1uname(2)                         System Calls                         uname(2)
2
3
4

NAME

6       uname - get name of current operating system
7

SYNOPSIS

9       #include <sys/utsname.h>
10
11       int uname(struct utsname *name);
12
13

DESCRIPTION

15       The uname() function stores information identifying the current operat‐
16       ing system in the structure pointed to by name.
17
18
19       The  uname()  function  uses  the   utsname   structure,   defined   in
20       <sys/utsname.h>, whose members include:
21
22         char    sysname[SYS_NMLN];
23         char    nodename[SYS_NMLN];
24         char    release[SYS_NMLN];
25         char    version[SYS_NMLN];
26         char    machine[SYS_NMLN];
27
28
29
30       The  uname() function returns a null-terminated character string naming
31       the current operating system in the character array sysname. Similarly,
32       the nodename member contains the name by which the system is known on a
33       communications network. The release and version members  further  iden‐
34       tify  the operating system. The machine member contains a standard name
35       that identifies the hardware on which the operating system is running.
36

RETURN VALUES

38       Upon successful completion, a non-negative value  is  returned.  Other‐
39       wise, −1 is returned and errno is set to indicate the error.
40

ERRORS

42       The uname() function will fail if:
43
44       EFAULT    The name argument points to an illegal address.
45
46

ATTRIBUTES

48       See attributes(5) for descriptions of the following attributes:
49
50
51
52
53       ┌─────────────────────────────┬─────────────────────────────┐
54       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
55       ├─────────────────────────────┼─────────────────────────────┤
56       │Interface Stability          │Standard                     │
57       ├─────────────────────────────┼─────────────────────────────┤
58       │MT-Level                     │Async-Signal-Safe            │
59       └─────────────────────────────┴─────────────────────────────┘
60

SEE ALSO

62       uname(1), sysinfo(2), sysconf(3C), attributes(5), standards(5)
63
64
65
66SunOS 5.11                        21 Jul 1999                         uname(2)
Impressum