1UNAME(3P)                  POSIX Programmer's Manual                 UNAME(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       uname - get the name of the current system
13

SYNOPSIS

15       #include <sys/utsname.h>
16
17       int uname(struct utsname *name);
18
19

DESCRIPTION

21       The uname() function shall store information  identifying  the  current
22       system in the structure pointed to by name.
23
24       The   uname()   function   uses   the   utsname  structure  defined  in
25       <sys/utsname.h>.
26
27       The uname() function shall return a string naming the current system in
28       the character array sysname. Similarly, nodename shall contain the name
29       of this node within an implementation-defined  communications  network.
30       The  arrays  release  and  version shall further identify the operating
31       system. The array machine shall contain  a  name  that  identifies  the
32       hardware that the system is running on.
33
34       The format of each member is implementation-defined.
35

RETURN VALUE

37       Upon  successful  completion,  a  non-negative value shall be returned.
38       Otherwise, -1 shall be returned and errno set to indicate the error.
39

ERRORS

41       No errors are defined.
42
43       The following sections are informative.
44

EXAMPLES

46       None.
47

APPLICATION USAGE

49       The inclusion of the nodename member in this structure does  not  imply
50       that  it  is  sufficient  information for interfacing to communications
51       networks.
52

RATIONALE

54       The values of the structure members are not  constrained  to  have  any
55       relation  to  the version of this volume of IEEE Std 1003.1-2001 imple‐
56       mented in the operating system. An application should instead depend on
57       _POSIX_VERSION and related constants defined in <unistd.h>.
58
59       This  volume  of  IEEE Std 1003.1-2001 does not define the sizes of the
60       members of the structure and permits them to  be  of  different  sizes,
61       although  most  implementations  define  them  all to be the same size:
62       eight bytes plus one byte for the  string  terminator.  That  size  for
63       nodename is not enough for use with many networks.
64
65       The  uname()  function  originated in System III, System V, and related
66       implementations, and it does not exist in Version 7  or  4.3  BSD.  The
67       values  it  returns  are set at system compile time in those historical
68       implementations.
69
70       4.3 BSD has gethostname() and gethostid(), which return a symbolic name
71       and  a numeric value, respectively. There are related sethostname() and
72       sethostid() functions that are used to set the  values  the  other  two
73       functions  return. The former functions are included in this specifica‐
74       tion, the latter are not.
75

FUTURE DIRECTIONS

77       None.
78

SEE ALSO

80       The Base Definitions volume of IEEE Std 1003.1-2001, <sys/utsname.h>
81
83       Portions of this text are reprinted and reproduced in  electronic  form
84       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
85       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
86       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
87       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
88       event of any discrepancy between this version and the original IEEE and
89       The Open Group Standard, the original IEEE and The Open Group  Standard
90       is  the  referee document. The original Standard can be obtained online
91       at http://www.opengroup.org/unix/online.html .
92
93
94
95IEEE/The Open Group                  2003                            UNAME(3P)
Impressum