@Go to the ‰ŠP�”›first@�”˜, ‰ŠP�”›previous@�”˜, ‰ŠP�”›next@�”˜, ‰ŠP�”›last@�”˜ section, ‰ŠP�”›table of contents@�”˜.
Œ

ˆ‰SEC476Št�”›System Configuration Parameters

@�”˜The functions and macros listed in this chapter give information about configuration parameters of the operating system--for example, capacity limits, presence of optional POSIX features, and the default path for executable files (see section ‰ŠP�”›String-Valued Parameters@�”˜).
ˆ‰SEC477Št�”›General Capacity Limits

‰IDX2091Š‰IDX2092Š‰IDX2093Š
@�”˜The POSIX.1 and POSIX.2 standards specify a number of parameters that describe capacity limitations of the system. These limits can be fixed constants for a given operating system, or they can vary from machine to machine. For example, some limit values may be configurable by the system administrator, either at run time or by rebuilding the kernel, and this should not require recompiling application programs.
‰IDX2094Š@�”˜Each of the following limit parameters has a macro that is defined in H`limits.h'@ only if the system has a fixed, uniform limit for the parameter in question. If the system allows different file systems or files to have different limits, then the macro is undefined; use Hsysconf@ to find out the limit that applies at a particular time on a particular machine. See section ‰ŠP�”›Using Xsysconf@�”˜.
Each of these parameters also has another macro, with a name starting with H`_POSIX'@, which gives the lowest value that the limit is allowed to have on Bany@ POSIX system. See section ‰ŠP�”›Minimum Values for General Capacity Limits@�”˜.
‰IDX2095Š
A�”˜Macro:@ int DARG_MAX
Â‰IDX2096Š@�”˜If defined, the unvarying maximum combined length of the Bargv@ and Benviron@ arguments that can be passed to the Hexec@ functions.À

‰IDX2097Š
A�”˜Macro:@ int DCHILD_MAX
Â‰IDX2098Š@�”˜If defined, the unvarying maximum number of processes that can exist with the same real user ID at any one time. In BSD and GNU, this is controlled by the HRLIMIT_NPROC@ resource limit; see section ‰ŠP�”›Limiting Resource Usage@�”˜.À

‰IDX2099Š
A�”˜Macro:@ int DOPEN_MAX
Â‰IDX2100Š@�”˜If defined, the unvarying maximum number of files that a single process can have open simultaneously. In BSD and GNU, this is controlled by the HRLIMIT_NOFILE@ resource limit; see section ‰ŠP�”›Limiting Resource Usage@�”˜.À

AMacro:@ int DSTREAM_MAX
Â‰IDX2101Š@�”˜If defined, the unvarying maximum number of streams that a single process can have open simultaneously. See section ‰ŠP�”›Opening Streams@�”˜.À

‰IDX2102Š
A�”˜Macro:@ int DTZNAME_MAX
Â‰IDX2103Š@�”˜If defined, the unvarying maximum length of a time zone name. See section ‰ŠP�”›Functions and Variables for Time Zones@�”˜.À

These limit macros are always defined in H`limits.h'@.
‰IDX2104Š
A�”˜Macro:@ int DNGROUPS_MAX
Â‰IDX2105Š@�”˜The maximum number of supplementary group IDs that one process can have.
The value of this macro is actually a lower bound for the maximum. That is, you can count on being able to have that many supplementary group IDs, but a particular machine might let you have even more. You can use Hsysconf@ to see whether a particular machine will let you have more (see section ‰ŠP�”›Using Xsysconf@�”˜).À

AMacro:@ int DSSIZE_MAX
Â‰IDX2106Š@�”˜The largest value that can fit in an object of type Hssize_t@. Effectively, this is the limit on the number of bytes that can be read or written in a single operation.
This macro is defined in all POSIX systems because this limit is never configurable.À

AMacro:@ int DRE_DUP_MAX
Â‰IDX2107Š@�”˜The largest number of repetitions you are guaranteed is allowed in the construct H`\{JminH,JmaxH\}'@ in a regular expression.
The value of this macro is actually a lower bound for the maximum. That is, you can count on being able to have that many repetitions, but a particular machine might let you have even more. You can use Hsysconf@ to see whether a particular machine will let you have more (see section ‰ŠP�”›Using Xsysconf@�”˜). And even the value that Hsysconf@ tells you is just a lower bound--larger values might work.
This macro is defined in all POSIX.2 systems, because POSIX.2 says it should always be defined even if there is no specific imposed limit.À

ˆ‰SEC478Št�”›Overall System Options

‰IDX2108Š‰IDX2109Š
@�”˜POSIX defines certain system-specific options that not all POSIX systems support. Since these options are provided in the kernel, not in the library, simply using the GNU C library does not guarantee any of these features is supported; it depends on the system you are using.
‰IDX2110Š@�”˜You can test for the availability of a given option using the macros in this section, together with the function Hsysconf@. The macros are defined only if you include H`unistd.h'@.
For the following macros, if the macro is defined in H`unistd.h'@, then the option is supported. Otherwise, the option may or may not be supported; use Hsysconf@ to find out. See section ‰ŠP�”›Using Xsysconf@�”˜.

AMacro:@ int D_POSIX_JOB_CONTROL
Â‰IDX2111Š@�”˜If this symbol is defined, it indicates that the system supports job control. Otherwise, the implementation behaves as if all processes within a session belong to a single process group. See section ‰ŠP�”›Job Control@�”˜.À

AMacro:@ int D_POSIX_SAVED_IDS
Â‰IDX2112Š@�”˜If this symbol is defined, it indicates that the system remembers the effective user and group IDs of a process before it executes an executable file with the set-user-ID or set-group-ID bits set, and that explicitly changing the effective user or group IDs back to these values is permitted. If this option is not defined, then if a nonprivileged process changes its effective user or group ID to the real user or group ID of the process, it can't change it back again. See section ‰ŠP�”›Enabling and Disabling Setuid Access@�”˜.À

For the following macros, if the macro is defined in H`unistd.h'@, then its value indicates whether the option is supported. A value of H-1@ means no, and any other value means yes. If the macro is not defined, then the option may or may not be supported; use Hsysconf@ to find out. See section ‰ŠP�”›Using Xsysconf@�”˜.

AMacro:@ int D_POSIX2_C_DEV
Â‰IDX2113Š@�”˜If this symbol is defined, it indicates that the system has the POSIX.2 C compiler command, Hc89@. The GNU C library always defines this as H1@, on the assumption that you would not have installed it if you didn't have a C compiler.À

AMacro:@ int D_POSIX2_FORT_DEV
Â‰IDX2114Š@�”˜If this symbol is defined, it indicates that the system has the POSIX.2 Fortran compiler command, Hfort77@. The GNU C library never defines this, because we don't know what the system has.À

AMacro:@ int D_POSIX2_FORT_RUN
Â‰IDX2115Š@�”˜If this symbol is defined, it indicates that the system has the POSIX.2 Hasa@ command to interpret Fortran carriage control. The GNU C library never defines this, because we don't know what the system has.À

AMacro:@ int D_POSIX2_LOCALEDEF
Â‰IDX2116Š@�”˜If this symbol is defined, it indicates that the system has the POSIX.2 Hlocaledef@ command. The GNU C library never defines this, because we don't know what the system has.À

AMacro:@ int D_POSIX2_SW_DEV
Â‰IDX2117Š@�”˜If this symbol is defined, it indicates that the system has the POSIX.2 commands Har@, Hmake@, and Hstrip@. The GNU C library always defines this as H1@, on the assumption that you had to have Har@ and Hmake@ to install the library, and it's unlikely that Hstrip@ would be absent when those are present.À

ˆ‰SEC479Št�”›Which Version of POSIX is Supported

A�”˜Macro:@ long int D_POSIX_VERSION
Â‰IDX2118Š@�”˜This constant represents the version of the POSIX.1 standard to which the implementation conforms. For an implementation conforming to the 1990 POSIX.1 standard, the value is the integer H199009L@.
H_POSIX_VERSION@ is always defined (in H`unistd.h'@) in any POSIX system.
DUsage Note:@ Don't try to test whether the system supports POSIX by including H`unistd.h'@ and then checking whether H_POSIX_VERSION@ is defined. On a non-POSIX system, this will probably fail because there is no H`unistd.h'@. We do not know of Bany@ way you can reliably test at compilation time whether your target system supports POSIX or whether H`unistd.h'@ exists.
The GNU C compiler predefines the symbol H__POSIX__@ if the target system is a POSIX system. Provided you do not use any other compilers on POSIX systems, testing Hdefined (__POSIX__)@ will reliably detect such systems.À

AMacro:@ long int D_POSIX2_C_VERSION
Â‰IDX2119Š@�”˜This constant represents the version of the POSIX.2 standard which the library and system kernel support. We don't know what value this will be for the first version of the POSIX.2 standard, because the value is based on the year and month in which the standard is officially adopted.
The value of this symbol says nothing about the utilities installed on the system.
DUsage Note:@ You can use this macro to tell whether a POSIX.1 system library supports POSIX.2 as well. Any POSIX.1 system contains H`unistd.h'@, so include that file and then test Hdefined (_POSIX2_C_VERSION)@.À

ˆ‰SEC480Št�”›Using |sysconf

@�”˜When your system has configurable system limits, you can use the Hsysconf@ function to find out the value that applies to any particular machine. The function and the associated Bparameter@ constants are declared in the header file H`unistd.h'@.
ˆ‰SEC481ŠT�”›Definition of \sysconf

A�”˜Function:@ long int Dsysconf@ B(int Bparameter@)
Â‰IDX2120Š@�”˜This function is used to inquire about runtime system parameters. The Bparameter@ argument should be one of the H`_SC_'@ symbols listed below.
The normal return value from Hsysconf@ is the value you requested. A value of H-1@ is returned both if the implementation does not impose a limit, and in case of an error.
The following Herrno@ error conditions are defined for this function:
HEINVAL
Ä@The value of the Bparameter@ is invalid.Â
À

ˆ‰SEC482ŠT�”›Constants for \sysconfT Parameters

@�”˜Here are the symbolic constants for use as the Bparameter@ argument to Hsysconf@. The values are all integer constants (more specifically, enumeration type values).
H_SC_ARG_MAX
Â@Inquire about the parameter corresponding to HARG_MAX@.
ÀH_SC_CHILD_MAX
Â@Inquire about the parameter corresponding to HCHILD_MAX@.
ÀH_SC_OPEN_MAX
Â@Inquire about the parameter corresponding to HOPEN_MAX@.
ÀH_SC_STREAM_MAX
Â@Inquire about the parameter corresponding to HSTREAM_MAX@.
ÀH_SC_TZNAME_MAX
Â@Inquire about the parameter corresponding to HTZNAME_MAX@.
ÀH_SC_NGROUPS_MAX
Â@Inquire about the parameter corresponding to HNGROUPS_MAX@.
ÀH_SC_JOB_CONTROL
Â@Inquire about the parameter corresponding to H_POSIX_JOB_CONTROL@.
ÀH_SC_SAVED_IDS
Â@Inquire about the parameter corresponding to H_POSIX_SAVED_IDS@.
ÀH_SC_VERSION
Â@Inquire about the parameter corresponding to H_POSIX_VERSION@.
ÀH_SC_CLK_TCK
Â@Inquire about the parameter corresponding to HCLOCKS_PER_SEC@; see section ‰ŠP�”›Basic CPU Time Inquiry@�”˜.
ÀH_SC_2_C_DEV
Â@Inquire about whether the system has the POSIX.2 C compiler command, Hc89@.
ÀH_SC_2_FORT_DEV
Â@Inquire about whether the system has the POSIX.2 Fortran compiler command, Hfort77@.
ÀH_SC_2_FORT_RUN
Â@Inquire about whether the system has the POSIX.2 Hasa@ command to interpret Fortran carriage control.
ÀH_SC_2_LOCALEDEF
Â@Inquire about whether the system has the POSIX.2 Hlocaledef@ command.
ÀH_SC_2_SW_DEV
Â@Inquire about whether the system has the POSIX.2 commands Har@, Hmake@, and Hstrip@.
ÀH_SC_BC_BASE_MAX
Â@Inquire about the maximum value of Hobase@ in the Hbc@ utility.
ÀH_SC_BC_DIM_MAX
Â@Inquire about the maximum size of an array in the Hbc@ utility.
ÀH_SC_BC_SCALE_MAX
Â@Inquire about the maximum value of Hscale@ in the Hbc@ utility.
ÀH_SC_BC_STRING_MAX
Â@Inquire about the maximum size of a string constant in the Hbc@ utility.
ÀH_SC_COLL_WEIGHTS_MAX
Â@Inquire about the maximum number of weights that can necessarily be used in defining the collating sequence for a locale.
ÀH_SC_EXPR_NEST_MAX
Â@Inquire about the maximum number of expressions nested within parentheses when using the Hexpr@ utility.
ÀH_SC_LINE_MAX
Â@Inquire about the maximum size of a text line that the POSIX.2 text utilities can handle.
ÀH_SC_EQUIV_CLASS_MAX
Â@Inquire about the maximum number of weights that can be assigned to an entry of the HLC_COLLATE@ category H`order'@ keyword in a locale definition. The GNU C library does not presently support locale definitions.
ÀH_SC_VERSION
Â@Inquire about the version number of POSIX.1 that the library and kernel support.
ÀH_SC_2_VERSION
Â@Inquire about the version number of POSIX.2 that the system utilities support.
ÀH_SC_PAGESIZE
Â@Inquire about the virtual memory page size of the machine. Hgetpagesize@ returns the same value.À

ˆ‰SEC483ŠT�”›Examples of \sysconf

@�”˜We recommend that you first test for a macro definition for the parameter you are interested in, and call Hsysconf@ only if the macro is not defined. For example, here is how to test whether job control is supported: int
have_job_control (void)
{
#ifdef _POSIX_JOB_CONTROL
return 1;
#else
int value = sysconf (_SC_JOB_CONTROL);
if (value < 0)
/* If the system is that badly wedged,
there's no use trying to go on. */
fatal (strerror (errno));
return value;
#endif
}
Here is how to get the value of a numeric limit: int
get_child_max ()
{
#ifdef CHILD_MAX
return CHILD_MAX;
#else
int value = sysconf (_SC_CHILD_MAX);
if (value < 0)
fatal (strerror (errno));
return value;
#endif
}
ˆ‰SEC484Št�”›Minimum Values for General Capacity Limits

@�”˜Here are the names for the POSIX minimum upper bounds for the system limit parameters. The significance of these values is that you can safely push to these limits without checking whether the particular system you are using can go that far.
H_POSIX_ARG_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum combined length of the Bargv@ and Benviron@ arguments that can be passed to the Hexec@ functions. Its value is H4096@.
ÀH_POSIX_CHILD_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum number of simultaneous processes per real user ID. Its value is H6@.
ÀH_POSIX_NGROUPS_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum number of supplementary group IDs per process. Its value is H0@.
ÀH_POSIX_OPEN_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum number of files that a single process can have open simultaneously. Its value is H16@.
ÀH_POSIX_SSIZE_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum value that can be stored in an object of type Hssize_t@. Its value is H32767@.
ÀH_POSIX_STREAM_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum number of streams that a single process can have open simultaneously. Its value is H8@.
ÀH_POSIX_TZNAME_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the maximum length of a time zone name. Its value is H3@.
ÀH_POSIX2_RE_DUP_MAX
Â@The value of this macro is the most restrictive limit permitted by POSIX for the numbers used in the H`\{JminH,JmaxH\}'@ construct in a regular expression. Its value is H255@.À

ˆ‰SEC485Št�”›Limits on File System Capacity

@�”˜The POSIX.1 standard specifies a number of parameters that describe the limitations of the file system. It's possible for the system to have a fixed, uniform limit for a parameter, but this isn't the usual case. On most systems, it's possible for different file systems (and, for some parameters, even different files) to have different maximum limits. For example, this is very likely if you use NFS to mount some of the file systems from other machines.
‰IDX2121Š@�”˜Each of the following macros is defined in H`limits.h'@ only if the system has a fixed, uniform limit for the parameter in question. If the system allows different file systems or files to have different limits, then the macro is undefined; use Hpathconf@ or Hfpathconf@ to find out the limit that applies to a particular file. See section ‰ŠP�”›Using Xpathconf@�”˜.
Each parameter also has another macro, with a name starting with H`_POSIX'@, which gives the lowest value that the limit is allowed to have on Bany@ POSIX system. See section ‰ŠP�”›Minimum Values for File System Limits@�”˜.
‰IDX2122Š
A�”˜Macro:@ int DLINK_MAX
Â‰IDX2123Š@�”˜The uniform system limit (if any) for the number of names for a given file. See section ‰ŠP�”›Hard Links@�”˜.À

‰IDX2124Š
A�”˜Macro:@ int DMAX_CANON
Â‰IDX2125Š@�”˜The uniform system limit (if any) for the amount of text in a line of input when input editing is enabled. See section ‰ŠP�”›Two Styles of Input: Canonical or Not@�”˜.À

AMacro:@ int DMAX_INPUT
Â‰IDX2126Š@�”˜The uniform system limit (if any) for the total number of characters typed ahead as input. See section ‰ŠP�”›I/O Queues@�”˜.À

‰IDX2127Š
A�”˜Macro:@ int DNAME_MAX
Â‰IDX2128Š@�”˜The uniform system limit (if any) for the length of a file name component.À

AMacro:@ int DPATH_MAX
Â‰IDX2129Š@�”˜The uniform system limit (if any) for the length of an entire file name (that is, the argument given to system calls such as Hopen@).À

‰IDX2130Š
A�”˜Macro:@ int DPIPE_BUF
Â‰IDX2131Š@�”˜The uniform system limit (if any) for the number of bytes that can be written atomically to a pipe. If multiple processes are writing to the same pipe simultaneously, output from different processes might be interleaved in chunks of this size. See section ‰ŠP�”›Pipes and FIFOs@�”˜.À

These are alternative macro names for some of the same information.

AMacro:@ int DMAXNAMLEN
Â‰IDX2132Š@�”˜This is the BSD name for HNAME_MAX@. It is defined in H`dirent.h'@.À

AMacro:@ int DFILENAME_MAX
Â‰IDX2133Š@�”˜The value of this macro is an integer constant expression that represents the maximum length of a file name string. It is defined in H`stdio.h'@.
Unlike HPATH_MAX@, this macro is defined even if there is no actual limit imposed. In such a case, its value is typically a very large number. DThis is always the case on the GNU system.@
DUsage Note:@ Don't use HFILENAME_MAX@ as the size of an array in which to store a file name! You can't possibly make an array that big! Use dynamic allocation (see section ‰ŠP�”›Memory Allocation@�”˜) instead.À

ˆ‰SEC486Št�”›Optional Features in File Support

@�”˜POSIX defines certain system-specific options in the system calls for operating on files. Some systems support these options and others do not. Since these options are provided in the kernel, not in the library, simply using the GNU C library does not guarantee any of these features is supported; it depends on the system you are using. They can also vary between file systems on a single machine.
‰IDX2134Š@�”˜This section describes the macros you can test to determine whether a particular option is supported on your machine. If a given macro is defined in H`unistd.h'@, then its value says whether the corresponding feature is supported. (A value of H-1@ indicates no; any other value indicates yes.) If the macro is undefined, it means particular files may or may not support the feature.
Since all the machines that support the GNU C library also support NFS, one can never make a general statement about whether all file systems support the H_POSIX_CHOWN_RESTRICTED@ and H_POSIX_NO_TRUNC@ features. So these names are never defined as macros in the GNU C library.

AMacro:@ int D_POSIX_CHOWN_RESTRICTED
Â‰IDX2135Š@�”˜If this option is in effect, the Hchown@ function is restricted so that the only changes permitted to nonprivileged processes is to change the group owner of a file to either be the effective group ID of the process, or one of its supplementary group IDs. See section ‰ŠP�”›File Owner@�”˜.À

AMacro:@ int D_POSIX_NO_TRUNC
Â‰IDX2136Š@�”˜If this option is in effect, file name components longer than HNAME_MAX@ generate an HENAMETOOLONG@ error. Otherwise, file name components that are too long are silently truncated.À

AMacro:@ unsigned char D_POSIX_VDISABLE
Â‰IDX2137Š@�”˜This option is only meaningful for files that are terminal devices. If it is enabled, then handling for special control characters can be disabled individually. See section ‰ŠP�”›Special Characters@�”˜.À

‰IDX2138Š@�”˜If one of these macros is undefined, that means that the option might be in effect for some files and not for others. To inquire about a particular file, call Hpathconf@ or Hfpathconf@. See section ‰ŠP�”›Using Xpathconf@�”˜.
ˆ‰SEC487Št�”›Minimum Values for File System Limits

@�”˜Here are the names for the POSIX minimum upper bounds for some of the above parameters. The significance of these values is that you can safely push to these limits without checking whether the particular system you are using can go that far.
H_POSIX_LINK_MAX
Â@The most restrictive limit permitted by POSIX for the maximum value of a file's link count. The value of this constant is H8@; thus, you can always make up to eight names for a file without running into a system limit.
ÀH_POSIX_MAX_CANON
Â@The most restrictive limit permitted by POSIX for the maximum number of bytes in a canonical input line from a terminal device. The value of this constant is H255@.
ÀH_POSIX_MAX_INPUT
Â@The most restrictive limit permitted by POSIX for the maximum number of bytes in a terminal device input queue (or typeahead buffer). See section ‰ŠP�”›Input Modes@�”˜. The value of this constant is H255@.
ÀH_POSIX_NAME_MAX
Â@The most restrictive limit permitted by POSIX for the maximum number of bytes in a file name component. The value of this constant is H14@.
ÀH_POSIX_PATH_MAX
Â@The most restrictive limit permitted by POSIX for the maximum number of bytes in a file name. The value of this constant is H255@.
ÀH_POSIX_PIPE_BUF
Â@The most restrictive limit permitted by POSIX for the maximum number of bytes that can be written atomically to a pipe. The value of this constant is H512@.À

ˆ‰SEC488Št�”›Using |pathconf

@�”˜When your machine allows different files to have different values for a file system parameter, you can use the functions in this section to find out the value that applies to any particular file.
These functions and the associated constants for the Bparameter@ argument are declared in the header file H`unistd.h'@.

AFunction:@ long int Dpathconf@ B(const char *Bfilename@, int Bparameter@)
Â‰IDX2139Š@�”˜This function is used to inquire about the limits that apply to the file named Bfilename@.
The Bparameter@ argument should be one of the H`_PC_'@ constants listed below.
The normal return value from Hpathconf@ is the value you requested. A value of H-1@ is returned both if the implementation does not impose a limit, and in case of an error. In the former case, Herrno@ is not set, while in the latter case, Herrno@ is set to indicate the cause of the problem. So the only way to use this function robustly is to store H0@ into Herrno@ just before calling it.
Besides the usual file name errors (see section ‰ŠP�”›File Name Errors@�”˜), the following error condition is defined for this function:
HEINVAL
Ä@The value of Bparameter@ is invalid, or the implementation doesn't support the Bparameter@ for the specific file.Â
À

AFunction:@ long int Dfpathconf@ B(int Bfiledes@, int Bparameter@)
Â‰IDX2140Š@�”˜This is just like Hpathconf@ except that an open file descriptor is used to specify the file for which information is requested, instead of a file name.
The following Herrno@ error conditions are defined for this function:
HEBADF
Ä@The Bfiledes@ argument is not a valid file descriptor.
ÂHEINVAL
Ä@The value of Bparameter@ is invalid, or the implementation doesn't support the Bparameter@ for the specific file.Â
À

Here are the symbolic constants that you can use as the Bparameter@ argument to Hpathconf@ and Hfpathconf@. The values are all integer constants.
H_PC_LINK_MAX
Â@Inquire about the value of HLINK_MAX@.
ÀH_PC_MAX_CANON
Â@Inquire about the value of HMAX_CANON@.
ÀH_PC_MAX_INPUT
Â@Inquire about the value of HMAX_INPUT@.
ÀH_PC_NAME_MAX
Â@Inquire about the value of HNAME_MAX@.
ÀH_PC_PATH_MAX
Â@Inquire about the value of HPATH_MAX@.
ÀH_PC_PIPE_BUF
Â@Inquire about the value of HPIPE_BUF@.
ÀH_PC_CHOWN_RESTRICTED
Â@Inquire about the value of H_POSIX_CHOWN_RESTRICTED@.
ÀH_PC_NO_TRUNC
Â@Inquire about the value of H_POSIX_NO_TRUNC@.
ÀH_PC_VDISABLE
Â@Inquire about the value of H_POSIX_VDISABLE@.À

ˆ‰SEC489Št�”›Utility Program Capacity Limits

@�”˜The POSIX.2 standard specifies certain system limits that you can access through Hsysconf@ that apply to utility behavior rather than the behavior of the library or the operating system.
The GNU C library defines macros for these limits, and Hsysconf@ returns values for them if you ask; but these values convey no meaningful information. They are simply the smallest values that POSIX.2 permits.

AMacro:@ int DBC_BASE_MAX
Â‰IDX2141Š@�”˜The largest value of Hobase@ that the Hbc@ utility is guaranteed to support.À

AMacro:@ int DBC_SCALE_MAX
Â‰IDX2142Š@�”˜The largest value of Hscale@ that the Hbc@ utility is guaranteed to support.À

AMacro:@ int DBC_DIM_MAX
Â‰IDX2143Š@�”˜The largest number of elements in one array that the Hbc@ utility is guaranteed to support.À

AMacro:@ int DBC_STRING_MAX
Â‰IDX2144Š@�”˜The largest number of characters in one string constant that the Hbc@ utility is guaranteed to support.À

AMacro:@ int DBC_DIM_MAX
Â‰IDX2145Š@�”˜The largest number of elements in one array that the Hbc@ utility is guaranteed to support.À

AMacro:@ int DCOLL_WEIGHTS_MAX
Â‰IDX2146Š@�”˜The largest number of weights that can necessarily be used in defining the collating sequence for a locale.À

AMacro:@ int DEXPR_NEST_MAX
Â‰IDX2147Š@�”˜The maximum number of expressions that can be nested within parenthesis by the Hexpr@ utility.À

AMacro:@ int DLINE_MAX
Â‰IDX2148Š@�”˜The largest text line that the text-oriented POSIX.2 utilities can support. (If you are using the GNU versions of these utilities, then there is no actual limit except that imposed by the available virtual memory, but there is no way that the library can tell you this.)À

AMacro:@ int DEQUIV_CLASS_MAX
Â‰IDX2149Š@�”˜The maximum number of weights that can be assigned to an entry of the HLC_COLLATE@ category H`order'@ keyword in a locale definition. The GNU C library does not presently support locale definitions.À

ˆ‰SEC490Št�”›Minimum Values for Utility Limits

H�”˜_POSIX2_BC_BASE_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum value of Hobase@ in the Hbc@ utility. Its value is H99@.
ÀH_POSIX2_BC_DIM_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum size of an array in the Hbc@ utility. Its value is H2048@.
ÀH_POSIX2_BC_SCALE_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum value of Hscale@ in the Hbc@ utility. Its value is H99@.
ÀH_POSIX2_BC_STRING_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum size of a string constant in the Hbc@ utility. Its value is H1000@.
ÀH_POSIX2_COLL_WEIGHTS_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum number of weights that can necessarily be used in defining the collating sequence for a locale. Its value is H2@.
ÀH_POSIX2_EXPR_NEST_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum number of expressions nested within parenthesis when using the Hexpr@ utility. Its value is H32@.
ÀH_POSIX2_LINE_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum size of a text line that the text utilities can handle. Its value is H2048@.
ÀH_POSIX2_EQUIV_CLASS_MAX
Â@The most restrictive limit permitted by POSIX.2 for the maximum number of weights that can be assigned to an entry of the HLC_COLLATE@ category H`order'@ keyword in a locale definition. Its value is H2@. The GNU C library does not presently support locale definitions.À

ˆ‰SEC491Št�”›String-Valued Parameters

@�”˜POSIX.2 defines a way to get string-valued parameters from the operating system with the function Hconfstr@:

AFunction:@ size_t Dconfstr@ B(int Bparameter@, char *Bbuf@, size_t Blen@)
Â‰IDX2150Š@�”˜This function reads the value of a string-valued system parameter, storing the string into Blen@ bytes of memory space starting at Bbuf@. The Bparameter@ argument should be one of the H`_CS_'@ symbols listed below.
The normal return value from Hconfstr@ is the length of the string value that you asked for. If you supply a null pointer for Bbuf@, then Hconfstr@ does not try to store the string; it just returns its length. A value of H0@ indicates an error.
If the string you asked for is too long for the buffer (that is, longer than JlenH - 1@), then Hconfstr@ stores just that much (leaving room for the terminating null character). You can tell that this has happened because Hconfstr@ returns a value greater than or equal to Blen@.
The following Herrno@ error conditions are defined for this function:
HEINVAL
Ä@The value of the Bparameter@ is invalid.Â
À

Currently there is just one parameter you can read with Hconfstr@:
H_CS_PATH
Â@This parameter's value is the recommended default path for searching for executable files. This is the path that a user has by default just after logging in.À

The way to use Hconfstr@ without any arbitrary limit on string size is to call it twice: first call it to get the length, allocate the buffer accordingly, and then call Hconfstr@ again to fill the buffer, like this: char *
get_default_path (void)
{
size_t len = confstr (_CS_PATH, NULL, 0);
char *buffer = (char *) xmalloc (len);

if (confstr (_CS_PATH, buf, len + 1) == 0)
{
free (buffer);
return NULL;
}

return buffer;
}
Œ
Go to the ‰ŠP�”›first@�”˜, ‰ŠP�”›previous@�”˜, ‰ŠP�”›next@�”˜, ‰ŠP�”›last@�”˜ section, ‰ŠP�”›table of contents@�”˜.