Linux Standard Base Core Specification 3.2 Copyright © 2007 Linux Foundation 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 may be 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 * Apple Inc. * Easy Software Products * artofcode LLC * Till Kamppeter * Manfred Wassman * Python Software Foundation These excerpts are being used in accordance with their respective licenses. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. UNIX is a registered trademark of The Open Group. LSB is a trademark of the Linux Foundation in the United States and other countries. AMD is a trademark of Advanced Micro Devices, Inc. Intel and Itanium are registered trademarks and Intel386 is a trademark of Intel Corporation. PowerPC is a registered trademark and PowerPC Architecture is a trademark of the IBM Corporation. S/390 is a registered trademark of the IBM Corporation. OpenGL is a registered trademark of Silicon Graphics, Inc. __________________________________________________________ Table of Contents Foreword Introduction I. Introductory Elements 1. Scope 1.1. General 1.2. Module Specific Scope 2. References 2.1. Normative References 2.2. Informative References/Bibliography 3. Requirements 3.1. Relevant Libraries 3.2. LSB Implementation Conformance 3.3. LSB Application Conformance 4. Definitions 5. Terminology 6. Documentation Conventions 7. Relationship To ISO/IEC 9945 POSIX 8. Relationship To Other Linux Foundation Specifications II. Executable And Linking Format (ELF) 9. Introduction 10. Low Level System Information 10.1. Operating System Interface 10.2. Machine Interface 11. Object Format 11.1. Object Files 11.2. Sections 11.3. Special Sections 11.4. Symbol Mapping 11.5. DWARF Extensions 11.6. Exception Frames 11.7. Symbol Versioning 11.8. ABI note tag 12. Dynamic Linking 12.1. Program Loading and Dynamic Linking 12.2. Program Header 12.3. Dynamic Entries III. Base Libraries 13. Base Libraries 13.1. Introduction 13.2. Program Interpreter 13.3. Interfaces for libc 13.4. Data Definitions for libc 13.5. Interface Definitions for libc 13.6. Interfaces for libm 13.7. Data Definitions for libm 13.8. Interface Definitions for libm 13.9. Interfaces for libpthread 13.10. Data Definitions for libpthread 13.11. Interface Definitions for libpthread 13.12. Interfaces for libgcc_s 13.13. Data Definitions for libgcc_s 13.14. Interfaces for libdl 13.15. Data Definitions for libdl 13.16. Interface Definitions for libdl 13.17. Interfaces for librt 13.18. Data Definitions for librt 13.19. Interfaces for libcrypt 13.20. Interfaces for libpam 13.21. Data Definitions for libpam 13.22. Interface Definitions for libpam IV. Utility Libraries 14. Utility Libraries 14.1. Introduction 14.2. Interfaces for libz 14.3. Data Definitions for libz 14.4. Interface Definitions for libz 14.5. Interfaces for libncurses 14.6. Data Definitions for libncurses 14.7. Interfaces for libutil 14.8. Interface Definitions for libutil V. Commands and Utilities 15. Commands and Utilities 15.1. Commands and Utilities 15.2. Command Behavior VI. Execution Environment 16. File System Hierarchy 16.1. /dev: Device Files 16.2. /etc: Host-specific system configuration 16.3. User Accounting Databases 16.4. Path For System Administration Utilities 17. Additional Recommendations 17.1. Recommendations for applications on ownership and permissions 18. Additional Behaviors 18.1. Mandatory Optional Behaviors 19. Localization 19.1. Introduction 19.2. Regular Expressions 19.3. Pattern Matching Notation VII. System Initialization 20. System Initialization 20.1. Cron Jobs 20.2. Init Script Actions 20.3. Comment Conventions for Init Scripts 20.4. Installation and Removal of Init Scripts 20.5. Run Levels 20.6. Facility Names 20.7. Script Names 20.8. Init Script Functions VIII. Users & Groups 21. Users & Groups 21.1. User and Group Database 21.2. User & Group Names 21.3. User ID Ranges 21.4. Rationale IX. Package Format and Installation 22. Software Installation 22.1. Introduction 22.2. Package File Format 22.3. Package Script Restrictions 22.4. Package Tools 22.5. Package Naming 22.6. Package Dependencies 22.7. Package Architecture Considerations A. Alphabetical Listing of Interfaces A.1. libc A.2. libcrypt A.3. libdl A.4. libm A.5. libncurses A.6. libpam A.7. libpthread A.8. librt A.9. libutil A.10. libz B. Future Directions (Informative) B.1. Introduction B.2. Commands And Utilities lsbinstall -- installation tool for various types of data C. GNU Free Documentation License (Informative) C.1. PREAMBLE C.2. APPLICABILITY AND DEFINITIONS C.3. VERBATIM COPYING C.4. COPYING IN QUANTITY C.5. MODIFICATIONS C.6. COMBINING DOCUMENTS C.7. COLLECTIONS OF DOCUMENTS C.8. AGGREGATION WITH INDEPENDENT WORKS C.9. TRANSLATION C.10. TERMINATION C.11. FUTURE REVISIONS OF THIS LICENSE C.12. How to use this License for your documents List of Figures 11-1. Version Definition Entries 11-2. Version Definition Auxiliary Entries 11-3. Version Needed Entries 11-4. Version Needed Auxiliary Entries 12-1. Dynamic Structure List of Tables 2-1. Normative References 2-2. Other References 3-1. Standard Library Names 3-2. Standard Library Names defined in the Architecture Specific Parts of ISO/IEC 23360 10-1. Scalar Types 11-1. ELF Section Types 11-2. Additional Section Types 11-3. ELF Special Sections 11-4. Additional Special Sections 11-5. DWARF Exception Header value format 11-6. DWARF Exception Header application 11-7. Additional DWARF Call Frame Instructions 11-8. Call Frame Information Format 11-9. Common Information Entry Format 11-10. Frame Description Entry Format 11-11. .eh_frame_hdr Section Format 12-1. Linux Segment Types 13-1. libc Definition 13-2. libc - RPC Function Interfaces 13-3. libc - System Calls Function Interfaces 13-4. libc - System Calls Deprecated Function Interfaces 13-5. libc - Standard I/O Function Interfaces 13-6. libc - Standard I/O Data Interfaces 13-7. libc - Signal Handling Function Interfaces 13-8. libc - Signal Handling Deprecated Function Interfaces 13-9. libc - Signal Handling Data Interfaces 13-10. libc - Localization Functions Function Interfaces 13-11. libc - Localization Functions Data Interfaces 13-12. libc - Posix Spawn Option Function Interfaces 13-13. libc - Posix Advisory Option Function Interfaces 13-14. libc - Socket Interface Function Interfaces 13-15. libc - Socket Interface Data Interfaces 13-16. libc - Wide Characters Function Interfaces 13-17. libc - String Functions Function Interfaces 13-18. libc - String Functions Deprecated Function Interfaces 13-19. libc - IPC Functions Function Interfaces 13-20. libc - Regular Expressions Function Interfaces 13-21. libc - Character Type Functions Function Interfaces 13-22. libc - Time Manipulation Function Interfaces 13-23. libc - Time Manipulation Data Interfaces 13-24. libc - Terminal Interface Functions Function Interfaces 13-25. libc - System Database Interface Function Interfaces 13-26. libc - System Database Interface Deprecated Function Interfaces 13-27. libc - Language Support Function Interfaces 13-28. libc - Large File Support Function Interfaces 13-29. libc - Large File Support Deprecated Function Interfaces 13-30. libc - Standard Library Function Interfaces 13-31. libc - Standard Library Deprecated Function Interfaces 13-32. libc - Standard Library Data Interfaces 13-33. libm Definition 13-34. libm - Math Function Interfaces 13-35. libm - Math Deprecated Function Interfaces 13-36. libm - Math Data Interfaces 13-37. libpthread Definition 13-38. libpthread - Realtime Threads Function Interfaces 13-39. libpthread - Advanced Realtime Threads Function Interfaces 13-40. libpthread - Posix Threads Function Interfaces 13-41. libpthread - Posix Threads Deprecated Function Interfaces 13-42. libpthread - Thread aware versions of libc interfaces Function Interfaces 13-43. libgcc_s Definition 13-44. libdl Definition 13-45. libdl - Dynamic Loader Function Interfaces 13-46. librt Definition 13-47. librt - Shared Memory Objects Function Interfaces 13-48. librt - Clock Function Interfaces 13-49. librt - Timers Function Interfaces 13-50. librt - Message Queues Function Interfaces 13-51. libcrypt Definition 13-52. libcrypt - Encryption Function Interfaces 13-53. libpam Definition 13-54. libpam - Pluggable Authentication API Function Interfaces 14-1. libz Definition 14-2. libz - Compression Library Function Interfaces 14-3. libncurses Definition 14-4. libncurses - Curses Function Interfaces 14-5. libncurses - Curses Data Interfaces 14-6. libutil Definition 14-7. libutil - Utility Functions Function Interfaces 15-1. Commands And Utilities 15-2. Built In Utilities 15-1. Escape Sequences 21-1. Required User & Group Names 21-2. Optional User & Group Names 22-1. RPM File Format 22-2. Signature Format 22-3. Index Type values 22-4. Header Private Tag Values 22-5. Signature Tag Values 22-6. Signature Digest Tag Values 22-7. Signature Signing Tag Values 22-8. Package Info Tag Values 22-9. Installation Tag Values 22-10. File Info Tag Values 22-11. File Flags 22-12. Package Dependency Tag Values 22-13. Index Type values 22-14. Package Dependency Attributes 22-15. Other Tag Values 22-16. CPIO File Format A-1. libc Function Interfaces A-2. libc Data Interfaces A-3. libcrypt Function Interfaces A-4. libdl Function Interfaces A-5. libm Function Interfaces A-6. libm Data Interfaces A-7. libncurses Function Interfaces A-8. libncurses Data Interfaces A-9. libpam Function Interfaces A-10. libpthread Function Interfaces A-11. librt Function Interfaces A-12. libutil Function Interfaces A-13. libz Function Interfaces __________________________________________________________ Foreword This is version 3.2 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 Linux Foundation Certification Policy for details. __________________________________________________________ Introduction 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. I. Introductory Elements Table of Contents 1. Scope 1.1. General 1.2. Module Specific Scope 2. References 2.1. Normative References 2.2. Informative References/Bibliography 3. Requirements 3.1. Relevant Libraries 3.2. LSB Implementation Conformance 3.3. LSB Application Conformance 4. Definitions 5. Terminology 6. Documentation Conventions 7. Relationship To ISO/IEC 9945 POSIX 8. Relationship To Other Linux Foundation Specifications __________________________________________________________ Chapter 1. Scope 1.1. General 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"), ISO/IEC 23360 Part 1, describing those parts of the interface that remain constant across all implementations of the LSB, and an architecture-specific part ("LSB-arch" or "archLSB") describing the parts of the interface that vary by processor architecture. Together, the LSB-generic and the relevant architecture-specific part of ISO/IEC 23360 for a single hardware architecture provide a complete interface specification for compiled application programs on systems that share a common hardware architecture. ISO/IEC 23360 Part 1, the LSB-generic document, should be used in conjunction with an architecture-specific part. Whenever a section of the LSB-generic specification is supplemented by architecture-specific information, the LSB-generic document includes a reference to the architecture part. Architecture-specific parts of ISO/IEC 23360 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 provides 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. __________________________________________________________ 1.2. Module Specific Scope This is the Core module of the Linux Standard Base (LSB), ISO/IEC 23360 Part 1. This module provides the fundamental system interfaces, libraries, and runtime environment upon which all conforming applications and libraries depend. Interfaces described in this part of ISO/IEC 23360 are mandatory except where explicitly listed otherwise. Core interfaces may be supplemented by other modules; all modules are built upon the core. __________________________________________________________ Chapter 2. References 2.1. Normative References 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 Linux Foundation'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/ 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(TM) C++ ABI Itanium(TM) C++ ABI (Revision 1.83) http://refspecs.linux-foundation.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 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 __________________________________________________________ 2.2. Informative References/Bibliography 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.linux-foundation.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.linux-foundation.org/dwarf IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary floating-point arithmetic for microprocessor systems http://www.ieee.org/ 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&p arent=T-REC-V.42 Li18nux Globalization Specification LI18NUX 2000 Globalization Specification, Version 1.0 with Amendment 4 http://www.openi18n.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.h tml 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 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ __________________________________________________________ Chapter 3. Requirements 3.1. Relevant Libraries 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 relevant architecture specific part of ISO/IEC 23360. 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 Parts of ISO/IEC 23360 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. __________________________________________________________ 3.2. LSB Implementation Conformance A conforming implementation is necessarily architecture specific, and must provide the interfaces specified by both the generic LSB Core specification (ISO/IEC 23360 Part 1) and the relevant architecture specific part of ISO/IEC 23360. 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 parts of ISO/IEC 23360 that supplement this specification for a given target processor architecture describe 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. __________________________________________________________ 3.3. LSB Application Conformance A conforming application is necessarily architecture specific, and must conform to both the generic LSB Core specification (ISO/IEC 23360 Part 1)and the relevant architecture specific part of ISO/IEC 23360. 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. A strictly conforming application shall not require or use any interface, facility, or implementation-defined extension that is not defined in this document in order to be installed or to execute successfully. __________________________________________________________ Chapter 4. Definitions For the purposes of this document, the following definitions, as specified in the ISO/IEC Directives, Part 2, 2001, 4th Edition, apply: can be able to; there is a possibility of; it is possible to cannot be unable to; there is no possibilty of; it is not possible to may is permitted; is allowed; is permissible need not it is not required that; no...is required shall is to; is required to; it is required that; has to; only...is permitted; it is necessary shall not is not allowed [permitted] [acceptable] [permissible]; is required to be not; is required that...be not; is not to be should it is recommended that; ought to should not it is not recommended that; ought not to __________________________________________________________ Chapter 5. Terminology For the purposes of this document, the following terms apply: archLSB 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. Binary Standard The total set of interfaces that are available to be used in the compiled binary code of a conforming application. gLSB The common part of the LSB Specification that describes those parts of the interface that remain constant across all hardware implementations of the LSB. implementation-defined 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. Shell Script 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. Source Standard The set of interfaces that are available to be used in the source code of a conforming application. undefined 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. unspecified 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). __________________________________________________________ Chapter 6. Documentation Conventions 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, forkpty(GLIBC_2.0) [SUSv3] refers to the interface named forkpty() with symbol version GLIBC_2.0 that is defined in the SUSv3 reference. Note: Symbol versions are defined in the architecture specific parts of ISO/IEC 23360 only. __________________________________________________________ Chapter 7. Relationship To ISO/IEC 9945 POSIX 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 Linux Foundation 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. __________________________________________________________ Chapter 8. Relationship To Other Linux Foundation Specifications The LSB is the base for several other specification projects under the umbrella of the Linux Foundation (LF). 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 LF projects. II. Executable And Linking Format (ELF) Table of Contents 9. Introduction 10. Low Level System Information 10.1. Operating System Interface 10.2. Machine Interface 10.2.1. Data Representation 11. Object Format 11.1. Object Files 11.2. Sections 11.2.1. Introduction 11.2.2. Sections Types 11.3. Special Sections 11.3.1. Special Sections 11.4. Symbol Mapping 11.4.1. Introduction 11.5. DWARF Extensions 11.5.1. DWARF Exception Header Encoding 11.5.2. DWARF CFI Extensions 11.6. Exception Frames 11.6.1. The .eh_frame section 11.6.2. The .eh_frame_hdr section 11.7. Symbol Versioning 11.7.1. Introduction 11.7.2. Symbol Version Table 11.7.3. Version Definitions 11.7.4. Version Requirements 11.7.5. Startup Sequence 11.7.6. Symbol Resolution 11.8. ABI note tag 12. Dynamic Linking 12.1. Program Loading and Dynamic Linking 12.2. Program Header 12.3. Dynamic Entries 12.3.1. Introduction 12.3.2. Dynamic Entries __________________________________________________________ Chapter 9. Introduction 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. __________________________________________________________ Chapter 10. Low Level System Information 10.1. Operating System Interface 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. __________________________________________________________ 10.2. Machine Interface 10.2.1. Data Representation LSB-conforming applications shall use the data representation as defined in the Arcitecture specific ELF documents. __________________________________________________________ 10.2.1.1. Fundamental Types In addition to the fundamental types specified in the relevant architecture specific part of ISO/IEC 23360, a 1 byte data type is defined here. Table 10-1. Scalar Types Type C C++ sizeof Alignment (bytes) Architecture Representation Integral _Bool bool 1 1 byte __________________________________________________________ Chapter 11. Object Format 11.1. Object Files LSB-conforming implementations shall support the object file Executable and Linking Format (ELF), which is defined by the following documents: * System V ABI * System V ABI Update * this specification * the relevant architecture specific part of ISO/IEC 23360 Conforming implementations may also support other unspecified object file formats. __________________________________________________________ 11.2. Sections 11.2.1. Introduction As described in System V ABI, an ELF object file contains a number of sections. __________________________________________________________ 11.2.2. Sections Types 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. __________________________________________________________ 11.2.2.1. ELF Section Types The following section types are defined in the System V ABI and the System V ABI Update. Table 11-1. ELF Section Types Name Value Description SHT_DYNAMIC 0x6 The section holds information for dynamic linking. Currently, an object file shall have only one dynamic section, but this restriction may be relaxed in the future. See `Dynamic Section' in Chapter 5 of System V ABI Update for details. SHT_DYNSYM 0xb This section holds a minimal set of symbols adequate for dynamic linking. See also SHT_SYMTAB. Currently, an object file may have either a section of SHT_SYMTAB type or a section of SHT_DYNSYM type, but not both. This restriction may be relaxed in the future. SHT_FINI_ARRAY 0xf This section contains an array of pointers to termination functions, as described in `Initialization and Termination Functions' in Chapter 5 of System V ABI Update. Each pointer in the array is taken as a parameterless procedure with a void return. SHT_HASH 0x5 The section holds a symbol hash table. Currently, an object file shall have only one hash table, but this restriction may be relaxed in the future. See `Hash Table' in Chapter 5 of System V ABI Update for details. SHT_INIT_ARRAY 0xe This section contains an array of pointers to initialization functions, as described in `Initialization and Termination Functions' in Chapter 5 of System V ABI Update. Each pointer in the array is taken as a parameterless procedure with a void return. SHT_NOBITS 0x8 A section of this type occupies no space in the file but otherwise resembles SHT_PROGBITS. Although this section contains no bytes, the sh_offset member contains the conceptual file offset. SHT_NOTE 0x7 The section holds information that marks the file in some way. See `Note Section' in Chapter 5 of System V ABI Update for details. SHT_NULL 0x0 This value marks the section header as inactive; it does not have an associated section. Other members of the section header have undefined values. SHT_PREINIT_ARRAY 0x10 This section contains an array of pointers to functions that are invoked before all other initialization functions, as described in `Initialization and Termination Functions' in Chapter 5 of System V ABI Update. Each pointer in the array is taken as a parameterless proceure with a void return. SHT_PROGBITS 0x1 The section holds information defined by the program, whose format and meaning are determined solely by the program. SHT_REL 0x9 The section holds relocation entries without explicit addends, such as type Elf32_Rel for the 32-bit class of object files or type Elf64_Rel for the 64-bit class of object files. An object file may have multiple relocation sections. See `Relocation' in Chapter 4 of System V ABI Update for details. SHT_RELA 0x4 The section holds relocation entries with explicit addends, such as type Elf32_Rela for the 32-bit class of object files or type Elf64_Rela for the 64-bit class of object files. An object file may have multiple relocation sections. See `Relocation' in Chapter 4 of System V ABI Update for details. SHT_STRTAB 0x3 The section holds a string table. An object file may have multiple string table sections. See `String Table' in Chapter 4 of System V ABI Update for details. SHT_SYMTAB 0x2 This section holds a symbol table. Currently, an object file may have either a section of SHT_SYMTAB type or a section of SHT_DYNSYM type, but not both. This restriction may be relaxed in the future. Typically, SHT_SYMTAB provides symbols for link editing, though it may also be used for dynamic linking. As a complete symbol table, it may contain many symbols unnecessary for dynamic linking. __________________________________________________________ 11.2.2.2. Additional Section Types The following additional section types are defined here. Table 11-2. Additional Section Types Name Value Description SHT_GNU_verdef 0x6ffffffd This section contains the symbol versions that are provided. SHT_GNU_verneed 0x6ffffffe This section contains the symbol versions that are required. SHT_GNU_versym 0x6fffffff This section contains the Symbol Version Table. __________________________________________________________ 11.3. Special Sections 11.3.1. Special Sections Various sections hold program and control information. Sections in the lists below are used by the system and have the indicated types and attributes. __________________________________________________________ 11.3.1.1. ELF Special Sections 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+SHF_MERGE+SHF_STRINGS .rodata1 SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS .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 .bss This section holds data that contributes to the program's memory image. The program may treat this data as uninitialized. However, the system shall initialize this data with zeroes when the program begins to run. The section occupies no file space, as indicated by the section type, SHT_NOBITS. .comment This section holds version control information. .data This section holds initialized data that contribute to the program's memory image. .data1 This section holds initialized data that contribute to the program's memory image. .debug This section holds information for symbolic debugging. The contents are unspecified. All section names with the prefix .debug hold information for symbolic debugging. The contents of these sections are unspecified. .dynamic This section holds dynamic linking information. The section's attributes will include the SHF_ALLOC bit. Whether the SHF_WRITE bit is set is processor specific. See Chapter 5 of System V ABI Update for more information. .dynstr This section holds strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries. See Chapter 5 of System V ABI Update for more information. .dynsym This section holds the dynamic linking symbol table, as described in `Symbol Table' of System V ABI Update. .fini This section holds executable instructions that contribute to the process termination code. That is, when a program exits normally, the system arranges to execute the code in this section. .fini_array This section holds an array of function pointers that contributes to a single termination array for the executable or shared object containing the section. .hash This section holds a symbol hash table. See `Hash Table' in Chapter 5 of System V ABI Update for more information. .init This section holds executable instructions that contribute to the process initialization code. When a program starts to run, the system arranges to execute the code in this section before calling the main program entry point (called main for C programs). .init_array This section holds an array of function pointers that contributes to a single initialization array for the executable or shared object containing the section. .interp This section holds the path name of a program interpreter. If the file has a loadable segment that includes relocation, the sections' attributes will include the SHF_ALLOC bit; otherwise, that bit will be off. See Chapter 5 of System V ABI Update for more information. .line This section holds line number information for symbolic debugging, which describes the correspondence between the source program and the machine code. The contents are unspecified. .note This section holds information in the format that `Note Section' in Chapter 5 of System V ABI Update describes. .preinit_array This section holds an array of function pointers that contributes to a single pre-initialization array for the executable or shared object containing the section. .rodata This section holds read-only data that typically contribute to a non-writable segment in the process image. See `Program Header' in Chapter 5 of System V ABI Update for more information. .rodata1 This section holds read-only data that typically contribute to a non-writable segment in the process image. See `Program Header' in Chapter 5 of System V ABI Update for more information. .shstrtab This section holds section names. .strtab This section holds strings, most commonly the strings that represent the names associated with symbol table entries. If the file has a loadable segment that includes the symbol string table, the section's attributes will include the SHF_ALLOC bit; otherwise, that bit will be off. .symtab This section holds a symbol table, as `Symbol Table' in Chapter 4 of System V ABI Update describes. If the file has a loadable segment that includes the symbol table, the section's attributes will include the SHF_ALLOC bit; otherwise, that bit will be off. .tbss This section holds uninitialized thread-local data that contribute to the program's memory image. By definition, the system initializes the data with zeros when the data is instantiated for each new execution flow. The section occupies no file space, as indicated by the section type, SHT_NOBITS. Implementations need not support thread-local storage. .tdata This section holds initialized thread-local data that contributes to the program's memory image. A copy of its contents is instantiated by the system for each new execution flow. Implementations need not support thread-local storage. .text This section holds the `text', or executable instructions, of a program. __________________________________________________________ 11.3.1.2. Additional Special Sections 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. __________________________________________________________ 11.4. Symbol Mapping 11.4.1. Introduction Symbols in a source program are translated by the compilation system into symbols that exist in the object file. __________________________________________________________ 11.4.1.1. C Language External C symbols shall be unchanged in an object file's symbol table. __________________________________________________________ 11.5. DWARF Extensions 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. __________________________________________________________ 11.5.1. DWARF Exception Header Encoding 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. __________________________________________________________ 11.5.2. DWARF CFI Extensions 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. __________________________________________________________ 11.6. Exception Frames 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. __________________________________________________________ 11.6.1. The .eh_frame section 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) __________________________________________________________ 11.6.1.1. The Common Information Entry Format 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. __________________________________________________________ 11.6.1.1.1. Augmentation String Format 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: 'z' A 'z' may be present as the first character of the string. If present, the Augmentation Data field shall be present. The contents of the Augmentation Data shall be intepreted according to other characters in the Augmentation String. 'L' A 'L' may be present at any position after the first character of the string. This character may only be present if 'z' is the first character of the string. If present, it indicates the presence of one argument in the Augmentation Data of the CIE, and a corresponding argument in the Augmentation Data of the FDE. The argument in the Augmentation Data of the CIE is 1-byte and represents the pointer encoding used for the argument in the Augmentation Data of the FDE, which is the address of a language-specific data area (LSDA). The size of the LSDA pointer is specified by the pointer encoding used. 'P' A 'P' may be present at any position after the first character of the string. This character may only be present if 'z' is the first character of the string. If present, it indicates the presence of two arguments in the Augmentation Data of the CIE. The first argument is 1-byte and represents the pointer encoding used for the second argument, which is the address of a personality routine handler. The personality routine is used to handle language and vendor-specific tasks. The system unwind library interface accesses the language-specific exception handling semantics via the pointer to the personality routine. The personality routine does not have an ABI-specific name. The size of the personality routine pointer is specified by the pointer encoding used. 'R' A 'R' may be present at any position after the first character of the string. This character may only be present if 'z' is the first character of the string. If present, The Augmentation Data shall include a 1 byte argument that represents the pointer encoding for the address pointers used in the FDE. __________________________________________________________ 11.6.1.2. The Frame Description Entry Format 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 the CIE Pointer in 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. __________________________________________________________ 11.6.2. The .eh_frame_hdr section 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 version Version of the .eh_frame_hdr format. This value shall be 1. eh_frame_ptr_enc The encoding format of the eh_frame_ptr field. fde_count_enc The encoding format of the fde_count field. A value of DW_EH_PE_omit indicates the binary search table is not present. table_enc The encoding format of the entries in the binary search table. A value of DW_EH_PE_omit indicates the binary search table is not present. eh_frame_ptr The encoded value of the pointer to the start of the .eh_frame section. fde_count The encoded value of the count of entries in the binary search table. binary search table A binary search table containing fde_count entries. Each entry of the table consist of two encoded values, the initial location, and the address. The entries are sorted in an increasing order by the initial location value. __________________________________________________________ 11.7. Symbol Versioning 11.7.1. Introduction 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. __________________________________________________________ 11.7.2. Symbol Version Table 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. __________________________________________________________ 11.7.3. Version Definitions 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. __________________________________________________________ 11.7.4. Version Requirements 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 vn_version Version of structure. This value is currently set to 1, and will be reset if the versioning implementation is incompatibly altered. vn_cnt Number of associated verneed array entries. vn_file Offset to the file name string in the section header, in bytes. vn_aux Offset to a corresponding entry in the vernaux array, in bytes. vn_next Offset to the next verneed entry, in bytes. 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 vna_hash Dependency name hash value (ELF hash function). vna_flags Dependency information flag bitmask. vna_other Object file version identifier used in the .gnu.version symbol version array. Bit number 15 controls whether or not the object is hidden; if this bit is set, the object cannot be used and the static linker will ignore the symbol's presence in the object. vna_name Offset to the dependency name string in the section header, in bytes. vna_next Offset to the next vernaux entry, in bytes. __________________________________________________________ 11.7.5. Startup Sequence 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. __________________________________________________________ 11.7.6. Symbol Resolution 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. __________________________________________________________ 11.8. ABI note tag 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. __________________________________________________________ Chapter 12. Dynamic Linking 12.1. Program Loading and Dynamic Linking 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 the relevant architecture specific part of ISO/IEC 23360. Any shared object that is loaded shall contain sufficient DT_NEEDED records to satisfy the symbols on the shared library. __________________________________________________________ 12.2. Program Header 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 PT_GNU_EH_FRAME The array element specifies the location and size of the exception handling information as defined by the .eh_frame_hdr section. PT_GNU_STACK The p_flags member specifies the permissions on the segment containing the stack and is used to indicate wether the stack should be executable. The absense of this header indicates that the stack will be executable. PT_GNU_RELRO the array element specifies the location and size of a segment which may be made read-only after relocations have been processed. __________________________________________________________ 12.3. Dynamic Entries 12.3.1. Introduction As described in System V ABI, if an object file participates 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. __________________________________________________________ 12.3.2. Dynamic Entries __________________________________________________________ 12.3.2.1. ELF Dynamic Entries The following dynamic entries are defined in the System V ABI and System V ABI Update. DT_BIND_NOW Process relocations of object DT_DEBUG For debugging; unspecified DT_FINI Address of termination function DT_HASH Address of symbol hash table DT_HIPROC End of processor-specific DT_INIT Address of init function DT_JMPREL Address of PLT relocs DT_LOPROC Start of processor-specific DT_NEEDED Name of needed library DT_NULL Marks end of dynamic section DT_PLTREL Type of reloc in PLT DT_PLTRELSZ Size in bytes of PLT relocs DT_REL Address of Rel relocs DT_RELA Address of Rela relocs DT_RELAENT Size of one Rela reloc DT_RELASZ Total size of Rela relocs DT_RELENT Size of one Rel reloc DT_RELSZ Total size of Rel relocs DT_RPATH Library search path DT_SONAME Name of shared object DT_STRSZ Size of string table DT_STRTAB Address of string table DT_SYMBOLIC Start symbol search here DT_SYMENT Size of one symbol table entry DT_SYMTAB Address of symbol table DT_TEXTREL Reloc might modify .text __________________________________________________________ 12.3.2.2. Additional Dynamic Entries An LSB conforming object may also use the following additional Dynamic Entry types. DT_ADDRRNGHI Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for definition by an archLSB. DT_ADDRRNGLO Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for definition by an archLSB. DT_AUXILIARY Shared object to load before self DT_FILTER Shared object to get values from DT_FINI_ARRAY The address of an array of pointers to termination functions. DT_FINI_ARRAYSZ Size in bytes of DT_FINI_ARRAY DT_HIOS Values from DT_LOOS through DT_HIOS are reserved for definition by specific operating systems. DT_INIT_ARRAY The address of an array of pointers to initialization functions. DT_INIT_ARRAYSZ Size in bytes of DT_INIT_ARRAY DT_LOOS Values from DT_LOOS through DT_HIOS are reserved for definition by specific operating systems. DT_NUM Number of dynamic entry tags defined (excepting reserved ranges). DT_POSFLAG_1 Flags for DT_* entries, effecting the following DT_* entry DT_RELCOUNT All Elf32_Rel R_*_RELATIVE relocations have been placed into a single block and this entry specifies the number of entries in that block. This permits ld.so.1 to streamline the processing of RELATIVE relocations. DT_RUNPATH null-terminated library search path string DT_SYMINENT Entry size of syminfo DT_SYMINFO Address of the Syminfo table. DT_SYMINSZ Size of syminfo table (in bytes) DT_VALRNGHI Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the Dyn.d_un.d_val field of the Elf*_Dyn structure. DT_VALRNGLO Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the Dyn.d_un.d_val field of the Elf*_Dyn structure. DT_VERDEF Address of version definition table DT_VERDEFNUM Number of version definitions DT_VERNEED Address of table with needed versions DT_VERNEEDNUM Number of needed versions DT_VERSYM Address of the table provided by the .gnu.version section. III. Base Libraries Table of Contents 13. Base Libraries 13.1. Introduction 13.2. Program Interpreter 13.3. Interfaces for libc 13.3.1. RPC 13.3.2. System Calls 13.3.3. Standard I/O 13.3.4. Signal Handling 13.3.5. Localization Functions 13.3.6. Posix Spawn Option 13.3.7. Posix Advisory Option 13.3.8. Socket Interface 13.3.9. Wide Characters 13.3.10. String Functions 13.3.11. IPC Functions 13.3.12. Regular Expressions 13.3.13. Character Type Functions 13.3.14. Time Manipulation 13.3.15. Terminal Interface Functions 13.3.16. System Database Interface 13.3.17. Language Support 13.3.18. Large File Support 13.3.19. Standard Library 13.4. Data Definitions for libc 13.4.1. arpa/inet.h 13.4.2. assert.h 13.4.3. ctype.h 13.4.4. dirent.h 13.4.5. err.h 13.4.6. errno.h 13.4.7. fcntl.h 13.4.8. fmtmsg.h 13.4.9. fnmatch.h 13.4.10. ftw.h 13.4.11. getopt.h 13.4.12. glob.h 13.4.13. grp.h 13.4.14. iconv.h 13.4.15. inttypes.h 13.4.16. langinfo.h 13.4.17. libgen.h 13.4.18. libintl.h 13.4.19. limits.h 13.4.20. locale.h 13.4.21. monetary.h 13.4.22. net/if.h 13.4.23. netdb.h 13.4.24. netinet/in.h 13.4.25. netinet/ip.h 13.4.26. netinet/tcp.h 13.4.27. netinet/udp.h 13.4.28. nl_types.h 13.4.29. poll.h 13.4.30. pty.h 13.4.31. pwd.h 13.4.32. regex.h 13.4.33. rpc/auth.h 13.4.34. rpc/clnt.h 13.4.35. rpc/pmap_clnt.h 13.4.36. rpc/rpc_msg.h 13.4.37. rpc/svc.h 13.4.38. rpc/types.h 13.4.39. rpc/xdr.h 13.4.40. sched.h 13.4.41. search.h 13.4.42. setjmp.h 13.4.43. signal.h 13.4.44. spawn.h 13.4.45. stddef.h 13.4.46. stdint.h 13.4.47. stdio.h 13.4.48. stdlib.h 13.4.49. string.h 13.4.50. strings.h 13.4.51. sys/file.h 13.4.52. sys/ioctl.h 13.4.53. sys/ipc.h 13.4.54. sys/mman.h 13.4.55. sys/msg.h 13.4.56. sys/param.h 13.4.57. sys/poll.h 13.4.58. sys/resource.h 13.4.59. sys/select.h 13.4.60. sys/sem.h 13.4.61. sys/shm.h 13.4.62. sys/socket.h 13.4.63. sys/stat.h 13.4.64. sys/statfs.h 13.4.65. sys/statvfs.h 13.4.66. sys/time.h 13.4.67. sys/timeb.h 13.4.68. sys/times.h 13.4.69. sys/types.h 13.4.70. sys/uio.h 13.4.71. sys/un.h 13.4.72. sys/utsname.h 13.4.73. sys/wait.h 13.4.74. syslog.h 13.4.75. termios.h 13.4.76. time.h 13.4.77. ucontext.h 13.4.78. ulimit.h 13.4.79. unistd.h 13.4.80. utime.h 13.4.81. utmp.h 13.4.82. utmpx.h 13.4.83. wchar.h 13.4.84. wctype.h 13.4.85. wordexp.h 13.5. Interface Definitions for libc _IO_feof -- alias for feof _IO_getc -- alias for getc _IO_putc -- alias for putc _IO_puts -- alias for puts __assert_fail -- abort the program after false assertion __ctype_b_loc -- accessor function for __ctype_b array for ctype functions __ctype_get_mb_cur_max -- maximum length of a multibyte character in the current locale __ctype_tolower_loc -- accessor function for __ctype_b_tolower array for ctype tolower() function __ctype_toupper_loc -- accessor function for __ctype_b_toupper() array for ctype toupper() function __cxa_atexit -- register a function to be called by exit or when a shared library is unloaded __cxa_finalize -- call destructors of global (or local static) C++ objects and exit functions registered with atexit __daylight -- daylight savings time flag __environ -- alias for environ - user environment __errno_location -- address of errno variable __fpending -- returns in bytes the amount of output pending on a stream __getpagesize -- alias for getpagesize - get current page size __getpgid -- get the process group id __h_errno_location -- address of h_errno variable __isinf -- test for infinity __isinff -- test for infinity __isinfl -- test for infinity __isnan -- test for infinity __isnanf -- test for infinity __isnanl -- test for infinity __libc_current_sigrtmax -- return number of available real-time signal with lowest priority __libc_current_sigrtmin -- return number of available real-time signal with highest priority __libc_start_main -- initialization routine __lxstat -- inline wrapper around call to lxstat __mempcpy -- copy given number of bytes of source to destination __rawmemchr -- scan memory __register_atfork -- alias for register_atfork __sigsetjmp -- save stack context for non-local goto __stpcpy -- alias for stpcpy __strdup -- alias for strdup __strtod_internal -- underlying function for strtod __strtof_internal -- underlying function for strtof __strtok_r -- alias for strtok_r __strtol_internal -- alias for strtol __strtold_internal -- underlying function for strtold __strtoll_internal -- underlying function for strtoll __strtoul_internal -- underlying function for strtoul __strtoull_internal -- underlying function for strtoull __sysconf -- get configuration information at runtime __sysv_signal -- signal handling __timezone -- global variable containing timezone __tzname -- global variable containing the timezone __wcstod_internal -- underlying function for wcstod __wcstof_internal -- underlying function for wcstof __wcstol_internal -- underlying function for wcstol __wcstold_internal -- underlying function for wcstold __wcstoul_internal -- underlying function for wcstoul __xmknod -- make block or character special file __xpg_basename -- return the last component of a file name __xpg_sigpause -- remove a signal from the signal mask and suspend the thread __xpg_strerror_r -- return string describing error number __xstat -- get File Status __xstat64 -- get File Status _environ -- alias for environ - user environment _nl_msg_cat_cntr -- new catalog load counter _sys_errlist -- array containing the "C" locale strings used by strerror() _sys_siglist -- array containing the names of the signal names acct -- switch process accounting on or off adjtime -- correct the time to allow synchronization of the system clock asprintf -- write formatted output to a dynamically allocated string basename -- return the last component of a file name bind_textdomain_codeset -- specify encoding for message retrieval bindresvport -- bind socket to privileged IP port bindtextdomain -- specify the location of a message catalog cfmakeraw -- get and set terminal attributes cfsetspeed -- set terminal input and output data rate daemon -- run in the background dcgettext -- perform domain and category specific lookup in message catalog dcngettext -- perform domain and category specific lookup in message catalog with plural dgettext -- perform lookup in message catalog for the current LC_MESSAGES locale dngettext -- perform lookup in message catalog for the current locale duplocale -- provide new handle for selection of locale endutent -- access utmp file entries err -- display formatted error messages error -- print error message errx -- display formatted error message and exit fcntl -- file control fflush_unlocked -- non thread safe fflush fgetwc_unlocked -- non thread safe fgetwc flock -- apply or remove an advisory lock on an open file freelocale -- free a locale object fscanf -- convert formatted input fstatfs -- (deprecated) fstatfs64 -- (deprecated) fwscanf -- convert formatted input getdomainname -- get NIS domain name (DEPRECATED). getdtablesize -- get file descriptor table size (DEPRECATED) getgrouplist -- get groups a user belongs to gethostbyaddr_r -- find network host database entry matching host name (DEPRECATED) gethostbyname2 -- find network host database entry matching host name (DEPRECATED) gethostbyname2_r -- find network host database entry matching host name (DEPRECATED) gethostbyname_r -- find network host database entry matching host name (DEPRECATED) getloadavg -- get system load averages getopt -- parse command line options getopt_long -- parse command line options getopt_long_only -- parse command line options getpagesize -- get memory page size (DEPRECATED) getsockopt -- get socket options gettext -- search message catalogs for a string getutent -- access user accounting database entries getutent_r -- access user accounting database entries glob64 -- find pathnames matching a pattern (Large File Support) globfree64 -- free memory from glob64() (Large File Support) inet_aton -- Internet address manipulation routine initgroups -- initialize the supplementary group access list ioctl -- control device sockio -- socket ioctl commands ttyio -- tty ioctl commands kill -- send a signal link -- create a link to a file mbsnrtowcs -- convert a multibyte string to a wide character string memmem -- locate bytes memrchr -- scan memory for a character mremap -- remap a virtual memory address newlocale -- allocate a locale object ngettext -- search message catalogs for plural string pmap_getport -- find the port number assigned to a service registered with a portmapper. pmap_set -- establishes mapping to machine's RPC Bind service. pmap_unset -- destroys RPC Binding posix_fadvise64 -- File advisory information (Large File Support) posix_fallocate64 -- file space control (Large File Support) psignal -- print signal message readdir64_r -- read a directory (Large File Support) regexec -- regular expression matching scanf -- convert formatted input sched_setscheduler -- set scheduling policy and parameters setbuffer -- stream buffering operation setgroups -- set list of supplementary group IDs sethostname -- set host name setsockopt -- set socket options setutent -- access user accounting database entries sigandset -- build a new signal set by combining the two input sets using logical AND sigisemptyset -- check for empty signal set sigorset -- build a new signal set by combining the two input sets using logical OR sigpause -- remove a signal from the signal mask and suspend the thread (deprecated) sigreturn -- return from signal handler and cleanup stack frame sscanf -- convert formatted input statfs -- (deprecated) statfs64 -- (deprecated) stime -- set time stpcpy -- copy a string returning a pointer to its end stpncpy -- copy a fixed-size string, returning a pointer to its end strcasestr -- locate a substring ignoring case strerror_r -- return string describing error number strndup -- return a malloc'd copy of at most the specified number of bytes of a string strnlen -- determine the length of a fixed-size string strptime -- parse a time string strsep -- extract token from string strsignal -- return string describing signal strtoq -- convert string value to a long or quad_t integer strtouq -- convert a string to an unsigned long long svc_register -- register Remote Procedure Call interface svc_run -- waits for RPC requests to arrive and calls service procedure svc_sendreply -- called by RPC service's dispatch routine svctcp_create -- create a TCP/IP-based RPC service transport svcudp_create -- create a UDP-based RPC service transport swscanf -- convert formatted input sysconf -- Get configuration information at runtime system -- execute a shell command textdomain -- set the current default message domain unlink -- remove a directory entry uselocale -- set locale for thread utmpname -- set user accounting database vasprintf -- write formatted output to a dynamically allocated string vdprintf -- write formatted output to a file descriptor verrx -- display formatted error message and exit vfscanf -- convert formatted input vfwscanf -- convert formatted input vscanf -- convert formatted input vsscanf -- convert formatted input vswscanf -- convert formatted input vsyslog -- log to system log vwscanf -- convert formatted input wait4 -- wait for process termination, BSD style waitpid -- wait for child process warn -- formatted error messages warnx -- formatted error messages wcpcpy -- copy a wide character string, returning a pointer to its end wcpncpy -- copy a fixed-size string of wide characters, returning a pointer to its end wcscasecmp -- compare two wide-character strings, ignoring case wcsdup -- duplicate a wide-character string wcsncasecmp -- compare two fixed-size wide-character strings, ignoring case wcsnlen -- determine the length of a fixed-size wide-character string wcsnrtombs -- convert a wide character string to a multi-byte string wcstoq -- convert wide string to long long int representation wcstouq -- convert wide string to unsigned long long int representation wscanf -- convert formatted input xdr_u_int -- library routines for external data representation xdrstdio_create -- library routines for external data representation 13.6. Interfaces for libm 13.6.1. Math 13.7. Data Definitions for libm 13.7.1. complex.h 13.7.2. fenv.h 13.7.3. math.h 13.8. Interface Definitions for libm __finite -- test for infinity __finitef -- test for infinity __finitel -- test for infinity __fpclassify -- Classify real floating type __fpclassifyf -- Classify real floating type __signbit -- test sign of floating point value __signbitf -- test sign of floating point value clog10 -- Logarithm of a Complex Number clog10f -- Logarithm of a Complex Number clog10l -- Logarithm of a Complex Number drem -- Floating Point Remainder (DEPRECATED) dremf -- Floating Point Remainder (DEPRECATED) dreml -- Floating Point Remainder (DEPRECATED) exp10 -- Base-10 power function exp10f -- Base-10 power function exp10l -- Base-10 power function fedisableexcept -- disable floating point exceptions feenableexcept -- enable floating point exceptions fegetexcept -- query floating point exception handling state finite -- test for infinity (DEPRECATED) finitef -- test for infinity (DEPRECATED) finitel -- test for infinity (DEPRECATED) gamma -- log gamma function (DEPRECATED) gammaf -- log gamma function (DEPRECATED) gammal -- log gamma function (DEPRECATED) j0f -- Bessel functions j0l -- Bessel functions j1f -- Bessel functions j1l -- Bessel functions jnf -- Bessel functions jnl -- Bessel functions lgamma_r -- log gamma functions lgammaf_r -- log gamma functions lgammal_r -- log gamma functions pow10 -- Base-10 power function pow10f -- Base-10 power function pow10l -- Base-10 power function significand -- floating point mantissa significandf -- floating point mantissa significandl -- floating point mantissa sincos -- trigonometric functions sincosf -- trigonometric functions sincosl -- trigonometric functions y0f -- Bessel functions y0l -- Bessel functions y1f -- Bessel functions y1l -- Bessel functions ynf -- Bessel functions ynl -- Bessel functions 13.9. Interfaces for libpthread 13.9.1. Realtime Threads 13.9.2. Advanced Realtime Threads 13.9.3. Posix Threads 13.9.4. Thread aware versions of libc interfaces 13.10. Data Definitions for libpthread 13.10.1. pthread.h 13.10.2. semaphore.h 13.11. Interface Definitions for libpthread _pthread_cleanup_pop -- establish cancellation handlers _pthread_cleanup_push -- establish cancellation handlers 13.12. Interfaces for libgcc_s 13.12.1. Unwind Library 13.13. Data Definitions for libgcc_s 13.13.1. unwind.h 13.14. Interfaces for libdl 13.14.1. Dynamic Loader 13.15. Data Definitions for libdl 13.15.1. dlfcn.h 13.16. Interface Definitions for libdl dladdr -- find the shared object containing a given address dlopen -- open dynamic object dlsym -- obtain the address of a symbol from a dlopen object 13.17. Interfaces for librt 13.17.1. Shared Memory Objects 13.17.2. Clock 13.17.3. Timers 13.17.4. Message Queues 13.18. Data Definitions for librt 13.18.1. mqueue.h 13.19. Interfaces for libcrypt 13.19.1. Encryption 13.20. Interfaces for libpam 13.20.1. Pluggable Authentication API 13.21. Data Definitions for libpam 13.21.1. security/pam_appl.h 13.22. Interface Definitions for libpam pam_acct_mgmt -- establish the status of a user's account pam_authenticate -- authenticate the user pam_chauthtok -- change the authentication token for a given user pam_close_session -- indicate that an authenticated session has ended pam_end -- terminate the use of the PAM library pam_fail_delay -- specify delay time to use on authentication error pam_get_item -- obtain the value of the indicated item. pam_getenv -- get a PAM environment variable pam_getenvlist -- returns a pointer to the complete PAM environment. pam_open_session -- indicate session has started pam_putenv -- Add, replace or delete a PAM environment variable pam_set_item -- (re)set the value of an item. pam_setcred -- set the module-specific credentials of the user pam_start -- initialize the PAM library pam_strerror -- returns a string describing the PAM error __________________________________________________________ Chapter 13. Base Libraries 13.1. Introduction 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. __________________________________________________________ 13.2. Program Interpreter The Program Interpreter is specified in the appropriate architecture specific part of ISO/IEC 23360. __________________________________________________________ 13.3. Interfaces for libc Table 13-1 defines the library name and shared object name for the libc library Table 13-1. libc Definition Library: libc SONAME: See archLSB. 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 __________________________________________________________ 13.3.1. RPC __________________________________________________________ 13.3.1.1. Interfaces for RPC 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] xdrstdio_create [LSB] __________________________________________________________ 13.3.2. System Calls __________________________________________________________ 13.3.2.1. Interfaces for System Calls 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] fstatfs [LSB] fstatvfs [SUSv3] fsync [SUSv3] ftime [SUSv3] ftruncate [SUSv3] getcontext [SUSv3] getdtablesize [LSB] getegid [SUSv3] geteuid [SUSv3] getgid [SUSv3] getgroups [SUSv3] getitimer [SUSv3] getloadavg [LSB] getpagesize [LSB] 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] mremap [LSB] msync [SUSv3] munlock [SUSv3] munlockall [SUSv3] munmap [SUSv3] nanosleep [SUSv3] nice [SUSv3] open [SUSv3] opendir [SUSv3] pathconf [SUSv3] pause [SUSv3] pipe [SUSv3] poll [SUSv3] pselect [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 [LSB] 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] statfs [LSB] statvfs [SUSv3] stime [LSB] symlink [SUSv3] sync [SUSv3] sysconf [LSB] time [SUSv3] times [SUSv3] truncate [SUSv3] ulimit [SUSv3] umask [SUSv3] uname [SUSv3] unlink [LSB] utime [SUSv3] utimes [SUSv3] vfork [SUSv3] wait [SUSv3] wait4 [LSB] waitid [SUSv3] waitpid [LSB] write [SUSv3] writev [SUSv3] An LSB conforming implementation shall provide the generic deprecated functions for System Calls specified in Table 13-4, with the full mandatory functionality as described in the referenced underlying specification. Note: These interfaces are deprecated, and applications should avoid using them. These interfaces may be withdrawn in future releases of this specification. Table 13-4. libc - System Calls Deprecated Function Interfaces fstatfs [LSB] getdtablesize [LSB] getpagesize [LSB] getwd [SUSv3] statfs [LSB] __________________________________________________________ 13.3.3. Standard I/O __________________________________________________________ 13.3.3.1. Interfaces for Standard I/O An LSB conforming implementation shall provide the generic functions for Standard I/O specified in Table 13-5, with the full mandatory functionality as described in the referenced underlying specification. Table 13-5. 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-6, with the full mandatory functionality as described in the referenced underlying specification. Table 13-6. libc - Standard I/O Data Interfaces stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] __________________________________________________________ 13.3.4. Signal Handling __________________________________________________________ 13.3.4.1. Interfaces for Signal Handling An LSB conforming implementation shall provide the generic functions for Signal Handling specified in Table 13-7, with the full mandatory functionality as described in the referenced underlying specification. Table 13-7. libc - Signal Handling Function Interfaces __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] __sigsetjmp [LSB] __sysv_signal [LSB] __xpg_sigpause [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 [LSB] 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 deprecated functions for Signal Handling specified in Table 13-8, with the full mandatory functionality as described in the referenced underlying specification. Note: These interfaces are deprecated, and applications should avoid using them. These interfaces may be withdrawn in future releases of this specification. Table 13-8. libc - Signal Handling Deprecated Function Interfaces sigpause [LSB] An LSB conforming implementation shall provide the generic data interfaces for Signal Handling specified in Table 13-9, with the full mandatory functionality as described in the referenced underlying specification. Table 13-9. libc - Signal Handling Data Interfaces _sys_siglist [LSB] __________________________________________________________ 13.3.5. Localization Functions __________________________________________________________ 13.3.5.1. Interfaces for Localization Functions An LSB conforming implementation shall provide the generic functions for Localization Functions specified in Table 13-10, with the full mandatory functionality as described in the referenced underlying specification. Table 13-10. 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-11, with the full mandatory functionality as described in the referenced underlying specification. Table 13-11. libc - Localization Functions Data Interfaces _nl_msg_cat_cntr [LSB] __________________________________________________________ 13.3.6. Posix Spawn Option __________________________________________________________ 13.3.6.1. Interfaces for Posix Spawn Option An LSB conforming implementation shall provide the generic functions for Posix Spawn Option specified in Table 13-12, with the full mandatory functionality as described in the referenced underlying specification. Table 13-12. libc - Posix Spawn Option Function Interfaces posix_spawn [SUSv3] posix_spawn_file_actions_addclose [SUSv3] posix_spawn_file_actions_adddup2 [SUSv3] posix_spawn_file_actions_addopen [SUSv3] posix_spawn_file_actions_destroy [SUSv3] posix_spawn_file_actions_init [SUSv3] posix_spawnattr_destroy [SUSv3] posix_spawnattr_getflags [SUSv3] posix_spawnattr_getpgroup [SUSv3] posix_spawnattr_getschedparam [SUSv3] posix_spawnattr_getschedpolicy [SUSv3] posix_spawnattr_getsigdefault [SUSv3] posix_spawnattr_getsigmask [SUSv3] posix_spawnattr_init [SUSv3] posix_spawnattr_setflags [SUSv3] posix_spawnattr_setpgroup [SUSv3] posix_spawnattr_setschedparam [SUSv3] posix_spawnattr_setschedpolicy [SUSv3] posix_spawnattr_setsigdefault [SUSv3] posix_spawnattr_setsigmask [SUSv3] posix_spawnp [SUSv3] __________________________________________________________ 13.3.7. Posix Advisory Option __________________________________________________________ 13.3.7.1. Interfaces for Posix Advisory Option An LSB conforming implementation shall provide the generic functions for Posix Advisory Option specified in Table 13-13, with the full mandatory functionality as described in the referenced underlying specification. Table 13-13. libc - Posix Advisory Option Function Interfaces posix_fadvise [SUSv3] posix_fallocate [SUSv3] posix_madvise [SUSv3] posix_memalign [SUSv3] __________________________________________________________ 13.3.8. Socket Interface __________________________________________________________ 13.3.8.1. Interfaces for Socket Interface An LSB conforming implementation shall provide the generic functions for Socket Interface specified in Table 13-14, with the full mandatory functionality as described in the referenced underlying specification. Table 13-14. 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 data interfaces for Socket Interface specified in Table 13-15, with the full mandatory functionality as described in the referenced underlying specification. Table 13-15. libc - Socket Interface Data Interfaces in6addr_any [SUSv3] in6addr_loopback [SUSv3] __________________________________________________________ 13.3.9. Wide Characters __________________________________________________________ 13.3.9.1. Interfaces for Wide Characters An LSB conforming implementation shall provide the generic functions for Wide Characters specified in Table 13-16, with the full mandatory functionality as described in the referenced underlying specification. Table 13-16. 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] __________________________________________________________ 13.3.10. String Functions __________________________________________________________ 13.3.10.1. Interfaces for String Functions An LSB conforming implementation shall provide the generic functions for String Functions specifi