uname(2) System Calls Manual uname(2)Name
uname - get name of current system
Syntax
#include <limits.h>
#include <sys/utsname.h>
int uname (name)
struct utsname *name;
Description
The system call stores information identifying the current system in the structure pointed to by name.
The system call uses the structure defined in whose members are:
char sysname[SYS_NMLN];
char nodename[SYS_NMLN];
char release[SYS_NMLN];
char version[SYS_NMLN];
char machine[SYS_NMLN];
The constant SYS_NMLN is defined in
The system call returns a null-terminated character string naming the current ULTRIX system in the character array, sysname. Similarly,
nodename contains the name that the system is known by on a communications network. The release and version further identify the operating
system. The machine contains a standard name that identifies the hardware that the ULTRIX system is running on.
Return Values
Upon successful completion, a nonnegative value is returned. Otherwise, -1 is returned, and errno is set to indicate the error.
Diagnostics
[EFAULT] The system call fails if name points to an invalid address.
uname(2)
Check Out this Related Man Page
uname(2) System Calls uname(2)NAME
uname - get name of current operating system
SYNOPSIS
#include <sys/utsname.h>
int uname(struct utsname *name);
DESCRIPTION
The uname() function stores information identifying the current operating system in the structure pointed to by name.
The uname() function uses the utsname structure, defined in <sys/utsname.h>, whose members include:
char sysname[SYS_NMLN];
char nodename[SYS_NMLN];
char release[SYS_NMLN];
char version[SYS_NMLN];
char machine[SYS_NMLN];
The uname() function returns a null-terminated character string naming the current operating system in the character array sysname. Simi-
larly, the nodename member contains the name by which the system is known on a communications network. The release and version members fur-
ther identify the operating system. The machine member contains a standard name that identifies the hardware on which the operating system
is running.
RETURN VALUES
Upon successful completion, a non-negative value is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The uname() function will fail if:
EFAULT The name argument points to an illegal address.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO uname(1), sysinfo(2), sysconf(3C), attributes(5), standards(5)SunOS 5.11 21 Jul 1999 uname(2)
I am extremely new here. Someone wants to upgrade off of Unix to Windows 2000 and wants to know if they need to buy new hardware
How do I find out what type of Unix they're using?
How do I find out the current hardware of the system? (Intel, ..etc)
Thanks (3 Replies)
i am telnet-ing into my university's UNIX system and trying to edit some perl code in emacs. However any time i try to open it in emacs i get the following error message:
> emacs project1.cgi
Error: Couldn't find per display information
>
i also cannot create any new documents in emacs and... (7 Replies)
Discussion started by: jeffro
7 Replies
3. Post Here to Contact Site Administrators and Moderators
I have seen quite a few posts recently which have launched into questions about specfic errors whose resolution depends a lot upon the OS type and version.
I suggest that in the FAQ an additional entry be included, either under general board usage or posting threads, that informs the user to... (6 Replies)
SCO 5.06
Someone broke into my NT box (grrr) and somehow, they created a bunch of directories w/ subdirectories that appear un-named.
I mounted the drive on my unix box using NFS and when I listed the directory in unix, Im getting a bunch of ascii charachters.
drwxr-xr-x 8 root group... (4 Replies)
Hi !
I heard that root can modify the uname -command, so it will show the wrong kernel version.
Is it true? can you tell more about this /give links ?
system: linux/*bsd.
thanks in advance (14 Replies)
Hi guys,
I am trying to do a ssh for performing a set of actions.
Find it below:
I need to put the user/ kernel/ DISTRO variables before I complete this operation.
what I observed is when ever I put a `command` in those quotes, it performs thta action in local system rather than remote one.... (5 Replies)
hi freinds recently i have change hostname node as using uname -s ******* but next time i saw the name using uname -n the name did t changed is that i have to reboot the system (4 Replies)
hi all,
Operating System Name : Unix Sun Solaris
Operating system release level : 5.10
Operating system version : Generic_137111-06
i know the release level that is kernel version
Generic_137111-06 what is number... (6 Replies)
Hello,
I'm writing some bash scripts and I'm trying to get an echo command and the output of another command to display on the same line. For example:
I want to run
echo "Operating System: " unameand have it displayed as
Operating System: Darwin
Thanks for your help! (7 Replies)
Using the command :
echo $eup_terminal_code | tr -s 'mil vrn qcm' 'mci pql qcm'
it works,but this translation changes depending on the system.
I'd like to define the following variables ,one for each system :
mil22h_from='mil vrn frl'
mil22h_to='mci vci fci'
... (4 Replies)
Hi all,
I am ssh'ed into a cluster and want to install a package. However, I don't know which type to chose (CentOS, Fedora, OpenSuSE are some of the options).
I ran called uname with various arguments but none are specific...
$ uname -n
resolute.research...
$ uname -i
x86_64
$ uname... (6 Replies)
awk '{if ($1 == "State:" && $2 == "Okay") {print system("uname -n")}}'
---------- Post updated at 01:20 AM ---------- Previous update was at 01:19 AM ----------
it is printing uname -n instead of printing the output of the command (8 Replies)
Can anyone please let me know the meaning of output of uname -a ?
I am totally new to unix or linux and just thinking to start learning.
When I run uname -a the output I get is -
"Linux blx28ap01 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux"
I want to... (7 Replies)
Hi all,
In Unix shell script i am connecting to oracle database and it is executing fine,
my problem is my user name and password is visible for all, how to hide.
Note -- username and password is hard coded, it is my requirement
example--
#!/bin/sh
------
------
sqlplus uname/pwd... (4 Replies)