[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2


getconf Command

Purpose

Writes system configuration variable values to standard output.

Syntax

getconf [ -v specification ] [ SystemwideConfiguration | PathConfiguration PathName ]

Description

The getconf command, invoked with the SystemwideConfiguration parameter, writes the value of the variable, as specified by the SystemwideConfiguration parameter, to standard output.

The getconf command, invoked with the PathConfiguration and Pathname parameters, writes the value of the variable, as specified by the PathConfiguration parameter for the path specified by the PathName parameter, to standard output.

If the specified variable is defined on the system and its value is described to be available from the confstr subroutine, the value of the specified variable is written in the following format:

"%s\n", <value>

Otherwise, if the specified variable is defined on the system, its value is written in the following format:

"%d\n", <value>

If the specified variable is valid but undefined on the system, the following is written to standard output:

"undefined\n"

If the variable name is invalid or an error occurs, a diagnostic message is written to the standard error.

Flags


-v specification Indicates a specific specification and version for which configuration variables are to be determined. If this flag is not specified, the values returned will correspond to an implementation default XBS5 conforming compilation environment.

Parameters


PathName Specifies a path name for the PathConfiguration parameter.
SystemwideConfiguration Specifies a system configuration variable.
PathConfiguration Specifies a system path configuration variable.

When the symbol listed in the first column of the following table is used as the system_var operand, getconf will yield the same value as confstr when called with the value in the second column:

system_var confstr Name Value
PATH _CS_PATH
XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILPBIG_OFF32_LINTFLAGS
XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS

Environment Variables

The following environment variables affect the execution of getconf:

LANG Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent | default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
LC_CALL If set to a non-empty string value, override the values of all the other internationalisation variables.
LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH Determine the location of message catalogues for the processing of LC_MESSAGES.

Systemwide Configuration Variables

The SystemwideConfiguration parameter specifies system configuration variables whose values are valid throughout the system. There are two kinds of system configuration variables:

Systemwide Configuration Variables

Systemwide configuration variables contain the minimum values met throughout all portions of the system. The following list defines the systemwide configuration variables used with the getconf command:

_CS_PATH Value for the PATH environment variable used to find commands.
ARG_MAX Maximum length, in bytes, of the arguments for one of the exec subroutines, including environment data.
BC_BASE_MAX Maximum value allowed for the obase variable with the bc command.
BC_DIM_MAX Maximum number of elements permitted in an array by the bc command.
BC_SCALE_MAX Maximum value allowed for the scale variable with the bc command.
BC_STRING_MAX Maximum length of a string constant accepted by the bc command.
CHARCLASS_NAME_MAX Maximum number of bytes in a character class name.
CHAR_BIT Number of bits in a type character.
CHAR_MAX Maximum value of a type character.
CHAR_MIN Minimum value of a type character.
CHILD_MAX Maximum number of simultaneous processes for each real user ID.
CLK_TCK Number of clock ticks per second returned by the time subroutine.
COLL_WEIGHTS_MAX Maximum number of weights that can be assigned to an entry in the LC_COLLATE locale stanza in a locale-definition file.
CS_PATH Value of the PATH environment variable used to find commands.
EXPR_NEST_MAX Maximum number of expressions that can be nested within parentheses by the expr command.
INT_MAX Maximum value of a type int.
INT_MIN Minimum value of a type int.
LINE_MAX Maximum length, in bytes, of a command's input line (either standard input or another file) when the utility is described as processing text files. The length includes room for the trailing new-line character.
LONG_BIT Number of bits in a type long int.
LONG_MAX Maximum value of a type long int.
LONG_MIN Minimum value of a type long int.
MB_LEN_MAX Maximum number of bytes in a character for any supported locale.
NGROUPS_MAX Maximum number of simultaneous supplementary group IDs for each process.
NL_ARGMAX Maximum value of digit in calls to the printf and scanf subroutines.
NL_LANGMAX Maximum number of bytes in a LANG name.
NL_MSGMAX Maximum message number.
NL_NMAX Maximum number of bytes in an N-to-1 collation mapping.
NL_SETMAX Maximum set number.
NL_TEXTMAX Maximum number of bytes in a message string.
NZERO Default process priority.
OPEN_MAX Maximum number of files that one process can have open at one time.
PATH Sequence of colon-separated path prefixes used to find commands.
RE_DUP_MAX Maximum number of repeated occurrences of a regular expression permitted when using the interval-notation parameters, such as the m and n parameters with the ed command.
SCHAR_MAX Maximum value of a type signed char.
SCHAR_MIN Minimum value of a type signed char.
SHRT_MAX Maximum value of a type short.
SHRT_MIN Minimum value of a type short.
SSIZE_MAX Maximum value of an object of type ssize_t.
STREAM_MAX Number of streams that one process can have open at one time.
TMP_MAX Minimum number of unique path names generated by the tmpnam subroutine. Maximum number of times an application can reliably call the tmpnam subroutine.
TZNAME_MAX Maximum number of bytes supported for the name of a time zone (not the length of the TZ environment variable).
UCHAR_MAX Maximum value of a type unsigned char.
UINT_MAX Maximum value of a type unsigned int.
ULONG_MAX Maximum value of a type unsigned long int.
USHRT_MAX Maximum value of a type unsigned short int.
WORD_BIT Number of bits in a word or type int.

System Standards Configuration Variables

System standards configuration variables contain the minimum values required by a particular system standard. The _POSIX_, POSIX2_, and _XOPEN_ prefixes indicate that the variable contains the minimum value for a system characteristic required by the POSIX 1003.1, POSIX 1003.2, and X/Open system standards, respectively. System standards are systemwide minimums that the system meets to support the particular system standard. Actual Configuration values may exceed these standards. The system standards configuration variables for the getconf command are defined as follows:

_POSIX_ARG_MAX Maximum length, in bytes, of the arguments for one of the exec subroutines, including environment data.
_POSIX_CHILD_MAX Maximum number of simultaneous processes for each real user ID.
_POSIX_JOB_CONTROL Value of 1 if the system supports job control.
_POSIX_LINK_MAX Maximum number of links to a single file.
_POSIX_MAX_CANON Maximum number of bytes in a terminal canonical input queue.
_POSIX_MAX_INPUT Maximum number of bytes allowed in a terminal input queue.
_POSIX_NAME_MAX Maximum number of bytes in a file name (not including terminating null).
_POSIX_NGROUPS_MAX Maximum number of simultaneous supplementary group IDs for each process.
_POSIX_OPEN_MAX Maximum number of files that one process can have open at one time.
_POSIX_PATH_MAX Maximum number of bytes in a path name.
_POSIX_PIPE_BUF Maximum number of bytes guaranteed to be atomic when writing to a pipe.
_POSIX_SAVED_IDS Value of 1. Each process has a saved set-user-ID and a saved set-group-ID.
_POSIX_SSIZE_MAX Maximum value that can be stored in an object of type ssize_t.
_POSIX_STREAM_MAX Number of streams that one process can have open at one time.
_POSIX_TZNAME_MAX Maximum number of bytes supported for the name of a time zone (not the length of the TZ environment variable).
_POSIX_VERSION Version of the POSIX 1 standard (C Language Binding) to which the operating system conforms.
_XOPEN_CRYPT Value of 1 if the system supports the X/Open Encryption Feature Group.
_XOPEN_ENH_I18N Value of 1 if the system supports the X/Open Enhanced Internationalisation Feature Group.
_XOPEN_SHM Value of 1 if the system supports the X/Open Shared Memory Feature Group.
_XOPEN_VERSION Version of the X/Open Portability Guide to which the operating system conforms.
_XOPEN_XCU_VERSION Version of the X/Open Commands and Utilities specification to which the operating system conforms.
_XOPEN_XPG2 Value of 1 if the system supports the X/Open Portability Guide, Volume 2, January 1987, XVS System Calls and Libraries, otherwise undefiined.
_XOPEN_XPG3 Value of 1 if the system supports the X/Open Specification, February 1992, System Interfaces and Headers, Issue 3, otherwise undefined.
_XOPEN_XPG4 Value of 1 if the system supports the X/Open CAE Specification, July 1992, System Interfaces and Headers, Issue 4, otherwise undefined.
POSIX2_BC_BASE_MAX Maximum value allowed for the obase variable with the bc command.
POSIX2_BC_DIM_MAX Maximum number of elements permitted in an array by the bc command.
POSIX2_BC_SCALE_MAX Maximum value allowed for the scale variable with the bc command.
POSIX2_BC_STRING_MAX Maximum length of a string constant accepted by the bc command.
POSIX2_CHAR_TERM Value of 1 if the system supports at least one terminal type; otherwise it has the value -1.
POSIX2_COLL_WEIGHTS_MAX Maximum number of weights that can be assigned to an entry of the LC_COLLATE locale variable in a locale-definition file.
POSIX2_C_BIND Value of 1 if the system supports the C Language Binding Option from POSIX 2; otherwise, it has the value -1.
POSIX2_C_DEV Value of 1 if the system supports the C Language Development Utilities from POSIX 2; otherwise, it has the value -1.
POSIX2_C_VERSION Version of the POSIX 2 standard (C Language Binding) to which the operating system conforms.
POSIX2_EXPR_NEST_MAX Maximum number of expressions that can be nested within parentheses by the expr command.
POSIX2_FORT_DEV Value of 1 if the system supports the FORTRAN Development Utilities Option from POSIX 2; otherwise, it has the value -1.
POSIX2_FORT_RUN Value of 1 if the system supports the FORTRAN Runtime Utilities Option from POSIX 2; otherwise, it has the value -1.
POSIX2_LINE_MAX The maximum length, in bytes, of a command's input line (either standard input or another file) when the command is described as processing text files. The length includes room for the trailing new-line character.
POSIX2_LOCALEDEF Value of 1 if the system supports the creation of the locales by the localedef command; otherwise, it is undefined.
POSIX2_RE_DUP_MAX Maximum number of repeated occurrences of a regular expression permitted when using the interval-notation parameters, such as the m and n parameters with the ed command.
POSIX2_SW_DEV Value of 1 if the system supports the Software Development Utilities Option; otherwise, it has the value -1.
POSIX2_UPE Value of 1 if the system supports the User Portability Utilities Option from POSIX 2; otherwise, it as the value -1.
POSIX2_VERSION Date of approval of the most current version of the POSIX 2 standard which the system supports. The date is a six-digit number, with the first four digits signifying the year and the last two digits the month. Different versions of the POSIX 2 standard are periodically approved by the IEEE Standards Board, and the date of approval is used to distinguish between different versions.

System Path Configuration Variables

The PathConfiguration parameter specifies system path configuration variables whose values contain information about paths and path structures in the system. The following list defines these variables:

_POSIX_CHOWN_RESTRICTED The chown() subroutine is restricted to a process with appropriate privileges, and to changing the group ID of a file only to the effective group ID of the process or to one of its supplementary group IDs. If the PathName parameter refers to a directory, the value returned applies to any files except directories that exist or can be created within the directory.
_POSIX_NO_TRUNC Path names longer than the limit specified by the NAME_MAX variable will generate an error. If the PathName parameter refers to a directory, the value returned applies to file names within the directory.
_POSIX_VDISABLE Terminal special characters, defined in the termios.h file, can be disabled using this character value.
LINK_MAX Maximum number of links to a single file. If the PathName parameter refers to a directory, the value returned applies to the directory.
MAX_CANON Maximum number of bytes in a terminal canonical input line.
MAX_INPUT Maximum number of bytes for which space is available in a terminal input queue.
NAME_MAX Maximum number of bytes in a file name (not including terminating null). If the PathName parameter refers to a directory, the value returned applies to the file names within the directory.
PATH_MAX Maximum number of bytes in a path name, including the terminating null character. If the PathName parameter refers to a directory, the value returned is the maximum length of a relative path name when the specified directory is the working directory.
PIPE_BUF Maximum number of bytes guaranteed to be atomic when writing to a pipe. If the PathName parameter refers to a FIFO or a pipe, the value returned applies to the referenced object. If the PathName parameter refers to a directory, the value returned applies to any FIFO that exists or can be created within the directory.

Exit Status

This command returns the following exit values:

0 The specified variable is valid and information about its current state was successfully written.
>0 An error occurred.
  1. To display the value of the ARG_MAX variable, enter:

    getconf ARG_MAX
    
  2. To display the value of the NAME_MAX variable for the /usr directory, enter:

     getconf NAME_MAX /usr
    
  3. The following sequence of shell commands shows how to handle unspecified results:

    if value=$(getconf PATH_MAX /usr)
    then
         if [ "$value" = "undefined" ]
         then
                    echo 
                         The value of PATH_MAX in /usr is undefined.
         else
     
                         The value of PATH_MAX in /usr is $value.
         fi
    else
                    echo
                         Error in the getconf command.
    fi
    

Examples

  1. To display the value of the ARG_MAX variable, enter:

    getconf ARG_MAX
    
  2. To display the value of the NAME_MAX variable for the /usr directory, enter:

    getconf NAME_MAX /usr
    
  3. The following sequence of shell commands shows how to handle unspecified results:

    if value=$(getconf PATH_MAX /usr)
    then
         if [ "$value" = "undefined" ]
         then
                 echo
                       The value of PATH_MAX in /usr is undefined.
         else
                 echo 
                       The value of PATH_MAX in /usr is $value.
         fi
    else
         echo Error in the getconf command.
    fi
    
  4. If the command:

    getconf _XBS5_ILP32_OFF32 
    

    does not write -1\n or undefined\n to standard output, then commands of the form:

    getconf -v XBS5_ILP32_OFF32 ... 
    

    will determine values for configuration variables corresponding to the XBS5_ILP32_OFF32 compilation environment specified in c89, Extended Description.

  5. If the command:

    getconf _XBS5_ILP32_OFFBIG 
    

    does not write -1\n or undefined\n to standard output, then commands of the form:

    getconf -v XBS5_ILP32_OFFBIG ... 
    

    will determine values for configuration variables corresponding to the XBS5_ILP32_OFFBIG compilation environment specified in c89, Extended Description.

  6. If the command:

    getconf _XBS5_LP64_OFF64 
    

    does not write -1\n or undefined\n" to standard output, then commands of the | form:

    getconf -v XBS5_LP64_OFF64 ... 
    

    will determine values for configuration variables corresponding to the XBS5_LP64_OFF64 compilation environment specified in c89, Extended Description.

  7. If the command:

    getconf _XBS5_LPBIG_OFFBIG 
    

    does not write -1\n or undefined\n to standard output, then commands of the form:

    getconf -v _XBS5_LPBIG_OFFBIG 
    

    will determine values for configuration variables corresponding to the XBS5_LPBIG_OFFBIG compilation environment specified in c89, Extended Description.

Files


/usr/bin/getconf Contains the getconf command.
/usr/include/limits.h Defines system configuration variables.
/usr/include/unistd.h Defines system configuration variables.

Related Information

The confstr subroutine, pathconf subroutine, sysconf subroutine.

Commands Overview in AIX 5L Version 5.1 System User's Guide: Operating System and Devices.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]