Linux and Unix sysinfo command

Quick links

About sysinfo
Syntax
Related commands
Linux and Unix main page

About sysinfo

Get and set system information strings.

Syntax

#include <sys/systeminfo.h>

long sysinfo(int command, char *buf, long count);

The available commands are:

SI_SYSNAMECopy into the array pointed to by buf the string that would be returned by uname in the sysname field. This is the name of the implementation of the operating system, for example, SunOS or UTS.
SI_HOSTNAMECopy 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 in the nodename field. This hostname or nodename is often the name the machine is known by locally.
SI_SET_HOSTNAMECopy 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 SI_HOSTNAME. This command requires that the effective-user-id be super-user.
SI_RELEASECopy into the array pointed to by buf the string that would be returned by
SI_VERSIONCopy into the array pointed to by buf the string that would be returned by uname in the version field. The syntax and semantics of this string are defined by the system provider.
SI_MACHINECopy into the array pointed to by buf the string that would be returned by uname in the machine field, for example, sun4c, sun4d, or sun4m.
SI_ARCHITECTURECopy into the array pointed to by buf a string describing the basic instruction set architecture of the current system, for example, sparc, mc68030, m32100, or i386. These names may not match predefined names in the C language compilation system.
SI_ISALISTCopy into the array pointed to by buf the names of the variant instruction set architectures executable on the current system.

The names are space-separated and are ordered in the sense of best performance. That is, earlier named instruction sets may contain more instructions than later-named instruction sets; a program that is compiled for an earlier-named instruction set will most likely run faster on this machine than the same program compiled for a later-named instruction set.

Programs compiled for an instruction set that does not appear in the list will most likely experience performance degradation or not run at all on this machine.

The instruction set names known to the system are listed in isalist; these names may or may not match predefined names or compiler options in the C language compilation system.

SI_PLATFORMCopy into the array pointed to by buf a string describing the specific model of the hardware platform, for example, SUNW,Sun_4_75, SUNW,SPARCsystem-600, or i86pc.
SI_HW_PROVIDERCopies the name of the hardware manufacturer into the array pointed to by buf.
SI_HW_SERIALCopy 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 function is executed. Note that this may be implemented in Read-Only Memory, using software constants set when building the operating system, or by other means, and may contain non-numeric characters. It is anticipated that manufacturers will not issue the same "serial number" to more than one physical machine. The pair of strings returned by SI_HW_PROVIDER and SI_HW_SERIAL is likely to be unique across all vendor's SVR4 implementations.
SI_SRPC_DOMAINCopies the Secure Remote Procedure Call domain name into the array pointed to by buf.

Related commands

sysklogd
uname