unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Page:
Section:
Apropos / Subsearch:
optional field



 uname(2)							    uname(2)




 NAME
      uname(), setuname() - get information about computer system; set node
      name (system name)

 SYNOPSIS
      #include <&lt&lt&lt;sys/utsname.h>&gt&gt&gt;

      int uname(struct utsname *name);

      int setuname(const char *name, size_t namelen);

 DESCRIPTION
    uname()
      The uname() system call places information identifying the computer
      system in the utsname structure pointed to by name.

      The utsname structure, defined in <&lt&lt&lt;sys/utsname.h>&gt&gt&gt;, is set up as
      follows:

	   #define UTSLEN  9
	   #define SNLEN  15

	   char sysname[UTSLEN];
	   char nodename[UTSLEN];
	   char release[UTSLEN];
	   char version[UTSLEN];
	   char machine[UTSLEN];
	   char idnumber[SNLEN];

      Each field is a null-terminated string.

      The sysname field contains the name of the operating system, HP-UX on
      standard HP-UX systems.

      The nodename field contains the name by which the computer system is
      known in a communications network.

      The release field contains the release identifier of the operating
      system, such as A.09.01.

      The version field contains additional information about the operating
      system.  This value can change in future releases.  The first
      character of the version field identifies the license level:

	   A	Two-user system
	   B	16-user system
	   C	32-user system
	   D	64-user system
	   E	8-user system
	   U	128-user, 256-user, or unlimited-user system




 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000






 uname(2)							    uname(2)




      The machine field contains the hardware and model identifiers of the
      computer system.

      The idnumber field contains a unique identification number within that
      class of hardware, possibly a hardware or software serial number.
      This field contains a null string if there is no identification
      number.

    setuname()
      The setuname() system call sets the node name (system name), as
      returned in the nodename field of the utsname structure, to name,
      which has a length of namelen characters.	 This is usually executed by
      /sbin/init.d/hostname at system boot time.  Names are limited to
      UTSLEN - 1 characters; UTSLEN is defined in <&lt&lt&lt;sys/utsname.h>&gt&gt&gt;.

 RETURN VALUE
      uname() and setuname() return the following values:

	    n	Successful completion.	n is a nonnegative value.
	   -1	Failure.  errno is set to indicate the error.

 ERRORS
      If uname() or setuname() fails, errno is set to one of the following
      values.

      [EFAULT]	     name points to an illegal address.	 The reliable
		     detection of this error is implementation dependent.

      [EPERM]	     setuname() was attempted by a process lacking
		     appropriate privileges.

 AUTHOR
      uname() was developed by AT&T and HP.

 SEE ALSO
      hostname(1), uname(1), setuname(1M), gethostname(2), sethostname(2).

 STANDARDS CONFORMANCE
      uname(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1















 Hewlett-Packard Company	    - 2 -   HP-UX Release 11i: November 2000