sysinfo(2) sysinfo(2)
NAME
sysinfo - get and set system information
SYNOPSIS
#include <sys/systeminfo.h>
long sysinfo (int command, char *buf, long count);
DESCRIPTION
sysinfo() copies information relating to the Reliant UNIX system on
which the process is executing into the buffer pointed to by buf;
sysinfo() can also set certain information where appropriate commands
are available. count is the size of the buffer.
The commands arguments which can be used are:
SISYSNAME Copies into the array pointed to by buf the string
that would be returned by uname [see uname(2)] in
the sysname field. This is the name of the imple-
mentation of the operating system, e.g., System V
or UTS.
SIHOSTNAME Copies into the array pointed to by buf a string
that names the present host machine. This is the
string that would be returned by uname [see
uname(2)] in the nodename field. This host name or
nodename is often the name the machine is known by
locally.
The host name is the name of this machine as a node
in some network; different networks may have dif-
ferent names for the node, but presenting the
nodename to the appropriate network directory or
name-to-address mapping service should produce a
transport end point address. The name may not be
fully qualified.
Internet host names may be up to 256 bytes in
length (plus the terminating null).
SISETHOSTNAME Copies the null-terminated contents of the array
pointed to by buf into the string maintained by the
kernel whose value will be returned by succeeding
calls to sysinfo() with the command SIHOSTNAME.
This command requires that the effective-user-id be
superuser.
SIRELEASE Copies into the array pointed to by buf the string
that would be returned by uname [see uname(2)] in
the release field. Typical values might be 4.0 or
3.2.
Page 1 Reliant UNIX 5.44 Printed 11/98
sysinfo(2) sysinfo(2)
SIVERSION Copies into the array pointed to by buf the string
that would be returned by uname [see uname(2)] in
the version field. The syntax and semantics of this
string are defined by the system provider.
SIMACHINE Copies into the array pointed to by buf the string
that would be returned by uname [see uname(2)] in
the machine field (e.g. 3b2 or 580).
SIARCHITECTURE Copies into the array pointed to by buf a string
describing the instruction set architecture of the
current system, e.g., mc68030, m32100, or i80486.
These names may not match predefined names in the C
language compilation system.
SIHWPROVIDER Copies the name of the hardware manufacturer into
the array pointed to by buf.
SIHWSERIAL Copies into the array pointed to by buf a string
which is the ASCII representation of the hardware-
specific serial number of the physical machine on
which the system call is executed. Note that this
may be implemented in Read-Only Memory, via
software constants set when building the operating
system, or by other means, and may contain non-
numeric characters. It is anticipated that manufac-
turers will not issue the same "serial number" to
more than one physical machine.
SISRPCDOMAIN Copies the Secure Remote Procedure Call domain name
into the array pointed to by buf.
SISETSRPCDOMAIN Sets the string to be returned by sysinfo() with
the SISRPCDOMAIN command to the buf array. This
command requires that the effective user id be
superuser.
sysinfo() will fail if one or both of the following apply:
EPERM The process does not have appropriate privilege for a SET
commands.
EINVAL buf does not point to a valid address, or the data for a SET
command exceeds the limits established by the implementation.
There is in many cases no corresponding programmatic interface to set
these values; such strings are typically settable only by the
superuser modifying entries in the master.d directory or the code pro-
vided by the particular OEM reading a serial number or code out of
read-only memory, or hard-coded in the version of the operating sys-
tem.
Page 2 Reliant UNIX 5.44 Printed 11/98
sysinfo(2) sysinfo(2)
A good starting guess for count is 257, which is likely to cover all
strings returned by this interface in typical installations.
RESULT
Upon successful completion, the value returned indicates the buffer
size in bytes required to hold the complete value and the terminating
null character. If this value is no greater than the value passed in
count, the entire string was copied; if this value is greater than
count, the string copied into buf has been truncated to count-1 bytes
plus a terminating null character.
Otherwise, a value of -1 is returned and errno is set to indicate the
error.
SEE ALSO
uname(2), sysconf(3C).
Page 3 Reliant UNIX 5.44 Printed 11/98