Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S

sysconf(2)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

sysconf(), CPU_IS_PA_RISC() — get configurable system variables

SYNOPSIS

#include <unistd.h>

long sysconf(int name);

int CPU_IS_PA_RISC(long cpuvers);

DESCRIPTION

The sysconf() system call provides a way for applications to determine the current value of a configurable limit or variable.

The name argument represents the system variable being queried.

The following table lists the configuration variable name, the associated value for the name argument that is used in the sysconf() call and the value returned.

CPU_IS_PA_RISC() is described in the entry for CPU_VERSION.

Some of the variables in the table are defined as constants in <limits.h> (see limits(5)). The associated values of the name argument are defined in <unistd.h>.

__________________________________________________________________________________________________

Configuration Variable

(Value for name Argument)

Value Returned by sysconf()

__________________________________________________________________________________________________

AES_OS_VERSION

(_SC_AES_OS_VERSION)

Version number of OSF/AES OSC supported.

AIO_LISTIO_MAX

(_SC_AIO_LISTIO_MAX)

Maximum number of aio operations that can be specified in a lio_listio() call (see lio_listio(2)).

AIO_MAX

(_SC_AIO_MAX)

Maximum number of aio operations that can be queued at any time (see aio(5)).

AIO_PRIO_DELTA_MAX

(_SC_AIO_PRIO_DELTA_MAX

Maximum slowdown factor that can be specified in the aio_reqprio field of a aiocb structure (see aio(5)).

ARG_MAX

(_SC_ARG_MAX)

Maximum total length of the arguments for exec() in bytes, including environment data (see exec(2)).

ATEXIT_MAX

(_SC_ATEXIT_MAX)

Maximum number of functions that can be registered with atexit() (see atexit(3)).

BC_BASE_MAX

(_SC_BC_BASE_MAX)

Maximum ibase (input number radix) and obase (output number radix) allowed by bc (see bc(1)).

BC_DIM_MAX

(_SC_BC_DIM_MAX)

Maximum number of elements in an array permitted by bc (see bc(1)).

BC_SCALE_MAX

(_SC_BC_SCALE_MAX)

Maximum scale factor (number of digits to the right of the decimal point) allowed by bc (see bc(1)).

BC_STRING_MAX

(_SC_BC_STRING_MAX)

Maximum length of strings allowed by bc (see bc(1)).

CCNUMA_SUPPORT

(_SC_CCNUMA_SUPPORT)

Positive if the implementation supports multiple locality domains; -1 otherwise (see mpctl(2)).

CHILD_MAX

(_SC_CHILD_MAX)

Maximum number of simultaneous processes per user ID (see fork(2)).

CLK_TCK

(_SC_CLK_TCK)

Number of clock intervals per second for times() (see times(2)).

CLOCKS_PER_SEC

(_SC_CLOCKS_PER_SEC)

Number of clock ticks per second for clock() (see clock(3C)).

COLL_WEIGHTS_MAX

(_SC_COLL_WEIGHTS_MAX)

Maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in a localedef input file (see localedef(1M)).

CPU_CHIP_TYPE

(_SC_CPU_CHIP_TYPE)

Itanium®-based systems: CPUID Register 3 of the Itanium-based processor identification registers. See the Itanium-based architecture definition for this platform for the meaning of each bit.

CPU_KEYBITS1

(_SC_CPU_KEYBITS1)

Itanium-based systems: CPUID Register 4 of the Itanium-based processor identification registers. See the Itanium-based architecture definition for this platform for the meaning of each bit.

PA-RISC: Processor Extensions. The availability of architecture specific instructions is indicated by the key bit data returned by sysconf(_SC_CPU_KEYBITS1). Upon successful completion, the data returned will be the logical OR of the defined values for the features supported.

The possible values returned by sysconf(_SC_CPU_KEYBITS1) and their meanings for PA-RISC platforms are shown in the following table.

Return Value

Instruction Supported

HARITH

Halfword parallel add, subtract, and average

HSHIFT

Halfword parallel shift-and-add

CPU_VERSION

(_SC_CPU_VERSION)

Version of CPU architecture.

The possible values of the CPU_VERSION variable returned by sysconf(_SC_CPU_VERSION) and their meanings are:

Value

Meaning

CPU_PA_RISC1_0

HP Precision Architecture RISC Version 1.0

CPU_PA_RISC1_1

HP Precision Architecture RISC Version 1.1

CPU_PA_RISC2_0

HP Precision Architecture RISC Version 2.0

CPU_IA64_ARCHREV_0

HP Itanium-based Architecture Version 0

The CPU_IS_PA_RISC() function classifies cpuvers, a value of the CPU_VERSION variable, as to its processor family.

DELAYTIMER_MAX

(_SC_DELAYTIMER_MAX)

Maximum timer overrun count.

EXPR_NEST_MAX

(_SC_EXPR_NEST_MAX)

Maximum parenthesis nesting level for expr expressions (see expr(1)).

GETGR_R_SIZE_MAX

(_SC_GETGR_R_SIZE_MAX)

Maximum getgrgid_r(), getgrnam_r() data buffer size.

GETPW_R_SIZE_MAX

(_SC_GETPW_R_SIZE_MAX)

Maximum getpwuid_r(), getpwnam_r() data buffer size.

HOST_NAME_MAX

(_SC_HOST_NAME_MAX)

Maximum length of a host name (not including the terminating null) (see gethostname(2)).

HT_CAPABLE

(_SC_HT_CAPABLE)

1

if the hardware is capable of HyperThreading.

0

if the hardware is not capable of HyperThreading. Note: The value returned may change during the lifetime of the calling process, if the system administrator changes the hardware configuration.

HT_ENABLED

(_SC_HT_ENABLED)

1

if the hardware is HyperThreading enabled and OS supports HyperThreading.

0

if the hardware is not HyperThreading enabled. Note: The value returned may change during the lifetime of the calling process, if the system administrator changes the hardware configuration.

HW_32_64_CAPABLE

(_SC_HW_32_64_CAPABLE)

Returns which kernel is supported on the hardware. The value returned is an encoding that may be interpreted using the _SYSTEM_SUPPORTS_ILP32OS() and _SYSTEM_SUPPORTS_LP64OS() macros defined in <unistd.h>.

For example:

long ret = sysconf(_SC_HW_32_64_CAPABLE); if (_SYSTEM_SUPPORTS_ILP32OS(ret) != 0) { /*system supports 32-bit OS*/ } if (_SYSTEM_SUPPORTS_LP64OS(ret) != 0) { /*system supports 64-bit OS*/ }

IO_TYPE

(_SC_IO_TYPE)

Type of I/O drivers the kernel supports; currently, only the value IO_TYPE_CDIO

KERNEL_BITS

(_SC_KERNEL_BITS)

Returns the number of bits used by the kernel for pointer and long data types. Current values include 32 and 64.

LIBC_VERSION

(_SC_LIBC_VERSION)

The version of libc that is in use by the application that is requesting this information.

The format of the value returned by sysconf(_SC_LIBC_VERSION) is XXyyZZZZqN,

where:

XX

HP-UX major release number

yy

HP-UX minor release number

ZZZZ

Library-specific number

q

One of the following values:

0

32PA

1

64PA

2

32EM

3

64EM

4-9

Reserved

N

One of the following values:

0

Archive library

1-9

System V version of shared library

LINE_MAX

(_SC_LINE_MAX)

Maximum number of bytes in an input line (including the newline) for POSIX.2 utilities.

LOGIN_NAME_MAX

(_SC_LOGIN_NAME_MAX)

Maximum length of user name in bytes.

MAPPED_FILES

(_SC_MAPPED_FILES)

Not supported.

MEMLOCK

(_SC_MEMLOCK)

Positive if the system supports POSIX memory locking (see mlockall(2), munlockall(2)).

MEMLOCK_RANGE

(_SC_MEMLOCK_RANGE)

Positive if the system supports POSIX memory range locking.

MEMORY_PROTECTION

(_SC_MEMORY_PROTECTION)

Not supported.

MESSAGE_PASSING

(_SC_MESSAGE_PASSING)

Positive if the system supports POSIX message queues.

MQ_OPEN_MAX

(_SC_MQ_OPEN_MAX)

Maximum number of per-process open message queue descriptors.

MQ_PRIO_MAX

(_SC_MQ_PRIO_MAX)

Maximum limit for message priority.

NGROUPS_MAX

(_SC_NGROUPS_MAX)

Maximum number of simultaneous supplementary group IDs per process.

OPEN_MAX

(_SC_OPEN_MAX)

Maximum number of files that one process can have open at one time.

PAGE_SIZE

(_SC_PAGE_SIZE)

Kernel memory page size.

PASS_MAX

(_SC_PASS_MAX)

Maximum number of significant bytes in a password.

POSIX_ADVISORY_INFO

(_SC_ADVISORY_INFO)

Equal to 200112 if the Advisory Information option is supported; -1 otherwise.

POSIX_ASYNCHRONOUS_IO

(_SC_ASYNCHRONOUS_IO)

Positive if the system supports POSIX Asynchronous Input and Output.

POSIX_BARRIERS

(_SC_BARRIERS)

Equal to 200112 if the Barriers option is supported; -1 otherwise.

POSIX_CLOCK_SELECTION

(_SC_CLOCK_SELECTION)

Equal to 200112 if the Clock Selection option is supported; -1 otherwise.

POSIX_CPUTIME

(_SC_CPUTIME)

Equal to 200112 if the Process CPU-Time Clocks option is supported; -1 otherwise.

POSIX_FSYNC

(_SC_FSYNC)

Positive if the File Synchronization option is supported (see fsync(2)).

POSIX_IPV6

(_SC_IPV6)

Equal to 200112 if the IPv6 option is supported; -1 otherwise.

POSIX_JOB_CONTROL

(_SC_JOB_CONTROL)

Positive if the system supports POSIX job control; -1 otherwise.

POSIX_MAPPED_FILES

(_SC_MAPPED_FILES)

Positive if the system supports POSIX memory locking (see mlockall(2), munlockall(2)).

POSIX_MEMLOCK

(_SC_MEMLOCK)

Positive if the system supports POSIX memory mapped files.

POSIX_MEMLOCK_RANGE

(_SC_MEMLOCK_RANGE)

Positive if the system supports POSIX memory range locking.

POSIX_MEMORY_PROTECTION

(_SC_MEMORY_PROTECTION)

Positive if the system supports POSIX memory protection.

POSIX_MESSAGE_PASSING

(_SC_MESSAGE_PASSING)

Positive if the system supports POSIX Prioritized Input and Output.

POSIX_MONOTONIC_CLOCK

(_SC_MONOTONIC_CLOCK)

Equal to 200112 if the Monotonic Clock option is supported; -1 otherwise.

POSIX_PRIORITIZED_IO

(_SC_PRIORITIZED_IO)

Positive if the system supports POSIX message queues.

POSIX_PRIORITY_SCHEDULING

(_SC_PRIORITY_SCHEDULING)

Positive if the system supports POSIX.4 priority scheduling; -1 otherwise.

POSIX_RAW_SOCKETS

(_SC_RAW_SOCKETS)

Equal to 200112 if the Raw Sockets option is supported; -1 otherwise.

POSIX_READER_WRITER_LOCKS

(_SC_READER_WRITER_LOCKS)

Equal to 200112 if the Read-Write Locks option is supported; -1 otherwise.

POSIX_REALTIME_SIGNALS

(_SC_REALTIME_SIGNALS)

Positive if the system supports POSIX.4 real time signal extensions; -1 otherwise.

POSIX_REGEXP

(_SC_REGEXP)

Equal to 200112 if the Regular Expression Handling option is supported; -1 otherwise.

POSIX_SAVED_IDS

(_SC_SAVED_IDS)

Positive if each process has a saved set-user-ID and a saved set-group-ID; -1 otherwise.

POSIX_SEMAPHORES

(_SC_SEMAPHORES)

Positive if the system supports POSIX semaphores.

POSIX_SHARED_MEMORY_OBJECTS

(_SC_SHARED_MEMORY_OBJECTS)

Positive if the system supports POSIX shared memory.

POSIX_SHELL

(_SC_SHELL)

Equal to 200112 if the POSIX shell is supported; -1 otherwise.

POSIX_SPAWN

(_SC_SPAWN)

Equal to 200112 if the Spawn option is supported; -1 otherwise.

POSIX_SPIN_LOCKS

(_SC_SPIN_LOCKS)

Equal to 200112 if the Spin Locks option is supported; -1 otherwise.

POSIX_SPORADIC_SERVER

(_SC_SPORADIC_SERVER)

Equal to 200112 if the Process Sporadic Server option is supported; -1 otherwise.

POSIX_SS_REPL_MAX

(_SC_SS_REPL_MAX)

Not supported.

POSIX_SYNCHRONIZED_IO

(_SC_SYNCHRONIZED_IO)

Positive if the Synchronized IO option is supported (see open(2)).

POSIX_THREAD_ATTR_STACKADDR

(_SC_THREAD_ATTR_STACKADDR))

Positive if the implementation supports the POSIX Thread Stack Address Attribute option; -1 otherwise.

POSIX_THREAD_ATTR_STACKSIZE

(_SC_THREAD_ATTR_STACKSIZE)

Positive if the implementation supports the POSIX Thread Stack Size Attribute option; -1 otherwise.

POSIX_THREAD_CPUTIME

(_SC_THREAD_CPUTIME)

Equal to 200112 if the Thread CPU-Time Clocks option is supported; -1 otherwise.

POSIX_THREAD_PRIORITY_SCHEDULING

(_SC_THREAD_PRIORITY_SCHEDULING)

Positive if the implementation supports the POSIX Thread Priority Scheduling option; -1 otherwise.

POSIX_THREAD_PRIO_INHERIT

(_SC_THREAD_PRIO_INHERIT)

Positive if the implementation supports the POSIX Thread Priority Inheritance option; -1 otherwise.

POSIX_THREAD_PRIO_PROTECT

(_SC_THREAD_PRIO_PROTECT)

Positive if the implementation supports the POSIX Thread Priority Protection option; -1 otherwise.

POSIX_THREAD_PROCESS_SHARED

(_SC_THREAD_PROCESS_SHARED)

Positive if the implementation supports the POSIX Thread Process-Shared Synchronization option; -1 otherwise.

POSIX_THREAD_SAFE_FUNCTIONS

(_SC_THREAD_SAFE_FUNCTIONS)

Positive if the implementation supports the POSIX Thread Thread-Safe Functions option; -1 otherwise.

POSIX_THREAD_SPORADIC_SERVER

(_SC_THREAD_SPORADIC_SERVER)

Equal to 200112 if the Thread Sporadic Server option is supported; -1 otherwise.

POSIX_THREADS

(_SC_THREADS)

Positive if the implementation supports POSIX threads; -1 otherwise.

POSIX_TIMEOUTS

(_SC_TIMEOUTS)

Equal to 200112 if the Timeouts option is supported; -1 otherwise.

POSIX_TIMERS

(_SC_TIMERS)

Positive if the system supports POSIX.4 clocks and timers; -1 otherwise.

POSIX_TRACE

(_SC_TRACE)

Equal to 200112 if the Trace option is supported; -1 otherwise.

POSIX_TRACE_EVENT_FILTER

(_SC_TRACE_EVENT_FILTER)

Equal to 200112 if the Trace Event Filter option is supported; -1 otherwise.

POSIX_TRACE_EVENT_NAME_MAX

(_SC_TRACE_EVENT_NAME_MAX)

Maximum length of the trace event name.

POSIX_TRACE_INHERIT

(_SC_TRACE_INHERIT)

Equal to 200112 if the Trace Inherit option is supported; -1 otherwise.

POSIX_TRACE_LOG

(_SC_TRACE_LOG)

Equal to 200112 if the Trace Log option is supported; -1 otherwise.

POSIX_TRACE_NAME_MAX

(_SC_TRACE_NAME_MAX)

Maximum length of the trace generation version string or of the trace stream name.

POSIX_TRACE_SYS_MAX

(_SC_TRACE_SYS_MAX)

Maximum number of trace streams that may simultaneously exist in the system.

POSIX_TRACE_USER_EVENT_MAX

(_SC_TRACE_USER_EVENT_MAX)

Maximum number of user trace event type identifiers that may simultaneously exist in a traced process

POSIX_TTY_NAME_MAX

(_SC_TTY_NAME_MAX)

Maximum length of a terminal device name.

POSIX_TYPED_MEMORY_OBJECTS

(_SC_TYPED_MEMORY_OBJECTS)

Equal to 200112 if the Typed Memory Objects option is supported; -1 otherwise.

POSIX_VERSION

(_SC_VERSION)

Approval date of the POSIX.1 Standard (such as 199009 for POSIX.1-1990) to which the system conforms. This value indicates the year (first four digits) and month (next two digits) that the standard was approved by the IEEE Standards Board.

POSIX2_C_BIND

(_SC_2_C_BIND)

Equal to 1 if the POSIX.2 C Language Bindings Option is available through the c89 utility; -1 otherwise.

POSIX2_C_DEV

(_SC_2_C_DEV)

Equal to 1 if the POSIX.2 C Language Development Utilities Option is supported; -1 otherwise.

POSIX2_C_VERSION

(_SC_2_C_VERSION)

Current version of the POSIX.2 C Language Binding Option supported (same format as _POSIX_VERSION); -1 otherwise.

POSIX2_FORT_DEV

(_SC_2_FORT_DEV)

Equal to 1 if the POSIX.2 FORTRAN Development Utilities Option is supported; -1 otherwise.

POSIX2_FORT_RUN

(_SC_2_FORT_RUN)

Equal to 1 if the POSIX.2 Fortran Runtime Utilities Option is supported; -1 otherwise.

POSIX2_LOCALEDEF

(_SC_2_LOCALEDEF)

Equal to 1 if locales can be created with the POSIX.2 localedef utility; -1 otherwise.

POSIX2_PBS

(_SC_2_PBS)

Equal to 200112 if the Batch Environment Services and Utilities option is supported; -1 otherwise.

POSIX2_PBS_ACCOUNTING

(_SC_2_PBS_ACCOUNTING)

Equal to 200112 if the Batch Accounting option is supported; -1 otherwise.

POSIX2_PBS_CHECKPOINT

(_SC_2_PBS_CHECKPOINT)

Equal to 200112 if the Batch Checkpoint/Restart option is supported; -1 otherwise.

POSIX2_PBS_LOCATE

(_SC_2_PBS_LOCATE)

Equal to 200112 if the Locate Batch job request option is supported; -1 otherwise.

POSIX2_PBS_MESSAGE

(_SC_2_PBS_MESSAGE)

Equal to 200112 if the Batch Job Message Request option is supported; -1 otherwise.

POSIX2_PBS_TRACK

(_SC_2_PBS_TRACK)

Equal to 200112 if the Track Batch Job Request option is supported; -1 otherwise.

POSIX2_SW_DEV

(_SC_2_SW_DEV)

Equal to 1 if the POSIX.2 Software Development Utilities Option is supported; -1 otherwise.

POSIX2_UPE

(_SC_2_UPE)

Equal to 1 if the POSIX.2 User Portability Utilities Option is supported; -1 otherwise.

POSIX2_VERSION

(_SC_2_VERSION)

Current version of POSIX.2 (same format as _POSIX_VERSION).

PRIORITIZED_IO

(_SC_PRIORITIZED_IO)

Not supported.

PROCESSOR_SET

(_SC_PSET_SUPPORT)

Positive if the implementation supports the Processor Set Functions; -1 otherwise.

PROC_RSRC_MGR

(_SC_PROC_RSRC_MGR)

Equal to 1 if the optional HP Process Resource Management (PRM) software is installed and configured; 0 otherwise (see prmconfig(1)).

PTHREAD_DESTRUCTOR_ITERATIONS

(_SC_THREAD_DESTRUCTOR_ITERATIONS)

The number of attempts made to destroy a pthread's thread-specific data values on thread exit.

PTHREAD_KEYS_MAX

(_SC_THREAD_KEYS_MAX)

The number of pthread data keys per process.

PTHREAD_STACK_MIN

(_SC_THREAD_STACK_MIN)

Minimum size in bytes of pthread stack storage.

PTHREAD_THREADS_MAX

(_SC_THREAD_THREADS_MAX)

Maximum number of pthreads that can be created per process.

RE_DUP_MAX

(_SC_RE_DUP_MAX)

Maximum number of repeated occurrences of a regular expression permitted when using the interval notation \{m,n\} (see regcomp(3C)).

RTSIG_MAX

(_SC_RTSIG_MAX)

Maximum number of realtime signals reserved for application use.

SECURITY_CLASS

(_SC_SECURITY_CLASS)

SEC_CLASS-NONE (No DoD security level supported).

SEMAPHORES

(_SC_SEMAPHORES)

Positive if the system supports POSIX semaphores.

SEM_NSEMS_MAX

(_SC_SEM_NSEMS_MAX)

Maximum number of open semaphores per process.

SEM_VALUE_MAX

(_SC_SEM_VALUE_MAX)

Maximum semaphore value.

SHARED_MEMORY_OBJECTS

(_SC_SHARED_MEMORY_OBJECTS)

Positive if the system supports POSIX shared memory.

SIGQUEUE_MAX

(_SC_SIGQUEUE_MAX)

Maximum number of queued signals that a process may send and have pending at the receivers at any time.

STREAM_MAX

(_SC_STREAM_MAX)

Maximum number of stdio streams that one process can have open at one time.

TIMER_MAX

(_SC_TIMER_MAX)

Maximum number of POSIX.4 timers per process, if POSIX.4 timers are supported; -1 otherwise.

TTY_NAME_MAX

(_SC_TTY_NAME_MAX)

Value of TTY_NAME_MAX.

TZNAME_MAX

(_SC_TZNAME_MAX)

Maximum number of bytes in a time zone name for the TZ environment variable.

XOPEN_CRYPT

(_SC_XOPEN_CRYPT)

Equal to 1 if the X/Open Encryption Feature Group is supported; -1 otherwise.

XOPEN_ENH_I18N

(_SC_XOPEN_ENH_I18N)

Equal to 1 if the X/Open Enhanced Internationalization Feature Group is supported; -1 otherwise.

XOPEN_LEGACY

(_SC_XOPEN_LEGACY)

Not supported.

XOPEN_REALTIME

(_SC_XOPEN_REALTIME)

Not supported.

XOPEN_REALTIME_THREADS

(_SC_XOPEN_REALTIME_THREADS)

Not supported.

XOPEN_SHM

(_SC_XOPEN_SHM)

Equal to 1 if the X/Open Shared Memory Feature Group is supported; -1 otherwise.

XOPEN_STREAMS

(_SC_XOPEN_STREAMS)

Equal to 200112 if the Streams option is supported; -1 otherwise.

XOPEN_VERSION

(_SC_XOPEN_VERSION)

Issue number of X/Open Portability Guide supported.

XBS5_ILP32_OFF32

(_SC_XBS5_ILP32_OFF32)

A flag that denotes whether _CS_XBS5_ILP32_OFF32_CFLAGS, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS and _CS_XBS5_ILP32_OFF32_LINTFLAGS are supported by confstr(). A return value of -1 indicates they are not supported.

XBS5_ILP32_OFFBIG

(_SC_XBS5_ILP32_OFFBIG)

A flag that denotes whether _CS_XBS5_ILP32_OFFBIG_CFLAGS, _CS_XBS5_ILP32_OFFBIG_LDFLAGS, _CS_XBS5_ILP32_OFFBIG_LIBS and _CS_XBS5_ILP32_OFFBIG_LINTFLAGS are supported by confstr(). A return value of -1 indicates they are not supported.

XBS5_LP64_OFF64

(_SC_XBS5_LP64_OFF64)

A flag that denotes whether _CS_XBS5_LP64_OFF64_CFLAGS, _CS_XBS5_LP64_OFF64_LDFLAGS, _CS_XBS5_LP64_OFF64_LIBS and _CS_XBS5_LP64_OFF64_LINTFLAGS are supported by confstr(). A return value of -1 indicates they are not supported.

XBS5_LPBIG_OFFBIG

(_SC_XBS5_LPBIG_OFFBIG)

A flag that denotes whether _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS and _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS are supported by confstr(). A return value of -1 indicates they are not supported.

__________________________________________________________________________________________________

RETURN VALUE

Upon successful completion, sysconf() returns the value of the named variable. If the value of name is not recognized, sysconf() returns -1 and sets errno to EINVAL. If the value in name is defined but is not supported in this environment, 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().

AUTHOR

sysconf() was developed by HP and POSIX.

CPU_IS_PA_RISC() was developed by HP.

STANDARDS CONFORMANCE

sysconf(): AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.2, POSIX.4

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.