sysconf(3) Library Functions Manual sysconf(3) JMENO sysconf - ziskej konfiguracni informace za behu KNIHOVNA Standardni knihovna C (libc, -lc) POUZITI #include long sysconf(int name); POPIS POSIX dovoluje aplikaci v case prekladu, nebo behu aplikace, testovat, zda jsou urcite volby podporovany, nebo jake jsou hodnoty techto konfigurovatelnych systemovych parametru. V case prekladu se toto deje pomoci vlozeni a/nebo a testovani hodnot prislusnych maker. V case behu, se muzeme dotazovat na numericke hodnoty pouzitim funkce sysconf(). Pokud se budeme dotazovat na hodnoty, ktere jsou zavisle na souborovem systemu, je vhodne pouzit volani fpathconf(3) nebo pathconf(3). Pro dotazovani se na hodnoty retezcu je vhodne pouzit confstr(3). Hodnoty ziskane z techto funkci jsou systemove konstanty. Nemeni se po dobu zivota procesu. For options, typically, there is a constant _POSIX_FOO that may be defined in . If it is undefined, one should ask at run time. If it is defined to -1, then the option is not supported. If it is defined to 0, then relevant functions and headers exist, but one has to ask at run time what degree of support is available. If it is defined to a value other than -1 or 0, then the option is supported. Usually the value (such as 200112L) indicates the year and month of the POSIX revision describing the option. glibc uses the value 1 to indicate support as long as the POSIX revision has not been published yet. The sysconf() argument will be _SC_FOO. For a list of options, see posixoptions(7). Pro promenne, nebo limity obvykle existuje konstanta _FOO, ktera je definovana v , nebo _POSIX_FOO, kterou lze nalezt v . Konstanta nebude definovana, pokud neni specifikovan limit. Pokud je konstanta definovana, definuje zarucenou hodnotu a dokonce muze byt podporovana i vyssi hodnota. Pokud chce aplikace vyuzivat hodnot, ktere se mohou menit mezi jednotlivymi systemy, muze byt volan sysconf(). Argumentem sysconf() bude _SC_FOO. Promenne POSIX.1 Uvadime jmeno promenne, jmeno parametru funkce sysconf(), ktery je pouzivan pro dotazovani se na tuto hodnotu, a kratky popis. Nejdrive promenne kompatibilni s POSIX.1. ARG_MAX - _SC_ARG_MAX Maximalni delka argumentu pro funkce z rodiny exec(3). Nesmi byt mene nez _POSIX_ARG_MAX (4096). CHILD_MAX - _SC_CHILD_MAX Pocet simultanne bezicich procesu jednoho uzivatele. Nesmi byt mene nez _POSIX_CHILD_MAX (25). HOST_NAME_MAX - _SC_HOST_NAME_MAX Maximalni delka hostname, ktera nezahrnuje ukoncujici null byte, tak jak jej vraci funkce gethostname(2). Nesmi byt mene nez _POSIX_HOST_NAME_MAX (255). LOGIN_NAME_MAX - _SC_LOGIN_NAME_MAX Maximalni delka loginu, ktera zahrnuje i ukoncujici null byte. Nesmi byt mene nez _POSIX_LOGIN_NAME_MAX (9). NGROUPS_MAX - _SC_NGROUPS_MAX Maximum number of supplementary group IDs. takt hodin - _SC_CLK_TCK Pocet taktu hodin za sekundu. Odpovidajici promenna je zastarala. Samozrejme byla nazvana CLK_TCK. (Poznamka: makro CLOCKS_PER_SEC nedava zadnou informaci: musi byt rovno 1000000.) OPEN_MAX - _SC_OPEN_MAX Maximalni pocet souboru, ktere muze mit proces v libovolny okamzik otevren. Nesmi byt mene nez _POSIX_OPEN_MAX (20). PAGESIZE - _SC_PAGESIZE Velikost stranky v bytech. Nesmi byt mene nez 1. PAGE_SIZE - _SC_PAGE_SIZE A synonym for PAGESIZE/_SC_PAGESIZE. (Both PAGESIZE and PAGE_SIZE are specified in POSIX.) RE_DUP_MAX - _SC_RE_DUP_MAX Pocet opakujicich se vyskytu BRE povolenych regexec(3) a regcomp(3). Nesmi byt mene nez _POSIX2_RE_DUP_MAX (255). STREAM_MAX - _SC_STREAM_MAX Maximalni pocet proudu, ktere muze mit proces kdykoliv otevren. Pokud je definovan, ma stejnou hodnotu jako C makro FOPEN_MAX. Nesmi byt mene nez _POSIX_STREAM_MAX (8). SYMLOOP_MAX - _SC_SYMLOOP_MAX Maximalni pocet symbolickych linku, ktere jsou videt ve jmene souboru, nez se vrati ELOOP. Nesmi byt mene nez _POSIX_SYMLOOP_MAX (8). TTY_NAME_MAX - _SC_TTY_NAME_MAX Maximalni delka jmena terminalu, vcetne ukoncujiciho null bytu. Nesmi byt mene nez _POSIX_TTY_NAME_MAX (9). TZNAME_MAX - _SC_TZNAME_MAX Maximalni pocet bytu ve jmenu casoveho pasma. Nesmi byt mene nez _POSIX_TZNAME_MAX (6). _POSIX_VERSION - _SC_VERSION indicates the year and month the POSIX.1 standard was approved in the format YYYYMML; the value 199009L indicates the Sept. 1990 revision. Promenne POSIX.2 Next, the POSIX.2 values, giving limits for utilities. BC_BASE_MAX - _SC_BC_BASE_MAX maximalni hodnota obase brana jako spravna v utilite bc(1). BC_DIM_MAX - _SC_BC_DIM_MAX indicates the maximum value of elements permitted in an array by bc(1). BC_SCALE_MAX - _SC_BC_SCALE_MAX maximalni hodnota scale povolena bc(1). BC_STRING_MAX - _SC_BC_STRING_MAX maximalni delka retezce povolena bc(1). COLL_WEIGHTS_MAX - _SC_COLL_WEIGHTS_MAX indicates the maximum numbers of weights that can be assigned to an entry of the LC_COLLATE order keyword in the locale definition file. EXPR_NEST_MAX - _SC_EXPR_NEST_MAX maximalni pocet vyrazu, ktere mohou byt vnoreny v zavorkach v expr(1). LINE_MAX - _SC_LINE_MAX The maximum length of a utility's input line, either from standard input or from a file. This includes space for a trailing newline. RE_DUP_MAX - _SC_RE_DUP_MAX The maximum number of repeated occurrences of a regular expression when the interval notation \{m,n\} is used. POSIX2_VERSION - _SC_2_VERSION verze POSIX.2 standardu ve formatu YYYYMML. POSIX2_C_DEV - _SC_2_C_DEV jsou podporovany POSIX.2 standardy tykajici se jazyka C ? POSIX2_FORT_DEV - _SC_2_FORT_DEV jsou podporovany POSIX.2 standardy tykajici se jazyka FORTRAN ? POSIX2_FORT_RUN - _SC_2_FORT_RUN jsou podporovany POSIX.2 FORTRAN utility ? _POSIX2_LOCALEDEF - _SC_2_LOCALEDEF indicates whether the POSIX.2 creation of locales via localedef(1) is supported. POSIX2_SW_DEV - _SC_2_SW_DEV je podporovana volba POSIX.2 vyvojovych utilit ? Nasledujici hodnoty take existuji, ale nejsou standard. - _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible for the product of this value and the value of _SC_PAGESIZE to overflow. - _SC_AVPHYS_PAGES Pocet aktualne dostupnych stranek fyzicke pameti. - _SC_NPROCESSORS_CONF Pocet nakonfigurovanych procesoru. Viz get_nprocs_conf(3). - _SC_NPROCESSORS_ONLN Pocet dostupnych online procesoru. Viz get_nprocs_conf(3). NAVRATOVE HODNOTY The return value of sysconf() is one of the following: o On error, -1 is returned and errno is set to indicate the error (for example, EINVAL, indicating that name is invalid). o If name corresponds to a maximum or minimum limit, and that limit is indeterminate, -1 is returned and errno is not changed. (To distinguish an indeterminate limit from an error, set errno to zero before the call, and then check whether errno is nonzero when -1 is returned.) o If name corresponds to an option, a positive value is returned if the option is supported, and -1 is returned if the option is not supported. o Otherwise, the current value of the option or limit is returned. This value will not be more restrictive than the corresponding value that was described to the application in or when the application was compiled. CHYBOVE STAVY EINVAL name je neplatny. ATRIBUTY Vysvetleni pojmu pouzitych v teto casti viz attributes(7). +----------------------------------------+---------------+-------------+ |Rozhrani | Atribut | Hodnota | +----------------------------------------+---------------+-------------+ |sysconf() | Thread safety | MT-Safe env | +----------------------------------------+---------------+-------------+ STANDARDY POSIX.1-2008. HISTORIE POSIX.1-2001. CHYBY Je velmi tezke pouzivat ARG_MAX protoze neni specifikovano, jake mnozstvi pameti je pri volani exec(3) spotrebovano uzivatelskymi promennymi v prostredi. Nektere hodnoty mohou byt prilis velke; nejsou vhodne k alokovani pameti. DALSI INFORMACE bc(1), expr(1), getconf(1), locale(1), confstr(3), fpathconf(3), pathconf(3), posixoptions(7) PREKLAD Preklad teto prirucky do cestiny vytvorili Pavel Heimlich Tento preklad je bezplatna dokumentace; Prectete si GNU General Public License Version 3 nebo novejsi ohledne podminek autorskych prav. Neexistuje ZADNA ODPOVEDNOST. Pokud narazite na nejake chyby v prekladu teto prirucky, poslete e-mail na adresu . Linux man-pages 6.9.1 15. cervna 2024 sysconf(3)