Blame manual/conf.texi

Packit 6c4009
@node System Configuration, Cryptographic Functions, System Management, Top
Packit 6c4009
@c %MENU% Parameters describing operating system limits
Packit 6c4009
@chapter System Configuration Parameters
Packit 6c4009
Packit 6c4009
The functions and macros listed in this chapter give information about
Packit 6c4009
configuration parameters of the operating system---for example, capacity
Packit 6c4009
limits, presence of optional POSIX features, and the default path for
Packit 6c4009
executable files (@pxref{String Parameters}).
Packit 6c4009
Packit 6c4009
@menu
Packit 6c4009
* General Limits::           Constants and functions that describe
Packit 6c4009
				various process-related limits that have
Packit 6c4009
				one uniform value for any given machine.
Packit 6c4009
* System Options::           Optional POSIX features.
Packit 6c4009
* Version Supported::        Version numbers of POSIX.1 and POSIX.2.
Packit 6c4009
* Sysconf::                  Getting specific configuration values
Packit 6c4009
                                of general limits and system options.
Packit 6c4009
* Minimums::                 Minimum values for general limits.
Packit 6c4009
Packit 6c4009
* Limits for Files::         Size limitations that pertain to individual files.
Packit 6c4009
                                These can vary between file systems
Packit 6c4009
                                or even from file to file.
Packit 6c4009
* Options for Files::        Optional features that some files may support.
Packit 6c4009
* File Minimums::            Minimum values for file limits.
Packit 6c4009
* Pathconf::                 Getting the limit values for a particular file.
Packit 6c4009
Packit 6c4009
* Utility Limits::           Capacity limits of some POSIX.2 utility programs.
Packit 6c4009
* Utility Minimums::         Minimum allowable values of those limits.
Packit 6c4009
Packit 6c4009
* String Parameters::        Getting the default search path.
Packit 6c4009
@end menu
Packit 6c4009
Packit 6c4009
@node General Limits
Packit 6c4009
@section General Capacity Limits
Packit 6c4009
@cindex POSIX capacity limits
Packit 6c4009
@cindex limits, POSIX
Packit 6c4009
@cindex capacity limits, POSIX
Packit 6c4009
Packit 6c4009
The POSIX.1 and POSIX.2 standards specify a number of parameters that
Packit 6c4009
describe capacity limitations of the system.  These limits can be fixed
Packit 6c4009
constants for a given operating system, or they can vary from machine to
Packit 6c4009
machine.  For example, some limit values may be configurable by the
Packit 6c4009
system administrator, either at run time or by rebuilding the kernel,
Packit 6c4009
and this should not require recompiling application programs.
Packit 6c4009
Packit 6c4009
@pindex limits.h
Packit 6c4009
Each of the following limit parameters has a macro that is defined in
Packit 6c4009
@file{limits.h} only if the system has a fixed, uniform limit for the
Packit 6c4009
parameter in question.  If the system allows different file systems or
Packit 6c4009
files to have different limits, then the macro is undefined; use
Packit 6c4009
@code{sysconf} to find out the limit that applies at a particular time
Packit 6c4009
on a particular machine.  @xref{Sysconf}.
Packit 6c4009
Packit 6c4009
Each of these parameters also has another macro, with a name starting
Packit 6c4009
with @samp{_POSIX}, which gives the lowest value that the limit is
Packit 6c4009
allowed to have on @emph{any} POSIX system.  @xref{Minimums}.
Packit 6c4009
Packit 6c4009
@cindex limits, program argument size
Packit 6c4009
@deftypevr Macro int ARG_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
If defined, the unvarying maximum combined length of the @var{argv} and
Packit 6c4009
@var{environ} arguments that can be passed to the @code{exec} functions.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, number of processes
Packit 6c4009
@deftypevr Macro int CHILD_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
If defined, the unvarying maximum number of processes that can exist
Packit 6c4009
with the same real user ID at any one time.  In BSD and GNU, this is
Packit 6c4009
controlled by the @code{RLIMIT_NPROC} resource limit; @pxref{Limits on
Packit 6c4009
Resources}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, number of open files
Packit 6c4009
@deftypevr Macro int OPEN_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
If defined, the unvarying maximum number of files that a single process
Packit 6c4009
can have open simultaneously.  In BSD and GNU, this is controlled
Packit 6c4009
by the @code{RLIMIT_NOFILE} resource limit; @pxref{Limits on Resources}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int STREAM_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
If defined, the unvarying maximum number of streams that a single
Packit 6c4009
process can have open simultaneously.  @xref{Opening Streams}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, time zone name length
Packit 6c4009
@deftypevr Macro int TZNAME_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
If defined, the unvarying maximum length of a time zone name.
Packit 6c4009
@xref{Time Zone Functions}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
These limit macros are always defined in @file{limits.h}.
Packit 6c4009
Packit 6c4009
@cindex limits, number of supplementary group IDs
Packit 6c4009
@deftypevr Macro int NGROUPS_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The maximum number of supplementary group IDs that one process can have.
Packit 6c4009
Packit 6c4009
The value of this macro is actually a lower bound for the maximum.  That
Packit 6c4009
is, you can count on being able to have that many supplementary group
Packit 6c4009
IDs, but a particular machine might let you have even more.  You can use
Packit 6c4009
@code{sysconf} to see whether a particular machine will let you have
Packit 6c4009
more (@pxref{Sysconf}).
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro ssize_t SSIZE_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The largest value that can fit in an object of type @code{ssize_t}.
Packit 6c4009
Effectively, this is the limit on the number of bytes that can be read
Packit 6c4009
or written in a single operation.
Packit 6c4009
Packit 6c4009
This macro is defined in all POSIX systems because this limit is never
Packit 6c4009
configurable.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int RE_DUP_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest number of repetitions you are guaranteed is allowed in the
Packit 6c4009
construct @samp{\@{@var{min},@var{max}\@}} in a regular expression.
Packit 6c4009
Packit 6c4009
The value of this macro is actually a lower bound for the maximum.  That
Packit 6c4009
is, you can count on being able to have that many repetitions, but a
Packit 6c4009
particular machine might let you have even more.  You can use
Packit 6c4009
@code{sysconf} to see whether a particular machine will let you have
Packit 6c4009
more (@pxref{Sysconf}).  And even the value that @code{sysconf} tells
Packit 6c4009
you is just a lower bound---larger values might work.
Packit 6c4009
Packit 6c4009
This macro is defined in all POSIX.2 systems, because POSIX.2 says it
Packit 6c4009
should always be defined even if there is no specific imposed limit.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@node System Options
Packit 6c4009
@section Overall System Options
Packit 6c4009
@cindex POSIX optional features
Packit 6c4009
@cindex optional POSIX features
Packit 6c4009
Packit 6c4009
POSIX defines certain system-specific options that not all POSIX systems
Packit 6c4009
support.  Since these options are provided in the kernel, not in the
Packit 6c4009
library, simply using @theglibc{} does not guarantee any of these
Packit 6c4009
features are supported; it depends on the system you are using.
Packit 6c4009
Packit 6c4009
@pindex unistd.h
Packit 6c4009
You can test for the availability of a given option using the macros in
Packit 6c4009
this section, together with the function @code{sysconf}.  The macros are
Packit 6c4009
defined only if you include @file{unistd.h}.
Packit 6c4009
Packit 6c4009
For the following macros, if the macro is defined in @file{unistd.h},
Packit 6c4009
then the option is supported.  Otherwise, the option may or may not be
Packit 6c4009
supported; use @code{sysconf} to find out.  @xref{Sysconf}.
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX_JOB_CONTROL
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system supports job
Packit 6c4009
control.  Otherwise, the implementation behaves as if all processes
Packit 6c4009
within a session belong to a single process group.  @xref{Job Control}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX_SAVED_IDS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system remembers the
Packit 6c4009
effective user and group IDs of a process before it executes an
Packit 6c4009
executable file with the set-user-ID or set-group-ID bits set, and that
Packit 6c4009
explicitly changing the effective user or group IDs back to these values
Packit 6c4009
is permitted.  If this option is not defined, then if a nonprivileged
Packit 6c4009
process changes its effective user or group ID to the real user or group
Packit 6c4009
ID of the process, it can't change it back again.  @xref{Enable/Disable
Packit 6c4009
Setuid}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
For the following macros, if the macro is defined in @file{unistd.h},
Packit 6c4009
then its value indicates whether the option is supported.  A value of
Packit 6c4009
@code{-1} means no, and any other value means yes.  If the macro is not
Packit 6c4009
defined, then the option may or may not be supported; use @code{sysconf}
Packit 6c4009
to find out.  @xref{Sysconf}.
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX2_C_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system has the POSIX.2
Packit 6c4009
C compiler command, @code{c89}.  @Theglibc{} always defines this
Packit 6c4009
as @code{1}, on the assumption that you would not have installed it if
Packit 6c4009
you didn't have a C compiler.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX2_FORT_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system has the POSIX.2
Packit 6c4009
Fortran compiler command, @code{fort77}.  @Theglibc{} never
Packit 6c4009
defines this, because we don't know what the system has.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX2_FORT_RUN
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system has the POSIX.2
Packit 6c4009
@code{asa} command to interpret Fortran carriage control.  @Theglibc{}
Packit 6c4009
never defines this, because we don't know what the system has.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX2_LOCALEDEF
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system has the POSIX.2
Packit 6c4009
@code{localedef} command.  @Theglibc{} never defines this, because
Packit 6c4009
we don't know what the system has.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX2_SW_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
If this symbol is defined, it indicates that the system has the POSIX.2
Packit 6c4009
commands @code{ar}, @code{make}, and @code{strip}.  @Theglibc{}
Packit 6c4009
always defines this as @code{1}, on the assumption that you had to have
Packit 6c4009
@code{ar} and @code{make} to install the library, and it's unlikely that
Packit 6c4009
@code{strip} would be absent when those are present.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@node Version Supported
Packit 6c4009
@section Which Version of POSIX is Supported
Packit 6c4009
Packit 6c4009
@deftypevr Macro {long int} _POSIX_VERSION
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
This constant represents the version of the POSIX.1 standard to which
Packit 6c4009
the implementation conforms.  For an implementation conforming to the
Packit 6c4009
1995 POSIX.1 standard, the value is the integer @code{199506L}.
Packit 6c4009
Packit 6c4009
@code{_POSIX_VERSION} is always defined (in @file{unistd.h}) in any
Packit 6c4009
POSIX system.
Packit 6c4009
Packit 6c4009
@strong{Usage Note:} Don't try to test whether the system supports POSIX
Packit 6c4009
by including @file{unistd.h} and then checking whether
Packit 6c4009
@code{_POSIX_VERSION} is defined.  On a non-POSIX system, this will
Packit 6c4009
probably fail because there is no @file{unistd.h}.  We do not know of
Packit 6c4009
@emph{any} way you can reliably test at compilation time whether your
Packit 6c4009
target system supports POSIX or whether @file{unistd.h} exists.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro {long int} _POSIX2_C_VERSION
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
This constant represents the version of the POSIX.2 standard which the
Packit 6c4009
library and system kernel support.  We don't know what value this will
Packit 6c4009
be for the first version of the POSIX.2 standard, because the value is
Packit 6c4009
based on the year and month in which the standard is officially adopted.
Packit 6c4009
Packit 6c4009
The value of this symbol says nothing about the utilities installed on
Packit 6c4009
the system.
Packit 6c4009
Packit 6c4009
@strong{Usage Note:} You can use this macro to tell whether a POSIX.1
Packit 6c4009
system library supports POSIX.2 as well.  Any POSIX.1 system contains
Packit 6c4009
@file{unistd.h}, so include that file and then test @code{defined
Packit 6c4009
(_POSIX2_C_VERSION)}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@node Sysconf
Packit 6c4009
@section Using @code{sysconf}
Packit 6c4009
Packit 6c4009
When your system has configurable system limits, you can use the
Packit 6c4009
@code{sysconf} function to find out the value that applies to any
Packit 6c4009
particular machine.  The function and the associated @var{parameter}
Packit 6c4009
constants are declared in the header file @file{unistd.h}.
Packit 6c4009
Packit 6c4009
@menu
Packit 6c4009
* Sysconf Definition::        Detailed specifications of @code{sysconf}.
Packit 6c4009
* Constants for Sysconf::     The list of parameters @code{sysconf} can read.
Packit 6c4009
* Examples of Sysconf::       How to use @code{sysconf} and the parameter
Packit 6c4009
				 macros properly together.
Packit 6c4009
@end menu
Packit 6c4009
Packit 6c4009
@node Sysconf Definition
Packit 6c4009
@subsection Definition of @code{sysconf}
Packit 6c4009
Packit 6c4009
@deftypefun {long int} sysconf (int @var{parameter})
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
@safety{@prelim{}@mtsafe{@mtsenv{}}@asunsafe{@asulock{} @ascuheap{}}@acunsafe{@aculock{} @acsmem{} @acsfd{}}}
Packit 6c4009
@c Some parts of the implementation open /proc and /sys files and dirs
Packit 6c4009
@c to collect system details, using fd and stream I/O depending on the
Packit 6c4009
@c case.  The returned max value may change over time for NPROCS,
Packit 6c4009
@c NPROCS_CONF, PHYS_PAGES, AVPHYS_PAGES, NGROUPS_MAX, SIGQUEUE_MAX,
Packit 6c4009
@c depending on variable values read from /proc at each call, and from
Packit 6c4009
@c rlimit-obtained values CHILD_MAX, OPEN_MAX, ARG_MAX, SIGQUEUE_MAX.
Packit 6c4009
This function is used to inquire about runtime system parameters.  The
Packit 6c4009
@var{parameter} argument should be one of the @samp{_SC_} symbols listed
Packit 6c4009
below.
Packit 6c4009
Packit 6c4009
The normal return value from @code{sysconf} is the value you requested.
Packit 6c4009
A value of @code{-1} is returned both if the implementation does not
Packit 6c4009
impose a limit, and in case of an error.
Packit 6c4009
Packit 6c4009
The following @code{errno} error conditions are defined for this function:
Packit 6c4009
Packit 6c4009
@table @code
Packit 6c4009
@item EINVAL
Packit 6c4009
The value of the @var{parameter} is invalid.
Packit 6c4009
@end table
Packit 6c4009
@end deftypefun
Packit 6c4009
Packit 6c4009
@node Constants for Sysconf
Packit 6c4009
@subsection Constants for @code{sysconf} Parameters
Packit 6c4009
Packit 6c4009
Here are the symbolic constants for use as the @var{parameter} argument
Packit 6c4009
to @code{sysconf}.  The values are all integer constants (more
Packit 6c4009
specifically, enumeration type values).
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _SC_ARG_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{ARG_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_CHILD_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{CHILD_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_OPEN_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{OPEN_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_STREAM_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{STREAM_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_TZNAME_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{TZNAME_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NGROUPS_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NGROUPS_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_JOB_CONTROL
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_JOB_CONTROL}.
Packit 6c4009
Packit 6c4009
@item _SC_SAVED_IDS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SAVED_IDS}.
Packit 6c4009
Packit 6c4009
@item _SC_VERSION
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_VERSION}.
Packit 6c4009
Packit 6c4009
@item _SC_CLK_TCK
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the number of clock ticks per second; @pxref{CPU Time}.
Packit 6c4009
The corresponding parameter @code{CLK_TCK} is obsolete.
Packit 6c4009
Packit 6c4009
@item _SC_CHARCLASS_NAME_MAX
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to maximal length allowed for
Packit 6c4009
a character class name in an extended locale specification.  These
Packit 6c4009
extensions are not yet standardized and so this option is not standardized
Packit 6c4009
as well.
Packit 6c4009
Packit 6c4009
@item _SC_REALTIME_SIGNALS
Packit 6c4009
@standards{POSIX.1, unistdh.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_REALTIME_SIGNALS}.
Packit 6c4009
Packit 6c4009
@item _SC_PRIORITY_SCHEDULING
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PRIORITY_SCHEDULING}.
Packit 6c4009
Packit 6c4009
@item _SC_TIMERS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_TIMERS}.
Packit 6c4009
Packit 6c4009
@item _SC_ASYNCHRONOUS_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_ASYNCHRONOUS_IO}.
Packit 6c4009
Packit 6c4009
@item _SC_PRIORITIZED_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PRIORITIZED_IO}.
Packit 6c4009
Packit 6c4009
@item _SC_SYNCHRONIZED_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SYNCHRONIZED_IO}.
Packit 6c4009
Packit 6c4009
@item _SC_FSYNC
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_FSYNC}.
Packit 6c4009
Packit 6c4009
@item _SC_MAPPED_FILES
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MAPPED_FILES}.
Packit 6c4009
Packit 6c4009
@item _SC_MEMLOCK
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MEMLOCK}.
Packit 6c4009
Packit 6c4009
@item _SC_MEMLOCK_RANGE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MEMLOCK_RANGE}.
Packit 6c4009
Packit 6c4009
@item _SC_MEMORY_PROTECTION
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MEMORY_PROTECTION}.
Packit 6c4009
Packit 6c4009
@item _SC_MESSAGE_PASSING
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MESSAGE_PASSING}.
Packit 6c4009
Packit 6c4009
@item _SC_SEMAPHORES
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SEMAPHORES}.
Packit 6c4009
Packit 6c4009
@item _SC_SHARED_MEMORY_OBJECTS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to@*
Packit 6c4009
@code{_POSIX_SHARED_MEMORY_OBJECTS}.
Packit 6c4009
Packit 6c4009
@item _SC_AIO_LISTIO_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_AIO_LISTIO_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_AIO_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_AIO_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_AIO_PRIO_DELTA_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value by which a process can decrease its asynchronous I/O
Packit 6c4009
priority level from its own scheduling priority.  This corresponds to the
Packit 6c4009
run-time invariant value @code{AIO_PRIO_DELTA_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_DELAYTIMER_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_DELAYTIMER_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_MQ_OPEN_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MQ_OPEN_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_MQ_PRIO_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_MQ_PRIO_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_RTSIG_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_RTSIG_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_SEM_NSEMS_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SEM_NSEMS_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_SEM_VALUE_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SEM_VALUE_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_SIGQUEUE_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SIGQUEUE_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_TIMER_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_TIMER_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_PII
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_XTI
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_XTI}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_SOCKET
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_SOCKET}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_INTERNET
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_OSI
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI}.
Packit 6c4009
Packit 6c4009
@item _SC_SELECT
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_SELECT}.
Packit 6c4009
Packit 6c4009
@item _SC_UIO_MAXIOV
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_UIO_MAXIOV}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_INTERNET_STREAM
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET_STREAM}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_INTERNET_DGRAM
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET_DGRAM}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_OSI_COTS
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_COTS}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_OSI_CLTS
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_CLTS}.
Packit 6c4009
Packit 6c4009
@item _SC_PII_OSI_M
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_M}.
Packit 6c4009
Packit 6c4009
@item _SC_T_IOV_MAX
Packit 6c4009
@standards{POSIX.1g, unistd.h}
Packit 6c4009
Inquire about the value associated with the @code{T_IOV_MAX}
Packit 6c4009
variable.
Packit 6c4009
Packit 6c4009
@item _SC_THREADS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREADS}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_SAFE_FUNCTIONS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to@*
Packit 6c4009
@code{_POSIX_THREAD_SAFE_FUNCTIONS}.
Packit 6c4009
Packit 6c4009
@item _SC_GETGR_R_SIZE_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_GETGR_R_SIZE_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_GETPW_R_SIZE_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_GETPW_R_SIZE_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_LOGIN_NAME_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_LOGIN_NAME_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_TTY_NAME_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_TTY_NAME_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_DESTRUCTOR_ITERATIONS
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to
Packit 6c4009
@code{_POSIX_THREAD_DESTRUCTOR_ITERATIONS}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_KEYS_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREAD_KEYS_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_STACK_MIN
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREAD_STACK_MIN}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_THREADS_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREAD_THREADS_MAX}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_ATTR_STACKADDR
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to@*a
Packit 6c4009
@code{_POSIX_THREAD_ATTR_STACKADDR}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_ATTR_STACKSIZE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to@*
Packit 6c4009
@code{_POSIX_THREAD_ATTR_STACKSIZE}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_PRIORITY_SCHEDULING
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to
Packit 6c4009
@code{_POSIX_THREAD_PRIORITY_SCHEDULING}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_PRIO_INHERIT
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREAD_PRIO_INHERIT}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_PRIO_PROTECT
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_POSIX_THREAD_PRIO_PROTECT}.
Packit 6c4009
Packit 6c4009
@item _SC_THREAD_PROCESS_SHARED
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to
Packit 6c4009
@code{_POSIX_THREAD_PROCESS_SHARED}.
Packit 6c4009
Packit 6c4009
@item _SC_2_C_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about whether the system has the POSIX.2 C compiler command,
Packit 6c4009
@code{c89}.
Packit 6c4009
Packit 6c4009
@item _SC_2_FORT_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about whether the system has the POSIX.2 Fortran compiler
Packit 6c4009
command, @code{fort77}.
Packit 6c4009
Packit 6c4009
@item _SC_2_FORT_RUN
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about whether the system has the POSIX.2 @code{asa} command to
Packit 6c4009
interpret Fortran carriage control.
Packit 6c4009
Packit 6c4009
@item _SC_2_LOCALEDEF
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about whether the system has the POSIX.2 @code{localedef}
Packit 6c4009
command.
Packit 6c4009
Packit 6c4009
@item _SC_2_SW_DEV
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about whether the system has the POSIX.2 commands @code{ar},
Packit 6c4009
@code{make}, and @code{strip}.
Packit 6c4009
Packit 6c4009
@item _SC_BC_BASE_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum value of @code{obase} in the @code{bc}
Packit 6c4009
utility.
Packit 6c4009
Packit 6c4009
@item _SC_BC_DIM_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum size of an array in the @code{bc}
Packit 6c4009
utility.
Packit 6c4009
Packit 6c4009
@item _SC_BC_SCALE_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum value of @code{scale} in the @code{bc}
Packit 6c4009
utility.
Packit 6c4009
Packit 6c4009
@item _SC_BC_STRING_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum size of a string constant in the
Packit 6c4009
@code{bc} utility.
Packit 6c4009
Packit 6c4009
@item _SC_COLL_WEIGHTS_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum number of weights that can necessarily
Packit 6c4009
be used in defining the collating sequence for a locale.
Packit 6c4009
Packit 6c4009
@item _SC_EXPR_NEST_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum number of expressions nested within
Packit 6c4009
parentheses when using the @code{expr} utility.
Packit 6c4009
Packit 6c4009
@item _SC_LINE_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum size of a text line that the POSIX.2 text
Packit 6c4009
utilities can handle.
Packit 6c4009
Packit 6c4009
@item _SC_EQUIV_CLASS_MAX
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the maximum number of weights that can be assigned to an
Packit 6c4009
entry of the @code{LC_COLLATE} category @samp{order} keyword in a locale
Packit 6c4009
definition.  @Theglibc{} does not presently support locale
Packit 6c4009
definitions.
Packit 6c4009
Packit 6c4009
@item _SC_VERSION
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the version number of POSIX.1 that the library and kernel
Packit 6c4009
support.
Packit 6c4009
Packit 6c4009
@item _SC_2_VERSION
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
Inquire about the version number of POSIX.2 that the system utilities
Packit 6c4009
support.
Packit 6c4009
Packit 6c4009
@item _SC_PAGESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the virtual memory page size of the machine.
Packit 6c4009
@code{getpagesize} returns the same value (@pxref{Query Memory Parameters}).
Packit 6c4009
Packit 6c4009
@item _SC_NPROCESSORS_CONF
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the number of configured processors.
Packit 6c4009
Packit 6c4009
@item _SC_NPROCESSORS_ONLN
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the number of processors online.
Packit 6c4009
Packit 6c4009
@item _SC_PHYS_PAGES
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the number of physical pages in the system.
Packit 6c4009
Packit 6c4009
@item _SC_AVPHYS_PAGES
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the number of available physical pages in the system.
Packit 6c4009
Packit 6c4009
@item _SC_ATEXIT_MAX
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the number of functions which can be registered as termination
Packit 6c4009
functions for @code{atexit}; @pxref{Cleanups on Exit}.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_ICACHE_SIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the size of the Level 1 instruction cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_ICACHE_ASSOC
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the associativity of the Level 1 instruction cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_ICACHE_LINESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the line length of the Level 1 instruction cache.
Packit 6c4009
Packit 6c4009
On aarch64, the cache line size returned is the minimum instruction cache line
Packit 6c4009
size observable by userspace.  This is typically the same as the L1 icache
Packit 6c4009
size but on some cores it may not be so.  However, it is specified in the
Packit 6c4009
architecture that operations such as cache line invalidation are consistent
Packit 6c4009
with the size reported with this variable.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_DCACHE_SIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the size of the Level 1 data cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_DCACHE_ASSOC
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the associativity of the Level 1 data cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL1_DCACHE_LINESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the line length of the Level 1 data cache.
Packit 6c4009
Packit 6c4009
On aarch64, the cache line size returned is the minimum data cache line size
Packit 6c4009
observable by userspace.  This is typically the same as the L1 dcache size but
Packit 6c4009
on some cores it may not be so.  However, it is specified in the architecture
Packit 6c4009
that operations such as cache line invalidation are consistent with the size
Packit 6c4009
reported with this variable.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL2_CACHE_SIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the size of the Level 2 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL2_CACHE_ASSOC
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the associativity of the Level 2 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL2_CACHE_LINESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the line length of the Level 2 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL3_CACHE_SIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the size of the Level 3 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL3_CACHE_ASSOC
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the associativity of the Level 3 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL3_CACHE_LINESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the line length of the Level 3 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL4_CACHE_SIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the size of the Level 4 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL4_CACHE_ASSOC
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the associativity of the Level 4 cache.
Packit 6c4009
Packit 6c4009
@item _SC_LEVEL4_CACHE_LINESIZE
Packit 6c4009
@standards{GNU, unistd.h}
Packit 6c4009
Inquire about the line length of the Level 4 cache.
Packit 6c4009
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_VERSION
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_VERSION}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_XCU_VERSION
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_XCU_VERSION}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_UNIX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_UNIX}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_REALTIME
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_REALTIME}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_REALTIME_THREADS
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_REALTIME_THREADS}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_LEGACY
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_LEGACY}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_CRYPT
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}.
Packit 6c4009
@Theglibc no longer implements the @code{_XOPEN_CRYPT} extensions,
Packit 6c4009
so @samp{sysconf (_SC_XOPEN_CRYPT)} always returns @code{-1}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_ENH_I18N
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_ENH_I18N}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_SHM
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_SHM}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_XPG2
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_XPG2}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_XPG3
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_XPG3}.
Packit 6c4009
Packit 6c4009
@item _SC_XOPEN_XPG4
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{_XOPEN_XPG4}.
Packit 6c4009
Packit 6c4009
@item _SC_CHAR_BIT
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the number of bits in a variable of type @code{char}.
Packit 6c4009
Packit 6c4009
@item _SC_CHAR_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{char}.
Packit 6c4009
Packit 6c4009
@item _SC_CHAR_MIN
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the minimum value which can be stored in a variable of type
Packit 6c4009
@code{char}.
Packit 6c4009
Packit 6c4009
@item _SC_INT_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{int}.
Packit 6c4009
Packit 6c4009
@item _SC_INT_MIN
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the minimum value which can be stored in a variable of type
Packit 6c4009
@code{int}.
Packit 6c4009
Packit 6c4009
@item _SC_LONG_BIT
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the number of bits in a variable of type @code{long int}.
Packit 6c4009
Packit 6c4009
@item _SC_WORD_BIT
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the number of bits in a variable of a register word.
Packit 6c4009
Packit 6c4009
@item _SC_MB_LEN_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum length of a multi-byte representation of a wide
Packit 6c4009
character value.
Packit 6c4009
Packit 6c4009
@item _SC_NZERO
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the value used to internally represent the zero priority level for
Packit 6c4009
the process execution.
Packit 6c4009
Packit 6c4009
@item _SC_SSIZE_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{ssize_t}.
Packit 6c4009
Packit 6c4009
@item _SC_SCHAR_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{signed char}.
Packit 6c4009
Packit 6c4009
@item _SC_SCHAR_MIN
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the minimum value which can be stored in a variable of type
Packit 6c4009
@code{signed char}.
Packit 6c4009
Packit 6c4009
@item _SC_SHRT_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{short int}.
Packit 6c4009
Packit 6c4009
@item _SC_SHRT_MIN
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the minimum value which can be stored in a variable of type
Packit 6c4009
@code{short int}.
Packit 6c4009
Packit 6c4009
@item _SC_UCHAR_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{unsigned char}.
Packit 6c4009
Packit 6c4009
@item _SC_UINT_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{unsigned int}.
Packit 6c4009
Packit 6c4009
@item _SC_ULONG_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{unsigned long int}.
Packit 6c4009
Packit 6c4009
@item _SC_USHRT_MAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the maximum value which can be stored in a variable of type
Packit 6c4009
@code{unsigned short int}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_ARGMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NL_ARGMAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_LANGMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NL_LANGMAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_MSGMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NL_MSGMAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_NMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about  the parameter corresponding to @code{NL_NMAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_SETMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NL_SETMAX}.
Packit 6c4009
Packit 6c4009
@item _SC_NL_TEXTMAX
Packit 6c4009
@standards{X/Open, unistd.h}
Packit 6c4009
Inquire about the parameter corresponding to @code{NL_TEXTMAX}.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
@node Examples of Sysconf
Packit 6c4009
@subsection Examples of @code{sysconf}
Packit 6c4009
Packit 6c4009
We recommend that you first test for a macro definition for the
Packit 6c4009
parameter you are interested in, and call @code{sysconf} only if the
Packit 6c4009
macro is not defined.  For example, here is how to test whether job
Packit 6c4009
control is supported:
Packit 6c4009
Packit 6c4009
@smallexample
Packit 6c4009
@group
Packit 6c4009
int
Packit 6c4009
have_job_control (void)
Packit 6c4009
@{
Packit 6c4009
#ifdef _POSIX_JOB_CONTROL
Packit 6c4009
  return 1;
Packit 6c4009
#else
Packit 6c4009
  int value = sysconf (_SC_JOB_CONTROL);
Packit 6c4009
  if (value < 0)
Packit 6c4009
    /* @r{If the system is that badly wedged,}
Packit 6c4009
       @r{there's no use trying to go on.}  */
Packit 6c4009
    fatal (strerror (errno));
Packit 6c4009
  return value;
Packit 6c4009
#endif
Packit 6c4009
@}
Packit 6c4009
@end group
Packit 6c4009
@end smallexample
Packit 6c4009
Packit 6c4009
Here is how to get the value of a numeric limit:
Packit 6c4009
Packit 6c4009
@smallexample
Packit 6c4009
int
Packit 6c4009
get_child_max ()
Packit 6c4009
@{
Packit 6c4009
#ifdef CHILD_MAX
Packit 6c4009
  return CHILD_MAX;
Packit 6c4009
#else
Packit 6c4009
  int value = sysconf (_SC_CHILD_MAX);
Packit 6c4009
  if (value < 0)
Packit 6c4009
    fatal (strerror (errno));
Packit 6c4009
  return value;
Packit 6c4009
#endif
Packit 6c4009
@}
Packit 6c4009
@end smallexample
Packit 6c4009
Packit 6c4009
@node Minimums
Packit 6c4009
@section Minimum Values for General Capacity Limits
Packit 6c4009
Packit 6c4009
Here are the names for the POSIX minimum upper bounds for the system
Packit 6c4009
limit parameters.  The significance of these values is that you can
Packit 6c4009
safely push to these limits without checking whether the particular
Packit 6c4009
system you are using can go that far.
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _POSIX_AIO_LISTIO_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
I/O operations that can be specified in a list I/O call.  The value of
Packit 6c4009
this constant is @code{2}; thus you can add up to two new entries
Packit 6c4009
of the list of outstanding operations.
Packit 6c4009
Packit 6c4009
@item _POSIX_AIO_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
outstanding asynchronous I/O operations.  The value of this constant is
Packit 6c4009
@code{1}.  So you cannot expect that you can issue more than one
Packit 6c4009
operation and immediately continue with the normal work, receiving the
Packit 6c4009
notifications asynchronously.
Packit 6c4009
Packit 6c4009
@item _POSIX_ARG_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum combined length of the @var{argv} and @var{environ}
Packit 6c4009
arguments that can be passed to the @code{exec} functions.
Packit 6c4009
Its value is @code{4096}.
Packit 6c4009
Packit 6c4009
@item _POSIX_CHILD_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum number of simultaneous processes per real user ID.  Its
Packit 6c4009
value is @code{6}.
Packit 6c4009
Packit 6c4009
@item _POSIX_NGROUPS_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum number of supplementary group IDs per process.  Its
Packit 6c4009
value is @code{0}.
Packit 6c4009
Packit 6c4009
@item _POSIX_OPEN_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum number of files that a single process can have open
Packit 6c4009
simultaneously.  Its value is @code{16}.
Packit 6c4009
Packit 6c4009
@item _POSIX_SSIZE_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum value that can be stored in an object of type
Packit 6c4009
@code{ssize_t}.  Its value is @code{32767}.
Packit 6c4009
Packit 6c4009
@item _POSIX_STREAM_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum number of streams that a single process can have open
Packit 6c4009
simultaneously.  Its value is @code{8}.
Packit 6c4009
Packit 6c4009
@item _POSIX_TZNAME_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the maximum length of a time zone name.  Its value is @code{3}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_RE_DUP_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The value of this macro is the most restrictive limit permitted by POSIX
Packit 6c4009
for the numbers used in the @samp{\@{@var{min},@var{max}\@}} construct
Packit 6c4009
in a regular expression.  Its value is @code{255}.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
@node Limits for Files
Packit 6c4009
@section Limits on File System Capacity
Packit 6c4009
Packit 6c4009
The POSIX.1 standard specifies a number of parameters that describe the
Packit 6c4009
limitations of the file system.  It's possible for the system to have a
Packit 6c4009
fixed, uniform limit for a parameter, but this isn't the usual case.  On
Packit 6c4009
most systems, it's possible for different file systems (and, for some
Packit 6c4009
parameters, even different files) to have different maximum limits.  For
Packit 6c4009
example, this is very likely if you use NFS to mount some of the file
Packit 6c4009
systems from other machines.
Packit 6c4009
Packit 6c4009
@pindex limits.h
Packit 6c4009
Each of the following macros is defined in @file{limits.h} only if the
Packit 6c4009
system has a fixed, uniform limit for the parameter in question.  If the
Packit 6c4009
system allows different file systems or files to have different limits,
Packit 6c4009
then the macro is undefined; use @code{pathconf} or @code{fpathconf} to
Packit 6c4009
find out the limit that applies to a particular file.  @xref{Pathconf}.
Packit 6c4009
Packit 6c4009
Each parameter also has another macro, with a name starting with
Packit 6c4009
@samp{_POSIX}, which gives the lowest value that the limit is allowed to
Packit 6c4009
have on @emph{any} POSIX system.  @xref{File Minimums}.
Packit 6c4009
Packit 6c4009
@cindex limits, link count of files
Packit 6c4009
@deftypevr Macro int LINK_MAX
Packit 6c4009
@standards{POSIX.1, limits.h (optional)}
Packit 6c4009
The uniform system limit (if any) for the number of names for a given
Packit 6c4009
file.  @xref{Hard Links}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, terminal input queue
Packit 6c4009
@deftypevr Macro int MAX_CANON
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The uniform system limit (if any) for the amount of text in a line of
Packit 6c4009
input when input editing is enabled.  @xref{Canonical or Not}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int MAX_INPUT
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The uniform system limit (if any) for the total number of characters
Packit 6c4009
typed ahead as input.  @xref{I/O Queues}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, file name length
Packit 6c4009
@deftypevr Macro int NAME_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The uniform system limit (if any) for the length of a file name component, not
Packit 6c4009
including the terminating null character.
Packit 6c4009
Packit 6c4009
@strong{Portability Note:} On some systems, @theglibc{} defines
Packit 6c4009
@code{NAME_MAX}, but does not actually enforce this limit.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int PATH_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The uniform system limit (if any) for the length of an entire file name (that
Packit 6c4009
is, the argument given to system calls such as @code{open}), including the
Packit 6c4009
terminating null character.
Packit 6c4009
Packit 6c4009
@strong{Portability Note:} @Theglibc{} does not enforce this limit
Packit 6c4009
even if @code{PATH_MAX} is defined.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@cindex limits, pipe buffer size
Packit 6c4009
@deftypevr Macro int PIPE_BUF
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The uniform system limit (if any) for the number of bytes that can be
Packit 6c4009
written atomically to a pipe.  If multiple processes are writing to the
Packit 6c4009
same pipe simultaneously, output from different processes might be
Packit 6c4009
interleaved in chunks of this size.  @xref{Pipes and FIFOs}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
These are alternative macro names for some of the same information.
Packit 6c4009
Packit 6c4009
@deftypevr Macro int MAXNAMLEN
Packit 6c4009
@standards{BSD, dirent.h}
Packit 6c4009
This is the BSD name for @code{NAME_MAX}.  It is defined in
Packit 6c4009
@file{dirent.h}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int FILENAME_MAX
Packit 6c4009
@standards{ISO, stdio.h}
Packit 6c4009
The value of this macro is an integer constant expression that
Packit 6c4009
represents the maximum length of a file name string.  It is defined in
Packit 6c4009
@file{stdio.h}.
Packit 6c4009
Packit 6c4009
Unlike @code{PATH_MAX}, this macro is defined even if there is no actual
Packit 6c4009
limit imposed.  In such a case, its value is typically a very large
Packit 6c4009
number.  @strong{This is always the case on @gnuhurdsystems{}.}
Packit 6c4009
Packit 6c4009
@strong{Usage Note:} Don't use @code{FILENAME_MAX} as the size of an
Packit 6c4009
array in which to store a file name!  You can't possibly make an array
Packit 6c4009
that big!  Use dynamic allocation (@pxref{Memory Allocation}) instead.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@node Options for Files
Packit 6c4009
@section Optional Features in File Support
Packit 6c4009
Packit 6c4009
POSIX defines certain system-specific options in the system calls for
Packit 6c4009
operating on files.  Some systems support these options and others do
Packit 6c4009
not.  Since these options are provided in the kernel, not in the
Packit 6c4009
library, simply using @theglibc{} does not guarantee that any of these
Packit 6c4009
features is supported; it depends on the system you are using.  They can
Packit 6c4009
also vary between file systems on a single machine.
Packit 6c4009
Packit 6c4009
@pindex unistd.h
Packit 6c4009
This section describes the macros you can test to determine whether a
Packit 6c4009
particular option is supported on your machine.  If a given macro is
Packit 6c4009
defined in @file{unistd.h}, then its value says whether the
Packit 6c4009
corresponding feature is supported.  (A value of @code{-1} indicates no;
Packit 6c4009
any other value indicates yes.)  If the macro is undefined, it means
Packit 6c4009
particular files may or may not support the feature.
Packit 6c4009
Packit 6c4009
Since all the machines that support @theglibc{} also support NFS,
Packit 6c4009
one can never make a general statement about whether all file systems
Packit 6c4009
support the @code{_POSIX_CHOWN_RESTRICTED} and @code{_POSIX_NO_TRUNC}
Packit 6c4009
features.  So these names are never defined as macros in @theglibc{}.
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX_CHOWN_RESTRICTED
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
If this option is in effect, the @code{chown} function is restricted so
Packit 6c4009
that the only changes permitted to nonprivileged processes is to change
Packit 6c4009
the group owner of a file to either be the effective group ID of the
Packit 6c4009
process, or one of its supplementary group IDs.  @xref{File Owner}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int _POSIX_NO_TRUNC
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
If this option is in effect, file name components longer than
Packit 6c4009
@code{NAME_MAX} generate an @code{ENAMETOOLONG} error.  Otherwise, file
Packit 6c4009
name components that are too long are silently truncated.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro {unsigned char} _POSIX_VDISABLE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
This option is only meaningful for files that are terminal devices.
Packit 6c4009
If it is enabled, then handling for special control characters can
Packit 6c4009
be disabled individually.  @xref{Special Characters}.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@pindex unistd.h
Packit 6c4009
If one of these macros is undefined, that means that the option might be
Packit 6c4009
in effect for some files and not for others.  To inquire about a
Packit 6c4009
particular file, call @code{pathconf} or @code{fpathconf}.
Packit 6c4009
@xref{Pathconf}.
Packit 6c4009
Packit 6c4009
@node File Minimums
Packit 6c4009
@section Minimum Values for File System Limits
Packit 6c4009
Packit 6c4009
Here are the names for the POSIX minimum upper bounds for some of the
Packit 6c4009
above parameters.  The significance of these values is that you can
Packit 6c4009
safely push to these limits without checking whether the particular
Packit 6c4009
system you are using can go that far.  In most cases @gnusystems{} do not
Packit 6c4009
have these strict limitations.  The actual limit should be requested if
Packit 6c4009
necessary.
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _POSIX_LINK_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum value of a
Packit 6c4009
file's link count.  The value of this constant is @code{8}; thus, you
Packit 6c4009
can always make up to eight names for a file without running into a
Packit 6c4009
system limit.
Packit 6c4009
Packit 6c4009
@item _POSIX_MAX_CANON
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
bytes in a canonical input line from a terminal device.  The value of
Packit 6c4009
this constant is @code{255}.
Packit 6c4009
Packit 6c4009
@item _POSIX_MAX_INPUT
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
bytes in a terminal device input queue (or typeahead buffer).
Packit 6c4009
@xref{Input Modes}.  The value of this constant is @code{255}.
Packit 6c4009
Packit 6c4009
@item _POSIX_NAME_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
bytes in a file name component.  The value of this constant is
Packit 6c4009
@code{14}.
Packit 6c4009
Packit 6c4009
@item _POSIX_PATH_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
bytes in a file name.  The value of this constant is @code{256}.
Packit 6c4009
Packit 6c4009
@item _POSIX_PIPE_BUF
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX for the maximum number of
Packit 6c4009
bytes that can be written atomically to a pipe.  The value of this
Packit 6c4009
constant is @code{512}.
Packit 6c4009
Packit 6c4009
@item SYMLINK_MAX
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
Maximum number of bytes in a symbolic link.
Packit 6c4009
Packit 6c4009
@item POSIX_REC_INCR_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
Recommended increment for file transfer sizes between the
Packit 6c4009
@code{POSIX_REC_MIN_XFER_SIZE} and @code{POSIX_REC_MAX_XFER_SIZE}
Packit 6c4009
values.
Packit 6c4009
Packit 6c4009
@item POSIX_REC_MAX_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
Maximum recommended file transfer size.
Packit 6c4009
Packit 6c4009
@item POSIX_REC_MIN_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
Minimum recommended file transfer size.
Packit 6c4009
Packit 6c4009
@item POSIX_REC_XFER_ALIGN
Packit 6c4009
@standards{POSIX.1, limits.h}
Packit 6c4009
Recommended file transfer buffer alignment.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
@node Pathconf
Packit 6c4009
@section Using @code{pathconf}
Packit 6c4009
Packit 6c4009
When your machine allows different files to have different values for a
Packit 6c4009
file system parameter, you can use the functions in this section to find
Packit 6c4009
out the value that applies to any particular file.
Packit 6c4009
Packit 6c4009
These functions and the associated constants for the @var{parameter}
Packit 6c4009
argument are declared in the header file @file{unistd.h}.
Packit 6c4009
Packit 6c4009
@deftypefun {long int} pathconf (const char *@var{filename}, int @var{parameter})
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{} @ascuheap{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
Packit 6c4009
@c When __statfs_link_max finds an ext* filesystem, it may read
Packit 6c4009
@c /proc/mounts or similar as a mntent stream.
Packit 6c4009
@c __statfs_chown_restricted may read from
Packit 6c4009
@c /proc/sys/fs/xfs/restrict_chown as a file descriptor.
Packit 6c4009
This function is used to inquire about the limits that apply to
Packit 6c4009
the file named @var{filename}.
Packit 6c4009
Packit 6c4009
The @var{parameter} argument should be one of the @samp{_PC_} constants
Packit 6c4009
listed below.
Packit 6c4009
Packit 6c4009
The normal return value from @code{pathconf} is the value you requested.
Packit 6c4009
A value of @code{-1} is returned both if the implementation does not
Packit 6c4009
impose a limit, and in case of an error.  In the former case,
Packit 6c4009
@code{errno} is not set, while in the latter case, @code{errno} is set
Packit 6c4009
to indicate the cause of the problem.  So the only way to use this
Packit 6c4009
function robustly is to store @code{0} into @code{errno} just before
Packit 6c4009
calling it.
Packit 6c4009
Packit 6c4009
Besides the usual file name errors (@pxref{File Name Errors}),
Packit 6c4009
the following error condition is defined for this function:
Packit 6c4009
Packit 6c4009
@table @code
Packit 6c4009
@item EINVAL
Packit 6c4009
The value of @var{parameter} is invalid, or the implementation doesn't
Packit 6c4009
support the @var{parameter} for the specific file.
Packit 6c4009
@end table
Packit 6c4009
@end deftypefun
Packit 6c4009
Packit 6c4009
@deftypefun {long int} fpathconf (int @var{filedes}, int @var{parameter})
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{} @ascuheap{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
Packit 6c4009
@c Same caveats as pathconf.
Packit 6c4009
This is just like @code{pathconf} except that an open file descriptor
Packit 6c4009
is used to specify the file for which information is requested, instead
Packit 6c4009
of a file name.
Packit 6c4009
Packit 6c4009
The following @code{errno} error conditions are defined for this function:
Packit 6c4009
Packit 6c4009
@table @code
Packit 6c4009
@item EBADF
Packit 6c4009
The @var{filedes} argument is not a valid file descriptor.
Packit 6c4009
Packit 6c4009
@item EINVAL
Packit 6c4009
The value of @var{parameter} is invalid, or the implementation doesn't
Packit 6c4009
support the @var{parameter} for the specific file.
Packit 6c4009
@end table
Packit 6c4009
@end deftypefun
Packit 6c4009
Packit 6c4009
Here are the symbolic constants that you can use as the @var{parameter}
Packit 6c4009
argument to @code{pathconf} and @code{fpathconf}.  The values are all
Packit 6c4009
integer constants.
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _PC_LINK_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{LINK_MAX}.
Packit 6c4009
Packit 6c4009
@item _PC_MAX_CANON
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{MAX_CANON}.
Packit 6c4009
Packit 6c4009
@item _PC_MAX_INPUT
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{MAX_INPUT}.
Packit 6c4009
Packit 6c4009
@item _PC_NAME_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{NAME_MAX}.
Packit 6c4009
Packit 6c4009
@item _PC_PATH_MAX
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{PATH_MAX}.
Packit 6c4009
Packit 6c4009
@item _PC_PIPE_BUF
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{PIPE_BUF}.
Packit 6c4009
Packit 6c4009
@item _PC_CHOWN_RESTRICTED
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_CHOWN_RESTRICTED}.
Packit 6c4009
Packit 6c4009
@item _PC_NO_TRUNC
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_NO_TRUNC}.
Packit 6c4009
Packit 6c4009
@item _PC_VDISABLE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_VDISABLE}.
Packit 6c4009
Packit 6c4009
@item _PC_SYNC_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_SYNC_IO}.
Packit 6c4009
Packit 6c4009
@item _PC_ASYNC_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_ASYNC_IO}.
Packit 6c4009
Packit 6c4009
@item _PC_PRIO_IO
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{_POSIX_PRIO_IO}.
Packit 6c4009
Packit 6c4009
@item _PC_FILESIZEBITS
Packit 6c4009
@standards{LFS, unistd.h}
Packit 6c4009
Inquire about the availability of large files on the filesystem.
Packit 6c4009
Packit 6c4009
@item _PC_REC_INCR_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{POSIX_REC_INCR_XFER_SIZE}.
Packit 6c4009
Packit 6c4009
@item _PC_REC_MAX_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{POSIX_REC_MAX_XFER_SIZE}.
Packit 6c4009
Packit 6c4009
@item _PC_REC_MIN_XFER_SIZE
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{POSIX_REC_MIN_XFER_SIZE}.
Packit 6c4009
Packit 6c4009
@item _PC_REC_XFER_ALIGN
Packit 6c4009
@standards{POSIX.1, unistd.h}
Packit 6c4009
Inquire about the value of @code{POSIX_REC_XFER_ALIGN}.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
@strong{Portability Note:} On some systems, @theglibc{} does not
Packit 6c4009
enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits.
Packit 6c4009
Packit 6c4009
@node Utility Limits
Packit 6c4009
@section Utility Program Capacity Limits
Packit 6c4009
Packit 6c4009
The POSIX.2 standard specifies certain system limits that you can access
Packit 6c4009
through @code{sysconf} that apply to utility behavior rather than the
Packit 6c4009
behavior of the library or the operating system.
Packit 6c4009
Packit 6c4009
@Theglibc{} defines macros for these limits, and @code{sysconf}
Packit 6c4009
returns values for them if you ask; but these values convey no
Packit 6c4009
meaningful information.  They are simply the smallest values that
Packit 6c4009
POSIX.2 permits.
Packit 6c4009
Packit 6c4009
@deftypevr Macro int BC_BASE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest value of @code{obase} that the @code{bc} utility is
Packit 6c4009
guaranteed to support.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int BC_DIM_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest number of elements in one array that the @code{bc} utility
Packit 6c4009
is guaranteed to support.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int BC_SCALE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest value of @code{scale} that the @code{bc} utility is
Packit 6c4009
guaranteed to support.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int BC_STRING_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest number of characters in one string constant that the
Packit 6c4009
@code{bc} utility is guaranteed to support.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int COLL_WEIGHTS_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest number of weights that can necessarily be used in defining
Packit 6c4009
the collating sequence for a locale.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int EXPR_NEST_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The maximum number of expressions that can be nested within parentheses
Packit 6c4009
by the @code{expr} utility.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int LINE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The largest text line that the text-oriented POSIX.2 utilities can
Packit 6c4009
support.  (If you are using the GNU versions of these utilities, then
Packit 6c4009
there is no actual limit except that imposed by the available virtual
Packit 6c4009
memory, but there is no way that the library can tell you this.)
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@deftypevr Macro int EQUIV_CLASS_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The maximum number of weights that can be assigned to an entry of the
Packit 6c4009
@code{LC_COLLATE} category @samp{order} keyword in a locale definition.
Packit 6c4009
@Theglibc{} does not presently support locale definitions.
Packit 6c4009
@end deftypevr
Packit 6c4009
Packit 6c4009
@node Utility Minimums
Packit 6c4009
@section Minimum Values for Utility Limits
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _POSIX2_BC_BASE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum value of
Packit 6c4009
@code{obase} in the @code{bc} utility.  Its value is @code{99}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_BC_DIM_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum size of
Packit 6c4009
an array in the @code{bc} utility.  Its value is @code{2048}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_BC_SCALE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum value of
Packit 6c4009
@code{scale} in the @code{bc} utility.  Its value is @code{99}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_BC_STRING_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum size of
Packit 6c4009
a string constant in the @code{bc} utility.  Its value is @code{1000}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_COLL_WEIGHTS_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum number
Packit 6c4009
of weights that can necessarily be used in defining the collating
Packit 6c4009
sequence for a locale.  Its value is @code{2}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_EXPR_NEST_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum number
Packit 6c4009
of expressions nested within parenthesis when using the @code{expr} utility.
Packit 6c4009
Its value is @code{32}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_LINE_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum size of
Packit 6c4009
a text line that the text utilities can handle.  Its value is
Packit 6c4009
@code{2048}.
Packit 6c4009
Packit 6c4009
@item _POSIX2_EQUIV_CLASS_MAX
Packit 6c4009
@standards{POSIX.2, limits.h}
Packit 6c4009
The most restrictive limit permitted by POSIX.2 for the maximum number
Packit 6c4009
of weights that can be assigned to an entry of the @code{LC_COLLATE}
Packit 6c4009
category @samp{order} keyword in a locale definition.  Its value is
Packit 6c4009
@code{2}.  @Theglibc{} does not presently support locale
Packit 6c4009
definitions.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
@node String Parameters
Packit 6c4009
@section String-Valued Parameters
Packit 6c4009
Packit 6c4009
POSIX.2 defines a way to get string-valued parameters from the operating
Packit 6c4009
system with the function @code{confstr}:
Packit 6c4009
Packit 6c4009
@deftypefun size_t confstr (int @var{parameter}, char *@var{buf}, size_t @var{len})
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit 6c4009
This function reads the value of a string-valued system parameter,
Packit 6c4009
storing the string into @var{len} bytes of memory space starting at
Packit 6c4009
@var{buf}.  The @var{parameter} argument should be one of the
Packit 6c4009
@samp{_CS_} symbols listed below.
Packit 6c4009
Packit 6c4009
The normal return value from @code{confstr} is the length of the string
Packit 6c4009
value that you asked for.  If you supply a null pointer for @var{buf},
Packit 6c4009
then @code{confstr} does not try to store the string; it just returns
Packit 6c4009
its length.  A value of @code{0} indicates an error.
Packit 6c4009
Packit 6c4009
If the string you asked for is too long for the buffer (that is, longer
Packit 6c4009
than @code{@var{len} - 1}), then @code{confstr} stores just that much
Packit 6c4009
(leaving room for the terminating null character).  You can tell that
Packit 6c4009
this has happened because @code{confstr} returns a value greater than or
Packit 6c4009
equal to @var{len}.
Packit 6c4009
Packit 6c4009
The following @code{errno} error conditions are defined for this function:
Packit 6c4009
Packit 6c4009
@table @code
Packit 6c4009
@item EINVAL
Packit 6c4009
The value of the @var{parameter} is invalid.
Packit 6c4009
@end table
Packit 6c4009
@end deftypefun
Packit 6c4009
Packit 6c4009
Currently there is just one parameter you can read with @code{confstr}:
Packit 6c4009
Packit 6c4009
@vtable @code
Packit 6c4009
@item _CS_PATH
Packit 6c4009
@standards{POSIX.2, unistd.h}
Packit 6c4009
This parameter's value is the recommended default path for searching for
Packit 6c4009
executable files.  This is the path that a user has by default just
Packit 6c4009
after logging in.
Packit 6c4009
Packit 6c4009
@item _CS_LFS_CFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the C compiler if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS_LDFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the linker if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS_LIBS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional libraries must be linked
Packit 6c4009
to the application if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS_LINTFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the lint tool if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS64_CFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the C compiler if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS64_LDFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the linker if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS64_LIBS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional libraries must be linked
Packit 6c4009
to the application if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
Packit 6c4009
@item _CS_LFS64_LINTFLAGS
Packit 6c4009
@standards{Unix98, unistd.h}
Packit 6c4009
The returned string specifies which additional flags must be given to
Packit 6c4009
the lint tool if a source is compiled using the
Packit 6c4009
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
Packit 6c4009
@end vtable
Packit 6c4009
Packit 6c4009
The way to use @code{confstr} without any arbitrary limit on string size
Packit 6c4009
is to call it twice: first call it to get the length, allocate the
Packit 6c4009
buffer accordingly, and then call @code{confstr} again to fill the
Packit 6c4009
buffer, like this:
Packit 6c4009
Packit 6c4009
@smallexample
Packit 6c4009
@group
Packit 6c4009
char *
Packit 6c4009
get_default_path (void)
Packit 6c4009
@{
Packit 6c4009
  size_t len = confstr (_CS_PATH, NULL, 0);
Packit 6c4009
  char *buffer = (char *) xmalloc (len);
Packit 6c4009
Packit 6c4009
  if (confstr (_CS_PATH, buf, len + 1) == 0)
Packit 6c4009
    @{
Packit 6c4009
      free (buffer);
Packit 6c4009
      return NULL;
Packit 6c4009
    @}
Packit 6c4009
Packit 6c4009
  return buffer;
Packit 6c4009
@}
Packit 6c4009
@end group
Packit 6c4009
@end smallexample