Index Index for
Section 2
Index Alphabetical
listing for S
Bottom of page Bottom of
page

sysinfo(2)

NAME

sysinfo - manages system information strings

SYNOPSIS

#include <sys/systeminfo.h> long sysinfo( int command, char *buf, long count );

PARAMETERS

command Specifies the commands that manage the system information strings. They are described in the Available Commands section. buf Specifies the buffer used for the storage of system information. count Specifies the size of the buffer pointed to by the buf parameter.

DESCRIPTION

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 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: SI_ARCHITECTURE 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. SI_HOSTNAME 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. SI_HW_PROVIDER 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. SI_HW_SERIAL 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. SI_MACHINE 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. SI_RELEASE 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. SI_SET_HOSTNAME 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. SI_SET_SRPC_DOMAIN 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. SI_SET_SYSNAME The command SI_SET_SYSNAME sets the system name. SI_SRPC_DOMAIN Copies the Secure Remote Procedure Call command name into the specified buffer. This command is not supported in this implementation of the operating system. SI_SYSNAME 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.

RESTRICTIONS

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.

RETURN VALUES

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.

ERRORS

[EINVAL] 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. [ENOSYS] Specifies that an invalid command was specified. See the RESTRICTIONS section. [EPERM] Specifies that the process does not have the appropriate privileges for a SET command.

SEE ALSO

Functions: getrlimit(2), setrlimit(2), sysconf(3), uname(2)

Index Index for
Section 2
Index Alphabetical
listing for S
Top of page Top of
page