⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conf.texi

📁 一个C源代码分析器
💻 TEXI
📖 第 1 页 / 共 3 页
字号:
@node System Configuration, Language Features, System Information, Top@chapter System Configuration ParametersThe functions and macros listed in this chapter give information aboutconfiguration parameters of the operating system---for example, capacitylimits, presence of optional POSIX features, and the default path forexecutable files (@pxref{String Parameters}).@menu* General Limits::           Constants and functions that describe				various process-related limits that have				one uniform value for any given machine.* System Options::           Optional POSIX features.* Version Supported::        Version numbers of POSIX.1 and POSIX.2.* Sysconf::                  Getting specific configuration values                                of general limits and system options.* Minimums::                 Minimum values for general limits.* Limits for Files::         Size limitations that pertain to individual files.                                These can vary between file systems                                or even from file to file.* Options for Files::        Optional features that some files may support.* File Minimums::            Minimum values for file limits.* Pathconf::                 Getting the limit values for a particular file.* Utility Limits::           Capacity limits of some POSIX.2 utility programs.* Utility Minimums::         Minimum allowable values of those limits.* String Parameters::        Getting the default search path.@end menu@node General Limits@section General Capacity Limits@cindex POSIX capacity limits@cindex limits, POSIX@cindex capacity limits, POSIXThe POSIX.1 and POSIX.2 standards specify a number of parameters thatdescribe capacity limitations of the system.  These limits can be fixedconstants for a given operating system, or they can vary from machine tomachine.  For example, some limit values may be configurable by thesystem administrator, either at run time or by rebuilding the kernel,and this should not require recompiling application programs.@pindex limits.hEach of the following limit parameters has a macro that is defined in@file{limits.h} only if the system has a fixed, uniform limit for theparameter in question.  If the system allows different file systems orfiles to have different limits, then the macro is undefined; use@code{sysconf} to find out the limit that applies at a particular timeon a particular machine.  @xref{Sysconf}.Each of these parameters also has another macro, with a name startingwith @samp{_POSIX}, which gives the lowest value that the limit isallowed to have on @emph{any} POSIX system.  @xref{Minimums}.@cindex limits, program argument size@comment limits.h@comment POSIX.1@deftypevr Macro int ARG_MAXIf defined, the unvarying maximum combined length of the @var{argv} and@var{environ} arguments that can be passed to the @code{exec} functions.@end deftypevr@cindex limits, number of processes@comment limits.h@comment POSIX.1@deftypevr Macro int CHILD_MAXIf defined, the unvarying maximum number of processes that can existwith the same real user ID at any one time.  In BSD and GNU, this iscontrolled by the @code{RLIMIT_NPROC} resource limit; @pxref{Limits onResources}.@end deftypevr@cindex limits, number of open files@comment limits.h@comment POSIX.1@deftypevr Macro int OPEN_MAXIf defined, the unvarying maximum number of files that a single processcan have open simultaneously.  In BSD and GNU, this is controlledby the @code{RLIMIT_NOFILE} resource limit; @pxref{Limits on Resources}.@end deftypevr@comment limits.h@comment POSIX.1@deftypevr Macro int STREAM_MAXIf defined, the unvarying maximum number of streams that a singleprocess can have open simultaneously.  @xref{Opening Streams}.@end deftypevr@cindex limits, time zone name length@comment limits.h@comment POSIX.1@deftypevr Macro int TZNAME_MAXIf defined, the unvarying maximum length of a time zone name.@xref{Time Zone Functions}.@end deftypevrThese limit macros are always defined in @file{limits.h}.@cindex limits, number of supplementary group IDs@comment limits.h@comment POSIX.1@deftypevr Macro int NGROUPS_MAXThe maximum number of supplementary group IDs that one process can have.The value of this macro is actually a lower bound for the maximum.  Thatis, you can count on being able to have that many supplementary groupIDs, but a particular machine might let you have even more.  You can use@code{sysconf} to see whether a particular machine will let you havemore (@pxref{Sysconf}).@end deftypevr@comment limits.h@comment POSIX.1@deftypevr Macro int SSIZE_MAXThe largest value that can fit in an object of type @code{ssize_t}.Effectively, this is the limit on the number of bytes that can be reador written in a single operation.This macro is defined in all POSIX systems because this limit is neverconfigurable.@end deftypevr@comment limits.h@comment POSIX.2@deftypevr Macro int RE_DUP_MAXThe largest number of repetitions you are guaranteed is allowed in theconstruct @samp{\@{@var{min},@var{max}\@}} in a regular expression.The value of this macro is actually a lower bound for the maximum.  Thatis, you can count on being able to have that many repetitions, but aparticular machine might let you have even more.  You can use@code{sysconf} to see whether a particular machine will let you havemore (@pxref{Sysconf}).  And even the value that @code{sysconf} tellsyou is just a lower bound---larger values might work.This macro is defined in all POSIX.2 systems, because POSIX.2 says itshould always be defined even if there is no specific imposed limit.@end deftypevr@node System Options@section Overall System Options@cindex POSIX optional features@cindex optional POSIX featuresPOSIX defines certain system-specific options that not all POSIX systemssupport.  Since these options are provided in the kernel, not in thelibrary, simply using the GNU C library does not guarantee any of thesefeatures is supported; it depends on the system you are using.@pindex unistd.hYou can test for the availability of a given option using the macros inthis section, together with the function @code{sysconf}.  The macros aredefined only if you include @file{unistd.h}.For the following macros, if the macro is defined in @file{unistd.h},then the option is supported.  Otherwise, the option may or may not besupported; use @code{sysconf} to find out.  @xref{Sysconf}.@comment unistd.h@comment POSIX.1@deftypevr Macro int _POSIX_JOB_CONTROLIf this symbol is defined, it indicates that the system supports jobcontrol.  Otherwise, the implementation behaves as if all processeswithin a session belong to a single process group.  @xref{Job Control}.@end deftypevr@comment unistd.h@comment POSIX.1@deftypevr Macro int _POSIX_SAVED_IDSIf this symbol is defined, it indicates that the system remembers theeffective user and group IDs of a process before it executes anexecutable file with the set-user-ID or set-group-ID bits set, and thatexplicitly changing the effective user or group IDs back to these valuesis permitted.  If this option is not defined, then if a nonprivilegedprocess changes its effective user or group ID to the real user or groupID of the process, it can't change it back again.  @xref{Enable/DisableSetuid}.@end deftypevrFor the following macros, if the macro is defined in @file{unistd.h},then its value indicates whether the option is supported.  A value of@code{-1} means no, and any other value means yes.  If the macro is notdefined, then the option may or may not be supported; use @code{sysconf}to find out.  @xref{Sysconf}.@comment unistd.h@comment POSIX.2@deftypevr Macro int _POSIX2_C_DEVIf this symbol is defined, it indicates that the system has the POSIX.2C compiler command, @code{c89}.  The GNU C library always defines thisas @code{1}, on the assumption that you would not have installed it ifyou didn't have a C compiler.@end deftypevr@comment unistd.h@comment POSIX.2@deftypevr Macro int _POSIX2_FORT_DEVIf this symbol is defined, it indicates that the system has the POSIX.2Fortran compiler command, @code{fort77}.  The GNU C library neverdefines this, because we don't know what the system has.@end deftypevr@comment unistd.h@comment POSIX.2@deftypevr Macro int _POSIX2_FORT_RUNIf this symbol is defined, it indicates that the system has the POSIX.2@code{asa} command to interpret Fortran carriage control.  The GNU Clibrary never defines this, because we don't know what the system has.@end deftypevr@comment unistd.h@comment POSIX.2@deftypevr Macro int _POSIX2_LOCALEDEFIf this symbol is defined, it indicates that the system has the POSIX.2@code{localedef} command.  The GNU C library never defines this, becausewe don't know what the system has.@end deftypevr@comment unistd.h@comment POSIX.2@deftypevr Macro int _POSIX2_SW_DEVIf this symbol is defined, it indicates that the system has the POSIX.2commands @code{ar}, @code{make}, and @code{strip}.  The GNU C libraryalways defines this as @code{1}, on the assumption that you had to have@code{ar} and @code{make} to install the library, and it's unlikely that@code{strip} would be absent when those are present.@end deftypevr@node Version Supported@section Which Version of POSIX is Supported@comment unistd.h@comment POSIX.1@deftypevr Macro {long int} _POSIX_VERSIONThis constant represents the version of the POSIX.1 standard to whichthe implementation conforms.  For an implementation conforming to the1990 POSIX.1 standard, the value is the integer @code{199009L}.@code{_POSIX_VERSION} is always defined (in @file{unistd.h}) in anyPOSIX system.@strong{Usage Note:} Don't try to test whether the system supports POSIXby including @file{unistd.h} and then checking whether@code{_POSIX_VERSION} is defined.  On a non-POSIX system, this willprobably fail because there is no @file{unistd.h}.  We do not know of@emph{any} way you can reliably test at compilation time whether yourtarget system supports POSIX or whether @file{unistd.h} exists.The GNU C compiler predefines the symbol @code{__POSIX__} if the targetsystem is a POSIX system.  Provided you do not use any other compilerson POSIX systems, testing @code{defined (__POSIX__)} will reliablydetect such systems.@end deftypevr@comment unistd.h@comment POSIX.2@deftypevr Macro {long int} _POSIX2_C_VERSIONThis constant represents the version of the POSIX.2 standard which thelibrary and system kernel support.  We don't know what value this willbe for the first version of the POSIX.2 standard, because the value isbased on the year and month in which the standard is officially adopted.The value of this symbol says nothing about the utilities installed onthe system.@strong{Usage Note:} You can use this macro to tell whether a POSIX.1system library supports POSIX.2 as well.  Any POSIX.1 system contains@file{unistd.h}, so include that file and then test @code{defined(_POSIX2_C_VERSION)}.@end deftypevr@node Sysconf@section Using @code{sysconf}When your system has configurable system limits, you can use the@code{sysconf} function to find out the value that applies to anyparticular machine.  The function and the associated @var{parameter}constants are declared in the header file @file{unistd.h}.@menu* Sysconf Definition::        Detailed specifications of @code{sysconf}.* Constants for Sysconf::     The list of parameters @code{sysconf} can read.* Examples of Sysconf::       How to use @code{sysconf} and the parameter				 macros properly together.@end menu@node Sysconf Definition@subsection Definition of @code{sysconf}@comment unistd.h@comment POSIX.1@deftypefun {long int} sysconf (int @var{parameter})This function is used to inquire about runtime system parameters.  The@var{parameter} argument should be one of the @samp{_SC_} symbols listedbelow.The normal return value from @code{sysconf} is the value you requested.A value of @code{-1} is returned both if the implementation does notimpose a limit, and in case of an error.  The following @code{errno} error conditions are defined for this function:@table @code@item EINVALThe value of the @var{parameter} is invalid.@end table@end deftypefun@node Constants for Sysconf@subsection Constants for @code{sysconf} ParametersHere are the symbolic constants for use as the @var{parameter} argumentto @code{sysconf}.  The values are all integer constants (morespecifically, enumeration type values).@table @code@comment unistd.h@comment POSIX.1@item _SC_ARG_MAXInquire about the parameter corresponding to @code{ARG_MAX}.@comment unistd.h@comment POSIX.1@item _SC_CHILD_MAXInquire about the parameter corresponding to @code{CHILD_MAX}.@comment unistd.h@comment POSIX.1@item _SC_OPEN_MAXInquire about the parameter corresponding to @code{OPEN_MAX}.@comment unistd.h@comment POSIX.1@item _SC_STREAM_MAXInquire about the parameter corresponding to @code{STREAM_MAX}.@comment unistd.h@comment POSIX.1@item _SC_TZNAME_MAXInquire about the parameter corresponding to @code{TZNAME_MAX}.@comment unistd.h@comment POSIX.1@item _SC_NGROUPS_MAXInquire about the parameter corresponding to @code{NGROUPS_MAX}.@comment unistd.h@comment POSIX.1@item _SC_JOB_CONTROLInquire about the parameter corresponding to @code{_POSIX_JOB_CONTROL}.@comment unistd.h@comment POSIX.1@item _SC_SAVED_IDSInquire about the parameter corresponding to @code{_POSIX_SAVED_IDS}.@comment unistd.h@comment POSIX.1@item _SC_VERSIONInquire about the parameter corresponding to @code{_POSIX_VERSION}.@comment unistd.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -