Get system configuration values (POSIX)
Syntax:
getconf system_var
getconf path_var pathname
Description:
This utility gets system configuration values, including:
- configuration strings, whose names start with _CS_
- configurable system limits, whose names start with _SC_
- configurable limits associated with a path, whose names start with
_PC_
Note:
The names of these variables are in uppercase, but
getconf and
setconf
let you use any case, omit the leading underscore, or the entire prefix
— provided that the rest of the name is unambiguous.
The first form writes to standard output the value of the specified
system variable.
The possible values of system_var are those for
sysconf()
and
confstr()
(see the C Library Reference):
- _CS_ARCHITECTURE
- The name of the instruction set architecture for this node's CPU(s).
- _CS_DOMAIN
- The domain name.
- _CS_HOSTNAME
- The name of this node in the network.
Note:
A hostname can consist only of letters, numbers, and hyphens, and
must not start or end with a hyphen.
For more information, see RFC 952.
- _CS_HW_PROVIDER
- The name of the hardware manufacturer.
- _CS_HW_SERIAL
- Serial number associated with the hardware.
- _CS_LIBPATH
- A value similar to the LD_LIBRARY_PATH environment
variable that finds all standard libraries.
- _CS_LOCALE
- The name of the current locale.
- _CS_MACHINE
- This node's hardware type.
- _CS_PATH
- A value similar to the PATH environment variable that
finds all standard utilities.
- _CS_RELEASE
- The current OS release level.
- _CS_RESOLVE
- The contents of the resolv.conf file, excluding the
domain name.
- _CS_SRPC_DOMAIN
- The secure RPC domain.
- _CS_SYSNAME
- The name of the operating system.
- _CS_TIMEZONE
- Time zone string (TZ style)
- _CS_VERSION
- The current OS version number.
- _SC_AIO_PRIO_DELTA_MAX
- The maximum amount by which a process can decrease its asynchronous I/O
priority level from its own scheduling priority.
- _SC_ARG_MAX
- Maximum length of arguments for the exec*() functions,
in bytes, including environment data.
- _SC_CHILD_MAX
- Maximum number of simultaneous processes per real user ID.
- _SC_CLK_TCK
- The number of intervals per second used to express the value in type
clock_t.
- _SC_DELAYTIMER_MAX
- The maximum number of times a timer can overrun and you can still
detect it.
- _SC_GETGR_R_SIZE_MAX
- If defined (not -1), the maximum size of buffer that you need to
supply to
getgrgid_r()
for any memory that it needs to allocate.
- _SC_GETPW_R_SIZE_MAX
- If defined (not -1), the maximum size of buffer that you need to
supply to
getpwent_r(),
getpwuid_r(),
getspent_r(),
or
getspnam_r()
for any memory that they need to allocate.
- _SC_JOB_CONTROL
- If this variable is defined, then job control is supported.
- _SC_NGROUPS_MAX
- The maximum number of simultaneous supplementary group IDs per
process.
- _SC_OPEN_MAX
- Maximum number of files that one process can have open at any given
time.
- _SC_PAGESIZE
- The default size of a thread's guard area.
- _SC_SAVED_IDS
- If this variable is defined, then each process has a saved set-user ID
and a saved set-group ID.
- _SC_SEM_NSEMS_MAX
- The maximum number of semaphores that one process can have open at
a time.
The getconf utility reports a value of -1 to indicate that
this limit is indeterminate because it applies to both named and unnamed
semaphores.
The kernel allows an arbitrary number of unnamed semaphores
(they're kernel synchronization objects, so the number of them is limited
only by the amount of available kernel memory).
- _SC_SIGQUEUE_MAX
- The maximum number of outstanding realtime signals sent per process.
- _SC_THREAD_STACK_MIN
- The minimum stack size for a thread.
- _SC_TZNAME_MAX
- The maximum length of the names for time zones.
- _SC_VERSION
- The current POSIX version that is currently supported. A value of
198808L indicates the August (08) 1988 standard, as approved by the
IEEE Standards Board.
The second form writes to standard output the value of the specified
path variable for the given path.
The possible values of path_var are those for
pathconf()
(see the C Library Reference):
- _PC_ASYNC_IO
- Defined if asynchronous I/O is supported for the file.
- _PC_CHOWN_RESTRICTED
- If defined (not -1), indicates that the use of the
chown
function is restricted to a process with root privileges,
and to
changing the group ID of a file to the effective group ID of the
process or to one of its supplementary group IDs.
- _PC_LINK_DIR
- Defined (not -1) if the filesystem permits the unlinking of
a directory.
- _PC_LINK_MAX
- Maximum value of a file's link count.
- _PC_MAX_CANON
- Maximum number of bytes in a terminal's canonical input buffer
(edit buffer).
- _PC_MAX_INPUT
- Maximum number of bytes in a terminal's raw input buffer.
- _PC_NAME_MAX
- Maximum number of bytes in a file name (not including the terminating
null).
- _PC_NO_TRUNC
- If defined (not -1), indicates that the use of pathname components
longer than the value given by _PC_NAME_MAX will
generate an error.
- _PC_PATH_MAX
- Maximum number of bytes in a pathname (not including the terminating
null).
- _PC_PIPE_BUF
- Maximum number of bytes that can be written atomically when writing to
a pipe.
- _PC_PRIO_IO
- Defined (not -1) if prioritized I/O is supported for the file.
- _PC_SYNC_IO
- Defined (not -1) if synchronous I/O is supported for the file.
- _PC_VDISABLE
- If defined (not -1), this is the character value which can be used to
individually disable special control characters in the
termios
control structure.
Examples:
$ getconf _CS_PATH
/bin
$ getconf _SC_ARG_MAX
61440
$ getconf _PC_LINK_MAX /bin
65535
Environment variables:
- LANG
- The locale to use for the locale categories.
Note:
QNX Neutrino currently supports only the POSIX (i.e. C) locale.
Exit status:
- 0
- Successful completion.
- 1
- An error occurred.