sysinfo(2) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

sysinfo(2)

sysinfo(2)                       System Calls                       sysinfo(2)



NAME
       sysinfo - get and set system information strings

SYNOPSIS
       #include <sys/systeminfo.h>

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

DESCRIPTION
       The  sysinfo()  function  copies  information relating to the operating
       system on which the process is executing into the buffer pointed to  by
       buf. It can also set certain information where appropriate commands are
       available. The count parameter indicates the size of the buffer.


       The sysconf(3C) function provides  a  similar  class  of  configuration
       information, but returns an integer rather than a string.


       The values for command are as follows:

       SI_SYSNAME

           Copy  into  the  array  pointed  to by buf the string that would be
           returned by uname(2) in the sysname field. This is the name of  the
           implementation of the operating system, for example, SunOS.


       SI_HOSTNAME

           Copy  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. The hostname is the  name
           of this machine as a node in some network. Different networks might
           have different names for the node, but presenting the  nodename  to
           the  appropriate  network directory or name-to-address mapping ser‐
           vice should produce a transport end point address. The  name  might
           not  be fully qualified. Internet host names can be up to 256 bytes
           in length (plus the terminating null).


       SI_SET_HOSTNAME

           Copy 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_HOST‐
           NAME.  This  command  requires that {PRIV_SYS_ADMIN} is asserted in
           the effective set of the calling process.


       SI_RELEASE

           Copy into the array pointed to by buf  the  string  that  would  be
           returned by uname(2) in the release field, for example, 5.11.


       SI_VERSION

           Copy  into  the  array  pointed  to by buf the string that would be
           returned by uname(2) in the version field. The syntax and semantics
           of this string are defined by the system provider.


       SI_MACHINE

           Copy  into  the  array  pointed  to by buf the string that would be
           returned by uname(2) in the machine field, for  example,  sun4v  or
           i86pc.


       SI_ARCHITECTURE

           Copy into the array pointed to by buf a string describing the basic
           instruction set architecture of the current  system,  for  example,
           sparc  or i386. These names might not match predefined names in the
           C language compilation system.


       SI_ARCHITECTURE_64

           Copy into the array pointed to  by  buf  a  string  describing  the
           64-bit  instruction  set  architecture  of  the current system, for
           example, sparcv9 or amd64. These names might not  match  predefined
           names  in  the  C  language compilation system. This subcode is not
           recognized on systems that do not allow  a  64-bit  application  to
           run.


       SI_ARCHITECTURE_32

           Copy  into  the  array  pointed  to  by buf a string describing the
           32-bit instruction set architecture  of  the  current  system,  for
           example,  sparc  or  i386.  These  names might not match predefined
           names in the C language compilation system.


       SI_ARCHITECTURE_K

           Copy into the array pointed to by buf a string describing the  ker‐
           nel  instruction set architecture of the current system for example
           sparcv9 or i386. These names might not match  predefined  names  in
           the C language compilation system.


       SI_ARCHITECTURE_NATIVE

           Copy  into  the  array  pointed  to  by buf a string describing the
           native instruction set architecture  of  the  current  system,  for
           example sparc or i386. These names might not match predefined names
           in the C language compilation system.


       SI_ISALIST

           Copy 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 might  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  isal‐
           ist(7);  these  names  might not match predefined names or compiler
           options in the C language compilation system.

           This command parameter is obsolete and might be removed in a future
           release.  For recommended ways of identifying and using instruction
           set variants, see getisax(2), and the chapter Chapter 8, Capability
           Processing in Oracle Solaris 11.4 Linkers and Libraries Guide.


       SI_PLATFORM

           Copy into the array pointed to by buf a string describing the hard‐
           ware platform, for example, sun4v, or i86pc.


       SI_HW_PROVIDER

           Copies the name of the hardware manufacturer into the array pointed
           to by buf.


       SI_HW_SERIAL

           Copy  into  the array pointed to by buf a string which is the ASCII
           representation of the hardware-specific serial number of the physi‐
           cal machine on which the function is executed. This might be imple‐
           mented in Read-Only  Memory,  using  software  constants  set  when
           building the operating system, or by other means, and might contain
           non-numeric characters. If the function is executed within  a  non-
           global  zone that emulates a host identifier, then the ASCII repre‐
           sentation of the zone's host identifier is copied  into  the  array
           pointed  to  by  buf. 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
           not guaranteed to be unique across all  vendor's  SVR4  implementa‐
           tions and could change over the lifetime of a given system.


       SI_SRPC_DOMAIN

           Copies  the Secure Remote Procedure Call domain name into the array
           pointed to by buf.


       SI_SET_SRPC_DOMAIN

           Set the string to be returned by sysinfo() with the  SI_SRPC_DOMAIN
           command to the value contained in the array pointed to by buf. This
           command requires that {PRIV_SYS_ADMIN} is asserted in the effective
           set of the calling process.


       SI_DHCP_CACHE

           Copy into the array pointed to by buf an ASCII string consisting of
           the ASCII hexadecimal encoding of the name of the interface config‐
           ured by boot(8) followed by the DHCPACK reply from the server. This
           command is intended for use only by the  dhcpagent(8)  DHCP  client
           daemon  for  the  purpose  of  adopting the DHCP maintenance of the
           interface configured by boot.


       SI_CPUBRAND

           Copy into the array pointed to by buf, a string that represents the
           type  of processor chips present in the system, such as SPARC-M7 or
           Intel(r) Xeon(r) CPU W3570.  This  is  same  as  the  brand  string
           exported  by  the cpu_info kstat and it changes when the underlying
           hardware changes.


RETURN VALUES
       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, −1 is returned and errno is set to indicate the error.

ERRORS
       The sysinfo() function will fail if:

       EFAULT    The buf argument does not point to a valid address.


       EINVAL    The  count  argument  for a non-SET command is less than 0 or
                 the data for a SET command exceeds the limits established  by
                 the implementation.


       EPERM     The {PRIV_SYS_ADMIN} was not asserted in the effective set of
                 the calling process.


USAGE
       In many cases there is no corresponding programming  interface  to  set
       these  values;  such  strings are typically settable only by the system
       administrator modifying entries in /etc/system or the code provided  by
       the  particular  OEM  reading  a serial number or code out of read-only
       memory, or hard-coded in the version of the operating system.


       A good estimation for count is  257,  which  is  likely  to  cover  all
       strings returned by this interface in typical installations.

SEE ALSO
       getisax(2),   uname(2),  gethostid(3C),  gethostname(3C),  sysconf(3C),
       isalist(7),  privileges(7),  standards(7),  zones(7),  boot(8),  dhcpa‐
       gent(8)


       Oracle Solaris 11.4 Linkers and Libraries Guide



Oracle Solaris 11.4               4 May 2020                        sysinfo(2)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3