{{Short description|C language standard library specifically for POSIX systems}} {{C POSIX library}} The '''C POSIX library''' is a specification of a C standard library for POSIX systems. It was developed at the same time as the ANSI C standard. Some effort was made to make POSIX compatible with standard C; POSIX includes additional functions to those introduced in standard C. On the other hand, the 5 headers that were added to the C standard library with C11, were not likewise included in subsequent revisions of POSIX.

It may be included in any C++ project, however the C++ standard library may have its own implementation of certain features, such as <code><regex></code> rather than <code><regex.h></code>, <code><thread></code> rather than <code><pthread.h></code>, or <code><semaphore></code> rather than <code><semaphore.h></code>.

==C POSIX library header files==

{| class="wikitable sortable" ! Header file!! Description !! First released !! C Standard |- |'''{{tag|aio.h|open}}''' || Asynchronous input and output || Issue 5 || |- |'''{{tag|arpa/inet.h|open}}'''|| Functions for manipulating numeric IP addresses (part of Berkeley sockets) || Issue 6 || |- |'''{{tag|assert.h|open}}'''|| Verify assumptions || Issue 1 || ANSI (89) |- |'''{{tag|complex.h|open}}'''|| Complex Arithmetic, see C mathematical functions || Issue 6 || C99 |- |'''{{tag|cpio.h|open}}''' || Magic numbers for the cpio archive format || Issue 3 || |- |'''{{tag|ctype.h|open}}''' |Character types |Issue 1 |ANSI (89) |- |'''{{tag|devctl.h|open}}''' || Device control || Issue 8 || |- |'''{{tag|dirent.h|open}}''' || Allows the opening and listing of directories || Issue 2 || |- |'''{{tag|dlfcn.h|open}}''' || Dynamic linking || Issue 5 || |- |'''{{tag|errno.h|open}}''' || Retrieving Error Number || Issue 1 || ANSI (89) |- |'''{{tag|endian.h|open}}''' || Endianness operations || Issue 8 || |- |'''{{tag|fcntl.h|open}}''' || File opening, locking and other operations || Issue 1 || |- |'''{{tag|fenv.h|open}}''' || Floating-Point Environment (FPE), see C mathematical functions || Issue 6 || C99 |- |'''{{tag|float.h|open}}''' || Floating-point types, see C data types || Issue 4 || ANSI (89) |- |'''{{tag|fmtmsg.h|open}}''' || Message display structures || Issue 4 || |- |'''{{tag|fnmatch.h|open}}''' || Filename matching || Issue 4 || |- |'''{{tag|ftw.h|open}}''' || File tree traversal || Issue 1 || |- |'''{{tag|glob.h|open}}''' || Pathname "globbing" (pattern-matching) || Issue 4 || |- |'''{{tag|grp.h|open}}''' || User group information and control || Issue 1 || |- |'''{{tag|iconv.h|open}}''' || Codeset conversion facility || Issue 4 || |- |'''{{tag|inttypes.h|open}}''' || Fixed sized integer types, see C data types || Issue 5 || C99 |- |'''{{tag|iso646.h|open}}''' || Alternative spellings, see C alternative tokens || Issue 5 || NA1 (95) |- |'''{{tag|langinfo.h|open}}''' || Language information constants – builds on C localization functions || Issue 2 || |- |'''{{tag|libgen.h|open}}''' || Pathname manipulation || Issue 4 || |- |'''{{tag|libintl.h|open}}''' || Internationalization || Issue 8 || |- |'''{{tag|limits.h|open}}''' || Implementation-defined constants, see C data types || Issue 1 || ANSI (89) |- |'''{{tag|locale.h|open}}''' || Category macros, see C localization functions || Issue 3 || ANSI (89) |- |'''{{tag|math.h|open}}''' || Mathematical declarations, see C mathematical functions || Issue 1 || ANSI (89) |- |'''{{tag|monetary.h|open}}''' || String formatting of monetary units || Issue 4 || |- |'''{{tag|mqueue.h|open}}''' || Message queue || Issue 5 || |- |'''{{tag|ndbm.h|open}}''' || NDBM database operations || Issue 4 || |- |'''{{tag|net/if.h|open}}''' || Listing of local network interfaces || Issue 6 || |- |'''{{tag|netdb.h|open}}''' || Translating protocol and host names into numeric addresses (part of Berkeley sockets) || Issue 6 || |- |'''{{tag|netinet/in.h|open}}''' || Defines Internet protocol and address family (part of Berkeley sockets) || Issue 6 |- |'''{{tag|netinet/tcp.h|open}}''' || Additional TCP control options (part of Berkeley sockets) || Issue 6 || |- |'''{{tag|nl_types.h|open}}''' || Localization message catalog functions || Issue 2 || |- |'''{{tag|poll.h|open}}''' || Asynchronous file descriptor multiplexing || Issue 4 || |- |'''{{tag|pthread.h|open}}''' || Defines an API for creating and manipulating POSIX threads || Issue 5 || |- |'''{{tag|pwd.h|open}}''' || passwd (user information) access and control || Issue 1 || |- |{{anchor|regex|regex.h}}'''{{tag|regex.h|open}}''' || Regular expression matching || Issue 4 || |- |'''{{tag|sched.h|open}}''' || Execution scheduling || Issue 5 || |- |'''{{tag|search.h|open}}''' || Search tables || Issue 1 || |- |'''{{tag|semaphore.h|open}}'''|| POSIX semaphores || Issue 5 || |- |'''{{tag|setjmp.h|open}}'''|| Stack environment declarations || Issue 1 || ANSI (89) |- |'''{{tag|signal.h|open}}'''|| Signals, see C signal handling || Issue 1 || ANSI (89) |- |'''{{tag|spawn.h|open}}'''|| Process spawning || Issue 6 || |- |'''{{tag|stdalign.h|open}}'''|| Alignment macros || Issue 8 || C11 |- |'''{{tag|stdarg.h|open}}'''|| Handle Variable Argument List || Issue 4 || ANSI (89) |- |'''{{tag|stdatomic.h|open}}'''|| Atomic operations || Issue 8 || C11 |- |'''{{tag|stdbool.h|open}}'''|| Boolean type and values, see C data types || Issue 6 || C99 |- |'''{{tag|stddef.h|open}}'''|| Standard type definitions, see C data types || Issue 4 || ANSI (89) |- |'''{{tag|stdint.h|open}}'''|| Integer types, see C data types || Issue 6 || C99 |- |'''{{tag|stdio.h|open}}'''|| Standard buffered input/output, see C file input/output || Issue 1 || ANSI (89) |- |'''{{tag|stdlib.h|open}}'''|| Standard library definitions, see C standard library || Issue 3 || ANSI (89) |- |'''{{tag|stdnoreturn.h|open}}'''|| The <code>noreturn</code> macro || Issue 8 || C11 |- |'''{{tag|string.h|open}}'''|| Several String Operations, see C string handling || Issue 1 || ANSI (89) |- |'''{{tag|strings.h|open}}'''|| Case-insensitive string comparisons || Issue 4 || |- |'''{{tag|stropts.h|open}}'''|| Stream manipulation, including ioctl || Issue 4 || |- |'''{{tag|sys/ipc.h|open}}''' || Inter-process communication (IPC) || Issue 2 || |- |'''{{tag|sys/mman.h|open}}''' || Memory management, including POSIX shared memory and memory mapped files || Issue 4 || |- |'''{{tag|sys/msg.h|open}}''' || POSIX message queues || Issue 2 || |- |'''{{tag|sys/resource.h|open}}''' || Resource usage, priorities, and limiting || Issue 4 || |- |'''{{tag|sys/select.h|open}}''' || Synchronous I/O multiplexing || Issue 6 || |- |'''{{tag|sys/sem.h|open}}''' || XSI (SysV style) semaphores || Issue 2 || |- |'''{{tag|sys/shm.h|open}}'''|| XSI (SysV style) shared memory || Issue 2 || |- |'''{{tag|sys/socket.h|open}}''' || Main Berkeley sockets header || Issue 6 || |- |'''{{tag|sys/stat.h|open}}''' || File information (stat et al.) || Issue 1 || |- |'''{{tag|sys/statvfs.h|open}}'''|| File System information || Issue 4 || |- |'''{{tag|sys/time.h|open}}''' || Time and date functions and structures || Issue 4 || |- |'''{{tag|sys/times.h|open}}''' || File access and modification times || Issue 1 || |- |'''{{tag|sys/types.h|open}}''' || Various data types used elsewhere || Issue 1 || |- |'''{{tag|sys/uio.h|open}}''' || Vectored I/O operations || Issue 4 || |- |'''{{tag|sys/un.h|open}}''' || Unix domain sockets || Issue 6 || |- |'''{{tag|sys/utsname.h|open}}''' || Operating system information, including uname || Issue 1 || |- |'''{{tag|sys/wait.h|open}}''' || Status of terminated child processes (see wait) || Issue 3 || |- |'''{{tag|syslog.h|open}}''' || System error logging || Issue 4 || |- |'''{{tag|tar.h|open}}''' || Magic numbers for the tar archive format || Issue 3 || |- |'''{{tag|termios.h|open}}''' || Allows terminal I/O interfaces || Issue 3 || |- |'''{{tag|tgmath.h|open}}''' || Type-Generic Macros, see C mathematical functions || Issue 6 || C99 |- |'''{{tag|threads.h|open}}''' || ISO C threads || Issue 8 || C11 |- |'''{{tag|time.h|open}}''' || Type-Generic Macros, see C date and time functions || Issue 1 || ANSI (89) |- |'''{{tag|trace.h|open}}''' || Tracing of runtime behavior (DEPRECATED) || Issue 6 || |- |'''{{tag|ucontext.h|open}}''' || manipulate user context (REMOVED in POSIX.1-2008) || |- |'''{{tag|ulimit.h|open}}''' || Resource limiting (DEPRECATED in favor of <sys/resource.h>) || Issue 1 || |- |'''{{tag|unistd.h|open}}''' || Various essential POSIX functions and constants || Issue 1 || |- |'''{{tag|utime.h|open}}''' || inode access and modification times || Issue 3 || |- |'''{{tag|utmpx.h|open}}''' || User accounting database functions || Issue 4 || |- |'''{{tag|wchar.h|open}}''' || Wide-Character Handling, see C string handling || Issue 4 || NA1 (95) |- |'''{{tag|wctype.h|open}}''' || Wide-Character Classification and Mapping Utilities, see C character classification || Issue 5 || NA1 (95) |- |'''{{tag|wordexp.h|open}}''' || Word-expansion like the shell would perform || Issue 4 || |}

==See also== * POSIX * C standard library * C++ standard library * Windows API * Windows.h

==References== * [http://www.opengroup.org/onlinepubs/9699919799/idx/head.html Official List of headers in the POSIX library on opengroup.org] * {{Cite web |url=http://www.space.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/funcref.htm |title=Lists headers in the POSIX library |access-date=November 6, 2007 |archive-url=https://web.archive.org/web/20100724201155/http://www.space.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/funcref.htm |archive-date=July 24, 2010 |url-status=dead |df=mdy-all }} * [http://www.cs.utah.edu/flux/oskit/html/oskit-wwwch20.html Description of the posix library from the Flux OSKit]

==Further reading== {{Refbegin}} * {{citation | last = Gallmeister | first = Bill | date = January 1, 1995 | title = POSIX.4 Programmers Guide: Programming for the Real World | edition = 1st | publisher = O'Reilly Media | isbn = 1-56592-074-0 | url = http://oreilly.com/catalog/9781565920743/ }} {{Refend}}

{{CProLang}}

Category:C POSIX library Category:POSIX