dirent.h

title: dirent.h(7p)

text:
# dirent.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
dirent.h — format of directory entries

## SYNOPSIS

```
#include <dirent.h>
```

## DESCRIPTION
The internal format of directories is unspecified.

The <dirent.h> header shall define the following type:

DIR

A type representing a directory stream. The DIR type may be an incomplete type.

It shall also define the structure dirent which shall include the following members:

```
ino_t  d_ino       File serial number.
char   d_name[]    Filename string of entry.
```

The <dirent.h> header shall define the ino_t type as described in <sys/types.h>.

The array d_name is of unspecified size, but shall contain a filename of at most {NAME_MAX} bytes followed by a terminating null byte.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int            alphasort(const struct dirent **, const struct dirent **);
int            closedir(DIR *);
int            dirfd(DIR *);
DIR           *fdopendir(int);
DIR           *opendir(const char *);
struct dirent *readdir(DIR *);
int            readdir_r(DIR *restrict, struct dirent *restrict,

                   struct dirent **restrict);
void           rewinddir(DIR *);
int            scandir(const char *, struct dirent ***,

                   int (*)(const struct dirent *),

                   int (*)(const struct dirent **,

                   const struct dirent **));
void           seekdir(DIR *, long);
long           telldir(DIR *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
Information similar to that in the <dirent.h> header is contained in a file <sys/dir.h> in 4.2 BSD and 4.3 BSD. The equivalent in these implementations of struct dirent from this volume of POSIX.1‐2017 is struct direct. The filename was changed because the name <sys/dir.h> was also used in earlier implementations to refer to definitions related to the older access method; this produced name conflicts. The name of the structure was changed because this volume of POSIX.1‐2017 does not completely define what is in the structure, so it could be different on some implementations from struct direct.

The name of an array of char of an unspecified size should not be used as an lvalue. Use of:

```
sizeof(d_name)
```

is incorrect; use:

```
strlen(d_name)
```

instead.

The array of char d_name is not a fixed size. Implementations may need to declare struct dirent with an array size for d_name of 1, but the actual number of bytes provided matches (or only slightly exceeds) the length of the filename string.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, alphasort(), closedir(), dirfd(), fdopendir(), readdir(), rewinddir(), seekdir(), telldir()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


dlfcn.h

package: man-pages-posix-devel

title: dlfcn.h(7p)

text:
# dlfcn.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
dlfcn.h — dynamic linking

## SYNOPSIS

```
#include <dlfcn.h>
```

## DESCRIPTION
The <dlfcn.h> header shall define at least the following symbolic constants for use in the construction of a dlopen() mode argument:

RTLD_LAZY

Relocations are performed at an implementation-defined time.

RTLD_NOW

Relocations are performed when the object is loaded.

RTLD_GLOBAL

All symbols are available for relocation processing of other modules.

RTLD_LOCAL

All symbols are not made available for relocation processing by other modules.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int    dlclose(void *);
char  *dlerror(void);
void  *dlopen(const char *, int);
void  *dlsym(void *restrict, const char *restrict);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, dlclose(), dlerror(), dlopen(), dlsym()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .

branch: sisyphus


errno.h

title: errno.h(7p)

text:
# errno.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
errno.h — system error numbers

## SYNOPSIS

```
#include <errno.h>
```

## DESCRIPTION
Some of the functionality described on this reference page extends the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1‐2017 defers to the ISO C standard.

The ISO C standard only requires the symbols [EDOM], [EILSEQ], and [ERANGE] to be defined.

The <errno.h> header shall provide a declaration or definition for errno. The symbol errno shall expand to a modifiable lvalue of type int. It is unspecified whether errno is a macro or an identifier declared with external linkage. If a macro definition is suppressed in order to access an actual object, or a program defines an identifier with the name errno, the behavior is undefined.

The <errno.h> header shall define the following macros which shall expand to integer constant expressions with type int, distinct positive values (except as noted below), and which shall be suitable for use in #if preprocessing directives:

E2BIG

Argument list too long.

EACCES

Permission denied.

EADDRINUSE

Address in use.

EADDRNOTAVAIL

Address not available.

EAFNOSUPPORT

Address family not supported.

EAGAIN

Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).

EALREADY

Connection already in progress.

EBADF

Bad file descriptor.

EBADMSG

Bad message.

EBUSY

Device or resource busy.

ECANCELED

Operation canceled.

ECHILD

No child processes.

ECONNABORTED

Connection aborted.

ECONNREFUSED

Connection refused.

ECONNRESET

Connection reset.

EDEADLK

Resource deadlock would occur.

EDESTADDRREQ

Destination address required.

EDOM

Mathematics argument out of domain of function.

EDQUOT

Reserved.

EEXIST

File exists.

EFAULT

Bad address.

EFBIG

File too large.

EHOSTUNREACH

Host is unreachable.

EIDRM

Identifier removed.

EILSEQ

Illegal byte sequence.

EINPROGRESS

Operation in progress.

EINTR

Interrupted function.

EINVAL

Invalid argument.

EIO

I/O error.

EISCONN

Socket is connected.

EISDIR

Is a directory.

ELOOP

Too many levels of symbolic links.

EMFILE

File descriptor value too large.

EMLINK

Too many links.

EMSGSIZE

Message too large.

EMULTIHOP

Reserved.

ENAMETOOLONG

Filename too long.

ENETDOWN

Network is down.

ENETRESET

Connection aborted by network.

ENETUNREACH

Network unreachable.

ENFILE

Too many files open in system.

ENOBUFS

No buffer space available.

ENODATA

No message is available on the STREAM head read queue.

ENODEV

No such device.

ENOENT

No such file or directory.

ENOEXEC

Executable file format error.

ENOLCK

No locks available.

ENOLINK

Reserved.

ENOMEM

Not enough space.

ENOMSG

No message of the desired type.

ENOPROTOOPT

Protocol not available.

ENOSPC

No space left on device.

ENOSR

No STREAM resources.

ENOSTR

Not a STREAM.

ENOSYS

Functionality not supported.

ENOTCONN

The socket is not connected.

ENOTDIR

Not a directory or a symbolic link to a directory.

ENOTEMPTY

Directory not empty.

ENOTRECOVERABLE

State not recoverable.

ENOTSOCK

Not a socket.

ENOTSUP

Not supported (may be the same value as [EOPNOTSUPP]).

ENOTTY

Inappropriate I/O control operation.

ENXIO

No such device or address.

EOPNOTSUPP

Operation not supported on socket (may be the same value as [ENOTSUP]).

EOVERFLOW

Value too large to be stored in data type.

EOWNERDEAD

Previous owner died.

EPERM

Operation not permitted.

EPIPE

Broken pipe.

EPROTO

Protocol error.

EPROTONOSUPPORT

Protocol not supported.

EPROTOTYPE

Protocol wrong type for socket.

ERANGE

Result too large.

EROFS

Read-only file system.

ESPIPE

Invalid seek.

ESRCH

No such process.

ESTALE

Reserved.

ETIME

Stream ioctl() timeout.

ETIMEDOUT

Connection timed out.

ETXTBSY

Text file busy.

EWOULDBLOCK

Operation would block (may be the same value as [EAGAIN]).

EXDEV

Cross-device link.

The following sections are informative.

## APPLICATION USAGE
Additional error numbers may be defined on conforming systems; see the System Interfaces volume of POSIX.1‐2017.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, Section 2.3, Error Numbers

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


fcntl.h

title: fcntl.h(7p)

text:
# fcntl.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
fcntl.h — file control options

## SYNOPSIS

```
#include <fcntl.h>
```

## DESCRIPTION
The <fcntl.h> header shall define the following symbolic constants for the cmd argument used by fcntl(). The values shall be unique and shall be suitable for use in #if preprocessing directives.

F_DUPFD

Duplicate file descriptor.

F_DUPFD_CLOEXEC

Duplicate file descriptor with the close-on-exec flag FD_CLOEXEC set.

F_GETFD

Get file descriptor flags.

F_SETFD

Set file descriptor flags.

F_GETFL

Get file status flags and file access modes.

F_SETFL

Set file status flags.

F_GETLK

Get record locking information.

F_SETLK

Set record locking information.

F_SETLKW

Set record locking information; wait if blocked.

F_GETOWN

Get process or process group ID to receive SIGURG signals.

F_SETOWN

Set process or process group ID to receive SIGURG signals.

The <fcntl.h> header shall define the following symbolic constant used for the fcntl() file descriptor flags, which shall be suitable for use in #if preprocessing directives.

FD_CLOEXEC

Close the file descriptor upon execution of an exec family function.

The <fcntl.h> header shall also define the following symbolic constants for the l_type argument used for record locking with fcntl(). The values shall be unique and shall be suitable for use in #if preprocessing directives.

F_RDLCK

Shared or read lock.

F_UNLCK

Unlock.

F_WRLCK

Exclusive or write lock.

The <fcntl.h> header shall define the values used for l_whence, SEEK_SET, SEEK_CUR, and SEEK_END as described in <stdio.h>.

The <fcntl.h> header shall define the following symbolic constants as file creation flags for use in the oflag value to open() and openat(). The values shall be bitwise-distinct and shall be suitable for use in #if preprocessing directives.

O_CLOEXEC

The FD_CLOEXEC flag associated with the new descriptor shall be set to close the file descriptor upon execution of an exec family function.

O_CREAT

Create file if it does not exist.

O_DIRECTORY

Fail if file is a non-directory file.

O_EXCL

Exclusive use flag.

O_NOCTTY

Do not assign controlling terminal.

O_NOFOLLOW

Do not follow symbolic links.

O_TRUNC

Truncate flag.

O_TTY_INIT

Set the termios structure terminal parameters to a state that provides conforming behavior; see Section 11.2, Parameters that Can be Set.

The O_TTY_INIT flag can have the value zero and in this case it need not be bitwise-distinct from the other flags.

The <fcntl.h> header shall define the following symbolic constants for use as file status flags for open(), openat(), and fcntl(). The values shall be suitable for use in #if preprocessing directives.

O_APPEND

Set append mode.

O_DSYNC

Write according to synchronized I/O data integrity completion.

O_NONBLOCK

Non-blocking mode.

O_RSYNC

Synchronized read I/O operations.

O_SYNC

Write according to synchronized I/O file integrity completion.

The <fcntl.h> header shall define the following symbolic constant for use as the mask for file access modes. The value shall be suitable for use in #if preprocessing directives.

O_ACCMODE

Mask for file access modes.

The <fcntl.h> header shall define the following symbolic constants for use as the file access modes for open(), openat(), and fcntl(). The values shall be unique, except that O_EXEC and O_SEARCH may have equal values. The values shall be suitable for use in #if preprocessing directives.

O_EXEC

Open for execute only (non-directory files). The result is unspecified if this flag is applied to a directory.

O_RDONLY

Open for reading only.

O_RDWR

Open for reading and writing.

O_SEARCH

Open directory for search only. The result is unspecified if this flag is applied to a non-directory file.

O_WRONLY

Open for writing only.

The <fcntl.h> header shall define the symbolic constants for file modes for use as values of mode_t as described in <sys/stat.h>.

The <fcntl.h> header shall define the following symbolic constant as a special value used in place of a file descriptor for the *at() functions which take a directory file descriptor as a parameter:

AT_FDCWD

Use the current working directory to determine the target of relative file paths.

The <fcntl.h> header shall define the following symbolic constant as a value for the flag used by faccessat():

AT_EACCESS

Check access using effective user and group ID.

The <fcntl.h> header shall define the following symbolic constant as a value for the flag used by fstatat(), fchmodat(), fchownat(), and utimensat():

AT_SYMLINK_NOFOLLOW

Do not follow symbolic links.

The <fcntl.h> header shall define the following symbolic constant as a value for the flag used by linkat():

AT_SYMLINK_FOLLOW

Follow symbolic link.

The <fcntl.h> header shall define the following symbolic constant as a value for the flag used by unlinkat():

AT_REMOVEDIR

Remove directory instead of file.

The <fcntl.h> header shall define the following symbolic constants for the advice argument used by posix_fadvise():

POSIX_FADV_DONTNEED

The application expects that it will not access the specified data in the near future.

POSIX_FADV_NOREUSE

The application expects to access the specified data once and then not reuse it thereafter.

POSIX_FADV_NORMAL

The application has no advice to give on its behavior with respect to the specified data. It is the default characteristic if no advice is given for an open file.

POSIX_FADV_RANDOM

The application expects to access the specified data in a random order.

POSIX_FADV_SEQUENTIAL

The application expects to access the specified data sequentially from lower offsets to higher offsets.

POSIX_FADV_WILLNEED

The application expects to access the specified data in the near future.

The <fcntl.h> header shall define the flock structure describing a file lock. It shall include the following members:

```
short  l_type   Type of lock; F_RDLCK, F_WRLCK, F_UNLCK.
short  l_whence Flag for starting offset.
off_t  l_start  Relative offset in bytes.
off_t  l_len    Size; if 0 then until EOF.
pid_t  l_pid    Process ID of the process holding the lock; returned with F_GETLK.
```

The <fcntl.h> header shall define the mode_t, off_t, and pid_t types as described in <sys/types.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int  creat(const char *, mode_t);
int  fcntl(int, int, ...);
int  open(const char *, int, ...);
int  openat(int, const char *, int, ...);
int  posix_fadvise(int, off_t, off_t, int);
int  posix_fallocate(int, off_t, off_t);
```

Inclusion of the <fcntl.h> header may also make visible all symbols from <sys/stat.h> and <unistd.h>.

The following sections are informative.

## APPLICATION USAGE
Although no existing implementation defines AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW as the same numeric value, POSIX.1‐2008 does not prohibit that as the two constants are not used with the same interfaces.

## RATIONALE
While many of the symbolic constants introduced in the <fcntl.h> header do not strictly need to be used in #if preprocessor directives, widespread historic practice has defined them as macros that are usable in such constructs, and examination of existing applications has shown that they are occasionally used in such a way. Therefore it was decided to retain this requirement on an implementation in POSIX.1‐2008.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<stdio.h>, <sys_stat.h>, <sys_types.h>, <unistd.h>

The System Interfaces volume of POSIX.1‐2017, creat(), exec, fcntl(), futimens(), open(), posix_fadvise(), posix_fallocate(), posix_madvise()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


fenv.h

title: fenv.h(7p)

text:
# fenv.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
fenv.h — floating-point environment

## SYNOPSIS

```
#include <fenv.h>
```

## DESCRIPTION
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1‐2017 defers to the ISO C standard.

The <fenv.h> header shall define the following data types through typedef:

fenv_t

Represents the entire floating-point environment. The floating-point environment refers collectively to any floating-point status flags and control modes supported by the implementation.

fexcept_t

Represents the floating-point status flags collectively, including any status the implementation associates with the flags. A floating-point status flag is a system variable whose value is set (but never cleared) when a floating-point exception is raised, which occurs as a side-effect of exceptional floating-point arithmetic to provide auxiliary information. A floating-point control mode is a system variable whose value may be set by the user to affect the subsequent behavior of floating-point arithmetic.

The <fenv.h> header shall define each of the following macros if and only if the implementation supports the floating-point exception by means of the floating-point functions feclearexcept(), fegetexceptflag(), feraiseexcept(), fesetexceptflag(), and fetestexcept(). The defined macros shall expand to integer constant expressions with values that are bitwise-distinct.

FE_DIVBYZERO FE_INEXACT FE_INVALID FE_OVERFLOW FE_UNDERFLOW

If the implementation supports the IEC 60559 Floating-Point option, all five macros shall be defined. Additional implementation-defined floating-point exceptions with macros beginning with FE_ and an uppercase letter may also be specified by the implementation.

The <fenv.h> header shall define the macro FE_ALL_EXCEPT as the bitwise-inclusive OR of all floating-point exception macros defined by the implementation, if any. If no such macros are defined, then the macro FE_ALL_EXCEPT shall be defined as zero.

The <fenv.h> header shall define each of the following macros if and only if the implementation supports getting and setting the represented rounding direction by means of the fegetround() and fesetround() functions. The defined macros shall expand to integer constant expressions whose values are distinct non-negative values.

FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD

If the implementation supports the IEC 60559 Floating-Point option, all four macros shall be defined. Additional implementation-defined rounding directions with macros beginning with FE_ and an uppercase letter may also be specified by the implementation.

The <fenv.h> header shall define the following macro, which represents the default floating-point environment (that is, the one installed at program startup) and has type pointer to const-qualified fenv_t. It can be used as an argument to the functions within the <fenv.h> header that manage the floating-point environment.

FE_DFL_ENV

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int  feclearexcept(int);
int  fegetenv(fenv_t *);
int  fegetexceptflag(fexcept_t *, int);
int  fegetround(void);
int  feholdexcept(fenv_t *);
int  feraiseexcept(int);
int  fesetenv(const fenv_t *);
int  fesetexceptflag(const fexcept_t *, int);
int  fesetround(int);
int  fetestexcept(int);
int  feupdateenv(const fenv_t *);
```

The FENV_ACCESS pragma provides a means to inform the implementation when an application might access the floating-point environment to test floating-point status flags or run under non-default floating-point control modes. The pragma shall occur either outside external declarations or preceding all explicit declarations and statements inside a compound statement. When outside external declarations, the pragma takes effect from its occurrence until another FENV_ACCESS pragma is encountered, or until the end of the translation unit. When inside a compound statement, the pragma takes effect from its occurrence until another FENV_ACCESS pragma is encountered (including within a nested compound statement), or until the end of the compound statement; at the end of a compound statement the state for the pragma is restored to its condition just before the compound statement. If this pragma is used in any other context, the behavior is undefined. If part of an application tests floating-point status flags, sets floating-point control modes, or runs under non-default mode settings, but was translated with the state for the FENV_ACCESS pragma off, the behavior is undefined. The default state (on or off) for the pragma is implementation-defined. (When execution passes from a part of the application translated with FENV_ACCESS off to a part translated with FENV_ACCESS on, the state of the floating-point status flags is unspecified and the floating-point control modes have their default settings.)

The following sections are informative.

## APPLICATION USAGE
This header is designed to support the floating-point exception status flags and directed-rounding control modes required by the IEC 60559:1989 standard, and other similar floating-point state information. Also it is designed to facilitate code portability among all systems.

Certain application programming conventions support the intended model of use for the floating-point environment:

*

A function call does not alter its caller's floating-point control modes, clear its caller's floating-point status flags, nor depend on the state of its caller's floating-point status flags unless the function is so documented.

*

A function call is assumed to require default floating-point control modes, unless its documentation promises otherwise.

*

A function call is assumed to have the potential for raising floating-point exceptions, unless its documentation promises otherwise.

With these conventions, an application can safely assume default floating-point control modes (or be unaware of them). The responsibilities associated with accessing the floating-point environment fall on the application that does so explicitly.

Even though the rounding direction macros may expand to constants corresponding to the values of FLT_ROUNDS, they are not required to do so.

For example:

```
#include <fenv.h>
void f(double x)
{

    #pragma STDC FENV_ACCESS ON

    void g(double);

    void h(double);

    /* ... */

    g(x + 1);

    h(x + 1);

    /* ... */
}
```

If the function g() might depend on status flags set as a side-effect of the first x+1, or if the second x+1 might depend on control modes set as a side-effect of the call to function g(), then the application shall contain an appropriately placed invocation as follows:

```
#pragma STDC FENV_ACCESS ON
```

## RATIONALE

### The fexcept_t Type
fexcept_t does not have to be an integer type. Its values must be obtained by a call to fegetexceptflag(), and cannot be created by logical operations from the exception macros. An implementation might simply implement fexcept_t as an int and use the representations reflected by the exception macros, but is not required to; other representations might contain extra information about the exceptions. fexcept_t might be a struct with a member for each exception (that might hold the address of the first or last floating-point instruction that caused that exception). The ISO/IEC 9899:1999 standard makes no claims about the internals of an fexcept_t, and so the user cannot inspect it.

### Exception and Rounding Macros
Macros corresponding to unsupported modes and rounding directions are not defined by the implementation and must not be defined by the application. An application might use #ifdef to test for this.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, feclearexcept(), fegetenv(), fegetexceptflag(), fegetround(), feholdexcept(), feraiseexcept(), fetestexcept(), feupdateenv()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


float.h

title: float.h(7p)

text:
# float.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
float.h — floating types

## SYNOPSIS

```
#include <float.h>
```

## DESCRIPTION
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1‐2017 defers to the ISO C standard.

The characteristics of floating types are defined in terms of a model that describes a representation of floating-point numbers and values that provide information about an implementation's floating-point arithmetic.

The following parameters are used to define the model for each floating-point type:

s

Sign (±1).

b

Base or radix of exponent representation (an integer >1).

e

Exponent (an integer between a minimum e_min and a maximum e_max ).

p

Precision (the number of base-b digits in the significand).

f_k " 6 Non-negative integers less than b (the significand digits).

A floating-point number x is defined by the following model:

x = sb^e ∑k=1p f_k b^ -k, e_min ≤ e ≤ e_max

In addition to normalized floating-point numbers ( f_1 >0 if x≠0), floating types may be able to contain other kinds of floating-point numbers, such as subnormal floating-point numbers (x≠0, e= e_min , f_1 =0) and unnormalized floating-point numbers (x≠0, e> e_min , f_1 =0), and values that are not floating-point numbers, such as infinities and NaNs. A NaN is an encoding signifying Not-a-Number. A quiet NaN propagates through almost every arithmetic operation without raising a floating-point exception; a signaling NaN generally raises a floating-point exception when occurring as an arithmetic operand.

An implementation may give zero and non-numeric values, such as infinities and NaNs, a sign, or may leave them unsigned. Wherever such values are unsigned, any requirement in POSIX.1‐2008 to retrieve the sign shall produce an unspecified sign and any requirement to set the sign shall be ignored.

The accuracy of the floating-point operations ('+', '-', '*', '/') and of the functions in <math.h> and <complex.h> that return floating-point results is implementation-defined, as is the accuracy of the conversion between floating-point internal representations and string representations performed by the functions in <stdio.h>, <stdlib.h>, and <wchar.h>. The implementation may state that the accuracy is unknown.

All integer values in the <float.h> header, except FLT_ROUNDS, shall be constant expressions suitable for use in #if preprocessing directives; all floating values shall be constant expressions. All except DECIMAL_DIG, FLT_EVAL_METHOD, FLT_RADIX, and FLT_ROUNDS have separate names for all three floating-point types. The floating-point model representation is provided for all values except FLT_EVAL_METHOD and FLT_ROUNDS.

The rounding mode for floating-point addition is characterized by the implementation-defined value of FLT_ROUNDS:

-1

Indeterminable.

0

Toward zero.

1

To nearest.

2

Toward positive infinity.

3

Toward negative infinity.

All other values for FLT_ROUNDS characterize implementation-defined rounding behavior.

The values of operations with floating operands and values subject to the usual arithmetic conversions and of floating constants are evaluated to a format whose range and precision may be greater than required by the type. The use of evaluation formats is characterized by the implementation-defined value of FLT_EVAL_METHOD:

-1

Indeterminable.

0

Evaluate all operations and constants just to the range and precision of the type.

1

Evaluate operations and constants of type float and double to the range and precision of the double type; evaluate long double operations and constants to the range and precision of the long double type.

2

Evaluate all operations and constants to the range and precision of the long double type.

All other negative values for FLT_EVAL_METHOD characterize implementation-defined behavior.

The <float.h> header shall define the following values as constant expressions with implementation-defined values that are greater or equal in magnitude (absolute value) to those shown, with the same sign.

*

Radix of exponent representation, b.

FLT_RADIX

2

*

Number of base-FLT_RADIX digits in the floating-point significand, p.

FLT_MANT_DIG

DBL_MANT_DIG

LDBL_MANT_DIG

*

Number of decimal digits, n, such that any floating-point number in the widest supported floating type with p_max radix b digits can be rounded to a floating-point number with n decimal digits and back again without change to the value.

p_max log_10 b 1 + p_max log_10 b if b is a power of 10otherwise

DECIMAL_DIG

10

*

Number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again without change to the q decimal digits.

p log_10 b (p − 1) log_10 b if b is a power of 10otherwise

FLT_DIG

6

DBL_DIG

10

LDBL_DIG

10

*

Minimum negative integer such that FLT_RADIX raised to that power minus 1 is a normalized floating-point number, e_min .

FLT_MIN_EXP

DBL_MIN_EXP

LDBL_MIN_EXP

*

Minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers.

log_10 b^ e_min ^ -1

FLT_MIN_10_EXP

-37

DBL_MIN_10_EXP

-37

LDBL_MIN_10_EXP

-37

*

Maximum integer such that FLT_RADIX raised to that power minus 1 is a representable finite floating-point number, e_max .

FLT_MAX_EXP

DBL_MAX_EXP

LDBL_MAX_EXP

Additionally, FLT_MAX_EXP shall be at least as large as FLT_MANT_DIG, DBL_MAX_EXP shall be at least as large as DBL_MANT_DIG, and LDBL_MAX_EXP shall be at least as large as LDBL_MANT_DIG; which has the effect that FLT_MAX, DBL_MAX, and LDBL_MAX are integral.

*

Maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers.

log_10 ((1 − b^ -p) b^e _max )

FLT_MAX_10_EXP

+37

DBL_MAX_10_EXP

+37

LDBL_MAX_10_EXP

+37

The <float.h> header shall define the following values as constant expressions with implementation-defined values that are greater than or equal to those shown:

*

Maximum representable finite floating-point number.

(1 − b^ -p) b^e _max

FLT_MAX

1E+37

DBL_MAX

1E+37

LDBL_MAX

1E+37

The <float.h> header shall define the following values as constant expressions with implementation-defined (positive) values that are less than or equal to those shown:

*

The difference between 1 and the least value greater than 1 that is representable in the given floating-point type, b^ 1 − p .

FLT_EPSILON

1E-5

DBL_EPSILON

1E-9

LDBL_EPSILON

1E-9

*

Minimum normalized positive floating-point number, b^ e_min ^ -1 .

FLT_MIN

1E-37

DBL_MIN

1E-37

LDBL_MIN

1E-37

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
All known hardware floating-point formats satisfy the property that the exponent range is larger than the number of mantissa digits. The ISO C standard permits a floating-point format where this property is not true, such that the largest finite value would not be integral; however, it is unlikely that there will ever be hardware support for such a floating-point format, and it introduces boundary cases that portable programs should not have to be concerned with (for example, a non-integral DBL_MAX means that ceil() would have to worry about overflow). Therefore, this standard imposes an additional requirement that the largest representable finite value is integral.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<complex.h>, <math.h>, <stdio.h>, <stdlib.h>, <wchar.h>

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


fmtmsg.h

title: fmtmsg.h(7p)

text:
# fmtmsg.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
fmtmsg.h — message display structures

## SYNOPSIS

```
#include <fmtmsg.h>
```

## DESCRIPTION
The <fmtmsg.h> header shall define the following symbolic constants:

MM_HARD

Source of the condition is hardware.

MM_SOFT

Source of the condition is software.

MM_FIRM

Source of the condition is firmware.

MM_APPL

Condition detected by application.

MM_UTIL

Condition detected by utility.

MM_OPSYS

Condition detected by operating system.

MM_RECOVER

Recoverable error.

MM_NRECOV

Non-recoverable error.

MM_HALT

Error causing application to halt.

MM_ERROR

Application has encountered a non-fatal fault.

MM_WARNING

Application has detected unusual non-error condition.

MM_INFO

Informative message.

MM_NOSEV

No severity level provided for the message.

MM_PRINT

Display message on standard error.

MM_CONSOLE

Display message on system console.

The table below indicates the null values and identifiers for fmtmsg() arguments. The <fmtmsg.h> header shall define the symbolic constants in the Identifier column, which shall have the type indicated in the Type column:

Argument

Type

Null-Value

Identifier

label

char *

(char*)0

MM_NULLLBL

severity

int

0

MM_NULLSEV

class

long

0L

MM_NULLMC

text

char *

(char*)0

MM_NULLTXT

action

char *

(char*)0

MM_NULLACT

tag

char *

(char*)0

MM_NULLTAG

The <fmtmsg.h> header shall also define the following symbolic constants for use as return values for fmtmsg():

MM_OK

The function succeeded.

MM_NOTOK

The function failed completely.

MM_NOMSG

The function was unable to generate a message on standard error, but otherwise succeeded.

MM_NOCON

The function was unable to generate a console message, but otherwise succeeded.

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.

```
int fmtmsg(long, const char *, int,

    const char *, const char *, const char *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, fmtmsg()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


fnmatch.h

title: fnmatch.h(7p)

text:
# fnmatch.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
fnmatch.h — filename-matching types

## SYNOPSIS

```
#include <fnmatch.h>
```

## DESCRIPTION
The <fnmatch.h> header shall define the following symbolic constants:

FNM_NOMATCH

The string does not match the specified pattern.

FNM_PATHNAME

<slash> in string only matches <slash> in pattern.

FNM_PERIOD

Leading <period> in string must be exactly matched by <period> in pattern.

FNM_NOESCAPE

Disable backslash escaping.

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.

```
int fnmatch(const char *, const char *, int);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, fnmatch()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


ftw.h

title: ftw.h(7p)

text:
# ftw.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
ftw.h — file tree traversal

## SYNOPSIS

```
#include <ftw.h>
```

## DESCRIPTION
The <ftw.h> header shall define the FTW structure, which shall include at least the following members:

```
int  base
int  level
```

The <ftw.h> header shall define the following symbolic constants for use as values of the third argument to the application-supplied function that is passed as the second argument to ftw() and nftw():

FTW_F

Non-directory file.

FTW_D

Directory.

FTW_DNR

Directory without read permission.

FTW_DP

Directory with subdirectories visited.

FTW_NS

Unknown type; stat() failed.

FTW_SL

Symbolic link.

FTW_SLN

Symbolic link that names a nonexistent file.

The <ftw.h> header shall define the following symbolic constants for use as values of the fourth argument to nftw():

FTW_PHYS

Physical walk, does not follow symbolic links. Otherwise, nftw() follows links but does not walk down any path that crosses itself.

FTW_MOUNT

The walk does not cross a mount point.

FTW_DEPTH

All subdirectories are visited before the directory itself.

FTW_CHDIR

The walk changes to each directory before reading it.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int ftw(const char *, int (*)(const char *, const struct stat *,

    int), int);
int nftw(const char *, int (*)(const char *, const struct stat *,

    int, struct FTW *), int, int);
```

The <ftw.h> header shall define the stat structure and the symbolic names for st_mode and the file type test macros as described in <sys/stat.h>.

Inclusion of the <ftw.h> header may also make visible all symbols from <sys/stat.h>.

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_stat.h>

The System Interfaces volume of POSIX.1‐2017, ftw(), nftw()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


glob.h

title: glob.h(7p)

text:
# glob.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
glob.h — pathname pattern-matching types

## SYNOPSIS

```
#include <glob.h>
```

## DESCRIPTION
The <glob.h> header shall define the structures and symbolic constants used by the glob() function.

The <glob.h> header shall define the glob_t structure type, which shall include at least the following members:

```
size_t   gl_pathc Count of paths matched by pattern.
char   **gl_pathv Pointer to a list of matched pathnames.
size_t   gl_offs  Slots to reserve at the beginning of gl_pathv.
```

The <glob.h> header shall define the size_t type as described in <sys/types.h>.

The <glob.h> header shall define the following symbolic constants as values for the flags argument:

GLOB_APPEND

Append generated pathnames to those previously obtained.

GLOB_DOOFFS

Specify how many null pointers to add to the beginning of gl_pathv.

GLOB_ERR

Cause glob() to return on error.

GLOB_MARK

Each pathname that is a directory that matches pattern has a <slash> appended.

GLOB_NOCHECK

If pattern does not match any pathname, then return a list consisting of only pattern.

GLOB_NOESCAPE

Disable backslash escaping.

GLOB_NOSORT

Do not sort the pathnames returned.

The <glob.h> header shall define the following symbolic constants as error return values:

GLOB_ABORTED

The scan was stopped because GLOB_ERR was set or (*errfunc)() returned non-zero.

GLOB_NOMATCH

The pattern does not match any existing pathname, and GLOB_NOCHECK was not set in flags.

GLOB_NOSPACE

An attempt to allocate memory failed.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
int  glob(const char *restrict, int, int(*)(const char *, int),

         glob_t *restrict);
void globfree(glob_t *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, glob()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


grp.h

title: grp.h(7p)

text:
# grp.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
grp.h — group structure

## SYNOPSIS

```
#include <grp.h>
```

## DESCRIPTION
The <grp.h> header shall declare the group structure, which shall include the following members:

```
char   *gr_name The name of the group.
gid_t   gr_gid  Numerical group ID.
char  **gr_mem  Pointer to a null-terminated array of character

                pointers to member names.
```

The <grp.h> header shall define the gid_t and size_t types as described in <sys/types.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
void           endgrent(void);
struct group  *getgrent(void);
struct group  *getgrgid(gid_t);
int            getgrgid_r(gid_t, struct group *, char *,

                   size_t, struct group **);
struct group  *getgrnam(const char *);
int            getgrnam_r(const char *, struct group *, char *,

                   size_t , struct group **);
void           setgrent(void);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, endgrent(), getgrgid(), getgrnam()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


iconv.h

title: iconv.h(7p)

text:
# iconv.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
iconv.h — codeset conversion facility

## SYNOPSIS

```
#include <iconv.h>
```

## DESCRIPTION
The <iconv.h> header shall define the following types:

iconv_t

Identifies the conversion from one codeset to another.

size_t

As described in <sys/types.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
size_t  iconv(iconv_t, char **restrict, size_t *restrict,

            char **restrict, size_t *restrict);
int     iconv_close(iconv_t);
iconv_t iconv_open(const char *, const char *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, iconv(), iconv_close(), iconv_open()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


inttypes.h

title: inttypes.h(7p)

text:
# inttypes.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
inttypes.h — fixed size integer types

## SYNOPSIS

```
#include <inttypes.h>
```

## DESCRIPTION
Some of the functionality described on this reference page extends the ISO C standard. Applications shall define the appropriate feature test macro (see the System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment) to enable the visibility of these symbols in this header.

The <inttypes.h> header shall include the <stdint.h> header.

The <inttypes.h> header shall define at least the following types:

imaxdiv_t

Structure type that is the type of the value returned by the imaxdiv() function.

wchar_t

As described in <stddef.h>.

The <inttypes.h> header shall define the following macros. Each expands to a character string literal containing a conversion specifier, possibly modified by a length modifier, suitable for use within the format argument of a formatted input/output function when converting the corresponding integer type. These macros have the general form of PRI (character string literals for the fprintf() and fwprintf() family of functions) or SCN (character string literals for the fscanf() and fwscanf() family of functions), followed by the conversion specifier, followed by a name corresponding to a similar type name in <stdint.h>. In these names, N represents the width of the type as described in <stdint.h>. For example, PRIdFAST32 can be used in a format string to print the value of an integer of type int_fast32_t.

The fprintf() macros for signed integers are:

PRIdN

PRIdLEASTN

PRIdFASTN

PRIdMAX

PRIdPTR

PRIiN

PRIiLEASTN

PRIiFASTN

PRIiMAX

PRIiPTR

The fprintf() macros for unsigned integers are:

PRIoN

PRIoLEASTN

PRIoFASTN

PRIoMAX

PRIoPTR

PRIuN

PRIuLEASTN

PRIuFASTN

PRIuMAX

PRIuPTR

PRIxN

PRIxLEASTN

PRIxFASTN

PRIxMAX

PRIxPTR

PRIXN

PRIXLEASTN

PRIXFASTN

PRIXMAX

PRIXPTR

The fscanf() macros for signed integers are:

SCNdN

SCNdLEASTN

SCNdFASTN

SCNdMAX

SCNdPTR

SCNiN

SCNiLEASTN

SCNiFASTN

SCNiMAX

SCNiPTR

The fscanf() macros for unsigned integers are:

SCNoN

SCNoLEASTN

SCNoFASTN

SCNoMAX

SCNoPTR

SCNuN

SCNuLEASTN

SCNuFASTN

SCNuMAX

SCNuPTR

SCNxN

SCNxLEASTN

SCNxFASTN

SCNxMAX

SCNxPTR

For each type that the implementation provides in <stdint.h>, the corresponding fprintf() and fwprintf() macros shall be defined and the corresponding fscanf() and fwscanf() macros shall be defined unless the implementation does not have a suitable modifier for the type.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
intmax_t  imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t  strtoimax(const char *restrict, char **restrict, int);
uintmax_t strtoumax(const char *restrict, char **restrict, int);
intmax_t  wcstoimax(const wchar_t *restrict, wchar_t **restrict, int);
uintmax_t wcstoumax(const wchar_t *restrict, wchar_t **restrict, int);
```

The following sections are informative.

## EXAMPLES

```
#include <inttypes.h>
#include <wchar.h>
int main(void)
{

    uintmax_t i = UINTMAX_MAX; // This type always exists.

    wprintf(L"The largest integer value is %020"

        PRIxMAX "\n", i);

    return 0;
}
```

## APPLICATION USAGE
The purpose of <inttypes.h> is to provide a set of integer types whose definitions are consistent across machines and independent of operating systems and other implementation idiosyncrasies. It defines, through typedef, integer types of various sizes. Implementations are free to typedef them as ISO C standard integer types or extensions that they support. Consistent use of this header will greatly increase the portability of applications across platforms.

## RATIONALE
The ISO/IEC 9899:1990 standard specified that the language should support four signed and unsigned integer data types—char, short, int, and long—but placed very little requirement on their size other than that int and short be at least 16 bits and long be at least as long as int and not smaller than 32 bits. For 16-bit systems, most implementations assigned 8, 16, 16, and 32 bits to char, short, int, and long, respectively. For 32-bit systems, the common practice has been to assign 8, 16, 32, and 32 bits to these types. This difference in int size can create some problems for users who migrate from one system to another which assigns different sizes to integer types, because the ISO C standard integer promotion rule can produce silent changes unexpectedly. The need for defining an extended integer type increased with the introduction of 64-bit systems.

## FUTURE DIRECTIONS
Macro names beginning with PRI or SCN followed by any lowercase letter or 'X' may be added to the macros defined in the <inttypes.h> header.

## SEE ALSO
<stddef.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment, imaxabs(), imaxdiv(), strtoimax(), wcstoimax()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


title: iso646.h(7p)

text:
# iso646.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
iso646.h — alternative spellings

## SYNOPSIS

```
#include <iso646.h>
```

## DESCRIPTION
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1‐2017 defers to the ISO C standard.

The <iso646.h> header shall define the following eleven macros (on the left) that expand to the corresponding tokens (on the right):

and

&&

and_eq

&=

bitand

&

bitor

|

compl

~

not

!

not_eq

!=

or

||

or_eq

|=

xor

^

xor_eq

^=

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
None.

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


langinfo.h

title: langinfo.h(7p)

text:
# langinfo.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
langinfo.h — language information constants

## SYNOPSIS

```
#include <langinfo.h>
```

## DESCRIPTION
The <langinfo.h> header shall define the symbolic constants used to identify items of langinfo data (see nl_langinfo()).

The <langinfo.h> header shall define the locale_t type as described in <locale.h>.

The <langinfo.h> header shall define the nl_item type as described in <nl_types.h>.

The <langinfo.h> header shall define the following symbolic constants with type nl_item. The entries under Category indicate in which setlocale() category each item is defined.

Constant

Category

Meaning

CODESET

LC_CTYPE

Codeset name.

D_T_FMT

LC_TIME

String for formatting date and time.

D_FMT

LC_TIME

Date format string.

T_FMT

LC_TIME

Time format string.

T_FMT_AMPM

LC_TIME

a.m. or p.m. time format string.

AM_STR

LC_TIME

Ante-meridiem affix.

PM_STR

LC_TIME

Post-meridiem affix.

DAY_1

LC_TIME

Name of the first day of the week (for example, Sunday).

DAY_2

LC_TIME

Name of the second day of the week (for example, Monday).

DAY_3

LC_TIME

Name of the third day of the week (for example, Tuesday).

DAY_4

LC_TIME

Name of the fourth day of the week

(for example, Wednesday).

DAY_5

LC_TIME

Name of the fifth day of the week (for example, Thursday).

DAY_6

LC_TIME

Name of the sixth day of the week (for example, Friday).

DAY_7

LC_TIME

Name of the seventh day of the week

(for example, Saturday).

ABDAY_1

LC_TIME

Abbreviated name of the first day of the week.

ABDAY_2

LC_TIME

Abbreviated name of the second day of the week.

ABDAY_3

LC_TIME

Abbreviated name of the third day of the week.

ABDAY_4

LC_TIME

Abbreviated name of the fourth day of the week.

ABDAY_5

LC_TIME

Abbreviated name of the fifth day of the week.

ABDAY_6

LC_TIME

Abbreviated name of the sixth day of the week.

ABDAY_7

LC_TIME

Abbreviated name of the seventh day of the week.

MON_1

LC_TIME

Name of the first month of the year.

MON_2

LC_TIME

Name of the second month.

MON_3

LC_TIME

Name of the third month.

MON_4

LC_TIME

Name of the fourth month.

MON_5

LC_TIME

Name of the fifth month.

MON_6

LC_TIME

Name of the sixth month.

MON_7

LC_TIME

Name of the seventh month.

MON_8

LC_TIME

Name of the eighth month.

MON_9

LC_TIME

Name of the ninth month.

MON_10

LC_TIME

Name of the tenth month.

MON_11

LC_TIME

Name of the eleventh month.

MON_12

LC_TIME

Name of the twelfth month.

ABMON_1

LC_TIME

Abbreviated name of the first month.

ABMON_2

LC_TIME

Abbreviated name of the second month.

ABMON_3

LC_TIME

Abbreviated name of the third month.

ABMON_4

LC_TIME

Abbreviated name of the fourth month.

ABMON_5

LC_TIME

Abbreviated name of the fifth month.

ABMON_6

LC_TIME

Abbreviated name of the sixth month.

ABMON_7

LC_TIME

Abbreviated name of the seventh month.

ABMON_8

LC_TIME

Abbreviated name of the eighth month.

ABMON_9

LC_TIME

Abbreviated name of the ninth month.

ABMON_10

LC_TIME

Abbreviated name of the tenth month.

ABMON_11

LC_TIME

Abbreviated name of the eleventh month.

ABMON_12

LC_TIME

Abbreviated name of the twelfth month.

ERA

LC_TIME

Era description segments.

ERA_D_FMT

LC_TIME

Era date format string.

ERA_D_T_FMT

LC_TIME

Era date and time format string.

ERA_T_FMT

LC_TIME

Era time format string.

ALT_DIGITS

LC_TIME

Alternative symbols for digits.

RADIXCHAR

LC_NUMERIC

Radix character.

THOUSEP

LC_NUMERIC

Separator for thousands.

YESEXPR

LC_MESSAGES

Affirmative response expression.

NOEXPR

LC_MESSAGES

Negative response expression.

CRNCYSTR

LC_MONETARY

Local currency symbol, preceded by '-' if the symbol should appear before the value, '+' if the symbol should appear after the value, or '.' if the symbol should replace the radix character. If the local currency symbol is the empty string, implementations may return the empty string ( "" ).

If the locale's values for p_cs_precedes and n_cs_precedes do not match, the value of nl_langinfo(CRNCYSTR) and nl_langinfo_l(CRNCYSTR,loc) is unspecified.

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.

```
char *nl_langinfo(nl_item);
char *nl_langinfo_l(nl_item, locale_t);
```

Inclusion of the <langinfo.h> header may also make visible all symbols from <nl_types.h>.

The following sections are informative.

## APPLICATION USAGE
Wherever possible, users are advised to use functions compatible with those in the ISO C standard to access items of langinfo data. In particular, the strftime() function should be used to access date and time information defined in category LC_TIME. The localeconv() function should be used to access information corresponding to RADIXCHAR, THOUSEP, and CRNCYSTR.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
Chapter 7, Locale, <locale.h>, <nl_types.h>

The System Interfaces volume of POSIX.1‐2017, nl_langinfo(), localeconv(), strfmon(), strftime()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


libgen.h

title: libgen.h(7p)

text:
# libgen.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
libgen.h — definitions for pattern matching functions

## SYNOPSIS

```
#include <libgen.h>
```

## DESCRIPTION
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

```
char  *basename(char *);
char  *dirname(char *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The System Interfaces volume of POSIX.1‐2017, basename(), dirname()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


limits.h

title: limits.h(7p)

text:
# limits.h(7p)

## PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME
limits.h — implementation-defined constants

## SYNOPSIS

```
#include <limits.h>
```

## DESCRIPTION
Some of the functionality described on this reference page extends the ISO C standard. Applications shall define the appropriate feature test macro (see the System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment) to enable the visibility of these symbols in this header.

Many of the symbols listed here are not defined by the ISO/IEC 9899:1999 standard. Such symbols are not shown as CX shaded, except under the heading ``Numerical Limits''.

The <limits.h> header shall define macros and symbolic constants for various limits. Different categories of limits are described below, representing various limits on resources that the implementation imposes on applications. All macros and symbolic constants defined in this header shall be suitable for use in #if preprocessing directives.

Implementations may choose any appropriate value for each limit, provided it is not more restrictive than the Minimum Acceptable Values listed below. Symbolic constant names beginning with _POSIX may be found in <unistd.h>.

Applications should not assume any particular value for a limit. To achieve maximum portability, an application should not require more resource than the Minimum Acceptable Value quantity. However, an application wishing to avail itself of the full amount of a resource available on an implementation may make use of the value given in <limits.h> on that particular implementation, by using the macros and symbolic constants listed below. It should be noted, however, that many of the listed limits are not invariant, and at runtime, the value of the limit may differ from those given in this header, for the following reasons:

*

The limit is pathname-dependent.

*

The limit differs between the compile and runtime machines.

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

The items in the list ending in _MIN give the most negative values that the mathematical types are guaranteed to be capable of representing. Numbers of a more negative value may be supported on some implementations, as indicated by the <limits.h> header on the implementation, but applications requiring such numbers are not guaranteed to be portable to all implementations. For positive constants ending in _MIN, this indicates the minimum acceptable value.

### Runtime Invariant Values (Possibly Indeterminate)
A definition of one of the symbolic constants in the following list shall be omitted from <limits.h> on specific implementations where the corresponding value is equal to or greater than the stated minimum, but is unspecified.

This indetermination might depend on the amount of available memory space on a specific instance of a specific implementation. The actual value supported by a specific instance shall be provided by the sysconf() function.

{AIO_LISTIO_MAX}

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

Minimum Acceptable Value: {_POSIX_AIO_LISTIO_MAX}

{AIO_MAX}

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

Minimum Acceptable Value: {_POSIX_AIO_MAX}

{AIO_PRIO_DELTA_MAX}

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

Minimum Acceptable Value: 0

{ARG_MAX}

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

Minimum Acceptable Value: {_POSIX_ARG_MAX}

{ATEXIT_MAX}

Maximum number of functions that may be registered with atexit().

Minimum Acceptable Value: 32

{CHILD_MAX}

Maximum number of simultaneous processes per real user ID.

Minimum Acceptable Value: {_POSIX_CHILD_MAX}

{DELAYTIMER_MAX}

Maximum number of timer expiration overruns.

Minimum Acceptable Value: {_POSIX_DELAYTIMER_MAX}

{HOST_NAME_MAX}

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

Minimum Acceptable Value: {_POSIX_HOST_NAME_MAX}

{IOV_MAX}

Maximum number of iovec structures that one process has available for use with readv() or writev().

Minimum Acceptable Value: {_XOPEN_IOV_MAX}

{LOGIN_NAME_MAX}

Maximum length of a login name.

Minimum Acceptable Value: {_POSIX_LOGIN_NAME_MAX}

{MQ_OPEN_MAX}

The maximum number of open message queue descriptors a process may hold.

Minimum Acceptable Value: {_POSIX_MQ_OPEN_MAX}

{MQ_PRIO_MAX}

The maximum number of message priorities supported by the implementation.

Minimum Acceptable Value: {_POSIX_MQ_PRIO_MAX}

{OPEN_MAX}

A value one greater than the maximum value that the system may assign to a newly-created file descriptor.

Minimum Acceptable Value: {_POSIX_OPEN_MAX}

{PAGESIZE}

Size in bytes of a page.

Minimum Acceptable Value: 1

{PAGE_SIZE}

Equivalent to {PAGESIZE}. If either {PAGESIZE} or {PAGE_SIZE} is defined, the other is defined with the same value.

{PTHREAD_DESTRUCTOR_ITERATIONS}

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

Minimum Acceptable Value: {_POSIX_THREAD_DESTRUCTOR_ITERATIONS}

{PTHREAD_KEYS_MAX}

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

Minimum Acceptable Value: {_POSIX_THREAD_KEYS_MAX}

{PTHREAD_STACK_MIN}

Minimum size in bytes of thread stack storage.

Minimum Acceptable Value: 0

{PTHREAD_THREADS_MAX}

Maximum number of threads that can be created per process.

Minimum Acceptable Value: {_POSIX_THREAD_THREADS_MAX}

{RTSIG_MAX}

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

Minimum Acceptable Value: {_POSIX_RTSIG_MAX}

{SEM_NSEMS_MAX}

Maximum number of semaphores that a process may have.

Minimum Acceptable Value: {_POSIX_SEM_NSEMS_MAX}

{SEM_VALUE_MAX}

The maximum value a semaphore may have.

Minimum Acceptable Value: {_POSIX_SEM_VALUE_MAX}

{SIGQUEUE_MAX}

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

Minimum Acceptable Value: {_POSIX_SIGQUEUE_MAX}

{SS_REPL_MAX}

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

Minimum Acceptable Value: {_POSIX_SS_REPL_MAX}

{STREAM_MAX}

Maximum number of streams that one process can have open at one time. If defined, it has the same value as {FOPEN_MAX} (see <stdio.h>).

Minimum Acceptable Value: {_POSIX_STREAM_MAX}

{SYMLOOP_MAX}

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

Minimum Acceptable Value: {_POSIX_SYMLOOP_MAX}

{TIMER_MAX}

Maximum number of timers per process supported by the implementation.

Minimum Acceptable Value: {_POSIX_TIMER_MAX}

{TRACE_EVENT_NAME_MAX}

Maximum length of the trace event name (not including the terminating null).

Minimum Acceptable Value: {_POSIX_TRACE_EVENT_NAME_MAX}

{TRACE_NAME_MAX}

Maximum length of the trace generation version string or of the trace stream name (not including the terminating null).

Minimum Acceptable Value: {_POSIX_TRACE_NAME_MAX}

{TRACE_SYS_MAX}

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

Minimum Acceptable Value: {_POSIX_TRACE_SYS_MAX}

{TRACE_USER_EVENT_MAX}

Maximum number of user trace event type identifiers that may simultaneously exist in a traced process, including the predefined user trace event POSIX_TRACE_UNNAMED_USER_EVENT.

Minimum Acceptable Value: {_POSIX_TRACE_USER_EVENT_MAX}

{TTY_NAME_MAX}

Maximum length of terminal device name.

Minimum Acceptable Value: {_POSIX_TTY_NAME_MAX}

{TZNAME_MAX}

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

Minimum Acceptable Value: {_POSIX_TZNAME_MAX}

Note:

The length given by {TZNAME_MAX} does not include the quoting characters mentioned in Section 8.3, Other Environment Variables.

### Pathname Variable Values
The values in the following list may be constants within an implementation or may vary from one pathname to another. For example, file systems or directories may have different characteristics.

A definition of one of the symbolic constants in the following list shall be omitted from the <limits.h> header on specific implementations where the corresponding value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied. The actual value supported for a specific pathname shall be provided by the pathconf() 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.

Minimum Acceptable Value: 32

{LINK_MAX}

Maximum number of links to a single file.

Minimum Acceptable Value: {_POSIX_LINK_MAX}

{MAX_CANON}

Maximum number of bytes in a terminal canonical input line.

Minimum Acceptable Value: {_POSIX_MAX_CANON}

{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.

Minimum Acceptable Value: {_POSIX_MAX_INPUT}

{NAME_MAX}

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

Minimum Acceptable Value: {_POSIX_NAME_MAX}

Minimum Acceptable Value: {_XOPEN_NAME_MAX}

{PATH_MAX}

Maximum number of bytes the implementation will store as a pathname in a user-supplied buffer of unspecified size, including the terminating null character. Minimum number the implementation will accept as the maximum number of bytes in a pathname.

Minimum Acceptable Value: {_POSIX_PATH_MAX}

Minimum Acceptable Value: {_XOPEN_PATH_MAX}

{PIPE_BUF}

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

Minimum Acceptable Value: {_POSIX_PIPE_BUF}

{POSIX_ALLOC_SIZE_MIN}

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

Minimum Acceptable Value: Not specified.

{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.

Minimum Acceptable Value: Not specified.

{POSIX_REC_MAX_XFER_SIZE}

Maximum recommended file transfer size.

Minimum Acceptable Value: Not specified.

{POSIX_REC_MIN_XFER_SIZE}

Minimum recommended file transfer size.

Minimum Acceptable Value: Not specified.

{POSIX_REC_XFER_ALIGN}

Recommended file transfer buffer alignment.

Minimum Acceptable Value: Not specified.

{SYMLINK_MAX}

Maximum number of bytes in a symbolic link.

Minimum Acceptable Value: {_POSIX_SYMLINK_MAX}

### Runtime Increasable Values
The magnitude limitations in the following list shall be fixed by specific implementations. An application should assume that the value of the symbolic constant defined 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 may increase the value relative to that supplied by <limits.h> for that implementation. The actual value supported by a specific instance shall be provided by the sysconf() function.

{BC_BASE_MAX}

Maximum obase values allowed by the bc utility.

Minimum Acceptable Value: {_POSIX2_BC_BASE_MAX}

{BC_DIM_MAX}

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

Minimum Acceptable Value: {_POSIX2_BC_DIM_MAX}

{BC_SCALE_MAX}

Maximum scale value allowed by the bc utility.

Minimum Acceptable Value: {_POSIX2_BC_SCALE_MAX}

{BC_STRING_MAX}

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

Minimum Acceptable Value: {_POSIX2_BC_STRING_MAX}

{CHARCLASS_NAME_MAX}

Maximum number of bytes in a character class name.

Minimum Acceptable Value: {_POSIX2_CHARCLASS_NAME_MAX}

{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; see Chapter 7, Locale.

Minimum Acceptable Value: {_POSIX2_COLL_WEIGHTS_MAX}

{EXPR_NEST_MAX}

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

Minimum Acceptable Value: {_POSIX2_EXPR_NEST_MAX}

{LINE_MAX}

Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>.

Minimum Acceptable Value: {_POSIX2_LINE_MAX}

{NGROUPS_MAX}

Maximum number of simultaneous supplementary group IDs per process.

Minimum Acceptable Value: {_POSIX_NGROUPS_MAX}

{RE_DUP_MAX}

Maximum number of repeated occurrences of a BRE or ERE interval expression; see Section 9.3.6, BREs Matching Multiple Characters and Section 9.4.6, EREs Matching Multiple Characters.

Minimum Acceptable Value: {_POSIX_RE_DUP_MAX}

### Maximum Values
The <limits.h> header shall define the following symbolic constants with the values shown. These are the most restrictive values for certain features on an implementation. A conforming implementation shall provide values no larger than these values. A conforming application must not require a smaller value for correct operation.

{_POSIX_CLOCKRES_MIN}

The resolution of the CLOCK_REALTIME clock, in nanoseconds.

Value: 20 000 000

If the Monotonic Clock option is supported, the resolution of the CLOCK_MONOTONIC clock, in nanoseconds, is represented by {_POSIX_CLOCKRES_MIN}.

### Minimum Values
The <limits.h> header shall define the following symbolic constants with the values shown. These are the most restrictive values for certain features on an implementation conforming to this volume of POSIX.1‐2017. Related symbolic constants are defined elsewhere in this volume of POSIX.1‐2017 which reflect the actual implementation and which need not be as restrictive. For each of these limits, a conforming implementation shall provide a value at least this large or shall have no limit. A strictly conforming application must not require a larger value for correct operation.

{_POSIX_AIO_LISTIO_MAX}

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

Value: 2

{_POSIX_AIO_MAX}

The number of outstanding asynchronous I/O operations.

Value: 1

{_POSIX_ARG_MAX}

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

Value: 4 096

{_POSIX_CHILD_MAX}

Maximum number of simultaneous processes per real user ID.

Value: 25

{_POSIX_DELAYTIMER_MAX}

The number of timer expiration overruns.

Value: 32

{_POSIX_HOST_NAME_MAX}

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

Value: 255

{_POSIX_LINK_MAX}

Maximum number of links to a single file.

Value: 8

{_POSIX_LOGIN_NAME_MAX}

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

Value: 9

{_POSIX_MAX_CANON}

Maximum number of bytes in a terminal canonical input queue.

Value: 255

{_POSIX_MAX_INPUT}

Maximum number of bytes allowed in a terminal input queue.

Value: 255

{_POSIX_MQ_OPEN_MAX}

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

Value: 8

{_POSIX_MQ_PRIO_MAX}

The maximum number of message priorities supported by the implementation.

Value: 32

{_POSIX_NAME_MAX}

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

Value: 14

{_POSIX_NGROUPS_MAX}

Maximum number of simultaneous supplementary group IDs per process.

Value: 8

{_POSIX_OPEN_MAX}

A value one greater than the maximum value that the system may assign to a newly-created file descriptor.

Value: 20

{_POSIX_PATH_MAX}

Minimum number the implementation will accept as the maximum number of bytes in a pathname.

Value: 256

{_POSIX_PIPE_BUF}

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

Value: 512

{_POSIX_RE_DUP_MAX}

Maximum number of repeated occurrences of a BRE or ERE interval expression; see Section 9.3.6, BREs Matching Multiple Characters and Section 9.4.6, EREs Matching Multiple Characters.

Value: 255

{_POSIX_RTSIG_MAX}

The number of realtime signal numbers reserved for application use.

Value: 8

{_POSIX_SEM_NSEMS_MAX}

The number of semaphores that a process may have.

Value: 256

{_POSIX_SEM_VALUE_MAX}

The maximum value a semaphore may have.

Value: 32 767

{_POSIX_SIGQUEUE_MAX}

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

Value: 32

{_POSIX_SSIZE_MAX}

The value that can be stored in an object of type ssize_t.

Value: 32 767

{_POSIX_SS_REPL_MAX}

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

Value: 4

{_POSIX_STREAM_MAX}

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

Value: 8

{_POSIX_SYMLINK_MAX}

The number of bytes in a symbolic link.

Value: 255

{_POSIX_SYMLOOP_MAX}

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

Value: 8

{_POSIX_THREAD_DESTRUCTOR_ITERATIONS}

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

Value: 4

{_POSIX_THREAD_KEYS_MAX}

The number of data keys per process.

Value: 128

{_POSIX_THREAD_THREADS_MAX}

The number of threads per process.

Value: 64

{_POSIX_TIMER_MAX}

The per-process number of timers.

Value: 32

{_POSIX_TRACE_EVENT_NAME_MAX}

The length in bytes of a trace event name (not including the terminating null).

Value: 30

{_POSIX_TRACE_NAME_MAX}

The length in bytes of a trace generation version string or a trace stream name (not including the terminating null).

Value: 8

{_POSIX_TRACE_SYS_MAX}

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

Value: 8

{_POSIX_TRACE_USER_EVENT_MAX}

The number of user trace event type identifiers that may simultaneously exist in a traced process, including the predefined user trace event POSIX_TRACE_UNNAMED_USER_EVENT.

Value: 32

{_POSIX_TTY_NAME_MAX}

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

Value: 9

{_POSIX_TZNAME_MAX}

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

Value: 6

Note:

The length given by {_POSIX_TZNAME_MAX} does not include the quoting characters mentioned in Section 8.3, Other Environment Variables.

{_POSIX2_BC_BASE_MAX}

Maximum obase values allowed by the bc utility.

Value: 99

{_POSIX2_BC_DIM_MAX}

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

Value: 2 048

{_POSIX2_BC_SCALE_MAX}

Maximum scale value allowed by the bc utility.

Value: 99

{_POSIX2_BC_STRING_MAX}

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

Value: 1 000

{_POSIX2_CHARCLASS_NAME_MAX}

Maximum number of bytes in a character class name.

Value: 14

{_POSIX2_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; see Chapter 7, Locale.

Value: 2

{_POSIX2_EXPR_NEST_MAX}

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

Value: 32

{_POSIX2_LINE_MAX}

Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>.

Value: 2 048

{_POSIX2_RE_DUP_MAX}

Maximum number of repeated occurrences of a BRE or ERE interval expression; see Section 9.3.6, BREs Matching Multiple Characters and Section 9.4.6, EREs Matching Multiple Characters.

Value: 255

{_XOPEN_IOV_MAX}

Maximum number of iovec structures that one process has available for use with readv() or writev().

Value: 16

{_XOPEN_NAME_MAX}

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

Value: 255

{_XOPEN_PATH_MAX}

Minimum number the implementation will accept as the maximum number of bytes in a pathname.

Value: 1024

### Numerical Limits
The <limits.h> header shall define the following macros and, except for {CHAR_BIT}, {LONG_BIT}, {MB_LEN_MAX}, and {WORD_BIT}, they shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions.

If the value of an object of type char is treated as a signed integer when used in an expression, the value of {CHAR_MIN} is the same as that of {SCHAR_MIN} and the value of {CHAR_MAX} is the same as that of {SCHAR_MAX}. Otherwise, the value of {CHAR_MIN} is 0 and the value of {CHAR_MAX} is the same as that of {UCHAR_MAX}.

{CHAR_BIT}

Number of bits in a type char.

Value: 8

{CHAR_MAX}

Maximum value for an object of type char.

Value: {UCHAR_MAX} or {SCHAR_MAX}

{CHAR_MIN}

Minimum value for an object of type char.

Value: {SCHAR_MIN} or 0

{INT_MAX}

Maximum value for an object of type int.

Minimum Acceptable Value: 2 147 483 647

{INT_MIN}

Minimum value for an object of type int.

Maximum Acceptable Value: -2 147 483 647

{LLONG_MAX}

Maximum value for an object of type long long.

Minimum Acceptable Value: +9223372036854775807

{LLONG_MIN}

Minimum value for an object of type long long.

Maximum Acceptable Value: -9223372036854775807

{LONG_BIT}

Number of bits in an object of type long.

Minimum Acceptable Value: 32

{LONG_MAX}

Maximum value for an object of type long.

Minimum Acceptable Value: +2 147 483 647

{LONG_MIN}

Minimum value for an object of type long.

Maximum Acceptable Value: -2 147 483 647

{MB_LEN_MAX}

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

Minimum Acceptable Value: 1

{SCHAR_MAX}

Maximum value for an object of type signed char.

Value: +127

{SCHAR_MIN}

Minimum value for an object of type signed char.

Value: -128

{SHRT_MAX}

Maximum value for an object of type short.

Minimum Acceptable Value: +32 767

{SHRT_MIN}

Minimum value for an object of type short.

Maximum Acceptable Value: -32 767

{SSIZE_MAX}

Maximum value for an object of type ssize_t.

Minimum Acceptable Value: {_POSIX_SSIZE_MAX}

{UCHAR_MAX}

Maximum value for an object of type unsigned char.

Value: 255

{UINT_MAX}

Maximum value for an object of type unsigned.

Minimum Acceptable Value: 4 294 967 295

{ULLONG_MAX}

Maximum value for an object of type unsigned long long.

Minimum Acceptable Value: 18446744073709551615

{ULONG_MAX}

Maximum value for an object of type unsigned long.

Minimum Acceptable Value: 4 294 967 295

{USHRT_MAX}

Maximum value for an object of type unsigned short.

Minimum Acceptable Value: 65 535

{WORD_BIT}

Number of bits in an object of type int.

Minimum Acceptable Value: 32

### Other Invariant Values
The <limits.h> header shall define the following symbolic constants:

{NL_ARGMAX}

Maximum value of n in conversion specifications using the "%n$" sequence in calls to the printf() and scanf() families of functions.

Minimum Acceptable Value: 9

{NL_LANGMAX}

Maximum number of bytes in a LANG name.

Minimum Acceptable Value: 14

{NL_MSGMAX}

Maximum message number.

Minimum Acceptable Value: 32 767

{NL_SETMAX}

Maximum set number.

Minimum Acceptable Value: 255

{NL_TEXTMAX}

Maximum number of bytes in a message string.

Minimum Acceptable Value: {_POSIX2_LINE_MAX}

{NZERO}

Default process priority.

Minimum Acceptable Value: 20

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
A request was made to reduce the value of {_POSIX_LINK_MAX} from the value of 8 specified for it in the POSIX.1‐1990 standard to 2. The standard developers decided to deny this request for several reasons:

*

They wanted to avoid making any changes to the standard that could break conforming applications, and the requested change could have that effect.

*

The use of multiple hard links to a file cannot always be replaced with use of symbolic links. Symbolic links are semantically different from hard links in that they associate a pathname with another pathname rather than a pathname with a file. This has implications for access control, file permanence, and transparency.

*

The original standard developers had considered the issue of allowing for implementations that did not in general support hard links, and decided that this would reduce consensus on the standard.

Systems that support historical versions of the development option of the ISO POSIX‐2 standard retain the name {_POSIX2_RE_DUP_MAX} as an alias for {_POSIX_RE_DUP_MAX}.

{PATH_MAX}

IEEE PASC Interpretation 1003.1 #15 addressed the inconsistency in the standard with the definition of pathname and the description of {PATH_MAX}, allowing application developers to allocate either {PATH_MAX} or {PATH_MAX}+1 bytes. The inconsistency has been removed by correction to the {PATH_MAX} definition to include the null character. With this change, applications that previously allocated {PATH_MAX} bytes will continue to succeed.

{SYMLINK_MAX}

This symbol refers to space for data that is stored in the file system, as opposed to {PATH_MAX} which is the length of a name that can be passed to a function. In some existing implementations, the pathnames pointed to by symbolic links are stored in the inodes of the links, so it is important that {SYMLINK_MAX} not be constrained to be as large as {PATH_MAX}.

## FUTURE DIRECTIONS
None.

## SEE ALSO
Chapter 7, Locale, <stdio.h>, <unistd.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment, fpathconf(), sysconf()

## COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .