.TH UNAME 2 .SH NAME uname, sysuname \- get or set system info .SH SYNOPSIS .ft B .nf #include int uname(struct utsname *name) #include #define _MINIX_SOURCE 1 #include int sysuname(int \fIreq\fP, int \fIfield\fP, char *\fIvalue\fP, size_t \fIlen\fP) .fi .ft P .SH DESCRIPTION .B Uname() fills a struct utsname with system information. This structure is described in as follows: .PP .nf .ta +4n +6n +25n struct utsname { char sysname[15+1]; /* System name */ char nodename[255+1]; /* Node/Network name */ char release[15+1]; /* O.S. release */ char version[11+1]; /* O.S. version */ char machine[11+1]; /* Machine hardware */ /* Minix additions */ char arch[11+1]; /* Architecture */ char kernel[11+1]; /* Kernel architecture */ char hostname[15+1]; /* Hostname */ char bus[11+1]; /* Bus architecture */ }; .fi .PP The strings are always null terminated, and may be of a different length then shown here. The first five are required by \s-2POSIX\s+2, the last four are Minix specific. .PP .B Sysuname() up or downloads a single string from/to an array .I value of size .IR len . The .I req and .I field arguments are defined as follows: .PP .nf .ta +35n +8n /* req: Get or set a string. */ #define _UTS_GET 0 #define _UTS_SET 1 /* field: What field to get or set. */ #define _UTS_ARCH 0 #define _UTS_KERNEL 1 #define _UTS_MACHINE 2 #define _UTS_HOSTNAME 3 #define _UTS_NODENAME 4 #define _UTS_RELEASE 5 #define _UTS_VERSION 6 #define _UTS_SYSNAME 7 #define _UTS_BUS 8 #define _UTS_MAX 9 /* Number of strings. */ .fi .PP Only the super-user may use .B sysuname() to set values, and not even for all fields. .SH DIAGNOSTICS Both functions return -1 on error and set errno. .B Uname() returns 0 on success, .B sysuname() returns the number of bytes copied. You know that the receiving buffer is large enough if the return value is less than .I len or the result is null terminated. .SH "SEE ALSO" .BR uname (1). .SH AUTHOR Kees J. Bot (kjb@cs.vu.nl) .\" .\" $PchId: uname.2,v 1.4 1995/11/27 19:35:02 philip Exp $