unistd.h

title: unistd.h(7p)

text:
# unistd.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
unistd.h — standard symbolic constants and types

## SYNOPSIS

```
#include <unistd.h>
```

## DESCRIPTION
The <unistd.h> header defines miscellaneous symbolic constants and types, and declares miscellaneous functions. The actual values of the constants are unspecified except as shown. The contents of this header are shown below.

### Version Test Macros
The <unistd.h> header shall define the following symbolic constants. The values shall be suitable for use in #if preprocessing directives.

_POSIX_VERSION

Integer value indicating version of this standard (C-language binding) to which the implementation conforms. For implementations conforming to POSIX.1‐2008, the value shall be 200809L.

_POSIX2_VERSION

Integer value indicating version of the Shell and Utilities volume of POSIX.1 to which the implementation conforms. For implementations conforming to POSIX.1‐2008, the value shall be 200809L. For profile implementations that define _POSIX_SUBPROFILE (see Section 2.1.5.1, Subprofiling Considerations) in <unistd.h>, _POSIX2_VERSION may be left undefined or be defined with the value -1 to indicate that the Shell and Utilities volume of POSIX.1 is not supported. In this case, a call to sysconf(_SC_2_VERSION) shall return either 200809L or -1 indicating that the Shell and Utilities volume of POSIX.1 is or is not, respectively, supported at runtime.

The <unistd.h> header shall define the following symbolic constant only if the implementation supports the XSI option; see Section 2.1.4, XSI Conformance. If defined, its value shall be suitable for use in #if preprocessing directives.

_XOPEN_VERSION

Integer value indicating version of the X/Open Portability Guide to which the implementation conforms. The value shall be 700.

### Constants for Options and Option Groups
The following symbolic constants, if defined in <unistd.h>, shall have a value of -1, 0, or greater, unless otherwise specified below. For profile implementations that define _POSIX_SUBPROFILE (see Section 2.1.5.1, Subprofiling Considerations) in <unistd.h>, constants described below as always having a value greater than zero need not be defined and, if defined, may have a value of -1, 0, or greater. The values shall be suitable for use in #if preprocessing directives.

If a symbolic constant is not defined or is defined with the value -1, the option is not supported for compilation. If it is defined with a value greater than zero, the option shall always be supported when the application is executed. If it is defined with the value zero, the option shall be supported for compilation and might or might not be supported at runtime. See Section 2.1.6, Options for further information about the conformance requirements of these three categories of support.

_POSIX_ADVISORY_INFO

The implementation supports the Advisory Information option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_ASYNCHRONOUS_IO

The implementation supports asynchronous input and output. This symbol shall always be set to the value 200809L.

_POSIX_BARRIERS

The implementation supports barriers. This symbol shall always be set to the value 200809L.

_POSIX_CHOWN_RESTRICTED

The use of chown() and fchown() is restricted to a process with appropriate privileges, and to changing the group ID of a file only to the effective group ID of the process or to one of its supplementary group IDs. This symbol shall be defined with a value other than -1.

_POSIX_CLOCK_SELECTION

The implementation supports clock selection. This symbol shall always be set to the value 200809L.

_POSIX_CPUTIME

The implementation supports the Process CPU-Time Clocks option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_FSYNC

The implementation supports the File Synchronization option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_IPV6

The implementation supports the IPv6 option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_JOB_CONTROL

The implementation supports job control. This symbol shall always be set to a value greater than zero.

_POSIX_MAPPED_FILES

The implementation supports memory mapped Files. This symbol shall always be set to the value 200809L.

_POSIX_MEMLOCK

The implementation supports the Process Memory Locking option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_MEMLOCK_RANGE

The implementation supports the Range Memory Locking option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_MEMORY_PROTECTION

The implementation supports memory protection. This symbol shall always be set to the value 200809L.

_POSIX_MESSAGE_PASSING

The implementation supports the Message Passing option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_MONOTONIC_CLOCK

The implementation supports the Monotonic Clock option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_NO_TRUNC

Pathname components longer than {NAME_MAX} generate an error. This symbol shall be defined with a value other than -1.

_POSIX_PRIORITIZED_IO

The implementation supports the Prioritized Input and Output option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_PRIORITY_SCHEDULING

The implementation supports the Process Scheduling option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_RAW_SOCKETS

The implementation supports the Raw Sockets option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_READER_WRITER_LOCKS

The implementation supports read-write locks. This symbol shall always be set to the value 200809L.

_POSIX_REALTIME_SIGNALS

The implementation supports realtime signals. This symbol shall always be set to the value 200809L.

_POSIX_REGEXP

The implementation supports the Regular Expression Handling option. This symbol shall always be set to a value greater than zero.

_POSIX_SAVED_IDS

Each process has a saved set-user-ID and a saved set-group-ID. This symbol shall always be set to a value greater than zero.

_POSIX_SEMAPHORES

The implementation supports semaphores. This symbol shall always be set to the value 200809L.

_POSIX_SHARED_MEMORY_OBJECTS

The implementation supports the Shared Memory Objects option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_SHELL

The implementation supports the POSIX shell. This symbol shall always be set to a value greater than zero.

_POSIX_SPAWN

The implementation supports the Spawn option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_SPIN_LOCKS

The implementation supports spin locks. This symbol shall always be set to the value 200809L.

_POSIX_SPORADIC_SERVER

The implementation supports the Process Sporadic Server option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_SYNCHRONIZED_IO

The implementation supports the Synchronized Input and Output option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_ATTR_STACKADDR

The implementation supports the Thread Stack Address Attribute option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_ATTR_STACKSIZE

The implementation supports the Thread Stack Size Attribute option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_CPUTIME

The implementation supports the Thread CPU-Time Clocks option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_PRIO_INHERIT

The implementation supports the Non-Robust Mutex Priority Inheritance option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_PRIO_PROTECT

The implementation supports the Non-Robust Mutex Priority Protection option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_PRIORITY_SCHEDULING

The implementation supports the Thread Execution Scheduling option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_PROCESS_SHARED

The implementation supports the Thread Process-Shared Synchronization option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_ROBUST_PRIO_INHERIT

The implementation supports the Robust Mutex Priority Inheritance option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_ROBUST_PRIO_PROTECT

The implementation supports the Robust Mutex Priority Protection option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREAD_SAFE_FUNCTIONS

The implementation supports thread-safe functions. This symbol shall always be set to the value 200809L.

_POSIX_THREAD_SPORADIC_SERVER

The implementation supports the Thread Sporadic Server option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_THREADS

The implementation supports threads. This symbol shall always be set to the value 200809L.

_POSIX_TIMEOUTS

The implementation supports timeouts. This symbol shall always be set to the value 200809L.

_POSIX_TIMERS

The implementation supports timers. This symbol shall always be set to the value 200809L.

_POSIX_TRACE

The implementation supports the Trace option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_TRACE_EVENT_FILTER

The implementation supports the Trace Event Filter option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_TRACE_INHERIT

The implementation supports the Trace Inherit option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_TRACE_LOG

The implementation supports the Trace Log option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_TYPED_MEMORY_OBJECTS

The implementation supports the Typed Memory Objects option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX_V6_ILP32_OFF32

The implementation provides a C-language compilation environment with 32-bit int, long, pointer, and off_t types.

_POSIX_V6_ILP32_OFFBIG

The implementation provides a C-language compilation environment with 32-bit int, long, and pointer types and an off_t type using at least 64 bits.

_POSIX_V6_LP64_OFF64

The implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer, and off_t types.

_POSIX_V6_LPBIG_OFFBIG

The implementation provides a C-language compilation environment with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits.

_POSIX_V7_ILP32_OFF32

The implementation provides a C-language compilation environment with 32-bit int, long, pointer, and off_t types.

_POSIX_V7_ILP32_OFFBIG

The implementation provides a C-language compilation environment with 32-bit int, long, and pointer types and an off_t type using at least 64 bits.

_POSIX_V7_LP64_OFF64

The implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer, and off_t types.

_POSIX_V7_LPBIG_OFFBIG

The implementation provides a C-language compilation environment with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits.

_POSIX2_C_BIND

The implementation supports the C-Language Binding option. This symbol shall always have the value 200809L.

_POSIX2_C_DEV

The implementation supports the C-Language Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_CHAR_TERM

The implementation supports the Terminal Characteristics option. The value of this symbol reported by sysconf() shall either be -1 or a value greater than zero.

_POSIX2_FORT_DEV

The implementation supports the FORTRAN Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_FORT_RUN

The implementation supports the FORTRAN Runtime Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_LOCALEDEF

The implementation supports the creation of locales by the localedef utility. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS

The implementation supports the Batch Environment Services and Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS_ACCOUNTING

The implementation supports the Batch Accounting option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS_CHECKPOINT

The implementation supports the Batch Checkpoint/Restart option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS_LOCATE

The implementation supports the Locate Batch Job Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS_MESSAGE

The implementation supports the Batch Job Message Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_PBS_TRACK

The implementation supports the Track Batch Job Request option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_SW_DEV

The implementation supports the Software Development Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_POSIX2_UPE

The implementation supports the User Portability Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall either be -1 or 200809L.

_XOPEN_CRYPT

The implementation supports the X/Open Encryption Option Group.

_XOPEN_ENH_I18N

The implementation supports the Issue 4, Version 2 Enhanced Internationalization Option Group. This symbol shall always be set to a value other than -1.

_XOPEN_REALTIME

The implementation supports the X/Open Realtime Option Group.

_XOPEN_REALTIME_THREADS

The implementation supports the X/Open Realtime Threads Option Group.

_XOPEN_SHM

The implementation supports the Issue 4, Version 2 Shared Memory Option Group. This symbol shall always be set to a value other than -1.

_XOPEN_STREAMS

The implementation supports the XSI STREAMS Option Group.

_XOPEN_UNIX

The implementation supports the XSI option.

_XOPEN_UUCP

The implementation supports the UUCP Utilities option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200809L. The value of this symbol reported by sysconf() shall be either -1 or 200809L.

### Execution-Time Symbolic Constants
If any of the following symbolic constants are not defined in the <unistd.h> header, the value shall vary depending on the file to which it is applied. If defined, they shall have values suitable for use in #if preprocessing directives.

If any of the following symbolic constants are defined to have value -1 in the <unistd.h> header, the implementation shall not provide the option on any file; if any are defined to have a value other than -1 in the <unistd.h> header, the implementation shall provide the option on all applicable files.

All of the following values, whether defined as symbolic constants in <unistd.h> or not, may be queried with respect to a specific file using the pathconf() or fpathconf() functions:

_POSIX_ASYNC_IO

Asynchronous input or output operations may be performed for the associated file.

_POSIX_PRIO_IO

Prioritized input or output operations may be performed for the associated file.

_POSIX_SYNC_IO

Synchronized input or output operations may be performed for the associated file.

If the following symbolic constants are defined in the <unistd.h> header, they apply to files and all paths in all file systems on the implementation:

_POSIX_TIMESTAMP_RESOLUTION

The resolution in nanoseconds for all file timestamps.

_POSIX2_SYMLINKS

Symbolic links can be created.

### Constants for Functions
The <unistd.h> header shall define NULL as described in <stddef.h>.

The <unistd.h> header shall define the following symbolic constants for use with the access() function. The values shall be suitable for use in #if preprocessing directives.

F_OK

Test for existence of file.

R_OK

Test for read permission.

W_OK

Test for write permission.

X_OK

Test for execute (search) permission.

The constants F_OK, R_OK, W_OK, and X_OK and the expressions R_OK|W_OK, R_OK|X_OK, and R_OK|W_OK|X_OK shall all have distinct values.

The <unistd.h> header shall define the following symbolic constants for the confstr() function:

_CS_PATH

This is the value for the PATH environment variable that finds all of the standard utilities that are provided in a manner accessible via the exec family of functions.

_CS_POSIX_V7_ILP32_OFF32_CFLAGS

If sysconf(_SC_V7_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types.

_CS_POSIX_V7_ILP32_OFF32_LDFLAGS

If sysconf(_SC_V7_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types.

_CS_POSIX_V7_ILP32_OFF32_LIBS

If sysconf(_SC_V7_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types.

_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS

If sysconf(_SC_V7_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits.

_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS

If sysconf(_SC_V7_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits.

_CS_POSIX_V7_ILP32_OFFBIG_LIBS

If sysconf(_SC_V7_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits.

_CS_POSIX_V7_LP64_OFF64_CFLAGS

If sysconf(_SC_V7_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 32-bit int and 64-bit long, pointer, and off_t types.

_CS_POSIX_V7_LP64_OFF64_LDFLAGS

If sysconf(_SC_V7_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 32-bit int and 64-bit long, pointer, and off_t types.

_CS_POSIX_V7_LP64_OFF64_LIBS

If sysconf(_SC_V7_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 32-bit int and 64-bit long, pointer, and off_t types.

_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS

If sysconf(_SC_V7_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits.

_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS

If sysconf(_SC_V7_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits.

_CS_POSIX_V7_LPBIG_OFFBIG_LIBS

If sysconf(_SC_V7_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits.

_CS_POSIX_V7_THREADS_CFLAGS

If sysconf(_SC_POSIX_THREADS) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build a multi-threaded application. These flags are in addition to those associated with any of the other _CS_POSIX_V7_*_CFLAGS values used to specify particular type size programing environments.

_CS_POSIX_V7_THREADS_LDFLAGS

If sysconf(_SC_POSIX_THREADS) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build a multi-threaded application. These flags are in addition to those associated with any of the other _CS_POSIX_V7_*_LDFLAGS values used to specify particular type size programing environments.

_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS

This value is a <newline>-separated list of names of programming environments supported by the implementation in which the widths of the blksize_t, cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, ssize_t, suseconds_t, tcflag_t, wchar_t, and wint_t types are no greater than the width of type long. The format of each name shall be suitable for use with the getconf -v option.

_CS_V7_ENV

This is the value that provides the environment variable information (other than that provided by _CS_PATH) that is required by the implementation to create a conforming environment, as described in the implementation's conformance documentation.

The following symbolic constants are reserved for compatibility with Issue 6:

```
_CS_POSIX_V6_ILP32_OFF32_CFLAGS
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS
_CS_POSIX_V6_ILP32_OFF32_LIBS
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LIBS
_CS_POSIX_V6_LP64_OFF64_CFLAGS
_CS_POSIX_V6_LP64_OFF64_LDFLAGS
_CS_POSIX_V6_LP64_OFF64_LIBS
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
_CS_V6_ENV
```

The <unistd.h> header shall define SEEK_CUR, SEEK_END, and SEEK_SET as described in <stdio.h>.

The <unistd.h> header shall define the following symbolic constants as possible values for the function argument to the lockf() function:

F_LOCK

Lock a section for exclusive use.

F_TEST

Test section for locks by other processes.

F_TLOCK

Test and lock a section for exclusive use.

F_ULOCK

Unlock locked sections.

The <unistd.h> header shall define the following symbolic constants for pathconf():

```
_PC_2_SYMLINKS
_PC_ALLOC_SIZE_MIN
_PC_ASYNC_IO
_PC_CHOWN_RESTRICTED
_PC_FILESIZEBITS
_PC_LINK_MAX
_PC_MAX_CANON
_PC_MAX_INPUT
_PC_NAME_MAX
_PC_NO_TRUNC
_PC_PATH_MAX
_PC_PIPE_BUF
_PC_PRIO_IO
_PC_REC_INCR_XFER_SIZE
_PC_REC_MAX_XFER_SIZE
_PC_REC_MIN_XFER_SIZE
_PC_REC_XFER_ALIGN
_PC_SYMLINK_MAX
_PC_SYNC_IO
_PC_TIMESTAMP_RESOLUTION
_PC_VDISABLE
```

The <unistd.h> header shall define the following symbolic constants for sysconf():

```
_SC_2_C_BIND
_SC_2_C_DEV
_SC_2_CHAR_TERM
_SC_2_FORT_DEV
_SC_2_FORT_RUN
_SC_2_LOCALEDEF
_SC_2_PBS
_SC_2_PBS_ACCOUNTING
_SC_2_PBS_CHECKPOINT
_SC_2_PBS_LOCATE
_SC_2_PBS_MESSAGE
_SC_2_PBS_TRACK
_SC_2_SW_DEV
_SC_2_UPE
_SC_2_VERSION
_SC_ADVISORY_INFO
_SC_AIO_LISTIO_MAX
_SC_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX
_SC_ARG_MAX
_SC_ASYNCHRONOUS_IO
_SC_ATEXIT_MAX
_SC_BARRIERS
_SC_BC_BASE_MAX
_SC_BC_DIM_MAX
_SC_BC_SCALE_MAX
_SC_BC_STRING_MAX
_SC_CHILD_MAX
_SC_CLK_TCK
_SC_CLOCK_SELECTION
_SC_COLL_WEIGHTS_MAX
_SC_CPUTIME
_SC_DELAYTIMER_MAX
_SC_EXPR_NEST_MAX
_SC_FSYNC
_SC_GETGR_R_SIZE_MAX
_SC_GETPW_R_SIZE_MAX
_SC_HOST_NAME_MAX
_SC_IOV_MAX
_SC_IPV6
_SC_JOB_CONTROL
_SC_LINE_MAX
_SC_LOGIN_NAME_MAX
_SC_MAPPED_FILES
_SC_MEMLOCK
_SC_MEMLOCK_RANGE
_SC_MEMORY_PROTECTION
_SC_MESSAGE_PASSING
_SC_MONOTONIC_CLOCK
_SC_MQ_OPEN_MAX
_SC_MQ_PRIO_MAX
_SC_NGROUPS_MAX
_SC_OPEN_MAX
_SC_PAGE_SIZE
_SC_PAGESIZE
_SC_PRIORITIZED_IO
_SC_PRIORITY_SCHEDULING
_SC_RAW_SOCKETS
_SC_RE_DUP_MAX
_SC_READER_WRITER_LOCKS
_SC_REALTIME_SIGNALS
_SC_REGEXP
_SC_RTSIG_MAX
_SC_SAVED_IDS
_SC_SEM_NSEMS_MAX
_SC_SEM_VALUE_MAX
_SC_SEMAPHORES
_SC_SHARED_MEMORY_OBJECTS
_SC_SHELL
_SC_SIGQUEUE_MAX
_SC_SPAWN
_SC_SPIN_LOCKS
_SC_SPORADIC_SERVER
_SC_SS_REPL_MAX
_SC_STREAM_MAX
_SC_SYMLOOP_MAX
_SC_SYNCHRONIZED_IO
_SC_THREAD_ATTR_STACKADDR
_SC_THREAD_ATTR_STACKSIZE
_SC_THREAD_CPUTIME
_SC_THREAD_DESTRUCTOR_ITERATIONS
_SC_THREAD_KEYS_MAX
_SC_THREAD_PRIO_INHERIT
_SC_THREAD_PRIO_PROTECT
_SC_THREAD_PRIORITY_SCHEDULING
_SC_THREAD_PROCESS_SHARED
_SC_THREAD_ROBUST_PRIO_INHERIT
_SC_THREAD_ROBUST_PRIO_PROTECT
_SC_THREAD_SAFE_FUNCTIONS
_SC_THREAD_SPORADIC_SERVER
_SC_THREAD_STACK_MIN
_SC_THREAD_THREADS_MAX
_SC_THREADS
_SC_TIMEOUTS
_SC_TIMER_MAX
_SC_TIMERS
_SC_TRACE
_SC_TRACE_EVENT_FILTER
_SC_TRACE_EVENT_NAME_MAX
_SC_TRACE_INHERIT
_SC_TRACE_LOG
_SC_TRACE_NAME_MAX
_SC_TRACE_SYS_MAX
_SC_TRACE_USER_EVENT_MAX
_SC_TTY_NAME_MAX
_SC_TYPED_MEMORY_OBJECTS
_SC_TZNAME_MAX
_SC_V7_ILP32_OFF32
_SC_V7_ILP32_OFFBIG
_SC_V7_LP64_OFF64
_SC_V7_LPBIG_OFFBIG
_SC_V6_ILP32_OFF32
_SC_V6_ILP32_OFFBIG
_SC_V6_LP64_OFF64
_SC_V6_LPBIG_OFFBIG
_SC_VERSION
_SC_XOPEN_CRYPT
_SC_XOPEN_ENH_I18N
_SC_XOPEN_REALTIME
_SC_XOPEN_REALTIME_THREADS
_SC_XOPEN_SHM
_SC_XOPEN_STREAMS
_SC_XOPEN_UNIX
_SC_XOPEN_UUCP
_SC_XOPEN_VERSION
```

The two constants _SC_PAGESIZE and _SC_PAGE_SIZE may be defined to have the same value.

The <unistd.h> header shall define the following symbolic constants for file streams:

STDERR_FILENO

File number of stderr; 2.

STDIN_FILENO

File number of stdin; 0.

STDOUT_FILENO

File number of stdout; 1.

The <unistd.h> header shall define the following symbolic constant for terminal special character handling:

_POSIX_VDISABLE

This symbol shall be defined to be the value of a character that shall disable terminal special character handling as described in Section 11.2.6, Special Control Characters. This symbol shall always be set to a value other than -1.

### Type Definitions
The <unistd.h> header shall define the size_t, ssize_t, uid_t, gid_t, off_t, and pid_t types as described in <sys/types.h>.

The <unistd.h> header shall define the intptr_t type as described in <stdint.h>.

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

```
int          access(const char *, int);
unsigned     alarm(unsigned);
int          chdir(const char *);
int          chown(const char *, uid_t, gid_t);
int          close(int);
size_t       confstr(int, char *, size_t);
char        *crypt(const char *, const char *);
int          dup(int);

int          dup2(int, int);
void         _exit(int);
void         encrypt(char [64], int);
int          execl(const char *, const char *, ...);
int          execle(const char *, const char *, ...);
int          execlp(const char *, const char *, ...);
int          execv(const char *, char *const []);
int          execve(const char *, char *const [], char *const []);
int          execvp(const char *, char *const []);
int          faccessat(int, const char *, int, int);
int          fchdir(int);
int          fchown(int, uid_t, gid_t);
int          fchownat(int, const char *, uid_t, gid_t, int);
int          fdatasync(int);
int          fexecve(int, char *const [], char *const []);
pid_t        fork(void);
long         fpathconf(int, int);
int          fsync(int);
int          ftruncate(int, off_t);
char        *getcwd(char *, size_t);
gid_t        getegid(void);
uid_t        geteuid(void);
gid_t        getgid(void);
int          getgroups(int, gid_t []);
long         gethostid(void);
int          gethostname(char *, size_t);
char        *getlogin(void);
int          getlogin_r(char *, size_t);
int          getopt(int, char * const [], const char *);
pid_t        getpgid(pid_t);
pid_t        getpgrp(void);
pid_t        getpid(void);
pid_t        getppid(void);
pid_t        getsid(pid_t);
uid_t        getuid(void);
int          isatty(int);
int          lchown(const char *, uid_t, gid_t);
int          link(const char *, const char *);
int          linkat(int, const char *, int, const char *, int);
int          lockf(int, int, off_t);
off_t        lseek(int, off_t, int);
int          nice(int);
long         pathconf(const char *, int);
int          pause(void);
int          pipe(int [2]);
ssize_t      pread(int, void *, size_t, off_t);
ssize_t      pwrite(int, const void *, size_t, off_t);
ssize_t      read(int, void *, size_t);
ssize_t      readlink(const char *restrict, char *restrict, size_t);
ssize_t      readlinkat(int, const char *restrict, char *restrict, size_t);
int          rmdir(const char *);
int          setegid(gid_t);
int          seteuid(uid_t);
int          setgid(gid_t);

int          setpgid(pid_t, pid_t);
pid_t        setpgrp(void);
int          setregid(gid_t, gid_t);
int          setreuid(uid_t, uid_t);
pid_t        setsid(void);
int          setuid(uid_t);
unsigned     sleep(unsigned);
void         swab(const void *restrict, void *restrict, ssize_t);
int          symlink(const char *, const char *);
int          symlinkat(const char *, int, const char *);
void         sync(void);
long         sysconf(int);
pid_t        tcgetpgrp(int);
int          tcsetpgrp(int, pid_t);
int          truncate(const char *, off_t);
char        *ttyname(int);
int          ttyname_r(int, char *, size_t);
int          unlink(const char *);
int          unlinkat(int, const char *, int);
ssize_t      write(int, const void *, size_t);
```

Implementations may also include the pthread_atfork() prototype as defined in <pthread.h>. Implementations may also include the ctermid() prototype as defined in <stdio.h>.

The <unistd.h> header shall declare the following external variables:

```
extern char  *optarg;
extern int    opterr, optind, optopt;
```

Inclusion of the <unistd.h> header may make visible all symbols from the headers <stddef.h>, <stdint.h>, and <stdio.h>.

The following sections are informative.

## APPLICATION USAGE
POSIX.1‐2008 only describes the behavior of systems that claim conformance to it. However, application developers who want to write applications that adapt to other versions of this standard (or to systems that do not conform to any POSIX standard) may find it useful to code them so as to conditionally compile different code depending on the value of _POSIX_VERSION, for example:

```
#if _POSIX_VERSION >= 200112L
/* Use the newer function that copes with large files. */
off_t pos=ftello(fp);
#else
/* Either this is an old version of POSIX, or _POSIX_VERSION is

   not even defined, so use the traditional function. */
long pos=ftell(fp);
#endif
```

Earlier versions of POSIX.1‐2008 and of the Single UNIX Specification can be identified by the following macros:

POSIX.1‐1988 standard

_POSIX_VERSION==198808L

POSIX.1‐1990 standard

_POSIX_VERSION==199009L

ISO POSIX‐1:1996 standard

_POSIX_VERSION==199506L

Single UNIX Specification, Version 1

_XOPEN_UNIX and _XOPEN_VERSION==4

Single UNIX Specification, Version 2

_XOPEN_UNIX and _XOPEN_VERSION==500

ISO POSIX‐1:2001 and Single UNIX Specification, Version 3

_POSIX_VERSION==200112L, plus (if the XSI option is supported) _XOPEN_UNIX and _XOPEN_VERSION==600

POSIX.1‐2008 does not make any attempt to define application binary interaction with the underlying operating system. However, application developers may find it useful to query _SC_VERSION at runtime via sysconf() to determine whether the current version of the operating system supports the necessary functionality as in the following program fragment:

```
if (sysconf(_SC_VERSION) < 200809L) {

    fprintf(stderr, "POSIX.1-2008 system required, terminating \n");

    exit(1);
}
```

New applications should not use _XOPEN_SHM or _XOPEN_ENH_I18N.

## RATIONALE
As POSIX.1‐2008 evolved, certain options became sufficiently standardized that it was concluded that simply requiring one of the option choices was simpler than retaining the option. However, for backwards-compatibility, the option flags (with required constant values) are retained.

### Version Test Macros
The standard developers considered altering the definition of _POSIX_VERSION and removing _SC_VERSION from the specification of sysconf() since the utility to an application was deemed by some to be minimal, and since the implementation of the functionality is potentially problematic. However, they recognized that support for existing application binaries is a concern to manufacturers, application developers, and the users of implementations conforming to POSIX.1‐2008.

While the example using _SC_VERSION in the APPLICATION USAGE section does not provide the greatest degree of imaginable utility to the application developer or user, it is arguably better than a core file or some other equally obscure result. (It is also possible for implementations to encode and recognize application binaries compiled in various POSIX.1-conforming environments, and modify the semantics of the underlying system to conform to the expectations of the application.) For the reasons outlined in the preceding paragraphs and in the APPLICATION USAGE section, the standard developers elected to retain the _POSIX_VERSION and _SC_VERSION functionality.

### Compile-Time Symbolic Constants for System-Wide Options
POSIX.1‐2008 includes support in certain areas for the newly adopted policy governing options and stubs.

This policy provides flexibility for implementations in how they support options. It also specifies how conforming applications can adapt to different implementations that support different sets of options. It allows the following:

1.

If an implementation has no interest in supporting an option, it does not have to provide anything associated with that option beyond the announcement that it does not support it.

2.

An implementation can support a partial or incompatible version of an option (as a non-standard extension) as long as it does not claim to support the option.

3.

An application can determine whether the option is supported. A strictly conforming application must check this announcement mechanism before first using anything associated with the option.

There is an important implication of this policy. POSIX.1‐2008 cannot dictate the behavior of interfaces associated with an option when the implementation does not claim to support the option. In particular, it cannot require that a function associated with an unsupported option will fail if it does not perform as specified. However, this policy does not prevent a standard from requiring certain functions to always be present, but that they shall always fail on some implementations. The setpgid() function in the POSIX.1‐1990 standard, for example, is considered appropriate.

The POSIX standards include various options, and the C-language binding support for an option implies that the implementation must supply data types and function interfaces. An application must be able to discover whether the implementation supports each option.

Any application must consider the following three cases for each option:

1.

Option never supported.

The implementation advertises at compile time that the option will never be supported. In this case, it is not necessary for the implementation to supply any of the data types or function interfaces that are provided only as part of the option. The implementation might provide data types and functions that are similar to those defined by POSIX.1‐2008, but there is no guarantee for any particular behavior.

2.

Option always supported.

The implementation advertises at compile time that the option will always be supported. In this case, all data types and function interfaces shall be available and shall operate as specified.

3.

Option might or might not be supported.

Some implementations might not provide a mechanism to specify support of options at compile time. In addition, the implementation might be unable or unwilling to specify support or non-support at compile time. In either case, any application that might use the option at runtime must be able to compile and execute. The implementation must provide, at compile time, all data types and function interfaces that are necessary to allow this. In this situation, there must be a mechanism that allows the application to query, at runtime, whether the option is supported. If the application attempts to use the option when it is not supported, the result is unspecified unless explicitly specified otherwise in POSIX.1‐2008.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<limits.h>, <stddef.h>, <stdint.h>, <stdio.h>, <sys_socket.h>, <sys_types.h>, <termios.h>, <wctype.h>

The System Interfaces volume of POSIX.1‐2017, access(), alarm(), chown(), close(), confstr(), crypt(), ctermid(), dup(), _Exit(), encrypt(), exec, fchdir(), fchown(), fdatasync(), fork(), fpathconf(), fsync(), ftruncate(), getcwd(), getegid(), geteuid(), getgid(), getgroups(), gethostid(), gethostname(), getlogin(), getopt(), getpgid(), getpgrp(), getpid(), getppid(), getsid(), getuid(), isatty(), lchown(), link(), lockf(), lseek(), nice(), pause(), pipe(), read(), readlink(), rmdir(), setegid(), seteuid(), setgid(), setpgid(), setpgrp(), setregid(), setreuid(), setsid(), setuid(), sleep(), swab(), symlink(), sync(), sysconf(), tcgetpgrp(), tcsetpgrp(), truncate(), ttyname(), unlink(), write()

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


utime.h

package: man-pages-posix-devel

title: utime.h(7p)

text:
# utime.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
utime.h — access and modification times structure

## SYNOPSIS

```
#include <utime.h>
```

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

```
time_t    actime    Access time.
time_t    modtime   Modification time.
```

The times shall be measured in seconds since the Epoch.

The <utime.h> header shall define the time_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.

```
int utime(const char *, const struct utimbuf *);
```

The following sections are informative.

## APPLICATION USAGE
The utime() function only allows setting file timestamps to the nearest second. Applications should use the utimensat() function instead. See <sys/stat.h>.

## RATIONALE
None.

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

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

The System Interfaces volume of POSIX.1‐2017, futimens(), 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 .


utmpx.h

title: utmpx.h(7p)

text:
# utmpx.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
utmpx.h — user accounting database definitions

## SYNOPSIS

```
#include <utmpx.h>
```

## DESCRIPTION
The <utmpx.h> header shall define the utmpx structure that shall include at least the following members:

```
char            ut_user[]  User login name.
char            ut_id[]    Unspecified initialization process identifier.
char            ut_line[]  Device name.
pid_t           ut_pid     Process ID.
short           ut_type    Type of entry.
struct timeval  ut_tv      Time entry was made.
```

The <utmpx.h> header shall define the pid_t type through typedef, as described in <sys/types.h>.

The <utmpx.h> header shall define the timeval structure as described in <sys/time.h>.

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

The <utmpx.h> header shall define the following symbolic constants as possible values for the ut_type member of the utmpx structure:

EMPTY

No valid user accounting information.

BOOT_TIME

Identifies time of system boot.

OLD_TIME

Identifies time when system clock changed.

NEW_TIME

Identifies time after system clock changed.

USER_PROCESS

Identifies a process.

INIT_PROCESS

Identifies a process spawned by the init process.

LOGIN_PROCESS

Identifies the session leader of a logged-in user.

DEAD_PROCESS

Identifies a session leader who has exited.

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

```
void          endutxent(void);
struct utmpx *getutxent(void);
struct utmpx *getutxid(const struct utmpx *);
struct utmpx *getutxline(const struct utmpx *);
struct utmpx *pututxline(const struct utmpx *);
void          setutxent(void);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

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

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

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


wchar.h

title: wchar.h(7p)

text:
# wchar.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
wchar.h — wide-character handling

## SYNOPSIS

```
#include <wchar.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 <wchar.h> header shall define the following types:

FILE

As described in <stdio.h>.

locale_t

As described in <locale.h>.

mbstate_t

An object type other than an array type that can hold the conversion state information necessary to convert between sequences of (possibly multi-byte) characters and wide characters. If a codeset is being used such that an mbstate_t needs to preserve more than two levels of reserved state, the results are unspecified.

size_t

As described in <stddef.h>.

va_list

As described in <stdarg.h>.

wchar_t

As described in <stddef.h>.

wctype_t

A scalar type of a data object that can hold values which represent locale-specific character classification.

wint_t

An integer type capable of storing any valid value of wchar_t or WEOF.

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

The implementation shall support one or more programming environments in which the width of wint_t is 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 <wchar.h> header shall define the following macros:

WCHAR_MAX

As described in <stdint.h>.

WCHAR_MIN

As described in <stdint.h>.

WEOF

Constant expression of type wint_t that is returned by several WP functions to indicate end-of-file.

NULL

As described in <stddef.h>.

Inclusion of the <wchar.h> header may make visible all symbols from the headers <ctype.h>, <string.h>, <stdarg.h>, <stddef.h>, <stdio.h>, <stdlib.h>, and <time.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided for use with ISO C standard compilers. Arguments to functions in this list can point to arrays containing wchar_t values that do not correspond to members of the character set of the current locale. Such values shall be processed according to the specified semantics, unless otherwise stated.

```
wint_t        btowc(int);
wint_t        fgetwc(FILE *);
wchar_t      *fgetws(wchar_t *restrict, int, FILE *restrict);
wint_t        fputwc(wchar_t, FILE *);
int           fputws(const wchar_t *restrict, FILE *restrict);
int           fwide(FILE *, int);
int           fwprintf(FILE *restrict, const wchar_t *restrict, ...);
int           fwscanf(FILE *restrict, const wchar_t *restrict, ...);
wint_t        getwc(FILE *);
wint_t        getwchar(void);
int           iswalnum(wint_t);
int           iswalpha(wint_t);
int           iswcntrl(wint_t);
int           iswctype(wint_t, wctype_t);
int           iswdigit(wint_t);
int           iswgraph(wint_t);
int           iswlower(wint_t);
int           iswprint(wint_t);
int           iswpunct(wint_t);
int           iswspace(wint_t);
int           iswupper(wint_t);
int           iswxdigit(wint_t);
size_t        mbrlen(const char *restrict, size_t, mbstate_t *restrict);
size_t        mbrtowc(wchar_t *restrict, const char *restrict, size_t,

                  mbstate_t *restrict);
int           mbsinit(const mbstate_t *);
size_t        mbsnrtowcs(wchar_t *restrict, const char **restrict,

                  size_t, size_t, mbstate_t *restrict);
size_t        mbsrtowcs(wchar_t *restrict, const char **restrict, size_t,

                  mbstate_t *restrict);
FILE         *open_wmemstream(wchar_t **, size_t *);
wint_t        putwc(wchar_t, FILE *);
wint_t        putwchar(wchar_t);
int           swprintf(wchar_t *restrict, size_t,

                  const wchar_t *restrict, ...);
int           swscanf(const wchar_t *restrict,

                  const wchar_t *restrict, ...);
wint_t        towlower(wint_t);
wint_t        towupper(wint_t);
wint_t        ungetwc(wint_t, FILE *);
int           vfwprintf(FILE *restrict, const wchar_t *restrict, va_list);
int           vfwscanf(FILE *restrict, const wchar_t *restrict, va_list);
int           vswprintf(wchar_t *restrict, size_t,

                  const wchar_t *restrict, va_list);
int           vswscanf(const wchar_t *restrict, const wchar_t *restrict,

                  va_list);
int           vwprintf(const wchar_t *restrict, va_list);
int           vwscanf(const wchar_t *restrict, va_list);
wchar_t      *wcpcpy(wchar_t *restrict, const wchar_t *restrict);
wchar_t      *wcpncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
size_t        wcrtomb(char *restrict, wchar_t, mbstate_t *restrict);
int           wcscasecmp(const wchar_t *, const wchar_t *);
int           wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
wchar_t      *wcscat(wchar_t *restrict, const wchar_t *restrict);
wchar_t      *wcschr(const wchar_t *, wchar_t);
int           wcscmp(const wchar_t *, const wchar_t *);
int           wcscoll(const wchar_t *, const wchar_t *);
int           wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
wchar_t      *wcscpy(wchar_t *restrict, const wchar_t *restrict);
size_t        wcscspn(const wchar_t *, const wchar_t *);
wchar_t      *wcsdup(const wchar_t *);
size_t        wcsftime(wchar_t *restrict, size_t,

                  const wchar_t *restrict, const struct tm *restrict);
size_t        wcslen(const wchar_t *);
int           wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
int           wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t,

                  locale_t);
wchar_t      *wcsncat(wchar_t *restrict, const wchar_t *restrict, size_t);
int           wcsncmp(const wchar_t *, const wchar_t *, size_t);
wchar_t      *wcsncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
size_t        wcsnlen(const wchar_t *, size_t);
size_t        wcsnrtombs(char *restrict, const wchar_t **restrict, size_t,

                  size_t, mbstate_t *restrict);
wchar_t      *wcspbrk(const wchar_t *, const wchar_t *);
wchar_t      *wcsrchr(const wchar_t *, wchar_t);
size_t        wcsrtombs(char *restrict, const wchar_t **restrict,

                  size_t, mbstate_t *restrict);
size_t        wcsspn(const wchar_t *, const wchar_t *);
wchar_t      *wcsstr(const wchar_t *restrict, const wchar_t *restrict);
double        wcstod(const wchar_t *restrict, wchar_t **restrict);
float         wcstof(const wchar_t *restrict, wchar_t **restrict);
wchar_t      *wcstok(wchar_t *restrict, const wchar_t *restrict,

                  wchar_t **restrict);
long          wcstol(const wchar_t *restrict, wchar_t **restrict, int);
long double   wcstold(const wchar_t *restrict, wchar_t **restrict);
long long     wcstoll(const wchar_t *restrict, wchar_t **restrict, int);
unsigned long wcstoul(const wchar_t *restrict, wchar_t **restrict, int);
unsigned long long

              wcstoull(const wchar_t *restrict, wchar_t **restrict, int);
int           wcswidth(const wchar_t *, size_t);
size_t        wcsxfrm(wchar_t *restrict, const wchar_t *restrict, size_t);
size_t        wcsxfrm_l(wchar_t *restrict, const wchar_t *restrict,

                  size_t, locale_t);
int           wctob(wint_t);
wctype_t      wctype(const char *);
int           wcwidth(wchar_t);
wchar_t      *wmemchr(const wchar_t *, wchar_t, size_t);
int           wmemcmp(const wchar_t *, const wchar_t *, size_t);
wchar_t      *wmemcpy(wchar_t *restrict, const wchar_t *restrict, size_t);
wchar_t      *wmemmove(wchar_t *, const wchar_t *, size_t);
wchar_t      *wmemset(wchar_t *, wchar_t, size_t);
int           wprintf(const wchar_t *restrict, ...);
int           wscanf(const wchar_t *restrict, ...);
```

The following sections are informative.

## APPLICATION USAGE
The iswblank() function was a late addition to the ISO C standard and was introduced at the same time as the ISO C standard introduced <wctype.h>, which contains all of the isw*() functions. The Open Group Base Specifications had previously aligned with the MSE working draft and had introduced the rest of the isw*() functions into <wchar.h>. For backwards-compatibility, the original set of isw*() functions, without iswblank(), are permitted (as part of the XSI option) in <wchar.h>. For maximum portability, applications should include <wctype.h> in order to obtain declarations for the isw*() functions. This compatibility has been made obsolescent.

## RATIONALE
In the ISO C standard, the symbols referenced as XSI extensions are in <wctype.h>. Their presence here is thus an extension.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<ctype.h>, <locale.h>, <stdarg.h>, <stddef.h>, <stdint.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wctype.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment, btowc(), confstr(), fgetwc(), fgetws(), fputwc(), fputws(), fwide(), fwprintf(), fwscanf(), getwc(), getwchar(), iswalnum(), iswalpha(), iswcntrl(), iswctype(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswpunct(), iswspace(), iswupper(), iswxdigit(), mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(), open_memstream(), putwc(), putwchar(), towlower(), towupper(), ungetwc(), vfwprintf(), vfwscanf(), wcrtomb(), wcscasecmp(), wcscat(), wcschr(), wcscmp(), wcscoll(), wcscpy(), wcscspn(), wcsdup(), wcsftime(), wcslen(), wcsncat(), wcsncmp(), wcsncpy(), wcspbrk(), wcsrchr(), wcsrtombs(), wcsspn(), wcsstr(), wcstod(), wcstok(), wcstol(), wcstoul(), wcswidth(), wcsxfrm(), wctob(), wctype(), wcwidth(), wmemchr(), wmemcmp(), wmemcpy(), wmemmove(), wmemset()

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 .


wctype.h

title: wctype.h(7p)

text:
# wctype.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
wctype.h — wide-character classification and mapping utilities

## SYNOPSIS

```
#include <wctype.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 <wctype.h> header shall define the following types:

wint_t

As described in <wchar.h>.

wctrans_t

A scalar type that can hold values which represent locale-specific character mappings.

wctype_t

As described in <wchar.h>.

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

The <wctype.h> header shall define the following macro:

WEOF

As described in <wchar.h>.

For all functions described in this header that accept an argument of type wint_t, the value is representable as a wchar_t or equals the value of WEOF. If this argument has any other value, the behavior is undefined.

The behavior of these functions shall be affected by the LC_CTYPE category of the current locale.

Inclusion of the <wctype.h> header may make visible all symbols from the headers <ctype.h>, <stdarg.h>, <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, and <wchar.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided for use with ISO C standard compilers.

```
int       iswalnum(wint_t);
int       iswalnum_l(wint_t, locale_t);
int       iswalpha(wint_t);
int       iswalpha_l(wint_t, locale_t);
int       iswblank(wint_t);
int       iswblank_l(wint_t, locale_t);
int       iswcntrl(wint_t);
int       iswcntrl_l(wint_t, locale_t);
int       iswctype(wint_t, wctype_t);
int       iswctype_l(wint_t, wctype_t, locale_t);
int       iswdigit(wint_t);
int       iswdigit_l(wint_t, locale_t);
int       iswgraph(wint_t);
int       iswgraph_l(wint_t, locale_t);
int       iswlower(wint_t);
int       iswlower_l(wint_t, locale_t);
int       iswprint(wint_t);
int       iswprint_l(wint_t, locale_t);
int       iswpunct(wint_t);
int       iswpunct_l(wint_t, locale_t);
int       iswspace(wint_t);
int       iswspace_l(wint_t, locale_t);
int       iswupper(wint_t);
int       iswupper_l(wint_t, locale_t);
int       iswxdigit(wint_t);
int       iswxdigit_l(wint_t, locale_t);
wint_t    towctrans(wint_t, wctrans_t);
wint_t    towctrans_l(wint_t, wctrans_t, locale_t);
wint_t    towlower(wint_t);
wint_t    towlower_l(wint_t, locale_t);
wint_t    towupper(wint_t);
wint_t    towupper_l(wint_t, locale_t);
wctrans_t wctrans(const char *);
wctrans_t wctrans_l(const char *, locale_t);
wctype_t  wctype(const char *);
wctype_t  wctype_l(const char *, locale_t);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<ctype.h>, <locale.h>, <stdarg.h>, <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wchar.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.2, The Compilation Environment, iswalnum(), iswalpha(), iswblank(), iswcntrl(), iswctype(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswpunct(), iswspace(), iswupper(), iswxdigit(), setlocale(), towctrans(), towlower(), towupper(), wctrans(), wctype()

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


wordexp.h

title: wordexp.h(7p)

text:
# wordexp.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
wordexp.h — word-expansion types

## SYNOPSIS

```
#include <wordexp.h>
```

## DESCRIPTION
The <wordexp.h> header shall define the structures and symbolic constants used by the wordexp() and wordfree() functions.

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

```
size_t   we_wordc  Count of words matched by words.
char   **we_wordv  Pointer to list of expanded words.
size_t   we_offs   Slots to reserve at the beginning of we_wordv.
```

The <wordexp.h> header shall define the following symbolic constants for use as flags for the wordexp() function:

WRDE_APPEND

Append words to those previously generated.

WRDE_DOOFFS

Number of null pointers to prepend to we_wordv.

WRDE_NOCMD

Fail if command substitution is requested.

WRDE_REUSE

The pwordexp argument was passed to a previous successful call to wordexp(), and has not been passed to wordfree(). The result is the same as if the application had called wordfree() and then called wordexp() without WRDE_REUSE.

WRDE_SHOWERR

Do not redirect stderr to /dev/null.

WRDE_UNDEF

Report error on an attempt to expand an undefined shell variable.

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

WRDE_BADCHAR

One of the unquoted characters—<newline>, '|', '&', ';', '<', '>', '(', ')', '{', '}'—appears in words in an inappropriate context.

WRDE_BADVAL

Reference to undefined shell variable when WRDE_UNDEF is set in flags.

WRDE_CMDSUB

Command substitution requested when WRDE_NOCMD was set in flags.

WRDE_NOSPACE

Attempt to allocate memory failed.

WRDE_SYNTAX

Shell syntax error, such as unbalanced parentheses or unterminated string.

The <wordexp.h> header shall define the size_t type as described in <stddef.h>.

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

```
int  wordexp(const char *restrict, wordexp_t *restrict, int);
void wordfree(wordexp_t *);
```

The following sections are informative.

## APPLICATION USAGE
None.

## RATIONALE
None.

## FUTURE DIRECTIONS
None.

## SEE ALSO
<stddef.h>

The System Interfaces volume of POSIX.1‐2017, Section 2.6, Word Expansions

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

title: mandoc_char(7)

summary: mandoc special characters

text:
# mandoc_char(7)

## NAME
mandoc_char — mandoc special characters

## DESCRIPTION
This page documents the roff(7) escape sequences accepted by mandoc(1) to represent special characters in mdoc(7) and man(7) documents.

The rendering depends on the mandoc(1) output mode; it can be inspected by calling man(1) on the mandoc_char manual page with different -T arguments. In ASCII output, the rendering of some characters may be hard to interpret for the reader. Many are rendered as descriptive strings like "<integral>", "<degree>", or "<Gamma>", which may look ugly, and many are replaced by similar ASCII characters. In particular, accented characters are usually shown without the accent. For that reason, try to avoid using any of the special characters documented here except those discussed in the DESCRIPTION, unless they are essential for explaining the subject matter at hand, for example when documenting complicated mathematical functions.

In particular, in English manual pages, do not use special-character escape sequences to represent national language characters in author names; instead, provide ASCII transcriptions of the names.

### Dashes and Hyphens
In typography there are different types of dashes of various width: the hyphen (‐), the en-dash (–), the em-dash (—), and the mathematical minus sign (−).

Hyphens are used for adjectives; to separate the two parts of a compound word; or to separate a word across two successive lines of text. The hyphen does not need to be escaped:

```
blue-eyed
lorry-driver
```

The en-dash is used to separate the two elements of a range, or can be used the same way as an em-dash. It should be written as ‘\(en’:

```
pp. 95\(en97.
Go away \(en or else!
```

The em-dash can be used to show an interruption or can be used the same way as colons, semi-colons, or parentheses. It should be written as ‘\(em’:

```
Three things \(em apples, oranges, and bananas.
This is not that \(em rather, this is that.
```

In roff(7) documents, the minus sign is normally written as ‘\-’. In manual pages, some style guides recommend to also use ‘\-’ if an ASCII 0x2d “hyphen-minus” output glyph that can be copied and pasted is desired in output modes supporting it, for example in -T utf8 and -T html. But currently, no practically relevant manual page formatter requires that subtlety, so in manual pages, it is sufficient to write plain ‘-’ to represent hyphen, minus, and hyphen-minus.

If a word on a text input line contains a hyphen, a formatter may decide to insert an output line break after the hyphen if that helps filling the current output line, but the whole word would overflow the line. If it is important that the word is not broken across lines in this way, a zero-width space (‘\&’) can be inserted before or after the hyphen. While mandoc(1) never breaks the output line after hyphens adjacent to a zero-width space, after any of the other dash- or hyphen-like characters represented by escape sequences, or after hyphens inside words in macro arguments, other software may not respect these rules and may break the line even in such cases.

Some roff(7) implementations contains dictionaries allowing to break the line at syllable boundaries even inside words that contain no hyphens. Such automatic hyphenation is not supported by mandoc(1), which only breaks the line at whitespace, and inside words only after existing hyphens.

### Spaces
To separate words in normal text, for indenting and alignment in literal context, and when none of the following special cases apply, just use the normal space character (‘ ’).

When filling text, output lines may be broken between words, i.e. at space characters. To prevent a line break between two particular words, use the unpaddable non-breaking space escape sequence (‘\ ’) instead of the normal space character. For example, the input string “number\ 1” will be kept together as “number 1” on the same output line.

On request and macro lines, the normal space character serves as an argument delimiter. To include whitespace into arguments, quoting is usually the best choice; see the MACRO SYNTAX section in roff(7). In some cases, using the non-breaking space escape sequence (‘\ ’) may be preferable.

To escape macro names and to protect whitespace at the end of input lines, the zero-width space (‘\&’) is often useful. For example, in mdoc(7), a normal space character can be displayed in single quotes in either of the following ways:

.Sq " "

.Sq \ \&

### Quotes
On request and macro lines, the double-quote character (‘"’) is handled specially to allow quoting. One way to prevent this special handling is by using the ‘\(dq’ escape sequence.

Note that on text lines, literal double-quote characters can be used verbatim. All other quote-like characters can be used verbatim as well, even on request and macro lines.

### Accents
In output modes supporting such special output characters, for example -T pdf, and sometimes less consistently in -T utf8, some roff(7) formatters convert the following ASCII input characters to the following Unicode special output characters:

`

U+2018

left single quotation mark

'

U+2019

right single quotation mark

~

U+02DC

small tilde

^

U+02C6

modifier letter circumflex

In prose, this automatic substitution is often desirable; but when these characters have to be displayed as plain ASCII characters, for example in source code samples, they require escaping to render as follows:

\(ga

U+0060

grave accent

\(aq

U+0027

apostrophe

\(ti

U+007E

tilde

\(ha

U+005E

circumflex accent

### Periods
The period (‘.’) is handled specially at the beginning of an input line, where it introduces a roff(7) request or a macro, and when appearing alone as a macro argument in mdoc(7). In such situations, prepend a zero-width space (‘\&.’) to make it behave like normal text.

Do not use the ‘\.’ escape sequence. It does not prevent special handling of the period.

### Backslashes
To include a literal backslash (‘\’) into the output, use the (‘\e’) escape sequence.

Note that doubling it (‘\\’) is not the right way to output a backslash. Because mandoc(1) does not implement full roff(7) functionality, it may work with mandoc(1), but it may have weird effects on complete roff(7) implementations.

## SPECIAL CHARACTERS
Special characters are encoded as ‘\X’ (for a one-character escape), ‘\(XX’ (two-character), and ‘\[N]’ (N-character). For details, see the Special Characters subsection of the roff(7) manual.

Spaces, non-breaking unless stated otherwise:

Input

Description

‘\ ’

unpaddable space

\~

paddable space

\0

digit-width space

\|

one-sixth \(em narrow space, zero width in nroff mode

\^

one-twelfth \(em half-narrow space, zero width in nroff

\&

zero-width space

\)

zero-width space transparent to end-of-sentence detection

\%

zero-width space allowing hyphenation

\:

zero-width space allowing line break

Lines:

Input

Rendered

Description

\(ba

|

bar

\(br

│

box rule

\(ul

_

underscore

\(ru

_

underscore (width 0.5m)

\(rn

‾

overline

\(bb

¦

broken bar

\(sl

/

forward slash

\(rs

\

backward slash

Text markers:

Input

Rendered

Description

\(ci

○

circle

\(bu

•

bullet

\(dd

‡

double dagger

\(dg

†

dagger

\(lz

◊

lozenge

\(sq

□

white square

\(ps

¶

paragraph

\(sc

§

section

\(lh

☜

left hand

\(rh

☞

right hand

\(at

@

at

\(sh

\#

hash (pound)

\(CR

↵

carriage return

\(OK

✓

check mark

\(CL

♣

club suit

\(SP

♠

spade suit

\(HE

♥

heart suit

\(DI

♦

diamond suit

Legal symbols:

Input

Rendered

Description

\(co

©

copyright

\(rg

®

registered

\(tm

™

trademarked

Punctuation:

Input

Rendered

Description

\(em

—

em-dash

\(en

–

en-dash

\(hy

‐

hyphen

\e

\

back-slash

\.

.

period

\(r!

¡

upside-down exclamation

\(r?

¿

upside-down question

Quotes:

Input

Rendered

Description

\(Bq

„

right low double-quote

\(bq

‚

right low single-quote

\(lq

“

left double-quote

\(rq

”

right double-quote

\(oq

‘

left single-quote

\(cq

’

right single-quote

\(aq

'

apostrophe quote (ASCII character)

\(dq

"

double quote (ASCII character)

\(Fo

«

left guillemet

\(Fc

»

right guillemet

\(fo

‹

left single guillemet

\(fc

›

right single guillemet

Brackets:

Input

Rendered

Description

\(lB

[

left bracket

\(rB

]

right bracket

\(lC

{

left brace

\(rC

}

right brace

\(la

⟨

left angle

\(ra

⟩

right angle

\(bv

⎪

brace extension (special font)

\[braceex]

⎪

brace extension

\[bracketlefttp]

⎡

top-left hooked bracket

\[bracketleftbt]

⎣

bottom-left hooked bracket

\[bracketleftex]

⎢

left hooked bracket extension

\[bracketrighttp]

⎤

top-right hooked bracket

\[bracketrightbt]

⎦

bottom-right hooked bracket

\[bracketrightex]

⎥

right hooked bracket extension

\(lt

⎧

top-left hooked brace

\[bracelefttp]

⎧

top-left hooked brace

\(lk

⎨

mid-left hooked brace

\[braceleftmid]

⎨

mid-left hooked brace

\(lb

⎩

bottom-left hooked brace

\[braceleftbt]

⎩

bottom-left hooked brace

\[braceleftex]

⎪

left hooked brace extension

\(rt

⎫

top-left hooked brace

\[bracerighttp]

⎫

top-right hooked brace

\(rk

⎬

mid-right hooked brace

\[bracerightmid]

⎬

mid-right hooked brace

\(rb

⎭

bottom-right hooked brace

\[bracerightbt]

⎭

bottom-right hooked brace

\[bracerightex]

⎪

right hooked brace extension

\[parenlefttp]

⎛

top-left hooked parenthesis

\[parenleftbt]

⎝

bottom-left hooked parenthesis

\[parenleftex]

⎜

left hooked parenthesis extension

\[parenrighttp]

⎞

top-right hooked parenthesis

\[parenrightbt]

⎠

bottom-right hooked parenthesis

\[parenrightex]

⎟

right hooked parenthesis extension

Arrows:

Input

Rendered

Description

\(<-

←

left arrow

\(->

→

right arrow

\(<>

↔

left-right arrow

\(da

↓

down arrow

\(ua

↑

up arrow

\(va

↕

up-down arrow

\(lA

⇐

left double-arrow

\(rA

⇒

right double-arrow

\(hA

⇔

left-right double-arrow

\(uA

⇑

up double-arrow

\(dA

⇓

down double-arrow

\(vA

⇕

up-down double-arrow

\(an

⎯

horizontal arrow extension

Logical:

Input

Rendered

Description

\(AN

∧

logical and

\(OR

∨

logical or

\[tno]

¬

logical not (text font)

\(no

¬

logical not (special font)

\(te

∃

existential quantifier

\(fa

∀

universal quantifier

\(st

∋

such that

\(tf

∴

therefore

\(3d

∴

therefore

\(or

|

bitwise or

Mathematical:

Input

Rendered

Description

\-

-

minus (text font)

\(mi

−

minus (special font)

+

+

plus (text font)

\(pl

+

plus (special font)

\(-+

∓

minus-plus

\[t+-]

±

plus-minus (text font)

\(+-

±

plus-minus (special font)

\(pc

·

center-dot

\[tmu]

×

multiply (text font)

\(mu

×

multiply (special font)

\(c*

⊗

circle-multiply

\(c+

⊕

circle-plus

\[tdi]

÷

divide (text font)

\(di

÷

divide (special font)

\(f/

⁄

fraction

\(**

∗

asterisk

\(<=

≤

less-than-equal

\(>=

≥

greater-than-equal

\(<<

≪

much less

\(>>

≫

much greater

\(eq

=

equal

\(!=

≠

not equal

\(==

≡

equivalent

\(ne

≢

not equivalent

\(ap

∼

tilde operator

\(|=

≃

asymptotically equal

\(=~

≅

approximately equal

\(~~

≈

almost equal

\(~=

≈

almost equal

\(pt

∝

proportionate

\(es

∅

empty set

\(mo

∈

element

\(nm

∉

not element

\(sb

⊂

proper subset

\(nb

⊄

not subset

\(sp

⊃

proper superset

\(nc

⊅

not superset

\(ib

⊆

reflexive subset

\(ip

⊇

reflexive superset

\(ca

∩

intersection

\(cu

∪

union

\(/_

∠

angle

\(pp

⊥

perpendicular

\(is

∫

integral

\[integral]

∫

integral

\[sum]

∑

summation

\[product]

∏

product

\[coproduct]

∐

coproduct

\(gr

∇

gradient

\(sr

√

square root

\[sqrt]

√

square root

\(lc

⌈

left-ceiling

\(rc

⌉

right-ceiling

\(lf

⌊

left-floor

\(rf

⌋

right-floor

\(if

∞

infinity

\(Ah

ℵ

aleph

\(Im

ℑ

imaginary

\(Re

ℜ

real

\(wp

℘

Weierstrass p

\(pd

∂

partial differential

\(-h

ℏ

Planck constant over 2π

\[hbar]

ℏ

Planck constant over 2π

\(12

½

one-half

\(14

¼

one-fourth

\(34

¾

three-fourths

\(18

⅛

one-eighth

\(38

⅜

three-eighths

\(58

⅝

five-eighths

\(78

⅞

seven-eighths

\(S1

¹

superscript 1

\(S2

²

superscript 2

\(S3

³

superscript 3

Ligatures:

Input

Rendered

Description

\(ff

ﬀ

ff ligature

\(fi

ﬁ

fi ligature

\(fl

ﬂ

fl ligature

\(Fi

ﬃ

ffi ligature

\(Fl

ﬄ

ffl ligature

\(AE

Æ

AE

\(ae

æ

ae

\(OE

Œ

OE

\(oe

œ

oe

\(ss

ß

German eszett

\(IJ

Ĳ

IJ ligature

\(ij

ĳ

ij ligature

Accents:

Input

Rendered

Description

\(a"

˝

Hungarian umlaut

\(a-

¯

macron

\(a.

˙

dotted

\(a^

^

circumflex

\(aa

´

acute

\'

´

acute

\(ga

`

grave

\`

`

grave

\(ab

˘

breve

\(ac

¸

cedilla

\(ad

¨

dieresis

\(ah

ˇ

caron

\(ao

˚

ring

\(a~

~

tilde

\(ho

˛

ogonek

\(ha

^

hat (ASCII character)

\(ti

~

tilde (ASCII character)

Accented letters:

Input

Rendered

Description

\('A

Á

acute A

\('E

É

acute E

\('I

Í

acute I

\('O

Ó

acute O

\('U

Ú

acute U

\('Y

Ý

acute Y

\('a

á

acute a

\('e

é

acute e

\('i

í

acute i

\('o

ó

acute o

\('u

ú

acute u

\('y

ý

acute y

\(`A

À

grave A

\(`E

È

grave E

\(`I

Ì

grave I

\(`O

Ò

grave O

\(`U

Ù

grave U

\(`a

à

grave a

\(`e

è

grave e

\(`i

ì

grave i

\(`o

ì

grave o

\(`u

ù

grave u

\(~A

Ã

tilde A

\(~N

Ñ

tilde N

\(~O

Õ

tilde O

\(~a

ã

tilde a

\(~n

ñ

tilde n

\(~o

õ

tilde o

\(:A

Ä

dieresis A

\(:E

Ë

dieresis E

\(:I

Ï

dieresis I

\(:O

Ö

dieresis O

\(:U

Ü

dieresis U

\(:a

ä

dieresis a

\(:e

ë

dieresis e

\(:i

ï

dieresis i

\(:o

ö

dieresis o

\(:u

ü

dieresis u

\(:y

ÿ

dieresis y

\(^A

Â

circumflex A

\(^E

Ê

circumflex E

\(^I

Î

circumflex I

\(^O

Ô

circumflex O

\(^U

Û

circumflex U

\(^a

â

circumflex a

\(^e

ê

circumflex e

\(^i

î

circumflex i

\(^o

ô

circumflex o

\(^u

û

circumflex u

\(,C

Ç

cedilla C

\(,c

ç

cedilla c

\(/L

Ł

stroke L

\(/l

ł

stroke l

\(/O

Ø

stroke O

\(/o

ø

stroke o

\(oA

Å

ring A

\(oa

å

ring a

Special letters:

Input

Rendered

Description

\(-D

Ð

Eth

\(Sd

ð

eth

\(TP

Þ

Thorn

\(Tp

þ

thorn

\(.i

ı

dotless i

\(.j

ȷ

dotless j

Currency:

Input

Rendered

Description

\(Do

$

dollar

\(ct

¢

cent

\(Eu

€

Euro symbol

\(eu

€

Euro symbol

\(Ye

¥

yen

\(Po

£

pound

\(Cs

¤

Scandinavian

\(Fn

ƒ

florin

Units:

Input

Rendered

Description

\(de

°

degree

\(%0

‰

per-thousand

\(fm

′

minute

\(sd

″

second

\(mc

µ

micro

\(Of

ª

Spanish female ordinal

\(Om

º

Spanish masculine ordinal

Greek letters:

Input

Rendered

Description

\(*A

Α

Alpha

\(*B

Β

Beta

\(*G

Γ

Gamma

\(*D

Δ

Delta

\(*E

Ε

Epsilon

\(*Z

Ζ

Zeta

\(*Y

Η

Eta

\(*H

Θ

Theta

\(*I

Ι

Iota

\(*K

Κ

Kappa

\(*L

Λ

Lambda

\(*M

Μ

Mu

\(*N

Ν

Nu

\(*C

Ξ

Xi

\(*O

Ο

Omicron

\(*P

Π

Pi

\(*R

Ρ

Rho

\(*S

Σ

Sigma

\(*T

Τ

Tau

\(*U

Υ

Upsilon

\(*F

Φ

Phi

\(*X

Χ

Chi

\(*Q

Ψ

Psi

\(*W

Ω

Omega

\(*a

α

alpha

\(*b

β

beta

\(*g

γ

gamma

\(*d

δ

delta

\(*e

ε

epsilon

\(*z

ζ

zeta

\(*y

η

eta

\(*h

θ

theta

\(*i

ι

iota

\(*k

κ

kappa

\(*l

λ

lambda

\(*m

μ

mu

\(*n

ν

nu

\(*c

ξ

xi

\(*o

ο

omicron

\(*p

π

pi

\(*r

ρ

rho

\(*s

σ

sigma

\(*t

τ

tau

\(*u

υ

upsilon

\(*f

ϕ

phi

\(*x

χ

chi

\(*q

ψ

psi

\(*w

ω

omega

\(+h

ϑ

theta variant

\(+f

φ

phi variant

\(+p

ϖ

pi variant

\(+e

ϵ

epsilon variant

\(ts

ς

sigma terminal

## PREDEFINED STRINGS
Predefined strings are inherited from the macro packages of historical troff implementations. They are not recommended for use, as they differ across implementations. Manuals using these predefined strings are almost certainly not portable.

Their syntax is similar to special characters, using ‘\*X’ (for a one-character escape), ‘\*(XX’ (two-character), and ‘\*[N]’ (N-character).

Input

Rendered

Description

\*(Ba

|

vertical bar

\*(Ne

≠

not equal

\*(Ge

≥

greater-than-equal

\*(Le

≤

less-than-equal

\*(Gt

>

greater-than

\*(Lt

<

less-than

\*(Pm

±

plus-minus

\*(If

infinity

infinity

\*(Pi

pi

pi

\*(Na

NaN

NaN

\*(Am

&

ampersand

\*R

®

restricted mark

\*(Tm

(Tm)

trade mark

\*q

"

double-quote

\*(Rq

”

right-double-quote

\*(Lq

“

left-double-quote

\*(lp

(

right-parenthesis

\*(rp

)

left-parenthesis

\*(lq

“

left double-quote

\*(rq

”

right double-quote

\*(ua

↑

up arrow

\*(va

↕

up-down arrow

\*(<=

≤

less-than-equal

\*(>=

≥

greater-than-equal

\*(aa

´

acute

\*(ga

`

grave

\*(Px

POSIX

POSIX standard name

\*(Ai

ANSI

ANSI standard name

## UNICODE CHARACTERS
The escape sequences

\[uXXXX] and \C'uXXXX'

are interpreted as Unicode codepoints. The codepoint must be in the range above U+0080 and less than U+10FFFF. For compatibility, the hexadecimal digits ‘A’ to ‘F’ must be given as uppercase characters, and points must be zero-padded to four characters; if greater than four characters, no zero padding is allowed. Unicode surrogates are not allowed.

## NUMBERED CHARACTERS
For backward compatibility with existing manuals, mandoc(1) also supports the

\N'number' and \[charnumber

] escape sequences, inserting the character number from the current character set into the output. Of course, this is inherently non-portable and is already marked as deprecated in the Heirloom roff manual; on top of that, the second form is a GNU extension. For example, do not use \N'34' or \[char34], use \(dq, or even the plain ‘"’ character where possible.

## COMPATIBILITY
This section documents compatibility between mandoc and other troff implementations, at this time limited to GNU troff ("groff").

- The \N'' escape sequence is limited to printable characters; in groff, it accepts arbitrary character numbers.

- In -Tascii, the \(ss, \(nm, \(nb, \(nc, \(ib, \(ip, \(pp, \[sum], \[product], \[coproduct], \(gr, \(-h, and \(a. special characters render differently between mandoc and groff.

- In -Thtml, the \(~=, \(nb, and \(nc special characters render differently between mandoc and groff.

- The -Tps and -Tpdf modes format like -Tascii instead of rendering glyphs as in groff.

- The \[radicalex], \[sqrtex], and \(ru special characters have been omitted from mandoc either because they are poorly documented or they have no known representation.

## SEE ALSO
mandoc(1), man(7), mdoc(7), roff(7)

## AUTHORS
The mandoc_char manual page was written by Kristaps Dzonsons <kristaps@bsd.lv>.

## CAVEATS
The predefined string ‘\*(Ba’ mimics the behaviour of the ‘|’ character in mdoc(7); thus, if you wish to render a vertical bar with no side effects, use the ‘\(ba’ escape.