Jump to content

C POSIX library: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
ZéroBot (talk | contribs)
m r2.7.1) (Robot: Adding pl:C POSIX library
 
(40 intermediate revisions by 36 users not shown)
Line 1: Line 1:
{{Short description|C (programming language) standard library specifically for POSIX systems}}
{{C POSIX library}}
{{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.


==C POSIX library header files==
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.

== C POSIX library header files ==


{| class="wikitable sortable"
{| class="wikitable sortable"
! Header File!! Description
! Header file!! Description !! First released !! C Standard
|-
|-
|'''{{tag|aio.h|open}}''' || [[Asynchronous I/O|Asynchronous input and output]] || Issue 5 ||
|''' <[[cpio.h]]>''' || [[File format#Magic_number|Magic number]]s for the [[cpio]] archive format.
|-
|-
|'''{{tag|arpa/inet.h|open}}'''|| Functions for manipulating numeric [[IP addresses]] (part of [[Berkeley sockets]]) || Issue 6 ||
|''' <[[dirent.h]]>''' || Allows the opening and listing of [[directory (file systems)|directories]].
|-
|-
|'''{{tag|[[assert.h]]|open}}'''|| Verify assumptions || Issue 1 || ANSI (89)
|''' <[[fcntl.h]]>''' || File opening, [[File locking|locking]] and other operations.
|-
|-
|'''{{tag|complex.h|open}}'''|| Complex Arithmetic, see [[C mathematical functions]] || Issue 6 || C99
|''' <[[grp.h]]>''' || User [[Group identifier (Unix)|group]] information and control.
|-
|-
|'''{{tag|cpio.h|open}}''' || [[File format#Magic number|Magic number]]s for the [[cpio]] archive format || Issue 3 ||
|''' <[[pthread.h]]>''' || Defines an API for creating and manipulating [[POSIX]] threads.
|-
|-
|'''{{tag|ctype.h|open}}'''
|''' <[[pwd.h]]>''' || [[Passwd (file)|passwd]] (user information) access and control.
|Character types
|Issue 1
|ANSI (89)
|-
|-
|'''{{tag|[[dirent.h]]|open}}''' || Allows the opening and listing of [[directory (file systems)|directories]] || Issue 2 ||
|''' <[[sys/ipc.h]]>''' || [[Inter-process communication]] (IPC).
|-
|-
|''' <[[sys/msg.h]]>''' || POSIX [[message queue]]s.
|'''{{tag|dlfcn.h|open}}''' || [[Dynamic linker|Dynamic linking]] || Issue 5 ||
|-
|-
|'''{{tag|[[errno.h]]|open}}''' || Retrieving Error Number || Issue 1 || ANSI (89)
|''' <[[sys/sem.h]]>''' || POSIX [[Semaphore (programming)|semaphore]]s.
|-
|-
|''' <[[sys/stat.h]]>''' || File information ([[stat (Unix)|stat]] et al.).
|'''{{tag|[[fcntl.h]]|open}}''' || File opening, [[File locking|locking]] and other operations || Issue 1 ||
|-
|-
|''' <[[C_date_and_time_functions|sys/time.h]]>''' || Time and date functions and structures.
|'''{{tag|[[fenv.h]]|open}}''' || Floating-Point Environment (FPE), see [[C mathematical functions]] || Issue 6 || C99
|-
|-
|''' <[[sys/types.h]]>''' || Various data types used elsewhere.
|'''{{tag|[[float.h]]|open}}''' || Floating-point types, see [[C data types]] || Issue 4 || ANSI (89)
|-
|-
|''' <[[sys/utsname.h]]>''' || [[uname]] and related structures.
|'''{{tag|fmtmsg.h|open}}''' || Message display structures || Issue 4 ||
|-
|-
|'''{{tag|fnmatch.h|open}}''' || Filename matching || Issue 4 ||
|''' <[[sys/wait.h]]>''' || Status of terminated child processes (see [[wait (operating system)|wait]])
|-
|'''{{tag|ftw.h|open}}''' || File tree traversal || Issue 1 ||
|-
|-
|'''{{tag|glob.h|open}}''' || Pathname [[Glob (programming)|"globbing"]] (pattern-matching) || Issue 4 ||
|''' <[[tar.h]]>''' || [[File format#Magic_number|Magic number]]s for the [[tar (file format)|tar]] archive format.
|-
|-
|'''{{tag|grp.h|open}}''' || User [[Group identifier (Unix)|group]] information and control || Issue 1 ||
|''' <[[termios.h]]>''' || Allows [[Serial port|terminal I/O]] interfaces.
|-
|-
|''' <[[unistd.h]]>''' || Various essential POSIX functions and constants.
|'''{{tag|[[iconv|iconv.h]]|open}}''' || [[Character encoding|Codeset]] conversion facility || Issue 4 ||
|-
|-
|'''{{tag|inttypes.h|open}}''' || Fixed sized integer types, see [[C data types]] || Issue 5 || C99
|''' <[[utime.h]]>''' || [[inode]] access and modification times.
|-
|'''{{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|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 [[Transmission Control Protocol|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 I/O|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 (file)|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 [[Semaphore (programming)|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 [[Spawn (computing)|spawning]] || Issue 6 ||
|-
|'''{{tag|[[stdarg.h]]|open}}'''|| Handle Variable Argument List || Issue 4 || ANSI (89)
|-
|'''{{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|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 (interprocess communication)|shared memory]] and [[memory mapped files]] || Issue 4 ||
|-
|'''{{tag|sys/msg.h|open}}''' || POSIX [[message queue]]s || Issue 2 ||
|-
|'''{{tag|sys/resource.h|open}}''' || Resource usage, priorities, and limiting || Issue 4 ||
|-
|'''{{tag|sys/select.h|open}}''' || [[Select (Unix)|Synchronous I/O multiplexing]] || Issue 6 ||
|-
|'''{{tag|sys/sem.h|open}}''' || XSI ([[Unix System V|SysV]] style) [[Semaphore (programming)|semaphores]] || Issue 2 ||
|-
|'''{{tag|sys/shm.h|open}}'''|| XSI ([[Unix System V|SysV]] style) [[Shared memory (interprocess communication)|shared memory]] || Issue 2 ||
|-
|'''{{tag|sys/socket.h|open}}''' || Main [[Berkeley sockets]] header || Issue 6 ||
|-
|'''{{tag|sys/stat.h|open}}''' || File information ([[stat (Unix)|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 socket]]s || 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 (operating system)|wait]]) || Issue 3 ||
|-
|'''{{tag|syslog.h|open}}''' || [[syslog|System error logging]] || Issue 4 ||
|-
|'''{{tag|tar.h|open}}''' || [[File format#Magic number|Magic number]]s for the [[tar (file format)|tar]] archive format || Issue 3 ||
|-
|'''{{tag|[[termios.h]]|open}}''' || Allows [[Serial port|terminal I/O]] interfaces || Issue 3 ||
|-
|'''{{tag|[[tgmath.h]]|open}}''' || Type-Generic Macros, see [[C mathematical functions]] || Issue 6 || C99
|-
|'''{{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|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 [[Unix shell|shell]] would perform || Issue 4 ||
|}
|}
{{Verify source|date=January 2010}}


==References==
==References==
* [http://www.opengroup.org/onlinepubs/9699919799/idx/head.html Official List of headers in the POSIX library on opengroup.org]
* [http://www.opengroup.org/onlinepubs/9699919799/idx/head.html Official List of headers in the POSIX library on opengroup.org]
* [http://web.archive.org/web/*/http://www.space.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/funcref.htm Lists headers in the POSIX library]
* {{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]
* [http://www.cs.utah.edu/flux/oskit/html/oskit-wwwch20.html Description of the posix library from the Flux OSKit]


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

{{CProLang}}


[[Category:C POSIX library| ]]
[[Category:C POSIX library| ]]
[[Category:POSIX]]
[[Category:POSIX]]

[[pl:C POSIX library]]
[[ru:C POSIX library]]

Latest revision as of 13:36, 1 August 2024

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.

C POSIX library header files

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

References

[edit]
  • Official List of headers in the POSIX library on opengroup.org
  • "Lists headers in the POSIX library". Archived from the original on July 24, 2010. Retrieved November 6, 2007.
  • Description of the posix library from the Flux OSKit

Further reading

[edit]