Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man2/sysinfo.2
Real path: /usr/share/man/man2/sysinfo.2
Zurück
'\" te .\" Portions Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1989, AT&T. All rights reserved. .TH sysinfo 2 "4 May 2020" "Oracle Solaris 11.4" "System Calls" .SH NAME sysinfo \- get and set system information strings .SH SYNOPSIS .LP .nf #include <sys/systeminfo.h> \fBint\fR \fBsysinfo\fR(\fBint\fR \fIcommand\fR, \fBchar *\fR\fIbuf\fR, \fBlong\fR \fIcount\fR); .fi .SH DESCRIPTION .sp .LP The \fBsysinfo()\fR function copies information relating to the operating system on which the process is executing into the buffer pointed to by \fIbuf\fR. It can also set certain information where appropriate commands are available. The \fIcount\fR parameter indicates the size of the buffer. .sp .LP The \fBsysconf\fR(3C) function provides a similar class of configuration information, but returns an integer rather than a string. .sp .LP The values for \fIcommand\fR are as follows: .sp .ne 2 .mk .na \fB\fBSI_SYSNAME\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR the string that would be returned by \fBuname\fR(2) in the \fIsysname\fR field. This is the name of the implementation of the operating system, for example, \fBSunOS\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_HOSTNAME\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string that names the present host machine. This is the string that would be returned by \fBuname()\fR in the \fInodename\fR field. This hostname or nodename is often the name the machine is known by locally. The \fIhostname\fR 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 service should produce a transport end point address. The name might not be fully qualified. Internet host names can be up to \fB256\fR bytes in length (plus the terminating null). .RE .sp .ne 2 .mk .na \fB\fBSI_SET_HOSTNAME\fR\fR .ad .br .sp .6 .RS 4n Copy the null-terminated contents of the array pointed to by \fIbuf\fR into the string maintained by the kernel whose value will be returned by succeeding calls to \fBsysinfo()\fR with the command \fBSI_HOSTNAME\fR. This command requires that {\fBPRIV_SYS_ADMIN\fR} is asserted in the effective set of the calling process. .RE .sp .ne 2 .mk .na \fB\fBSI_RELEASE\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR the string that would be returned by \fBuname\fR(2) in the \fIrelease\fR field, for example, \fB5.11\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_VERSION\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR the string that would be returned by \fBuname\fR(2) in the \fIversion\fR field. The syntax and semantics of this string are defined by the system provider. .RE .sp .ne 2 .mk .na \fB\fBSI_MACHINE\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR the string that would be returned by \fBuname\fR(2) in the \fImachine\fR field, for example, \fBsun4v\fR or \fBi86pc\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_ARCHITECTURE\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the basic instruction set architecture of the current system, for example, \fBsparc\fR or \fBi386\fR. These names might not match predefined names in the C language compilation system. .RE .sp .ne 2 .mk .na \fB\fBSI_ARCHITECTURE_64\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the 64-bit instruction set architecture of the current system, for example, \fBsparcv9\fR or \fBamd64\fR. 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. .RE .sp .ne 2 .mk .na \fB\fBSI_ARCHITECTURE_32\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the 32-bit instruction set architecture of the current system, for example, \fBsparc\fR or \fBi386\fR. These names might not match predefined names in the C language compilation system. .RE .sp .ne 2 .mk .na \fB\fBSI_ARCHITECTURE_K\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the kernel instruction set architecture of the current system for example \fBsparcv9\fR or \fBi386\fR. These names might not match predefined names in the C language compilation system. .RE .sp .ne 2 .mk .na \fB\fBSI_ARCHITECTURE_NATIVE\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the native instruction set architecture of the current system, for example \fBsparc\fR or \fBi386\fR. These names might not match predefined names in the C language compilation system. .RE .sp .ne 2 .mk .na \fB\fBSI_ISALIST\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR the names of the variant instruction set architectures executable on the current system. .sp 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. .sp 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. .sp The instruction set names known to the system are listed in \fBisalist\fR(7); these names might not match predefined names or compiler options in the C language compilation system. .sp This command parameter is obsolete and might be removed in a future release. For recommended ways of identifying and using instruction set variants, see \fBgetisax\fR(2), and the chapter Chapter 8, \fICapability Processing\fR in \fIOracle Solaris 11.4 Linkers and Libraries Guide\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_PLATFORM\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string describing the hardware platform, for example, \fBsun4v\fR, or \fBi86pc\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_HW_PROVIDER\fR\fR .ad .br .sp .6 .RS 4n Copies the name of the hardware manufacturer into the array pointed to by \fIbuf\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_HW_SERIAL\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR a string which is the ASCII representation of the hardware-specific serial number of the physical machine on which the function is executed. This might be implemented 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 representation of the zone's host identifier is copied into the array pointed to by \fIbuf\fR. It is anticipated that manufacturers will not issue the same "serial number" to more than one physical machine. The pair of strings returned by \fBSI_HW_PROVIDER\fR and \fBSI_HW_SERIAL\fR is not guaranteed to be unique across all vendor's SVR4 implementations and could change over the lifetime of a given system. .RE .sp .ne 2 .mk .na \fB\fBSI_SRPC_DOMAIN\fR\fR .ad .br .sp .6 .RS 4n Copies the Secure Remote Procedure Call domain name into the array pointed to by \fIbuf\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_SET_SRPC_DOMAIN\fR\fR .ad .br .sp .6 .RS 4n Set the string to be returned by \fBsysinfo()\fR with the \fBSI_SRPC_DOMAIN\fR command to the value contained in the array pointed to by \fIbuf\fR. This command requires that {\fBPRIV_SYS_ADMIN\fR} is asserted in the effective set of the calling process. .RE .sp .ne 2 .mk .na \fB\fBSI_DHCP_CACHE\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR an ASCII string consisting of the ASCII hexadecimal encoding of the name of the interface configured by \fBboot\fR(8) followed by the DHCPACK reply from the server. This command is intended for use only by the \fBdhcpagent\fR(8) DHCP client daemon for the purpose of adopting the DHCP maintenance of the interface configured by \fBboot\fR. .RE .sp .ne 2 .mk .na \fB\fBSI_CPUBRAND\fR\fR .ad .br .sp .6 .RS 4n Copy into the array pointed to by \fIbuf\fR, a string that represents the type of processor chips present in the system, such as \fBSPARC-M7\fR or \fBIntel(r) Xeon(r) CPU W3570\fR. This is same as the brand string exported by the \fBcpu_info\fR kstat and it changes when the underlying hardware changes. .RE .SH RETURN VALUES .sp .LP 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 \fIcount\fR, the entire string was copied. If this value is greater than \fIcount\fR, the string copied into \fIbuf\fR has been truncated to \fIcount\fR\(mi1 bytes plus a terminating null character. .sp .LP Otherwise, \(mi1 is returned and \fBerrno\fR is set to indicate the error. .SH ERRORS .sp .LP The \fBsysinfo()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fIbuf\fR argument does not point to a valid address. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIcount\fR argument for a non-SET command is less than 0 or the data for a SET command exceeds the limits established by the implementation. .RE .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 10n .rt The {\fBPRIV_SYS_ADMIN\fR} was not asserted in the effective set of the calling process. .RE .SH USAGE .sp .LP 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 \fB/etc/system\fR 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. .sp .LP A good estimation for \fIcount\fR is 257, which is likely to cover all strings returned by this interface in typical installations. .SH SEE ALSO .sp .LP \fBgetisax\fR(2), \fBuname\fR(2), \fBgethostid\fR(3C), \fBgethostname\fR(3C), \fBsysconf\fR(3C), \fBisalist\fR(7), \fBprivileges\fR(7), \fBstandards\fR(7), \fBzones\fR(7), \fBboot\fR(8), \fBdhcpagent\fR(8) .sp .LP \fIOracle Solaris 11.4 Linkers and Libraries Guide\fR