Limits h си что содержит

Limits h си что содержит

The limits.h > header defines various symbolic names. Different categories of names are described below.

The names represent various limits on resources that the implementation imposes on applications. Symbolic constant names beginning with _POSIX can be found in unistd.h (3HEAD).

Applications should not assume any particular value for a limit. An application wishing to avail itself of the full amount of a resource available on an implementation can make use of the value given in limits.h on that particular implementation by using the symbolic names listed below. Many of the listed limits are not invariant, and at runtime, the value of the limit might differ from those given in this header, for the following reasons: o The limit is pathname-dependent. o The limit differs between the compile and runtime machines.

For these reasons, an application can use the fpathconf (2), pathconf (2), and sysconf (3C) functions to determine the actual value of a limit at runtime.

Runtime Invariant Values (Possibly Indeterminate)

Maximum number of I/O operations in a single list I/O call supported by the implementation.

Maximum number of outstanding asynchronous I/O operations supported by the implementation.

The maximum amount by which a process can decrease its asynchronous I/O priority level from its own scheduling priority.

Maximum length of argument to the exec (2) functions including environment data.

Maximum number of functions that can be registered with atexit (3C).

Maximum number of simultaneous processes per real user ID.

Number of clock ticks per second returned by the times (2) function.

Maximum number of timer expiration overruns.

Maximum length of a host name (not including the terminating null) as returned from the gethostname (3C) function.

Maximum number of iovec structures that one process has available for use with read (2) or write (2).

Maximum length of a login name.

The maximum number of open message queue descriptors a process is allowed to hold.

Maximum length of a login name.

The maximum number of open message queue descriptors a process is allowed to hold.

The maximum number of message priorities supported by the implementation.

Maximum number of files that one process can have open at any one time.

Size in bytes of a page.

The maximum number of significant bytes in a password, not including the terminating null.

Maximum number of attempts made to destroy a thread’s thread-specific data values on thread exit.

Maximum number of data keys that can be created by a process.

Minimum size in bytes of thread stack storage.

Maximum number of threads that can be created per process.

Maximum number of realtime signals reserved for application use in this implementation.

Maximum number of semaphores that a process can have.

The maximum value a semaphore can have.

Maximum number of queued signals that a process can send and have pending at the receiver(s) at any time.

The maximum number of replenishment operations that may be simultaneously pending for a particular sporadic server scheduler.

Maximum number of symbolic links that can be reliably traversed in the resolution of a pathname in the absence of a loop.

Maximum number of timers per process supported by the implementation.

Maximum length of the trace event name.

Maximum length of the trace generation version string or of the trace stream name.

Maximum number of trace streams that may simultaneously exist in the system.

Maximum length of terminal device name.

Maximum number of bytes supported for the name of a timezone (not of the TZ variable).

Pathname Variable Values

The values in the following list can be constants within an implementation or can vary from one pathname to another. For example, file systems or directories can have different characteristics. The value supported for a specific pathname is provided by the pathconf (2) function.

FILESIZEBITS Minimum number of bits needed to represent, as a signed integer value, the maximum size of a regular file allowed in the specified directory.

LINK_MAX Maximum number of links to a single file.

MAX_CANON Maximum number of bytes in a terminal canonical input line.

MAX_INPUT Minimum number of bytes for which space is available in a terminal input queue; therefore, the maximum number of bytes a conforming application may require to be typed as input before reading them.

NAME_MAX Maximum number of bytes in a filename (not including terminating null).

PATH_MAX Maximum number of bytes in a pathname, including the terminating null character.

PIPE_BUF Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.

POSIX_ALLOC_SIZE_MIN Minimum number of bytes of storage actually allocated for any portion of a file.

POSIX_REC_INCR_XFER_SIZE Recommended increment for file transfer sizes between the POSIX_REC_MIN_XFER_SIZE and POSIX_REC_MAX_XFER_SIZE values.

POSIX_REC_MAX_XFER_SIZE Maximum recommended file transfer size.

POSIX_REC_MIN_XFER_SIZE Minimum recommended file transfer size.

POSIX_REC_XFER_ALIGN Recommended file transfer buffer alignment.

SYMLINK_MAX Maximum number of bytes in a symbolic link.

Runtime Increasable Values

The magnitude limitations in the following list are fixed by specific implementations. An application should assume that the value supplied by limits.h > in a specific implementation is the minimum that pertains whenever the application is run under that implementation. A specific instance of a specific implementation can increase the value relative to that supplied by limits.h > for that implementation. The actual value supported by a specific instance is provided by the sysconf (3C) function.

BC_BASE_MAX Maximum obase values allowed by the bc (1) utility.

BC_DIM_MAX Maximum number of elements permitted in an array by the bc utility.

BC_SCALE_MAX Maximum scale value allowed by the bc utility.

BC_STRING_MAX Maximum length of a string constant accepted by the bc utility.

CHARCLASS_NAME_MAX Maximum number of bytes in a character class name.

COLL_WEIGHTS_MAX Maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in the locale definition file.

EXPR_NEST_MAX Maximum number of expressions that can be nested within parentheses by the expr (1) utility.

EXPR_NEST_MAX Maximum number of expressions that can be nested within parentheses by the expr utility.

NGROUPS_MAX Maximum number of simultaneous supplementary group IDs per process.

Maximum Values

The symbolic constants in the following list are symbolic names for the most restrictive value for certain features on an implementation supporting the POSIX Timers option.

_POSIX_CLOCKRES_MIN The resolution of the CLOCK_REALTIME clock, in nanoseconds.

Minimum Values

The symbolic constants in the following list are symbolic names for the most restrictive value for certain features on an implementation conforming to various POSIX and Single Unix Specification requirements. See standards (5).

The number of I/O operations that can be specified in a list I/O call.

The number of outstanding asynchronous I/O operations.

Maximum length of argument to the exec (2) functions including environment data.

Maximum number of simultaneous processes per real user ID.

The number of timer expiration overruns.

Maximum length of a host name (not including the terminating null) as returned from the gethostname (3C) function.

Maximum number of links to a single file.

The size of the storage required for a login name, in bytes, including the terminating null.

Maximum number of bytes in a terminal canonical input queue.

Maximum number of bytes allowed in a terminal input queue.

The number of message queues that can be open for a single process.

The maximum number of message priorities supported by the implementation.

Maximum number of bytes in a filename (not including terminating null).

Maximum number of simultaneous supplementary group IDs per process.

Maximum number of files that one process can have open at any one time.

Maximum number of bytes in a pathname.

Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.

The number of repeated occurrences of a BRE permitted by the regexec() and regcomp() functions when using the interval notation

The number of realtime signal numbers reserved for application use.

The number of semaphores that a process can have.

The maximum value a semaphore can have.

The number of queued signals that a process can send and have pending at the receiver(s) at any time.

The number of streams that one process can have open at one time.

The number of replenishment operations that can be simultaneously pending for a particular sporadic server scheduler.

The number of bytes in a symbolic link.

The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop.

The number of attempts made to destroy a thread’s thread-specific data values on thread exit.

The number of data keys per process.

The number of threads per process.

The per-process number of timers.

The length in bytes of a trace event name.

The length in bytes of a trace generation version string or a trace stream name.

The number of trace streams that can simultaneously exist in the system.

The size of the storage required for a terminal device name, in bytes, including the terminating null.

Maximum number of bytes supported for the name of a timezone (not of the TZ variable).

Maximum obase values allowed by the bc utility.

Maximum number of elements permitted in an array by the bc utility.

Maximum scale value allowed by the bc utility.

Maximum length of a string constant accepted by the bc utility.

Maximum number of bytes in a character class name.

Maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in the locale definition file.

Maximum number of expressions that can be nested within parentheses by the expr utility.

Maximum number of iovec structures that one process has available for use with read (2) or write (2).

Maximum number of bytes in a filename (not including the terminating null).

Maximum number of bytes in a pathname.

Numerical Limits

MB_LEN_MAX Maximum number of bytes in a character, for any supported locale.

TMP_MAX Minimum number of unique filename generated by tmpnam (3C). Maximum number of times an application can call tmpnam() reliably.

Other Invariant Values

The following constants are defined in limits.h >.

CHARCLASS_NAME_MAX Maximum number of bytes in a character class name.

LOGNAME_MAX The maximum number of bytes supported in a user’s login name.

NL_ARGMAX Maximum value of digit in calls to the printf (3C) and scanf (3C) functions.

NL_LANGMAX Maximum number of bytes in a LANG name.

NL_MSGMAX Maximum message number.

NL_NMAX Maximum number of bytes in an N-to-1 collation mapping.

NL_SETMAX Maximum set number.

NL_TEXTMAX Maximum number of bytes in a message string.

Источник

(limit.h) в C / C ++

Максимальный и минимальный размер целочисленных значений весьма полезен, или, проще говоря, ограничения любого интегрального типа играют важную роль в программировании. Вместо запоминания этих значений можно использовать разные макросы.

(limit.h) определяет размеры целочисленных типов.
Этот заголовок определяет константы с ограничениями фундаментальных целочисленных типов для конкретной используемой системы и используемой реализации компилятора.

Ограничения для основных типов с плавающей точкой определены в ( ).
Ограничения для целочисленных типов, зависящих от ширины, и других типов typedef определены в ( ).

1. CHAR_MIN:

2. CHAR_MAX:

3. SHRT_MIN:

4. SHRT_MAX:

5. USHRT_MAX:

6. INT_MIN:

7. INT_MAX:

8. UINT_MAX:

9. LONG_MIN:

10. LONG_MAX:

11. ULONG_MAX:

12. LLONG_MIN:

13. LLONG_MAX:

14. ULLONG_MAX:

ПРИМЕЧАНИЕ ** фактическое значение зависит от конкретной системы и реализации библиотеки, но должно отражать ограничения этих типов в целевой платформе.

Значения вашей машины могут зависеть от того, 32-битная или 64-битная машина.

Совместимость:
LLONG_MIN, LLONG_MAX и ULLONG_MAX определены для библиотек, соответствующих стандарту C 1999 года или более поздней версии (который включает в себя только стандарт C ++ с 2011 года: C ++ 11).

Два применения этих MACROS — проверка на целочисленное переполнение и вычисление минимума или максимума в массиве очень больших или очень маленьких элементов.

Ниже программа отобразит соответствующие значения для вашей машины:

// C ++ программа для демонстрации работы
// константы в климах.
#include
#include

Источник

Limits.h

limits.h

limits.h — заголовочный файл стандартной библиотеки общего назначения языка программирования Си, который включает определения характеристик общих типов переменных. Значения зависят от специфики реализации, но могут быть не ниже диапазона, определенного для конечного значения в удобной реализации Си.

Содержание

Константы-члены

Колонка «минимальное значение диапазона» содержит минимумы из возможного диапазона для константы данного типа, как это указано в стандарте. Иногда, значения _MIN представляют минимумы диапазона, представимые в виде редко используемого обратного кода и знакового диапазона. Большинство реализаций будут иметь больший диапазон по крайней мере для некоторых из этих чисел. например:

Смотри также

Дополнительные источники

Ссылки

Полезное

Смотреть что такое «Limits.h» в других словарях:

Limits.h — is the header of the general purpose standard library of the C programming language which includes definitions of the characteristics of common variable types. The values are implementation specific, but may not be of lower magnitude than certain … Wikipedia

limits — I noun amplitude, area, boundary, bounds, capacity, configuration, confines, dimensions, extremity, frontiers, limitations, metes and bounds, outlines, perimeters, premises, purview, range, reach, scope associated concepts: basis jurisdiction,… … Law dictionary

limits — n. 1) city limits 2) (AE) (esp. mil.) off limits to; on limits to (the bar was put off limits to all military personnel) 3) within (reasonable) limits * * * on limits to (the bar was put off limits to all military personnel) (AE) (esp. mil.) off… … Combinatory dictionary

limits.h — Стандартная библиотека языка программирования С assert.h complex.h ctype.h errno.h fenv.h float.h inttypes.h iso646.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stdbool.h stddef.h … Википедия

limits — /ˈlɪməts/ (say limuhts) plural noun Australian History → limits of location … Australian-English dictionary

limits — ribos statusas T sritis automatika atitikmenys: angl. boundaries; bounds; limits; ranges vok. Grenzen, f rus. пределы, m pranc. limites, f … Automatikos terminų žodynas

limits — limitai statusas T sritis augalininkystė apibrėžtis Mažiausia ir didžiausia variacinės eilutės reikšmės. atitikmenys: angl. limits rus. лимиты … Žemės ūkio augalų selekcijos ir sėklininkystės terminų žodynas

LIMITS — Liquemin in Myocardial Infarction during Thrombolysis with Saruplase [trial] … Medical dictionary

limits — The maximum number of speculative futures contracts one can hold as determined by the Commodity Futures Trading Commission and/or the exchange upon which the contract is traded. Also referred to as trading limit. The maximum advance or decline… … Financial and business terms

limits — Synonyms and related words: boundaries, bounds, bourns, circumference, circumscription, compass, confines, coordinates, edges, fringes, limitations, marches, metes, metes and bounds, outlines, outskirts, pale, parameters, perimeter, periphery,… … Moby Thesaurus

Источник

The limits.h header determines various properties of the various variable types. The macros defined in this header, limits the values of various variable types like char, int and long.

These limits specify that a variable cannot store any value beyond these limits, for example an unsigned character can store up to a maximum value of 255.

Library Macros

The following values are implementation-specific and defined with the #define directive, but these values may not be any lower than what is given here.

MacroValueDescription
CHAR_BIT8Defines the number of bits in a byte.
SCHAR_MIN-128Defines the minimum value for a signed char.
SCHAR_MAX+127Defines the maximum value for a signed char.
UCHAR_MAX255Defines the maximum value for an unsigned char.
CHAR_MIN-128Defines the minimum value for type char and its value will be equal to SCHAR_MIN if char represents negative values, otherwise zero.
CHAR_MAX+127Defines the value for type char and its value will be equal to SCHAR_MAX if char represents negative values, otherwise UCHAR_MAX.
MB_LEN_MAX16Defines the maximum number of bytes in a multi-byte character.
SHRT_MIN-32768Defines the minimum value for a short int.
SHRT_MAX+32767Defines the maximum value for a short int.
USHRT_MAX65535Defines the maximum value for an unsigned short int.
INT_MIN-2147483648Defines the minimum value for an int.
INT_MAX+2147483647Defines the maximum value for an int.
UINT_MAX4294967295Defines the maximum value for an unsigned int.
LONG_MIN-9223372036854775808Defines the minimum value for a long int.
LONG_MAX+9223372036854775807Defines the maximum value for a long int.
ULONG_MAX18446744073709551615Defines the maximum value for an unsigned long int.

Example

The following example shows the usage of few of the constants defined in limits.h file.

Let us compile and run the above program that will produce the following result −

Источник

Limits.h

limits.h

limits.h — заголовочный файл стандартной библиотеки общего назначения языка программирования Си, который включает определения характеристик общих типов переменных. Значения зависят от специфики реализации, но могут быть не ниже диапазона, определенного для конечного значения в удобной реализации Си.

Содержание

Константы-члены

Колонка «минимальное значение диапазона» содержит минимумы из возможного диапазона для константы данного типа, как это указано в стандарте. Иногда, значения _MIN представляют минимумы диапазона, представимые в виде редко используемого обратного кода и знакового диапазона. Большинство реализаций будут иметь больший диапазон по крайней мере для некоторых из этих чисел. например:

Смотри также

Дополнительные источники

Ссылки

Полезное

Смотреть что такое «Limits.h» в других словарях:

Limits.h — is the header of the general purpose standard library of the C programming language which includes definitions of the characteristics of common variable types. The values are implementation specific, but may not be of lower magnitude than certain … Wikipedia

limits — I noun amplitude, area, boundary, bounds, capacity, configuration, confines, dimensions, extremity, frontiers, limitations, metes and bounds, outlines, perimeters, premises, purview, range, reach, scope associated concepts: basis jurisdiction,… … Law dictionary

limits — n. 1) city limits 2) (AE) (esp. mil.) off limits to; on limits to (the bar was put off limits to all military personnel) 3) within (reasonable) limits * * * on limits to (the bar was put off limits to all military personnel) (AE) (esp. mil.) off… … Combinatory dictionary

limits.h — Стандартная библиотека языка программирования С assert.h complex.h ctype.h errno.h fenv.h float.h inttypes.h iso646.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stdbool.h stddef.h … Википедия

limits — /ˈlɪməts/ (say limuhts) plural noun Australian History → limits of location … Australian-English dictionary

limits — ribos statusas T sritis automatika atitikmenys: angl. boundaries; bounds; limits; ranges vok. Grenzen, f rus. пределы, m pranc. limites, f … Automatikos terminų žodynas

limits — limitai statusas T sritis augalininkystė apibrėžtis Mažiausia ir didžiausia variacinės eilutės reikšmės. atitikmenys: angl. limits rus. лимиты … Žemės ūkio augalų selekcijos ir sėklininkystės terminų žodynas

LIMITS — Liquemin in Myocardial Infarction during Thrombolysis with Saruplase [trial] … Medical dictionary

limits — The maximum number of speculative futures contracts one can hold as determined by the Commodity Futures Trading Commission and/or the exchange upon which the contract is traded. Also referred to as trading limit. The maximum advance or decline… … Financial and business terms

limits — Synonyms and related words: boundaries, bounds, bourns, circumference, circumscription, compass, confines, coordinates, edges, fringes, limitations, marches, metes, metes and bounds, outlines, outskirts, pale, parameters, perimeter, periphery,… … Moby Thesaurus

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *