title: sys_shm.h(7p)

text:
# sys_shm.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
sys/shm.h — XSI shared memory facility

## SYNOPSIS

```
#include <sys/shm.h>
```

## DESCRIPTION
The <sys/shm.h> header shall define the following symbolic constants:

SHM_RDONLY

Attach read-only (else read-write).

SHM_RND

Round attach address to SHMLBA.

SHMLBA

Segment low boundary address multiple.

The <sys/shm.h> header shall define the following data types through typedef:

shmatt_t

Unsigned integer used for the number of current attaches that must be able to store values at least as large as a type unsigned short.

The <sys/shm.h> header shall define the shmid_ds structure, which shall include the following members:

```
struct ipc_perm shm_perm   Operation permission structure.
size_t          shm_segsz  Size of segment in bytes.
pid_t           shm_lpid   Process ID of last shared memory operation.
pid_t           shm_cpid   Process ID of creator.
shmatt_t        shm_nattch Number of current attaches.
time_t          shm_atime  Time of last shmat().
time_t          shm_dtime  Time of last shmdt().
time_t          shm_ctime  Time of last change by shmctl().
```

The <sys/shm.h> header shall define the pid_t, size_t, and time_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 *shmat(int, const void *, int);
int   shmctl(int, int, struct shmid_ds *);
int   shmdt(const void *);
int   shmget(key_t, size_t, int);
```

In addition, the <sys/shm.h> header shall include the <sys/ipc.h> header.

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_ipc.h>, <sys_types.h>

The System Interfaces volume of POSIX.1‐2017, shmat(), shmctl(), shmdt(), shmget()

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


package: man-pages-posix-devel

title: sys_socket.h(7p)

text:
# sys_socket.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
sys/socket.h — main sockets header

## SYNOPSIS

```
#include <sys/socket.h>
```

## DESCRIPTION
The <sys/socket.h> header shall define the socklen_t type, which is an integer type of width of at least 32 bits; see APPLICATION USAGE.

The <sys/socket.h> header shall define the sa_family_t unsigned integer type.

The <sys/socket.h> header shall define the sockaddr structure, which shall include at least the following members:

```
sa_family_t  sa_family  Address family.
char         sa_data[]  Socket address (variable-length data).
```

The sockaddr structure is used to define a socket address which is used in the bind(), connect(), getpeername(), getsockname(), recvfrom(), and sendto() functions.

The <sys/socket.h> header shall define the sockaddr_storage structure, which shall be:

*

Large enough to accommodate all supported protocol-specific address structures

*

Aligned at an appropriate boundary so that pointers to it can be cast as pointers to protocol-specific address structures and used to access the fields of those structures without alignment problems

The sockaddr_storage structure shall include at least the following members:

```
sa_family_t   ss_family
```

When a pointer to a sockaddr_storage structure is cast as a pointer to a sockaddr structure, the ss_family field of the sockaddr_storage structure shall map onto the sa_family field of the sockaddr structure. When a pointer to a sockaddr_storage structure is cast as a pointer to a protocol-specific address structure, the ss_family field shall map onto a field of that structure that is of type sa_family_t and that identifies the protocol's address family.

The <sys/socket.h> header shall define the msghdr structure, which shall include at least the following members:

```
void          *msg_name        Optional address.
socklen_t      msg_namelen     Size of address.
struct iovec  *msg_iov         Scatter/gather array.
int            msg_iovlen      Members in msg_iov.
void          *msg_control     Ancillary data; see below.
socklen_t      msg_controllen  Ancillary data buffer len.
int            msg_flags       Flags on received message.
```

The msghdr structure is used to minimize the number of directly supplied parameters to the recvmsg() and sendmsg() functions. This structure is used as a value‐result parameter in the recvmsg() function and value only for the sendmsg() function.

The <sys/socket.h> header shall define the iovec structure as described in <sys/uio.h>.

The <sys/socket.h> header shall define the cmsghdr structure, which shall include at least the following members:

```
socklen_t  cmsg_len    Data byte count, including the cmsghdr.
int        cmsg_level  Originating protocol.
int        cmsg_type   Protocol-specific type.
```

The cmsghdr structure is used for storage of ancillary data object information.

Ancillary data consists of a sequence of pairs, each consisting of a cmsghdr structure followed by a data array. The data array contains the ancillary data message, and the cmsghdr structure contains descriptive information that allows an application to correctly parse the data.

The values for cmsg_level shall be legal values for the level argument to the getsockopt() and setsockopt() functions. The system documentation shall specify the cmsg_type definitions for the supported protocols.

Ancillary data is also possible at the socket level. The <sys/socket.h> header shall define the following symbolic constant for use as the cmsg_type value when cmsg_level is SOL_SOCKET:

SCM_RIGHTS

Indicates that the data array contains the access rights to be sent or received.

The <sys/socket.h> header shall define the following macros to gain access to the data arrays in the ancillary data associated with a message header:

CMSG_DATA(cmsg)

If the argument is a pointer to a cmsghdr structure, this macro shall return an unsigned character pointer to the data array associated with the cmsghdr structure.

CMSG_NXTHDR(mhdr,cmsg)

If the first argument is a pointer to a msghdr structure and the second argument is a pointer to a cmsghdr structure in the ancillary data pointed to by the msg_control field of that msghdr structure, this macro shall return a pointer to the next cmsghdr structure, or a null pointer if this structure is the last cmsghdr in the ancillary data.

CMSG_FIRSTHDR(mhdr)

If the argument is a pointer to a msghdr structure, this macro shall return a pointer to the first cmsghdr structure in the ancillary data associated with this msghdr structure, or a null pointer if there is no ancillary data associated with the msghdr structure.

The <sys/socket.h> header shall define the linger structure, which shall include at least the following members:

```
int  l_onoff   Indicates whether linger option is enabled.
int  l_linger  Linger time, in seconds.
```

The <sys/socket.h> header shall define the following symbolic constants with distinct values:

SOCK_DGRAM

Datagram socket.

SOCK_RAW

Raw Protocol Interface.

SOCK_SEQPACKET

Sequenced-packet socket.

SOCK_STREAM

Byte-stream socket.

The <sys/socket.h> header shall define the following symbolic constant for use as the level argument of setsockopt() and getsockopt().

SOL_SOCKET

Options to be accessed at socket level, not protocol level.

The <sys/socket.h> header shall define the following symbolic constants with distinct values for use as the option_name argument in getsockopt() or setsockopt() calls (see the System Interfaces volume of POSIX.1‐2017, Section 2.10.16, Use of Options):

SO_ACCEPTCONN

Socket is accepting connections.

SO_BROADCAST

Transmission of broadcast messages is supported.

SO_DEBUG

Debugging information is being recorded.

SO_DONTROUTE

Bypass normal routing.

SO_ERROR

Socket error status.

SO_KEEPALIVE

Connections are kept alive with periodic messages.

SO_LINGER

Socket lingers on close.

SO_OOBINLINE

Out-of-band data is transmitted in line.

SO_RCVBUF

Receive buffer size.

SO_RCVLOWAT

Receive ``low water mark''.

SO_RCVTIMEO

Receive timeout.

SO_REUSEADDR

Reuse of local addresses is supported.

SO_SNDBUF

Send buffer size.

SO_SNDLOWAT

Send ``low water mark''.

SO_SNDTIMEO

Send timeout.

SO_TYPE

Socket type.

The <sys/socket.h> header shall define the following symbolic constant for use as the maximum backlog queue length which may be specified by the backlog field of the listen() function:

SOMAXCONN

The maximum backlog queue length.

The <sys/socket.h> header shall define the following symbolic constants with distinct values for use as the valid values for the msg_flags field in the msghdr structure, or the flags parameter in recv(), recvfrom(), recvmsg(), send(), sendmsg(), or sendto() calls:

MSG_CTRUNC

Control data truncated.

MSG_DONTROUTE

Send without using routing tables.

MSG_EOR

Terminates a record (if supported by the protocol).

MSG_OOB

Out-of-band data.

MSG_NOSIGNAL

No SIGPIPE generated when an attempt to send is made on a stream-oriented socket that is no longer connected.

MSG_PEEK

Leave received data in queue.

MSG_TRUNC

Normal data truncated.

MSG_WAITALL

Attempt to fill the read buffer.

The <sys/socket.h> header shall define the following symbolic constants with distinct values:

AF_INET

Internet domain sockets for use with IPv4 addresses.

AF_INET6

Internet domain sockets for use with IPv6 addresses.

AF_UNIX

UNIX domain sockets.

AF_UNSPEC

Unspecified.

The value of AF_UNSPEC shall be 0.

The <sys/socket.h> header shall define the following symbolic constants with distinct values:

SHUT_RD

Disables further receive operations.

SHUT_RDWR

Disables further send and receive operations.

SHUT_WR

Disables further send operations.

The <sys/socket.h> header shall define the size_t and ssize_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     accept(int, struct sockaddr *restrict, socklen_t *restrict);
int     bind(int, const struct sockaddr *, socklen_t);
int     connect(int, const struct sockaddr *, socklen_t);
int     getpeername(int, struct sockaddr *restrict, socklen_t *restrict);
int     getsockname(int, struct sockaddr *restrict, socklen_t *restrict);
int     getsockopt(int, int, int, void *restrict, socklen_t *restrict);
int     listen(int, int);
ssize_t recv(int, void *, size_t, int);
ssize_t recvfrom(int, void *restrict, size_t, int,

        struct sockaddr *restrict, socklen_t *restrict);
ssize_t recvmsg(int, struct msghdr *, int);
ssize_t send(int, const void *, size_t, int);
ssize_t sendmsg(int, const struct msghdr *, int);
ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *,

        socklen_t);
int     setsockopt(int, int, int, const void *, socklen_t);
int     shutdown(int, int);
int     sockatmark(int);
int     socket(int, int, int);
int     socketpair(int, int, int, int [2]);
```

Inclusion of <sys/socket.h> may also make visible all symbols from <sys/uio.h>.

The following sections are informative.

## APPLICATION USAGE
To forestall portability problems, it is recommended that applications not use values larger than 231 -1 for the socklen_t type.

The sockaddr_storage structure solves the problem of declaring storage for automatic variables which is both large enough and aligned enough for storing the socket address data structure of any family. For example, code with a file descriptor and without the context of the address family can pass a pointer to a variable of this type, where a pointer to a socket address structure is expected in calls such as getpeername(), and determine the address family by accessing the received content after the call.

The example below illustrates a data structure which aligns on a 64-bit boundary. An implementation-defined field _ss_align following _ss_pad1 is used to force a 64-bit alignment which covers proper alignment good enough for needs of at least sockaddr_in6 (IPv6) and sockaddr_in (IPv4) address data structures. The size of padding field _ss_pad1 depends on the chosen alignment boundary. The size of padding field _ss_pad2 depends on the value of overall size chosen for the total size of the structure. This size and alignment are represented in the above example by implementation-defined (not required) constants _SS_MAXSIZE (chosen value 128) and _SS_ALIGNMENT (with chosen value 8). Constants _SS_PAD1SIZE (derived value 6) and _SS_PAD2SIZE (derived value 112) are also for illustration and not required. The implementation-defined definitions and structure field names above start with an <underscore> to denote implementation private name space. Portable code is not expected to access or reference those fields or constants.

```
/*

 *  Desired design of maximum size and alignment.

 */
#define _SS_MAXSIZE 128

    /* Implementation-defined maximum size. */
#define _SS_ALIGNSIZE (sizeof(int64_t))

    /* Implementation-defined desired alignment. */
```

```
/*

 *  Definitions used for sockaddr_storage structure paddings design.

 */
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(sa_family_t))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof(sa_family_t)+ \

                      _SS_PAD1SIZE + _SS_ALIGNSIZE))
struct sockaddr_storage {

    sa_family_t  ss_family;  /* Address family. */
/*

 *  Following fields are implementation-defined.

 */

    char _ss_pad1[_SS_PAD1SIZE];

        /* 6-byte pad; this is to make implementation-defined

           pad up to alignment field that follows explicit in

           the data structure. */

    int64_t _ss_align;  /* Field to force desired structure

                           storage alignment. */

    char _ss_pad2[_SS_PAD2SIZE];

        /* 112-byte pad to achieve desired size,

           _SS_MAXSIZE value minus size of ss_family

           __ss_pad1, __ss_align fields is 112. */
};
```

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>, <sys_uio.h>

The System Interfaces volume of POSIX.1‐2017, accept(), bind(), connect(), getpeername(), getsockname(), getsockopt(), listen(), recv(), recvfrom(), recvmsg(), send(), sendmsg(), sendto(), setsockopt(), shutdown(), sockatmark(), socket(), socketpair()

## 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


title: sys_stat.h(7p)

text:
# sys_stat.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
sys/stat.h — data returned by the stat() function

## SYNOPSIS

```
#include <sys/stat.h>
```

## DESCRIPTION
The <sys/stat.h> header shall define the structure of the data returned by the fstat(), lstat(), and stat() functions.

The <sys/stat.h> header shall define the stat structure, which shall include at least the following members:

```
dev_t st_dev            Device ID of device containing file.
ino_t st_ino            File serial number.
mode_t st_mode          Mode of file (see below).
nlink_t st_nlink        Number of hard links to the file.
uid_t st_uid            User ID of file.
gid_t st_gid            Group ID of file.
dev_t st_rdev           Device ID (if file is character or block special).
off_t st_size           For regular files, the file size in bytes.

                        For symbolic links, the length in bytes of the

                        pathname contained in the symbolic link.

                        For a shared memory object, the length in bytes.

                        For a typed memory object, the length in bytes.

                        For other file types, the use of this field is

                        unspecified.
struct timespec st_atim Last data access timestamp.
struct timespec st_mtim Last data modification timestamp.
struct timespec st_ctim Last file status change timestamp.
blksize_t st_blksize    A file system-specific preferred I/O block size

                        for this object. In some file system types, this

                        may vary from file to file.
blkcnt_t st_blocks      Number of blocks allocated for this object.
```

The st_ino and st_dev fields taken together uniquely identify the file within the system.

The <sys/stat.h> header shall define the blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, uid_t, gid_t, off_t, and time_t types as described in <sys/types.h>.

The <sys/stat.h> header shall define the timespec structure as described in <time.h>. Times shall be given in seconds since the Epoch.

Which structure members have meaningful values depends on the type of file. For further information, see the descriptions of fstat(), lstat(), and stat() in the System Interfaces volume of POSIX.1‐2017.

For compatibility with earlier versions of this standard, the st_atime macro shall be defined with the value st_atim.tv_sec. Similarly, st_ctime and st_mtime shall be defined as macros with the values st_ctim.tv_sec and st_mtim.tv_sec, respectively.

The <sys/stat.h> header shall define the following symbolic constants for the file types encoded in type mode_t. The values shall be suitable for use in #if preprocessing directives:

S_IFMT

Type of file.

S_IFBLK

Block special.

S_IFCHR

Character special.

S_IFIFO

FIFO special.

S_IFREG

Regular.

S_IFDIR

Directory.

S_IFLNK

Symbolic link.

S_IFSOCK

Socket.

The <sys/stat.h> header shall define the following symbolic constants for the file mode bits encoded in type mode_t, with the indicated numeric values. These macros shall expand to an expression which has a type that allows them to be used, either singly or OR'ed together, as the third argument to open() without the need for a mode_t cast. The values shall be suitable for use in #if preprocessing directives.

Name

Numeric Value

Description

S_IRWXU

0700

Read, write, execute/search by owner.

S_IRUSR

0400

Read permission, owner.

S_IWUSR

0200

Write permission, owner.

S_IXUSR

0100

Execute/search permission, owner.

S_IRWXG

070

Read, write, execute/search by group.

S_IRGRP

040

Read permission, group.

S_IWGRP

020

Write permission, group.

S_IXGRP

010

Execute/search permission, group.

S_IRWXO

07

Read, write, execute/search by others.

S_IROTH

04

Read permission, others.

S_IWOTH

02

Write permission, others.

S_IXOTH

01

Execute/search permission, others.

S_ISUID

04000

Set-user-ID on execution.

S_ISGID

02000

Set-group-ID on execution.

S_ISVTX

01000

On directories, restricted deletion flag.

The following macros shall be provided to test whether a file is of the specified type. The value m supplied to the macros is the value of st_mode from a stat structure. The macro shall evaluate to a non-zero value if the test is true; 0 if the test is false.

S_ISBLK(m)

Test for a block special file.

S_ISCHR(m)

Test for a character special file.

S_ISDIR(m)

Test for a directory.

S_ISFIFO(m)

Test for a pipe or FIFO special file.

S_ISREG(m)

Test for a regular file.

S_ISLNK(m)

Test for a symbolic link.

S_ISSOCK(m)

Test for a socket.

The implementation may implement message queues, semaphores, or shared memory objects as distinct file types. The following macros shall be provided to test whether a file is of the specified type. The value of the buf argument supplied to the macros is a pointer to a stat structure. The macro shall evaluate to a non-zero value if the specified object is implemented as a distinct file type and the specified file type is contained in the stat structure referenced by buf. Otherwise, the macro shall evaluate to zero.

S_TYPEISMQ(buf)

Test for a message queue.

S_TYPEISSEM(buf)

Test for a semaphore.

S_TYPEISSHM(buf)

Test for a shared memory object.

The implementation may implement typed memory objects as distinct file types, and the following macro shall test whether a file is of the specified type. The value of the buf argument supplied to the macros is a pointer to a stat structure. The macro shall evaluate to a non-zero value if the specified object is implemented as a distinct file type and the specified file type is contained in the stat structure referenced by buf. Otherwise, the macro shall evaluate to zero.

S_TYPEISTMO(buf)

Test macro for a typed memory object.

The <sys/stat.h> header shall define the following symbolic constants as distinct integer values outside of the range [0,999999999], for use with the futimens() and utimensat() functions: UTIME_NOW UTIME_OMIT

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

```
int    chmod(const char *, mode_t);
int    fchmod(int, mode_t);
int    fchmodat(int, const char *, mode_t, int);
int    fstat(int, struct stat *);
int    fstatat(int, const char *restrict, struct stat *restrict, int);
int    futimens(int, const struct timespec [2]);
int    lstat(const char *restrict, struct stat *restrict);
int    mkdir(const char *, mode_t);
int    mkdirat(int, const char *, mode_t);
int    mkfifo(const char *, mode_t);
int    mkfifoat(int, const char *, mode_t);
int    mknod(const char *, mode_t, dev_t);
int    mknodat(int, const char *, mode_t, dev_t);
int    stat(const char *restrict, struct stat *restrict);
mode_t umask(mode_t);
int    utimensat(int, const char *, const struct timespec [2], int);
```

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

The following sections are informative.

## APPLICATION USAGE
Use of the macros is recommended for determining the type of a file.

## RATIONALE
A conforming C-language application must include <sys/stat.h> for functions that have arguments or return values of type mode_t, so that symbolic values for that type can be used. An alternative would be to require that these constants are also defined by including <sys/types.h>.

The S_ISUID and S_ISGID bits may be cleared on any write, not just on open(), as some historical implementations do.

System calls that update the time entry fields in the stat structure must be documented by the implementors. POSIX-conforming systems should not update the time entry fields for functions listed in the System Interfaces volume of POSIX.1‐2017 unless the standard requires that they do, except in the case of documented extensions to the standard.

Upon assignment, file timestamps are immediately converted to the resolution of the file system by truncation (i.e., the recorded time can be older than the actual time). For example, if the file system resolution is 1 microsecond, then a conforming stat() must always return an st_mtim.tv_nsec that is a multiple of 1000. Some older implementations returned higher-resolution timestamps while the inode information was cached, and then spontaneously truncated the tv_nsec fields when they were stored to and retrieved from disk, but this behavior does not conform.

Note that st_dev must be unique within a Local Area Network (LAN) in a ``system'' made up of multiple computers' file systems connected by a LAN.

Networked implementations of a POSIX-conforming system must guarantee that all files visible within the file tree (including parts of the tree that may be remotely mounted from other machines on the network) on each individual processor are uniquely identified by the combination of the st_ino and st_dev fields.

The unit for the st_blocks member of the stat structure is not defined within POSIX.1‐2008. In some implementations it is 512 bytes. It may differ on a file system basis. There is no correlation between values of the st_blocks and st_blksize, and the f_bsize (from <sys/statvfs.h>) structure members.

Traditionally, some implementations defined the multiplier for st_blocks in <sys/param.h> as the symbol DEV_BSIZE.

Some earlier versions of this standard did not specify values for the file mode bit macros. The expectation was that some implementors might choose to use a different encoding for these bits than the traditional one, and that new applications would use symbolic file modes instead of numeric. This version of the standard specifies the traditional encoding, in recognition that nearly 20 years after the first publication of this standard numeric file modes are still in widespread use by application developers, and that all conforming implementations still use the traditional encoding.

## FUTURE DIRECTIONS
No new S_IFMT symbolic names for the file type values of mode_t will be defined by POSIX.1‐2008; if new file types are required, they will only be testable through S_ISxx() or S_TYPEISxxx() macros instead.

## SEE ALSO
<sys_statvfs.h>, <sys_types.h>, <time.h>

The System Interfaces volume of POSIX.1‐2017, chmod(), fchmod(), fstat(), fstatat(), futimens(), mkdir(), mkfifo(), mknod(), umask()

## 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: sys_statvfs.h(7p)

text:
# sys_statvfs.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
sys/statvfs.h — VFS File System information structure

## SYNOPSIS

```
#include <sys/statvfs.h>
```

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

```
unsigned long f_bsize    File system block size.
unsigned long f_frsize   Fundamental file system block size.
fsblkcnt_t    f_blocks   Total number of blocks on file system in units of f_frsize.
fsblkcnt_t    f_bfree    Total number of free blocks.
fsblkcnt_t    f_bavail   Number of free blocks available to

                         non-privileged process.
fsfilcnt_t    f_files    Total number of file serial numbers.
fsfilcnt_t    f_ffree    Total number of free file serial numbers.
fsfilcnt_t    f_favail   Number of file serial numbers available to

                         non-privileged process.
unsigned long f_fsid     File system ID.
unsigned long f_flag     Bit mask of f_flag values.
unsigned long f_namemax  Maximum filename length.
```

The <sys/statvfs.h> header shall define the fsblkcnt_t and fsfilcnt_t types as described in <sys/types.h>.

The <sys/statvfs.h> header shall define the following symbolic constants for the f_flag member:

ST_RDONLY

Read-only file system.

ST_NOSUID

Does not support the semantics of the ST_ISUID and ST_ISGID file mode bits.

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

```
int fstatvfs(int, struct statvfs *);
int statvfs(const char *restrict, struct statvfs *restrict);
```

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, fstatvfs()

## 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: sys_time.h(7p)

text:
# sys_time.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
sys/time.h — time types

## SYNOPSIS

```
#include <sys/time.h>
```

## DESCRIPTION
The <sys/time.h> header shall define the timeval structure, which shall include at least the following members:

```
time_t         tv_sec      Seconds.
suseconds_t    tv_usec     Microseconds.
```

The <sys/time.h> header shall define the itimerval structure, which shall include at least the following members:

```
struct timeval it_interval Timer interval.
struct timeval it_value    Current value.
```

The <sys/time.h> header shall define the time_t and suseconds_t types as described in <sys/types.h>.

The <sys/time.h> header shall define the fd_set type as described in <sys/select.h>.

The <sys/time.h> header shall define the following symbolic constants for the which argument of getitimer() and setitimer():

ITIMER_REAL

Decrements in real time.

ITIMER_VIRTUAL

Decrements in process virtual time.

ITIMER_PROF

Decrements both in process virtual time and when the system is running on behalf of the process.

The <sys/time.h> header shall define the following as described in <sys/select.h>: FD_CLR() FD_ISSET() FD_SET() FD_ZERO() FD_SETSIZE

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

```
int   getitimer(int, struct itimerval *);
int   gettimeofday(struct timeval *restrict, void *restrict);
int   setitimer(int, const struct itimerval *restrict,

          struct itimerval *restrict);
int   select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,

          struct timeval *restrict);
int   utimes(const char *, const struct timeval [2]);
```

Inclusion of the <sys/time.h> header may make visible all symbols from the <sys/select.h> header.

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_select.h>, <sys_types.h>

The System Interfaces volume of POSIX.1‐2017, futimens(), getitimer(), gettimeofday(), pselect()

## 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: sys_times.h(7p)

text:
# sys_times.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
sys/times.h — file access and modification times structure

## SYNOPSIS

```
#include <sys/times.h>
```

## DESCRIPTION
The <sys/times.h> header shall define the tms structure, which is returned by times() and shall include at least the following members:

```
clock_t  tms_utime  User CPU time.
clock_t  tms_stime  System CPU time.
clock_t  tms_cutime User CPU time of terminated child processes.
clock_t  tms_cstime System CPU time of terminated child processes.
```

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

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

```
clock_t times(struct tms *);
```

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, times()

## 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: sys_types.h(7p)

text:
# sys_types.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
sys/types.h — data types

## SYNOPSIS

```
#include <sys/types.h>
```

## DESCRIPTION
The <sys/types.h> header shall define at least the following types:

blkcnt_t

Used for file block counts.

blksize_t

Used for block sizes.

clock_t

Used for system times in clock ticks or CLOCKS_PER_SEC; see <time.h>.

clockid_t

Used for clock ID type in the clock and timer functions.

dev_t

Used for device IDs.

fsblkcnt_t

Used for file system block counts.

fsfilcnt_t

Used for file system file counts.

gid_t

Used for group IDs.

id_t

Used as a general identifier; can be used to contain at least a pid_t, uid_t, or gid_t.

ino_t

Used for file serial numbers.

key_t

Used for XSI interprocess communication.

mode_t

Used for some file attributes.

nlink_t

Used for link counts.

off_t

Used for file sizes.

pid_t

Used for process IDs and process group IDs.

pthread_attr_t

Used to identify a thread attribute object.

pthread_barrier_t

Used to identify a barrier.

pthread_barrierattr_t

Used to define a barrier attributes object.

pthread_cond_t

Used for condition variables.

pthread_condattr_t

Used to identify a condition attribute object.

pthread_key_t

Used for thread-specific data keys.

pthread_mutex_t

Used for mutexes.

pthread_mutexattr_t

Used to identify a mutex attribute object.

pthread_once_t

Used for dynamic package initialization.

pthread_rwlock_t

Used for read-write locks.

pthread_rwlockattr_t

Used for read-write lock attributes.

pthread_spinlock_t

Used to identify a spin lock.

pthread_t

Used to identify a thread.

size_t

Used for sizes of objects.

ssize_t

Used for a count of bytes or an error indication.

suseconds_t

Used for time in microseconds.

time_t

Used for time in seconds.

timer_t

Used for timer ID returned by timer_create().

trace_attr_t

Used to identify a trace stream attributes object

trace_event_id_t

Used to identify a trace event type.

trace_event_set_t

Used to identify a trace event type set.

trace_id_t

Used to identify a trace stream.

uid_t

Used for user IDs.

All of the types shall be defined as arithmetic types of an appropriate length, with the following exceptions:

```
pthread_attr_t
pthread_barrier_t
pthread_barrierattr_t
pthread_cond_t
pthread_condattr_t
pthread_key_t
pthread_mutex_t
pthread_mutexattr_t
pthread_once_t
pthread_rwlock_t
pthread_rwlockattr_t
pthread_spinlock_t
pthread_t
timer_t
trace_attr_t
trace_event_id_t
trace_event_set_t
trace_id_t
```

Additionally:

*

mode_t shall be an integer type.

*

dev_t shall be an integer type.

*

nlink_t, uid_t, gid_t, and id_t shall be integer types.

*

blkcnt_t and off_t shall be signed integer types.

*

fsblkcnt_t, fsfilcnt_t, and ino_t shall be defined as unsigned integer types.

*

size_t shall be an unsigned integer type.

*

blksize_t, pid_t, and ssize_t shall be signed integer types.

*

clock_t shall be an integer or real-floating type. time_t shall be an integer type.

The type ssize_t shall be capable of storing values at least in the range [-1, {SSIZE_MAX}].

The type suseconds_t shall be a signed integer type capable of storing values at least in the range [-1, 1000000].

The implementation shall support one or more programming environments in which the widths of blksize_t, pid_t, size_t, ssize_t, and suseconds_t are no greater than the width of type long. The names of these programming environments can be obtained using the confstr() function or the getconf utility.

There are no defined comparison or assignment operators for the following types:

```
pthread_attr_t
pthread_barrier_t
pthread_barrierattr_t
pthread_cond_t
pthread_condattr_t
pthread_mutex_t
pthread_mutexattr_t
pthread_rwlock_t
pthread_rwlockattr_t
pthread_spinlock_t
timer_t
trace_attr_t
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<time.h>

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

The Shell and Utilities volume of POSIX.1‐2017, getconf

## 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: sys_uio.h(7p)

text:
# sys_uio.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
sys/uio.h — definitions for vector I/O operations

## SYNOPSIS

```
#include <sys/uio.h>
```

## DESCRIPTION
The <sys/uio.h> header shall define the iovec structure, which shall include at least the following members:

```
void   *iov_base  Base address of a memory region for input or output.
size_t  iov_len   The size of the memory pointed to by iov_base.
```

The <sys/uio.h> header uses the iovec structure for scatter/gather I/O.

The <sys/uio.h> header shall define the ssize_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.

```
ssize_t readv(int, const struct iovec *, int);
ssize_t writev(int, const struct iovec *, int);
```

The following sections are informative.

## APPLICATION USAGE
The implementation can put a limit on the number of scatter/gather elements which can be processed in one call. The symbol {IOV_MAX} defined in <limits.h> should always be used to learn about the limits instead of assuming a fixed value.

## RATIONALE
Traditionally, the maximum number of scatter/gather elements the system can process in one call were described by the symbolic value {UIO_MAXIOV}. In IEEE Std 1003.1‐2001 this value is replaced by the constant {IOV_MAX} which can be found in <limits.h>.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<limits.h>, <sys_types.h>

The System Interfaces volume of POSIX.1‐2017, read(), readv(), write(), writev()

## 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: sys_un.h(7p)

text:
# sys_un.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
sys/un.h — definitions for UNIX domain sockets

## SYNOPSIS

```
#include <sys/un.h>
```

## DESCRIPTION
The <sys/un.h> header shall define the sockaddr_un structure, which shall include at least the following members:

```
sa_family_t  sun_family  Address family.
char         sun_path[]  Socket pathname.
```

The sockaddr_un structure is used to store addresses for UNIX domain sockets. Pointers to this type shall be cast by applications to struct sockaddr * for use with socket functions.

The <sys/un.h> header shall define the sa_family_t type as described in <sys/socket.h>.

The following sections are informative.

## APPLICATION USAGE
The size of sun_path has intentionally been left undefined. This is because different implementations use different sizes. For example, 4.3 BSD uses a size of 108, and 4.4 BSD uses a size of 104. Since most implementations originate from BSD versions, the size is typically in the range 92 to 108.

Applications should not assume a particular length for sun_path or assume that it can hold {_POSIX_PATH_MAX} bytes (256).

Although applications are required to initialize all members (including any non-standard ones) of a sockaddr_in6 structure (see <netinet_in.h>), the same is not required for the sockaddr_un structure, since historically many applications only initialized the standard members. Despite this, applications are encouraged to initialize sockaddr_un structures in a manner similar to the required initialization of sockaddr_in6 structures.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<netinet_in.h>, <sys_socket.h>

The System Interfaces volume of POSIX.1‐2017, bind(), socket(), socketpair()

## 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: sys_utsname.h(7p)

text:
# sys_utsname.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
sys/utsname.h — system name structure

## SYNOPSIS

```
#include <sys/utsname.h>
```

## DESCRIPTION
The <sys/utsname.h> header shall define the structure utsname which shall include at least the following members:

```
char  sysname[]  Name of this implementation of the operating system.
char  nodename[] Name of this node within the communications

                 network to which this node is attached, if any.
char  release[]  Current release level of this implementation.
char  version[]  Current version level of this release.
char  machine[]  Name of the hardware type on which the system is running.
```

The character arrays are of unspecified size, but the data stored in them shall be terminated by a null byte.

The following shall be declared as a function and may also be defined as a macro:

```
int uname(struct utsname *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

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

## 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: sys_wait.h(7p)

text:
# sys_wait.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
sys/wait.h — declarations for waiting

## SYNOPSIS

```
#include <sys/wait.h>
```

## DESCRIPTION
The <sys/wait.h> header shall define the following symbolic constants for use with waitpid():

WCONTINUED

Report status of continued child process.

WNOHANG

Do not hang if no status is available; return immediately.

WUNTRACED

Report status of stopped child process.

The <sys/wait.h> header shall define the following macros for analysis of process status values:

WEXITSTATUS

Return exit status.

WIFCONTINUED

True if child has been continued.

WIFEXITED

True if child exited normally.

WIFSIGNALED

True if child exited due to uncaught signal.

WIFSTOPPED

True if child is currently stopped.

WSTOPSIG

Return signal number that caused process to stop.

WTERMSIG

Return signal number that caused process to terminate.

The <sys/wait.h> header shall define the following symbolic constants as possible values for the options argument to waitid():

WEXITED

Wait for processes that have exited.

WNOWAIT

Keep the process whose status is returned in infop in a waitable state.

WSTOPPED

Status is returned for any child that has stopped upon receipt of a signal.

The WCONTINUED and WNOHANG constants, described above for waitpid(), can also be used with waitid().

The type idtype_t shall be defined as an enumeration type whose possible values shall include at least the following: P_ALL P_PGID P_PID

The <sys/wait.h> header shall define the id_t and pid_t types as described in <sys/types.h>.

The <sys/wait.h> header shall define the siginfo_t type and the sigval union as described in <signal.h>.

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

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

```
pid_t  wait(int *);
int    waitid(idtype_t, id_t, siginfo_t *, int);
pid_t  waitpid(pid_t, int *, int);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<signal.h>, <sys_resource.h>, <sys_types.h>

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

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


syslog.h

title: syslog.h(7p)

text:
# syslog.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
syslog.h — definitions for system error logging

## SYNOPSIS

```
#include <syslog.h>
```

## DESCRIPTION
The <syslog.h> header shall define the following symbolic constants, zero or more of which may be OR'ed together to form the logopt option of openlog():

LOG_PID

Log the process ID with each message.

LOG_CONS

Log to the system console on error.

LOG_NDELAY

Connect to syslog daemon immediately.

LOG_ODELAY

Delay open until syslog() is called.

LOG_NOWAIT

Do not wait for child processes.

The <syslog.h> header shall define the following symbolic constants for use as the facility argument to openlog():

LOG_KERN

Reserved for message generated by the system.

LOG_USER

Message generated by a process.

LOG_MAIL

Reserved for message generated by mail system.

LOG_NEWS

Reserved for message generated by news system.

LOG_UUCP

Reserved for message generated by UUCP system.

LOG_DAEMON

Reserved for message generated by system daemon.

LOG_AUTH

Reserved for message generated by authorization daemon.

LOG_CRON

Reserved for message generated by clock daemon.

LOG_LPR

Reserved for message generated by printer system.

LOG_LOCAL0

Reserved for local use.

LOG_LOCAL1

Reserved for local use.

LOG_LOCAL2

Reserved for local use.

LOG_LOCAL3

Reserved for local use.

LOG_LOCAL4

Reserved for local use.

LOG_LOCAL5

Reserved for local use.

LOG_LOCAL6

Reserved for local use.

LOG_LOCAL7

Reserved for local use.

The <syslog.h> header shall define the following macros for constructing the maskpri argument to setlogmask(). The following macros expand to an expression of type int when the argument pri is an expression of type int:

LOG_MASK(pri)

A mask for priority pri.

The <syslog.h> header shall define the following symbolic constants for use as the priority argument of syslog():

LOG_EMERG

A panic condition was reported to all processes.

LOG_ALERT

A condition that should be corrected immediately.

LOG_CRIT

A critical condition.

LOG_ERR

An error message.

LOG_WARNING

A warning message.

LOG_NOTICE

A condition requiring special handling.

LOG_INFO

A general information message.

LOG_DEBUG

A message useful for debugging programs.

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

```
void  closelog(void);
void  openlog(const char *, int, int);
int   setlogmask(int);
void  syslog(int, 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, closelog()

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


tar.h

title: tar.h(7p)

text:
# tar.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
tar.h — extended tar definitions

## SYNOPSIS

```
#include <tar.h>
```

## DESCRIPTION
The <tar.h> header shall define the following symbolic constants with the indicated values.

General definitions:

Name

Value

Description

TMAGIC

"ustar"

Used in the magic field in the ustar header block, including the trailing null byte.

TMAGLEN

6

Length in octets of the magic field.

TVERSION

"00"

Used in the version field in the ustar header block, excluding the trailing null byte.

TVERSLEN

2

Length in octets of the version field.

Typeflag field definitions:

Name

Value

Description

REGTYPE

'0'

Regular file.

AREGTYPE

'\0'

Regular file.

LNKTYPE

'1'

Link.

SYMTYPE

'2'

Symbolic link.

CHRTYPE

'3'

Character special.

BLKTYPE

'4'

Block special.

DIRTYPE

'5'

Directory.

FIFOTYPE

'6'

FIFO special.

CONTTYPE

'7'

Reserved.

Mode field bit definitions (octal):

Name

Value

Description

TSUID

04000

Set UID on execution.

TSGID

02000

Set GID on execution.

TSVTX

01000

On directories, restricted deletion flag.

TUREAD

00400

Read by owner.

TUWRITE

00200

Write by owner special.

TUEXEC

00100

Execute/search by owner.

TGREAD

00040

Read by group.

TGWRITE

00020

Write by group.

TGEXEC

00010

Execute/search by group.

TOREAD

00004

Read by other.

TOWRITE

00002

Write by other.

TOEXEC

00001

Execute/search by other.

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
The Shell and Utilities volume of POSIX.1‐2017, pax

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


termios.h

title: termios.h(7p)

text:
# termios.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
termios.h — define values for termios

## SYNOPSIS

```
#include <termios.h>
```

## DESCRIPTION
The <termios.h> header shall contain the definitions used by the terminal I/O interfaces (see Chapter 11, General Terminal Interface for the structures and names defined).

### The termios Structure
The <termios.h> header shall define the following data types through typedef:

cc_t

Used for terminal special characters.

speed_t

Used for terminal baud rates.

tcflag_t

Used for terminal modes.

The above types shall be all unsigned integer types.

The implementation shall support one or more programming environments in which the widths of cc_t, speed_t, and tcflag_t are no greater than the width of type long. The names of these programming environments can be obtained using the confstr() function or the getconf utility.

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

```
tcflag_t  c_iflag     Input modes.
tcflag_t  c_oflag     Output modes.
tcflag_t  c_cflag     Control modes.
tcflag_t  c_lflag     Local modes.
cc_t      c_cc[NCCS]  Control characters.
```

The <termios.h> header shall define the following symbolic constant:

NCCS

Size of the array c_cc for control characters.

The <termios.h> header shall define the following symbolic constants for use as subscripts for the array c_cc:

Subscript Usage

Canonical Mode

Non-Canonical Mode

Description

VEOF

EOF character.

VEOL

EOL character.

VERASE

ERASE character.

VINTR

VINTR

INTR character.

VKILL

KILL character.

VMIN

MIN value.

VQUIT

VQUIT

QUIT character.

VSTART

VSTART

START character.

VSTOP

VSTOP

STOP character.

VSUSP

VSUSP

SUSP character.

VTIME

TIME value.

The subscript values shall be suitable for use in #if preprocessing directives and shall be distinct, except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOL subscripts, respectively.

### Input Modes
The <termios.h> header shall define the following symbolic constants for use as flags in the c_iflag field. The c_iflag field describes the basic terminal input control.

BRKINT

Signal interrupt on break.

ICRNL

Map CR to NL on input.

IGNBRK

Ignore break condition.

IGNCR

Ignore CR.

IGNPAR

Ignore characters with parity errors.

INLCR

Map NL to CR on input.

INPCK

Enable input parity check.

ISTRIP

Strip character.

IXANY

Enable any character to restart output.

IXOFF

Enable start/stop input control.

IXON

Enable start/stop output control.

PARMRK

Mark parity errors.

### Output Modes
The <termios.h> header shall define the following symbolic constants for use as flags in the c_oflag field. The c_oflag field specifies the system treatment of output.

OPOST

Post-process output.

ONLCR

Map NL to CR-NL on output.

OCRNL

Map CR to NL on output.

ONOCR

No CR output at column 0.

ONLRET

NL performs CR function.

OFDEL

Fill is DEL.

OFILL

Use fill characters for delay.

NLDLY

Select newline delays:

NL0

Newline type 0.

NL1

Newline type 1.

CRDLY

Select carriage-return delays:

CR0

Carriage-return delay type 0.

CR1

Carriage-return delay type 1.

CR2

Carriage-return delay type 2.

CR3

Carriage-return delay type 3.

TABDLY

Select horizontal-tab delays:

TAB0

Horizontal-tab delay type 0.

TAB1

Horizontal-tab delay type 1.

TAB2

Horizontal-tab delay type 2.

TAB3

Expand tabs to spaces.

BSDLY

Select backspace delays:

BS0

Backspace-delay type 0.

BS1

Backspace-delay type 1.

VTDLY

Select vertical-tab delays:

VT0

Vertical-tab delay type 0.

VT1

Vertical-tab delay type 1.

FFDLY

Select form-feed delays:

FF0

Form-feed delay type 0.

FF1

Form-feed delay type 1.

### Baud Rate Selection
The <termios.h> header shall define the following symbolic constants for use as values of objects of type speed_t.

The input and output baud rates are stored in the termios structure. These are the valid values for objects of type speed_t. Not all baud rates need be supported by the underlying hardware.

B0

Hang up

B50

50 baud

B75

75 baud

B110

110 baud

B134

134.5 baud

B150

150 baud

B200

200 baud

B300

300 baud

B600

600 baud

B1200

1200 baud

B1800

1800 baud

B2400

2400 baud

B4800

4800 baud

B9600

9600 baud

B19200

19200 baud

B38400

38400 baud

### Control Modes
The <termios.h> header shall define the following symbolic constants for use as flags in the c_cflag field. The c_cflag field describes the hardware control of the terminal; not all values specified are required to be supported by the underlying hardware.

CSIZE

Character size:

CS5

5 bits

CS6

6 bits

CS7

7 bits

CS8

8 bits

CSTOPB

Send two stop bits, else one.

CREAD

Enable receiver.

PARENB

Parity enable.

PARODD

Odd parity, else even.

HUPCL

Hang up on last close.

CLOCAL

Ignore modem status lines.

The implementation shall support the functionality associated with the symbols CS7, CS8, CSTOPB, PARODD, and PARENB.

### Local Modes
The <termios.h> header shall define the following symbolic constants for use as flags in the c_lflag field. The c_lflag field of the argument structure is used to control various terminal functions.

ECHO

Enable echo.

ECHOE

Echo erase character as error-correcting backspace.

ECHOK

Echo KILL.

ECHONL

Echo NL.

ICANON

Canonical input (erase and kill processing).

IEXTEN

Enable extended input character processing.

ISIG

Enable signals.

NOFLSH

Disable flush after interrupt or quit.

TOSTOP

Send SIGTTOU for background output.

### Attribute Selection
The <termios.h> header shall define the following symbolic constants for use with tcsetattr():

TCSANOW

Change attributes immediately.

TCSADRAIN

Change attributes when output has drained.

TCSAFLUSH

Change attributes when output has drained; also flush pending input.

### Line Control
The <termios.h> header shall define the following symbolic constants for use with tcflush():

TCIFLUSH

Flush pending input.

TCIOFLUSH

Flush both pending input and untransmitted output.

TCOFLUSH

Flush untransmitted output.

The <termios.h> header shall define the following symbolic constants for use with tcflow():

TCIOFF

Transmit a STOP character, intended to suspend input data.

TCION

Transmit a START character, intended to restart input data.

TCOOFF

Suspend output.

TCOON

Restart output.

The <termios.h> header shall define the pid_t type 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.

```
speed_t cfgetispeed(const struct termios *);
speed_t cfgetospeed(const struct termios *);
int     cfsetispeed(struct termios *, speed_t);
int     cfsetospeed(struct termios *, speed_t);
int     tcdrain(int);
int     tcflow(int, int);
int     tcflush(int, int);
int     tcgetattr(int, struct termios *);
pid_t   tcgetsid(int);
int     tcsendbreak(int, int);
int     tcsetattr(int, int, const struct termios *);
```

The following sections are informative.

## APPLICATION USAGE
The following names are reserved for XSI-conformant systems to use as an extension to the above; therefore strictly conforming applications shall not use them:

CBAUD

EXTB

VDSUSP

DEFECHO

FLUSHO

VLNEXT

ECHOCTL

LOBLK

VREPRINT

ECHOKE

PENDIN

VSTATUS

ECHOPRT

SWTCH

VWERASE

EXTA

VDISCARD

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, cfgetispeed(), cfgetospeed(), cfsetispeed(), cfsetospeed(), confstr(), tcdrain(), tcflow(), tcflush(), tcgetattr(), tcgetsid(), tcsendbreak(), tcsetattr()

The Shell and Utilities volume of POSIX.1‐2017, Chapter 11, General Terminal Interface, getconf

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


tgmath.h

title: tgmath.h(7p)

text:
# tgmath.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
tgmath.h — type-generic macros

## SYNOPSIS

```
#include <tgmath.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 <tgmath.h> header shall include the headers <math.h> and <complex.h> and shall define several type-generic macros.

Of the functions contained within the <math.h> and <complex.h> headers without an f (float) or l (long double) suffix, several have one or more parameters whose corresponding real type is double. For each such function, except modf(), j0(), j1(), jn(), y0(), y1(), and yn(), there shall be a corresponding type-generic macro. The parameters whose corresponding real type is double in the function synopsis are generic parameters. Use of the macro invokes a function whose corresponding real type and type domain are determined by the arguments for the generic parameters.

Use of the macro invokes a function whose generic parameters have the corresponding real type determined as follows:

*

First, if any argument for generic parameters has type long double, the type determined is long double.

*

Otherwise, if any argument for generic parameters has type double or is of integer type, the type determined is double.

*

Otherwise, the type determined is float.

For each unsuffixed function in the <math.h> header for which there is a function in the <complex.h> header with the same name except for a c prefix, the corresponding type-generic macro (for both functions) has the same name as the function in the <math.h> header. The corresponding type-generic macro for fabs() and cabs() is fabs().

<math.h> Function

<complex.h> Function

Type-Generic Macro

acos()

cacos()

acos()

asin()

casin()

asin()

atan()

catan()

atan()

acosh()

cacosh()

acosh()

asinh()

casinh()

asinh()

atanh()

catanh()

atanh()

cos()

ccos()

cos()

sin()

csin()

sin()

tan()

ctan()

tan()

cosh()

ccosh()

cosh()

sinh()

csinh()

sinh()

tanh()

ctanh()

tanh()

exp()

cexp()

exp()

log()

clog()

log()

pow()

cpow()

pow()

sqrt()

csqrt()

sqrt()

fabs()

cabs()

fabs()

If at least one argument for a generic parameter is complex, then use of the macro invokes a complex function; otherwise, use of the macro invokes a real function.

For each unsuffixed function in the <math.h> header without a c-prefixed counterpart in the <complex.h> header, except for modf(), j0(), j1(), jn(), y0(), y1(), and yn(), the corresponding type-generic macro has the same name as the function. These type-generic macros are:

atan2() cbrt() ceil() copysign() erf() erfc() exp2() expm1() fdim() floor()

fma() fmax() fmin() fmod() frexp() hypot() ilogb() ldexp() lgamma() llrint()

llround() log10() log1p() log2() logb() lrint() lround() nearbyint() nextafter() nexttoward()

remainder() remquo() rint() round() scalbln() scalbn() tgamma() trunc()

If all arguments for generic parameters are real, then use of the macro invokes a real function; otherwise, use of the macro results in undefined behavior.

For each unsuffixed function in the <complex.h> header that is not a c-prefixed counterpart to a function in the <math.h> header, the corresponding type-generic macro has the same name as the function. These type-generic macros are:

carg() cimag() conj() cproj() creal()

Use of the macro with any real or complex argument invokes a complex function.

The following sections are informative.

## APPLICATION USAGE
With the declarations:

```
#include <tgmath.h>
int n;
float f;
double d;
long double ld;
float complex fc;
double complex dc;
long double complex ldc;
```

functions invoked by use of type-generic macros are shown in the following table:

Macro

Use Invokes

exp(n)

exp(n), the function

acosh(f)

acoshf(f)

sin(d)

sin(d), the function

atan(ld)

atanl(ld)

log(fc)

clogf(fc)

sqrt(dc)

csqrt(dc)

pow(ldc,f)

cpowl(ldc, f)

remainder(n,n)

remainder(n, n), the function

nextafter(d,f)

nextafter(d, f), the function

nexttoward(f,ld)

nexttowardf(f, ld)

copysign(n,ld)

copysignl(n, ld)

ceil(fc)

Undefined behavior

rint(dc)

Undefined behavior

fmax(ldc,ld)

Undefined behavior

carg(n)

carg(n), the function

cproj(f)

cprojf(f)

creal(d)

creal(d), the function

cimag(ld)

cimagl(ld)

cabs(fc)

cabsf(fc)

carg(dc)

carg(dc), the function

cproj(ldc)

cprojl(ldc)

## RATIONALE
Type-generic macros allow calling a function whose type is determined by the argument type, as is the case for C operators such as '+' and '*'. For example, with a type-generic cos() macro, the expression cos((float)x) will have type float. This feature enables writing more portably efficient code and alleviates need for awkward casting and suffixing in the process of porting or adjusting precision. Generic math functions are a widely appreciated feature of Fortran.

The only arguments that affect the type resolution are the arguments corresponding to the parameters that have type double in the synopsis. Hence the type of a type-generic call to nexttoward(), whose second parameter is long double in the synopsis, is determined solely by the type of the first argument.

The term ``type-generic'' was chosen over the proposed alternatives of intrinsic and overloading. The term is more specific than intrinsic, which already is widely used with a more general meaning, and reflects a closer match to Fortran's generic functions than to C++ overloading.

The macros are placed in their own header in order not to silently break old programs that include the <math.h> header; for example, with:

```
printf ("%e", sin(x))
```

modf(double, double *) is excluded because no way was seen to make it safe without complicating the type resolution.

The implementation might, as an extension, endow appropriate ones of the macros that POSIX.1‐2008 specifies only for real arguments with the ability to invoke the complex functions.

POSIX.1‐2008 does not prescribe any particular implementation mechanism for generic macros. It could be implemented simply with built-in macros. The generic macro for sqrt(), for example, could be implemented with:

```
#undef sqrt
#define sqrt(x) __BUILTIN_GENERIC_sqrt(x)
```

Generic macros are designed for a useful level of consistency with C++ overloaded math functions.

The great majority of existing C programs are expected to be unaffected when the <tgmath.h> header is included instead of the <math.h> or <complex.h> headers. Generic macros are similar to the ISO/IEC 9899:1999 standard library masking macros, though the semantic types of return values differ.

The ability to overload on integer as well as floating types would have been useful for some functions; for example, copysign(). Overloading with different numbers of arguments would have allowed reusing names; for example, remainder() for remquo(). However, these facilities would have complicated the specification; and their natural consistent use, such as for a floating abs() or a two-argument atan(), would have introduced further inconsistencies with the ISO/IEC 9899:1999 standard for insufficient benefit.

The ISO C standard in no way limits the implementation's options for efficiency, including inlining library functions.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<math.h>, <complex.h>

The System Interfaces volume of POSIX.1‐2017, cabs(), fabs(), modf()

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


time.h

title: time.h(7p)

text:
# time.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
time.h — time types

## SYNOPSIS

```
#include <time.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 <time.h> header shall define the clock_t, size_t, time_t, types as described in <sys/types.h>.

The <time.h> header shall define the clockid_t and timer_t types as described in <sys/types.h>.

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

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

The tag sigevent shall be declared as naming an incomplete structure type, the contents of which are described in the <signal.h> header.

The <time.h> header shall declare the tm structure, which shall include at least the following members:

```
int    tm_sec   Seconds [0,60].
int    tm_min   Minutes [0,59].
int    tm_hour  Hour [0,23].
int    tm_mday  Day of month [1,31].
int    tm_mon   Month of year [0,11].
int    tm_year  Years since 1900.
int    tm_wday  Day of week [0,6] (Sunday =0).
int    tm_yday  Day of year [0,365].
int    tm_isdst Daylight Savings flag.
```

The value of tm_isdst shall be positive if Daylight Savings Time is in effect, 0 if Daylight Savings Time is not in effect, and negative if the information is not available.

The <time.h> header shall declare the timespec structure, which shall include at least the following members:

```
time_t  tv_sec    Seconds.
long    tv_nsec   Nanoseconds.
```

The <time.h> header shall also declare the itimerspec structure, which shall include at least the following members:

```
struct timespec  it_interval  Timer period.
struct timespec  it_value     Timer expiration.
```

The <time.h> header shall define the following macros:

NULL

As described in <stddef.h>.

CLOCKS_PER_SEC

A number used to convert the value returned by the clock() function into seconds. The value shall be an expression with type clock_t. The value of CLOCKS_PER_SEC shall be 1 million on XSI-conformant systems. However, it may be variable on other systems, and it should not be assumed that CLOCKS_PER_SEC is a compile-time constant.

The <time.h> header shall define the following symbolic constants. The values shall have a type that is assignment-compatible with clockid_t.

CLOCK_MONOTONIC

The identifier for the system-wide monotonic clock, which is defined as a clock measuring real time, whose value cannot be set via clock_settime() and which cannot have negative clock jumps. The maximum possible clock jump shall be implementation-defined.

CLOCK_PROCESS_CPUTIME_ID

The identifier of the CPU-time clock associated with the process making a clock() or timer*() function call.

CLOCK_REALTIME

The identifier of the system-wide clock measuring real time.

CLOCK_THREAD_CPUTIME_ID

The identifier of the CPU-time clock associated with the thread making a clock() or timer*() function call.

The <time.h> header shall define the following symbolic constant:

TIMER_ABSTIME

Flag indicating time is absolute. For functions taking timer objects, this refers to the clock associated with the timer.

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

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

```
char      *asctime(const struct tm *);
char      *asctime_r(const struct tm *restrict, char *restrict);
clock_t    clock(void);
int        clock_getcpuclockid(pid_t, clockid_t *);
int        clock_getres(clockid_t, struct timespec *);
int        clock_gettime(clockid_t, struct timespec *);
int        clock_nanosleep(clockid_t, int, const struct timespec *,

               struct timespec *);
int        clock_settime(clockid_t, const struct timespec *);
char      *ctime(const time_t *);
char      *ctime_r(const time_t *, char *);
double     difftime(time_t, time_t);
struct tm *getdate(const char *);
struct tm *gmtime(const time_t *);
struct tm *gmtime_r(const time_t *restrict, struct tm *restrict);
struct tm *localtime(const time_t *);
struct tm *localtime_r(const time_t *restrict, struct tm *restrict);
time_t     mktime(struct tm *);
int        nanosleep(const struct timespec *, struct timespec *);
size_t     strftime(char *restrict, size_t, const char *restrict,

           const struct tm *restrict);
size_t     strftime_l(char *restrict, size_t, const char *restrict,

               const struct tm *restrict, locale_t);
char      *strptime(const char *restrict, const char *restrict,

               struct tm *restrict);
time_t     time(time_t *);
int        timer_create(clockid_t, struct sigevent *restrict,

               timer_t *restrict);
int        timer_delete(timer_t);
int        timer_getoverrun(timer_t);
int        timer_gettime(timer_t, struct itimerspec *);
int        timer_settime(timer_t, int, const struct itimerspec *restrict,

               struct itimerspec *restrict);
void       tzset(void);
```

The <time.h> header shall declare the following as variables:

```
extern int    daylight;
extern long   timezone;
extern char  *tzname[];
```

Inclusion of the <time.h> header may make visible all symbols from the <signal.h> header.

The following sections are informative.

## APPLICATION USAGE
The range [0,60] for tm_sec allows for the occasional leap second.

tm_year is a signed value; therefore, years before 1900 may be represented.

To obtain the number of clock ticks per second returned by the times() function, applications should call sysconf(_SC_CLK_TCK).

## RATIONALE
The range [0,60] seconds allows for positive or negative leap seconds. The formal definition of UTC does not permit double leap seconds, so all mention of double leap seconds has been removed, and the range shortened from the former [0,61] seconds seen in earlier versions of this standard.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<locale.h>, <signal.h>, <stddef.h>, <sys_types.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment, asctime(), clock(), clock_getcpuclockid(), clock_getres(), clock_nanosleep(), ctime(), difftime(), getdate(), gmtime(), localtime(), mktime(), mq_receive(), mq_send(), nanosleep(), pthread_getcpuclockid(), pthread_mutex_timedlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), sem_timedwait(), strftime(), strptime(), sysconf(), time(), timer_create(), timer_delete(), timer_getoverrun(), tzset(), utime()

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


trace.h

title: trace.h(7p)

text:
# trace.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
trace.h — tracing

## SYNOPSIS

```
#include <trace.h>
```

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

```
trace_event_id_t  posix_event_id
pid_t             posix_pid
void             *posix_prog_address
pthread_t         posix_thread_id
struct timespec   posix_timestamp
int               posix_truncation_status
```

The <trace.h> header shall define the posix_trace_status_info structure, which shall include at least the following members:

```
int     posix_stream_full_status
int     posix_stream_overrun_status
int     posix_stream_status
int     posix_log_full_status
int     posix_log_overrun_status
int     posix_stream_flush_error
int     posix_stream_flush_status
```

The <trace.h> header shall define the following symbolic constants:

```
POSIX_TRACE_ALL_EVENTS
POSIX_TRACE_APPEND
POSIX_TRACE_CLOSE_FOR_CHILD
POSIX_TRACE_FILTER
POSIX_TRACE_FLUSH
POSIX_TRACE_FLUSH_START
POSIX_TRACE_FLUSH_STOP
POSIX_TRACE_FLUSHING
POSIX_TRACE_FULL
POSIX_TRACE_LOOP
POSIX_TRACE_NO_OVERRUN
POSIX_TRACE_NOT_FLUSHING
POSIX_TRACE_NOT_FULL
POSIX_TRACE_INHERITED
POSIX_TRACE_NOT_TRUNCATED
POSIX_TRACE_OVERFLOW
POSIX_TRACE_OVERRUN
POSIX_TRACE_RESUME
POSIX_TRACE_RUNNING
POSIX_TRACE_START
POSIX_TRACE_STOP
POSIX_TRACE_SUSPENDED
POSIX_TRACE_SYSTEM_EVENTS
POSIX_TRACE_TRUNCATED_READ
POSIX_TRACE_TRUNCATED_RECORD
POSIX_TRACE_UNNAMED_USER_EVENT
POSIX_TRACE_UNTIL_FULL
POSIX_TRACE_WOPID_EVENTS
```

The <trace.h> header shall define the size_t, trace_attr_t, trace_event_id_t, trace_event_set_t, and trace_id_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  posix_trace_attr_destroy(trace_attr_t *);
int  posix_trace_attr_getclockres(const trace_attr_t *,

         struct timespec *);
int  posix_trace_attr_getcreatetime(const trace_attr_t *,

         struct timespec *);
int  posix_trace_attr_getgenversion(const trace_attr_t *, char *);
int  posix_trace_attr_getinherited(const trace_attr_t *restrict,

         int *restrict);
int  posix_trace_attr_getlogfullpolicy(const trace_attr_t *restrict,

         int *restrict);
int  posix_trace_attr_getlogsize(const trace_attr_t *restrict,

         size_t *restrict);
int  posix_trace_attr_getmaxdatasize(const trace_attr_t *restrict,

         size_t *restrict);
int  posix_trace_attr_getmaxsystemeventsize(const trace_attr_t *restrict,

         size_t *restrict);
int  posix_trace_attr_getmaxusereventsize(const trace_attr_t *restrict,

         size_t, size_t *restrict);
int  posix_trace_attr_getname(const trace_attr_t *, char *);
int  posix_trace_attr_getstreamfullpolicy(const trace_attr_t *restrict,

         int *restrict);
int  posix_trace_attr_getstreamsize(const trace_attr_t *restrict,

         size_t *restrict);
int  posix_trace_attr_init(trace_attr_t *);
int  posix_trace_attr_setinherited(trace_attr_t *, int);
int  posix_trace_attr_setlogfullpolicy(trace_attr_t *, int);
int  posix_trace_attr_setlogsize(trace_attr_t *, size_t);
int  posix_trace_attr_setmaxdatasize(trace_attr_t *, size_t);
int  posix_trace_attr_setname(trace_attr_t *, const char *);
int  posix_trace_attr_setstreamfullpolicy(trace_attr_t *, int);
int  posix_trace_attr_setstreamsize(trace_attr_t *, size_t);
int  posix_trace_clear(trace_id_t);
int  posix_trace_close(trace_id_t);
int  posix_trace_create(pid_t, const trace_attr_t *restrict,

         trace_id_t *restrict);
int  posix_trace_create_withlog(pid_t, const trace_attr_t *restrict,

         int, trace_id_t *restrict);
void posix_trace_event(trace_event_id_t, const void *restrict, size_t);
int  posix_trace_eventid_equal(trace_id_t, trace_event_id_t,

         trace_event_id_t);
int  posix_trace_eventid_get_name(trace_id_t, trace_event_id_t, char *);
int  posix_trace_eventid_open(const char *restrict,

         trace_event_id_t *restrict);
int  posix_trace_eventset_add(trace_event_id_t, trace_event_set_t *);
int  posix_trace_eventset_del(trace_event_id_t, trace_event_set_t *);
int  posix_trace_eventset_empty(trace_event_set_t *);
int  posix_trace_eventset_fill(trace_event_set_t *, int);
int  posix_trace_eventset_ismember(trace_event_id_t,

         const trace_event_set_t *restrict, int *restrict);
int  posix_trace_eventtypelist_getnext_id(trace_id_t,

         trace_event_id_t *restrict, int *restrict);
int  posix_trace_eventtypelist_rewind(trace_id_t);
int  posix_trace_flush(trace_id_t);
int  posix_trace_get_attr(trace_id_t, trace_attr_t *);
int  posix_trace_get_filter(trace_id_t, trace_event_set_t *);
int  posix_trace_get_status(trace_id_t,

         struct posix_trace_status_info *);
int  posix_trace_getnext_event(trace_id_t,

         struct posix_trace_event_info *restrict, void *restrict,

         size_t, size_t *restrict, int *restrict);
int  posix_trace_open(int, trace_id_t *);
int  posix_trace_rewind(trace_id_t);
int  posix_trace_set_filter(trace_id_t, const trace_event_set_t *, int);
int  posix_trace_shutdown(trace_id_t);
int  posix_trace_start(trace_id_t);
int  posix_trace_stop(trace_id_t);
int  posix_trace_timedgetnext_event(trace_id_t,

         struct posix_trace_event_info *restrict, void *restrict,

         size_t, size_t *restrict, int *restrict,

         const struct timespec *restrict);
int  posix_trace_trid_eventid_open(trace_id_t, const char *restrict,

         trace_event_id_t *restrict);
int  posix_trace_trygetnext_event(trace_id_t,

         struct posix_trace_event_info *restrict, void *restrict, size_t,

         size_t *restrict, int *restrict);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
The <trace.h> header may be removed in a future version.

## SEE ALSO
<sys_types.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.11, Tracing, posix_trace_attr_destroy(), posix_trace_attr_getclockres(), posix_trace_attr_getinherited(), posix_trace_attr_getlogsize(), posix_trace_clear(), posix_trace_close(), posix_trace_create(), posix_trace_event(), posix_trace_eventid_equal(), posix_trace_eventset_add(), posix_trace_eventtypelist_getnext_id(), posix_trace_get_attr(), posix_trace_get_filter(), posix_trace_getnext_event(), posix_trace_start()

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


ulimit.h

title: ulimit.h(7p)

text:
# ulimit.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
ulimit.h — ulimit commands

## SYNOPSIS

```
#include <ulimit.h>
```

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

Symbolic constants:

UL_GETFSIZE

Get maximum file size.

UL_SETFSIZE

Set maximum file size.

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

```
long ulimit(int, ...);
```

The following sections are informative.

## APPLICATION USAGE
See ulimit().

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

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

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