HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
s
sysconf(2) sysconf(2)
Return Value Instruction Supported
HARITH Halfword parallel add, subtract, and average
HSHIFT Halfword parallel shift-and-add
The format of the value returned by sysconf(_SC_LIBC_VERSION) is as follows:
XXyyZZZZqN
where
XX HP-UX major release number
yy HP-UX minor release number
ZZZZ Library specific number
q 0=32PA 1=64PA 2=32EM 3=64EM 4-9=Reserved
N 0 = archive library
1-9 = System V version of shared library
RETURN VALUE
Upon successful completion, sysconf() returns the value of the named variable. If the value of name is
not valid,
sysconf() returns −1 and sets errno
to indicate the error. If the variable corresponding to
name is not defined,
sysconf() returns −1, but does not change errno.
CPU_IS_PA_RISC() returns positive nonzero if cpuvers is an HP PA-RISC processor; zero if not.
ERRORS
If
sysconf() fails, the value of errno (see errno(2)) is set to:
[EINVAL] The value of name is not valid.
EXAMPLES
The following example determines the number of times the system clock ticks each second:
#include <unistd.h>
long ticks;
...
ticks = sysconf(_SC_CLK_TCK);
The following example determines if the current processor is an HP PA-RISC machine:
#include <unistd.h>
if (CPU_IS_PA_RISC(sysconf(_SC_CPU_VERSION)))
...
WARNINGS
CPU_IS_PA_RISC() is implemented as a macro.
Normally, the values returned from sysconf() do not change during the lifetime of the calling process.
However, the value of the symbolic constant _POSIX_VERSION
and thus the value of
sysconf(_SC_VERSION)
can vary under certain circumstances. If either of the feature test macros
_POSIX1_1988 or _XPG3 is defined by the programmer prior to including <unistd.h> , the value of
_POSIX_VERSION is defined as
198808, in conformance with POSIX.1-1988, FIPS 151-1, and XPG3.
Otherwise, the value of
_POSIX_VERSION
is defined as 199009, in conformance with POSIX.1-1990.
Similarly, the value of the symbolic constant
_XOPEN_VERSION and thus the value of
sysconf(_SC_XOPEN_VERSION) can vary under certain circumstances. If the feature test macro
_XPG3 is defined by the programmer prior to including <unistd.h> , the value of _XOPEN_VERSION
is defined as 3, in conformance with XPG3. Otherwise, the value of _XOPEN_VERSION is defined as 4
,in
conformance with XPG4.
See stdsyms(5) for more information about these feature test macros.
Any application that has a dependency on libdld.sl is a potential user of both archived and shared libc.
Applications that comprise both archived and shared components where
sysconf(_SC_LIBC_VERSION)
may be invoked from both the archived and shared components may
get inconsistent return values from
sysconf().
HP-UX Release 11i: December 2000 − 6 − Section 2−−401
___
___