Copyright © 2004, 2005 Free Standards Group
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
Portions of the text are copyrighted by the following parties:
The Regents of the University of California
Free Software Foundation
Ian F. Darwin
Paul Vixie
BSDI (now Wind River)
Andrew G Morgan
Jean-loup Gailly and Mark Adler
Massachusetts Institute of Technology
These excerpts are being used in accordance with their respective licenses.
Linux is a trademark of Linus Torvalds.
UNIX a registered trademark of the Open Group in the United States and other countries.
LSB is a trademark of the Free Standards Group in the USA and other countries.
AMD is a trademark of Advanced Micro Devices, Inc.
Intel and Itanium are registered trademarks and Intel386 is a trademarks of Intel Corporation.
PowerPC and PowerPC Architecture are trademarks of the IBM Corporation.
OpenGL is a registered trademark of Silicon Graphics, Inc.
This is version 3.1 of the Linux Standard Base Core Specification. This specification is part of a family of specifications under the general title "Linux Standard Base". Developers of applications or implementations interested in using the LSB trademark should see the Free Standards Group Certification Policy for details.
The LSB defines a binary interface for application programs that are compiled and packaged for LSB-conforming implementations on many different hardware architectures. Since a binary specification shall include information specific to the computer processor architecture for which it is intended, it is not possible for a single document to specify the interface for all possible LSB-conforming implementations. Therefore, the LSB is a family of specifications, rather than a single one.
This document should be used in conjunction with the documents it references. This document enumerates the system components it includes, but descriptions of those components may be included entirely or partly in this document, partly in other documents, or entirely in other reference documents. For example, the section that describes system service routines includes a list of the system routines supported in this interface, formal declarations of the data structures they use that are visible to applications, and a pointer to the underlying referenced specification for information about the syntax and semantics of each call. Only those routines not described in standards referenced by this document, or extensions to those standards, are described in the detail. Information referenced in this way is as much a part of this document as is the information explicitly included here.
The specification carries a version number of either the form x.y or x.y.z. This version number carries the following meaning:
The first number (x) is the major version number. All versions with the same major version number should share binary compatibility. Any addition or deletion of a new library results in a new version number. Interfaces marked as deprecated may be removed from the specification at a major version change.
The second number (y) is the minor version number. Individual interfaces may be added if all certified implementations already had that (previously undocumented) interface. Interfaces may be marked as deprecated at a minor version change. Other minor changes may be permitted at the discretion of the LSB workgroup.
The third number (z), if present, is the editorial level. Only editorial changes should be included in such versions.
Since this specification is a descriptive Application Binary Interface, and not a source level API specification, it is not possible to make a guarantee of 100% backward compatibility between major releases. However, it is the intent that those parts of the binary interface that are visible in the source level API will remain backward compatible from version to version, except where a feature marked as "Deprecated" in one release may be removed from a future release.
Implementors are strongly encouraged to make use of symbol versioning to permit simultaneous support of applications conforming to different releases of this specification.
The Linux Standard Base (LSB) defines a system interface for compiled applications and a minimal environment for support of installation scripts. Its purpose is to enable a uniform industry standard environment for high-volume applications conforming to the LSB.
These specifications are composed of two basic parts: A common specification ("LSB-generic" or "generic LSB") describing those parts of the interface that remain constant across all implementations of the LSB, and an architecture-specific supplement ("LSB-arch" or "archLSB") describing the parts of the interface that vary by processor architecture. Together, the LSB-generic and the architecture-specific supplement for a single hardware architecture provide a complete interface specification for compiled application programs on systems that share a common hardware architecture.
The LSB-generic document shall be used in conjunction with an architecture-specific supplement. Whenever a section of the LSB-generic specification shall be supplemented by architecture-specific information, the LSB-generic document includes a reference to the architecture supplement. Architecture supplements may also contain additional information that is not referenced in the LSB-generic document.
The LSB contains both a set of Application Program Interfaces (APIs) and Application Binary Interfaces (ABIs). APIs may appear in the source code of portable applications, while the compiled binary of that application may use the larger set of ABIs. A conforming implementation shall provide all of the ABIs listed here. The compilation system may replace (e.g. by macro definition) certain APIs with calls to one or more of the underlying binary interfaces, and may insert calls to binary interfaces as needed.
The LSB is primarily a binary interface definition. Not all of the source level APIs available to applications may be contained in this specification.
This is the Core module of the Linux Standards Base (LSB). This module provides the fundamental system interfaces, libraries, and runtime environment upon which all conforming applications and libraries depend.
Interfaces described in this module are mandatory except where explicitly listed otherwise. Core interfaces may be supplemented by other modules; all modules are built upon the core.
The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
Note: Where copies of a document are available on the World Wide Web, a Uniform Resource Locator (URL) is given for informative purposes only. This may point to a more recent copy of the referenced specification, or may be out of date. Reference copies of specifications at the revision level indicated may be found at the Free Standards Group's Reference Specifications site.
Table 2-1. Normative References
Name | Title | URL |
---|---|---|
Filesystem Hierarchy Standard | Filesystem Hierarchy Standard (FHS) 2.3 | http://www.pathname.com/fhs/ |
IEC 60559/IEEE 754 Floating Point | IEC 60559:1989 Binary floating-point arithmetic for microprocessor systems | http://www.ieee.org/ |
ISO C (1999) | ISO/IEC 9899: 1999, Programming Languages --C | |
ISO POSIX (2003) | ISO/IEC 9945-1:2003 Information technology -- Portable Operating System Interface (POSIX) -- Part 1: Base Definitions ISO/IEC 9945-2:2003 Information technology -- Portable Operating System Interface (POSIX) -- Part 2: System Interfaces ISO/IEC 9945-3:2003 Information technology -- Portable Operating System Interface (POSIX) -- Part 3: Shell and Utilities ISO/IEC 9945-4:2003 Information technology -- Portable Operating System Interface (POSIX) -- Part 4: Rationale Including Technical Cor. 1: 2004 | http://www.unix.org/version3/ |
Itanium C++ ABI | Itanium C++ ABI (Revision 1.83) | http://refspecs.freestandards.org/cxxabi-1.83.html |
Large File Support | Large File Support | http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html |
SUSv2 | CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) | http://www.opengroup.org/publications/catalog/un.htm |
SUSv2 Commands and Utilities | The Single UNIX® Specification(SUS) Version 2, Commands and Utilities (XCU), Issue 5 (ISBN: 1-85912-191-8, C604) | http://www.opengroup.org/publications/catalog/un.htm |
SVID Issue 3 | American Telephone and Telegraph Company, System V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 1989.(ISBN 0201566524) | |
SVID Issue 4 | System V Interface Definition,Fourth Edition | |
System V ABI | System V Application Binary Interface, Edition 4.1 | http://www.caldera.com/developers/devspecs/gabi41.pdf |
System V ABI Update | System V Application Binary Interface - DRAFT - 17 December 2003 | http://www.caldera.com/developers/gabi/2003-12-17/contents.html |
X/Open Curses | CAE Specification, May 1996, X/Open Curses, Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus Corrigendum U018 | http://www.opengroup.org/publications/catalog/un.htm |
In addition, the specifications listed below provide essential background information to implementors of this specification. These references are included for information only.
Table 2-2. Other References
Name | Title | URL |
---|---|---|
DWARF Debugging Information Format, Revision 2.0.0 | DWARF Debugging Information Format, Revision 2.0.0 (July 27, 1993) | http://refspecs.freestandards.org/dwarf/dwarf-2.0.0.pdf |
DWARF Debugging Information Format, Revision 3.0.0 (Draft) | DWARF Debugging Information Format, Revision 3.0.0 (Draft) | http://refspecs.freestandards.org/dwarf/ |
ISO/IEC TR14652 | ISO/IEC Technical Report 14652:2002 Specification method for cultural conventions | |
ITU-T V.42 | International Telecommunication Union Recommendation V.42 (2002): Error-correcting procedures for DCEs using asynchronous-to-synchronous conversionITUV | http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-V.42 |
Li18nux Globalization Specification | LI18NUX 2000 Globalization Specification, Version 1.0 with Amendment 4 | http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm |
Linux Allocated Device Registry | LINUX ALLOCATED DEVICES | http://www.lanana.org/docs/device-list/devices.txt |
PAM | Open Software Foundation, Request For Comments: 86.0 , October 1995, V. Samar & R.Schemers (SunSoft) | http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt |
RFC 1321: The MD5 Message-Digest Algorithm | IETF RFC 1321: The MD5 Message-Digest Algorithm | http://www.ietf.org/rfc/rfc1321.txt |
RFC 1831/1832 RPC & XDR | IETF RFC 1831 & 1832 | http://www.ietf.org/ |
RFC 1833: Binding Protocols for ONC RPC Version 2 | IETF RFC 1833: Binding Protocols for ONC RPC Version 2 | http://www.ietf.org/rfc/rfc1833.txt |
RFC 1950: ZLIB Compressed Data Format Specication | IETF RFC 1950: ZLIB Compressed Data Format Specification | http://www.ietf.org/rfc/rfc1950.txt |
RFC 1951: DEFLATE Compressed Data Format Specification | IETF RFC 1951: DEFLATE Compressed Data Format Specification version 1.3 | http://www.ietf.org/rfc/rfc1951.txt |
RFC 1952: GZIP File Format Specification | IETF RFC 1952: GZIP file format specification version 4.3 | http://www.ietf.org/rfc/rfc1952.txt |
RFC 2440: OpenPGP Message Format | IETF RFC 2440: OpenPGP Message Format | http://www.ietf.org/rfc/rfc2440.txt |
RFC 2821:Simple Mail Transfer Protocol | IETF RFC 2821: Simple Mail Transfer Protocol | http://www.ietf.org/rfc/rfc2821.txt |
RFC 2822:Internet Message Format | IETF RFC 2822: Internet Message Format | http://www.ietf.org/rfc/rfc2822.txt |
RFC 791:Internet Protocol | IETF RFC 791: Internet Protocol Specification | http://www.ietf.org/rfc/rfc791.txt |
RPM Package Format | RPM Package Format V3.0 | http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html |
zlib Manual | zlib 1.2 Manual | http://www.gzip.org/zlib/ |
The libraries listed in Table 3-1 shall be available on a Linux Standard Base system, with the specified runtime names. The libraries listed in Table 3-2 are architecture specific, but shall be available on all LSB conforming systems. This list may be supplemented or amended by the architecture specific supplement.
Table 3-1. Standard Library Names
Library | Runtime Name |
---|---|
libdl | libdl.so.2 |
libcrypt | libcrypt.so.1 |
libz | libz.so.1 |
libncurses | libncurses.so.5 |
libutil | libutil.so.1 |
libpthread | libpthread.so.0 |
librt | librt.so.1 |
libpam | libpam.so.0 |
libgcc_s | libgcc_s.so.1 |
Table 3-2. Standard Library Names defined in the Architecture Specific Supplement
Library | Runtime Name |
---|---|
libm | See archLSB |
libc | See archLSB |
proginterp | See archLSB |
These libraries will be in an implementation-defined directory which the dynamic linker shall search by default.
A conforming implementation is necessarily architecture specific, and must provide the interfaces specified by both the generic LSB Core specification and its relevant architecture specific supplement.
Rationale: An implementation must provide at least the interfaces specified in these specifications. It may also provide additional interfaces.
A conforming implementation shall satisfy the following requirements:
A processor architecture represents a family of related processors which may not have identical feature sets. The architecture specific supplement to this specification for a given target processor architecture describes a minimum acceptable processor. The implementation shall provide all features of this processor, whether in hardware or through emulation transparent to the application.
The implementation shall be capable of executing compiled applications having the format and using the system interfaces described in this document.
The implementation shall provide libraries containing the interfaces specified by this document, and shall provide a dynamic linking mechanism that allows these interfaces to be attached to applications at runtime. All the interfaces shall behave as specified in this document.
The map of virtual memory provided by the implementation shall conform to the requirements of this document.
The implementation's low-level behavior with respect to function call linkage, system traps, signals, and other such activities shall conform to the formats described in this document.
The implementation shall provide all of the mandatory interfaces in their entirety.
The implementation may provide one or more of the optional interfaces. Each optional interface that is provided shall be provided in its entirety. The product documentation shall state which optional interfaces are provided.
The implementation shall provide all files and utilities specified as part of this document in the format defined here and in other referenced documents. All commands and utilities shall behave as required by this document. The implementation shall also provide all mandatory components of an application's runtime environment that are included or referenced in this document.
The implementation, when provided with standard data formats and values at a named interface, shall provide the behavior defined for those values and data formats at that interface. However, a conforming implementation may consist of components which are separately packaged and/or sold. For example, a vendor of a conforming implementation might sell the hardware, operating system, and windowing system as separately packaged items.
The implementation may provide additional interfaces with different names. It may also provide additional behavior corresponding to data values outside the standard ranges, for standard named interfaces.
A conforming application is necessarily architecture specific, and must conform to both the generic LSB Core specification and its relevant architecture specific supplement.
A conforming application shall satisfy the following requirements:
Its executable files shall be either shell scripts or object files in the format defined for the Object File Format system interface.
Its object files shall participate in dynamic linking as defined in the Program Loading and Linking System interface.
It shall employ only the instructions, traps, and other low-level facilities defined in the Low-Level System interface as being for use by applications.
If it requires any optional interface defined in this document in order to be installed or to execute successfully, the requirement for that optional interface shall be stated in the application's documentation.
It shall not use any interface or data format that is not required to be provided by a conforming implementation, unless:
If such an interface or data format is supplied by another application through direct invocation of that application during execution, that application shall be in turn an LSB conforming application.
The use of that interface or data format, as well as its source, shall be identified in the documentation of the application.
It shall not use any values for a named interface that are reserved for vendor extensions.
For the purposes of this document, the following definitions, as specified in the ISO/IEC Directives, Part 2, 2001, 4th Edition, apply:
For the purposes of this document, the following terms apply:
The architectural part of the LSB Specification which describes the specific parts of the interface that are platform specific. The archLSB is complementary to the gLSB.
The total set of interfaces that are available to be used in the compiled binary code of a conforming application.
The common part of the LSB Specification that describes those parts of the interface that remain constant across all hardware implementations of the LSB.
Describes a value or behavior that is not defined by this document but is selected by an implementor. The value or behavior may vary among implementations that conform to this document. An application should not rely on the existence of the value or behavior. An application that relies on such a value or behavior cannot be assured to be portable across conforming implementations. The implementor shall document such a value or behavior so that it can be used correctly by an application.
A file that is read by an interpreter (e.g., awk). The first line of the shell script includes a reference to its interpreter binary.
The set of interfaces that are available to be used in the source code of a conforming application.
Describes the nature of a value or behavior not defined by this document which results from use of an invalid program construct or invalid data input. The value or behavior may vary among implementations that conform to this document. An application should not rely on the existence or validity of the value or behavior. An application that relies on any particular value or behavior cannot be assured to be portable across conforming implementations.
Describes the nature of a value or behavior not specified by this document which results from use of a valid program construct or valid data input. The value or behavior may vary among implementations that conform to this document. An application should not rely on the existence or validity of the value or behavior. An application that relies on any particular value or behavior cannot be assured to be portable across conforming implementations.
Other terms and definitions used in this document shall have the same meaning as defined in Chapter 3 of the Base Definitions volume of ISO POSIX (2003).
Throughout this document, the following typographic conventions are used:
function() | the name of a function | |
command | the name of a command or utility | |
CONSTANT | a constant value | |
parameter | a parameter | |
variable | a variable |
Throughout this specification, several tables of interfaces are presented. Each entry in these tables has the following format:
name | the name of the interface | |
(symver) | An optional symbol version identifier, if required. | |
[refno] | A reference number indexing the table of referenced specifications that follows this table. |
For example,
refers to the interface named forkpty() with symbol versionGLIBC_2.0
that is defined in the
SUSv3 reference.
Note: Symbol versions are defined in the architecture specific supplements only.
This specification includes many interfaces described in ISO POSIX (2003). Unless otherwise specified, such interfaces should behave exactly as described in that specification. Any conflict between the requirements described here and the ISO POSIX (2003) standard is unintentional, except as explicitly noted otherwise.
Note: In addition to the differences noted inline in this specification, PDTR 24715 has extracted the differences between this specification and ISO POSIX (2003) into a single place. It is the long term plan of the Free Standards Group to converge the LSB Core Specification with ISO/IEC 9945 POSIX.
The LSB Specification Authority is responsible for deciding the meaning of conformance to normative referenced standards in the LSB context. Problem Reports regarding underlying or referenced standards in any other context will be referred to the relevant maintenance body for that standard.
The LSB is the base for several other specification projects under the umbrella of the Free Standards Group (FSG). This specification is the foundation, and other specifications build on the interfaces defined here. However, beyond those specifications listed as Normative References, this specification has no dependencies on other FSG projects.
Executable and Linking Format (ELF) defines the object format for compiled applications. This specification supplements the information found in System V ABI Update and is intended to document additions made since the publication of that document.
LSB-conforming applications shall assume that stack, heap and other allocated memory regions will be non-executable. The application must take steps to make them executable if needed.
LSB-conforming applications shall use the data representation as defined in the Arcitecture specific ELF documents.
In addition to the fundamental types specified in the architecture specific supplement, a 1 byte data type is defined here.
LSB-conforming implementations shall support the object file Executable and Linking Format (ELF), which is defined by the following documents:
this specification
an architecture specific supplement to this specification
As described in System V ABI, an ELF object file contains a number of sections.
The section header table is an array of
Elf32_Shdr or
Elf64_Shdr structures as
described in System V ABI. The
sh_type
member shall be either a value from
Table 11-1, drawn from the System V
ABI, or one of the additional values specified in Table 11-2.
A section header's sh_type
member specifies the sections's semantics.
The following section types are defined in the System V ABI and the System V ABI Update.
Table 11-1. ELF Section Types
Various sections hold program and control information. Sections in the lists below are used by the system and have the indicated types and attributes.
The following sections are defined in the System V ABI and the System V ABI Update.
Table 11-3. ELF Special Sections
Name | Type | Attributes |
---|---|---|
.bss | SHT_NOBITS | SHF_ALLOC+SHF_WRITE |
.comment | SHT_PROGBITS | 0 |
.data | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.data1 | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.debug | SHT_PROGBITS | 0 |
.dynamic | SHT_DYNAMIC | SHF_ALLOC+SHF_WRITE |
.dynstr | SHT_STRTAB | SHF_ALLOC |
.dynsym | SHT_DYNSYM | SHF_ALLOC |
.fini | SHT_PROGBITS | SHF_ALLOC+SHF_EXECINSTR |
.fini_array | SHT_FINI_ARRAY | SHF_ALLOC+SHF_WRITE |
.hash | SHT_HASH | SHF_ALLOC |
.init | SHT_PROGBITS | SHF_ALLOC+SHF_EXECINSTR |
.init_array | SHT_INIT_ARRAY | SHF_ALLOC+SHF_WRITE |
.interp | SHT_PROGBITS | SHF_ALLOC |
.line | SHT_PROGBITS | 0 |
.note | SHT_NOTE | 0 |
.preinit_array | SHT_PREINIT_ARRAY | SHF_ALLOC+SHF_WRITE |
.rodata | SHT_PROGBITS | SHF_ALLOC |
.rodata1 | SHT_PROGBITS | SHF_ALLOC |
.shstrtab | SHT_STRTAB | 0 |
.strtab | SHT_STRTAB | SHF_ALLOC |
.symtab | SHT_SYMTAB | SHF_ALLOC |
.tbss | SHT_NOBITS | SHF_ALLOC+SHF_WRITE+SHF_TLS |
.tdata | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE+SHF_TLS |
.text | SHT_PROGBITS | SHF_ALLOC+SHF_EXECINSTR |
Object files in an LSB conforming application may also contain one or more of the additional special sections described below.
Table 11-4. Additional Special Sections
Name | Type | Attributes |
---|---|---|
.ctors | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.data.rel.ro | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.dtors | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.eh_frame | SHT_PROGBITS | SHF_ALLOC |
.eh_frame_hdr | SHT_PROGBITS | SHF_ALLOC |
.gcc_except_table | SHT_PROGBITS | SHF_ALLOC |
.gnu.version | SHT_GNU_versym | SHF_ALLOC |
.gnu.version_d | SHT_GNU_verdef | SHF_ALLOC |
.gnu.version_r | SHT_GNU_verneed | SHF_ALLOC |
.got.plt | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.jcr | SHT_PROGBITS | SHF_ALLOC+SHF_WRITE |
.note.ABI-tag | SHT_NOTE | SHF_ALLOC |
.stab | SHT_PROGBITS | 0 |
.stabstr | SHT_STRTAB | 0 |
.ctors | This section contains a list of global constructor function pointers. | |
.data.rel.ro | This section holds initialized data that contribute to the program's memory image. This section may be made read-only after relocations have been applied. | |
.dtors | This section contains a list of global destructor function pointers. | |
.eh_frame | This section contains information necessary for frame unwinding during exception handling. See Section 11.6.1. | |
.eh_frame_hdr | This section contains a pointer to the .eh_frame section which is accessible to the runtime support code of a C++ application. This section may also contain a binary search table which may be used by the runtime support code to more efficiently access records in the .eh_frame section. See Section 11.6.2. | |
.gcc_except_table | This section holds Language Specific Data. | |
.gnu.version | This section contains the Symbol Version Table. See Section 11.7.2. | |
.gnu.version_d | This section contains the Version Definitions. See Section 11.7.3. | |
.gnu.version_r | This section contains the Version Requirements. See Section 11.7.4. | |
.got.plt | This section holds the read-only portion of the GLobal Offset Table. This section may be made read-only after relocations have been applied. | |
.jcr | This section contains information necessary for registering compiled Java classes. The contents are compiler-specific and used by compiler initialization functions. | |
.note.ABI-tag | Specify ABI details. See Section 11.8. | |
.stab | This section contains debugging information. The contents are not specified as part of the LSB. | |
.stabstr | This section contains strings associated with the debugging infomation contained in the .stab section. |
Symbols in a source program are translated by the compilation system into symbols that exist in the object file.
The LSB does not specify debugging information, however, some additional sections contain information which is encoded using the the encoding as specified by DWARF Debugging Information Format, Revision 2.0.0 with extensions defined here.
Note: The extensions specified here also exist in DWARF Debugging Information Format, Revision 3.0.0 (Draft). It is expected that future versions of the LSB will reference the final version of that document, and that the definitions here will be taken from that document instead of being specified here.
The DWARF Exception Header Encoding is used to describe the type of data used in the .eh_frame and .eh_frame_hdr section. The upper 4 bits indicate how the value is to be applied. The lower 4 bits indicate the format of the data.
Table 11-5. DWARF Exception Header value format
Name | Value | Meaning |
---|---|---|
DW_EH_PE_absptr | 0x00 | The Value is a literal pointer whose size is determined by the architecture. |
DW_EH_PE_uleb128 | 0x01 | Unsigned value is encoded using the Little Endian Base 128 (LEB128) as defined by DWARF Debugging Information Format, Revision 2.0.0. |
DW_EH_PE_udata2 | 0x02 | A 2 bytes unsigned value. |
DW_EH_PE_udata4 | 0x03 | A 4 bytes unsigned value. |
DW_EH_PE_udata8 | 0x04 | An 8 bytes unsigned value. |
DW_EH_PE_sleb128 | 0x09 | Signed value is encoded using the Little Endian Base 128 (LEB128) as defined by DWARF Debugging Information Format, Revision 2.0.0. |
DW_EH_PE_sdata2 | 0x0A | A 2 bytes signed value. |
DW_EH_PE_sdata4 | 0x0B | A 4 bytes signed value. |
DW_EH_PE_sdata8 | 0x0C | An 8 bytes signed value. |
Table 11-6. DWARF Exception Header application
Name | Value | Meaning |
---|---|---|
DW_EH_PE_pcrel | 0x10 | Value is relative to the current program counter. |
DW_EH_PE_textrel | 0x20 | Value is relative to the beginning of the .text section. |
DW_EH_PE_datarel | 0x30 | Value is relative to the beginning of the .got or .eh_frame_hdr section. |
DW_EH_PE_funcrel | 0x40 | Value is relative to the beginning of the function. |
DW_EH_PE_aligned | 0x50 | Value is aligned to an address unit sized boundary. |
One special encoding, 0xff (DW_EH_PE_omit), shall be used to indicate that no value ispresent.
In addition to the Call Frame Instructions defined in section 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, the following additional Call Frame Instructions may also be used.
Table 11-7. Additional DWARF Call Frame Instructions
Name | Value | Meaning |
---|---|---|
DW_CFA_expression | 0x10 | The DW_CFA_expression instruction takes two operands: an unsigned LEB128 value representing a register number, and a DW_FORM_block value representing a DWARF expression. The required action is to establish the DWARF expression as the means by which the address in which the given register contents are found may be computed. The value of the CFA is pushed on the DWARF evaluation stack prior to execution of the DWARF expression. The DW_OP_call2, DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address DWARF operators (see Section 2.4.1 of DWARF Debugging Information Format, Revision 2.0.0) cannot be used in such a DWARF expression. |
DW_CFA_offset_extended_sf | 0x11 | The DW_CFA_offset_extended_sf instruction takes two operands: an unsigned LEB128 value representing a register number and a signed LEB128 factored offset. This instruction is identical to DW_CFA_offset_extended except that the second operand is signed. |
DW_CFA_def_cfa_sf | 0x12 | The DW_CFA_def_cfa_sf instruction takes two operands: an unsigned LEB128 value representing a register number and a signed LEB128 factored offset. This instruction is identical to DW_CFA_def_cfa except that the second operand is signed and factored. |
DW_CFA_def_cfa_offset_sf | 0x13 | The DW_CFA_def_cfa_offset_sf instruction takes a signed LEB128 operand representing a factored offset. This instruction is identical to DW_CFA_def_cfa_offset except that the operand is signed and factored. |
DW_CFA_GNU_args_size | 0x2e | The DW_CFA_GNU_args_size instruction takes an unsigned LEB128 operand representing an argument size. This instruction specifies the total of the size of the arguments which have been pushed onto the stack. |
DW_CFA_GNU_negative_offset_extended | 0x2f | The DW_CFA_def_cfa_sf instruction takes two operands: an unsigned LEB128 value representing a register number and an unsigned LEB128 which represents the magnitude of the offset. This instruction is identical to DW_CFA_offset_extended_sf except that the operand is subtracted to produce the offset. This instructions is obsoleted by DW_CFA_offset_extended_sf. |
When using languages that support exceptions, such as C++, additional information must be provided to the runtime environment that describes the call frames that must be unwound during the processing of an exception. This information is contained in the special sections .eh_frame and .eh_framehdr.
Note: The format of the .eh_frame section is similar in format and purpose to the .debug_frame section which is specified in DWARF Debugging Information Format, Revision 3.0.0 (Draft). Readers are advised that there are some subtle difference, and care should be taken when comparing the two sections.
The .eh_frame section shall contain 1 or more Call Frame Information (CFI) records. The number of records present shall be determined by size of the section as contained in the section header. Each CFI record contains a Common Information Entry (CIE) record followed by 1 or more Frame Description Entry (FDE) records. Both CIEs and FDEs shall be aligned to an addressing unit sized boundary.
Table 11-8. Call Frame Information Format
Common Information Entry Record |
Frame Description Entry Record(s) |
Table 11-9. Common Information Entry Format
Length | Required |
Extended Length | Optional |
CIE ID | Required |
Version | Required |
Augmentation String | Required |
Code Alignment Factor | Required |
Data Alignment Factor | Required |
Return Address Register | Required |
Augmentation Data Length | Optional |
Augmentation Data | Optional |
Initial Instructions | Required |
Padding |
Length
A 4 byte unsigned value indicating the length in bytes of the CIE structure,
not including the Length
field itself. If
Length
contains the value 0xffffffff, then the
length is contained in the Extended Length
field.
If Length
contains the value 0, then this CIE shall
be considered a terminator and processing shall end.
Extended Length
A 8 byte unsigned value indicating the length in bytes of the CIE structure,
not including the Length
and
Extended Length
fields.
CIE ID
A 4 byte unsigned value that is used to distinguish CIE records from FDE records. This value shall always be 0, which indicates this record is a CIE.
Version
A 1 byte value that identifies the version number of the frame information structure. This value shall be 1.
Augmentation String
This value is a NUL terminated string that identifies the augmentation to the CIE or to the FDEs associated with this CIE. A zero length string indicates that no augmentation data is present. The augmentation string is case sensitive and shall be interpreted as described below.
Code Alignment Factor
An unsigned LEB128 encoded value that is factored out of all advance location instructions that are associated with this CIE or its FDEs. This value shall be multiplied by the delta argument of an adavance location instruction to obtain the new location value.
Data Alignment Factor
A signed LEB128 encoded value that is factored out of all offset instructions that are associated with this CIE or its FDEs. This value shall be multiplied by the register offset argument of an offset instruction to obtain the new offset value.
Augmentation Length
An unsigned LEB128 encoded value indicating the length in bytes of the Augmentation Data. This field is only present if the Augmentation String contains the character 'z'.
Augmentation Data
A block of data whose contents are defined by the contents of the Augmentation String as described below. This field is only present if the Augmentation String contains the character 'z'. The size of this data is given by the Augentation Length.
Initial Instructions
Initial set of Call Frame Instructions. The number of instructions is determined by the remaining space in the CIE record.
Padding
Extra bytes to align the CIE structure to an addressing unit size boundary.
The Agumentation String indicates the presence of some optional fields, and how those fields should be intepreted. This string is case sensitive. Each character in the augmentation string in the CIE can be interpreted as below:
Table 11-10. Frame Description Entry Format
Length | Required |
Extended Length | Optional |
CIE Pointer | Required |
PC Begin | Required |
PC Range | Required |
Augmentation Data Length | Optional |
Augmentation Data | Optional |
Call Frame Instructions | Required |
Padding |
Length
A 4 byte unsigned value indicating the length in bytes of the CIE structure,
not including the Length
field itself. If
Length
contains the value 0xffffffff, then the
length is contained the Extended Length
field.
If Length
contains the value 0, then this CIE shall
be considered a terminator and processing shall end.
Extended Length
A 8 byte unsigned value indicating the length in bytes of the CIE structure,
not including the Length
field itself.
CIE Pointer
A 4 byte unsigned value that when subtracted from the offset of the current FDE yields the offset of the start of the associated CIE. This value shall never be 0.
PC Begin
An encoded value that indicates the address of the initial location associated with this FDE. The encoding format is specified in the Augmentation Data.
PC Range
An absolute value that indicates the number of bytes of instructions associated with this FDE.
Augmentation Length
An unsigned LEB128 encoded value indicating the length in bytes of the Augmentation Data. This field is only present if the Augmentation String in the associated CIE contains the character 'z'.
Augmentation Data
A block of data whose contents are defined by the contents of the Augmentation String in the associated CIE as described above. This field is only present if the Augmentation String in the associated CIE contains the character 'z'. The size of this data is given by the Augentation Length.
Call Frame Instructions
A set of Call Frame Instructions.
Padding
Extra bytes to align the FDE structure to an addressing unit size boundary.
The .eh_frame_hdr section contains additional information about the .eh_frame section. A pointer to the start of the .eh_frame data, and optionally, a binary search table of pointers to the .eh_frame records are found in this section.
Data in this section is encoded according to Section 11.5.1.
Table 11-11. .eh_frame_hdr Section Format
Encoding | Field |
---|---|
unsigned byte | version |
unsigned byte | eh_frame_ptr_enc |
unsigned byte | fde_count_enc |
unsigned byte | table_enc |
encoded | eh_frame_ptr |
encoded | fde_count |
binary search table |
This chapter describes the Symbol Versioning mechanism. All ELF objects may provide or depend on versioned symbols. Symbol Versioning is implemented by 3 section types: SHT_GNU_versym, SHT_GNU_verdef, and SHT_GNU_verneed.
The prefix Elfxx in the following descriptions and code fragments stands for either "Elf32" or "Elf64", depending on the architecture.
Versions are described by strings. The structures that are used for symbol versions also contain a member that holds the ELF hashing values of the strings. This allows for more efficient processing.
The special section .gnu.version which has a section type of SHT_GNU_versym shall contain the Symbol Version Table. This section shall have the same number of entries as the Dynamic Symbol Table in the .dynsym section.
The .gnu.version section shall contain an array of elements of type Elfxx_Half. Each entry specifies the version defined for or required by the corresponding symbol in the Dynamic Symbol Table.
The values in the Symbol Version Table are specific to the object in which they
are located. These values are identifiers that are provided by the the
vna_other
member of the
Elfxx_Vernaux structure or the
vd_ndx
member of the
Elfxx_Verdef structure.
The values 0 and 1 are reserved.
0 | The symbol is local, not available outside the object. | |
1 | The symbol is defined in this object and is globally available. |
All other values are used to identify version strings located in one of the other Symbol Version sections. The value itself is not the version associated with the symbol. The string identified by the value defines the version of the symbol.
The special section .gnu.version_d which has a section type of SHT_GNU_verdef shall contain symbol version definitions. The number of entries in this section shall be contained in the DT_VERDEFNUM entry of the Dynamic Section .dynamic. The sh_link member of the section header (see figure 4-8 in the System V ABI) shall point to the section that contains the strings referenced by this section.
The section shall contain an array of Elfxx_Verdef structures, as described in Figure 11-1, optionally followed by an array of Elfxx_Verdaux structures, as defined in Figure 11-2.
typedef struct { Elfxx_Half vd_version; Elfxx_Half vd_flags; Elfxx_Half vd_ndx; Elfxx_Half vd_cnt; Elfxx_Word vd_hash; Elfxx_Word vd_aux; Elfxx_Word vd_next; } Elfxx_Verdef; |
Figure 11-1. Version Definition Entries
vd_version | Version revision. This field shall be set to 1. | |
vd_flags | Version information flag bitmask. | |
vd_ndx | Version index numeric value referencing the SHT_GNU_versym section. | |
vd_cnt | Number of associated verdaux array entries. | |
vd_hash | Version name hash value (ELF hash function). | |
vd_aux | Offset in bytes to a corresponding entry in an array of Elfxx_Verdaux structures as defined in Figure 11-2 | |
vd_next | Offset to the next verdef entry, in bytes. |
typedef struct { Elfxx_Word vda_name; Elfxx_Word vda_next; } Elfxx_Verdaux; |
Figure 11-2. Version Definition Auxiliary Entries
vda_name | Offset to the version or dependency name string in the section header, in bytes. | |
vda_next | Offset to the next verdaux entry, in bytes. |
The special section .gnu.version_r which has a section type of
SHT_GNU_verneed
shall contain required symbol version definitions. The number of entries in
this section shall be contained in the DT_VERNEEDNUM entry of the Dynamic
Section .dynamic.
The sh_link
member of the section header (see figure 4-8 in
System V ABI)
shall point to the section that contains the strings referenced by this section.
The section shall contain an array of Elfxx_Verneed structures, as described in Figure 11-3, optionally followed by an array of Elfxx_Vernaux structures, as defined in Figure 11-4.
typedef struct { Elfxx_Half vn_version; Elfxx_Half vn_cnt; Elfxx_Word vn_file; Elfxx_Word vn_aux; Elfxx_Word vn_next; } Elfxx_Verneed; |
Figure 11-3. Version Needed Entries
typedef struct { Elfxx_Word vna_hash; Elfxx_Half vna_flags; Elfxx_Half vna_other; Elfxx_Word vna_name; Elfxx_Word vna_next; } Elfxx_Vernaux; |
Figure 11-4. Version Needed Auxiliary Entries
When loading a sharable object the system shall analyze version definition data from the loaded object to assure that it meets the version requirements of the calling object. This step is referred to as definition testing. The dynamic loader shall retrieve the entries in the caller's Elfxx_Verneed array and attempt to find matching definition information in the loaded Elfxx_Verdef table.
Each object and dependency shall be tested in turn. If a symbol definition is missing and the vna_flags bit for VER_FLG_WEAK is not set, the loader shall return an error and exit. If the vna_flags bit for VER_FLG_WEAK is set in the Elfxx_Vernaux entry, and the loader shall issue a warning and continue operation.
When the versions referenced by undefined symbols in the loaded object are found, version availability is certified. The test completes without error and the object shall be made available.
When symbol versioning is used in an object, relocations extend definition testing beyond the simple match of symbol name strings: the version of the reference shall also equal the name of the definition.
The same index that is used in the symbol table can be referenced in the SHT_GNU_versym section, and the value of this index is then used to acquire name data. The corresponding requirement string is retrieved from the Elfxx_Verneed array, and likewise, the corresponding definition string from the Elfxx_Verdef table.
If the high order bit (bit number 15) of the version symbolis set, the object cannot be used and the static linker shall ignore the symbol's presence in the object.
When an object with a reference and an object with the definition are being linked, the following rules shall govern the result:
The object with the reference and the object with the definitions both use
versioning. All described matching is processed in this case. A fatal error
shall be triggered when no matching definition can be found in the object whose
name is the one referenced by the vn_name
element in the
Elfxx_Verneed entry.
The object with the reference does not use versioning, while the object with the definitions does. In this instance, only the definitions with index numbers 1 and 2 will be used in the reference match, the same identified by the static linker as the base definition. In cases where the static linker was not used, such as in calls to dlopen(), a version that does not have the base definition index shall be acceptable if it is the only version for which the symbol is defined.
The object with the reference uses versioning, but the object with the definitions specifies none. A matching symbol shall be accepted in this case. A fatal error shall be triggered if a corruption in the required symbols list obscures an outdated object file and causes a match on the object filename in the Elfxx_Verneed entry.
Neither the object with the reference nor the object with the definitions use versioning. The behavior in this instance shall default to pre-existing symbol rules.
Every executable shall contain a section named .note.ABI-tag of type SHT_NOTE. This section is structured as a note section as documented in the ELF spec. The section shall contain at least the following entry. The name field (namesz/name) contains the string "GNU". The type field shall be 1. The descsz field shall be at least 16, and the first 16 bytes of the desc field shall be as follows.
The first 32-bit word of the desc field shall be 0 (this signifies a Linux executable). The second, third, and fourth 32-bit words of the desc field contain the earliest compatible kernel version. For example, if the 3 words are 2, 2, and 5, this signifies a 2.2.5 kernel.
LSB-conforming implementations shall support the object file information and system actions that create running programs as specified in the System V ABI and System V ABI Update and as further required by this specification and its architecture specific supplement.
Any shared object that is loaded shall contain sufficient DT_NEEDED records to satisfy the symbols on the shared library.
In addition to the Segment Types defined in the System V ABI and System V ABI Update the following Segment Types shall also be supported.
Table 12-1. Linux Segment Types
Name | Value |
---|---|
PT_GNU_EH_FRAME | 0x6474e550 |
PT_GNU_STACK | 0x6474e551 |
PT_GNU_RELRO | 0x6474e552 |
As described in System V ABI, if an object file CHAPTERicipates in dynamic linking, its program header table shall have an element of type PT_DYNAMIC. This `segment' contains the .dynamic section. A special symbol, _DYNAMIC, labels the section, which contains an array of the following structures.
typedef struct { Elf32_Sword d_tag; union { Elf32_Word d_val; Elf32_Addr d_ptr; } d_un; } Elf32_Dyn; extern Elf32_Dyn _DYNAMIC[]; typedef struct { Elf64_Sxword d_tag; union { Elf64_Xword d_val; Elf64_Addr d_ptr; } d_un; } Elf64_Dyn; extern Elf64_Dyn _DYNAMIC[]; |
Figure 12-1. Dynamic Structure
For each object with this type, d_tag
controls the interpretation of d_un
.
The following dynamic entries are defined in the System V ABI and System V ABI Update.
An LSB conforming object may also use the following additional Dynamic Entry types.
An LSB-conforming implementation shall support the following base libraries which provide interfaces for accessing the operating system, processor and other hardware in the system.
libc
libm
libgcc_s
libdl
librt
libcrypt
libpam
There are three main parts to the definition of each of these libraries.
The "Interfaces" section defines the required library name and version, and the required public symbols (interfaces and global data), as well as symbol versions, if any.
The "Interface Definitions" section provides complete or partial definitions of certain interfaces where either this specification is the source specification, or where there are variations from the source specification. If an interface definition requires one or more header files, one of those headers shall include the function prototype for the interface.
For source definitions of interfaces which include a reference to a header file, the contents of such header files form a part of the specification. The "Data Definitions" section provides the binary-level details for the header files from the source specifications, such as values for macros and enumerated types, as well as structure layouts, sizes and padding, etc. These data definitions, although presented in the form of header files for convenience, should not be taken a representing complete header files, as they are a supplement to the source specifications. Application developers should follow the guidelines of the source specifications when determining which header files need to be included to completely resolve all references.
Note: While the Data Definitions supplement the source specifications, this specification itself does not require conforming implementations to supply any header files.
The Program Interpreter is specified in the appropriate architecture specific supplement.
Table 13-1 defines the library name and shared object name for the libc library
The behavior of the interfaces in this library is specified by the following specifications:
[LFS] Large File Support |
[LSB] This Specification |
[SUSv2] SUSv2 |
[SUSv3] ISO POSIX (2003) |
[SVID.3] SVID Issue 3 |
[SVID.4] SVID Issue 4 |
An LSB conforming implementation shall provide the generic functions for RPC specified in Table 13-2, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-2. libc - RPC Function Interfaces
authnone_create [SVID.4] | clnt_create [SVID.4] | clnt_pcreateerror [SVID.4] | clnt_perrno [SVID.4] |
clnt_perror [SVID.4] | clnt_spcreateerror [SVID.4] | clnt_sperrno [SVID.4] | clnt_sperror [SVID.4] |
key_decryptsession [SVID.3] | pmap_getport [LSB] | pmap_set [LSB] | pmap_unset [LSB] |
svc_getreqset [SVID.3] | svc_register [LSB] | svc_run [LSB] | svc_sendreply [LSB] |
svcerr_auth [SVID.3] | svcerr_decode [SVID.3] | svcerr_noproc [SVID.3] | svcerr_noprog [SVID.3] |
svcerr_progvers [SVID.3] | svcerr_systemerr [SVID.3] | svcerr_weakauth [SVID.3] | svctcp_create [LSB] |
svcudp_create [LSB] | xdr_accepted_reply [SVID.3] | xdr_array [SVID.3] | xdr_bool [SVID.3] |
xdr_bytes [SVID.3] | xdr_callhdr [SVID.3] | xdr_callmsg [SVID.3] | xdr_char [SVID.3] |
xdr_double [SVID.3] | xdr_enum [SVID.3] | xdr_float [SVID.3] | xdr_free [SVID.3] |
xdr_int [SVID.3] | xdr_long [SVID.3] | xdr_opaque [SVID.3] | xdr_opaque_auth [SVID.3] |
xdr_pointer [SVID.3] | xdr_reference [SVID.3] | xdr_rejected_reply [SVID.3] | xdr_replymsg [SVID.3] |
xdr_short [SVID.3] | xdr_string [SVID.3] | xdr_u_char [SVID.3] | xdr_u_int [LSB] |
xdr_u_long [SVID.3] | xdr_u_short [SVID.3] | xdr_union [SVID.3] | xdr_vector [SVID.3] |
xdr_void [SVID.3] | xdr_wrapstring [SVID.3] | xdrmem_create [SVID.3] | xdrrec_create [SVID.3] |
xdrrec_eof [SVID.3] |
An LSB conforming implementation shall provide the generic functions for System Calls specified in Table 13-3, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-3. libc - System Calls Function Interfaces
__fxstat [LSB] | __getpgid [LSB] | __lxstat [LSB] | __xmknod [LSB] |
__xstat [LSB] | access [SUSv3] | acct [LSB] | alarm [SUSv3] |
brk [SUSv2] | chdir [SUSv3] | chmod [SUSv3] | chown [SUSv3] |
chroot [SUSv2] | clock [SUSv3] | close [SUSv3] | closedir [SUSv3] |
creat [SUSv3] | dup [SUSv3] | dup2 [SUSv3] | execl [SUSv3] |
execle [SUSv3] | execlp [SUSv3] | execv [SUSv3] | execve [SUSv3] |
execvp [SUSv3] | exit [SUSv3] | fchdir [SUSv3] | fchmod [SUSv3] |
fchown [SUSv3] | fcntl [LSB] | fdatasync [SUSv3] | flock [LSB] |
fork [SUSv3] | fstatvfs [SUSv3] | fsync [SUSv3] | ftime [SUSv3] |
ftruncate [SUSv3] | getcontext [SUSv3] | getegid [SUSv3] | geteuid [SUSv3] |
getgid [SUSv3] | getgroups [SUSv3] | getitimer [SUSv3] | getloadavg [LSB] |
getpagesize [SUSv2] | getpgid [SUSv3] | getpgrp [SUSv3] | getpid [SUSv3] |
getppid [SUSv3] | getpriority [SUSv3] | getrlimit [SUSv3] | getrusage [SUSv3] |
getsid [SUSv3] | getuid [SUSv3] | getwd [SUSv3] | initgroups [LSB] |
ioctl [LSB] | kill [LSB] | killpg [SUSv3] | lchown [SUSv3] |
link [LSB] | lockf [SUSv3] | lseek [SUSv3] | mkdir [SUSv3] |
mkfifo [SUSv3] | mlock [SUSv3] | mlockall [SUSv3] | mmap [SUSv3] |
mprotect [SUSv3] | msync [SUSv3] | munlock [SUSv3] | munlockall [SUSv3] |
munmap [SUSv3] | nanosleep [SUSv3] | nice [SUSv3] | open [SUSv3] |
opendir [SUSv3] | pathconf [SUSv3] | pause [SUSv3] | pipe [SUSv3] |
poll [SUSv3] | read [SUSv3] | readdir [SUSv3] | readdir_r [SUSv3] |
readlink [SUSv3] | readv [SUSv3] | rename [SUSv3] | rmdir [SUSv3] |
sbrk [SUSv2] | sched_get_priority_max [SUSv3] | sched_get_priority_min [SUSv3] | sched_getparam [SUSv3] |
sched_getscheduler [SUSv3] | sched_rr_get_interval [SUSv3] | sched_setparam [SUSv3] | sched_setscheduler [SUSv3] |
sched_yield [SUSv3] | select [SUSv3] | setcontext [SUSv3] | setegid [SUSv3] |
seteuid [SUSv3] | setgid [SUSv3] | setitimer [SUSv3] | setpgid [SUSv3] |
setpgrp [SUSv3] | setpriority [SUSv3] | setregid [SUSv3] | setreuid [SUSv3] |
setrlimit [SUSv3] | setrlimit64 [LFS] | setsid [SUSv3] | setuid [SUSv3] |
sleep [SUSv3] | statvfs [SUSv3] | stime [LSB] | symlink [SUSv3] |
sync [SUSv3] | sysconf [SUSv3] | time [SUSv3] | times [SUSv3] |
truncate [SUSv3] | ulimit [SUSv3] | umask [SUSv3] | uname [SUSv3] |
unlink [LSB] | utime [SUSv3] | utimes [SUSv3] | vfork [SUSv3] |
wait [SUSv3] | wait4 [LSB] | waitpid [LSB] | write [SUSv3] |
writev [SUSv3] |
An LSB conforming implementation shall provide the generic functions for Standard I/O specified in Table 13-4, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-4. libc - Standard I/O Function Interfaces
_IO_feof [LSB] | _IO_getc [LSB] | _IO_putc [LSB] | _IO_puts [LSB] |
asprintf [LSB] | clearerr [SUSv3] | ctermid [SUSv3] | fclose [SUSv3] |
fdopen [SUSv3] | feof [SUSv3] | ferror [SUSv3] | fflush [SUSv3] |
fflush_unlocked [LSB] | fgetc [SUSv3] | fgetpos [SUSv3] | fgets [SUSv3] |
fgetwc_unlocked [LSB] | fileno [SUSv3] | flockfile [SUSv3] | fopen [SUSv3] |
fprintf [SUSv3] | fputc [SUSv3] | fputs [SUSv3] | fread [SUSv3] |
freopen [SUSv3] | fscanf [LSB] | fseek [SUSv3] | fseeko [SUSv3] |
fsetpos [SUSv3] | ftell [SUSv3] | ftello [SUSv3] | fwrite [SUSv3] |
getc [SUSv3] | getc_unlocked [SUSv3] | getchar [SUSv3] | getchar_unlocked [SUSv3] |
getw [SUSv2] | pclose [SUSv3] | popen [SUSv3] | printf [SUSv3] |
putc [SUSv3] | putc_unlocked [SUSv3] | putchar [SUSv3] | putchar_unlocked [SUSv3] |
puts [SUSv3] | putw [SUSv2] | remove [SUSv3] | rewind [SUSv3] |
rewinddir [SUSv3] | scanf [LSB] | seekdir [SUSv3] | setbuf [SUSv3] |
setbuffer [LSB] | setvbuf [SUSv3] | snprintf [SUSv3] | sprintf [SUSv3] |
sscanf [LSB] | telldir [SUSv3] | tempnam [SUSv3] | ungetc [SUSv3] |
vasprintf [LSB] | vdprintf [LSB] | vfprintf [SUSv3] | vprintf [SUSv3] |
vsnprintf [SUSv3] | vsprintf [SUSv3] |
An LSB conforming implementation shall provide the generic data interfaces for Standard I/O specified in Table 13-5, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Signal Handling specified in Table 13-6, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-6. libc - Signal Handling Function Interfaces
__libc_current_sigrtmax [LSB] | __libc_current_sigrtmin [LSB] | __sigsetjmp [LSB] | __sysv_signal [LSB] |
bsd_signal [SUSv3] | psignal [LSB] | raise [SUSv3] | sigaction [SUSv3] |
sigaddset [SUSv3] | sigaltstack [SUSv3] | sigandset [LSB] | sigdelset [SUSv3] |
sigemptyset [SUSv3] | sigfillset [SUSv3] | sighold [SUSv3] | sigignore [SUSv3] |
siginterrupt [SUSv3] | sigisemptyset [LSB] | sigismember [SUSv3] | siglongjmp [SUSv3] |
signal [SUSv3] | sigorset [LSB] | sigpause [SUSv3] | sigpending [SUSv3] |
sigprocmask [SUSv3] | sigqueue [SUSv3] | sigrelse [SUSv3] | sigreturn [LSB] |
sigset [SUSv3] | sigsuspend [SUSv3] | sigtimedwait [SUSv3] | sigwait [SUSv3] |
sigwaitinfo [SUSv3] |
An LSB conforming implementation shall provide the generic data interfaces for Signal Handling specified in Table 13-7, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Localization Functions specified in Table 13-8, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-8. libc - Localization Functions Function Interfaces
bind_textdomain_codeset [LSB] | bindtextdomain [LSB] | catclose [SUSv3] | catgets [SUSv3] |
catopen [SUSv3] | dcgettext [LSB] | dcngettext [LSB] | dgettext [LSB] |
dngettext [LSB] | duplocale(GLIBC_2.3) [LSB] | freelocale(GLIBC_2.3) [LSB] | gettext [LSB] |
iconv [SUSv3] | iconv_close [SUSv3] | iconv_open [SUSv3] | localeconv [SUSv3] |
newlocale(GLIBC_2.3) [LSB] | ngettext [LSB] | nl_langinfo [SUSv3] | setlocale [SUSv3] |
textdomain [LSB] | uselocale(GLIBC_2.3) [LSB] |
An LSB conforming implementation shall provide the generic data interfaces for Localization Functions specified in Table 13-9, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Socket Interface specified in Table 13-10, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-10. libc - Socket Interface Function Interfaces
__h_errno_location [LSB] | accept [SUSv3] | bind [SUSv3] | bindresvport [LSB] |
connect [SUSv3] | gethostid [SUSv3] | gethostname [SUSv3] | getpeername [SUSv3] |
getsockname [SUSv3] | getsockopt [LSB] | if_freenameindex [SUSv3] | if_indextoname [SUSv3] |
if_nameindex [SUSv3] | if_nametoindex [SUSv3] | listen [SUSv3] | recv [SUSv3] |
recvfrom [SUSv3] | recvmsg [SUSv3] | send [SUSv3] | sendmsg [SUSv3] |
sendto [SUSv3] | setsockopt [LSB] | shutdown [SUSv3] | sockatmark [SUSv3] |
socket [SUSv3] | socketpair [SUSv3] |
An LSB conforming implementation shall provide the generic functions for Wide Characters specified in Table 13-11, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-11. libc - Wide Characters Function Interfaces
__wcstod_internal [LSB] | __wcstof_internal [LSB] | __wcstol_internal [LSB] | __wcstold_internal [LSB] |
__wcstoul_internal [LSB] | btowc [SUSv3] | fgetwc [SUSv3] | fgetws [SUSv3] |
fputwc [SUSv3] | fputws [SUSv3] | fwide [SUSv3] | fwprintf [SUSv3] |
fwscanf [LSB] | getwc [SUSv3] | getwchar [SUSv3] | mblen [SUSv3] |
mbrlen [SUSv3] | mbrtowc [SUSv3] | mbsinit [SUSv3] | mbsnrtowcs [LSB] |
mbsrtowcs [SUSv3] | mbstowcs [SUSv3] | mbtowc [SUSv3] | putwc [SUSv3] |
putwchar [SUSv3] | swprintf [SUSv3] | swscanf [LSB] | towctrans [SUSv3] |
towlower [SUSv3] | towupper [SUSv3] | ungetwc [SUSv3] | vfwprintf [SUSv3] |
vfwscanf [LSB] | vswprintf [SUSv3] | vswscanf [LSB] | vwprintf [SUSv3] |
vwscanf [LSB] | wcpcpy [LSB] | wcpncpy [LSB] | wcrtomb [SUSv3] |
wcscasecmp [LSB] | wcscat [SUSv3] | wcschr [SUSv3] | wcscmp [SUSv3] |
wcscoll [SUSv3] | wcscpy [SUSv3] | wcscspn [SUSv3] | wcsdup [LSB] |
wcsftime [SUSv3] | wcslen [SUSv3] | wcsncasecmp [LSB] | wcsncat [SUSv3] |
wcsncmp [SUSv3] | wcsncpy [SUSv3] | wcsnlen [LSB] | wcsnrtombs [LSB] |
wcspbrk [SUSv3] | wcsrchr [SUSv3] | wcsrtombs [SUSv3] | wcsspn [SUSv3] |
wcsstr [SUSv3] | wcstod [SUSv3] | wcstof [SUSv3] | wcstoimax [SUSv3] |
wcstok [SUSv3] | wcstol [SUSv3] | wcstold [SUSv3] | wcstoll [SUSv3] |
wcstombs [SUSv3] | wcstoq [LSB] | wcstoul [SUSv3] | wcstoull [SUSv3] |
wcstoumax [SUSv3] | wcstouq [LSB] | wcswcs [SUSv3] | wcswidth [SUSv3] |
wcsxfrm [SUSv3] | wctob [SUSv3] | wctomb [SUSv3] | wctrans [SUSv3] |
wctype [SUSv3] | wcwidth [SUSv3] | wmemchr [SUSv3] | wmemcmp [SUSv3] |
wmemcpy [SUSv3] | wmemmove [SUSv3] | wmemset [SUSv3] | wprintf [SUSv3] |
wscanf [LSB] |
An LSB conforming implementation shall provide the generic functions for String Functions specified in Table 13-12, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-12. libc - String Functions Function Interfaces
__mempcpy [LSB] | __rawmemchr [LSB] | __stpcpy [LSB] | __strdup [LSB] |
__strtod_internal [LSB] | __strtof_internal [LSB] | __strtok_r [LSB] | __strtol_internal [LSB] |
__strtold_internal [LSB] | __strtoll_internal [LSB] | __strtoul_internal [LSB] | __strtoull_internal [LSB] |
bcmp [SUSv3] | bcopy [SUSv3] | bzero [SUSv3] | ffs [SUSv3] |
index [SUSv3] | memccpy [SUSv3] | memchr [SUSv3] | memcmp [SUSv3] |
memcpy [SUSv3] | memmove [SUSv3] | memrchr [LSB] | memset [SUSv3] |
rindex [SUSv3] | stpcpy [LSB] | stpncpy [LSB] | strcasecmp [SUSv3] |
strcasestr [LSB] | strcat [SUSv3] | strchr [SUSv3] | strcmp [SUSv3] |
strcoll [SUSv3] | strcpy [SUSv3] | strcspn [SUSv3] | strdup [SUSv3] |
strerror [SUSv3] | strerror_r [LSB] | strfmon [SUSv3] | strftime [SUSv3] |
strlen [SUSv3] | strncasecmp [SUSv3] | strncat [SUSv3] | strncmp [SUSv3] |
strncpy [SUSv3] | strndup [LSB] | strnlen [LSB] | strpbrk [SUSv3] |
strptime [LSB] | strrchr [SUSv3] | strsep [LSB] | strsignal [LSB] |
strspn [SUSv3] | strstr [SUSv3] | strtof [SUSv3] | strtoimax [SUSv3] |
strtok [SUSv3] | strtok_r [SUSv3] | strtold [SUSv3] | strtoll [SUSv3] |
strtoq [LSB] | strtoull [SUSv3] | strtoumax [SUSv3] | strtouq [LSB] |
strxfrm [SUSv3] | swab [SUSv3] |
An LSB conforming implementation shall provide the generic functions for IPC Functions specified in Table 13-13, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Regular Expressions specified in Table 13-14, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Character Type Functions specified in Table 13-15, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-15. libc - Character Type Functions Function Interfaces
__ctype_b_loc(GLIBC_2.3) [LSB] | __ctype_get_mb_cur_max [LSB] | __ctype_tolower_loc(GLIBC_2.3) [LSB] | __ctype_toupper_loc(GLIBC_2.3) [LSB] |
_tolower [SUSv3] | _toupper [SUSv3] | isalnum [SUSv3] | isalpha [SUSv3] |
isascii [SUSv3] | iscntrl [SUSv3] | isdigit [SUSv3] | isgraph [SUSv3] |
islower [SUSv3] | isprint [SUSv3] | ispunct [SUSv3] | isspace [SUSv3] |
isupper [SUSv3] | iswalnum [SUSv3] | iswalpha [SUSv3] | iswblank [SUSv3] |
iswcntrl [SUSv3] | iswctype [SUSv3] | iswdigit [SUSv3] | iswgraph [SUSv3] |
iswlower [SUSv3] | iswprint [SUSv3] | iswpunct [SUSv3] | iswspace [SUSv3] |
iswupper [SUSv3] | iswxdigit [SUSv3] | isxdigit [SUSv3] | toascii [SUSv3] |
tolower [SUSv3] | toupper [SUSv3] |
An LSB conforming implementation shall provide the generic functions for Time Manipulation specified in Table 13-16, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-16. libc - Time Manipulation Function Interfaces
adjtime [LSB] | asctime [SUSv3] | asctime_r [SUSv3] | ctime [SUSv3] |
ctime_r [SUSv3] | difftime [SUSv3] | gmtime [SUSv3] | gmtime_r [SUSv3] |
localtime [SUSv3] | localtime_r [SUSv3] | mktime [SUSv3] | tzset [SUSv3] |
ualarm [SUSv3] |
An LSB conforming implementation shall provide the generic data interfaces for Time Manipulation specified in Table 13-17, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Terminal Interface Functions specified in Table 13-18, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-18. libc - Terminal Interface Functions Function Interfaces
cfgetispeed [SUSv3] | cfgetospeed [SUSv3] | cfmakeraw [LSB] | cfsetispeed [SUSv3] |
cfsetospeed [SUSv3] | cfsetspeed [LSB] | tcdrain [SUSv3] | tcflow [SUSv3] |
tcflush [SUSv3] | tcgetattr [SUSv3] | tcgetpgrp [SUSv3] | tcgetsid [SUSv3] |
tcsendbreak [SUSv3] | tcsetattr [SUSv3] | tcsetpgrp [SUSv3] |
An LSB conforming implementation shall provide the generic functions for System Database Interface specified in Table 13-19, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-19. libc - System Database Interface Function Interfaces
endgrent [SUSv3] | endprotoent [SUSv3] | endpwent [SUSv3] | endservent [SUSv3] |
endutent [SUSv2] | endutxent [SUSv3] | getgrent [SUSv3] | getgrgid [SUSv3] |
getgrgid_r [SUSv3] | getgrnam [SUSv3] | getgrnam_r [SUSv3] | getgrouplist [LSB] |
gethostbyaddr [SUSv3] | gethostbyname [SUSv3] | getprotobyname [SUSv3] | getprotobynumber [SUSv3] |
getprotoent [SUSv3] | getpwent [SUSv3] | getpwnam [SUSv3] | getpwnam_r [SUSv3] |
getpwuid [SUSv3] | getpwuid_r [SUSv3] | getservbyname [SUSv3] | getservbyport [SUSv3] |
getservent [SUSv3] | getutent [LSB] | getutent_r [LSB] | getutxent [SUSv3] |
getutxid [SUSv3] | getutxline [SUSv3] | pututxline [SUSv3] | setgrent [SUSv3] |
setgroups [LSB] | setprotoent [SUSv3] | setpwent [SUSv3] | setservent [SUSv3] |
setutent [LSB] | setutxent [SUSv3] | utmpname [LSB] |
An LSB conforming implementation shall provide the generic functions for Language Support specified in Table 13-20, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Large File Support specified in Table 13-21, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-21. libc - Large File Support Function Interfaces
__fxstat64 [LSB] | __lxstat64 [LSB] | __xstat64 [LSB] | creat64 [LFS] |
fgetpos64 [LFS] | fopen64 [LFS] | freopen64 [LFS] | fseeko64 [LFS] |
fsetpos64 [LFS] | fstatvfs64 [LFS] | ftello64 [LFS] | ftruncate64 [LFS] |
ftw64 [LFS] | getrlimit64 [LFS] | lockf64 [LFS] | mkstemp64 [LFS] |
mmap64 [LFS] | nftw64 [LFS] | readdir64 [LFS] | statvfs64 [LFS] |
tmpfile64 [LFS] | truncate64 [LFS] |
An LSB conforming implementation shall provide the generic functions for Standard Library specified in Table 13-22, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-22. libc - Standard Library Function Interfaces
_Exit [SUSv3] | __assert_fail [LSB] | __cxa_atexit [LSB] | __errno_location [LSB] |
__fpending [LSB] | __getpagesize [LSB] | __isinf [LSB] | __isinff [LSB] |
__isinfl [LSB] | __isnan [LSB] | __isnanf [LSB] | __isnanl [LSB] |
__sysconf [LSB] | _exit [SUSv3] | _longjmp [SUSv3] | _setjmp [SUSv3] |
a64l [SUSv3] | abort [SUSv3] | abs [SUSv3] | atof [SUSv3] |
atoi [SUSv3] | atol [SUSv3] | atoll [SUSv3] | basename [SUSv3] |
bsearch [SUSv3] | calloc [SUSv3] | closelog [SUSv3] | confstr [SUSv3] |
cuserid [SUSv2] | daemon [LSB] | dirname [SUSv3] | div [SUSv3] |
drand48 [SUSv3] | ecvt [SUSv3] | erand48 [SUSv3] | err [LSB] |
error [LSB] | errx [LSB] | fcvt [SUSv3] | fmtmsg [SUSv3] |
fnmatch [SUSv3] | fpathconf [SUSv3] | free [SUSv3] | freeaddrinfo [SUSv3] |
ftrylockfile [SUSv3] | ftw [SUSv3] | funlockfile [SUSv3] | gai_strerror [SUSv3] |
gcvt [SUSv3] | getaddrinfo [SUSv3] | getcwd [SUSv3] | getdate [SUSv3] |
getenv [SUSv3] | getlogin [SUSv3] | getlogin_r [SUSv3] | getnameinfo [SUSv3] |
getopt [LSB] | getopt_long [LSB] | getopt_long_only [LSB] | getsubopt [SUSv3] |
gettimeofday [SUSv3] | glob [SUSv3] | glob64 [LSB] | globfree [SUSv3] |
globfree64 [LSB] | grantpt [SUSv3] | hcreate [SUSv3] | hdestroy [SUSv3] |
hsearch [SUSv3] | htonl [SUSv3] | htons [SUSv3] | imaxabs [SUSv3] |
imaxdiv [SUSv3] | inet_addr [SUSv3] | inet_ntoa [SUSv3] | inet_ntop [SUSv3] |
inet_pton [SUSv3] | initstate [SUSv3] | insque [SUSv3] | isatty [SUSv3] |
isblank [SUSv3] | jrand48 [SUSv3] | l64a [SUSv3] | labs [SUSv3] |
lcong48 [SUSv3] | ldiv [SUSv3] | lfind [SUSv3] | llabs [SUSv3] |
lldiv [SUSv3] | longjmp [SUSv3] | lrand48 [SUSv3] | lsearch [SUSv3] |
makecontext [SUSv3] | malloc [SUSv3] | memmem [LSB] | mkstemp [SUSv3] |
mktemp [SUSv3] | mrand48 [SUSv3] | nftw [SUSv3] | nrand48 [SUSv3] |
ntohl [SUSv3] | ntohs [SUSv3] | openlog [SUSv3] | perror [SUSv3] |
posix_memalign [SUSv3] | posix_openpt [SUSv3] | ptsname [SUSv3] | putenv [SUSv3] |
qsort [SUSv3] | rand [SUSv3] | rand_r [SUSv3] | random [SUSv3] |
realloc [SUSv3] | realpath [SUSv3] | remque [SUSv3] | seed48 [SUSv3] |
setenv [SUSv3] | sethostname [LSB] | setlogmask [SUSv3] | setstate [SUSv3] |
srand [SUSv3] | srand48 [SUSv3] | srandom [SUSv3] | strtod [SUSv3] |
strtol [SUSv3] | strtoul [SUSv3] | swapcontext [SUSv3] | syslog [SUSv3] |
system [LSB] | tdelete [SUSv3] | tfind [SUSv3] | tmpfile [SUSv3] |
tmpnam [SUSv3] | tsearch [SUSv3] | ttyname [SUSv3] | ttyname_r [SUSv3] |
twalk [SUSv3] | unlockpt [SUSv3] | unsetenv [SUSv3] | usleep [SUSv3] |
verrx [LSB] | vfscanf [LSB] | vscanf [LSB] | vsscanf [LSB] |
vsyslog [LSB] | warn [LSB] | warnx [LSB] | wordexp [SUSv3] |
wordfree [SUSv3] |
An LSB conforming implementation shall provide the generic data interfaces for Standard Library specified in Table 13-23, with the full mandatory functionality as described in the referenced underlying specification.
This section defines global identifiers and their values that are associated with interfaces contained in libc. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
extern uint32_t htonl(uint32_t); extern uint16_t htons(uint16_t); extern in_addr_t inet_addr(const char *); extern char *inet_ntoa(struct in_addr); extern const char *inet_ntop(int, const void *, char *, socklen_t); extern int inet_pton(int, const char *, void *); extern uint32_t ntohl(uint32_t); extern uint16_t ntohs(uint16_t); |
The assert.h header shall define the
assert() macro. It refers to the macro
NDEBUG
, which is not defined in this
header.
If NDEBUG
is defined before the inclusion of
this header, the assert() macro shall be defined
as described below, otherwise the macro shall behave as described
in assert() in ISO/IEC 9945 POSIX.
extern void __assert_fail(const char *, const char *, unsigned int, const char *); |
enum { _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint, _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum }; extern int _tolower(int); extern int _toupper(int); extern int isalnum(int); extern int isalpha(int); extern int isascii(int); extern int iscntrl(int); extern int isdigit(int); extern int isgraph(int); extern int islower(int); extern int isprint(int); extern int ispunct(int); extern int isspace(int); extern int isupper(int); extern int isxdigit(int); extern int toascii(int); extern int tolower(int); extern int toupper(int); extern int isblank(int); extern const unsigned short **__ctype_b_loc(void); extern const int32_t **__ctype_toupper_loc(void); extern const int32_t **__ctype_tolower_loc(void); |
typedef struct __dirstream DIR; struct dirent { long int d_ino; off_t d_off; unsigned short d_reclen; unsigned char d_type; char d_name[256]; }; struct dirent64 { uint64_t d_ino; int64_t d_off; unsigned short d_reclen; unsigned char d_type; char d_name[256]; }; extern void rewinddir(DIR *); extern void seekdir(DIR *, long int); extern long int telldir(DIR *); extern int closedir(DIR *); extern DIR *opendir(const char *); extern struct dirent *readdir(DIR *); extern struct dirent64 *readdir64(DIR *); extern int readdir_r(DIR *, struct dirent *, struct dirent **); |
extern void err(int, const char *, ...); extern void errx(int, const char *, ...); extern void warn(const char *, ...); extern void warnx(const char *, ...); extern void error(int, int, const char *, ...); |
ISO POSIX (2003) requires that each error value shall be unique, with permission for EAGAIN and EWOULDBLOCK possibly having the same value. This specification also requires that ENOTSUP and EOPNOTSUPP have the same value.
Note: A defect report against ISO POSIX (2003) has been filed to request that specification also permit these two symbols to have the same value.
#define errno (*__errno_location()) #define EPERM 1 #define ECHILD 10 #define ENETDOWN 100 #define ENETUNREACH 101 #define ENETRESET 102 #define ECONNABORTED 103 #define ECONNRESET 104 #define ENOBUFS 105 #define EISCONN 106 #define ENOTCONN 107 #define ESHUTDOWN 108 #define ETOOMANYREFS 109 #define EAGAIN 11 #define ETIMEDOUT 110 #define ECONNREFUSED 111 #define EHOSTDOWN 112 #define EHOSTUNREACH 113 #define EALREADY 114 #define EINPROGRESS 115 #define ESTALE 116 #define EUCLEAN 117 #define ENOTNAM 118 #define ENAVAIL 119 #define ENOMEM 12 #define EISNAM 120 #define EREMOTEIO 121 #define EDQUOT 122 #define ENOMEDIUM 123 #define EMEDIUMTYPE 124 #define ECANCELED 125 #define EACCES 13 #define EFAULT 14 #define ENOTBLK 15 #define EBUSY 16 #define EEXIST 17 #define EXDEV 18 #define ENODEV 19 #define ENOENT 2 #define ENOTDIR 20 #define EISDIR 21 #define EINVAL 22 #define ENFILE 23 #define EMFILE 24 #define ENOTTY 25 #define ETXTBSY 26 #define EFBIG 27 #define ENOSPC 28 #define ESPIPE 29 #define ESRCH 3 #define EROFS 30 #define EMLINK 31 #define EPIPE 32 #define EDOM 33 #define ERANGE 34 #define EDEADLK 35 #define ENAMETOOLONG 36 #define ENOLCK 37 #define ENOSYS 38 #define ENOTEMPTY 39 #define EINTR 4 #define ELOOP 40 #define ENOMSG 42 #define EIDRM 43 #define ECHRNG 44 #define EL2NSYNC 45 #define EL3HLT 46 #define EL3RST 47 #define ELNRNG 48 #define EUNATCH 49 #define EIO 5 #define ENOANO 55 #define EBADRQC 56 #define EBADSLT 57 #define EBFONT 59 #define ENXIO 6 #define ENOSTR 60 #define ENODATA 61 #define ETIME 62 #define ENOSR 63 #define ENONET 64 #define ENOPKG 65 #define EREMOTE 66 #define ENOLINK 67 #define EADV 68 #define ESRMNT 69 #define E2BIG 7 #define ECOMM 70 #define EPROTO 71 #define EMULTIHOP 72 #define EDOTDOT 73 #define EBADMSG 74 #define EOVERFLOW 75 #define ENOTUNIQ 76 #define EBADFD 77 #define EREMCHG 78 #define ELIBACC 79 #define ENOEXEC 8 #define ELIBBAD 80 #define ELIBSCN 81 #define ELIBMAX 82 #define ELIBEXEC 83 #define EILSEQ 84 #define ERESTART 85 #define ESTRPIPE 86 #define EUSERS 87 #define ENOTSOCK 88 #define EDESTADDRREQ 89 #define EBADF 9 #define EMSGSIZE 90 #define EPROTOTYPE 91 #define ENOPROTOOPT 92 #define EPROTONOSUPPORT 93 #define ESOCKTNOSUPPORT 94 #define EOPNOTSUPP 95 #define EPFNOSUPPORT 96 #define EAFNOSUPPORT 97 #define EADDRINUSE 98 #define EADDRNOTAVAIL 99 #define EWOULDBLOCK EAGAIN #define ENOTSUP EOPNOTSUPP extern int *__errno_location(void); |
#define O_RDONLY 00 #define O_ACCMODE 0003 #define O_WRONLY 01 #define O_CREAT 0100 #define O_TRUNC 01000 #define O_SYNC 010000 #define O_RDWR 02 #define O_EXCL 0200 #define O_APPEND 02000 #define O_ASYNC 020000 #define O_NOCTTY 0400 #define O_NDELAY 04000 #define O_NONBLOCK 04000 #define FD_CLOEXEC 1 struct flock { short l_type; short l_whence; off_t l_start; off_t l_len; pid_t l_pid; }; struct flock64 { short l_type; short l_whence; loff_t l_start; loff_t l_len; pid_t l_pid; }; #define F_DUPFD 0 #define F_RDLCK 0 #define F_GETFD 1 #define F_WRLCK 1 #define F_SETFD 2 #define F_UNLCK 2 #define F_GETFL 3 #define F_SETFL 4 #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 #define F_SETOWN 8 #define F_GETOWN 9 extern int lockf64(int, int, off64_t); extern int fcntl(int, int, ...); |
#define MM_HARD 1 #define MM_NRECOV 128 #define MM_UTIL 16 #define MM_SOFT 2 #define MM_OPSYS 32 #define MM_FIRM 4 #define MM_RECOVER 64 #define MM_APPL 8 #define MM_NOSEV 0 #define MM_HALT 1 #define MM_ERROR 2 #define MM_NULLLBL ((char *) 0) extern int fmtmsg(long int, const char *, int, const char *, const char *, const char *); |
#define FNM_PATHNAME (1<<0) #define FNM_NOESCAPE (1<<1) #define FNM_PERIOD (1<<2) #define FNM_NOMATCH 1 extern int fnmatch(const char *, const char *, int); |
#define FTW_D FTW_D #define FTW_DNR FTW_DNR #define FTW_DP FTW_DP #define FTW_F FTW_F #define FTW_NS FTW_NS #define FTW_SL FTW_SL #define FTW_SLN FTW_SLN enum { FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN }; enum { FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH }; struct FTW { int base; int level; }; typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, int __flag); typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, int __flag); typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, int __flag, struct FTW * __info); typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, int __flag, struct FTW * __info); extern int ftw(const char *, __ftw_func_t, int); extern int ftw64(const char *, __ftw64_func_t, int); extern int nftw(const char *, __nftw_func_t, int, int); extern int nftw64(const char *, __nftw64_func_t, int, int); |
#define no_argument 0 #define required_argument 1 #define optional_argument 2 struct option { char *name; int has_arg; int *flag; int val; }; extern int getopt_long(int, char *const, const char *, const struct option *, int *); extern int getopt_long_only(int, char *const, const char *, const struct option *, int *); |
#define GLOB_ERR (1<<0) #define GLOB_MARK (1<<1) #define GLOB_BRACE (1<<10) #define GLOB_NOMAGIC (1<<11) #define GLOB_TILDE (1<<12) #define GLOB_ONLYDIR (1<<13) #define GLOB_TILDE_CHECK (1<<14) #define GLOB_NOSORT (1<<2) #define GLOB_DOOFFS (1<<3) #define GLOB_NOCHECK (1<<4) #define GLOB_APPEND (1<<5) #define GLOB_NOESCAPE (1<<6) #define GLOB_PERIOD (1<<7) #define GLOB_MAGCHAR (1<<8) #define GLOB_ALTDIRFUNC (1<<9) #define GLOB_NOSPACE 1 #define GLOB_ABORTED 2 #define GLOB_NOMATCH 3 #define GLOB_NOSYS 4 typedef struct { size_t gl_pathc; char **gl_pathv; size_t gl_offs; int gl_flags; void (*gl_closedir) (void *); struct dirent *(*gl_readdir) (void *); void *(*gl_opendir) (const char *); int (*gl_lstat) (const char *, struct stat *); int (*gl_stat) (const char *, struct stat *); } glob_t; typedef struct { size_t gl_pathc; char **gl_pathv; size_t gl_offs; int gl_flags; void (*gl_closedir) (void *); struct dirent64 *(*gl_readdir64) (void *); void *(*gl_opendir) (const char *); int (*gl_lstat) (const char *, struct stat *); int (*gl_stat) (const char *, struct stat *); } glob64_t; extern int glob(const char *, int, int (*__errfunc) (const char *p1, int p2) , glob_t *); extern int glob64(const char *, int, int (*__errfunc) (const char *p1, int p2) , glob64_t *); extern void globfree(glob_t *); extern void globfree64(glob64_t *); |
struct group { char *gr_name; char *gr_passwd; gid_t gr_gid; char **gr_mem; }; extern void endgrent(void); extern struct group *getgrent(void); extern struct group *getgrgid(gid_t); extern struct group *getgrnam(char *); extern int initgroups(const char *, gid_t); extern void setgrent(void); extern int setgroups(size_t, const gid_t *); extern int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); extern int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); extern int getgrouplist(const char *, gid_t, gid_t *, int *); |
typedef void *iconv_t; extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); extern int iconv_close(iconv_t); extern iconv_t iconv_open(char *, char *); |
typedef lldiv_t imaxdiv_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; extern intmax_t strtoimax(const char *, char **, int); extern uintmax_t strtoumax(const char *, char **, int); extern intmax_t wcstoimax(const wchar_t *, wchar_t * *, int); extern uintmax_t wcstoumax(const wchar_t *, wchar_t * *, int); extern intmax_t imaxabs(intmax_t); extern imaxdiv_t imaxdiv(intmax_t, intmax_t); |
#define ABDAY_1 0x20000 #define ABDAY_2 0x20001 #define ABDAY_3 0x20002 #define ABDAY_4 0x20003 #define ABDAY_5 0x20004 #define ABDAY_6 0x20005 #define ABDAY_7 0x20006 #define DAY_1 0x20007 #define DAY_2 0x20008 #define DAY_3 0x20009 #define DAY_4 0x2000A #define DAY_5 0x2000B #define DAY_6 0x2000C #define DAY_7 0x2000D #define ABMON_1 0x2000E #define ABMON_2 0x2000F #define ABMON_3 0x20010 #define ABMON_4 0x20011 #define ABMON_5 0x20012 #define ABMON_6 0x20013 #define ABMON_7 0x20014 #define ABMON_8 0x20015 #define ABMON_9 0x20016 #define ABMON_10 0x20017 #define ABMON_11 0x20018 #define ABMON_12 0x20019 #define MON_1 0x2001A #define MON_2 0x2001B #define MON_3 0x2001C #define MON_4 0x2001D #define MON_5 0x2001E #define MON_6 0x2001F #define MON_7 0x20020 #define MON_8 0x20021 #define MON_9 0x20022 #define MON_10 0x20023 #define MON_11 0x20024 #define MON_12 0x20025 #define AM_STR 0x20026 #define PM_STR 0x20027 #define D_T_FMT 0x20028 #define D_FMT 0x20029 #define T_FMT 0x2002A #define T_FMT_AMPM 0x2002B #define ERA 0x2002C #define ERA_D_FMT 0x2002E #define ALT_DIGITS 0x2002F #define ERA_D_T_FMT 0x20030 #define ERA_T_FMT 0x20031 #define CODESET 14 #define CRNCYSTR 0x4000F #define RADIXCHAR 0x10000 #define THOUSEP 0x10001 #define YESEXPR 0x50000 #define NOEXPR 0x50001 #define YESSTR 0x50002 #define NOSTR 0x50003 extern char *nl_langinfo(nl_item); |
extern char *bindtextdomain(const char *, const char *); extern char *dcgettext(const char *, const char *, int); extern char *dgettext(const char *, const char *); extern char *gettext(const char *); extern char *textdomain(const char *); extern char *bind_textdomain_codeset(const char *, const char *); extern char *dcngettext(const char *, const char *, const char *, unsigned long int, int); extern char *dngettext(const char *, const char *, const char *, unsigned long int); extern char *ngettext(const char *, const char *, unsigned long int); |
#define LLONG_MIN (-LLONG_MAX-1LL) #define ULLONG_MAX 18446744073709551615ULL #define OPEN_MAX 256 #define PATH_MAX 4096 #define LLONG_MAX 9223372036854775807LL #define SSIZE_MAX LONG_MAX #define MB_LEN_MAX 16 #define SCHAR_MIN (-128) #define SCHAR_MAX 127 #define UCHAR_MAX 255 #define CHAR_BIT 8 #define SHRT_MIN (-32768) #define SHRT_MAX 32767 #define USHRT_MAX 65535 #define INT_MIN (-INT_MAX-1) #define INT_MAX 2147483647 #define __INT_MAX__ 2147483647 #define UINT_MAX 4294967295U #define LONG_MIN (-LONG_MAX-1L) #define PTHREAD_KEYS_MAX 1024 #define PTHREAD_THREADS_MAX 16384 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 |
struct lconv { char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping; char *positive_sign; char *negative_sign; char int_frac_digits; char frac_digits; char p_cs_precedes; char p_sep_by_space; char n_cs_precedes; char n_sep_by_space; char p_sign_posn; char n_sign_posn; char int_p_cs_precedes; char int_p_sep_by_space; char int_n_cs_precedes; char int_n_sep_by_space; char int_p_sign_posn; char int_n_sign_posn; }; #define LC_GLOBAL_LOCALE ((locale_t) -1L) #define LC_CTYPE 0 #define LC_NUMERIC 1 #define LC_TELEPHONE 10 #define LC_MEASUREMENT 11 #define LC_IDENTIFICATION 12 #define LC_TIME 2 #define LC_COLLATE 3 #define LC_MONETARY 4 #define LC_MESSAGES 5 #define LC_ALL 6 #define LC_PAPER 7 #define LC_NAME 8 #define LC_ADDRESS 9 typedef struct __locale_struct { struct locale_data *__locales[13]; const unsigned short *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; } *__locale_t; typedef struct __locale_struct *locale_t; #define LC_ADDRESS_MASK (1 << LC_ADDRESS) #define LC_COLLATE_MASK (1 << LC_COLLATE) #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) #define LC_MESSAGES_MASK (1 << LC_MESSAGES) #define LC_MONETARY_MASK (1 << LC_MONETARY) #define LC_NAME_MASK (1 << LC_NAME) #define LC_NUMERIC_MASK (1 << LC_NUMERIC) #define LC_PAPER_MASK (1 << LC_PAPER) #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) #define LC_TIME_MASK (1 << LC_TIME) #define LC_CTYPE_MASK (1<<LC_CTYPE) #define LC_ALL_MASK \ (LC_CTYPE_MASK| LC_NUMERIC_MASK| LC_TIME_MASK| LC_COLLATE_MASK| LC_MONETARY_MASK|\ LC_MESSAGES_MASK| LC_PAPER_MASK| LC_NAME_MASK| LC_ADDRESS_MASK| LC_TELEPHONE_MASK|\ LC_MEASUREMENT_MASK| LC_IDENTIFICATION_MASK) extern struct lconv *localeconv(void); extern char *setlocale(int, const char *); extern locale_t uselocale(locale_t); extern void freelocale(locale_t); extern locale_t duplocale(locale_t); extern locale_t newlocale(int, const char *, locale_t); |
#define IF_NAMESIZE 16 #define IFF_UP 0x01 #define IFF_BROADCAST 0x02 #define IFF_DEBUG 0x04 #define IFF_LOOPBACK 0x08 #define IFF_POINTOPOINT 0x10 #define IFF_PROMISC 0x100 #define IFF_MULTICAST 0x1000 #define IFF_NOTRAILERS 0x20 #define IFF_RUNNING 0x40 #define IFF_NOARP 0x80 struct if_nameindex { unsigned int if_index; char *if_name; }; struct ifaddr { struct sockaddr ifa_addr; union { struct sockaddr ifu_broadaddr; struct sockaddr ifu_dstaddr; } ifa_ifu; void *ifa_ifp; void *ifa_next; }; #define IFNAMSIZ IF_NAMESIZE struct ifreq { union { char ifrn_name[IFNAMSIZ]; } ifr_ifrn; union { struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; struct sockaddr ifru_netmask; struct sockaddr ifru_hwaddr; short ifru_flags; int ifru_ivalue; int ifru_mtu; char ifru_slave[IFNAMSIZ]; char ifru_newname[IFNAMSIZ]; caddr_t ifru_data; struct ifmap ifru_map; } ifr_ifru; }; struct ifconf { int ifc_len; union { caddr_t ifcu_buf; struct ifreq *ifcu_req; } ifc_ifcu; }; extern void if_freenameindex(struct if_nameindex *); extern char *if_indextoname(unsigned int, char *); extern struct if_nameindex *if_nameindex(void); extern unsigned int if_nametoindex(const char *); |
#define NETDB_INTERNAL -1 #define NETDB_SUCCESS 0 #define HOST_NOT_FOUND 1 #define IPPORT_RESERVED 1024 #define NI_MAXHOST 1025 #define TRY_AGAIN 2 #define NO_RECOVERY 3 #define NI_MAXSERV 32 #define NO_DATA 4 #define h_addr h_addr_list[0] #define NO_ADDRESS NO_DATA struct servent { char *s_name; char **s_aliases; int s_port; char *s_proto; }; struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; struct protoent { char *p_name; char **p_aliases; int p_proto; }; struct netent { char *n_name; char **n_aliases; int n_addrtype; unsigned int n_net; }; #define AI_PASSIVE 0x0001 #define AI_CANONNAME 0x0002 #define AI_NUMERICHOST 0x0004 struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; socklen_t ai_addrlen; struct sockaddr *ai_addr; char *ai_canonname; struct addrinfo *ai_next; }; #define NI_NUMERICHOST 1 #define NI_DGRAM 16 #define NI_NUMERICSERV 2 #define NI_NOFQDN 4 #define NI_NAMEREQD 8 #define EAI_BADFLAGS -1 #define EAI_MEMORY -10 #define EAI_SYSTEM -11 #define EAI_NONAME -2 #define EAI_AGAIN -3 #define EAI_FAIL -4 #define EAI_NODATA -5 #define EAI_FAMILY -6 #define EAI_SOCKTYPE -7 #define EAI_SERVICE -8 #define EAI_ADDRFAMILY -9 extern void endprotoent(void); extern void endservent(void); extern void freeaddrinfo(struct addrinfo *); extern const char *gai_strerror(int); extern int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); extern struct hostent *gethostbyaddr(const void *, socklen_t, int); extern struct hostent *gethostbyname(const char *); extern struct protoent *getprotobyname(const char *); extern struct protoent *getprotobynumber(int); extern struct protoent *getprotoent(void); extern struct servent *getservbyname(const char *, const char *); extern struct servent *getservbyport(int, const char *); extern struct servent *getservent(void); extern void setprotoent(int); extern void setservent(int); extern int *__h_errno_location(void); |
#define IPPROTO_IP 0 #define IPPROTO_ICMP 1 #define IPPROTO_UDP 17 #define IPPROTO_IGMP 2 #define IPPROTO_RAW 255 #define IPPROTO_IPV6 41 #define IPPROTO_ICMPV6 58 #define IPPROTO_TCP 6 typedef uint16_t in_port_t; struct in_addr { uint32_t s_addr; }; typedef uint32_t in_addr_t; #define INADDR_NONE ((in_addr_t) 0xffffffff) #define INADDR_BROADCAST (0xffffffff) #define INADDR_ANY 0 struct in6_addr { union { uint8_t u6_addr8[16]; uint16_t u6_addr16[8]; uint32_t u6_addr32[4]; } in6_u; }; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #define INET_ADDRSTRLEN 16 struct sockaddr_in { sa_family_t sin_family; unsigned short sin_port; struct in_addr sin_addr; unsigned char sin_zero[8]; }; #define INET6_ADDRSTRLEN 46 struct sockaddr_in6 { unsigned short sin6_family; uint16_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; }; #define SOL_IP 0 #define IP_TOS 1 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IP_TTL 2 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_V6ONLY 26 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 #define IP_OPTIONS 4 struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; int ipv6mr_interface; }; struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; extern int bindresvport(int, struct sockaddr_in *); |
#define IPTOS_LOWCOST 0x02 #define IPTOS_RELIABILITY 0x04 #define IPTOS_THROUGHPUT 0x08 #define IPTOS_LOWDELAY 0x10 #define IPTOS_TOS_MASK 0x1e #define IPTOS_MINCOST IPTOS_LOWCOST #define IPTOS_PREC_MASK 0xe0 |
#define NL_CAT_LOCALE 1 #define NL_SETD 1 typedef void *nl_catd; typedef int nl_item; extern int catclose(nl_catd); extern char *catgets(nl_catd, int, int, const char *); extern nl_catd catopen(const char *, int); |
extern int openpty(int *, int *, char *, struct termios *, struct winsize *); extern int forkpty(int *, char *, struct termios *, struct winsize *); |
struct passwd { char *pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; char *pw_gecos; char *pw_dir; char *pw_shell; }; extern void endpwent(void); extern struct passwd *getpwent(void); extern struct passwd *getpwnam(char *); extern struct passwd *getpwuid(uid_t); extern void setpwent(void); extern int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **); extern int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); |
typedef unsigned long int reg_syntax_t; typedef struct re_pattern_buffer { unsigned char *buffer; unsigned long int allocated; unsigned long int used; reg_syntax_t syntax; char *fastmap; char *translate; size_t re_nsub; unsigned int can_be_null:1; unsigned int regs_allocated:2; unsigned int fastmap_accurate:1; unsigned int no_sub:1; unsigned int not_bol:1; unsigned int not_eol:1; unsigned int newline_anchor:1; } regex_t; typedef int regoff_t; typedef struct { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; #define REG_ICASE (REG_EXTENDED<<1) #define REG_NEWLINE (REG_ICASE<<1) #define REG_NOSUB (REG_NEWLINE<<1) #define REG_EXTENDED 1 #define REG_NOTEOL (1<<1) #define REG_NOTBOL 1 typedef enum { REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND, REG_ESIZE, REG_ERPAREN } reg_errcode_t; extern int regcomp(regex_t *, const char *, int); extern size_t regerror(int, const regex_t *, char *, size_t); extern int regexec(const regex_t *, const char *, size_t, regmatch_t, int); extern void regfree(regex_t *); |
enum auth_stat { AUTH_OK, AUTH_BADCRED = 1, AUTH_REJECTEDCRED = 2, AUTH_BADVERF = 3, AUTH_REJECTEDVERF = 4, AUTH_TOOWEAK = 5, AUTH_INVALIDRESP = 6, AUTH_FAILED = 7 }; union des_block { struct { u_int32_t high; u_int32_t low; } key; char c[8]; }; struct opaque_auth { enum_t oa_flavor; caddr_t oa_base; u_int oa_length; }; typedef struct AUTH { struct opaque_auth ah_cred; struct opaque_auth ah_verf; union des_block ah_key; struct auth_ops *ah_ops; caddr_t ah_private; } AUTH; struct auth_ops { void (*ah_nextverf) (struct AUTH *); int (*ah_marshal) (struct AUTH *, XDR *); int (*ah_validate) (struct AUTH *, struct opaque_auth *); int (*ah_refresh) (struct AUTH *); void (*ah_destroy) (struct AUTH *); }; extern struct AUTH *authnone_create(void); extern int key_decryptsession(char *, union des_block *); extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); |
#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) #define NULLPROC ((u_long)0) #define CLSET_TIMEOUT 1 #define CLGET_XID 10 #define CLSET_XID 11 #define CLGET_VERS 12 #define CLSET_VERS 13 #define CLGET_PROG 14 #define CLSET_PROG 15 #define CLGET_TIMEOUT 2 #define CLGET_SERVER_ADDR 3 #define CLSET_RETRY_TIMEOUT 4 #define CLGET_RETRY_TIMEOUT 5 #define CLGET_FD 6 #define CLGET_SVC_ADDR 7 #define CLSET_FD_CLOSE 8 #define CLSET_FD_NCLOSE 9 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) enum clnt_stat { RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTSEND = 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTERED = 15, RPC_N2AXLATEFAILURE = 22, RPC_FAILED = 16, RPC_INTR = 18, RPC_TLIERROR = 20, RPC_UDERROR = 23, RPC_INPROGRESS = 24, RPC_STALERACHANDLE = 25 }; struct rpc_err { enum clnt_stat re_status; union { int RE_errno; enum auth_stat RE_why; struct { u_long low; u_long high; } RE_vers; struct { long int s1; long int s2; } RE_lb; } ru; }; typedef struct CLIENT { struct AUTH *cl_auth; struct clnt_ops *cl_ops; caddr_t cl_private; } CLIENT; struct clnt_ops { enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval); void (*cl_abort) (void); void (*cl_geterr) (struct CLIENT *, struct rpc_err *); bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); void (*cl_destroy) (struct CLIENT *); bool_t(*cl_control) (struct CLIENT *, int, char *); }; extern struct CLIENT *clnt_create(const char *, const u_long, const u_long, const char *); extern void clnt_pcreateerror(const char *); extern void clnt_perrno(enum clnt_stat); extern void clnt_perror(struct CLIENT *, const char *); extern char *clnt_spcreateerror(const char *); extern char *clnt_sperrno(enum clnt_stat); extern char *clnt_sperror(struct CLIENT *, const char *); |
extern u_short pmap_getport(struct sockaddr_in *, const u_long, const u_long, u_int); extern bool_t pmap_set(const u_long, const u_long, int, u_short); extern bool_t pmap_unset(u_long, u_long); |
enum msg_type { CALL, REPLY = 1 }; enum reply_stat { MSG_ACCEPTED, MSG_DENIED = 1 }; enum accept_stat { SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 }; enum reject_stat { RPC_MISMATCH, AUTH_ERROR = 1 }; struct accepted_reply { struct opaque_auth ar_verf; enum accept_stat ar_stat; union { struct { unsigned long int low; unsigned long int high; } AR_versions; struct { caddr_t where; xdrproc_t proc; } AR_results; } ru; }; struct rejected_reply { enum reject_stat rj_stat; union { struct { unsigned long int low; unsigned long int high; } RJ_versions; enum auth_stat RJ_why; } ru; }; struct reply_body { enum reply_stat rp_stat; union { struct accepted_reply RP_ar; struct rejected_reply RP_dr; } ru; }; struct call_body { unsigned long int cb_rpcvers; unsigned long int cb_prog; unsigned long int cb_vers; unsigned long int cb_proc; struct opaque_auth cb_cred; struct opaque_auth cb_verf; }; struct rpc_msg { unsigned long int rm_xid; enum msg_type rm_direction; union { struct call_body RM_cmb; struct reply_body RM_rmb; } ru; }; extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); |
#define RPC_ANYSOCK -1 #define svc_freeargs(xprt,xargs, argsp) \ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) #define svc_getargs(xprt,xargs, argsp) \ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) enum xprt_stat { XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE }; typedef struct SVCXPRT { int xp_sock; u_short xp_port; struct xp_ops *xp_ops; int xp_addrlen; struct sockaddr_in xp_raddr; struct opaque_auth xp_verf; caddr_t xp_p1; caddr_t xp_p2; char xp_pad[256]; } SVCXPRT; struct svc_req { rpcprog_t rq_prog; rpcvers_t rq_vers; rpcproc_t rq_proc; struct opaque_auth rq_cred; caddr_t rq_clntcred; SVCXPRT *rq_xprt; }; typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); struct xp_ops { bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, caddr_t args_ptr); bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, caddr_t args_ptr); void (*xp_destroy) (SVCXPRT * __xprt); }; extern void svc_getreqset(fd_set *); extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, __dispatch_fn_t, rpcprot_t); extern void svc_run(void); extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); extern void svcerr_auth(SVCXPRT *, enum auth_stat); extern void svcerr_decode(SVCXPRT *); extern void svcerr_noproc(SVCXPRT *); extern void svcerr_noprog(SVCXPRT *); extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); extern void svcerr_systemerr(SVCXPRT *); extern void svcerr_weakauth(SVCXPRT *); extern SVCXPRT *svctcp_create(int, u_int, u_int); extern SVCXPRT *svcudp_create(int); |
typedef int bool_t; typedef int enum_t; typedef unsigned long int rpcprog_t; typedef unsigned long int rpcvers_t; typedef unsigned long int rpcproc_t; typedef unsigned long int rpcprot_t; |
enum xdr_op { XDR_ENCODE, XDR_DECODE, XDR_FREE }; typedef struct XDR { enum xdr_op x_op; struct xdr_ops *x_ops; caddr_t x_public; caddr_t x_private; caddr_t x_base; int x_handy; } XDR; struct xdr_ops { bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); u_int(*x_getpostn) (XDR * __xdrs); bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); int32_t *(*x_inline) (XDR * __xdrs, int __len); void (*x_destroy) (XDR * __xdrs); bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); }; typedef bool_t(*xdrproc_t) (XDR *, void *, ...); struct xdr_discrim { int value; xdrproc_t proc; }; extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, xdrproc_t); extern bool_t xdr_bool(XDR *, bool_t *); extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); extern bool_t xdr_char(XDR *, char *); extern bool_t xdr_double(XDR *, double *); extern bool_t xdr_enum(XDR *, enum_t *); extern bool_t xdr_float(XDR *, float *); extern void xdr_free(xdrproc_t, char *); extern bool_t xdr_int(XDR *, int *); extern bool_t xdr_long(XDR *, long int *); extern bool_t xdr_opaque(XDR *, caddr_t, u_int); extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); extern bool_t xdr_short(XDR *, short *); extern bool_t xdr_string(XDR *, char **, u_int); extern bool_t xdr_u_char(XDR *, u_char *); extern bool_t xdr_u_int(XDR *, u_int *); extern bool_t xdr_u_long(XDR *, u_long *); extern bool_t xdr_u_short(XDR *, u_short *); extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t); extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); extern bool_t xdr_void(void); extern bool_t xdr_wrapstring(XDR *, char **); extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); extern void xdrrec_create(XDR *, u_int, u_int, caddr_t, int (*__readit) (char *p1, char *p2, int p3) , int (*__writeit) (char *p1, char *p2, int p3) ); extern typedef int bool_t xdrrec_eof(XDR *); |
#define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 struct sched_param { int sched_priority; }; extern int sched_get_priority_max(int); extern int sched_get_priority_min(int); extern int sched_getparam(pid_t, struct sched_param *); extern int sched_getscheduler(pid_t); extern int sched_rr_get_interval(pid_t, struct timespec *); extern int sched_setparam(pid_t, const struct sched_param *); extern int sched_setscheduler(pid_t, int, const struct sched_param *); extern int sched_yield(void); |
typedef struct entry { char *key; void *data; } ENTRY; typedef enum { FIND, ENTER } ACTION; typedef enum { preorder, postorder, endorder, leaf } VISIT; typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); extern int hcreate(size_t); extern ENTRY *hsearch(ENTRY, ACTION); extern void insque(void *, void *); extern void *lfind(const void *, const void *, size_t *, size_t, __compar_fn_t); extern void *lsearch(const void *, void *, size_t *, size_t, __compar_fn_t); extern void remque(void *); extern void hdestroy(void); extern void *tdelete(const void *, void **, __compar_fn_t); extern void *tfind(const void *, void *const *, __compar_fn_t); extern void *tsearch(const void *, void **, __compar_fn_t); extern void twalk(const void *, __action_fn_t); |
#define setjmp(env) _setjmp(env) #define sigsetjmp(a,b) __sigsetjmp(a,b) struct __jmp_buf_tag { __jmp_buf __jmpbuf; int __mask_was_saved; sigset_t __saved_mask; }; typedef struct __jmp_buf_tag jmp_buf[1]; typedef jmp_buf sigjmp_buf; extern int __sigsetjmp(jmp_buf, int); extern void longjmp(jmp_buf, int); extern void siglongjmp(sigjmp_buf, int); extern void _longjmp(jmp_buf, int); extern int _setjmp(jmp_buf); |
#define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) #define SIGRTMAX (__libc_current_sigrtmax ()) #define SIGRTMIN (__libc_current_sigrtmin ()) #define SIG_BLOCK 0 #define SIG_UNBLOCK 1 #define SIG_SETMASK 2 #define NSIG 65 typedef int sig_atomic_t; typedef void (*sighandler_t) (int); #define SIG_HOLD ((sighandler_t) 2) #define SIG_ERR ((sighandler_t)-1) #define SIG_DFL ((sighandler_t)0) #define SIG_IGN ((sighandler_t)1) #define SIGHUP 1 #define SIGUSR1 10 #define SIGSEGV 11 #define SIGUSR2 12 #define SIGPIPE 13 #define SIGALRM 14 #define SIGTERM 15 #define SIGSTKFLT 16 #define SIGCHLD 17 #define SIGCONT 18 #define SIGSTOP 19 #define SIGINT 2 #define SIGTSTP 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGURG 23 #define SIGXCPU 24 #define SIGXFSZ 25 #define SIGVTALRM 26 #define SIGPROF 27 #define SIGWINCH 28 #define SIGIO 29 #define SIGQUIT 3 #define SIGPWR 30 #define SIGSYS 31 #define SIGUNUSED 31 #define SIGILL 4 #define SIGTRAP 5 #define SIGABRT 6 #define SIGIOT 6 #define SIGBUS 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGCLD SIGCHLD #define SIGPOLL SIGIO #define SV_ONSTACK (1<<0) #define SV_INTERRUPT (1<<1) #define SV_RESETHAND (1<<2) typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; #define SIGEV_SIGNAL 0 #define SIGEV_NONE 1 #define SIGEV_THREAD 2 #define SIGEV_MAX_SIZE 64 typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[SIGEV_PAD_SIZE]; struct { void (*sigev_thread_func) (sigval_t); void *_attribute; } _sigev_thread; } _sigev_un; } sigevent_t; #define SI_MAX_SIZE 128 #define si_pid _sifields._kill._pid #define si_uid _sifields._kill._uid #define si_value _sifields._rt._sigval #define si_int _sifields._rt._sigval.sival_int #define si_ptr _sifields._rt._sigval.sival_ptr #define si_status _sifields._sigchld._status #define si_stime _sifields._sigchld._stime #define si_utime _sifields._sigchld._utime #define si_addr _sifields._sigfault._addr #define si_band _sifields._sigpoll._band #define si_fd _sifields._sigpoll._fd #define si_timer1 _sifields._timer._timer1 #define si_timer2 _sifields._timer._timer2 typedef struct siginfo { int si_signo; int si_errno; int si_code; union { int _pad[SI_PAD_SIZE]; struct { pid_t _pid; uid_t _uid; } _kill; struct { unsigned int _timer1; unsigned int _timer2; } _timer; struct { pid_t _pid; uid_t _uid; sigval_t _sigval; } _rt; struct { pid_t _pid; uid_t _uid; int _status; clock_t _utime; clock_t _stime; } _sigchld; struct { void *_addr; } _sigfault; struct { int _band; int _fd; } _sigpoll; } _sifields; } siginfo_t; #define SI_QUEUE -1 #define SI_TIMER -2 #define SI_MESGQ -3 #define SI_ASYNCIO -4 #define SI_SIGIO -5 #define SI_TKILL -6 #define SI_ASYNCNL -60 #define SI_USER 0 #define SI_KERNEL 0x80 #define ILL_ILLOPC 1 #define ILL_ILLOPN 2 #define ILL_ILLADR 3 #define ILL_ILLTRP 4 #define ILL_PRVOPC 5 #define ILL_PRVREG 6 #define ILL_COPROC 7 #define ILL_BADSTK 8 #define FPE_INTDIV 1 #define FPE_INTOVF 2 #define FPE_FLTDIV 3 #define FPE_FLTOVF 4 #define FPE_FLTUND 5 #define FPE_FLTRES 6 #define FPE_FLTINV 7 #define FPE_FLTSUB 8 #define SEGV_MAPERR 1 #define SEGV_ACCERR 2 #define BUS_ADRALN 1 #define BUS_ADRERR 2 #define BUS_OBJERR 3 #define TRAP_BRKPT 1 #define TRAP_TRACE 2 #define CLD_EXITED 1 #define CLD_KILLED 2 #define CLD_DUMPED 3 #define CLD_TRAPPED 4 #define CLD_STOPPED 5 #define CLD_CONTINUED 6 #define POLL_IN 1 #define POLL_OUT 2 #define POLL_MSG 3 #define POLL_ERR 4 #define POLL_PRI 5 #define POLL_HUP 6 typedef struct { unsigned long int sig[_SIGSET_NWORDS]; } sigset_t; #define SA_NOCLDSTOP 0x00000001 #define SA_NOCLDWAIT 0x00000002 #define SA_SIGINFO 0x00000004 #define SA_ONSTACK 0x08000000 #define SA_RESTART 0x10000000 #define SA_INTERRUPT 0x20000000 #define SA_NODEFER 0x40000000 #define SA_RESETHAND 0x80000000 #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; #define SS_ONSTACK 1 #define SS_DISABLE 2 extern int __libc_current_sigrtmax(void); extern int __libc_current_sigrtmin(void); extern sighandler_t __sysv_signal(int, sighandler_t); extern char *const _sys_siglist(void); extern int killpg(pid_t, int); extern void psignal(int, const char *); extern int raise(int); extern int sigaddset(sigset_t *, int); extern int sigandset(sigset_t *, const sigset_t *, const sigset_t *); extern int sigdelset(sigset_t *, int); extern int sigemptyset(sigset_t *); extern int sigfillset(sigset_t *); extern int sighold(int); extern int sigignore(int); extern int siginterrupt(int, int); extern int sigisemptyset(const sigset_t *); extern int sigismember(const sigset_t *, int); extern int sigorset(sigset_t *, const sigset_t *, const sigset_t *); extern int sigpending(sigset_t *); extern int sigrelse(int); extern sighandler_t sigset(int, sighandler_t); extern int pthread_kill(pthread_t, int); extern int pthread_sigmask(int, sigset_t *, sigset_t *); extern int sigaction(int, const struct sigaction *, struct sigaction *); extern int sigwait(sigset_t *, int *); extern int kill(pid_t, int); extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); extern sighandler_t signal(int, sighandler_t); extern int sigpause(int); extern int sigprocmask(int, const sigset_t *, sigset_t *); extern int sigreturn(struct sigcontext *); extern int sigsuspend(const sigset_t *); extern int sigqueue(pid_t, int, const union sigval); extern int sigwaitinfo(const sigset_t *, siginfo_t *); extern int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); extern sighandler_t bsd_signal(int, sighandler_t); |
#define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) #define NULL (0L) typedef int wchar_t; |
#define EOF (-1) #define P_tmpdir "/tmp" #define FOPEN_MAX 16 #define L_tmpnam 20 #define FILENAME_MAX 4096 #define BUFSIZ 8192 #define L_ctermid 9 #define L_cuserid 9 typedef struct { off_t __pos; mbstate_t __state; } fpos_t; typedef struct { off64_t __pos; mbstate_t __state; } fpos64_t; typedef struct _IO_FILE FILE; #define _IOFBF 0 #define _IOLBF 1 #define _IONBF 2 extern char *const _sys_errlist(void); extern void clearerr(FILE *); extern int fclose(FILE *); extern FILE *fdopen(int, const char *); extern int fflush_unlocked(FILE *); extern int fileno(FILE *); extern FILE *fopen(const char *, const char *); extern int fprintf(FILE *, const char *, ...); extern int fputc(int, FILE *); extern FILE *freopen(const char *, const char *, FILE *); extern FILE *freopen64(const char *, const char *, FILE *); extern int fscanf(FILE *, const char *, ...); extern int fseek(FILE *, long int, int); extern int fseeko(FILE *, off_t, int); extern int fseeko64(FILE *, loff_t, int); extern off_t ftello(FILE *); extern loff_t ftello64(FILE *); extern int getchar(void); extern int getchar_unlocked(void); extern int getw(FILE *); extern int pclose(FILE *); extern void perror(const char *); extern FILE *popen(const char *, const char *); extern int printf(const char *, ...); extern int putc_unlocked(int, FILE *); extern int putchar(int); extern int putchar_unlocked(int); extern int putw(int, FILE *); extern int remove(const char *); extern void rewind(FILE *); extern int scanf(const char *, ...); extern void setbuf(FILE *, char *); extern int sprintf(char *, const char *, ...); extern int sscanf(const char *, const char *, ...); extern FILE *stderr(void); extern FILE *stdin(void); extern FILE *stdout(void); extern char *tempnam(const char *, const char *); extern FILE *tmpfile64(void); extern FILE *tmpfile(void); extern char *tmpnam(char *); extern int vfprintf(FILE *, const char *, va_list); extern int vprintf(const char *, va_list); extern int feof(FILE *); extern int ferror(FILE *); extern int fflush(FILE *); extern int fgetc(FILE *); extern int fgetpos(FILE *, fpos_t *); extern char *fgets(char *, int, FILE *); extern int fputs(const char *, FILE *); extern size_t fread(void *, size_t, size_t, FILE *); extern int fsetpos(FILE *, const fpos_t *); extern long int ftell(FILE *); extern size_t fwrite(const void *, size_t, size_t, FILE *); extern int getc(FILE *); extern int putc(int, FILE *); extern int puts(const char *); extern int setvbuf(FILE *, char *, int, size_t); extern int snprintf(char *, size_t, const char *, ...); extern int ungetc(int, FILE *); extern int vsnprintf(char *, size_t, const char *, va_list); extern int vsprintf(char *, const char *, va_list); extern void flockfile(FILE *); extern int asprintf(char **, const char *, ...); extern int fgetpos64(FILE *, fpos64_t *); extern FILE *fopen64(const char *, const char *); extern int fsetpos64(FILE *, const fpos64_t *); extern int ftrylockfile(FILE *); extern void funlockfile(FILE *); extern int getc_unlocked(FILE *); extern void setbuffer(FILE *, char *, size_t); extern int vasprintf(char **, const char *, va_list); extern int vdprintf(int, const char *, va_list); extern int vfscanf(FILE *, const char *, va_list); extern int vscanf(const char *, va_list); extern int vsscanf(const char *, const char *, va_list); extern size_t __fpending(FILE *); |
#define MB_CUR_MAX (__ctype_get_mb_cur_max()) #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 #define RAND_MAX 2147483647 typedef int (*__compar_fn_t) (const void *, const void *); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; typedef struct { long long int quot; long long int rem; } lldiv_t; extern double __strtod_internal(const char *, char **, int); extern float __strtof_internal(const char *, char **, int); extern long int __strtol_internal(const char *, char **, int, int); extern long double __strtold_internal(const char *, char **, int); extern long long int __strtoll_internal(const char *, char **, int, int); extern unsigned long int __strtoul_internal(const char *, char **, int, int); extern unsigned long long int __strtoull_internal(const char *, char **, int, int); extern long int a64l(const char *); extern void abort(void); extern int abs(int); extern double atof(const char *); extern int atoi(char *); extern long int atol(char *); extern long long int atoll(const char *); extern void *bsearch(const void *, const void *, size_t, size_t, __compar_fn_t); extern div_t div(int, int); extern double drand48(void); extern char *ecvt(double, int, int *, int *); extern double erand48(unsigned short); extern void exit(int); extern char *fcvt(double, int, int *, int *); extern char *gcvt(double, int, char *); extern char *getenv(const char *); extern int getsubopt(char **, char *const *, char **); extern int grantpt(int); extern long int jrand48(unsigned short); extern char *l64a(long int); extern long int labs(long int); extern void lcong48(unsigned short); extern ldiv_t ldiv(long int, long int); extern long long int llabs(long long int); extern lldiv_t lldiv(long long int, long long int); extern long int lrand48(void); extern int mblen(const char *, size_t); extern size_t mbstowcs(wchar_t *, const char *, size_t); extern int mbtowc(wchar_t *, const char *, size_t); extern char *mktemp(char *); extern long int mrand48(void); extern long int nrand48(unsigned short); extern char *ptsname(int); extern int putenv(char *); extern void qsort(void *, size_t, size_t, __compar_fn_t); extern int rand(void); extern int rand_r(unsigned int *); extern unsigned short *seed48(unsigned short); extern void srand48(long int); extern int unlockpt(int); extern size_t wcstombs(char *, const wchar_t *, size_t); extern int wctomb(char *, wchar_t); extern int system(const char *); extern void *calloc(size_t, size_t); extern void free(void *); extern char *initstate(unsigned int, char *, size_t); extern void *malloc(size_t); extern long int random(void); extern void *realloc(void *, size_t); extern char *setstate(char *); extern void srand(unsigned int); extern void srandom(unsigned int); extern double strtod(char *, char **); extern float strtof(const char *, char **); extern long int strtol(char *, char **, int); extern long double strtold(const char *, char **); extern long long int strtoll(const char *, char **, int); extern long long int strtoq(const char *, char **, int); extern unsigned long int strtoul(const char *, char **, int); extern unsigned long long int strtoull(const char *, char **, int); extern unsigned long long int strtouq(const char *, char **, int); extern void _Exit(int); extern size_t __ctype_get_mb_cur_max(void); extern char **environ(void); extern char *realpath(const char *, char *); extern int setenv(const char *, const char *, int); extern int unsetenv(const char *); extern int getloadavg(double, int); extern int mkstemp64(char *); extern int posix_memalign(void **, size_t, size_t); extern int posix_openpt(int); |
extern void *__mempcpy(void *, const void *, size_t); extern char *__stpcpy(char *, const char *); extern char *__strtok_r(char *, const char *, char **); extern void bcopy(void *, void *, size_t); extern void *memchr(void *, int, size_t); extern int memcmp(void *, void *, size_t); extern void *memcpy(void *, void *, size_t); extern void *memmem(const void *, size_t, const void *, size_t); extern void *memmove(void *, const void *, size_t); extern void *memset(void *, int, size_t); extern char *strcat(char *, const char *); extern char *strchr(char *, int); extern int strcmp(char *, char *); extern int strcoll(const char *, const char *); extern char *strcpy(char *, char *); extern size_t strcspn(const char *, const char *); extern char *strerror(int); extern size_t strlen(char *); extern char *strncat(char *, char *, size_t); extern int strncmp(char *, char *, size_t); extern char *strncpy(char *, char *, size_t); extern char *strpbrk(const char *, const char *); extern char *strrchr(char *, int); extern char *strsignal(int); extern size_t strspn(const char *, const char *); extern char *strstr(char *, char *); extern char *strtok(char *, const char *); extern size_t strxfrm(char *, const char *, size_t); extern int bcmp(void *, void *, size_t); extern void bzero(void *, size_t); extern int ffs(int); extern char *index(char *, int); extern void *memccpy(void *, const void *, int, size_t); extern char *rindex(char *, int); extern int strcasecmp(char *, char *); extern char *strdup(char *); extern int strncasecmp(char *, char *, size_t); extern char *strndup(const char *, size_t); extern size_t strnlen(const char *, size_t); extern char *strsep(char **, const char *); extern char *strerror_r(int, char *, size_t); extern char *strtok_r(char *, const char *, char **); extern char *strcasestr(const char *, const char *); extern char *stpcpy(char *, const char *); extern char *stpncpy(char *, const char *, size_t); extern void *memrchr(const void *, int, size_t); |
#define LOCK_SH 1 #define LOCK_EX 2 #define LOCK_NB 4 #define LOCK_UN 8 extern int flock(int, int); |
struct winsize { unsigned short ws_row; unsigned short ws_col; unsigned short ws_xpixel; unsigned short ws_ypixel; }; extern int ioctl(int, unsigned long int, ...); |
#define IPC_PRIVATE ((key_t)0) #define IPC_RMID 0 #define IPC_CREAT 00001000 #define IPC_EXCL 00002000 #define IPC_NOWAIT 00004000 #define IPC_SET 1 #define IPC_STAT 2 extern key_t ftok(char *, int); |
#define MAP_FAILED ((void*)-1) #define PROT_NONE 0x0 #define MAP_SHARED 0x01 #define MAP_PRIVATE 0x02 #define PROT_READ 0x1 #define MAP_FIXED 0x10 #define PROT_WRITE 0x2 #define MAP_ANONYMOUS 0x20 #define PROT_EXEC 0x4 #define MS_ASYNC 1 #define MS_INVALIDATE 2 #define MS_SYNC 4 #define MAP_ANON MAP_ANONYMOUS extern int msync(void *, size_t, int); extern int mlock(const void *, size_t); extern int mlockall(int); extern void *mmap(void *, size_t, int, int, int, off_t); extern int mprotect(void *, size_t, int); extern int munlock(const void *, size_t); extern int munlockall(void); extern int munmap(void *, size_t); extern void *mmap64(void *, size_t, int, int, int, off64_t); extern int shm_open(const char *, int, mode_t); extern int shm_unlink(const char *); |
#define MSG_NOERROR 010000 extern int msgctl(int, int, struct msqid_ds *); extern int msgget(key_t, int); extern int msgrcv(int, void *, size_t, long int, int); extern int msgsnd(int, const void *, size_t, int); |
#define POLLIN 0x0001 #define POLLPRI 0x0002 #define POLLOUT 0x0004 #define POLLERR 0x0008 #define POLLHUP 0x0010 #define POLLNVAL 0x0020 struct pollfd { int fd; short events; short revents; }; typedef unsigned long int nfds_t; |
#define RUSAGE_CHILDREN (-1) #define RUSAGE_BOTH (-2) #define RLIM_INFINITY (~0UL) #define RLIM_SAVED_CUR -1 #define RLIM_SAVED_MAX -1 #define RLIMIT_CPU 0 #define RUSAGE_SELF 0 #define RLIMIT_FSIZE 1 #define RLIMIT_DATA 2 #define RLIMIT_STACK 3 #define RLIMIT_CORE 4 #define RLIMIT_NOFILE 7 #define RLIMIT_AS 9 typedef unsigned long int rlim_t; typedef unsigned long long int rlim64_t; typedef int __rlimit_resource_t; struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; struct rlimit64 { rlim64_t rlim_cur; rlim64_t rlim_max; }; struct rusage { struct timeval ru_utime; struct timeval ru_stime; long int ru_maxrss; long int ru_ixrss; long int ru_idrss; long int ru_isrss; long int ru_minflt; long int ru_majflt; long int ru_nswap; long int ru_inblock; long int ru_oublock; long int ru_msgsnd; long int ru_msgrcv; long int ru_nsignals; long int ru_nvcsw; long int ru_nivcsw; }; enum __priority_which { PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 }; #define PRIO_PGRP PRIO_PGRP #define PRIO_PROCESS PRIO_PROCESS #define PRIO_USER PRIO_USER typedef enum __priority_which __priority_which_t; extern int getpriority(__priority_which_t, id_t); extern int getrlimit64(id_t, struct rlimit64 *); extern int setpriority(__priority_which_t, id_t, int); extern int setrlimit(__rlimit_resource_t, const struct rlimit *); extern int setrlimit64(__rlimit_resource_t, const struct rlimit64 *); extern int getrlimit(__rlimit_resource_t, struct rlimit *); extern int getrusage(int, struct rusage *); |
#define SEM_UNDO 0x1000 #define GETPID 11 #define GETVAL 12 #define GETALL 13 #define GETNCNT 14 #define GETZCNT 15 #define SETVAL 16 #define SETALL 17 struct sembuf { short sem_num; short sem_op; short sem_flg; }; extern int semctl(int, int, int, ...); extern int semget(key_t, int, int); extern int semop(int, struct sembuf *, size_t); |
#define SHM_RDONLY 010000 #define SHM_W 0200 #define SHM_RND 020000 #define SHM_R 0400 #define SHM_REMAP 040000 #define SHM_LOCK 11 #define SHM_UNLOCK 12 extern int __getpagesize(void); extern void *shmat(int, const void *, int); extern int shmctl(int, int, struct shmid_ds *); extern int shmdt(const void *); extern int shmget(key_t, size_t, int); |
#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) #define SCM_RIGHTS 0x01 #define SOL_SOCKET 1 #define SOMAXCONN 128 #define SOL_RAW 255 #define CMSG_ALIGN(len) \ (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) #define CMSG_DATA(cmsg) \ ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) #define CMSG_SPACE(len) \ (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) #define CMSG_FIRSTHDR(msg) \ ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ (struct cmsghdr *)(msg)->msg_control : \ (struct cmsghdr *)NULL) #define CMSG_NXTHDR(mhdr,cmsg) \ (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \ (struct cmsghdr *)NULL : \ (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) struct linger { int l_onoff; int l_linger; }; struct cmsghdr { size_t cmsg_len; int cmsg_level; int cmsg_type; }; struct iovec { void *iov_base; size_t iov_len; }; typedef unsigned short sa_family_t; typedef unsigned int socklen_t; struct sockaddr { sa_family_t sa_family; char sa_data[14]; }; struct sockaddr_storage { sa_family_t ss_family; __ss_aligntype __ss_align; char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; }; struct msghdr { void *msg_name; int msg_namelen; struct iovec *msg_iov; size_t msg_iovlen; void *msg_control; size_t msg_controllen; unsigned int msg_flags; }; #define AF_UNSPEC 0 #define AF_UNIX 1 #define AF_INET6 10 #define AF_INET 2 #define PF_INET AF_INET #define PF_INET6 AF_INET6 #define PF_UNIX AF_UNIX #define PF_UNSPEC AF_UNSPEC #define SOCK_STREAM 1 #define SOCK_PACKET 10 #define SOCK_DGRAM 2 #define SOCK_RAW 3 #define SOCK_RDM 4 #define SOCK_SEQPACKET 5 #define SO_DEBUG 1 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ACCEPTCONN 30 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_KEEPALIVE 9 #define SIOCGIFCONF 0x8912 #define SIOCGIFFLAGS 0x8913 #define SIOCGIFADDR 0x8915 #define SIOCGIFNETMASK 0x891b #define SHUT_RD 0 #define SHUT_WR 1 #define SHUT_RDWR 2 #define MSG_DONTROUTE 4 #define MSG_WAITALL 0x100 #define MSG_TRUNC 0x20 #define MSG_EOR 0x80 #define MSG_OOB 1 #define MSG_PEEK 2 #define MSG_CTRUNC 8 extern int bind(int, const struct sockaddr *, socklen_t); extern int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, unsigned int); extern int getsockname(int, struct sockaddr *, socklen_t *); extern int listen(int, int); extern int setsockopt(int, int, int, const void *, socklen_t); extern int accept(int, struct sockaddr *, socklen_t *); extern int connect(int, const struct sockaddr *, socklen_t); extern ssize_t recv(int, void *, size_t, int); extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); extern ssize_t recvmsg(int, struct msghdr *, int); extern ssize_t send(int, const void *, size_t, int); extern ssize_t sendmsg(int, const struct msghdr *, int); extern ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); extern int getpeername(int, struct sockaddr *, socklen_t *); extern int getsockopt(int, int, int, void *, socklen_t *); extern int shutdown(int, int); extern int socket(int, int, int); extern int socketpair(int, int, int, int); extern int sockatmark(int); |
#define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) #define S_IROTH (S_IRGRP>>3) #define S_IRGRP (S_IRUSR>>3) #define S_IRWXO (S_IRWXG>>3) #define S_IRWXG (S_IRWXU>>3) #define S_IWOTH (S_IWGRP>>3) #define S_IWGRP (S_IWUSR>>3) #define S_IXOTH (S_IXGRP>>3) #define S_IXGRP (S_IXUSR>>3) #define S_ISVTX 01000 #define S_IXUSR 0x0040 #define S_IWUSR 0x0080 #define S_IRUSR 0x0100 #define S_ISGID 0x0400 #define S_ISUID 0x0800 #define S_IFIFO 0x1000 #define S_IFCHR 0x2000 #define S_IFDIR 0x4000 #define S_IFBLK 0x6000 #define S_IFREG 0x8000 #define S_IFLNK 0xa000 #define S_IFSOCK 0xc000 #define S_IFMT 0xf000 #define st_atime st_atim.tv_sec #define st_ctime st_ctim.tv_sec #define st_mtime st_mtim.tv_sec #define S_IREAD S_IRUSR #define S_IWRITE S_IWUSR #define S_IEXEC S_IXUSR extern int __fxstat(int, int, struct stat *); extern int __fxstat64(int, int, struct stat64 *); extern int __lxstat(int, char *, struct stat *); extern int __lxstat64(int, const char *, struct stat64 *); extern int __xmknod(int, const char *, mode_t, dev_t *); extern int __xstat(int, const char *, struct stat *); extern int __xstat64(int, const char *, struct stat64 *); extern int mkfifo(const char *, mode_t); extern int chmod(const char *, mode_t); extern int fchmod(int, mode_t); extern mode_t umask(mode_t); |
extern int fstatvfs(int, struct statvfs *); extern int fstatvfs64(int, struct statvfs64 *); extern int statvfs(const char *, struct statvfs *); extern int statvfs64(const char *, struct statvfs64 *); |
#define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 struct timezone { int tz_minuteswest; int tz_dsttime; }; typedef int __itimer_which_t; struct timespec { time_t tv_sec; long int tv_nsec; }; struct timeval { time_t tv_sec; suseconds_t tv_usec; }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; extern int getitimer(__itimer_which_t, struct itimerval *); extern int setitimer(__itimer_which_t, const struct itimerval *, struct itimerval *); extern int adjtime(const struct timeval *, struct timeval *); extern int gettimeofday(struct timeval *, struct timezone *); extern int utimes(const char *, const struct timeval *); |
struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; extern int ftime(struct timeb *); |
struct tms { clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime; }; extern clock_t times(struct tms *); |
#define FALSE 0 #define TRUE 1 #define FD_SETSIZE 1024 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) #define FD_ISSET(d,set) \ ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) #define FD_CLR(d,set) \ ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) #define FD_SET(d,set) \ ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) typedef signed char int8_t; typedef short int16_t; typedef int int32_t; typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; typedef unsigned int u_int32_t; typedef unsigned int uid_t; typedef int pid_t; typedef long int off_t; typedef int key_t; typedef long int suseconds_t; typedef unsigned int u_int; typedef struct { int __val[2]; } fsid_t; typedef unsigned int useconds_t; typedef unsigned long int blksize_t; typedef long int fd_mask; typedef int timer_t; typedef int clockid_t; typedef unsigned int id_t; typedef unsigned long long int ino64_t; typedef long long int loff_t; typedef unsigned long int blkcnt_t; typedef unsigned long int fsblkcnt_t; typedef unsigned long int fsfilcnt_t; typedef unsigned long long int blkcnt64_t; typedef unsigned long long int fsblkcnt64_t; typedef unsigned long long int fsfilcnt64_t; typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long int u_long; typedef unsigned long int ino_t; typedef unsigned int gid_t; typedef unsigned long long int dev_t; typedef unsigned int mode_t; typedef unsigned long int nlink_t; typedef char *caddr_t; typedef struct { unsigned long int fds_bits[__FDSET_LONGS]; } fd_set; typedef long int clock_t; typedef long int time_t; |
extern ssize_t readv(int, const struct iovec *, int); extern ssize_t writev(int, const struct iovec *, int); |
#define UNIX_PATH_MAX 108 struct sockaddr_un { sa_family_t sun_family; char sun_path[UNIX_PATH_MAX]; }; |
#define SYS_NMLN 65 struct utsname { char sysname[65]; char nodename[65]; char release[65]; char version[65]; char machine[65]; char domainname[65]; }; extern int uname(struct utsname *); |
#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) #define WTERMSIG(status) ((status) & 0x7f) #define WCOREDUMP(status) ((status) & 0x80) #define WIFEXITED(status) (WTERMSIG(status) == 0) #define WNOHANG 0x00000001 #define WUNTRACED 0x00000002 #define WCOREFLAG 0x80 #define WSTOPSIG(status) WEXITSTATUS(status) typedef enum { P_ALL, P_PID, P_PGID } idtype_t; extern pid_t wait(int *); extern pid_t waitpid(pid_t, int *, int); extern pid_t wait4(pid_t, int *, int, struct rusage *); |
#define LOG_EMERG 0 #define LOG_PRIMASK 0x07 #define LOG_ALERT 1 #define LOG_CRIT 2 #define LOG_ERR 3 #define LOG_WARNING 4 #define LOG_NOTICE 5 #define LOG_INFO 6 #define LOG_DEBUG 7 #define LOG_KERN (0<<3) #define LOG_AUTHPRIV (10<<3) #define LOG_FTP (11<<3) #define LOG_USER (1<<3) #define LOG_MAIL (2<<3) #define LOG_DAEMON (3<<3) #define LOG_AUTH (4<<3) #define LOG_SYSLOG (5<<3) #define LOG_LPR (6<<3) #define LOG_NEWS (7<<3) #define LOG_UUCP (8<<3) #define LOG_CRON (9<<3) #define LOG_FACMASK 0x03f8 #define LOG_LOCAL0 (16<<3) #define LOG_LOCAL1 (17<<3) #define LOG_LOCAL2 (18<<3) #define LOG_LOCAL3 (19<<3) #define LOG_LOCAL4 (20<<3) #define LOG_LOCAL5 (21<<3) #define LOG_LOCAL6 (22<<3) #define LOG_LOCAL7 (23<<3) #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) #define LOG_MASK(pri) (1 << (pri)) #define LOG_PID 0x01 #define LOG_CONS 0x02 #define LOG_ODELAY 0x04 #define LOG_NDELAY 0x08 #define LOG_NOWAIT 0x10 #define LOG_PERROR 0x20 extern void closelog(void); extern void openlog(const char *, int, int); extern int setlogmask(int); extern void syslog(int, const char *, ...); extern void vsyslog(int, const char *, va_list); |
#define TCIFLUSH 0 #define TCOOFF 0 #define TCSANOW 0 #define BS0 0000000 #define CR0 0000000 #define FF0 0000000 #define NL0 0000000 #define TAB0 0000000 #define VT0 0000000 #define OPOST 0000001 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #define NL1 0000400 #define TCOFLUSH 1 #define TCOON 1 #define TCSADRAIN 1 #define TCIOFF 2 #define TCIOFLUSH 2 #define TCSAFLUSH 2 #define TCION 3 typedef unsigned int speed_t; typedef unsigned char cc_t; typedef unsigned int tcflag_t; #define NCCS 32 struct termios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; tcflag_t c_lflag; cc_t c_line; cc_t c_cc[NCCS]; speed_t c_ispeed; speed_t c_ospeed; }; #define VINTR 0 #define VQUIT 1 #define VLNEXT 15 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IXANY 0004000 #define IMAXBEL 0020000 #define CS5 0000000 #define ECHO 0000010 #define B0 0000000 #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 extern speed_t cfgetispeed(const struct termios *); extern speed_t cfgetospeed(const struct termios *); extern void cfmakeraw(struct termios *); extern int cfsetispeed(struct termios *, speed_t); extern int cfsetospeed(struct termios *, speed_t); extern int cfsetspeed(struct termios *, speed_t); extern int tcflow(int, int); extern int tcflush(int, int); extern pid_t tcgetsid(int); extern int tcsendbreak(int, int); extern int tcsetattr(int, int, const struct termios *); extern int tcdrain(int); extern int tcgetattr(int, struct termios *); |
#define CLK_TCK ((clock_t)__sysconf(2)) #define CLOCK_REALTIME 0 #define TIMER_ABSTIME 1 #define CLOCKS_PER_SEC 1000000l struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; extern int __daylight(void); extern long int __timezone(void); extern char *__tzname(void); extern char *asctime(const struct tm *); extern clock_t clock(void); extern char *ctime(const time_t *); extern char *ctime_r(const time_t *, char *); extern double difftime(time_t, time_t); extern struct tm *getdate(const char *); extern int getdate_err(void); extern struct tm *gmtime(const time_t *); extern struct tm *localtime(const time_t *); extern time_t mktime(struct tm *); extern int stime(const time_t *); extern size_t strftime(char *, size_t, const char *, const struct tm *); extern char *strptime(const char *, const char *, struct tm *); extern time_t time(time_t *); extern int nanosleep(const struct timespec *, struct timespec *); extern int daylight(void); extern long int timezone(void); extern char *tzname(void); extern void tzset(void); extern char *asctime_r(const struct tm *, char *); extern struct tm *gmtime_r(const time_t *, struct tm *); extern struct tm *localtime_r(const time_t *, struct tm *); extern int clock_getcpuclockid(pid_t, clockid_t *); extern int clock_getres(clockid_t, struct timespec *); extern int clock_gettime(clockid_t, struct timespec *); extern int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); extern int clock_settime(clockid_t, const struct timespec *); extern int timer_create(clockid_t, struct sigevent *, timer_t *); extern int timer_delete(timer_t); extern int timer_getoverrun(timer_t); extern int timer_gettime(timer_t, struct itimerspec *); extern int timer_settime(timer_t, int, const struct itimerspec *, struct itimerspec *); |
extern int getcontext(ucontext_t *); extern int makecontext(ucontext_t *, void (*func) (void) , int, ...); extern int setcontext(const struct ucontext *); extern int swapcontext(ucontext_t *, const struct ucontext *); |
#define SEEK_SET 0 #define STDIN_FILENO 0 #define SEEK_CUR 1 #define STDOUT_FILENO 1 #define SEEK_END 2 #define STDERR_FILENO 2 typedef long long int off64_t; #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 #define _POSIX_VDISABLE '\0' #define _POSIX_CHOWN_RESTRICTED 1 #define _POSIX_JOB_CONTROL 1 #define _POSIX_NO_TRUNC 1 #define _POSIX_SHELL 1 #define _POSIX_FSYNC 200112 #define _POSIX_MAPPED_FILES 200112 #define _POSIX_MEMLOCK 200112 #define _POSIX_MEMLOCK_RANGE 200112 #define _POSIX_MEMORY_PROTECTION 200112 #define _POSIX_SEMAPHORES 200112 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 #define _POSIX_TIMERS 200112 #define _POSIX2_C_BIND 200112L #define _POSIX_THREADS 200112L #define _PC_LINK_MAX 0 #define _PC_MAX_CANON 1 #define _PC_ASYNC_IO 10 #define _PC_PRIO_IO 11 #define _PC_FILESIZEBITS 13 #define _PC_REC_INCR_XFER_SIZE 14 #define _PC_REC_MIN_XFER_SIZE 16 #define _PC_REC_XFER_ALIGN 17 #define _PC_ALLOC_SIZE_MIN 18 #define _PC_MAX_INPUT 2 #define _PC_2_SYMLINKS 20 #define _PC_NAME_MAX 3 #define _PC_PATH_MAX 4 #define _PC_PIPE_BUF 5 #define _PC_CHOWN_RESTRICTED 6 #define _PC_NO_TRUNC 7 #define _PC_VDISABLE 8 #define _PC_SYNC_IO 9 #define _SC_ARG_MAX 0 #define _SC_CHILD_MAX 1 #define _SC_PRIORITY_SCHEDULING 10 #define _SC_TIMERS 11 #define _SC_ASYNCHRONOUS_IO 12 #define _SC_XBS5_ILP32_OFF32 125 #define _SC_XBS5_ILP32_OFFBIG 126 #define _SC_XBS5_LP64_OFF64 127 #define _SC_XBS5_LPBIG_OFFBIG 128 #define _SC_XOPEN_LEGACY 129 #define _SC_PRIORITIZED_IO 13 #define _SC_XOPEN_REALTIME 130 #define _SC_XOPEN_REALTIME_THREADS 131 #define _SC_ADVISORY_INFO 132 #define _SC_BARRIERS 133 #define _SC_CLOCK_SELECTION 137 #define _SC_CPUTIME 138 #define _SC_THREAD_CPUTIME 139 #define _SC_SYNCHRONIZED_IO 14 #define _SC_MONOTONIC_CLOCK 149 #define _SC_FSYNC 15 #define _SC_READER_WRITER_LOCKS 153 #define _SC_SPIN_LOCKS 154 #define _SC_REGEXP 155 #define _SC_SHELL 157 #define _SC_SPAWN 159 #define _SC_MAPPED_FILES 16 #define _SC_SPORADIC_SERVER 160 #define _SC_THREAD_SPORADIC_SERVER 161 #define _SC_TIMEOUTS 164 #define _SC_TYPED_MEMORY_OBJECTS 165 #define _SC_2_PBS_ACCOUNTING 169 #define _SC_MEMLOCK 17 #define _SC_2_PBS_LOCATE 170 #define _SC_2_PBS_MESSAGE 171 #define _SC_2_PBS_TRACK 172 #define _SC_SYMLOOP_MAX 173 #define _SC_2_PBS_CHECKPOINT 175 #define _SC_V6_ILP32_OFF32 176 #define _SC_V6_ILP32_OFFBIG 177 #define _SC_V6_LP64_OFF64 178 #define _SC_V6_LPBIG_OFFBIG 179 #define _SC_MEMLOCK_RANGE 18 #define _SC_HOST_NAME_MAX 180 #define _SC_TRACE 181 #define _SC_TRACE_EVENT_FILTER 182 #define _SC_TRACE_INHERIT 183 #define _SC_TRACE_LOG 184 #define _SC_MEMORY_PROTECTION 19 #define _SC_CLK_TCK 2 #define _SC_MESSAGE_PASSING 20 #define _SC_SEMAPHORES 21 #define _SC_SHARED_MEMORY_OBJECTS 22 #define _SC_AIO_LISTIO_MAX 23 #define _SC_AIO_MAX 24 #define _SC_AIO_PRIO_DELTA_MAX 25 #define _SC_DELAYTIMER_MAX 26 #define _SC_MQ_OPEN_MAX 27 #define _SC_MQ_PRIO_MAX 28 #define _SC_VERSION 29 #define _SC_NGROUPS_MAX 3 #define _SC_PAGESIZE 30 #define _SC_PAGE_SIZE 30 #define _SC_RTSIG_MAX 31 #define _SC_SEM_NSEMS_MAX 32 #define _SC_SEM_VALUE_MAX 33 #define _SC_SIGQUEUE_MAX 34 #define _SC_TIMER_MAX 35 #define _SC_BC_BASE_MAX 36 #define _SC_BC_DIM_MAX 37 #define _SC_BC_SCALE_MAX 38 #define _SC_BC_STRING_MAX 39 #define _SC_OPEN_MAX 4 #define _SC_COLL_WEIGHTS_MAX 40 #define _SC_EXPR_NEST_MAX 42 #define _SC_LINE_MAX 43 #define _SC_RE_DUP_MAX 44 #define _SC_2_VERSION 46 #define _SC_2_C_BIND 47 #define _SC_2_C_DEV 48 #define _SC_2_FORT_DEV 49 #define _SC_STREAM_MAX 5 #define _SC_2_FORT_RUN 50 #define _SC_2_SW_DEV 51 #define _SC_2_LOCALEDEF 52 #define _SC_TZNAME_MAX 6 #define _SC_IOV_MAX 60 #define _SC_THREADS 67 #define _SC_THREAD_SAFE_FUNCTIONS 68 #define _SC_GETGR_R_SIZE_MAX 69 #define _SC_JOB_CONTROL 7 #define _SC_GETPW_R_SIZE_MAX 70 #define _SC_LOGIN_NAME_MAX 71 #define _SC_TTY_NAME_MAX 72 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 #define _SC_THREAD_KEYS_MAX 74 #define _SC_THREAD_STACK_MIN 75 #define _SC_THREAD_THREADS_MAX 76 #define _SC_THREAD_ATTR_STACKADDR 77 #define _SC_THREAD_ATTR_STACKSIZE 78 #define _SC_THREAD_PRIORITY_SCHEDULING 79 #define _SC_SAVED_IDS 8 #define _SC_THREAD_PRIO_INHERIT 80 #define _SC_THREAD_PRIO_PROTECT 81 #define _SC_THREAD_PROCESS_SHARED 82 #define _SC_ATEXIT_MAX 87 #define _SC_PASS_MAX 88 #define _SC_XOPEN_VERSION 89 #define _SC_REALTIME_SIGNALS 9 #define _SC_XOPEN_UNIX 91 #define _SC_XOPEN_CRYPT 92 #define _SC_XOPEN_ENH_I18N 93 #define _SC_XOPEN_SHM 94 #define _SC_2_CHAR_TERM 95 #define _SC_2_C_VERSION 96 #define _SC_2_UPE 97 #define _CS_PATH 0 #define _POSIX_REGEXP 1 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 #define _CS_XBS5_LP64_OFF64_LIBS 1110 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 #define _XOPEN_XPG4 1 #define F_ULOCK 0 #define F_LOCK 1 #define F_TLOCK 2 #define F_TEST 3 extern char **__environ(void); extern pid_t __getpgid(pid_t); extern void _exit(int); extern int acct(const char *); extern unsigned int alarm(unsigned int); extern int chown(const char *, uid_t, gid_t); extern int chroot(const char *); extern size_t confstr(int, char *, size_t); extern int creat(const char *, mode_t); extern int creat64(const char *, mode_t); extern char *ctermid(char *); extern char *cuserid(char *); extern int daemon(int, int); extern int execl(const char *, const char *, ...); extern int execle(const char *, const char *, ...); extern int execlp(const char *, const char *, ...); extern int execv(const char *, char *const); extern int execvp(const char *, char *const); extern int fdatasync(int); extern int ftruncate64(int, off64_t); extern long int gethostid(void); extern char *getlogin(void); extern int getlogin_r(char *, size_t); extern int getopt(int, char *const, const char *); extern pid_t getpgrp(void); extern pid_t getsid(pid_t); extern char *getwd(char *); extern int lockf(int, int, off_t); extern int mkstemp(char *); extern int nice(int); extern char *optarg(void); extern int opterr(void); extern int optind(void); extern int optopt(void); extern int rename(const char *, const char *); extern int setegid(gid_t); extern int seteuid(uid_t); extern int sethostname(const char *, size_t); extern int setpgrp(void); extern void swab(const void *, void *, ssize_t); extern void sync(void); extern pid_t tcgetpgrp(int); extern int tcsetpgrp(int, pid_t); extern int truncate(const char *, off_t); extern int truncate64(const char *, off64_t); extern char *ttyname(int); extern unsigned int ualarm(useconds_t, useconds_t); extern int usleep(useconds_t); extern int close(int); extern int fsync(int); extern off_t lseek(int, off_t, int); extern int open(const char *, int, ...); extern int pause(void); extern ssize_t read(int, void *, size_t); extern ssize_t write(int, const void *, size_t); extern char *crypt(char *, char *); extern void encrypt(char *, int); extern void setkey(const char *); extern int access(const char *, int); extern int brk(void *); extern int chdir(const char *); extern int dup(int); extern int dup2(int, int); extern int execve(const char *, char *const, char *const); extern int fchdir(int); extern int fchown(int, uid_t, gid_t); extern pid_t fork(void); extern gid_t getegid(void); extern uid_t geteuid(void); extern gid_t getgid(void); extern int getgroups(int, gid_t); extern int gethostname(char *, size_t); extern pid_t getpgid(pid_t); extern pid_t getpid(void); extern uid_t getuid(void); extern int lchown(const char *, uid_t, gid_t); extern int link(const char *, const char *); extern int mkdir(const char *, mode_t); extern long int pathconf(const char *, int); extern int pipe(int); extern int readlink(const char *, char *, size_t); extern int rmdir(const char *); extern void *sbrk(ptrdiff_t); extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int setgid(gid_t); extern int setpgid(pid_t, pid_t); extern int setregid(gid_t, gid_t); extern int setreuid(uid_t, uid_t); extern pid_t setsid(void); extern int setuid(uid_t); extern unsigned int sleep(unsigned int); extern int symlink(const char *, const char *); extern long int sysconf(int); extern int unlink(const char *); extern pid_t vfork(void); extern ssize_t pread(int, void *, size_t, off_t); extern ssize_t pwrite(int, const void *, size_t, off_t); extern char **_environ(void); extern long int fpathconf(int, int); extern int ftruncate(int, off_t); extern char *getcwd(char *, size_t); extern int getpagesize(void); extern pid_t getppid(void); extern int isatty(int); extern loff_t lseek64(int, loff_t, int); extern int open64(const char *, int, ...); extern ssize_t pread64(int, void *, size_t, off64_t); extern ssize_t pwrite64(int, const void *, size_t, off64_t); extern int ttyname_r(int, char *, size_t); |
struct utimbuf { time_t actime; time_t modtime; }; extern int utime(const char *, const struct utimbuf *); |
#define UT_HOSTSIZE 256 #define UT_LINESIZE 32 #define UT_NAMESIZE 32 struct exit_status { short e_termination; short e_exit; }; #define EMPTY 0 #define RUN_LVL 1 #define BOOT_TIME 2 #define NEW_TIME 3 #define OLD_TIME 4 #define INIT_PROCESS 5 #define LOGIN_PROCESS 6 #define USER_PROCESS 7 #define DEAD_PROCESS 8 #define ACCOUNTING 9 extern void endutent(void); extern struct utmp *getutent(void); extern void setutent(void); extern int getutent_r(struct utmp *, struct utmp **); extern int utmpname(const char *); extern int login_tty(int); extern void login(const struct utmp *); extern int logout(const char *); extern void logwtmp(const char *, const char *, const char *); |
extern void endutxent(void); extern struct utmpx *getutxent(void); extern struct utmpx *getutxid(const struct utmpx *); extern struct utmpx *getutxline(const struct utmpx *); extern struct utmpx *pututxline(const struct utmpx *); extern void setutxent(void); |
#define WEOF (0xffffffffu) #define WCHAR_MAX 0x7FFFFFFF #define WCHAR_MIN 0x80000000 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t * *, int, int); extern wchar_t *wcscat(wchar_t *, const wchar_t *); extern wchar_t *wcschr(const wchar_t *, wchar_t); extern int wcscmp(const wchar_t *, const wchar_t *); extern int wcscoll(const wchar_t *, const wchar_t *); extern wchar_t *wcscpy(wchar_t *, const wchar_t *); extern size_t wcscspn(const wchar_t *, const wchar_t *); extern wchar_t *wcsdup(const wchar_t *); extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *); extern wchar_t *wcsrchr(const wchar_t *, wchar_t); extern size_t wcsspn(const wchar_t *, const wchar_t *); extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t * *); extern int wcswidth(const wchar_t *, size_t); extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); extern int wctob(wint_t); extern int wcwidth(wchar_t); extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); extern int wmemcmp(const wchar_t *, const wchar_t *, size_t); extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); extern size_t mbrlen(const char *, size_t, mbstate_t *); extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); extern int mbsinit(const mbstate_t *); extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *); extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); extern wchar_t *wcpcpy(wchar_t *, const wchar_t *); extern wchar_t *wcpncpy(wchar_t *, const wchar_t *, size_t); extern size_t wcrtomb(char *, wchar_t, mbstate_t *); extern size_t wcslen(const wchar_t *); extern size_t wcsnrtombs(char *, const wchar_t * *, size_t, size_t, mbstate_t *); extern size_t wcsrtombs(char *, const wchar_t * *, size_t, mbstate_t *); extern double wcstod(const wchar_t *, wchar_t * *); extern float wcstof(const wchar_t *, wchar_t * *); extern long int wcstol(const wchar_t *, wchar_t * *, int); extern long double wcstold(const wchar_t *, wchar_t * *); extern long long int wcstoq(const wchar_t *, wchar_t * *, int); extern unsigned long int wcstoul(const wchar_t *, wchar_t * *, int); extern unsigned long long int wcstouq(const wchar_t *, wchar_t * *, int); extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); extern int wcscasecmp(const wchar_t *, const wchar_t *); extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); extern size_t wcsnlen(const wchar_t *, size_t); extern long long int wcstoll(const wchar_t *, wchar_t * *, int); extern unsigned long long int wcstoull(const wchar_t *, wchar_t * *, int); extern wint_t btowc(int); extern wint_t fgetwc(FILE *); extern wint_t fgetwc_unlocked(FILE *); extern wchar_t *fgetws(wchar_t *, int, FILE *); extern wint_t fputwc(wchar_t, FILE *); extern int fputws(const wchar_t *, FILE *); extern int fwide(FILE *, int); extern int fwprintf(FILE *, const wchar_t *, ...); extern int fwscanf(FILE *, const wchar_t *, ...); extern wint_t getwc(FILE *); extern wint_t getwchar(void); extern wint_t putwc(wchar_t, FILE *); extern wint_t putwchar(wchar_t); extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); extern int swscanf(const wchar_t *, const wchar_t *, ...); extern wint_t ungetwc(wint_t, FILE *); extern int vfwprintf(FILE *, const wchar_t *, va_list); extern int vfwscanf(FILE *, const wchar_t *, va_list); extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); extern int vswscanf(const wchar_t *, const wchar_t *, va_list); extern int vwprintf(const wchar_t *, va_list); extern int vwscanf(const wchar_t *, va_list); extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *); extern int wprintf(const wchar_t *, ...); extern int wscanf(const wchar_t *, ...); |
typedef unsigned long int wctype_t; typedef unsigned int wint_t; typedef const int32_t *wctrans_t; typedef struct { int count; wint_t value; } __mbstate_t; typedef __mbstate_t mbstate_t; extern int iswblank(wint_t); extern wint_t towlower(wint_t); extern wint_t towupper(wint_t); extern wctrans_t wctrans(const char *); extern int iswalnum(wint_t); extern int iswalpha(wint_t); extern int iswcntrl(wint_t); extern int iswctype(wint_t, wctype_t); extern int iswdigit(wint_t); extern int iswgraph(wint_t); extern int iswlower(wint_t); extern int iswprint(wint_t); extern int iswpunct(wint_t); extern int iswspace(wint_t); extern int iswupper(wint_t); extern int iswxdigit(wint_t); extern wctype_t wctype(const char *); extern wint_t towctrans(wint_t, wctrans_t); |
enum { WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, WRDE_UNDEF, __WRDE_FLAGS }; typedef struct { int we_wordc; char **we_wordv; int we_offs; } wordexp_t; enum { WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, WRDE_SYNTAX }; extern int wordexp(const char *, wordexp_t *, int); extern void wordfree(wordexp_t *); |
The interfaces defined on the following pages are included in libc and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 13.3 shall behave as described in the referenced base document.
_IO_feof() tests the end-of-file indicator for the stream pointed to by __fp, returning a non-zero value if it is set.
_IO_feof() is not in the source standard; it is only in the binary standard.
_IO_getc() reads the next character from
__fp and returns it as an unsigned char cast
to an int, or EOF
on end-of-file or error.
_IO_getc() is not in the source standard; it is only in the binary standard.
_IO_putc() writes the character __c, cast to an unsigned char, to __fp.
_IO_putc() is not in the source standard; it is only in the binary standard.
_IO_puts() writes the string __s
and a trailing newline to stdout
.
_IO_puts() is not in the source standard; it is only in the binary standard.
The __assert_fail() function is used to implement the assert() interface of ISO POSIX (2003). The __assert_fail() function shall print the given file filename, line line number, function function name and a message on the standard error stream in an unspecified format, and abort program execution via the abort() function. For example:
a.c:10: foobar: Assertion a == b failed.
If function is NULL, __assert_fail() shall omit information about the function.
assertion, file, and line shall be non-NULL.
The __assert_fail() function is not in the source standard; it is only in the binary standard. The assert() interface is not in the binary standard; it is only in the source standard. The assert() may be implemented as a macro.
The __ctype_b_loc()
function shall return a pointer into an array of
characters in the current locale that contains characteristics for each
character in the current character set. The array shall contain a total of
384
characters, and can be indexed with any signed or unsigned char (i.e. with an
index value between -128
and
255
). If the application is multithreaded, the
array shall be local to the current thread.
This interface is not in the source standard; it is only in the binary standard.
The __ctype_b_loc() function shall return a pointer to the array of characters to be used for the ctype() family of functions (see <ctype.h>).
__ctype_get_mb_cur_max() returns the maximum length of a multibyte character in the current locale.
__ctype_get_mb_cur_max() is not in the source standard; it is only in the binary standard.
The __ctype_tolower_loc()
function shall return a pointer into an array of
characters in the current locale that contains lower case equivalents for each
character in the current character set. The array shall contain a total of
384
characters, and can be indexed with any signed or unsigned char (i.e. with an
index value between -128
and
255
). If the application is multithreaded, the
array shall be local to the current thread.
This interface is not in the source standard; it is only in the binary standard.
The __ctype_tolower_loc() function shall return a pointer to the array of characters to be used for the ctype() family of functions (see <ctype.h>).
The __ctype_toupper_loc()
function shall return a pointer into an array of
characters in the current locale that contains upper case equivalents for each
character in the current character set. The array shall contain a total of
384
characters, and can be indexed with any signed or unsigned char (i.e. with an
index value between -128
and
255
). If the application is multithreaded, the
array shall be local to the current thread.
This interface is not in the source standard; it is only in the binary standard.
The __ctype_toupper_loc() function shall return a pointer to the array of characters to be used for the ctype() family of functions (see <ctype.h>).
As described in the Itanium C++ ABI, __cxa_atexit() registers a destructor function to be called by exit() or when a shared library is unloaded. When a shared library is unloaded, any destructor function associated with that shared library, identified by dso_handle, shall be called with the single argument arg, and then that function shall be removed, or marked as complete, from the list of functions to run at exit(). On a call to exit(), any remaining functions registered shall be called with the single argument arg. Destructor functions shall always be called in the reverse order to their registration (i.e. the most recently registered function shall be called first),
The __cxa_atexit() function is used to implement atexit(), as described in ISO POSIX (2003). Calling atexit(func) from the statically linked part of an application shall be equivalent to __cxa_atexit(func, NULL, NULL).
__cxa_atexit() is not in the source standard; it is only in the binary standard.
Note: atexit() is not in the binary standard; it is only in the source standard.
The integer variable __daylight
shall implement the daylight savings time flag daylight
as specified in the
ISO POSIX (2003) header file <time.h>.
__daylight
is not in the source standard;
it is only in the binary standard. daylight
is not in the binary standard; it is only in the source standard.
__environ
is an alias for environ
- user environment.
__environ
has the same specification as
environ
.
__environ
is not in the source standard;
it is only in the binary standard.
The __errno_location() function shall return
the address of the errno
variable for the current
thread.
__errno_location() is not in the source standard; it is only in the binary standard.
__fpending() returns the amount of output in bytes pending on a stream.
__fpending() is not in the source standard; it is only in the binary standard.
__getpagesize() is an alias for getpagesize() - get current page size.
__getpagesize() has the same specification as getpagesize().
__getpagesize() is not in the source standard; it is only in the binary standard.
__getpgid() has the same specification as getpgid().
__getpgid() is not in the source standard; it is only in the binary standard.
__h_errno_location() returns the address of the
h_errno
variable, where h_errno
is as specified in ISO POSIX (2003).
__h_errno_location() is not in the source standard;
it is only in the binary standard. Note that h_errno
itself is only in the source standard; it is not in the binary standard.
__isinf() has the same specification as isinf() in ISO POSIX (2003), except that the argument type for __isinf() is known to be double.
__isinf() is not in the source standard; it is only in the binary standard.
__isinff() has the same specification as isinf() in ISO POSIX (2003) except that the argument type for __isinff() is known to be float.
__isinff() is not in the source standard; it is only in the binary standard.
__isinfl() has the same specification as isinf() in the ISO POSIX (2003), except that the argument type for __isinfl() is known to be long double.
__isinfl() is not in the source standard; it is only in the binary standard.
__isnan() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnan() is known to be double.
__isnan() is not in the source standard; it is only in the binary standard.
__isnanf() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnanf() is known to be float.
__isnanf() is not in the source standard; it is only in the binary standard.
__isnanl() has the same specification as isnan() in ISO POSIX (2003), except that the argument type for __isnanl() is known to be long double.
__isnanl() is not in the source standard; it is only in the binary standard.
__libc_current_sigrtmax() returns the number of an available real-time signal with the lowest priority.
__libc_current_sigrtmax() is not in the source standard; it is only in the binary standard.
__libc_current_sigrtmin() returns the number of an available real-time signal with the highest priority.
__libc_current_sigrtmin() is not in the source standard; it is only in the binary standard.
The __libc_start_main() function shall perform any necessary initialization of the execution environment, call the main function with appropriate arguments, and handle the return from main(). If the main() function returns, the return value shall be passed to the exit() function.
Note: While this specification is intended to be implementation independent, process and library initialization may include:
This list is an example only.
performing any necessary security checks if the effective user ID is not the same as the real user ID.
initialize the threading subsystem.
registering the rtld_fini to release resources when this dynamic shared object exits (or is unloaded).
registering the fini handler to run at program exit.
calling the initializer function (*init)().
calling main() with appropriate arguments.
calling exit() with the return value from main().
__libc_start_main() is not in the source standard; it is only in the binary standard.
__lxstat() is an inline wrapper around call to lxstat().
__lxstat() is not in the source standard; it is only in the binary standard.
__mempcpy() copies n bytes of source to destination, returning pointer to bytes after the last written byte.
__mempcpy() is not in the source standard; it is only in the binary standard.
__rawmemchr() searches in s for c.
__rawmemchr() is a weak alias to rawmemchr(). It is similar to memchr(), but it has no length limit.
__rawmemchr() is not in the source standard; it is only in the binary standard.
__register_atfork() implements pthread_atfork() as specified in ISO POSIX (2003). The additional parameter __dso_handle allows a shared object to pass in it's handle so that functions registered by __register_atfork() can be unregistered by the runtime when the shared object is unloaded.
__sigsetjmp() has the same behavior as sigsetjmp() as specified by ISO POSIX (2003).
__sigsetjmp() is not in the source standard; it is only in the binary standard.
The __stpcpy() function has the same specification as the stpcpy().
__stpcpy() is not in the source standard; it is only in the binary standard.
__strdup() has the same specification as strdup().
__strdup() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtod_internal() is undefined.
__strtod_internal(__nptr, __endptr, 0)() has the same specification as strtod(__nptr, __endptr)().
__strtod_internal() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtof_internal() is undefined.
__strtof_internal(__nptr, __endptr, 0)() has the same specification as strtof(__nptr, __endptr)().
__strtof_internal() is not in the source standard; it is only in the binary standard.
__strtok_r() has the same specification as strtok_r().
__strtok_r() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtol_internal() is undefined.
__strtol_internal(__nptr, __endptr, __base, 0) has the same specification as strtol(__nptr, __endptr, __base).
__strtol_internal() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtold_internal() is undefined.
__strtold_internal(__nptr, __endptr, 0) has the same specification as strtold(__nptr, __endptr).
__strtold_internal() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtoll_internal() is undefined.
__strtoll_internal(__nptr, __endptr, __base, 0) has the same specification as strtoll(__nptr, __endptr, __base).
__strtoll_internal() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtoul_internal() is undefined.
__strtoul_internal(__nptr, __endptr, __base, 0) has the same specification as strtoul(__nptr, __endptr, __base).
__strtoul_internal() is not in the source standard; it is only in the binary standard.
__group shall be 0 or the behavior of __strtoull_internal() is undefined.
__strtoull_internal(__nptr, __endptr, __base, 0) has the same specification as strtoull(__nptr, __endptr, __base).
__strtoull_internal() is not in the source standard; it is only in the binary standard.
__sysconf() gets configuration information at runtime.
__sysconf() is weak alias to sysconf().
__sysconf() has the same specification as sysconf().
__sysconf() is not in the source standard; it is only in the binary standard.
__sysv_signal() has the same behavior as signal() as specified by ISO POSIX (2003).
__sysv_signal() is not in the source standard; it is only in the binary standard.
__tzname
has the same specification as
tzname
in the
ISO POSIX (2003).
Note that the array size of 2 is explicit in the ISO POSIX (2003), but not in the SUSv2.
group shall be 0 or the behavior of __wcstod_internal() is undefined.
__wcstod_internal(nptr, endptr, 0) shall behave as wcstod(nptr, endptr) as specified by ISO POSIX (2003).
__wcstod_internal() is not in the source standard; it is only in the binary standard.
group shall be 0 or the behavior of __wcstof_internal() is undefined.
__wcstof_internal(nptr, endptr, 0) shall behave as wcstof(nptr, endptr) as specified in ISO POSIX (2003).
__wcstof_internal() is not in the source standard; it is only in the binary standard.
group shall be 0 or the behavior of __wcstol_internal() is undefined.
__wcstol_internal(nptr, endptr, base, 0) shall behave as wcstol(nptr, endptr, base) as specified by ISO POSIX (2003).
__wcstol_internal() is not in the source standard; it is only in the binary standard.
group shall be 0 or the behavior of __wcstold_internal() is undefined.
__wcstold_internal(nptr, endptr, 0) shall behave as wcstold(nptr, endptr) as specified by ISO POSIX (2003).
__wcstold_internal() is not in the source standard; it is only in the binary standard.
group shall be 0 or the behavior of __wcstoul_internal() is undefined.
__wcstoul_internal(nptr, endptr, base, 0)() shall behave as wcstoul(nptr, endptr, base)() as specified by ISO POSIX (2003).
__wcstoul_internal() is not in the source standard; it is only in the binary standard.
The __xmknod() function shall implement the mknod() interface from ISO POSIX (2003).
The value of ver shall be 1 or the behavior of __xmknod() is undefined.
__xmknod(1, path, mode, dev) shall behave as mknod(path, mode, dev) as specified by ISO POSIX (2003).
The __xmknod() function is not in the source standard; it is only in the binary standard.
Note: The mknod() function is not in the binary standard; it is only in the source standard.
The functions __xstat(), __lxstat(), and __fxstat() shall implement the ISO POSIX (2003) functions stat(), lstat(), and fstat() respectively.
ver shall be 3 or the behavior of these functions is undefined.
__xstat(3, path, stat_buf) shall implement stat(path, stat_buf) as specified by ISO POSIX (2003).
__lxstat(3, path, stat_buf) shall implement lstat(path, stat_buf) as specified by ISO POSIX (2003).
__fxstat(3, fildes, stat_buf) shall implement fstat(fildes, stat_buf) as specified by ISO POSIX (2003).
__xstat(), __lxstat(), and __fxstat() are not in the source standard; they are only in the binary standard.
stat(), lstat(), and fstat() are not in the binary standard; they are only in the source standard.
The functions __xstat64(), __lxstat64(), and __fxstat64() shall implement the Large File Support functions stat64(), lstat64(), and fstat64() respectively.
ver shall be 3 or the behavior of these functions is undefined.
__xstat64(3, path, stat_buf) shall behave as stat(path, stat_buf) as specified by Large File Support.
__lxstat64(3, path, stat_buf) shall behave as lstat(path, stat_buf) as specified by Large File Support.
__fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, stat_buf) as specified by Large File Support.
__xstat64(), __lxstat64(), and __fxstat64() are not in the source standard; they are only in the binary standard.
stat64(), lstat64(), and fstat64() are not in the binary standard; they are only in the source standard.
The global variable
_nl_msg_cat_cntr
is incremented each time a new
catalog is loaded.
This variable is only in the binary standard; it is not in the source standard.
_sys_errlist
is an array containing the "C" locale
strings used by strerror(). This normally should not
be used directly. strerror() provides all of the
needed functionality.
_sys_siglist
is an array containing the names of
the signal names.
The _sys_siglist
array
is only in the binary standard; it is not in the source standard.
Applications wishing to access the names of signals should use
the strsignal() function.
When filename is the name of an existing file, acct() turns accounting on and appends a record to filename for each terminating process. When filename is NULL, acct() turns accounting off.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
adjtime() makes small adjustments to the system time as returned by gettimeofday()(2), advancing or retarding it by the time specified by the timeval delta. If delta is negative, the clock is slowed down by incrementing it more slowly than normal until the correction is complete. If delta is positive, a larger increment than normal is used. The skew used to perform the correction is generally a fraction of one percent. Thus, the time is always a monotonically increasing function. A time correction from an earlier call to adjtime() may not be finished when adjtime() is called again. If olddelta is non-NULL, the structure pointed to will contain, upon return, the number of microseconds still to be corrected from the earlier call.
adjtime() may be used by time servers that synchronize the clocks of computers in a local area network. Such time servers would slow down the clocks of some machines and speed up the clocks of others to bring them to the average network time.
Appropriate privilege is required to adjust the system time.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EFAULT | An argument points outside the process's allocated address space. | |
EPERM | The process does not have appropriate privilege. |
The asprintf() function shall behave as sprintf(), except that the output string shall be dynamically allocated space of sufficient length to hold the resulting string. The address of this dynamically allocated string shall be stored in the location referenced by ptr.
The bind_textdomain_codeset() function can be used to specify the output codeset for message catalogs for domain domainname. The codeset argument shall be a valid codeset name which can be used tor the iconv_open function, or a null pointer. If the codeset argument is the null pointer, then function returns the currently selected codeset for the domain with the name domainname. It shall return a null pointer if no codeset has yet been selected.
Each successive call to bind_textdomain_codeset() function overrrides the settings made by the preceding call with the same domainname.
The bind_textdomain_codeset() function shall return a pointer to a string containing the name of the selected codeset. The string shall be allocated internally in the function and shall not be changed or freed by the user.
The bind_textdomain_codeset() function returns a pointer to a string containing the name of the selected codeset. The string is allocated internally in the function and shall not be changed by the user.
Returns the currently selected codeset name. It returns a null pointer if no codeset has yet been selected.
If the process has appropriate privilege, the bindresvport() function shall bind a socket to a privileged IP port.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EPERM | The process did not have appropriate privilege. | |
EPFNOSUPPORT | Address of sin did not match address family of sd. |
The bindtextdomain() shall set the the base directory of the hierarchy containing message catalogs for a given message domain.
The bindtextdomain() function specifies that the domainname message catalog can be found in the dirname directory hierarchy, rather than in the system default locale data base.
If dirname is not
NULL
, the base directory for message catalogs
belonging to domain
domainname shall be set to
dirname.
If dirname is NULL
,
the base directory for message catalogs shall not be altered.
The function shall make copies of the argument strings as needed.
dirname can be an absolute or relative pathname.
Note: Applications that wish to use chdir() should always use absolute pathnames to avoid misadvertently selecting the wrong or non-existant directory.
If domainname is the null pointer, or is an empty
string, bindtextdomain() shall fail, but need not
set errno
.
The bindtextdomain() function shall return a pointer to a string containing the name of the selected directory. The string shall be allocated internally in the function and shall not be changed or freed by the user.
On success, bindtextdomain() shall return a
pointer to a string containing the
directory pathname currently bound to the domain. On failure, a
NULL pointer is returned, and the global variable
errno
may be set to indicate the error.
gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bind_textdomain_codeset
The cfmakeraw() function shall set the attributes of the termios structure referenced by termios_p as follows:
termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP |INLCR|IGNCR|ICRNL|IXON); termios_p->c_oflag &= ~OPOST; termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); termios_p->c_cflag &= ~(CSIZE|PARENB); termios_p->c_cflag |= CS8; |
termios_p shall point to a termios structure that contains the following members:
tcflag_t c_iflag; /* input modes */ tcflag_t c_oflag; /* output modes */ tcflag_t c_cflag; /* control modes */ tcflag_t c_lflag; /* local modes */ cc_t c_cc[NCCS]; /* control chars */ |
cfsetspeed() sets the baud rate values in the termios structure. The effects of the function on the terminal as described below do not become effective, nor are all errors detected, until the tcsetattr() function is called. Certain values for baud rates set in termios and passed to tcsetattr() have special meanings.
Input and output baud rates are found in the
termios structure. The unsigned integer
speed_t
is typdef'd in the include file
termios.h. The value of the integer corresponds
directly to the baud rate being represented; however, the following
symbolic values are defined.
#define B0 0 #define B50 50 #define B75 75 #define B110 110 #define B134 134 #define B150 150 #define B200 200 #define B300 300 #define B600 600 #define B1200 1200 #define B1800 1800 #define B2400 2400 #define B4800 4800 #define B9600 9600 #define B19200 19200 #define B38400 38400 #ifndef _POSIX_SOURCE #define EXTA 19200 #define EXTB 38400 #endif /*_POSIX_SOURCE */ |
cfsetspeed() sets both the input and output baud
rates in the termios structure referenced by
t
to speed.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
The daemon() function shall create a new process, detached from the controlling terminal. If successful, the calling process shall exit and the new process shall continue to execute the application in the background. If nochdir evaluates to true, the current directory shall not be changed. Otherwise, daemon() shall change the current working directory to the root (`/'). If noclose evaluates to true the standard input, standard output, and standard error file descriptors shall not be altered. Otherwise, daemon() shall close the standard input, standard output and standard error file descriptors and reopen them attached to /dev/null.
On error, -1 is returned, and the global
variable errno
is set to any of the errors
specified for the library functions fork() and
setsid().
The dcgettext() function is a domain specified version of gettext().
The dcgettext() function shall lookup the translation in the current locale of the message identified by msgid in the domain specified by domainname and in the locale category specified by category. If domainname is NULL, the current default domain shall be used. The msgid argument shall be a NULL-terminated string to be matched in the catalogue. category shall specify the locale category to be used for retrieving message strings. The category parameter shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall not be changed by a call to dcgettext().
If a translation was found in one of the specified catalogs, it shall be converted to the current locale's codeset and returned. The resulting NULL-terminated string shall be allocated by the dcgettext function, and must not be modified or freed. If no translation was found, or category was invalid, msgid shall be returned.
gettext, dgettext, ngettext, dngettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset
The dcngettext() function is a domain specific version of gettext, capable of returning either a singular or plural form of the message. The dcngettext() function shall lookup the translation in the current locale of the message identified by msgid1 in the domain specified by domainname and in the locale category specified by category. If domainname is NULL, the current default domain shall be used. The msgid1 argument shall be a NULL-terminated string to be matched in the catalogue. category shall specify the locale category to be used for retrieving message strings. The category parameter shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall not be changed by a call to dcngettext(). If n is 1 then the singular version of the message is returned, otherwise one of the plural forms is returned, depending on the value of n and the current locale settings.
If a translation corresponding to the value of n was found in one of the specified catalogs for msgid1, it shall be converted to the current locale's codeset and returned. The resulting NULL-terminated string shall be allocated by the dcngettext() function, and must not be modified or freed. If no translation was found, or category was invalid, msgid1 shall be returned if n has the value 1, otherwise msgid2 shall be returned.
gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, bindtextdomain, bind_textdomain_codeset
dgettext() is a domain specified version of gettext().
The dgettext() function shall search the currently selected message catalogs in the domain domainname for a string identified by the string msgid. If a string is located, that string shall be returned. The domain specified by domainname applies to the currently active LC_MESSAGE locale. The default domain shall not be changed by a call to dgettext().
Note: The usage of domainanme is equivalent in syntax and meaning to the textdomain() function's application of domainname, except that the selection of the domain in dgettext() is valid only for the duration of the call.
The dgettext() function is equivalent to dcgettext(domainname, msgid, LC_MESSAGES).
On success of a msgid query, the translated NULL-terminated string is returned. On error, the original msgid is returned. The length of the string returned is undetermined until dgettext() is called.
gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset
dngettext() shall be equivalent to a call to
dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) |
gettext, dgettext, ngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset
The duplocale() function shall provide a new locale object based on the locale object provided in locale, suitable for use in the newlocale() or uselocale() functions. The new object may be released by calling freelocale().
On success, the duplocale() function shall return
a locale object. Otherwise, it shall return
NULL
, and set errno
to indicate the error.
The err() function
shall display a formatted error message on the standard
error stream.
First, err() shall write
the last component of the program name, a colon
character, and a space character. If fmt is non-NULL, it shall be used as a
format string for the printf()
family of functions, and err() shall
write the formatted message, a
colon character, and a space.
Finally, the error message
string affiliated with the current value of the global variable
errno
shall be
written, followed by a newline character.
The err() function shall not return, the program shall terminate with the exit value of eval.
error() shall print a message to standard error.
error() shall build the message from the following elements in their specified order:
the program name. If the application has provided a function named
error_print_progname(), error()
shall call this to supply the program name;
otherwise, error()
uses the content of the global variable program_name
.
the colon and space characters, then the result of using the printf-style format and the optional arguments.
if errnum is nonzero,
error() shall add the colon and
space characters, then the result of
strerror(errnum
).
a newline.
If exitstatus is nonzero,
error() shall call
exit(exitstatus
).
The errx() function shall display a formatted error message on the standard error stream. The last component of the program name, a colon character, and a space shall be output. If fmt is non-NULL, it shall be used as the format string for the printf() family of functions, and the formatted error message, a colon character, and a space shall be output. The output shall be followed by a newline character.
errx() does not return, but shall exit with the value of eval.
fcntl() is as specified in ISO POSIX (2003), but with differences as listed below.
O_LARGEFILE
According to ISO POSIX (2003),
only an application sets
fcntl() flags, for example
O_LARGEFILE
. However, this specification
also allows an implementation to set the O_LARGEFILE
flag in the case where the programming environment is one of
_POSIX_V6_ILP32_OFFBIG
, _POSIX_V6_LP64_OFF64
, _POSIX_V6_LPBIG_OFFBIG
. See getconf and c99
in ISO POSIX (2003)
for a description of these environments.
Thus, calling fcntl() with the
F_GETFL command may return
O_LARGEFILE
as well as flags explicitly
set by the application in the case that both the implementation and
the application support an off_t of at least 64 bits.
fflush_unlocked() is the same as fflush() except that it need not be thread safe. That is, it may only be invoked in the ways which are legal for getc_unlocked().
fgetwc_unlocked() is the same as fgetwc() except that it need not be thread safe. That is, it may only be invoked in the ways which are legal for getc_unlocked().
flock() applies or removes an advisory lock on the open file fd. Valid operation types are:
A single file may not simultaneously have both shared and exclusive locks.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
The freelocale() function shall free the locale object locale, and release any resources associated with it.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The getgrouplist() function shall fill in the array groups with the supplementary groups for the user specified by user. On entry, ngroups shall refer to an integer containing the maximum number of gid_t members in the groups array. The group group shall also be included. On success, the value referred to by ngroups shall be updated to contain the number of gid_t objects copied.
On success, if there was sufficient room to copy all the
supplementatry group identifiers to the array
identified by groups,
getgrouplist() shall return the number of
gid_t objects copied, and the value referenced by
ngroups shall be updated.
If there was not sufficient room to copy all the supplementary
group identifiers, grouplist() shall return
-1
, and update the value referenced
by ngroups to the number actually copied.
If user does not refer to a valid
user on the system, getgrouplist() shall
return 0
, and set the value referenced by
ngroups to 0
.
getloadavg() returns the number of processes in the system run queue averaged over various periods of time. Up to nelem samples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively.
The getopt() function shall parse command line arguments as described in ISO POSIX (2003), with the following exceptions, where LSB and POSIX specifications vary. LSB systems shall implement the modified behaviors described below.
The getopt() function can process command line arguments referenced by argv in one of three ways:
PERMUTE | the order of arguments in argv is altered so that all options (and their arguments) are moved in front of all of the operands. This is the default behavior.
| |
REQUIRE_ORDER | The arguments in
argv are processed in exactly the order
given, and option processing stops when the first non-option argument
is reached, or when the element of argv is "--". This ordering
can be enforced either by setting the environment variable
| |
RETURN_IN_ORDER | The order of arguments is not altered, and all arguments are processed. Non-option arguments (operands) are handled as if they were the argument to an option with the value 1 ('\001'). This ordering is selected by setting the first character of optstring to '-'; |
LSB specifies that:
an element of argv that starts with "-" (and is not exactly "-" or "--") is an option element.
characters of an option element, aside from the initial "-", are option characters.
POSIX specifies that:
applications using getopt() shall obey the following syntax guidelines:
option name is a single alphanumeric character from the portable character set
option is preceded by the '-' delimiter character
options without option-arguments should be accepted when grouped behind one '-' delimiter
each option and option-argument is a separate argument
option-arguments are not optional
all options should precede operands on the command line
the argument "--" is accepted as a delimiter indicating the end of options and the consideration of subsequent arguments, if any, as operands
historical implementations of getopt() support other characters as options as an allowed extension, but applications that use extensions are not maximally portable.
support for multi-byte option characters is only possible when such characters can be represented as type int.
applications that call any utility with a first operand starting with '-' should usually specify "--" to mark the end of the options. Standard utilities that do not support this guideline indicate that fact in the OPTIONS section of the utility description.
LSB specifies that:
if a character is followed by two colons, the option takes an optional argument; if there is text in the current argv element, it is returned in optarg, otherwise optarg is set to 0.
if optstring contains W followed by a semi-colon (;), then -W foo is treated as the long option --foo.
Note: See getopt_long() for a description of long options.
The first character of optstring shall modify the behavior of getopt() as follows:
if the first character is '+', then
REQUIRE_ORDER
processing shall be in
effect (see above)
if the first character is '-', then
RETURN_IN_ORDER
processing shall be in
effect (see above)
if the first character is ':', then
getopt() shall return ':' instead of '?'
to indicate a missing option argument, and shall not print any
diagnostic message to stderr
.
POSIX specifies that:
the -W
option is reserved for implementation extensions.
LSB specifies the following additional getopt() return values:
'\001' is returned
if RETURN_IN_ORDER
argument ordering is in effect,
and the next argument is an operand, not an option. The argument is
available in optarg
.
POSIX specifies the following getopt() return values:
the next option character is returned, if found successfully.
':' is returned if a parameter is missing for
one of the options and the first character of optstring
is
':'.
'?' is returned if an unknown option
character not in optstring
is encountered, or if
getopt() detects a missing argument and the first
character of optstring
is not ':'.
-1 is returned for the end of the option list.
LSB specifies that:
if the variable POSIXLY_CORRECT
is set, option
processing stops as soon as a non-option argument is encountered.
the variable _[PID]_GNU_nonoption_argv_flags_
(where [PID] is the process ID for the
current process), contains a space separated list of arguments that should
not be treated as arguments even though they appear to be so.
Rationale: This was used by bash 2.0 to communicate to GNU libc which arguments resulted from wildcard expansion and so should not be considered as options. This behavior was removed in bash version 2.01, but the support remains in GNU libc.
getopt_long() works like getopt() except that it also accepts long options, started out by two dashes. Long option names may be abbreviated if the abbreviation is unique or is an exact match for some defined option. A long option may take a parameter, of the form --arg=param or --arg param.
longopts is a pointer to the first element of an array of struct option declared in getopt.h as:
struct option { const char *name; int has_arg; int *flag; int val; }; |
The fields in this structure have the following meaning:
getopt_long() returns the option character if a short option was found successfully, or ":" if there was a missing parameter for one of the options, or "?" for an unknown option character, or -1 for the end of the option list.
For a long option,
getopt_long() returns val
if flag
is NULL, and 0
otherwise. Error and -1 returns are the
same as for getopt(), plus
"?" for an ambiguous match or an
extraneous parameter.
getopt_long_only() is like getopt_long(), but "-" as well as "--" can indicate a long option. If an option that starts with "-" (not "--") doesn't match a long option, but does match a short option, it is parsed as a short option instead.
Note: The getopt_long_only() function is intended only for supporting certain programs whose command line syntax was designed before the Utility Syntax Guidelines of ISO POSIX (2003) were developed. New programs should generally call getopt_long() instead, which provides the --option syntax for long options, which is preferred by GNU and consistent with ISO POSIX (2003).
getopt_long_only() returns the option character if the option was found successfully, or ":" if there was a missing parameter for one of the options, or "?" for an unknown option character, or -1 for the end of the option list.
getopt_long_only() also returns the option character when a short option is recognized. For a long option, they return val if flag is NULL, and 0 otherwise. Error and -1 returns are the same as for getopt(), plus "?" for an ambiguous match or an extraneous parameter.
The getsockopt() function shall behave as specified in ISO POSIX (2003), with the following extensions.
If the level parameter is
IPPROTO_IP
, the following values shall be supported for
option_name (see RFC 791:Internet Protocol for
further details):
IP_OPTIONS | Get the Internet Protocol options sent with every packet from this socket. The option_value shall point to a memory buffer in which the options shall be placed; on entry option_len shall point to an integer value indicating the maximum size of the memory buffer, in bytes. On successful return, the value referenced by option_len shall be updated to the size of data copied to the buffer. For IPv4, the maximum length of options is 40 bytes. | |
IP_TTL | Get the current unicast Internet Protocol Time To Live value used when sending packets with this socket. The option_value shall point to a buffer large enough to hold the time to live value (at least 1 byte), and option_len shall point to an integer value holding the maximum size of that buffer. On successful return, the value referenced by option_len shall be updated to contain the number of bytes copied into the buffer, which shall be no larger than the initial value, and option_value shall point to an integer containing the time to live value. | |
IP_TOS | Get the Internet Protocol type of service indicator used when sending packets with this socket. The option_value shall point to a buffer large enough to hold the type of service indicator (at least 1 byte), and option_len shall point to an integer value holding the maximum size of that buffer. On successful return, the value referenced by option_len shall be updated to contain the number of bytes copied into the buffer, which shall be no larger than the initial value, and option_value shall point to an integer containing the time to live value. |
The gettext() function shall search the currently selected message catalogs for a string identified by the string msgid. If a string is located, that string shall be returned.
The gettext() function is equivalent to dcgettext(NULL, msgid, LC_MESSAGES).
If a string is found in the currently selected message catalogs for msgid, then a pointer to that string shall be returned. Otherwise, a pointer to msgid shall be returned.
Applications shall not modify the string returned by gettext().
dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset
Upon successful completion, getutent() shall return a pointer to a utmp structure containing a copy of the requested entry in the user accounting database. Otherwise, a null pointer shall be returned. The return value may point to a static area which is overwritten by a subsequent call to getutent().
The getutent_r() function is a reentrant version of the getutent() function. On entry, buffer should point to a user supplied buffer to which the next entry in the database will be copied, and result should point to a location where the result will be stored.
On success, getutent_r() shall return 0 and set
the location referenced by result to a pointer
to buffer. Otherwise, getutent_r()
shall return -1
and set the location referenced
by result to NULL
.
The glob64() function is a large-file version of the glob() defined in ISO POSIX (2003). It shall search for pathnames matching pattern according to the rules used by the shell, /bin/sh. No tilde expansion or parameter substitution is done; see wordexp().
The results of a glob64()
call are stored in the structure pointed to by pglob,
which is a glob64_t
declared in
glob.h with the following members:
typedef struct { size_t |
Structure members with the same name as corresponding members of a
glob_t
as
defined in ISO POSIX (2003) shall have the same purpose.
Other members are defined as follows:
gl_flags | reserved for internal use | |
gl_closedir | pointer to a function capable of closing a directory opened by
| |
gl_readdir64 | pointer to a function capable of reading entries in a large directory | |
gl_opendir | pointer to a function capable of opening a large directory | |
gl_stat | pointer to a function capable of returning file status for a large file | |
gl_lstat | pointer to a function capable of returning file status information for a large file or symbolic link |
A large file or large directory is one with a size which cannot be represented by a variable of type off_t.
On success, 0 is returned. Other possible returns are:
GLOB_NOSPACE | out of memory | |
GLOB_ABORTED | read error | |
GLOB_NOMATCH | no match found |
globfree64() frees the dynamically allocated storage from an earlier call to glob64().
globfree64() is a 64-bit version of globfree().
If the process has appropriate privilege, the initgroups() function shall initialize the Supplementary Group IDs for the current process by reading the group database and using all groups of which user is a member. The additional group group is also added to the list.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EPERM | The calling process does not have sufficient privileges. | |
ENOMEM | Insufficient memory to allocate group information structure. |
The ioctl() function shall manipulate the underlying device parameters of special files. fildes shall be an open file descriptor referring to a special file. The ioctl() function shall take three parameters; the type and value of the third parameter is dependent on the device and request.
Conforming LSB applications shall not call ioctl() except in situations explicitly stated in this specification.
On success, 0 is returned.
An ioctl() may use the return value as an
output parameter and return a non-negative value on success.
On error, -1 is returned and
the global variable errno
is set appropriately.
EBADF | fildes is not a valid descriptor. | |
EFAULT | The third parameter references an inaccessible memory area. | |
ENOTTY | fildes is not associated with a character special device. | |
ENOTTY | The specified request does not apply to the kind of object that fildes references. | |
EINVAL | request or the third parameter is not valid. |
It should be noted that ISO POSIX (2003) contains an interface named ioctl(). The LSB only defines behavior when fildes refers to a socket (see sockio) or terminal device (see ttyio), while ISO POSIX (2003) only defines behavior when fildes refers to a STREAMS device. An implementation may support both behaviors; the LSB does not require any STREAMS support.
Socket ioctl() commands are a subset of the ioctl() calls, which can perform a variety of functions on sockets. sockfd shall be an open file descriptor referring to a socket (see the socket() or accept() functions).
Socket ioctl() commands apply to the underlying network interfaces, and affect the entire system, not just the file descriptor used to issue the ioctl().
The following values for request are accepted:
Get the interface configuration list for the system.
Note: The SIOCGIFCONF interface is superceded by the if_nameindex() family of functions (see ISO POSIX (2003)). A future version of this specification may withdraw this value for request.
ifc_ifcu.ifcu_req
field
to point to an array of ifreq structures, and
set ifc_len
to the size in bytes of this allocated
array. Upon return, ifc_len
will contain the size in bytes of the array which was actually used.
If it is the same as the length upon calling, the caller
should assume that the array was too small and try again with a
larger array.On success, SIOCGIFCONF shall return a nonnegative value.
Rationale: Historical UNIX systems disagree on the meaning of the return value.
Get the interface flags for the indicated interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_flags
field is set
with the interface flags.
Get the interface address for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_addr
field is set
with the interface address.
Get the interface broadcast address for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_broadcast
field is set
with the interface broadcast address.
Get the network mask for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_netmask
field is set
with the network mask.
Get the Maximum Transmission Unit (MTU) size for the given interface.
argp shall point to a
ifreq structure. Before calling, the
caller should fill in the ifr_name
field with the interface name, and upon return, the
ifr_ifru.ifru_mtu
field is set
with the MTU.
Get the amount of queued unread data in the receive buffer. argp shall point to an integer where the result is to be placed.
Note: Some implementations may also support the use of FIONREAD on other types of file descriptor. However, the LSB only specifies its behavior for a socket related file descriptor.
On success, if request is
SIOCGIFCONF, a non-negative integer shall be returned.
If request is not SIOCGIFCONF, on success
0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EBADF | sockfd is not a valid descriptor. | |
EFAULT | argp references an inaccessible memory area. | |
ENOTTY | The specified request does not apply to the kind of object that the descriptor sockfd references. | |
EINVAL | Either request or argp is invalid. | |
ENOTCONN | The operation is only defined on a connected socket, but the socket wasn't connected. |
Tty ioctl commands are a subset of the ioctl() calls, which can perform a variety of functions on tty devices. fd shall be an open file descriptor referring to a terminal device.
The following ioctl()s are provided:
TIOCGWINSZ | Get the size attributes of the terminal or pseudo-terminal identified by
fd. On entry, argp shall reference
a winsize structure.
On return, the structure will have
|
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EBADF | fd is not a valid descriptor. | |
EFAULT | argp references an inaccessible memory area. | |
EINVAL | request and argp are not valid. |
kill() is as specified in the ISO POSIX (2003), but with differences as listed below.
If pid is specified as -1, sig shall not be sent to the calling process. Other than this, the rules in the ISO POSIX (2003) apply.
Rationale: This was a deliberate Linus decision after an unpopular experiment in including the calling process in the 2.5.1 kernel. See "What does it mean to signal everybody?", Linux Weekly News, 20 December 2001, http://lwn.net/2001/1220/kernel.php3
The link() function shall behave as specified in ISO POSIX (2003), except with differences as listed below.
ISO POSIX (2003) specifies that pathname resolution shall follow symbolic links during pathname resolution unless the function is required to act on the symbolic link itself, or certain arguments direct that the function act on the symbolic link itself. The link() function in ISO POSIX (2003) contains no such requirement to operate on a symbolic link. However, a conforming LSB implementation need not follow a symbolic link for the path1 argument.
mbsnrtowcs() is like mbsrtowcs(), except that the number of bytes to be converted, starting at src, is limited to nms.
If dest is not a NULL pointer, mbsnrtowcs() converts at most nms bytes from the multibyte string src to a wide-character string starting at dest. At most, len wide characters are written to dest. The state ps is updated.
The conversion is effectively performed by repeatedly calling:
mbrtowc(dest, *src, n, ps) |
The conversion can stop for three reasons:
An invalid multibyte sequence has been encountered. In this case
src is left pointing to the invalid multibyte
sequence, (size_t)(-1) is returned, and errno
is
set to EILSEQ.
The nms limit forces a stop, or len non-L'\0' wide characters have been stored at dest. In this case, src is left pointing to the next multibyte sequence to be converted, and the number of wide characters written to dest is returned.
The multibyte string has been completely converted, including the terminating '\0' (which has the side effect of bringing back ps to the initial state). In this case, src is set to NULL, and the number of wide characters written to dest, excluding the terminating L'\0' character, is returned.
If dest is NULL, len is ignored, and the conversion proceeds as above, except that the converted wide characters are not written out to memory, and that no destination length limit exists.
In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to mbsnrtowcs() is used instead.
The programmer shall ensure that there is room for at least len wide characters at dest.
mbsnrtowcs() returns the number of wide characters
that make up the converted part of the wide character string, not
including the terminating null wide character. If an invalid multibyte
sequence was encountered, (size_t)(-1) is returned, and the global
variable errno
is set to EILSEQ.
The behavior of mbsnrtowcs() depends on the
LC_CTYPE
category of the current locale.
Passing NULL as ps is not multi-thread safe.
memmem() finds the start of the first occurrence of the byte array referenced by needle of length needlelen in the memory area haystack of length haystacklen.
memmem() returns a pointer to the beginning of the byte array, or NULL if the byte array is not found.
Earlier versions of the C library (prior to glibc 2.1) contained a memmem() with various problems, and application developers should treat this function with care.
The memrchr() function shall locate the last occurence of c (converted to an unsigned char) in the initial n bytes (each interpreted as an unsigned char) of the object pointed to by s.
The memrchr() shall return a pointer to the located byte, or a null pointer if the byte does not occur in the object.
The newlocale() function shall initialize
a locale object. If base is
NULL
, then newlocale()
shall first allocate the object; otherwise it shall use the locale
object referenced by base.
The object shall be initialized for the locale named
by locale, and for the categories selected
in category_mask. The
category_mask value is a bitwise
inclusive OR of the required
LC_name_MASK
values, or the value LC_ALL_MASK
.
On success, the newlocale() function shall return
the initialized locale object. Otherwise, it shall return
NULL
, and set errno
to indicate the error.
The newlocale() function shall fail if:
ENOMEM | Insufficient memory. | |
EINVAL | An invalid category_mask was provided, or
the locale was |
The only portable way to allocate a locale object is to call
newlocale() with a NULL
base. The allocated object may be reinitialized
to a new locale by passing it back to newlocale().
The new object may be released by calling freelocale().
The ngettext() function shall search the currently selected message catalogs for a string matching the singular string msgid1. If a string is located, and if n is 1, that string shall be returned. If n is not 1, a pluralized version (dependent on n) of the string shall be returned.
The ngettext() function is equivalent to dcngettext(NULL, msgid1, msgid2, n, LC_MESSAGES)().
If a string is found in the currently selected message catalogs for
msgid1, then if n is
1
a pointer to the located string shall be returned.
If n is not 1
, a pointer to an
appropriately pluralized version of the string shall be returned.
If no message could be found in the currently selected mesage catalogs,
then if n is 1
,
a pointer to msgid1 shall be returned, otherwise
a pointer to msgid2 shall be returned.
Applications shall not modify the string returned by ngettext().
gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset
The pmap_getport() function shall
return the port number assigned to a service registered with a
RPC Binding service running on a given target system,
using the protocol described in
RFC 1833: Binding Protocols for ONC RPC Version 2.
The pmap_getport() function shall be called given the
RPC program number program,
the program version version, and transport
protocol protocol. Conforming implementations shall
support both IPPROTO_UDP
and
IPPROTO_TCP
protocols. On entry,
address shall specify the address of the
system on which the portmapper to be
contacted resides. The value of address->sin_port
shall be ignored, and the standard
value for the portmapper port shall always be used.
Note: Security and network restrictions may prevent a conforming application from contacting a remote RPC Binding Service.
On success, the pmap_getport() function shall return
the port number in host byte order of the RPC application
registered with the remote portmapper. On failure,
if either the program was not
registered or the remote portmapper service could not be reached,
the pmap_getport() function
shall return 0. If the remote portmap service could not be reached, the status
is left in the global variable rpc_createerr
.
pmap_set() establishes a mapping between the
triple [program,version,protocol] and
port on the machine's RPC Bind
service. The value of protocol
is most likely IPPROTO_UDP
or IPPROTO_TCP
. Automatically done by svc_register().
As a user interface to the RPC Bind service,
pmap_unset() destroys all mapping between the triple
[prognum,versnum,
*] and ports
on the machine's
RPC Bind service.
The psignal() function shall
display a message on the stderr
stream.
If s is not the null pointer, and does
not point to an empty string (e.g. "\0"), the
message shall consist
of the string s, a colon, a space, and a string
describing the signal number sig; otherwise
psignal() shall display only a message describing
the signal number sig. If
sig is invalid, the message displayed shall
indicate an unknown signal.
The array sys_siglist
holds the signal description
strings indexed by signal number.
The regexec() function shall behave as specified in ISO POSIX (2003), except with differences as listed below.
Certain aspects of regular expression matching are optional; see Internationalization and Regular Expressions.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
setbuffer() is an alias for the call to setvbuf(). It works the same, except that the size of the buffer in setbuffer() is up to the caller, rather than being determined by the default BUFSIZ.
If the process has appropriate privilege,
the setgroups() function shall set
the supplementary group IDs for
the current process. list shall reference
an array of size group IDs. A process
may have at most NGROUPS_MAX
supplementary
group IDs.
On successful completion, 0 is returned.
On error, -1 is returned and
the errno
is set to indicate the error.
EFAULT | list has an invalid address. | |
EPERM | The process does not have appropriate privileges. | |
EINVAL | size is greater than |
If the process has appropriate privileges, the sethostname() function shall change the host name for the current macine. The name shall point to a null-terminated string of at most len bytes that holds the new hostname.
If the symbol HOST_NAME_MAX
is defined, or if
sysconf(_SC_HOST_NAME_MAX)() returns a value greater
than 0, this value shall represent the maximum length of the new hostname.
Otherwise, if the symbol MAXHOSTLEN
is defined, this value
shall represent the maximum length for the new hostname. If none of these
values are defined, the maximum length shall be the size of the
nodename
field of the
utsname structure.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
EINVAL | len is negative or larger than the maximum allowed size. | |
EPERM | the process did not have appropriate privilege. | |
EFAULT | name is an invalid address. |
ISO POSIX (2003) guarantees that:
Maximum length of a host name (not including the terminating null) as returned from the gethostname() function shall be at least 255 bytes.
The glibc C library does not currently define HOST_NAME_MAX
,
and although it provides the name _SC_HOST_NAME_MAX
a call to sysconf() returns -1
and does not alter errno
in this case (indicating that
there is no restriction on the hostname length). However, the glibc
manual idicates that some implementations may have
MAXHOSTNAMELEN
as a means of detecting the maximum length,
while the Linux kernel at release 2.4 and 2.6 stores this hostname
in the utsname structure.
While the glibc manual suggests simply shortening the name until
sethostname() succeeds, the LSB requires
that one of the first four mechanisms works.
Future versions of glibc may provide a more reasonable result from
sysconf(_SC_HOST_NAME_MAX
).
The setsockopt() function shall behave as specified in ISO POSIX (2003), with the following extensions.
If the level parameter is
IPPROTO_IP
, the following values shall be supported for
option_name (see RFC 791:Internet Protocol for
further details):
IP_OPTIONS | Set the Internet Protocol options sent with every packet from this socket. The option_value shall point to a memory buffer containing the options and option_len shall contain the size in bytes of that buffer. For IPv4, the maximum length of options is 40 bytes. | |
IP_TOS | Set the Type of Service flags to use when sending packets with this socket. The option_value shall point to a value containing the type of service value. The least significant two bits of the value shall contain the new Type of Service indicator. Use of other bits in the value is unspecified. The option_len parameter shall hold the size, in bytes, of the buffer referred to by option_value. | |
IP_TTL | Set the current unicast Internet Protocol Time To Live value used when sending packets with this socket. The option_value shall point to a value containing the time to live value, which shall be between 1 and 255. The option_len parameter shall hold the size, in bytes, of the buffer referred to by option_value. | |
IP_MULTICAST_TTL | Sets the Time To Live value of outgoing multicast packets for this
socket. optval shall point to an integer which contains
the new TTL value. If the new TTL value is | |
IP_MULTICAST_LOOP | Sets a boolean flag indicating whether multicast packets originating locally should be looped back to the local sockets. optval shall point to an integer which contains the new flag value. | |
IP_ADD_MEMBERSHIP | Join a multicast group.
optval shall point to a
ip_mreq structure. Before calling, the
caller should fill in the | |
IP_DROP_MEMBERSHIP | Leave a multicast group.
optval shall point to a
ip_mreq structure containing the same values as were
used with | |
IP_MULTICAST_IF | Set the local device for a multicast socket.
optval shall point to a
ip_mreq structure initialized in the same manner as
with |
The ip_mreq structure contains two
struct in_addr fields:
imr_multiaddr
and
imr_address
.
On success, 0 is returned.
On error, -1 is returned and
the global variable errno
is set appropriately.
The setutent() function shall reset the user accounting database such that the next call to getutent() shall return the first record in the database. It is recommended to call it before any of the other functions that operate on the user accounting databases (e.g. getutent())
The sigandset() shall combine the two signal sets referenced by left and right, using a logical AND operation, and shall place the result in the location referenced by set, The resulting signal set shall contain only signals that are in both the set referenced by left and the set referenced by right.
On success, sigandset() shall return 0. Otherise, sigandset() shall return
-1 and set errno
to indicate
the error.
The sigisemptyset() function shall return
a positive non-zero value if the signal set referenced by
set is empty, or zero if this set is empty.
On error, sigisemptyset() shall return -1 and set errno
to indicate the error.
The sigorset() shall combine the two signal sets referenced by left and right, using a logical OR operation, and shall place the result in the location referenced by set, The resulting signal set shall contain only signals that are in either the set referenced by left or the set referenced by right.
On success, sigorset() shall return 0. Otherise, sigorset() shall return
-1 and set errno
to indicate
the error.
The sigreturn() function is used by the system to cleanup after a signal handler has returned. This function is not in the source standard; it is only in the binary standard.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
If the process has appropriate privilege, the stime() function shall set the system's idea of the time and date. Time, referenced by t, is measured in seconds from the epoch (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970).
On success, stime() shall return
0.
Otherwise, stime() shall return
-1 and
errno
shall be set to indicate the error.
The stpcpy() function shall copy the string pointed to by src (including the terminating null character) to the array pointed to by dest. The strings may not overlap, and the destination string dest shall be large enough to receive the copy.
stpcpy() returns a pointer to the end of the string dest (that is, the address of the terminating null character) rather than the beginning.
This program uses stpcpy() to concatenate foo and bar to produce foobar, which it then prints.
#include <string.h> int main (void) { char buffer[256]; char *to = buffer; to = stpcpy (to, "foo"); to = stpcpy (to, "bar"); printf ("%s\n", buffer); } |
The stpncpy() function shall copy at most n characters from the string pointed to by src, including the terminating null character, to the array pointed to by dest. Exactly n characters are written at dest. If the length strlen()(src) is smaller than n, the remaining characters in dest are filled with '\0' characters. If the length strlen(src) is greater than or equal to n, dest will not be null terminated.
The strings may not overlap.
The programmer shall ensure that there is room for at least n characters at dest.
The stpncpy() function shall return a pointer to the terminating NULL in dest, or, if dest is not NULL-terminated, dest + n.
The strcasestr() shall behave as strstr(), except that it shall ignore the case of both strings. The strcasestr() function shall be locale aware; that is strcasestr() shall behave as if both strings had been converted to lower case in the current locale before the comparison is performed.
Upon successful completion, strcasestr() shall return a pointer to the located string or a null pointer if the string is not found. If s2 points to a string with zero length, the function shall return s1.
The strerror_r() shall behave as specified in ISO POSIX (2003), except as described below.
On success, strerror_r() shall return a pointer
to the generated message string (determined by the setting of the
LC_MESSAGES
category in the current locale).
Otherwise, strerror_r() shall return the string
corresponding to "Unknown error".
The strndup() function shall return a malloc()'d copy of at most n bytes of string. The resultant string shall be terminated even if no NULL terminator appears before string+n.
On success, strndup() shall return a pointer to a newly
allocated block of memory containing a copy of at most n
bytes of string. Otherwise, strndup()
shall return NULL and set errno
to indicate the error.
strnlen() returns the number of characters in the string s, not including the terminating \0 character, but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters at s and never beyond s + maxlen.
strnlen() returns strlen(s), if that is less than maxlen, or maxlen if there is no \0 character among the first maxlen characters pointed to by s.
The strptime() shall behave as specified in the ISO POSIX (2003) with differences as listed below.
The ISO POSIX (2003) specifies fields for which "leading zeros are
permitted but not required"; however, applications shall not expect to
be able to supply more leading zeroes for these fields than would be
implied by the range of the field. Implementations may choose to
either match an input with excess leading zeroes, or treat this as a
non-matching input. For example, %j
has a range of
001 to 366, so 0,
00, 000, 001,
and 045 are acceptable inputs, but inputs such as
0000, 0366 and the like are not.
glibc developers consider it appropriate behavior to forbid excess leading zeroes. When trying to parse a given input against several format strings, forbidding excess leading zeroes could be helpful. For example, if one matches 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for the first match to fail, as it would be perverse to parse that date as November 12, year 26. The second pattern parses it as December 26, year 11.
The ISO POSIX (2003) is not explicit that an unlimited number of leading zeroes are required, although it may imply this. The LSB explicitly allows implementations to have either behavior. Future versions of this standard may require implementations to forbid excess leading zeroes.
An Interpretation Request is currently pending against ISO POSIX (2003) for this matter.
The strsep() function shall find the first token in the string referenced by the pointer stringp, using the characters in delim as delimiters.
If stringp is NULL, strsep() shall return NULL and do nothing else.
If stringp is non-NULL, strsep() shall find the first token in the string referenced by stringp, where tokens are delimited by characters in the string delim. This token shall be terminated with a \0 character by overwriting the delimiter, and stringp shall be updated to point past the token. In case no delimiter was found, the token is taken to be the entire string referenced by stringp, and the location referenced by stringp is made NULL.
The strsep() function was introduced as a replacement for strtok(), since the latter cannot handle empty fields. However, strtok() conforms to ISO C (1999) and to ISO POSIX (2003) and hence is more portable.
The strsignal() function shall return a pointer to a string describing the signal number sig. The string can only be used until the next call to strsignal().
The array sys_siglist
holds the signal description
strings indexed by signal number. This array should not be accessed
directly by applications.
If sig is a valid signal number, strsignal() shall return a pointer to the appropriate description string. Otherwise, strsignal() shall return either a pointer to the string "unknown signal", or a null pointer.
Although the function is not declared as returning a pointer to a constant character string, applications shall not modify the returned string.
strtoq() converts the string nptr to a quadt value. The conversion is done according to the given base, which shall be between 2 and 36 inclusive, or be the special value 0.
nptr may begin with an arbitrary amount of white space (as determined by isspace()), followed by a single optional + or - sign character. If base is 0 or 16, the string may then include a 0x prefix, and the number will be read in base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next character is 0, in which case it is taken as 8 (octal).
The remainder of the string is converted to a long value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter A in either upper or lower case represents 10, B represents 11, and so forth, with Z representing 35.)
strtoq() returns the result of the conversion,
unless the value would underflow or overflow. If an underflow occurs,
strtoq() returns QUAD_MIN
. If
an overflow occurs, strtoq() returns
QUAD_MAX
. In both cases, the global variable
errno
is set to ERANGE.
strtouq() converts the string nptr to an unsigned long long value. The conversion is done according to the given base, which shall be between 2 and 36 inclusive, or be the special value 0.
nptr may begin with an arbitrary amount of white space (as determined by isspace()), followed by a single optional + or - sign character. If base is 0 or 16, the string may then include a 0x prefix, and the number will be read in base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next character is 0, in which case it is taken as 8 (octal).
The remainder of the string is converted to an unsigned long value in the obvious manner, stopping at the end of the string or at the first character that does not produce a valid digit in the given base. (In bases above 10, the letter A in either upper or lower case represents 10, B represents 11, and so forth, with Z representing 35.)
On success, strtouq() returns either the result of
the conversion or, if there was a leading minus sign, the negation of
the result of the conversion, unless the original (non-negated) value
would overflow. In the case of an overflow the function returns
UQUAD_MAX
and the global variable errno
is set to ERANGE.
The svc_register() function shall associate
the program identified by prognum at version
versnum
with the service dispatch procedure, dispatch.
If protocol is zero, the service is not registered with the
portmap
service. If protocol is
non-zero, then a mapping of the triple [prognum,
versnum, protocol] to
xprt->xp_port
is established with the local
portmap
service. The
procedure dispatch has the following form:
The svc_run() function shall wait for RPC requests to arrive, read and unpack each request, and dispatch it to the appropriate registered handler. Under normal conditions, svc_run() shall not return; it shall only return if serious errors occur that prevent further processing.
Called by an RPC service's dispatch routine to send the results of a remote procedure call. The parameter xprt is the request's associated transport handle; outproc is the XDR routine which is used to encode the results; and out is the address of the results. This routine returns one if it succeeds, zero other-wise.
svctcp_create() cretes a TCP/IP-based RPC service transport,
to which it returns a pointer. The transport is associated with the socket
sock, which may be RPC_ANYSOCK
, in
which case a new socket is created. If the socket is not bound to a local TCP
port, then this routine binds it to an arbitrary port. Upon completion,
xprt->xp_sock
is the transport's socket descriptor,
and xprt->xp_port
is the transport's port number. Since
TCP-based RPC uses buffered I/O, users may specify the size of buffers;
values of zero choose suitable defaults.
svctcp_create() returns NULL if it fails, or a pointer to the RPC service transport otherwise.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The fact that system() ignores interrupts is often not what a program wants. ISO POSIX (2003) describes some of the consequences; an additional consequence is that a program calling system() from a loop cannot be reliably interrupted. Many programs will want to use the exec() family of functions instead.
Do not use system() from a program with
suid
or sgid
privileges,
because unexpected values for some environment variables might be used
to subvert system integrity. Use the exec()
family of functions instead, but not execlp()
or execvp(). system() will
not, in fact, work properly from programs with suid
or sgid
privileges on systems on which
/bin/sh is bash version 2,
since bash 2 drops privileges on startup.
(Debian uses a modified bash which does not do
this when invoked as sh.)
The check for the availability of /bin/sh is not actually performed; it is always assumed to be available. ISO C (1999) specifies the check, but ISO POSIX (2003) specifies that the return shall always be nonzero, since a system without the shell is not conforming, and it is this that is implemented.
It is possible for the shell command to return
127, so that code is not a sure
indication that the execve() call failed; check
the global variable errno
to make sure.
The textdomain() function shall set the current default message domain to domainname. Subsequent calls to gettext() and ngettext() use the default message domain.
If domainname is NULL, the default message domain shall not be altered.
If domainname is "", textdomain() shall reset the default domain to the system default of "messages".
On success, textdomain() shall return the currently
selected domain. Otherwise, a null pointer shall be returned, and
errno
is set to indicate the error.
unlink() is as specified in ISO POSIX (2003), but with differences as listed below.
See also Section 18.1, Additional behaviors: unlink/link on directory.
If path specifies a directory, the implementation may return EISDIR instead of EPERM as specified by ISO POSIX (2003).
Rationale: The Linux kernel has deliberately chosen EISDIR for this case and does not expect to change.
The uselocale() function shall set the locale for the calling thread to the locale specified by newloc.
If newloc is the value
LC_GLOBAL_LOCALE
,
the thread's locale shall be set to the process current
global locale, as set
by setlocale().
If newloc is NULL
, the
thread's locale is not altered.
The uselocale() function shall return the previous locale,
or LC_GLOBAL_LOCALE
if the thread local locale
has not been previously set.
The utmpname() function shall cause the user accounting database used by the getutent(), getutent_r(), getutxent(), getutxid(), getutxline(), and pututxline() functions to be that named by dbname, instead of the system default database. See Section 16.3 for further information.
Note: The LSB does not specify the format of the user accounting database, nor the names of the file or files that may contain it.
The vasprintf() function shall write formatted output to a dynamically allocated string, and store the address of that string in the location referenced by ptr. It shall behave as asprintf(), except that instead of being called with a variable number of arguments, it is called with an argument list as defined by <stdarg.h>.
The vdprintf() function shall behave as vfprintf(), except that vdprintf() shall write output to the file associated with the file descriptor specified by the fd argument, rather than place output on a stream (as defined by ISO POSIX (2003)).
The verrx() shall behave as errx() except that instead of being called with a variable number of arguments, it is called with an argument list as defined by <stdarg.h>.
verrx() does not return, but exits with the value of eval.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
The vsyslog() function is identical to syslog() as specified in ISO POSIX (2003), except that arglist (as defined by stdarg.h) replaces the variable number of arguments.
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
wait4() suspends execution of the current process until a child (as specified by pid) has exited, or until a signal is delivered whose action is to terminate the current process or to call a signal handling function. If a child (as requested by pid) has already exited by the time of the call (a so-called "zombie" process), the function returns immediately. Any system resources used by the child are freed.
The value of pid can be one of:
< -1 | wait for any child process whose process group ID is equal to the absolute value of pid. | |
-1 | wait for any child process; this is equivalent to calling wait3(). | |
0 | wait for any child process whose process group ID is equal to that of the calling process. | |
> 0 | wait for the child whose process ID is equal to the value of pid. |
The value of options is a bitwise or of zero or more of the following constants:
WNOHANG | return immediately if no child is there to be waited for. | |
WUNTRACED | return for children that are stopped, and whose status has not been reported. |
If status is not NULL, wait4() stores status information in the location status. This status can be evaluated with the following macros:
Note: These macros take the
status
value (an int) as an argument -- not a pointer to the value!
WIFEXITED(status) | is nonzero if the child exited normally. | |
WEXITSTATUS(status) | evaluates to the least significant eight bits of the return code of the child that terminated, which may have been set as the argument to a call to exit() or as the argument for a return statement in the main program. This macro can only be evaluated if WIFEXITED() returned nonzero. | |
WIFSIGNALED(status) | returns true if the child process exited because of a signal that was not caught. | |
WTERMSIG(status) | returns the number of the signal that caused the child process to terminate. This macro can only be evaluated if WIFSIGNALED() returned nonzero. | |
WIFSTOPPED(status) | returns true if the child process that caused the return is currently stopped; this is only possible if the call was done using WUNTRACED(). | |
WSTOPSIG(status) | returns the number of the signal that caused the child to stop. This macro can only be evaluated if WIFSTOPPED() returned nonzero. |
If rusage is not NULL, the struct rusage (as defined in sys/resource.h) that it points to will be filled with accounting information. See getrusage() for details.
On success, the process ID of the child that exited is returned. On
error, -1 is returned (in particular, when
no unwaited-for child processes of the specified kind exist), or
0 if WNOHANG() was used
and no child was available yet. In the latter two cases, the global
variable errno
is set appropriately.
ECHILD | No unwaited-for child process as specified does exist. | |
ERESTARTSYS | A WNOHANG() was not set and an unblocked signal or
a |
The warn() function
shall display a formatted error message on the standard
error stream.
The output shall consist of the last component of the program name, a colon
character, and a space character. If fmt is non-NULL, it shall be used as a
format string for the printf()
family of functions, and the formatted message, a
colon character, and a space are written to stderr
.
Finally, the error message
string affiliated with the current value of the global variable
errno
shall be
written to stderr
, followed by a newline character.
The warnx() function shall display a formatted error message on the standard error stream. The last component of the program name, a colon character, and a space shall be output. If fmt is non-NULL, it shall be used as the format string for the printf() family of functions, and the formatted error message, a colon character, and a space shall be output. The output shall be followed by a newline character.
wcpcpy() is the wide-character equivalent of stpcpy(). It copies the wide character string src, including the terminating null wide character code, to the array dest.
The strings may not overlap.
The programmer shall ensure that there is room for at least wcslen()(src)+1 wide characters at dest.
wcpcpy() returns a pointer to the end of the wide-character string dest, that is, a pointer to the terminating null wide character code.
wcpncpy() is the wide-character equivalent of stpncpy(). It copies at most n wide characters from the wide-character string src, including the terminating null wide character code, to the array dest. Exactly n wide characters are written at dest. If the length wcslen()(src) is smaller than n, the remaining wide characters in the array dest are filled with null wide character codes. If the length wcslen()(src) is greater than or equal to n, the string dest will not be terminated with a null wide character code.
The strings may not overlap.
The programmer shall ensure that there is room for at least n wide characters at dest.
wcpncpy() returns a pointer to the wide character one past the last non-null wide character written.
wcscasecmp() is the wide-character equivalent of strcasecmp(). It compares the wide-character string s1 and the wide-character string s2, ignoring case differences (towupper, towlower).
The wcscasecmp() function shall return 0 if the wide-character strings s1 and s2 are equal except for case distinctions. It shall return a positive integer if s1 is greater than s2, ignoring case. It shall return a negative integer if s1 is less than s2, ignoring case.
wcsdup() is the wide-character equivalent of strdup(). It allocates and returns a new wide-character string whose initial contents is a duplicate of the wide-character string s.
Memory for the new wide-character string is obtained with malloc(), and can be freed with free().
wcsdup() returns a pointer to the new wide-character string, or NULL if sufficient memory was not available.
wcsncasecmp() is the wide-character equivalent of strncasecmp(). It compares the wide-character string s1 and the wide-character string s2, but at most n wide characters from each string, ignoring case differences (towupper, towlower).
wcscasecmp() returns 0 if the wide-character strings s1 and s2, truncated to at most length n, are equal except for case distinctions. It returns a positive integer if truncated s1 is greater than truncated s2, ignoring case. It returns a negative integer if truncated s1 is smaller than truncated s2, ignoring case.
wcsnlen() is the wide-character equivalent of strnlen(). It returns the number of wide-characters in the string s, not including the terminating null wide character code, but at most maxlen. In doing this, wcsnlen() looks only at the first maxlen wide-characters at s and never beyond s + maxlen.
wcsnlen() returns wcslen()(s) if that is less than maxlen, or maxlen if there is no null wide character code among the first maxlen wide characters pointed to by s.
wcsnrtombs() is like wcsrtombs(), except that the number of wide characters to be converted, starting at src, is limited to nwc.
If dest is not a NULL pointer, wcsnrtombs() converts at most nwc wide characters from the wide-character string src to a multibyte string starting at dest. At most len bytes are written to dest. The state ps is updated.
The conversion is effectively performed by repeatedly calling:
wcrtomb(dest, *src, ps) |
The conversion can stop for three reasons:
A wide character has been encountered that cannot be represented as a
multibyte sequence (according to the current locale). In this case
src is left pointing to the invalid wide character,
(size_t)(-1) is returned, and errno
is
set to EILSEQ.
nws wide characters have been converted without encountering a null wide character code, or the length limit forces a stop. In this case, src is left pointing to the next wide character to be converted, and the number bytes written to dest is returned.
The wide-character string has been completely converted, including the terminating null wide character code (which has the side effect of bringing back ps to the initial state). In this case, src is set to NULL, and the number of bytes written to dest, excluding the terminating null wide character code, is returned.
If dest is NULL, len is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that no destination length limit exists.
In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to wcsnrtombs() is used instead.
The programmer shall ensure that there is room for at least len bytes at dest.
wcsnrtombs() returns the number of bytes that
make up the converted part of multibyte sequence, not including
the terminating null wide character code. If a wide character was
encountered which could not be converted, (size_t)(-1) is returned,
and the global variable errno
set to
EILSEQ.
The behavior of wcsnrtombs() depends on the
LC_CTYPE
category of the current locale.
Passing NULL as ps is not multi-thread safe.
The wcstoq() function shall convert the initial portion of the wide string nptr to long long int representation. It is identical to wcstoll().
The wcstouq() function shall convert the initial portion of the wide string nptr to unsigned long long int representation. It is identical to wcstoull().
The scanf() family of functions shall behave as described in ISO POSIX (2003), except as noted below.
The
%s,
%S and
%[ conversion specifiers shall accept an
option length modifier
a,
which shall cause a memory buffer to be allocated to hold the string converted.
In such a case, the argument corresponding to the conversion specifier should be
a reference to a pointer value that will receive a pointer to the allocated
buffer. If there is insufficient memory to allocate a buffer, the
function may set
errno
to ENOMEM and a
conversion error results.
Note: This directly conflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as "%aseconds" will have a different meaning on an LSB conforming system.
Table 13-24 defines the library name and shared object name for the libm library
The behavior of the interfaces in this library is specified by the following specifications:
[ISOC99] ISO C (1999) |
[LSB] This Specification |
[SUSv2] SUSv2 |
[SUSv3] ISO POSIX (2003) |
An LSB conforming implementation shall provide the generic functions for Math specified in Table 13-25, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-25. libm - Math Function Interfaces
__finite [ISOC99] | __finitef [ISOC99] | __finitel [ISOC99] | __fpclassify [LSB] |
__fpclassifyf [LSB] | __signbit [ISOC99] | __signbitf [ISOC99] | acos [SUSv3] |
acosf [SUSv3] | acosh [SUSv3] | acoshf [SUSv3] | acoshl [SUSv3] |
acosl [SUSv3] | asin [SUSv3] | asinf [SUSv3] | asinh [SUSv3] |
asinhf [SUSv3] | asinhl [SUSv3] | asinl [SUSv3] | atan [SUSv3] |
atan2 [SUSv3] | atan2f [SUSv3] | atan2l [SUSv3] | atanf [SUSv3] |
atanh [SUSv3] | atanhf [SUSv3] | atanhl [SUSv3] | atanl [SUSv3] |
cabs [SUSv3] | cabsf [SUSv3] | cabsl [SUSv3] | cacos [SUSv3] |
cacosf [SUSv3] | cacosh [SUSv3] | cacoshf [SUSv3] | cacoshl [SUSv3] |
cacosl [SUSv3] | carg [SUSv3] | cargf [SUSv3] | cargl [SUSv3] |
casin [SUSv3] | casinf [SUSv3] | casinh [SUSv3] | casinhf [SUSv3] |
casinhl [SUSv3] | casinl [SUSv3] | catan [SUSv3] | catanf [SUSv3] |
catanh [SUSv3] | catanhf [SUSv3] | catanhl [SUSv3] | catanl [SUSv3] |
cbrt [SUSv3] | cbrtf [SUSv3] | cbrtl [SUSv3] | ccos [SUSv3] |
ccosf [SUSv3] | ccosh [SUSv3] | ccoshf [SUSv3] | ccoshl [SUSv3] |
ccosl [SUSv3] | ceil [SUSv3] | ceilf [SUSv3] | ceill [SUSv3] |
cexp [SUSv3] | cexpf [SUSv3] | cexpl [SUSv3] | cimag [SUSv3] |
cimagf [SUSv3] | cimagl [SUSv3] | clog [SUSv3] | clog10 [ISOC99] |
clog10f [ISOC99] | clog10l [ISOC99] | clogf [SUSv3] | clogl [SUSv3] |
conj [SUSv3] | conjf [SUSv3] | conjl [SUSv3] | copysign [SUSv3] |
copysignf [SUSv3] | copysignl [SUSv3] | cos [SUSv3] | cosf [SUSv3] |
cosh [SUSv3] | coshf [SUSv3] | coshl [SUSv3] | cosl [SUSv3] |
cpow [SUSv3] | cpowf [SUSv3] | cpowl [SUSv3] | cproj [SUSv3] |
cprojf [SUSv3] | cprojl [SUSv3] | creal [SUSv3] | crealf [SUSv3] |
creall [SUSv3] | csin [SUSv3] | csinf [SUSv3] | csinh [SUSv3] |
csinhf [SUSv3] | csinhl [SUSv3] | csinl [SUSv3] | csqrt [SUSv3] |
csqrtf [SUSv3] | csqrtl [SUSv3] | ctan [SUSv3] | ctanf [SUSv3] |
ctanh [SUSv3] | ctanhf [SUSv3] | ctanhl [SUSv3] | ctanl [SUSv3] |
dremf [ISOC99] | dreml [ISOC99] | erf [SUSv3] | erfc [SUSv3] |
erfcf [SUSv3] | erfcl [SUSv3] | erff [SUSv3] | erfl [SUSv3] |
exp [SUSv3] | exp2 [SUSv3] | exp2f [SUSv3] | expf [SUSv3] |
expl [SUSv3] | expm1 [SUSv3] | expm1f [SUSv3] | expm1l [SUSv3] |
fabs [SUSv3] | fabsf [SUSv3] | fabsl [SUSv3] | fdim [SUSv3] |
fdimf [SUSv3] | fdiml [SUSv3] | feclearexcept [SUSv3] | fegetenv [SUSv3] |
fegetexceptflag [SUSv3] | fegetround [SUSv3] | feholdexcept [SUSv3] | feraiseexcept [SUSv3] |
fesetenv [SUSv3] | fesetexceptflag [SUSv3] | fesetround [SUSv3] | fetestexcept [SUSv3] |
feupdateenv [SUSv3] | finite [SUSv2] | finitef [ISOC99] | finitel [ISOC99] |
floor [SUSv3] | floorf [SUSv3] | floorl [SUSv3] | fma [SUSv3] |
fmaf [SUSv3] | fmal [SUSv3] | fmax [SUSv3] | fmaxf [SUSv3] |
fmaxl [SUSv3] | fmin [SUSv3] | fminf [SUSv3] | fminl [SUSv3] |
fmod [SUSv3] | fmodf [SUSv3] | fmodl [SUSv3] | frexp [SUSv3] |
frexpf [SUSv3] | frexpl [SUSv3] | gamma [SUSv2] | gammaf [ISOC99] |
gammal [ISOC99] | hypot [SUSv3] | hypotf [SUSv3] | hypotl [SUSv3] |
ilogb [SUSv3] | ilogbf [SUSv3] | ilogbl [SUSv3] | j0 [SUSv3] |
j0f [ISOC99] | j0l [ISOC99] | j1 [SUSv3] | j1f [ISOC99] |
j1l [ISOC99] | jn [SUSv3] | jnf [ISOC99] | jnl [ISOC99] |
ldexp [SUSv3] | ldexpf [SUSv3] | ldexpl [SUSv3] | lgamma [SUSv3] |
lgamma_r [ISOC99] | lgammaf [SUSv3] | lgammaf_r [ISOC99] | lgammal [SUSv3] |
lgammal_r [ISOC99] | llrint [SUSv3] | llrintf [SUSv3] | llrintl [SUSv3] |
llround [SUSv3] | llroundf [SUSv3] | llroundl [SUSv3] | log [SUSv3] |
log10 [SUSv3] | log10f [SUSv3] | log10l [SUSv3] | log1p [SUSv3] |
log1pf [SUSv3] | log1pl [SUSv3] | log2 [SUSv3] | log2f [SUSv3] |
log2l [SUSv3] | logb [SUSv3] | logbf [SUSv3] | logbl [SUSv3] |
logf [SUSv3] | logl [SUSv3] | lrint [SUSv3] | lrintf [SUSv3] |
lrintl [SUSv3] | lround [SUSv3] | lroundf [SUSv3] | lroundl [SUSv3] |
matherr [ISOC99] | modf [SUSv3] | modff [SUSv3] | modfl [SUSv3] |
nan [SUSv3] | nanf [SUSv3] | nanl [SUSv3] | nearbyint [SUSv3] |
nearbyintf [SUSv3] | nearbyintl [SUSv3] | nextafter [SUSv3] | nextafterf [SUSv3] |
nextafterl [SUSv3] | nexttoward [SUSv3] | nexttowardf [SUSv3] | nexttowardl [SUSv3] |
pow [SUSv3] | pow10 [ISOC99] | pow10f [ISOC99] | pow10l [ISOC99] |
powf [SUSv3] | powl [SUSv3] | remainder [SUSv3] | remainderf [SUSv3] |
remainderl [SUSv3] | remquo [SUSv3] | remquof [SUSv3] | remquol [SUSv3] |
rint [SUSv3] | rintf [SUSv3] | rintl [SUSv3] | round [SUSv3] |
roundf [SUSv3] | roundl [SUSv3] | scalb [SUSv3] | scalbf [ISOC99] |
scalbl [ISOC99] | scalbln [SUSv3] | scalblnf [SUSv3] | scalblnl [SUSv3] |
scalbn [SUSv3] | scalbnf [SUSv3] | scalbnl [SUSv3] | significand [ISOC99] |
significandf [ISOC99] | significandl [ISOC99] | sin [SUSv3] | sincos [ISOC99] |
sincosf [ISOC99] | sincosl [ISOC99] | sinf [SUSv3] | sinh [SUSv3] |
sinhf [SUSv3] | sinhl [SUSv3] | sinl [SUSv3] | sqrt [SUSv3] |
sqrtf [SUSv3] | sqrtl [SUSv3] | tan [SUSv3] | tanf [SUSv3] |
tanh [SUSv3] | tanhf [SUSv3] | tanhl [SUSv3] | tanl [SUSv3] |
tgamma [SUSv3] | tgammaf [SUSv3] | tgammal [SUSv3] | trunc [SUSv3] |
truncf [SUSv3] | truncl [SUSv3] | y0 [SUSv3] | y0f [ISOC99] |
y0l [ISOC99] | y1 [SUSv3] | y1f [ISOC99] | y1l [ISOC99] |
yn [SUSv3] | ynf [ISOC99] | ynl [ISOC99] |
An LSB conforming implementation shall provide the generic data interfaces for Math specified in Table 13-26, with the full mandatory functionality as described in the referenced underlying specification.
This section defines global identifiers and their values that are associated with interfaces contained in libm. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
#define complex _Complex extern double cabs(double complex); extern float cabsf(float complex); extern long double cabsl(long double complex); extern double complex cacos(double complex); extern float complex cacosf(float complex); extern double complex cacosh(double complex); extern float complex cacoshf(float complex); extern long double complex cacoshl(long double complex); extern long double complex cacosl(long double complex); extern double carg(double complex); extern float cargf(float complex); extern long double cargl(long double complex); extern double complex casin(double complex); extern float complex casinf(float complex); extern double complex casinh(double complex); extern float complex casinhf(float complex); extern long double complex casinhl(long double complex); extern long double complex casinl(long double complex); extern double complex catan(double complex); extern float complex catanf(float complex); extern double complex catanh(double complex); extern float complex catanhf(float complex); extern long double complex catanhl(long double complex); extern long double complex catanl(long double complex); extern double complex ccos(double complex); extern float complex ccosf(float complex); extern double complex ccosh(double complex); extern float complex ccoshf(float complex); extern long double complex ccoshl(long double complex); extern long double complex ccosl(long double complex); extern double complex cexp(double complex); extern float complex cexpf(float complex); extern long double complex cexpl(long double complex); extern double cimag(double complex); extern float cimagf(float complex); extern long double cimagl(long double complex); extern double complex clog(double complex); extern float complex clog10f(float complex); extern long double complex clog10l(long double complex); extern float complex clogf(float complex); extern long double complex clogl(long double complex); extern double complex conj(double complex); extern float complex conjf(float complex); extern long double complex conjl(long double complex); extern double complex cpow(double complex, double complex); extern float complex cpowf(float complex, float complex); extern long double complex cpowl(long double complex, long double complex); extern double complex cproj(double complex); extern float complex cprojf(float complex); extern long double complex cprojl(long double complex); extern double creal(double complex); extern float crealf(float complex); extern long double creall(long double complex); extern double complex csin(double complex); extern float complex csinf(float complex); extern double complex csinh(double complex); extern float complex csinhf(float complex); extern long double complex csinhl(long double complex); extern long double complex csinl(long double complex); extern double complex csqrt(double complex); extern float complex csqrtf(float complex); extern long double complex csqrtl(long double complex); extern double complex ctan(double complex); extern float complex ctanf(float complex); extern double complex ctanh(double complex); extern float complex ctanhf(float complex); extern long double complex ctanhl(long double complex); extern long double complex ctanl(long double complex); |
extern int feclearexcept(int); extern int fegetenv(fenv_t *); extern int fegetexceptflag(fexcept_t *, int); extern int fegetround(void); extern int feholdexcept(fenv_t *); extern int feraiseexcept(int); extern int fesetenv(const fenv_t *); extern int fesetexceptflag(const fexcept_t *, int); extern int fesetround(int); extern int fetestexcept(int); extern int feupdateenv(const fenv_t *); |
#define DOMAIN 1 #define SING 2 struct exception { int type; char *name; double arg1; double arg2; double retval; }; #define FP_NAN 0 #define FP_INFINITE 1 #define FP_ZERO 2 #define FP_SUBNORMAL 3 #define FP_NORMAL 4 #define isnormal(x) (fpclassify (x) == FP_NORMAL) #define isfinite(x) \ (sizeof (x) == sizeof (float) ? __finitef (x) : sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) #define isinf(x) \ (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) #define isnan(x) \ (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) #define HUGE_VAL 0x1.0p2047 #define HUGE_VALF 0x1.0p255f #define HUGE_VALL 0x1.0p32767L #define NAN ((float)0x7fc00000UL) #define M_1_PI 0.31830988618379067154 #define M_LOG10E 0.43429448190325182765 #define M_2_PI 0.63661977236758134308 #define M_LN2 0.69314718055994530942 #define M_SQRT1_2 0.70710678118654752440 #define M_PI_4 0.78539816339744830962 #define M_2_SQRTPI 1.12837916709551257390 #define M_SQRT2 1.41421356237309504880 #define M_LOG2E 1.4426950408889634074 #define M_PI_2 1.57079632679489661923 #define M_LN10 2.30258509299404568402 #define M_E 2.7182818284590452354 #define M_PI 3.14159265358979323846 #define INFINITY HUGE_VALF #define MATH_ERRNO 1 #define MATH_ERREXCEPT 2 #define isunordered(u, v) \ (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) #define islessgreater(x, y) \ (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) #define isless(x,y) \ (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) #define islessequal(x, y) \ (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) #define isgreater(x,y) \ (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) #define isgreaterequal(x,y) \ (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) extern int __finite(double); extern int __finitef(float); extern int __finitel(long double); extern int __isinf(double); extern int __isinff(float); extern int __isinfl(long double); extern int __isnan(double); extern int __isnanf(float); extern int __isnanl(long double); extern int __signbit(double); extern int __signbitf(float); extern int __fpclassify(double); extern int __fpclassifyf(float); extern int __fpclassifyl(long double); extern int signgam(void); extern double copysign(double, double); extern int finite(double); extern double frexp(double, int *); extern double ldexp(double, int); extern double modf(double, double *); extern double acos(double); extern double acosh(double); extern double asinh(double); extern double atanh(double); extern double asin(double); extern double atan(double); extern double atan2(double, double); extern double cbrt(double); extern double ceil(double); extern double cos(double); extern double cosh(double); extern double erf(double); extern double erfc(double); extern double exp(double); extern double expm1(double); extern double fabs(double); extern double floor(double); extern double fmod(double, double); extern double gamma(double); extern double hypot(double, double); extern int ilogb(double); extern double j0(double); extern double j1(double); extern double jn(int, double); extern double lgamma(double); extern double log(double); extern double log10(double); extern double log1p(double); extern double logb(double); extern double nextafter(double, double); extern double pow(double, double); extern double remainder(double, double); extern double rint(double); extern double scalb(double, double); extern double sin(double); extern double sinh(double); extern double sqrt(double); extern double tan(double); extern double tanh(double); extern double y0(double); extern double y1(double); extern double yn(int, double); extern float copysignf(float, float); extern long double copysignl(long double, long double); extern int finitef(float); extern int finitel(long double); extern float frexpf(float, int *); extern long double frexpl(long double, int *); extern float ldexpf(float, int); extern long double ldexpl(long double, int); extern float modff(float, float *); extern long double modfl(long double, long double *); extern double scalbln(double, long int); extern float scalblnf(float, long int); extern long double scalblnl(long double, long int); extern double scalbn(double, int); extern float scalbnf(float, int); extern long double scalbnl(long double, int); extern float acosf(float); extern float acoshf(float); extern long double acoshl(long double); extern long double acosl(long double); extern float asinf(float); extern float asinhf(float); extern long double asinhl(long double); extern long double asinl(long double); extern float atan2f(float, float); extern long double atan2l(long double, long double); extern float atanf(float); extern float atanhf(float); extern long double atanhl(long double); extern long double atanl(long double); extern float cbrtf(float); extern long double cbrtl(long double); extern float ceilf(float); extern long double ceill(long double); extern float cosf(float); extern float coshf(float); extern long double coshl(long double); extern long double cosl(long double); extern float dremf(float, float); extern long double dreml(long double, long double); extern float erfcf(float); extern long double erfcl(long double); extern float erff(float); extern long double erfl(long double); extern double exp2(double); extern float exp2f(float); extern long double exp2l(long double); extern float expf(float); extern long double expl(long double); extern float expm1f(float); extern long double expm1l(long double); extern float fabsf(float); extern long double fabsl(long double); extern double fdim(double, double); extern float fdimf(float, float); extern long double fdiml(long double, long double); extern float floorf(float); extern long double floorl(long double); extern double fma(double, double, double); extern float fmaf(float, float, float); extern long double fmal(long double, long double, long double); extern double fmax(double, double); extern float fmaxf(float, float); extern long double fmaxl(long double, long double); extern double fmin(double, double); extern float fminf(float, float); extern long double fminl(long double, long double); extern float fmodf(float, float); extern long double fmodl(long double, long double); extern float gammaf(float); extern long double gammal(long double); extern float hypotf(float, float); extern long double hypotl(long double, long double); extern int ilogbf(float); extern int ilogbl(long double); extern float j0f(float); extern long double j0l(long double); extern float j1f(float); extern long double j1l(long double); extern float jnf(int, float); extern long double jnl(int, long double); extern double lgamma_r(double, int *); extern float lgammaf(float); extern float lgammaf_r(float, int *); extern long double lgammal(long double); extern long double lgammal_r(long double, int *); extern long long int llrint(double); extern long long int llrintf(float); extern long long int llrintl(long double); extern long long int llround(double); extern long long int llroundf(float); extern long long int llroundl(long double); extern float log10f(float); extern long double log10l(long double); extern float log1pf(float); extern long double log1pl(long double); extern double log2(double); extern float log2f(float); extern long double log2l(long double); extern float logbf(float); extern long double logbl(long double); extern float logf(float); extern long double logl(long double); extern long int lrint(double); extern long int lrintf(float); extern long int lrintl(long double); extern long int lround(double); extern long int lroundf(float); extern long int lroundl(long double); extern int matherr(struct exception *); extern double nan(const char *); extern float nanf(const char *); extern long double nanl(const char *); extern double nearbyint(double); extern float nearbyintf(float); extern long double nearbyintl(long double); extern float nextafterf(float, float); extern long double nextafterl(long double, long double); extern double nexttoward(double, long double); extern float nexttowardf(float, long double); extern long double nexttowardl(long double, long double); extern double pow10(double); extern float pow10f(float); extern long double pow10l(long double); extern float powf(float, float); extern long double powl(long double, long double); extern float remainderf(float, float); extern long double remainderl(long double, long double); extern double remquo(double, double, int *); extern float remquof(float, float, int *); extern long double remquol(long double, long double, int *); extern float rintf(float); extern long double rintl(long double); extern double round(double); extern float roundf(float); extern long double roundl(long double); extern float scalbf(float, float); extern long double scalbl(long double, long double); extern double significand(double); extern float significandf(float); extern long double significandl(long double); extern void sincos(double, double *, double *); extern void sincosf(float, float *, float *); extern void sincosl(long double, long double *, long double *); extern float sinf(float); extern float sinhf(float); extern long double sinhl(long double); extern long double sinl(long double); extern float sqrtf(float); extern long double sqrtl(long double); extern float tanf(float); extern float tanhf(float); extern long double tanhl(long double); extern long double tanl(long double); extern double tgamma(double); extern float tgammaf(float); extern long double tgammal(long double); extern double trunc(double); extern float truncf(float); extern long double truncl(long double); extern float y0f(float); extern long double y0l(long double); extern float y1f(float); extern long double y1l(long double); extern float ynf(int, float); extern long double ynl(int, long double); extern int __fpclassifyl(long double); extern int __fpclassifyl(long double); extern int __signbitl(long double); extern int __signbitl(long double); extern int __signbitl(long double); extern long double exp2l(long double); extern long double exp2l(long double); |
The interfaces defined on the following pages are included in libm and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 13.6 shall behave as described in the referenced base document.
__fpclassify() has the same specification as fpclassify() in ISO POSIX (2003), except that the argument type for __fpclassify() is known to be double.
__fpclassify() is not in the source standard; it is only in the binary standard.
__fpclassifyf() has the same specification as fpclassifyf() in ISO POSIX (2003), except that the argument type for __fpclassifyf() is known to be float.
__fpclassifyf() is not in the source standard; it is only in the binary standard.
Table 13-27 defines the library name and shared object name for the libpthread library
The behavior of the interfaces in this library is specified by the following specifications:
[LFS] Large File Support |
[LSB] This Specification |
[SUSv3] ISO POSIX (2003) |
An LSB conforming implementation shall provide the generic functions for Realtime Threads specified in Table 13-28, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-28. libpthread - Realtime Threads Function Interfaces
pthread_attr_getinheritsched [SUSv3] | pthread_attr_getschedpolicy [SUSv3] | pthread_attr_getscope [SUSv3] | pthread_attr_setinheritsched [SUSv3] |
pthread_attr_setschedpolicy [SUSv3] | pthread_attr_setscope [SUSv3] | pthread_getschedparam [SUSv3] | pthread_setschedparam [SUSv3] |
pthread_setschedprio(GLIBC_2.3.4) [SUSv3] |
No external functions are defined for libpthread - Advanced Realtime Threads in this part of the specification. See also the relevant architecture specific supplement.
An LSB conforming implementation shall provide the generic functions for Posix Threads specified in Table 13-29, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-29. libpthread - Posix Threads Function Interfaces
_pthread_cleanup_pop [LSB] | _pthread_cleanup_push [LSB] | pthread_attr_destroy [SUSv3] | pthread_attr_getdetachstate [SUSv3] |
pthread_attr_getguardsize [SUSv3] | pthread_attr_getschedparam [SUSv3] | pthread_attr_getstack [SUSv3] | pthread_attr_getstackaddr [SUSv3] |
pthread_attr_getstacksize [SUSv3] | pthread_attr_init [SUSv3] | pthread_attr_setdetachstate [SUSv3] | pthread_attr_setguardsize [SUSv3] |
pthread_attr_setschedparam [SUSv3] | pthread_attr_setstack [SUSv3] | pthread_attr_setstackaddr [SUSv3] | pthread_attr_setstacksize [SUSv3] |
pthread_cancel [SUSv3] | pthread_cond_broadcast [SUSv3] | pthread_cond_destroy [SUSv3] | pthread_cond_init [SUSv3] |
pthread_cond_signal [SUSv3] | pthread_cond_timedwait [SUSv3] | pthread_cond_wait [SUSv3] | pthread_condattr_destroy [SUSv3] |
pthread_condattr_getpshared [SUSv3] | pthread_condattr_init [SUSv3] | pthread_condattr_setpshared [SUSv3] | pthread_create [SUSv3] |
pthread_detach [SUSv3] | pthread_equal [SUSv3] | pthread_exit [SUSv3] | pthread_getconcurrency [SUSv3] |
pthread_getspecific [SUSv3] | pthread_join [SUSv3] | pthread_key_create [SUSv3] | pthread_key_delete [SUSv3] |
pthread_kill [SUSv3] | pthread_mutex_destroy [SUSv3] | pthread_mutex_init [SUSv3] | pthread_mutex_lock [SUSv3] |
pthread_mutex_trylock [SUSv3] | pthread_mutex_unlock [SUSv3] | pthread_mutexattr_destroy [SUSv3] | pthread_mutexattr_getpshared [SUSv3] |
pthread_mutexattr_gettype [SUSv3] | pthread_mutexattr_init [SUSv3] | pthread_mutexattr_setpshared [SUSv3] | pthread_mutexattr_settype [SUSv3] |
pthread_once [SUSv3] | pthread_rwlock_destroy [SUSv3] | pthread_rwlock_init [SUSv3] | pthread_rwlock_rdlock [SUSv3] |
pthread_rwlock_timedrdlock [SUSv3] | pthread_rwlock_timedwrlock [SUSv3] | pthread_rwlock_tryrdlock [SUSv3] | pthread_rwlock_trywrlock [SUSv3] |
pthread_rwlock_unlock [SUSv3] | pthread_rwlock_wrlock [SUSv3] | pthread_rwlockattr_destroy [SUSv3] | pthread_rwlockattr_getpshared [SUSv3] |
pthread_rwlockattr_init [SUSv3] | pthread_rwlockattr_setpshared [SUSv3] | pthread_self [SUSv3] | pthread_setcancelstate [SUSv3] |
pthread_setcanceltype [SUSv3] | pthread_setconcurrency [SUSv3] | pthread_setspecific [SUSv3] | pthread_sigmask [SUSv3] |
pthread_testcancel [SUSv3] | sem_close [SUSv3] | sem_destroy [SUSv3] | sem_getvalue [SUSv3] |
sem_init [SUSv3] | sem_open [SUSv3] | sem_post [SUSv3] | sem_timedwait [SUSv3] |
sem_trywait [SUSv3] | sem_unlink [SUSv3] | sem_wait [SUSv3] |
An LSB conforming implementation shall provide the generic functions for Thread aware versions of libc interfaces specified in Table 13-30, with the full mandatory functionality as described in the referenced underlying specification.
This section defines global identifiers and their values that are associated with interfaces contained in libpthread. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
#define PTHREAD_SCOPE_SYSTEM 0 #define PTHREAD_MUTEX_DEFAULT 1 #define PTHREAD_MUTEX_NORMAL 1 #define PTHREAD_SCOPE_PROCESS 1 #define PTHREAD_MUTEX_RECURSIVE 2 #define PTHREAD_RWLOCK_DEFAULT_NP 2 #define PTHREAD_MUTEX_ERRORCHECK 3 #define PTHREAD_MUTEX_INITIALIZER \ {0,0,0,PTHREAD_MUTEX_NORMAL,__LOCK_INITIALIZER} #define PTHREAD_RWLOCK_INITIALIZER \ { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP,\ PTHREAD_PROCESS_PRIVATE } #define pthread_cleanup_push(routine,arg) \ {struct _pthread_cleanup_buffer _buffer;\ _pthread_cleanup_push(&_buffer,(routine),(arg)); #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} #define __LOCK_INITIALIZER { 0, 0 } #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} struct _pthread_cleanup_buffer { void (*__routine) (void *); void *__arg; int __canceltype; struct _pthread_cleanup_buffer *__prev; }; typedef unsigned int pthread_key_t; typedef int pthread_once_t; typedef long long int __pthread_cond_align_t; typedef unsigned long int pthread_t; struct _pthread_fastlock { long int __status; int __spinlock; }; typedef struct _pthread_descr_struct *_pthread_descr; typedef struct { int __m_reserved; int __m_count; _pthread_descr __m_owner; int __m_kind; struct _pthread_fastlock __m_lock; } pthread_mutex_t; typedef struct { int __mutexkind; } pthread_mutexattr_t; typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize; } pthread_attr_t; typedef struct { struct _pthread_fastlock __c_lock; _pthread_descr __c_waiting; char __padding[48 - sizeof(struct _pthread_fastlock) - sizeof(_pthread_descr) - sizeof(__pthread_cond_align_t)]; __pthread_cond_align_t __align; } pthread_cond_t; typedef struct { int __dummy; } pthread_condattr_t; typedef struct _pthread_rwlock_t { struct _pthread_fastlock __rw_lock; int __rw_readers; _pthread_descr __rw_writer; _pthread_descr __rw_read_waiting; _pthread_descr __rw_write_waiting; int __rw_kind; int __rw_pshared; } pthread_rwlock_t; typedef struct { int __lockkind; int __pshared; } pthread_rwlockattr_t; #define PTHREAD_CREATE_JOINABLE 0 #define PTHREAD_INHERIT_SCHED 0 #define PTHREAD_ONCE_INIT 0 #define PTHREAD_PROCESS_PRIVATE 0 #define PTHREAD_CREATE_DETACHED 1 #define PTHREAD_EXPLICIT_SCHED 1 #define PTHREAD_PROCESS_SHARED 1 #define PTHREAD_CANCELED ((void*)-1) #define PTHREAD_CANCEL_DEFERRED 0 #define PTHREAD_CANCEL_ENABLE 0 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 #define PTHREAD_CANCEL_DISABLE 1 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, void (*__routine) (void *) , void *); extern int pthread_attr_destroy(pthread_attr_t *); extern int pthread_attr_getdetachstate(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, int *); extern int pthread_attr_getinheritsched(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, int *); extern int pthread_attr_getschedparam(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, struct sched_param { int sched_priority;} *); extern int pthread_attr_getschedpolicy(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, int *); extern int pthread_attr_getscope(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, int *); extern int pthread_attr_init(pthread_attr_t *); extern int pthread_attr_setdetachstate(pthread_attr_t *, int); extern int pthread_attr_setinheritsched(pthread_attr_t *, int); extern int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param { int sched_priority;} *); extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); extern int pthread_attr_setscope(pthread_attr_t *, int); extern int pthread_cancel(typedef unsigned long int pthread_t); extern int pthread_cond_broadcast(pthread_cond_t *); extern int pthread_cond_destroy(pthread_cond_t *); extern int pthread_cond_init(pthread_cond_t *, const typedef struct { int __dummy;} pthread_condattr_t *); extern int pthread_cond_signal(pthread_cond_t *); extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec { time_t tv_sec; long int tv_nsec;} *); extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); extern int pthread_condattr_destroy(pthread_condattr_t *); extern int pthread_condattr_init(pthread_condattr_t *); extern int pthread_create(pthread_t *, const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, void *(*__start_routine) (void *p1) , void *); extern int pthread_detach(typedef unsigned long int pthread_t); extern int pthread_equal(typedef unsigned long int pthread_t, typedef unsigned long int pthread_t); extern void pthread_exit(void *); extern int pthread_getschedparam(typedef unsigned long int pthread_t, int *, struct sched_param { int sched_priority;} *); extern void *pthread_getspecific(typedef unsigned int pthread_key_t); extern int pthread_join(typedef unsigned long int pthread_t, void **); extern int pthread_key_create(pthread_key_t *, void (*destr_func) (void *) ); extern int pthread_key_delete(typedef unsigned int pthread_key_t); extern int pthread_mutex_destroy(pthread_mutex_t *); extern int pthread_mutex_init(pthread_mutex_t *, const typedef struct { int __mutexkind;} pthread_mutexattr_t *); extern int pthread_mutex_lock(pthread_mutex_t *); extern int pthread_mutex_trylock(pthread_mutex_t *); extern int pthread_mutex_unlock(pthread_mutex_t *); extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); extern int pthread_mutexattr_init(pthread_mutexattr_t *); extern int pthread_once(pthread_once_t *, void (*init_routine) (void) ); extern int pthread_rwlock_destroy(pthread_rwlock_t *); extern int pthread_rwlock_init(pthread_rwlock_t *, pthread_rwlockattr_t *); extern int pthread_rwlock_rdlock(pthread_rwlock_t *); extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); extern int pthread_rwlock_unlock(pthread_rwlock_t *); extern int pthread_rwlock_wrlock(pthread_rwlock_t *); extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); extern int pthread_rwlockattr_getpshared(const typedef struct { int __lockkind; int __pshared;} pthread_rwlockattr_t *, int *); extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); extern typedef unsigned long int pthread_t pthread_self(void); extern int pthread_setcancelstate(int, int *); extern int pthread_setcanceltype(int, int *); extern int pthread_setschedparam(typedef unsigned long int pthread_t, int, const struct sched_param { int sched_priority;} *); extern int pthread_setspecific(typedef unsigned int pthread_key_t, const void *); extern void pthread_testcancel(void); extern int pthread_attr_getguardsize(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, size_t *); extern int pthread_attr_setguardsize(pthread_attr_t *, typedef unsigned long int size_t); extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); extern int pthread_attr_getstackaddr(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, void **); extern int pthread_attr_setstacksize(pthread_attr_t *, typedef unsigned long int size_t); extern int pthread_attr_getstacksize(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, size_t *); extern int pthread_mutexattr_gettype(const typedef struct { int __mutexkind;} pthread_mutexattr_t *, int *); extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); extern int pthread_getconcurrency(void); extern int pthread_setconcurrency(int); extern int pthread_attr_getstack(const typedef struct { int __detachstate; int __schedpolicy; struct sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; unsigned long int __stacksize;} pthread_attr_t *, void **, size_t *); extern int pthread_attr_setstack(pthread_attr_t *, void *, typedef unsigned long int size_t); extern int pthread_condattr_getpshared(const typedef struct { int __dummy;} pthread_condattr_t *, int *); extern int pthread_condattr_setpshared(pthread_condattr_t *, int); extern int pthread_mutexattr_getpshared(const typedef struct { int __mutexkind;} pthread_mutexattr_t *, int *); extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *, const struct timespec { time_t tv_sec; long int tv_nsec;} *); extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *, const struct timespec { time_t tv_sec; long int tv_nsec;} *); extern int __register_atfork(void (*prepare) (void) , void (*parent) (void) , void (*child) (void) , void *); extern int pthread_setschedprio(typedef unsigned long int pthread_t, int); |
typedef struct { struct _pthread_fastlock __sem_lock; int __sem_value; _pthread_descr __sem_waiting; } sem_t; #define SEM_FAILED ((sem_t*)0) #define SEM_VALUE_MAX ((int)((~0u)>>1)) extern int sem_close(sem_t *); extern int sem_destroy(sem_t *); extern int sem_getvalue(sem_t *, int *); extern int sem_init(sem_t *, int, unsigned int); extern sem_t *sem_open(const char *, int, ...); extern int sem_post(sem_t *); extern int sem_trywait(sem_t *); extern int sem_unlink(const char *); extern int sem_wait(sem_t *); extern int sem_timedwait(sem_t *, const struct timespec *); |
The interfaces defined on the following pages are included in libpthread and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 13.9 shall behave as described in the referenced base document.
The _pthread_cleanup_pop() function provides an implementation of the pthread_cleanup_pop() macro described in ISO POSIX (2003).
The _pthread_cleanup_pop() function is not in the source standard; it is only in the binary standard.
The _pthread_cleanup_push() function provides an implementation of the pthread_cleanup_push() macro described in ISO POSIX (2003).
The _pthread_cleanup_push() function is not in the source standard; it is only in the binary standard.
Table 13-31 defines the library name and shared object name for the libgcc_s library
No external functions are defined for libgcc_s - Unwind Library in this part of the specification. See also the relevant architecture specific supplement.
This section defines global identifiers and their values that are associated with interfaces contained in libgcc_s. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
struct _Unwind_Context; typedef void *_Unwind_Ptr; typedef unsigned int _Unwind_Word; typedef enum { _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ERROR = 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, _URC_CONTINUE_UNWIND = 8 } _Unwind_Reason_Code; struct _Unwind_Exception { u_int64_t exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; u_int64_t private_1; u_int64_t private_2; }; #define _UA_SEARCH_PHASE 1 #define _UA_END_OF_STACK 16 #define _UA_CLEANUP_PHASE 2 #define _UA_HANDLER_FRAME 4 #define _UA_FORCE_UNWIND 8 extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern void _Unwind_DeleteException(struct _Unwind_Exception *); extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); extern void _Unwind_Resume(struct _Unwind_Exception *); extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern void *_Unwind_FindEnclosingFunction(void *); extern _Unwind_Word _Unwind_GetBSP(struct _Unwind_Context *); |
Table 13-32 defines the library name and shared object name for the libdl library
The behavior of the interfaces in this library is specified by the following specifications:
[LSB] This Specification |
[SUSv3] ISO POSIX (2003) |
An LSB conforming implementation shall provide the generic functions for Dynamic Loader specified in Table 13-33, with the full mandatory functionality as described in the referenced underlying specification.
This section defines global identifiers and their values that are associated with interfaces contained in libdl. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
#define RTLD_NEXT ((void *) -1l) #define RTLD_LOCAL 0 #define RTLD_LAZY 0x00001 #define RTLD_NOW 0x00002 #define RTLD_GLOBAL 0x00100 typedef struct { char *dli_fname; void *dli_fbase; char *dli_sname; void *dli_saddr; } Dl_info; extern int dladdr(const void *, Dl_info *); extern int dlclose(void *); extern char *dlerror(void); extern void *dlopen(char *, int); extern void *dlsym(void *, char *); |
The interfaces defined on the following pages are included in libdl and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 13.14 shall behave as described in the referenced base document.
#include <dlfcn.h> typedef struct { const char |
The dladdr() function shall query the dynamic linker for information about the shared object containing the address addr. The information shall be returned in the user supplied data structure referenced by dlip.
The structure shall contain at least the following members:
dli_fname | The pathname of the shared object containing the address | |
dli_fbase | The base address at which the shared object is mapped into the address space of the calling process. | |
dli_sname | The name of the nearest runtime symbol with value less than or equal to addr. Where possible, the symbol name shall be returned as it would appear in C source code. If no symbol with a suitable value is found,
both this field and | |
dli_saddr | The address of the symbol returned in
|
The behavior of dladdr() is only specified in dynamically linked programs.
On success, dladdr() shall return non-zero, and the structure referenced by dlip shall be filled in as described. Otherwise, dladdr() shall return zero, and the cause of the error can be fetched with dlerror().
The dlopen() function shall behave as specified in ISO POSIX (2003), but with additional behaviors listed below.
If the file argument does not contain a slash character, then the system shall look for a library of that name in at least the following directories, and use the first one which is found:
The directories specified by the
DT_RPATH
dynamic entry.
The directories specified in the
LD_LIBRARY_PATH
environment variable (which is a colon separated list of pathnames).
This step shall be skipped for setuid
and setgid executables.
A set of directories sufficient to contain the libraries specified in this standard.
Note: Traditionally, /lib and /usr/lib. This case would also cover cases in which the system used the mechanism of /etc/ld.so.conf and /etc/ld.so.cache to provide access.
Example: An application which is not linked against libm may choose to dlopen libm.
dlsym() is as specified in the ISO POSIX (2003), but with differences as listed below.
The value RTLD_NEXT, which is reserved for future use shall be available, with the behavior as described in ISO POSIX (2003).
Table 13-34 defines the library name and shared object name for the librt library
The behavior of the interfaces in this library is specified by the following specifications:
[SUSv3] ISO POSIX (2003) |
An LSB conforming implementation shall provide the generic functions for Shared Memory Objects specified in Table 13-35, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Clock specified in Table 13-36, with the full mandatory functionality as described in the referenced underlying specification.
An LSB conforming implementation shall provide the generic functions for Timers specified in Table 13-37, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-38 defines the library name and shared object name for the libcrypt library
The behavior of the interfaces in this library is specified by the following specifications:
[SUSv3] ISO POSIX (2003) |
An LSB conforming implementation shall provide the generic functions for Encryption specified in Table 13-39, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-40 defines the library name and shared object name for the libpam library
The Pluggable Authentication Module (PAM) interfaces allow applications to request authentication via a system administrator defined mechanism, known as a service.
A single service name, other
, shall always be present.
The behavior of this service shall be determined by the system administrator.
Additional service names may also exist.
Note: Future versions of this specification might define additional service names.
The behavior of the interfaces in this library is specified by the following specifications:
[LSB] This Specification |
An LSB conforming implementation shall provide the generic functions for Pluggable Authentication API specified in Table 13-41, with the full mandatory functionality as described in the referenced underlying specification.
Table 13-41. libpam - Pluggable Authentication API Function Interfaces
pam_acct_mgmt [LSB] | pam_authenticate [LSB] | pam_chauthtok [LSB] | pam_close_session [LSB] |
pam_end [LSB] | pam_fail_delay [LSB] | pam_get_item [LSB] | pam_getenvlist [LSB] |
pam_open_session [LSB] | pam_set_item [LSB] | pam_setcred [LSB] | pam_start [LSB] |
pam_strerror [LSB] |
This section defines global identifiers and their values that are associated with interfaces contained in libpam. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
typedef struct pam_handle pam_handle_t; struct pam_message { int msg_style; const char *msg; }; struct pam_response { char *resp; int resp_retcode; }; struct pam_conv { int (*conv) (int num_msg, const struct pam_message * *msg, struct pam_response * *resp, void *appdata_ptr); void *appdata_ptr; }; #define PAM_PROMPT_ECHO_OFF 1 #define PAM_PROMPT_ECHO_ON 2 #define PAM_ERROR_MSG 3 #define PAM_TEXT_INFO 4 #define PAM_SERVICE 1 #define PAM_USER 2 #define PAM_TTY 3 #define PAM_RHOST 4 #define PAM_CONV 5 #define PAM_RUSER 8 #define PAM_USER_PROMPT 9 #define PAM_SUCCESS 0 #define PAM_OPEN_ERR 1 #define PAM_USER_UNKNOWN 10 #define PAM_MAXTRIES 11 #define PAM_NEW_AUTHTOK_REQD 12 #define PAM_ACCT_EXPIRED 13 #define PAM_SESSION_ERR 14 #define PAM_CRED_UNAVAIL 15 #define PAM_CRED_EXPIRED 16 #define PAM_CRED_ERR 17 #define PAM_CONV_ERR 19 #define PAM_SYMBOL_ERR 2 #define PAM_AUTHTOK_ERR 20 #define PAM_AUTHTOK_RECOVER_ERR 21 #define PAM_AUTHTOK_LOCK_BUSY 22 #define PAM_AUTHTOK_DISABLE_AGING 23 #define PAM_TRY_AGAIN 24 #define PAM_ABORT 26 #define PAM_AUTHTOK_EXPIRED 27 #define PAM_BAD_ITEM 29 #define PAM_SERVICE_ERR 3 #define PAM_SYSTEM_ERR 4 #define PAM_BUF_ERR 5 #define PAM_PERM_DENIED 6 #define PAM_AUTH_ERR 7 #define PAM_CRED_INSUFFICIENT 8 #define PAM_AUTHINFO_UNAVAIL 9 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U #define PAM_ESTABLISH_CRED 0x0002U #define PAM_DELETE_CRED 0x0004U #define PAM_REINITIALIZE_CRED 0x0008U #define PAM_REFRESH_CRED 0x0010U #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U #define PAM_SILENT 0x8000U extern int pam_set_item(pam_handle_t *, int, const void *); extern int pam_get_item(const pam_handle_t *, int, const void **); extern const char *pam_strerror(pam_handle_t *, int); extern char **pam_getenvlist(pam_handle_t *); extern int pam_fail_delay(pam_handle_t *, unsigned int); extern int pam_start(const char *, const char *, const struct pam_conv *, pam_handle_t * *); extern int pam_end(pam_handle_t *, int); extern int pam_authenticate(pam_handle_t *, int); extern int pam_setcred(pam_handle_t *, int); extern int pam_acct_mgmt(pam_handle_t *, int); extern int pam_open_session(pam_handle_t *, int); extern int pam_close_session(pam_handle_t *, int); extern int pam_chauthtok(pam_handle_t *, int); |
The interfaces defined on the following pages are included in libpam and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 13.19 shall behave as described in the referenced base document.
pam_acct_mgmt() establishes the account's usability and the user's accessibility to the system. It is typically called after the user has been authenticated.
flags may be specified as any valid flag (namely,
one of those applicable to the flags argument of
pam_authenticate()). Additionally, the value of
flags may be logically or'd
with PAM_SILENT
.
PAM_SUCCESS | Success. | |
PAM_NEW_AUTHTOK_REQD | User is valid, but user's authentication token has expired. The correct response to this return-value is to require that the user satisfy the pam_chauthtok() function before obtaining service. It may not be possible for an application to do this. In such a case, the user should be denied access until the account password is updated. | |
PAM_ACCT_EXPIRED | User is no longer permitted access to the system. | |
PAM_AUTH_ERR | Authentication error. | |
PAM_PERM_DENIED | User is not permitted to gain access at this time. | |
PAM_USER_UNKNOWN | User is not known to a module's account management component. |
Note: Errors may be translated to text with pam_strerror().
pam_authenticate() serves as an interface to the authentication mechanisms of the loaded modules.
flags is an optional parameter that may be specified by the following value:
Instruct the authentication modules to return PAM_AUTH_ERR
if the user does not have a registered authorization token.
Additionally, the value of flags may be
logically or'd with PAM_SILENT
.
The process may need to be privileged in order to successfully call this function.
Success.
User was not authenticated or process did not have sufficient privileges to perform authentication.
Application does not have sufficient credentials to authenticate the user.
Modules were not able to access the authentication information. This might be due to a network or hardware failure, etc.
Supplied username is not known to the authentication service.
One or more authentication modules has reached its limit of tries authenticating the user. Do not try again.
One or more authentication modules failed to load.
Note: Errors may be translated to text with pam_strerror().
pam_chauthtok() is used to change the authentication token for a given user as indicated by the state associated with the handle pamh.
flags is an optional parameter that may be specified by the following value:
User's authentication token should only be changed if it has expired.
Additionally, the value of flags may be
logically or'd with PAM_SILENT
.
Success.
A module was unable to obtain the new authentication token.
A module was unable to obtain the old authentication token.
One or more modules were unable to change the authentication token since it is currently locked.
Authentication token aging has been disabled for at least one of the modules.
Permission denied.
Not all modules were in a position to update the authentication token(s). In such a case, none of the user's authentication tokens are updated.
User is not known to the authentication token changing service.
Note: Errors may be translated to text with pam_strerror().
pam_close_session() is used to indicate that an authenticated session has ended. It is used to inform the module that the user is exiting a session. It should be possible for the PAM library to open a session and close the same session from different applications.
flags may have the value
PAM_SILENT
to indicate that no output
should be generated as a result of this function call.
PAM_SUCCESS | Success. | |
PAM_SESSION_ERR | One of the required loaded modules was unable to close a session for the user. |
Note: Errors may be translated to text with pam_strerror().
pam_end() terminates use of the PAM library. On success, the contents of *pamh are no longer valid, and all memory associated with it is invalid.
Normally, pam_status is passed the value
PAM_SUCCESS
, but in the event of an
unsuccessful service application, the appropriate PAM error
return value should be used.
pam_fail_delay() specifies the minimum delay for the PAM library to use when an authentication error occurs. The actual delay can vary by as much at 25%. If this function is called multiple times, the longest time specified by any of the call will be used.
The delay is invoked if an authentication error occurs during the pam_authenticate() or pam_chauthtok() function calls.
Independent of the success of pam_authenticate() or pam_chauthtok(), the delay time is reset to its default value of 0 when the PAM library returns control to the application from these two functions.
pam_get_item() obtains the value of the indicated item_type. The possible values of item_type are the same as listed for pam_set_item().
On success, item contains a pointer to the value of the corresponding item. Note that this is a pointer to the actual data and should not be free()'d or over-written.
PAM_SUCCESS | Success. | |
PAM_PERM_DENIED | Application passed a | |
PAM_BAD_ITEM | Application attempted to get an undefined item. |
Note: Errors may be translated to text with pam_strerror().
pam_getenvlist() returns a pointer to the complete
PAM environment. This pointer points to an array of pointers to
NUL
-terminated strings and must be terminated by a
NULL
pointer. Each string has the form "name=value".
The PAM library module allocates memory for the returned value and the associated strings. The calling application is responsible for freeing this memory.
pam_getenvlist() returns an array of string pointers
containing the PAM environment. On error, NULL
is returned.
The pam_open_session() function is used to indicate that an authenticated session has begun, after the user has been identified (see pam_authenticate()) and, if necessary, granted credentials (see pam_setcred()). It is used to inform the module that the user is currently in a session. It should be possible for the PAM library to open a session and close the same session from different applications.
flags may have the value
PAM_SILENT
to indicate that no output be
generated as a result of this function call.
PAM_SUCCESS | Success. | |
PAM_SESSION_ERR | One of the loaded modules was unable to open a session for the user. |
Note: Errors may be translated to text with pam_strerror().
pam_set_item() (re)sets the value of one of the following item_types:
PAM_SERVICE | service name | |
PAM_USER | user name | |
PAM_TTY | terminal name The value for a device file should include the /dev/
prefix. The value for graphical, X-based, applications should be the
| |
PAM_RHOST | remote host name | |
PAM_CONV | conversation structure | |
PAM_RUSER | remote user name | |
PAM_USER_PROMPT | string to be used when prompting for a user's name The default value for this string is Please enter username: . |
For all item_types other than
PAM_CONV
, item is a pointer
to a NULL
-terminated character string. In the case
of PAM_CONV
, item points to
an initialized pam_conv structure.
PAM_SUCCESS | Success. | |
PAM_PERM_DENIED | An attempt was made to replace the conversation structure with a
| |
PAM_BUF_ERR | Function ran out of memory making a copy of the item. | |
PAM_BAD_ITEM | Application attempted to set an undefined item. |
Note: Errors may be translated to text with pam_strerror().
pam_setcred() sets the module-specific credentials of the user. It is usually called after the user has been authenticated, after the account management function has been called and after a session has been opened for the user.
flags maybe specified from among the following values:
set credentials for the authentication service
delete credentials associated with the authentication service
reinitialize the user credentials
extend lifetime of the user credentials
Additionally, the value of flags may be
logically or'd with PAM_SILENT
.
PAM_SUCCESS | Success. | |
PAM_CRED_UNAVAIL | Module cannot retrieve the user's credentials. | |
PAM_CRED_EXPIRED | User's credentials have expired. | |
PAM_USER_UNKNOWN | User is not known to an authentication module. | |
PAM_CRED_ERR | Module was unable to set the credentials of the user. |
Note: Errors may be translated to text with pam_strerror().
pam_start() is used to initialize the PAM library. It must be called prior to any other usage of the PAM library. On success, *pamh becomes a handle that provides continuity for successive calls to the PAM library. pam_start() expects arguments as follows: the service_name of the program, the username of the individual to be authenticated, a pointer to an application-supplied pam_conv structure, and a pointer to a pam_handle_t pointer.
An application must provide the conversation function used for direct communication between a loaded module and the application. The application also typically provides a means for the module to prompt the user for a password, etc.
The structure, pam_conv, is defined to be,
struct pam_conv { int (*conv) (int num_msg, const struct pam_message * *msg, struct pam_response * *resp, void *appdata_ptr); void *appdata_ptr; }; |
When a module calls the referenced conv() function, appdata_ptr is set to the second element of this structure.
The other arguments of a call to conv() concern the information exchanged by module and application. num_msg holds the length of the array of pointers passed via msg. On success, the pointer resp points to an array of num_msg pam_response structures, holding the application-supplied text. Note that resp is a struct pam_response array and not an array of pointers.
On success, this function returns a description of the indicated error.
The application
should not free or modify this string.
Otherwise, a string
indicating that the error is unknown shall be returned.
It is unspecified whether or not the string returned is translated according to
the setting of LC_MESSAGES
.
An LSB-conforming implementation shall also support the following utility libraries which are built on top of the interfaces provided by the base libraries. These libraries implement common functionality, and hide additional system dependent information such as file formats and device names.
libz
libcurses
libutil
The structure of the definitions for these libraries follows the same model as used for Base Libraries.
Table 14-1 defines the library name and shared object name for the libz library
The behavior of the interfaces in this library is specified by the following specifications:
[LSB] This Specification |
An LSB conforming implementation shall provide the generic functions for Compression Library specified in Table 14-2, with the full mandatory functionality as described in the referenced underlying specification.
Table 14-2. libz - Compression Library Function Interfaces
adler32 [LSB] | compress [LSB] | compress2 [LSB] | compressBound [LSB] |
crc32 [LSB] | deflate [LSB] | deflateBound [LSB] | deflateCopy [LSB] |
deflateEnd [LSB] | deflateInit2_ [LSB] | deflateInit_ [LSB] | deflateParams [LSB] |
deflateReset [LSB] | deflateSetDictionary [LSB] | get_crc_table [LSB] | gzclose [LSB] |
gzdopen [LSB] | gzeof [LSB] | gzerror [LSB] | gzflush [LSB] |
gzgetc [LSB] | gzgets [LSB] | gzopen [LSB] | gzprintf [LSB] |
gzputc [LSB] | gzputs [LSB] | gzread [LSB] | gzrewind [LSB] |
gzseek [LSB] | gzsetparams [LSB] | gztell [LSB] | gzwrite [LSB] |
inflate [LSB] | inflateEnd [LSB] | inflateInit2_ [LSB] | inflateInit_ [LSB] |
inflateReset [LSB] | inflateSetDictionary [LSB] | inflateSync [LSB] | inflateSyncPoint [LSB] |
uncompress [LSB] | zError [LSB] | zlibVersion [LSB] |
This section defines global identifiers and their values that are associated with interfaces contained in libz. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.
This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.
This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.
In addition to the values below, the zlib.h
header shall define the
ZLIB_VERSION
macro. This macro may be used
to check that the version of the library at run time matches that
at compile time.
See also the zlibVersion() function, which returns the library version at run time. The first character of the version at compile time should always match the first character at run time.
#define Z_NULL 0 #define MAX_WBITS 15 #define MAX_MEM_LEVEL 9 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) #define deflateInit(strm,level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit2(strm,windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) typedef char charf; typedef int intf; typedef void *voidpf; typedef unsigned int uInt; typedef unsigned long int uLong; typedef uLong uLongf; typedef void *voidp; typedef unsigned char Byte; typedef off_t z_off_t; typedef void *const voidpc; typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); typedef void (*free_func) (voidpf opaque, voidpf address); struct internal_state { int dummy; }; typedef Byte Bytef; typedef uInt uIntf; typedef struct z_stream_s { Bytef *next_in; uInt avail_in; uLong total_in; Bytef *next_out; uInt avail_out; uLong total_out; char *msg; struct internal_state *state; alloc_func zalloc; free_func zfree; voidpf opaque; int data_type; uLong adler; uLong reserved; } z_stream; typedef z_stream *z_streamp; typedef voidp gzFile; #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_DEFAULT_COMPRESSION (-1) #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_STRATEGY 0 #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_BINARY 0 #define Z_ASCII 1 #define Z_UNKNOWN 2 #define Z_DEFLATED 8 extern int gzread(gzFile, voidp, unsigned int); extern int gzclose(gzFile); extern gzFile gzopen(const char *, const char *); extern gzFile gzdopen(int, const char *); extern int gzwrite(gzFile, voidpc, unsigned int); extern int gzflush(gzFile, int); extern const char *gzerror(gzFile, int *); extern uLong adler32(uLong, const Bytef *, uInt); extern int compress(Bytef *, uLongf *, const Bytef *, uLong); extern int compress2(Bytef *, uLongf *, const Bytef *, uLong, int); extern uLong crc32(uLong, const Bytef *, uInt); extern int deflate(z_streamp, int); extern int deflateCopy(z_streamp, z_streamp); extern int deflateEnd(z_streamp); extern int deflateInit2_(z_streamp, int, int, int, int, int, const char *, int); extern int deflateInit_(z_streamp, int, const char *, int); extern int deflateParams(z_streamp, int, int); extern int deflateReset(z_streamp); extern int deflateSetDictionary(z_streamp, const Bytef *, uInt); extern const uLongf *get_crc_table(void); extern int gzeof(gzFile); extern int gzgetc(gzFile); extern char *gzgets(gzFile, char *, int); extern int gzprintf(gzFile, const char *, ...); extern int gzputc(gzFile, int); extern int gzputs(gzFile, const char *); extern int gzrewind(gzFile); extern z_off_t gzseek(gzFile, z_off_t, int); extern int gzsetparams(gzFile, int, int); extern z_off_t gztell(gzFile); extern int inflate(z_streamp, int); extern int inflateEnd(z_streamp); extern int inflateInit2_(z_streamp, int, const char *, int); extern int inflateInit_(z_streamp, const char *, int); extern int inflateReset(z_streamp); extern int inflateSetDictionary(z_streamp, const Bytef *, uInt); extern int inflateSync(z_streamp); extern int inflateSyncPoint(z_streamp); extern int uncompress(Bytef *, uLongf *, const Bytef *, uLong); extern const char *zError(int); extern const char *zlibVersion(void); extern uLong deflateBound(z_streamp, uLong); extern uLong compressBound(uLong); |
The interfaces defined on the following pages are included in libz and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard.
Other interfaces listed in Section 14.2 shall behave as described in the referenced base document.
The adler32() function shall compute a running Adler-32 checksum (as described in RFC 1950: ZLIB Compressed Data Format Specication). On entry, adler is the previous value for the checksum, and buf shall point to an array of len bytes of data to be added to this checksum. The adler32() function shall return the new checksum.
If buf is NULL
(or
Z_NULL
), adler32()
shall return the initial checksum.
The following code fragment demonstrates typical usage of the adler32() function:
uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); |
The compress() function shall attempt to compress sourceLen bytes of data in the buffer source, placing the result in the buffer dest.
On entry, destLen should point to a value describing the size of the dest buffer. The application should ensure that this value be at least (sourceLen × 1.001) + 12. On successful exit, the variable referenced by destLen shall be updated to hold the length of compressed data in dest.
The compress() function is equivalent to
compress2() with a level of
Z_DEFAULT_LEVEL
.
On success, compress() shall return Z_OK. Otherwise, compress() shall return a value to indicate the error.
On error, compress() shall return a value as described below:
Z_BUF_ERROR | The buffer dest was not large enough to hold the compressed data. | |
Z_MEM_ERROR | Insufficient memory. |
The compress2() function shall attempt to compress
sourceLen bytes of data in the buffer
source, placing the result in the buffer
dest, at the level described by
level.
The level supplied shall be a value between
0
and 9
, or the value
Z_DEFAULT_COMPRESSION
. A level
of 1
requests the highest speed, while a level
of 9
requests the highest compression.
A level of 0
indicates that no
compression should be used, and the output shall be the same as the input.
On entry, destLen should point to a value describing the size of the dest buffer. The application should ensure that this value be at least (sourceLen × 1.001) + 12. On successful exit, the variable referenced by destLen shall be updated to hold the length of compressed data in dest.
The compress() function is equivalent to
compress2() with a level of
Z_DEFAULT_LEVEL
.
On success, compress2() shall return Z_OK. Otherwise, compress2() shall return a value to indicate the error.
On error, compress2() shall return a value as described below:
Z_BUF_ERROR | The buffer dest was not large enough to hold the compressed data. | |
Z_MEM_ERROR | Insufficient memory. | |
Z_STREAM_ERROR | The level was not |
The compressBound() function shall estimate the size of buffer required to compress sourceLen bytes of data using the compress() or compress2() functions. If successful, the value returned shall be an upper bound for the size of buffer required to compress sourceLen bytes of data, using the parameters stored in stream, in a single call to compress() or compress2().
The compressBound() shall return a value representing the upper bound of an array to allocate to hold the compressed data in a single call to compress() or compress2(). This function may return a conservative value that may be larger than sourceLen.
The crc32() function shall compute a running Cyclic Redundancy Check checksum, as defined in ITU-T V.42. On entry, crc is the previous value for the checksum, and buf shall point to an array of len bytes of data to be added to this checksum. The crc32() function shall return the new checksum.
If buf is NULL
(or
Z_NULL
), crc32()
shall return the initial checksum.
The following code fragment demonstrates typical usage of the crc32() function:
uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); |
The deflate() function shall attempt to compress data until either the input buffer is empty or the output buffer is full. The stream references a z_stream structure. Before the first call to deflate(), this structure should have been initialized by a call to deflateInit2_().
Note: deflateInit2_() is only in the binary standard; source level applications should initialize stream via a call to deflateInit() or deflateInit2().
next_in | should point to the data to be compressed. | |
avail_in | should contain the number of bytes of data in the
buffer referenced by | |
next_out | should point to a buffer where compressed data may be placed. | |
avail_out | should contain the size in bytes of the
buffer referenced by |
The deflate() function shall perform one or both of the following actions:
Compress input data from next_in
and update next_in
,
avail_in
and
total_in
to reflect the data that has been
compressed.
Fill the output buffer referenced by next_out
,
and update next_out
,
avail_out
and
total_out
to reflect the compressed data that
has been placed there. If flush is not
Z_NO_FLUSH
, and
avail_out
indicates that there is still space in
output buffer, this action shall always occur (see below for further details).
The deflate() function shall return when either
avail_in
reaches zero (indicating that all the input
data has been compressed), or avail_out
reaches
zero (indicating that the output buffer is full).
On success, the deflate() function shall set the
adler
field of the stream
to the adler32() checksum of all the input data compressed
so far (represented by total_in
).
If the deflate() function shall attempt to determine
the type of input data, and set field data_type
in stream to Z_ASCII
if the
majority of the data bytes fall within the ASCII (ISO 646) printable
character range. Otherwise, it shall set data_type
to Z_BINARY
.
This data type is informational only, and does not affect the compression
algorithm.
Note: Future versions of the LSB may remove this requirement, since it is based on an outdated character set that does not support Internationalization, and does not affect the algorithm. It is included for information only at this release. Applications should not depend on this field.
The parameter flush determines when compressed bits
are added to the output buffer in next_out
.
If flush is Z_NO_FLUSH
,
deflate()
may return with some data pending output, and not yet added to the
output buffer.
If flush is Z_SYNC_FLUSH
,
deflate() shall flush all pending output to
next_out
and align the output to a byte
boundary. A synchronization point is generated in the output.
If flush is Z_FULL_FLUSH
,
all output shall be flushed, as for Z_SYNC_FLUSH
,
and the compression state shall be reset.
A synchronization point is generated in the output.
Rationale:
Z_SYNC_FLUSH
is intended to ensure that the compressed data contains all the data compressed so far, and allows a decompressor to reconstruct all of the input data.Z_FULL_FLUSH
allows decompression to restart from this point if the previous compressed data has been lost or damaged. Flushing is likely to degrade the performance of the compression system, and should only be used where necessary.
If flush is set to Z_FINISH
,
all pending input shall be processed and deflate()
shall return with Z_STREAM_END if there is
sufficient space in the output buffer at next_out
,
as indicated by avail_out
. If
deflate() is called with flush
set to Z_FINISH
and there is insufficient space to store
the compressed data, and no other error has occurred during compression,
deflate() shall return Z_OK,
and the application should call deflate() again with
flush unchanged, and having updated next_out
and avail_out
.
If all the compression is to be done in a single step,
deflate()
may be called with flush set to
Z_FINISH
immediately after the stream
has been initialized if avail_out
is set to at least the value returned by deflateBound().
On success, deflate() shall return
Z_OK, unless flush was set
to Z_FINISH
and there was sufficient space in the output buffer
to compress all of the input data. In this case, deflate()
shall return Z_STREAM_END.
On error, deflate() shall return a value to indicate
the error.
Note: If deflate() returns Z_OK and has set
avail_out
to zero, the function should be called again with the same value for flush, and with updatednext_out
andavail_out
until deflate() returns with Z_OK (or Z_STREAM_END if flush is set toZ_FINISH
) and a non-zeroavail_out
.
On error, deflate() shall return a value as described
below, and set the msg
field of
stream to point to a string describing the error:
Z_BUF_ERROR | No progress is possible; either | |
Z_MEM_ERROR | Insufficient memory. | |
Z_STREAM_ERROR | The state (as represented in stream) is inconsistent, or
stream was |
The deflateBound() function shall estimate the size
of buffer required to compress sourceLen
bytes of data. If successful, the value returned shall be an upper
bound for the size of buffer required to compress
sourceLen bytes of data, using the
parameters stored in stream,
in a single
call to deflate() with flush set to
Z_FINISH
.
On entry, stream should have been initialized via a call to deflateInit_() or deflateInit2_().
The deflateBound() shall return a value
representing the upper bound of an array to allocate to hold
the compressed data in a single call to deflate().
If the stream is not correctly initialized,
or is NULL
, then deflateBound()
may return a conservative value that may be larger than
sourceLen.
The deflateCopy() function shall copy the compression state information in source to the uninitialized z_stream structure referenced by dest.
On successful return, dest will be an exact copy
of the stream referenced by source. The input and
output buffer pointers in next_in
and
next_out
will reference the same data.
On success, deflateCopy() shall return Z_OK. Otherwise it shall return a value less than zero to indicate the error.
On error, deflateCopy() shall return a value as described below:
Z_STREAM_ERROR | The state in source is inconsistent, or
either source or
dest was | |
Z_MEM_ERROR | Insufficient memory available. |
This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd(). Note that deflateCopy() duplicates the internal compression state which can be quite large, so this strategy may be slow and can consume lots of memory.
The deflateEnd() function shall free all allocated state information referenced by stream. All pending output is discarded, and unprocessed input is ignored.
On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if there was pending output discarded or input unprocessed. Otherwise it shall return Z_STREAM_ERROR to indicate the error.
On error, deflateEnd() shall return Z_STREAM_ERROR. The following conditions shall be treated as an error:
The state in stream is inconsistent or inappropriate.
stream
is NULL
.
The deflateInit2_() function shall initialize the compression system. On entry, strm shall refer to a user supplied z_stream object (a z_stream_s structure). The following fields shall be set on entry:
zalloc | a pointer to an alloc_func function, used to allocate state information.
If this is | |
zfree | a pointer to a free_func function, used to free memory allocated by the
| |
opaque | If |
If the version requested is not compatible with the version
implemented, or if the size of the z_stream_s structure
provided in stream_size does not match the size in the library
implementation, deflateInit2_() shall fail, and return
Z_VERSION_ERROR
.
The level supplied shall be a value between
0
and 9
, or the value
Z_DEFAULT_COMPRESSION
. A level
of 1
requests the highest speed, while a level
of 9
requests the highest compression.
A level of 0
indicates that no
compression should be used, and the output shall be the same as the input.
The method selects the compression algorithm to use. LSB
conforming implementation shall support the Z_DEFLATED
method,
and may support other implementation defined methods.
The windowBits parameter shall be a base 2 logarithm of the window
size to use, and shall be a value between 8
and 15
.
A smaller value will use less memory, but will result in a poorer compression ratio,
while a higher value will
give better compression but utilize more memory.
The memLevel parameter specifies how much memory to use for the
internal state. The value of memLevel shall be between
1
and MAX_MEM_LEVEL
. Smaller values
use less memory but are slower, while higher values use more memory to gain compression speed.
The strategy parameter selects the compression strategy to use:
Z_DEFAULT_STRATEGY | use the system default compression strategy. | |
Z_FILTERED | use a compression strategy tuned for data consisting largely of small values with a
fairly random distribution. | |
Z_HUFFMAN_ONLY | force Huffman encoding only, with no string match. |
The deflateInit2_() function is not in the source standard; it is only in the binary standard. Source applications should use the deflateInit2() macro.
On success, the deflateInit2_() function shall return
Z_OK
.
Otherwise, deflateInit2_() shall return
a value as described below to indicate the error.
On error, deflateInit2_() shall return one of the following error indicators:
Z_STREAM_ERROR | Invalid parameter. | |
Z_MEM_ERROR | Insufficient memory available. | |
Z_VERSION_ERROR | The version requested is not compatible with the library version, or the z_stream size differs from that used by the library. |
In addition, the msg
field of the strm
may be set to an error message.
The deflateInit_() function shall initialize the compression system. On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure). The following fields shall be set on entry:
zalloc | a pointer to an alloc_func function, used to allocate state information.
If this is | |
zfree | a pointer to a free_func function, used to free memory
allocated by the
| |
opaque | If |
If the version requested is not compatible with
the version implemented, or if the size of the
z_stream_s structure
provided in stream_size does not match the size
in the library
implementation, deflateInit_() shall fail, and return
Z_VERSION_ERROR
.
The level supplied shall be a value between
0
and 9
, or the value
Z_DEFAULT_COMPRESSION
. A level
of 1
requests the highest speed, while a
level
of 9
requests the highest compression.
A level of 0
indicates that no
compression should be used, and the output shall be the same as the input.
The deflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the deflateInit() macro.
The deflateInit_() function is equivalent to
deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, version, stream_size); |
On success, the deflateInit_() function shall return
Z_OK
.
Otherwise, deflateInit_() shall return
a value as described below to indicate the error.
On error, deflateInit_() shall return one of the following error indicators:
Z_STREAM_ERROR | Invalid parameter. | |
Z_MEM_ERROR | Insufficient memory available. | |
Z_VERSION_ERROR | The version requested is not compatible with the library version, or the z_stream size differs from that used by the library. |
In addition, the msg
field of the
stream
may be set to an error message.
The deflateParams() function shall dynamically alter the compression parameters for the compression stream object stream. On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure), already initialized via a call to deflateInit_() or deflateInit2_().
The level supplied shall be a value between
0
and 9
, or the value
Z_DEFAULT_COMPRESSION
. A level
of 1
requests the highest speed, while a level
of 9
requests the highest compression.
A level of 0
indicates that no
compression should be used, and the output shall be the same as the input.
If the compression level is altered by deflateParams(),
and some data has already been compressed with this stream
(i.e. total_in
is not zero),
and the new level requires a different
underlying compression method, then stream
shall be flushed by a call to deflate().
The strategy parameter selects the compression strategy to use:
Z_DEFAULT_STRATEGY | use the system default compression strategy. | |
Z_FILTERED | use a compression strategy tuned for data consisting largely of small values with a
fairly random distribution. | |
Z_HUFFMAN_ONLY | force Huffman encoding only, with no string match. |
On success, the deflateParams() function shall return
Z_OK
.
Otherwise, deflateParams() shall return
a value as described below to indicate the error.
On error, deflateParams() shall return one of the following error indicators:
Z_STREAM_ERROR | Invalid parameter. | |
Z_MEM_ERROR | Insufficient memory available. | |
Z_BUF_ERROR | Insufficient space in stream to flush the current output. |
In addition, the msg
field of the strm
may be set to an error message.
Applications should ensure that the stream is flushed,
e.g. by a call to deflate(stream, Z_SYNC_FLUSH)
before calling deflateParams(), or ensure that there is
sufficient space in next_out
(as identified by
avail_out
) to ensure that all pending output and
all uncompressed input can be flushed in a single call to
deflate().
Rationale: Although the deflateParams() function should flush pending output and compress all pending input, the result is unspecified if there is insufficient space in the output buffer. Applications should only call deflateParams() when the stream is effectively empty (flushed).
The deflateParams() can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy.
The deflateReset() function shall reset all state
associated with stream.
All pending output shall be discarded, and the counts of processed
bytes (total_in
and
total_out
) shall be reset to zero.
On success, deflateReset() shall return Z_OK. Otherwise it shall return Z_STREAM_ERROR to indicate the error.
On error, deflateReset() shall return Z_STREAM_ERROR. The following conditions shall be treated as an error:
The state in stream is inconsistent or inappropriate.
stream
is NULL
.
The deflateSetDictionary() function shall initialize the compression dictionary associated with stream using the dictlen bytes referenced by dictionary.
The implementation may silently use a subset of the provided dictionary if the dictionary cannot fit in the current window associated with stream (see deflateInit2_()). The application should ensure that the dictionary is sorted such that the most commonly used strings occur at the end of the dictionary.
If the dictionary is successfully set, the Adler32 checksum of the entire
provided dictionary
shall be stored in the adler
member of
stream. This value may be used by the decompression
system to select the correct dictionary. The compression and decompression
systems must use the same dictionary.
stream shall reference an initialized compression
stream, with total_in
zero (i.e. no data
has been compressed since the stream was initialized).
On success, deflateSetDictionary() shall return Z_OK. Otherwise it shall return Z_STREAM_ERROR to indicate an error.
On error, deflateSetDictionary() shall return a value as described below:
Z_STREAM_ERROR | The state in stream is inconsistent, or
stream
was |
The application should provide a dictionary consisting of strings {{{ed note: do we really mean "strings"? Null terminated?}}} that are likely to be encountered in the data to be compressed. The application should ensure that the dictionary is sorted such that the most commonly used strings occur at the end of the dictionary.
The use of a dictionary is optional; however if the data to be compressed is relatively short and has a predictable structure, the use of a dictionary can substantially improve the compression ratio.
Generate tables for a byte-wise 32-bit CRC calculation based on the polynomial: x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1
In a multi-threaded application, get_crc_table() should be called by one thread to initialize the tables before any other thread calls any libz function.
The get_crc_table() function shall return a pointer to the first of a set of tables used internally to calculate CRC-32 values (see crc32()).
The gzclose() function shall close the compressed file stream file. If file was open for writing, gzclose() shall first flush any pending output. Any state information allocated shall be freed.
On success, gzclose() shall return Z_OK. Otherwise, gzclose() shall return an error value as described below.
On error, gzclose() may set
the global variable errno
to indicate the error.
The gzclose() shall return a value other than Z_OK
on error.
Z_STREAM_ERROR | file was | |
Z_ERRNO | An error occurred in the underlying base libraries, and the application should check
| |
Z_BUF_ERROR | no compression progress is possible during buffer flush (see deflate()). |
The gzdopen() function shall attempt to associate the open file referenced by fd with a gzFile object. The mode argument is based on that of fopen(), but the mode parameter may also contain the following characters:
digit | set the compression level to digit. A low value (e.g. 1) means high speed, while a high value (e.g. 9) means high compression. A compression level of 0 (zero) means no compression. See defaultInit2_() for further details. | |
[fhR] | set the compression strategy to [fhR]. The letter f corresponds to filtered data, the letter h corresponds to Huffman only compression, and the letter R corresponds to Run Length Encoding. See defaultInit2_() for further details. |
If fd refers to an uncompressed file, and mode refers to a read mode, gzdopen() shall attempt to open the file and return a gzFile object suitable for reading directly from the file without any decompression.
If mode
is NULL, or if mode does not contain
one of r, w, or a,
gzdopen() shall return Z_NULL
,
and need not set any other error condition.
On success, gzdopen() shall return a
gzFile object. On failure,
gzdopen() shall return Z_NULL
and
may set errno
accordingly.
Note: At version 1.2.2,
zlib
does not seterrno
for several error conditions. Applications may not be able to determine the cause of an error.
If file was open for reading and end of file has been reached, gzeof() shall return 1. Otherwise, gzeof() shall return 0.
The gzerror() function shall return a string describing the last error to have occurred associated with the open compressed file stream referred to by file. It shall also set the location referenced by errnum to an integer value that further identifies the error.
The gzerror() function shall return a string that describes the last error associated with the given file compressed file stream. This string shall have the format "%s: %s", with the name of the file, followed by a colon, a space, and the description of the error. If the compressed file stream was opened by a call to gzdopen(), the format of the filename is unspecified.
Rationale: Although in all current implementations of libz file descriptors are named "<fd:%d>", the code suggests that this is for debugging purposes only, and may change in a future release.
It is unspecified if the string returned is determined by the setting
of the LC_MESSAGES
category in the current locale.
The gzflush() function shall flush pending output to the compressed file stream identified by file, which must be open for writing.
The parameter flush determines which compressed bits
are added to the output file.
If flush is Z_NO_FLUSH
,
gzflush()
may return with some data pending output, and not yet written to the file.
If flush is Z_SYNC_FLUSH
,
gzflush() shall flush all pending output to
file and align the output to a byte
boundary.
There may still be data pending compression that is not flushed.
If flush is Z_FULL_FLUSH
,
all output shall be flushed, as for Z_SYNC_FLUSH
,
and the compression state shall be reset.
There may still be data pending compression that is not flushed.
Rationale:
Z_SYNC_FLUSH
is intended to ensure that the compressed data contains all the data compressed so far, and allows a decompressor to reconstruct all of the input data.Z_FULL_FLUSH
allows decompression to restart from this point if the previous compressed data has been lost or damaged. Flushing is likely to degrade the performance of the compression system, and should only be used where necessary.
If flush is set to Z_FINISH
,
all pending uncompressed data shall be compressed
and all output shall be flushed.
On success, gzflush() shall return the value Z_OK. Otherwise gzflush() shall return a value to indicate the error, and may set the error number associated with the compressed file stream file.
Note: If flush is set to
Z_FINISH
and the flush operation is successful, gzflush() will return Z_OK, but the compressed file stream error value may be set toZ_STREAM_END
.
On error, gzwrite() shall return an error value, and may set the error number associated with the stream identified by file to indicate the error. Applications may use gzerror() to access this error value.
Z_ERRNO | An underlying base library function has indicated an error.
The global variable | |
Z_STREAM_ERROR | The stream is invalid, is not open for writing, or is in an invalid state. | |
Z_BUF_ERROR | no compression progress is possible (see deflate()). | |
Z_MEM_ERROR | Insufficient memory available to compress. |
The gzgetc() function shall read the next single character from the compressed file stream referenced by file, which shall have been opened in a read mode (see gzopen() and gzdopen()).
On success, gzgetc() shall return the uncompressed character read, otherwise, on end of file or error, gzgetc() shall return -1.
On end of file or error, gzgetc() shall return -1. Further information can be found by calling gzerror() with a pointer to the compressed file stream.
The gzgets() function shall attempt to read data from the compressed file stream file, uncompressing it into buf until either len-1 bytes have been inserted into buf, or until a newline character has been uncompressed into buf. A null byte shall be appended to the uncompressed data. The file shall have been opened in for reading (see gzopen() and gzdopen()).
On success, gzgets() shall return a pointer to buf. Otherwise, gzgets() shall return Z_NULL. Applications may examine the cause using gzerror().
On error, gzgets() shall return Z_NULL. The following conditions shall always be treated as an error:
file is NULL ,
or does not refer to a file open for reading; |
buf is NULL ; |
len is less than or equal to zero. |
The gzopen() function shall open the compressed file named by path. The mode argument is based on that of fopen(), but the mode parameter may also contain the following characters:
digit | set the compression level to digit. A low value (e.g. 1) means high speed, while a high value (e.g. 9) means high compression. A compression level of 0 (zero) means no compression. See defaultInit2_() for further details. | |
[fhR] | set the compression strategy to [fhR]. The letter f corresponds to filtered data, the letter h corresponds to Huffman only compression, and the letter R corresponds to Run Length Encoding. See defaultInit2_() for further details. |
If path refers to an uncompressed file, and mode refers to a read mode, gzopen() shall attempt to open the file and return a gzFile object suitable for reading directly from the file without any decompression.
If path or mode
is NULL, or if mode does not contain
one of r, w, or a,
gzopen() shall return Z_NULL
,
and need not set any other error condition.
The gzFile object is also referred to as a compressed file stream.
gzopen("file.gz", "w6h"); |
On success, gzopen() shall return a
gzFile object (also known as a compressed
file stream). On failure,
gzopen() shall return Z_NULL
and
may set errno
accordingly.
Note: At version 1.2.2,
zlib
does not seterrno
for several error conditions. Applications may not be able to determine the cause of an error.
The gzprintf() function shall format data as for fprintf(), and write the resulting string to the compressed file stream file.
The gzprintf() function
shall return the number of uncompressed bytes
actually written, or a value less than or equal to
0
in the event of an error.
If file is NULL
, or refers to a
compressed file stream that has not been opened for writing,
gzprintf() shall return Z_STREAM_ERROR.
Otherwise, errors are as for gzwrite().
The gzputc() function shall write the single character c, converted from integer to unsigned character, to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()).
On success, gzputc() shall return the value written, otherwise gzputc() shall return -1.
The gzputs() function shall write the null terminated string s to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()). The terminating null character shall not be written. The gzputs() function shall return the number of uncompressed bytes actually written.
On success, gzputs() shall return the number of uncompressed
bytes actually written to file.
On error gzputs() shall return a value
less than or equal to 0
.
Applications may examine the cause using gzerror().
On error, gzputs() shall set
the error number associated with the stream identified by
file
to indicate the error. Applications should use gzerror()
to access this error value.
If file is NULL
,
gzputs() shall return Z_STREAM_ERR
.
Z_ERRNO | An underlying base library function has indicated an error.
The global variable | |
Z_STREAM_ERROR | The stream is invalid, is not open for writing, or is in an invalid state. | |
Z_BUF_ERROR | no compression progress is possible (see deflate()). | |
Z_MEM_ERROR | Insufficient memory available to compress. |
The gzread() function shall read data from the compressed file referenced by file, which shall have been opened in a read mode (see gzopen() and gzdopen()). The gzread() function shall read data from file, and uncompress it into buf. At most, len bytes of uncompressed data shall be copied to buf. If the file is not compressed, gzread() shall simply copy data from file to buf without alteration.
On success, gzread() shall return the number of bytes
decompressed into buf.
If gzread() returns 0
,
either the end-of-file has been reached
or an underlying read error has occurred. Applications
should use gzerror() or gzeof()
to determine which occurred.
On other errors,
gzread() shall return a value less than
0
and
and applications may examine the cause using gzerror().
On error, gzread() shall set the error number associated with the stream identified by file to indicate the error. Applications should use gzerror() to access this error value.
Z_ERRNO | An underlying base library function has indicated an error.
The global variable | |
Z_STREAM_END | End of file has been reached on input. | |
Z_DATA_ERROR | A CRC error occurred when reading data; the file is corrupt. | |
Z_STREAM_ERROR | The stream is invalid, or is in an invalid state. | |
Z_NEED_DICT | A dictionary is needed (see inflateSetDictionary()). | |
Z_MEM_ERROR | Insufficient memory available to decompress. |
The gzrewind() function shall set the starting position for the next read on compressed file stream file to the beginning of file. file must be open for reading.
gzrewind() is equivalent to
(int)gzseek(file, 0L, SEEK_SET) |
On success, gzrewind() shall return 0. On error, gzrewind() shall return -1, and may set the error value for file accordingly.
On error, gzrewind() shall return -1
,
indicating that file is
NULL
, or does not represent
an open compressed file stream, or represents a compressed file stream
that is open for writing and is not currently at the beginning of file.
The gzseek() function shall set the file-position indicator for the compressed file stream file. The file-position indicator controls where the next read or write operation on the compressed file stream shall take place. The offset indicates a byte offset in the uncompressed data. The whence parameter may be one of:
SEEK_SET | the offset is relative to the start of the uncompressed data. | |
SEEK_CUR | the offset is relative to the current positition in the uncompressed data. |
Note: The value
SEEK_END
need not be supported.
If the file is open for writing, the new offset must be greater than or equal to the current offset. In this case, gzseek() shall compress a sequence of null bytes to fill the gap from the previous offset to the new offset.
On success, gzseek() shall return the resulting offset in the file expressed as a byte position in the uncompressed data stream. On error, gzseek() shall return -1, and may set the error value for file accordingly.
On error, gzseek() shall return -1. The following conditions shall always result in an error:
file is NULL
file does not represent an open compressed file stream.
file refers to a compressed file stream that is open for writing, and the newly computed offset is less than the current offset.
The newly computed offset is less than zero.
whence is not one of the supported values.
If file is open for reading, the implementation may still need to uncompress all of the data up to the new offset. As a result, gzseek() may be extremely slow in some circumstances.
The gzsetparams() function shall set the compression level and compression strategy on the compressed file stream referenced by file. The compressed file stream shall have been opened in a write mode. The level and strategy are as defined in deflateInit2_. If there is any data pending writing, it shall be flushed before the parameters are updated.
On error, gzsetparams() shall return one of the following error indications:
Z_STREAM_ERROR | Invalid parameter, or file not open for writing. | |
Z_BUF_ERROR | An internal inconsistency was detected while flushing the previous buffer. |
The gztell() function shall return the starting position for the next read or write operation on compressed file stream file. This position represents the number of bytes from the beginning of file in the uncompressed data.
gztell() is equivalent to
gzseek(file, 0L, SEEK_SET) |
gztell() shall return the current offset in the file expressed as a byte position in the uncompressed data stream. On error, gztell() shall return -1, and may set the error value for file accordingly.
On error, gztell() shall return -1
,
indicating that file is
NULL
, or does not represent
an open compressed file stream.
The gzwrite() function shall write data to the compressed file referenced by file, which shall have been opened in a write mode (see gzopen() and gzdopen()). On entry, buf shall point to a buffer containing lenbytes of uncompressed data. The gzwrite() function shall compress this data and write it to file. The gzwrite() function shall return the number of uncompressed bytes actually written.
On success, gzwrite() shall return the number of
uncompressed bytes actually written to file.
On error gzwrite() shall return a value
less than or equal to 0
.
Applications may examine the cause using gzerror().
On error, gzwrite() shall set the error number associated with the stream identified by file to indicate the error. Applications should use gzerror() to access this error value.
Z_ERRNO | An underlying base library function has indicated an error.
The global variable | |
Z_STREAM_ERROR | The stream is invalid, is not open for writing, or is in an invalid state. | |
Z_BUF_ERROR | no compression progress is possible (see deflate()). | |
Z_MEM_ERROR | Insufficient memory available to compress. |
The inflate() function shall attempt to decompress data until either the input buffer is empty or the output buffer is full. The stream references a z_stream structure. Before the first call to inflate(), this structure should have been initialized by a call to inflateInit2_().
Note: inflateInit2_() is only in the binary standard; source level applications should initialize stream via a call to inflateInit() or inflateInit2().
next_in | should point to the data to be decompressed. | |
avail_in | should contain the number of bytes of data in the
buffer referenced by | |
next_out | should point to a buffer where decompressed data may be placed. | |
avail_out | should contain the size in bytes of the
buffer referenced by |
The inflate() function shall perform one or both of the following actions:
Decompress input data from next_in
and update next_in
,
avail_in
and
total_in
to reflect the data that has been
decompressed.
Fill the output buffer referenced by next_out
,
and update next_out
,
avail_out
, and
total_out
to reflect the decompressed data that
has been placed there. If flush is not
Z_NO_FLUSH
, and
avail_out
indicates that there is still space in
output buffer, this action shall always occur (see below for further details).
The inflate() function shall return when either
avail_in
reaches zero (indicating that all the input
data has been compressed), or avail_out
reaches
zero (indicating that the output buffer is full).
On success, the inflate() function shall set the
adler
field of the stream
to the Adler-32 checksum of all the input data compressed
so far (represented by total_in
).
The parameter flush determines when uncompressed bytes
are added to the output buffer in next_out
.
If flush is Z_NO_FLUSH
,
inflate()
may return with some data pending output, and not yet added to the
output buffer.
If flush is Z_SYNC_FLUSH
,
inflate() shall flush all pending output to
next_out
, and update
next_out
and avail_out
accordingly.
If flush is set to Z_BLOCK
,
inflate() shall stop adding data to the output
buffer if and when the next compressed block boundary is reached
(see RFC 1951: DEFLATE Compressed Data Format Specification).
If flush is set to Z_FINISH
,
all of the compressed input shall be decompressed and added to
the output. If there is insufficient output space (i.e. the compressed
input data uncompresses to more than avail_out
bytes), then inflate() shall fail and return
Z_BUF_ERROR.
On success, inflate() shall return Z_OK if decompression progress has been made, or Z_STREAM_END if all of the input data has been decompressed and there was sufficient space in the output buffer to store the uncompressed result. On error, inflate() shall return a value to indicate the error.
Note: If inflate() returns Z_OK and has set
avail_out
to zero, the function should be called again with the same value for flush, and with updatednext_out
andavail_out
until inflate() returns with either Z_OK or Z_STREAM_END and a non-zeroavail_out
.
On success, inflate() shall set the
adler
to the Adler-32 checksum of
the output produced so far (i.e. total_out
bytes).
On error, inflate() shall return a value as described
below, and may set the msg
field of
stream to point to a string describing the error:
Z_BUF_ERROR | No progress is possible; either | |
Z_MEM_ERROR | Insufficient memory. | |
Z_STREAM_ERROR | The state (as represented in stream) is inconsistent, or
stream was | |
Z_NEED_DICT | A preset dictionary is required. The |
The inflateEnd() function shall free all allocated state information referenced by stream. All pending output is discarded, and unprocessed input is ignored.
On success, inflateEnd() shall return Z_OK. Otherwise it shall return Z_STREAM_ERROR to indicate the error.
On error, inflateEnd() shall return Z_STREAM_ERROR. The following conditions shall be treated as an error:
The state in stream is inconsistent.
stream
is NULL
.
The zfree
function pointer is
NULL
.
The inflateInit2_() function shall initialize the decompression system. On entry, strm shall refer to a user supplied z_stream object (a z_stream_s structure). The following fields shall be set on entry:
zalloc | a pointer to an alloc_func function, used to allocate state information.
If this is | |
zfree | a pointer to a free_func function, used to free memory allocated by the
| |
opaque | If |
If the version requested is not compatible with the version
implemented, or if the size of the z_stream_s structure
provided in stream_size does not match the size in the library
implementation, inflateInit2_() shall fail, and return
Z_VERSION_ERROR
.
The windowBits parameter shall be a base 2 logarithm of the maximum
window
size to use, and shall be a value between 8
and 15
.
If the input data was compressed with a larger window size, subsequent attempts to
decompress this data will fail with Z_DATA_ERROR
, rather than try to
allocate a larger window.
The inflateInit2_() function is not in the source standard; it is only in the binary standard. Source applications should use the inflateInit2() macro.
On success, the inflateInit2_() function shall return
Z_OK
.
Otherwise, inflateInit2_() shall return
a value as described below to indicate the error.
On error, inflateInit2_() shall return one of the following error indicators:
Z_STREAM_ERROR | Invalid parameter. | |
Z_MEM_ERROR | Insufficient memory available. | |
Z_VERSION_ERROR | The version requested is not compatible with the library version, or the z_stream size differs from that used by the library. |
In addition, the msg
field of the strm
may be set to an error message.
The inflateInit_() function shall initialize the decompression system. On entry, stream shall refer to a user supplied z_stream object (a z_stream_s structure). The following fields shall be set on entry:
zalloc | a pointer to an alloc_func function, used to allocate state information.
If this is | |
zfree | a pointer to a free_func function, used to free memory allocated by the
| |
opaque | If |
If the version requested is not compatible with the version
implemented, or if the size of the z_stream_s structure
provided in stream_size does not match the size in the library
implementation, inflateInit_() shall fail, and return
Z_VERSION_ERROR
.
The inflateInit_() function is not in the source standard; it is only in the binary standard. Source applications should use the inflateInit() macro.
The inflateInit_() shall be equivalent to
inflateInit2_(strm, DEF_WBITS, version, stream_size); |
On success, the inflateInit_() function shall return
Z_OK
.
Otherwise, inflateInit_() shall return
a value as described below to indicate the error.
On error, inflateInit_() shall return one of the following error indicators:
Z_STREAM_ERROR | Invalid parameter. | |
Z_MEM_ERROR | Insufficient memory available. | |
Z_VERSION_ERROR | The version requested is not compatible with the library version, or the z_stream size differs from that used by the library. |
In addition, the msg
field of the strm
may be set to an error message.
The inflateReset() function shall reset all state
associated with stream.
All pending output shall be discarded, and the counts of processed
bytes (total_in
and
total_out
) shall be reset to zero.
On success, inflateReset() shall return Z_OK. Otherwise it shall return Z_STREAM_ERROR to indicate the error.
On error, inflateReset() shall return Z_STREAM_ERROR. The following conditions shall be treated as an error:
The state in stream is inconsistent or inappropriate.
stream
is NULL
.
The inflateSetDictionary() function shall initialize the decompression dictionary associated with stream using the dictlen bytes referenced by dictionary.
The inflateSetDictionary() function should be called immediately after a call to inflate() has failed with return value Z_NEED_DICT. The dictionary must have the same Adler-32 checksum as the dictionary used for the compression (see deflateSetDictionary()).
stream shall reference an initialized decompression
stream, with total_in
zero (i.e. no data
has been decompressed since the stream was initialized).
On success, inflateSetDictionary() shall return Z_OK. Otherwise it shall return a value as indicated below.
On error, inflateSetDictionary() shall return a value as described below:
Z_STREAM_ERROR | The state in stream is inconsistent, or
stream
was | |
Z_DATA_ERROR | The Adler-32 checksum of the supplied dictionary does not match that used for the compression. |
The application should provide a dictionary consisting of strings {{{ed note: do we really mean "strings"? Null terminated?}}} that are likely to be encountered in the data to be compressed. The application should ensure that the dictionary is sorted such that the most commonly used strings occur at the end of the dictionary.
The use of a dictionary is optional; however if the data to be compressed is relatively short and has a predictable structure, the use of a dictionary can substantially improve the compression ratio.
The inflateSync() function shall advance through the
compressed data in stream, skipping any invalid
compressed data, until the next full flush point is reached, or all
input is exhausted. See the
description for deflate() with flush level
Z_FULL_FLUSH
.
No output is placed in next_out
.
On success, inflateSync() shall return
Z_OK, and update the
next_in
,, avail_in
, and, total_in
fields of stream to reflect the number
of bytes of compressed data that have been skipped.
Otherwise, inflateSync()
shall return a value as described below to indicate the
error.
On error, inflateSync() shall return a value as described below:
Z_STREAM_ERROR | The state (as represented in stream) is inconsistent, or
stream was | |
Z_BUF_ERROR | There is no data available to skip over. | |
Z_DATA_ERROR | No sync point was found. |
The inflateSyncPoint() function shall return a non-zero calue if the compressed data stream referenced by stream is at a synchronization point.
If the compressed data in stream is at
a synchronization point (see deflate()
with a flush level of Z_SYNC_FLUSH
or
Z_FULL_FLUSH
), inflateSyncPoint()
shall return a non-zero value, other than Z_STREAM_ERROR
.
Otherwise, if the stream is valid,
inflateSyncPoint() shall return 0.
If stream is invalid, or in an invalid state,
inflateSyncPoint() shall return
Z_STREAM_ERROR to indicate the error.
On error, inflateSyncPoint() shall return a value as described below:
Z_STREAM_ERROR | The state (as represented in stream) is inconsistent, or
stream was |
The uncompress() function shall attempt to uncompress sourceLen bytes of data in the buffer source, placing the result in the buffer dest.
On entry, destLen should point to a value describing the size of the dest buffer. The application should ensure that this value is large enough to hold the entire uncompressed data.
Note: The LSB does not describe any mechanism by which a compressor can communicate the size required to the uncompressor.
On success, uncompress() shall return Z_OK. Otherwise, uncompress() shall return a value to indicate the error.
On error, uncompress() shall return a value as described below:
Z_BUF_ERROR | The buffer dest was not large enough to hold the uncompressed data. | |
Z_MEM_ERROR | Insufficient memory. | |
Z_DATA_ERROR | The compressed data (referenced by source) was corrupted. |
The zError() function shall return the string identifying the error associated with err. This allows for conversion from error code to string for functions such as compress() and uncompress(), that do not always set the string version of an error.
The zError() function shall return a the string identifying the error associated with err, or NULL if err is not a valid error code.
It is unspecified if the string returned is determined by the setting
of the LC_MESSAGES
category in the current locale.
The zlibVersion() function shall return the string identifying the interface version at the time the library was built.
Applications should compare the value returned from
zlibVersion() with the macro constant
ZLIB_VERSION
for compatibility.
Table 14-3 defines the library name and shared object name for the libncurses library
The Parameters or return value of the following interface have had the const qualifier added as shown here.
extern const char *keyname (int); extern int mvscanw (int, int, const char *, ...); extern int mvwscanw (WINDOW *, int, int, const char *, ...); extern SCREEN *newterm (const char *, FILE *, FILE *); extern int scanw (const char *, ...); extern int vwscanw (WINDOW *, const char *, va_list); extern int vw_scanw (WINDOW *, const char *, va_list); extern int wscanw (WINDOW *, const char *, ...); |
The behavior of the interfaces in this library is specified by the following specifications:
[SUS-CURSES] X/Open Curses |
An LSB conforming implementation shall provide the generic functions for Curses specified in Table 14-4, with the full mandatory functionality as described in the referenced underlying specification.
Table 14-4. libncurses - Curses Function Interfaces
addch [SUS-CURSES] | addchnstr [SUS-CURSES] | addchstr [SUS-CURSES] | addnstr [SUS-CURSES] |
addstr [SUS-CURSES] | attr_get [SUS-CURSES] | attr_off [SUS-CURSES] | attr_on [SUS-CURSES] |
attr_set [SUS-CURSES] | attroff [SUS-CURSES] | attron [SUS-CURSES] | attrset [SUS-CURSES] |
baudrate [SUS-CURSES] | beep [SUS-CURSES] | bkgd [SUS-CURSES] | bkgdset [SUS-CURSES] |
border [SUS-CURSES] | box [SUS-CURSES] | can_change_color [SUS-CURSES] | cbreak [SUS-CURSES] |
chgat [SUS-CURSES] | clear [SUS-CURSES] | clearok [SUS-CURSES] | clrtobot [SUS-CURSES] |
clrtoeol [SUS-CURSES] | color_content [SUS-CURSES] | color_set [SUS-CURSES] | copywin [SUS-CURSES] |
curs_set [SUS-CURSES] | def_prog_mode [SUS-CURSES] | def_shell_mode [SUS-CURSES] | del_curterm [SUS-CURSES] |
delay_output [SUS-CURSES] | delch [SUS-CURSES] | deleteln [SUS-CURSES] | delscreen [SUS-CURSES] |
delwin [SUS-CURSES] | derwin [SUS-CURSES] | doupdate [SUS-CURSES] | dupwin [SUS-CURSES] |
echo [SUS-CURSES] | echochar [SUS-CURSES] | endwin [SUS-CURSES] | erase [SUS-CURSES] |
erasechar [SUS-CURSES] | filter [SUS-CURSES] | flash [SUS-CURSES] | flushinp [SUS-CURSES] |
getbkgd [SUS-CURSES] | getch [SUS-CURSES] | getnstr [SUS-CURSES] | getstr [SUS-CURSES] |
getwin [SUS-CURSES] | halfdelay [SUS-CURSES] | has_colors [SUS-CURSES] | has_ic [SUS-CURSES] |
has_il [SUS-CURSES] | hline [SUS-CURSES] | idcok [SUS-CURSES] | idlok [SUS-CURSES] |
immedok [SUS-CURSES] | inch [SUS-CURSES] | inchnstr [SUS-CURSES] | inchstr [SUS-CURSES] |
init_color [SUS-CURSES] | init_pair [SUS-CURSES] | initscr [SUS-CURSES] | innstr [SUS-CURSES] |
insch [SUS-CURSES] | insdelln [SUS-CURSES] | insertln [SUS-CURSES] | insnstr [SUS-CURSES] |
insstr [SUS-CURSES] | instr [SUS-CURSES] | intrflush [SUS-CURSES] | is_linetouched [SUS-CURSES] |
is_wintouched [SUS-CURSES] | isendwin [SUS-CURSES] | keyname [SUS-CURSES] | keypad [SUS-CURSES] |
killchar [SUS-CURSES] | leaveok [SUS-CURSES] | longname [SUS-CURSES] | meta [SUS-CURSES] |
move [SUS-CURSES] | mvaddch [SUS-CURSES] | mvaddchnstr [SUS-CURSES] | mvaddchstr [SUS-CURSES] |
mvaddnstr [SUS-CURSES] | mvaddstr [SUS-CURSES] | mvchgat [SUS-CURSES] | mvcur [SUS-CURSES] |
mvdelch [SUS-CURSES] | mvderwin [SUS-CURSES] | mvgetch [SUS-CURSES] | mvgetnstr [SUS-CURSES] |
mvgetstr [SUS-CURSES] | mvhline [SUS-CURSES] | mvinch [SUS-CURSES] | mvinchnstr [SUS-CURSES] |
mvinchstr [SUS-CURSES] | mvinnstr [SUS-CURSES] | mvinsch [SUS-CURSES] | mvinsnstr [SUS-CURSES] |
mvinsstr [SUS-CURSES] | mvinstr [SUS-CURSES] | mvprintw [SUS-CURSES] | mvscanw [SUS-CURSES] |
mvvline [SUS-CURSES] | mvwaddch [SUS-CURSES] | mvwaddchnstr [SUS-CURSES] | mvwaddchstr [SUS-CURSES] |
mvwaddnstr [SUS-CURSES] | mvwaddstr [SUS-CURSES] | mvwchgat [SUS-CURSES] | mvwdelch [SUS-CURSES] |
mvwgetch [SUS-CURSES] | mvwgetnstr [SUS-CURSES] | mvwgetstr [SUS-CURSES] | mvwhline [SUS-CURSES] |
mvwin [SUS-CURSES] | mvwinch [SUS-CURSES] | mvwinchnstr [SUS-CURSES] | mvwinchstr [SUS-CURSES] |
mvwinnstr [SUS-CURSES] | mvwinsch [SUS-CURSES] | mvwinsnstr [SUS-CURSES] | mvwinsstr [SUS-CURSES] |
mvwinstr [SUS-CURSES] | mvwprintw [SUS-CURSES] | mvwscanw [SUS-CURSES] | mvwvline [SUS-CURSES] |
napms [SUS-CURSES] | newpad [SUS-CURSES] | newterm [SUS-CURSES] | newwin [SUS-CURSES] |
nl [SUS-CURSES] | nocbreak [SUS-CURSES] | nodelay [SUS-CURSES] | noecho [SUS-CURSES] |
nonl [SUS-CURSES] | noqiflush |