getconf 명령어 (AIX 5.3·6.1)

핵심 정리

  • 시스템 구성 변수(POSIX·X/Open 한도와 AIX 고유 값)의 값을 보여 줍니다. getconf 변수, 경로별 값은 getconf 변수 경로, 모두는 getconf -a.
  • AIX에서 자주 쓰는 것: getconf KERNEL_BITMODE(커널 32/64비트), getconf HARDWARE_BITMODE(하드웨어 비트), getconf REAL_MEMORY(메모리 KB), getconf BOOT_DEVICE(부팅 디스크), getconf DISK_SIZE /dev/hdisk0(디스크 크기 MB).
  • 프로그래밍 한도: ARG_MAX(명령 인수 최대 길이), OPEN_MAX, CHILD_MAX, NAME_MAX·PATH_MAX(경로별), PIPE_BUF, LINE_MAX.
  • 값이 정의되지 않았으면 undefined, 변수 이름이 틀리면 표준 오류에 진단 메시지를 씁니다.
  • BOOT_DEVICE, MACHINE_ARCHITECTURE, DISK_SIZE처럼 root만 볼 수 있는 값도 있습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 버전의 내용이 같음)
원문 IBM Commands Reference — 5.3 Volume 2, 6.1 Volume 2
파일 /usr/bin/getconf, /usr/include/limits.h, /usr/include/unistd.h
관련 명령어 prtconf, bootinfo, lsattr -El sys0, ulimit

목적

시스템 구성 변수의 값을 보여 줍니다.

영어 원문

Writes system configuration variable values to standard output.

구문

text
getconf [ -v specification ] [ SystemwideConfiguration | PathConfiguration PathName ] [ DeviceVariable DeviceName ]
getconf -a

설명

SystemwideConfiguration 매개변수와 함께 실행하면 그 변수의 값을 표준 출력에 씁니다.

PathConfiguration과 PathName 매개변수와 함께 실행하면 PathName 경로에 대한 그 변수의 값을 씁니다.

-a와 함께 실행하면 모든 시스템 구성 변수의 값을 씁니다.

DeviceVariable과 DeviceName 매개변수와 함께 실행하면 DeviceName 장치 경로의 디스크 장치 이름이나 위치를 씁니다.

변수가 시스템에 정의되어 있고 그 값을 confstr 서브루틴으로 얻는다고 되어 있으면 "%s\n" 형식으로, 그 밖에 정의되어 있으면 "%d\n" 형식으로 씁니다. 올바른 변수지만 시스템에 정의되지 않았으면 undefined를 씁니다. 변수 이름이 틀리거나 오류가 나면 표준 오류에 진단 메시지를 씁니다.

영어 원문

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.

The getconf command, invoked with the -a flag, writes the values of all system configuration variables to standard output.

The getconf command, invoked with the DeviceVariable and DeviceName parameters, writes the value of the disk device name or location, for the device path specified by the DeviceName parameter, to the 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.

플래그

플래그 설명
-v specification 구성 변수를 정할 규격과 버전. 없으면 구현의 기본인 XBS5 준수 컴파일 환경에 해당하는 값을 돌려줍니다.
-a 모든 시스템 구성 변수의 값을 표준 출력에 씁니다.
영어 원문
  • -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.
  • -a — Writes the values of all system configuration variables to standard output.

매개변수

매개변수 설명
PathName PathConfiguration에 쓸 경로 이름.
SystemwideConfiguration 시스템 구성 변수.
PathConfiguration 시스템 경로 구성 변수.
DeviceName 장치의 경로 이름.
DeviceVariable 장치 변수.

아래 첫 열의 이름을 system_var로 쓰면 둘째 열의 값으로 confstr를 부른 것과 같은 값을 돌려줍니다.

system_var confstr 이름
BOOT_DEVICE _CS_AIX_BOOTDEV
MACHINE_ARCHITECTURE _CS_AIX_ARCHITECTURE
MODEL_CODE _CS_AIX_MODEL_CODE
PATH _CS_PATH
XBS5_ILP32_OFF32_CFLAGS, _LDFLAGS, _LIBS, _LINTFLAGS _CS_XBS5_ILP32_OFF32_...
XBS5_ILP32_OFFBIG_... _CS_XBS5_ILP32_OFFBIG_...
XBS5_LP64_OFF64_... _CS_XBS5_LP64_OFF64_...
XBS5_LPBIG_OFFBIG_... _CS_XBS5_LPBIG_OFFBIG_...

참고: confstr의 _CS_AIX_ARCHITECTURE와 _CS_AIX_BOOTDEV는 root만 쓸 수 있습니다.

영어 원문
  • PathName — Specifies a path name for the PathConfiguration parameter.
  • SystemwideConfiguration — Specifies a system configuration variable.
  • PathConfiguration — Specifies a system path configuration variable.
  • DeviceName — Specifies the path name of a device.
  • DeviceVariable — Specifies a device 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:

Note: The _CS_AIX_ARCHITECTURE and _CS_AIX_BOOTDEV variables, used as parameters to confstr, are available only to the root user.

system_var confstr Name Value BOOT_DEVICE _CS_AIX_BOOTDEV MACHINE_ARCHITECTURE _CS_AIX_ARCHITECTURE MODEL_CODE _CS_AIX_MODEL_CODE 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

환경 변수

변수 설명
LANG 정하지 않았거나 비어 있는 국제화 변수의 기본값. LANG도 없으면 구현의 기본 로캘을 씁니다. 국제화 변수 가운데 잘못된 값이 있으면 모두 정의되지 않은 것처럼 동작합니다.
LC_ALL 비어 있지 않으면 다른 모든 국제화 변수를 덮어씁니다.
LC_CTYPE 텍스트 바이트를 문자로 해석할 로캘(예: 인수의 단일·멀티바이트 문자).
LC_MESSAGES 표준 오류에 쓰는 진단 메시지의 형식과 내용에 쓸 로캘.
NLSPATH LC_MESSAGES 처리에 쓸 메시지 카탈로그 위치.
영어 원문

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

SystemwideConfiguration 매개변수는 시스템 전체에 유효한 구성 변수를 지정합니다. 시스템 전체 구성 변수와 시스템 표준 구성 변수의 두 종류가 있습니다.

시스템 전체 구성 변수

시스템의 모든 부분이 만족하는 최솟값입니다.

변수 뜻
_CS_PATH, CS_PATH, PATH 명령을 찾는 데 쓸 PATH 환경 변수 값(콜론으로 나눈 경로 접두사)
ARG_MAX exec 서브루틴 인수의 최대 길이(환경 데이터 포함, 바이트)
BC_BASE_MAX, BC_DIM_MAX, BC_SCALE_MAX, BC_STRING_MAX bc의 obase 최댓값, 배열 원소 최대 수, scale 최댓값, 문자열 상수 최대 길이
CHARCLASS_NAME_MAX 문자 클래스 이름의 최대 바이트 수
CHAR_BIT, CHAR_MAX, CHAR_MIN char의 비트 수, 최댓값, 최솟값
CHILD_MAX 실제 사용자 ID마다 동시에 실행할 수 있는 프로세스 최대 수
CLK_TCK time 서브루틴이 돌려주는 초당 클록 틱 수
COLL_WEIGHTS_MAX 로캘 정의의 LC_COLLATE 항목에 줄 수 있는 가중치 최대 수
EXPR_NEST_MAX expr에서 괄호로 중첩할 수 있는 식의 최대 수
INT_MAX, INT_MIN int의 최댓값, 최솟값
LINE_MAX 텍스트 파일을 처리하는 명령의 입력 줄 최대 길이(줄바꿈 포함, 바이트)
LONG_BIT, LONG_MAX, LONG_MIN long int의 비트 수, 최댓값, 최솟값
MB_LEN_MAX 지원하는 로캘에서 한 문자의 최대 바이트 수
NGROUPS_MAX 프로세스마다 동시에 가질 수 있는 보조 그룹 ID 최대 수
NL_ARGMAX, NL_LANGMAX, NL_MSGMAX, NL_NMAX, NL_SETMAX, NL_TEXTMAX printf·scanf의 자릿수 최댓값, LANG 이름 최대 바이트, 최대 메시지 번호, N 대 1 대조 대응 최대 바이트, 최대 집합 번호, 메시지 문자열 최대 바이트
NZERO 기본 프로세스 우선순위
OPEN_MAX 한 프로세스가 동시에 열 수 있는 파일 최대 수
RE_DUP_MAX 정규식의 구간 표기(예: ed의 m, n)로 허용하는 반복 최대 수
SCHAR_MAX, SCHAR_MIN, SHRT_MAX, SHRT_MIN, UCHAR_MAX, UINT_MAX, ULONG_MAX, USHRT_MAX 각 정수형의 최댓값·최솟값
SSIZE_MAX ssize_t 객체의 최댓값
STREAM_MAX 한 프로세스가 동시에 열 수 있는 스트림 수
TMP_MAX tmpnam이 만드는 고유 경로 이름의 최소 수(믿고 부를 수 있는 최대 횟수)
TZNAME_MAX 시간대 이름의 최대 바이트 수(TZ 환경 변수의 길이가 아님)
WORD_BIT 워드(int)의 비트 수
KERNEL_BITMODE 커널의 비트 모드(32비트 또는 64비트)
REAL_MEMORY 실제 메모리 크기
HARDWARE_BITMODE 머신 하드웨어의 비트 모드(32비트 또는 64비트)
MP_CAPABLE 머신의 멀티프로세서(MP) 지원 여부

시스템 표준 구성 변수

특정 시스템 표준이 요구하는 최솟값입니다. _POSIX_, POSIX2_, _XOPEN_ 접두사는 각각 POSIX 1003.1, POSIX 1003.2, X/Open 표준이 요구하는 최솟값임을 나타냅니다. 표준은 응용 프로그램의 이식성을 위해 시스템이 지키는 시스템 전체 최솟값이며, 실제 시스템 값은 이보다 클 수 있습니다.

변수 뜻
_POSIX_ARG_MAX, _POSIX_CHILD_MAX, _POSIX_NGROUPS_MAX, _POSIX_OPEN_MAX, _POSIX_SSIZE_MAX, _POSIX_STREAM_MAX, _POSIX_TZNAME_MAX 같은 이름의 시스템 전체 변수에 해당하는 POSIX 최솟값
_POSIX_LINK_MAX, _POSIX_MAX_CANON, _POSIX_MAX_INPUT, _POSIX_NAME_MAX, _POSIX_PATH_MAX, _POSIX_PIPE_BUF 파일 링크 수, 단말 정규 입력 큐 바이트, 단말 입력 큐 바이트, 파일 이름 바이트, 경로 이름 바이트, 파이프에 원자적으로 쓸 수 있는 바이트의 최솟값
_POSIX_JOB_CONTROL 작업 제어를 지원하면 1
_POSIX_SAVED_IDS 1. 프로세스마다 저장된 set-user-ID와 set-group-ID가 있음
_POSIX_VERSION 따르는 POSIX 1 표준(C 언어 바인딩)의 버전
_XOPEN_CRYPT, _XOPEN_ENH_I18N, _XOPEN_SHM X/Open 암호화, 강화된 국제화, 공유 메모리 기능 그룹을 지원하면 1
_XOPEN_VERSION, _XOPEN_XCU_VERSION 따르는 X/Open 이식성 지침, 명령·유틸리티 규격의 버전
_XOPEN_XPG2, _XOPEN_XPG3, _XOPEN_XPG4 X/Open Portability Guide Volume 2(1987), XPG Issue 3(1992년 2월), CAE Issue 4(1992년 7월)를 지원하면 1, 아니면 정의되지 않음
POSIX2_BC_BASE_MAX, POSIX2_BC_DIM_MAX, POSIX2_BC_SCALE_MAX, POSIX2_BC_STRING_MAX, POSIX2_COLL_WEIGHTS_MAX, POSIX2_EXPR_NEST_MAX, POSIX2_LINE_MAX, POSIX2_RE_DUP_MAX 같은 이름의 시스템 전체 변수에 해당하는 POSIX 2 최솟값
POSIX2_CHAR_TERM, POSIX2_C_BIND, POSIX2_C_DEV, POSIX2_FORT_DEV, POSIX2_FORT_RUN, POSIX2_SW_DEV, POSIX2_UPE 단말 종류 하나 이상, C 언어 바인딩, C 개발 유틸리티, FORTRAN 개발·실행 유틸리티, 소프트웨어 개발 유틸리티, 사용자 이식성 유틸리티 옵션을 지원하면 1, 아니면 -1
POSIX2_LOCALEDEF localedef로 로캘을 만들 수 있으면 1, 아니면 정의되지 않음
POSIX2_C_VERSION 따르는 POSIX 2 표준(C 언어 바인딩)의 버전
POSIX2_VERSION 지원하는 최신 POSIX 2 표준의 승인 날짜(앞 네 자리 연도, 뒤 두 자리 월)
영어 원문

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

  • System standards 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.
  • KERNEL_BITMODE — Bit mode of the kernel, 32-bit or 64-bit.
  • REAL_MEMORY — Real memory size.
  • HARDWARE_BITMODE — Bit mode of the machine hardware, 32-bit or 64-bit.
  • MP_CAPABLE — MP-capability of the machine.
  • 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 undefined.
  • _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 that 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

PathConfiguration 매개변수는 시스템의 경로와 경로 구조에 관한 정보를 담은 경로 구성 변수를 지정합니다.

변수 뜻
_POSIX_CHOWN_RESTRICTED chown()은 적절한 특권이 있는 프로세스만, 그리고 파일의 그룹 ID를 프로세스의 실효 그룹 ID나 보조 그룹 ID로만 바꿀 수 있음. 경로가 디렉터리면 그 안의 디렉터리가 아닌 파일에 적용
_POSIX_NO_TRUNC NAME_MAX보다 긴 경로 이름은 오류가 남. 경로가 디렉터리면 그 안의 파일 이름에 적용
_POSIX_VDISABLE termios.h의 단말 특수 문자를 이 문자 값으로 끌 수 있음
LINK_MAX 한 파일의 최대 링크 수. 경로가 디렉터리면 그 디렉터리에 적용
MAX_CANON 단말 정규 입력 줄의 최대 바이트 수
MAX_INPUT 단말 입력 큐에서 쓸 수 있는 최대 바이트 수
NAME_MAX 파일 이름의 최대 바이트 수(끝의 null 제외). 경로가 디렉터리면 그 안의 파일 이름에 적용
PATH_MAX 경로 이름의 최대 바이트 수(끝의 null 포함). 경로가 디렉터리면 그 디렉터리가 작업 디렉터리일 때 상대 경로의 최대 길이
PIPE_BUF 파이프에 원자적으로 쓸 수 있는 최대 바이트. 경로가 FIFO·파이프면 그 객체에, 디렉터리면 그 안의 FIFO에 적용
DISK_PARTITION 디스크의 물리 파티션(PP) 크기. PathName에 디스크의 전체 경로를 줘야 함
DISK_SIZE 디스크 크기(MB). PathName에 디스크의 전체 경로를 줘야 함
영어 원문

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.
  • DISK_PARTITION — Physical partition size of the disk. Note: For the DISK_PARTITION path configuration variable, the PathName parameter must specify the complete path of the disk for which information is being queried.
  • DISK_SIZE — Disk size in megabytes. Note: For the DISK_SIZE path configuration variable, the PathName parameter must specify the complete path of the disk for which information is being queried.

Device Variables

DeviceVariable 매개변수는 DeviceName이 /dev/hdisk0 같은 장치 경로임을 나타냅니다. 디스크 경로를 주면 디스크의 장치 이름이나 위치를 보여 줍니다.

변수 뜻
DISK_DEVNAME 장치의 장치 이름이나 위치
영어 원문

The DeviceVariable parameter indicates that the DeviceName parameter is the path of a device, such as /dev/hdisk0. Given the path of a disk, the getconf command displays the device name or location of the disk.

  • DISK_DEVNAME — Device name or location of the device.

종료 상태

값 뜻
0 올바른 변수이고 현재 상태 정보를 성공적으로 씀
0보다 큼 오류
영어 원문

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.

예제

명령 하는 일
getconf ARG_MAX ARG_MAX 값
getconf NAME_MAX /usr /usr 디렉터리의 NAME_MAX 값
getconf DISK_SIZE /dev/hdisk0 (root) 디스크 hdisk0의 크기
getconf REAL_MEMORY 실제 메모리 크기
getconf HARDWARE_BITMODE 하드웨어가 32비트인지 64비트인지
getconf KERNEL_BITMODE 커널이 32비트인지 64비트인지
getconf DISK_DEVNAME hdisk0 디스크 hdisk0의 장치 이름이나 위치

정해지지 않은 결과를 다루는 셸 명령 예:

bash
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

컴파일 환경: getconf _XBS5_ILP32_OFF32가 -1이나 undefined를 쓰지 않으면 getconf -v XBS5_ILP32_OFF32 ... 형식의 명령으로 c89의 그 컴파일 환경에 해당하는 구성 변수 값을 정합니다. _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF64, _XBS5_LPBIG_OFFBIG도 같습니다.

자주 쓰는 형태:

bash
getconf KERNEL_BITMODE; getconf HARDWARE_BITMODE
getconf REAL_MEMORY                 # KB
getconf BOOT_DEVICE                 # 부팅 디스크(root)
getconf DISK_SIZE /dev/hdisk1       # MB(root)
getconf -a | grep -i max | head
영어 원문
  1. To display the value of the ARG_MAX variable, enter the following command:
getconf ARG_MAX
  1. To display the value of the NAME_MAX variable for the /usr directory, enter the following command:
getconf NAME_MAX /usr
  1. 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
  1. 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 ...

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

  1. 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 ...

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

  1. 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 ...

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

  1. 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

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

  1. To determine the disk size for disk hdisk0, as root user, enter the following command:
getconf DISK_SIZE /dev/hdisk0
  1. To determine the real memory size, enter the following command:
getconf REAL_MEMORY
  1. To determine if the machine hardware is 32-bit or 64-bit, enter the following command:
getconf HARDWARE_BITMODE
  1. To determine if the kernel is 32-bit or 64-bit, enter the following command:
getconf KERNEL_BITMODE
  1. To determine the device name or location of disk hdisk0, enter the following command:
getconf DISK_DEVNAME hdisk0

파일

파일 설명
/usr/bin/getconf getconf 명령
/usr/include/limits.h 시스템 구성 변수 정의
/usr/include/unistd.h 시스템 구성 변수 정의
영어 원문
  • /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:

  • confstr command
  • pathconf command
  • sysconf command
  • Commands command

리눅스(GNU)와 다른 점

리눅스에도 같은 getconf(glibc)가 있어 ARG_MAX, OPEN_MAX, PAGE_SIZE, LONG_BIT, NAME_MAX /처럼 씁니다. AIX 고유 변수(KERNEL_BITMODE, REAL_MEMORY, BOOT_DEVICE, DISK_SIZE)는 없으므로 uname -m, free -k, lsblk, findmnt /boot로 봅니다.