sysinfo - manages system information strings
#include <sys/systeminfo.h>
long sysinfo(
int command,
char *buf,
long count );
Specifies the commands that manage the system information
strings. They are described in the Available Commands section.
Specifies the buffer used for the storage of system
information. Specifies the size of the buffer pointed to
by the buf parameter.
The sysinfo function retrieves and sets information relating
to the operating system into a buffer pointed to by
the buf parameter. This function is similar to the
sysconf function which returns an integer instead of a
string.
Available Commands [Toc] [Back]
This section describes the commands that may be specified
with the command parameter. The commands allow you to set
certain attributes and they are listed in alphabetical
order: Copies a string into the specified buffer that
describes the instruction set of the current system's
architecture. These names cannot conflict with predefined
names in the C language compilation system. Copies a
string into the specified buffer that represents the name
of the present host machine. This is the same string that
would be returned by the uname function in the nodename
field. The name is typically the hostname or nodename that
the machine is recognized by locally.
The hostname is the name of the target machine as
it is used in a network. Although the hostname may
differ on various networks, the nodename that is
presented 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 can be up to 256 bytes in
length including the terminating null. Copies a
string into the specified buffer that represents
the name of the hardware manufacturer. This command
is not supported in this implementation of the
operating system. Copies a string into the specified
buffer the ASCII representation of the hardware-specific
serial number of the machine that
executed the function call. This can be initiated
in Read Only Memory through the software constants
set when the machine is built. The string can contain
non-numeric characters. This command is not
supported in this implementation of the operating
system. Copies a string into the specified buffer
that represents the name of the machine. This is
the same string that would be returned by the uname
function in the machine field. Copies a string
into the specified buffer that represents the name
of the release. This is the same string that would
be returned by the uname function in the release
field. Copies the null-terminated contents of the
specified buffer into the string that is maintained
by the kernel. This value will be returned by successive
calls to the sysinfo function when used
with the SI_HOSTNAME command. Superuser privileges
are required to perform this action. Specifies
that the string returned by the sysinfo function
using the SI_SRPC_DOMAIN command is to be set to
the value of the array pointed to by the buf parameter.
This command is not supported in this implementation
of the operating system. The command
SI_SET_SYSNAME sets the system name. Copies the
Secure Remote Procedure Call command name into the
specified buffer. This command is not supported in
this implementation of the operating system.
Copies a string into the specified buffer the value
that would be returned by the uname function in the
sysname field. This is the name of the implementation
of the operating system.
Two commands, SI_SRPC_DOMAIN and SI_SET_SRPC_DOMAIN, are
not currently supported. If either of these commands is
specified, a value of -1 is returned and errno is set.
On success, the return value specifies the size in bytes
required for the buffer to hold the value and terminating
character of the string. If this value does not exceed the
value specified in the count parameter, the string is
copied. If this value exceeds the value specified by the
count parameter, the string that is copied to the specified
buffer is truncated to the count-1 bytes and a terminating
character.
If an error is encountered, a value of -1 is returned and
errno is set to indicate the error.
Specifies that the buf parameter does not point to a valid
address, or that the data for a SET command is not allowed
in this implementation. Specifies that an invalid command
was specified. See the RESTRICTIONS section. Specifies
that the process does not have the appropriate privileges
for a SET command.
Functions: getrlimit(2), setrlimit(2), sysconf(3),
uname(2)
sysinfo(2)
[ Back ] |