1 2 Linux Standard Base Core Specification 3.0Preview1 3 4 Copyright © 2004 Free Standards Group 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation 8 License, Version 1.1; with no Invariant Sections, with no 9 Front-Cover Texts, and with no Back-Cover Texts. A copy of the 10 license is included in the section entitled "GNU Free 11 Documentation License". 12 13 Portions of the text are copyrighted by the following parties: 14 15 * The Regents of the University of California 16 * Free Software Foundation 17 * Ian F. Darwin 18 * Paul Vixie 19 * BSDI (now Wind River) 20 * Andrew G Morgan 21 * Jean-loup Gailly and Mark Adler 22 * Massachusetts Institute of Technology 23 24 These excerpts are being used in accordance with their 25 respective licenses. 26 27 Linux is a trademark of Linus Torvalds. 28 29 UNIX a registered trademark of the Open Group in the United 30 States and other countries. 31 32 LSB is a trademark of the Free Standards Group in the USA and 33 other countries. 34 35 AMD is a trademark of Advanced Micro Devices, Inc. 36 37 Intel and Itanium are registered trademarks and Intel386 is a 38 trademarks of Intel Corporation. 39 40 OpenGL is a registered trademark of Silicon Graphics, Inc. 41 42 Table of Contents 43 Specification Introduction 44 ELF Specification 45 Linux Standard Base Specification 46 Linux Packaging Specification 47 Free Documentation License 48 49 Specification Introduction 50 _________________________________________________________ 51 52 Table of Contents 53 Foreword 54 Introduction 55 I. Introductory Elements 56 57 1. Scope 58 59 1.1. General 60 1.2. Module Specific Scope 61 62 2. Normative References 63 3. Requirements 64 65 3.1. Relevant Libraries 66 3.2. LSB Implementation Conformance 67 3.3. LSB Application Conformance 68 69 4. Definitions 70 5. Terminology 71 6. Documentation Conventions 72 7. Relationship To ISO/IEC 9945 POSIX 73 74 List of Tables 75 2-1. Normative References 76 3-1. Standard Library Names 77 3-2. Standard Library Names defined in the Architecture 78 Specific Supplement 79 _________________________________________________________ 80 81 Foreword 82 83 This is version 3.0Preview1 of the Linux Standard Base Core 84 Specification. An implementation of this version of the 85 specification may not claim to be an implementation of the 86 Linux Standard Base unless it has successfully completed the 87 compliance process as defined by the Free Standards Group. 88 _________________________________________________________ 89 90 Introduction 91 92 The LSB defines a binary interface for application programs 93 that are compiled and packaged for LSB-conforming 94 implementations on many different hardware architectures. 95 Since a binary specification shall include information 96 specific to the computer processor architecture for which it 97 is intended, it is not possible for a single document to 98 specify the interface for all possible LSB-conforming 99 implementations. Therefore, the LSB is a family of 100 specifications, rather than a single one. 101 102 This document should be used in conjunction with the documents 103 it references. This document enumerates the system components 104 it includes, but descriptions of those components may be 105 included entirely or partly in this document, partly in other 106 documents, or entirely in other reference documents. For 107 example, the section that describes system service routines 108 includes a list of the system routines supported in this 109 interface, formal declarations of the data structures they use 110 that are visible to applications, and a pointer to the 111 underlying referenced specification for information about the 112 syntax and semantics of each call. Only those routines not 113 described in standards referenced by this document, or 114 extensions to those standards, are described in the detail. 115 Information referenced in this way is as much a part of this 116 document as is the information explicitly included here. 117 118 The specification carries a version number of either the form 119 x.y or x.y.z. This version number carries the following 120 meaning: 121 122 * The first number (x) is the major version number. All 123 versions with the same major version number should share 124 binary compatibility. Any addition or deletion of a new 125 library results in a new version number. Interfaces marked 126 as deprecated may be removed from the specification at a 127 major version change. 128 * The second number (y) is the minor version number. 129 Individual interfaces may be added if all certified 130 implementations already had that (previously undocumented) 131 interface. Interfaces may be marked as deprecated at a 132 minor version change. Other minor changes may be permitted 133 at the discretion of the LSB workgroup. 134 * The third number (z), if present, is the editorial level. 135 Only editorial changes should be included in such 136 versions. 137 138 I. Introductory Elements 139 140 Table of Contents 141 1. Scope 142 2. Normative References 143 3. Requirements 144 4. Definitions 145 5. Terminology 146 6. Documentation Conventions 147 7. Relationship To ISO/IEC 9945 POSIX 148 _________________________________________________________ 149 150 Chapter 1. Scope 151 152 1.1. General 153 154 The Linux Standard Base (LSB) defines a system interface for 155 compiled applications and a minimal environment for support of 156 installation scripts. Its purpose is to enable a uniform 157 industry standard environment for high-volume applications 158 conforming to the LSB. 159 160 These specifications are composed of two basic parts: A common 161 specification ("LSB-generic") describing those parts of the 162 interface that remain constant across all implementations of 163 the LSB, and an architecture-specific specification 164 ("LSB-arch") describing the parts of the interface that vary 165 by processor architecture. Together, the LSB-generic and the 166 architecture-specific supplement for a single hardware 167 architecture provide a complete interface specification for 168 compiled application programs on systems that share a common 169 hardware architecture. 170 171 The LSB-generic document shall be used in conjunction with an 172 architecture-specific supplement. Whenever a section of the 173 LSB-generic specification shall be supplemented by 174 architecture-specific information, the LSB-generic document 175 includes a reference to the architecture supplement. 176 Architecture supplements may also contain additional 177 information that is not referenced in the LSB-generic 178 document. 179 180 The LSB contains both a set of Application Program Interfaces 181 (APIs) and Application Binary Interfaces (ABIs). APIs may 182 appear in the source code of portable applications, while the 183 compiled binary of that application may use the larger set of 184 ABIs. A conforming implementation shall provide all of the 185 ABIs listed here. The compilation system may replace (e.g. by 186 macro definition) certain APIs with calls to one or more of 187 the underlying binary interfaces, and may insert calls to 188 binary interfaces as needed. 189 190 The LSB is primarily a binary interface definition. Not all of 191 the source level APIs available to applications may be 192 contained in this specification. 193 _________________________________________________________ 194 195 1.2. Module Specific Scope 196 197 This is the Core module of the Linux Standards Base (LSB). 198 This module provides the fundamental system interfaces, 199 libraries, and runtime environment upon which all conforming 200 applications and libraries depend. 201 202 Interfaces described in this module are mandatory except where 203 explicitly listed otherwise. Core interfaces may be 204 supplemented by other modules; all modules are built upon the 205 core. 206 _________________________________________________________ 207 208 Chapter 2. Normative References 209 210 The specifications listed below are referenced in whole or in 211 part by the Linux Standard Base. In this specification, where 212 only a particular section of one of these references is 213 identified, then the normative reference is to that section 214 alone, and the rest of the referenced document is informative. 215 216 Table 2-1. Normative References 217 Name Title URL 218 DWARF Debugging Information Format DWARF Debugging Information 219 Format, Revision 2.0.0 (July 27, 1993) 220 http://www.eagercon.com/dwarf/dwarf-2.0.0.pdf 221 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 222 (FHS) 2.3 http://www.pathname.com/fhs/ 223 Gdk 2.6.2 Reference Manual Gdk 2.6.2 Reference Manual 224 http://www.gtk.org/api/2.6/gdk/index.html 225 Gdk-pixbuf 2.6.2 Reference Manual Gdk-pixbuf 2.6.2 Reference 226 Manual http://www.gtk.org/api/2.6/gdk-pixbuf/index.html 227 Glib 2.6.2 Reference Manual Glib 2.6.2 Reference Manual 228 http://www.gtk.org/api/2.6/glib/index.html 229 Gobject 2.6.2 Reference Manual Gobject 2.6.2 Reference Manual 230 http://www.gtk.org/api/2.6/gobject/index.html 231 Gtk 2.6.2 Reference Manual Gtk 2.6.2 Reference Manual 232 http://www.gtk.org/api/2.6/gtk/index.html 233 IEEE Std 754-1985 IEEE Standard 754 for Binary Floating-Point 234 Arithmetic http://www.ieee.org/ 235 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 236 ISO POSIX (2003) 237 238 ISO/IEC 9945-1:2003 Information technology -- Portable 239 Operating System Interface (POSIX) -- Part 1: Base Definitions 240 241 ISO/IEC 9945-2:2003 Information technology -- Portable 242 Operating System Interface (POSIX) -- Part 2: System 243 Interfaces 244 245 ISO/IEC 9945-3:2003 Information technology -- Portable 246 Operating System Interface (POSIX) -- Part 3: Shell and 247 Utilities 248 249 ISO/IEC 9945-4:2003 Information technology -- Portable 250 Operating System Interface (POSIX) -- Part 4: Rationale 251 252 Including Technical Cor. 1: 2004 253 http://www.unix.org/version3/ 254 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 255 Specification method for cultural conventions 256 ITU-T V.42 International Telecommunication Union 257 Recommendation V.42 (2002): Error-correcting procedures for 258 DCEs using asynchronous-to-synchronous conversionITUV 259 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 260 parent=T-REC-V.42 261 Large File Support Large File Support 262 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 263 Li18nux Globalization Specification LI18NUX 2000 Globalization 264 Specification, Version 1.0 with Amendment 4 265 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 266 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 267 http://www.lanana.org/docs/device-list/devices.txt 268 PAM Open Software Foundation, Request For Comments: 86.0 , 269 October 1995, V. Samar & R.Schemers (SunSoft) 270 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 271 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 272 MD5 Message-Digest Algorithm 273 http://www.ietf.org/rfc/rfc1321.txt 274 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 275 1833: Binding Protocols for ONC RPC Version 2 276 http://www.ietf.org/rfc/rfc1833.txt 277 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 278 1950: ZLIB Compressed Data Format Specification 279 http://www.ietf.org/rfc/rfc1950.txt 280 RFC 1951: DEFLATE Compressed Data Format Specification IETF 281 RFC 1951: DEFLATE Compressed Data Format Specification version 282 1.3 http://www.ietf.org/rfc/rfc1951.txt 283 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 284 file format specification version 4.3 285 http://www.ietf.org/rfc/rfc1952.txt 286 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 287 Message Format http://www.ietf.org/rfc/rfc2440.txt 288 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 289 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 290 RFC 2822:Internet Message Format IETF RFC 2822: Internet 291 Message Format http://www.ietf.org/rfc/rfc2822.txt 292 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 293 Specification http://www.ietf.org/rfc/rfc791.txt 294 SUSv2 CAE Specification, January 1997, System Interfaces and 295 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 296 http://www.opengroup.org/publications/catalog/un.htm 297 SUSv2 Commands and Utilities The Single UNIX® 298 Specification(SUS) Version 2, Commands and Utilities (XCU), 299 Issue 5 (ISBN: 1-85912-191-8, C604) 300 http://www.opengroup.org/publications/catalog/un.htm 301 SVID Issue 3 American Telephone and Telegraph Company, System 302 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 303 1989.(ISBN 0201566524) 304 SVID Issue 4 System V Interface Definition,Fourth Edition 305 System V ABI System V Application Binary Interface, Edition 306 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 307 System V ABI Update System V Application Binary Interface - 308 DRAFT - 17 December 2003 309 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 310 l 311 this specification Linux Standard Base 312 http://www.linuxbase.org/spec/ 313 X/Open Curses CAE Specification, May 1996, X/Open Curses, 314 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 315 Corrigendum U018 316 http://www.opengroup.org/publications/catalog/un.htm 317 _________________________________________________________ 318 319 Chapter 3. Requirements 320 321 3.1. Relevant Libraries 322 323 The libraries listed in Table 3-1 shall be available on a 324 Linux Standard Base system, with the specified runtime names. 325 The libraries listed in Table 3-2 are architecture specific, 326 but shall be available on all LSB conforming systems. This 327 list may be supplemented or amended by the 328 architecture-specific specification. 329 330 Table 3-1. Standard Library Names 331 Library Runtime Name 332 libdl libdl.so.2 333 libcrypt libcrypt.so.1 334 libz libz.so.1 335 libncurses libncurses.so.5 336 libutil libutil.so.1 337 libpthread libpthread.so.0 338 libpam libpam.so.0 339 libgcc_s libgcc_s.so.1 340 341 Table 3-2. Standard Library Names defined in the Architecture 342 Specific Supplement 343 Library Runtime Name 344 libm See archLSB 345 libc See archLSB 346 proginterp See archLSB 347 348 These libraries will be in an implementation-defined directory 349 which the dynamic linker shall search by default. 350 _________________________________________________________ 351 352 3.2. LSB Implementation Conformance 353 354 A conforming implementation shall satisfy the following 355 requirements: 356 357 * The implementation shall implement fully the architecture 358 described in the hardware manual for the target processor 359 architecture. 360 * The implementation shall be capable of executing compiled 361 applications having the format and using the system 362 interfaces described in this document. 363 * The implementation shall provide libraries containing the 364 interfaces specified by this document, and shall provide a 365 dynamic linking mechanism that allows these interfaces to 366 be attached to applications at runtime. All the interfaces 367 shall behave as specified in this document. 368 * The map of virtual memory provided by the implementation 369 shall conform to the requirements of this document. 370 * The implementation's low-level behavior with respect to 371 function call linkage, system traps, signals, and other 372 such activities shall conform to the formats described in 373 this document. 374 * The implementation shall provide all of the mandatory 375 interfaces in their entirety. 376 * The implementation may provide one or more of the optional 377 interfaces. Each optional interface that is provided shall 378 be provided in its entirety. The product documentation 379 shall state which optional interfaces are provided. 380 * The implementation shall provide all files and utilities 381 specified as part of this document in the format defined 382 here and in other referenced documents. All commands and 383 utilities shall behave as required by this document. The 384 implementation shall also provide all mandatory components 385 of an application's runtime environment that are included 386 or referenced in this document. 387 * The implementation, when provided with standard data 388 formats and values at a named interface, shall provide the 389 behavior defined for those values and data formats at that 390 interface. However, a conforming implementation may 391 consist of components which are separately packaged and/or 392 sold. For example, a vendor of a conforming implementation 393 might sell the hardware, operating system, and windowing 394 system as separately packaged items. 395 * The implementation may provide additional interfaces with 396 different names. It may also provide additional behavior 397 corresponding to data values outside the standard ranges, 398 for standard named interfaces. 399 _________________________________________________________ 400 401 3.3. LSB Application Conformance 402 403 A conforming application shall satisfy the following 404 requirements: 405 406 * Its executable files are either shell scripts or object 407 files in the format defined for the Object File Format 408 system interface. 409 * Its object files participate in dynamic linking as defined 410 in the Program Loading and Linking System interface. 411 * It employs only the instructions, traps, and other 412 low-level facilities defined in the Low-Level System 413 interface as being for use by applications. 414 * If it requires any optional interface defined in this 415 document in order to be installed or to execute 416 successfully, the requirement for that optional interface 417 is stated in the application's documentation. 418 * It does not use any interface or data format that is not 419 required to be provided by a conforming implementation, 420 unless: 421 + If such an interface or data format is supplied by 422 another application through direct invocation of that 423 application during execution, that application is in 424 turn an LSB conforming application. 425 + The use of that interface or data format, as well as 426 its source, is identified in the documentation of the 427 application. 428 * It shall not use any values for a named interface that are 429 reserved for vendor extensions. 430 431 A strictly conforming application does not require or use any 432 interface, facility, or implementation-defined extension that 433 is not defined in this document in order to be installed or to 434 execute successfully. 435 _________________________________________________________ 436 437 Chapter 4. Definitions 438 439 For the purposes of this document, the following definitions, 440 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 441 Edition, apply: 442 443 can 444 be able to; there is a possibility of; it is possible 445 to 446 447 cannot 448 be unable to; there is no possibilty of; it is not 449 possible to 450 451 may 452 is permitted; is allowed; is permissible 453 454 need not 455 it is not required that; no...is required 456 457 shall 458 is to; is required to; it is required that; has to; 459 only...is permitted; it is necessary 460 461 shall not 462 is not allowed [permitted] [acceptable] [permissible]; 463 is required to be not; is required that...be not; is 464 not to be 465 466 should 467 it is recommended that; ought to 468 469 should not 470 it is not recommended that; ought not to 471 _________________________________________________________ 472 473 Chapter 5. Terminology 474 475 For the purposes of this document, the following terms apply: 476 477 archLSB 478 The architectural part of the LSB Specification which 479 describes the specific parts of the interface that are 480 platform specific. The archLSB is complementary to the 481 gLSB. 482 483 Binary Standard 484 The total set of interfaces that are available to be 485 used in the compiled binary code of a conforming 486 application. 487 488 gLSB 489 The common part of the LSB Specification that describes 490 those parts of the interface that remain constant 491 across all hardware implementations of the LSB. 492 493 implementation-defined 494 Describes a value or behavior that is not defined by 495 this document but is selected by an implementor. The 496 value or behavior may vary among implementations that 497 conform to this document. An application should not 498 rely on the existence of the value or behavior. An 499 application that relies on such a value or behavior 500 cannot be assured to be portable across conforming 501 implementations. The implementor shall document such a 502 value or behavior so that it can be used correctly by 503 an application. 504 505 Shell Script 506 A file that is read by an interpreter (e.g., awk). The 507 first line of the shell script includes a reference to 508 its interpreter binary. 509 510 Source Standard 511 The set of interfaces that are available to be used in 512 the source code of a conforming application. 513 514 undefined 515 Describes the nature of a value or behavior not defined 516 by this document which results from use of an invalid 517 program construct or invalid data input. The value or 518 behavior may vary among implementations that conform to 519 this document. An application should not rely on the 520 existence or validity of the value or behavior. An 521 application that relies on any particular value or 522 behavior cannot be assured to be portable across 523 conforming implementations. 524 525 unspecified 526 Describes the nature of a value or behavior not 527 specified by this document which results from use of a 528 valid program construct or valid data input. The value 529 or behavior may vary among implementations that conform 530 to this document. An application should not rely on the 531 existence or validity of the value or behavior. An 532 application that relies on any particular value or 533 behavior cannot be assured to be portable across 534 conforming implementations. 535 536 Other terms and definitions used in this document shall have 537 the same meaning as defined in Chapter 3 of the Base 538 Definitions volume of ISO POSIX (2003). 539 _________________________________________________________ 540 541 Chapter 6. Documentation Conventions 542 543 Throughout this document, the following typographic 544 conventions are used: 545 546 function() 547 the name of a function 548 549 command 550 the name of a command or utility 551 552 CONSTANT 553 a constant value 554 555 parameter 556 a parameter 557 558 variable 559 a variable 560 561 Throughout this specification, several tables of interfaces 562 are presented. Each entry in these tables has the following 563 format: 564 565 name 566 the name of the interface 567 568 (symver) 569 An optional symbol version identifier, if required. 570 571 [refno] 572 A reference number indexing the table of referenced 573 specifications that follows this table. 574 575 For example, 576 577 forkpty(GLIBC_2.0) [1] 578 579 refers to the interface named forkpty() with symbol version 580 GLIBC_2.0 that is defined in the first of the listed 581 references below the table. 582 _________________________________________________________ 583 584 Chapter 7. Relationship To ISO/IEC 9945 POSIX 585 586 This specification includes many interfaces described in ISO 587 POSIX (2003). Unless otherwise specified, such interfaces 588 should behave exactly as described in that specification. Any 589 conflict between the requirements described here and the ISO 590 POSIX (2003) standard is unintentional, except as explicitly 591 noted otherwise. 592 593 Note: In addition to the differences noted inline in this 594 specification, PDTR 24715 has extracted the differences 595 between this specification and ISO POSIX (2003) into a 596 single place. It is the long term plan of the LSB to 597 converge with ISO/IEC 9945 POSIX. 598 599 The LSB Specification Authority is responsible for deciding 600 the meaning of conformance to normative referenced standards 601 in the LSB context. Problem Reports regarding underlying or 602 referenced standards in any other context will be referred to 603 the relevant maintenance body for that standard. 604 605 ELF Specification 606 _________________________________________________________ 607 608 Table of Contents 609 I. Low Level System Information 610 611 1. Operating System Interface 612 2. Machine Interface 613 614 2.1. Data Representation 615 616 II. Object Format 617 618 3. Object Files 619 4. Sections 620 621 4.1. Introduction 622 4.2. Sections Types 623 624 5. Special Sections 625 626 5.1. Special Sections 627 628 6. Symbol Mapping 629 630 6.1. Introduction 631 6.2. Symbol Mapping 632 633 7. DWARF Extensions 634 8. EH Frame 635 9. EH Frame Header 636 637 9.1. Introduction 638 9.2. DWARF Exception Header Encoding 639 640 10. Symbol Versioning 641 642 10.1. Introduction 643 10.2. Symbol Version Table 644 10.3. Version Definitions 645 10.4. Version Requirements 646 10.5. Startup Sequence 647 10.6. Symbol Resolution 648 649 11. ABI note tag 650 651 III. Dynamic Linking 652 653 12. Program Loading and Dynamic Linking 654 13. Program Header 655 14. Dynamic Entries 656 657 14.1. Introduction 658 14.2. Dynamic Entries 659 660 List of Figures 661 10-1. Version Definition Entries 662 10-2. Version Definition Auxiliary Entries 663 10-3. Version Needed Entries 664 10-4. Version Needed Auxiliary Entries 665 14-1. Dynamic Structure 666 667 List of Tables 668 2-1. Scalar Types 669 4-1. ELF Section Types 670 4-2. Additional Section Types 671 5-1. ELF Special Sections 672 5-2. Additional Special Sections 673 7-1. Additional DWARF Call Frame Instructions 674 9-1. .eh_frame_hdr Section Format 675 9-2. DWARF Exception Header value format 676 9-3. DWARF Exception Header application 677 13-1. Linux Segment Types 678 679 I. Low Level System Information 680 681 Table of Contents 682 1. Operating System Interface 683 2. Machine Interface 684 _________________________________________________________ 685 686 Chapter 1. Operating System Interface 687 688 LSB-conforming applications shall assume that stack, heap and 689 other allocated memory regions will be non-executable. The 690 application must take steps to make them executable if needed. 691 _________________________________________________________ 692 693 Chapter 2. Machine Interface 694 695 2.1. Data Representation 696 697 LSB-conforming applications shall use the data representation 698 as defined in the Arcitecture specific ELF documents. 699 _________________________________________________________ 700 701 2.1.1. Fundamental Types 702 703 In addition to the fundamental types specified in the 704 Architecture specific ELF documents, a 1 byte data type is 705 defined here. 706 707 Table 2-1. Scalar Types 708 Type C C++ sizeof Alignment (bytes) Architecture 709 Representation 710 Integral _Bool bool 1 1 byte 711 712 II. Object Format 713 714 Table of Contents 715 3. Object Files 716 4. Sections 717 5. Special Sections 718 6. Symbol Mapping 719 7. DWARF Extensions 720 8. EH Frame 721 9. EH Frame Header 722 10. Symbol Versioning 723 11. ABI note tag 724 _________________________________________________________ 725 726 Chapter 3. Object Files 727 728 LSB-conforming implementations shall support the object file 729 Executable and Linking Format (ELF), which is defined by the 730 following documents: 731 732 * System V ABI 733 * System V ABI Update 734 * this document 735 * an architecture-specific LSB specification 736 737 Conforming implementations may also support other unspecified 738 object file formats. 739 _________________________________________________________ 740 741 Chapter 4. Sections 742 743 4.1. Introduction 744 745 As described in System V ABI, an ELF object file contains a 746 number of sections. 747 _________________________________________________________ 748 749 4.2. Sections Types 750 751 The section header table is an array of Elf32_Shdr or 752 Elf64_Shdr structures as described in System V ABI. The 753 sh_type member shall be either a value from Table 4-1, drawn 754 from the System V ABI, or one of the additional values 755 specified in Table 4-2. 756 757 A section header's sh_type member specifies the sections's 758 semantics. 759 _________________________________________________________ 760 761 4.2.1. ELF Section Types 762 763 The following section types are defined in the System V ABI 764 and the System V ABI Update. 765 766 Table 4-1. ELF Section Types 767 Name Value Description 768 SHT_DYNAMIC 0x6 The section holds information for dynamic 769 linking. Currently, an object file shall have only one dynamic 770 section, but this restriction may be relaxed in the future. 771 See `Dynamic Section' in Chapter 5 for details. 772 SHT_DYNSYM 0xb This section holds a minimal set of symbols 773 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 774 an object file may have either a section of SHT_SYMTAB type or 775 a section of SHT_DYNSYM type, but not both. This restriction 776 may be relaxed in the future. 777 SHT_FINI_ARRAY 0xf This section contains an array of pointers 778 to termination functions, as described in `Initialization and 779 Termination Functions' in Chapter 5. Each pointer in the array 780 is taken as a parameterless procedure with a void return. 781 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 782 an object file shall have only one hash table, but this 783 restriction may be relaxed in the future. See `Hash Table' in 784 the Chapter 5 for details. 785 SHT_HIPROC 0x7fffffff Values in this inclusive range are 786 reserved for processor-specific semantics. 787 SHT_HIUSER 0xffffffff This value specifies the upper bound of 788 the range of indexes reserved for application programs. 789 Section types between SHT_LOUSER and SHT_HIUSER can be used by 790 the application, without conflicting with current or future 791 system-defined section types. 792 SHT_INIT_ARRAY 0xe This section contains an array of pointers 793 to initialization functions, as described in `Initialization 794 and Termination Functions' in Chapter 5. Each pointer in the 795 array is taken as a parameterless procedure with a void 796 return. 797 SHT_LOPROC 0x70000000 Values in this inclusive range are 798 reserved for processor-specific semantics. 799 SHT_LOUSER 0x80000000 This value specifies the lower bound of 800 the range of indexes reserved for application programs. 801 SHT_NOBITS 0x8 A section of this type occupies no space in the 802 file but otherwise resembles SHT_PROGBITS. Although this 803 section contains no bytes, the sh_offset member contains the 804 conceptual file offset. 805 SHT_NOTE 0x7 The section holds information that marks the file 806 in some way. See `Note Section' in Chapter 5 for details. 807 SHT_NULL 0x0 This value marks the section header as inactive; 808 it does not have an associated section. Other members of the 809 section header have undefined values. 810 SHT_PREINIT_ARRAY 0x10 This section contains an array of 811 pointers to functions that are invoked before all other 812 initialization functions, as described in `Initialization and 813 Termination Functions' in Chapter 5. Each pointer in the array 814 is taken as a parameterless proceure with a void return. 815 SHT_PROGBITS 0x1 The section holds information defined by the 816 program, whose format and meaning are determined solely by the 817 program. 818 SHT_REL 0x9 The section holds relocation entries without 819 explicit addends, such as type Elf32_Rel for the 32-bit class 820 of object files or type Elf64_Rel for the 64-bit class of 821 object files. An object file may have multiple relocation 822 sections. See "Relocation" 823 SHT_RELA 0x4 The section holds relocation entries with 824 explicit addends, such as type Elf32_Rela for the 32-bit class 825 of object files or type Elf64_Rela for the 64-bit class of 826 object files. An object file may have multiple relocation 827 sections. `Relocation' b 828 SHT_SHLIB 0xa This section type is reserved but has 829 unspecified semantics. 830 SHT_STRTAB 0x3 The section holds a string table. An object 831 file may have multiple string table sections. See `String 832 Table' below for details. 833 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 834 an object file may have either a section of SHT_SYMTAB type or 835 a section of SHT_DYNSYM type, but not both. This restriction 836 may be relaxed in the future. Typically, SHT_SYMTAB provides 837 symbols for link editing, though it may also be used for 838 dynamic linking. As a complete symbol table, it may contain 839 many symbols unnecessary for dynamic linking. 840 _________________________________________________________ 841 842 4.2.2. Additional Section Types 843 844 The following additional section types are defined here. 845 846 Table 4-2. Additional Section Types 847 Name Value Description 848 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 849 versions that are provided. 850 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 851 versions that are required. 852 SHT_GNU_versym 0x6fffffff This section contains the Symbol 853 Version Table. 854 _________________________________________________________ 855 856 Chapter 5. Special Sections 857 858 5.1. Special Sections 859 860 Various sections hold program and control information. 861 Sections in the lists below are used by the system and have 862 the indicated types and attributes. 863 _________________________________________________________ 864 865 5.1.1. ELF Special Sections 866 867 The following sections are defined in the System V ABI and the 868 System V ABI Update. 869 870 Table 5-1. ELF Special Sections 871 Name Type Attributes 872 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 873 .comment SHT_PROGBITS 0 874 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 875 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 876 .debug SHT_PROGBITS 0 877 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 878 .dynstr SHT_STRTAB SHF_ALLOC 879 .dynsym SHT_DYNSYM SHF_ALLOC 880 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 881 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 882 .hash SHT_HASH SHF_ALLOC 883 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 884 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 885 .interp SHT_PROGBITS SHF_ALLOC 886 .line SHT_PROGBITS 0 887 .note SHT_NOTE 0 888 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 889 .rodata SHT_PROGBITS SHF_ALLOC 890 .rodata1 SHT_PROGBITS SHF_ALLOC 891 .shstrtab SHT_STRTAB 0 892 .strtab SHT_STRTAB SHF_ALLOC 893 .symtab SHT_SYMTAB SHF_ALLOC 894 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 895 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 896 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 897 898 .bss 899 This section holds data that contributes to the 900 program's memory image. The program may treat this data 901 as uninitialized. However, the system shall initialize 902 this data with zeroes when the program begins to run. 903 The section occupies no file space, as indicated by the 904 section type, SHT_NOBITS 905 906 .comment 907 This section holds version control information. 908 909 .data 910 This section holds initialized data that contribute to 911 the program's memory image. 912 913 .data1 914 This section holds initialized data that contribute to 915 the program's memory image. 916 917 .debug 918 This section holds information for symbolic debugging. 919 The contents are unspecified. All section names with 920 the prefix .debug hold information for symbolic 921 debugging. The contents of these sections are 922 unspecified. 923 924 .dynamic 925 This section holds dynamic linking information. The 926 section's attributes will include the SHF_ALLOC bit. 927 Whether the SHF_WRITE bit is set is processor specific. 928 See Chapter 5 for more information. 929 930 .dynstr 931 This section holds strings needed for dynamic linking, 932 most commonly the strings that represent the names 933 associated with symbol table entries. See Chapter 5 for 934 more information. 935 936 .dynsym 937 This section holds the dynamic linking symbol table, as 938 described in `Symbol Table'. See Chapter 5 for more 939 information. 940 941 .fini 942 This section holds executable instructions that 943 contribute to the process termination code. That is, 944 when a program exits normally, the system arranges to 945 execute the code in this section. 946 947 .fini_array 948 This section holds an array of function pointers that 949 contributes to a single termination array for the 950 executable or shared object containing the section. 951 952 .hash 953 This section holds a symbol hash table. See `Hash 954 Table' in Chapter 5 for more information. 955 956 .init 957 This section holds executable instructions that 958 contribute to the process initialization code. When a 959 program starts to run, the system arranges to execute 960 the code in this section before calling the main 961 program entry point (called main for C programs) 962 963 .init_array 964 This section holds an array of function pointers that 965 contributes to a single initialization array for the 966 executable or shared object containing the section. 967 968 .interp 969 This section holds the path name of a program 970 interpreter. If the file has a loadable segment that 971 includes relocation, the sections' attributes will 972 include the SHF_ALLOC bit; otherwise, that bit will be 973 off. See Chapter 5 for more information. 974 975 .line 976 This section holds line number information for symbolic 977 debugging, which describes the correspondence between 978 the source program and the machine code. The contents 979 are unspecified. 980 981 .note 982 This section holds information in the format that `Note 983 Section' in Chapter 5 describes of the System V 984 Application Binary Interface, Edition 4.1. 985 986 .preinit_array 987 This section holds an array of function pointers that 988 contributes to a single pre-initialization array for 989 the executable or shared object containing the section. 990 991 .rodata 992 This section holds read-only data that typically 993 contribute to a non-writable segment in the process 994 image. See `Program Header' in Chapter 5 for more 995 information. 996 997 .rodata1 998 This section hold sread-only data that typically 999 contribute to a non-writable segment in the process 1000 image. See `Program Header' in Chapter 5 for more 1001 information. 1002 1003 .shstrtab 1004 This section holds section names. 1005 1006 .strtab 1007 This section holds strings, most commonly the strings 1008 that represent the names associated with symbol table 1009 entries. If the file has a loadable segment that 1010 includes the symbol string table, the section's 1011 attributes will include the SHF_ALLOC bit; otherwi 1012 1013 .symtab 1014 This section holds a symbol table, as `Symbol Table'. 1015 in this chapter describes. If the file has a loadable 1016 segment that includes the symbol table, the section's 1017 attributes will include the SHF_ALLOC bit; otherwise, 1018 that bit will be off. 1019 1020 .tbss 1021 This section holds uninitialized thread-local data that 1022 contribute to the program's memory image. By 1023 definition, the system initializes the data with zeros 1024 when the data is instantiated for each new execution 1025 flow. The section occupies no file space, as indicated 1026 by the section type, SHT_NOBITS. Implementations need 1027 not support thread-local storage. 1028 1029 .tdata 1030 This section holds initialized thread-local data that 1031 contributes to the program's memory image. A copy of 1032 its contents is instantiated by the system for each new 1033 execution flow. Implementations need not support 1034 thread-local storage. 1035 1036 .text 1037 This section holds the `text,' or executable 1038 instructions, of a program. 1039 _________________________________________________________ 1040 1041 5.1.2. Additional Special Sections 1042 1043 Object files in an LSB conforming application may also contain 1044 one or more of the additional special sections described 1045 below. 1046 1047 Table 5-2. Additional Special Sections 1048 Name Type Attributes 1049 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1050 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1051 .eh_frame SHT_PROGBITS SHF_ALLOC 1052 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1053 .gnu.version SHT_GNU_versym SHF_ALLOC 1054 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1055 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1056 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1057 .note.ABI-tag SHT_NOTE SHF_ALLOC 1058 .stab SHT_PROGBITS 0 1059 .stabstr SHT_STRTAB 0 1060 1061 .ctors 1062 This section contains a list of global constructor 1063 function pointers. 1064 1065 .dtors 1066 This section contains a list of global destructor 1067 function pointers. 1068 1069 .eh_frame 1070 This section contains information necessary for frame 1071 unwinding during exception handling. 1072 1073 .eh_frame_hdr 1074 This section contains a pointer to the .eh_frame 1075 section which is accessible to the runtime support code 1076 of a C++ application. This section may also contain a 1077 binary search table which may be used by the runtime 1078 support code to more efficiently access records in the 1079 .eh_frame section. 1080 1081 .gnu.version 1082 This section contains the Symbol Version Table. 1083 1084 .gnu.version_d 1085 This section contains the Version Definitions. 1086 1087 .gnu.version_r 1088 This section contains the Version Requirments. 1089 1090 .jcr 1091 This section contains information necessary for 1092 registering compiled Java classes. The contents are 1093 compiler-specific and used by compiler initialization 1094 functions. 1095 1096 .note.ABI-tag 1097 Specify ABI details. 1098 1099 .stab 1100 This section contains debugging information. The 1101 contents are not specified as part of the LSB. 1102 1103 .stabstr 1104 This section contains strings associated with the 1105 debugging infomation contained in the .stab section. 1106 _________________________________________________________ 1107 1108 Chapter 6. Symbol Mapping 1109 1110 6.1. Introduction 1111 1112 This chapter defines how names are mapped from the source 1113 symbol to the object symbol. 1114 _________________________________________________________ 1115 1116 6.2. Symbol Mapping 1117 1118 Symbols in a source program are translated by the compilation 1119 system into symbols that exist in the object file. The rules 1120 for this translation are defined here. 1121 _________________________________________________________ 1122 1123 6.2.1. C Language 1124 1125 External C symbols have the same names in C and object files' 1126 symbol tables. 1127 _________________________________________________________ 1128 1129 Chapter 7. DWARF Extensions 1130 1131 In addition to the Call Frame Instructions defined in section 1132 6.4.2 of DWARF Debugging Information Format, the following 1133 Call Frame Instructions may also be used. 1134 1135 Table 7-1. Additional DWARF Call Frame Instructions 1136 Name Value Meaning 1137 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1138 two operands: an unsigned LEB128 value representing a register 1139 number, and a DW_FORM_block value representing a DWARF 1140 expression. The required action is to establish the DWARF 1141 expression as the means by which the address in which the 1142 given register contents are found may be computed. The value 1143 of the CFA is pushed on the DWARF evaluation stack prior to 1144 execution of the DWARF expression. The DW_OP_call2, 1145 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1146 DWARF operators (see Section 2.4.1 of DWARF Debugging 1147 Information Format) cannot be used in such a DWARF expression. 1148 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1149 instruction takes two operands: an unsigned LEB128 value 1150 representing a register number and a signed LEB128 factored 1151 offset. This instruction is identical to 1152 DW_CFA_offset_extended except that the second operand is 1153 signed. 1154 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1155 two operands: an unsigned LEB128 value representing a register 1156 number and a signed LEB128 factored offset. This instruction 1157 is identical to DW_CFA_def_cfa except that the second operand 1158 is signed and factored. 1159 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1160 instruction takes a signed LEB128 operand representing a 1161 factored offset. This instruction is identical to 1162 DW_CFA_def_cfa_offset except that the operand is signed and 1163 factored. 1164 DW_CFA_GNU_args_size 0x2e The DW_CFA_def_cfa_offset_sf 1165 instruction takes an unsigned LEB128 operand representing an 1166 argument size. 1167 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1168 instruction takes two operands: an unsigned LEB128 value 1169 representing a register number and an unsigned LEB128 which 1170 represents the magnitude of the offset. This instruction is 1171 identical to DW_CFA_offset_extended_sf except that the operand 1172 is subtracted to produce the offset. This instructions is 1173 obsoleted by DW_CFA_offset_extended_sf. 1174 _________________________________________________________ 1175 1176 Chapter 8. EH Frame 1177 1178 This chapter will contain a formal description of the contents 1179 of the .eh_frame_hdr section. 1180 _________________________________________________________ 1181 1182 Chapter 9. EH Frame Header 1183 1184 9.1. Introduction 1185 1186 The .eh_frame_hdr section contains additional information 1187 about the .eh_frame section. A pointer to the start of the 1188 .eh_frame data, and optionally, a binary search table of 1189 pointers to the .eh_frame records are found in this section. 1190 1191 Data in this section is encoded according to the DWARF 1192 Exception Header Encoding described below. 1193 1194 Table 9-1. .eh_frame_hdr Section Format 1195 Encoding Field 1196 unsigned byte version 1197 unsigned byte eh_frame_ptr_enc 1198 unsigned byte fde_count_enc 1199 unsigned byte table_enc 1200 encoded eh_frame_ptr 1201 encoded fde_count 1202 binary search table 1203 1204 version 1205 Version of the .eh_frame_hdr format. This value shall 1206 be 1. 1207 1208 eh_frame_ptr_enc 1209 The encoding format of the eh_frame_ptr field. 1210 1211 fde_count_enc 1212 The encoding format of the fde_count field. A value of 1213 DW_EH_PE_omit indicates the binary search table is not 1214 present. 1215 1216 table_enc 1217 The encoding format of the entries in the binary search 1218 table. A value of DW_EH_PE_omit indicates the binary 1219 search table is not present. 1220 1221 eh_frame_ptr 1222 The encoded value of the pointer to the start of the 1223 .eh_frame section. 1224 1225 fde_count 1226 The encoded value of the count of entries in the binary 1227 search table. 1228 1229 binary search table 1230 A binary search table containing fde_count entries. 1231 Each entry of the table consist of two encoded values, 1232 the initial location, and the address. The entries are 1233 sorted in an increasing order by the initial location 1234 value. 1235 _________________________________________________________ 1236 1237 9.2. DWARF Exception Header Encoding 1238 1239 The DWARF Exception Header Encoding is used to describe the 1240 type of data used in the .eh_frame_hdr section. The upper 4 1241 bits indicate how the value is to be applied. The lower 4 bits 1242 indicate the format of the data. 1243 1244 Table 9-2. DWARF Exception Header value format 1245 Name Value Meaning 1246 DW_EH_PE_omit 0xff No value is present. 1247 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1248 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1249 Information Format. 1250 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1251 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1252 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1253 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1254 Endian Base 128 (LEB128) as defined by DWARF Debugging 1255 Information Format. 1256 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1257 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1258 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1259 1260 Table 9-3. DWARF Exception Header application 1261 Name Value Meaning 1262 DW_EH_PE_absptr 0x00 Value is used with no modification. 1263 DW_EH_PE_pcrel 0x10 Value is reletive to the current program 1264 counter. 1265 DW_EH_PE_datarel 0x30 Value is reletive to the beginning of 1266 the .eh_frame_hdr section. 1267 DW_EH_PE_omit 0xff No value is present. 1268 _________________________________________________________ 1269 1270 Chapter 10. Symbol Versioning 1271 1272 10.1. Introduction 1273 1274 This chapter describes the Symbol Versioning mechanism. All 1275 ELF objects may provide or depend on versioned symbols. Symbol 1276 Versioning is implemented by 3 section types: SHT_GNU_versym, 1277 SHT_GNU_verdef, and SHT_GNU_verneed. 1278 1279 The prefix Elfxx in the following descriptions and code 1280 fragments stands for either "Elf32" or "Elf64", depending on 1281 the architecture. 1282 1283 Versions are described by strings. The structures that are 1284 used for symbol versions also contain a member that holds the 1285 ELF hashing values of the strings. This allows for more 1286 efficient processing. 1287 _________________________________________________________ 1288 1289 10.2. Symbol Version Table 1290 1291 The special section .gnu.version which has a section type of 1292 SHT_GNU_versym shall contain the Symbol Version Table. This 1293 section shall have the same number of entries as the Dynamic 1294 Symbol Table in the .dynsym section. 1295 1296 The .gnu.version section shall contain an array of elements of 1297 type Elfxx_Half. Each entry specifies the version defined for 1298 or required by the corresponding symbol in the Dynamic Symbol 1299 Table. 1300 1301 The values in the Symbol Version Table are specific to the 1302 object in which they are located. These values are identifiers 1303 that are provided by the the vna_other member of the 1304 Elfxx_Vernaux structure or the vd_ndx member of the 1305 Elfxx_Verdef structure. 1306 1307 The values 0 and 1 are reserved. 1308 1309 0 1310 The symbol is local, not available outside the object. 1311 1312 1 1313 The symbol is defined in this object and is globally 1314 available. 1315 1316 All other values are used to identify version strings located 1317 in one of the other Symbol Version sections. The value itself 1318 is not the version associated with the symbol. The string 1319 identified by the value defines the version of the symbol. 1320 _________________________________________________________ 1321 1322 10.3. Version Definitions 1323 1324 Symbol definitions are contained in the special section 1325 .gnu.version_d which has a section type of SHT_GNU_verdef. The 1326 number of entries in this section is contained in the 1327 DT_VERDEFNUM entry of the Dynamic Section. The sh_link member 1328 of the section header points to the section that contains the 1329 strings referenced by this section. 1330 1331 The special section .gnu.version_d which has a section type of 1332 SHT_GNU_verdef shall contain symbol version definitions. The 1333 number of entries in this section shall be contained in the 1334 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The 1335 sh_link member of the section header (see figure 4-8 in the 1336 System V ABI) shall point to the section that contains the 1337 strings referenced by this section. 1338 1339 The section shall contain an array of Elfxx_Verdef structures, 1340 as described in Figure 10-1, optionally followed by an array 1341 of Elfxx_Verdaux structures, as defined in Figure 10-2. 1342 typedef struct { 1343 Elfxx_Half vd_version; 1344 Elfxx_Half vd_flags; 1345 Elfxx_Half vd_ndx; 1346 Elfxx_Half vd_cnt; 1347 Elfxx_Word vd_hash; 1348 Elfxx_Word vd_aux; 1349 Elfxx_Word vd_next; 1350 } Elfxx_Verdef; 1351 1352 Figure 10-1. Version Definition Entries 1353 1354 vd_version 1355 Version revision. This field shall be set to 1. 1356 1357 vd_flags 1358 Version information flag bitmask. 1359 1360 vd_ndx 1361 Version index numeric value referencing the 1362 SHT_GNU_versym section. 1363 1364 vd_cnt 1365 Number of associated verdaux array entries. 1366 1367 vd_hash 1368 Version name hash value (ELF hash function). 1369 1370 vd_aux 1371 Offset in bytes to a corresponding entry in an array of 1372 Elfxx_Verdaux structures as defined in Figure 10-2 1373 1374 vd_next 1375 Offset to the next verdef entry, in bytes. 1376 1377 typedef struct { 1378 Elfxx_Word vda_name; 1379 Elfxx_Word vda_next; 1380 } Elfxx_Verdaux; 1381 1382 Figure 10-2. Version Definition Auxiliary Entries 1383 1384 vda_name 1385 Offset to the version or dependency name string in the 1386 section header, in bytes. 1387 1388 vda_next 1389 Offset to the next verdaux entry, in bytes. 1390 _________________________________________________________ 1391 1392 10.4. Version Requirements 1393 1394 The special section .gnu.version_r which has a section type of 1395 SHT_GNU_verneed shall contain required symbol version 1396 definitions. The number of entries in this section shall be 1397 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1398 .dynamic. The sh_link member of the section header (see figure 1399 4-8 in System V ABI) shall point to the section that contains 1400 the strings referenced by this section. 1401 1402 The section shall contain an array of Elfxx_Verneed 1403 structures, as described in Figure 10-3, optionally followed 1404 by an array of Elfxx_Vernaux structures, as defined in Figure 1405 10-4. 1406 typedef struct { 1407 Elfxx_Half vn_version; 1408 Elfxx_Half vn_cnt; 1409 Elfxx_Word vn_file; 1410 Elfxx_Word vn_aux; 1411 Elfxx_Word vn_next; 1412 } Elfxx_Verneed; 1413 1414 Figure 10-3. Version Needed Entries 1415 1416 vn_version 1417 Version of structure. This value is currently set to 1, 1418 and will be reset if the versioning implementation is 1419 incompatibly altered. 1420 1421 vn_cnt 1422 Number of associated verneed array entries. 1423 1424 vn_file 1425 Offset to the file name string in the section header, 1426 in bytes. 1427 1428 vn_aux 1429 Offset to a corresponding entry in the vernaux array, 1430 in bytes. 1431 1432 vn_next 1433 Offset to the next verneed entry, in bytes. 1434 1435 typedef struct { 1436 Elfxx_Word vna_hash; 1437 Elfxx_Half vna_flags; 1438 Elfxx_Half vna_other; 1439 Elfxx_Word vna_name; 1440 Elfxx_Word vna_next; 1441 } Elfxx_Vernaux; 1442 1443 Figure 10-4. Version Needed Auxiliary Entries 1444 1445 vna_hash 1446 Dependency name hash value (ELF hash function). 1447 1448 vna_flags 1449 Dependency information flag bitmask. 1450 1451 vna_other 1452 Object file version identifier used in the .gnu.version 1453 symbol version array. Bit number 15 controls whether or 1454 not the object is hidden; if this bit is set, the 1455 object cannot be used and the static linker will ignore 1456 the symbol's presence in the object. 1457 1458 vna_name 1459 Offset to the dependency name string in the section 1460 header, in bytes. 1461 1462 vna_next 1463 Offset to the next vernaux entry, in bytes. 1464 _________________________________________________________ 1465 1466 10.5. Startup Sequence 1467 1468 When loading a sharable object the system shall analyze 1469 version definition data from the loaded object to assure that 1470 it meets the version requirements of the calling object. This 1471 step is referred to as definition testing. The dynamic loader 1472 shall retrieve the entries in the caller's Elfxx_Verneed array 1473 and attempt to find matching definition information in the 1474 loaded Elfxx_Verdef table. 1475 1476 Each object and dependency shall be tested in turn. If a 1477 symbol definition is missing and the vna_flags bit for 1478 VER_FLG_WEAK is not set, the loader shall return an error and 1479 exit. If the vna_flags bit for VER_FLG_WEAK is set in the 1480 Elfxx_Vernaux entry, and the loader shall issue a warning and 1481 continue operation. 1482 1483 When the versions referenced by undefined symbols in the 1484 loaded object are found, version availability is certified. 1485 The test completes without error and the object shall be made 1486 available. 1487 _________________________________________________________ 1488 1489 10.6. Symbol Resolution 1490 1491 When symbol versioning is used in an object, relocations 1492 extend definition testing beyond the simple match of symbol 1493 name strings: the version of the reference shall also equal 1494 the name of the definition. 1495 1496 The same index that is used in the symbol table can be 1497 referenced in the SHT_GNU_versym section, and the value of 1498 this index is then used to acquire name data. The 1499 corresponding requirement string is retrieved from the 1500 Elfxx_Verneed array, and likewise, the corresponding 1501 definition string from the Elfxx_Verdef table. 1502 1503 If the high order bit (bit number 15) of the version symbolis 1504 set, the object cannot be used and the static linker shall 1505 ignore the symbol's presence in the object. 1506 1507 When an object with a reference and an object with the 1508 definition are being linked, the following rules shall govern 1509 the result: 1510 1511 * The object with the reference and the object with the 1512 definitions both use versioning. All described matching is 1513 processed in this case. A fatal error shall be triggered 1514 when no matching definition can be found in the object 1515 whose name is the one referenced by the vn_name element in 1516 the Elfxx_Verneed entry. 1517 * The object with the reference does not use versioning, 1518 while the object with the definitions does. In this 1519 instance, only the definitions with index numbers 1 and 2 1520 will be used in the reference match, the same identified 1521 by the static linker as the base definition. In cases 1522 where the static linker was not used, such as in calls to 1523 dlopen(), a version that does not have the base definition 1524 index shall be acceptable if it is the only version for 1525 which the symbol is defined. 1526 * The object with the reference uses versioning, but the 1527 object with the definitions specifies none. A matching 1528 symbol shall be accepted in this case. A fatal error shall 1529 be triggered if a corruption in the required symbols list 1530 obscures an outdated object file and causes a match on the 1531 object filename in the Elfxx_Verneed entry. 1532 * Neither the object with the reference nor the object with 1533 the definitions use versioning. The behavior in this 1534 instance shall default to pre-existing symbol rules. 1535 _________________________________________________________ 1536 1537 Chapter 11. ABI note tag 1538 1539 Every executable shall contain a section named .note.ABI-tag 1540 of type SHT_NOTE. This section is structured as a note section 1541 as documented in the ELF spec. The section shall contain at 1542 least the following entry. The name field (namesz/name) 1543 contains the string "GNU". The type field shall be 1. The 1544 descsz field shall be at least 16, and the first 16 bytes of 1545 the desc field shall be as follows. 1546 1547 The first 32-bit word of the desc field shall be 0 (this 1548 signifies a Linux executable). The second, third, and fourth 1549 32-bit words of the desc field contain the earliest compatible 1550 kernel version. For example, if the 3 words are 2, 2, and 5, 1551 this signifies a 2.2.5 kernel. 1552 1553 III. Dynamic Linking 1554 1555 Table of Contents 1556 12. Program Loading and Dynamic Linking 1557 13. Program Header 1558 14. Dynamic Entries 1559 _________________________________________________________ 1560 1561 Chapter 12. Program Loading and Dynamic Linking 1562 1563 LSB-conforming implementations shall support the object file 1564 information and system actions that create running programs as 1565 specified in the System V ABI and System V ABI Update and as 1566 supplemented by this document and an architecture-specific LSB 1567 specification. 1568 1569 Any shared object that is loaded shall contain sufficient 1570 DT_NEEDED records to satisfy the symbols on the shared 1571 library. 1572 _________________________________________________________ 1573 1574 Chapter 13. Program Header 1575 1576 In addition to the Segment Types defined in the System V ABI 1577 and System V ABI Update the following Segment Types shall also 1578 be supported. 1579 1580 Table 13-1. Linux Segment Types 1581 Name Value 1582 PT_GNU_EH_FRAME 0x6474e550 1583 PT_GNU_STACK 0x6474e551 1584 1585 PT_GNU_EH_FRAME 1586 The array element specifies the location and size of 1587 the exception handling information as defined by the 1588 .eh_frame_hdr section. 1589 1590 PT_GNU_STACK 1591 The p_flags member specifies the permissions on the 1592 segment containing the stack and is used to indicate 1593 wether the stack should be executable. The absense of 1594 this header indicates that the stack will be 1595 executable. 1596 _________________________________________________________ 1597 1598 Chapter 14. Dynamic Entries 1599 1600 14.1. Introduction 1601 1602 As described in System V ABI, if an object file participates 1603 in dynamic linking, its program header table shall have an 1604 element of type PT_DYNAMIC. This `segment' contains the 1605 .dynamic section. A special symbol, _DYNAMIC, labels the 1606 section, which contains an array of the following structures. 1607 typedef struct { 1608 Elf32_Sword d_tag; 1609 union { 1610 Elf32_Word d_val; 1611 Elf32_Addr d_ptr; 1612 } d_un; 1613 } Elf32_Dyn; 1614 1615 extern Elf32_Dyn _DYNAMIC[]; 1616 1617 typedef struct { 1618 Elf64_Sxword d_tag; 1619 union { 1620 Elf64_Xword d_val; 1621 Elf64_Addr d_ptr; 1622 } d_un; 1623 } Elf64_Dyn; 1624 1625 extern Elf64_Dyn _DYNAMIC[]; 1626 1627 Figure 14-1. Dynamic Structure 1628 1629 For each object with this type, d_tag controls the 1630 interpretation of d_un. 1631 _________________________________________________________ 1632 1633 14.2. Dynamic Entries 1634 _________________________________________________________ 1635 1636 14.2.1. ELF Dynamic Entries 1637 1638 The following dynamic entries are defined in the System V ABI 1639 and System V ABI Update. 1640 1641 DT_BIND_NOW 1642 Process relocations of object 1643 1644 DT_DEBUG 1645 For debugging; unspecified 1646 1647 DT_FINI 1648 Address of termination function 1649 1650 DT_HASH 1651 Address of symbol hash table 1652 1653 DT_HIPROC 1654 End of processor-specific 1655 1656 DT_INIT 1657 Address of init function 1658 1659 DT_JMPREL 1660 Address of PLT relocs 1661 1662 DT_LOPROC 1663 Start of processor-specific 1664 1665 DT_NEEDED 1666 Name of needed library 1667 1668 DT_NULL 1669 Marks end of dynamic section 1670 1671 DT_PLTREL 1672 Type of reloc in PLT 1673 1674 DT_PLTRELSZ 1675 Size in bytes of PLT relocs 1676 1677 DT_REL 1678 Address of Rel relocs 1679 1680 DT_RELA 1681 Address of Rela relocs 1682 1683 DT_RELAENT 1684 Size of one Rela reloc 1685 1686 DT_RELASZ 1687 Total size of Rela relocs 1688 1689 DT_RELENT 1690 Size of one Rel reloc 1691 1692 DT_RELSZ 1693 Total size of Rel relocs 1694 1695 DT_RPATH 1696 Library search path 1697 1698 DT_SONAME 1699 Name of shared object 1700 1701 DT_STRSZ 1702 Size of string table 1703 1704 DT_STRTAB 1705 Address of string table 1706 1707 DT_SYMBOLIC 1708 Start symbol search here 1709 1710 DT_SYMENT 1711 Size of one symbol table entry 1712 1713 DT_SYMTAB 1714 Address of symbol table 1715 1716 DT_TEXTREL 1717 Reloc might modify .text 1718 _________________________________________________________ 1719 1720 14.2.2. Additional Dynamic Entries 1721 1722 An LSB conforming object may also use the following additional 1723 Dynamic Entry types. 1724 1725 DT_ADDRRNGHI 1726 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1727 reserved for definition by an archLSB. 1728 1729 DT_ADDRRNGLO 1730 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1731 reserved for definition by an archLSB. 1732 1733 DT_AUXILIARY 1734 Shared object to load before self 1735 1736 DT_FILTER 1737 Shared object to get values from 1738 1739 DT_FINI_ARRAY 1740 The address of an array of pointers to termination 1741 functions. 1742 1743 DT_FINI_ARRAYSZ 1744 Size in bytes of DT_FINI_ARRAY 1745 1746 DT_HIOS 1747 Values from DT_LOOS through DT_HIOS are reserved for 1748 definition by specific operating systems. 1749 1750 DT_INIT_ARRAY 1751 The address of an array of pointers to initialization 1752 functions. 1753 1754 DT_INIT_ARRAYSZ 1755 Size in bytes of DT_INIT_ARRAY 1756 1757 DT_LOOS 1758 Values from DT_LOOS through DT_HIOS are reserved for 1759 definition by specific operating systems. 1760 1761 DT_NUM 1762 Number of dynamic entry tags defined (excepting 1763 reserved ranges). 1764 1765 DT_POSFLAG_1 1766 Flags for DT_* entries, effecting the following DT_* 1767 entry 1768 1769 DT_RELCOUNT 1770 All Elf32_Rel R_*_RELATIVE relocations have been placed 1771 into a single block and this entry specifies the number 1772 of entries in that block. This permits ld.so.1 to 1773 streamline the processing of RELATIVE relocations. 1774 1775 DT_RUNPATH 1776 null-terminated library search path string 1777 1778 DT_SYMINENT 1779 Entry size of syminfo 1780 1781 DT_SYMINFO 1782 Address of the Syminfo table. 1783 1784 DT_SYMINSZ 1785 Size of syminfo table (in bytes) 1786 1787 DT_VALRNGHI 1788 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1789 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1790 1791 DT_VALRNGLO 1792 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1793 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1794 1795 DT_VERDEF 1796 Address of version definition table 1797 1798 DT_VERDEFNUM 1799 Number of version definitions 1800 1801 DT_VERNEED 1802 Address of table with needed versions 1803 1804 DT_VERNEEDNUM 1805 Number of needed versions 1806 1807 DT_VERSYM 1808 Address of the table provided by the .gnu.version 1809 section. 1810 1811 Linux Standard Base Specification 1812 _________________________________________________________ 1813 1814 Table of Contents 1815 I. Base Libraries 1816 1817 1. Libraries 1818 1819 1.1. Introduction 1820 1.2. Program Interpreter 1821 1.3. Interfaces for libc 1822 1.4. Data Definitions for libc 1823 1.5. Interface Definitions for libc 1824 1.6. Interfaces for libm 1825 1.7. Data Definitions for libm 1826 1.8. Interface Definitions for libm 1827 1.9. Interfaces for libpthread 1828 1.10. Data Definitions for libpthread 1829 1.11. Interface Definitions for libpthread 1830 1.12. Interfaces for libgcc_s 1831 1.13. Data Definitions for libgcc_s 1832 1.14. Interfaces for libdl 1833 1.15. Data Definitions for libdl 1834 1.16. Interface Definitions for libdl 1835 1.17. Interfaces for libcrypt 1836 1.18. Interfaces for libpam 1837 1.19. Data Definitions for libpam 1838 1.20. Interface Definitions for libpam 1839 1840 II. Utility Libraries 1841 1842 2. Utility Libraries 1843 1844 2.1. Introduction 1845 2.2. Interfaces for libz 1846 2.3. Data Definitions for libz 1847 2.4. Interface Definitions for libz 1848 2.5. Interfaces for libncurses 1849 2.6. Data Definitions for libncurses 1850 2.7. Interfaces for libutil 1851 2.8. Interface Definitions for libutil 1852 1853 III. Commands and Utilities 1854 1855 3. Commands and Utilities 1856 1857 3.1. Commands and Utilities 1858 3.2. Command Behavior 1859 1860 IV. Execution Environment 1861 1862 4. File System Hierarchy 1863 1864 4.1. /dev 1865 4.2. User Accounting Databases 1866 4.3. Path For System Administration Utilities 1867 1868 5. Additional Recommendations 1869 1870 5.1. Minimal granted Directory and File permissions 1871 5.2. Recommendations for applications on ownership 1872 and permissions 1873 1874 6. Additional Behaviors 1875 1876 6.1. Mandatory Optional Behaviors 1877 1878 7. Localization 1879 1880 7.1. Introduction 1881 7.2. Regular Expressions 1882 7.3. Pattern Matching Notation 1883 1884 V. System Initialization 1885 1886 8. System Initialization 1887 1888 8.1. Cron Jobs 1889 8.2. Init Script Actions 1890 8.3. Comment Conventions for Init Scripts 1891 8.4. Installation and Removal of init.d Files 1892 8.5. Run Levels 1893 8.6. Facility Names 1894 8.7. Script Names 1895 8.8. Init Script Functions 1896 1897 VI. Users & Groups 1898 1899 9. Users & Groups 1900 1901 9.1. User and Group Database 1902 9.2. User & Group Names 1903 9.3. UID Ranges 1904 9.4. Rationale 1905 1906 A. Alphabetical Listing of Interfaces 1907 1908 A.1. libc 1909 A.2. libcrypt 1910 A.3. libdl 1911 A.4. libm 1912 A.5. libncurses 1913 A.6. libpam 1914 A.7. libpthread 1915 A.8. libutil 1916 A.9. libz 1917 1918 List of Tables 1919 1-1. libc Definition 1920 1-2. libc - RPC Function Interfaces 1921 1-3. libc - System Calls Function Interfaces 1922 1-4. libc - Standard I/O Function Interfaces 1923 1-5. libc - Standard I/O Data Interfaces 1924 1-6. libc - Signal Handling Function Interfaces 1925 1-7. libc - Signal Handling Data Interfaces 1926 1-8. libc - Localization Functions Function Interfaces 1927 1-9. libc - Localization Functions Data Interfaces 1928 1-10. libc - Socket Interface Function Interfaces 1929 1-11. libc - Wide Characters Function Interfaces 1930 1-12. libc - String Functions Function Interfaces 1931 1-13. libc - IPC Functions Function Interfaces 1932 1-14. libc - Regular Expressions Function Interfaces 1933 1-15. libc - Character Type Functions Function Interfaces 1934 1-16. libc - Time Manipulation Function Interfaces 1935 1-17. libc - Time Manipulation Data Interfaces 1936 1-18. libc - Terminal Interface Functions Function Interfaces 1937 1-19. libc - System Database Interface Function Interfaces 1938 1-20. libc - Language Support Function Interfaces 1939 1-21. libc - Large File Support Function Interfaces 1940 1-22. libc - Standard Library Function Interfaces 1941 1-23. libc - Standard Library Data Interfaces 1942 1-24. libm Definition 1943 1-25. libm - Math Function Interfaces 1944 1-26. libm - Math Data Interfaces 1945 1-27. libpthread Definition 1946 1-28. libpthread - Realtime Threads Function Interfaces 1947 1-29. libpthread - Posix Threads Function Interfaces 1948 1-30. libgcc_s Definition 1949 1-31. libdl Definition 1950 1-32. libdl - Dynamic Loader Function Interfaces 1951 1-33. libcrypt Definition 1952 1-34. libcrypt - Encryption Function Interfaces 1953 1-35. libpam Definition 1954 1-36. libpam - Pluggable Authentication API Function 1955 Interfaces 1956 1957 2-1. libz Definition 1958 2-2. libz - Compression Library Function Interfaces 1959 2-3. libncurses Definition 1960 2-4. libncurses - Curses Function Interfaces 1961 2-5. libncurses - Curses Data Interfaces 1962 2-6. libutil Definition 1963 2-7. libutil - Utility Functions Function Interfaces 1964 3-1. Commands And Utilities 1965 3-2. Built In Utilities 1966 3-1. Escape Sequences 1967 9-1. Required User & Group Names 1968 9-2. Optional User & Group Names 1969 A-1. libc Function Interfaces 1970 A-2. libc Data Interfaces 1971 A-3. libcrypt Function Interfaces 1972 A-4. libdl Function Interfaces 1973 A-5. libm Function Interfaces 1974 A-6. libm Data Interfaces 1975 A-7. libncurses Function Interfaces 1976 A-8. libncurses Data Interfaces 1977 A-9. libpam Function Interfaces 1978 A-10. libpthread Function Interfaces 1979 A-11. libutil Function Interfaces 1980 A-12. libz Function Interfaces 1981 1982 I. Base Libraries 1983 1984 Table of Contents 1985 1. Libraries 1986 _________________________________________________________ 1987 1988 Chapter 1. Libraries 1989 1990 1.1. Introduction 1991 1992 An LSB-conforming implementation shall support the following 1993 base libraries which provide interfaces for accessing the 1994 operating system, processor and other hardware in the system. 1995 1996 * libc 1997 * libm 1998 * libgcc_s 1999 * libdl 2000 * libcrypt 2001 * libpam 2002 _________________________________________________________ 2003 2004 1.2. Program Interpreter 2005 2006 The Program Interpreter is specified in the appropriate 2007 architecture-specific LSB specification. 2008 _________________________________________________________ 2009 2010 1.3. Interfaces for libc 2011 2012 Table 1-1 defines the library name and shared object name for 2013 the libc library 2014 2015 Table 1-1. libc Definition 2016 Library: libc 2017 SONAME: See archLSB. 2018 2019 The behavior of the interfaces in this library is specified by 2020 the following specifications: 2021 2022 Large File Support 2023 this specification 2024 SUSv2 2025 ISO POSIX (2003) 2026 SVID Issue 3 2027 SVID Issue 4 2028 _________________________________________________________ 2029 2030 1.3.1. RPC 2031 _________________________________________________________ 2032 2033 1.3.1.1. Interfaces for RPC 2034 2035 An LSB conforming implementation shall provide the generic 2036 functions for RPC specified in Table 1-2, with the full 2037 mandatory functionality as described in the referenced 2038 underlying specification. 2039 2040 Table 1-2. libc - RPC Function Interfaces 2041 authnone_create [1] svc_getreqset [2] svcudp_create [3] 2042 xdr_int [2] xdr_u_long [2] 2043 clnt_create [1] svc_register [3] xdr_accepted_reply [2] 2044 xdr_long [2] xdr_u_short [2] 2045 clnt_pcreateerror [1] svc_run [3] xdr_array [2] xdr_opaque [2] 2046 xdr_union [2] 2047 clnt_perrno [1] svc_sendreply [3] xdr_bool [2] xdr_opaque_auth 2048 [2] xdr_vector [2] 2049 clnt_perror [1] svcerr_auth [2] xdr_bytes [2] xdr_pointer [2] 2050 xdr_void [2] 2051 clnt_spcreateerror [1] svcerr_decode [2] xdr_callhdr [2] 2052 xdr_reference [2] xdr_wrapstring [2] 2053 clnt_sperrno [1] svcerr_noproc [2] xdr_callmsg [2] 2054 xdr_rejected_reply [2] xdrmem_create [2] 2055 clnt_sperror [1] svcerr_noprog [2] xdr_char [2] xdr_replymsg 2056 [2] xdrrec_create [2] 2057 key_decryptsession [2] svcerr_progvers [2] xdr_double [2] 2058 xdr_short [2] xdrrec_eof [2] 2059 pmap_getport [3] svcerr_systemerr [2] xdr_enum [2] xdr_string 2060 [2] 2061 pmap_set [3] svcerr_weakauth [2] xdr_float [2] xdr_u_char [2] 2062 2063 pmap_unset [3] svctcp_create [3] xdr_free [2] xdr_u_int [3] 2064 2065 Referenced Specification(s) 2066 2067 [1]. SVID Issue 4 2068 2069 [2]. SVID Issue 3 2070 2071 [3]. this specification 2072 _________________________________________________________ 2073 2074 1.3.2. System Calls 2075 _________________________________________________________ 2076 2077 1.3.2.1. Interfaces for System Calls 2078 2079 An LSB conforming implementation shall provide the generic 2080 functions for System Calls specified in Table 1-3, with the 2081 full mandatory functionality as described in the referenced 2082 underlying specification. 2083 2084 Table 1-3. libc - System Calls Function Interfaces 2085 __fxstat [1] fchmod [2] getwd [2] read [2] setrlimit [2] 2086 __getpgid [1] fchown [2] initgroups [1] readdir [2] 2087 setrlimit64 [3] 2088 __lxstat [1] fcntl [1] ioctl [1] readdir_r [2] setsid [2] 2089 __xmknod [1] fdatasync [2] kill [1] readlink [2] setuid [2] 2090 __xstat [1] flock [1] killpg [2] readv [2] sleep [2] 2091 access [2] fork [2] lchown [2] rename [2] statvfs [2] 2092 acct [1] fstatvfs [2] link [1] rmdir [2] stime [1] 2093 alarm [2] fsync [2] lockf [2] sbrk [4] symlink [2] 2094 brk [4] ftime [2] lseek [2] sched_get_priority_max [2] sync 2095 [2] 2096 chdir [2] ftruncate [2] mkdir [2] sched_get_priority_min [2] 2097 sysconf [2] 2098 chmod [2] getcontext [2] mkfifo [2] sched_getparam [2] time 2099 [2] 2100 chown [2] getegid [2] mlock [2] sched_getscheduler [2] times 2101 [2] 2102 chroot [4] geteuid [2] mlockall [2] sched_rr_get_interval [2] 2103 truncate [2] 2104 clock [2] getgid [2] mmap [2] sched_setparam [2] ulimit [2] 2105 close [2] getgroups [2] mprotect [2] sched_setscheduler [2] 2106 umask [2] 2107 closedir [2] getitimer [2] msync [2] sched_yield [2] uname [2] 2108 creat [2] getloadavg [1] munlock [2] select [2] unlink [1] 2109 dup [2] getpagesize [4] munlockall [2] setcontext [2] utime 2110 [2] 2111 dup2 [2] getpgid [2] munmap [2] setegid [2] utimes [2] 2112 execl [2] getpgrp [2] nanosleep [2] seteuid [2] vfork [2] 2113 execle [2] getpid [2] nice [2] setgid [2] wait [2] 2114 execlp [2] getppid [2] open [2] setitimer [2] wait4 [1] 2115 execv [2] getpriority [2] opendir [2] setpgid [2] waitpid [1] 2116 execve [2] getrlimit [2] pathconf [2] setpgrp [2] write [2] 2117 execvp [2] getrusage [2] pause [2] setpriority [2] writev [2] 2118 exit [2] getsid [2] pipe [2] setregid [2] 2119 fchdir [2] getuid [2] poll [2] setreuid [2] 2120 2121 Referenced Specification(s) 2122 2123 [1]. this specification 2124 2125 [2]. ISO POSIX (2003) 2126 2127 [3]. Large File Support 2128 2129 [4]. SUSv2 2130 _________________________________________________________ 2131 2132 1.3.3. Standard I/O 2133 _________________________________________________________ 2134 2135 1.3.3.1. Interfaces for Standard I/O 2136 2137 An LSB conforming implementation shall provide the generic 2138 functions for Standard I/O specified in Table 1-4, with the 2139 full mandatory functionality as described in the referenced 2140 underlying specification. 2141 2142 Table 1-4. libc - Standard I/O Function Interfaces 2143 _IO_feof [1] fgetpos [2] fsetpos [2] putchar [2] sscanf [1] 2144 _IO_getc [1] fgets [2] ftell [2] putchar_unlocked [2] telldir 2145 [2] 2146 _IO_putc [1] fgetwc_unlocked [1] ftello [2] puts [2] tempnam 2147 [2] 2148 _IO_puts [1] fileno [2] fwrite [2] putw [3] ungetc [2] 2149 asprintf [1] flockfile [2] getc [2] remove [2] vasprintf [1] 2150 clearerr [2] fopen [2] getc_unlocked [2] rewind [2] vdprintf 2151 [1] 2152 ctermid [2] fprintf [2] getchar [2] rewinddir [2] vfprintf [2] 2153 fclose [2] fputc [2] getchar_unlocked [2] scanf [1] vprintf 2154 [2] 2155 fdopen [2] fputs [2] getw [3] seekdir [2] vsnprintf [2] 2156 feof [2] fread [2] pclose [2] setbuf [2] vsprintf [2] 2157 ferror [2] freopen [2] popen [2] setbuffer [1] 2158 fflush [2] fscanf [1] printf [2] setvbuf [2] 2159 fflush_unlocked [1] fseek [2] putc [2] snprintf [2] 2160 fgetc [2] fseeko [2] putc_unlocked [2] sprintf [2] 2161 2162 Referenced Specification(s) 2163 2164 [1]. this specification 2165 2166 [2]. ISO POSIX (2003) 2167 2168 [3]. SUSv2 2169 2170 An LSB conforming implementation shall provide the generic 2171 data interfaces for Standard I/O specified in Table 1-5, with 2172 the full mandatory functionality as described in the 2173 referenced underlying specification. 2174 2175 Table 1-5. libc - Standard I/O Data Interfaces 2176 stderr [1] stdin [1] stdout [1] 2177 2178 Referenced Specification(s) 2179 2180 [1]. ISO POSIX (2003) 2181 _________________________________________________________ 2182 2183 1.3.4. Signal Handling 2184 _________________________________________________________ 2185 2186 1.3.4.1. Interfaces for Signal Handling 2187 2188 An LSB conforming implementation shall provide the generic 2189 functions for Signal Handling specified in Table 1-6, with the 2190 full mandatory functionality as described in the referenced 2191 underlying specification. 2192 2193 Table 1-6. libc - Signal Handling Function Interfaces 2194 __libc_current_sigrtmax [1] sigaction [2] sighold [2] sigorset 2195 [1] sigset [2] 2196 __libc_current_sigrtmin [1] sigaddset [2] sigignore [2] 2197 sigpause [2] sigsuspend [2] 2198 __sigsetjmp [1] sigaltstack [2] siginterrupt [2] sigpending 2199 [2] sigtimedwait [2] 2200 __sysv_signal [1] sigandset [1] sigisemptyset [1] sigprocmask 2201 [2] sigwait [2] 2202 bsd_signal [2] sigdelset [2] sigismember [2] sigqueue [2] 2203 sigwaitinfo [2] 2204 psignal [1] sigemptyset [2] siglongjmp [2] sigrelse [2] 2205 raise [2] sigfillset [2] signal [2] sigreturn [1] 2206 2207 Referenced Specification(s) 2208 2209 [1]. this specification 2210 2211 [2]. ISO POSIX (2003) 2212 2213 An LSB conforming implementation shall provide the generic 2214 data interfaces for Signal Handling specified in Table 1-7, 2215 with the full mandatory functionality as described in the 2216 referenced underlying specification. 2217 2218 Table 1-7. libc - Signal Handling Data Interfaces 2219 _sys_siglist [1] 2220 2221 Referenced Specification(s) 2222 2223 [1]. this specification 2224 _________________________________________________________ 2225 2226 1.3.5. Localization Functions 2227 _________________________________________________________ 2228 2229 1.3.5.1. Interfaces for Localization Functions 2230 2231 An LSB conforming implementation shall provide the generic 2232 functions for Localization Functions specified in Table 1-8, 2233 with the full mandatory functionality as described in the 2234 referenced underlying specification. 2235 2236 Table 1-8. libc - Localization Functions Function Interfaces 2237 bind_textdomain_codeset [1] dcgettext [1] 2238 freelocale(GLIBC_2.3) [1] localeconv [2] textdomain [1] 2239 bindtextdomain [1] dcngettext [1] gettext [1] 2240 newlocale(GLIBC_2.3) [1] uselocale(GLIBC_2.3) [1] 2241 catclose [2] dgettext [1] iconv [2] ngettext [1] 2242 catgets [2] dngettext [1] iconv_close [2] nl_langinfo [2] 2243 catopen [2] duplocale(GLIBC_2.3) [1] iconv_open [2] setlocale 2244 [2] 2245 2246 Referenced Specification(s) 2247 2248 [1]. this specification 2249 2250 [2]. ISO POSIX (2003) 2251 2252 An LSB conforming implementation shall provide the generic 2253 data interfaces for Localization Functions specified in Table 2254 1-9, with the full mandatory functionality as described in the 2255 referenced underlying specification. 2256 2257 Table 1-9. libc - Localization Functions Data Interfaces 2258 _nl_msg_cat_cntr [1] 2259 2260 Referenced Specification(s) 2261 2262 [1]. this specification 2263 _________________________________________________________ 2264 2265 1.3.6. Socket Interface 2266 _________________________________________________________ 2267 2268 1.3.6.1. Interfaces for Socket Interface 2269 2270 An LSB conforming implementation shall provide the generic 2271 functions for Socket Interface specified in Table 1-10, with 2272 the full mandatory functionality as described in the 2273 referenced underlying specification. 2274 2275 Table 1-10. libc - Socket Interface Function Interfaces 2276 __h_errno_location [1] gethostname [2] if_nameindex [2] send 2277 [2] socket [2] 2278 accept [2] getpeername [2] if_nametoindex [2] sendmsg [2] 2279 socketpair [2] 2280 bind [2] getsockname [2] listen [2] sendto [2] 2281 bindresvport [1] getsockopt [1] recv [2] setsockopt [1] 2282 connect [2] if_freenameindex [2] recvfrom [2] shutdown [2] 2283 gethostid [2] if_indextoname [2] recvmsg [2] sockatmark [2] 2284 2285 Referenced Specification(s) 2286 2287 [1]. this specification 2288 2289 [2]. ISO POSIX (2003) 2290 _________________________________________________________ 2291 2292 1.3.7. Wide Characters 2293 _________________________________________________________ 2294 2295 1.3.7.1. Interfaces for Wide Characters 2296 2297 An LSB conforming implementation shall provide the generic 2298 functions for Wide Characters specified in Table 1-11, with 2299 the full mandatory functionality as described in the 2300 referenced underlying specification. 2301 2302 Table 1-11. libc - Wide Characters Function Interfaces 2303 __wcstod_internal [1] mbsinit [2] vwscanf [1] wcsnlen [1] 2304 wcstoumax [2] 2305 __wcstof_internal [1] mbsnrtowcs [1] wcpcpy [1] wcsnrtombs [1] 2306 wcstouq [1] 2307 __wcstol_internal [1] mbsrtowcs [2] wcpncpy [1] wcspbrk [2] 2308 wcswcs [2] 2309 __wcstold_internal [1] mbstowcs [2] wcrtomb [2] wcsrchr [2] 2310 wcswidth [2] 2311 __wcstoul_internal [1] mbtowc [2] wcscasecmp [1] wcsrtombs [2] 2312 wcsxfrm [2] 2313 btowc [2] putwc [2] wcscat [2] wcsspn [2] wctob [2] 2314 fgetwc [2] putwchar [2] wcschr [2] wcsstr [2] wctomb [2] 2315 fgetws [2] swprintf [2] wcscmp [2] wcstod [2] wctrans [2] 2316 fputwc [2] swscanf [1] wcscoll [2] wcstof [2] wctype [2] 2317 fputws [2] towctrans [2] wcscpy [2] wcstoimax [2] wcwidth [2] 2318 fwide [2] towlower [2] wcscspn [2] wcstok [2] wmemchr [2] 2319 fwprintf [2] towupper [2] wcsdup [1] wcstol [2] wmemcmp [2] 2320 fwscanf [1] ungetwc [2] wcsftime [2] wcstold [2] wmemcpy [2] 2321 getwc [2] vfwprintf [2] wcslen [2] wcstoll [2] wmemmove [2] 2322 getwchar [2] vfwscanf [1] wcsncasecmp [1] wcstombs [2] wmemset 2323 [2] 2324 mblen [2] vswprintf [2] wcsncat [2] wcstoq [1] wprintf [2] 2325 mbrlen [2] vswscanf [1] wcsncmp [2] wcstoul [2] wscanf [1] 2326 mbrtowc [2] vwprintf [2] wcsncpy [2] wcstoull [2] 2327 2328 Referenced Specification(s) 2329 2330 [1]. this specification 2331 2332 [2]. ISO POSIX (2003) 2333 _________________________________________________________ 2334 2335 1.3.8. String Functions 2336 _________________________________________________________ 2337 2338 1.3.8.1. Interfaces for String Functions 2339 2340 An LSB conforming implementation shall provide the generic 2341 functions for String Functions specified in Table 1-12, with 2342 the full mandatory functionality as described in the 2343 referenced underlying specification. 2344 2345 Table 1-12. libc - String Functions Function Interfaces 2346 __mempcpy [1] bzero [2] strcasestr [1] strncat [2] strtok [2] 2347 __rawmemchr [1] ffs [2] strcat [2] strncmp [2] strtok_r [2] 2348 __stpcpy [1] index [2] strchr [2] strncpy [2] strtold [2] 2349 __strdup [1] memccpy [2] strcmp [2] strndup [1] strtoll [2] 2350 __strtod_internal [1] memchr [2] strcoll [2] strnlen [1] 2351 strtoq [1] 2352 __strtof_internal [1] memcmp [2] strcpy [2] strpbrk [2] 2353 strtoull [2] 2354 __strtok_r [1] memcpy [2] strcspn [2] strptime [1] strtoumax 2355 [2] 2356 __strtol_internal [1] memmove [2] strdup [2] strrchr [2] 2357 strtouq [1] 2358 __strtold_internal [1] memrchr [1] strerror [2] strsep [1] 2359 strxfrm [2] 2360 __strtoll_internal [1] memset [2] strerror_r [1] strsignal [1] 2361 swab [2] 2362 __strtoul_internal [1] rindex [2] strfmon [2] strspn [2] 2363 __strtoull_internal [1] stpcpy [1] strftime [2] strstr [2] 2364 bcmp [2] stpncpy [1] strlen [2] strtof [2] 2365 bcopy [2] strcasecmp [2] strncasecmp [2] strtoimax [2] 2366 2367 Referenced Specification(s) 2368 2369 [1]. this specification 2370 2371 [2]. ISO POSIX (2003) 2372 _________________________________________________________ 2373 2374 1.3.9. IPC Functions 2375 _________________________________________________________ 2376 2377 1.3.9.1. Interfaces for IPC Functions 2378 2379 An LSB conforming implementation shall provide the generic 2380 functions for IPC Functions specified in Table 1-13, with the 2381 full mandatory functionality as described in the referenced 2382 underlying specification. 2383 2384 Table 1-13. libc - IPC Functions Function Interfaces 2385 ftok [1] msgrcv [1] semget [1] shmctl [1] 2386 msgctl [1] msgsnd [1] semop [1] shmdt [1] 2387 msgget [1] semctl [1] shmat [1] shmget [1] 2388 2389 Referenced Specification(s) 2390 2391 [1]. ISO POSIX (2003) 2392 _________________________________________________________ 2393 2394 1.3.10. Regular Expressions 2395 _________________________________________________________ 2396 2397 1.3.10.1. Interfaces for Regular Expressions 2398 2399 An LSB conforming implementation shall provide the generic 2400 functions for Regular Expressions specified in Table 1-14, 2401 with the full mandatory functionality as described in the 2402 referenced underlying specification. 2403 2404 Table 1-14. libc - Regular Expressions Function Interfaces 2405 regcomp [1] regerror [1] regexec [2] regfree [1] 2406 2407 Referenced Specification(s) 2408 2409 [1]. ISO POSIX (2003) 2410 2411 [2]. this specification 2412 _________________________________________________________ 2413 2414 1.3.11. Character Type Functions 2415 _________________________________________________________ 2416 2417 1.3.11.1. Interfaces for Character Type Functions 2418 2419 An LSB conforming implementation shall provide the generic 2420 functions for Character Type Functions specified in Table 2421 1-15, with the full mandatory functionality as described in 2422 the referenced underlying specification. 2423 2424 Table 1-15. libc - Character Type Functions Function 2425 Interfaces 2426 __ctype_b_loc(GLIBC_2.3) [1] isalpha [2] ispunct [2] iswctype 2427 [2] iswupper [2] 2428 __ctype_get_mb_cur_max [1] isascii [2] isspace [2] iswdigit 2429 [2] iswxdigit [2] 2430 __ctype_tolower_loc(GLIBC_2.3) [1] iscntrl [2] isupper [2] 2431 iswgraph [2] isxdigit [2] 2432 __ctype_toupper_loc(GLIBC_2.3) [1] isdigit [2] iswalnum [2] 2433 iswlower [2] toascii [2] 2434 _tolower [2] isgraph [2] iswalpha [2] iswprint [2] tolower [2] 2435 _toupper [2] islower [2] iswblank [2] iswpunct [2] toupper [2] 2436 isalnum [2] isprint [2] iswcntrl [2] iswspace [2] 2437 2438 Referenced Specification(s) 2439 2440 [1]. this specification 2441 2442 [2]. ISO POSIX (2003) 2443 _________________________________________________________ 2444 2445 1.3.12. Time Manipulation 2446 _________________________________________________________ 2447 2448 1.3.12.1. Interfaces for Time Manipulation 2449 2450 An LSB conforming implementation shall provide the generic 2451 functions for Time Manipulation specified in Table 1-16, with 2452 the full mandatory functionality as described in the 2453 referenced underlying specification. 2454 2455 Table 1-16. libc - Time Manipulation Function Interfaces 2456 adjtime [1] ctime [2] gmtime [2] localtime_r [2] ualarm [2] 2457 asctime [2] ctime_r [2] gmtime_r [2] mktime [2] 2458 asctime_r [2] difftime [2] localtime [2] tzset [2] 2459 2460 Referenced Specification(s) 2461 2462 [1]. this specification 2463 2464 [2]. ISO POSIX (2003) 2465 2466 An LSB conforming implementation shall provide the generic 2467 data interfaces for Time Manipulation specified in Table 1-17, 2468 with the full mandatory functionality as described in the 2469 referenced underlying specification. 2470 2471 Table 1-17. libc - Time Manipulation Data Interfaces 2472 __daylight [1] __tzname [1] timezone [2] 2473 __timezone [1] daylight [2] tzname [2] 2474 2475 Referenced Specification(s) 2476 2477 [1]. this specification 2478 2479 [2]. ISO POSIX (2003) 2480 _________________________________________________________ 2481 2482 1.3.13. Terminal Interface Functions 2483 _________________________________________________________ 2484 2485 1.3.13.1. Interfaces for Terminal Interface Functions 2486 2487 An LSB conforming implementation shall provide the generic 2488 functions for Terminal Interface Functions specified in Table 2489 1-18, with the full mandatory functionality as described in 2490 the referenced underlying specification. 2491 2492 Table 1-18. libc - Terminal Interface Functions Function 2493 Interfaces 2494 cfgetispeed [1] cfsetispeed [1] tcdrain [1] tcgetattr [1] 2495 tcsendbreak [1] 2496 cfgetospeed [1] cfsetospeed [1] tcflow [1] tcgetpgrp [1] 2497 tcsetattr [1] 2498 cfmakeraw [2] cfsetspeed [2] tcflush [1] tcgetsid [1] 2499 tcsetpgrp [1] 2500 2501 Referenced Specification(s) 2502 2503 [1]. ISO POSIX (2003) 2504 2505 [2]. this specification 2506 _________________________________________________________ 2507 2508 1.3.14. System Database Interface 2509 _________________________________________________________ 2510 2511 1.3.14.1. Interfaces for System Database Interface 2512 2513 An LSB conforming implementation shall provide the generic 2514 functions for System Database Interface specified in Table 2515 1-19, with the full mandatory functionality as described in 2516 the referenced underlying specification. 2517 2518 Table 1-19. libc - System Database Interface Function 2519 Interfaces 2520 endgrent [1] getgrgid_r [1] getprotoent [1] getservent [1] 2521 setgroups [2] 2522 endprotoent [1] getgrnam [1] getpwent [1] getutent [2] 2523 setprotoent [1] 2524 endpwent [1] getgrnam_r [1] getpwnam [1] getutent_r [2] 2525 setpwent [1] 2526 endservent [1] getgrouplist [2] getpwnam_r [1] getutxent [1] 2527 setservent [1] 2528 endutent [3] gethostbyaddr [1] getpwuid [1] getutxid [1] 2529 setutent [2] 2530 endutxent [1] gethostbyname [1] getpwuid_r [1] getutxline [1] 2531 setutxent [1] 2532 getgrent [1] getprotobyname [1] getservbyname [1] pututxline 2533 [1] utmpname [2] 2534 getgrgid [1] getprotobynumber [1] getservbyport [1] setgrent 2535 [1] 2536 2537 Referenced Specification(s) 2538 2539 [1]. ISO POSIX (2003) 2540 2541 [2]. this specification 2542 2543 [3]. SUSv2 2544 _________________________________________________________ 2545 2546 1.3.15. Language Support 2547 _________________________________________________________ 2548 2549 1.3.15.1. Interfaces for Language Support 2550 2551 An LSB conforming implementation shall provide the generic 2552 functions for Language Support specified in Table 1-20, with 2553 the full mandatory functionality as described in the 2554 referenced underlying specification. 2555 2556 Table 1-20. libc - Language Support Function Interfaces 2557 __libc_start_main [1] __register_atfork(GLIBC_2.3.2) [1] 2558 2559 Referenced Specification(s) 2560 2561 [1]. this specification 2562 _________________________________________________________ 2563 2564 1.3.16. Large File Support 2565 _________________________________________________________ 2566 2567 1.3.16.1. Interfaces for Large File Support 2568 2569 An LSB conforming implementation shall provide the generic 2570 functions for Large File Support specified in Table 1-21, with 2571 the full mandatory functionality as described in the 2572 referenced underlying specification. 2573 2574 Table 1-21. libc - Large File Support Function Interfaces 2575 __fxstat64 [1] fopen64 [2] ftello64 [2] lseek64 [2] readdir64 2576 [2] 2577 __lxstat64 [1] freopen64 [2] ftruncate64 [2] mkstemp64 [2] 2578 statvfs64 [2] 2579 __xstat64 [1] fseeko64 [2] ftw64 [2] mmap64 [2] tmpfile64 [2] 2580 creat64 [2] fsetpos64 [2] getrlimit64 [2] nftw64 [2] 2581 truncate64 [2] 2582 fgetpos64 [2] fstatvfs64 [2] lockf64 [2] open64 [2] 2583 2584 Referenced Specification(s) 2585 2586 [1]. this specification 2587 2588 [2]. Large File Support 2589 _________________________________________________________ 2590 2591 1.3.17. Standard Library 2592 _________________________________________________________ 2593 2594 1.3.17.1. Interfaces for Standard Library 2595 2596 An LSB conforming implementation shall provide the generic 2597 functions for Standard Library specified in Table 1-22, with 2598 the full mandatory functionality as described in the 2599 referenced underlying specification. 2600 2601 Table 1-22. libc - Standard Library Function Interfaces 2602 _Exit [1] dirname [1] glob [1] lsearch [1] srand48 [1] 2603 __assert_fail [2] div [1] glob64 [2] makecontext [1] srandom 2604 [1] 2605 __cxa_atexit [2] drand48 [1] globfree [1] malloc [1] strtod 2606 [1] 2607 __errno_location [2] ecvt [1] globfree64 [2] memmem [2] strtol 2608 [1] 2609 __fpending [2] erand48 [1] grantpt [1] mkstemp [1] strtoul [1] 2610 __getpagesize [2] err [2] hcreate [1] mktemp [1] swapcontext 2611 [1] 2612 __isinf [2] error [2] hdestroy [1] mrand48 [1] syslog [1] 2613 __isinff [2] errx [2] hsearch [1] nftw [1] system [2] 2614 __isinfl [2] fcvt [1] htonl [1] nrand48 [1] tdelete [1] 2615 __isnan [2] fmtmsg [1] htons [1] ntohl [1] tfind [1] 2616 __isnanf [2] fnmatch [1] imaxabs [1] ntohs [1] tmpfile [1] 2617 __isnanl [2] fpathconf [1] imaxdiv [1] openlog [1] tmpnam [1] 2618 __sysconf [2] free [1] inet_addr [1] perror [1] tsearch [1] 2619 _exit [1] freeaddrinfo [1] inet_ntoa [1] posix_memalign [1] 2620 ttyname [1] 2621 _longjmp [1] ftrylockfile [1] inet_ntop [1] posix_openpt [1] 2622 ttyname_r [1] 2623 _setjmp [1] ftw [1] inet_pton [1] ptsname [1] twalk [1] 2624 a64l [1] funlockfile [1] initstate [1] putenv [1] unlockpt [1] 2625 abort [1] gai_strerror [1] insque [1] qsort [1] unsetenv [1] 2626 abs [1] gcvt [1] isatty [1] rand [1] usleep [1] 2627 atof [1] getaddrinfo [1] isblank [1] rand_r [1] verrx [2] 2628 atoi [1] getcwd [1] jrand48 [1] random [1] vfscanf [2] 2629 atol [1] getdate [1] l64a [1] realloc [1] vscanf [2] 2630 atoll [1] getenv [1] labs [1] realpath [1] vsscanf [2] 2631 basename [1] getlogin [1] lcong48 [1] remque [1] vsyslog [2] 2632 bsearch [1] getnameinfo [1] ldiv [1] seed48 [1] warn [2] 2633 calloc [1] getopt [2] lfind [1] setenv [1] warnx [2] 2634 closelog [1] getopt_long [2] llabs [1] sethostname [2] wordexp 2635 [1] 2636 confstr [1] getopt_long_only [2] lldiv [1] setlogmask [1] 2637 wordfree [1] 2638 cuserid [3] getsubopt [1] longjmp [1] setstate [1] 2639 daemon [2] gettimeofday [1] lrand48 [1] srand [1] 2640 2641 Referenced Specification(s) 2642 2643 [1]. ISO POSIX (2003) 2644 2645 [2]. this specification 2646 2647 [3]. SUSv2 2648 2649 An LSB conforming implementation shall provide the generic 2650 data interfaces for Standard Library specified in Table 1-23, 2651 with the full mandatory functionality as described in the 2652 referenced underlying specification. 2653 2654 Table 1-23. libc - Standard Library Data Interfaces 2655 __environ [1] _sys_errlist [1] getdate_err [2] opterr [2] 2656 optopt [2] 2657 _environ [1] environ [2] optarg [2] optind [2] 2658 2659 Referenced Specification(s) 2660 2661 [1]. this specification 2662 2663 [2]. ISO POSIX (2003) 2664 _________________________________________________________ 2665 2666 1.4. Data Definitions for libc 2667 2668 This section defines global identifiers and their values that 2669 are associated with interfaces contained in libc. These 2670 definitions are organized into groups that correspond to 2671 system headers. This convention is used as a convenience for 2672 the reader, and does not imply the existence of these headers, 2673 or their content. 2674 2675 These definitions are intended to supplement those provided in 2676 the referenced underlying specifications. 2677 2678 This specification uses ISO/IEC 9899 C Language as the 2679 reference programming language, and data definitions are 2680 specified in ISO C format. The C language is used here as a 2681 convenient notation. Using a C language description of these 2682 data objects does not preclude their use by other programming 2683 languages. 2684 _________________________________________________________ 2685 2686 1.4.1. ctype.h 2687 2688 enum 2689 { 2690 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint 2691 , 2692 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 2693 } 2694 ; 2695 _________________________________________________________ 2696 2697 1.4.2. dirent.h 2698 2699 typedef struct __dirstream DIR; 2700 2701 struct dirent 2702 { 2703 long int d_ino; 2704 off_t d_off; 2705 unsigned short d_reclen; 2706 unsigned char d_type; 2707 char d_name[256]; 2708 } 2709 ; 2710 struct dirent64 2711 { 2712 uint64_t d_ino; 2713 int64_t d_off; 2714 unsigned short d_reclen; 2715 unsigned char d_type; 2716 char d_name[256]; 2717 } 2718 ; 2719 _________________________________________________________ 2720 2721 1.4.3. errno.h 2722 2723 ISO POSIX (2003) requires that each error value shall be 2724 unique, with permission for EAGAIN and EWOULDBLOCK possibly 2725 having the same value. This specification also requires that 2726 ENOTSUP and EOPNOTSUPP have the same value. 2727 2728 Note: A defect report against ISO POSIX (2003) has been 2729 filed to request that specification also permit these two 2730 symbols to have the same value. 2731 2732 #define errno (*__errno_location()) 2733 2734 #define EPERM 1 2735 #define ECHILD 10 2736 #define ENETDOWN 100 2737 #define ENETUNREACH 101 2738 #define ENETRESET 102 2739 #define ECONNABORTED 103 2740 #define ECONNRESET 104 2741 #define ENOBUFS 105 2742 #define EISCONN 106 2743 #define ENOTCONN 107 2744 #define ESHUTDOWN 108 2745 #define ETOOMANYREFS 109 2746 #define EAGAIN 11 2747 #define ETIMEDOUT 110 2748 #define ECONNREFUSED 111 2749 #define EHOSTDOWN 112 2750 #define EHOSTUNREACH 113 2751 #define EALREADY 114 2752 #define EINPROGRESS 115 2753 #define ESTALE 116 2754 #define EUCLEAN 117 2755 #define ENOTNAM 118 2756 #define ENAVAIL 119 2757 #define ENOMEM 12 2758 #define EISNAM 120 2759 #define EREMOTEIO 121 2760 #define EDQUOT 122 2761 #define ENOMEDIUM 123 2762 #define EMEDIUMTYPE 124 2763 #define ECANCELED 125 2764 #define EACCES 13 2765 #define EFAULT 14 2766 #define ENOTBLK 15 2767 #define EBUSY 16 2768 #define EEXIST 17 2769 #define EXDEV 18 2770 #define ENODEV 19 2771 #define ENOENT 2 2772 #define ENOTDIR 20 2773 #define EISDIR 21 2774 #define EINVAL 22 2775 #define ENFILE 23 2776 #define EMFILE 24 2777 #define ENOTTY 25 2778 #define ETXTBSY 26 2779 #define EFBIG 27 2780 #define ENOSPC 28 2781 #define ESPIPE 29 2782 #define ESRCH 3 2783 #define EROFS 30 2784 #define EMLINK 31 2785 #define EPIPE 32 2786 #define EDOM 33 2787 #define ERANGE 34 2788 #define EDEADLK 35 2789 #define ENAMETOOLONG 36 2790 #define ENOLCK 37 2791 #define ENOSYS 38 2792 #define ENOTEMPTY 39 2793 #define EINTR 4 2794 #define ELOOP 40 2795 #define ENOMSG 42 2796 #define EIDRM 43 2797 #define ECHRNG 44 2798 #define EL2NSYNC 45 2799 #define EL3HLT 46 2800 #define EL3RST 47 2801 #define ELNRNG 48 2802 #define EUNATCH 49 2803 #define EIO 5 2804 #define ENOANO 55 2805 #define EBADRQC 56 2806 #define EBADSLT 57 2807 #define EBFONT 59 2808 #define ENXIO 6 2809 #define ENOSTR 60 2810 #define ENODATA 61 2811 #define ETIME 62 2812 #define ENOSR 63 2813 #define ENONET 64 2814 #define ENOPKG 65 2815 #define EREMOTE 66 2816 #define ENOLINK 67 2817 #define EADV 68 2818 #define ESRMNT 69 2819 #define E2BIG 7 2820 #define ECOMM 70 2821 #define EPROTO 71 2822 #define EMULTIHOP 72 2823 #define EDOTDOT 73 2824 #define EBADMSG 74 2825 #define EOVERFLOW 75 2826 #define ENOTUNIQ 76 2827 #define EBADFD 77 2828 #define EREMCHG 78 2829 #define ELIBACC 79 2830 #define ENOEXEC 8 2831 #define ELIBBAD 80 2832 #define ELIBSCN 81 2833 #define ELIBMAX 82 2834 #define ELIBEXEC 83 2835 #define EILSEQ 84 2836 #define ERESTART 85 2837 #define ESTRPIPE 86 2838 #define EUSERS 87 2839 #define ENOTSOCK 88 2840 #define EDESTADDRREQ 89 2841 #define EBADF 9 2842 #define EMSGSIZE 90 2843 #define EPROTOTYPE 91 2844 #define ENOPROTOOPT 92 2845 #define EPROTONOSUPPORT 93 2846 #define ESOCKTNOSUPPORT 94 2847 #define EOPNOTSUPP 95 2848 #define EPFNOSUPPORT 96 2849 #define EAFNOSUPPORT 97 2850 #define EADDRINUSE 98 2851 #define EADDRNOTAVAIL 99 2852 #define EWOULDBLOCK EAGAIN 2853 #define ENOTSUP EOPNOTSUPP 2854 _________________________________________________________ 2855 2856 1.4.4. fcntl.h 2857 2858 #define O_RDONLY 00 2859 #define O_ACCMODE 0003 2860 #define O_WRONLY 01 2861 #define O_CREAT 0100 2862 #define O_TRUNC 01000 2863 #define O_SYNC 010000 2864 #define O_RDWR 02 2865 #define O_EXCL 0200 2866 #define O_APPEND 02000 2867 #define O_ASYNC 020000 2868 #define O_NOCTTY 0400 2869 #define O_NDELAY 04000 2870 #define O_NONBLOCK 04000 2871 #define FD_CLOEXEC 1 2872 2873 struct flock 2874 { 2875 short l_type; 2876 short l_whence; 2877 off_t l_start; 2878 off_t l_len; 2879 pid_t l_pid; 2880 } 2881 ; 2882 struct flock64 2883 { 2884 short l_type; 2885 short l_whence; 2886 loff_t l_start; 2887 loff_t l_len; 2888 pid_t l_pid; 2889 } 2890 ; 2891 2892 #define F_DUPFD 0 2893 #define F_RDLCK 0 2894 #define F_GETFD 1 2895 #define F_WRLCK 1 2896 #define F_SETFD 2 2897 #define F_UNLCK 2 2898 #define F_GETFL 3 2899 #define F_SETFL 4 2900 #define F_GETLK 5 2901 #define F_SETLK 6 2902 #define F_SETLKW 7 2903 #define F_SETOWN 8 2904 #define F_GETOWN 9 2905 _________________________________________________________ 2906 2907 1.4.5. fmtmsg.h 2908 2909 #define MM_HARD 1 2910 #define MM_NRECOV 128 2911 #define MM_UTIL 16 2912 #define MM_SOFT 2 2913 #define MM_OPSYS 32 2914 #define MM_FIRM 4 2915 #define MM_RECOVER 64 2916 #define MM_APPL 8 2917 2918 #define MM_NOSEV 0 2919 #define MM_HALT 1 2920 #define MM_ERROR 2 2921 2922 #define MM_NULLLBL ((char *) 0) 2923 _________________________________________________________ 2924 2925 1.4.6. fnmatch.h 2926 2927 #define FNM_PATHNAME (1<<0) 2928 #define FNM_NOESCAPE (1<<1) 2929 #define FNM_PERIOD (1<<2) 2930 #define FNM_NOMATCH 1 2931 _________________________________________________________ 2932 2933 1.4.7. ftw.h 2934 2935 #define FTW_D FTW_D 2936 #define FTW_DNR FTW_DNR 2937 #define FTW_DP FTW_DP 2938 #define FTW_F FTW_F 2939 #define FTW_NS FTW_NS 2940 #define FTW_SL FTW_SL 2941 #define FTW_SLN FTW_SLN 2942 2943 enum 2944 { 2945 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 2946 } 2947 ; 2948 2949 enum 2950 { 2951 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 2952 } 2953 ; 2954 2955 struct FTW 2956 { 2957 int base; 2958 int level; 2959 } 2960 ; 2961 2962 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 2963 int __flag); 2964 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __stat 2965 us, 2966 int __flag); 2967 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 2968 int __flag, struct FTW * __info); 2969 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __sta 2970 tus, 2971 int __flag, struct FTW * __info); 2972 _________________________________________________________ 2973 2974 1.4.8. getopt.h 2975 2976 #define no_argument 0 2977 #define required_argument 1 2978 #define optional_argument 2 2979 2980 struct option 2981 { 2982 char *name; 2983 int has_arg; 2984 int *flag; 2985 int val; 2986 } 2987 ; 2988 _________________________________________________________ 2989 2990 1.4.9. glob.h 2991 2992 #define GLOB_ERR (1<<0) 2993 #define GLOB_MARK (1<<1) 2994 #define GLOB_BRACE (1<<10) 2995 #define GLOB_NOMAGIC (1<<11) 2996 #define GLOB_TILDE (1<<12) 2997 #define GLOB_ONLYDIR (1<<13) 2998 #define GLOB_TILDE_CHECK (1<<14) 2999 #define GLOB_NOSORT (1<<2) 3000 #define GLOB_DOOFFS (1<<3) 3001 #define GLOB_NOCHECK (1<<4) 3002 #define GLOB_APPEND (1<<5) 3003 #define GLOB_NOESCAPE (1<<6) 3004 #define GLOB_PERIOD (1<<7) 3005 #define GLOB_MAGCHAR (1<<8) 3006 #define GLOB_ALTDIRFUNC (1<<9) 3007 3008 #define GLOB_NOSPACE 1 3009 #define GLOB_ABORTED 2 3010 #define GLOB_NOMATCH 3 3011 #define GLOB_NOSYS 4 3012 3013 typedef struct 3014 { 3015 size_t gl_pathc; 3016 char **gl_pathv; 3017 size_t gl_offs; 3018 int gl_flags; 3019 void (*gl_closedir) (void *); 3020 struct dirent *(*gl_readdir) (void *); 3021 void *(*gl_opendir) (const char *); 3022 int (*gl_lstat) (const char *, struct stat *); 3023 int (*gl_stat) (const char *, struct stat *); 3024 } 3025 glob_t; 3026 3027 typedef struct 3028 { 3029 size_t gl_pathc; 3030 char **gl_pathv; 3031 size_t gl_offs; 3032 int gl_flags; 3033 void (*gl_closedir) (void *); 3034 struct dirent64 *(*gl_readdir64) (void *); 3035 void *(*gl_opendir) (const char *); 3036 int (*gl_lstat) (const char *, struct stat *); 3037 int (*gl_stat) (const char *, struct stat *); 3038 } 3039 glob64_t; 3040 _________________________________________________________ 3041 3042 1.4.10. grp.h 3043 3044 struct group 3045 { 3046 char *gr_name; 3047 char *gr_passwd; 3048 gid_t gr_gid; 3049 char **gr_mem; 3050 } 3051 ; 3052 _________________________________________________________ 3053 3054 1.4.11. iconv.h 3055 3056 typedef void *iconv_t; 3057 _________________________________________________________ 3058 3059 1.4.12. inttypes.h 3060 3061 typedef lldiv_t imaxdiv_t; 3062 typedef unsigned char uint8_t; 3063 typedef unsigned short uint16_t; 3064 typedef unsigned int uint32_t; 3065 _________________________________________________________ 3066 3067 1.4.13. langinfo.h 3068 3069 #define ABDAY_1 0x20000 3070 #define ABDAY_2 0x20001 3071 #define ABDAY_3 0x20002 3072 #define ABDAY_4 0x20003 3073 #define ABDAY_5 0x20004 3074 #define ABDAY_6 0x20005 3075 #define ABDAY_7 0x20006 3076 3077 #define DAY_1 0x20007 3078 #define DAY_2 0x20008 3079 #define DAY_3 0x20009 3080 #define DAY_4 0x2000A 3081 #define DAY_5 0x2000B 3082 #define DAY_6 0x2000C 3083 #define DAY_7 0x2000D 3084 3085 #define ABMON_1 0x2000E 3086 #define ABMON_2 0x2000F 3087 #define ABMON_3 0x20010 3088 #define ABMON_4 0x20011 3089 #define ABMON_5 0x20012 3090 #define ABMON_6 0x20013 3091 #define ABMON_7 0x20014 3092 #define ABMON_8 0x20015 3093 #define ABMON_9 0x20016 3094 #define ABMON_10 0x20017 3095 #define ABMON_11 0x20018 3096 #define ABMON_12 0x20019 3097 3098 #define MON_1 0x2001A 3099 #define MON_2 0x2001B 3100 #define MON_3 0x2001C 3101 #define MON_4 0x2001D 3102 #define MON_5 0x2001E 3103 #define MON_6 0x2001F 3104 #define MON_7 0x20020 3105 #define MON_8 0x20021 3106 #define MON_9 0x20022 3107 #define MON_10 0x20023 3108 #define MON_11 0x20024 3109 #define MON_12 0x20025 3110 3111 #define AM_STR 0x20026 3112 #define PM_STR 0x20027 3113 3114 #define D_T_FMT 0x20028 3115 #define D_FMT 0x20029 3116 #define T_FMT 0x2002A 3117 #define T_FMT_AMPM 0x2002B 3118 3119 #define ERA 0x2002C 3120 #define ERA_D_FMT 0x2002E 3121 #define ALT_DIGITS 0x2002F 3122 #define ERA_D_T_FMT 0x20030 3123 #define ERA_T_FMT 0x20031 3124 3125 #define CODESET 14 3126 3127 #define CRNCYSTR 0x4000F 3128 3129 #define RADIXCHAR 0x10000 3130 #define THOUSEP 0x10001 3131 #define YESEXPR 0x50000 3132 #define NOEXPR 0x50001 3133 #define YESSTR 0x50002 3134 #define NOSTR 0x50003 3135 _________________________________________________________ 3136 3137 1.4.14. limits.h 3138 3139 #define LLONG_MIN (-LLONG_MAX-1LL) 3140 #define ULLONG_MAX 18446744073709551615ULL 3141 #define OPEN_MAX 256 3142 #define PATH_MAX 4096 3143 #define LLONG_MAX 9223372036854775807LL 3144 #define SSIZE_MAX LONG_MAX 3145 3146 #define MB_LEN_MAX 16 3147 3148 #define SCHAR_MIN (-128) 3149 #define SCHAR_MAX 127 3150 #define UCHAR_MAX 255 3151 #define CHAR_BIT 8 3152 3153 #define SHRT_MIN (-32768) 3154 #define SHRT_MAX 32767 3155 #define USHRT_MAX 65535 3156 3157 #define INT_MIN (-INT_MAX-1) 3158 #define INT_MAX 2147483647 3159 #define __INT_MAX__ 2147483647 3160 #define UINT_MAX 4294967295U 3161 3162 #define LONG_MIN (-LONG_MAX-1L) 3163 3164 #define PTHREAD_KEYS_MAX 1024 3165 #define PTHREAD_STACK_MIN 16384 3166 #define PTHREAD_THREADS_MAX 16384 3167 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 3168 _________________________________________________________ 3169 3170 1.4.15. locale.h 3171 3172 struct lconv 3173 { 3174 char *decimal_point; 3175 char *thousands_sep; 3176 char *grouping; 3177 char *int_curr_symbol; 3178 char *currency_symbol; 3179 char *mon_decimal_point; 3180 char *mon_thousands_sep; 3181 char *mon_grouping; 3182 char *positive_sign; 3183 char *negative_sign; 3184 char int_frac_digits; 3185 char frac_digits; 3186 char p_cs_precedes; 3187 char p_sep_by_space; 3188 char n_cs_precedes; 3189 char n_sep_by_space; 3190 char p_sign_posn; 3191 char n_sign_posn; 3192 char int_p_cs_precedes; 3193 char int_p_sep_by_space; 3194 char int_n_cs_precedes; 3195 char int_n_sep_by_space; 3196 char int_p_sign_posn; 3197 char int_n_sign_posn; 3198 } 3199 ; 3200 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 3201 #define LC_CTYPE 0 3202 #define LC_NUMERIC 1 3203 #define