1 2 Linux Standard Base Core Specification 3.1 3 4 Copyright © 2004, 2005 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 PowerPC and PowerPC Architecture are trademarks of the IBM 41 Corporation. 42 43 OpenGL is a registered trademark of Silicon Graphics, Inc. 44 _________________________________________________________ 45 46 Table of Contents 47 Foreword 48 Introduction 49 I. Introductory Elements 50 51 1. Scope 52 53 1.1. General 54 1.2. Module Specific Scope 55 56 2. References 57 58 2.1. Normative References 59 2.2. Informative References/Bibliography 60 61 3. Requirements 62 63 3.1. Relevant Libraries 64 3.2. LSB Implementation Conformance 65 3.3. LSB Application Conformance 66 67 4. Definitions 68 5. Terminology 69 6. Documentation Conventions 70 7. Relationship To ISO/IEC 9945 POSIX 71 8. Relationship To Other Free Standards Group 72 Specifications 73 74 II. Executable And Linking Format (ELF) 75 76 9. Introduction 77 10. Low Level System Information 78 79 10.1. Operating System Interface 80 10.2. Machine Interface 81 82 11. Object Format 83 84 11.1. Object Files 85 11.2. Sections 86 11.3. Special Sections 87 11.4. Symbol Mapping 88 11.5. DWARF Extensions 89 11.6. Exception Frames 90 11.7. Symbol Versioning 91 11.8. ABI note tag 92 93 12. Dynamic Linking 94 95 12.1. Program Loading and Dynamic Linking 96 12.2. Program Header 97 12.3. Dynamic Entries 98 99 III. Base Libraries 100 101 13. Base Libraries 102 103 13.1. Introduction 104 13.2. Program Interpreter 105 13.3. Interfaces for libc 106 13.4. Data Definitions for libc 107 13.5. Interface Definitions for libc 108 13.6. Interfaces for libm 109 13.7. Data Definitions for libm 110 13.8. Interface Definitions for libm 111 13.9. Interfaces for libpthread 112 13.10. Data Definitions for libpthread 113 13.11. Interface Definitions for libpthread 114 13.12. Interfaces for libgcc_s 115 13.13. Data Definitions for libgcc_s 116 13.14. Interfaces for libdl 117 13.15. Data Definitions for libdl 118 13.16. Interface Definitions for libdl 119 13.17. Interfaces for librt 120 13.18. Interfaces for libcrypt 121 13.19. Interfaces for libpam 122 13.20. Data Definitions for libpam 123 13.21. Interface Definitions for libpam 124 125 IV. Utility Libraries 126 127 14. Utility Libraries 128 129 14.1. Introduction 130 14.2. Interfaces for libz 131 14.3. Data Definitions for libz 132 14.4. Interface Definitions for libz 133 14.5. Interfaces for libncurses 134 14.6. Data Definitions for libncurses 135 14.7. Interfaces for libutil 136 14.8. Interface Definitions for libutil 137 138 V. Commands and Utilities 139 140 15. Commands and Utilities 141 142 15.1. Commands and Utilities 143 15.2. Command Behavior 144 145 VI. Execution Environment 146 147 16. File System Hierarchy 148 149 16.1. /dev: Device Files 150 16.2. /etc: Host-specific system configuration 151 16.3. User Accounting Databases 152 16.4. Path For System Administration Utilities 153 154 17. Additional Recommendations 155 156 17.1. Recommendations for applications on ownership 157 and permissions 158 159 18. Additional Behaviors 160 161 18.1. Mandatory Optional Behaviors 162 163 19. Localization 164 165 19.1. Introduction 166 19.2. Regular Expressions 167 19.3. Pattern Matching Notation 168 169 VII. System Initialization 170 171 20. System Initialization 172 173 20.1. Cron Jobs 174 20.2. Init Script Actions 175 20.3. Comment Conventions for Init Scripts 176 20.4. Installation and Removal of Init Scripts 177 20.5. Run Levels 178 20.6. Facility Names 179 20.7. Script Names 180 20.8. Init Script Functions 181 182 VIII. Users & Groups 183 184 21. Users & Groups 185 186 21.1. User and Group Database 187 21.2. User & Group Names 188 21.3. User ID Ranges 189 21.4. Rationale 190 191 IX. Package Format and Installation 192 193 22. Software Installation 194 195 22.1. Introduction 196 22.2. Package File Format 197 22.3. Package Script Restrictions 198 22.4. Package Tools 199 22.5. Package Naming 200 22.6. Package Dependencies 201 22.7. Package Architecture Considerations 202 203 A. Alphabetical Listing of Interfaces 204 205 A.1. libc 206 A.2. libcrypt 207 A.3. libdl 208 A.4. libm 209 A.5. libncurses 210 A.6. libpam 211 A.7. libpthread 212 A.8. librt 213 A.9. libutil 214 A.10. libz 215 216 B. Future Directions (Informative) 217 218 B.1. Introduction 219 B.2. Commands And Utilities 220 221 lsbinstall -- installation tool for various types 222 of data 223 224 C. GNU Free Documentation License (Informative) 225 226 C.1. PREAMBLE 227 C.2. APPLICABILITY AND DEFINITIONS 228 C.3. VERBATIM COPYING 229 C.4. COPYING IN QUANTITY 230 C.5. MODIFICATIONS 231 C.6. COMBINING DOCUMENTS 232 C.7. COLLECTIONS OF DOCUMENTS 233 C.8. AGGREGATION WITH INDEPENDENT WORKS 234 C.9. TRANSLATION 235 C.10. TERMINATION 236 C.11. FUTURE REVISIONS OF THIS LICENSE 237 C.12. How to use this License for your documents 238 239 List of Figures 240 11-1. Version Definition Entries 241 11-2. Version Definition Auxiliary Entries 242 11-3. Version Needed Entries 243 11-4. Version Needed Auxiliary Entries 244 12-1. Dynamic Structure 245 246 List of Tables 247 2-1. Normative References 248 2-2. Other References 249 3-1. Standard Library Names 250 3-2. Standard Library Names defined in the Architecture 251 Specific Supplement 252 253 10-1. Scalar Types 254 11-1. ELF Section Types 255 11-2. Additional Section Types 256 11-3. ELF Special Sections 257 11-4. Additional Special Sections 258 11-5. DWARF Exception Header value format 259 11-6. DWARF Exception Header application 260 11-7. Additional DWARF Call Frame Instructions 261 11-8. Call Frame Information Format 262 11-9. Common Information Entry Format 263 11-10. Frame Description Entry Format 264 11-11. .eh_frame_hdr Section Format 265 12-1. Linux Segment Types 266 13-1. libc Definition 267 13-2. libc - RPC Function Interfaces 268 13-3. libc - System Calls Function Interfaces 269 13-4. libc - Standard I/O Function Interfaces 270 13-5. libc - Standard I/O Data Interfaces 271 13-6. libc - Signal Handling Function Interfaces 272 13-7. libc - Signal Handling Data Interfaces 273 13-8. libc - Localization Functions Function Interfaces 274 13-9. libc - Localization Functions Data Interfaces 275 13-10. libc - Socket Interface Function Interfaces 276 13-11. libc - Wide Characters Function Interfaces 277 13-12. libc - String Functions Function Interfaces 278 13-13. libc - IPC Functions Function Interfaces 279 13-14. libc - Regular Expressions Function Interfaces 280 13-15. libc - Character Type Functions Function Interfaces 281 13-16. libc - Time Manipulation Function Interfaces 282 13-17. libc - Time Manipulation Data Interfaces 283 13-18. libc - Terminal Interface Functions Function Interfaces 284 13-19. libc - System Database Interface Function Interfaces 285 13-20. libc - Language Support Function Interfaces 286 13-21. libc - Large File Support Function Interfaces 287 13-22. libc - Standard Library Function Interfaces 288 13-23. libc - Standard Library Data Interfaces 289 13-24. libm Definition 290 13-25. libm - Math Function Interfaces 291 13-26. libm - Math Data Interfaces 292 13-27. libpthread Definition 293 13-28. libpthread - Realtime Threads Function Interfaces 294 13-29. libpthread - Posix Threads Function Interfaces 295 13-30. libpthread - Thread aware versions of libc interfaces 296 Function Interfaces 297 298 13-31. libgcc_s Definition 299 13-32. libdl Definition 300 13-33. libdl - Dynamic Loader Function Interfaces 301 13-34. librt Definition 302 13-35. librt - Shared Memory Objects Function Interfaces 303 13-36. librt - Clock Function Interfaces 304 13-37. librt - Timers Function Interfaces 305 13-38. libcrypt Definition 306 13-39. libcrypt - Encryption Function Interfaces 307 13-40. libpam Definition 308 13-41. libpam - Pluggable Authentication API Function 309 Interfaces 310 311 14-1. libz Definition 312 14-2. libz - Compression Library Function Interfaces 313 14-3. libncurses Definition 314 14-4. libncurses - Curses Function Interfaces 315 14-5. libncurses - Curses Data Interfaces 316 14-6. libutil Definition 317 14-7. libutil - Utility Functions Function Interfaces 318 15-1. Commands And Utilities 319 15-2. Built In Utilities 320 15-1. Escape Sequences 321 21-1. Required User & Group Names 322 21-2. Optional User & Group Names 323 22-1. RPM File Format 324 22-2. Signature Format 325 22-3. Index Type values 326 22-4. Header Private Tag Values 327 22-5. Signature Tag Values 328 22-6. Signature Digest Tag Values 329 22-7. Signature Signing Tag Values 330 22-8. Package Info Tag Values 331 22-9. Installation Tag Values 332 22-10. File Info Tag Values 333 22-11. File Flags 334 22-12. Package Dependency Tag Values 335 22-13. Index Type values 336 22-14. Package Dependency Attributes 337 22-15. Other Tag Values 338 22-16. CPIO File Format 339 A-1. libc Function Interfaces 340 A-2. libc Data Interfaces 341 A-3. libcrypt Function Interfaces 342 A-4. libdl Function Interfaces 343 A-5. libm Function Interfaces 344 A-6. libm Data Interfaces 345 A-7. libncurses Function Interfaces 346 A-8. libncurses Data Interfaces 347 A-9. libpam Function Interfaces 348 A-10. libpthread Function Interfaces 349 A-11. librt Function Interfaces 350 A-12. libutil Function Interfaces 351 A-13. libz Function Interfaces 352 _________________________________________________________ 353 354 Foreword 355 356 This is version 3.1 of the Linux Standard Base Core 357 Specification. This specification is part of a family of 358 specifications under the general title "Linux Standard Base". 359 Developers of applications or implementations interested in 360 using the LSB trademark should see the Free Standards Group 361 Certification Policy for details. 362 _________________________________________________________ 363 364 Introduction 365 366 The LSB defines a binary interface for application programs 367 that are compiled and packaged for LSB-conforming 368 implementations on many different hardware architectures. 369 Since a binary specification shall include information 370 specific to the computer processor architecture for which it 371 is intended, it is not possible for a single document to 372 specify the interface for all possible LSB-conforming 373 implementations. Therefore, the LSB is a family of 374 specifications, rather than a single one. 375 376 This document should be used in conjunction with the documents 377 it references. This document enumerates the system components 378 it includes, but descriptions of those components may be 379 included entirely or partly in this document, partly in other 380 documents, or entirely in other reference documents. For 381 example, the section that describes system service routines 382 includes a list of the system routines supported in this 383 interface, formal declarations of the data structures they use 384 that are visible to applications, and a pointer to the 385 underlying referenced specification for information about the 386 syntax and semantics of each call. Only those routines not 387 described in standards referenced by this document, or 388 extensions to those standards, are described in the detail. 389 Information referenced in this way is as much a part of this 390 document as is the information explicitly included here. 391 392 The specification carries a version number of either the form 393 x.y or x.y.z. This version number carries the following 394 meaning: 395 396 * The first number (x) is the major version number. All 397 versions with the same major version number should share 398 binary compatibility. Any addition or deletion of a new 399 library results in a new version number. Interfaces marked 400 as deprecated may be removed from the specification at a 401 major version change. 402 * The second number (y) is the minor version number. 403 Individual interfaces may be added if all certified 404 implementations already had that (previously undocumented) 405 interface. Interfaces may be marked as deprecated at a 406 minor version change. Other minor changes may be permitted 407 at the discretion of the LSB workgroup. 408 * The third number (z), if present, is the editorial level. 409 Only editorial changes should be included in such 410 versions. 411 412 Since this specification is a descriptive Application Binary 413 Interface, and not a source level API specification, it is not 414 possible to make a guarantee of 100% backward compatibility 415 between major releases. However, it is the intent that those 416 parts of the binary interface that are visible in the source 417 level API will remain backward compatible from version to 418 version, except where a feature marked as "Deprecated" in one 419 release may be removed from a future release. 420 421 Implementors are strongly encouraged to make use of symbol 422 versioning to permit simultaneous support of applications 423 conforming to different releases of this specification. 424 425 I. Introductory Elements 426 427 Table of Contents 428 1. Scope 429 430 1.1. General 431 1.2. Module Specific Scope 432 433 2. References 434 435 2.1. Normative References 436 2.2. Informative References/Bibliography 437 438 3. Requirements 439 440 3.1. Relevant Libraries 441 3.2. LSB Implementation Conformance 442 3.3. LSB Application Conformance 443 444 4. Definitions 445 5. Terminology 446 6. Documentation Conventions 447 7. Relationship To ISO/IEC 9945 POSIX 448 8. Relationship To Other Free Standards Group Specifications 449 _________________________________________________________ 450 451 Chapter 1. Scope 452 453 1.1. General 454 455 The Linux Standard Base (LSB) defines a system interface for 456 compiled applications and a minimal environment for support of 457 installation scripts. Its purpose is to enable a uniform 458 industry standard environment for high-volume applications 459 conforming to the LSB. 460 461 These specifications are composed of two basic parts: A common 462 specification ("LSB-generic" or "generic LSB") describing 463 those parts of the interface that remain constant across all 464 implementations of the LSB, and an architecture-specific 465 supplement ("LSB-arch" or "archLSB") describing the parts of 466 the interface that vary by processor architecture. Together, 467 the LSB-generic and the architecture-specific supplement for a 468 single hardware architecture provide a complete interface 469 specification for compiled application programs on systems 470 that share a common hardware architecture. 471 472 The LSB-generic document shall be used in conjunction with an 473 architecture-specific supplement. Whenever a section of the 474 LSB-generic specification shall be supplemented by 475 architecture-specific information, the LSB-generic document 476 includes a reference to the architecture supplement. 477 Architecture supplements may also contain additional 478 information that is not referenced in the LSB-generic 479 document. 480 481 The LSB contains both a set of Application Program Interfaces 482 (APIs) and Application Binary Interfaces (ABIs). APIs may 483 appear in the source code of portable applications, while the 484 compiled binary of that application may use the larger set of 485 ABIs. A conforming implementation shall provide all of the 486 ABIs listed here. The compilation system may replace (e.g. by 487 macro definition) certain APIs with calls to one or more of 488 the underlying binary interfaces, and may insert calls to 489 binary interfaces as needed. 490 491 The LSB is primarily a binary interface definition. Not all of 492 the source level APIs available to applications may be 493 contained in this specification. 494 _________________________________________________________ 495 496 1.2. Module Specific Scope 497 498 This is the Core module of the Linux Standards Base (LSB). 499 This module provides the fundamental system interfaces, 500 libraries, and runtime environment upon which all conforming 501 applications and libraries depend. 502 503 Interfaces described in this module are mandatory except where 504 explicitly listed otherwise. Core interfaces may be 505 supplemented by other modules; all modules are built upon the 506 core. 507 _________________________________________________________ 508 509 Chapter 2. References 510 511 2.1. Normative References 512 513 The following referenced documents are indispensable for the 514 application of this document. For dated references, only the 515 edition cited applies. For undated references, the latest 516 edition of the referenced document (including any amendments) 517 applies. 518 519 Note: Where copies of a document are available on the World 520 Wide Web, a Uniform Resource Locator (URL) is given for 521 informative purposes only. This may point to a more recent 522 copy of the referenced specification, or may be out of 523 date. Reference copies of specifications at the revision 524 level indicated may be found at the Free Standards Group's 525 Reference Specifications site. 526 527 Table 2-1. Normative References 528 Name Title URL 529 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 530 (FHS) 2.3 http://www.pathname.com/fhs/ 531 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 532 floating-point arithmetic for microprocessor systems 533 http://www.ieee.org/ 534 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 535 ISO POSIX (2003) 536 537 ISO/IEC 9945-1:2003 Information technology -- Portable 538 Operating System Interface (POSIX) -- Part 1: Base Definitions 539 540 ISO/IEC 9945-2:2003 Information technology -- Portable 541 Operating System Interface (POSIX) -- Part 2: System 542 Interfaces 543 544 ISO/IEC 9945-3:2003 Information technology -- Portable 545 Operating System Interface (POSIX) -- Part 3: Shell and 546 Utilities 547 548 ISO/IEC 9945-4:2003 Information technology -- Portable 549 Operating System Interface (POSIX) -- Part 4: Rationale 550 551 Including Technical Cor. 1: 2004 552 http://www.unix.org/version3/ 553 Itanium C++ ABI Itanium C++ ABI (Revision 1.83) 554 http://refspecs.freestandards.org/cxxabi-1.83.html 555 Large File Support Large File Support 556 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 557 SUSv2 CAE Specification, January 1997, System Interfaces and 558 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 559 http://www.opengroup.org/publications/catalog/un.htm 560 SUSv2 Commands and Utilities The Single UNIX® 561 Specification(SUS) Version 2, Commands and Utilities (XCU), 562 Issue 5 (ISBN: 1-85912-191-8, C604) 563 http://www.opengroup.org/publications/catalog/un.htm 564 SVID Issue 3 American Telephone and Telegraph Company, System 565 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 566 1989.(ISBN 0201566524) 567 SVID Issue 4 System V Interface Definition,Fourth Edition 568 System V ABI System V Application Binary Interface, Edition 569 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 570 System V ABI Update System V Application Binary Interface - 571 DRAFT - 17 December 2003 572 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 573 l 574 X/Open Curses CAE Specification, May 1996, X/Open Curses, 575 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 576 Corrigendum U018 577 http://www.opengroup.org/publications/catalog/un.htm 578 _________________________________________________________ 579 580 2.2. Informative References/Bibliography 581 582 In addition, the specifications listed below provide essential 583 background information to implementors of this specification. 584 These references are included for information only. 585 586 Table 2-2. Other References 587 Name Title URL 588 DWARF Debugging Information Format, Revision 2.0.0 DWARF 589 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 590 http://refspecs.freestandards.org/dwarf/dwarf-2.0.0.pdf 591 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 592 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 593 http://refspecs.freestandards.org/dwarf/ 594 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 595 Specification method for cultural conventions 596 ITU-T V.42 International Telecommunication Union 597 Recommendation V.42 (2002): Error-correcting procedures for 598 DCEs using asynchronous-to-synchronous conversionITUV 599 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 600 parent=T-REC-V.42 601 Li18nux Globalization Specification LI18NUX 2000 Globalization 602 Specification, Version 1.0 with Amendment 4 603 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 604 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 605 http://www.lanana.org/docs/device-list/devices.txt 606 PAM Open Software Foundation, Request For Comments: 86.0 , 607 October 1995, V. Samar & R.Schemers (SunSoft) 608 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 609 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 610 MD5 Message-Digest Algorithm 611 http://www.ietf.org/rfc/rfc1321.txt 612 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 613 http://www.ietf.org/ 614 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 615 1833: Binding Protocols for ONC RPC Version 2 616 http://www.ietf.org/rfc/rfc1833.txt 617 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 618 1950: ZLIB Compressed Data Format Specification 619 http://www.ietf.org/rfc/rfc1950.txt 620 RFC 1951: DEFLATE Compressed Data Format Specification IETF 621 RFC 1951: DEFLATE Compressed Data Format Specification version 622 1.3 http://www.ietf.org/rfc/rfc1951.txt 623 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 624 file format specification version 4.3 625 http://www.ietf.org/rfc/rfc1952.txt 626 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 627 Message Format http://www.ietf.org/rfc/rfc2440.txt 628 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 629 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 630 RFC 2822:Internet Message Format IETF RFC 2822: Internet 631 Message Format http://www.ietf.org/rfc/rfc2822.txt 632 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 633 Specification http://www.ietf.org/rfc/rfc791.txt 634 RPM Package Format RPM Package Format V3.0 635 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format. 636 html 637 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 638 _________________________________________________________ 639 640 Chapter 3. Requirements 641 642 3.1. Relevant Libraries 643 644 The libraries listed in Table 3-1 shall be available on a 645 Linux Standard Base system, with the specified runtime names. 646 The libraries listed in Table 3-2 are architecture specific, 647 but shall be available on all LSB conforming systems. This 648 list may be supplemented or amended by the architecture 649 specific supplement. 650 651 Table 3-1. Standard Library Names 652 Library Runtime Name 653 libdl libdl.so.2 654 libcrypt libcrypt.so.1 655 libz libz.so.1 656 libncurses libncurses.so.5 657 libutil libutil.so.1 658 libpthread libpthread.so.0 659 librt librt.so.1 660 libpam libpam.so.0 661 libgcc_s libgcc_s.so.1 662 663 Table 3-2. Standard Library Names defined in the Architecture 664 Specific Supplement 665 Library Runtime Name 666 libm See archLSB 667 libc See archLSB 668 proginterp See archLSB 669 670 These libraries will be in an implementation-defined directory 671 which the dynamic linker shall search by default. 672 _________________________________________________________ 673 674 3.2. LSB Implementation Conformance 675 676 A conforming implementation is necessarily architecture 677 specific, and must provide the interfaces specified by both 678 the generic LSB Core specification and its relevant 679 architecture specific supplement. 680 681 Rationale: An implementation must provide at least the 682 interfaces specified in these specifications. It may also 683 provide additional interfaces. 684 685 A conforming implementation shall satisfy the following 686 requirements: 687 688 * A processor architecture represents a family of related 689 processors which may not have identical feature sets. The 690 architecture specific supplement to this specification for 691 a given target processor architecture describes a minimum 692 acceptable processor. The implementation shall provide all 693 features of this processor, whether in hardware or through 694 emulation transparent to the application. 695 * The implementation shall be capable of executing compiled 696 applications having the format and using the system 697 interfaces described in this document. 698 * The implementation shall provide libraries containing the 699 interfaces specified by this document, and shall provide a 700 dynamic linking mechanism that allows these interfaces to 701 be attached to applications at runtime. All the interfaces 702 shall behave as specified in this document. 703 * The map of virtual memory provided by the implementation 704 shall conform to the requirements of this document. 705 * The implementation's low-level behavior with respect to 706 function call linkage, system traps, signals, and other 707 such activities shall conform to the formats described in 708 this document. 709 * The implementation shall provide all of the mandatory 710 interfaces in their entirety. 711 * The implementation may provide one or more of the optional 712 interfaces. Each optional interface that is provided shall 713 be provided in its entirety. The product documentation 714 shall state which optional interfaces are provided. 715 * The implementation shall provide all files and utilities 716 specified as part of this document in the format defined 717 here and in other referenced documents. All commands and 718 utilities shall behave as required by this document. The 719 implementation shall also provide all mandatory components 720 of an application's runtime environment that are included 721 or referenced in this document. 722 * The implementation, when provided with standard data 723 formats and values at a named interface, shall provide the 724 behavior defined for those values and data formats at that 725 interface. However, a conforming implementation may 726 consist of components which are separately packaged and/or 727 sold. For example, a vendor of a conforming implementation 728 might sell the hardware, operating system, and windowing 729 system as separately packaged items. 730 * The implementation may provide additional interfaces with 731 different names. It may also provide additional behavior 732 corresponding to data values outside the standard ranges, 733 for standard named interfaces. 734 _________________________________________________________ 735 736 3.3. LSB Application Conformance 737 738 A conforming application is necessarily architecture specific, 739 and must conform to both the generic LSB Core specification 740 and its relevant architecture specific supplement. 741 742 A conforming application shall satisfy the following 743 requirements: 744 745 * Its executable files shall be either shell scripts or 746 object files in the format defined for the Object File 747 Format system interface. 748 * Its object files shall participate in dynamic linking as 749 defined in the Program Loading and Linking System 750 interface. 751 * It shall employ only the instructions, traps, and other 752 low-level facilities defined in the Low-Level System 753 interface as being for use by applications. 754 * If it requires any optional interface defined in this 755 document in order to be installed or to execute 756 successfully, the requirement for that optional interface 757 shall be stated in the application's documentation. 758 * It shall not use any interface or data format that is not 759 required to be provided by a conforming implementation, 760 unless: 761 + If such an interface or data format is supplied by 762 another application through direct invocation of that 763 application during execution, that application shall 764 be in turn an LSB conforming application. 765 + The use of that interface or data format, as well as 766 its source, shall be identified in the documentation 767 of the application. 768 * It shall not use any values for a named interface that are 769 reserved for vendor extensions. 770 771 A strictly conforming application shall not require or use any 772 interface, facility, or implementation-defined extension that 773 is not defined in this document in order to be installed or to 774 execute successfully. 775 _________________________________________________________ 776 777 Chapter 4. Definitions 778 779 For the purposes of this document, the following definitions, 780 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 781 Edition, apply: 782 783 can 784 785 be able to; there is a possibility of; it is possible to 786 cannot 787 788 be unable to; there is no possibilty of; it is not possible to 789 may 790 791 is permitted; is allowed; is permissible 792 need not 793 794 it is not required that; no...is required 795 shall 796 797 is to; is required to; it is required that; has to; only...is 798 permitted; it is necessary 799 shall not 800 801 is not allowed [permitted] [acceptable] [permissible]; is 802 required to be not; is required that...be not; is not to be 803 should 804 805 it is recommended that; ought to 806 should not 807 808 it is not recommended that; ought not to 809 _________________________________________________________ 810 811 Chapter 5. Terminology 812 813 For the purposes of this document, the following terms apply: 814 815 archLSB 816 The architectural part of the LSB Specification which 817 describes the specific parts of the interface that are 818 platform specific. The archLSB is complementary to the 819 gLSB. 820 821 Binary Standard 822 The total set of interfaces that are available to be 823 used in the compiled binary code of a conforming 824 application. 825 826 gLSB 827 The common part of the LSB Specification that describes 828 those parts of the interface that remain constant 829 across all hardware implementations of the LSB. 830 831 implementation-defined 832 Describes a value or behavior that is not defined by 833 this document but is selected by an implementor. The 834 value or behavior may vary among implementations that 835 conform to this document. An application should not 836 rely on the existence of the value or behavior. An 837 application that relies on such a value or behavior 838 cannot be assured to be portable across conforming 839 implementations. The implementor shall document such a 840 value or behavior so that it can be used correctly by 841 an application. 842 843 Shell Script 844 A file that is read by an interpreter (e.g., awk). The 845 first line of the shell script includes a reference to 846 its interpreter binary. 847 848 Source Standard 849 The set of interfaces that are available to be used in 850 the source code of a conforming application. 851 852 undefined 853 Describes the nature of a value or behavior not defined 854 by this document which results from use of an invalid 855 program construct or invalid data input. The value or 856 behavior may vary among implementations that conform to 857 this document. An application should not rely on the 858 existence or validity of the value or behavior. An 859 application that relies on any particular value or 860 behavior cannot be assured to be portable across 861 conforming implementations. 862 863 unspecified 864 Describes the nature of a value or behavior not 865 specified by this document which results from use of a 866 valid program construct or valid data input. The value 867 or behavior may vary among implementations that conform 868 to this document. An application should not rely on the 869 existence or validity of the value or behavior. An 870 application that relies on any particular value or 871 behavior cannot be assured to be portable across 872 conforming implementations. 873 874 Other terms and definitions used in this document shall have 875 the same meaning as defined in Chapter 3 of the Base 876 Definitions volume of ISO POSIX (2003). 877 _________________________________________________________ 878 879 Chapter 6. Documentation Conventions 880 881 Throughout this document, the following typographic 882 conventions are used: 883 884 function() 885 886 the name of a function 887 command 888 889 the name of a command or utility 890 CONSTANT 891 892 a constant value 893 parameter 894 895 a parameter 896 variable 897 898 a variable 899 900 Throughout this specification, several tables of interfaces 901 are presented. Each entry in these tables has the following 902 format: 903 904 name 905 906 the name of the interface 907 (symver) 908 909 An optional symbol version identifier, if required. 910 [refno] 911 912 A reference number indexing the table of referenced 913 specifications that follows this table. 914 915 For example, 916 917 forkpty(GLIBC_2.0) [SUSv3] 918 919 refers to the interface named forkpty() with symbol version 920 GLIBC_2.0 that is defined in the SUSv3 reference. 921 922 Note: Symbol versions are defined in the architecture 923 specific supplements only. 924 _________________________________________________________ 925 926 Chapter 7. Relationship To ISO/IEC 9945 POSIX 927 928 This specification includes many interfaces described in ISO 929 POSIX (2003). Unless otherwise specified, such interfaces 930 should behave exactly as described in that specification. Any 931 conflict between the requirements described here and the ISO 932 POSIX (2003) standard is unintentional, except as explicitly 933 noted otherwise. 934 935 Note: In addition to the differences noted inline in this 936 specification, PDTR 24715 has extracted the differences 937 between this specification and ISO POSIX (2003) into a 938 single place. It is the long term plan of the Free 939 Standards Group to converge the LSB Core Specification with 940 ISO/IEC 9945 POSIX. 941 942 The LSB Specification Authority is responsible for deciding 943 the meaning of conformance to normative referenced standards 944 in the LSB context. Problem Reports regarding underlying or 945 referenced standards in any other context will be referred to 946 the relevant maintenance body for that standard. 947 _________________________________________________________ 948 949 Chapter 8. Relationship To Other Free Standards Group Specifications 950 951 The LSB is the base for several other specification projects 952 under the umbrella of the Free Standards Group (FSG). This 953 specification is the foundation, and other specifications 954 build on the interfaces defined here. However, beyond those 955 specifications listed as Normative References, this 956 specification has no dependencies on other FSG projects. 957 958 II. Executable And Linking Format (ELF) 959 960 Table of Contents 961 9. Introduction 962 10. Low Level System Information 963 964 10.1. Operating System Interface 965 10.2. Machine Interface 966 967 10.2.1. Data Representation 968 969 11. Object Format 970 971 11.1. Object Files 972 11.2. Sections 973 974 11.2.1. Introduction 975 11.2.2. Sections Types 976 977 11.3. Special Sections 978 979 11.3.1. Special Sections 980 981 11.4. Symbol Mapping 982 983 11.4.1. Introduction 984 985 11.5. DWARF Extensions 986 987 11.5.1. DWARF Exception Header Encoding 988 11.5.2. DWARF CFI Extensions 989 990 11.6. Exception Frames 991 992 11.6.1. The .eh_frame section 993 11.6.2. The .eh_frame_hdr section 994 995 11.7. Symbol Versioning 996 997 11.7.1. Introduction 998 11.7.2. Symbol Version Table 999 11.7.3. Version Definitions 1000 11.7.4. Version Requirements 1001 11.7.5. Startup Sequence 1002 11.7.6. Symbol Resolution 1003 1004 11.8. ABI note tag 1005 1006 12. Dynamic Linking 1007 1008 12.1. Program Loading and Dynamic Linking 1009 12.2. Program Header 1010 12.3. Dynamic Entries 1011 1012 12.3.1. Introduction 1013 12.3.2. Dynamic Entries 1014 _________________________________________________________ 1015 1016 Chapter 9. Introduction 1017 1018 Executable and Linking Format (ELF) defines the object format 1019 for compiled applications. This specification supplements the 1020 information found in System V ABI Update and is intended to 1021 document additions made since the publication of that 1022 document. 1023 _________________________________________________________ 1024 1025 Chapter 10. Low Level System Information 1026 1027 10.1. Operating System Interface 1028 1029 LSB-conforming applications shall assume that stack, heap and 1030 other allocated memory regions will be non-executable. The 1031 application must take steps to make them executable if needed. 1032 _________________________________________________________ 1033 1034 10.2. Machine Interface 1035 1036 10.2.1. Data Representation 1037 1038 LSB-conforming applications shall use the data representation 1039 as defined in the Arcitecture specific ELF documents. 1040 _________________________________________________________ 1041 1042 10.2.1.1. Fundamental Types 1043 1044 In addition to the fundamental types specified in the 1045 architecture specific supplement, a 1 byte data type is 1046 defined here. 1047 1048 Table 10-1. Scalar Types 1049 Type C C++ sizeof Alignment (bytes) Architecture 1050 Representation 1051 Integral _Bool bool 1 1 byte 1052 _________________________________________________________ 1053 1054 Chapter 11. Object Format 1055 1056 11.1. Object Files 1057 1058 LSB-conforming implementations shall support the object file 1059 Executable and Linking Format (ELF), which is defined by the 1060 following documents: 1061 1062 * System V ABI 1063 * System V ABI Update 1064 * this specification 1065 * an architecture specific supplement to this specification 1066 1067 Conforming implementations may also support other unspecified 1068 object file formats. 1069 _________________________________________________________ 1070 1071 11.2. Sections 1072 1073 11.2.1. Introduction 1074 1075 As described in System V ABI, an ELF object file contains a 1076 number of sections. 1077 _________________________________________________________ 1078 1079 11.2.2. Sections Types 1080 1081 The section header table is an array of Elf32_Shdr or 1082 Elf64_Shdr structures as described in System V ABI. The 1083 sh_type member shall be either a value from Table 11-1, drawn 1084 from the System V ABI, or one of the additional values 1085 specified in Table 11-2. 1086 1087 A section header's sh_type member specifies the sections's 1088 semantics. 1089 _________________________________________________________ 1090 1091 11.2.2.1. ELF Section Types 1092 1093 The following section types are defined in the System V ABI 1094 and the System V ABI Update. 1095 1096 Table 11-1. ELF Section Types 1097 Name Value Description 1098 SHT_DYNAMIC 0x6 The section holds information for dynamic 1099 linking. Currently, an object file shall have only one dynamic 1100 section, but this restriction may be relaxed in the future. 1101 See `Dynamic Section' in Chapter 5 for details. 1102 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1103 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1104 an object file may have either a section of SHT_SYMTAB type or 1105 a section of SHT_DYNSYM type, but not both. This restriction 1106 may be relaxed in the future. 1107 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1108 to termination functions, as described in `Initialization and 1109 Termination Functions' in Chapter 5. Each pointer in the array 1110 is taken as a parameterless procedure with a void return. 1111 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1112 an object file shall have only one hash table, but this 1113 restriction may be relaxed in the future. See `Hash Table' in 1114 the Chapter 5 for details. 1115 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1116 to initialization functions, as described in `Initialization 1117 and Termination Functions' in Chapter 5. Each pointer in the 1118 array is taken as a parameterless procedure with a void 1119 return. 1120 SHT_NOBITS 0x8 A section of this type occupies no space in the 1121 file but otherwise resembles SHT_PROGBITS. Although this 1122 section contains no bytes, the sh_offset member contains the 1123 conceptual file offset. 1124 SHT_NOTE 0x7 The section holds information that marks the file 1125 in some way. See `Note Section' in Chapter 5 for details. 1126 SHT_NULL 0x0 This value marks the section header as inactive; 1127 it does not have an associated section. Other members of the 1128 section header have undefined values. 1129 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1130 pointers to functions that are invoked before all other 1131 initialization functions, as described in `Initialization and 1132 Termination Functions' in Chapter 5. Each pointer in the array 1133 is taken as a parameterless proceure with a void return. 1134 SHT_PROGBITS 0x1 The section holds information defined by the 1135 program, whose format and meaning are determined solely by the 1136 program. 1137 SHT_REL 0x9 The section holds relocation entries without 1138 explicit addends, such as type Elf32_Rel for the 32-bit class 1139 of object files or type Elf64_Rel for the 64-bit class of 1140 object files. An object file may have multiple relocation 1141 sections. See "Relocation" 1142 SHT_RELA 0x4 The section holds relocation entries with 1143 explicit addends, such as type Elf32_Rela for the 32-bit class 1144 of object files or type Elf64_Rela for the 64-bit class of 1145 object files. An object file may have multiple relocation 1146 sections. `Relocation' b 1147 SHT_STRTAB 0x3 The section holds a string table. An object 1148 file may have multiple string table sections. See `String 1149 Table' below for details. 1150 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 1151 an object file may have either a section of SHT_SYMTAB type or 1152 a section of SHT_DYNSYM type, but not both. This restriction 1153 may be relaxed in the future. Typically, SHT_SYMTAB provides 1154 symbols for link editing, though it may also be used for 1155 dynamic linking. As a complete symbol table, it may contain 1156 many symbols unnecessary for dynamic linking. 1157 _________________________________________________________ 1158 1159 11.2.2.2. Additional Section Types 1160 1161 The following additional section types are defined here. 1162 1163 Table 11-2. Additional Section Types 1164 Name Value Description 1165 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1166 versions that are provided. 1167 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1168 versions that are required. 1169 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1170 Version Table. 1171 _________________________________________________________ 1172 1173 11.3. Special Sections 1174 1175 11.3.1. Special Sections 1176 1177 Various sections hold program and control information. 1178 Sections in the lists below are used by the system and have 1179 the indicated types and attributes. 1180 _________________________________________________________ 1181 1182 11.3.1.1. ELF Special Sections 1183 1184 The following sections are defined in the System V ABI and the 1185 System V ABI Update. 1186 1187 Table 11-3. ELF Special Sections 1188 Name Type Attributes 1189 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1190 .comment SHT_PROGBITS 0 1191 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1192 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1193 .debug SHT_PROGBITS 0 1194 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1195 .dynstr SHT_STRTAB SHF_ALLOC 1196 .dynsym SHT_DYNSYM SHF_ALLOC 1197 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1198 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1199 .hash SHT_HASH SHF_ALLOC 1200 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1201 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1202 .interp SHT_PROGBITS SHF_ALLOC 1203 .line SHT_PROGBITS 0 1204 .note SHT_NOTE 0 1205 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1206 .rodata SHT_PROGBITS SHF_ALLOC 1207 .rodata1 SHT_PROGBITS SHF_ALLOC 1208 .shstrtab SHT_STRTAB 0 1209 .strtab SHT_STRTAB SHF_ALLOC 1210 .symtab SHT_SYMTAB SHF_ALLOC 1211 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1212 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1213 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1214 1215 .bss 1216 1217 This section holds data that contributes to the program's 1218 memory image. The program may treat this data as 1219 uninitialized. However, the system shall initialize this data 1220 with zeroes when the program begins to run. The section 1221 occupies no file space, as indicated by the section type, 1222 SHT_NOBITS 1223 .comment 1224 1225 This section holds version control information. 1226 .data 1227 1228 This section holds initialized data that contribute to the 1229 program's memory image. 1230 .data1 1231 1232 This section holds initialized data that contribute to the 1233 program's memory image. 1234 .debug 1235 1236 This section holds information for symbolic debugging. The 1237 contents are unspecified. All section names with the prefix 1238 .debug hold information for symbolic debugging. The contents 1239 of these sections are unspecified. 1240 .dynamic 1241 1242 This section holds dynamic linking information. The section's 1243 attributes will include the SHF_ALLOC bit. Whether the 1244 SHF_WRITE bit is set is processor specific. See Chapter 5 for 1245 more information. 1246 .dynstr 1247 1248 This section holds strings needed for dynamic linking, most 1249 commonly the strings that represent the names associated with 1250 symbol table entries. See Chapter 5 for more information. 1251 .dynsym 1252 1253 This section holds the dynamic linking symbol table, as 1254 described in `Symbol Table'. See Chapter 5 for more 1255 information. 1256 .fini 1257 1258 This section holds executable instructions that contribute to 1259 the process termination code. That is, when a program exits 1260 normally, the system arranges to execute the code in this 1261 section. 1262 .fini_array 1263 1264 This section holds an array of function pointers that 1265 contributes to a single termination array for the executable 1266 or shared object containing the section. 1267 .hash 1268 1269 This section holds a symbol hash table. See `Hash Table' in 1270 Chapter 5 for more information. 1271 .init 1272 1273 This section holds executable instructions that contribute to 1274 the process initialization code. When a program starts to run, 1275 the system arranges to execute the code in this section before 1276 calling the main program entry point (called main for C 1277 programs) 1278 .init_array 1279 1280 This section holds an array of function pointers that 1281 contributes to a single initialization array for the 1282 executable or shared object containing the section. 1283 .interp 1284 1285 This section holds the path name of a program interpreter. If 1286 the file has a loadable segment that includes relocation, the 1287 sections' attributes will include the SHF_ALLOC bit; 1288 otherwise, that bit will be off. See Chapter 5 for more 1289 information. 1290 .line 1291 1292 This section holds line number information for symbolic 1293 debugging, which describes the correspondence between the 1294 source program and the machine code. The contents are 1295 unspecified. 1296 .note 1297 1298 This section holds information in the format that `Note 1299 Section' in Chapter 5 describes of the System V Application 1300 Binary Interface, Edition 4.1. 1301 .preinit_array 1302 1303 This section holds an array of function pointers that 1304 contributes to a single pre-initialization array for the 1305 executable or shared object containing the section. 1306 .rodata 1307 1308 This section holds read-only data that typically contribute to 1309 a non-writable segment in the process image. See `Program 1310 Header' in Chapter 5 for more information. 1311 .rodata1 1312 1313 This section hold sread-only data that typically contribute to 1314 a non-writable segment in the process image. See `Program 1315 Header' in Chapter 5 for more information. 1316 .shstrtab 1317 1318 This section holds section names. 1319 .strtab 1320 1321 This section holds strings, most commonly the strings that 1322 represent the names associated with symbol table entries. If 1323 the file has a loadable segment that includes the symbol 1324 string table, the section's attributes will include the 1325 SHF_ALLOC bit; otherwi 1326 .symtab 1327 1328 This section holds a symbol table, as `Symbol Table'. in this 1329 chapter describes. If the file has a loadable segment that 1330 includes the symbol table, the section's attributes will 1331 include the SHF_ALLOC bit; otherwise, that bit will be off. 1332 .tbss 1333 1334 This section holds uninitialized thread-local data that 1335 contribute to the program's memory image. By definition, the 1336 system initializes the data with zeros when the data is 1337 instantiated for each new execution flow. The section occupies 1338 no file space, as indicated by the section type, SHT_NOBITS. 1339 Implementations need not support thread-local storage. 1340 .tdata 1341 1342 This section holds initialized thread-local data that 1343 contributes to the program's memory image. A copy of its 1344 contents is instantiated by the system for each new execution 1345 flow. Implementations need not support thread-local storage. 1346 .text 1347 1348 This section holds the `text,' or executable instructions, of 1349 a program. 1350 _________________________________________________________ 1351 1352 11.3.1.2. Additional Special Sections 1353 1354 Object files in an LSB conforming application may also contain 1355 one or more of the additional special sections described 1356 below. 1357 1358 Table 11-4. Additional Special Sections 1359 Name Type Attributes 1360 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1361 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1362 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1363 .eh_frame SHT_PROGBITS SHF_ALLOC 1364 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1365 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1366 .gnu.version SHT_GNU_versym SHF_ALLOC 1367 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1368 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1369 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1370 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1371 .note.ABI-tag SHT_NOTE SHF_ALLOC 1372 .stab SHT_PROGBITS 0 1373 .stabstr SHT_STRTAB 0 1374 1375 .ctors 1376 1377 This section contains a list of global constructor function 1378 pointers. 1379 .data.rel.ro 1380 1381 This section holds initialized data that contribute to the 1382 program's memory image. This section may be made read-only 1383 after relocations have been applied. 1384 .dtors 1385 1386 This section contains a list of global destructor function 1387 pointers. 1388 .eh_frame 1389 1390 This section contains information necessary for frame 1391 unwinding during exception handling. See Section 11.6.1. 1392 .eh_frame_hdr 1393 1394 This section contains a pointer to the .eh_frame section which 1395 is accessible to the runtime support code of a C++ 1396 application. This section may also contain a binary search 1397 table which may be used by the runtime support code to more 1398 efficiently access records in the .eh_frame section. See 1399 Section 11.6.2. 1400 .gcc_except_table 1401 1402 This section holds Language Specific Data. 1403 .gnu.version 1404 1405 This section contains the Symbol Version Table. See Section 1406 11.7.2. 1407 .gnu.version_d 1408 1409 This section contains the Version Definitions. See Section 1410 11.7.3. 1411 .gnu.version_r 1412 1413 This section contains the Version Requirements. See Section 1414 11.7.4. 1415 .got.plt 1416 1417 This section holds the read-only portion of the GLobal Offset 1418 Table. This section may be made read-only after relocations 1419 have been applied. 1420 .jcr 1421 1422 This section contains information necessary for registering 1423 compiled Java classes. The contents are compiler-specific and 1424 used by compiler initialization functions. 1425 .note.ABI-tag 1426 1427 Specify ABI details. See Section 11.8. 1428 .stab 1429 1430 This section contains debugging information. The contents are 1431 not specified as part of the LSB. 1432 .stabstr 1433 1434 This section contains strings associated with the debugging 1435 infomation contained in the .stab section. 1436 _________________________________________________________ 1437 1438 11.4. Symbol Mapping 1439 1440 11.4.1. Introduction 1441 1442 Symbols in a source program are translated by the compilation 1443 system into symbols that exist in the object file. 1444 _________________________________________________________ 1445 1446 11.4.1.1. C Language 1447 1448 External C symbols shall be unchanged in an object file's 1449 symbol table. 1450 _________________________________________________________ 1451 1452 11.5. DWARF Extensions 1453 1454 The LSB does not specify debugging information, however, some 1455 additional sections contain information which is encoded using 1456 the the encoding as specified by DWARF Debugging Information 1457 Format, Revision 2.0.0 with extensions defined here. 1458 1459 Note: The extensions specified here also exist in DWARF 1460 Debugging Information Format, Revision 3.0.0 (Draft). It is 1461 expected that future versions of the LSB will reference the 1462 final version of that document, and that the definitions 1463 here will be taken from that document instead of being 1464 specified here. 1465 _________________________________________________________ 1466 1467 11.5.1. DWARF Exception Header Encoding 1468 1469 The DWARF Exception Header Encoding is used to describe the 1470 type of data used in the .eh_frame and .eh_frame_hdr section. 1471 The upper 4 bits indicate how the value is to be applied. The 1472 lower 4 bits indicate the format of the data. 1473 1474 Table 11-5. DWARF Exception Header value format 1475 Name Value Meaning 1476 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1477 is determined by the architecture. 1478 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1479 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1480 Information Format, Revision 2.0.0. 1481 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1482 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1483 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1484 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1485 Endian Base 128 (LEB128) as defined by DWARF Debugging 1486 Information Format, Revision 2.0.0. 1487 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1488 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1489 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1490 1491 Table 11-6. DWARF Exception Header application 1492 Name Value Meaning 1493 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1494 counter. 1495 DW_EH_PE_textrel 0x20 Value is relative to the beginning of 1496 the .text section. 1497 DW_EH_PE_datarel 0x30 Value is relative to the beginning of 1498 the .got or .eh_frame_hdr section. 1499 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of 1500 the function. 1501 DW_EH_PE_aligned 0x50 Value is aligned to an address unit 1502 sized boundary. 1503 1504 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1505 indicate that no value ispresent. 1506 _________________________________________________________ 1507 1508 11.5.2. DWARF CFI Extensions 1509 1510 In addition to the Call Frame Instructions defined in section 1511 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1512 the following additional Call Frame Instructions may also be 1513 used. 1514 1515 Table 11-7. Additional DWARF Call Frame Instructions 1516 Name Value Meaning 1517 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1518 two operands: an unsigned LEB128 value representing a register 1519 number, and a DW_FORM_block value representing a DWARF 1520 expression. The required action is to establish the DWARF 1521 expression as the means by which the address in which the 1522 given register contents are found may be computed. The value 1523 of the CFA is pushed on the DWARF evaluation stack prior to 1524 execution of the DWARF expression. The DW_OP_call2, 1525 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1526 DWARF operators (see Section 2.4.1 of DWARF Debugging 1527 Information Format, Revision 2.0.0) cannot be used in such a 1528 DWARF expression. 1529 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1530 instruction takes two operands: an unsigned LEB128 value 1531 representing a register number and a signed LEB128 factored 1532 offset. This instruction is identical to 1533 DW_CFA_offset_extended except that the second operand is 1534 signed. 1535 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1536 two operands: an unsigned LEB128 value representing a register 1537 number and a signed LEB128 factored offset. This instruction 1538 is identical to DW_CFA_def_cfa except that the second operand 1539 is signed and factored. 1540 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1541 instruction takes a signed LEB128 operand representing a 1542 factored offset. This instruction is identical to 1543 DW_CFA_def_cfa_offset except that the operand is signed and 1544 factored. 1545 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1546 takes an unsigned LEB128 operand representing an argument 1547 size. This instruction specifies the total of the size of the 1548 arguments which have been pushed onto the stack. 1549 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1550 instruction takes two operands: an unsigned LEB128 value 1551 representing a register number and an unsigned LEB128 which 1552 represents the magnitude of the offset. This instruction is 1553 identical to DW_CFA_offset_extended_sf except that the operand 1554 is subtracted to produce the offset. This instructions is 1555 obsoleted by DW_CFA_offset_extended_sf. 1556 _________________________________________________________ 1557 1558 11.6. Exception Frames 1559 1560 When using languages that support exceptions, such as C++, 1561 additional information must be provided to the runtime 1562 environment that describes the call frames that must be 1563 unwound during the processing of an exception. This 1564 information is contained in the special sections .eh_frame and 1565 .eh_framehdr. 1566 1567 Note: The format of the .eh_frame section is similar in 1568 format and purpose to the .debug_frame section which is 1569 specified in DWARF Debugging Information Format, Revision 1570 3.0.0 (Draft). Readers are advised that there are some 1571 subtle difference, and care should be taken when comparing 1572 the two sections. 1573 _________________________________________________________ 1574 1575 11.6.1. The .eh_frame section 1576 1577 The .eh_frame section shall contain 1 or more Call Frame 1578 Information (CFI) records. The number of records present shall 1579 be determined by size of the section as contained in the 1580 section header. Each CFI record contains a Common Information 1581 Entry (CIE) record followed by 1 or more Frame Description 1582 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1583 addressing unit sized boundary. 1584 1585 Table 11-8. Call Frame Information Format 1586 Common Information Entry Record 1587 Frame Description Entry Record(s) 1588 _________________________________________________________ 1589 1590 11.6.1.1. The Common Information Entry Format 1591 1592 Table 11-9. Common Information Entry Format 1593 Length Required 1594 Extended Length Optional 1595 CIE ID Required 1596 Version Required 1597 Augmentation String Required 1598 Code Alignment Factor Required 1599 Data Alignment Factor Required 1600 Return Address Register Required 1601 Augmentation Data Length Optional 1602 Augmentation Data Optional 1603 Initial Instructions Required 1604 Padding 1605 1606 Length 1607 A 4 byte unsigned value indicating the length in bytes 1608 of the CIE structure, not including the Length field 1609 itself. If Length contains the value 0xffffffff, then 1610 the length is contained in the Extended Length field. 1611 If Length contains the value 0, then this CIE shall be 1612 considered a terminator and processing shall end. 1613 1614 Extended Length 1615 A 8 byte unsigned value indicating the length in bytes 1616 of the CIE structure, not including the Length and 1617 Extended Length fields. 1618 1619 CIE ID 1620 A 4 byte unsigned value that is used to distinguish CIE 1621 records from FDE records. This value shall always be 0, 1622 which indicates this record is a CIE. 1623 1624 Version 1625 A 1 byte value that identifies the version number of 1626 the frame information structure. This value shall be 1. 1627 1628 Augmentation String 1629 This value is a NUL terminated string that identifies 1630 the augmentation to the CIE or to the FDEs associated 1631 with this CIE. A zero length string indicates that no 1632 augmentation data is present. The augmentation string 1633 is case sensitive and shall be interpreted as described 1634 below. 1635 1636 Code Alignment Factor 1637 An unsigned LEB128 encoded value that is factored out 1638 of all advance location instructions that are 1639 associated with this CIE or its FDEs. This value shall 1640 be multiplied by the delta argument of an adavance 1641 location instruction to obtain the new location value. 1642 1643 Data Alignment Factor 1644 A signed LEB128 encoded value that is factored out of 1645 all offset instructions that are associated with this 1646 CIE or its FDEs. This value shall be multiplied by the 1647 register offset argument of an offset instruction to 1648 obtain the new offset value. 1649 1650 Augmentation Length 1651 An unsigned LEB128 encoded value indicating the length 1652 in bytes of the Augmentation Data. This field is only 1653 present if the Augmentation String contains the 1654 character 'z'. 1655 1656 Augmentation Data 1657 A block of data whose contents are defined by the 1658 contents of the Augmentation String as described below. 1659 This field is only present if the Augmentation String 1660 contains the character 'z'. The size of this data is 1661 given by the Augentation Length. 1662 1663 Initial Instructions 1664 Initial set of Call Frame Instructions. The number of 1665 instructions is determined by the remaining space in 1666 the CIE record. 1667 1668 Padding 1669 Extra bytes to align the CIE structure to an addressing 1670 unit size boundary. 1671 _________________________________________________________ 1672 1673 11.6.1.1.1. Augmentation String Format 1674 1675 The Agumentation String indicates the presence of some 1676 optional fields, and how those fields should be intepreted. 1677 This string is case sensitive. Each character in the 1678 augmentation string in the CIE can be interpreted as below: 1679 1680 'z' 1681 1682 A 'z' may be present as the first character of the string. If 1683 present, the Augmentation Data field shall be present. The 1684 contents of the Augmentation Data shall be intepreted 1685 according to other characters in the Augmentation String. 1686 'L' 1687 1688 A 'L' may be present at any position after the first character 1689 of the string. This character may only be present if 'z' is 1690 the first character of the string. If present, it indicates 1691 the presence of one argument in the Augmentation Data of the 1692 CIE, and a corresponding argument in the Augmentation Data of 1693 the FDE. The argument in the Augmentation Data of the CIE is 1694 1-byte and represents the pointer encoding used for the 1695 argument in the Augmentation Data of the FDE, which is the 1696 address of a language-specific data area (LSDA). The size of 1697 the LSDA pointer is specified by the pointer encoding used. 1698 'P' 1699 1700 A 'P' may be present at any position after the first character 1701 of the string. This character may only be present if 'z' is 1702 the first character of the string. If present, it indicates 1703 the presence of two arguments in the Augmentation Data of the 1704 CIE. The first argument is 1-byte and represents the pointer 1705 encoding used for the second argument, which is the address of 1706 a personality routine handler. The personality routine is used 1707 to handle language and vendor-specific tasks. The system 1708 unwind library interface accesses the language-specific 1709 exception handling semantics via the pointer to the 1710 personality routine. The personality routine does not have an 1711 ABI-specific name. The size of the personality routine pointer 1712 is specified by the pointer encoding used. 1713 'R' 1714 1715 A 'R' may be present at any position after the first character 1716 of the string. This character may only be present if 'z' is 1717 the first character of the string. If present, The 1718 Augmentation Data shall include a 1 byte argument that 1719 represents the pointer encoding for the address pointers used 1720 in the FDE. 1721 _________________________________________________________ 1722 1723 11.6.1.2. The Frame Description Entry Format 1724 1725 Table 11-10. Frame Description Entry Format 1726 Length Required 1727 Extended Length Optional 1728 CIE Pointer Required 1729 PC Begin Required 1730 PC Range Required 1731 Augmentation Data Length Optional 1732 Augmentation Data Optional 1733 Call Frame Instructions Required 1734 Padding 1735 1736 Length 1737 A 4 byte unsigned value indicating the length in bytes 1738 of the CIE structure, not including the Length field 1739 itself. If Length contains the value 0xffffffff, then 1740 the length is contained the Extended Length field. If 1741 Length contains the value 0, then this CIE shall be 1742 considered a terminator and processing shall end. 1743 1744 Extended Length 1745 A 8 byte unsigned value indicating the length in bytes 1746 of the CIE structure, not including the Length field 1747 itself. 1748 1749 CIE Pointer 1750 A 4 byte unsigned value that when subtracted from the 1751 offset of the current FDE yields the offset of the 1752 start of the associated CIE. This value shall never be 1753 0. 1754 1755 PC Begin 1756 An encoded value that indicates the address of the 1757 initial location associated with this FDE. The encoding 1758 format is specified in the Augmentation Data. 1759 1760 PC Range 1761 An absolute value that indicates the number of bytes of 1762 instructions associated with this FDE. 1763 1764 Augmentation Length 1765 An unsigned LEB128 encoded value indicating the length 1766 in bytes of the Augmentation Data. This field is only 1767 present if the Augmentation String in the associated 1768 CIE contains the character 'z'. 1769 1770 Augmentation Data 1771 A block of data whose contents are defined by the 1772 contents of the Augmentation String in the associated 1773 CIE as described above. This field is only present if 1774 the Augmentation String in the associated CIE contains 1775 the character 'z'. The size of this data is given by 1776 the Augentation Length. 1777 1778 Call Frame Instructions 1779 A set of Call Frame Instructions. 1780 1781 Padding 1782 Extra bytes to align the FDE structure to an addressing 1783 unit size boundary. 1784 _________________________________________________________ 1785 1786 11.6.2. The .eh_frame_hdr section 1787 1788 The .eh_frame_hdr section contains additional information 1789 about the .eh_frame section. A pointer to the start of the 1790 .eh_frame data, and optionally, a binary search table of 1791 pointers to the .eh_frame records are found in this section. 1792 1793 Data in this section is encoded according to Section 11.5.1. 1794 1795 Table 11-11. .eh_frame_hdr Section Format 1796 Encoding Field 1797 unsigned byte version 1798 unsigned byte eh_frame_ptr_enc 1799 unsigned byte fde_count_enc 1800 unsigned byte table_enc 1801 encoded eh_frame_ptr 1802 encoded fde_count 1803 binary search table 1804 1805 version 1806 1807 Version of the .eh_frame_hdr format. This value shall be 1. 1808 eh_frame_ptr_enc 1809 1810 The encoding format of the eh_frame_ptr field. 1811 fde_count_enc 1812 1813 The encoding format of the fde_count field. A value of 1814 DW_EH_PE_omit indicates the binary search table is not 1815 present. 1816 table_enc 1817 1818 The encoding format of the entries in the binary search table. 1819 A value of DW_EH_PE_omit indicates the binary search table is 1820 not present. 1821 eh_frame_ptr 1822 1823 The encoded value of the pointer to the start of the .eh_frame 1824 section. 1825 fde_count 1826 1827 The encoded value of the count of entries in the binary search 1828 table. 1829 binary search table 1830 1831 A binary search table containing fde_count entries. Each entry 1832 of the table consist of two encoded values, the initial 1833 location, and the address. The entries are sorted in an 1834 increasing order by the initial location value. 1835 _________________________________________________________ 1836 1837 11.7. Symbol Versioning 1838 1839 11.7.1. Introduction 1840 1841 This chapter describes the Symbol Versioning mechanism. All 1842 ELF objects may provide or depend on versioned symbols. Symbol 1843 Versioning is implemented by 3 section types: SHT_GNU_versym, 1844 SHT_GNU_verdef, and SHT_GNU_verneed. 1845 1846 The prefix Elfxx in the following descriptions and code 1847 fragments stands for either "Elf32" or "Elf64", depending on 1848 the architecture. 1849 1850 Versions are described by strings. The structures that are 1851 used for symbol versions also contain a member that holds the 1852 ELF hashing values of the strings. This allows for more 1853 efficient processing. 1854 _________________________________________________________ 1855 1856 11.7.2. Symbol Version Table 1857 1858 The special section .gnu.version which has a section type of 1859 SHT_GNU_versym shall contain the Symbol Version Table. This 1860 section shall have the same number of entries as the Dynamic 1861 Symbol Table in the .dynsym section. 1862 1863 The .gnu.version section shall contain an array of elements of 1864 type Elfxx_Half. Each entry specifies the version defined for 1865 or required by the corresponding symbol in the Dynamic Symbol 1866 Table. 1867 1868 The values in the Symbol Version Table are specific to the 1869 object in which they are located. These values are identifiers 1870 that are provided by the the vna_other member of the 1871 Elfxx_Vernaux structure or the vd_ndx member of the 1872 Elfxx_Verdef structure. 1873 1874 The values 0 and 1 are reserved. 1875 1876 0 1877 1878 The symbol is local, not available outside the object. 1879 1 1880 1881 The symbol is defined in this object and is globally 1882 available. 1883 1884 All other values are used to identify version strings located 1885 in one of the other Symbol Version sections. The value itself 1886 is not the version associated with the symbol. The string 1887 identified by the value defines the version of the symbol. 1888 _________________________________________________________ 1889 1890 11.7.3. Version Definitions 1891 1892 The special section .gnu.version_d which has a section type of 1893 SHT_GNU_verdef shall contain symbol version definitions. The 1894 number of entries in this section shall be contained in the 1895 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The 1896 sh_link member of the section header (see figure 4-8 in the 1897 System V ABI) shall point to the section that contains the 1898 strings referenced by this section. 1899 1900 The section shall contain an array of Elfxx_Verdef structures, 1901 as described in Figure 11-1, optionally followed by an array 1902 of Elfxx_Verdaux structures, as defined in Figure 11-2. 1903 typedef struct { 1904 Elfxx_Half vd_version; 1905 Elfxx_Half vd_flags; 1906 Elfxx_Half vd_ndx; 1907 Elfxx_Half vd_cnt; 1908 Elfxx_Word vd_hash; 1909 Elfxx_Word vd_aux; 1910 Elfxx_Word vd_next; 1911 } Elfxx_Verdef; 1912 1913 Figure 11-1. Version Definition Entries 1914 1915 vd_version 1916 1917 Version revision. This field shall be set to 1. 1918 vd_flags 1919 1920 Version information flag bitmask. 1921 vd_ndx 1922 1923 Version index numeric value referencing the SHT_GNU_versym 1924 section. 1925 vd_cnt 1926 1927 Number of associated verdaux array entries. 1928 vd_hash 1929 1930 Version name hash value (ELF hash function). 1931 vd_aux 1932 1933 Offset in bytes to a corresponding entry in an array of 1934 Elfxx_Verdaux structures as defined in Figure 11-2 1935 vd_next 1936 1937 Offset to the next verdef entry, in bytes. 1938 typedef struct { 1939 Elfxx_Word vda_name; 1940 Elfxx_Word vda_next; 1941 } Elfxx_Verdaux; 1942 1943 Figure 11-2. Version Definition Auxiliary Entries 1944 1945 vda_name 1946 1947 Offset to the version or dependency name string in the section 1948 header, in bytes. 1949 vda_next 1950 1951 Offset to the next verdaux entry, in bytes. 1952 _________________________________________________________ 1953 1954 11.7.4. Version Requirements 1955 1956 The special section .gnu.version_r which has a section type of 1957 SHT_GNU_verneed shall contain required symbol version 1958 definitions. The number of entries in this section shall be 1959 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1960 .dynamic. The sh_link member of the section header (see figure 1961 4-8 in System V ABI) shall point to the section that contains 1962 the strings referenced by this section. 1963 1964 The section shall contain an array of Elfxx_Verneed 1965 structures, as described in Figure 11-3, optionally followed 1966 by an array of Elfxx_Vernaux structures, as defined in Figure 1967 11-4. 1968 typedef struct { 1969 Elfxx_Half vn_version; 1970 Elfxx_Half vn_cnt; 1971 Elfxx_Word vn_file; 1972 Elfxx_Word vn_aux; 1973 Elfxx_Word vn_next; 1974 } Elfxx_Verneed; 1975 1976 Figure 11-3. Version Needed Entries 1977 1978 vn_version 1979 1980 Version of structure. This value is currently set to 1, and 1981 will be reset if the versioning implementation is incompatibly 1982 altered. 1983 vn_cnt 1984 1985 Number of associated verneed array entries. 1986 vn_file 1987 1988 Offset to the file name string in the section header, in 1989 bytes. 1990 vn_aux 1991 1992 Offset to a corresponding entry in the vernaux array, in 1993 bytes. 1994 vn_next 1995 1996 Offset to the next verneed entry, in bytes. 1997 typedef struct { 1998 Elfxx_Word vna_hash; 1999 Elfxx_Half vna_flags; 2000 Elfxx_Half vna_other; 2001 Elfxx_Word vna_name; 2002 Elfxx_Word vna_next; 2003 } Elfxx_Vernaux; 2004 2005 Figure 11-4. Version Needed Auxiliary Entries 2006 2007 vna_hash 2008 2009 Dependency name hash value (ELF hash function). 2010 vna_flags 2011 2012 Dependency information flag bitmask. 2013 vna_other 2014 2015 Object file version identifier used in the .gnu.version symbol 2016 version array. Bit number 15 controls whether or not the 2017 object is hidden; if this bit is set, the object cannot be 2018 used and the static linker will ignore the symbol's presence 2019 in the object. 2020 vna_name 2021 2022 Offset to the dependency name string in the section header, in 2023 bytes. 2024 vna_next 2025 2026 Offset to the next vernaux entry, in bytes. 2027 _________________________________________________________ 2028 2029 11.7.5. Startup Sequence 2030 2031 When loading a sharable object the system shall analyze 2032 version definition data from the loaded object to assure that 2033 it meets the version requirements of the calling object. This 2034 step is referred to as definition testing. The dynamic loader 2035 shall retrieve the entries in the caller's Elfxx_Verneed array 2036 and attempt to find matching definition information in the 2037 loaded Elfxx_Verdef table. 2038 2039 Each object and dependency shall be tested in turn. If a 2040 symbol definition is missing and the vna_flags bit for 2041 VER_FLG_WEAK is not set, the loader shall return an error and 2042 exit. If the vna_flags bit for VER_FLG_WEAK is set in the 2043 Elfxx_Vernaux entry, and the loader shall issue a warning and 2044 continue operation. 2045 2046 When the versions referenced by undefined symbols in the 2047 loaded object are found, version availability is certified. 2048 The test completes without error and the object shall be made 2049 available. 2050 _________________________________________________________ 2051 2052 11.7.6. Symbol Resolution 2053 2054 When symbol versioning is used in an object, relocations 2055 extend definition testing beyond the simple match of symbol 2056 name strings: the version of the reference shall also equal 2057 the name of the definition. 2058 2059 The same index that is used in the symbol table can be 2060 referenced in the SHT_GNU_versym section, and the value of 2061 this index is then used to acquire name data. The 2062 corresponding requirement string is retrieved from the 2063 Elfxx_Verneed array, and likewise, the corresponding 2064 definition string from the Elfxx_Verdef table. 2065 2066 If the high order bit (bit number 15) of the version symbolis 2067 set, the object cannot be used and the static linker shall 2068 ignore the symbol's presence in the object. 2069 2070 When an object with a reference and an object with the 2071 definition are being linked, the following rules shall govern 2072 the result: 2073 2074 * The object with the reference and the object with the 2075 definitions both use versioning. All described matching is 2076 processed in this case. A fatal error shall be triggered 2077 when no matching definition can be found in the object 2078 whose name is the one referenced by the vn_name element in 2079 the Elfxx_Verneed entry. 2080 * The object with the reference does not use versioning, 2081 while the object with the definitions does. In this 2082 instance, only the definitions with index numbers 1 and 2 2083 will be used in the reference match, the same identified 2084 by the static linker as the base definition. In cases 2085 where the static linker was not used, such as in calls to 2086 dlopen(), a version that does not have the base definition 2087 index shall be acceptable if it is the only version for 2088 which the symbol is defined. 2089 * The object with the reference uses versioning, but the 2090 object with the definitions specifies none. A matching 2091 symbol shall be accepted in this case. A fatal error shall 2092 be triggered if a corruption in the required symbols list 2093 obscures an outdated object file and causes a match on the 2094 object filename in the Elfxx_Verneed entry. 2095 * Neither the object with the reference nor the object with 2096 the definitions use versioning. The behavior in this 2097 instance shall default to pre-existing symbol rules. 2098 _________________________________________________________ 2099 2100 11.8. ABI note tag 2101 2102 Every executable shall contain a section named .note.ABI-tag 2103 of type SHT_NOTE. This section is structured as a note section 2104 as documented in the ELF spec. The section shall contain at 2105 least the following entry. The name field (namesz/name) 2106 contains the string "GNU". The type field shall be 1. The 2107 descsz field shall be at least 16, and the first 16 bytes of 2108 the desc field shall be as follows. 2109 2110 The first 32-bit word of the desc field shall be 0 (this 2111 signifies a Linux executable). The second, third, and fourth 2112 32-bit words of the desc field contain the earliest compatible 2113 kernel version. For example, if the 3 words are 2, 2, and 5, 2114 this signifies a 2.2.5 kernel. 2115 _________________________________________________________ 2116 2117 Chapter 12. Dynamic Linking 2118 2119 12.1. Program Loading and Dynamic Linking 2120 2121 LSB-conforming implementations shall support the object file 2122 information and system actions that create running programs as 2123 specified in the System V ABI and System V ABI Update and as 2124 further required by this specification and its architecture 2125 specific supplement. 2126 2127 Any shared object that is loaded shall contain sufficient 2128 DT_NEEDED records to satisfy the symbols on the shared 2129 library. 2130 _________________________________________________________ 2131 2132 12.2. Program Header 2133 2134 In addition to the Segment Types defined in the System V ABI 2135 and System V ABI Update the following Segment Types shall also 2136 be supported. 2137 2138 Table 12-1. Linux Segment Types 2139 Name Value 2140 PT_GNU_EH_FRAME 0x6474e550 2141 PT_GNU_STACK 0x6474e551 2142 PT_GNU_RELRO 0x6474e552 2143 2144 PT_GNU_EH_FRAME 2145 2146 The array element specifies the location and size of the 2147 exception handling information as defined by the .eh_frame_hdr 2148 section. 2149 PT_GNU_STACK 2150 2151 The p_flags member specifies the permissions on the segment 2152 containing the stack and is used to indicate wether the stack 2153 should be executable. The absense of this header indicates 2154 that the stack will be executable. 2155 PT_GNU_RELRO 2156 2157 The array element specifies the location and size of a segment 2158 which may be made read-only after relocation shave been 2159 processed. 2160 _________________________________________________________ 2161 2162 12.3. Dynamic Entries 2163 2164 12.3.1. Introduction 2165 2166 As described in System V ABI, if an object file 2167 CHAPTERicipates in dynamic linking, its program header table 2168 shall have an element of type PT_DYNAMIC. This `segment' 2169 contains the .dynamic section. A special symbol, _DYNAMIC, 2170 labels the section, which contains an array of the following 2171 structures. 2172 typedef struct { 2173 Elf32_Sword d_tag; 2174 union { 2175 Elf32_Word d_val; 2176 Elf32_Addr d_ptr; 2177 } d_un; 2178 } Elf32_Dyn; 2179 2180 extern Elf32_Dyn _DYNAMIC[]; 2181 2182 typedef struct { 2183 Elf64_Sxword d_tag; 2184 union { 2185 Elf64_Xword d_val; 2186 Elf64_Addr d_ptr; 2187 } d_un; 2188 } Elf64_Dyn; 2189 2190 extern Elf64_Dyn _DYNAMIC[]; 2191 2192 Figure 12-1. Dynamic Structure 2193 2194 For each object with this type, d_tag controls the 2195 interpretation of d_un. 2196 _________________________________________________________ 2197 2198 12.3.2. Dynamic Entries 2199 _________________________________________________________ 2200 2201 12.3.2.1. ELF Dynamic Entries 2202 2203 The following dynamic entries are defined in the System V ABI 2204 and System V ABI Update. 2205 2206 DT_BIND_NOW 2207 2208 Process relocations of object 2209 DT_DEBUG 2210 2211 For debugging; unspecified 2212 DT_FINI 2213 2214 Address of termination function 2215 DT_HASH 2216 2217 Address of symbol hash table 2218 DT_HIPROC 2219 2220 End of processor-specific 2221 DT_INIT 2222 2223 Address of init function 2224 DT_JMPREL 2225 2226 Address of PLT relocs 2227 DT_LOPROC 2228 2229 Start of processor-specific 2230 DT_NEEDED 2231 2232 Name of needed library 2233 DT_NULL 2234 2235 Marks end of dynamic section 2236 DT_PLTREL 2237 2238 Type of reloc in PLT 2239 DT_PLTRELSZ 2240 2241 Size in bytes of PLT relocs 2242 DT_REL 2243 2244 Address of Rel relocs 2245 DT_RELA 2246 2247 Address of Rela relocs 2248 DT_RELAENT 2249 2250 Size of one Rela reloc 2251 DT_RELASZ 2252 2253 Total size of Rela relocs 2254 DT_RELENT 2255 2256 Size of one Rel reloc 2257 DT_RELSZ 2258 2259 Total size of Rel relocs 2260 DT_RPATH 2261 2262 Library search path 2263 DT_SONAME 2264 2265 Name of shared object 2266 DT_STRSZ 2267 2268 Size of string table 2269 DT_STRTAB 2270 2271 Address of string table 2272 DT_SYMBOLIC 2273 2274 Start symbol search here 2275 DT_SYMENT 2276 2277 Size of one symbol table entry 2278 DT_SYMTAB 2279 2280 Address of symbol table 2281 DT_TEXTREL 2282 2283 Reloc might modify .text 2284 _________________________________________________________ 2285 2286 12.3.2.2. Additional Dynamic Entries 2287 2288 An LSB conforming object may also use the following additional 2289 Dynamic Entry types. 2290 2291 DT_ADDRRNGHI 2292 2293 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2294 definition by an archLSB. 2295 DT_ADDRRNGLO 2296 2297 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2298 definition by an archLSB. 2299 DT_AUXILIARY 2300 2301 Shared object to load before self 2302 DT_FILTER 2303 2304 Shared object to get values from 2305 DT_FINI_ARRAY 2306 2307 The address of an array of pointers to termination functions. 2308 DT_FINI_ARRAYSZ 2309 2310 Size in bytes of DT_FINI_ARRAY 2311 DT_HIOS 2312 2313 Values from DT_LOOS through DT_HIOS are reserved for 2314 definition by specific operating systems. 2315 DT_INIT_ARRAY 2316 2317 The address of an array of pointers to initialization 2318 functions. 2319 DT_INIT_ARRAYSZ 2320 2321 Size in bytes of DT_INIT_ARRAY 2322 DT_LOOS 2323 2324 Values from DT_LOOS through DT_HIOS are reserved for 2325 definition by specific operating systems. 2326 DT_NUM 2327 2328 Number of dynamic entry tags defined (excepting reserved 2329 ranges). 2330 DT_POSFLAG_1 2331 2332 Flags for DT_* entries, effecting the following DT_* entry 2333 DT_RELCOUNT 2334 2335 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2336 single block and this entry specifies the number of entries in 2337 that block. This permits ld.so.1 to streamline the processing 2338 of RELATIVE relocations. 2339 DT_RUNPATH 2340 2341 null-terminated library search path string 2342 DT_SYMINENT 2343 2344 Entry size of syminfo 2345 DT_SYMINFO 2346 2347 Address of the Syminfo table. 2348 DT_SYMINSZ 2349 2350 Size of syminfo table (in bytes) 2351 DT_VALRNGHI 2352 2353 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2354 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2355 DT_VALRNGLO 2356 2357 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2358 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2359 DT_VERDEF 2360 2361 Address of version definition table 2362 DT_VERDEFNUM 2363 2364 Number of version definitions 2365 DT_VERNEED 2366 2367 Address of table with needed versions 2368 DT_VERNEEDNUM 2369 2370 Number of needed versions 2371 DT_VERSYM 2372 2373 Address of the table provided by the .gnu.version section. 2374 2375 III. Base Libraries 2376 2377 Table of Contents 2378 13. Base Libraries 2379 2380 13.1. Introduction 2381 13.2. Program Interpreter 2382 13.3. Interfaces for libc 2383 2384 13.3.1. RPC 2385 13.3.2. System Calls 2386 13.3.3. Standard I/O 2387 13.3.4. Signal Handling 2388 13.3.5. Localization Functions 2389 13.3.6. Socket Interface 2390 13.3.7. Wide Characters 2391 13.3.8. String Functions 2392 13.3.9. IPC Functions 2393 13.3.10. Regular Expressions 2394 13.3.11. Character Type Functions 2395 13.3.12. Time Manipulation 2396 13.3.13. Terminal Interface Functions 2397 13.3.14. System Database Interface 2398 13.3.15. Language Support 2399 13.3.16. Large File Support 2400 13.3.17. Standard Library 2401 2402 13.4. Data Definitions for libc 2403 2404 13.4.1. arpa/inet.h 2405 13.4.2. assert.h 2406 13.4.3. ctype.h 2407 13.4.4. dirent.h 2408 13.4.5. err.h 2409 13.4.6. errno.h 2410 13.4.7. fcntl.h 2411 13.4.8. fmtmsg.h 2412 13.4.9. fnmatch.h 2413 13.4.10. ftw.h 2414 13.4.11. getopt.h 2415 13.4.12. glob.h 2416 13.4.13. grp.h 2417 13.4.14. iconv.h 2418 13.4.15. inttypes.h 2419 13.4.16. langinfo.h 2420 13.4.17. libgen.h 2421 13.4.18. libintl.h 2422 13.4.19. limits.h 2423 13.4.20. locale.h 2424 13.4.21. monetary.h 2425 13.4.22. net/if.h 2426 13.4.23. netdb.h 2427 13.4.24. netinet/in.h 2428 13.4.25. netinet/ip.h 2429 13.4.26. netinet/tcp.h 2430 13.4.27. netinet/udp.h 2431 13.4.28. nl_types.h 2432 13.4.29. poll.h 2433 13.4.30. pty.h 2434 13.4.31. pwd.h 2435 13.4.32. regex.h 2436 13.4.33. rpc/auth.h 2437 13.4.34. rpc/clnt.h 2438 13.4.35. rpc/pmap_clnt.h 2439 13.4.36. rpc/rpc_msg.h 2440 13.4.37. rpc/svc.h 2441 13.4.38. rpc/types.h 2442 13.4.39. rpc/xdr.h 2443 13.4.40. sched.h 2444 13.4.41. search.h 2445 13.4.42. setjmp.h 2446 13.4.43. signal.h 2447 13.4.44. stddef.h 2448 13.4.45. stdio.h 2449 13.4.46. stdlib.h 2450 13.4.47. string.h 2451 13.4.48. sys/file.h 2452 13.4.49. sys/ioctl.h 2453 13.4.50. sys/ipc.h 2454 13.4.51. sys/mman.h 2455 13.4.52. sys/msg.h 2456 13.4.53. sys/param.h 2457 13.4.54. sys/poll.h 2458 13.4.55. sys/resource.h 2459 13.4.56. sys/sem.h 2460 13.4.57. sys/shm.h 2461 13.4.58. sys/socket.h 2462 13.4.59. sys/stat.h 2463 13.4.60. sys/statvfs.h 2464 13.4.61. sys/time.h 2465 13.4.62. sys/timeb.h 2466 13.4.63. sys/times.h 2467 13.4.64. sys/types.h 2468 13.4.65. sys/uio.h 2469 13.4.66. sys/un.h 2470 13.4.67. sys/utsname.h 2471 13.4.68. sys/wait.h 2472 13.4.69. syslog.h 2473 13.4.70. termios.h 2474 13.4.71. time.h 2475 13.4.72. ucontext.h 2476 13.4.73. ulimit.h 2477 13.4.74. unistd.h 2478 13.4.75. utime.h 2479 13.4.76. utmp.h 2480 13.4.77. utmpx.h 2481 13.4.78. wchar.h 2482 13.4.79. wctype.h 2483 13.4.80. wordexp.h 2484 2485 13.5. Interface Definitions for libc 2486 2487 _IO_feof -- alias for feof 2488 _IO_getc -- alias for getc 2489 _IO_putc -- alias for putc 2490 _IO_puts -- alias for puts 2491 __assert_fail -- abort the program after false 2492 assertion 2493 2494 __ctype_b_loc -- accessor function for __ctype_b 2495 array for ctype functions 2496 2497 __ctype_get_mb_cur_max -- maximum length of a 2498 multibyte character in the current locale 2499 2500 __ctype_tolower_loc -- accessor function for 2501 __ctype_b_tolower array for ctype tolower() 2502 function 2503 2504 __ctype_toupper_loc -- accessor function for 2505 __ctype_b_toupper() array for ctype 2506 toupper() function 2507 2508 __cxa_atexit -- register a function to be called by 2509 exit or when a shared library is unloaded 2510 2511 __daylight -- daylight savings time flag 2512 __environ -- alias for environ - user environment 2513 __errno_location -- address of errno variable 2514 __fpending -- returns in bytes the amount of output 2515 pending on a stream 2516 2517 __getpagesize -- alias for getpagesize - get 2518 current page size 2519 2520 __getpgid -- get the process group id 2521 __h_errno_location -- address of h_errno variable 2522 __isinf -- test for infinity 2523 __isinff -- test for infinity 2524 __isinfl -- test for infinity 2525 __isnan -- test for infinity 2526 __isnanf -- test for infinity 2527 __isnanl -- test for infinity 2528 __libc_current_sigrtmax -- return number of 2529 available real-time signal with lowest 2530 priority 2531 2532 __libc_current_sigrtmin -- return number of 2533 available real-time signal with highest 2534 priority 2535 2536 __libc_start_main -- initialization routine 2537 __lxstat -- inline wrapper around call to lxstat 2538 __mempcpy -- copy given number of bytes of source 2539 to destination 2540 2541 __rawmemchr -- scan memory 2542 __register_atfork -- alias for register_atfork 2543 __sigsetjmp -- save stack context for non-local 2544 goto 2545 2546 __stpcpy -- alias for stpcpy 2547 __strdup -- alias for strdup 2548 __strtod_internal -- underlying function for strtod 2549 __strtof_internal -- underlying function for strtof 2550 __strtok_r -- alias for strtok_r 2551 __strtol_internal -- alias for strtol 2552 __strtold_internal -- underlying function for 2553 strtold 2554 2555 __strtoll_internal -- underlying function for 2556 strtoll 2557 2558 __strtoul_internal -- underlying function for 2559 strtoul 2560 2561 __strtoull_internal -- underlying function for 2562 strtoull 2563 2564 __sysconf -- get configuration information at 2565 runtime 2566 2567 __sysv_signal -- signal handling 2568 __timezone -- global variable containing timezone 2569 __tzname -- global variable containing the timezone 2570 __wcstod_internal -- underlying function for wcstod 2571 __wcstof_internal -- underlying function for wcstof 2572 __wcstol_internal -- underlying function for wcstol 2573 __wcstold_internal -- underlying function for 2574 wcstold 2575 2576 __wcstoul_internal -- underlying function for 2577 wcstoul 2578 2579 __xmknod -- make block or character special file 2580 __xstat -- get File Status 2581 __xstat64 -- get File Status 2582 _environ -- alias for environ - user environment 2583 _nl_msg_cat_cntr -- new catalog load counter 2584 _sys_errlist -- array containing the "C" locale 2585 strings used by strerror() 2586 2587 _sys_siglist -- array containing the names of the 2588 signal names 2589 2590 acct -- switch process accounting on or off 2591 adjtime -- correct the time to allow 2592 synchronization of the system clock 2593 2594 asprintf -- write formatted output to a dynamically 2595 allocated string 2596 2597 bind_textdomain_codeset -- specify encoding for 2598 message retrieval 2599 2600 bindresvport -- bind socket to privileged IP port 2601 bindtextdomain -- specify the location of a message 2602 catalog 2603 2604 cfmakeraw -- get and set terminal attributes 2605 cfsetspeed -- set terminal input and output data 2606 rate 2607 2608 daemon -- run in the background 2609 dcgettext -- perform domain and category specific 2610 lookup in message catalog 2611 2612 dcngettext -- perform domain and category specific 2613 lookup in message catalog with plural 2614 2615 dgettext -- perform lookup in message catalog for 2616 the current LC_MESSAGES locale 2617 2618 dngettext -- perform lookup in message catalog for 2619 the current locale 2620 2621 duplocale -- provide new handle for selection of 2622 locale 2623 2624 err -- display formatted error messages 2625 error -- print error message 2626 errx -- display formatted error message and exit 2627 fcntl -- file control 2628 fflush_unlocked -- non thread safe fflush 2629 fgetwc_unlocked -- non thread safe fgetwc 2630 flock -- apply or remove an advisory lock on an 2631 open file 2632 2633 freelocale -- free a locale object 2634 fscanf -- convert formatted input 2635 fwscanf -- convert formatted input 2636 getgrouplist -- get network group entry 2637 getloadavg -- get system load averages 2638 getopt -- parse command line options 2639 getopt_long -- parse command line options 2640 getopt_long_only -- parse command line options 2641 getsockopt -- get socket options 2642 gettext -- search message catalogs for a string 2643 getutent -- access user accounting database entries 2644 2645 getutent_r -- access user accounting database 2646 entries 2647 2648 glob64 -- find pathnames matching a pattern (Large 2649 File Support) 2650 2651 globfree64 -- free memory from glob64() (Large File 2652 Support) 2653 2654 initgroups -- initialize the supplementary group 2655 access list 2656 2657 ioctl -- control device 2658 sockio -- socket ioctl commands 2659 ttyio -- tty ioctl commands 2660 kill -- send a signal 2661 link -- create a link to a file 2662 mbsnrtowcs -- convert a multibyte string to a wide 2663 character string 2664 2665 memmem -- locate bytes 2666 memrchr -- scan memory for a character 2667 newlocale -- allocate a locale object 2668 ngettext -- search message catalogs for plural 2669 string 2670 2671 pmap_getport -- find the port number assigned to a 2672 service registered with a portmapper. 2673 2674 pmap_set -- establishes mapping to machine's RPC 2675 Bind service. 2676 2677 pmap_unset -- destroys RPC Binding 2678 psignal -- print signal message 2679 regexec -- regular expression matching 2680 scanf -- convert formatted input 2681 setbuffer -- stream buffering operation 2682 setgroups -- set list of supplementary group IDs 2683 sethostname -- set host name 2684 setsockopt -- set socket options 2685 setutent -- access user accounting database entries 2686 sigandset -- build a new signal set by combining 2687 the two input sets using logical AND 2688 2689 sigisemptyset -- check for empty signal set 2690 sigorset -- build a new signal set by combining the 2691 two input sets using logical OR 2692 2693 sigreturn -- return from signal handler and cleanup 2694 stack frame 2695 2696 sscanf -- convert formatted input 2697 stime -- set time 2698 stpcpy -- copy a string returning a pointer to its 2699 end 2700 2701 stpncpy -- copy a fixed-size string, returning a 2702 pointer to its end 2703 2704 strcasestr -- locate a substring ignoring case 2705 strerror_r -- reentrant version of strerror 2706 strndup -- return a malloc'd copy of at most the 2707 specified number of bytes of a string 2708 2709 strnlen -- determine the length of a fixed-size 2710 string 2711 2712 strptime -- parse a time string 2713 strsep -- extract token from string 2714 strsignal -- return string describing signal 2715 strtoq -- convert string value to a long or quad_t 2716 integer 2717 2718 strtouq -- convert a string to an unsigned long 2719 long 2720 2721 svc_register -- register Remote Procedure Call 2722 interface 2723 2724 svc_run -- waits for RPC requests to arrive and 2725 calls service procedure 2726 2727 svc_sendreply -- called by RPC service's dispatch 2728 routine 2729 2730 svctcp_create -- create a TCP/IP-based RPC service 2731 transport 2732 2733 svcudp_create -- create a UDP-based RPC service 2734 transport 2735 2736 swscanf -- convert formatted input 2737 system -- execute a shell command 2738 textdomain -- set the current default message 2739 domain 2740 2741 unlink -- remove a directory entry 2742 uselocale -- set locale for thread 2743 utmpname -- set user accounting database 2744 vasprintf -- write formatted output to a 2745 dynamically allocated string 2746 2747 vdprintf -- write formatted output to a file 2748 descriptor 2749 2750 verrx -- display formatted error message and exit 2751 vfscanf -- convert formatted input 2752 vfwscanf -- convert formatted input 2753 vscanf -- convert formatted input 2754 vsscanf -- convert formatted input 2755 vswscanf -- convert formatted input 2756 vsyslog -- log to system log 2757 vwscanf -- convert formatted input 2758 wait4 -- wait for process termination, BSD style 2759 waitpid -- wait for child process 2760 warn -- formatted error messages 2761 warnx -- formatted error messages 2762 wcpcpy -- copy a wide character string, returning a 2763 pointer to its end 2764 2765 wcpncpy -- copy a fixed-size string of wide 2766 characters, returning a pointer to its end 2767 2768 wcscasecmp -- compare two wide-character strings, 2769 ignoring case 2770 2771 wcsdup -- duplicate a wide-character string 2772 wcsncasecmp -- compare two fixed-size 2773 wide-character strings, ignoring case 2774 2775 wcsnlen -- determine the length of a fixed-size 2776 wide-character string 2777 2778 wcsnrtombs -- convert a wide character string to a 2779 multi-byte string 2780 2781 wcstoq -- convert wide string to long long int 2782 representation 2783 2784 wcstouq -- convert wide string to unsigned long 2785 long int representation 2786 2787 wscanf -- convert formatted input 2788 xdr_u_int -- library routines for external data 2789 representation 2790 2791 13.6. Interfaces for libm 2792 2793 13.6.1. Math 2794 2795 13.7. Data Definitions for libm 2796 2797 13.7.1. complex.h 2798 13.7.2. fenv.h 2799 13.7.3. math.h 2800 2801 13.8. Interface Definitions for libm 2802 2803 __fpclassify -- Classify real floating type 2804 __fpclassifyf -- Classify real floating type 2805 2806 13.9. Interfaces for libpthread 2807 2808 13.9.1. Realtime Threads 2809 13.9.2. Advanced Realtime Threads 2810 13.9.3. Posix Threads 2811 13.9.4. Thread aware versions of libc interfaces 2812 2813 13.10. Data Definitions for libpthread 2814 2815 13.10.1. pthread.h 2816 13.10.2. semaphore.h 2817 2818 13.11. Interface Definitions for libpthread 2819 2820 _pthread_cleanup_pop -- establish cancellation 2821 handlers 2822 2823 _pthread_cleanup_push -- establish cancellation 2824 handlers 2825 2826 13.12. Interfaces for libgcc_s 2827 2828 13.12.1. Unwind Library 2829 2830 13.13. Data Definitions for libgcc_s 2831 2832 13.13.1. unwind.h 2833 2834 13.14. Interfaces for libdl 2835 2836 13.14.1. Dynamic Loader 2837 2838 13.15. Data Definitions for libdl 2839 2840 13.15.1. dlfcn.h 2841 2842 13.16. Interface Definitions for libdl 2843 2844 dladdr -- find the shared object containing a given 2845 address 2846 2847 dlopen -- open dynamic object 2848 dlsym -- obtain the address of a symbol from a 2849 dlopen object 2850 2851 13.17. Interfaces for librt 2852 2853 13.17.1. Shared Memory Objects 2854 13.17.2. Clock 2855 13.17.3. Timers 2856 2857 13.18. Interfaces for libcrypt 2858 2859 13.18.1. Encryption 2860 2861 13.19. Interfaces for libpam 2862 2863 13.19.1. Pluggable Authentication API 2864 2865 13.20. Data Definitions for libpam 2866 2867 13.20.1. security/pam_appl.h 2868 2869 13.21. Interface Definitions for libpam 2870 2871 pam_acct_mgmt -- establish the status of a user's 2872 account 2873 2874 pam_authenticate -- authenticate the user 2875 pam_chauthtok -- change the authentication token 2876 for a given user 2877 2878 pam_close_session -- indicate that an authenticated 2879 session has ended 2880 2881 pam_end -- terminate the use of the PAM library 2882 pam_fail_delay -- specify delay time to use on 2883 authentication error 2884 2885 pam_get_item -- obtain the value of the indicated 2886 item. 2887 2888 pam_getenvlist -- returns a pointer to the complete 2889 PAM environment. 2890 2891 pam_open_session -- indicate session has started 2892 pam_set_item -- (re)set the value of an item. 2893 pam_setcred -- set the module-specific credentials 2894 of the user 2895 2896 pam_start -- initialize the PAM library 2897 pam_strerror -- returns a string describing the PAM 2898 error 2899 _________________________________________________________ 2900 2901 Chapter 13. Base Libraries 2902 2903 13.1. Introduction 2904 2905 An LSB-conforming implementation shall support the following 2906 base libraries which provide interfaces for accessing the 2907 operating system, processor and other hardware in the system. 2908 2909 * libc 2910 * libm 2911 * libgcc_s 2912 * libdl 2913 * librt 2914 * libcrypt 2915 * libpam 2916 2917 There are three main parts to the definition of each of these 2918 libraries. 2919 2920 The "Interfaces" section defines the required library name and 2921 version, and the required public symbols (interfaces and 2922 global data), as well as symbol versions, if any. 2923 2924 The "Interface Definitions" section provides complete or 2925 partial definitions of certain interfaces where either this 2926 specification is the source specification, or where there are 2927 variations from the source specification. If an interface 2928 definition requires one or more header files, one of those 2929 headers shall include the function prototype for the 2930 interface. 2931 2932 For source definitions of interfaces which include a reference 2933 to a header file, the contents of such header files form a 2934 part of the specification. The "Data Definitions" section 2935 provides the binary-level details for the header files from 2936 the source specifications, such as values for macros and 2937 enumerated types, as well as structure layouts, sizes and 2938 padding, etc. These data definitions, although presented in 2939 the form of header files for convenience, should not be taken 2940 a representing complete header files, as they are a supplement 2941 to the source specifications. Application developers should 2942 follow the guidelines of the source specifications when 2943 determining which header files need to be included to 2944 completely resolve all references. 2945 2946 Note: While the Data Definitions supplement the source 2947 specifications, this specification itself does not require 2948 conforming implementations to supply any header files. 2949 _________________________________________________________ 2950 2951 13.2. Program Interpreter 2952 2953 The Program Interpreter is specified in the appropriate 2954 architecture specific supplement. 2955 _________________________________________________________ 2956 2957 13.3. Interfaces for libc 2958 2959 Table 13-1 defines the library name and shared object name for 2960 the libc library 2961 2962 Table 13-1. libc Definition 2963 Library: libc 2964 SONAME: See archLSB. 2965 2966 The behavior of the interfaces in this library is specified by 2967 the following specifications: 2968 2969 [LFS] Large File Support 2970 [LSB] This Specification 2971 [SUSv2] SUSv2 2972 [SUSv3] ISO POSIX (2003) 2973 [SVID.3] SVID Issue 3 2974 [SVID.4] SVID Issue 4 2975 _________________________________________________________ 2976 2977 13.3.1. RPC 2978 _________________________________________________________ 2979 2980 13.3.1.1. Interfaces for RPC 2981 2982 An LSB conforming implementation shall provide the generic 2983 functions for RPC specified in Table 13-2, with the full 2984 mandatory functionality as described in the referenced 2985 underlying specification. 2986 2987 Table 13-2. libc - RPC Function Interfaces 2988 authnone_create [SVID.4] clnt_create [SVID.4] 2989 clnt_pcreateerror [SVID.4] clnt_perrno [SVID.4] 2990 clnt_perror [SVID.4] clnt_spcreateerror [SVID.4] clnt_sperrno 2991 [SVID.4] clnt_sperror [SVID.4] 2992 key_decryptsession [SVID.3] pmap_getport [LSB] pmap_set [LSB] 2993 pmap_unset [LSB] 2994 svc_getreqset [SVID.3] svc_register [LSB] svc_run [LSB] 2995 svc_sendreply [LSB] 2996 svcerr_auth [SVID.3] svcerr_decode [SVID.3] svcerr_noproc 2997 [SVID.3] svcerr_noprog [SVID.3] 2998 svcerr_progvers [SVID.3] svcerr_systemerr [SVID.3] 2999 svcerr_weakauth [SVID.3] svctcp_create [LSB] 3000 svcudp_create [LSB] xdr_accepted_reply [SVID.3] xdr_array 3001 [SVID.3] xdr_bool [SVID.3] 3002 xdr_bytes [SVID.3] xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] 3003 xdr_char [SVID.3] 3004 xdr_double [SVID.3] xdr_enum [SVID.3] xdr_float [SVID.3] 3005 xdr_free [SVID.3] 3006 xdr_int [SVID.3] xdr_long [SVID.3] xdr_opaque [SVID.3] 3007 xdr_opaque_auth [SVID.3] 3008 xdr_pointer [SVID.3] xdr_reference [SVID.3] xdr_rejected_reply 3009 [SVID.3] xdr_replymsg [SVID.3] 3010 xdr_short [SVID.3] xdr_string [SVID.3] xdr_u_char [SVID.3] 3011 xdr_u_int [LSB] 3012 xdr_u_long [SVID.3] xdr_u_short [SVID.3] xdr_union [SVID.3] 3013 xdr_vector [SVID.3] 3014 xdr_void [SVID.3] xdr_wrapstring [SVID.3] xdrmem_create 3015 [SVID.3] xdrrec_create [SVID.3] 3016 xdrrec_eof [SVID.3] 3017 _________________________________________________________ 3018 3019 13.3.2. System Calls 3020 _________________________________________________________ 3021 3022 13.3.2.1. Interfaces for System Calls 3023 3024 An LSB conforming implementation shall provide the generic 3025 functions for System Calls specified in Table 13-3, with the 3026 full mandatory functionality as described in the referenced 3027 underlying specification. 3028 3029 Table 13-3. libc - System Calls Function Interfaces 3030 __fxstat [LSB] __getpgid [LSB] __lxstat [LSB] __xmknod [LSB] 3031 __xstat [LSB] access [SUSv3] acct [LSB] alarm [SUSv3] 3032 brk [SUSv2] chdir [SUSv3] chmod [SUSv3] chown [SUSv3] 3033 chroot [SUSv2] clock [SUSv3] close [SUSv3] closedir [SUSv3] 3034 creat [SUSv3] dup [SUSv3] dup2 [SUSv3] execl [SUSv3] 3035 execle [SUSv3] execlp [SUSv3] execv [SUSv3] execve [SUSv3] 3036 execvp [SUSv3] exit [SUSv3] fchdir [SUSv3] fchmod [SUSv3] 3037 fchown [SUSv3] fcntl [LSB] fdatasync [SUSv3] flock [LSB] 3038 fork [SUSv3] fstatvfs [SUSv3] fsync [SUSv3] ftime [SUSv3] 3039 ftruncate [SUSv3] getcontext [SUSv3] getegid [SUSv3] geteuid 3040 [SUSv3] 3041 getgid [SUSv3] getgroups [SUSv3] getitimer [SUSv3] getloadavg 3042 [LSB] 3043 getpagesize [SUSv2] getpgid [SUSv3] getpgrp [SUSv3] getpid 3044 [SUSv3] 3045 getppid [SUSv3] getpriority [SUSv3] getrlimit [SUSv3] 3046 getrusage [SUSv3] 3047 getsid [SUSv3] getuid [SUSv3] getwd [SUSv3] initgroups [LSB] 3048 ioctl [LSB] kill [LSB] killpg [SUSv3] lchown [SUSv3] 3049 link [LSB] lockf [SUSv3] lseek [SUSv3] mkdir [SUSv3] 3050 mkfifo [SUSv3] mlock [SUSv3] mlockall [SUSv3] mmap [SUSv3] 3051 mprotect [SUSv3] msync [SUSv3] munlock [SUSv3] munlockall 3052 [SUSv3] 3053 munmap [SUSv3] nanosleep [SUSv3] nice [SUSv3] open [SUSv3] 3054 opendir [SUSv3] pathconf [SUSv3] pause [SUSv3] pipe [SUSv3] 3055 poll [SUSv3] read [SUSv3] readdir [SUSv3] readdir_r [SUSv3] 3056 readlink [SUSv3] readv [SUSv3] rename [SUSv3] rmdir [SUSv3] 3057 sbrk [SUSv2] sched_get_priority_max [SUSv3] 3058 sched_get_priority_min [SUSv3] sched_getparam [SUSv3] 3059 sched_getscheduler [SUSv3] sched_rr_get_interval [SUSv3] 3060 sched_setparam [SUSv3] sched_setscheduler [SUSv3] 3061 sched_yield [SUSv3] select [SUSv3] setcontext [SUSv3] setegid 3062 [SUSv3] 3063 seteuid [SUSv3] setgid [SUSv3] setitimer [SUSv3] setpgid 3064 [SUSv3] 3065 setpgrp [SUSv3] setpriority [SUSv3] setregid [SUSv3] setreuid 3066 [SUSv3] 3067 setrlimit [SUSv3] setrlimit64 [LFS] setsid [SUSv3] setuid 3068 [SUSv3] 3069 sleep [SUSv3] statvfs [SUSv3] stime [LSB] symlink [SUSv3] 3070 sync [SUSv3] sysconf [SUSv3] time [SUSv3] times [SUSv3] 3071 truncate [SUSv3] ulimit [SUSv3] umask [SUSv3] uname [SUSv3] 3072 unlink [LSB] utime [SUSv3] utimes [SUSv3] vfork [SUSv3] 3073 wait [SUSv3] wait4 [LSB] waitpid [LSB] write [SUSv3] 3074 writev [SUSv3] 3075 _________________________________________________________ 3076 3077 13.3.3. Standard I/O 3078 _________________________________________________________ 3079 3080 13.3.3.1. Interfaces for Standard I/O 3081 3082 An LSB conforming implementation shall provide the generic 3083 functions for Standard I/O specified in Table 13-4, with the 3084 full mandatory functionality as described in the referenced 3085 underlying specification. 3086 3087 Table 13-4. libc - Standard I/O Function Interfaces 3088 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 3089 asprintf [LSB] clearerr [SUSv3] ctermid [SUSv3] fclose [SUSv3] 3090 fdopen [SUSv3] feof [SUSv3] ferror [SUSv3] fflush [SUSv3] 3091 fflush_unlocked [LSB] fgetc [SUSv3] fgetpos [SUSv3] fgets 3092 [SUSv3] 3093 fgetwc_unlocked [LSB] fileno [SUSv3] flockfile [SUSv3] fopen 3094 [SUSv3] 3095 fprintf [SUSv3] fputc [SUSv3] fputs [SUSv3] fread [SUSv3] 3096 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 3097 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 3098 getc [SUSv3] getc_unlocked [SUSv3] getchar [SUSv3] 3099 getchar_unlocked [SUSv3] 3100 getw [SUSv2] pclose [SUSv3] popen [SUSv3] printf [SUSv3] 3101 putc [SUSv3] putc_unlocked [SUSv3] putchar [SUSv3] 3102 putchar_unlocked [SUSv3] 3103 puts [SUSv3] putw [SUSv2] remove [SUSv3] rewind [SUSv3] 3104 rewinddir [SUSv3] scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] 3105 setbuffer [LSB] setvbuf [SUSv3] snprintf [SUSv3] sprintf 3106 [SUSv3] 3107 sscanf [LSB] telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] 3108 vasprintf [LSB] vdprintf [LSB] vfprintf [SUSv3] vprintf 3109 [SUSv3] 3110 vsnprintf [SUSv3] vsprintf [SUSv3] 3111 3112 An LSB conforming implementation shall provide the generic 3113 data interfaces for Standard I/O specified in Table 13-5, with 3114 the full mandatory functionality as described in the 3115 referenced underlying specification. 3116 3117 Table 13-5. libc - Standard I/O Data Interfaces 3118 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 3119 _________________________________________________________ 3120 3121 13.3.4. Signal Handling 3122 _________________________________________________________ 3123 3124 13.3.4.1. Interfaces for Signal Handling 3125 3126 An LSB conforming implementation shall provide the generic 3127 functions for Signal Handling specified in Table 13-6, with 3128 the full mandatory functionality as described in the 3129 referenced underlying specification. 3130 3131 Table 13-6. libc - Signal Handling Function Interfaces 3132 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 3133 __sigsetjmp [LSB] __sysv_signal [LSB] 3134 bsd_signal [SUSv3] psignal [LSB] raise [SUSv3] sigaction 3135 [SUSv3] 3136 sigaddset [SUSv3] sigaltstack [SUSv3] sigandset [LSB] 3137 sigdelset [SUSv3] 3138 sigemptyset [SUSv3] sigfillset [SUSv3] sighold [SUSv3] 3139 sigignore [SUSv3] 3140 siginterrupt [SUSv3] sigisemptyset [LSB] sigismember [SUSv3] 3141 siglongjmp [SUSv3] 3142 signal [SUSv3] sigorset [LSB] sigpause [SUSv3] sigpending 3143 [SUSv3] 3144 sigprocmask [SUSv3] sigqueue [SUSv3] sigrelse [SUSv3] 3145 sigreturn [LSB] 3146 sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait [SUSv3] sigwait 3147 [SUSv3] 3148 sigwaitinfo [SUSv3] 3149 3150 An LSB conforming implementation shall provide the generic 3151 data interfaces for Signal Handling specified in Table 13-7, 3152 with the full mandatory functionality as described in the 3153 referenced underlying specification. 3154 3155 Table 13-7. libc - Signal Handling Data Interfaces 3156 _sys_siglist [LSB] 3157 _________________________________________________________ 3158 3159 13.3.5. Localization Functions 3160 _________________________________________________________ 3161 3162 13.3.5.1. Interfaces for Localization Functions 3163 3164 An LSB conforming implementation shall provide the generic 3165 functions for Localization Functions specified in Table 13-8, 3166 with the full mandatory functionality as described in the 3167 referenced underlying specification. 3168 3169 Table 13-8. libc - Localization Functions Function Interfaces 3170 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 3171 [SUSv3] catgets [SUSv3] 3172 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext 3173 [LSB] 3174 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 3175 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 3176 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] 3177 localeconv [SUSv3] 3178 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 3179 setlocale [SUSv3] 3180 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 3181 3182 An LSB conforming implementation shall provide the generic 3183 data interfaces for Localization Functions specified in Table 3184 13-9, with the full mandatory functionality as described in 3185 the referenced underlying specification. 3186 3187 Table 13-9. libc - Localization Functions Data Interfaces 3188 _nl_msg_cat_cntr [LSB] 3189 _________________________________________________________ 3190 3191 13.3.6. Socket Interface 3192 _________________________________________________________ 3193 3194 13.3.6.1. Interfaces for Socket Interface 3195 3196 An LSB conforming implementation shall provide the generic 3197 functions for Socket Interface specified in Table 13-10, with 3198 the full mandatory functionality as described in the 3199 referenced underlying specification. 3200 3201 Table 13-10. libc - Socket Interface Function Interfaces 3202 __h_errno_location [LSB] accept [SUSv3] bind [SUSv3] 3203 bindresvport [LSB] 3204 connect [SUSv3] gethostid [SUSv3] gethostname [SUSv3] 3205 getpeername [SUSv3] 3206 getsockname [SUSv3] getsockopt [LSB] if_freenameindex [SUSv3] 3207 if_indextoname [SUSv3] 3208 if_nameindex [SUSv3] if_nametoindex [SUSv3] listen [SUSv3] 3209 recv [SUSv3] 3210 recvfrom [SUSv3] recvmsg [SUSv3] send [SUSv3] sendmsg [SUSv3] 3211 sendto [SUSv3] setsockopt [LSB] shutdown [SUSv3] sockatmark 3212 [SUSv3] 3213 socket [SUSv3] socketpair [SUSv3] 3214 _________________________________________________________ 3215 3216 13.3.7. Wide Characters 3217 _________________________________________________________ 3218 3219 13.3.7.1. Interfaces for Wide Characters 3220 3221 An LSB conforming implementation shall provide the generic 3222 functions for Wide Characters specified in Table 13-11, with 3223 the full mandatory functionality as described in the 3224 referenced underlying specification. 3225 3226 Table 13-11. libc - Wide Characters Function Interfaces 3227 __wcstod_internal [LSB] __wcstof_internal [LSB] 3228 __wcstol_internal [LSB] __wcstold_internal [LSB] 3229 __wcstoul_internal [LSB] btowc [SUSv3] fgetwc [SUSv3] fgetws 3230 [SUSv3] 3231 fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] fwprintf [SUSv3] 3232 fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] mblen [SUSv3] 3233 mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] mbsnrtowcs 3234 [LSB] 3235 mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc [SUSv3] putwc 3236 [SUSv3] 3237 putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] towctrans 3238 [SUSv3] 3239 towlower [SUSv3] towupper [SUSv3] ungetwc [SUSv3] vfwprintf 3240 [SUSv3] 3241 vfwscanf [LSB] vswprintf [SUSv3] vswscanf [LSB] vwprintf 3242 [SUSv3] 3243 vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] wcrtomb [SUSv3] 3244 wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] wcscmp [SUSv3] 3245 wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] wcsdup [LSB] 3246 wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] wcsncat 3247 [SUSv3] 3248 wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] wcsnrtombs [LSB] 3249 wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs [SUSv3] wcsspn 3250 [SUSv3] 3251 wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] wcstoimax [SUSv3] 3252 wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] wcstoll [SUSv3] 3253 wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] wcstoull [SUSv3] 3254 wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] wcswidth 3255 [SUSv3] 3256 wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] wctrans [SUSv3] 3257 wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] wmemcmp [SUSv3] 3258 wmemcpy [SUSv3] wmemmove [SUSv3] wmemset [SUSv3] wprintf 3259 [SUSv3] 3260 wscanf [LSB] 3261 _________________________________________________________ 3262 3263 13.3.8. String Functions 3264 _________________________________________________________ 3265 3266 13.3.8.1. Interfaces for String Functions 3267 3268 An LSB conforming implementation shall provide the generic 3269 functions for String Functions specified in Table 13-12, with 3270 the full mandatory functionality as described in the 3271 referenced underlying specification. 3272 3273 Table 13-12. libc - String Functions Function Interfaces 3274 __mempcpy [LSB] __rawmemchr [LSB] __stpcpy [LSB] __strdup 3275 [LSB] 3276 __strtod_internal [LSB] __strtof_internal [LSB] __strtok_r 3277 [LSB] __strtol_internal [LSB] 3278 __strtold_internal [LSB] __strtoll_internal [LSB] 3279 __strtoul_internal [LSB] __strtoull_internal [LSB] 3280 bcmp [SUSv3] bcopy [SUSv3] bzero [SUSv3] ffs [SUSv3] 3281 index [SUSv3] memccpy [SUSv3] memchr [SUSv3] memcmp [SUSv3] 3282 memcpy [SUSv3] memmove [SUSv3] memrchr [LSB] memset [SUSv3] 3283 rindex [SUSv3] stpcpy [LSB] stpncpy [LSB] strcasecmp [SUSv3] 3284 strcasestr [LSB] strcat [SUSv3] strchr [SUSv3] strcmp [SUSv3] 3285 strcoll [SUSv3] strcpy [SUSv3] strcspn [SUSv3] strdup [SUSv3] 3286 strerror [SUSv3] strerror_r [LSB] strfmon [SUSv3] strftime 3287 [SUSv3] 3288 strlen [SUSv3] strncasecmp [SUSv3] strncat [SUSv3] strncmp 3289 [SUSv3] 3290 strncpy [SUSv3] strndup [LSB] strnlen [LSB] strpbrk [SUSv3] 3291 strptime [LSB] strrchr [SUSv3] strsep [LSB] strsignal [LSB] 3292 strspn [SUSv3] strstr [SUSv3] strtof [SUSv3] strtoimax [SUSv3] 3293 strtok [SUSv3] strtok_r [SUSv3] strtold [SUSv3] strtoll 3294 [SUSv3] 3295 strtoq [LSB] strtoull [SUSv3] strtoumax [SUSv3] strtouq [LSB] 3296 strxfrm [SUSv3] swab [SUSv3] 3297 _________________________________________________________ 3298 3299 13.3.9. IPC Functions 3300 _________________________________________________________ 3301 3302 13.3.9.1. Interfaces for IPC Functions 3303 3304 An LSB conforming implementation shall provide the generic 3305 functions for IPC Functions specified in Table 13-13, with the 3306 full mandatory functionality as described in the referenced 3307 underlying specification. 3308 3309 Table 13-13. libc - IPC Functions Function Interfaces 3310 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 3311 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 3312 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 3313 _________________________________________________________ 3314 3315 13.3.10. Regular Expressions 3316 _________________________________________________________ 3317 3318 13.3.10.1. Interfaces for Regular Expressions 3319 3320 An LSB conforming implementation shall provide the generic 3321 functions for Regular Expressions specified in Table 13-14, 3322 with the full mandatory functionality as described in the 3323 referenced underlying specification. 3324 3325 Table 13-14. libc - Regular Expressions Function Interfaces 3326 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 3327 _________________________________________________________ 3328 3329 13.3.11. Character Type Functions 3330 _________________________________________________________ 3331 3332 13.3.11.1. Interfaces for Character Type Functions 3333 3334 An LSB conforming implementation shall provide the generic 3335 functions for Character Type Functions specified in Table 3336 13-15, with the full mandatory functionality as described in 3337 the referenced underlying specification. 3338 3339 Table 13-15. libc - Character Type Functions Function 3340 Interfaces 3341 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 3342 __ctype_tolower_loc(GLIBC_2.3) [LSB] 3343 __ctype_toupper_loc(GLIBC_2.3) [LSB] 3344 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 3345 [SUSv3] 3346 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph 3347 [SUSv3] 3348 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace 3349 [SUSv3] 3350 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 3351 [SUSv3] 3352 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 3353 [SUSv3] 3354 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 3355 [SUSv3] 3356 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 3357 [SUSv3] 3358 tolower [SUSv3] toupper [SUSv3] 3359 _________________________________________________________ 3360 3361 13.3.12. Time Manipulation 3362 _________________________________________________________ 3363 3364 13.3.12.1. Interfaces for Time Manipulation 3365 3366 An LSB conforming implementation shall provide the generic 3367 functions for Time Manipulation specified in Table 13-16, with 3368 the full mandatory functionality as described in the 3369 referenced underlying specification. 3370 3371 Table 13-16. libc - Time Manipulation Function Interfaces 3372 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 3373 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 3374 [SUSv3] 3375 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 3376 [SUSv3] 3377 ualarm [SUSv3] 3378 3379 An LSB conforming implementation shall provide the generic 3380 data interfaces for Time Manipulation specified in Table 3381 13-17, with the full mandatory functionality as described in 3382 the referenced underlying specification. 3383 3384 Table 13-17. libc - Time Manipulation Data Interfaces 3385 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 3386 [SUSv3] 3387 timezone [SUSv3] tzname [SUSv3] 3388 _________________________________________________________ 3389 3390 13.3.13. Terminal Interface Functions 3391 _________________________________________________________ 3392 3393 13.3.13.1. Interfaces for Terminal Interface Functions 3394 3395 An LSB conforming implementation shall provide the generic 3396 functions for Terminal Interface Functions specified in Table 3397 13-18, with the full mandatory functionality as described in 3398 the referenced underlying specification. 3399 3400 Table 13-18. libc - Terminal Interface Functions Function 3401 Interfaces 3402 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 3403 cfsetispeed [SUSv3] 3404 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 3405 [SUSv3] 3406 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 3407 [SUSv3] 3408 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 3409 _________________________________________________________ 3410 3411 13.3.14. System Database Interface 3412 _________________________________________________________ 3413 3414 13.3.14.1. Interfaces for System Database Interface 3415 3416 An LSB conforming implementation shall provide the generic 3417 functions for System Database Interface specified in Table 3418 13-19, with the full mandatory functionality as described in 3419 the referenced underlying specification. 3420 3421 Table 13-19. libc - System Database Interface Function 3422 Interfaces 3423 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 3424 endservent [SUSv3] 3425 endutent [SUSv2] endutxent [SUSv3] getgrent [SUSv3] getgrgid 3426 [SUSv3] 3427 getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r [SUSv3] 3428 getgrouplist [LSB] 3429 gethostbyaddr [SUSv3] gethostbyname [SUSv3] getprotobyname 3430 [SUSv3] getprotobynumber [SUSv3] 3431 getprotoent [SUSv3] getpwent [SUSv3] getpwnam [SUSv3] 3432 getpwnam_r [SUSv3] 3433 getpwuid [SUSv3] getpwuid_r [SUSv3] getservbyname [SUSv3] 3434 getservbyport [SUSv3] 3435 getservent [SUSv3] getutent [LSB] getutent_r [LSB] getutxent 3436 [SUSv3] 3437 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] 3438 setgrent [SUSv3] 3439 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] 3440 setservent [SUSv3] 3441 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 3442 _________________________________________________________ 3443 3444 13.3.15. Language Support 3445 _________________________________________________________ 3446 3447 13.3.15.1. Interfaces for Language Support 3448 3449 An LSB conforming implementation shall provide the generic 3450 functions for Language Support specified in Table 13-20, with 3451 the full mandatory functionality as described in the 3452 referenced underlying specification. 3453 3454 Table 13-20. libc - Language Support Function Interfaces 3455 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 3456 _________________________________________________________ 3457 3458 13.3.16. Large File Support 3459 _________________________________________________________ 3460 3461 13.3.16.1. Interfaces for Large File Support 3462 3463 An LSB conforming implementation shall provide the generic 3464 functions for Large File Support specified in Table 13-21, 3465 with the full mandatory functionality as described in the 3466 referenced underlying specification. 3467 3468 Table 13-21. libc - Large File Support Function Interfaces 3469 __fxstat64 [LSB] __lxstat64 [LSB] __xstat64 [LSB] creat64 3470 [LFS] 3471 fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] fseeko64 [LFS] 3472 fsetpos64 [LFS] fstatvfs64 [LFS] ftello64 [LFS] ftruncate64 3473 [LFS] 3474 ftw64 [LFS] getrlimit64 [LFS] lockf64 [LFS] mkstemp64 [LFS] 3475 mmap64 [LFS] nftw64 [LFS] readdir64 [LFS] statvfs64 [LFS] 3476 tmpfile64 [LFS] truncate64 [LFS] 3477 _________________________________________________________ 3478 3479 13.3.17. Standard Library 3480 _________________________________________________________ 3481 3482 13.3.17.1. Interfaces for Standard Library 3483 3484 An LSB conforming implementation shall provide the generic 3485 functions for Standard Library specified in Table 13-22, with 3486 the full mandatory functionality as described in the 3487 referenced underlying specification. 3488 3489 Table 13-22. libc - Standard Library Function Interfaces 3490 _Exit [SUSv3] __assert_fail [LSB] __cxa_atexit [LSB] 3491 __errno_location [LSB] 3492 __fpending [LSB] __getpagesize [LSB] __isinf [LSB] __isinff 3493 [LSB] 3494 __isinfl [LSB] __isnan [LSB] __isnanf [LSB] __isnanl [LSB] 3495 __sysconf [LSB] _exit [SUSv3] _longjmp [SUSv3] _setjmp [SUSv3] 3496 a64l [SUSv3] abort [SUSv3] abs [SUSv3] atof [SUSv3] 3497 atoi [SUSv3] atol [SUSv3] atoll [SUSv3] basename [SUSv3] 3498 bsearch [SUSv3] calloc [SUSv3] closelog [SUSv3] confstr 3499 [SUSv3] 3500 cuserid [SUSv2] daemon [LSB] dirname [SUSv3] div [SUSv3] 3501 drand48 [SUSv3] ecvt [SUSv3] erand48 [SUSv3] err [LSB] 3502 error [LSB] errx [LSB] fcvt [SUSv3] fmtmsg [SUSv3] 3503 fnmatch [SUSv3] fpathconf [SUSv3] free [SUSv3] freeaddrinfo 3504 [SUSv3] 3505 ftrylockfile [SUSv3] ftw [SUSv3] funlockfile [SUSv3] 3506 gai_strerror [SUSv3] 3507 gcvt [SUSv3] getaddrinfo [SUSv3] getcwd [SUSv3] getdate 3508 [SUSv3] 3509 getenv [SUSv3] getlogin [SUSv3] getlogin_r [SUSv3] getnameinfo 3510 [SUSv3] 3511 getopt [LSB] getopt_long [LSB] getopt_long_only [LSB] 3512 getsubopt [SUSv3] 3513 gettimeofday [SUSv3] glob [SUSv3] glob64 [LSB] globfree 3514 [SUSv3] 3515 globfree64 [LSB] grantpt [SUSv3] hcreate [SUSv3] hdestroy 3516 [SUSv3] 3517 hsearch [SUSv3] htonl [SUSv3] htons [SUSv3] imaxabs [SUSv3] 3518 imaxdiv [SUSv3] inet_addr [SUSv3] inet_ntoa [SUSv3] inet_ntop 3519 [SUSv3] 3520 inet_pton [SUSv3] initstate [SUSv3] insque [SUSv3] isatty 3521 [SUSv3] 3522 isblank [SUSv3] jrand48 [SUSv3] l64a [SUSv3] labs [SUSv3] 3523 lcong48 [SUSv3] ldiv [SUSv3] lfind [SUSv3] llabs [SUSv3] 3524 lldiv [SUSv3] longjmp [SUSv3] lrand48 [SUSv3] lsearch [SUSv3] 3525 makecontext [SUSv3] malloc [SUSv3] memmem [LSB] mkstemp 3526 [SUSv3] 3527 mktemp [SUSv3] mrand48 [SUSv3] nftw [SUSv3] nrand48 [SUSv3] 3528 ntohl [SUSv3] ntohs [SUSv3] openlog [SUSv3] perror [SUSv3] 3529 posix_memalign [SUSv3] posix_openpt [SUSv3] ptsname [SUSv3] 3530 putenv [SUSv3] 3531 qsort [SUSv3] rand [SUSv3] rand_r [SUSv3] random [SUSv3] 3532 realloc [SUSv3] realpath [SUSv3] remque [SUSv3] seed48 [SUSv3] 3533 setenv [SUSv3] sethostname [LSB] setlogmask [SUSv3] setstate 3534 [SUSv3] 3535 srand [SUSv3] srand48 [SUSv3] srandom [SUSv3] strtod [SUSv3] 3536 strtol [SUSv3] strtoul [SUSv3] swapcontext [SUSv3] syslog 3537 [SUSv3] 3538 system [LSB] tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] 3539 tmpnam [SUSv3] tsearch [SUSv3] ttyname [SUSv3] ttyname_r 3540 [SUSv3] 3541 twalk [SUSv3] unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] 3542 verrx [LSB] vfscanf [LSB] vscanf [LSB] vsscanf [LSB] 3543 vsyslog [LSB] warn [LSB] warnx [LSB] wordexp [SUSv3] 3544 wordfree [SUSv3] 3545 3546 An LSB conforming implementation shall provide the generic 3547 data interfaces for Standard Library specified in Table 13-23, 3548 with the full mandatory functionality as described in the 3549 referenced underlying specification. 3550 3551 Table 13-23. libc - Standard Library Data Interfaces 3552 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 3553 [SUSv3] 3554 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 3555 [SUSv3] 3556 optopt [SUSv3] 3557 _________________________________________________________ 3558 3559 13.4. Data Definitions for libc 3560 3561 This section defines global identifiers and their values that 3562 are associated with interfaces contained in libc. These 3563 definitions are organized into groups that correspond to 3564 system headers. This convention is used as a convenience for 3565 the reader, and does not imply the existence of these headers, 3566 or their content. Where an interface is defined as requiring a 3567 particular system header file all of the data definitions for 3568 that system header file presented here shall be in effect. 3569 3570 This section gives data definitions to promote binary 3571 application portability, not to repeat source interface 3572 definitions available elsewhere. System providers and 3573 application developers should use this ABI to supplement - not 3574 to replace - source interface definition specifications. 3575 3576 This specification uses the ISO C (1999) C Language as the 3577 reference programming language, and data definitions are 3578 specified in ISO C format. The C language is used here as a 3579 convenient notation. Using a C language description of these 3580 data objects does not preclude their use by other programming 3581 languages. 3582 _________________________________________________________ 3583 3584 13.4.1. arpa/inet.h 3585 3586 extern uint32_t htonl(uint32_t); 3587 extern uint16_t htons(uint16_t); 3588 extern in_addr_t inet_addr(const char *); 3589 extern char *inet_ntoa(struct in_addr); 3590 extern const char *inet_ntop(int, const void *, char *, socklen_t); 3591 extern int inet_pton(int, const char *, void *); 3592 extern uint32_t ntohl(uint32_t); 3593 extern uint16_t ntohs(uint16_t); 3594 _________________________________________________________ 3595 3596 13.4.2. assert.h 3597 3598 The assert.h header shall define the assert() macro. It refers 3599 to the macro NDEBUG, which is not defined in this header. If 3600 NDEBUG is defined before the inclusion of this header, the 3601 assert() macro shall be defined as described below, otherwise 3602 the macro shall behave as described in assert() in ISO/IEC 3603 9945 POSIX. 3604 extern void __assert_fail(const char *, const char *, unsigned int, 3605 const char *); 3606 _________________________________________________________ 3607 3608 13.4.3. ctype.h 3609 3610 enum { 3611 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint, 3612 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 3613 }; 3614 extern int _tolower(int); 3615 extern int _toupper(int); 3616 extern int isalnum(int); 3617 extern int isalpha(int); 3618 extern int isascii(int); 3619 extern int iscntrl(int); 3620 extern int isdigit(int); 3621 extern int isgraph(int); 3622 extern int islower(int); 3623 extern int isprint(int); 3624 extern int ispunct(int); 3625 extern int isspace(int); 3626 extern int isupper(int); 3627 extern int isxdigit(int); 3628 extern int toascii(int); 3629 extern int tolower(int); 3630 extern int toupper(int); 3631 extern int isblank(int); 3632 extern const unsigned short **__ctype_b_loc(void); 3633 extern const int32_t **__ctype_toupper_loc(void); 3634 extern const int32_t **__ctype_tolower_loc(void); 3635 _________________________________________________________ 3636 3637 13.4.4. dirent.h 3638 3639 typedef struct __dirstream DIR; 3640 3641 struct dirent { 3642 long int d_ino; 3643 off_t d_off; 3644 unsigned short d_reclen; 3645 unsigned char d_type; 3646 char d_name[256]; 3647 }; 3648 struct dirent64 { 3649 uint64_t d_ino; 3650 int64_t d_off; 3651 unsigned short d_reclen; 3652 unsigned char d_type; 3653 char d_name[256]; 3654 }; 3655 extern void rewinddir(DIR *); 3656 extern void seekdir(DIR *, long int); 3657 extern long int telldir(DIR *); 3658 extern int closedir(DIR *); 3659 extern DIR *opendir(const char *); 3660 extern struct dirent *readdir(DIR *); 3661 extern struct dirent64 *readdir64(DIR *); 3662 extern int readdir_r(DIR *, struct dirent *, struct dirent **); 3663 _________________________________________________________ 3664 3665 13.4.5. err.h 3666 3667 extern void err(int, const char *, ...); 3668 extern void errx(int, const char *, ...); 3669 extern void warn(const char *, ...); 3670 extern void warnx(const char *, ...); 3671 extern void error(int, int, const char *, ...); 3672 _________________________________________________________ 3673 3674 13.4.6. errno.h 3675 3676 ISO POSIX (2003) requires that each error value shall be 3677 unique, with permission for EAGAIN and EWOULDBLOCK possibly 3678 having the same value. This specification also requires that 3679 ENOTSUP and EOPNOTSUPP have the same value. 3680 3681 Note: A defect report against ISO POSIX (2003) has been 3682 filed to request that specification also permit these two 3683 symbols to have the same value. 3684 3685 #define errno (*__errno_location()) 3686 3687 #define EPERM 1 3688 #define ECHILD 10 3689 #define ENETDOWN 100 3690 #define ENETUNREACH 101 3691 #define ENETRESET 102 3692 #define ECONNABORTED 103 3693 #define ECONNRESET 104 3694 #define ENOBUFS 105 3695 #define EISCONN 106 3696 #define ENOTCONN 107 3697 #define ESHUTDOWN 108 3698 #define ETOOMANYREFS 109 3699 #define EAGAIN 11 3700 #define ETIMEDOUT 110 3701 #define ECONNREFUSED 111 3702 #define EHOSTDOWN 112 3703 #define EHOSTUNREACH 113 3704 #define EALREADY 114 3705 #define EINPROGRESS 115 3706 #define ESTALE 116 3707 #define EUCLEAN 117 3708 #define ENOTNAM 118 3709 #define ENAVAIL 119 3710 #define ENOMEM 12 3711 #define EISNAM 120 3712 #define EREMOTEIO 121 3713 #define EDQUOT 122 3714 #define ENOMEDIUM 123 3715 #define EMEDIUMTYPE 124 3716 #define ECANCELED 125 3717 #define EACCES 13 3718 #define EFAULT 14 3719 #define ENOTBLK 15 3720 #define EBUSY 16 3721 #define EEXIST 17 3722 #define EXDEV 18 3723 #define ENODEV 19 3724 #define ENOENT 2 3725 #define ENOTDIR 20 3726 #define EISDIR 21 3727 #define EINVAL 22 3728 #define ENFILE 23 3729 #define EMFILE 24 3730 #define ENOTTY 25 3731 #define ETXTBSY 26 3732 #define EFBIG 27 3733 #define ENOSPC 28 3734 #define ESPIPE 29 3735 #define ESRCH 3 3736 #define EROFS 30 3737 #define EMLINK 31 3738 #define EPIPE 32 3739 #define EDOM 33 3740 #define ERANGE 34 3741 #define EDEADLK 35 3742 #define ENAMETOOLONG 36 3743 #define ENOLCK 37 3744 #define ENOSYS 38 3745 #define ENOTEMPTY 39 3746 #define EINTR 4 3747 #define ELOOP 40 3748 #define ENOMSG 42 3749 #define EIDRM 43 3750 #define ECHRNG 44 3751 #define EL2NSYNC 45 3752 #define EL3HLT 46 3753 #define EL3RST 47 3754 #define ELNRNG 48 3755 #define EUNATCH 49 3756 #define EIO 5 3757 #define ENOANO 55 3758 #define EBADRQC 56 3759 #define EBADSLT 57 3760 #define EBFONT 59 3761 #define ENXIO 6 3762 #define ENOSTR 60 3763 #define ENODATA 61 3764 #define ETIME 62 3765 #define ENOSR 63 3766 #define ENONET 64 3767 #define ENOPKG 65 3768 #define EREMOTE 66 3769 #define ENOLINK 67 3770 #define EADV 68 3771 #define ESRMNT 69 3772 #define E2BIG 7 3773 #define ECOMM 70 3774 #define EPROTO 71 3775 #define EMULTIHOP 72 3776 #define EDOTDOT 73 3777 #define EBADMSG 74 3778 #define EOVERFLOW 75 3779 #define ENOTUNIQ 76 3780 #define EBADFD 77 3781 #define EREMCHG 78 3782 #define ELIBACC 79 3783 #define ENOEXEC 8 3784 #define ELIBBAD 80 3785 #define ELIBSCN 81 3786 #define ELIBMAX 82 3787 #define ELIBEXEC 83 3788 #define EILSEQ 84 3789 #define ERESTART 85 3790 #define ESTRPIPE 86 3791 #define EUSERS 87 3792 #define ENOTSOCK 88 3793 #define EDESTADDRREQ 89 3794 #define EBADF 9 3795 #define EMSGSIZE 90 3796 #define EPROTOTYPE 91 3797 #define ENOPROTOOPT 92 3798 #define EPROTONOSUPPORT 93 3799 #define ESOCKTNOSUPPORT 94 3800 #define EOPNOTSUPP 95 3801 #define EPFNOSUPPORT 96 3802 #define EAFNOSUPPORT 97 3803 #define EADDRINUSE 98 3804 #define EADDRNOTAVAIL 99 3805 #define EWOULDBLOCK EAGAIN 3806 #define ENOTSUP EOPNOTSUPP 3807 3808 extern int *__errno_location(void); 3809 _________________________________________________________ 3810 3811 13.4.7. fcntl.h 3812 3813 #define O_RDONLY 00 3814 #define O_ACCMODE 0003 3815 #define O_WRONLY 01 3816 #define O_CREAT 0100 3817 #define O_TRUNC 01000 3818 #define O_SYNC 010000 3819 #define O_RDWR 02 3820 #define O_EXCL 0200 3821 #define O_APPEND 02000 3822 #define O_ASYNC 020000 3823 #define O_NOCTTY 0400 3824 #define O_NDELAY 04000 3825 #define O_NONBLOCK 04000 3826 #define FD_CLOEXEC 1 3827 3828 struct flock { 3829 short l_type; 3830 short l_whence; 3831 off_t l_start; 3832 off_t l_len; 3833 pid_t l_pid; 3834 }; 3835 struct flock64 { 3836 short l_type; 3837 short l_whence; 3838 loff_t l_start; 3839 loff_t l_len; 3840 pid_t l_pid; 3841 }; 3842 3843 #define F_DUPFD 0 3844 #define F_RDLCK 0 3845 #define F_GETFD 1 3846 #define F_WRLCK 1 3847 #define F_SETFD 2 3848 #define F_UNLCK 2 3849 #define F_GETFL 3 3850 #define F_SETFL 4 3851 #define F_GETLK 5 3852 #define F_SETLK 6 3853 #define F_SETLKW 7 3854 #define F_SETOWN 8 3855 #define F_GETOWN 9 3856 3857 extern int lockf64(int, int, off64_t); 3858 extern int fcntl(int, int, ...); 3859 _________________________________________________________ 3860 3861 13.4.8. fmtmsg.h 3862 3863 #define MM_HARD 1 3864 #define MM_NRECOV 128 3865 #define MM_UTIL 16 3866 #define MM_SOFT 2 3867 #define MM_OPSYS 32 3868 #define MM_FIRM 4 3869 #define MM_RECOVER 64 3870 #define MM_APPL 8 3871 3872 #define MM_NOSEV 0 3873 #define MM_HALT 1 3874 #define MM_ERROR 2 3875 3876 #define MM_NULLLBL ((char *) 0) 3877 3878 extern int fmtmsg(long int, const char *, int, const char *, const char *, 3879 const char *); 3880 _________________________________________________________ 3881 3882 13.4.9. fnmatch.h 3883 3884 #define FNM_PATHNAME (1<<0) 3885 #define FNM_NOESCAPE (1<<1) 3886 #define FNM_PERIOD (1<<2) 3887 #define FNM_NOMATCH 1 3888 3889 extern int fnmatch(const char *, const char *, int); 3890 _________________________________________________________ 3891 3892 13.4.10. ftw.h 3893 3894 #define FTW_D FTW_D 3895 #define FTW_DNR FTW_DNR 3896 #define FTW_DP FTW_DP 3897 #define FTW_F FTW_F 3898 #define FTW_NS FTW_NS 3899 #define FTW_SL FTW_SL 3900 #define FTW_SLN FTW_SLN 3901 3902 enum { 3903 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 3904 }; 3905 3906 enum { 3907 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 3908 }; 3909 3910 struct FTW { 3911 int base; 3912 int level; 3913 }; 3914 3915 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 3916 int __flag); 3917 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 3918 int __flag); 3919 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 3920 int __flag, struct FTW * __info); 3921 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 3922 int __flag, struct FTW * __info); 3923 extern int ftw(const char *, __ftw_func_t, int); 3924 extern int ftw64(const char *, __ftw64_func_t, int); 3925 extern int nftw(const char *, __nftw_func_t, int, int); 3926 extern int nftw64(const char *, __nftw64_func_t, int, int); 3927 _________________________________________________________ 3928 3929 13.4.11. getopt.h 3930 3931 #define no_argument 0 3932 #define required_argument 1 3933 #define optional_argument 2 3934 3935 struct option { 3936 char *name; 3937 int has_arg; 3938 int *flag; 3939 int val; 3940 }; 3941 extern int getopt_long(int, char *const, const char *, 3942 const struct option *, int *); 3943 extern int getopt_long_only(int, char *const, const char *, 3944 const struct option *, int *); 3945 _________________________________________________________ 3946 3947 13.4.12. glob.h 3948 3949 #define GLOB_ERR (1<<0) 3950 #define GLOB_MARK (1<<1) 3951 #define GLOB_BRACE (1<<10) 3952 #define GLOB_NOMAGIC (1<<11) 3953 #define GLOB_TILDE (1<<12) 3954 #define GLOB_ONLYDIR (1<<13) 3955 #define GLOB_TILDE_CHECK (1<<14) 3956 #define GLOB_NOSORT (1<<2) 3957 #define GLOB_DOOFFS (1<<3) 3958 #define GLOB_NOCHECK (1<<4) 3959 #define GLOB_APPEND (1<<5) 3960 #define GLOB_NOESCAPE (1<<6) 3961 #define GLOB_PERIOD (1<<7) 3962 #define GLOB_MAGCHAR (1<<8) 3963 #define GLOB_ALTDIRFUNC (1<<9) 3964 3965 #define GLOB_NOSPACE 1 3966 #define GLOB_ABORTED 2 3967 #define GLOB_NOMATCH 3 3968 #define GLOB_NOSYS 4 3969 3970 typedef struct { 3971 size_t gl_pathc; 3972 char **gl_pathv; 3973 size_t gl_offs; 3974 int gl_flags; 3975 void (*gl_closedir) (void *); 3976 struct dirent *(*gl_readdir) (void *); 3977 void *(*gl_opendir) (const char *); 3978 int (*gl_lstat) (const char *, struct stat *); 3979 int (*gl_stat) (const char *, struct stat *); 3980 } glob_t; 3981 3982 typedef struct { 3983 size_t gl_pathc; 3984 char **gl_pathv; 3985 size_t gl_offs; 3986 int gl_flags; 3987 void (*gl_closedir) (void *); 3988 struct dirent64 *(*gl_readdir64) (void *); 3989 void *(*gl_opendir) (const char *); 3990 int (*gl_lstat) (const char *, struct stat *); 3991 int (*gl_stat) (const char *, struct stat *); 3992 } glob64_t; 3993 extern int glob(const char *, int, 3994 int (*__errfunc) (const char *p1, int p2) 3995 , glob_t *); 3996 extern int glob64(const char *, int, 3997 int (*__errfunc) (const char *p1, int p2) 3998 , glob64_t *); 3999 extern void globfree(glob_t *); 4000 extern void globfree64(glob64_t *); 4001 _________________________________________________________ 4002 4003 13.4.13. grp.h 4004 4005 struct group { 4006 char *gr_name; 4007 char *gr_passwd; 4008 gid_t gr_gid; 4009 char **gr_mem; 4010 }; 4011 4012 extern void endgrent(void); 4013 extern struct group *getgrent(void); 4014 extern struct group *getgrgid(gid_t); 4015 extern struct group *getgrnam(char *); 4016 extern int initgroups(const char *, gid_t); 4017 extern void setgrent(void); 4018 extern int setgroups(size_t, const gid_t *); 4019 extern int getgrgid_r(gid_t, struct group *, char *, size_t, 4020 struct group **); 4021 extern int getgrnam_r(const char *, struct group *, char *, size_t, 4022 struct group **); 4023 extern int getgrouplist(const char *, gid_t, gid_t *, int *); 4024 _________________________________________________________ 4025 4026 13.4.14. iconv.h 4027 4028 typedef void *iconv_t; 4029 extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); 4030 extern int iconv_close(iconv_t); 4031 extern iconv_t iconv_open(char *, char *); 4032 _________________________________________________________ 4033 4034 13.4.15. inttypes.h 4035 4036 typedef lldiv_t imaxdiv_t; 4037 typedef unsigned char uint8_t; 4038 typedef unsigned short uint16_t; 4039 typedef unsigned int uint32_t; 4040 4041 extern intmax_t strtoimax(const char *, char **, int); 4042 extern uintmax_t strtoumax(const char *, char **, int); 4043 extern intmax_t wcstoimax(const wchar_t *, wchar_t * *, int); 4044 extern uintmax_t wcstoumax(const wchar_t *, wchar_t * *, int); 4045 extern intmax_t imaxabs(intmax_t); 4046 extern imaxdiv_t imaxdiv(intmax_t, intmax_t); 4047 _________________________________________________________ 4048 4049 13.4.16. langinfo.h 4050 4051 #define ABDAY_1 0x20000 4052 #define ABDAY_2 0x20001 4053 #define ABDAY_3 0x20002 4054 #define ABDAY_4 0x20003 4055 #define ABDAY_5 0x20004 4056 #define ABDAY_6 0x20005 4057 #define ABDAY_7 0x20006 4058 4059 #define DAY_1 0x20007 4060 #define DAY_2 0x20008 4061 #define DAY_3 0x20009 4062 #define DAY_4 0x2000A 4063 #define DAY_5 0x2000B 4064 #define DAY_6 0x2000C 4065 #define DAY_7 0x2000D 4066 4067 #define ABMON_1 0x2000E 4068 #define ABMON_2 0x2000F 4069 #define ABMON_3 0x20010 4070 #define ABMON_4 0x20011 4071 #define ABMON_5 0x20012 4072 #define ABMON_6 0x20013 4073 #define ABMON_7 0x20014 4074 #define ABMON_8 0x20015 4075 #define ABMON_9 0x20016 4076 #define ABMON_10 0x20017 4077 #define ABMON_11 0x20018 4078 #define ABMON_12 0x20019 4079 4080 #define MON_1 0x2001A 4081 #define MON_2 0x2001B 4082 #define MON_3 0x2001C 4083 #define MON_4 0x2001D 4084 #define MON_5 0x2001E 4085 #define MON_6 0x2001F 4086 #define MON_7 0x20020 4087 #define MON_8 0x20021 4088 #define MON_9 0x20022 4089 #define MON_10 0x20023 4090 #define MON_11 0x20024 4091 #define MON_12 0x20025 4092 4093 #define AM_STR 0x20026 4094 #define PM_STR 0x20027 4095 4096 #define D_T_FMT 0x20028 4097 #define D_FMT 0x20029 4098 #define T_FMT 0x2002A 4099 #define T_FMT_AMPM 0x2002B 4100 4101 #define ERA 0x2002C 4102 #define ERA_D_FMT 0x2002E 4103 #define ALT_DIGITS 0x2002F 4104 #define ERA_D_T_FMT 0x20030 4105 #define ERA_T_FMT 0x20031 4106 4107 #define CODESET 14 4108 4109 #define CRNCYSTR 0x4000F 4110 4111 #define RADIXCHAR 0x10000 4112 #define THOUSEP 0x10001 4113 #define YESEXPR 0x50000 4114 #define NOEXPR 0x50001 4115 #define YESSTR 0x50002 4116 #define NOSTR 0x50003 4117 4118 extern char *nl_langinfo(nl_item); 4119 _________________________________________________________ 4120 4121 13.4.17. libgen.h 4122 4123 extern char *basename(const char *); 4124 extern char *dirname(char *); 4125 _________________________________________________________ 4126 4127 13.4.18. libintl.h 4128 4129 extern char *bindtextdomain(const char *, const char *); 4130 extern char *dcgettext(const char *, const char *, int); 4131 extern char *dgettext(const char *, const char *); 4132 extern char *gettext(const char *); 4133 extern char *textdomain(const char *); 4134 extern char *bind_textdomain_codeset(const char *, const char *); 4135 extern char *dcngettext(const char *, const char *, const char *, 4136 unsigned long int, int); 4137 extern char *dngettext(const char *, const char *, const char *, 4138 unsigned long int); 4139 extern char *ngettext(const char *, const char *, unsigned long int); 4140 _________________________________________________________ 4141 4142 13.4.19. limits.h 4143 4144 #define LLONG_MIN (-LLONG_MAX-1LL) 4145 #define ULLONG_MAX 18446744073709551615ULL 4146 #define OPEN_MAX 256 4147 #define PATH_MAX 4096 4148 #define LLONG_MAX 9223372036854775807LL 4149 #define SSIZE_MAX LONG_MAX 4150 4151 #define MB_LEN_MAX 16 4152 4153 #define SCHAR_MIN (-128) 4154 #define SCHAR_MAX 127 4155 #define UCHAR_MAX 255 4156 #define CHAR_BIT 8 4157 4158 #define SHRT_MIN (-32768) 4159 #define SHRT_MAX 32767 4160 #define USHRT_MAX 65535 4161 4162 #define INT_MIN (-INT_MAX-1) 4163 #define INT_MAX 2147483647 4164 #define __INT_MAX__ 2147483647 4165 #define UINT_MAX 4294967295U 4166 4167 #define LONG_MIN (-LONG_MAX-1L) 4168 4169 #define PTHREAD_KEYS_MAX 1024 4170 #define PTHREAD_THREADS_MAX 16384 4171 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 4172 _________________________________________________________ 4173 4174 13.4.20. locale.h 4175 4176 struct lconv { 4177 char *decimal_point; 4178 char *thousands_sep; 4179 char *grouping; 4180 char *int_curr_symbol; 4181 char *currency_symbol; 4182 char *mon_decimal_point; 4183 char *mon_thousands_sep; 4184 char *mon_grouping; 4185 char *positive_sign; 4186 char *negative_sign; 4187 char int_frac_digits; 4188 char frac_digits; 4189 char p_cs_precedes; 4190 char p_sep_by_space; 4191 char n_cs_precedes; 4192 char n_sep_by_space; 4193 char p_sign_posn; 4194 char n_sign_posn; 4195 char int_p_cs_precedes; 4196 char int_p_sep_by_space; 4197 char int_n_cs_precedes; 4198 char int_n_sep_by_space; 4199 char int_p_sign_posn; 4200 char int_n_sign_posn; 4201 }; 4202 4203 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 4204 #define LC_CTYPE 0 4205 #define LC_NUMERIC 1 4206 #define LC_TELEPHONE 10 4207 #define LC_MEASUREMENT 11 4208 #define LC_IDENTIFICATION 12 4209 #define LC_TIME 2 4210 #define LC_COLLATE 3 4211 #define LC_MONETARY 4 4212 #define LC_MESSAGES 5 4213 #define LC_ALL 6 4214 #define LC_PAPER 7 4215 #define LC_NAME 8 4216 #define LC_ADDRESS 9 4217 4218 typedef struct __locale_struct { 4219 struct locale_data *__locales[13]; 4220 const unsigned short *__ctype_b; 4221 const int *__ctype_tolower; 4222 const int *__ctype_toupper; 4223 const char *__names[13]; 4224 } *__locale_t; 4225 4226 typedef struct __locale_struct *locale_t; 4227 4228 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 4229 #define LC_COLLATE_MASK (1 << LC_COLLATE) 4230 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 4231 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 4232 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 4233 #define LC_MONETARY_MASK (1 << LC_MONETARY) 4234 #define LC_NAME_MASK (1 << LC_NAME) 4235 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 4236 #define LC_PAPER_MASK (1 << LC_PAPER) 4237 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 4238 #define LC_TIME_MASK (1 << LC_TIME) 4239 #define LC_CTYPE_MASK (1<cl_ops->cl_control)(cl,rq,in)) 4655 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 4656 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 4657 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 4658 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 4659 #define NULLPROC ((u_long)0) 4660 #define CLSET_TIMEOUT 1 4661 #define CLGET_XID 10 4662 #define CLSET_XID 11 4663 #define CLGET_VERS 12 4664 #define CLSET_VERS 13 4665 #define CLGET_PROG 14 4666 #define CLSET_PROG 15 4667 #define CLGET_TIMEOUT 2 4668 #define CLGET_SERVER_ADDR 3 4669 #define CLSET_RETRY_TIMEOUT 4 4670 #define CLGET_RETRY_TIMEOUT 5 4671 #define CLGET_FD 6 4672 #define CLGET_SVC_ADDR 7 4673 #define CLSET_FD_CLOSE 8 4674 #define CLSET_FD_NCLOSE 9 4675 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 4676 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 4677 4678 enum clnt_stat { 4679 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 4680 2, RPC_CANTSEND = 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 4681 5, RPC_VERSMISMATCH = 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 4682 8, RPC_PROGVERSMISMATCH = 9, RPC_PROCUNAVAIL = 4683 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 4684 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 4685 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 4686 14, RPC_PROGNOTREGISTERED = 15, RPC_N2AXLATEFAILURE = 4687 22, RPC_FAILED = 16, RPC_INTR = 18, RPC_TLIERROR = 4688 20, RPC_UDERROR = 23, RPC_INPROGRESS = 24, RPC_STALERACHANDLE = 25 4689 }; 4690 struct rpc_err { 4691 enum clnt_stat re_status; 4692 union { 4693 int RE_errno; 4694 enum auth_stat RE_why; 4695 struct { 4696 u_long low; 4697 u_long high; 4698 } RE_vers; 4699 struct { 4700 long int s1; 4701 long int s2; 4702 } RE_lb; 4703 } ru; 4704 }; 4705 4706 typedef struct CLIENT { 4707 struct AUTH *cl_auth; 4708 struct clnt_ops *cl_ops; 4709 caddr_t cl_private; 4710 } CLIENT; 4711 4712 struct clnt_ops { 4713 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 4714 xdrproc_t, caddr_t, struct timeval); 4715 void (*cl_abort) (void); 4716 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 4717 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 4718 void (*cl_destroy) (struct CLIENT *); 4719 bool_t(*cl_control) (struct CLIENT *, int, char *); 4720 }; 4721 extern struct CLIENT *clnt_create(const char *, const u_long, const u_long, 4722 const char *); 4723 extern void clnt_pcreateerror(const char *); 4724 extern void clnt_perrno(enum clnt_stat); 4725 extern void clnt_perror(struct CLIENT *, const char *); 4726 extern char *clnt_spcreateerror(const char *); 4727 extern char *clnt_sperrno(enum clnt_stat); 4728 extern char *clnt_sperror(struct CLIENT *, const char *); 4729 _________________________________________________________ 4730 4731 13.4.35. rpc/pmap_clnt.h 4732 4733 extern u_short pmap_getport(struct sockaddr_in *, const u_long, 4734 const u_long, u_int); 4735 extern bool_t pmap_set(const u_long, const u_long, int, u_short); 4736 extern bool_t pmap_unset(u_long, u_long); 4737 _________________________________________________________ 4738 4739 13.4.36. rpc/rpc_msg.h 4740 4741 enum msg_type { 4742 CALL, REPLY = 1 4743 }; 4744 enum reply_stat { 4745 MSG_ACCEPTED, MSG_DENIED = 1 4746 }; 4747 enum accept_stat { 4748 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 4749 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 4750 }; 4751 enum reject_stat { 4752 RPC_MISMATCH, AUTH_ERROR = 1 4753 }; 4754 4755 struct accepted_reply { 4756 struct opaque_auth ar_verf; 4757 enum accept_stat ar_stat; 4758 union { 4759 struct { 4760 unsigned long int low; 4761 unsigned long int high; 4762 } AR_versions; 4763 struct { 4764 caddr_t where; 4765 xdrproc_t proc; 4766 } AR_results; 4767 } ru; 4768 }; 4769 4770 struct rejected_reply { 4771 enum reject_stat rj_stat; 4772 union { 4773 struct { 4774 unsigned long int low; 4775 unsigned long int high; 4776 } RJ_versions; 4777 enum auth_stat RJ_why; 4778 } ru; 4779 }; 4780 4781 struct reply_body { 4782 enum reply_stat rp_stat; 4783 union { 4784 struct accepted_reply RP_ar; 4785 struct rejected_reply RP_dr; 4786 } ru; 4787 }; 4788 4789 struct call_body { 4790 unsigned long int cb_rpcvers; 4791 unsigned long int cb_prog; 4792 unsigned long int cb_vers; 4793 unsigned long int cb_proc; 4794 struct opaque_auth cb_cred; 4795 struct opaque_auth cb_verf; 4796 }; 4797 4798 struct rpc_msg { 4799 unsigned long int rm_xid; 4800 enum msg_type rm_direction; 4801 union { 4802 struct call_body RM_cmb; 4803 struct reply_body RM_rmb; 4804 } ru; 4805 }; 4806 extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); 4807 _________________________________________________________ 4808 4809 13.4.37. rpc/svc.h 4810 4811 #define RPC_ANYSOCK -1 4812 #define svc_freeargs(xprt,xargs, argsp) \ 4813 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 4814 #define svc_getargs(xprt,xargs, argsp) \ 4815 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 4816 4817 enum xprt_stat { 4818 XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE 4819 }; 4820 4821 typedef struct SVCXPRT { 4822 int xp_sock; 4823 u_short xp_port; 4824 struct xp_ops *xp_ops; 4825 int xp_addrlen; 4826 struct sockaddr_in xp_raddr; 4827 struct opaque_auth xp_verf; 4828 caddr_t xp_p1; 4829 caddr_t xp_p2; 4830 char xp_pad[256]; 4831 } SVCXPRT; 4832 4833 struct svc_req { 4834 rpcprog_t rq_prog; 4835 rpcvers_t rq_vers; 4836 rpcproc_t rq_proc; 4837 struct opaque_auth rq_cred; 4838 caddr_t rq_clntcred; 4839 SVCXPRT *rq_xprt; 4840 }; 4841 4842 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 4843 4844 struct xp_ops { 4845 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 4846 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 4847 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 4848 caddr_t args_ptr); 4849 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 4850 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 4851 caddr_t args_ptr); 4852 void (*xp_destroy) (SVCXPRT * __xprt); 4853 }; 4854 extern void svc_getreqset(fd_set *); 4855 extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, 4856 __dispatch_fn_t, rpcprot_t); 4857 extern void svc_run(void); 4858 extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); 4859 extern void svcerr_auth(SVCXPRT *, enum auth_stat); 4860 extern void svcerr_decode(SVCXPRT *); 4861 extern void svcerr_noproc(SVCXPRT *); 4862 extern void svcerr_noprog(SVCXPRT *); 4863 extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); 4864 extern void svcerr_systemerr(SVCXPRT *); 4865 extern void svcerr_weakauth(SVCXPRT *); 4866 extern SVCXPRT *svctcp_create(int, u_int, u_int); 4867 extern SVCXPRT *svcudp_create(int); 4868 _________________________________________________________ 4869 4870 13.4.38. rpc/types.h 4871 4872 typedef int bool_t; 4873 typedef int enum_t; 4874 typedef unsigned long int rpcprog_t; 4875 typedef unsigned long int rpcvers_t; 4876 typedef unsigned long int rpcproc_t; 4877 typedef unsigned long int rpcprot_t; 4878 _________________________________________________________ 4879 4880 13.4.39. rpc/xdr.h 4881 4882 enum xdr_op { 4883 XDR_ENCODE, XDR_DECODE, XDR_FREE 4884 }; 4885 typedef struct XDR { 4886 enum xdr_op x_op; 4887 struct xdr_ops *x_ops; 4888 caddr_t x_public; 4889 caddr_t x_private; 4890 caddr_t x_base; 4891 int x_handy; 4892 } XDR; 4893 4894 struct xdr_ops { 4895 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 4896 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 4897 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 4898 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 4899 u_int(*x_getpostn) (XDR * __xdrs); 4900 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 4901 int32_t *(*x_inline) (XDR * __xdrs, int __len); 4902 void (*x_destroy) (XDR * __xdrs); 4903 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 4904 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 4905 }; 4906 4907 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 4908 4909 struct xdr_discrim { 4910 int value; 4911 xdrproc_t proc; 4912 }; 4913 extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, 4914 xdrproc_t); 4915 extern bool_t xdr_bool(XDR *, bool_t *); 4916 extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); 4917 extern bool_t xdr_char(XDR *, char *); 4918 extern bool_t xdr_double(XDR *, double *); 4919 extern bool_t xdr_enum(XDR *, enum_t *); 4920 extern bool_t xdr_float(XDR *, float *); 4921 extern void xdr_free(xdrproc_t, char *); 4922 extern bool_t xdr_int(XDR *, int *); 4923 extern bool_t xdr_long(XDR *, long int *); 4924 extern bool_t xdr_opaque(XDR *, caddr_t, u_int); 4925 extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); 4926 extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); 4927 extern bool_t xdr_short(XDR *, short *); 4928 extern bool_t xdr_string(XDR *, char **, u_int); 4929 extern bool_t xdr_u_char(XDR *, u_char *); 4930 extern bool_t xdr_u_int(XDR *, u_int *); 4931 extern bool_t xdr_u_long(XDR *, u_long *); 4932 extern bool_t xdr_u_short(XDR *, u_short *); 4933 extern bool_t xdr_union(XDR *, enum_t *, char *, 4934 const struct xdr_discrim *, xdrproc_t); 4935 extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); 4936 extern bool_t xdr_void(void); 4937 extern bool_t xdr_wrapstring(XDR *, char **); 4938 extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); 4939 extern void xdrrec_create(XDR *, u_int, u_int, caddr_t, 4940 int (*__readit) (char *p1, char *p2, int p3) 4941 , int (*__writeit) (char *p1, char *p2, int p3) 4942 ); 4943 extern typedef int bool_t xdrrec_eof(XDR *); 4944 _________________________________________________________ 4945 4946 13.4.40. sched.h 4947 4948 #define SCHED_OTHER 0 4949 #define SCHED_FIFO 1 4950 #define SCHED_RR 2 4951 4952 struct sched_param { 4953 int sched_priority; 4954 }; 4955 extern int sched_get_priority_max(int); 4956 extern int sched_get_priority_min(int); 4957 extern int sched_getparam(pid_t, struct sched_param *); 4958 extern int sched_getscheduler(pid_t); 4959 extern int sched_rr_get_interval(pid_t, struct timespec *); 4960 extern int sched_setparam(pid_t, const struct sched_param *); 4961 extern int sched_setscheduler(pid_t, int, const struct sched_param *); 4962 extern int sched_yield(void); 4963 _________________________________________________________ 4964 4965 13.4.41. search.h 4966 4967 typedef struct entry { 4968 char *key; 4969 void *data; 4970 } ENTRY; 4971 typedef enum { 4972 FIND, ENTER 4973 } ACTION; 4974 typedef enum { 4975 preorder, postorder, endorder, leaf 4976 } VISIT; 4977 4978 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 4979 extern int hcreate(size_t); 4980 extern ENTRY *hsearch(ENTRY, ACTION); 4981 extern void insque(void *, void *); 4982 extern void *lfind(const void *, const void *, size_t *, size_t, 4983 __compar_fn_t); 4984 extern void *lsearch(const void *, void *, size_t *, size_t, 4985 __compar_fn_t); 4986 extern void remque(void *); 4987 extern void hdestroy(void); 4988 extern void *tdelete(const void *, void **, __compar_fn_t); 4989 extern void *tfind(const void *, void *const *, __compar_fn_t); 4990 extern void *tsearch(const void *, void **, __compar_fn_t); 4991 extern void twalk(const void *, __action_fn_t); 4992 _________________________________________________________ 4993 4994 13.4.42. setjmp.h 4995 4996 #define setjmp(env) _setjmp(env) 4997 #define sigsetjmp(a,b) __sigsetjmp(a,b) 4998 4999 struct __jmp_buf_tag { 5000 __jmp_buf __jmpbuf; 5001 int __mask_was_saved; 5002 sigset_t __saved_mask; 5003 }; 5004 5005 typedef struct __jmp_buf_tag jmp_buf[1]; 5006 typedef jmp_buf sigjmp_buf; 5007 extern int __sigsetjmp(jmp_buf, int); 5008 extern void longjmp(jmp_buf, int); 5009 extern void siglongjmp(sigjmp_buf, int); 5010 extern void _longjmp(jmp_buf, int); 5011 extern int _setjmp(jmp_buf); 5012 _________________________________________________________ 5013 5014 13.4.43. signal.h 5015 5016 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 5017 #define SIGRTMAX (__libc_current_sigrtmax ()) 5018 #define SIGRTMIN (__libc_current_sigrtmin ()) 5019 #define SIG_BLOCK 0 5020 #define SIG_UNBLOCK 1 5021 #define SIG_SETMASK 2 5022 #define NSIG 65 5023 5024 typedef int sig_atomic_t; 5025 5026 typedef void (*sighandler_t) (int); 5027 5028 #define SIG_HOLD ((sighandler_t) 2) 5029 #define SIG_ERR ((sighandler_t)-1) 5030 #define SIG_DFL ((sighandler_t)0) 5031 #define SIG_IGN ((sighandler_t)1) 5032 5033 #define SIGHUP 1 5034 #define SIGUSR1 10 5035 #define SIGSEGV 11 5036 #define SIGUSR2 12 5037 #define SIGPIPE 13 5038 #define SIGALRM 14 5039 #define SIGTERM 15 5040 #define SIGSTKFLT 16 5041 #define SIGCHLD 17 5042 #define SIGCONT 18 5043 #define SIGSTOP 19 5044 #define SIGINT 2 5045 #define SIGTSTP 20 5046 #define SIGTTIN 21 5047 #define SIGTTOU 22 5048 #define SIGURG 23 5049 #define SIGXCPU 24 5050 #define SIGXFSZ 25 5051 #define SIGVTALRM 26 5052 #define SIGPROF 27 5053 #define SIGWINCH 28 5054 #define SIGIO 29 5055 #define SIGQUIT 3 5056 #define SIGPWR 30 5057 #define SIGSYS 31 5058 #define SIGUNUSED 31 5059 #define SIGILL 4 5060 #define SIGTRAP 5 5061 #define SIGABRT 6 5062 #define SIGIOT 6 5063 #define SIGBUS 7 5064 #define SIGFPE 8 5065 #define SIGKILL 9 5066 #define SIGCLD SIGCHLD 5067 #define SIGPOLL SIGIO 5068 5069 #define SV_ONSTACK (1<<0) 5070 #define SV_INTERRUPT (1<<1) 5071 #define SV_RESETHAND (1<<2) 5072 5073 typedef union sigval { 5074 int sival_int; 5075 void *sival_ptr; 5076 } sigval_t; 5077 5078 #define SIGEV_SIGNAL 0 5079 #define SIGEV_NONE 1 5080 #define SIGEV_THREAD 2 5081 #define SIGEV_MAX_SIZE 64 5082 5083 typedef struct sigevent { 5084 sigval_t sigev_value; 5085 int sigev_signo; 5086 int sigev_notify; 5087 union { 5088 int _pad[SIGEV_PAD_SIZE]; 5089 struct { 5090 void (*sigev_thread_func) (sigval_t); 5091 void *_attribute; 5092 } _sigev_thread; 5093 } _sigev_un; 5094 } sigevent_t; 5095 5096 #define SI_MAX_SIZE 128 5097 #define si_pid _sifields._kill._pid 5098 #define si_uid _sifields._kill._uid 5099 #define si_value _sifields._rt._sigval 5100 #define si_int _sifields._rt._sigval.sival_int 5101 #define si_ptr _sifields._rt._sigval.sival_ptr 5102 #define si_status _sifields._sigchld._status 5103 #define si_stime _sifields._sigchld._stime 5104 #define si_utime _sifields._sigchld._utime 5105 #define si_addr _sifields._sigfault._addr 5106 #define si_band _sifields._sigpoll._band 5107 #define si_fd _sifields._sigpoll._fd 5108 #define si_timer1 _sifields._timer._timer1 5109 #define si_timer2 _sifields._timer._timer2 5110 5111 typedef struct siginfo { 5112 int si_signo; 5113 int si_errno; 5114 int si_code; 5115 union { 5116 int _pad[SI_PAD_SIZE]; 5117 struct { 5118 pid_t _pid; 5119 uid_t _uid; 5120 } _kill; 5121 struct { 5122 unsigned int _timer1; 5123 unsigned int _timer2; 5124 } _timer; 5125 struct { 5126 pid_t _pid; 5127 uid_t _uid; 5128 sigval_t _sigval; 5129 } _rt; 5130 struct { 5131 pid_t _pid; 5132 uid_t _uid; 5133 int _status; 5134 clock_t _utime; 5135 clock_t _stime; 5136 } _sigchld; 5137 struct { 5138 void *_addr; 5139 } _sigfault; 5140 struct { 5141 int _band; 5142 int _fd; 5143 } _sigpoll; 5144 } _sifields; 5145 } siginfo_t; 5146 5147 #define SI_QUEUE -1 5148 #define SI_TIMER -2 5149 #define SI_MESGQ -3 5150 #define SI_ASYNCIO -4 5151 #define SI_SIGIO -5 5152 #define SI_TKILL -6 5153 #define SI_ASYNCNL -60 5154 #define SI_USER 0 5155 #define SI_KERNEL 0x80 5156 5157 #define ILL_ILLOPC 1 5158 #define ILL_ILLOPN 2 5159 #define ILL_ILLADR 3 5160 #define ILL_ILLTRP 4 5161 #define ILL_PRVOPC 5 5162 #define ILL_PRVREG 6 5163 #define ILL_COPROC 7 5164 #define ILL_BADSTK 8 5165 5166 #define FPE_INTDIV 1 5167 #define FPE_INTOVF 2 5168 #define FPE_FLTDIV 3 5169 #define FPE_FLTOVF 4 5170 #define FPE_FLTUND 5 5171 #define FPE_FLTRES 6 5172 #define FPE_FLTINV 7 5173 #define FPE_FLTSUB 8 5174 5175 #define SEGV_MAPERR 1 5176 #define SEGV_ACCERR 2 5177 5178 #define BUS_ADRALN 1 5179 #define BUS_ADRERR 2 5180 #define BUS_OBJERR 3 5181 5182 #define TRAP_BRKPT 1 5183 #define TRAP_TRACE 2 5184 5185 #define CLD_EXITED 1 5186 #define CLD_KILLED 2 5187 #define CLD_DUMPED 3 5188 #define CLD_TRAPPED 4 5189 #define CLD_STOPPED 5 5190 #define CLD_CONTINUED 6 5191 5192 #define POLL_IN 1 5193 #define POLL_OUT 2 5194 #define POLL_MSG 3 5195 #define POLL_ERR 4 5196 #define POLL_PRI 5 5197 #define POLL_HUP 6 5198 5199 typedef struct { 5200 unsigned long int sig[_SIGSET_NWORDS]; 5201 } sigset_t; 5202 5203 #define SA_NOCLDSTOP 0x00000001 5204 #define SA_NOCLDWAIT 0x00000002 5205 #define SA_SIGINFO 0x00000004 5206 #define SA_ONSTACK 0x08000000 5207 #define SA_RESTART 0x10000000 5208 #define SA_INTERRUPT 0x20000000 5209 #define SA_NODEFER 0x40000000 5210 #define SA_RESETHAND 0x80000000 5211 #define SA_NOMASK SA_NODEFER 5212 #define SA_ONESHOT SA_RESETHAND 5213 5214 typedef struct sigaltstack { 5215 void *ss_sp; 5216 int ss_flags; 5217 size_t ss_size; 5218 } stack_t; 5219 5220 #define SS_ONSTACK 1 5221 #define SS_DISABLE 2 5222 5223 extern int __libc_current_sigrtmax(void); 5224 extern int __libc_current_sigrtmin(void); 5225 extern sighandler_t __sysv_signal(int, sighandler_t); 5226 extern char *const _sys_siglist(void); 5227 extern int killpg(pid_t, int); 5228 extern void psignal(int, const char *); 5229 extern int raise(int); 5230 extern int sigaddset(sigset_t *, int); 5231 extern int sigandset(sigset_t *, const sigset_t *, const sigset_t *); 5232 extern int sigdelset(sigset_t *, int); 5233 extern int sigemptyset(sigset_t *); 5234 extern int sigfillset(sigset_t *); 5235 extern int sighold(int); 5236 extern int sigignore(int); 5237 extern int siginterrupt(int, int); 5238 extern int sigisemptyset(const sigset_t *); 5239 extern int sigismember(const sigset_t *, int); 5240 extern int sigorset(sigset_t *, const sigset_t *, const sigset_t *); 5241 extern int sigpending(sigset_t *); 5242 extern int sigrelse(int); 5243 extern sighandler_t sigset(int, sighandler_t); 5244 extern int pthread_kill(pthread_t, int); 5245 extern int pthread_sigmask(int, sigset_t *, sigset_t *); 5246 extern int sigaction(int, const struct sigaction *, struct sigaction *); 5247 extern int sigwait(sigset_t *, int *); 5248 extern int kill(pid_t, int); 5249 extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); 5250 extern sighandler_t signal(int, sighandler_t); 5251 extern int sigpause(int); 5252 extern int sigprocmask(int, const sigset_t *, sigset_t *); 5253 extern int sigreturn(struct sigcontext *); 5254 extern int sigsuspend(const sigset_t *); 5255 extern int sigqueue(pid_t, int, const union sigval); 5256 extern int sigwaitinfo(const sigset_t *, siginfo_t *); 5257 extern int sigtimedwait(const sigset_t *, siginfo_t *, 5258 const struct timespec *); 5259 extern sighandler_t bsd_signal(int, sighandler_t); 5260 _________________________________________________________ 5261 5262 13.4.44. stddef.h 5263 5264 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 5265 #define NULL (0L) 5266 5267 typedef int wchar_t; 5268 _________________________________________________________ 5269 5270 13.4.45. stdio.h 5271 5272 #define EOF (-1) 5273 #define P_tmpdir "/tmp" 5274 #define FOPEN_MAX 16 5275 #define L_tmpnam 20 5276 #define FILENAME_MAX 4096 5277 #define BUFSIZ 8192 5278 #define L_ctermid 9 5279 #define L_cuserid 9 5280 5281 typedef struct { 5282 off_t __pos; 5283 mbstate_t __state; 5284 } fpos_t; 5285 typedef struct { 5286 off64_t __pos; 5287 mbstate_t __state; 5288 } fpos64_t; 5289 5290 typedef struct _IO_FILE FILE; 5291 5292 #define _IOFBF 0 5293 #define _IOLBF 1 5294 #define _IONBF 2 5295 5296 extern char *const _sys_errlist(void); 5297 extern void clearerr(FILE *); 5298 extern int fclose(FILE *); 5299 extern FILE *fdopen(int, const char *); 5300 extern int fflush_unlocked(FILE *); 5301 extern int fileno(FILE *); 5302 extern FILE *fopen(const char *, const char *); 5303 extern int fprintf(FILE *, const char *, ...); 5304 extern int fputc(int, FILE *); 5305 extern FILE *freopen(const char *, const char *, FILE *); 5306 extern FILE *freopen64(const char *, const char *, FILE *); 5307 extern int fscanf(FILE *, const char *, ...); 5308 extern int fseek(FILE *, long int, int); 5309 extern int fseeko(FILE *, off_t, int); 5310 extern int fseeko64(FILE *, loff_t, int); 5311 extern off_t ftello(FILE *); 5312 extern loff_t ftello64(FILE *); 5313 extern int getchar(void); 5314 extern int getchar_unlocked(void); 5315 extern int getw(FILE *); 5316 extern int pclose(FILE *); 5317 extern void perror(const char *); 5318 extern FILE *popen(const char *, const char *); 5319 extern int printf(const char *, ...); 5320 extern int putc_unlocked(int, FILE *); 5321 extern int putchar(int); 5322 extern int putchar_unlocked(int); 5323 extern int putw(int, FILE *); 5324 extern int remove(const char *); 5325 extern void rewind(FILE *); 5326 extern int scanf(const char *, ...); 5327 extern void setbuf(FILE *, char *); 5328 extern int sprintf(char *, const char *, ...); 5329 extern int sscanf(const char *, const char *, ...); 5330 extern FILE *stderr(void); 5331 extern FILE *stdin(void); 5332 extern FILE *stdout(void); 5333 extern char *tempnam(const char *, const char *); 5334 extern FILE *tmpfile64(void); 5335 extern FILE *tmpfile(void); 5336 extern char *tmpnam(char *); 5337 extern int vfprintf(FILE *, const char *, va_list); 5338 extern int vprintf(const char *, va_list); 5339 extern int feof(FILE *); 5340 extern int ferror(FILE *); 5341 extern int fflush(FILE *); 5342 extern int fgetc(FILE *); 5343 extern int fgetpos(FILE *, fpos_t *); 5344 extern char *fgets(char *, int, FILE *); 5345 extern int fputs(const char *, FILE *); 5346 extern size_t fread(void *, size_t, size_t, FILE *); 5347 extern int fsetpos(FILE *, const fpos_t *); 5348 extern long int ftell(FILE *); 5349 extern size_t fwrite(const void *, size_t, size_t, FILE *); 5350 extern int getc(FILE *); 5351 extern int putc(int, FILE *); 5352 extern int puts(const char *); 5353 extern int setvbuf(FILE *, char *, int, size_t); 5354 extern int snprintf(char *, size_t, const char *, ...); 5355 extern int ungetc(int, FILE *); 5356 extern int vsnprintf(char *, size_t, const char *, va_list); 5357 extern int vsprintf(char *, const char *, va_list); 5358 extern void flockfile(FILE *); 5359 extern int asprintf(char **, const char *, ...); 5360 extern int fgetpos64(FILE *, fpos64_t *); 5361 extern FILE *fopen64(const char *, const char *); 5362 extern int fsetpos64(FILE *, const fpos64_t *); 5363 extern int ftrylockfile(FILE *); 5364 extern void funlockfile(FILE *); 5365 extern int getc_unlocked(FILE *); 5366 extern void setbuffer(FILE *, char *, size_t); 5367 extern int vasprintf(char **, const char *, va_list); 5368 extern int vdprintf(int, const char *, va_list); 5369 extern int vfscanf(FILE *, const char *, va_list); 5370 extern int vscanf(const char *, va_list); 5371 extern int vsscanf(const char *, const char *, va_list); 5372 extern size_t __fpending(FILE *); 5373 _________________________________________________________ 5374 5375 13.4.46. stdlib.h 5376 5377 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 5378 #define EXIT_SUCCESS 0 5379 #define EXIT_FAILURE 1 5380 #define RAND_MAX 2147483647 5381 5382 typedef int (*__compar_fn_t) (const void *, const void *); 5383 struct random_data { 5384 int32_t *fptr; 5385 int32_t *rptr; 5386 int32_t *state; 5387 int rand_type; 5388 int rand_deg; 5389 int rand_sep; 5390 int32_t *end_ptr; 5391 }; 5392 5393 typedef struct { 5394 int quot; 5395 int rem; 5396 } div_t; 5397 5398 typedef struct { 5399 long int quot; 5400 long int rem; 5401 } ldiv_t; 5402 5403 typedef struct { 5404 long long int quot; 5405 long long int rem; 5406 } lldiv_t; 5407 extern double __strtod_internal(const char *, char **, int); 5408 extern float __strtof_internal(const char *, char **, int); 5409 extern long int __strtol_internal(const char *, char **, int, int); 5410 extern long double __strtold_internal(const char *, char **, int); 5411 extern long long int __strtoll_internal(const char *, char **, int, int); 5412 extern unsigned long int __strtoul_internal(const char *, char **, int, 5413 int); 5414 extern unsigned long long int __strtoull_internal(const char *, char **, 5415 int, int); 5416 extern long int a64l(const char *); 5417 extern void abort(void); 5418 extern int abs(int); 5419 extern double atof(const char *); 5420 extern int atoi(char *); 5421 extern long int atol(char *); 5422 extern long long int atoll(const char *); 5423 extern void *bsearch(const void *, const void *, size_t, size_t, 5424 __compar_fn_t); 5425 extern div_t div(int, int); 5426 extern double drand48(void); 5427 extern char *ecvt(double, int, int *, int *); 5428 extern double erand48(unsigned short); 5429 extern void exit(int); 5430 extern char *fcvt(double, int, int *, int *); 5431 extern char *gcvt(double, int, char *); 5432 extern char *getenv(const char *); 5433 extern int getsubopt(char **, char *const *, char **); 5434 extern int grantpt(int); 5435 extern long int jrand48(unsigned short); 5436 extern char *l64a(long int); 5437 extern long int labs(long int); 5438 extern void lcong48(unsigned short); 5439 extern ldiv_t ldiv(long int, long int); 5440 extern long long int llabs(long long int); 5441 extern lldiv_t lldiv(long long int, long long int); 5442 extern long int lrand48(void); 5443 extern int mblen(const char *, size_t); 5444 extern size_t mbstowcs(wchar_t *, const char *, size_t); 5445 extern int mbtowc(wchar_t *, const char *, size_t); 5446 extern char *mktemp(char *); 5447 extern long int mrand48(void); 5448 extern long int nrand48(unsigned short); 5449 extern char *ptsname(int); 5450 extern int putenv(char *); 5451 extern void qsort(void *, size_t, size_t, __compar_fn_t); 5452 extern int rand(void); 5453 extern int rand_r(unsigned int *); 5454 extern unsigned short *seed48(unsigned short); 5455 extern void srand48(long int); 5456 extern int unlockpt(int); 5457 extern size_t wcstombs(char *, const wchar_t *, size_t); 5458 extern int wctomb(char *, wchar_t); 5459 extern int system(const char *); 5460 extern void *calloc(size_t, size_t); 5461 extern void free(void *); 5462 extern char *initstate(unsigned int, char *, size_t); 5463 extern void *malloc(size_t); 5464 extern long int random(void); 5465 extern void *realloc(void *, size_t); 5466 extern char *setstate(char *); 5467 extern void srand(unsigned int); 5468 extern void srandom(unsigned int); 5469 extern double strtod(char *, char **); 5470 extern float strtof(const char *, char **); 5471 extern long int strtol(char *, char **, int); 5472 extern long double strtold(const char *, char **); 5473 extern long long int strtoll(const char *, char **, int); 5474 extern long long int strtoq(const char *, char **, int); 5475 extern unsigned long int strtoul(const char *, char **, int); 5476 extern unsigned long long int strtoull(const char *, char **, int); 5477 extern unsigned long long int strtouq(const char *, char **, int); 5478 extern void _Exit(int); 5479 extern size_t __ctype_get_mb_cur_max(void); 5480 extern char **environ(void); 5481 extern char *realpath(const char *, char *); 5482 extern int setenv(const char *, const char *, int); 5483 extern int unsetenv(const char *); 5484 extern int getloadavg(double, int); 5485 extern int mkstemp64(char *); 5486 extern int posix_memalign(void **, size_t, size_t); 5487 extern int posix_openpt(int); 5488 _________________________________________________________ 5489 5490 13.4.47. string.h 5491 5492 extern void *__mempcpy(void *, const void *, size_t); 5493 extern char *__stpcpy(char *, const char *); 5494 extern char *__strtok_r(char *, const char *, char **); 5495 extern void bcopy(void *, void *, size_t); 5496 extern void *memchr(void *, int, size_t); 5497 extern int memcmp(void *, void *, size_t); 5498 extern void *memcpy(void *, void *, size_t); 5499 extern void *memmem(const void *, size_t, const void *, size_t); 5500 extern void *memmove(void *, const void *, size_t); 5501 extern void *memset(void *, int, size_t); 5502 extern char *strcat(char *, const char *); 5503 extern char *strchr(char *, int); 5504 extern int strcmp(char *, char *); 5505 extern int strcoll(const char *, const char *); 5506 extern char *strcpy(char *, char *); 5507 extern size_t strcspn(const char *, const char *); 5508 extern char *strerror(int); 5509 extern size_t strlen(char *); 5510 extern char *strncat(char *, char *, size_t); 5511 extern int strncmp(char *, char *, size_t); 5512 extern char *strncpy(char *, char *, size_t); 5513 extern char *strpbrk(const char *, const char *); 5514 extern char *strrchr(char *, int); 5515 extern char *strsignal(int); 5516 extern size_t strspn(const char *, const char *); 5517 extern char *strstr(char *, char *); 5518 extern char *strtok(char *, const char *); 5519 extern size_t strxfrm(char *, const char *, size_t); 5520 extern int bcmp(void *, void *, size_t); 5521 extern void bzero(void *, size_t); 5522 extern int ffs(int); 5523 extern char *index(char *, int); 5524 extern void *memccpy(void *, const void *, int, size_t); 5525 extern char *rindex(char *, int); 5526 extern int strcasecmp(char *, char *); 5527 extern char *strdup(char *); 5528 extern int strncasecmp(char *, char *, size_t); 5529 extern char *strndup(const char *, size_t); 5530 extern size_t strnlen(const char *, size_t); 5531 extern char *strsep(char **, const char *); 5532 extern char *strerror_r(int, char *, size_t); 5533 extern char *strtok_r(char *, const char *, char **); 5534 extern char *strcasestr(const char *, const char *); 5535 extern char *stpcpy(char *, const char *); 5536 extern char *stpncpy(char *, const char *, size_t); 5537 extern void *memrchr(const void *, int, size_t); 5538 _________________________________________________________ 5539 5540 13.4.48. sys/file.h 5541 5542 #define LOCK_SH 1 5543 #define LOCK_EX 2 5544 #define LOCK_NB 4 5545 #define LOCK_UN 8 5546 5547 extern int flock(int, int); 5548 _________________________________________________________ 5549 5550 13.4.49. sys/ioctl.h 5551 5552 struct winsize { 5553 unsigned short ws_row; 5554 unsigned short ws_col; 5555 unsigned short ws_xpixel; 5556 unsigned short ws_ypixel; 5557 }; 5558 extern int ioctl(int, unsigned long int, ...); 5559 _________________________________________________________ 5560 5561 13.4.50. sys/ipc.h 5562 5563 #define IPC_PRIVATE ((key_t)0) 5564 #define IPC_RMID 0 5565 #define IPC_CREAT 00001000 5566 #define IPC_EXCL 00002000 5567 #define IPC_NOWAIT 00004000 5568 #define IPC_SET 1 5569 #define IPC_STAT 2 5570 5571 extern key_t ftok(char *, int); 5572 _________________________________________________________ 5573 5574 13.4.51. sys/mman.h 5575 5576 #define MAP_FAILED ((void*)-1) 5577 #define PROT_NONE 0x0 5578 #define MAP_SHARED 0x01 5579 #define MAP_PRIVATE 0x02 5580 #define PROT_READ 0x1 5581 #define MAP_FIXED 0x10 5582 #define PROT_WRITE 0x2 5583 #define MAP_ANONYMOUS 0x20 5584 #define PROT_EXEC 0x4 5585 #define MS_ASYNC 1 5586 #define MS_INVALIDATE 2 5587 #define MS_SYNC 4 5588 #define MAP_ANON MAP_ANONYMOUS 5589 5590 extern int msync(void *, size_t, int); 5591 extern int mlock(const void *, size_t); 5592 extern int mlockall(int); 5593 extern void *mmap(void *, size_t, int, int, int, off_t); 5594 extern int mprotect(void *, size_t, int); 5595 extern int munlock(const void *, size_t); 5596 extern int munlockall(void); 5597 extern int munmap(void *, size_t); 5598 extern void *mmap64(void *, size_t, int, int, int, off64_t); 5599 extern int shm_open(const char *, int, mode_t); 5600 extern int shm_unlink(const char *); 5601 _________________________________________________________ 5602 5603 13.4.52. sys/msg.h 5604 5605 #define MSG_NOERROR 010000 5606 5607 extern int msgctl(int, int, struct msqid_ds *); 5608 extern int msgget(key_t, int); 5609 extern int msgrcv(int, void *, size_t, long int, int); 5610 extern int msgsnd(int, const void *, size_t, int); 5611 _________________________________________________________ 5612 5613 13.4.53. sys/param.h 5614 5615 #define NOFILE 256 5616 #define MAXPATHLEN 4096 5617 _________________________________________________________ 5618 5619 13.4.54. sys/poll.h 5620 5621 #define POLLIN 0x0001 5622 #define POLLPRI 0x0002 5623 #define POLLOUT 0x0004 5624 #define POLLERR 0x0008 5625 #define POLLHUP 0x0010 5626 #define POLLNVAL 0x0020 5627 5628 struct pollfd { 5629 int fd; 5630 short events; 5631 short revents; 5632 }; 5633 typedef unsigned long int nfds_t; 5634 _________________________________________________________ 5635 5636 13.4.55. sys/resource.h 5637 5638 #define RUSAGE_CHILDREN (-1) 5639 #define RUSAGE_BOTH (-2) 5640 #define RLIM_INFINITY (~0UL) 5641 #define RLIM_SAVED_CUR -1 5642 #define RLIM_SAVED_MAX -1 5643 #define RLIMIT_CPU 0 5644 #define RUSAGE_SELF 0 5645 #define RLIMIT_FSIZE 1 5646 #define RLIMIT_DATA 2 5647 #define RLIMIT_STACK 3 5648 #define RLIMIT_CORE 4 5649 #define RLIMIT_NOFILE 7 5650 #define RLIMIT_AS 9 5651 5652 typedef unsigned long int rlim_t; 5653 typedef unsigned long long int rlim64_t; 5654 typedef int __rlimit_resource_t; 5655 5656 struct rlimit { 5657 rlim_t rlim_cur; 5658 rlim_t rlim_max; 5659 }; 5660 struct rlimit64 { 5661 rlim64_t rlim_cur; 5662 rlim64_t rlim_max; 5663 }; 5664 5665 struct rusage { 5666 struct timeval ru_utime; 5667 struct timeval ru_stime; 5668 long int ru_maxrss; 5669 long int ru_ixrss; 5670 long int ru_idrss; 5671 long int ru_isrss; 5672 long int ru_minflt; 5673 long int ru_majflt; 5674 long int ru_nswap; 5675 long int ru_inblock; 5676 long int ru_oublock; 5677 long int ru_msgsnd; 5678 long int ru_msgrcv; 5679 long int ru_nsignals; 5680 long int ru_nvcsw; 5681 long int ru_nivcsw; 5682 }; 5683 5684 enum __priority_which { 5685 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 5686 }; 5687 5688 #define PRIO_PGRP PRIO_PGRP 5689 #define PRIO_PROCESS PRIO_PROCESS 5690 #define PRIO_USER PRIO_USER 5691 5692 typedef enum __priority_which __priority_which_t; 5693 extern int getpriority(__priority_which_t, id_t); 5694 extern int getrlimit64(id_t, struct rlimit64 *); 5695 extern int setpriority(__priority_which_t, id_t, int); 5696 extern int setrlimit(__rlimit_resource_t, const struct rlimit *); 5697 extern int setrlimit64(__rlimit_resource_t, const struct rlimit64 *); 5698 extern int getrlimit(__rlimit_resource_t, struct rlimit *); 5699 extern int getrusage(int, struct rusage *); 5700 _________________________________________________________ 5701 5702 13.4.56. sys/sem.h 5703 5704 #define SEM_UNDO 0x1000 5705 #define GETPID 11 5706 #define GETVAL 12 5707 #define GETALL 13 5708 #define GETNCNT 14 5709 #define GETZCNT 15 5710 #define SETVAL 16 5711 #define SETALL 17 5712 5713 struct sembuf { 5714 short sem_num; 5715 short sem_op; 5716 short sem_flg; 5717 }; 5718 extern int semctl(int, int, int, ...); 5719 extern int semget(key_t, int, int); 5720 extern int semop(int, struct sembuf *, size_t); 5721 _________________________________________________________ 5722 5723 13.4.57. sys/shm.h 5724 5725 #define SHM_RDONLY 010000 5726 #define SHM_W 0200 5727 #define SHM_RND 020000 5728 #define SHM_R 0400 5729 #define SHM_REMAP 040000 5730 #define SHM_LOCK 11 5731 #define SHM_UNLOCK 12 5732 5733 extern int __getpagesize(void); 5734 extern void *shmat(int, const void *, int); 5735 extern int shmctl(int, int, struct shmid_ds *); 5736 extern int shmdt(const void *); 5737 extern int shmget(key_t, size_t, int); 5738 _________________________________________________________ 5739 5740 13.4.58. sys/socket.h 5741 5742 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 5743 #define SCM_RIGHTS 0x01 5744 #define SOL_SOCKET 1 5745 #define SOMAXCONN 128 5746 #define SOL_RAW 255 5747 #define CMSG_ALIGN(len) \ 5748 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 5749 #define CMSG_DATA(cmsg) \ 5750 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 5751 #define CMSG_SPACE(len) \ 5752 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 5753 #define CMSG_FIRSTHDR(msg) \ 5754 ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ 5755 (struct cmsghdr *)(msg)->msg_control : \ 5756 (struct cmsghdr *)NULL) 5757 #define CMSG_NXTHDR(mhdr,cmsg) \ 5758 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 5759 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 5760 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 5761 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ?\ 5762 (struct cmsghdr *)NULL : \ 5763 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 5764 5765 struct linger { 5766 int l_onoff; 5767 int l_linger; 5768 }; 5769 struct cmsghdr { 5770 size_t cmsg_len; 5771 int cmsg_level; 5772 int cmsg_type; 5773 }; 5774 struct iovec { 5775 void *iov_base; 5776 size_t iov_len; 5777 }; 5778 5779 typedef unsigned short sa_family_t; 5780 typedef unsigned int socklen_t; 5781 5782 struct sockaddr { 5783 sa_family_t sa_family; 5784 char sa_data[14]; 5785 }; 5786 struct sockaddr_storage { 5787 sa_family_t ss_family; 5788 __ss_aligntype __ss_align; 5789 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 5790 }; 5791 5792 struct msghdr { 5793 void *msg_name; 5794 int msg_namelen; 5795 struct iovec *msg_iov; 5796 size_t msg_iovlen; 5797 void *msg_control; 5798 size_t msg_controllen; 5799 unsigned int msg_flags; 5800 }; 5801 5802 #define AF_UNSPEC 0 5803 #define AF_UNIX 1 5804 #define AF_INET6 10 5805 #define AF_INET 2 5806 5807 #define PF_INET AF_INET 5808 #define PF_INET6 AF_INET6 5809 #define PF_UNIX AF_UNIX 5810 #define PF_UNSPEC AF_UNSPEC 5811 5812 #define SOCK_STREAM 1 5813 #define SOCK_PACKET 10 5814 #define SOCK_DGRAM 2 5815 #define SOCK_RAW 3 5816 #define SOCK_RDM 4 5817 #define SOCK_SEQPACKET 5 5818 5819 #define SO_DEBUG 1 5820 #define SO_OOBINLINE 10 5821 #define SO_NO_CHECK 11 5822 #define SO_PRIORITY 12 5823 #define SO_LINGER 13 5824 #define SO_REUSEADDR 2 5825 #define SO_TYPE 3 5826 #define SO_ACCEPTCONN 30 5827 #define SO_ERROR 4 5828 #define SO_DONTROUTE 5 5829 #define SO_BROADCAST 6 5830 #define SO_SNDBUF 7 5831 #define SO_RCVBUF 8 5832 #define SO_KEEPALIVE 9 5833 5834 #define SIOCGIFCONF 0x8912 5835 #define SIOCGIFFLAGS 0x8913 5836 #define SIOCGIFADDR 0x8915 5837 #define SIOCGIFNETMASK 0x891b 5838 5839 #define SHUT_RD 0 5840 #define SHUT_WR 1 5841 #define SHUT_RDWR 2 5842 #define MSG_DONTROUTE 4 5843 5844 #define MSG_WAITALL 0x100 5845 #define MSG_TRUNC 0x20 5846 #define MSG_EOR 0x80 5847 #define MSG_OOB 1 5848 #define MSG_PEEK 2 5849 #define MSG_CTRUNC 8 5850 5851 extern int bind(int, const struct sockaddr *, socklen_t); 5852 extern int getnameinfo(const struct sockaddr *, socklen_t, char *, 5853 socklen_t, char *, socklen_t, unsigned int); 5854 extern int getsockname(int, struct sockaddr *, socklen_t *); 5855 extern int listen(int, int); 5856 extern int setsockopt(int, int, int, const void *, socklen_t); 5857 extern int accept(int, struct sockaddr *, socklen_t *); 5858 extern int connect(int, const struct sockaddr *, socklen_t); 5859 extern ssize_t recv(int, void *, size_t, int); 5860 extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, 5861 socklen_t *); 5862 extern ssize_t recvmsg(int, struct msghdr *, int); 5863 extern ssize_t send(int, const void *, size_t, int); 5864 extern ssize_t sendmsg(int, const struct msghdr *, int); 5865 extern ssize_t sendto(int, const void *, size_t, int, 5866 const struct sockaddr *, socklen_t); 5867 extern int getpeername(int, struct sockaddr *, socklen_t *); 5868 extern int getsockopt(int, int, int, void *, socklen_t *); 5869 extern int shutdown(int, int); 5870 extern int socket(int, int, int); 5871 extern int socketpair(int, int, int, int); 5872 extern int sockatmark(int); 5873 _________________________________________________________ 5874 5875 13.4.59. sys/stat.h 5876 5877 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 5878 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 5879 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 5880 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 5881 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 5882 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 5883 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 5884 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 5885 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 5886 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 5887 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 5888 #define S_IROTH (S_IRGRP>>3) 5889 #define S_IRGRP (S_IRUSR>>3) 5890 #define S_IRWXO (S_IRWXG>>3) 5891 #define S_IRWXG (S_IRWXU>>3) 5892 #define S_IWOTH (S_IWGRP>>3) 5893 #define S_IWGRP (S_IWUSR>>3) 5894 #define S_IXOTH (S_IXGRP>>3) 5895 #define S_IXGRP (S_IXUSR>>3) 5896 #define S_ISVTX 01000 5897 #define S_IXUSR 0x0040 5898 #define S_IWUSR 0x0080 5899 #define S_IRUSR 0x0100 5900 #define S_ISGID 0x0400 5901 #define S_ISUID 0x0800 5902 #define S_IFIFO 0x1000 5903 #define S_IFCHR 0x2000 5904 #define S_IFDIR 0x4000 5905 #define S_IFBLK 0x6000 5906 #define S_IFREG 0x8000 5907 #define S_IFLNK 0xa000 5908 #define S_IFSOCK 0xc000 5909 #define S_IFMT 0xf000 5910 #define st_atime st_atim.tv_sec 5911 #define st_ctime st_ctim.tv_sec 5912 #define st_mtime st_mtim.tv_sec 5913 #define S_IREAD S_IRUSR 5914 #define S_IWRITE S_IWUSR 5915 #define S_IEXEC S_IXUSR 5916 5917 extern int __fxstat(int, int, struct stat *); 5918 extern int __fxstat64(int, int, struct stat64 *); 5919 extern int __lxstat(int, char *, struct stat *); 5920 extern int __lxstat64(int, const char *, struct stat64 *); 5921 extern int __xmknod(int, const char *, mode_t, dev_t *); 5922 extern int __xstat(int, const char *, struct stat *); 5923 extern int __xstat64(int, const char *, struct stat64 *); 5924 extern int mkfifo(const char *, mode_t); 5925 extern int chmod(const char *, mode_t); 5926 extern int fchmod(int, mode_t); 5927 extern mode_t umask(mode_t); 5928 _________________________________________________________ 5929 5930 13.4.60. sys/statvfs.h 5931 5932 extern int fstatvfs(int, struct statvfs *); 5933 extern int fstatvfs64(int, struct statvfs64 *); 5934 extern int statvfs(const char *, struct statvfs *); 5935 extern int statvfs64(const char *, struct statvfs64 *); 5936 _________________________________________________________ 5937 5938 13.4.61. sys/time.h 5939 5940 #define ITIMER_REAL 0 5941 #define ITIMER_VIRTUAL 1 5942 #define ITIMER_PROF 2 5943 5944 struct timezone { 5945 int tz_minuteswest; 5946 int tz_dsttime; 5947 }; 5948 5949 typedef int __itimer_which_t; 5950 5951 struct timespec { 5952 time_t tv_sec; 5953 long int tv_nsec; 5954 }; 5955 5956 struct timeval { 5957 time_t tv_sec; 5958 suseconds_t tv_usec; 5959 }; 5960 5961 struct itimerval { 5962 struct timeval it_interval; 5963 struct timeval it_value; 5964 }; 5965 extern int getitimer(__itimer_which_t, struct itimerval *); 5966 extern int setitimer(__itimer_which_t, const struct itimerval *, 5967 struct itimerval *); 5968 extern int adjtime(const struct timeval *, struct timeval *); 5969 extern int gettimeofday(struct timeval *, struct timezone *); 5970 extern int utimes(const char *, const struct timeval *); 5971 _________________________________________________________ 5972 5973 13.4.62. sys/timeb.h 5974 5975 struct timeb { 5976 time_t time; 5977 unsigned short millitm; 5978 short timezone; 5979 short dstflag; 5980 }; 5981 extern int ftime(struct timeb *); 5982 _________________________________________________________ 5983 5984 13.4.63. sys/times.h 5985 5986 struct tms { 5987 clock_t tms_utime; 5988 clock_t tms_stime; 5989 clock_t tms_cutime; 5990 clock_t tms_cstime; 5991 }; 5992 extern clock_t times(struct tms *); 5993 _________________________________________________________ 5994 5995 13.4.64. sys/types.h 5996 5997 #define FALSE 0 5998 #define TRUE 1 5999 #define FD_SETSIZE 1024 6000 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 6001 #define FD_ISSET(d,set) \ 6002 ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) 6003 #define FD_CLR(d,set) \ 6004 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) 6005 #define FD_SET(d,set) \ 6006 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 6007 6008 typedef signed char int8_t; 6009 typedef short int16_t; 6010 typedef int int32_t; 6011 typedef unsigned char u_int8_t; 6012 typedef unsigned short u_int16_t; 6013 typedef unsigned int u_int32_t; 6014 typedef unsigned int uid_t; 6015 typedef int pid_t; 6016 typedef long int off_t; 6017 typedef int key_t; 6018 typedef long int suseconds_t; 6019 typedef unsigned int u_int; 6020 typedef struct { 6021 int __val[2]; 6022 } fsid_t; 6023 typedef unsigned int useconds_t; 6024 typedef unsigned long int blksize_t; 6025 typedef long int fd_mask; 6026 typedef int timer_t; 6027 typedef int clockid_t; 6028 6029 typedef unsigned int id_t; 6030 6031 typedef unsigned long long int ino64_t; 6032 typedef long long int loff_t; 6033 typedef unsigned long int blkcnt_t; 6034 typedef unsigned long int fsblkcnt_t; 6035 typedef unsigned long int fsfilcnt_t; 6036 typedef unsigned long long int blkcnt64_t; 6037 typedef unsigned long long int fsblkcnt64_t; 6038 typedef unsigned long long int fsfilcnt64_t; 6039 typedef unsigned char u_char; 6040 typedef unsigned short u_short; 6041 typedef unsigned long int u_long; 6042 6043 typedef unsigned long int ino_t; 6044 typedef unsigned int gid_t; 6045 typedef unsigned long long int dev_t; 6046 typedef unsigned int mode_t; 6047 typedef unsigned long int nlink_t; 6048 typedef char *caddr_t; 6049 6050 typedef struct { 6051 unsigned long int fds_bits[__FDSET_LONGS]; 6052 } fd_set; 6053 6054 typedef long int clock_t; 6055 typedef long int time_t; 6056 _________________________________________________________ 6057 6058 13.4.65. sys/uio.h 6059 6060 extern ssize_t readv(int, const struct iovec *, int); 6061 extern ssize_t writev(int, const struct iovec *, int); 6062 _________________________________________________________ 6063 6064 13.4.66. sys/un.h 6065 6066 #define UNIX_PATH_MAX 108 6067 6068 struct sockaddr_un { 6069 sa_family_t sun_family; 6070 char sun_path[UNIX_PATH_MAX]; 6071 }; 6072 _________________________________________________________ 6073 6074 13.4.67. sys/utsname.h 6075 6076 #define SYS_NMLN 65 6077 6078 struct utsname { 6079 char sysname[65]; 6080 char nodename[65]; 6081 char release[65]; 6082 char version[65]; 6083 char machine[65]; 6084 char domainname[65]; 6085 }; 6086 extern int uname(struct utsname *); 6087 _________________________________________________________ 6088 6089 13.4.68. sys/wait.h 6090 6091 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 6092 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 6093 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 6094 #define WTERMSIG(status) ((status) & 0x7f) 6095 #define WCOREDUMP(status) ((status) & 0x80) 6096 #define WIFEXITED(status) (WTERMSIG(status) == 0) 6097 #define WNOHANG 0x00000001 6098 #define WUNTRACED 0x00000002 6099 #define WCOREFLAG 0x80 6100 #define WSTOPSIG(status) WEXITSTATUS(status) 6101 6102 typedef enum { 6103 P_ALL, P_PID, P_PGID 6104 } idtype_t; 6105 extern pid_t wait(int *); 6106 extern pid_t waitpid(pid_t, int *, int); 6107 extern pid_t wait4(pid_t, int *, int, struct rusage *); 6108 _________________________________________________________ 6109 6110 13.4.69. syslog.h 6111 6112 #define LOG_EMERG 0 6113 #define LOG_PRIMASK 0x07 6114 #define LOG_ALERT 1 6115 #define LOG_CRIT 2 6116 #define LOG_ERR 3 6117 #define LOG_WARNING 4 6118 #define LOG_NOTICE 5 6119 #define LOG_INFO 6 6120 #define LOG_DEBUG 7 6121 6122 #define LOG_KERN (0<<3) 6123 #define LOG_AUTHPRIV (10<<3) 6124 #define LOG_FTP (11<<3) 6125 #define LOG_USER (1<<3) 6126 #define LOG_MAIL (2<<3) 6127 #define LOG_DAEMON (3<<3) 6128 #define LOG_AUTH (4<<3) 6129 #define LOG_SYSLOG (5<<3) 6130 #define LOG_LPR (6<<3) 6131 #define LOG_NEWS (7<<3) 6132 #define LOG_UUCP (8<<3) 6133 #define LOG_CRON (9<<3) 6134 #define LOG_FACMASK 0x03f8 6135 6136 #define LOG_LOCAL0 (16<<3) 6137 #define LOG_LOCAL1 (17<<3) 6138 #define LOG_LOCAL2 (18<<3) 6139 #define LOG_LOCAL3 (19<<3) 6140 #define LOG_LOCAL4 (20<<3) 6141 #define LOG_LOCAL5 (21<<3) 6142 #define LOG_LOCAL6 (22<<3) 6143 #define LOG_LOCAL7 (23<<3) 6144 6145 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 6146 #define LOG_MASK(pri) (1 << (pri)) 6147 6148 #define LOG_PID 0x01 6149 #define LOG_CONS 0x02 6150 #define LOG_ODELAY 0x04 6151 #define LOG_NDELAY 0x08 6152 #define LOG_NOWAIT 0x10 6153 #define LOG_PERROR 0x20 6154 6155 extern void closelog(void); 6156 extern void openlog(const char *, int, int); 6157 extern int setlogmask(int); 6158 extern void syslog(int, const char *, ...); 6159 extern void vsyslog(int, const char *, va_list); 6160 _________________________________________________________ 6161 6162 13.4.70. termios.h 6163 6164 #define TCIFLUSH 0 6165 #define TCOOFF 0 6166 #define TCSANOW 0 6167 #define BS0 0000000 6168 #define CR0 0000000 6169 #define FF0 0000000 6170 #define NL0 0000000 6171 #define TAB0 0000000 6172 #define VT0 0000000 6173 #define OPOST 0000001 6174 #define OCRNL 0000010 6175 #define ONOCR 0000020 6176 #define ONLRET 0000040 6177 #define OFILL 0000100 6178 #define OFDEL 0000200 6179 #define NL1 0000400 6180 #define TCOFLUSH 1 6181 #define TCOON 1 6182 #define TCSADRAIN 1 6183 #define TCIOFF 2 6184 #define TCIOFLUSH 2 6185 #define TCSAFLUSH 2 6186 #define TCION 3 6187 6188 typedef unsigned int speed_t; 6189 typedef unsigned char cc_t; 6190 typedef unsigned int tcflag_t; 6191 6192 #define NCCS 32 6193 6194 struct termios { 6195 tcflag_t c_iflag; 6196 tcflag_t c_oflag; 6197 tcflag_t c_cflag; 6198 tcflag_t c_lflag; 6199 cc_t c_line; 6200 cc_t c_cc[NCCS]; 6201 speed_t c_ispeed; 6202 speed_t c_ospeed; 6203 }; 6204 6205 #define VINTR 0 6206 #define VQUIT 1 6207 #define VLNEXT 15 6208 #define VERASE 2 6209 #define VKILL 3 6210 #define VEOF 4 6211 6212 #define IGNBRK 0000001 6213 #define BRKINT 0000002 6214 #define IGNPAR 0000004 6215 #define PARMRK 0000010 6216 #define INPCK 0000020 6217 #define ISTRIP 0000040 6218 #define INLCR 0000100 6219 #define IGNCR 0000200 6220 #define ICRNL 0000400 6221 #define IXANY 0004000 6222 #define IMAXBEL 0020000 6223 6224 #define CS5 0000000 6225 6226 #define ECHO 0000010 6227 6228 #define B0 0000000 6229 #define B50 0000001 6230 #define B75 0000002 6231 #define B110 0000003 6232 #define B134 0000004 6233 #define B150 0000005 6234 #define B200 0000006 6235 #define B300 0000007 6236 #define B600 0000010 6237 #define B1200 0000011 6238 #define B1800 0000012 6239 #define B2400 0000013 6240 #define B4800 0000014 6241 #define B9600 0000015 6242 #define B19200 0000016 6243 #define B38400 0000017 6244 6245 extern speed_t cfgetispeed(const struct termios *); 6246 extern speed_t cfgetospeed(const struct termios *); 6247 extern void cfmakeraw(struct termios *); 6248 extern int cfsetispeed(struct termios *, speed_t); 6249 extern int cfsetospeed(struct termios *, speed_t); 6250 extern int cfsetspeed(struct termios *, speed_t); 6251 extern int tcflow(int, int); 6252 extern int tcflush(int, int); 6253 extern pid_t tcgetsid(int); 6254 extern int tcsendbreak(int, int); 6255 extern int tcsetattr(int, int, const struct termios *); 6256 extern int tcdrain(int); 6257 extern int tcgetattr(int, struct termios *); 6258 _________________________________________________________ 6259 6260 13.4.71. time.h 6261 6262 #define CLK_TCK ((clock_t)__sysconf(2)) 6263 #define CLOCK_REALTIME 0 6264 #define TIMER_ABSTIME 1 6265 #define CLOCKS_PER_SEC 1000000l 6266 6267 struct tm { 6268 int tm_sec; 6269 int tm_min; 6270 int tm_hour; 6271 int tm_mday; 6272 int tm_mon; 6273 int tm_year; 6274 int tm_wday; 6275 int tm_yday; 6276 int tm_isdst; 6277 long int tm_gmtoff; 6278 char *tm_zone; 6279 }; 6280 struct itimerspec { 6281 struct timespec it_interval; 6282 struct timespec it_value; 6283 }; 6284 6285 extern int __daylight(void); 6286 extern long int __timezone(void); 6287 extern char *__tzname(void); 6288 extern char *asctime(const struct tm *); 6289 extern clock_t clock(void); 6290 extern char *ctime(const time_t *); 6291 extern char *ctime_r(const time_t *, char *); 6292 extern double difftime(time_t, time_t); 6293 extern struct tm *getdate(const char *); 6294 extern int getdate_err(void); 6295 extern struct tm *gmtime(const time_t *); 6296 extern struct tm *localtime(const time_t *); 6297 extern time_t mktime(struct tm *); 6298 extern int stime(const time_t *); 6299 extern size_t strftime(char *, size_t, const char *, const struct tm *); 6300 extern char *strptime(const char *, const char *, struct tm *); 6301 extern time_t time(time_t *); 6302 extern int nanosleep(const struct timespec *, struct timespec *); 6303 extern int daylight(void); 6304 extern long int timezone(void); 6305 extern char *tzname(void); 6306 extern void tzset(void); 6307 extern char *asctime_r(const struct tm *, char *); 6308 extern struct tm *gmtime_r(const time_t *, struct tm *); 6309 extern struct tm *localtime_r(const time_t *, struct tm *); 6310 extern int clock_getcpuclockid(pid_t, clockid_t *); 6311 extern int clock_getres(clockid_t, struct timespec *); 6312 extern int clock_gettime(clockid_t, struct timespec *); 6313 extern int clock_nanosleep(clockid_t, int, const struct timespec *, 6314 struct timespec *); 6315 extern int clock_settime(clockid_t, const struct timespec *); 6316 extern int timer_create(clockid_t, struct sigevent *, timer_t *); 6317 extern int timer_delete(timer_t); 6318 extern int timer_getoverrun(timer_t); 6319 extern int timer_gettime(timer_t, struct itimerspec *); 6320 extern int timer_settime(timer_t, int, const struct itimerspec *, 6321 struct itimerspec *); 6322 _________________________________________________________ 6323 6324 13.4.72. ucontext.h 6325 6326 extern int getcontext(ucontext_t *); 6327 extern int makecontext(ucontext_t *, void (*func) (void) 6328 , int, ...); 6329 extern int setcontext(const struct ucontext *); 6330 extern int swapcontext(ucontext_t *, const struct ucontext *); 6331 _________________________________________________________ 6332 6333 13.4.73. ulimit.h 6334 6335 #define UL_GETFSIZE 1 6336 #define UL_SETFSIZE 2 6337 6338 extern long int ulimit(int, ...); 6339 _________________________________________________________ 6340 6341 13.4.74. unistd.h 6342 6343 #define SEEK_SET 0 6344 #define STDIN_FILENO 0 6345 #define SEEK_CUR 1 6346 #define STDOUT_FILENO 1 6347 #define SEEK_END 2 6348 #define STDERR_FILENO 2 6349 6350 typedef long long int off64_t; 6351 6352 #define F_OK 0 6353 #define X_OK 1 6354 #define W_OK 2 6355 #define R_OK 4 6356 6357 #define _POSIX_VDISABLE '\0' 6358 #define _POSIX_CHOWN_RESTRICTED 1 6359 #define _POSIX_JOB_CONTROL 1 6360 #define _POSIX_NO_TRUNC 1 6361 #define _POSIX_SHELL 1 6362 #define _POSIX_FSYNC 200112 6363 #define _POSIX_MAPPED_FILES 200112 6364 #define _POSIX_MEMLOCK 200112 6365 #define _POSIX_MEMLOCK_RANGE 200112 6366 #define _POSIX_MEMORY_PROTECTION 200112 6367 #define _POSIX_SEMAPHORES 200112 6368 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 6369 #define _POSIX_TIMERS 200112 6370 #define _POSIX2_C_BIND 200112L 6371 #define _POSIX_THREADS 200112L 6372 6373 #define _PC_LINK_MAX 0 6374 #define _PC_MAX_CANON 1 6375 #define _PC_ASYNC_IO 10 6376 #define _PC_PRIO_IO 11 6377 #define _PC_FILESIZEBITS 13 6378 #define _PC_REC_INCR_XFER_SIZE 14 6379 #define _PC_REC_MIN_XFER_SIZE 16 6380 #define _PC_REC_XFER_ALIGN 17 6381 #define _PC_ALLOC_SIZE_MIN 18 6382 #define _PC_MAX_INPUT 2 6383 #define _PC_2_SYMLINKS 20 6384 #define _PC_NAME_MAX 3 6385 #define _PC_PATH_MAX 4 6386 #define _PC_PIPE_BUF 5 6387 #define _PC_CHOWN_RESTRICTED 6 6388 #define _PC_NO_TRUNC 7 6389 #define _PC_VDISABLE 8 6390 #define _PC_SYNC_IO 9 6391 6392 #define _SC_ARG_MAX 0 6393 #define _SC_CHILD_MAX 1 6394 #define _SC_PRIORITY_SCHEDULING 10 6395 #define _SC_TIMERS 11 6396 #define _SC_ASYNCHRONOUS_IO 12 6397 #define _SC_XBS5_ILP32_OFF32 125 6398 #define _SC_XBS5_ILP32_OFFBIG 126 6399 #define _SC_XBS5_LP64_OFF64 127 6400 #define _SC_XBS5_LPBIG_OFFBIG 128 6401 #define _SC_XOPEN_LEGACY 129 6402 #define _SC_PRIORITIZED_IO 13 6403 #define _SC_XOPEN_REALTIME 130 6404 #define _SC_XOPEN_REALTIME_THREADS 131 6405 #define _SC_ADVISORY_INFO 132 6406 #define _SC_BARRIERS 133 6407 #define _SC_CLOCK_SELECTION 137 6408 #define _SC_CPUTIME 138 6409 #define _SC_THREAD_CPUTIME 139 6410 #define _SC_SYNCHRONIZED_IO 14 6411 #define _SC_MONOTONIC_CLOCK 149 6412 #define _SC_FSYNC 15 6413 #define _SC_READER_WRITER_LOCKS 153 6414 #define _SC_SPIN_LOCKS 154 6415 #define _SC_REGEXP 155 6416 #define _SC_SHELL 157 6417 #define _SC_SPAWN 159 6418 #define _SC_MAPPED_FILES 16 6419 #define _SC_SPORADIC_SERVER 160 6420 #define _SC_THREAD_SPORADIC_SERVER 161 6421 #define _SC_TIMEOUTS 164 6422 #define _SC_TYPED_MEMORY_OBJECTS 165 6423 #define _SC_2_PBS_ACCOUNTING 169 6424 #define _SC_MEMLOCK 17 6425 #define _SC_2_PBS_LOCATE 170 6426 #define _SC_2_PBS_MESSAGE 171 6427 #define _SC_2_PBS_TRACK 172 6428 #define _SC_SYMLOOP_MAX 173 6429 #define _SC_2_PBS_CHECKPOINT 175 6430 #define _SC_V6_ILP32_OFF32 176 6431 #define _SC_V6_ILP32_OFFBIG 177 6432 #define _SC_V6_LP64_OFF64 178 6433 #define _SC_V6_LPBIG_OFFBIG 179 6434 #define _SC_MEMLOCK_RANGE 18 6435 #define _SC_HOST_NAME_MAX 180 6436 #define _SC_TRACE 181 6437 #define _SC_TRACE_EVENT_FILTER 182 6438 #define _SC_TRACE_INHERIT 183 6439 #define _SC_TRACE_LOG 184 6440 #define _SC_MEMORY_PROTECTION 19 6441 #define _SC_CLK_TCK 2 6442 #define _SC_MESSAGE_PASSING 20 6443 #define _SC_SEMAPHORES 21 6444 #define _SC_SHARED_MEMORY_OBJECTS 22 6445 #define _SC_AIO_LISTIO_MAX 23 6446 #define _SC_AIO_MAX 24 6447 #define _SC_AIO_PRIO_DELTA_MAX 25 6448 #define _SC_DELAYTIMER_MAX 26 6449 #define _SC_MQ_OPEN_MAX 27 6450 #define _SC_MQ_PRIO_MAX 28 6451 #define _SC_VERSION 29 6452 #define _SC_NGROUPS_MAX 3 6453 #define _SC_PAGESIZE 30 6454 #define _SC_PAGE_SIZE 30 6455 #define _SC_RTSIG_MAX 31 6456 #define _SC_SEM_NSEMS_MAX 32 6457 #define _SC_SEM_VALUE_MAX 33 6458 #define _SC_SIGQUEUE_MAX 34 6459 #define _SC_TIMER_MAX 35 6460 #define _SC_BC_BASE_MAX 36 6461 #define _SC_BC_DIM_MAX 37 6462 #define _SC_BC_SCALE_MAX 38 6463 #define _SC_BC_STRING_MAX 39 6464 #define _SC_OPEN_MAX 4 6465 #define _SC_COLL_WEIGHTS_MAX 40 6466 #define _SC_EXPR_NEST_MAX 42 6467 #define _SC_LINE_MAX 43 6468 #define _SC_RE_DUP_MAX 44 6469 #define _SC_2_VERSION 46 6470 #define _SC_2_C_BIND 47 6471 #define _SC_2_C_DEV 48 6472 #define _SC_2_FORT_DEV 49 6473 #define _SC_STREAM_MAX 5 6474 #define _SC_2_FORT_RUN 50 6475 #define _SC_2_SW_DEV 51 6476 #define _SC_2_LOCALEDEF 52 6477 #define _SC_TZNAME_MAX 6 6478 #define _SC_IOV_MAX 60 6479 #define _SC_THREADS 67 6480 #define _SC_THREAD_SAFE_FUNCTIONS 68 6481 #define _SC_GETGR_R_SIZE_MAX 69 6482 #define _SC_JOB_CONTROL 7 6483 #define _SC_GETPW_R_SIZE_MAX 70 6484 #define _SC_LOGIN_NAME_MAX 71 6485 #define _SC_TTY_NAME_MAX 72 6486 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 6487 #define _SC_THREAD_KEYS_MAX 74 6488 #define _SC_THREAD_STACK_MIN 75 6489 #define _SC_THREAD_THREADS_MAX 76 6490 #define _SC_THREAD_ATTR_STACKADDR 77 6491 #define _SC_THREAD_ATTR_STACKSIZE 78 6492 #define _SC_THREAD_PRIORITY_SCHEDULING 79 6493 #define _SC_SAVED_IDS 8 6494 #define _SC_THREAD_PRIO_INHERIT 80 6495 #define _SC_THREAD_PRIO_PROTECT 81 6496 #define _SC_THREAD_PROCESS_SHARED 82 6497 #define _SC_ATEXIT_MAX 87 6498 #define _SC_PASS_MAX 88 6499 #define _SC_XOPEN_VERSION 89 6500 #define _SC_REALTIME_SIGNALS 9 6501 #define _SC_XOPEN_UNIX 91 6502 #define _SC_XOPEN_CRYPT 92 6503 #define _SC_XOPEN_ENH_I18N 93 6504 #define _SC_XOPEN_SHM 94 6505 #define _SC_2_CHAR_TERM 95 6506 #define _SC_2_C_VERSION 96 6507 #define _SC_2_UPE 97 6508 6509 #define _CS_PATH 0 6510 #define _POSIX_REGEXP 1 6511 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 6512 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 6513 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 6514 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 6515 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 6516 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 6517 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 6518 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 6519 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 6520 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 6521 #define _CS_XBS5_LP64_OFF64_LIBS 1110 6522 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 6523 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 6524 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 6525 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 6526 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 6527 6528 #define _XOPEN_XPG4 1 6529 6530 #define F_ULOCK 0 6531 #define F_LOCK 1 6532 #define F_TLOCK 2 6533 #define F_TEST 3 6534 6535 extern char **__environ(void); 6536 extern pid_t __getpgid(pid_t); 6537 extern void _exit(int); 6538 extern int acct(const char *); 6539 extern unsigned int alarm(unsigned int); 6540 extern int chown(const char *, uid_t, gid_t); 6541 extern int chroot(const char *); 6542 extern size_t confstr(int, char *, size_t); 6543 extern int creat(const char *, mode_t); 6544 extern int creat64(const char *, mode_t); 6545 extern char *ctermid(char *); 6546 extern char *cuserid(char *); 6547 extern int daemon(int, int); 6548 extern int execl(const char *, const char *, ...); 6549 extern int execle(const char *, const char *, ...); 6550 extern int execlp(const char *, const char *, ...); 6551 extern int execv(const char *, char *const); 6552 extern int execvp(const char *, char *const); 6553 extern int fdatasync(int); 6554 extern int ftruncate64(int, off64_t); 6555 extern long int gethostid(void); 6556 extern char *getlogin(void); 6557 extern int getlogin_r(char *, size_t); 6558 extern int getopt(int, char *const, const char *); 6559 extern pid_t getpgrp(void); 6560 extern pid_t getsid(pid_t); 6561 extern char *getwd(char *); 6562 extern int lockf(int, int, off_t); 6563 extern int mkstemp(char *); 6564 extern int nice(int); 6565 extern char *optarg(void); 6566 extern int opterr(void); 6567 extern int optind(void); 6568 extern int optopt(void); 6569 extern int rename(const char *, const char *); 6570 extern int setegid(gid_t); 6571 extern int seteuid(uid_t); 6572 extern int sethostname(const char *, size_t); 6573 extern int setpgrp(void); 6574 extern void swab(const void *, void *, ssize_t); 6575 extern void sync(void); 6576 extern pid_t tcgetpgrp(int); 6577 extern int tcsetpgrp(int, pid_t); 6578 extern int truncate(const char *, off_t); 6579 extern int truncate64(const char *, off64_t); 6580 extern char *ttyname(int); 6581 extern unsigned int ualarm(useconds_t, useconds_t); 6582 extern int usleep(useconds_t); 6583 extern int close(int); 6584 extern int fsync(int); 6585 extern off_t lseek(int, off_t, int); 6586 extern int open(const char *, int, ...); 6587 extern int pause(void); 6588 extern ssize_t read(int, void *, size_t); 6589 extern ssize_t write(int, const void *, size_t); 6590 extern char *crypt(char *, char *); 6591 extern void encrypt(char *, int); 6592 extern void setkey(const char *); 6593 extern int access(const char *, int); 6594 extern int brk(void *); 6595 extern int chdir(const char *); 6596 extern int dup(int); 6597 extern int dup2(int, int); 6598 extern int execve(const char *, char *const, char *const); 6599 extern int fchdir(int); 6600 extern int fchown(int, uid_t, gid_t); 6601 extern pid_t fork(void); 6602 extern gid_t getegid(void); 6603 extern uid_t geteuid(void); 6604 extern gid_t getgid(void); 6605 extern int getgroups(int, gid_t); 6606 extern int gethostname(char *, size_t); 6607 extern pid_t getpgid(pid_t); 6608 extern pid_t getpid(void); 6609 extern uid_t getuid(void); 6610 extern int lchown(const char *, uid_t, gid_t); 6611 extern int link(const char *, const char *); 6612 extern int mkdir(const char *, mode_t); 6613 extern long int pathconf(const char *, int); 6614 extern int pipe(int); 6615 extern int readlink(const char *, char *, size_t); 6616 extern int rmdir(const char *); 6617 extern void *sbrk(ptrdiff_t); 6618 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 6619 extern int setgid(gid_t); 6620 extern int setpgid(pid_t, pid_t); 6621 extern int setregid(gid_t, gid_t); 6622 extern int setreuid(uid_t, uid_t); 6623 extern pid_t setsid(void); 6624 extern int setuid(uid_t); 6625 extern unsigned int sleep(unsigned int); 6626 extern int symlink(const char *, const char *); 6627 extern long int sysconf(int); 6628 extern int unlink(const char *); 6629 extern pid_t vfork(void); 6630 extern ssize_t pread(int, void *, size_t, off_t); 6631 extern ssize_t pwrite(int, const void *, size_t, off_t); 6632 extern char **_environ(void); 6633 extern long int fpathconf(int, int); 6634 extern int ftruncate(int, off_t); 6635 extern char *getcwd(char *, size_t); 6636 extern int getpagesize(void); 6637 extern pid_t getppid(void); 6638 extern int isatty(int); 6639 extern loff_t lseek64(int, loff_t, int); 6640 extern int open64(const char *, int, ...); 6641 extern ssize_t pread64(int, void *, size_t, off64_t); 6642 extern ssize_t pwrite64(int, const void *, size_t, off64_t); 6643 extern int ttyname_r(int, char *, size_t); 6644 _________________________________________________________ 6645 6646 13.4.75. utime.h 6647 6648 struct utimbuf { 6649 time_t actime; 6650 time_t modtime; 6651 }; 6652 extern int utime(const char *, const struct utimbuf *); 6653 _________________________________________________________ 6654 6655 13.4.76. utmp.h 6656 6657 #define UT_HOSTSIZE 256 6658 #define UT_LINESIZE 32 6659 #define UT_NAMESIZE 32 6660 6661 struct exit_status { 6662 short e_termination; 6663 short e_exit; 6664 }; 6665 6666 #define EMPTY 0 6667 #define RUN_LVL 1 6668 #define BOOT_TIME 2 6669 #define NEW_TIME 3 6670 #define OLD_TIME 4 6671 #define INIT_PROCESS 5 6672 #define LOGIN_PROCESS 6 6673 #define USER_PROCESS 7 6674 #define DEAD_PROCESS 8 6675 #define ACCOUNTING 9 6676 6677 extern void endutent(void); 6678 extern struct utmp *getutent(void); 6679 extern void setutent(void); 6680 extern int getutent_r(struct utmp *, struct utmp **); 6681 extern int utmpname(const char *); 6682 extern int login_tty(int); 6683 extern void login(const struct utmp *); 6684 extern int logout(const char *); 6685 extern void logwtmp(const char *, const char *, const char *); 6686 _________________________________________________________ 6687 6688 13.4.77. utmpx.h 6689 6690 extern void endutxent(void); 6691 extern struct utmpx *getutxent(void); 6692 extern struct utmpx *getutxid(const struct utmpx *); 6693 extern struct utmpx *getutxline(const struct utmpx *); 6694 extern struct utmpx *pututxline(const struct utmpx *); 6695 extern void setutxent(void); 6696 _________________________________________________________ 6697 6698 13.4.78. wchar.h 6699 6700 #define WEOF (0xffffffffu) 6701 #define WCHAR_MAX 0x7FFFFFFF 6702 #define WCHAR_MIN 0x80000000 6703 6704 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 6705 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 6706 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 6707 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 6708 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t **, 6709 int, int); 6710 extern wchar_t *wcscat(wchar_t *, const wchar_t *); 6711 extern wchar_t *wcschr(const wchar_t *, wchar_t); 6712 extern int wcscmp(const wchar_t *, const wchar_t *); 6713 extern int wcscoll(const wchar_t *, const wchar_t *); 6714 extern wchar_t *wcscpy(wchar_t *, const wchar_t *); 6715 extern size_t wcscspn(const wchar_t *, const wchar_t *); 6716 extern wchar_t *wcsdup(const wchar_t *); 6717 extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); 6718 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); 6719 extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); 6720 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *); 6721 extern wchar_t *wcsrchr(const wchar_t *, wchar_t); 6722 extern size_t wcsspn(const wchar_t *, const wchar_t *); 6723 extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); 6724 extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t * *); 6725 extern int wcswidth(const wchar_t *, size_t); 6726 extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); 6727 extern int wctob(wint_t); 6728 extern int wcwidth(wchar_t); 6729 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); 6730 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t); 6731 extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); 6732 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 6733 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); 6734 extern size_t mbrlen(const char *, size_t, mbstate_t *); 6735 extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); 6736 extern int mbsinit(const mbstate_t *); 6737 extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, 6738 mbstate_t *); 6739 extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); 6740 extern wchar_t *wcpcpy(wchar_t *, const wchar_t *); 6741 extern wchar_t *wcpncpy(wchar_t *, const wchar_t *, size_t); 6742 extern size_t wcrtomb(char *, wchar_t, mbstate_t *); 6743 extern size_t wcslen(const wchar_t *); 6744 extern size_t wcsnrtombs(char *, const wchar_t * *, size_t, size_t, 6745 mbstate_t *); 6746 extern size_t wcsrtombs(char *, const wchar_t * *, size_t, mbstate_t *); 6747 extern double wcstod(const wchar_t *, wchar_t * *); 6748 extern float wcstof(const wchar_t *, wchar_t * *); 6749 extern long int wcstol(const wchar_t *, wchar_t * *, int); 6750 extern long double wcstold(const wchar_t *, wchar_t * *); 6751 extern long long int wcstoq(const wchar_t *, wchar_t * *, int); 6752 extern unsigned long int wcstoul(const wchar_t *, wchar_t * *, int); 6753 extern unsigned long long int wcstouq(const wchar_t *, wchar_t * *, int); 6754 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); 6755 extern int wcscasecmp(const wchar_t *, const wchar_t *); 6756 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 6757 extern size_t wcsnlen(const wchar_t *, size_t); 6758 extern long long int wcstoll(const wchar_t *, wchar_t * *, int); 6759 extern unsigned long long int wcstoull(const wchar_t *, wchar_t * *, int); 6760 extern wint_t btowc(int); 6761 extern wint_t fgetwc(FILE *); 6762 extern wint_t fgetwc_unlocked(FILE *); 6763 extern wchar_t *fgetws(wchar_t *, int, FILE *); 6764 extern wint_t fputwc(wchar_t, FILE *); 6765 extern int fputws(const wchar_t *, FILE *); 6766 extern int fwide(FILE *, int); 6767 extern int fwprintf(FILE *, const wchar_t *, ...); 6768 extern int fwscanf(FILE *, const wchar_t *, ...); 6769 extern wint_t getwc(FILE *); 6770 extern wint_t getwchar(void); 6771 extern wint_t putwc(wchar_t, FILE *); 6772 extern wint_t putwchar(wchar_t); 6773 extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); 6774 extern int swscanf(const wchar_t *, const wchar_t *, ...); 6775 extern wint_t ungetwc(wint_t, FILE *); 6776 extern int vfwprintf(FILE *, const wchar_t *, va_list); 6777 extern int vfwscanf(FILE *, const wchar_t *, va_list); 6778 extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); 6779 extern int vswscanf(const wchar_t *, const wchar_t *, va_list); 6780 extern int vwprintf(const wchar_t *, va_list); 6781 extern int vwscanf(const wchar_t *, va_list); 6782 extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, 6783 const struct tm *); 6784 extern int wprintf(const wchar_t *, ...); 6785 extern int wscanf(const wchar_t *, ...); 6786 _________________________________________________________ 6787 6788 13.4.79. wctype.h 6789 6790 typedef unsigned long int wctype_t; 6791 typedef unsigned int wint_t; 6792 typedef const int32_t *wctrans_t; 6793 typedef struct { 6794 int count; 6795 wint_t value; 6796 } __mbstate_t; 6797 6798 typedef __mbstate_t mbstate_t; 6799 extern int iswblank(wint_t); 6800 extern wint_t towlower(wint_t); 6801 extern wint_t towupper(wint_t); 6802 extern wctrans_t wctrans(const char *); 6803 extern int iswalnum(wint_t); 6804 extern int iswalpha(wint_t); 6805 extern int iswcntrl(wint_t); 6806 extern int iswctype(wint_t, wctype_t); 6807 extern int iswdigit(wint_t); 6808 extern int iswgraph(wint_t); 6809 extern int iswlower(wint_t); 6810 extern int iswprint(wint_t); 6811 extern int iswpunct(wint_t); 6812 extern int iswspace(wint_t); 6813 extern int iswupper(wint_t); 6814 extern int iswxdigit(wint_t); 6815 extern wctype_t wctype(const char *); 6816 extern wint_t towctrans(wint_t, wctrans_t); 6817 _________________________________________________________ 6818 6819 13.4.80. wordexp.h 6820 6821 enum { 6822 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, 6823 WRDE_UNDEF, __WRDE_FLAGS 6824 }; 6825 6826 typedef struct { 6827 int we_wordc; 6828 char **we_wordv; 6829 int we_offs; 6830 } wordexp_t; 6831 6832 enum { 6833 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 6834 WRDE_SYNTAX 6835 }; 6836 extern int wordexp(const char *, wordexp_t *, int); 6837 extern void wordfree(wordexp_t *); 6838 _________________________________________________________ 6839 6840 13.5. Interface Definitions for libc 6841 6842 Table of Contents 6843 _IO_feof -- alias for feof 6844 _IO_getc -- alias for getc 6845 _IO_putc -- alias for putc 6846 _IO_puts -- alias for puts 6847 __assert_fail -- abort the program after false assertion 6848 __ctype_b_loc -- accessor function for __ctype_b array for 6849 ctype functions 6850 6851 __ctype_get_mb_cur_max -- maximum length of a multibyte 6852 character in the current locale 6853 6854 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 6855 array for ctype tolower() function 6856 6857 __ctype_toupper_loc -- accessor function for 6858 __ctype_b_toupper() array for ctype toupper() function 6859 6860 __cxa_atexit -- register a function to be called by exit or 6861 when a shared library is unloaded 6862 6863 __daylight -- daylight savings time flag 6864 __environ -- alias for environ - user environment 6865 __errno_location -- address of errno variable 6866 __fpending -- returns in bytes the amount of output pending on 6867 a stream 6868 6869 __getpagesize -- alias for getpagesize - get current page size 6870 6871 __getpgid -- get the process group id 6872 __h_errno_location -- address of h_errno variable 6873 __isinf -- test for infinity 6874 __isinff -- test for infinity 6875 __isinfl -- test for infinity 6876 __isnan -- test for infinity 6877 __isnanf -- test for infinity 6878 __isnanl -- test for infinity 6879 __libc_current_sigrtmax -- return number of available 6880 real-time signal with lowest priority 6881 6882 __libc_current_sigrtmin -- return number of available 6883 real-time signal with highest priority 6884 6885 __libc_start_main -- initialization routine 6886 __lxstat -- inline wrapper around call to lxstat 6887 __mempcpy -- copy given number of bytes of source to 6888 destination 6889 6890 __rawmemchr -- scan memory 6891 __register_atfork -- alias for register_atfork 6892 __sigsetjmp -- save stack context for non-local goto 6893 __stpcpy -- alias for stpcpy 6894 __strdup -- alias for strdup 6895 __strtod_internal -- underlying function for strtod 6896 __strtof_internal -- underlying function for strtof 6897 __strtok_r -- alias for strtok_r 6898 __strtol_internal -- alias for strtol 6899 __strtold_internal -- underlying function for strtold 6900 __strtoll_internal -- underlying function for strtoll 6901 __strtoul_internal -- underlying function for strtoul 6902 __strtoull_internal -- underlying function for strtoull 6903 __sysconf -- get configuration information at runtime 6904 __sysv_signal -- signal handling 6905 __timezone -- global variable containing timezone 6906 __tzname -- global variable containing the timezone 6907 __wcstod_internal -- underlying function for wcstod 6908 __wcstof_internal -- underlying function for wcstof 6909 __wcstol_internal -- underlying function for wcstol 6910 __wcstold_internal -- underlying function for wcstold 6911 __wcstoul_internal -- underlying function for wcstoul 6912 __xmknod -- make block or character special file 6913 __xstat -- get File Status 6914 __xstat64 -- get File Status 6915 _environ -- alias for environ - user environment 6916 _nl_msg_cat_cntr -- new catalog load counter 6917 _sys_errlist -- array containing the "C" locale strings used 6918 by strerror() 6919 6920 _sys_siglist -- array containing the names of the signal names 6921 acct -- switch process accounting on or off 6922 adjtime -- correct the time to allow synchronization of the 6923 system clock 6924 6925 asprintf -- write formatted output to a dynamically allocated 6926 string 6927 6928 bind_textdomain_codeset -- specify encoding for message 6929 retrieval 6930 6931 bindresvport -- bind socket to privileged IP port 6932 bindtextdomain -- specify the location of a message catalog 6933 cfmakeraw -- get and set terminal attributes 6934 cfsetspeed -- set terminal input and output data rate 6935 daemon -- run in the background 6936 dcgettext -- perform domain and category specific lookup in 6937 message catalog 6938 6939 dcngettext -- perform domain and category specific lookup in 6940 message catalog with plural 6941 6942 dgettext -- perform lookup in message catalog for the current 6943 LC_MESSAGES locale 6944 6945 dngettext -- perform lookup in message catalog for the current 6946 locale 6947 6948 duplocale -- provide new handle for selection of locale 6949 err -- display formatted error messages 6950 error -- print error message 6951 errx -- display formatted error message and exit 6952 fcntl -- file control 6953 fflush_unlocked -- non thread safe fflush 6954 fgetwc_unlocked -- non thread safe fgetwc 6955 flock -- apply or remove an advisory lock on an open file 6956 freelocale -- free a locale object 6957 fscanf -- convert formatted input 6958 fwscanf -- convert formatted input 6959 getgrouplist -- get network group entry 6960 getloadavg -- get system load averages 6961 getopt -- parse command line options 6962 getopt_long -- parse command line options 6963 getopt_long_only -- parse command line options 6964 getsockopt -- get socket options 6965 gettext -- search message catalogs for a string 6966 getutent -- access user accounting database entries 6967 getutent_r -- access user accounting database entries 6968 glob64 -- find pathnames matching a pattern (Large File 6969 Support) 6970 6971 globfree64 -- free memory from glob64() (Large File Support) 6972 initgroups -- initialize the supplementary group access list 6973 ioctl -- control device 6974 sockio -- socket ioctl commands 6975 ttyio -- tty ioctl commands 6976 kill -- send a signal 6977 link -- create a link to a file 6978 mbsnrtowcs -- convert a multibyte string to a wide character 6979 string 6980 6981 memmem -- locate bytes 6982 memrchr -- scan memory for a character 6983 newlocale -- allocate a locale object 6984 ngettext -- search message catalogs for plural string 6985 pmap_getport -- find the port number assigned to a service 6986 registered with a portmapper. 6987 6988 pmap_set -- establishes mapping to machine's RPC Bind service. 6989 pmap_unset -- destroys RPC Binding 6990 psignal -- print signal message 6991 regexec -- regular expression matching 6992 scanf -- convert formatted input 6993 setbuffer -- stream buffering operation 6994 setgroups -- set list of supplementary group IDs 6995 sethostname -- set host name 6996 setsockopt -- set socket options 6997 setutent -- access user accounting database entries 6998 sigandset -- build a new signal set by combining the two input 6999 sets using logical AND 7000 7001 sigisemptyset -- check for empty signal set 7002 sigorset -- build a new signal set by combining the two input 7003 sets using logical OR 7004 7005 sigreturn -- return from signal handler and cleanup stack 7006 frame 7007 7008 sscanf -- convert formatted input 7009 stime -- set time 7010 stpcpy -- copy a string returning a pointer to its end 7011 stpncpy -- copy a fixed-size string, returning a pointer to 7012 its end 7013 7014 strcasestr -- locate a substring ignoring case 7015 strerror_r -- reentrant version of strerror 7016 strndup -- return a malloc'd copy of at most the specified 7017 number of bytes of a string 7018 7019 strnlen -- determine the length of a fixed-size string 7020 strptime -- parse a time string 7021 strsep -- extract token from string 7022 strsignal -- return string describing signal 7023 strtoq -- convert string value to a long or quad_t integer 7024 strtouq -- convert a string to an unsigned long long 7025 svc_register -- register Remote Procedure Call interface 7026 svc_run -- waits for RPC requests to arrive and calls service 7027 procedure 7028 7029 svc_sendreply -- called by RPC service's dispatch routine 7030 svctcp_create -- create a TCP/IP-based RPC service transport 7031 svcudp_create -- create a UDP-based RPC service transport 7032 swscanf -- convert formatted input 7033 system -- execute a shell command 7034 textdomain -- set the current default message domain 7035 unlink -- remove a directory entry 7036 uselocale -- set locale for thread 7037 utmpname -- set user accounting database 7038 vasprintf -- write formatted output to a dynamically allocated 7039 string 7040 7041 vdprintf -- write formatted output to a file descriptor 7042 verrx -- display formatted error message and exit 7043 vfscanf -- convert formatted input 7044 vfwscanf -- convert formatted input 7045 vscanf -- convert formatted input 7046 vsscanf -- convert formatted input 7047 vswscanf -- convert formatted input 7048 vsyslog -- log to system log 7049 vwscanf -- convert formatted input 7050 wait4 -- wait for process termination, BSD style 7051 waitpid -- wait for child process 7052 warn -- formatted error messages 7053 warnx -- formatted error messages 7054 wcpcpy -- copy a wide character string, returning a pointer to 7055 its end 7056 7057 wcpncpy -- copy a fixed-size string of wide characters, 7058 returning a pointer to its end 7059 7060 wcscasecmp -- compare two wide-character strings, ignoring 7061 case 7062 7063 wcsdup -- duplicate a wide-character string 7064 wcsncasecmp -- compare two fixed-size wide-character strings, 7065 ignoring case 7066 7067 wcsnlen -- determine the length of a fixed-size wide-character 7068 string 7069 7070 wcsnrtombs -- convert a wide character string to a multi-byte 7071 string 7072 7073 wcstoq -- convert wide string to long long int representation 7074 wcstouq -- convert wide string to unsigned long long int 7075 representation 7076 7077 wscanf -- convert formatted input 7078 xdr_u_int -- library routines for external data representation 7079 7080 The interfaces defined on the following pages are included in 7081 libc and are defined by this specification. Unless otherwise 7082 noted, these interfaces shall be included in the source 7083 standard. 7084 7085 Other interfaces listed in Section 13.3 shall behave as 7086 described in the referenced base document. 7087 7088 _IO_feof 7089 7090 Name 7091 7092 _IO_feof -- alias for feof 7093 7094 Synopsis 7095 7096 int _IO_feof(_IO_FILE * __fp); 7097 7098 Description 7099 7100 _IO_feof() tests the end-of-file indicator for the stream 7101 pointed to by __fp, returning a non-zero value if it is set. 7102 7103 _IO_feof() is not in the source standard; it is only in the 7104 binary standard. 7105 7106 _IO_getc 7107 7108 Name 7109 7110 _IO_getc -- alias for getc 7111 7112 Synopsis 7113 7114 int _IO_getc(_IO_FILE * __fp); 7115 7116 Description 7117 7118 _IO_getc() reads the next character from __fp and returns it 7119 as an unsigned char cast to an int, or EOF on end-of-file or 7120 error. 7121 7122 _IO_getc() is not in the source standard; it is only in the 7123 binary standard. 7124 7125 _IO_putc 7126 7127 Name 7128 7129 _IO_putc -- alias for putc 7130 7131 Synopsis 7132 7133 int _IO_putc(int __c, _IO_FILE * __fp); 7134 7135 Description 7136 7137 _IO_putc() writes the character __c, cast to an unsigned char, 7138 to __fp. 7139 7140 _IO_putc() is not in the source standard; it is only in the 7141 binary standard. 7142 7143 _IO_puts 7144 7145 Name 7146 7147 _IO_puts -- alias for puts 7148 7149 Synopsis 7150 7151 int _IO_puts(const char * __c); 7152 7153 Description 7154 7155 _IO_puts() writes the string __s and a trailing newline to 7156 stdout. 7157 7158 _IO_puts() is not in the source standard; it is only in the 7159 binary standard. 7160 7161 __assert_fail 7162 7163 Name 7164 7165 __assert_fail -- abort the program after false assertion 7166 7167 Synopsis 7168 7169 void __assert_fail(const char * assertion, const char * file, 7170 unsigned int line, const char * function); 7171 7172 Description 7173 7174 The __assert_fail() function is used to implement the assert() 7175 interface of ISO POSIX (2003). The __assert_fail() function 7176 shall print the given file filename, line line number, 7177 function function name and a message on the standard error 7178 stream in an unspecified format, and abort program execution 7179 via the abort() function. For example: 7180 7181 a.c:10: foobar: Assertion a == b failed. 7182 7183 If function is NULL, __assert_fail() shall omit information 7184 about the function. 7185 7186 assertion, file, and line shall be non-NULL. 7187 7188 The __assert_fail() function is not in the source standard; it 7189 is only in the binary standard. The assert() interface is not 7190 in the binary standard; it is only in the source standard. The 7191 assert() may be implemented as a macro. 7192 7193 __ctype_b_loc 7194 7195 Name 7196 7197 __ctype_b_loc -- accessor function for __ctype_b array for 7198 ctype functions 7199 7200 Synopsis 7201 7202 #include 7203 7204 const unsigned short * * __ctype_b_loc (void); 7205 7206 Description 7207 7208 The __ctype_b_loc() function shall return a pointer into an 7209 array of characters in the current locale that contains 7210 characteristics for each character in the current character 7211 set. The array shall contain a total of 384 characters, and 7212 can be indexed with any signed or unsigned char (i.e. with an 7213 index value between -128 and 255). If the application is 7214 multithreaded, the array shall be local to the current thread. 7215 7216 This interface is not in the source standard; it is only in 7217 the binary standard. 7218 7219 Return Value 7220 7221 The __ctype_b_loc() function shall return a pointer to the 7222 array of characters to be used for the ctype() family of 7223 functions (see ). 7224 7225 __ctype_get_mb_cur_max 7226 7227 Name 7228 7229 __ctype_get_mb_cur_max -- maximum length of a multibyte 7230 character in the current locale 7231 7232 Synopsis 7233 7234 size_t __ctype_get_mb_cur_max(void); 7235 7236 Description 7237 7238 __ctype_get_mb_cur_max() returns the maximum length of a 7239 multibyte character in the current locale. 7240 7241 __ctype_get_mb_cur_max() is not in the source standard; it is 7242 only in the binary standard. 7243 7244 __ctype_tolower_loc 7245 7246 Name 7247 7248 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 7249 array for ctype tolower() function 7250 7251 Synopsis 7252 7253 #include 7254 7255 int32_t * * __ctype_tolower_loc(void); 7256 7257 Description 7258 7259 The __ctype_tolower_loc() function shall return a pointer into 7260 an array of characters in the current locale that contains 7261 lower case equivalents for each character in the current 7262 character set. The array shall contain a total of 384 7263 characters, and can be indexed with any signed or unsigned 7264 char (i.e. with an index value between -128 and 255). If the 7265 application is multithreaded, the array shall be local to the 7266 current thread. 7267 7268 This interface is not in the source standard; it is only in 7269 the binary standard. 7270 7271 Return Value 7272 7273 The __ctype_tolower_loc() function shall return a pointer to 7274 the array of characters to be used for the ctype() family of 7275 functions (see ). 7276 7277 __ctype_toupper_loc 7278 7279 Name 7280 7281 __ctype_toupper_loc -- accessor function for 7282 __ctype_b_toupper() array for ctype toupper() function 7283 7284 Synopsis 7285 7286 #include 7287 7288 int32_t * * __ctype_toupper_loc(void); 7289 7290 Description 7291 7292 The __ctype_toupper_loc() function shall return a pointer into 7293 an array of characters in the current locale that contains 7294 upper case equivalents for each character in the current 7295 character set. The array shall contain a total of 384 7296 characters, and can be indexed with any signed or unsigned 7297 char (i.e. with an index value between -128 and 255). If the 7298 application is multithreaded, the array shall be local to the 7299 current thread. 7300 7301 This interface is not in the source standard; it is only in 7302 the binary standard. 7303 7304 Return Value 7305 7306 The __ctype_toupper_loc() function shall return a pointer to 7307 the array of characters to be used for the ctype() family of 7308 functions (see ). 7309 7310 __cxa_atexit 7311 7312 Name 7313 7314 __cxa_atexit -- register a function to be called by exit or 7315 when a shared library is unloaded 7316 7317 Synopsis 7318 7319 int __cxa_atexit(void (*func) (void *), void * arg, void * 7320 dso_handle); 7321 7322 Description 7323 7324 As described in the Itanium C++ ABI, __cxa_atexit() registers 7325 a destructor function to be called by exit() or when a shared 7326 library is unloaded. When a shared library is unloaded, any 7327 destructor function associated with that shared library, 7328 identified by dso_handle, shall be called with the single 7329 argument arg, and then that function shall be removed, or 7330 marked as complete, from the list of functions to run at 7331 exit(). On a call to exit(), any remaining functions 7332 registered shall be called with the single argument arg. 7333 Destructor functions shall always be called in the reverse 7334 order to their registration (i.e. the most recently registered 7335 function shall be called first), 7336 7337 The __cxa_atexit() function is used to implement atexit(), as 7338 described in ISO POSIX (2003). Calling atexit(func) from the 7339 statically linked part of an application shall be equivalent 7340 to __cxa_atexit(func, NULL, NULL). 7341 7342 __cxa_atexit() is not in the source standard; it is only in 7343 the binary standard. 7344 7345 Note: atexit() is not in the binary standard; it is only in 7346 the source standard. 7347 7348 __daylight 7349 7350 Name 7351 7352 __daylight -- daylight savings time flag 7353 7354 Synopsis 7355 7356 int __daylight; 7357 7358 Description 7359 7360 The integer variable __daylight shall implement the daylight 7361 savings time flag daylight as specified in the ISO POSIX 7362 (2003) header file . 7363 7364 __daylight is not in the source standard; it is only in the 7365 binary standard. daylight is not in the binary standard; it is 7366 only in the source standard. 7367 7368 __environ 7369 7370 Name 7371 7372 __environ -- alias for environ - user environment 7373 7374 Synopsis 7375 7376 extern char * *__environ; 7377 7378 Description 7379 7380 __environ is an alias for environ - user environment. 7381 7382 __environ has the same specification as environ. 7383 7384 __environ is not in the source standard; it is only in the 7385 binary standard. 7386 7387 __errno_location 7388 7389 Name 7390 7391 __errno_location -- address of errno variable 7392 7393 Synopsis 7394 7395 int * __errno_location(void); 7396 7397 Description 7398 7399 The __errno_location() function shall return the address of 7400 the errno variable for the current thread. 7401 7402 __errno_location() is not in the source standard; it is only 7403 in the binary standard. 7404 7405 __fpending 7406 7407 Name 7408 7409 __fpending -- returns in bytes the amount of output pending on 7410 a stream 7411 7412 Synopsis 7413 7414 size_t __fpending(FILE * stream); 7415 7416 Description 7417 7418 __fpending() returns the amount of output in bytes pending on 7419 a stream. 7420 7421 __fpending() is not in the source standard; it is only in the 7422 binary standard. 7423 7424 __getpagesize 7425 7426 Name 7427 7428 __getpagesize -- alias for getpagesize - get current page size 7429 7430 Synopsis 7431 7432 int __getpagesize(void); 7433 7434 Description 7435 7436 __getpagesize() is an alias for getpagesize() - get current 7437 page size. 7438 7439 __getpagesize() has the same specification as getpagesize(). 7440 7441 __getpagesize() is not in the source standard; it is only in 7442 the binary standard. 7443 7444 __getpgid 7445 7446 Name 7447 7448 __getpgid -- get the process group id 7449 7450 Synopsis 7451 7452 pid_t __getpgid(pid_t pid); 7453 7454 Description 7455 7456 __getpgid() has the same specification as getpgid(). 7457 7458 __getpgid() is not in the source standard; it is only in the 7459 binary standard. 7460 7461 __h_errno_location 7462 7463 Name 7464 7465 __h_errno_location -- address of h_errno variable 7466 7467 Synopsis 7468 7469 int * __h_errno_location(void); 7470 7471 Description 7472 7473 __h_errno_location() returns the address of the h_errno 7474 variable, where h_errno is as specified in ISO POSIX (2003). 7475 7476 __h_errno_location() is not in the source standard; it is only 7477 in the binary standard. Note that h_errno itself is only in 7478 the source standard; it is not in the binary standard. 7479 7480 __isinf 7481 7482 Name 7483 7484 __isinf -- test for infinity 7485 7486 Synopsis 7487 7488 int __isinf(double arg); 7489 7490 Description 7491 7492 __isinf() has the same specification as isinf() in ISO POSIX 7493 (2003), except that the argument type for __isinf() is known 7494 to be double. 7495 7496 __isinf() is not in the source standard; it is only in the 7497 binary standard. 7498 7499 __isinff 7500 7501 Name 7502 7503 __isinff -- test for infinity 7504 7505 Synopsis 7506 7507 int __isinff(float arg); 7508 7509 Description 7510 7511 __isinff() has the same specification as isinf() in ISO POSIX 7512 (2003) except that the argument type for __isinff() is known 7513 to be float. 7514 7515 __isinff() is not in the source standard; it is only in the 7516 binary standard. 7517 7518 __isinfl 7519 7520 Name 7521 7522 __isinfl -- test for infinity 7523 7524 Synopsis 7525 7526 int __isinfl(long double arg); 7527 7528 Description 7529 7530 __isinfl() has the same specification as isinf() in the ISO 7531 POSIX (2003), except that the argument type for __isinfl() is 7532 known to be long double. 7533 7534 __isinfl() is not in the source standard; it is only in the 7535 binary standard. 7536 7537 __isnan 7538 7539 Name 7540 7541 __isnan -- test for infinity 7542 7543 Synopsis 7544 7545 int __isnan(double arg); 7546 7547 Description 7548 7549 __isnan() has the same specification as isnan() in ISO POSIX 7550 (2003), except that the argument type for __isnan() is known 7551 to be double. 7552 7553 __isnan() is not in the source standard; it is only in the 7554 binary standard. 7555 7556 __isnanf 7557 7558 Name 7559 7560 __isnanf -- test for infinity 7561 7562 Synopsis 7563 7564 int __isnanf(float arg); 7565 7566 Description 7567 7568 __isnanf() has the same specification as isnan() in ISO POSIX 7569 (2003), except that the argument type for __isnanf() is known 7570 to be float. 7571 7572 __isnanf() is not in the source standard; it is only in the 7573 binary standard. 7574 7575 __isnanl 7576 7577 Name 7578 7579 __isnanl -- test for infinity 7580 7581 Synopsis 7582 7583 int __isnanl(long double arg); 7584 7585 Description 7586 7587 __isnanl() has the same specification as isnan() in ISO POSIX 7588 (2003), except that the argument type for __isnanl() is known 7589 to be long double. 7590 7591 __isnanl() is not in the source standard; it is only in the 7592 binary standard. 7593 7594 __libc_current_sigrtmax 7595 7596 Name 7597 7598 __libc_current_sigrtmax -- return number of available 7599 real-time signal with lowest priority 7600 7601 Synopsis 7602 7603 int __libc_current_sigrtmax(void); 7604 7605 Description 7606 7607 __libc_current_sigrtmax() returns the number of an available 7608 real-time signal with the lowest priority. 7609 7610 __libc_current_sigrtmax() is not in the source standard; it is 7611 only in the binary standard. 7612 7613 __libc_current_sigrtmin 7614 7615 Name 7616 7617 __libc_current_sigrtmin -- return number of available 7618 real-time signal with highest priority 7619 7620 Synopsis 7621 7622 int __libc_current_sigrtmin(void); 7623 7624 Description 7625 7626 __libc_current_sigrtmin() returns the number of an available 7627 real-time signal with the highest priority. 7628 7629 __libc_current_sigrtmin() is not in the source standard; it is 7630 only in the binary standard. 7631 7632 __libc_start_main 7633 7634 Name 7635 7636 __libc_start_main -- initialization routine 7637 7638 Synopsis 7639 7640 int __libc_start_main(int *(main) (int, char * *, char * *), 7641 int argc, char * * ubp_av, void (*init) (void), void (*fini) 7642 (void), void (*rtld_fini) (void), void (* stack_end)); 7643 7644 Description 7645 7646 The __libc_start_main() function shall perform any necessary 7647 initialization of the execution environment, call the main 7648 function with appropriate arguments, and handle the return 7649 from main(). If the main() function returns, the return value 7650 shall be passed to the exit() function. 7651 7652 Note: While this specification is intended to be 7653 implementation independent, process and library 7654 initialization may include: 7655 7656 * performing any necessary security checks if the effective 7657 user ID is not the same as the real user ID. 7658 * initialize the threading subsystem. 7659 * registering the rtld_fini to release resources when this 7660 dynamic shared object exits (or is unloaded). 7661 * registering the fini handler to run at program exit. 7662 * calling the initializer function (*init)(). 7663 * calling main() with appropriate arguments. 7664 * calling exit() with the return value from main(). 7665 7666 This list is an example only. 7667 7668 __libc_start_main() is not in the source standard; it is only 7669 in the binary standard. 7670 7671 See Also 7672 7673 The section on Process Initialization in each of the 7674 architecture specific supplements. 7675 7676 __lxstat 7677 7678 Name 7679 7680 __lxstat -- inline wrapper around call to lxstat 7681 7682 Synopsis 7683 7684 #include 7685 7686 int __lxstat(int version, char * __path, struct stat 7687 __statbuf); 7688 7689 Description 7690 7691 __lxstat() is an inline wrapper around call to lxstat(). 7692 7693 __lxstat() is not in the source standard; it is only in the 7694 binary standard. 7695 7696 __mempcpy 7697 7698 Name 7699 7700 __mempcpy -- copy given number of bytes of source to 7701 destination 7702 7703 Synopsis 7704 7705 #include 7706 7707 ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, 7708 size_t n); 7709 7710 Description 7711 7712 __mempcpy() copies n bytes of source to destination, returning 7713 pointer to bytes after the last written byte. 7714 7715 __mempcpy() is not in the source standard; it is only in the 7716 binary standard. 7717 7718 __rawmemchr 7719 7720 Name 7721 7722 __rawmemchr -- scan memory 7723 7724 Synopsis 7725 7726 #include 7727 7728 ptr_t __rawmemchr(const ptr_t s, int c); 7729 7730 Description 7731 7732 __rawmemchr() searches in s for c. 7733 7734 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 7735 memchr(), but it has no length limit. 7736 7737 __rawmemchr() is not in the source standard; it is only in the 7738 binary standard. 7739 7740 __register_atfork 7741 7742 Name 7743 7744 __register_atfork -- alias for register_atfork 7745 7746 Synopsis 7747 7748 int __register_atfork(void (*prepare) (void), void (*parent) 7749 (void), void (*child) (void), void * __dso_handle); 7750 7751 Description 7752 7753 __register_atfork() implements pthread_atfork() as specified 7754 in ISO POSIX (2003). The additional parameter __dso_handle 7755 allows a shared object to pass in it's handle so that 7756 functions registered by __register_atfork() can be 7757 unregistered by the runtime when the shared object is 7758 unloaded. 7759 7760 __sigsetjmp 7761 7762 Name 7763 7764 __sigsetjmp -- save stack context for non-local goto 7765 7766 Synopsis 7767 7768 int __sigsetjmp(jmp_buf env, int savemask); 7769 7770 Description 7771 7772 __sigsetjmp() has the same behavior as sigsetjmp() as 7773 specified by ISO POSIX (2003). 7774 7775 __sigsetjmp() is not in the source standard; it is only in the 7776 binary standard. 7777 7778 __stpcpy 7779 7780 Name 7781 7782 __stpcpy -- alias for stpcpy 7783 7784 Synopsis 7785 7786 #include 7787 7788 char * __stpcpy(char * dest, const char * src); 7789 7790 Description 7791 7792 The __stpcpy() function has the same specification as the 7793 stpcpy(). 7794 7795 __stpcpy() is not in the source standard; it is only in the 7796 binary standard. 7797 7798 __strdup 7799 7800 Name 7801 7802 __strdup -- alias for strdup 7803 7804 Synopsis 7805 7806 char * __strdup(const char string); 7807 7808 Description 7809 7810 __strdup() has the same specification as strdup(). 7811 7812 __strdup() is not in the source standard; it is only in the 7813 binary standard. 7814 7815 __strtod_internal 7816 7817 Name 7818 7819 __strtod_internal -- underlying function for strtod 7820 7821 Synopsis 7822 7823 double __strtod_internal(const char * __nptr, char * * 7824 __endptr, int __group); 7825 7826 Description 7827 7828 __group shall be 0 or the behavior of __strtod_internal() is 7829 undefined. 7830 7831 __strtod_internal(__nptr, __endptr, 0)() has the same 7832 specification as strtod(__nptr, __endptr)(). 7833 7834 __strtod_internal() is not in the source standard; it is only 7835 in the binary standard. 7836 7837 __strtof_internal 7838 7839 Name 7840 7841 __strtof_internal -- underlying function for strtof 7842 7843 Synopsis 7844 7845 float __strtof_internal(const char * __nptr, char * * 7846 __endptr, int __group); 7847 7848 Description 7849 7850 __group shall be 0 or the behavior of __strtof_internal() is 7851 undefined. 7852 7853 __strtof_internal(__nptr, __endptr, 0)() has the same 7854 specification as strtof(__nptr, __endptr)(). 7855 7856 __strtof_internal() is not in the source standard; it is only 7857 in the binary standard. 7858 7859 __strtok_r 7860 7861 Name 7862 7863 __strtok_r -- alias for strtok_r 7864 7865 Synopsis 7866 7867 char * __strtok_r(char * restrict s, const char * restrict 7868 delim, char * * restrict save_ptr); 7869 7870 Description 7871 7872 __strtok_r() has the same specification as strtok_r(). 7873 7874 __strtok_r() is not in the source standard; it is only in the 7875 binary standard. 7876 7877 __strtol_internal 7878 7879 Name 7880 7881 __strtol_internal -- alias for strtol 7882 7883 Synopsis 7884 7885 long int __strtol_internal(const char * __nptr, char * * 7886 __endptr, int __base, int __group); 7887 7888 Description 7889 7890 __group shall be 0 or the behavior of __strtol_internal() is 7891 undefined. 7892 7893 __strtol_internal(__nptr, __endptr, __base, 0) has the same 7894 specification as strtol(__nptr, __endptr, __base). 7895 7896 __strtol_internal() is not in the source standard; it is only 7897 in the binary standard. 7898 7899 __strtold_internal 7900 7901 Name 7902 7903 __strtold_internal -- underlying function for strtold 7904 7905 Synopsis 7906 7907 long double __strtold_internal(const char * __nptr, char * * 7908 __endptr, int __group); 7909 7910 Description 7911 7912 __group shall be 0 or the behavior of __strtold_internal() is 7913 undefined. 7914 7915 __strtold_internal(__nptr, __endptr, 0) has the same 7916 specification as strtold(__nptr, __endptr). 7917 7918 __strtold_internal() is not in the source standard; it is only 7919 in the binary standard. 7920 7921 __strtoll_internal 7922 7923 Name 7924 7925 __strtoll_internal -- underlying function for strtoll 7926 7927 Synopsis 7928 7929 long long __strtoll_internal(const char * __nptr, char * * 7930 __endptr, int __base, int __group); 7931 7932 Description 7933 7934 __group shall be 0 or the behavior of __strtoll_internal() is 7935 undefined. 7936 7937 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 7938 specification as strtoll(__nptr, __endptr, __base). 7939 7940 __strtoll_internal() is not in the source standard; it is only 7941 in the binary standard. 7942 7943 __strtoul_internal 7944 7945 Name 7946 7947 __strtoul_internal -- underlying function for strtoul 7948 7949 Synopsis 7950 7951 unsigned long int __strtoul_internal(const char * __nptr, char 7952 * * __endptr, int __base, int __group); 7953 7954 Description 7955 7956 __group shall be 0 or the behavior of __strtoul_internal() is 7957 undefined. 7958 7959 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 7960 specification as strtoul(__nptr, __endptr, __base). 7961 7962 __strtoul_internal() is not in the source standard; it is only 7963 in the binary standard. 7964 7965 __strtoull_internal 7966 7967 Name 7968 7969 __strtoull_internal -- underlying function for strtoull 7970 7971 Synopsis 7972 7973 unsigned long long __strtoull_internal(const char * __nptr, 7974 char * * __endptr, int __base, int __group); 7975 7976 Description 7977 7978 __group shall be 0 or the behavior of __strtoull_internal() is 7979 undefined. 7980 7981 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 7982 specification as strtoull(__nptr, __endptr, __base). 7983 7984 __strtoull_internal() is not in the source standard; it is 7985 only in the binary standard. 7986 7987 __sysconf 7988 7989 Name 7990 7991 __sysconf -- get configuration information at runtime 7992 7993 Synopsis 7994 7995 #include 7996 7997 long __sysconf(int name); 7998 7999 Description 8000 8001 __sysconf() gets configuration information at runtime. 8002 8003 __sysconf() is weak alias to sysconf(). 8004 8005 __sysconf() has the same specification as sysconf(). 8006 8007 __sysconf() is not in the source standard; it is only in the 8008 binary standard. 8009 8010 __sysv_signal 8011 8012 Name 8013 8014 __sysv_signal -- signal handling 8015 8016 Synopsis 8017 8018 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 8019 8020 Description 8021 8022 __sysv_signal() has the same behavior as signal() as specified 8023 by ISO POSIX (2003). 8024 8025 __sysv_signal() is not in the source standard; it is only in 8026 the binary standard. 8027 8028 __timezone 8029 8030 Name 8031 8032 -- global variable containing timezone 8033 8034 Synopsis 8035 8036 long int __timezone; 8037 8038 Description 8039 8040 __timezone() has the same specification as timezone() in the 8041 ISO POSIX (2003) 8042 8043 __tzname 8044 8045 Name 8046 8047 -- global variable containing the timezone 8048 8049 Synopsis 8050 8051 char * __tzname[2]; 8052 8053 Description 8054 8055 __tzname has the same specification as tzname in the ISO POSIX 8056 (2003). 8057 8058 Note that the array size of 2 is explicit in the ISO POSIX 8059 (2003), but not in the SUSv2. 8060 8061 __wcstod_internal 8062 8063 Name 8064 8065 __wcstod_internal -- underlying function for wcstod 8066 8067 Synopsis 8068 8069 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 8070 endptr, int group); 8071 8072 Description 8073 8074 group shall be 0 or the behavior of __wcstod_internal() is 8075 undefined. 8076 8077 __wcstod_internal(nptr, endptr, 0) shall behave as 8078 wcstod(nptr, endptr) as specified by ISO POSIX (2003). 8079 8080 __wcstod_internal() is not in the source standard; it is only 8081 in the binary standard. 8082 8083 __wcstof_internal 8084 8085 Name 8086 8087 __wcstof_internal -- underlying function for wcstof 8088 8089 Synopsis 8090 8091 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 8092 endptr, int group); 8093 8094 Description 8095 8096 group shall be 0 or the behavior of __wcstof_internal() is 8097 undefined. 8098 8099 __wcstof_internal(nptr, endptr, 0) shall behave as 8100 wcstof(nptr, endptr) as specified in ISO POSIX (2003). 8101 8102 __wcstof_internal() is not in the source standard; it is only 8103 in the binary standard. 8104 8105 __wcstol_internal 8106 8107 Name 8108 8109 __wcstol_internal -- underlying function for wcstol 8110 8111 Synopsis 8112 8113 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 8114 endptr, int base, int group); 8115 8116 Description 8117 8118 group shall be 0 or the behavior of __wcstol_internal() is 8119 undefined. 8120 8121 __wcstol_internal(nptr, endptr, base, 0) shall behave as 8122 wcstol(nptr, endptr, base) as specified by ISO POSIX (2003). 8123 8124 __wcstol_internal() is not in the source standard; it is only 8125 in the binary standard. 8126 8127 __wcstold_internal 8128 8129 Name 8130 8131 __wcstold_internal -- underlying function for wcstold 8132 8133 Synopsis 8134 8135 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 8136 * endptr, int group); 8137 8138 Description 8139 8140 group shall be 0 or the behavior of __wcstold_internal() is 8141 undefined. 8142 8143 __wcstold_internal(nptr, endptr, 0) shall behave as 8144 wcstold(nptr, endptr) as specified by ISO POSIX (2003). 8145 8146 __wcstold_internal() is not in the source standard; it is only 8147 in the binary standard. 8148 8149 __wcstoul_internal 8150 8151 Name 8152 8153 __wcstoul_internal -- underlying function for wcstoul 8154 8155 Synopsis 8156 8157 unsigned long __wcstoul_internal(const wchar_t * restrict 8158 nptr, wchar_t * * restrict endptr, int base, int group); 8159 8160 Description 8161 8162 group shall be 0 or the behavior of __wcstoul_internal() is 8163 undefined. 8164 8165 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 8166 wcstoul(nptr, endptr, base)() as specified by ISO POSIX 8167 (2003). 8168 8169 __wcstoul_internal() is not in the source standard; it is only 8170 in the binary standard. 8171 8172 __xmknod 8173 8174 Name 8175 8176 __xmknod -- make block or character special file 8177 8178 Synopsis 8179 8180 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 8181 dev); 8182 8183 Description 8184 8185 The __xmknod() function shall implement the mknod() interface 8186 from ISO POSIX (2003). 8187 8188 The value of ver shall be 1 or the behavior of __xmknod() is 8189 undefined. 8190 8191 __xmknod(1, path, mode, dev) shall behave as mknod(path, mode, 8192 dev) as specified by ISO POSIX (2003). 8193 8194 The __xmknod() function is not in the source standard; it is 8195 only in the binary standard. 8196 8197 Note: The mknod() function is not in the binary standard; 8198 it is only in the source standard. 8199 8200 __xstat 8201 8202 Name 8203 8204 __xstat -- get File Status 8205 8206 Synopsis 8207 8208 #include 8209 #include 8210 8211 int __xstat(int ver, const char * path, struct stat * 8212 stat_buf); 8213 8214 int __lxstat(int ver, const char * path, struct stat * 8215 stat_buf); 8216 8217 int __fxstat(int ver, int fildes, struct stat * stat_buf); 8218 8219 Description 8220 8221 The functions __xstat(), __lxstat(), and __fxstat() shall 8222 implement the ISO POSIX (2003) functions stat(), lstat(), and 8223 fstat() respectively. 8224 8225 ver shall be 3 or the behavior of these functions is 8226 undefined. 8227 8228 __xstat(3, path, stat_buf) shall implement stat(path, 8229 stat_buf) as specified by ISO POSIX (2003). 8230 8231 __lxstat(3, path, stat_buf) shall implement lstat(path, 8232 stat_buf) as specified by ISO POSIX (2003). 8233 8234 __fxstat(3, fildes, stat_buf) shall implement fstat(fildes, 8235 stat_buf) as specified by ISO POSIX (2003). 8236 8237 __xstat(), __lxstat(), and __fxstat() are not in the source 8238 standard; they are only in the binary standard. 8239 8240 stat(), lstat(), and fstat() are not in the binary standard; 8241 they are only in the source standard. 8242 8243 __xstat64 8244 8245 Name 8246 8247 __xstat64 -- get File Status 8248 8249 Synopsis 8250 8251 #define _LARGEFILE_SOURCE 1 8252 #include 8253 #include 8254 8255 int __xstat64(int ver, const char * path, struct stat64 * 8256 stat_buf); 8257 8258 int __lxstat64(int ver, const char * path, struct stat64 * 8259 stat_buf); 8260 8261 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 8262 8263 Description 8264 8265 The functions __xstat64(), __lxstat64(), and __fxstat64() 8266 shall implement the Large File Support functions stat64(), 8267 lstat64(), and fstat64() respectively. 8268 8269 ver shall be 3 or the behavior of these functions is 8270 undefined. 8271 8272 __xstat64(3, path, stat_buf) shall behave as stat(path, 8273 stat_buf) as specified by Large File Support. 8274 8275 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 8276 stat_buf) as specified by Large File Support. 8277 8278 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 8279 stat_buf) as specified by Large File Support. 8280 8281 __xstat64(), __lxstat64(), and __fxstat64() are not in the 8282 source standard; they are only in the binary standard. 8283 8284 stat64(), lstat64(), and fstat64() are not in the binary 8285 standard; they are only in the source standard. 8286 8287 _environ 8288 8289 Name 8290 8291 _environ -- alias for environ - user environment 8292 8293 Synopsis 8294 8295 extern char * *_environ; 8296 8297 Description 8298 8299 _environ is an alias for environ - user environment. 8300 8301 _nl_msg_cat_cntr 8302 8303 Name 8304 8305 _nl_msg_cat_cntr -- new catalog load counter 8306 8307 Synopsis 8308 8309 #include 8310 8311 extern int _nl_msg_cat_cntr; 8312 8313 Description 8314 8315 The global variable _nl_msg_cat_cntr is incremented each time 8316 a new catalog is loaded. This variable is only in the binary 8317 standard; it is not in the source standard. 8318 8319 _sys_errlist 8320 8321 Name 8322 8323 _sys_errlist -- array containing the "C" locale strings used 8324 by strerror() 8325 8326 Synopsis 8327 8328 #include 8329 8330 extern const char *const _sys_errlist[]; 8331 8332 Description 8333 8334 _sys_errlist is an array containing the "C" locale strings 8335 used by strerror(). This normally should not be used directly. 8336 strerror() provides all of the needed functionality. 8337 8338 _sys_siglist 8339 8340 Name 8341 8342 _sys_siglist -- array containing the names of the signal names 8343 8344 Synopsis 8345 8346 #include 8347 8348 extern const char *const _sys_siglist[NSIG]; 8349 8350 Description 8351 8352 _sys_siglist is an array containing the names of the signal 8353 names. 8354 8355 The _sys_siglist array is only in the binary standard; it is 8356 not in the source standard. Applications wishing to access the 8357 names of signals should use the strsignal() function. 8358 8359 acct 8360 8361 Name 8362 8363 acct -- switch process accounting on or off 8364 8365 Synopsis 8366 8367 #include 8368 8369 int acct(const char * filename); 8370 8371 Description 8372 8373 When filename is the name of an existing file, acct() turns 8374 accounting on and appends a record to filename for each 8375 terminating process. When filename is NULL, acct() turns 8376 accounting off. 8377 8378 Return Value 8379 8380 On success, 0 is returned. On error, -1 is returned and the 8381 global variable errno is set appropriately. 8382 8383 Errors 8384 8385 ENOSYS 8386 8387 BSD process accounting has not been enabled when the operating 8388 system kernel was compiled. The kernel configuration parameter 8389 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 8390 ENOMEM 8391 8392 Out of memory. 8393 EPERM 8394 8395 The calling process has no permission to enable process 8396 accounting. 8397 EACCES 8398 8399 filename is not a regular file. 8400 EIO 8401 8402 Error writing to the filename. 8403 EUSERS 8404 8405 There are no more free file structures or we run out of 8406 memory. 8407 8408 adjtime 8409 8410 Name 8411 8412 adjtime -- correct the time to allow synchronization of the 8413 system clock 8414 8415 Synopsis 8416 8417 #include 8418 8419 int adjtime(const struct timeval * delta, struct timeval * 8420 olddelta); 8421 8422 Description 8423 8424 adjtime() makes small adjustments to the system time as 8425 returned by gettimeofday()(2), advancing or retarding it by 8426 the time specified by the timeval delta. If delta is negative, 8427 the clock is slowed down by incrementing it more slowly than 8428 normal until the correction is complete. If delta is positive, 8429 a larger increment than normal is used. The skew used to 8430 perform the correction is generally a fraction of one percent. 8431 Thus, the time is always a monotonically increasing function. 8432 A time correction from an earlier call to adjtime() may not be 8433 finished when adjtime() is called again. If olddelta is 8434 non-NULL, the structure pointed to will contain, upon return, 8435 the number of microseconds still to be corrected from the 8436 earlier call. 8437 8438 adjtime() may be used by time servers that synchronize the 8439 clocks of computers in a local area network. Such time servers 8440 would slow down the clocks of some machines and speed up the 8441 clocks of others to bring them to the average network time. 8442 8443 Appropriate privilege is required to adjust the system time. 8444 8445 Return Value 8446 8447 On success, 0 is returned. On error, -1 is returned and the 8448 global variable errno is set appropriately. 8449 8450 Errors 8451 8452 EFAULT 8453 8454 An argument points outside the process's allocated address 8455 space. 8456 EPERM 8457 8458 The process does not have appropriate privilege. 8459 8460 asprintf 8461 8462 Name 8463 8464 asprintf -- write formatted output to a dynamically allocated 8465 string 8466 8467 Synopsis 8468 8469 #include 8470 8471 int asprintf(char ** restrict ptr, const char * restrict 8472 format, ...); 8473 8474 Description 8475 8476 The asprintf() function shall behave as sprintf(), except that 8477 the output string shall be dynamically allocated space of 8478 sufficient length to hold the resulting string. The address of 8479 this dynamically allocated string shall be stored in the 8480 location referenced by ptr. 8481 8482 Return Value 8483 8484 Refer to fprintf(). 8485 8486 Errors 8487 8488 Refer to fprintf(). 8489 8490 bind_textdomain_codeset 8491 8492 Name 8493 8494 bind_textdomain_codeset -- specify encoding for message 8495 retrieval 8496 8497 Synopsis 8498 8499 #include 8500 8501 char * bind_textdomain_codeset (const char * domainname , 8502 const char * codeset ); 8503 8504 Description 8505 8506 The bind_textdomain_codeset() function can be used to specify 8507 the output codeset for message catalogs for domain domainname. 8508 The codeset argument shall be a valid codeset name which can 8509 be used tor the iconv_open function, or a null pointer. If the 8510 codeset argument is the null pointer, then function returns 8511 the currently selected codeset for the domain with the name 8512 domainname. It shall return a null pointer if no codeset has 8513 yet been selected. 8514 8515 Each successive call to bind_textdomain_codeset() function 8516 overrrides the settings made by the preceding call with the 8517 same domainname. 8518 8519 The bind_textdomain_codeset() function shall return a pointer 8520 to a string containing the name of the selected codeset. The 8521 string shall be allocated internally in the function and shall 8522 not be changed or freed by the user. 8523 8524 The bind_textdomain_codeset() function returns a pointer to a 8525 string containing the name of the selected codeset. The string 8526 is allocated internally in the function and shall not be 8527 changed by the user. 8528 8529 Parameters 8530 8531 domainname 8532 8533 The domainname argument is applied to the currently active 8534 LC_MESSAGE locale. It is equivalent in syntax and meaning to 8535 the domainname argument to textdomain, except that the 8536 selection of the domain is valid only for the duration of the 8537 call. 8538 codeset 8539 8540 The name of the output codeset for the selected domain, or 8541 NULL to select the current codeset. 8542 8543 If domainname is the null pointer, or is an empty string, 8544 bind_textdomain_codeset() shall fail, but need not set errno. 8545 8546 Return Value 8547 8548 Returns the currently selected codeset name. It returns a null 8549 pointer if no codeset has yet been selected. 8550 8551 Errors 8552 8553 ENOMEM 8554 8555 Insufficient memory available to allocate return value. 8556 8557 See Also 8558 8559 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8560 textdomain, bindtextdomain 8561 8562 bindresvport 8563 8564 Name 8565 8566 bindresvport -- bind socket to privileged IP port 8567 8568 Synopsis 8569 8570 #include 8571 #include 8572 8573 int bindresvport(int sd, struct sockaddr_in * sin); 8574 8575 Description 8576 8577 If the process has appropriate privilege, the bindresvport() 8578 function shall bind a socket to a privileged IP port. 8579 8580 Return Value 8581 8582 On success, 0 is returned. On error, -1 is returned and the 8583 global variable errno is set appropriately. 8584 8585 Errors 8586 8587 EPERM 8588 8589 The process did not have appropriate privilege. 8590 EPFNOSUPPORT 8591 8592 Address of sin did not match address family of sd. 8593 8594 bindtextdomain 8595 8596 Name 8597 8598 bindtextdomain -- specify the location of a message catalog 8599 8600 Synopsis 8601 8602 #include 8603 8604 char * bindtextdomain(const char * domainname, const char * 8605 dirname); 8606 8607 Description 8608 8609 The bindtextdomain() shall set the the base directory of the 8610 hierarchy containing message catalogs for a given message 8611 domain. 8612 8613 The bindtextdomain() function specifies that the domainname 8614 message catalog can be found in the dirname directory 8615 hierarchy, rather than in the system default locale data base. 8616 8617 If dirname is not NULL, the base directory for message 8618 catalogs belonging to domain domainname shall be set to 8619 dirname. If dirname is NULL, the base directory for message 8620 catalogs shall not be altered. 8621 8622 The function shall make copies of the argument strings as 8623 needed. 8624 8625 dirname can be an absolute or relative pathname. 8626 8627 Note: Applications that wish to use chdir() should always 8628 use absolute pathnames to avoid misadvertently selecting 8629 the wrong or non-existant directory. 8630 8631 If domainname is the null pointer, or is an empty string, 8632 bindtextdomain() shall fail, but need not set errno. 8633 8634 The bindtextdomain() function shall return a pointer to a 8635 string containing the name of the selected directory. The 8636 string shall be allocated internally in the function and shall 8637 not be changed or freed by the user. 8638 8639 Return Value 8640 8641 On success, bindtextdomain() shall return a pointer to a 8642 string containing the directory pathname currently bound to 8643 the domain. On failure, a NULL pointer is returned, and the 8644 global variable errno may be set to indicate the error. 8645 8646 Errors 8647 8648 ENOMEM 8649 8650 Insufficient memory was available. 8651 8652 See Also 8653 8654 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8655 textdomain, bind_textdomain_codeset 8656 8657 cfmakeraw 8658 8659 Name 8660 8661 cfmakeraw -- get and set terminal attributes 8662 8663 Synopsis 8664 8665 #include 8666 8667 void cfmakeraw(struct termios * termios_p); 8668 8669 Description 8670 8671 The cfmakeraw() function shall set the attributes of the 8672 termios structure referenced by termios_p as follows: 8673 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 8674 |INLCR|IGNCR|ICRNL|IXON); 8675 8676 termios_p->c_oflag &= ~OPOST; 8677 8678 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 8679 8680 termios_p->c_cflag &= ~(CSIZE|PARENB); 8681 8682 termios_p->c_cflag |= CS8; 8683 8684 termios_p shall point to a termios structure that contains the 8685 following members: 8686 tcflag_t c_iflag; /* input modes */ 8687 tcflag_t c_oflag; /* output modes */ 8688 tcflag_t c_cflag; /* control modes */ 8689 tcflag_t c_lflag; /* local modes */ 8690 cc_t c_cc[NCCS]; /* control chars */ 8691 8692 cfsetspeed 8693 8694 Name 8695 8696 cfsetspeed -- set terminal input and output data rate 8697 8698 Synopsis 8699 8700 #include 8701 8702 int cfsetspeed(struct termios *t, speed_t speed); 8703 8704 Description 8705 8706 cfsetspeed() sets the baud rate values in the termios 8707 structure. The effects of the function on the terminal as 8708 described below do not become effective, nor are all errors 8709 detected, until the tcsetattr() function is called. Certain 8710 values for baud rates set in termios and passed to tcsetattr() 8711 have special meanings. 8712 8713 Getting and Setting the Baud Rate 8714 8715 Input and output baud rates are found in the termios 8716 structure. The unsigned integer speed_t is typdef'd in the 8717 include file termios.h. The value of the integer corresponds 8718 directly to the baud rate being represented; however, the 8719 following symbolic values are defined. 8720 #define B0 0 8721 #define B50 50 8722 #define B75 75 8723 #define B110 110 8724 #define B134 134 8725 #define B150 150 8726 #define B200 200 8727 #define B300 300 8728 #define B600 600 8729 #define B1200 1200 8730 #define B1800 1800 8731 #define B2400 2400 8732 #define B4800 4800 8733 #define B9600 9600 8734 #define B19200 19200 8735 #define B38400 38400 8736 #ifndef _POSIX_SOURCE 8737 #define EXTA 19200 8738 #define EXTB 38400 8739 #endif /*_POSIX_SOURCE */ 8740 8741 cfsetspeed() sets both the input and output baud rates in the 8742 termios structure referenced by t to speed. 8743 8744 Return Value 8745 8746 On success, 0 is returned. On error, -1 is returned and the 8747 global variable errno is set appropriately. 8748 8749 Errors 8750 8751 EINVAL 8752 8753 Invalid speed argument 8754 8755 daemon 8756 8757 Name 8758 8759 daemon -- run in the background 8760 8761 Synopsis 8762 8763 #include 8764 8765 int daemon(int nochdir, int noclose); 8766 8767 Description 8768 8769 The daemon() function shall create a new process, detached 8770 from the controlling terminal. If successful, the calling 8771 process shall exit and the new process shall continue to 8772 execute the application in the background. If nochdir 8773 evaluates to true, the current directory shall not be changed. 8774 Otherwise, daemon() shall change the current working directory 8775 to the root (`/'). If noclose evaluates to true the standard 8776 input, standard output, and standard error file descriptors 8777 shall not be altered. Otherwise, daemon() shall close the 8778 standard input, standard output and standard error file 8779 descriptors and reopen them attached to /dev/null. 8780 8781 Return Value 8782 8783 On error, -1 is returned, and the global variable errno is set 8784 to any of the errors specified for the library functions 8785 fork() and setsid(). 8786 8787 dcgettext 8788 8789 Name 8790 8791 dcgettext -- perform domain and category specific lookup in 8792 message catalog 8793 8794 Synopsis 8795 8796 #include 8797 #include 8798 8799 char * dcgettext(const char * domainname, const char * msgid, 8800 int category); 8801 8802 Description 8803 8804 The dcgettext() function is a domain specified version of 8805 gettext(). 8806 8807 The dcgettext() function shall lookup the translation in the 8808 current locale of the message identified by msgid in the 8809 domain specified by domainname and in the locale category 8810 specified by category. If domainname is NULL, the current 8811 default domain shall be used. The msgid argument shall be a 8812 NULL-terminated string to be matched in the catalogue. 8813 category shall specify the locale category to be used for 8814 retrieving message strings. The category parameter shall be 8815 one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, 8816 LC_NUMERIC, or LC_TIME. The default domain shall not be 8817 changed by a call to dcgettext(). 8818 8819 Return Value 8820 8821 If a translation was found in one of the specified catalogs, 8822 it shall be converted to the current locale's codeset and 8823 returned. The resulting NULL-terminated string shall be 8824 allocated by the dcgettext function, and must not be modified 8825 or freed. If no translation was found, or category was 8826 invalid, msgid shall be returned. 8827 8828 Errors 8829 8830 dcgettext() shall not modify the errno global variable. 8831 8832 See Also 8833 8834 gettext, dgettext, ngettext, dngettext, dcngettext, 8835 textdomain, bindtextdomain, bind_textdomain_codeset 8836 8837 dcngettext 8838 8839 Name 8840 8841 dcngettext -- perform domain and category specific lookup in 8842 message catalog with plural 8843 8844 Synopsis 8845 8846 #include 8847 #include 8848 8849 char * dcngettext(const char * domainname, const char * 8850 msgid1, const char * msgid2, unsigned long int n, int 8851 category); 8852 8853 Description 8854 8855 The dcngettext() function is a domain specific version of 8856 gettext, capable of returning either a singular or plural form 8857 of the message. The dcngettext() function shall lookup the 8858 translation in the current locale of the message identified by 8859 msgid1 in the domain specified by domainname and in the locale 8860 category specified by category. If domainname is NULL, the 8861 current default domain shall be used. The msgid1 argument 8862 shall be a NULL-terminated string to be matched in the 8863 catalogue. category shall specify the locale category to be 8864 used for retrieving message strings. The category parameter 8865 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, 8866 LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall 8867 not be changed by a call to dcngettext(). If n is 1 then the 8868 singular version of the message is returned, otherwise one of 8869 the plural forms is returned, depending on the value of n and 8870 the current locale settings. 8871 8872 Return Value 8873 8874 If a translation corresponding to the value of n was found in 8875 one of the specified catalogs for msgid1, it shall be 8876 converted to the current locale's codeset and returned. The 8877 resulting NULL-terminated string shall be allocated by the 8878 dcngettext() function, and must not be modified or freed. If 8879 no translation was found, or category was invalid, msgid1 8880 shall be returned if n has the value 1, otherwise msgid2 shall 8881 be returned. 8882 8883 Errors 8884 8885 dcngettext() shall not modify the errno global variable. 8886 8887 See Also 8888 8889 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 8890 bindtextdomain, bind_textdomain_codeset 8891 8892 dgettext 8893 8894 Name 8895 8896 dgettext -- perform lookup in message catalog for the current 8897 LC_MESSAGES locale 8898 8899 Synopsis 8900 8901 #include 8902 8903 char * dgettext(const char * domainname, const char * msgid); 8904 8905 Description 8906 8907 dgettext() is a domain specified version of gettext(). 8908 8909 The dgettext() function shall search the currently selected 8910 message catalogs in the domain domainname for a string 8911 identified by the string msgid. If a string is located, that 8912 string shall be returned. The domain specified by domainname 8913 applies to the currently active LC_MESSAGE locale. The default 8914 domain shall not be changed by a call to dgettext(). 8915 8916 Note: The usage of domainanme is equivalent in syntax and 8917 meaning to the textdomain() function's application of 8918 domainname, except that the selection of the domain in 8919 dgettext() is valid only for the duration of the call. 8920 8921 The dgettext() function is equivalent to dcgettext(domainname, 8922 msgid, LC_MESSAGES). 8923 8924 Return Value 8925 8926 On success of a msgid query, the translated NULL-terminated 8927 string is returned. On error, the original msgid is returned. 8928 The length of the string returned is undetermined until 8929 dgettext() is called. 8930 8931 Errors 8932 8933 dgettext() shall not modify the errno global variable. 8934 8935 See Also 8936 8937 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8938 textdomain, bindtextdomain, bind_textdomain_codeset 8939 8940 dngettext 8941 8942 Name 8943 8944 dngettext -- perform lookup in message catalog for the current 8945 locale 8946 8947 Synopsis 8948 8949 #include 8950 8951 char * dngettext(const char * domainname, const char * msgid1, 8952 const char * msgid2, unsigned long int n); 8953 8954 Description 8955 8956 dngettext() shall be equivalent to a call to 8957 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 8958 8959 See dcngettext() for more information. 8960 8961 See Also 8962 8963 gettext, dgettext, ngettext, dcgettext, dcngettext, 8964 textdomain, bindtextdomain, bind_textdomain_codeset 8965 8966 duplocale 8967 8968 Name 8969 8970 duplocale -- provide new handle for selection of locale 8971 8972 Synopsis 8973 8974 #include 8975 8976 locale_t duplocale(locale_t locale); 8977 8978 Description 8979 8980 The duplocale() function shall provide a new locale object 8981 based on the locale object provided in locale, suitable for 8982 use in the newlocale() or uselocale() functions. The new 8983 object may be released by calling freelocale(). 8984 8985 Return Value 8986 8987 On success, the duplocale() function shall return a locale 8988 object. Otherwise, it shall return NULL, and set errno to 8989 indicate the error. 8990 8991 Errors 8992 8993 The duplocale() function shall fail if: 8994 8995 ENOMEM 8996 8997 Insufficient memory. 8998 8999 See Also 9000 9001 setlocale(), freelocale(), newlocale(), uselocale() 9002 9003 err 9004 9005 Name 9006 9007 err -- display formatted error messages 9008 9009 Synopsis 9010 9011 #include 9012 9013 void err(int eval, const char * fmt, ...); 9014 9015 Description 9016 9017 The err() function shall display a formatted error message on 9018 the standard error stream. First, err() shall write the last 9019 component of the program name, a colon character, and a space 9020 character. If fmt is non-NULL, it shall be used as a format 9021 string for the printf() family of functions, and err() shall 9022 write the formatted message, a colon character, and a space. 9023 Finally, the error message string affiliated with the current 9024 value of the global variable errno shall be written, followed 9025 by a newline character. 9026 9027 The err() function shall not return, the program shall 9028 terminate with the exit value of eval. 9029 9030 See Also 9031 9032 error(), errx() 9033 9034 Return Value 9035 9036 None. 9037 9038 Errors 9039 9040 None. 9041 9042 error 9043 9044 Name 9045 9046 error -- print error message 9047 9048 Synopsis 9049 9050 #include 9051 9052 void error(int exitstatus, int errnum, const char * format, 9053 ...); 9054 9055 Description 9056 9057 error() shall print a message to standard error. 9058 9059 error() shall build the message from the following elements in 9060 their specified order: 9061 9062 1. the program name. If the application has provided a 9063 function named error_print_progname(), error() shall call 9064 this to supply the program name; otherwise, error() uses 9065 the content of the global variable program_name. 9066 2. the colon and space characters, then the result of using 9067 the printf-style format and the optional arguments. 9068 3. if errnum is nonzero, error() shall add the colon and 9069 space characters, then the result of strerror(errnum). 9070 4. a newline. 9071 9072 If exitstatus is nonzero, error() shall call exit(exitstatus). 9073 9074 See Also 9075 9076 err(), errx() 9077 9078 errx 9079 9080 Name 9081 9082 errx -- display formatted error message and exit 9083 9084 Synopsis 9085 9086 #include 9087 9088 void errx(int eval, const char * fmt, ...); 9089 9090 Description 9091 9092 The errx() function shall display a formatted error message on 9093 the standard error stream. The last component of the program 9094 name, a colon character, and a space shall be output. If fmt 9095 is non-NULL, it shall be used as the format string for the 9096 printf() family of functions, and the formatted error message, 9097 a colon character, and a space shall be output. The output 9098 shall be followed by a newline character. 9099 9100 errx() does not return, but shall exit with the value of eval. 9101 9102 Return Value 9103 9104 None. 9105 9106 Errors 9107 9108 None. 9109 9110 See Also 9111 9112 error(), err() 9113 9114 fcntl 9115 9116 Name 9117 9118 fcntl -- file control 9119 9120 Description 9121 9122 fcntl() is as specified in ISO POSIX (2003), but with 9123 differences as listed below. 9124 9125 Implementation may set O_LARGEFILE 9126 9127 According to ISO POSIX (2003), only an application sets 9128 fcntl() flags, for example O_LARGEFILE. However, this 9129 specification also allows an implementation to set the 9130 O_LARGEFILE flag in the case where the programming environment 9131 is one of _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 9132 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX 9133 (2003) for a description of these environments. Thus, calling 9134 fcntl() with the F_GETFL command may return O_LARGEFILE as 9135 well as flags explicitly set by the application in the case 9136 that both the implementation and the application support an 9137 off_t of at least 64 bits. 9138 9139 fflush_unlocked 9140 9141 Name 9142 9143 fflush_unlocked -- non thread safe fflush 9144 9145 Description 9146 9147 fflush_unlocked() is the same as fflush() except that it need 9148 not be thread safe. That is, it may only be invoked in the 9149 ways which are legal for getc_unlocked(). 9150 9151 fgetwc_unlocked 9152 9153 Name 9154 9155 fgetwc_unlocked -- non thread safe fgetwc 9156 9157 Description 9158 9159 fgetwc_unlocked() is the same as fgetwc() except that it need 9160 not be thread safe. That is, it may only be invoked in the 9161 ways which are legal for getc_unlocked(). 9162 9163 flock 9164 9165 Name 9166 9167 flock -- apply or remove an advisory lock on an open file 9168 9169 Synopsis 9170 9171 int flock(int fd, int operation); 9172 9173 Description 9174 9175 flock() applies or removes an advisory lock on the open file 9176 fd. Valid operation types are: 9177 9178 LOCK_SH 9179 9180 Shared lock. More than one process may hold a shared lock for 9181 a given file at a given time. 9182 LOCK_EX 9183 9184 Exclusive lock. Only one process may hold an exclusive lock 9185 for a given file at a given time. 9186 LOCK_UN 9187 9188 Unlock. 9189 LOCK_NB 9190 9191 Don't block when locking. May be specified (by oring) along 9192 with one of the other operations. 9193 9194 A single file may not simultaneously have both shared and 9195 exclusive locks. 9196 9197 Return Value 9198 9199 On success, 0 is returned. On error, -1 is returned and the 9200 global variable errno is set appropriately. 9201 9202 Errors 9203 9204 EWOULDBLOCK 9205 9206 The file is locked and the LOCK_NB flag was selected. 9207 9208 freelocale 9209 9210 Name 9211 9212 freelocale -- free a locale object 9213 9214 Synopsis 9215 9216 #include 9217 9218 void freelocale(locale_t locale); 9219 9220 Description 9221 9222 The freelocale() function shall free the locale object locale, 9223 and release any resources associated with it. 9224 9225 Return Value 9226 9227 None. 9228 9229 Errors 9230 9231 None defined. 9232 9233 See Also 9234 9235 setlocale(), newlocale(), duplocale(), uselocale() 9236 9237 fscanf 9238 9239 Name 9240 9241 fscanf -- convert formatted input 9242 9243 Description 9244 9245 The scanf() family of functions shall behave as described in 9246 ISO POSIX (2003), except as noted below. 9247 9248 Differences 9249 9250 The %s, %S and %[ conversion specifiers shall accept an option 9251 length modifier a, which shall cause a memory buffer to be 9252 allocated to hold the string converted. In such a case, the 9253 argument corresponding to the conversion specifier should be a 9254 reference to a pointer value that will receive a pointer to 9255 the allocated buffer. If there is insufficient memory to 9256 allocate a buffer, the function may set errno to ENOMEM and a 9257 conversion error results. 9258 9259 Note: This directly conflicts with the ISO C (1999) usage 9260 of %a as a conversion specifier for hexadecimal float 9261 values. While this conversion specifier should be 9262 supported, a format specifier such as "%aseconds" will have 9263 a different meaning on an LSB conforming system. 9264 9265 fwscanf 9266 9267 Name 9268 9269 fwscanf -- convert formatted input 9270 9271 Description 9272 9273 The scanf() family of functions shall behave as described in 9274 ISO POSIX (2003), except as noted below. 9275 9276 Differences 9277 9278 The %s, %S and %[ conversion specifiers shall accept an option 9279 length modifier a, which shall cause a memory buffer to be 9280 allocated to hold the string converted. In such a case, the 9281 argument corresponding to the conversion specifier should be a 9282 reference to a pointer value that will receive a pointer to 9283 the allocated buffer. If there is insufficient memory to 9284 allocate a buffer, the function may set errno to ENOMEM and a 9285 conversion error results. 9286 9287 Note: This directly conflicts with the ISO C (1999) usage 9288 of %a as a conversion specifier for hexadecimal float 9289 values. While this conversion specifier should be 9290 supported, a format specifier such as "%aseconds" will have 9291 a different meaning on an LSB conforming system. 9292 9293 getgrouplist 9294 9295 Name 9296 9297 getgrouplist -- get network group entry 9298 9299 Synopsis 9300 9301 #include 9302 9303 int getgrouplist(const char * user, gid_t group, gid_t * 9304 groups, int * ngroups); 9305 9306 Description 9307 9308 The getgrouplist() function shall fill in the array groups 9309 with the supplementary groups for the user specified by user. 9310 On entry, ngroups shall refer to an integer containing the 9311 maximum number of gid_t members in the groups array. The group 9312 group shall also be included. On success, the value referred 9313 to by ngroups shall be updated to contain the number of gid_t 9314 objects copied. 9315 9316 Return Value 9317 9318 On success, if there was sufficient room to copy all the 9319 supplementatry group identifiers to the array identified by 9320 groups, getgrouplist() shall return the number of gid_t 9321 objects copied, and the value referenced by ngroups shall be 9322 updated. If there was not sufficient room to copy all the 9323 supplementary group identifiers, grouplist() shall return -1, 9324 and update the value referenced by ngroups to the number 9325 actually copied. 9326 9327 If user does not refer to a valid user on the system, 9328 getgrouplist() shall return 0, and set the value referenced by 9329 ngroups to 0. 9330 9331 Errors 9332 9333 None defined. 9334 9335 See Also 9336 9337 getgroups() 9338 9339 getloadavg 9340 9341 Name 9342 9343 getloadavg -- get system load averages 9344 9345 Synopsis 9346 9347 #include 9348 9349 int getloadavg(double loadavg[], int nelem); 9350 9351 Description 9352 9353 getloadavg() returns the number of processes in the system run 9354 queue averaged over various periods of time. Up to nelem 9355 samples are retrieved and assigned to successive elements of 9356 loadavg[]. The system imposes a maximum of 3 samples, 9357 representing averages over the last 1, 5, and 15 minutes, 9358 respectively. 9359 9360 getopt 9361 9362 Name 9363 9364 getopt -- parse command line options 9365 9366 Synopsis 9367 9368 #include 9369 9370 int getopt(int argc, char * const argv[], const char * 9371 optstring); 9372 9373 extern char *optarg; 9374 extern int optind, opterr, optopt; 9375 9376 Description 9377 9378 The getopt() function shall parse command line arguments as 9379 described in ISO POSIX (2003), with the following exceptions, 9380 where LSB and POSIX specifications vary. LSB systems shall 9381 implement the modified behaviors described below. 9382 9383 Argument Ordering 9384 9385 The getopt() function can process command line arguments 9386 referenced by argv in one of three ways: 9387 9388 PERMUTE 9389 9390 the order of arguments in argv is altered so that all options 9391 (and their arguments) are moved in front of all of the 9392 operands. This is the default behavior. 9393 9394 Note: This behavior has undefined results if argv is not 9395 modifiable. This is to support historic behavior predating 9396 the use of const and ISO C (1999). The function prototype 9397 was aligned with ISO POSIX (2003) despite the fact that it 9398 modifies argv, and the library maintainers are unwilling to 9399 change this. 9400 9401 REQUIRE_ORDER 9402 9403 The arguments in argv are processed in exactly the order 9404 given, and option processing stops when the first non-option 9405 argument is reached, or when the element of argv is "--". This 9406 ordering can be enforced either by setting the environment 9407 variable POSIXLY_CORRECT, or by setting the first character of 9408 optstring to '+'. 9409 RETURN_IN_ORDER 9410 9411 The order of arguments is not altered, and all arguments are 9412 processed. Non-option arguments (operands) are handled as if 9413 they were the argument to an option with the value 1 ('\001'). 9414 This ordering is selected by setting the first character of 9415 optstring to '-'; 9416 9417 Option Characteristics 9418 9419 LSB specifies that: 9420 9421 * an element of argv that starts with "-" (and is not 9422 exactly "-" or "--") is an option element. 9423 * characters of an option element, aside from the initial 9424 "-", are option characters. 9425 9426 POSIX specifies that: 9427 9428 * applications using getopt() shall obey the following 9429 syntax guidelines: 9430 + option name is a single alphanumeric character from 9431 the portable character set 9432 + option is preceded by the '-' delimiter character 9433 + options without option-arguments should be accepted 9434 when grouped behind one '-' delimiter 9435 + each option and option-argument is a separate 9436 argument 9437 + option-arguments are not optional 9438 + all options should precede operands on the command 9439 line 9440 + the argument "--" is accepted as a delimiter 9441 indicating the end of options and the consideration 9442 of subsequent arguments, if any, as operands 9443 * historical implementations of getopt() support other 9444 characters as options as an allowed extension, but 9445 applications that use extensions are not maximally 9446 portable. 9447 * support for multi-byte option characters is only possible 9448 when such characters can be represented as type int. 9449 * applications that call any utility with a first operand 9450 starting with '-' should usually specify "--" to mark the 9451 end of the options. Standard utilities that do not support 9452 this guideline indicate that fact in the OPTIONS section 9453 of the utility description. 9454 9455 Extensions 9456 9457 LSB specifies that: 9458 9459 * if a character is followed by two colons, the option takes 9460 an optional argument; if there is text in the current argv 9461 element, it is returned in optarg, otherwise optarg is set 9462 to 0. 9463 * if optstring contains W followed by a semi-colon (;), then 9464 -W foo is treated as the long option --foo. 9465 9466 Note: See getopt_long() for a description of long options. 9467 * The first character of optstring shall modify the behavior 9468 of getopt() as follows: 9469 + if the first character is '+', then REQUIRE_ORDER 9470 processing shall be in effect (see above) 9471 + if the first character is '-', then RETURN_IN_ORDER 9472 processing shall be in effect (see above) 9473 + if the first character is ':', then getopt() shall 9474 return ':' instead of '?' to indicate a missing 9475 option argument, and shall not print any diagnostic 9476 message to stderr. 9477 9478 POSIX specifies that: 9479 9480 * the -W option is reserved for implementation extensions. 9481 9482 Return Values 9483 9484 LSB specifies the following additional getopt() return values: 9485 9486 * '\001' is returned if RETURN_IN_ORDER argument ordering is 9487 in effect, and the next argument is an operand, not an 9488 option. The argument is available in optarg. 9489 9490 Any other return value has the same meaning as for POSIX. 9491 9492 POSIX specifies the following getopt() return values: 9493 9494 * the next option character is returned, if found 9495 successfully. 9496 * ':' is returned if a parameter is missing for one of the 9497 options and the first character of optstring is ':'. 9498 * '?' is returned if an unknown option character not in 9499 optstring is encountered, or if getopt() detects a missing 9500 argument and the first character of optstring is not ':'. 9501 * -1 is returned for the end of the option list. 9502 9503 Environment Variables 9504 9505 LSB specifies that: 9506 9507 * if the variable POSIXLY_CORRECT is set, option processing 9508 stops as soon as a non-option argument is encountered. 9509 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 9510 is the process ID for the current process), contains a 9511 space separated list of arguments that should not be 9512 treated as arguments even though they appear to be so. 9513 9514 Rationale: This was used by bash 2.0 to communicate to GNU 9515 libc which arguments resulted from wildcard expansion and 9516 so should not be considered as options. This behavior was 9517 removed in bash version 2.01, but the support remains in 9518 GNU libc. 9519 This behavior is DEPRECATED in this version of the LSB; 9520 future revisions of this specification may not include 9521 this requirement. 9522 9523 getopt_long 9524 9525 Name 9526 9527 getopt_long -- parse command line options 9528 9529 Synopsis 9530 9531 #define _GNU_SOURCE 9532 #include 9533 9534 int getopt_long(int argc, char * const argv[], const char * 9535 opstring, const struct option * longopts, int * longindex); 9536 9537 Description 9538 9539 getopt_long() works like getopt() except that it also accepts 9540 long options, started out by two dashes. Long option names may 9541 be abbreviated if the abbreviation is unique or is an exact 9542 match for some defined option. A long option may take a 9543 parameter, of the form --arg=param or --arg param. 9544 9545 longopts is a pointer to the first element of an array of 9546 struct option declared in getopt.h as: 9547 struct option { 9548 const char *name; 9549 int has_arg; 9550 int *flag; 9551 int val; 9552 }; 9553 9554 The fields in this structure have the following meaning: 9555 9556 name 9557 9558 The name of the long option. 9559 has_arg 9560 9561 One of: 9562 9563 no_argument (or 0) if the option does not take an argument, 9564 required_argument (or 1) if the option requires an argument, 9565 or 9566 optional_argument (or 2) if the option takes an optional 9567 argument. 9568 9569 flag 9570 9571 specifies how results are returned for a long option. If flag 9572 is NULL, then getopt_long() shall return val. (For example, 9573 the calling program may set val to the equivalent short option 9574 character.) Otherwise, getopt_long() returns 0, and flag shall 9575 point to a variable which shall be set to val if the option is 9576 found, but left unchanged if the option is not found. 9577 val 9578 9579 The value to return, or to load into the variable pointed to 9580 by flag. 9581 9582 Return Value 9583 9584 getopt_long() returns the option character if a short option 9585 was found successfully, or ":" if there was a missing 9586 parameter for one of the options, or "?" for an unknown option 9587 character, or -1 for the end of the option list. 9588 9589 For a long option, getopt_long() returns val if flag is NULL, 9590 and 0 otherwise. Error and -1 returns are the same as for 9591 getopt(), plus "?" for an ambiguous match or an extraneous 9592 parameter. 9593 9594 getopt_long_only 9595 9596 Name 9597 9598 getopt_long_only -- parse command line options 9599 9600 Synopsis 9601 9602 #define _GNU_SOURCE 9603 #include 9604 9605 int getopt_long_only(int argc, char * const argv[], const char 9606 * optstring, const struct option * longopts, int * longindex); 9607 9608 Description 9609 9610 getopt_long_only() is like getopt_long(), but "-" as well as 9611 "--" can indicate a long option. If an option that starts with 9612 "-" (not "--") doesn't match a long option, but does match a 9613 short option, it is parsed as a short option instead. 9614 9615 Note: The getopt_long_only() function is intended only for 9616 supporting certain programs whose command line syntax was 9617 designed before the Utility Syntax Guidelines of ISO POSIX 9618 (2003) were developed. New programs should generally call 9619 getopt_long() instead, which provides the --option syntax 9620 for long options, which is preferred by GNU and consistent 9621 with ISO POSIX (2003). 9622 9623 Return Value 9624 9625 getopt_long_only() returns the option character if the option 9626 was found successfully, or ":" if there was a missing 9627 parameter for one of the options, or "?" for an unknown option 9628 character, or -1 for the end of the option list. 9629 9630 getopt_long_only() also returns the option character when a 9631 short option is recognized. For a long option, they return val 9632 if flag is NULL, and 0 otherwise. Error and -1 returns are the 9633 same as for getopt(), plus "?" for an ambiguous match or an 9634 extraneous parameter. 9635 9636 getsockopt 9637 9638 Name 9639 9640 getsockopt -- get socket options 9641 9642 Synopsis 9643 9644 #include 9645 #include 9646 9647 int getsockopt(int socket, int level, int option_name, void * 9648 restrict option_value, socklen_t * restrict option_len); 9649 9650 Description 9651 9652 The getsockopt() function shall behave as specified in ISO 9653 POSIX (2003), with the following extensions. 9654 9655 IP Protocol Level Options 9656 9657 If the level parameter is IPPROTO_IP, the following values 9658 shall be supported for option_name (see RFC 791:Internet 9659 Protocol for further details): 9660 9661 IP_OPTIONS 9662 9663 Get the Internet Protocol options sent with every packet from 9664 this socket. The option_value shall point to a memory buffer 9665 in which the options shall be placed; on entry option_len 9666 shall point to an integer value indicating the maximum size of 9667 the memory buffer, in bytes. On successful return, the value 9668 referenced by option_len shall be updated to the size of data 9669 copied to the buffer. For IPv4, the maximum length of options 9670 is 40 bytes. 9671 IP_TTL 9672 9673 Get the current unicast Internet Protocol Time To Live value 9674 used when sending packets with this socket. The option_value 9675 shall point to a buffer large enough to hold the time to live 9676 value (at least 1 byte), and option_len shall point to an 9677 integer value holding the maximum size of that buffer. On 9678 successful return, the value referenced by option_len shall be 9679 updated to contain the number of bytes copied into the buffer, 9680 which shall be no larger than the initial value, and 9681 option_value shall point to an integer containing the time to 9682 live value. 9683 IP_TOS 9684 9685 Get the Internet Protocol type of service indicator used when 9686 sending packets with this socket. The option_value shall point 9687 to a buffer large enough to hold the type of service indicator 9688 (at least 1 byte), and option_len shall point to an integer 9689 value holding the maximum size of that buffer. On successful 9690 return, the value referenced by option_len shall be updated to 9691 contain the number of bytes copied into the buffer, which 9692 shall be no larger than the initial value, and option_value 9693 shall point to an integer containing the time to live value. 9694 9695 gettext 9696 9697 Name 9698 9699 gettext -- search message catalogs for a string 9700 9701 Synopsis 9702 9703 #include 9704 9705 char * gettext(const char * msgid); 9706 9707 Description 9708 9709 The gettext() function shall search the currently selected 9710 message catalogs for a string identified by the string msgid. 9711 If a string is located, that string shall be returned. 9712 9713 The gettext() function is equivalent to dcgettext(NULL, msgid, 9714 LC_MESSAGES). 9715 9716 Return Value 9717 9718 If a string is found in the currently selected message 9719 catalogs for msgid, then a pointer to that string shall be 9720 returned. Otherwise, a pointer to msgid shall be returned. 9721 9722 Applications shall not modify the string returned by 9723 gettext(). 9724 9725 Errors 9726 9727 None. 9728 9729 The gettext() function shall not modify errno. 9730 9731 See Also 9732 9733 dgettext, ngettext, dngettext, dcgettext, dcngettext, 9734 textdomain, bindtextdomain, bind_textdomain_codeset 9735 9736 getutent 9737 9738 Name 9739 9740 getutent -- access user accounting database entries 9741 9742 Synopsis 9743 9744 #include 9745 9746 struct utmp *getutent(void); 9747 9748 Description 9749 9750 The getutent() function shall read the next entry from the 9751 user accounting database. 9752 9753 Return Value 9754 9755 Upon successful completion, getutent() shall return a pointer 9756 to a utmp structure containing a copy of the requested entry 9757 in the user accounting database. Otherwise, a null pointer 9758 shall be returned. The return value may point to a static area 9759 which is overwritten by a subsequent call to getutent(). 9760 9761 Errors 9762 9763 None defined. 9764 9765 getutent_r 9766 9767 Name 9768 9769 getutent_r -- access user accounting database entries 9770 9771 Synopsis 9772 9773 int getutent_r(struct utmp * buffer, struct utmp ** result); 9774 9775 Description 9776 9777 The getutent_r() function is a reentrant version of the 9778 getutent() function. On entry, buffer should point to a user 9779 supplied buffer to which the next entry in the database will 9780 be copied, and result should point to a location where the 9781 result will be stored. 9782 9783 Return Value 9784 9785 On success, getutent_r() shall return 0 and set the location 9786 referenced by result to a pointer to buffer. Otherwise, 9787 getutent_r() shall return -1 and set the location referenced 9788 by result to NULL. 9789 9790 glob64 9791 9792 Name 9793 9794 glob64 -- find pathnames matching a pattern (Large File 9795 Support) 9796 9797 Synopsis 9798 9799 #include 9800 9801 int glob64(const char * pattern, int flags, int (*errfunc) 9802 (const char *, int), glob64_t * pglob); 9803 9804 Description 9805 9806 The glob64() function is a large-file version of the glob() 9807 defined in ISO POSIX (2003). It shall search for pathnames 9808 matching pattern according to the rules used by the shell, 9809 /bin/sh. No tilde expansion or parameter substitution is done; 9810 see wordexp(). 9811 9812 The results of a glob64() call are stored in the structure 9813 pointed to by pglob, which is a glob64_t declared in glob.h 9814 with the following members: 9815 typedef struct 9816 { 9817 size_t gl_pathc; 9818 char **gl_pathv; 9819 size_t gl_offs; 9820 int gl_flags; 9821 void (*gl_closedir) (void *); 9822 struct dirent64 *(*gl_readdir64) (void *); 9823 void *(*gl_opendir) (const char *); 9824 int (*gl_lstat) (const char *, struct stat *); 9825 int (*gl_stat) (const char *, struct stat *); 9826 } 9827 glob64_t; 9828 9829 Structure members with the same name as corresponding members 9830 of a glob_t as defined in ISO POSIX (2003) shall have the same 9831 purpose. 9832 9833 Other members are defined as follows: 9834 9835 gl_flags 9836 9837 reserved for internal use 9838 gl_closedir 9839 9840 pointer to a function capable of closing a directory opened by 9841 gl_opendir 9842 gl_readdir64 9843 9844 pointer to a function capable of reading entries in a large 9845 directory 9846 gl_opendir 9847 9848 pointer to a function capable of opening a large directory 9849 gl_stat 9850 9851 pointer to a function capable of returning file status for a 9852 large file 9853 gl_lstat 9854 9855 pointer to a function capable of returning file status 9856 information for a large file or symbolic link 9857 9858 A large file or large directory is one with a size which 9859 cannot be represented by a variable of type off_t. 9860 9861 Return Value 9862 9863 On success, 0 is returned. Other possible returns are: 9864 9865 GLOB_NOSPACE 9866 9867 out of memory 9868 GLOB_ABORTED 9869 9870 read error 9871 GLOB_NOMATCH 9872 9873 no match found 9874 9875 globfree64 9876 9877 Name 9878 9879 globfree64 -- free memory from glob64() (Large File Support) 9880 9881 Synopsis 9882 9883 #include 9884 9885 void globfree64(glob64_t * pglob); 9886 9887 Description 9888 9889 globfree64() frees the dynamically allocated storage from an 9890 earlier call to glob64(). 9891 9892 globfree64() is a 64-bit version of globfree(). 9893 9894 initgroups 9895 9896 Name 9897 9898 initgroups -- initialize the supplementary group access list 9899 9900 Synopsis 9901 9902 #include 9903 #include 9904 9905 int initgroups(const char * user, gid_t group); 9906 9907 Description 9908 9909 If the process has appropriate privilege, the initgroups() 9910 function shall initialize the Supplementary Group IDs for the 9911 current process by reading the group database and using all 9912 groups of which user is a member. The additional group group 9913 is also added to the list. 9914 9915 Return Value 9916 9917 On success, 0 is returned. On error, -1 is returned and the 9918 global variable errno is set appropriately. 9919 9920 Errors 9921 9922 EPERM 9923 9924 The calling process does not have sufficient privileges. 9925 ENOMEM 9926 9927 Insufficient memory to allocate group information structure. 9928 9929 See Also 9930 9931 setgroups() 9932 9933 ioctl 9934 9935 Name 9936 9937 ioctl -- control device 9938 9939 Synopsis 9940 9941 #include 9942 9943 int ioctl (int fildes , int request , ...); 9944 9945 Description 9946 9947 The ioctl() function shall manipulate the underlying device 9948 parameters of special files. fildes shall be an open file 9949 descriptor referring to a special file. The ioctl() function 9950 shall take three parameters; the type and value of the third 9951 parameter is dependent on the device and request. 9952 9953 Conforming LSB applications shall not call ioctl() except in 9954 situations explicitly stated in this specification. 9955 9956 Return Value 9957 9958 On success, 0 is returned. An ioctl() may use the return value 9959 as an output parameter and return a non-negative value on 9960 success. On error, -1 is returned and the global variable 9961 errno is set appropriately. 9962 9963 Errors 9964 9965 EBADF 9966 9967 fildes is not a valid descriptor. 9968 EFAULT 9969 9970 The third parameter references an inaccessible memory area. 9971 ENOTTY 9972 9973 fildes is not associated with a character special device. 9974 ENOTTY 9975 9976 The specified request does not apply to the kind of object 9977 that fildes references. 9978 EINVAL 9979 9980 request or the third parameter is not valid. 9981 9982 Relationship to POSIX (Informative) 9983 9984 It should be noted that ISO POSIX (2003) contains an interface 9985 named ioctl(). The LSB only defines behavior when fildes 9986 refers to a socket (see sockio) or terminal device (see 9987 ttyio), while ISO POSIX (2003) only defines behavior when 9988 fildes refers to a STREAMS device. An implementation may 9989 support both behaviors; the LSB does not require any STREAMS 9990 support. 9991 9992 sockio 9993 9994 Name 9995 9996 sockio -- socket ioctl commands 9997 9998 Synopsis 9999 10000 #include 10001 #include 10002 #include 10003 #include 10004 10005 int ioctl(int sockfd, int request, void * argp); 10006 10007 Description 10008 10009 Socket ioctl() commands are a subset of the ioctl() calls, 10010 which can perform a variety of functions on sockets. sockfd 10011 shall be an open file descriptor referring to a socket (see 10012 the socket() or accept() functions). 10013 10014 Socket ioctl() commands apply to the underlying network 10015 interfaces, and affect the entire system, not just the file 10016 descriptor used to issue the ioctl(). 10017 10018 The following values for request are accepted: 10019 10020 SIOCGIFCONF (Deprecated) 10021 Get the interface configuration list for the system. 10022 10023 Note: The SIOCGIFCONF interface is superceded by the 10024 if_nameindex() family of functions (see ISO POSIX (2003)). 10025 A future version of this specification may withdraw this 10026 value for request. 10027 10028 argp shall point to a ifconf structure, as described in 10029 . Before calling, the caller shall set the 10030 ifc_ifcu.ifcu_req field to point to an array of ifreq 10031 structures, and set ifc_len to the size in bytes of 10032 this allocated array. Upon return, ifc_len will contain 10033 the size in bytes of the array which was actually used. 10034 If it is the same as the length upon calling, the 10035 caller should assume that the array was too small and 10036 try again with a larger array. 10037 10038 On success, SIOCGIFCONF shall return a nonnegative 10039 value. 10040 10041 Rationale: Historical UNIX systems disagree on the meaning 10042 of the return value. 10043 10044 SIOCGIFFLAGS 10045 Get the interface flags for the indicated interface. 10046 argp shall point to a ifreq structure. Before calling, 10047 the caller should fill in the ifr_name field with the 10048 interface name, and upon return, the 10049 ifr_ifru.ifru_flags field is set with the interface 10050 flags. 10051 10052 SIOCGIFADDR 10053 Get the interface address for the given interface. argp 10054 shall point to a ifreq structure. Before calling, the 10055 caller should fill in the ifr_name field with the 10056 interface name, and upon return, the ifr_ifru.ifru_addr 10057 field is set with the interface address. 10058 10059 SIOCGIFBRDADDR 10060 Get the interface broadcast address for the given 10061 interface. argp shall point to a ifreq structure. 10062 Before calling, the caller should fill in the ifr_name 10063 field with the interface name, and upon return, the 10064 ifr_ifru.ifru_broadcast field is set with the interface 10065 broadcast address. 10066 10067 SIOCGIFNETMASK 10068 Get the network mask for the given interface. argp 10069 shall point to a ifreq structure. Before calling, the 10070 caller should fill in the ifr_name field with the 10071 interface name, and upon return, the 10072 ifr_ifru.ifru_netmask field is set with the network 10073 mask. 10074 10075 SIOCGIFMTU 10076 Get the Maximum Transmission Unit (MTU) size for the 10077 given interface. argp shall point to a ifreq structure. 10078 Before calling, the caller should fill in the ifr_name 10079 field with the interface name, and upon return, the 10080 ifr_ifru.ifru_mtu field is set with the MTU. 10081 10082 FIONREAD 10083 Get the amount of queued unread data in the receive 10084 buffer. argp shall point to an integer where the result 10085 is to be placed. 10086 10087 Note: Some implementations may also support the use of 10088 FIONREAD on other types of file descriptor. However, the 10089 LSB only specifies its behavior for a socket related file 10090 descriptor. 10091 10092 Return Value 10093 10094 On success, if request is SIOCGIFCONF, a non-negative integer 10095 shall be returned. If request is not SIOCGIFCONF, on success 0 10096 is returned. On error, -1 is returned and the global variable 10097 errno is set appropriately. 10098 10099 Errors 10100 10101 EBADF 10102 10103 sockfd is not a valid descriptor. 10104 EFAULT 10105 10106 argp references an inaccessible memory area. 10107 ENOTTY 10108 10109 The specified request does not apply to the kind of object 10110 that the descriptor sockfd references. 10111 EINVAL 10112 10113 Either request or argp is invalid. 10114 ENOTCONN 10115 10116 The operation is only defined on a connected socket, but the 10117 socket wasn't connected. 10118 10119 ttyio 10120 10121 Name 10122 10123 ttyio -- tty ioctl commands 10124 10125 Synopsis 10126 10127 #include 10128 #include 10129 10130 int ioctl(int fd, unsigned long request, int * argp); 10131 10132 Description 10133 10134 Tty ioctl commands are a subset of the ioctl() calls, which 10135 can perform a variety of functions on tty devices. fd shall be 10136 an open file descriptor referring to a terminal device. 10137 10138 The following ioctl()s are provided: 10139 10140 TIOCGWINSZ 10141 10142 Get the size attributes of the terminal or pseudo-terminal 10143 identified by fd. On entry, argp shall reference a winsize 10144 structure. On return, the structure will have ws_row set to 10145 the number of rows of text (i.e. lines of text) that can be 10146 viewed on the device, and ws_col set to the number of columns 10147 (i.e. text width). 10148 10149 Note: The number of columns stored in ws_col assumes that 10150 the terminal device is using a mono-spaced font. 10151 10152 Return Value 10153 10154 On success, 0 is returned. On error, -1 is returned and the 10155 global variable errno is set appropriately. 10156 10157 Errors 10158 10159 EBADF 10160 10161 fd is not a valid descriptor. 10162 EFAULT 10163 10164 argp references an inaccessible memory area. 10165 EINVAL 10166 10167 request and argp are not valid. 10168 10169 kill 10170 10171 Name 10172 10173 kill -- send a signal 10174 10175 Synopsis 10176 10177 #include 10178 10179 int kill(pid_t pid, int sig); 10180 10181 Description 10182 10183 kill() is as specified in the ISO POSIX (2003), but with 10184 differences as listed below. 10185 10186 Process ID -1 doesn't affect calling process 10187 10188 If pid is specified as -1, sig shall not be sent to the 10189 calling process. Other than this, the rules in the ISO POSIX 10190 (2003) apply. 10191 10192 Rationale: This was a deliberate Linus decision after an 10193 unpopular experiment in including the calling process in 10194 the 2.5.1 kernel. See "What does it mean to signal 10195 everybody?", Linux Weekly News, 20 December 2001, 10196 http://lwn.net/2001/1220/kernel.php3 10197 10198 link 10199 10200 Name 10201 10202 link -- create a link to a file 10203 10204 Synopsis 10205 10206 #include 10207 10208 int link(const char * path1, const char * path2); 10209 10210 Description 10211 10212 The link() function shall behave as specified in ISO POSIX 10213 (2003), except with differences as listed below. 10214 10215 Need Not Follow Symlinks 10216 10217 ISO POSIX (2003) specifies that pathname resolution shall 10218 follow symbolic links during pathname resolution unless the 10219 function is required to act on the symbolic link itself, or 10220 certain arguments direct that the function act on the symbolic 10221 link itself. The link() function in ISO POSIX (2003) contains 10222 no such requirement to operate on a symbolic link. However, a 10223 conforming LSB implementation need not follow a symbolic link 10224 for the path1 argument. 10225 10226 mbsnrtowcs 10227 10228 Name 10229 10230 mbsnrtowcs -- convert a multibyte string to a wide character 10231 string 10232 10233 Synopsis 10234 10235 #include 10236 10237 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 10238 nms, size_t len, mbstate_t * ps); 10239 10240 Description 10241 10242 mbsnrtowcs() is like mbsrtowcs(), except that the number of 10243 bytes to be converted, starting at src, is limited to nms. 10244 10245 If dest is not a NULL pointer, mbsnrtowcs() converts at most 10246 nms bytes from the multibyte string src to a wide-character 10247 string starting at dest. At most, len wide characters are 10248 written to dest. The state ps is updated. 10249 10250 The conversion is effectively performed by repeatedly calling: 10251 10252 mbrtowc(dest, *src, n, ps) 10253 10254 where n is some positive number, as long as this call 10255 succeeds, and then incrementing dest by one and src by the 10256 number of bytes consumed. 10257 10258 The conversion can stop for three reasons: 10259 10260 * An invalid multibyte sequence has been encountered. In 10261 this case src is left pointing to the invalid multibyte 10262 sequence, (size_t)(-1) is returned, and errno is set to 10263 EILSEQ. 10264 * The nms limit forces a stop, or len non-L'\0' wide 10265 characters have been stored at dest. In this case, src is 10266 left pointing to the next multibyte sequence to be 10267 converted, and the number of wide characters written to 10268 dest is returned. 10269 * The multibyte string has been completely converted, 10270 including the terminating '\0' (which has the side effect 10271 of bringing back ps to the initial state). In this case, 10272 src is set to NULL, and the number of wide characters 10273 written to dest, excluding the terminating L'\0' 10274 character, is returned. 10275 10276 If dest is NULL, len is ignored, and the conversion proceeds 10277 as above, except that the converted wide characters are not 10278 written out to memory, and that no destination length limit 10279 exists. 10280 10281 In both of the above cases, if ps is a NULL pointer, a static 10282 anonymous state only known to mbsnrtowcs() is used instead. 10283 10284 The programmer shall ensure that there is room for at least 10285 len wide characters at dest. 10286 10287 Return Value 10288 10289 mbsnrtowcs() returns the number of wide characters that make 10290 up the converted part of the wide character string, not 10291 including the terminating null wide character. If an invalid 10292 multibyte sequence was encountered, (size_t)(-1) is returned, 10293 and the global variable errno is set to EILSEQ. 10294 10295 Notes 10296 10297 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 10298 of the current locale. 10299 10300 Passing NULL as ps is not multi-thread safe. 10301 10302 memmem 10303 10304 Name 10305 10306 memmem -- locate bytes 10307 10308 Synopsis 10309 10310 #define _GNU_SOURCE 10311 #include 10312 10313 void * memmem(const void * haystack, size_t haystacklen, const 10314 void * needle, size_t needlelen); 10315 10316 Description 10317 10318 memmem() finds the start of the first occurrence of the byte 10319 array referenced by needle of length needlelen in the memory 10320 area haystack of length haystacklen. 10321 10322 Return Value 10323 10324 memmem() returns a pointer to the beginning of the byte array, 10325 or NULL if the byte array is not found. 10326 10327 Notes 10328 10329 Earlier versions of the C library (prior to glibc 2.1) 10330 contained a memmem() with various problems, and application 10331 developers should treat this function with care. 10332 10333 memrchr 10334 10335 Name 10336 10337 memrchr -- scan memory for a character 10338 10339 Synopsis 10340 10341 #include 10342 10343 void * memrchr(const void * s, int c, size_t n); 10344 10345 Description 10346 10347 The memrchr() function shall locate the last occurence of c 10348 (converted to an unsigned char) in the initial n bytes (each 10349 interpreted as an unsigned char) of the object pointed to by 10350 s. 10351 10352 Return Value 10353 10354 The memrchr() shall return a pointer to the located byte, or a 10355 null pointer if the byte does not occur in the object. 10356 10357 Errors 10358 10359 No errors are defined. 10360 10361 See Also 10362 10363 memchr() 10364 10365 newlocale 10366 10367 Name 10368 10369 newlocale -- allocate a locale object 10370 10371 Synopsis 10372 10373 #include 10374 10375 locale_t newlocale(int category_mask, const char * locale, 10376 locale_t base); 10377 10378 Description 10379 10380 The newlocale() function shall initialize a locale object. If 10381 base is NULL, then newlocale() shall first allocate the 10382 object; otherwise it shall use the locale object referenced by 10383 base. 10384 10385 The object shall be initialized for the locale named by 10386 locale, and for the categories selected in category_mask. The 10387 category_mask value is a bitwise inclusive OR of the required 10388 LC_name_MASK values, or the value LC_ALL_MASK. 10389 10390 Return Value 10391 10392 On success, the newlocale() function shall return the 10393 initialized locale object. Otherwise, it shall return NULL, 10394 and set errno to indicate the error. 10395 10396 Errors 10397 10398 The newlocale() function shall fail if: 10399 10400 ENOMEM 10401 10402 Insufficient memory. 10403 EINVAL 10404 10405 An invalid category_mask was provided, or the locale was NULL. 10406 10407 Application Usage (Informative) 10408 10409 The only portable way to allocate a locale object is to call 10410 newlocale() with a NULL base. The allocated object may be 10411 reinitialized to a new locale by passing it back to 10412 newlocale(). The new object may be released by calling 10413 freelocale(). 10414 10415 See Also 10416 10417 setlocale(), freelocale(), duplocale(), uselocale() 10418 10419 ngettext 10420 10421 Name 10422 10423 ngettext -- search message catalogs for plural string 10424 10425 Synopsis 10426 10427 #include 10428 10429 char * ngettext(const char * msgid1, const char * msgid2, 10430 unsigned long int n); 10431 10432 Description 10433 10434 The ngettext() function shall search the currently selected 10435 message catalogs for a string matching the singular string 10436 msgid1. If a string is located, and if n is 1, that string 10437 shall be returned. If n is not 1, a pluralized version 10438 (dependent on n) of the string shall be returned. 10439 10440 The ngettext() function is equivalent to dcngettext(NULL, 10441 msgid1, msgid2, n, LC_MESSAGES)(). 10442 10443 Return Value 10444 10445 If a string is found in the currently selected message 10446 catalogs for msgid1, then if n is 1 a pointer to the located 10447 string shall be returned. If n is not 1, a pointer to an 10448 appropriately pluralized version of the string shall be 10449 returned. If no message could be found in the currently 10450 selected mesage catalogs, then if n is 1, a pointer to msgid1 10451 shall be returned, otherwise a pointer to msgid2 shall be 10452 returned. 10453 10454 Applications shall not modify the string returned by 10455 ngettext(). 10456 10457 Errors 10458 10459 None. 10460 10461 The ngettext() function shall not modify errno. 10462 10463 See Also 10464 10465 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 10466 textdomain, bindtextdomain, bind_textdomain_codeset 10467 10468 pmap_getport 10469 10470 Name 10471 10472 pmap_getport -- find the port number assigned to a service 10473 registered with a portmapper. 10474 10475 Synopsis 10476 10477 #include 10478 10479 u_short * pmap_getport(struct sockaddr_in * address, const 10480 u_long program, const u_long * version, u_int protocol); 10481 10482 Description 10483 10484 The pmap_getport() function shall return the port number 10485 assigned to a service registered with a RPC Binding service 10486 running on a given target system, using the protocol described 10487 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 10488 pmap_getport() function shall be called given the RPC program 10489 number program, the program version version, and transport 10490 protocol protocol. Conforming implementations shall support 10491 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 10492 shall specify the address of the system on which the 10493 portmapper to be contacted resides. The value of 10494 address->sin_port shall be ignored, and the standard value for 10495 the portmapper port shall always be used. 10496 10497 Note: Security and network restrictions may prevent a 10498 conforming application from contacting a remote RPC Binding 10499 Service. 10500 10501 Return Value 10502 10503 On success, the pmap_getport() function shall return the port 10504 number in host byte order of the RPC application registered 10505 with the remote portmapper. On failure, if either the program 10506 was not registered or the remote portmapper service could not 10507 be reached, the pmap_getport() function shall return 0. If the 10508 remote portmap service could not be reached, the status is 10509 left in the global variable rpc_createerr. 10510 10511 pmap_set 10512 10513 Name 10514 10515 pmap_set -- establishes mapping to machine's RPC Bind service. 10516 10517 Synopsis 10518 10519 #include 10520 10521 bool_t pmap_set(const u_long program, const u_long version, 10522 int protocol, u_short port); 10523 10524 Description 10525 10526 pmap_set() establishes a mapping between the triple 10527 [program,version,protocol] and port on the machine's RPC Bind 10528 service. The value of protocol is most likely IPPROTO_UDP or 10529 IPPROTO_TCP. Automatically done by svc_register(). 10530 10531 Return Value 10532 10533 pmap_set() returns non-zero if it suceeds, 0 otherwise. 10534 10535 pmap_unset 10536 10537 Name 10538 10539 pmap_unset -- destroys RPC Binding 10540 10541 Synopsis 10542 10543 #include 10544 10545 bool_t pmap_unset(u_long prognum, u_long versnum); 10546 10547 Description 10548 10549 As a user interface to the RPC Bind service, pmap_unset() 10550 destroys all mapping between the triple [prognum,versnum, *] 10551 and ports on the machine's RPC Bind service. 10552 10553 Return Value 10554 10555 pmap_unset() returns non-zero if it succeeds, zero otherwise. 10556 10557 psignal 10558 10559 Name 10560 10561 psignal -- print signal message 10562 10563 Synopsis 10564 10565 #include 10566 10567 void psignal(int sig, const char * s); 10568 10569 extern const char *const sys_siglist[] 10570 10571 Description 10572 10573 The psignal() function shall display a message on the stderr 10574 stream. If s is not the null pointer, and does not point to an 10575 empty string (e.g. "\0"), the message shall consist of the 10576 string s, a colon, a space, and a string describing the signal 10577 number sig; otherwise psignal() shall display only a message 10578 describing the signal number sig. If sig is invalid, the 10579 message displayed shall indicate an unknown signal. 10580 10581 The array sys_siglist holds the signal description strings 10582 indexed by signal number. 10583 10584 Return Value 10585 10586 psignal() returns no value. 10587 10588 regexec 10589 10590 Name 10591 10592 regexec -- regular expression matching 10593 10594 Description 10595 10596 The regexec() function shall behave as specified in ISO POSIX 10597 (2003), except with differences as listed below. 10598 10599 Differences 10600 10601 Certain aspects of regular expression matching are optional; 10602 see Internationalization and Regular Expressions. 10603 10604 scanf 10605 10606 Name 10607 10608 scanf -- convert formatted input 10609 10610 Description 10611 10612 The scanf() family of functions shall behave as described in 10613 ISO POSIX (2003), except as noted below. 10614 10615 Differences 10616 10617 The %s, %S and %[ conversion specifiers shall accept an option 10618 length modifier a, which shall cause a memory buffer to be 10619 allocated to hold the string converted. In such a case, the 10620 argument corresponding to the conversion specifier should be a 10621 reference to a pointer value that will receive a pointer to 10622 the allocated buffer. If there is insufficient memory to 10623 allocate a buffer, the function may set errno to ENOMEM and a 10624 conversion error results. 10625 10626 Note: This directly conflicts with the ISO C (1999) usage 10627 of %a as a conversion specifier for hexadecimal float 10628 values. While this conversion specifier should be 10629 supported, a format specifier such as "%aseconds" will have 10630 a different meaning on an LSB conforming system. 10631 10632 setbuffer 10633 10634 Name 10635 10636 setbuffer -- stream buffering operation 10637 10638 Synopsis 10639 10640 #include 10641 10642 void setbuffer(FILE * stream, char * buf, size_t size); 10643 10644 Description 10645 10646 setbuffer() is an alias for the call to setvbuf(). It works 10647 the same, except that the size of the buffer in setbuffer() is 10648 up to the caller, rather than being determined by the default 10649 BUFSIZ. 10650 10651 setgroups 10652 10653 Name 10654 10655 setgroups -- set list of supplementary group IDs 10656 10657 Synopsis 10658 10659 #include 10660 10661 int setgroups(size_t size, const gid_t * list); 10662 10663 Description 10664 10665 If the process has appropriate privilege, the setgroups() 10666 function shall set the supplementary group IDs for the current 10667 process. list shall reference an array of size group IDs. A 10668 process may have at most NGROUPS_MAX supplementary group IDs. 10669 10670 Return Value 10671 10672 On successful completion, 0 is returned. On error, -1 is 10673 returned and the errno is set to indicate the error. 10674 10675 Errors 10676 10677 EFAULT 10678 10679 list has an invalid address. 10680 EPERM 10681 10682 The process does not have appropriate privileges. 10683 EINVAL 10684 10685 size is greater than NGROUPS_MAX. 10686 10687 sethostname 10688 10689 Name 10690 10691 sethostname -- set host name 10692 10693 Synopsis 10694 10695 #include 10696 #include 10697 #include 10698 10699 int sethostname(const char * name, size_t len); 10700 10701 Description 10702 10703 If the process has appropriate privileges, the sethostname() 10704 function shall change the host name for the current macine. 10705 The name shall point to a null-terminated string of at most 10706 len bytes that holds the new hostname. 10707 10708 If the symbol HOST_NAME_MAX is defined, or if 10709 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 10710 this value shall represent the maximum length of the new 10711 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 10712 value shall represent the maximum length for the new hostname. 10713 If none of these values are defined, the maximum length shall 10714 be the size of the nodename field of the utsname structure. 10715 10716 Return Value 10717 10718 On success, 0 is returned. On error, -1 is returned and the 10719 global variable errno is set appropriately. 10720 10721 Errors 10722 10723 EINVAL 10724 10725 len is negative or larger than the maximum allowed size. 10726 EPERM 10727 10728 the process did not have appropriate privilege. 10729 EFAULT 10730 10731 name is an invalid address. 10732 10733 Rationale 10734 10735 ISO POSIX (2003) guarantees that: 10736 10737 Maximum length of a host name (not including the 10738 terminating null) as returned from the gethostname() 10739 function shall be at least 255 bytes. 10740 10741 The glibc C library does not currently define HOST_NAME_MAX, 10742 and although it provides the name _SC_HOST_NAME_MAX a call to 10743 sysconf() returns -1 and does not alter errno in this case 10744 (indicating that there is no restriction on the hostname 10745 length). However, the glibc manual idicates that some 10746 implementations may have MAXHOSTNAMELEN as a means of 10747 detecting the maximum length, while the Linux kernel at 10748 release 2.4 and 2.6 stores this hostname in the utsname 10749 structure. While the glibc manual suggests simply shortening 10750 the name until sethostname() succeeds, the LSB requires that 10751 one of the first four mechanisms works. Future versions of 10752 glibc may provide a more reasonable result from 10753 sysconf(_SC_HOST_NAME_MAX). 10754 10755 setsockopt 10756 10757 Name 10758 10759 setsockopt -- set socket options 10760 10761 Synopsis 10762 10763 #include 10764 #include 10765 10766 int setsockopt(int socket, int level, int option_name, const 10767 void * option_value, socklen_t option_len); 10768 10769 Description 10770 10771 The setsockopt() function shall behave as specified in ISO 10772 POSIX (2003), with the following extensions. 10773 10774 IP Protocol Level Options 10775 10776 If the level parameter is IPPROTO_IP, the following values 10777 shall be supported for option_name (see RFC 791:Internet 10778 Protocol for further details): 10779 10780 IP_OPTIONS 10781 10782 Set the Internet Protocol options sent with every packet from 10783 this socket. The option_value shall point to a memory buffer 10784 containing the options and option_len shall contain the size 10785 in bytes of that buffer. For IPv4, the maximum length of 10786 options is 40 bytes. 10787 IP_TOS 10788 10789 Set the Type of Service flags to use when sending packets with 10790 this socket. The option_value shall point to a value 10791 containing the type of service value. The least significant 10792 two bits of the value shall contain the new Type of Service 10793 indicator. Use of other bits in the value is unspecified. The 10794 option_len parameter shall hold the size, in bytes, of the 10795 buffer referred to by option_value. 10796 IP_TTL 10797 10798 Set the current unicast Internet Protocol Time To Live value 10799 used when sending packets with this socket. The option_value 10800 shall point to a value containing the time to live value, 10801 which shall be between 1 and 255. The option_len parameter 10802 shall hold the size, in bytes, of the buffer referred to by 10803 option_value. 10804 IP_MULTICAST_TTL 10805 10806 Sets the Time To Live value of outgoing multicast packets for 10807 this socket. optval shall point to an integer which contains 10808 the new TTL value. If the new TTL value is -1, the 10809 implementation should use an unspecified default TTL value. If 10810 the new TTL value is out of the range of acceptable values 10811 (0-255), setsockopt() shall return -1 and set errno to 10812 indicate the error. 10813 IP_MULTICAST_LOOP 10814 10815 Sets a boolean flag indicating whether multicast packets 10816 originating locally should be looped back to the local 10817 sockets. optval shall point to an integer which contains the 10818 new flag value. 10819 IP_ADD_MEMBERSHIP 10820 10821 Join a multicast group. optval shall point to a ip_mreq 10822 structure. Before calling, the caller should fill in the 10823 imr_multiaddr field with the multicast group address and the 10824 imr_address field with the address of the local interface. If 10825 imr_address is set to INADDR_ANY, then an appropriate 10826 interface is chosen by the system. 10827 IP_DROP_MEMBERSHIP 10828 10829 Leave a multicast group. optval shall point to a ip_mreq 10830 structure containing the same values as were used with 10831 IP_ADD_MEMBERSHIP. 10832 IP_MULTICAST_IF 10833 10834 Set the local device for a multicast socket. optval shall 10835 point to a ip_mreq structure initialized in the same manner as 10836 with IP_ADD_MEMBERSHIP. 10837 10838 The ip_mreq structure contains two struct in_addr fields: 10839 imr_multiaddr and imr_address. 10840 10841 Return Value 10842 10843 On success, 0 is returned. On error, -1 is returned and the 10844 global variable errno is set appropriately. 10845 10846 Errors 10847 10848 As defined in ISO POSIX (2003). 10849 10850 setutent 10851 10852 Name 10853 10854 setutent -- access user accounting database entries 10855 10856 Synopsis 10857 10858 #include 10859 10860 void setutent(void); 10861 10862 Description 10863 10864 The setutent() function shall reset the user accounting 10865 database such that the next call to getutent() shall return 10866 the first record in the database. It is recommended to call it 10867 before any of the other functions that operate on the user 10868 accounting databases (e.g. getutent()) 10869 10870 Return Value 10871 10872 None. 10873 10874 sigandset 10875 10876 Name 10877 10878 sigandset -- build a new signal set by combining the two input 10879 sets using logical AND 10880 10881 Synopsis 10882 10883 #include 10884 10885 int sigandset(sigset_t * set, const sigset_t * left, const 10886 sigset_t * right); 10887 10888 Description 10889 10890 The sigandset() shall combine the two signal sets referenced 10891 by left and right, using a logical AND operation, and shall 10892 place the result in the location referenced by set, The 10893 resulting signal set shall contain only signals that are in 10894 both the set referenced by left and the set referenced by 10895 right. 10896 10897 Return Value 10898 10899 On success, sigandset() shall return 0. Otherise, sigandset() 10900 shall return -1 and set errno to indicate the error. 10901 10902 Errors 10903 10904 EINVAL 10905 10906 One or more of set, left, or right was a null pointer. 10907 10908 See Also 10909 10910 sigorset() 10911 10912 sigisemptyset 10913 10914 Name 10915 10916 sigisemptyset -- check for empty signal set 10917 10918 Synopsis 10919 10920 #include 10921 10922 int sigisemptyset(const sigset_t * set); 10923 10924 Description 10925 10926 The sigisemptyset() function shall check for empty signal set 10927 referenced by set. 10928 10929 Return Value 10930 10931 The sigisemptyset() function shall return a positive non-zero 10932 value if the signal set referenced by set is empty, or zero if 10933 this set is empty. On error, sigisemptyset() shall return -1 10934 and set errno to indicate the error. 10935 10936 Errors 10937 10938 EINVAL 10939 10940 set is a null pointer. 10941 10942 sigorset 10943 10944 Name 10945 10946 sigorset -- build a new signal set by combining the two input 10947 sets using logical OR 10948 10949 Synopsis 10950 10951 #include 10952 10953 int sigorset(sigset_t * set, const sigset_t * left, const 10954 sigset_t * right); 10955 10956 Description 10957 10958 The sigorset() shall combine the two signal sets referenced by 10959 left and right, using a logical OR operation, and shall place 10960 the result in the location referenced by set, The resulting 10961 signal set shall contain only signals that are in either the 10962 set referenced by left or the set referenced by right. 10963 10964 Return Value 10965 10966 On success, sigorset() shall return 0. Otherise, sigorset() 10967 shall return -1 and set errno to indicate the error. 10968 10969 Errors 10970 10971 EINVAL 10972 10973 One or more of set, left, or right was a null pointer. 10974 10975 See Also 10976 10977 sigandset() 10978 10979 sigreturn 10980 10981 Name 10982 10983 sigreturn -- return from signal handler and cleanup stack 10984 frame 10985 10986 Synopsis 10987 10988 int sigreturn(struct sigcontext * scp); 10989 10990 Description 10991 10992 The sigreturn() function is used by the system to cleanup 10993 after a signal handler has returned. This function is not in 10994 the source standard; it is only in the binary standard. 10995 10996 Return Value 10997 10998 sigreturn() never returns. 10999 11000 sscanf 11001 11002 Name 11003 11004 sscanf -- convert formatted input 11005 11006 Description 11007 11008 The scanf() family of functions shall behave as described in 11009 ISO POSIX (2003), except as noted below. 11010 11011 Differences 11012 11013 The %s, %S and %[ conversion specifiers shall accept an option 11014 length modifier a, which shall cause a memory buffer to be 11015 allocated to hold the string converted. In such a case, the 11016 argument corresponding to the conversion specifier should be a 11017 reference to a pointer value that will receive a pointer to 11018 the allocated buffer. If there is insufficient memory to 11019 allocate a buffer, the function may set errno to ENOMEM and a 11020 conversion error results. 11021 11022 Note: This directly conflicts with the ISO C (1999) usage 11023 of %a as a conversion specifier for hexadecimal float 11024 values. While this conversion specifier should be 11025 supported, a format specifier such as "%aseconds" will have 11026 a different meaning on an LSB conforming system. 11027 11028 stime 11029 11030 Name 11031 11032 stime -- set time 11033 11034 Synopsis 11035 11036 #define _SVID_SOURCE 11037 #include 11038 11039 int stime(const time_t * t); 11040 11041 Description 11042 11043 If the process has appropriate privilege, the stime() function 11044 shall set the system's idea of the time and date. Time, 11045 referenced by t, is measured in seconds from the epoch 11046 (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 11047 11048 Return Value 11049 11050 On success, stime() shall return 0. Otherwise, stime() shall 11051 return -1 and errno shall be set to indicate the error. 11052 11053 Errors 11054 11055 EPERM 11056 11057 The process does not have appropriate privilege. 11058 EINVAL 11059 11060 t is a null pointer. 11061 11062 stpcpy 11063 11064 Name 11065 11066 stpcpy -- copy a string returning a pointer to its end 11067 11068 Synopsis 11069 11070 #include 11071 11072 char * stpcpy(char * restrict dest, const char * restrict 11073 src); 11074 11075 Description 11076 11077 The stpcpy() function shall copy the string pointed to by src 11078 (including the terminating null character) to the array 11079 pointed to by dest. The strings may not overlap, and the 11080 destination string dest shall be large enough to receive the 11081 copy. 11082 11083 Return Value 11084 11085 stpcpy() returns a pointer to the end of the string dest (that 11086 is, the address of the terminating null character) rather than 11087 the beginning. 11088 11089 Example 11090 11091 This program uses stpcpy() to concatenate foo and bar to 11092 produce foobar, which it then prints. 11093 #include 11094 11095 int 11096 main (void) 11097 { 11098 char buffer[256]; 11099 char *to = buffer; 11100 to = stpcpy (to, "foo"); 11101 to = stpcpy (to, "bar"); 11102 printf ("%s\n", buffer); 11103 } 11104 11105 stpncpy 11106 11107 Name 11108 11109 stpncpy -- copy a fixed-size string, returning a pointer to 11110 its end 11111 11112 Synopsis 11113 11114 #include 11115 11116 char * stpncpy(char * restrict dest, const char * restrict 11117 src, size_t n); 11118 11119 Description 11120 11121 The stpncpy() function shall copy at most n characters from 11122 the string pointed to by src, including the terminating null 11123 character, to the array pointed to by dest. Exactly n 11124 characters are written at dest. If the length strlen()(src) is 11125 smaller than n, the remaining characters in dest are filled 11126 with '\0' characters. If the length strlen(src) is greater 11127 than or equal to n, dest will not be null terminated. 11128 11129 The strings may not overlap. 11130 11131 The programmer shall ensure that there is room for at least n 11132 characters at dest. 11133 11134 Return Value 11135 11136 The stpncpy() function shall return a pointer to the 11137 terminating NULL in dest, or, if dest is not NULL-terminated, 11138 dest + n. 11139 11140 strcasestr 11141 11142 Name 11143 11144 strcasestr -- locate a substring ignoring case 11145 11146 Synopsis 11147 11148 #include 11149 11150 char * strcasestr(const char * s1, const char * s2); 11151 11152 Description 11153 11154 The strcasestr() shall behave as strstr(), except that it 11155 shall ignore the case of both strings. The strcasestr() 11156 function shall be locale aware; that is strcasestr() shall 11157 behave as if both strings had been converted to lower case in 11158 the current locale before the comparison is performed. 11159 11160 Return Value 11161 11162 Upon successful completion, strcasestr() shall return a 11163 pointer to the located string or a null pointer if the string 11164 is not found. If s2 points to a string with zero length, the 11165 function shall return s1. 11166 11167 strerror_r 11168 11169 Name 11170 11171 strerror_r -- reentrant version of strerror 11172 11173 Synopsis 11174 11175 #include 11176 11177 char * strerror_r(int errnum, char * buf, size_t buflen); 11178 11179 Description 11180 11181 The strerror_r() shall behave as specified in ISO POSIX 11182 (2003), except as described below. 11183 11184 Returns String, not Error Value 11185 11186 The strerror_r() function shall return a pointer to the string 11187 corresponding to errno. The returned pointer may point within 11188 the buffer buf (at most buflen bytes). 11189 11190 Return Value 11191 11192 On success, strerror_r() shall return a pointer to the 11193 generated message string (determined by the setting of the 11194 LC_MESSAGES category in the current locale). Otherwise, 11195 strerror_r() shall return the string corresponding to "Unknown 11196 error". 11197 11198 strndup 11199 11200 Name 11201 11202 strndup -- return a malloc'd copy of at most the specified 11203 number of bytes of a string 11204 11205 Synopsis 11206 11207 #include 11208 11209 char * strndup(const char * string, size_t n); 11210 11211 Description 11212 11213 The strndup() function shall return a malloc()'d copy of at 11214 most n bytes of string. The resultant string shall be 11215 terminated even if no NULL terminator appears before string+n. 11216 11217 Return Value 11218 11219 On success, strndup() shall return a pointer to a newly 11220 allocated block of memory containing a copy of at most n bytes 11221 of string. Otherwise, strndup() shall return NULL and set 11222 errno to indicate the error. 11223 11224 Errors 11225 11226 ENOMEM 11227 11228 Insufficient memory available. 11229 11230 strnlen 11231 11232 Name 11233 11234 strnlen -- determine the length of a fixed-size string 11235 11236 Synopsis 11237 11238 #include 11239 11240 size_t strnlen(const char * s, size_t maxlen); 11241 11242 Description 11243 11244 strnlen() returns the number of characters in the string s, 11245 not including the terminating \0 character, but at most 11246 maxlen. In doing this, strnlen() looks only at the first 11247 maxlen characters at s and never beyond s + maxlen. 11248 11249 Return Value 11250 11251 strnlen() returns strlen(s), if that is less than maxlen, or 11252 maxlen if there is no \0 character among the first maxlen 11253 characters pointed to by s. 11254 11255 strptime 11256 11257 Name 11258 11259 strptime -- parse a time string 11260 11261 Description 11262 11263 The strptime() shall behave as specified in the ISO POSIX 11264 (2003) with differences as listed below. 11265 11266 Number of leading zeroes may be limited 11267 11268 The ISO POSIX (2003) specifies fields for which "leading zeros 11269 are permitted but not required"; however, applications shall 11270 not expect to be able to supply more leading zeroes for these 11271 fields than would be implied by the range of the field. 11272 Implementations may choose to either match an input with 11273 excess leading zeroes, or treat this as a non-matching input. 11274 For example, %j has a range of 001 to 366, so 0, 00, 000, 001, 11275 and 045 are acceptable inputs, but inputs such as 0000, 0366 11276 and the like are not. 11277 11278 Rationale 11279 11280 glibc developers consider it appropriate behavior to forbid 11281 excess leading zeroes. When trying to parse a given input 11282 against several format strings, forbidding excess leading 11283 zeroes could be helpful. For example, if one matches 11284 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it 11285 seems useful for the first match to fail, as it would be 11286 perverse to parse that date as November 12, year 26. The 11287 second pattern parses it as December 26, year 11. 11288 11289 The ISO POSIX (2003) is not explicit that an unlimited number 11290 of leading zeroes are required, although it may imply this. 11291 The LSB explicitly allows implementations to have either 11292 behavior. Future versions of this standard may require 11293 implementations to forbid excess leading zeroes. 11294 11295 An Interpretation Request is currently pending against ISO 11296 POSIX (2003) for this matter. 11297 11298 strsep 11299 11300 Name 11301 11302 strsep -- extract token from string 11303 11304 Synopsis 11305 11306 #include 11307 11308 char * strsep(char * * stringp, const char * delim); 11309 11310 Description 11311 11312 The strsep() function shall find the first token in the string 11313 referenced by the pointer stringp, using the characters in 11314 delim as delimiters. 11315 11316 If stringp is NULL, strsep() shall return NULL and do nothing 11317 else. 11318 11319 If stringp is non-NULL, strsep() shall find the first token in 11320 the string referenced by stringp, where tokens are delimited 11321 by characters in the string delim. This token shall be 11322 terminated with a \0 character by overwriting the delimiter, 11323 and stringp shall be updated to point past the token. In case 11324 no delimiter was found, the token is taken to be the entire 11325 string referenced by stringp, and the location referenced by 11326 stringp is made NULL. 11327 11328 Return Value 11329 11330 strsep() shall return a pointer to the beginning of the token. 11331 11332 Notes 11333 11334 The strsep() function was introduced as a replacement for 11335 strtok(), since the latter cannot handle empty fields. 11336 However, strtok() conforms to ISO C (1999) and to ISO POSIX 11337 (2003) and hence is more portable. 11338 11339 See Also 11340 11341 strtok(), strtok_r(). 11342 11343 strsignal 11344 11345 Name 11346 11347 strsignal -- return string describing signal 11348 11349 Synopsis 11350 11351 #define _GNU_SOURCE 11352 #include 11353 11354 char * strsignal(int sig); 11355 11356 extern const char * const sys_siglist[]; 11357 11358 Description 11359 11360 The strsignal() function shall return a pointer to a string 11361 describing the signal number sig. The string can only be used 11362 until the next call to strsignal(). 11363 11364 The array sys_siglist holds the signal description strings 11365 indexed by signal number. This array should not be accessed 11366 directly by applications. 11367 11368 Return Value 11369 11370 If sig is a valid signal number, strsignal() shall return a 11371 pointer to the appropriate description string. Otherwise, 11372 strsignal() shall return either a pointer to the string 11373 "unknown signal", or a null pointer. 11374 11375 Although the function is not declared as returning a pointer 11376 to a constant character string, applications shall not modify 11377 the returned string. 11378 11379 strtoq 11380 11381 Name 11382 11383 strtoq -- convert string value to a long or quad_t integer 11384 11385 Synopsis 11386 11387 #include 11388 #include 11389 #include 11390 11391 long long strtoq(const char * nptr, char * * endptr, int 11392 base); 11393 11394 Description 11395 11396 strtoq() converts the string nptr to a quadt value. The 11397 conversion is done according to the given base, which shall be 11398 between 2 and 36 inclusive, or be the special value 0. 11399 11400 nptr may begin with an arbitrary amount of white space (as 11401 determined by isspace()), followed by a single optional + or - 11402 sign character. If base is 0 or 16, the string may then 11403 include a 0x prefix, and the number will be read in base 16; 11404 otherwise, a 0 base is taken as 10 (decimal), unless the next 11405 character is 0, in which case it is taken as 8 (octal). 11406 11407 The remainder of the string is converted to a long value in 11408 the obvious manner, stopping at the first character which is 11409 not a valid digit in the given base. (In bases above 10, the 11410 letter A in either upper or lower case represents 10, B 11411 represents 11, and so forth, with Z representing 35.) 11412 11413 Return Value 11414 11415 strtoq() returns the result of the conversion, unless the 11416 value would underflow or overflow. If an underflow occurs, 11417 strtoq() returns QUAD_MIN. If an overflow occurs, strtoq() 11418 returns QUAD_MAX. In both cases, the global variable errno is 11419 set to ERANGE. 11420 11421 Errors 11422 11423 ERANGE 11424 11425 The given string was out of range; the value converted has 11426 been clamped. 11427 11428 strtouq 11429 11430 Name 11431 11432 strtouq -- convert a string to an unsigned long long 11433 11434 Synopsis 11435 11436 #include 11437 #include 11438 #include 11439 11440 unsigned long long strtouq(const char * nptr, char * * endptr, 11441 int base); 11442 11443 Description 11444 11445 strtouq() converts the string nptr to an unsigned long long 11446 value. The conversion is done according to the given base, 11447 which shall be between 2 and 36 inclusive, or be the special 11448 value 0. 11449 11450 nptr may begin with an arbitrary amount of white space (as 11451 determined by isspace()), followed by a single optional + or - 11452 sign character. If base is 0 or 16, the string may then 11453 include a 0x prefix, and the number will be read in base 16; 11454 otherwise, a 0 base is taken as 10 (decimal), unless the next 11455 character is 0, in which case it is taken as 8 (octal). 11456 11457 The remainder of the string is converted to an unsigned long 11458 value in the obvious manner, stopping at the end of the string 11459 or at the first character that does not produce a valid digit 11460 in the given base. (In bases above 10, the letter A in either 11461 upper or lower case represents 10, B represents 11, and so 11462 forth, with Z representing 35.) 11463 11464 Return Value 11465 11466 On success, strtouq() returns either the result of the 11467 conversion or, if there was a leading minus sign, the negation 11468 of the result of the conversion, unless the original 11469 (non-negated) value would overflow. In the case of an overflow 11470 the function returns UQUAD_MAX and the global variable errno 11471 is set to ERANGE. 11472 11473 Errors 11474 11475 ERANGE 11476 11477 The given string was out of range; the value converted has 11478 been clamped. 11479 11480 svc_register 11481 11482 Name 11483 11484 svc_register -- register Remote Procedure Call interface 11485 11486 Synopsis 11487 11488 #include 11489 11490 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 11491 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 11492 protocol); 11493 11494 Description 11495 11496 The svc_register() function shall associate the program 11497 identified by prognum at version versnum with the service 11498 dispatch procedure, dispatch. If protocol is zero, the service 11499 is not registered with the portmap service. If protocol is 11500 non-zero, then a mapping of the triple [prognum, versnum, 11501 protocol] to xprt->xp_port is established with the local 11502 portmap service. The procedure dispatch has the following 11503 form: 11504 11505 int dispatch(struct svc_req * request, SVCXPRT * xprt); 11506 11507 Return Value 11508 11509 svc_register() returns 1 if it succeeds, and zero otherwise. 11510 11511 svc_run 11512 11513 Name 11514 11515 svc_run -- waits for RPC requests to arrive and calls service 11516 procedure 11517 11518 Synopsis 11519 11520 #include 11521 11522 void svc_run(void); 11523 11524 Description 11525 11526 The svc_run() function shall wait for RPC requests to arrive, 11527 read and unpack each request, and dispatch it to the 11528 appropriate registered handler. Under normal conditions, 11529 svc_run() shall not return; it shall only return if serious 11530 errors occur that prevent further processing. 11531 11532 svc_sendreply 11533 11534 Name 11535 11536 svc_sendreply -- called by RPC service's dispatch routine 11537 11538 Synopsis 11539 11540 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 11541 out); 11542 11543 Description 11544 11545 Called by an RPC service's dispatch routine to send the 11546 results of a remote procedure call. The parameter xprt is the 11547 request's associated transport handle; outproc is the XDR 11548 routine which is used to encode the results; and out is the 11549 address of the results. This routine returns one if it 11550 succeeds, zero other-wise. 11551 11552 svctcp_create 11553 11554 Name 11555 11556 svctcp_create -- create a TCP/IP-based RPC service transport 11557 11558 Synopsis 11559 11560 #include 11561 11562 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 11563 recv_buf_size); 11564 11565 Description 11566 11567 svctcp_create() cretes a TCP/IP-based RPC service transport, 11568 to which it returns a pointer. The transport is associated 11569 with the socket sock, which may be RPC_ANYSOCK, in which case 11570 a new socket is created. If the socket is not bound to a local 11571 TCP port, then this routine binds it to an arbitrary port. 11572 Upon completion, xprt->xp_sock is the transport's socket 11573 descriptor, and xprt->xp_port is the transport's port number. 11574 Since TCP-based RPC uses buffered I/O, users may specify the 11575 size of buffers; values of zero choose suitable defaults. 11576 11577 Return Value 11578 11579 svctcp_create() returns NULL if it fails, or a pointer to the 11580 RPC service transport otherwise. 11581 11582 svcudp_create 11583 11584 Name 11585 11586 svcudp_create -- create a UDP-based RPC service transport 11587 11588 Synopsis 11589 11590 SVCXPRT * 11591 11592 svcudp_create(int sock); 11593 11594 Description 11595 11596 This call is equivalent to svcudp_bufcreate( sock, SZ, SZ) for 11597 some default size SZ. 11598 11599 swscanf 11600 11601 Name 11602 11603 swscanf -- convert formatted input 11604 11605 Description 11606 11607 The scanf() family of functions shall behave as described in 11608 ISO POSIX (2003), except as noted below. 11609 11610 Differences 11611 11612 The %s, %S and %[ conversion specifiers shall accept an option 11613 length modifier a, which shall cause a memory buffer to be 11614 allocated to hold the string converted. In such a case, the 11615 argument corresponding to the conversion specifier should be a 11616 reference to a pointer value that will receive a pointer to 11617 the allocated buffer. If there is insufficient memory to 11618 allocate a buffer, the function may set errno to ENOMEM and a 11619 conversion error results. 11620 11621 Note: This directly conflicts with the ISO C (1999) usage 11622 of %a as a conversion specifier for hexadecimal float 11623 values. While this conversion specifier should be 11624 supported, a format specifier such as "%aseconds" will have 11625 a different meaning on an LSB conforming system. 11626 11627 system 11628 11629 Name 11630 11631 system -- execute a shell command 11632 11633 Synopsis 11634 11635 #include 11636 11637 int system(const char * string); 11638 11639 Description 11640 11641 The system() function shall behave as described in ISO POSIX 11642 (2003). 11643 11644 Notes 11645 11646 The fact that system() ignores interrupts is often not what a 11647 program wants. ISO POSIX (2003) describes some of the 11648 consequences; an additional consequence is that a program 11649 calling system() from a loop cannot be reliably interrupted. 11650 Many programs will want to use the exec() family of functions 11651 instead. 11652 11653 Do not use system() from a program with suid or sgid 11654 privileges, because unexpected values for some environment 11655 variables might be used to subvert system integrity. Use the 11656 exec() family of functions instead, but not execlp() or 11657 execvp(). system() will not, in fact, work properly from 11658 programs with suid or sgid privileges on systems on which 11659 /bin/sh is bash version 2, since bash 2 drops privileges on 11660 startup. (Debian uses a modified bash which does not do this 11661 when invoked as sh.) 11662 11663 The check for the availability of /bin/sh is not actually 11664 performed; it is always assumed to be available. ISO C (1999) 11665 specifies the check, but ISO POSIX (2003) specifies that the 11666 return shall always be nonzero, since a system without the 11667 shell is not conforming, and it is this that is implemented. 11668 11669 It is possible for the shell command to return 127, so that 11670 code is not a sure indication that the execve() call failed; 11671 check the global variable errno to make sure. 11672 11673 textdomain 11674 11675 Name 11676 11677 textdomain -- set the current default message domain 11678 11679 Synopsis 11680 11681 #include 11682 11683 char * textdomain(const char * domainname); 11684 11685 Description 11686 11687 The textdomain() function shall set the current default 11688 message domain to domainname. Subsequent calls to gettext() 11689 and ngettext() use the default message domain. 11690 11691 If domainname is NULL, the default message domain shall not be 11692 altered. 11693 11694 If domainname is "", textdomain() shall reset the default 11695 domain to the system default of "messages". 11696 11697 Return 11698 11699 On success, textdomain() shall return the currently selected 11700 domain. Otherwise, a null pointer shall be returned, and errno 11701 is set to indicate the error. 11702 11703 Errors 11704 11705 ENOMEM 11706 11707 Insufficent memory available. 11708 11709 unlink 11710 11711 Name 11712 11713 unlink -- remove a directory entry 11714 11715 Synopsis 11716 11717 int unlink(const char * path); 11718 11719 Description 11720 11721 unlink() is as specified in ISO POSIX (2003), but with 11722 differences as listed below. 11723 11724 See also Section 18.1, Additional behaviors: unlink/link on 11725 directory. 11726 11727 May return EISDIR on directories 11728 11729 If path specifies a directory, the implementation may return 11730 EISDIR instead of EPERM as specified by ISO POSIX (2003). 11731 11732 Rationale: The Linux kernel has deliberately chosen EISDIR 11733 for this case and does not expect to change. 11734 11735 uselocale 11736 11737 Name 11738 11739 uselocale -- set locale for thread 11740 11741 Synopsis 11742 11743 #include 11744 11745 locale_t uselocale(locale_t newloc); 11746 11747 Description 11748 11749 The uselocale() function shall set the locale for the calling 11750 thread to the locale specified by newloc. 11751 11752 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 11753 shall be set to the process current global locale, as set by 11754 setlocale(). If newloc is NULL, the thread's locale is not 11755 altered. 11756 11757 Return Value 11758 11759 The uselocale() function shall return the previous locale, or 11760 LC_GLOBAL_LOCALE if the thread local locale has not been 11761 previously set. 11762 11763 Errors 11764 11765 None defined. 11766 11767 See Also 11768 11769 setlocale(), freelocale(), duplocale(), newlocale() 11770 11771 utmpname 11772 11773 Name 11774 11775 utmpname -- set user accounting database 11776 11777 Synopsis 11778 11779 #include 11780 11781 int utmpname(const char * dbname); 11782 11783 Description 11784 11785 The utmpname() function shall cause the user accounting 11786 database used by the getutent(), getutent_r(), getutxent(), 11787 getutxid(), getutxline(), and pututxline() functions to be 11788 that named by dbname, instead of the system default database. 11789 See Section 16.3 for further information. 11790 11791 Note: The LSB does not specify the format of the user 11792 accounting database, nor the names of the file or files 11793 that may contain it. 11794 11795 Return Value 11796 11797 None. 11798 11799 Errors 11800 11801 None defined. 11802 11803 vasprintf 11804 11805 Name 11806 11807 vasprintf -- write formatted output to a dynamically allocated 11808 string 11809 11810 Synopsis 11811 11812 #include 11813 #include 11814 11815 int vasprintf(char * * restrict ptr, const char * restrict 11816 format, va_list arg); 11817 11818 Description 11819 11820 The vasprintf() function shall write formatted output to a 11821 dynamically allocated string, and store the address of that 11822 string in the location referenced by ptr. It shall behave as 11823 asprintf(), except that instead of being called with a 11824 variable number of arguments, it is called with an argument 11825 list as defined by . 11826 11827 Return Value 11828 11829 Refer to fprintf(). 11830 11831 Errors 11832 11833 Refer to fprintf(). 11834 11835 vdprintf 11836 11837 Name 11838 11839 vdprintf -- write formatted output to a file descriptor 11840 11841 Synopsis 11842 11843 #include 11844 11845 int vdprintf(int fd, const char * restrict format, va_list 11846 arg); 11847 11848 Description 11849 11850 The vdprintf() function shall behave as vfprintf(), except 11851 that vdprintf() shall write output to the file associated with 11852 the file descriptor specified by the fd argument, rather than 11853 place output on a stream (as defined by ISO POSIX (2003)). 11854 11855 Return Value 11856 11857 Refer to fprintf(). 11858 11859 Errors 11860 11861 Refer to fprintf(). 11862 11863 verrx 11864 11865 Name 11866 11867 verrx -- display formatted error message and exit 11868 11869 Synopsis 11870 11871 #include 11872 #include 11873 11874 void verrx(int eval, const char * fmt, va_list args); 11875 11876 Description 11877 11878 The verrx() shall behave as errx() except that instead of 11879 being called with a variable number of arguments, it is called 11880 with an argument list as defined by . 11881 11882 verrx() does not return, but exits with the value of eval. 11883 11884 Return Value 11885 11886 None. 11887 11888 Errors 11889 11890 None. 11891 11892 vfscanf 11893 11894 Name 11895 11896 vfscanf -- convert formatted input 11897 11898 Description 11899 11900 The scanf() family of functions shall behave as described in 11901 ISO POSIX (2003), except as noted below. 11902 11903 Differences 11904 11905 The %s, %S and %[ conversion specifiers shall accept an option 11906 length modifier a, which shall cause a memory buffer to be 11907 allocated to hold the string converted. In such a case, the 11908 argument corresponding to the conversion specifier should be a 11909 reference to a pointer value that will receive a pointer to 11910 the allocated buffer. If there is insufficient memory to 11911 allocate a buffer, the function may set errno to ENOMEM and a 11912 conversion error results. 11913 11914 Note: This directly conflicts with the ISO C (1999) usage 11915 of %a as a conversion specifier for hexadecimal float 11916 values. While this conversion specifier should be 11917 supported, a format specifier such as "%aseconds" will have 11918 a different meaning on an LSB conforming system. 11919 11920 vfwscanf 11921 11922 Name 11923 11924 vfwscanf -- convert formatted input 11925 11926 Description 11927 11928 The scanf() family of functions shall behave as described in 11929 ISO POSIX (2003), except as noted below. 11930 11931 Differences 11932 11933 The %s, %S and %[ conversion specifiers shall accept an option 11934 length modifier a, which shall cause a memory buffer to be 11935 allocated to hold the string converted. In such a case, the 11936 argument corresponding to the conversion specifier should be a 11937 reference to a pointer value that will receive a pointer to 11938 the allocated buffer. If there is insufficient memory to 11939 allocate a buffer, the function may set errno to ENOMEM and a 11940 conversion error results. 11941 11942 Note: This directly conflicts with the ISO C (1999) usage 11943 of %a as a conversion specifier for hexadecimal float 11944 values. While this conversion specifier should be 11945 supported, a format specifier such as "%aseconds" will have 11946 a different meaning on an LSB conforming system. 11947 11948 vscanf 11949 11950 Name 11951 11952 vscanf -- convert formatted input 11953 11954 Description 11955 11956 The scanf() family of functions shall behave as described in 11957 ISO POSIX (2003), except as noted below. 11958 11959 Differences 11960 11961 The %s, %S and %[ conversion specifiers shall accept an option 11962 length modifier a, which shall cause a memory buffer to be 11963 allocated to hold the string converted. In such a case, the 11964 argument corresponding to the conversion specifier should be a 11965 reference to a pointer value that will receive a pointer to 11966 the allocated buffer. If there is insufficient memory to 11967 allocate a buffer, the function may set errno to ENOMEM and a 11968 conversion error results. 11969 11970 Note: This directly conflicts with the ISO C (1999) usage 11971 of %a as a conversion specifier for hexadecimal float 11972 values. While this conversion specifier should be 11973 supported, a format specifier such as "%aseconds" will have 11974 a different meaning on an LSB conforming system. 11975 11976 vsscanf 11977 11978 Name 11979 11980 vsscanf -- convert formatted input 11981 11982 Description 11983 11984 The scanf() family of functions shall behave as described in 11985 ISO POSIX (2003), except as noted below. 11986 11987 Differences 11988 11989 The %s, %S and %[ conversion specifiers shall accept an option 11990 length modifier a, which shall cause a memory buffer to be 11991 allocated to hold the string converted. In such a case, the 11992 argument corresponding to the conversion specifier should be a 11993 reference to a pointer value that will receive a pointer to 11994 the allocated buffer. If there is insufficient memory to 11995 allocate a buffer, the function may set errno to ENOMEM and a 11996 conversion error results. 11997 11998 Note: This directly conflicts with the ISO C (1999) usage 11999 of %a as a conversion specifier for hexadecimal float 12000 values. While this conversion specifier should be 12001 supported, a format specifier such as "%aseconds" will have 12002 a different meaning on an LSB conforming system. 12003 12004 vswscanf 12005 12006 Name 12007 12008 vswscanf -- convert formatted input 12009 12010 Description 12011 12012 The scanf() family of functions shall behave as described in 12013 ISO POSIX (2003), except as noted below. 12014 12015 Differences 12016 12017 The %s, %S and %[ conversion specifiers shall accept an option 12018 length modifier a, which shall cause a memory buffer to be 12019 allocated to hold the string converted. In such a case, the 12020 argument corresponding to the conversion specifier should be a 12021 reference to a pointer value that will receive a pointer to 12022 the allocated buffer. If there is insufficient memory to 12023 allocate a buffer, the function may set errno to ENOMEM and a 12024 conversion error results. 12025 12026 Note: This directly conflicts with the ISO C (1999) usage 12027 of %a as a conversion specifier for hexadecimal float 12028 values. While this conversion specifier should be 12029 supported, a format specifier such as "%aseconds" will have 12030 a different meaning on an LSB conforming system. 12031 12032 vsyslog 12033 12034 Name 12035 12036 vsyslog -- log to system log 12037 12038 Synopsis 12039 12040 #include 12041 #include 12042 12043 void vsyslog(int priority, char * message, va_list arglist); 12044 12045 Description 12046 12047 The vsyslog() function is identical to syslog() as specified 12048 in ISO POSIX (2003), except that arglist (as defined by 12049 stdarg.h) replaces the variable number of arguments. 12050 12051 vwscanf 12052 12053 Name 12054 12055 vwscanf -- convert formatted input 12056 12057 Description 12058 12059 The scanf() family of functions shall behave as described in 12060 ISO POSIX (2003), except as noted below. 12061 12062 Differences 12063 12064 The %s, %S and %[ conversion specifiers shall accept an option 12065 length modifier a, which shall cause a memory buffer to be 12066 allocated to hold the string converted. In such a case, the 12067 argument corresponding to the conversion specifier should be a 12068 reference to a pointer value that will receive a pointer to 12069 the allocated buffer. If there is insufficient memory to 12070 allocate a buffer, the function may set errno to ENOMEM and a 12071 conversion error results. 12072 12073 Note: This directly conflicts with the ISO C (1999) usage 12074 of %a as a conversion specifier for hexadecimal float 12075 values. While this conversion specifier should be 12076 supported, a format specifier such as "%aseconds" will have 12077 a different meaning on an LSB conforming system. 12078 12079 wait4 12080 12081 Name 12082 12083 wait4 -- wait for process termination, BSD style 12084 12085 Synopsis 12086 12087 #include 12088 #include 12089 #include 12090 12091 pid_t wait4(pid_t pid, int * status, int options, struct 12092 rusage * rusage); 12093 12094 Description 12095 12096 wait4() suspends execution of the current process until a 12097 child (as specified by pid) has exited, or until a signal is 12098 delivered whose action is to terminate the current process or 12099 to call a signal handling function. If a child (as requested 12100 by pid) has already exited by the time of the call (a 12101 so-called "zombie" process), the function returns immediately. 12102 Any system resources used by the child are freed. 12103 12104 The value of pid can be one of: 12105 12106 < -1 12107 12108 wait for any child process whose process group ID is equal to 12109 the absolute value of pid. 12110 -1 12111 12112 wait for any child process; this is equivalent to calling 12113 wait3(). 12114 0 12115 12116 wait for any child process whose process group ID is equal to 12117 that of the calling process. 12118 > 0 12119 12120 wait for the child whose process ID is equal to the value of 12121 pid. 12122 12123 The value of options is a bitwise or of zero or more of the 12124 following constants: 12125 12126 WNOHANG 12127 12128 return immediately if no child is there to be waited for. 12129 WUNTRACED 12130 12131 return for children that are stopped, and whose status has not 12132 been reported. 12133 12134 If status is not NULL, wait4() stores status information in 12135 the location status. This status can be evaluated with the 12136 following macros: 12137 12138 Note: These macros take the status value (an int) as an 12139 argument -- not a pointer to the value! 12140 12141 WIFEXITED(status) 12142 12143 is nonzero if the child exited normally. 12144 WEXITSTATUS(status) 12145 12146 evaluates to the least significant eight bits of the return 12147 code of the child that terminated, which may have been set as 12148 the argument to a call to exit() or as the argument for a 12149 return statement in the main program. This macro can only be 12150 evaluated if WIFEXITED() returned nonzero. 12151 WIFSIGNALED(status) 12152 12153 returns true if the child process exited because of a signal 12154 that was not caught. 12155 WTERMSIG(status) 12156 12157 returns the number of the signal that caused the child process 12158 to terminate. This macro can only be evaluated if 12159 WIFSIGNALED() returned nonzero. 12160 WIFSTOPPED(status) 12161 12162 returns true if the child process that caused the return is 12163 currently stopped; this is only possible if the call was done 12164 using WUNTRACED(). 12165 WSTOPSIG(status) 12166 12167 returns the number of the signal that caused the child to 12168 stop. This macro can only be evaluated if WIFSTOPPED() 12169 returned nonzero. 12170 12171 If rusage is not NULL, the struct rusage (as defined in 12172 sys/resource.h) that it points to will be filled with 12173 accounting information. See getrusage() for details. 12174 12175 Return Value 12176 12177 On success, the process ID of the child that exited is 12178 returned. On error, -1 is returned (in particular, when no 12179 unwaited-for child processes of the specified kind exist), or 12180 0 if WNOHANG() was used and no child was available yet. In the 12181 latter two cases, the global variable errno is set 12182 appropriately. 12183 12184 Errors 12185 12186 ECHILD 12187 12188 No unwaited-for child process as specified does exist. 12189 ERESTARTSYS 12190 12191 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 12192 was caught. This error is returned by the system call. The 12193 library interface is not allowed to return ERESTARTSYS, but 12194 will return EINTR. 12195 12196 waitpid 12197 12198 Name 12199 12200 waitpid -- wait for child process 12201 12202 Description 12203 12204 waitpid() is as specified in ISO POSIX (2003), but with 12205 differences as listed below. 12206 12207 Need not support WCONTINUED or WIFCONTINUED 12208 12209 Implementations need not support the XSI optional 12210 functionality of WCONTINUED() or WIFCONTINUED(). 12211 12212 warn 12213 12214 Name 12215 12216 warn -- formatted error messages 12217 12218 Synopsis 12219 12220 #include 12221 12222 void warn(const char * fmt, ...); 12223 12224 Description 12225 12226 The warn() function shall display a formatted error message on 12227 the standard error stream. The output shall consist of the 12228 last component of the program name, a colon character, and a 12229 space character. If fmt is non-NULL, it shall be used as a 12230 format string for the printf() family of functions, and the 12231 formatted message, a colon character, and a space are written 12232 to stderr. Finally, the error message string affiliated with 12233 the current value of the global variable errno shall be 12234 written to stderr, followed by a newline character. 12235 12236 Return Value 12237 12238 None. 12239 12240 Errors 12241 12242 None. 12243 12244 warnx 12245 12246 Name 12247 12248 warnx -- formatted error messages 12249 12250 Synopsis 12251 12252 #include 12253 12254 void warnx(const char * fmt, ...); 12255 12256 Description 12257 12258 The warnx() function shall display a formatted error message 12259 on the standard error stream. The last component of the 12260 program name, a colon character, and a space shall be output. 12261 If fmt is non-NULL, it shall be used as the format string for 12262 the printf() family of functions, and the formatted error 12263 message, a colon character, and a space shall be output. The 12264 output shall be followed by a newline character. 12265 12266 Return Value 12267 12268 None. 12269 12270 Errors 12271 12272 None. 12273 12274 wcpcpy 12275 12276 Name 12277 12278 wcpcpy -- copy a wide character string, returning a pointer to 12279 its end 12280 12281 Synopsis 12282 12283 #include 12284 12285 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 12286 12287 Description 12288 12289 wcpcpy() is the wide-character equivalent of stpcpy(). It 12290 copies the wide character string src, including the 12291 terminating null wide character code, to the array dest. 12292 12293 The strings may not overlap. 12294 12295 The programmer shall ensure that there is room for at least 12296 wcslen()(src)+1 wide characters at dest. 12297 12298 Return Value 12299 12300 wcpcpy() returns a pointer to the end of the wide-character 12301 string dest, that is, a pointer to the terminating null wide 12302 character code. 12303 12304 wcpncpy 12305 12306 Name 12307 12308 wcpncpy -- copy a fixed-size string of wide characters, 12309 returning a pointer to its end 12310 12311 Synopsis 12312 12313 #include 12314 12315 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 12316 n); 12317 12318 Description 12319 12320 wcpncpy() is the wide-character equivalent of stpncpy(). It 12321 copies at most n wide characters from the wide-character 12322 string src, including the terminating null wide character 12323 code, to the array dest. Exactly n wide characters are written 12324 at dest. If the length wcslen()(src) is smaller than n, the 12325 remaining wide characters in the array dest are filled with 12326 null wide character codes. If the length wcslen()(src) is 12327 greater than or equal to n, the string dest will not be 12328 terminated with a null wide character code. 12329 12330 The strings may not overlap. 12331 12332 The programmer shall ensure that there is room for at least n 12333 wide characters at dest. 12334 12335 Return Value 12336 12337 wcpncpy() returns a pointer to the wide character one past the 12338 last non-null wide character written. 12339 12340 wcscasecmp 12341 12342 Name 12343 12344 wcscasecmp -- compare two wide-character strings, ignoring 12345 case 12346 12347 Synopsis 12348 12349 #include 12350 12351 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 12352 12353 Description 12354 12355 wcscasecmp() is the wide-character equivalent of strcasecmp(). 12356 It compares the wide-character string s1 and the 12357 wide-character string s2, ignoring case differences (towupper, 12358 towlower). 12359 12360 Return Value 12361 12362 The wcscasecmp() function shall return 0 if the wide-character 12363 strings s1 and s2 are equal except for case distinctions. It 12364 shall return a positive integer if s1 is greater than s2, 12365 ignoring case. It shall return a negative integer if s1 is 12366 less than s2, ignoring case. 12367 12368 Notes 12369 12370 The behavior of wcscasecmp() depends upon the LC_CTYPE 12371 category of the current locale. 12372 12373 wcsdup 12374 12375 Name 12376 12377 wcsdup -- duplicate a wide-character string 12378 12379 Synopsis 12380 12381 #include 12382 12383 wchar_t * wcsdup(const wchar_t * s); 12384 12385 Description 12386 12387 wcsdup() is the wide-character equivalent of strdup(). It 12388 allocates and returns a new wide-character string whose 12389 initial contents is a duplicate of the wide-character string 12390 s. 12391 12392 Memory for the new wide-character string is obtained with 12393 malloc(), and can be freed with free(). 12394 12395 Return Value 12396 12397 wcsdup() returns a pointer to the new wide-character string, 12398 or NULL if sufficient memory was not available. 12399 12400 wcsncasecmp 12401 12402 Name 12403 12404 wcsncasecmp -- compare two fixed-size wide-character strings, 12405 ignoring case 12406 12407 Synopsis 12408 12409 #include 12410 12411 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 12412 n); 12413 12414 Description 12415 12416 wcsncasecmp() is the wide-character equivalent of 12417 strncasecmp(). It compares the wide-character string s1 and 12418 the wide-character string s2, but at most n wide characters 12419 from each string, ignoring case differences (towupper, 12420 towlower). 12421 12422 Return Value 12423 12424 wcscasecmp() returns 0 if the wide-character strings s1 and 12425 s2, truncated to at most length n, are equal except for case 12426 distinctions. It returns a positive integer if truncated s1 is 12427 greater than truncated s2, ignoring case. It returns a 12428 negative integer if truncated s1 is smaller than truncated s2, 12429 ignoring case. 12430 12431 Notes 12432 12433 The behavior of wcsncasecmp() depends upon the LC_CTYPE 12434 category of the current locale. 12435 12436 wcsnlen 12437 12438 Name 12439 12440 wcsnlen -- determine the length of a fixed-size wide-character 12441 string 12442 12443 Synopsis 12444 12445 #include 12446 12447 size_t wcsnlen(const wchar_t * s, size_t maxlen); 12448 12449 Description 12450 12451 wcsnlen() is the wide-character equivalent of strnlen(). It 12452 returns the number of wide-characters in the string s, not 12453 including the terminating null wide character code, but at 12454 most maxlen. In doing this, wcsnlen() looks only at the first 12455 maxlen wide-characters at s and never beyond s + maxlen. 12456 12457 Return Value 12458 12459 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 12460 maxlen if there is no null wide character code among the first 12461 maxlen wide characters pointed to by s. 12462 12463 wcsnrtombs 12464 12465 Name 12466 12467 wcsnrtombs -- convert a wide character string to a multi-byte 12468 string 12469 12470 Synopsis 12471 12472 #include 12473 12474 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 12475 nwc, size_t len, mbstate_t * ps); 12476 12477 Description 12478 12479 wcsnrtombs() is like wcsrtombs(), except that the number of 12480 wide characters to be converted, starting at src, is limited 12481 to nwc. 12482 12483 If dest is not a NULL pointer, wcsnrtombs() converts at most 12484 nwc wide characters from the wide-character string src to a 12485 multibyte string starting at dest. At most len bytes are 12486 written to dest. The state ps is updated. 12487 12488 The conversion is effectively performed by repeatedly calling: 12489 wcrtomb(dest, *src, ps) 12490 12491 as long as this call succeeds, and then incrementing dest by 12492 the number of bytes written and src by 1. 12493 12494 The conversion can stop for three reasons: 12495 12496 * A wide character has been encountered that cannot be 12497 represented as a multibyte sequence (according to the 12498 current locale). In this case src is left pointing to the 12499 invalid wide character, (size_t)(-1) is returned, and 12500 errno is set to EILSEQ. 12501 * nws wide characters have been converted without 12502 encountering a null wide character code, or the length 12503 limit forces a stop. In this case, src is left pointing to 12504 the next wide character to be converted, and the number 12505 bytes written to dest is returned. 12506 * The wide-character string has been completely converted, 12507 including the terminating null wide character code (which 12508 has the side effect of bringing back ps to the initial 12509 state). In this case, src is set to NULL, and the number 12510 of bytes written to dest, excluding the terminating null 12511 wide character code, is returned. 12512 12513 If dest is NULL, len is ignored, and the conversion proceeds 12514 as above, except that the converted bytes are not written out 12515 to memory, and that no destination length limit exists. 12516 12517 In both of the above cases, if ps is a NULL pointer, a static 12518 anonymous state only known to wcsnrtombs() is used instead. 12519 12520 The programmer shall ensure that there is room for at least 12521 len bytes at dest. 12522 12523 Return Value 12524 12525 wcsnrtombs() returns the number of bytes that make up the 12526 converted part of multibyte sequence, not including the 12527 terminating null wide character code. If a wide character was 12528 encountered which could not be converted, (size_t)(-1) is 12529 returned, and the global variable errno set to EILSEQ. 12530 12531 Notes 12532 12533 The behavior of wcsnrtombs() depends on the LC_CTYPE category 12534 of the current locale. 12535 12536 Passing NULL as ps is not multi-thread safe. 12537 12538 wcstoq 12539 12540 Name 12541 12542 wcstoq -- convert wide string to long long int representation 12543 12544 Synopsis 12545 12546 #include 12547 12548 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 12549 restrict endptr, int base); 12550 12551 Description 12552 12553 The wcstoq() function shall convert the initial portion of the 12554 wide string nptr to long long int representation. It is 12555 identical to wcstoll(). 12556 12557 Return Value 12558 12559 Refer to wcstoll(). 12560 12561 Errors 12562 12563 Refer to wcstoll(). 12564 12565 wcstouq 12566 12567 Name 12568 12569 wcstouq -- convert wide string to unsigned long long int 12570 representation 12571 12572 Synopsis 12573 12574 #include 12575 12576 unsigned long long wcstouq(const wchar_t * restrict nptr, 12577 wchar_t ** restrict endptr, int base); 12578 12579 Description 12580 12581 The wcstouq() function shall convert the initial portion of 12582 the wide string nptr to unsigned long long int representation. 12583 It is identical to wcstoull(). 12584 12585 Return Value 12586 12587 Refer to wcstoull(). 12588 12589 Errors 12590 12591 Refer to wcstoull(). 12592 12593 wscanf 12594 12595 Name 12596 12597 wscanf -- convert formatted input 12598 12599 Description 12600 12601 The scanf() family of functions shall behave as described in 12602 ISO POSIX (2003), except as noted below. 12603 12604 Differences 12605 12606 The %s, %S and %[ conversion specifiers shall accept an option 12607 length modifier a, which shall cause a memory buffer to be 12608 allocated to hold the string converted. In such a case, the 12609 argument corresponding to the conversion specifier should be a 12610 reference to a pointer value that will receive a pointer to 12611 the allocated buffer. If there is insufficient memory to 12612 allocate a buffer, the function may set errno to ENOMEM and a 12613 conversion error results. 12614 12615 Note: This directly conflicts with the ISO C (1999) usage 12616 of %a as a conversion specifier for hexadecimal float 12617 values. While this conversion specifier should be 12618 supported, a format specifier such as "%aseconds" will have 12619 a different meaning on an LSB conforming system. 12620 12621 xdr_u_int 12622 12623 Name 12624 12625 xdr_u_int -- library routines for external data representation 12626 12627 Synopsis 12628 12629 int xdr_u_int(XDR * xdrs, unsigned int * up); 12630 12631 Description 12632 12633 xdr_u_int() is a filter primitive that translates between C 12634 unsigned integers and their external representations. 12635 12636 Return Value 12637 12638 On success, 1 is returned. On error, 0 is returned. 12639 _________________________________________________________ 12640 12641 13.6. Interfaces for libm 12642 12643 Table 13-24 defines the library name and shared object name 12644 for the libm library 12645 12646 Table 13-24. libm Definition 12647 Library: libm 12648 SONAME: See archLSB. 12649 12650 The behavior of the interfaces in this library is specified by 12651 the following specifications: 12652 12653 [ISOC99] ISO C (1999) 12654 [LSB] This Specification 12655 [SUSv2] SUSv2 12656 [SUSv3] ISO POSIX (2003) 12657 _________________________________________________________ 12658 12659 13.6.1. Math 12660 _________________________________________________________ 12661 12662 13.6.1.1. Interfaces for Math 12663 12664 An LSB conforming implementation shall provide the generic 12665 functions for Math specified in Table 13-25, with the full 12666 mandatory functionality as described in the referenced 12667 underlying specification. 12668 12669 Table 13-25. libm - Math Function Interfaces 12670 __finite [ISOC99] __finitef [ISOC99] __finitel [ISOC99] 12671 __fpclassify [LSB] 12672 __fpclassifyf [LSB] __signbit [ISOC99] __signbitf [ISOC99] 12673 acos [SUSv3] 12674 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 12675 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 12676 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 12677 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 12678 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 12679 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 12680 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 12681 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 12682 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 12683 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 12684 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 12685 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 12686 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 12687 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 12688 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 12689 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [ISOC99] 12690 clog10f [ISOC99] clog10l [ISOC99] clogf [SUSv3] clogl [SUSv3] 12691 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 12692 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 12693 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 12694 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 12695 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 12696 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 12697 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 12698 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 12699 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 12700 dremf [ISOC99] dreml [ISOC99] erf [SUSv3] erfc [SUSv3] 12701 erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] erfl [SUSv3] 12702 exp [SUSv3] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 12703 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 12704 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 12705 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] fegetenv 12706 [SUSv3] 12707 fegetexceptflag [SUSv3] fegetround [SUSv3] feholdexcept 12708 [SUSv3] feraiseexcept [SUSv3] 12709 fesetenv [SUSv3] fesetexceptflag [SUSv3] fesetround [SUSv3] 12710 fetestexcept [SUSv3] 12711 feupdateenv [SUSv3] finite [SUSv2] finitef [ISOC99] finitel 12712 [ISOC99] 12713 floor [SUSv3] floorf [SUSv3] floorl [SUSv3] fma [SUSv3] 12714 fmaf [SUSv3] fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] 12715 fmaxl [SUSv3] fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] 12716 fmod [SUSv3] fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] 12717 frexpf [SUSv3] frexpl [SUSv3] gamma [SUSv2] gammaf [ISOC99] 12718 gammal [ISOC99] hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] 12719 ilogb [SUSv3] ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] 12720 j0f [ISOC99] j0l [ISOC99] j1 [SUSv3] j1f [ISOC99] 12721 j1l [ISOC99] jn [SUSv3] jnf [ISOC99] jnl [ISOC99] 12722 ldexp [SUSv3] ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] 12723 lgamma_r [ISOC99] lgammaf [SUSv3] lgammaf_r [ISOC99] lgammal 12724 [SUSv3] 12725 lgammal_r [ISOC99] llrint [SUSv3] llrintf [SUSv3] llrintl 12726 [SUSv3] 12727 llround [SUSv3] llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] 12728 log10 [SUSv3] log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] 12729 log1pf [SUSv3] log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] 12730 log2l [SUSv3] logb [SUSv3] logbf [SUSv3] logbl [SUSv3] 12731 logf [SUSv3] logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] 12732 lrintl [SUSv3] lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] 12733 matherr [ISOC99] modf [SUSv3] modff [SUSv3] modfl [SUSv3] 12734 nan [SUSv3] nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] 12735 nearbyintf [SUSv3] nearbyintl [SUSv3] nextafter [SUSv3] 12736 nextafterf [SUSv3] 12737 nextafterl [SUSv3] nexttoward [SUSv3] nexttowardf [SUSv3] 12738 nexttowardl [SUSv3] 12739 pow [SUSv3] pow10 [ISOC99] pow10f [ISOC99] pow10l [ISOC99] 12740 powf [SUSv3] powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] 12741 remainderl [SUSv3] remquo [SUSv3] remquof [SUSv3] remquol 12742 [SUSv3] 12743 rint [SUSv3] rintf [SUSv3] rintl [SUSv3] round [SUSv3] 12744 roundf [SUSv3] roundl [SUSv3] scalb [SUSv3] scalbf [ISOC99] 12745 scalbl [ISOC99] scalbln [SUSv3] scalblnf [SUSv3] scalblnl 12746 [SUSv3] 12747 scalbn [SUSv3] scalbnf [SUSv3] scalbnl [SUSv3] significand 12748 [ISOC99] 12749 significandf [ISOC99] significandl [ISOC99] sin [SUSv3] sincos 12750 [ISOC99] 12751 sincosf [ISOC99] sincosl [ISOC99] sinf [SUSv3] sinh [SUSv3] 12752 sinhf [SUSv3] sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] 12753 sqrtf [SUSv3] sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] 12754 tanh [SUSv3] tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] 12755 tgamma [SUSv3] tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] 12756 truncf [SUSv3] truncl [SUSv3] y0 [SUSv3] y0f [ISOC99] 12757 y0l [ISOC99] y1 [SUSv3] y1f [ISOC99] y1l [ISOC99] 12758 yn [SUSv3] ynf [ISOC99] ynl [ISOC99] 12759 12760 An LSB conforming implementation shall provide the generic 12761 data interfaces for Math specified in Table 13-26, with the 12762 full mandatory functionality as described in the referenced 12763 underlying specification. 12764 12765 Table 13-26. libm - Math Data Interfaces 12766 signgam [SUSv3] 12767 _________________________________________________________ 12768 12769 13.7. Data Definitions for libm 12770 12771 This section defines global identifiers and their values that 12772 are associated with interfaces contained in libm. These 12773 definitions are organized into groups that correspond to 12774 system headers. This convention is used as a convenience for 12775 the reader, and does not imply the existence of these headers, 12776 or their content. Where an interface is defined as requiring a 12777 particular system header file all of the data definitions for 12778 that system header file presented here shall be in effect. 12779 12780 This section gives data definitions to promote binary 12781 application portability, not to repeat source interface 12782 definitions available elsewhere. System providers and 12783 application developers should use this ABI to supplement - not 12784 to replace - source interface definition specifications. 12785 12786 This specification uses the ISO C (1999) C Language as the 12787 reference programming language, and data definitions are 12788 specified in ISO C format. The C language is used here as a 12789 convenient notation. Using a C language description of these 12790 data objects does not preclude their use by other programming 12791 languages. 12792 _________________________________________________________ 12793 12794 13.7.1. complex.h 12795 12796 #define complex _Complex 12797 12798 extern double cabs(double complex); 12799 extern float cabsf(float complex); 12800 extern long double cabsl(long double complex); 12801 extern double complex cacos(double complex); 12802 extern float complex cacosf(float complex); 12803 extern double complex cacosh(double complex); 12804 extern float complex cacoshf(float complex); 12805 extern long double complex cacoshl(long double complex); 12806 extern long double complex cacosl(long double complex); 12807 extern double carg(double complex); 12808 extern float cargf(float complex); 12809 extern long double cargl(long double complex); 12810 extern double complex casin(double complex); 12811 extern float complex casinf(float complex); 12812 extern double complex casinh(double complex); 12813 extern float complex casinhf(float complex); 12814 extern long double complex casinhl(long double complex); 12815 extern long double complex casinl(long double complex); 12816 extern double complex catan(double complex); 12817 extern float complex catanf(float complex); 12818 extern double complex catanh(double complex); 12819 extern float complex catanhf(float complex); 12820 extern long double complex catanhl(long double complex); 12821 extern long double complex catanl(long double complex); 12822 extern double complex ccos(double complex); 12823 extern float complex ccosf(float complex); 12824 extern double complex ccosh(double complex); 12825 extern float complex ccoshf(float complex); 12826 extern long double complex ccoshl(long double complex); 12827 extern long double complex ccosl(long double complex); 12828 extern double complex cexp(double complex); 12829 extern float complex cexpf(float complex); 12830 extern long double complex cexpl(long double complex); 12831 extern double cimag(double complex); 12832 extern float cimagf(float complex); 12833 extern long double cimagl(long double complex); 12834 extern double complex clog(double complex); 12835 extern float complex clog10f(float complex); 12836 extern long double complex clog10l(long double complex); 12837 extern float complex clogf(float complex); 12838 extern long double complex clogl(long double complex); 12839 extern double complex conj(double complex); 12840 extern float complex conjf(float complex); 12841 extern long double complex conjl(long double complex); 12842 extern double complex cpow(double complex, double complex); 12843 extern float complex cpowf(float complex, float complex); 12844 extern long double complex cpowl(long double complex, long double complex); 12845 extern double complex cproj(double complex); 12846 extern float complex cprojf(float complex); 12847 extern long double complex cprojl(long double complex); 12848 extern double creal(double complex); 12849 extern float crealf(float complex); 12850 extern long double creall(long double complex); 12851 extern double complex csin(double complex); 12852 extern float complex csinf(float complex); 12853 extern double complex csinh(double complex); 12854 extern float complex csinhf(float complex); 12855 extern long double complex csinhl(long double complex); 12856 extern long double complex csinl(long double complex); 12857 extern double complex csqrt(double complex); 12858 extern float complex csqrtf(float complex); 12859 extern long double complex csqrtl(long double complex); 12860 extern double complex ctan(double complex); 12861 extern float complex ctanf(float complex); 12862 extern double complex ctanh(double complex); 12863 extern float complex ctanhf(float complex); 12864 extern long double complex ctanhl(long double complex); 12865 extern long double complex ctanl(long double complex); 12866 _________________________________________________________ 12867 12868 13.7.2. fenv.h 12869 12870 extern int feclearexcept(int); 12871 extern int fegetenv(fenv_t *); 12872 extern int fegetexceptflag(fexcept_t *, int); 12873 extern int fegetround(void); 12874 extern int feholdexcept(fenv_t *); 12875 extern int feraiseexcept(int); 12876 extern int fesetenv(const fenv_t *); 12877 extern int fesetexceptflag(const fexcept_t *, int); 12878 extern int fesetround(int); 12879 extern int fetestexcept(int); 12880 extern int feupdateenv(const fenv_t *); 12881 _________________________________________________________ 12882 12883 13.7.3. math.h 12884 12885 #define DOMAIN 1 12886 #define SING 2 12887 12888 struct exception { 12889 int type; 12890 char *name; 12891 double arg1; 12892 double arg2; 12893 double retval; 12894 }; 12895 12896 #define FP_NAN 0 12897 #define FP_INFINITE 1 12898 #define FP_ZERO 2 12899 #define FP_SUBNORMAL 3 12900 #define FP_NORMAL 4 12901 12902 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 12903 #define isfinite(x) \ 12904 (sizeof (x) == sizeof (float) ? __finitef (x) : sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) 12905 #define isinf(x) \ 12906 (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 12907 #define isnan(x) \ 12908 (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 12909 12910 #define HUGE_VAL 0x1.0p2047 12911 #define HUGE_VALF 0x1.0p255f 12912 #define HUGE_VALL 0x1.0p32767L 12913 12914 #define NAN ((float)0x7fc00000UL) 12915 #define M_1_PI 0.31830988618379067154 12916 #define M_LOG10E 0.43429448190325182765 12917 #define M_2_PI 0.63661977236758134308 12918 #define M_LN2 0.69314718055994530942 12919 #define M_SQRT1_2 0.70710678118654752440 12920 #define M_PI_4 0.78539816339744830962 12921 #define M_2_SQRTPI 1.12837916709551257390 12922 #define M_SQRT2 1.41421356237309504880 12923 #define M_LOG2E 1.4426950408889634074 12924 #define M_PI_2 1.57079632679489661923 12925 #define M_LN10 2.30258509299404568402 12926 #define M_E 2.7182818284590452354 12927 #define M_PI 3.14159265358979323846 12928 #define INFINITY HUGE_VALF 12929 12930 #define MATH_ERRNO 1 12931 #define MATH_ERREXCEPT 2 12932 12933 #define isunordered(u, v) \ 12934 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) 12935 #define islessgreater(x, y) \ 12936 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) 12937 #define isless(x,y) \ 12938 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) 12939 #define islessequal(x, y) \ 12940 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) 12941 #define isgreater(x,y) \ 12942 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) 12943 #define isgreaterequal(x,y) \ 12944 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) 12945 12946 extern int __finite(double); 12947 extern int __finitef(float); 12948 extern int __finitel(long double); 12949 extern int __isinf(double); 12950 extern int __isinff(float); 12951 extern int __isinfl(long double); 12952 extern int __isnan(double); 12953 extern int __isnanf(float); 12954 extern int __isnanl(long double); 12955 extern int __signbit(double); 12956 extern int __signbitf(float); 12957 extern int __fpclassify(double); 12958 extern int __fpclassifyf(float); 12959 extern int __fpclassifyl(long double); 12960 extern int signgam(void); 12961 extern double copysign(double, double); 12962 extern int finite(double); 12963 extern double frexp(double, int *); 12964 extern double ldexp(double, int); 12965 extern double modf(double, double *); 12966 extern double acos(double); 12967 extern double acosh(double); 12968 extern double asinh(double); 12969 extern double atanh(double); 12970 extern double asin(double); 12971 extern double atan(double); 12972 extern double atan2(double, double); 12973 extern double cbrt(double); 12974 extern double ceil(double); 12975 extern double cos(double); 12976 extern double cosh(double); 12977 extern double erf(double); 12978 extern double erfc(double); 12979 extern double exp(double); 12980 extern double expm1(double); 12981 extern double fabs(double); 12982 extern double floor(double); 12983 extern double fmod(double, double); 12984 extern double gamma(double); 12985 extern double hypot(double, double); 12986 extern int ilogb(double); 12987 extern double j0(double); 12988 extern double j1(double); 12989 extern double jn(int, double); 12990 extern double lgamma(double); 12991 extern double log(double); 12992 extern double log10(double); 12993 extern double log1p(double); 12994 extern double logb(double); 12995 extern double nextafter(double, double); 12996 extern double pow(double, double); 12997 extern double remainder(double, double); 12998 extern double rint(double); 12999 extern double scalb(double, double); 13000 extern double sin(double); 13001 extern double sinh(double); 13002 extern double sqrt(double); 13003 extern double tan(double); 13004 extern double tanh(double); 13005 extern double y0(double); 13006 extern double y1(double); 13007 extern double yn(int, double); 13008 extern float copysignf(float, float); 13009 extern long double copysignl(long double, long double); 13010 extern int finitef(float); 13011 extern int finitel(long double); 13012 extern float frexpf(float, int *); 13013 extern long double frexpl(long double, int *); 13014 extern float ldexpf(float, int); 13015 extern long double ldexpl(long double, int); 13016 extern float modff(float, float *); 13017 extern long double modfl(long double, long double *); 13018 extern double scalbln(double, long int); 13019 extern float scalblnf(float, long int); 13020 extern long double scalblnl(long double, long int); 13021 extern double scalbn(double, int); 13022 extern float scalbnf(float, int); 13023 extern long double scalbnl(long double, int); 13024 extern float acosf(float); 13025 extern float acoshf(float); 13026 extern long double acoshl(long double); 13027 extern long double acosl(long double); 13028 extern float asinf(float); 13029 extern float asinhf(float); 13030 extern long double asinhl(long double); 13031 extern long double asinl(long double); 13032 extern float atan2f(float, float); 13033 extern long double atan2l(long double, long double); 13034 extern float atanf(float); 13035 extern float atanhf(float); 13036 extern long double atanhl(long double); 13037 extern long double atanl(long double); 13038 extern float cbrtf(float); 13039 extern long double cbrtl(long double); 13040 extern float ceilf(float); 13041 extern long double ceill(long double); 13042 extern float cosf(float); 13043 extern float coshf(float); 13044 extern long double coshl(long double); 13045 extern long double cosl(long double); 13046 extern float dremf(float, float); 13047 extern long double dreml(long double, long double); 13048 extern float erfcf(float); 13049 extern long double erfcl(long double); 13050 extern float erff(float); 13051 extern long double erfl(long double); 13052 extern double exp2(double); 13053 extern float exp2f(float); 13054 extern long double exp2l(long double); 13055 extern float expf(float); 13056 extern long double expl(long double); 13057 extern float expm1f(float); 13058 extern long double expm1l(long double); 13059 extern float fabsf(float); 13060 extern long double fabsl(long double); 13061 extern double fdim(double, double); 13062 extern float fdimf(float, float); 13063 extern long double fdiml(long double, long double); 13064 extern float floorf(float); 13065 extern long double floorl(long double); 13066 extern double fma(double, double, double); 13067 extern float fmaf(float, float, float); 13068 extern long double fmal(long double, long double, long double); 13069 extern double fmax(double, double); 13070 extern float fmaxf(float, float); 13071 extern long double fmaxl(long double, long double); 13072 extern double fmin(double, double); 13073 extern float fminf(float, float); 13074 extern long double fminl(long double, long double); 13075 extern float fmodf(float, float); 13076 extern long double fmodl(long double, long double); 13077 extern float gammaf(float); 13078 extern long double gammal(long double); 13079 extern float hypotf(float, float); 13080 extern long double hypotl(long double, long double); 13081 extern int ilogbf(float); 13082 extern int ilogbl(long double); 13083 extern float j0f(float); 13084 extern long double j0l(long double); 13085 extern float j1f(float); 13086 extern long double j1l(long double); 13087 extern float jnf(int, float); 13088 extern long double jnl(int, long double); 13089 extern double lgamma_r(double, int *); 13090 extern float lgammaf(float); 13091 extern float lgammaf_r(float, int *); 13092 extern long double lgammal(long double); 13093 extern long double lgammal_r(long double, int *); 13094 extern long long int llrint(double); 13095 extern long long int llrintf(float); 13096 extern long long int llrintl(long double); 13097 extern long long int llround(double); 13098 extern long long int llroundf(float); 13099 extern long long int llroundl(long double); 13100 extern float log10f(float); 13101 extern long double log10l(long double); 13102 extern float log1pf(float); 13103 extern long double log1pl(long double); 13104 extern double log2(double); 13105 extern float log2f(float); 13106 extern long double log2l(long double); 13107 extern float logbf(float); 13108 extern long double logbl(long double); 13109 extern float logf(float); 13110 extern long double logl(long double); 13111 extern long int lrint(double); 13112 extern long int lrintf(float); 13113 extern long int lrintl(long double); 13114 extern long int lround(double); 13115 extern long int lroundf(float); 13116 extern long int lroundl(long double); 13117 extern int matherr(struct exception *); 13118 extern double nan(const char *); 13119 extern float nanf(const char *); 13120 extern long double nanl(const char *); 13121 extern double nearbyint(double); 13122 extern float nearbyintf(float); 13123 extern long double nearbyintl(long double); 13124 extern float nextafterf(float, float); 13125 extern long double nextafterl(long double, long double); 13126 extern double nexttoward(double, long double); 13127 extern float nexttowardf(float, long double); 13128 extern long double nexttowardl(long double, long double); 13129 extern double pow10(double); 13130 extern float pow10f(float); 13131 extern long double pow10l(long double); 13132 extern float powf(float, float); 13133 extern long double powl(long double, long double); 13134 extern float remainderf(float, float); 13135 extern long double remainderl(long double, long double); 13136 extern double remquo(double, double, int *); 13137 extern float remquof(float, float, int *); 13138 extern long double remquol(long double, long double, int *); 13139 extern float rintf(float); 13140 extern long double rintl(long double); 13141 extern double round(double); 13142 extern float roundf(float); 13143 extern long double roundl(long double); 13144 extern float scalbf(float, float); 13145 extern long double scalbl(long double, long double); 13146 extern double significand(double); 13147 extern float significandf(float); 13148 extern long double significandl(long double); 13149 extern void sincos(double, double *, double *); 13150 extern void sincosf(float, float *, float *); 13151 extern void sincosl(long double, long double *, long double *); 13152 extern float sinf(float); 13153 extern float sinhf(float); 13154 extern long double sinhl(long double); 13155 extern long double sinl(long double); 13156 extern float sqrtf(float); 13157 extern long double sqrtl(long double); 13158 extern float tanf(float); 13159 extern float tanhf(float); 13160 extern long double tanhl(long double); 13161 extern long double tanl(long double); 13162 extern double tgamma(double); 13163 extern float tgammaf(float); 13164 extern long double tgammal(long double); 13165 extern double trunc(double); 13166 extern float truncf(float); 13167 extern long double truncl(long double); 13168 extern float y0f(float); 13169 extern long double y0l(long double); 13170 extern float y1f(float); 13171 extern long double y1l(long double); 13172 extern float ynf(int, float); 13173 extern long double ynl(int, long double); 13174 extern int __fpclassifyl(long double); 13175 extern int __fpclassifyl(long double); 13176 extern int __signbitl(long double); 13177 extern int __signbitl(long double); 13178 extern int __signbitl(long double); 13179 extern long double exp2l(long double); 13180 extern long double exp2l(long double); 13181 _________________________________________________________ 13182 13183 13.8. Interface Definitions for libm 13184 13185 Table of Contents 13186 __fpclassify -- Classify real floating type 13187 __fpclassifyf -- Classify real floating type 13188 13189 The interfaces defined on the following pages are included in 13190 libm and are defined by this specification. Unless otherwise 13191 noted, these interfaces shall be included in the source 13192 standard. 13193 13194 Other interfaces listed in Section 13.6 shall behave as 13195 described in the referenced base document. 13196 13197 __fpclassify 13198 13199 Name 13200 13201 __fpclassify -- Classify real floating type 13202 13203 Synopsis 13204 13205 int __fpclassify(double arg); 13206 13207 Description 13208 13209 __fpclassify() has the same specification as fpclassify() in 13210 ISO POSIX (2003), except that the argument type for 13211 __fpclassify() is known to be double. 13212 13213 __fpclassify() is not in the source standard; it is only in 13214 the binary standard. 13215 13216 __fpclassifyf 13217 13218 Name 13219 13220 __fpclassifyf -- Classify real floating type 13221 13222 Synopsis 13223 13224 int __fpclassifyf(float arg); 13225 13226 Description 13227 13228 __fpclassifyf() has the same specification as fpclassifyf() in 13229 ISO POSIX (2003), except that the argument type for 13230 __fpclassifyf() is known to be float. 13231 13232 __fpclassifyf() is not in the source standard; it is only in 13233 the binary standard. 13234 _________________________________________________________ 13235 13236 13.9. Interfaces for libpthread 13237 13238 Table 13-27 defines the library name and shared object name 13239 for the libpthread library 13240 13241 Table 13-27. libpthread Definition 13242 Library: libpthread 13243 SONAME: libpthread.so.0 13244 13245 The behavior of the interfaces in this library is specified by 13246 the following specifications: 13247 13248 [LFS] Large File Support 13249 [LSB] This Specification 13250 [SUSv3] ISO POSIX (2003) 13251 _________________________________________________________ 13252 13253 13.9.1. Realtime Threads 13254 _________________________________________________________ 13255 13256 13.9.1.1. Interfaces for Realtime Threads 13257 13258 An LSB conforming implementation shall provide the generic 13259 functions for Realtime Threads specified in Table 13-28, with 13260 the full mandatory functionality as described in the 13261 referenced underlying specification. 13262 13263 Table 13-28. libpthread - Realtime Threads Function Interfaces 13264 pthread_attr_getinheritsched [SUSv3] 13265 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 13266 [SUSv3] pthread_attr_setinheritsched [SUSv3] 13267 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 13268 [SUSv3] pthread_getschedparam [SUSv3] pthread_setschedparam 13269 [SUSv3] 13270 pthread_setschedprio(GLIBC_2.3.4) [SUSv3] 13271 _________________________________________________________ 13272 13273 13.9.2. Advanced Realtime Threads 13274 _________________________________________________________ 13275 13276 13.9.2.1. Interfaces for Advanced Realtime Threads 13277 13278 No external functions are defined for libpthread - Advanced 13279 Realtime Threads in this part of the specification. See also 13280 the relevant architecture specific supplement. 13281 _________________________________________________________ 13282 13283 13.9.3. Posix Threads 13284 _________________________________________________________ 13285 13286 13.9.3.1. Interfaces for Posix Threads 13287 13288 An LSB conforming implementation shall provide the generic 13289 functions for Posix Threads specified in Table 13-29, with the 13290 full mandatory functionality as described in the referenced 13291 underlying specification. 13292 13293 Table 13-29. libpthread - Posix Threads Function Interfaces 13294 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 13295 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 13296 [SUSv3] 13297 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 13298 [SUSv3] pthread_attr_getstack [SUSv3] 13299 pthread_attr_getstackaddr [SUSv3] 13300 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 13301 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 13302 [SUSv3] 13303 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 13304 [SUSv3] pthread_attr_setstackaddr [SUSv3] 13305 pthread_attr_setstacksize [SUSv3] 13306 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 13307 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 13308 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 13309 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 13310 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 13311 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 13312 [SUSv3] 13313 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 13314 [SUSv3] pthread_getconcurrency [SUSv3] 13315 pthread_getspecific [SUSv3] pthread_join [SUSv3] 13316 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 13317 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 13318 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 13319 pthread_mutex_trylock [SUSv3] pthread_mutex_unlock [SUSv3] 13320 pthread_mutexattr_destroy [SUSv3] pthread_mutexattr_getpshared 13321 [SUSv3] 13322 pthread_mutexattr_gettype [SUSv3] pthread_mutexattr_init 13323 [SUSv3] pthread_mutexattr_setpshared [SUSv3] 13324 pthread_mutexattr_settype [SUSv3] 13325 pthread_once [SUSv3] pthread_rwlock_destroy [SUSv3] 13326 pthread_rwlock_init [SUSv3] pthread_rwlock_rdlock [SUSv3] 13327 pthread_rwlock_timedrdlock [SUSv3] pthread_rwlock_timedwrlock 13328 [SUSv3] pthread_rwlock_tryrdlock [SUSv3] 13329 pthread_rwlock_trywrlock [SUSv3] 13330 pthread_rwlock_unlock [SUSv3] pthread_rwlock_wrlock [SUSv3] 13331 pthread_rwlockattr_destroy [SUSv3] 13332 pthread_rwlockattr_getpshared [SUSv3] 13333 pthread_rwlockattr_init [SUSv3] pthread_rwlockattr_setpshared 13334 [SUSv3] pthread_self [SUSv3] pthread_setcancelstate [SUSv3] 13335 pthread_setcanceltype [SUSv3] pthread_setconcurrency [SUSv3] 13336 pthread_setspecific [SUSv3] pthread_sigmask [SUSv3] 13337 pthread_testcancel [SUSv3] sem_close [SUSv3] sem_destroy 13338 [SUSv3] sem_getvalue [SUSv3] 13339 sem_init [SUSv3] sem_open [SUSv3] sem_post [SUSv3] 13340 sem_timedwait [SUSv3] 13341 sem_trywait [SUSv3] sem_unlink [SUSv3] sem_wait [SUSv3] 13342 _________________________________________________________ 13343 13344 13.9.4. Thread aware versions of libc interfaces 13345 _________________________________________________________ 13346 13347 13.9.4.1. Interfaces for Thread aware versions of libc interfaces 13348 13349 An LSB conforming implementation shall provide the generic 13350 functions for Thread aware versions of libc interfaces 13351 specified in Table 13-30, with the full mandatory 13352 functionality as described in the referenced underlying 13353 specification. 13354 13355 Table 13-30. libpthread - Thread aware versions of libc 13356 interfaces Function Interfaces 13357 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LFS] 13358 pwrite [SUSv3] pwrite64 [LFS] 13359 _________________________________________________________ 13360 13361 13.10. Data Definitions for libpthread 13362 13363 This section defines global identifiers and their values that 13364 are associated with interfaces contained in libpthread. These 13365 definitions are organized into groups that correspond to 13366 system headers. This convention is used as a convenience for 13367 the reader, and does not imply the existence of these headers, 13368 or their content. Where an interface is defined as requiring a 13369 particular system header file all of the data definitions for 13370 that system header file presented here shall be in effect. 13371 13372 This section gives data definitions to promote binary 13373 application portability, not to repeat source interface 13374 definitions available elsewhere. System providers and 13375 application developers should use this ABI to supplement - not 13376 to replace - source interface definition specifications. 13377 13378 This specification uses the ISO C (1999) C Language as the 13379 reference programming language, and data definitions are 13380 specified in ISO C format. The C language is used here as a 13381 convenient notation. Using a C language description of these 13382 data objects does not preclude their use by other programming 13383 languages. 13384 _________________________________________________________ 13385 13386 13.10.1. pthread.h 13387 13388 #define PTHREAD_SCOPE_SYSTEM 0 13389 #define PTHREAD_MUTEX_DEFAULT 1 13390 #define PTHREAD_MUTEX_NORMAL 1 13391 #define PTHREAD_SCOPE_PROCESS 1 13392 #define PTHREAD_MUTEX_RECURSIVE 2 13393 #define PTHREAD_RWLOCK_DEFAULT_NP 2 13394 #define PTHREAD_MUTEX_ERRORCHECK 3 13395 #define PTHREAD_MUTEX_INITIALIZER \ 13396 {0,0,0,PTHREAD_MUTEX_NORMAL,__LOCK_INITIALIZER} 13397 #define PTHREAD_RWLOCK_INITIALIZER \ 13398 { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP,\ 13399 PTHREAD_PROCESS_PRIVATE } 13400 #define pthread_cleanup_push(routine,arg) \ 13401 {struct _pthread_cleanup_buffer _buffer;\ 13402 _pthread_cleanup_push(&_buffer,(routine),(arg)); 13403 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 13404 #define __LOCK_INITIALIZER { 0, 0 } 13405 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 13406 13407 struct _pthread_cleanup_buffer { 13408 void (*__routine) (void *); 13409 void *__arg; 13410 int __canceltype; 13411 struct _pthread_cleanup_buffer *__prev; 13412 }; 13413 typedef unsigned int pthread_key_t; 13414 typedef int pthread_once_t; 13415 typedef long long int __pthread_cond_align_t; 13416 13417 typedef unsigned long int pthread_t; 13418 struct _pthread_fastlock { 13419 long int __status; 13420 int __spinlock; 13421 }; 13422 13423 typedef struct _pthread_descr_struct *_pthread_descr; 13424 13425 typedef struct { 13426 int __m_reserved; 13427 int __m_count; 13428 _pthread_descr __m_owner; 13429 int __m_kind; 13430 struct _pthread_fastlock __m_lock; 13431 } pthread_mutex_t; 13432 typedef struct { 13433 int __mutexkind; 13434 } pthread_mutexattr_t; 13435 13436 typedef struct { 13437 int __detachstate; 13438 int __schedpolicy; 13439 struct sched_param __schedparam; 13440 int __inheritsched; 13441 int __scope; 13442 size_t __guardsize; 13443 int __stackaddr_set; 13444 void *__stackaddr; 13445 unsigned long int __stacksize; 13446 } pthread_attr_t; 13447 13448 typedef struct { 13449 struct _pthread_fastlock __c_lock; 13450 _pthread_descr __c_waiting; 13451 char __padding[48 - sizeof(struct _pthread_fastlock) - 13452 sizeof(_pthread_descr) - 13453 sizeof(__pthread_cond_align_t)]; 13454 __pthread_cond_align_t __align; 13455 } pthread_cond_t; 13456 typedef struct { 13457 int __dummy; 13458 } pthread_condattr_t; 13459 13460 typedef struct _pthread_rwlock_t { 13461 struct _pthread_fastlock __rw_lock; 13462 int __rw_readers; 13463 _pthread_descr __rw_writer; 13464 _pthread_descr __rw_read_waiting; 13465 _pthread_descr __rw_write_waiting; 13466 int __rw_kind; 13467 int __rw_pshared; 13468 } pthread_rwlock_t; 13469 typedef struct { 13470 int __lockkind; 13471 int __pshared; 13472 } pthread_rwlockattr_t; 13473 13474 #define PTHREAD_CREATE_JOINABLE 0 13475 #define PTHREAD_INHERIT_SCHED 0 13476 #define PTHREAD_ONCE_INIT 0 13477 #define PTHREAD_PROCESS_PRIVATE 0 13478 #define PTHREAD_CREATE_DETACHED 1 13479 #define PTHREAD_EXPLICIT_SCHED 1 13480 #define PTHREAD_PROCESS_SHARED 1 13481 13482 #define PTHREAD_CANCELED ((void*)-1) 13483 #define PTHREAD_CANCEL_DEFERRED 0 13484 #define PTHREAD_CANCEL_ENABLE 0 13485 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 13486 #define PTHREAD_CANCEL_DISABLE 1 13487 13488 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 13489 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 13490 void (*__routine) (void *) 13491 , void *); 13492 extern int pthread_attr_destroy(pthread_attr_t *); 13493 extern int pthread_attr_getdetachstate(const typedef struct { 13494 int __detachstate; 13495 int __schedpolicy; 13496 struct sched_param __schedparam; 13497 int __inheritsched; 13498 int __scope; 13499 size_t __guardsize; 13500 int __stackaddr_set; 13501 void *__stackaddr; 13502 unsigned long int __stacksize;} 13503 pthread_attr_t *, int *); 13504 extern int pthread_attr_getinheritsched(const typedef struct { 13505 int __detachstate; 13506 int __schedpolicy; 13507 struct sched_param __schedparam; 13508 int __inheritsched; 13509 int __scope; 13510 size_t __guardsize; 13511 int __stackaddr_set; 13512 void *__stackaddr; 13513 unsigned long int __stacksize;} 13514 pthread_attr_t *, int *); 13515 extern int pthread_attr_getschedparam(const typedef struct { 13516 int __detachstate; 13517 int __schedpolicy; 13518 struct sched_param __schedparam; 13519 int __inheritsched; 13520 int __scope; 13521 size_t __guardsize; 13522 int __stackaddr_set; 13523 void *__stackaddr; 13524 unsigned long int __stacksize;} 13525 pthread_attr_t *, struct sched_param { 13526 int sched_priority;} 13527 13528 *); 13529 extern int pthread_attr_getschedpolicy(const typedef struct { 13530 int __detachstate; 13531 int __schedpolicy; 13532 struct sched_param __schedparam; 13533 int __inheritsched; 13534 int __scope; 13535 size_t __guardsize; 13536 int __stackaddr_set; 13537 void *__stackaddr; 13538 unsigned long int __stacksize;} 13539 pthread_attr_t *, int *); 13540 extern int pthread_attr_getscope(const typedef struct { 13541 int __detachstate; 13542 int __schedpolicy; 13543 struct sched_param __schedparam; 13544 int __inheritsched; 13545 int __scope; 13546 size_t __guardsize; 13547 int __stackaddr_set; 13548 void *__stackaddr; 13549 unsigned long int __stacksize;} 13550 pthread_attr_t *, int *); 13551 extern int pthread_attr_init(pthread_attr_t *); 13552 extern int pthread_attr_setdetachstate(pthread_attr_t *, int); 13553 extern int pthread_attr_setinheritsched(pthread_attr_t *, int); 13554 extern int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param { 13555 int sched_priority;} 13556 13557 *); 13558 extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); 13559 extern int pthread_attr_setscope(pthread_attr_t *, int); 13560 extern int pthread_cancel(typedef unsigned long int pthread_t); 13561 extern int pthread_cond_broadcast(pthread_cond_t *); 13562 extern int pthread_cond_destroy(pthread_cond_t *); 13563 extern int pthread_cond_init(pthread_cond_t *, const typedef struct { 13564 int __dummy;} 13565 13566 pthread_condattr_t *); 13567 extern int pthread_cond_signal(pthread_cond_t *); 13568 extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *,const struct timespec { 13569 time_t tv_sec; long int tv_nsec;} 13570 13571 *); 13572 extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); 13573 extern int pthread_condattr_destroy(pthread_condattr_t *); 13574 extern int pthread_condattr_init(pthread_condattr_t *); 13575 extern int pthread_create(pthread_t *, const typedef struct { 13576 int __detachstate; 13577 int __schedpolicy; 13578 struct sched_param __schedparam; 13579 int __inheritsched; 13580 int __scope; 13581 size_t __guardsize; 13582 int __stackaddr_set; 13583 void *__stackaddr; 13584 unsigned long int __stacksize;} 13585 pthread_attr_t *, 13586 void *(*__start_routine) (void *p1) 13587 , void *); 13588 extern int pthread_detach(typedef unsigned long int pthread_t); 13589 extern int pthread_equal(typedef unsigned long int pthread_t, 13590 typedef unsigned long int pthread_t); 13591 extern void pthread_exit(void *); 13592 extern int pthread_getschedparam(typedef unsigned long int pthread_t, 13593 int *, struct sched_param { 13594 int sched_priority;} 13595 13596 *); 13597 extern void *pthread_getspecific(typedef unsigned int pthread_key_t); 13598 extern int pthread_join(typedef unsigned long int pthread_t, void **); 13599 extern int pthread_key_create(pthread_key_t *, void (*destr_func) (void *) 13600 ); 13601 extern int pthread_key_delete(typedef unsigned int pthread_key_t); 13602 extern int pthread_mutex_destroy(pthread_mutex_t *); 13603 extern int pthread_mutex_init(pthread_mutex_t *, const typedef struct { 13604 int __mutexkind;} 13605 13606 pthread_mutexattr_t *); 13607 extern int pthread_mutex_lock(pthread_mutex_t *); 13608 extern int pthread_mutex_trylock(pthread_mutex_t *); 13609 extern int pthread_mutex_unlock(pthread_mutex_t *); 13610 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); 13611 extern int pthread_mutexattr_init(pthread_mutexattr_t *); 13612 extern int pthread_once(pthread_once_t *, void (*init_routine) (void) 13613 ); 13614 extern int pthread_rwlock_destroy(pthread_rwlock_t *); 13615 extern int pthread_rwlock_init(pthread_rwlock_t *, pthread_rwlockattr_t *); 13616 extern int pthread_rwlock_rdlock(pthread_rwlock_t *); 13617 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); 13618 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); 13619 extern int pthread_rwlock_unlock(pthread_rwlock_t *); 13620 extern int pthread_rwlock_wrlock(pthread_rwlock_t *); 13621 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); 13622 extern int pthread_rwlockattr_getpshared(const typedef struct { 13623 int __lockkind; int __pshared;} 13624 pthread_rwlockattr_t *, int *); 13625 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); 13626 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); 13627 extern typedef unsigned long int pthread_t pthread_self(void); 13628 extern int pthread_setcancelstate(int, int *); 13629 extern int pthread_setcanceltype(int, int *); 13630 extern int pthread_setschedparam(typedef unsigned long int pthread_t, int, const struct sched_param { 13631 int sched_priority;} 13632 13633 *); 13634 extern int pthread_setspecific(typedef unsigned int pthread_key_t, 13635 const void *); 13636 extern void pthread_testcancel(void); 13637 extern int pthread_attr_getguardsize(const typedef struct { 13638 int __detachstate; 13639 int __schedpolicy; 13640 struct sched_param __schedparam; 13641 int __inheritsched; 13642 int __scope; 13643 size_t __guardsize; 13644 int __stackaddr_set; 13645 void *__stackaddr; 13646 unsigned long int __stacksize;} 13647 pthread_attr_t *, size_t *); 13648 extern int pthread_attr_setguardsize(pthread_attr_t *, 13649 typedef unsigned long int size_t); 13650 extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); 13651 extern int pthread_attr_getstackaddr(const typedef struct { 13652 int __detachstate; 13653 int __schedpolicy; 13654 struct sched_param __schedparam; 13655 int __inheritsched; 13656 int __scope; 13657 size_t __guardsize; 13658 int __stackaddr_set; 13659 void *__stackaddr; 13660 unsigned long int __stacksize;} 13661 pthread_attr_t *, void **); 13662 extern int pthread_attr_setstacksize(pthread_attr_t *, 13663 typedef unsigned long int size_t); 13664 extern int pthread_attr_getstacksize(const typedef struct { 13665 int __detachstate; 13666 int __schedpolicy; 13667 struct sched_param __schedparam; 13668 int __inheritsched; 13669 int __scope; 13670 size_t __guardsize; 13671 int __stackaddr_set; 13672 void *__stackaddr; 13673 unsigned long int __stacksize;} 13674 pthread_attr_t *, size_t *); 13675 extern int pthread_mutexattr_gettype(const typedef struct { 13676 int __mutexkind;} 13677 pthread_mutexattr_t *, int *); 13678 extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); 13679 extern int pthread_getconcurrency(void); 13680 extern int pthread_setconcurrency(int); 13681 extern int pthread_attr_getstack(const typedef struct { 13682 int __detachstate; 13683 int __schedpolicy; 13684 struct sched_param __schedparam; 13685 int __inheritsched; 13686 int __scope; 13687 size_t __guardsize; 13688 int __stackaddr_set; 13689 void *__stackaddr; 13690 unsigned long int __stacksize;} 13691 pthread_attr_t *, void **, size_t *); 13692 extern int pthread_attr_setstack(pthread_attr_t *, void *, 13693 typedef unsigned long int size_t); 13694 extern int pthread_condattr_getpshared(const typedef struct { 13695 int __dummy;} 13696 pthread_condattr_t *, int *); 13697 extern int pthread_condattr_setpshared(pthread_condattr_t *, int); 13698 extern int pthread_mutexattr_getpshared(const typedef struct { 13699 int __mutexkind;} 13700 pthread_mutexattr_t *, int *); 13701 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); 13702 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *, const structtimespec { 13703 time_t tv_sec; long int tv_nsec;} 13704 13705 *); 13706 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *, const structtimespec { 13707 time_t tv_sec; long int tv_nsec;} 13708 13709 *); 13710 extern int __register_atfork(void (*prepare) (void) 13711 , void (*parent) (void) 13712 , void (*child) (void) 13713 , void *); 13714 extern int pthread_setschedprio(typedef unsigned long int pthread_t, int); 13715 _________________________________________________________ 13716 13717 13.10.2. semaphore.h 13718 13719 typedef struct { 13720 struct _pthread_fastlock __sem_lock; 13721 int __sem_value; 13722 _pthread_descr __sem_waiting; 13723 } sem_t; 13724 13725 #define SEM_FAILED ((sem_t*)0) 13726 13727 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 13728 13729 extern int sem_close(sem_t *); 13730 extern int sem_destroy(sem_t *); 13731 extern int sem_getvalue(sem_t *, int *); 13732 extern int sem_init(sem_t *, int, unsigned int); 13733 extern sem_t *sem_open(const char *, int, ...); 13734 extern int sem_post(sem_t *); 13735 extern int sem_trywait(sem_t *); 13736 extern int sem_unlink(const char *); 13737 extern int sem_wait(sem_t *); 13738 extern int sem_timedwait(sem_t *, const struct timespec *); 13739 _________________________________________________________ 13740 13741 13.11. Interface Definitions for libpthread 13742 13743 Table of Contents 13744 _pthread_cleanup_pop -- establish cancellation handlers 13745 _pthread_cleanup_push -- establish cancellation handlers 13746 13747 The interfaces defined on the following pages are included in 13748 libpthread and are defined by this specification. Unless 13749 otherwise noted, these interfaces shall be included in the 13750 source standard. 13751 13752 Other interfaces listed in Section 13.9 shall behave as 13753 described in the referenced base document. 13754 13755 _pthread_cleanup_pop 13756 13757 Name 13758 13759 _pthread_cleanup_pop -- establish cancellation handlers 13760 13761 Synopsis 13762 13763 #include 13764 13765 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 13766 int); 13767 13768 Description 13769 13770 The _pthread_cleanup_pop() function provides an implementation 13771 of the pthread_cleanup_pop() macro described in ISO POSIX 13772 (2003). 13773 13774 The _pthread_cleanup_pop() function is not in the source 13775 standard; it is only in the binary standard. 13776 13777 _pthread_cleanup_push 13778 13779 Name 13780 13781 _pthread_cleanup_push -- establish cancellation handlers 13782 13783 Synopsis 13784 13785 #include 13786 13787 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 13788 void (*) (void *), void *); 13789 13790 Description 13791 13792 The _pthread_cleanup_push() function provides an 13793 implementation of the pthread_cleanup_push() macro described 13794 in ISO POSIX (2003). 13795 13796 The _pthread_cleanup_push() function is not in the source 13797 standard; it is only in the binary standard. 13798 _________________________________________________________ 13799 13800 13.12. Interfaces for libgcc_s 13801 13802 Table 13-31 defines the library name and shared object name 13803 for the libgcc_s library 13804 13805 Table 13-31. libgcc_s Definition 13806 Library: libgcc_s 13807 SONAME: libgcc_s.so.1 13808 _________________________________________________________ 13809 13810 13.12.1. Unwind Library 13811 _________________________________________________________ 13812 13813 13.12.1.1. Interfaces for Unwind Library 13814 13815 No external functions are defined for libgcc_s - Unwind 13816 Library in this part of the specification. See also the 13817 relevant architecture specific supplement. 13818 _________________________________________________________ 13819 13820 13.13. Data Definitions for libgcc_s 13821 13822 This section defines global identifiers and their values that 13823 are associated with interfaces contained in libgcc_s. These 13824 definitions are organized into groups that correspond to 13825 system headers. This convention is used as a convenience for 13826 the reader, and does not imply the existence of these headers, 13827 or their content. Where an interface is defined as requiring a 13828 particular system header file all of the data definitions for 13829 that system header file presented here shall be in effect. 13830 13831 This section gives data definitions to promote binary 13832 application portability, not to repeat source interface 13833 definitions available elsewhere. System providers and 13834 application developers should use this ABI to supplement - not 13835 to replace - source interface definition specifications. 13836 13837 This specification uses the ISO C (1999) C Language as the 13838 reference programming language, and data definitions are 13839 specified in ISO C format. The C language is used here as a 13840 convenient notation. Using a C language description of these 13841 data objects does not preclude their use by other programming 13842 languages. 13843 _________________________________________________________ 13844 13845 13.13.1. unwind.h 13846 13847 struct _Unwind_Context; 13848 13849 typedef void *_Unwind_Ptr; 13850 typedef unsigned int _Unwind_Word; 13851 13852 typedef enum { 13853 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 13854 1, _URC_FATAL_PHASE2_ERROR = 2, _URC_FATAL_PHASE1_ERROR = 13855 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 13856 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 13857 7, _URC_CONTINUE_UNWIND = 8 13858 } _Unwind_Reason_Code; 13859 13860 struct _Unwind_Exception { 13861 u_int64_t exception_class; 13862 _Unwind_Exception_Cleanup_Fn exception_cleanup; 13863 u_int64_t private_1; 13864 u_int64_t private_2; 13865 }; 13866 13867 #define _UA_SEARCH_PHASE 1 13868 #define _UA_END_OF_STACK 16 13869 #define _UA_CLEANUP_PHASE 2 13870 #define _UA_HANDLER_FRAME 4 13871 #define _UA_FORCE_UNWIND 8 13872 13873 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13874 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13875 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13876 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13877 _Unwind_Stop_Fn, void *); 13878 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13879 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13880 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 13881 *); 13882 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13883 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13884 *); 13885 extern void _Unwind_Resume(struct _Unwind_Exception *); 13886 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13887 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13888 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13889 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13890 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13891 _Unwind_Stop_Fn, void *); 13892 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13893 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13894 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13895 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 13896 *); 13897 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13898 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13899 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13900 *); 13901 extern void _Unwind_Resume(struct _Unwind_Exception *); 13902 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13903 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13904 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13905 _Unwind_Stop_Fn, void *); 13906 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13907 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13908 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13909 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 13910 *); 13911 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13912 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13913 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13914 *); 13915 extern void _Unwind_Resume(struct _Unwind_Exception *); 13916 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13917 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13918 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13919 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13920 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13921 _Unwind_Stop_Fn, void *); 13922 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13923 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13924 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13925 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 13926 *); 13927 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13928 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13929 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13930 *); 13931 extern void _Unwind_Resume(struct _Unwind_Exception *); 13932 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13933 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13934 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13935 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13936 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13937 _Unwind_Stop_Fn, void *); 13938 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13939 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13940 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13941 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 13942 *); 13943 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13944 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13945 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13946 *); 13947 extern void _Unwind_Resume(struct _Unwind_Exception *); 13948 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13949 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13950 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13951 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13952 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13953 _Unwind_Stop_Fn, void *); 13954 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13955 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13956 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13957 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); 13958 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13959 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13960 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13961 *); 13962 extern void _Unwind_Resume(struct _Unwind_Exception *); 13963 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13964 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13965 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 13966 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 13967 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 13968 _Unwind_Stop_Fn, void *); 13969 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 13970 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 13971 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 13972 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); 13973 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 13974 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 13975 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 13976 *); 13977 extern void _Unwind_Resume(struct _Unwind_Exception *); 13978 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 13979 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 13980 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13981 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13982 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13983 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13984 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13985 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13986 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 13987 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13988 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13989 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13990 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13991 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13992 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13993 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 13994 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 13995 _Unwind_Exception*); 13996 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 13997 _Unwind_Exception*); 13998 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 13999 _Unwind_Exception*); 14000 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 14001 _Unwind_Exception*); 14002 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 14003 _Unwind_Exception*); 14004 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 14005 _Unwind_Exception*); 14006 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 14007 _Unwind_Exception*); 14008 extern void *_Unwind_FindEnclosingFunction(void *); 14009 extern void *_Unwind_FindEnclosingFunction(void *); 14010 extern void *_Unwind_FindEnclosingFunction(void *); 14011 extern void *_Unwind_FindEnclosingFunction(void *); 14012 extern void *_Unwind_FindEnclosingFunction(void *); 14013 extern void *_Unwind_FindEnclosingFunction(void *); 14014 extern void *_Unwind_FindEnclosingFunction(void *); 14015 extern _Unwind_Word _Unwind_GetBSP(struct _Unwind_Context *); 14016 _________________________________________________________ 14017 14018 13.14. Interfaces for libdl 14019 14020 Table 13-32 defines the library name and shared object name 14021 for the libdl library 14022 14023 Table 13-32. libdl Definition 14024 Library: libdl 14025 SONAME: libdl.so.2 14026 14027 The behavior of the interfaces in this library is specified by 14028 the following specifications: 14029 14030 [LSB] This Specification 14031 [SUSv3] ISO POSIX (2003) 14032 _________________________________________________________ 14033 14034 13.14.1. Dynamic Loader 14035 _________________________________________________________ 14036 14037 13.14.1.1. Interfaces for Dynamic Loader 14038 14039 An LSB conforming implementation shall provide the generic 14040 functions for Dynamic Loader specified in Table 13-33, with 14041 the full mandatory functionality as described in the 14042 referenced underlying specification. 14043 14044 Table 13-33. libdl - Dynamic Loader Function Interfaces 14045 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 14046 dlsym [LSB] 14047 _________________________________________________________ 14048 14049 13.15. Data Definitions for libdl 14050 14051 This section defines global identifiers and their values that 14052 are associated with interfaces contained in libdl. These 14053 definitions are organized into groups that correspond to 14054 system headers. This convention is used as a convenience for 14055 the reader, and does not imply the existence of these headers, 14056 or their content. Where an interface is defined as requiring a 14057 particular system header file all of the data definitions for 14058 that system header file presented here shall be in effect. 14059 14060 This section gives data definitions to promote binary 14061 application portability, not to repeat source interface 14062 definitions available elsewhere. System providers and 14063 application developers should use this ABI to supplement - not 14064 to replace - source interface definition specifications. 14065 14066 This specification uses the ISO C (1999) C Language as the 14067 reference programming language, and data definitions are 14068 specified in ISO C format. The C language is used here as a 14069 convenient notation. Using a C language description of these 14070 data objects does not preclude their use by other programming 14071 languages. 14072 _________________________________________________________ 14073 14074 13.15.1. dlfcn.h 14075 14076 #define RTLD_NEXT ((void *) -1l) 14077 #define RTLD_LOCAL 0 14078 #define RTLD_LAZY 0x00001 14079 #define RTLD_NOW 0x00002 14080 #define RTLD_GLOBAL 0x00100 14081 14082 typedef struct { 14083 char *dli_fname; 14084 void *dli_fbase; 14085 char *dli_sname; 14086 void *dli_saddr; 14087 } Dl_info; 14088 extern int dladdr(const void *, Dl_info *); 14089 extern int dlclose(void *); 14090 extern char *dlerror(void); 14091 extern void *dlopen(char *, int); 14092 extern void *dlsym(void *, char *); 14093 _________________________________________________________ 14094 14095 13.16. Interface Definitions for libdl 14096 14097 Table of Contents 14098 dladdr -- find the shared object containing a given address 14099 dlopen -- open dynamic object 14100 dlsym -- obtain the address of a symbol from a dlopen object 14101 14102 The interfaces defined on the following pages are included in 14103 libdl and are defined by this specification. Unless otherwise 14104 noted, these interfaces shall be included in the source 14105 standard. 14106 14107 Other interfaces listed in Section 13.14 shall behave as 14108 described in the referenced base document. 14109 14110 dladdr 14111 14112 Name 14113 14114 dladdr -- find the shared object containing a given address 14115 14116 Synopsis 14117 14118 #include 14119 14120 typedef struct { 14121 const char *dli_fname; 14122 void *dli_fbase; 14123 const char *dli_sname; 14124 void *dli_saddr; 14125 } Dl_info; 14126 14127 int dladdr(const void * addr, Dl_info * dlip); 14128 14129 Description 14130 14131 The dladdr() function shall query the dynamic linker for 14132 information about the shared object containing the address 14133 addr. The information shall be returned in the user supplied 14134 data structure referenced by dlip. 14135 14136 The structure shall contain at least the following members: 14137 14138 dli_fname 14139 14140 The pathname of the shared object containing the address 14141 dli_fbase 14142 14143 The base address at which the shared object is mapped into the 14144 address space of the calling process. 14145 dli_sname 14146 14147 The name of the nearest runtime symbol with value less than or 14148 equal to addr. Where possible, the symbol name shall be 14149 returned as it would appear in C source code. 14150 14151 If no symbol with a suitable value is found, both this field 14152 and dli_saddr shall be set to NULL. 14153 dli_saddr 14154 14155 The address of the symbol returned in dli_sname. This address 14156 has type "pointer to type", where type is the type of the 14157 symbol dli_sname. 14158 14159 Example: If the symbol in dli_sname is a function, then the 14160 type of dli_saddr is of type "pointer to function". 14161 14162 The behavior of dladdr() is only specified in dynamically 14163 linked programs. 14164 14165 Return Value 14166 14167 On success, dladdr() shall return non-zero, and the structure 14168 referenced by dlip shall be filled in as described. Otherwise, 14169 dladdr() shall return zero, and the cause of the error can be 14170 fetched with dlerror(). 14171 14172 Errors 14173 14174 See dlerror(). 14175 14176 Environment 14177 14178 LD_LIBRARY_PATH 14179 14180 directory search-path for object files 14181 14182 dlopen 14183 14184 Name 14185 14186 dlopen -- open dynamic object 14187 14188 Synopsis 14189 14190 #include 14191 14192 void * dlopen(const char * filename, int flag); 14193 14194 Description 14195 14196 The dlopen() function shall behave as specified in ISO POSIX 14197 (2003), but with additional behaviors listed below. 14198 14199 If the file argument does not contain a slash character, then 14200 the system shall look for a library of that name in at least 14201 the following directories, and use the first one which is 14202 found: 14203 14204 * The directories specified by the DT_RPATH dynamic entry. 14205 * The directories specified in the LD_LIBRARY_PATH 14206 environment variable (which is a colon separated list of 14207 pathnames). This step shall be skipped for setuid and 14208 setgid executables. 14209 * A set of directories sufficient to contain the libraries 14210 specified in this standard. 14211 14212 Note: Traditionally, /lib and /usr/lib. This case would 14213 also cover cases in which the system used the mechanism of 14214 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 14215 Example: An application which is not linked against libm 14216 may choose to dlopen libm. 14217 14218 dlsym 14219 14220 Name 14221 14222 dlsym -- obtain the address of a symbol from a dlopen object 14223 14224 Description 14225 14226 dlsym() is as specified in the ISO POSIX (2003), but with 14227 differences as listed below. 14228 14229 The special purpose value for handle RTLD_NEXT 14230 14231 The value RTLD_NEXT, which is reserved for future use shall be 14232 available, with the behavior as described in ISO POSIX (2003). 14233 _________________________________________________________ 14234 14235 13.17. Interfaces for librt 14236 14237 Table 13-34 defines the library name and shared object name 14238 for the librt library 14239 14240 Table 13-34. librt Definition 14241 Library: librt 14242 SONAME: librt.so.1 14243 14244 The behavior of the interfaces in this library is specified by 14245 the following specifications: 14246 14247 [SUSv3] ISO POSIX (2003) 14248 _________________________________________________________ 14249 14250 13.17.1. Shared Memory Objects 14251 _________________________________________________________ 14252 14253 13.17.1.1. Interfaces for Shared Memory Objects 14254 14255 An LSB conforming implementation shall provide the generic 14256 functions for Shared Memory Objects specified in Table 13-35, 14257 with the full mandatory functionality as described in the 14258 referenced underlying specification. 14259 14260 Table 13-35. librt - Shared Memory Objects Function Interfaces 14261 shm_open [SUSv3] shm_unlink [SUSv3] 14262 _________________________________________________________ 14263 14264 13.17.2. Clock 14265 _________________________________________________________ 14266 14267 13.17.2.1. Interfaces for Clock 14268 14269 An LSB conforming implementation shall provide the generic 14270 functions for Clock specified in Table 13-36, with the full 14271 mandatory functionality as described in the referenced 14272 underlying specification. 14273 14274 Table 13-36. librt - Clock Function Interfaces 14275 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 14276 [SUSv3] clock_nanosleep [SUSv3] 14277 clock_settime [SUSv3] 14278 _________________________________________________________ 14279 14280 13.17.3. Timers 14281 _________________________________________________________ 14282 14283 13.17.3.1. Interfaces for Timers 14284 14285 An LSB conforming implementation shall provide the generic 14286 functions for Timers specified in Table 13-37, with the full 14287 mandatory functionality as described in the referenced 14288 underlying specification. 14289 14290 Table 13-37. librt - Timers Function Interfaces 14291 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 14292 [SUSv3] timer_gettime [SUSv3] 14293 timer_settime [SUSv3] 14294 _________________________________________________________ 14295 14296 13.18. Interfaces for libcrypt 14297 14298 Table 13-38 defines the library name and shared object name 14299 for the libcrypt library 14300 14301 Table 13-38. libcrypt Definition 14302 Library: libcrypt 14303 SONAME: libcrypt.so.1 14304 14305 The behavior of the interfaces in this library is specified by 14306 the following specifications: 14307 14308 [SUSv3] ISO POSIX (2003) 14309 _________________________________________________________ 14310 14311 13.18.1. Encryption 14312 _________________________________________________________ 14313 14314 13.18.1.1. Interfaces for Encryption 14315 14316 An LSB conforming implementation shall provide the generic 14317 functions for Encryption specified in Table 13-39, with the 14318 full mandatory functionality as described in the referenced 14319 underlying specification. 14320 14321 Table 13-39. libcrypt - Encryption Function Interfaces 14322 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 14323 _________________________________________________________ 14324 14325 13.19. Interfaces for libpam 14326 14327 Table 13-40 defines the library name and shared object name 14328 for the libpam library 14329 14330 Table 13-40. libpam Definition 14331 Library: libpam 14332 SONAME: libpam.so.0 14333 14334 The Pluggable Authentication Module (PAM) interfaces allow 14335 applications to request authentication via a system 14336 administrator defined mechanism, known as a service. 14337 14338 A single service name, other, shall always be present. The 14339 behavior of this service shall be determined by the system 14340 administrator. Additional service names may also exist. 14341 14342 Note: Future versions of this specification might define 14343 additional service names. 14344 14345 The behavior of the interfaces in this library is specified by 14346 the following specifications: 14347 14348 [LSB] This Specification 14349 _________________________________________________________ 14350 14351 13.19.1. Pluggable Authentication API 14352 _________________________________________________________ 14353 14354 13.19.1.1. Interfaces for Pluggable Authentication API 14355 14356 An LSB conforming implementation shall provide the generic 14357 functions for Pluggable Authentication API specified in Table 14358 13-41, with the full mandatory functionality as described in 14359 the referenced underlying specification. 14360 14361 Table 13-41. libpam - Pluggable Authentication API Function 14362 Interfaces 14363 pam_acct_mgmt [LSB] pam_authenticate [LSB] pam_chauthtok [LSB] 14364 pam_close_session [LSB] 14365 pam_end [LSB] pam_fail_delay [LSB] pam_get_item [LSB] 14366 pam_getenvlist [LSB] 14367 pam_open_session [LSB] pam_set_item [LSB] pam_setcred [LSB] 14368 pam_start [LSB] 14369 pam_strerror [LSB] 14370 _________________________________________________________ 14371 14372 13.20. Data Definitions for libpam 14373 14374 This section defines global identifiers and their values that 14375 are associated with interfaces contained in libpam. These 14376 definitions are organized into groups that correspond to 14377 system headers. This convention is used as a convenience for 14378 the reader, and does not imply the existence of these headers, 14379 or their content. Where an interface is defined as requiring a 14380 particular system header file all of the data definitions for 14381 that system header file presented here shall be in effect. 14382 14383 This section gives data definitions to promote binary 14384 application portability, not to repeat source interface 14385 definitions available elsewhere. System providers and 14386 application developers should use this ABI to supplement - not 14387 to replace - source interface definition specifications. 14388 14389 This specification uses the ISO C (1999) C Language as the 14390 reference programming language, and data definitions are 14391 specified in ISO C format. The C language is used here as a 14392 convenient notation. Using a C language description of these 14393 data objects does not preclude their use by other programming 14394 languages. 14395 _________________________________________________________ 14396 14397 13.20.1. security/pam_appl.h 14398 14399 typedef struct pam_handle pam_handle_t; 14400 struct pam_message { 14401 int msg_style; 14402 const char *msg; 14403 }; 14404 struct pam_response { 14405 char *resp; 14406 int resp_retcode; 14407 }; 14408 14409 struct pam_conv { 14410 int (*conv) (int num_msg, const struct pam_message * *msg, 14411 struct pam_response * *resp, void *appdata_ptr); 14412 void *appdata_ptr; 14413 }; 14414 14415 #define PAM_PROMPT_ECHO_OFF 1 14416 #define PAM_PROMPT_ECHO_ON 2 14417 #define PAM_ERROR_MSG 3 14418 #define PAM_TEXT_INFO 4 14419 14420 #define PAM_SERVICE 1 14421 #define PAM_USER 2 14422 #define PAM_TTY 3 14423 #define PAM_RHOST 4 14424 #define PAM_CONV 5 14425 #define PAM_RUSER 8 14426 #define PAM_USER_PROMPT 9 14427 14428 #define PAM_SUCCESS 0 14429 #define PAM_OPEN_ERR 1 14430 #define PAM_USER_UNKNOWN 10 14431 #define PAM_MAXTRIES 11 14432 #define PAM_NEW_AUTHTOK_REQD 12 14433 #define PAM_ACCT_EXPIRED 13 14434 #define PAM_SESSION_ERR 14 14435 #define PAM_CRED_UNAVAIL 15 14436 #define PAM_CRED_EXPIRED 16 14437 #define PAM_CRED_ERR 17 14438 #define PAM_CONV_ERR 19 14439 #define PAM_SYMBOL_ERR 2 14440 #define PAM_AUTHTOK_ERR 20 14441 #define PAM_AUTHTOK_RECOVER_ERR 21 14442 #define PAM_AUTHTOK_LOCK_BUSY 22 14443 #define PAM_AUTHTOK_DISABLE_AGING 23 14444 #define PAM_TRY_AGAIN 24 14445 #define PAM_ABORT 26 14446 #define PAM_AUTHTOK_EXPIRED 27 14447 #define PAM_BAD_ITEM 29 14448 #define PAM_SERVICE_ERR 3 14449 #define PAM_SYSTEM_ERR 4 14450 #define PAM_BUF_ERR 5 14451 #define PAM_PERM_DENIED 6 14452 #define PAM_AUTH_ERR 7 14453 #define PAM_CRED_INSUFFICIENT 8 14454 #define PAM_AUTHINFO_UNAVAIL 9 14455 14456 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 14457 #define PAM_ESTABLISH_CRED 0x0002U 14458 #define PAM_DELETE_CRED 0x0004U 14459 #define PAM_REINITIALIZE_CRED 0x0008U 14460 #define PAM_REFRESH_CRED 0x0010U 14461 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 14462 #define PAM_SILENT 0x8000U 14463 14464 extern int pam_set_item(pam_handle_t *, int, const void *); 14465 extern int pam_get_item(const pam_handle_t *, int, const void **); 14466 extern const char *pam_strerror(pam_handle_t *, int); 14467 extern char **pam_getenvlist(pam_handle_t *); 14468 extern int pam_fail_delay(pam_handle_t *, unsigned int); 14469 extern int pam_start(const char *, const char *, const struct pam_conv*, 14470 pam_handle_t * *); 14471 extern int pam_end(pam_handle_t *, int); 14472 extern int pam_authenticate(pam_handle_t *, int); 14473 extern int pam_setcred(pam_handle_t *, int); 14474 extern int pam_acct_mgmt(pam_handle_t *, int); 14475 extern int pam_open_session(pam_handle_t *, int); 14476 extern int pam_close_session(pam_handle_t *, int); 14477 extern int pam_chauthtok(pam_handle_t *, int); 14478 _________________________________________________________ 14479 14480 13.21. Interface Definitions for libpam 14481 14482 Table of Contents 14483 pam_acct_mgmt -- establish the status of a user's account 14484 pam_authenticate -- authenticate the user 14485 pam_chauthtok -- change the authentication token for a given 14486 user 14487 14488 pam_close_session -- indicate that an authenticated session 14489 has ended 14490 14491 pam_end -- terminate the use of the PAM library 14492 pam_fail_delay -- specify delay time to use on authentication 14493 error 14494 14495 pam_get_item -- obtain the value of the indicated item. 14496 pam_getenvlist -- returns a pointer to the complete PAM 14497 environment. 14498 14499 pam_open_session -- indicate session has started 14500 pam_set_item -- (re)set the value of an item. 14501 pam_setcred -- set the module-specific credentials of the user 14502 pam_start -- initialize the PAM library 14503 pam_strerror -- returns a string describing the PAM error 14504 14505 The interfaces defined on the following pages are included in 14506 libpam and are defined by this specification. Unless otherwise 14507 noted, these interfaces shall be included in the source 14508 standard. 14509 14510 Other interfaces listed in Section 13.19 shall behave as 14511 described in the referenced base document. 14512 14513 pam_acct_mgmt 14514 14515 Name 14516 14517 pam_acct_mgmt -- establish the status of a user's account 14518 14519 Synopsis 14520 14521 #include 14522 14523 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 14524 14525 Description 14526 14527 pam_acct_mgmt() establishes the account's usability and the 14528 user's accessibility to the system. It is typically called 14529 after the user has been authenticated. 14530 14531 flags may be specified as any valid flag (namely, one of those 14532 applicable to the flags argument of pam_authenticate()). 14533 Additionally, the value of flags may be logically or'd with 14534 PAM_SILENT. 14535 14536 Return Value 14537 14538 PAM_SUCCESS 14539 14540 Success. 14541 PAM_NEW_AUTHTOK_REQD 14542 14543 User is valid, but user's authentication token has expired. 14544 The correct response to this return-value is to require that 14545 the user satisfy the pam_chauthtok() function before obtaining 14546 service. It may not be possible for an application to do this. 14547 In such a case, the user should be denied access until the 14548 account password is updated. 14549 PAM_ACCT_EXPIRED 14550 14551 User is no longer permitted access to the system. 14552 PAM_AUTH_ERR 14553 14554 Authentication error. 14555 PAM_PERM_DENIED 14556 14557 User is not permitted to gain access at this time. 14558 PAM_USER_UNKNOWN 14559 14560 User is not known to a module's account management component. 14561 14562 Note: Errors may be translated to text with pam_strerror(). 14563 14564 pam_authenticate 14565 14566 Name 14567 14568 pam_authenticate -- authenticate the user 14569 14570 Synopsis 14571 14572 #include 14573 14574 int pam_authenticate(pam_handle_t * pamh, int flags); 14575 14576 Description 14577 14578 pam_authenticate() serves as an interface to the 14579 authentication mechanisms of the loaded modules. 14580 14581 flags is an optional parameter that may be specified by the 14582 following value: 14583 14584 PAM_DISALLOW_NULL_AUTHTOK 14585 Instruct the authentication modules to return 14586 PAM_AUTH_ERR if the user does not have a registered 14587 authorization token. 14588 14589 Additionally, the value of flags may be logically or'd with 14590 PAM_SILENT. 14591 14592 The process may need to be privileged in order to successfully 14593 call this function. 14594 14595 Return Value 14596 14597 PAM_SUCCESS 14598 Success. 14599 14600 PAM_AUTH_ERR 14601 User was not authenticated or process did not have 14602 sufficient privileges to perform authentication. 14603 14604 PAM_CRED_INSUFFICIENT 14605 Application does not have sufficient credentials to 14606 authenticate the user. 14607 14608 PAM_AUTHINFO_UNAVAIL 14609 Modules were not able to access the authentication 14610 information. This might be due to a network or hardware 14611 failure, etc. 14612 14613 PAM_USER_UNKNOWN 14614 Supplied username is not known to the authentication 14615 service. 14616 14617 PAM_MAXTRIES 14618 One or more authentication modules has reached its 14619 limit of tries authenticating the user. Do not try 14620 again. 14621 14622 PAM_ABORT 14623 One or more authentication modules failed to load. 14624 14625 Note: Errors may be translated to text with pam_strerror(). 14626 14627 pam_chauthtok 14628 14629 Name 14630 14631 pam_chauthtok -- change the authentication token for a given 14632 user 14633 14634 Synopsis 14635 14636 #include 14637 14638 int pam_chauthtok(pam_handle_t * pamh, const int flags); 14639 14640 Description 14641 14642 pam_chauthtok() is used to change the authentication token for 14643 a given user as indicated by the state associated with the 14644 handle pamh. 14645 14646 flags is an optional parameter that may be specified by the 14647 following value: 14648 14649 PAM_CHANGE_EXPIRED_AUTHTOK 14650 User's authentication token should only be changed if 14651 it has expired. 14652 14653 Additionally, the value of flags may be logically or'd with 14654 PAM_SILENT. 14655 14656 RETURN VALUE 14657 14658 PAM_SUCCESS 14659 Success. 14660 14661 PAM_AUTHTOK_ERR 14662 A module was unable to obtain the new authentication 14663 token. 14664 14665 PAM_AUTHTOK_RECOVER_ERR 14666 A module was unable to obtain the old authentication 14667 token. 14668 14669 PAM_AUTHTOK_LOCK_BUSY 14670 One or more modules were unable to change the 14671 authentication token since it is currently locked. 14672 14673 PAM_AUTHTOK_DISABLE_AGING 14674 Authentication token aging has been disabled for at 14675 least one of the modules. 14676 14677 PAM_PERM_DENIED 14678 Permission denied. 14679 14680 PAM_TRY_AGAIN 14681 Not all modules were in a position to update the 14682 authentication token(s). In such a case, none of the 14683 user's authentication tokens are updated. 14684 14685 PAM_USER_UNKNOWN 14686 User is not known to the authentication token changing 14687 service. 14688 14689 Note: Errors may be translated to text with pam_strerror(). 14690 14691 pam_close_session 14692 14693 Name 14694 14695 pam_close_session -- indicate that an authenticated session 14696 has ended 14697 14698 Synopsis 14699 14700 #include 14701 14702 int pam_close_session(pam_handle_t * pamh, int flags); 14703 14704 Description 14705 14706 pam_close_session() is used to indicate that an authenticated 14707 session has ended. It is used to inform the module that the 14708 user is exiting a session. It should be possible for the PAM 14709 library to open a session and close the same session from 14710 different applications. 14711 14712 flags may have the value PAM_SILENT to indicate that no output 14713 should be generated as a result of this function call. 14714 14715 Return Value 14716 14717 PAM_SUCCESS 14718 14719 Success. 14720 PAM_SESSION_ERR 14721 14722 One of the required loaded modules was unable to close a 14723 session for the user. 14724 14725 Note: Errors may be translated to text with pam_strerror(). 14726 14727 pam_end 14728 14729 Name 14730 14731 pam_end -- terminate the use of the PAM library 14732 14733 Synopsis 14734 14735 #include 14736 14737 int pam_end(pam_handle_t * pamh, int pam_status); 14738 14739 Description 14740 14741 pam_end() terminates use of the PAM library. On success, the 14742 contents of *pamh are no longer valid, and all memory 14743 associated with it is invalid. 14744 14745 Normally, pam_status is passed the value PAM_SUCCESS, but in 14746 the event of an unsuccessful service application, the 14747 appropriate PAM error return value should be used. 14748 14749 Return Value 14750 14751 PAM_SUCCESS 14752 14753 Success. 14754 14755 Note: Errors may be translated to text with pam_strerror(). 14756 14757 pam_fail_delay 14758 14759 Name 14760 14761 pam_fail_delay -- specify delay time to use on authentication 14762 error 14763 14764 Synopsis 14765 14766 #include 14767 14768 int pam_fail_delay(pam_handle_t * pamh, unsigned int 14769 micro_sec); 14770 14771 Description 14772 14773 pam_fail_delay() specifies the minimum delay for the PAM 14774 library to use when an authentication error occurs. The actual 14775 delay can vary by as much at 25%. If this function is called 14776 multiple times, the longest time specified by any of the call 14777 will be used. 14778 14779 The delay is invoked if an authentication error occurs during 14780 the pam_authenticate() or pam_chauthtok() function calls. 14781 14782 Independent of the success of pam_authenticate() or 14783 pam_chauthtok(), the delay time is reset to its default value 14784 of 0 when the PAM library returns control to the application 14785 from these two functions. 14786 14787 Return Value 14788 14789 PAM_SUCCESS 14790 14791 Success. 14792 14793 Note: Errors may be translated to text with pam_strerror(). 14794 14795 pam_get_item 14796 14797 Name 14798 14799 pam_get_item -- obtain the value of the indicated item. 14800 14801 Synopsis 14802 14803 #include 14804 14805 int pam_get_item(const pam_handle_t * pamh, int item_type, 14806 const void * * item); 14807 14808 Description 14809 14810 pam_get_item() obtains the value of the indicated item_type. 14811 The possible values of item_type are the same as listed for 14812 pam_set_item(). 14813 14814 On success, item contains a pointer to the value of the 14815 corresponding item. Note that this is a pointer to the actual 14816 data and should not be free()'d or over-written. 14817 14818 Return Value 14819 14820 PAM_SUCCESS 14821 14822 Success. 14823 PAM_PERM_DENIED 14824 14825 Application passed a NULL pointer for item. 14826 PAM_BAD_ITEM 14827 14828 Application attempted to get an undefined item. 14829 14830 Note: Errors may be translated to text with pam_strerror(). 14831 14832 pam_getenvlist 14833 14834 Name 14835 14836 pam_getenvlist -- returns a pointer to the complete PAM 14837 environment. 14838 14839 Synopsis 14840 14841 #include 14842 14843 char * const * pam_getenvlist(pam_handle_t * pamh); 14844 14845 Description 14846 14847 pam_getenvlist() returns a pointer to the complete PAM 14848 environment. This pointer points to an array of pointers to 14849 NUL-terminated strings and must be terminated by a NULL 14850 pointer. Each string has the form "name=value". 14851 14852 The PAM library module allocates memory for the returned value 14853 and the associated strings. The calling application is 14854 responsible for freeing this memory. 14855 14856 Return Value 14857 14858 pam_getenvlist() returns an array of string pointers 14859 containing the PAM environment. On error, NULL is returned. 14860 14861 pam_open_session 14862 14863 Name 14864 14865 pam_open_session -- indicate session has started 14866 14867 Synopsis 14868 14869 #include 14870 14871 int pam_open_session(pam_handle_t * pamh, int flags); 14872 14873 Description 14874 14875 The pam_open_session() function is used to indicate that an 14876 authenticated session has begun, after the user has been 14877 identified (see pam_authenticate()) and, if necessary, granted 14878 credentials (see pam_setcred()). It is used to inform the 14879 module that the user is currently in a session. It should be 14880 possible for the PAM library to open a session and close the 14881 same session from different applications. 14882 14883 flags may have the value PAM_SILENT to indicate that no output 14884 be generated as a result of this function call. 14885 14886 Return Value 14887 14888 PAM_SUCCESS 14889 14890 Success. 14891 PAM_SESSION_ERR 14892 14893 One of the loaded modules was unable to open a session for the 14894 user. 14895 14896 Note: Errors may be translated to text with pam_strerror(). 14897 14898 pam_set_item 14899 14900 Name 14901 14902 pam_set_item -- (re)set the value of an item. 14903 14904 Synopsis 14905 14906 #include 14907 14908 int pam_set_item(pam_handle_t * pamh, int item_type, const 14909 void * item); 14910 14911 Description 14912 14913 pam_set_item() (re)sets the value of one of the following 14914 item_types: 14915 14916 PAM_SERVICE 14917 14918 service name 14919 PAM_USER 14920 14921 user name 14922 PAM_TTY 14923 14924 terminal name 14925 14926 The value for a device file should include the /dev/ prefix. 14927 The value for graphical, X-based, applications should be the 14928 $DISPLAY variable. 14929 PAM_RHOST 14930 14931 remote host name 14932 PAM_CONV 14933 14934 conversation structure 14935 PAM_RUSER 14936 14937 remote user name 14938 PAM_USER_PROMPT 14939 14940 string to be used when prompting for a user's name 14941 14942 The default value for this string is Please enter username: . 14943 14944 For all item_types other than PAM_CONV, item is a pointer to a 14945 NULL-terminated character string. In the case of PAM_CONV, 14946 item points to an initialized pam_conv structure. 14947 14948 Return Value 14949 14950 PAM_SUCCESS 14951 14952 Success. 14953 PAM_PERM_DENIED 14954 14955 An attempt was made to replace the conversation structure with 14956 a NULL value. 14957 PAM_BUF_ERR 14958 14959 Function ran out of memory making a copy of the item. 14960 PAM_BAD_ITEM 14961 14962 Application attempted to set an undefined item. 14963 14964 Note: Errors may be translated to text with pam_strerror(). 14965 14966 pam_setcred 14967 14968 Name 14969 14970 pam_setcred -- set the module-specific credentials of the user 14971 14972 Synopsis 14973 14974 #include 14975 14976 extern int pam_setcred(pam_handle_t * pamh, int flags); 14977 14978 Description 14979 14980 pam_setcred() sets the module-specific credentials of the 14981 user. It is usually called after the user has been 14982 authenticated, after the account management function has been 14983 called and after a session has been opened for the user. 14984 14985 flags maybe specified from among the following values: 14986 14987 PAM_ESTABLISH_CRED 14988 set credentials for the authentication service 14989 14990 PAM_DELETE_CRED 14991 delete credentials associated with the authentication 14992 service 14993 14994 PAM_REINITIALIZE_CRED 14995 reinitialize the user credentials 14996 14997 PAM_REFRESH_CRED 14998 extend lifetime of the user credentials 14999 15000 Additionally, the value of flags may be logically or'd with 15001 PAM_SILENT. 15002 15003 Return Value 15004 15005 PAM_SUCCESS 15006 15007 Success. 15008 PAM_CRED_UNAVAIL 15009 15010 Module cannot retrieve the user's credentials. 15011 PAM_CRED_EXPIRED 15012 15013 User's credentials have expired. 15014 PAM_USER_UNKNOWN 15015 15016 User is not known to an authentication module. 15017 PAM_CRED_ERR 15018 15019 Module was unable to set the credentials of the user. 15020 15021 Note: Errors may be translated to text with pam_strerror(). 15022 15023 pam_start 15024 15025 Name 15026 15027 pam_start -- initialize the PAM library 15028 15029 Synopsis 15030 15031 #include 15032 15033 int pam_start(const char * service_name, const char * user, 15034 const struct pam_conv * pam_conversation, pam_handle_t * * 15035 pamh); 15036 15037 Description 15038 15039 pam_start() is used to initialize the PAM library. It must be 15040 called prior to any other usage of the PAM library. On 15041 success, *pamh becomes a handle that provides continuity for 15042 successive calls to the PAM library. pam_start() expects 15043 arguments as follows: the service_name of the program, the 15044 username of the individual to be authenticated, a pointer to 15045 an application-supplied pam_conv structure, and a pointer to a 15046 pam_handle_t pointer. 15047 15048 An application must provide the conversation function used for 15049 direct communication between a loaded module and the 15050 application. The application also typically provides a means 15051 for the module to prompt the user for a password, etc. 15052 15053 The structure, pam_conv, is defined to be, 15054 struct pam_conv { 15055 int (*conv) (int num_msg, 15056 const struct pam_message * *msg, 15057 struct pam_response * *resp, 15058 void *appdata_ptr); 15059 void *appdata_ptr; 15060 }; 15061 15062 It is initialized by the application before it is passed to 15063 the library. The contents of this structure are attached to 15064 the *pamh handle. The point of this argument is to provide a 15065 mechanism for any loaded module to interact directly with the 15066 application program; this is why it is called a conversation 15067 structure. 15068 15069 When a module calls the referenced conv() function, 15070 appdata_ptr is set to the second element of this structure. 15071 15072 The other arguments of a call to conv() concern the 15073 information exchanged by module and application. num_msg holds 15074 the length of the array of pointers passed via msg. On 15075 success, the pointer resp points to an array of num_msg 15076 pam_response structures, holding the application-supplied 15077 text. Note that resp is a struct pam_response array and not an 15078 array of pointers. 15079 15080 Return Value 15081 15082 PAM_SUCCESS 15083 15084 Success. 15085 PAM_BUF_ERR 15086 15087 Memory allocation error. 15088 PAM_ABORT 15089 15090 Internal failure. 15091 15092 ERRORS 15093 15094 May be translated to text with pam_strerror(). 15095 15096 pam_strerror 15097 15098 Name 15099 15100 pam_strerror -- returns a string describing the PAM error 15101 15102 Synopsis 15103 15104 #include 15105 15106 const char * pam_strerror(pam_handle_t * pamh, int errnum); 15107 15108 Description 15109 15110 pam_strerror() returns a string describing the PAM error 15111 associated with errnum. 15112 15113 Return Value 15114 15115 On success, this function returns a description of the 15116 indicated error. The application should not free or modify 15117 this string. Otherwise, a string indicating that the error is 15118 unknown shall be returned. It is unspecified whether or not 15119 the string returned is translated according to the setting of 15120 LC_MESSAGES. 15121 15122 IV. Utility Libraries 15123 15124 Table of Contents 15125 14. Utility Libraries 15126 15127 14.1. Introduction 15128 14.2. Interfaces for libz 15129 15130 14.2.1. Compression Library 15131 15132 14.3. Data Definitions for libz 15133 15134 14.3.1. zlib.h 15135 15136 14.4. Interface Definitions for libz 15137 15138 adler32 -- compute Adler 32 Checksum 15139 compress -- compress data 15140 compress2 -- compress data at a specified level 15141 compressBound -- compute compressed data size 15142 crc32 -- compute CRC-32 Checksum 15143 deflate -- compress data 15144 deflateBound -- compute compressed data size 15145 deflateCopy -- copy compression stream 15146 deflateEnd -- free compression stream state 15147 deflateInit2_ -- initialize compression system 15148 deflateInit_ -- initialize compression system 15149 deflateParams -- set compression parameters 15150 deflateReset -- reset compression stream state 15151 deflateSetDictionary -- initialize compression 15152 dictionary 15153 15154 get_crc_table -- generate a table for crc 15155 calculations 15156 15157 gzclose -- close a compressed file stream 15158 gzdopen -- open a compressed file 15159 gzeof -- check for end-of-file on a compressed file 15160 stream 15161 15162 gzerror -- decode an error on a compressed file 15163 stream 15164 15165 gzflush -- flush a compressed file stream 15166 gzgetc -- read a character from a compressed file 15167 gzgets -- read a string from a compressed file 15168 gzopen -- open a compressed file 15169 gzprintf -- format data and compress 15170 gzputc -- write character to a compressed file 15171 gzputs -- string write to a compressed file 15172 gzread -- read from a compressed file 15173 gzrewind -- reset the file-position indicator on a 15174 compressed file stream 15175 15176 gzseek -- reposition a file-position indicator in a 15177 compressed file stream 15178 15179 gzsetparams -- dynamically set compression 15180 parameters 15181 15182 gztell -- find position on a compressed file stream 15183 gzwrite -- write to a compressed file 15184 inflate -- decompress data 15185 inflateEnd -- free decompression stream state 15186 inflateInit2_ -- initialize decompression system 15187 inflateInit_ -- initialize decompression system 15188 inflateReset -- reset decompression stream state 15189 inflateSetDictionary -- initialize decompression 15190 dictionary 15191 15192 inflateSync -- advance compression stream to next 15193 sync point 15194 15195 inflateSyncPoint -- test for synchronization point 15196 uncompress -- uncompress data 15197 zError -- translate error number to string 15198 zlibVersion -- discover library version at run time 15199 15200 14.5. Interfaces for libncurses 15201 15202 14.5.1. Curses 15203 15204 14.6. Data Definitions for libncurses 15205 15206 14.6.1. curses.h 15207 14.6.2. term.h 15208 15209 14.7. Interfaces for libutil 15210 15211 14.7.1. Utility Functions 15212 15213 14.8. Interface Definitions for libutil 15214 15215 forkpty -- Create a new process attached to an 15216 available pseudo-terminal 15217 15218 login -- login utility function 15219 login_tty -- Prepare a terminal for login 15220 logout -- logout utility function 15221 logwtmp -- append an entry to the wtmp file 15222 openpty -- find and open an available 15223 pseudo-terminal 15224 _________________________________________________________ 15225 15226 Chapter 14. Utility Libraries 15227 15228 14.1. Introduction 15229 15230 An LSB-conforming implementation shall also support the 15231 following utility libraries which are built on top of the 15232 interfaces provided by the base libraries. These libraries 15233 implement common functionality, and hide additional system 15234 dependent information such as file formats and device names. 15235 15236 * libz 15237 * libcurses 15238 * libutil 15239 15240 The structure of the definitions for these libraries follows 15241 the same model as used for Base Libraries. 15242 _________________________________________________________ 15243 15244 14.2. Interfaces for libz 15245 15246 Table 14-1 defines the library name and shared object name for 15247 the libz library 15248 15249 Table 14-1. libz Definition 15250 Library: libz 15251 SONAME: libz.so.1 15252 15253 The behavior of the interfaces in this library is specified by 15254 the following specifications: 15255 15256 [LSB] This Specification 15257 _________________________________________________________ 15258 15259 14.2.1. Compression Library 15260 _________________________________________________________ 15261 15262 14.2.1.1. Interfaces for Compression Library 15263 15264 An LSB conforming implementation shall provide the generic 15265 functions for Compression Library specified in Table 14-2, 15266 with the full mandatory functionality as described in the 15267 referenced underlying specification. 15268 15269 Table 14-2. libz - Compression Library Function Interfaces 15270 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 15271 [LSB] 15272 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 15273 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 15274 deflateParams [LSB] 15275 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 15276 [LSB] gzclose [LSB] 15277 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 15278 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 15279 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 15280 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 15281 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] 15282 inflateInit_ [LSB] 15283 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync 15284 [LSB] inflateSyncPoint [LSB] 15285 uncompress [LSB] zError [LSB] zlibVersion [LSB] 15286 _________________________________________________________ 15287 15288 14.3. Data Definitions for libz 15289 15290 This section defines global identifiers and their values that 15291 are associated with interfaces contained in libz. These 15292 definitions are organized into groups that correspond to 15293 system headers. This convention is used as a convenience for 15294 the reader, and does not imply the existence of these headers, 15295 or their content. Where an interface is defined as requiring a 15296 particular system header file all of the data definitions for 15297 that system header file presented here shall be in effect. 15298 15299 This section gives data definitions to promote binary 15300 application portability, not to repeat source interface 15301 definitions available elsewhere. System providers and 15302 application developers should use this ABI to supplement - not 15303 to replace - source interface definition specifications. 15304 15305 This specification uses the ISO C (1999) C Language as the 15306 reference programming language, and data definitions are 15307 specified in ISO C format. The C language is used here as a 15308 convenient notation. Using a C language description of these 15309 data objects does not preclude their use by other programming 15310 languages. 15311 _________________________________________________________ 15312 15313 14.3.1. zlib.h 15314 15315 In addition to the values below, the zlib.h header shall 15316 define the ZLIB_VERSION macro. This macro may be used to check 15317 that the version of the library at run time matches that at 15318 compile time. 15319 15320 See also the zlibVersion() function, which returns the library 15321 version at run time. The first character of the version at 15322 compile time should always match the first character at run 15323 time. 15324 #define Z_NULL 0 15325 #define MAX_WBITS 15 15326 #define MAX_MEM_LEVEL 9 15327 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) 15328 \ 15329 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 15330 #define deflateInit(strm,level) \ 15331 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 15332 #define inflateInit2(strm,windowBits) \ 15333 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 15334 #define inflateInit(strm) \ 15335 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 15336 15337 typedef char charf; 15338 typedef int intf; 15339 15340 typedef void *voidpf; 15341 typedef unsigned int uInt; 15342 typedef unsigned long int uLong; 15343 typedef uLong uLongf; 15344 typedef void *voidp; 15345 typedef unsigned char Byte; 15346 typedef off_t z_off_t; 15347 typedef void *const voidpc; 15348 15349 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 15350 typedef void (*free_func) (voidpf opaque, voidpf address); 15351 struct internal_state { 15352 int dummy; 15353 }; 15354 typedef Byte Bytef; 15355 typedef uInt uIntf; 15356 15357 typedef struct z_stream_s { 15358 Bytef *next_in; 15359 uInt avail_in; 15360 uLong total_in; 15361 Bytef *next_out; 15362 uInt avail_out; 15363 uLong total_out; 15364 char *msg; 15365 struct internal_state *state; 15366 alloc_func zalloc; 15367 free_func zfree; 15368 voidpf opaque; 15369 int data_type; 15370 uLong adler; 15371 uLong reserved; 15372 } z_stream; 15373 15374 typedef z_stream *z_streamp; 15375 typedef voidp gzFile; 15376 15377 #define Z_NO_FLUSH 0 15378 #define Z_PARTIAL_FLUSH 1 15379 #define Z_SYNC_FLUSH 2 15380 #define Z_FULL_FLUSH 3 15381 #define Z_FINISH 4 15382 15383 #define Z_ERRNO (-1) 15384 #define Z_STREAM_ERROR (-2) 15385 #define Z_DATA_ERROR (-3) 15386 #define Z_MEM_ERROR (-4) 15387 #define Z_BUF_ERROR (-5) 15388 #define Z_VERSION_ERROR (-6) 15389 #define Z_OK 0 15390 #define Z_STREAM_END 1 15391 #define Z_NEED_DICT 2 15392 15393 #define Z_DEFAULT_COMPRESSION (-1) 15394 #define Z_NO_COMPRESSION 0 15395 #define Z_BEST_SPEED 1 15396 #define Z_BEST_COMPRESSION 9 15397 15398 #define Z_DEFAULT_STRATEGY 0 15399 #define Z_FILTERED 1 15400 #define Z_HUFFMAN_ONLY 2 15401 15402 #define Z_BINARY 0 15403 #define Z_ASCII 1 15404 #define Z_UNKNOWN 2 15405 15406 #define Z_DEFLATED 8 15407 15408 extern int gzread(gzFile, voidp, unsigned int); 15409 extern int gzclose(gzFile); 15410 extern gzFile gzopen(const char *, const char *); 15411 extern gzFile gzdopen(int, const char *); 15412 extern int gzwrite(gzFile, voidpc, unsigned int); 15413 extern int gzflush(gzFile, int); 15414 extern const char *gzerror(gzFile, int *); 15415 extern uLong adler32(uLong, const Bytef *, uInt); 15416 extern int compress(Bytef *, uLongf *, const Bytef *, uLong); 15417 extern int compress2(Bytef *, uLongf *, const Bytef *, uLong, int); 15418 extern uLong crc32(uLong, const Bytef *, uInt); 15419 extern int deflate(z_streamp, int); 15420 extern int deflateCopy(z_streamp, z_streamp); 15421 extern int deflateEnd(z_streamp); 15422 extern int deflateInit2_(z_streamp, int, int, int, int, int, const char *, 15423 int); 15424 extern int deflateInit_(z_streamp, int, const char *, int); 15425 extern int deflateParams(z_streamp, int, int); 15426 extern int deflateReset(z_streamp); 15427 extern int deflateSetDictionary(z_streamp, const Bytef *, uInt); 15428 extern const uLongf *get_crc_table(void); 15429 extern int gzeof(gzFile); 15430 extern int gzgetc(gzFile); 15431 extern char *gzgets(gzFile, char *, int); 15432 extern int gzprintf(gzFile, const char *, ...); 15433 extern int gzputc(gzFile, int); 15434 extern int gzputs(gzFile, const char *); 15435 extern int gzrewind(gzFile); 15436 extern z_off_t gzseek(gzFile, z_off_t, int); 15437 extern int gzsetparams(gzFile, int, int); 15438 extern z_off_t gztell(gzFile); 15439 extern int inflate(z_streamp, int); 15440 extern int inflateEnd(z_streamp); 15441 extern int inflateInit2_(z_streamp, int, const char *, int); 15442 extern int inflateInit_(z_streamp, const char *, int); 15443 extern int inflateReset(z_streamp); 15444 extern int inflateSetDictionary(z_streamp, const Bytef *, uInt); 15445 extern int inflateSync(z_streamp); 15446 extern int inflateSyncPoint(z_streamp); 15447 extern int uncompress(Bytef *, uLongf *, const Bytef *, uLong); 15448 extern const char *zError(int); 15449 extern const char *zlibVersion(void); 15450 extern uLong deflateBound(z_streamp, uLong); 15451 extern uLong compressBound(uLong); 15452 _________________________________________________________ 15453 15454 14.4. Interface Definitions for libz 15455 15456 Table of Contents 15457 adler32 -- compute Adler 32 Checksum 15458 compress -- compress data 15459 compress2 -- compress data at a specified level 15460 compressBound -- compute compressed data size 15461 crc32 -- compute CRC-32 Checksum 15462 deflate -- compress data 15463 deflateBound -- compute compressed data size 15464 deflateCopy -- copy compression stream 15465 deflateEnd -- free compression stream state 15466 deflateInit2_ -- initialize compression system 15467 deflateInit_ -- initialize compression system 15468 deflateParams -- set compression parameters 15469 deflateReset -- reset compression stream state 15470 deflateSetDictionary -- initialize compression dictionary 15471 get_crc_table -- generate a table for crc calculations 15472 gzclose -- close a compressed file stream 15473 gzdopen -- open a compressed file 15474 gzeof -- check for end-of-file on a compressed file stream 15475 gzerror -- decode an error on a compressed file stream 15476 gzflush -- flush a compressed file stream 15477 gzgetc -- read a character from a compressed file 15478 gzgets -- read a string from a compressed file 15479 gzopen -- open a compressed file 15480 gzprintf -- format data and compress 15481 gzputc -- write character to a compressed file 15482 gzputs -- string write to a compressed file 15483 gzread -- read from a compressed file 15484 gzrewind -- reset the file-position indicator on a compressed 15485 file stream 15486 15487 gzseek -- reposition a file-position indicator in a compressed 15488 file stream 15489 15490 gzsetparams -- dynamically set compression parameters 15491 gztell -- find position on a compressed file stream 15492 gzwrite -- write to a compressed file 15493 inflate -- decompress data 15494 inflateEnd -- free decompression stream state 15495 inflateInit2_ -- initialize decompression system 15496 inflateInit_ -- initialize decompression system 15497 inflateReset -- reset decompression stream state 15498 inflateSetDictionary -- initialize decompression dictionary 15499 inflateSync -- advance compression stream to next sync point 15500 inflateSyncPoint -- test for synchronization point 15501 uncompress -- uncompress data 15502 zError -- translate error number to string 15503 zlibVersion -- discover library version at run time 15504 15505 The interfaces defined on the following pages are included in 15506 libz and are defined by this specification. Unless otherwise 15507 noted, these interfaces shall be included in the source 15508 standard. 15509 15510 Other interfaces listed in Section 14.2 shall behave as 15511 described in the referenced base document. 15512 15513 adler32 15514 15515 Name 15516 15517 adler32 -- compute Adler 32 Checksum 15518 15519 Synopsis 15520 15521 #include 15522 15523 uLong adler32(uLong adler, const Bytef * buf, uInt len); 15524 15525 Description 15526 15527 The adler32() function shall compute a running Adler-32 15528 checksum (as described in RFC 1950: ZLIB Compressed Data 15529 Format Specication). On entry, adler is the previous value for 15530 the checksum, and buf shall point to an array of len bytes of 15531 data to be added to this checksum. The adler32() function 15532 shall return the new checksum. 15533 15534 If buf is NULL (or Z_NULL), adler32() shall return the initial 15535 checksum. 15536 15537 Return Value 15538 15539 The adler32() function shall return the new checksum value. 15540 15541 Errors 15542 15543 None defined. 15544 15545 Application Usage (informative) 15546 15547 The following code fragment demonstrates typical usage of the 15548 adler32() function: 15549 uLong adler = adler32(0L, Z_NULL, 0); 15550 15551 while (read_buffer(buffer, length) != EOF) { 15552 adler = adler32(adler, buffer, length); 15553 } 15554 if (adler != original_adler) error(); 15555 15556 compress 15557 15558 Name 15559 15560 compress -- compress data 15561 15562 Synopsis 15563 15564 #include 15565 15566 int compress(Bytef * dest, uLongf * destLen, const Bytef * 15567 source, uLong sourceLen); 15568 15569 Description 15570 15571 The compress() function shall attempt to compress sourceLen 15572 bytes of data in the buffer source, placing the result in the 15573 buffer dest. 15574 15575 On entry, destLen should point to a value describing the size 15576 of the dest buffer. The application should ensure that this 15577 value be at least (sourceLen × 1.001) + 12. On successful 15578 exit, the variable referenced by destLen shall be updated to 15579 hold the length of compressed data in dest. 15580 15581 The compress() function is equivalent to compress2() with a 15582 level of Z_DEFAULT_LEVEL. 15583 15584 Return Value 15585 15586 On success, compress() shall return Z_OK. Otherwise, 15587 compress() shall return a value to indicate the error. 15588 15589 Errors 15590 15591 On error, compress() shall return a value as described below: 15592 15593 Z_BUF_ERROR 15594 15595 The buffer dest was not large enough to hold the compressed 15596 data. 15597 Z_MEM_ERROR 15598 15599 Insufficient memory. 15600 15601 compress2 15602 15603 Name 15604 15605 compress2 -- compress data at a specified level 15606 15607 Synopsis 15608 15609 #include 15610 15611 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 15612 source, uLong sourceLen, int level); 15613 15614 Description 15615 15616 The compress2() function shall attempt to compress sourceLen 15617 bytes of data in the buffer source, placing the result in the 15618 buffer dest, at the level described by level. The level 15619 supplied shall be a value between 0 and 9, or the value 15620 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 15621 speed, while a level of 9 requests the highest compression. A 15622 level of 0 indicates that no compression should be used, and 15623 the output shall be the same as the input. 15624 15625 On entry, destLen should point to a value describing the size 15626 of the dest buffer. The application should ensure that this 15627 value be at least (sourceLen × 1.001) + 12. On successful 15628 exit, the variable referenced by destLen shall be updated to 15629 hold the length of compressed data in dest. 15630 15631 The compress() function is equivalent to compress2() with a 15632 level of Z_DEFAULT_LEVEL. 15633 15634 Return Value 15635 15636 On success, compress2() shall return Z_OK. Otherwise, 15637 compress2() shall return a value to indicate the error. 15638 15639 Errors 15640 15641 On error, compress2() shall return a value as described below: 15642 15643 Z_BUF_ERROR 15644 15645 The buffer dest was not large enough to hold the compressed 15646 data. 15647 Z_MEM_ERROR 15648 15649 Insufficient memory. 15650 Z_STREAM_ERROR 15651 15652 The level was not Z_DEFAULT_LEVEL, or was not between 0 and 9. 15653 15654 compressBound 15655 15656 Name 15657 15658 compressBound -- compute compressed data size 15659 15660 Synopsis 15661 15662 #include 15663 15664 int compressBound(uLong sourceLen); 15665 15666 Description 15667 15668 The compressBound() function shall estimate the size of buffer 15669 required to compress sourceLen bytes of data using the 15670 compress() or compress2() functions. If successful, the value 15671 returned shall be an upper bound for the size of buffer 15672 required to compress sourceLen bytes of data, using the 15673 parameters stored in stream, in a single call to compress() or 15674 compress2(). 15675 15676 Return Value 15677 15678 The compressBound() shall return a value representing the 15679 upper bound of an array to allocate to hold the compressed 15680 data in a single call to compress() or compress2(). This 15681 function may return a conservative value that may be larger 15682 than sourceLen. 15683 15684 Errors 15685 15686 None defined. 15687 15688 crc32 15689 15690 Name 15691 15692 crc32 -- compute CRC-32 Checksum 15693 15694 Synopsis 15695 15696 #include 15697 15698 uLong crc32(uLong crc, const Bytef * buf, uInt len); 15699 15700 Description 15701 15702 The crc32() function shall compute a running Cyclic Redundancy 15703 Check checksum, as defined in ITU-T V.42. On entry, crc is the 15704 previous value for the checksum, and buf shall point to an 15705 array of len bytes of data to be added to this checksum. The 15706 crc32() function shall return the new checksum. 15707 15708 If buf is NULL (or Z_NULL), crc32() shall return the initial 15709 checksum. 15710 15711 Return Value 15712 15713 The crc32() function shall return the new checksum value. 15714 15715 Errors 15716 15717 None defined. 15718 15719 Application Usage (informative) 15720 15721 The following code fragment demonstrates typical usage of the 15722 crc32() function: 15723 uLong crc = crc32(0L, Z_NULL, 0); 15724 15725 while (read_buffer(buffer, length) != EOF) { 15726 crc = crc32(crc, buffer, length); 15727 } 15728 if (crc != original_crc) error(); 15729 15730 deflate 15731 15732 Name 15733 15734 deflate -- compress data 15735 15736 Synopsis 15737 15738 #include 15739 15740 int deflate(z_streamp stream, int flush); 15741 15742 Description 15743 15744 The deflate() function shall attempt to compress data until 15745 either the input buffer is empty or the output buffer is full. 15746 The stream references a z_stream structure. Before the first 15747 call to deflate(), this structure should have been initialized 15748 by a call to deflateInit2_(). 15749 15750 Note: deflateInit2_() is only in the binary standard; 15751 source level applications should initialize stream via a 15752 call to deflateInit() or deflateInit2(). 15753 15754 In addition, the stream input and output buffers should have 15755 been initialized as follows: 15756 15757 next_in 15758 15759 should point to the data to be compressed. 15760 avail_in 15761 15762 should contain the number of bytes of data in the buffer 15763 referenced by next_in. 15764 next_out 15765 15766 should point to a buffer where compressed data may be placed. 15767 avail_out 15768 15769 should contain the size in bytes of the buffer referenced by 15770 next_out 15771 15772 The deflate() function shall perform one or both of the 15773 following actions: 15774 15775 1. Compress input data from next_in and update next_in, 15776 avail_in and total_in to reflect the data that has been 15777 compressed. 15778 2. Fill the output buffer referenced by next_out, and update 15779 next_out, avail_out and total_out to reflect the 15780 compressed data that has been placed there. If flush is 15781 not Z_NO_FLUSH, and avail_out indicates that there is 15782 still space in output buffer, this action shall always 15783 occur (see below for further details). 15784 15785 The deflate() function shall return when either avail_in 15786 reaches zero (indicating that all the input data has been 15787 compressed), or avail_out reaches zero (indicating that the 15788 output buffer is full). 15789 15790 On success, the deflate() function shall set the adler field 15791 of the stream to the adler32() checksum of all the input data 15792 compressed so far (represented by total_in). 15793 15794 If the deflate() function shall attempt to determine the type 15795 of input data, and set field data_type in stream to Z_ASCII if 15796 the majority of the data bytes fall within the ASCII (ISO 646) 15797 printable character range. Otherwise, it shall set data_type 15798 to Z_BINARY. This data type is informational only, and does 15799 not affect the compression algorithm. 15800 15801 Note: Future versions of the LSB may remove this 15802 requirement, since it is based on an outdated character set 15803 that does not support Internationalization, and does not 15804 affect the algorithm. It is included for information only 15805 at this release. Applications should not depend on this 15806 field. 15807 15808 Flush Operation 15809 15810 The parameter flush determines when compressed bits are added 15811 to the output buffer in next_out. If flush is Z_NO_FLUSH, 15812 deflate() may return with some data pending output, and not 15813 yet added to the output buffer. 15814 15815 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 15816 output to next_out and align the output to a byte boundary. A 15817 synchronization point is generated in the output. 15818 15819 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 15820 Z_SYNC_FLUSH, and the compression state shall be reset. A 15821 synchronization point is generated in the output. 15822 15823 Rationale: Z_SYNC_FLUSH is intended to ensure that the 15824 compressed data contains all the data compressed so far, 15825 and allows a decompressor to reconstruct all of the input 15826 data. Z_FULL_FLUSH allows decompression to restart from 15827 this point if the previous compressed data has been lost or 15828 damaged. Flushing is likely to degrade the performance of 15829 the compression system, and should only be used where 15830 necessary. 15831 15832 If flush is set to Z_FINISH, all pending input shall be 15833 processed and deflate() shall return with Z_STREAM_END if 15834 there is sufficient space in the output buffer at next_out, as 15835 indicated by avail_out. If deflate() is called with flush set 15836 to Z_FINISH and there is insufficient space to store the 15837 compressed data, and no other error has occurred during 15838 compression, deflate() shall return Z_OK, and the application 15839 should call deflate() again with flush unchanged, and having 15840 updated next_out and avail_out. 15841 15842 If all the compression is to be done in a single step, 15843 deflate() may be called with flush set to Z_FINISH immediately 15844 after the stream has been initialized if avail_out is set to 15845 at least the value returned by deflateBound(). 15846 15847 Return Value 15848 15849 On success, deflate() shall return Z_OK, unless flush was set 15850 to Z_FINISH and there was sufficient space in the output 15851 buffer to compress all of the input data. In this case, 15852 deflate() shall return Z_STREAM_END. On error, deflate() shall 15853 return a value to indicate the error. 15854 15855 Note: If deflate() returns Z_OK and has set avail_out to 15856 zero, the function should be called again with the same 15857 value for flush, and with updated next_out and avail_out 15858 until deflate() returns with Z_OK (or Z_STREAM_END if flush 15859 is set to Z_FINISH) and a non-zero avail_out. 15860 15861 Errors 15862 15863 On error, deflate() shall return a value as described below, 15864 and set the msg field of stream to point to a string 15865 describing the error: 15866 15867 Z_BUF_ERROR 15868 15869 No progress is possible; either avail_in or avail_out was 15870 zero. 15871 Z_MEM_ERROR 15872 15873 Insufficient memory. 15874 Z_STREAM_ERROR 15875 15876 The state (as represented in stream) is inconsistent, or 15877 stream was NULL. 15878 15879 deflateBound 15880 15881 Name 15882 15883 deflateBound -- compute compressed data size 15884 15885 Synopsis 15886 15887 #include 15888 15889 int deflateBound(z_streamp stream, uLong sourceLen); 15890 15891 Description 15892 15893 The deflateBound() function shall estimate the size of buffer 15894 required to compress sourceLen bytes of data. If successful, 15895 the value returned shall be an upper bound for the size of 15896 buffer required to compress sourceLen bytes of data, using the 15897 parameters stored in stream, in a single call to deflate() 15898 with flush set to Z_FINISH. 15899 15900 On entry, stream should have been initialized via a call to 15901 deflateInit_() or deflateInit2_(). 15902 15903 Return Value 15904 15905 The deflateBound() shall return a value representing the upper 15906 bound of an array to allocate to hold the compressed data in a 15907 single call to deflate(). If the stream is not correctly 15908 initialized, or is NULL, then deflateBound() may return a 15909 conservative value that may be larger than sourceLen. 15910 15911 Errors 15912 15913 None defined. 15914 15915 deflateCopy 15916 15917 Name 15918 15919 deflateCopy -- copy compression stream 15920 15921 Synopsis 15922 15923 #include 15924 15925 int deflateCopy(z_streamp dest, z_streamp source); 15926 15927 Description 15928 15929 The deflateCopy() function shall copy the compression state 15930 information in source to the uninitialized z_stream structure 15931 referenced by dest. 15932 15933 On successful return, dest will be an exact copy of the stream 15934 referenced by source. The input and output buffer pointers in 15935 next_in and next_out will reference the same data. 15936 15937 Return Value 15938 15939 On success, deflateCopy() shall return Z_OK. Otherwise it 15940 shall return a value less than zero to indicate the error. 15941 15942 Errors 15943 15944 On error, deflateCopy() shall return a value as described 15945 below: 15946 15947 Z_STREAM_ERROR 15948 15949 The state in source is inconsistent, or either source or dest 15950 was NULL. 15951 Z_MEM_ERROR 15952 15953 Insufficient memory available. 15954 15955 Application Usage (informative) 15956 15957 This function can be useful when several compression 15958 strategies will be tried, for example when there are several 15959 ways of pre-processing the input data with a filter. The 15960 streams that will be discarded should then be freed by calling 15961 deflateEnd(). Note that deflateCopy() duplicates the internal 15962 compression state which can be quite large, so this strategy 15963 may be slow and can consume lots of memory. 15964 15965 deflateEnd 15966 15967 Name 15968 15969 deflateEnd -- free compression stream state 15970 15971 Synopsis 15972 15973 #include 15974 15975 int deflateEnd(z_streamp stream); 15976 15977 Description 15978 15979 The deflateEnd() function shall free all allocated state 15980 information referenced by stream. All pending output is 15981 discarded, and unprocessed input is ignored. 15982 15983 Return Value 15984 15985 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 15986 there was pending output discarded or input unprocessed. 15987 Otherwise it shall return Z_STREAM_ERROR to indicate the 15988 error. 15989 15990 Errors 15991 15992 On error, deflateEnd() shall return Z_STREAM_ERROR. The 15993 following conditions shall be treated as an error: 15994 15995 * The state in stream is inconsistent or inappropriate. 15996 * stream is NULL. 15997 15998 deflateInit2_ 15999 16000 Name 16001 16002 deflateInit2_ -- initialize compression system 16003 16004 Synopsis 16005 16006 #include 16007 16008 int deflateInit2_ (z_streamp strm, int level, int method, int 16009 windowBits, int memLevel, int strategy, char * version, int 16010 stream_size); 16011 16012 Description 16013 16014 The deflateInit2_() function shall initialize the compression 16015 system. On entry, strm shall refer to a user supplied z_stream 16016 object (a z_stream_s structure). The following fields shall be 16017 set on entry: 16018 16019 zalloc 16020 16021 a pointer to an alloc_func function, used to allocate state 16022 information. If this is NULL, a default allocation function 16023 will be used. 16024 zfree 16025 16026 a pointer to a free_func function, used to free memory 16027 allocated by the zalloc function. If this is NULL a default 16028 free function will be used. 16029 opaque 16030 16031 If alloc_func is not NULL, opaque is a user supplied pointer 16032 to data that will be passed to the alloc_func and free_func 16033 functions. 16034 16035 If the version requested is not compatible with the version 16036 implemented, or if the size of the z_stream_s structure 16037 provided in stream_size does not match the size in the library 16038 implementation, deflateInit2_() shall fail, and return 16039 Z_VERSION_ERROR. 16040 16041 The level supplied shall be a value between 0 and 9, or the 16042 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16043 speed, while a level of 9 requests the highest compression. A 16044 level of 0 indicates that no compression should be used, and 16045 the output shall be the same as the input. 16046 16047 The method selects the compression algorithm to use. LSB 16048 conforming implementation shall support the Z_DEFLATED method, 16049 and may support other implementation defined methods. 16050 16051 The windowBits parameter shall be a base 2 logarithm of the 16052 window size to use, and shall be a value between 8 and 15. A 16053 smaller value will use less memory, but will result in a 16054 poorer compression ratio, while a higher value will give 16055 better compression but utilize more memory. 16056 16057 The memLevel parameter specifies how much memory to use for 16058 the internal state. The value of memLevel shall be between 1 16059 and MAX_MEM_LEVEL. Smaller values use less memory but are 16060 slower, while higher values use more memory to gain 16061 compression speed. 16062 16063 The strategy parameter selects the compression strategy to 16064 use: 16065 16066 Z_DEFAULT_STRATEGY 16067 16068 use the system default compression strategy. 16069 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 16070 Z_FILTERED 16071 16072 use a compression strategy tuned for data consisting largely 16073 of small values with a fairly random distribution. Z_FILTERED 16074 uses more Huffman encoding and less string matching than 16075 Z_DEFAULT_STRATEGY. 16076 Z_HUFFMAN_ONLY 16077 16078 force Huffman encoding only, with no string match. 16079 16080 The deflateInit2_() function is not in the source standard; it 16081 is only in the binary standard. Source applications should use 16082 the deflateInit2() macro. 16083 16084 Return Value 16085 16086 On success, the deflateInit2_() function shall return Z_OK. 16087 Otherwise, deflateInit2_() shall return a value as described 16088 below to indicate the error. 16089 16090 Errors 16091 16092 On error, deflateInit2_() shall return one of the following 16093 error indicators: 16094 16095 Z_STREAM_ERROR 16096 16097 Invalid parameter. 16098 Z_MEM_ERROR 16099 16100 Insufficient memory available. 16101 Z_VERSION_ERROR 16102 16103 The version requested is not compatible with the library 16104 version, or the z_stream size differs from that used by the 16105 library. 16106 16107 In addition, the msg field of the strm may be set to an error 16108 message. 16109 16110 deflateInit_ 16111 16112 Name 16113 16114 deflateInit_ -- initialize compression system 16115 16116 Synopsis 16117 16118 #include 16119 16120 int deflateInit_(z_streamp stream, int level, const char * 16121 version, int stream_size); 16122 16123 Description 16124 16125 The deflateInit_() function shall initialize the compression 16126 system. On entry, stream shall refer to a user supplied 16127 z_stream object (a z_stream_s structure). The following fields 16128 shall be set on entry: 16129 16130 zalloc 16131 16132 a pointer to an alloc_func function, used to allocate state 16133 information. If this is NULL, a default allocation function 16134 will be used. 16135 zfree 16136 16137 a pointer to a free_func function, used to free memory 16138 allocated by the zalloc function. If this is NULL a default 16139 free function will be used. 16140 opaque 16141 16142 If alloc_func is not NULL, opaque is a user supplied pointer 16143 to data that will be passed to the alloc_func and free_func 16144 functions. 16145 16146 If the version requested is not compatible with the version 16147 implemented, or if the size of the z_stream_s structure 16148 provided in stream_size does not match the size in the library 16149 implementation, deflateInit_() shall fail, and return 16150 Z_VERSION_ERROR. 16151 16152 The level supplied shall be a value between 0 and 9, or the 16153 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16154 speed, while a level of 9 requests the highest compression. A 16155 level of 0 indicates that no compression should be used, and 16156 the output shall be the same as the input. 16157 16158 The deflateInit_() function is not in the source standard; it 16159 is only in the binary standard. Source applications should use 16160 the deflateInit() macro. 16161 16162 The deflateInit_() function is equivalent to 16163 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, 16164 Z_DEFAULT_STRATEGY, version, stream_size); 16165 16166 Return Value 16167 16168 On success, the deflateInit_() function shall return Z_OK. 16169 Otherwise, deflateInit_() shall return a value as described 16170 below to indicate the error. 16171 16172 Errors 16173 16174 On error, deflateInit_() shall return one of the following 16175 error indicators: 16176 16177 Z_STREAM_ERROR 16178 16179 Invalid parameter. 16180 Z_MEM_ERROR 16181 16182 Insufficient memory available. 16183 Z_VERSION_ERROR 16184 16185 The version requested is not compatible with the library 16186 version, or the z_stream size differs from that used by the 16187 library. 16188 16189 In addition, the msg field of the stream may be set to an 16190 error message. 16191 16192 deflateParams 16193 16194 Name 16195 16196 deflateParams -- set compression parameters 16197 16198 Synopsis 16199 16200 #include 16201 16202 int deflateParams(z_streamp stream, int level, int strategy); 16203 16204 Description 16205 16206 The deflateParams() function shall dynamically alter the 16207 compression parameters for the compression stream object 16208 stream. On entry, stream shall refer to a user supplied 16209 z_stream object (a z_stream_s structure), already initialized 16210 via a call to deflateInit_() or deflateInit2_(). 16211 16212 The level supplied shall be a value between 0 and 9, or the 16213 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16214 speed, while a level of 9 requests the highest compression. A 16215 level of 0 indicates that no compression should be used, and 16216 the output shall be the same as the input. If the compression 16217 level is altered by deflateParams(), and some data has already 16218 been compressed with this stream (i.e. total_in is not zero), 16219 and the new level requires a different underlying compression 16220 method, then stream shall be flushed by a call to deflate(). 16221 16222 The strategy parameter selects the compression strategy to 16223 use: 16224 16225 Z_DEFAULT_STRATEGY 16226 16227 use the system default compression strategy. 16228 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 16229 Z_FILTERED 16230 16231 use a compression strategy tuned for data consisting largely 16232 of small values with a fairly random distribution. Z_FILTERED 16233 uses more Huffman encoding and less string matching than 16234 Z_DEFAULT_STRATEGY. 16235 Z_HUFFMAN_ONLY 16236 16237 force Huffman encoding only, with no string match. 16238 16239 Return Value 16240 16241 On success, the deflateParams() function shall return Z_OK. 16242 Otherwise, deflateParams() shall return a value as described 16243 below to indicate the error. 16244 16245 Errors 16246 16247 On error, deflateParams() shall return one of the following 16248 error indicators: 16249 16250 Z_STREAM_ERROR 16251 16252 Invalid parameter. 16253 Z_MEM_ERROR 16254 16255 Insufficient memory available. 16256 Z_BUF_ERROR 16257 16258 Insufficient space in stream to flush the current output. 16259 16260 In addition, the msg field of the strm may be set to an error 16261 message. 16262 16263 Application Usage (Informative) 16264 16265 Applications should ensure that the stream is flushed, e.g. by 16266 a call to deflate(stream, Z_SYNC_FLUSH) before calling 16267 deflateParams(), or ensure that there is sufficient space in 16268 next_out (as identified by avail_out) to ensure that all 16269 pending output and all uncompressed input can be flushed in a 16270 single call to deflate(). 16271 16272 Rationale: Although the deflateParams() function should 16273 flush pending output and compress all pending input, the 16274 result is unspecified if there is insufficient space in the 16275 output buffer. Applications should only call 16276 deflateParams() when the stream is effectively empty 16277 (flushed). 16278 16279 The deflateParams() can be used to switch between 16280 compression and straight copy of the input data, or to 16281 switch to a different kind of input data requiring a 16282 different strategy. 16283 16284 deflateReset 16285 16286 Name 16287 16288 deflateReset -- reset compression stream state 16289 16290 Synopsis 16291 16292 #include 16293 16294 int deflateReset(z_streamp stream); 16295 16296 Description 16297 16298 The deflateReset() function shall reset all state associated 16299 with stream. All pending output shall be discarded, and the 16300 counts of processed bytes (total_in and total_out) shall be 16301 reset to zero. 16302 16303 Return Value 16304 16305 On success, deflateReset() shall return Z_OK. Otherwise it 16306 shall return Z_STREAM_ERROR to indicate the error. 16307 16308 Errors 16309 16310 On error, deflateReset() shall return Z_STREAM_ERROR. The 16311 following conditions shall be treated as an error: 16312 16313 * The state in stream is inconsistent or inappropriate. 16314 * stream is NULL. 16315 16316 deflateSetDictionary 16317 16318 Name 16319 16320 deflateSetDictionary -- initialize compression dictionary 16321 16322 Synopsis 16323 16324 #include 16325 16326 int deflateSetDictionary(z_streamp stream, const Bytef * 16327 dictionary, uInt dictlen); 16328 16329 Description 16330 16331 The deflateSetDictionary() function shall initialize the 16332 compression dictionary associated with stream using the 16333 dictlen bytes referenced by dictionary. 16334 16335 The implementation may silently use a subset of the provided 16336 dictionary if the dictionary cannot fit in the current window 16337 associated with stream (see deflateInit2_()). The application 16338 should ensure that the dictionary is sorted such that the most 16339 commonly used strings occur at the end of the dictionary. 16340 16341 If the dictionary is successfully set, the Adler32 checksum of 16342 the entire provided dictionary shall be stored in the adler 16343 member of stream. This value may be used by the decompression 16344 system to select the correct dictionary. The compression and 16345 decompression systems must use the same dictionary. 16346 16347 stream shall reference an initialized compression stream, with 16348 total_in zero (i.e. no data has been compressed since the 16349 stream was initialized). 16350 16351 Return Value 16352 16353 On success, deflateSetDictionary() shall return Z_OK. 16354 Otherwise it shall return Z_STREAM_ERROR to indicate an error. 16355 16356 Errors 16357 16358 On error, deflateSetDictionary() shall return a value as 16359 described below: 16360 16361 Z_STREAM_ERROR 16362 16363 The state in stream is inconsistent, or stream was NULL. 16364 16365 Application Usage (informative) 16366 16367 The application should provide a dictionary consisting of 16368 strings {{{ed note: do we really mean "strings"? Null 16369 terminated?}}} that are likely to be encountered in the data 16370 to be compressed. The application should ensure that the 16371 dictionary is sorted such that the most commonly used strings 16372 occur at the end of the dictionary. 16373 16374 The use of a dictionary is optional; however if the data to be 16375 compressed is relatively short and has a predictable 16376 structure, the use of a dictionary can substantially improve 16377 the compression ratio. 16378 16379 get_crc_table 16380 16381 Name 16382 16383 get_crc_table -- generate a table for crc calculations 16384 16385 Synopsis 16386 16387 #include 16388 16389 const uLongf * get_crc_table(void); 16390 16391 Description 16392 16393 Generate tables for a byte-wise 32-bit CRC calculation based 16394 on the polynomial: 16395 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+ 16396 1 16397 16398 In a multi-threaded application, get_crc_table() should be 16399 called by one thread to initialize the tables before any other 16400 thread calls any libz function. 16401 16402 Return Value 16403 16404 The get_crc_table() function shall return a pointer to the 16405 first of a set of tables used internally to calculate CRC-32 16406 values (see crc32()). 16407 16408 Errors 16409 16410 None defined. 16411 16412 gzclose 16413 16414 Name 16415 16416 gzclose -- close a compressed file stream 16417 16418 Synopsis 16419 16420 #include 16421 16422 int gzclose (gzFile file ); 16423 16424 Description 16425 16426 The gzclose() function shall close the compressed file stream 16427 file. If file was open for writing, gzclose() shall first 16428 flush any pending output. Any state information allocated 16429 shall be freed. 16430 16431 Return Value 16432 16433 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 16434 shall return an error value as described below. 16435 16436 Errors 16437 16438 On error, gzclose() may set the global variable errno to 16439 indicate the error. The gzclose() shall return a value other 16440 than Z_OK on error. 16441 16442 Z_STREAM_ERROR 16443 16444 file was NULL (or Z_NULL), or did not refer to an open 16445 compressed file stream. 16446 Z_ERRNO 16447 16448 An error occurred in the underlying base libraries, and the 16449 application should check errno for further information. 16450 Z_BUF_ERROR 16451 16452 no compression progress is possible during buffer flush (see 16453 deflate()). 16454 16455 gzdopen 16456 16457 Name 16458 16459 gzdopen -- open a compressed file 16460 16461 Synopsis 16462 16463 #include 16464 16465 gzFile gzdopen ( int fd, const char *mode ); 16466 16467 Description 16468 16469 The gzdopen() function shall attempt to associate the open 16470 file referenced by fd with a gzFile object. The mode argument 16471 is based on that of fopen(), but the mode parameter may also 16472 contain the following characters: 16473 16474 digit 16475 16476 set the compression level to digit. A low value (e.g. 1) means 16477 high speed, while a high value (e.g. 9) means high 16478 compression. A compression level of 0 (zero) means no 16479 compression. See defaultInit2_() for further details. 16480 [fhR] 16481 16482 set the compression strategy to [fhR]. The letter f 16483 corresponds to filtered data, the letter h corresponds to 16484 Huffman only compression, and the letter R corresponds to Run 16485 Length Encoding. See defaultInit2_() for further details. 16486 16487 If fd refers to an uncompressed file, and mode refers to a 16488 read mode, gzdopen() shall attempt to open the file and return 16489 a gzFile object suitable for reading directly from the file 16490 without any decompression. 16491 16492 If mode is NULL, or if mode does not contain one of r, w, or 16493 a, gzdopen() shall return Z_NULL, and need not set any other 16494 error condition. 16495 16496 Example 16497 16498 gzdopen(fileno(stdin), "r"); 16499 16500 Attempt to associate the standard input with a gzFile object. 16501 16502 Return Value 16503 16504 On success, gzdopen() shall return a gzFile object. On 16505 failure, gzdopen() shall return Z_NULL and may set errno 16506 accordingly. 16507 16508 Note: At version 1.2.2, zlib does not set errno for several 16509 error conditions. Applications may not be able to determine 16510 the cause of an error. 16511 16512 Errors 16513 16514 On error, gzdopen() may set the global variable errno to 16515 indicate the error. 16516 16517 gzeof 16518 16519 Name 16520 16521 gzeof -- check for end-of-file on a compressed file stream 16522 16523 Synopsis 16524 16525 #include 16526 16527 int gzeof (gzFile file ); 16528 16529 Description 16530 16531 The gzeof() function shall test the compressed file stream 16532 file for end of file. 16533 16534 Return Value 16535 16536 If file was open for reading and end of file has been reached, 16537 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 16538 16539 Errors 16540 16541 None defined. 16542 16543 gzerror 16544 16545 Name 16546 16547 gzerror -- decode an error on a compressed file stream 16548 16549 Synopsis 16550 16551 #include 16552 16553 const char * gzerror (gzFile file, int * errnum); 16554 16555 Description 16556 16557 The gzerror() function shall return a string describing the 16558 last error to have occurred associated with the open 16559 compressed file stream referred to by file. It shall also set 16560 the location referenced by errnum to an integer value that 16561 further identifies the error. 16562 16563 Return Value 16564 16565 The gzerror() function shall return a string that describes 16566 the last error associated with the given file compressed file 16567 stream. This string shall have the format "%s: %s", with the 16568 name of the file, followed by a colon, a space, and the 16569 description of the error. If the compressed file stream was 16570 opened by a call to gzdopen(), the format of the filename is 16571 unspecified. 16572 16573 Rationale: Although in all current implementations of libz 16574 file descriptors are named "", the code suggests 16575 that this is for debugging purposes only, and may change in 16576 a future release. 16577 16578 It is unspecified if the string returned is determined by the 16579 setting of the LC_MESSAGES category in the current locale. 16580 16581 Errors 16582 16583 None defined. 16584 16585 gzflush 16586 16587 Name 16588 16589 gzflush -- flush a compressed file stream 16590 16591 Synopsis 16592 16593 #include 16594 16595 int gzflush(gzFile file, int flush); 16596 16597 Description 16598 16599 The gzflush() function shall flush pending output to the 16600 compressed file stream identified by file, which must be open 16601 for writing. 16602 16603 Flush Operation 16604 16605 The parameter flush determines which compressed bits are added 16606 to the output file. If flush is Z_NO_FLUSH, gzflush() may 16607 return with some data pending output, and not yet written to 16608 the file. 16609 16610 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 16611 output to file and align the output to a byte boundary. There 16612 may still be data pending compression that is not flushed. 16613 16614 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 16615 Z_SYNC_FLUSH, and the compression state shall be reset. There 16616 may still be data pending compression that is not flushed. 16617 16618 Rationale: Z_SYNC_FLUSH is intended to ensure that the 16619 compressed data contains all the data compressed so far, 16620 and allows a decompressor to reconstruct all of the input 16621 data. Z_FULL_FLUSH allows decompression to restart from 16622 this point if the previous compressed data has been lost or 16623 damaged. Flushing is likely to degrade the performance of 16624 the compression system, and should only be used where 16625 necessary. 16626 16627 If flush is set to Z_FINISH, all pending uncompressed data 16628 shall be compressed and all output shall be flushed. 16629 16630 Return Value 16631 16632 On success, gzflush() shall return the value Z_OK. Otherwise 16633 gzflush() shall return a value to indicate the error, and may 16634 set the error number associated with the compressed file 16635 stream file. 16636 16637 Note: If flush is set to Z_FINISH and the flush operation 16638 is successful, gzflush() will return Z_OK, but the 16639 compressed file stream error value may be set to 16640 Z_STREAM_END. 16641 16642 Errors 16643 16644 On error, gzwrite() shall return an error value, and may set 16645 the error number associated with the stream identified by file 16646 to indicate the error. Applications may use gzerror() to 16647 access this error value. 16648 16649 Z_ERRNO 16650 16651 An underlying base library function has indicated an error. 16652 The global variable errno may be examined for further 16653 information. 16654 Z_STREAM_ERROR 16655 16656 The stream is invalid, is not open for writing, or is in an 16657 invalid state. 16658 Z_BUF_ERROR 16659 16660 no compression progress is possible (see deflate()). 16661 Z_MEM_ERROR 16662 16663 Insufficient memory available to compress. 16664 16665 gzgetc 16666 16667 Name 16668 16669 gzgetc -- read a character from a compressed file 16670 16671 Synopsis 16672 16673 #include 16674 16675 int gzgetc (gzFile file); 16676 16677 Description 16678 16679 The gzgetc() function shall read the next single character 16680 from the compressed file stream referenced by file, which 16681 shall have been opened in a read mode (see gzopen() and 16682 gzdopen()). 16683 16684 Return Value 16685 16686 On success, gzgetc() shall return the uncompressed character 16687 read, otherwise, on end of file or error, gzgetc() shall 16688 return -1. 16689 16690 Errors 16691 16692 On end of file or error, gzgetc() shall return -1. Further 16693 information can be found by calling gzerror() with a pointer 16694 to the compressed file stream. 16695 16696 gzgets 16697 16698 Name 16699 16700 gzgets -- read a string from a compressed file 16701 16702 Synopsis 16703 16704 #include 16705 16706 char * gzgets (gzFile file, char * buf, int len); 16707 16708 Description 16709 16710 The gzgets() function shall attempt to read data from the 16711 compressed file stream file, uncompressing it into buf until 16712 either len-1 bytes have been inserted into buf, or until a 16713 newline character has been uncompressed into buf. A null byte 16714 shall be appended to the uncompressed data. The file shall 16715 have been opened in for reading (see gzopen() and gzdopen()). 16716 16717 Return Value 16718 16719 On success, gzgets() shall return a pointer to buf. Otherwise, 16720 gzgets() shall return Z_NULL. Applications may examine the 16721 cause using gzerror(). 16722 16723 Errors 16724 16725 On error, gzgets() shall return Z_NULL. The following 16726 conditions shall always be treated as an error: 16727 16728 file is NULL, or does not refer to a file open for reading; 16729 buf is NULL; 16730 len is less than or equal to zero. 16731 16732 gzopen 16733 16734 Name 16735 16736 gzopen -- open a compressed file 16737 16738 Synopsis 16739 16740 #include 16741 16742 gzFile gzopen (const char *path , const char *mode ); 16743 16744 Description 16745 16746 The gzopen() function shall open the compressed file named by 16747 path. The mode argument is based on that of fopen(), but the 16748 mode parameter may also contain the following characters: 16749 16750 digit 16751 16752 set the compression level to digit. A low value (e.g. 1) means 16753 high speed, while a high value (e.g. 9) means high 16754 compression. A compression level of 0 (zero) means no 16755 compression. See defaultInit2_() for further details. 16756 [fhR] 16757 16758 set the compression strategy to [fhR]. The letter f 16759 corresponds to filtered data, the letter h corresponds to 16760 Huffman only compression, and the letter R corresponds to Run 16761 Length Encoding. See defaultInit2_() for further details. 16762 16763 If path refers to an uncompressed file, and mode refers to a 16764 read mode, gzopen() shall attempt to open the file and return 16765 a gzFile object suitable for reading directly from the file 16766 without any decompression. 16767 16768 If path or mode is NULL, or if mode does not contain one of r, 16769 w, or a, gzopen() shall return Z_NULL, and need not set any 16770 other error condition. 16771 16772 The gzFile object is also referred to as a compressed file 16773 stream. 16774 16775 Example 16776 16777 gzopen("file.gz", "w6h"); 16778 16779 Attempt to create a new compressed file, file.gz, at 16780 compression level 6 using Huffman only compression. 16781 16782 Return Value 16783 16784 On success, gzopen() shall return a gzFile object (also known 16785 as a compressed file stream). On failure, gzopen() shall 16786 return Z_NULL and may set errno accordingly. 16787 16788 Note: At version 1.2.2, zlib does not set errno for several 16789 error conditions. Applications may not be able to determine 16790 the cause of an error. 16791 16792 Errors 16793 16794 On error, gzopen() may set the global variable errno to 16795 indicate the error. 16796 16797 gzprintf 16798 16799 Name 16800 16801 gzprintf -- format data and compress 16802 16803 Synopsis 16804 16805 #include 16806 16807 int gzprintf (gzFile file, const char * fmt, ...); 16808 16809 Description 16810 16811 The gzprintf() function shall format data as for fprintf(), 16812 and write the resulting string to the compressed file stream 16813 file. 16814 16815 Return Value 16816 16817 The gzprintf() function shall return the number of 16818 uncompressed bytes actually written, or a value less than or 16819 equal to 0 in the event of an error. 16820 16821 Errors 16822 16823 If file is NULL, or refers to a compressed file stream that 16824 has not been opened for writing, gzprintf() shall return 16825 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 16826 16827 gzputc 16828 16829 Name 16830 16831 gzputc -- write character to a compressed file 16832 16833 Synopsis 16834 16835 #include 16836 16837 int gzputc (gzFile file, int c); 16838 16839 Description 16840 16841 The gzputc() function shall write the single character c, 16842 converted from integer to unsigned character, to the 16843 compressed file referenced by file, which shall have been 16844 opened in a write mode (see gzopen() and gzdopen()). 16845 16846 Return Value 16847 16848 On success, gzputc() shall return the value written, otherwise 16849 gzputc() shall return -1. 16850 16851 Errors 16852 16853 On error, gzputc() shall return -1. 16854 16855 gzputs 16856 16857 Name 16858 16859 gzputs -- string write to a compressed file 16860 16861 Synopsis 16862 16863 #include 16864 16865 int gzputs (gzFile file, const char * s); 16866 16867 Description 16868 16869 The gzputs() function shall write the null terminated string s 16870 to the compressed file referenced by file, which shall have 16871 been opened in a write mode (see gzopen() and gzdopen()). The 16872 terminating null character shall not be written. The gzputs() 16873 function shall return the number of uncompressed bytes 16874 actually written. 16875 16876 Return Value 16877 16878 On success, gzputs() shall return the number of uncompressed 16879 bytes actually written to file. On error gzputs() shall return 16880 a value less than or equal to 0. Applications may examine the 16881 cause using gzerror(). 16882 16883 Errors 16884 16885 On error, gzputs() shall set the error number associated with 16886 the stream identified by file to indicate the error. 16887 Applications should use gzerror() to access this error value. 16888 If file is NULL, gzputs() shall return Z_STREAM_ERR. 16889 16890 Z_ERRNO 16891 16892 An underlying base library function has indicated an error. 16893 The global variable errno may be examined for further 16894 information. 16895 Z_STREAM_ERROR 16896 16897 The stream is invalid, is not open for writing, or is in an 16898 invalid state. 16899 Z_BUF_ERROR 16900 16901 no compression progress is possible (see deflate()). 16902 Z_MEM_ERROR 16903 16904 Insufficient memory available to compress. 16905 16906 gzread 16907 16908 Name 16909 16910 gzread -- read from a compressed file 16911 16912 Synopsis 16913 16914 #include 16915 16916 int gzread (gzFile file, voidp buf, unsigned int len); 16917 16918 Description 16919 16920 The gzread() function shall read data from the compressed file 16921 referenced by file, which shall have been opened in a read 16922 mode (see gzopen() and gzdopen()). The gzread() function shall 16923 read data from file, and uncompress it into buf. At most, len 16924 bytes of uncompressed data shall be copied to buf. If the file 16925 is not compressed, gzread() shall simply copy data from file 16926 to buf without alteration. 16927 16928 Return Value 16929 16930 On success, gzread() shall return the number of bytes 16931 decompressed into buf. If gzread() returns 0, either the 16932 end-of-file has been reached or an underlying read error has 16933 occurred. Applications should use gzerror() or gzeof() to 16934 determine which occurred. On other errors, gzread() shall 16935 return a value less than 0 and and applications may examine 16936 the cause using gzerror(). 16937 16938 Errors 16939 16940 On error, gzread() shall set the error number associated with 16941 the stream identified by file to indicate the error. 16942 Applications should use gzerror() to access this error value. 16943 16944 Z_ERRNO 16945 16946 An underlying base library function has indicated an error. 16947 The global variable errno may be examined for further 16948 information. 16949 Z_STREAM_END 16950 16951 End of file has been reached on input. 16952 Z_DATA_ERROR 16953 16954 A CRC error occurred when reading data; the file is corrupt. 16955 Z_STREAM_ERROR 16956 16957 The stream is invalid, or is in an invalid state. 16958 Z_NEED_DICT 16959 16960 A dictionary is needed (see inflateSetDictionary()). 16961 Z_MEM_ERROR 16962 16963 Insufficient memory available to decompress. 16964 16965 gzrewind 16966 16967 Name 16968 16969 gzrewind -- reset the file-position indicator on a compressed 16970 file stream 16971 16972 Synopsis 16973 16974 #include 16975 16976 int gzrewind(gzFile file); 16977 16978 Description 16979 16980 The gzrewind() function shall set the starting position for 16981 the next read on compressed file stream file to the beginning 16982 of file. file must be open for reading. 16983 16984 gzrewind() is equivalent to 16985 (int)gzseek(file, 0L, SEEK_SET) 16986 16987 . 16988 16989 Return Value 16990 16991 On success, gzrewind() shall return 0. On error, gzrewind() 16992 shall return -1, and may set the error value for file 16993 accordingly. 16994 16995 Errors 16996 16997 On error, gzrewind() shall return -1, indicating that file is 16998 NULL, or does not represent an open compressed file stream, or 16999 represents a compressed file stream that is open for writing 17000 and is not currently at the beginning of file. 17001 17002 gzseek 17003 17004 Name 17005 17006 gzseek -- reposition a file-position indicator in a compressed 17007 file stream 17008 17009 Synopsis 17010 17011 #include 17012 17013 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 17014 17015 Description 17016 17017 The gzseek() function shall set the file-position indicator 17018 for the compressed file stream file. The file-position 17019 indicator controls where the next read or write operation on 17020 the compressed file stream shall take place. The offset 17021 indicates a byte offset in the uncompressed data. The whence 17022 parameter may be one of: 17023 17024 SEEK_SET 17025 17026 the offset is relative to the start of the uncompressed data. 17027 SEEK_CUR 17028 17029 the offset is relative to the current positition in the 17030 uncompressed data. 17031 17032 Note: The value SEEK_END need not be supported. 17033 17034 If the file is open for writing, the new offset must be 17035 greater than or equal to the current offset. In this case, 17036 gzseek() shall compress a sequence of null bytes to fill the 17037 gap from the previous offset to the new offset. 17038 17039 Return Value 17040 17041 On success, gzseek() shall return the resulting offset in the 17042 file expressed as a byte position in the uncompressed data 17043 stream. On error, gzseek() shall return -1, and may set the 17044 error value for file accordingly. 17045 17046 Errors 17047 17048 On error, gzseek() shall return -1. The following conditions 17049 shall always result in an error: 17050 17051 * file is NULL 17052 * file does not represent an open compressed file stream. 17053 * file refers to a compressed file stream that is open for 17054 writing, and the newly computed offset is less than the 17055 current offset. 17056 * The newly computed offset is less than zero. 17057 * whence is not one of the supported values. 17058 17059 Application Usage (informative) 17060 17061 If file is open for reading, the implementation may still need 17062 to uncompress all of the data up to the new offset. As a 17063 result, gzseek() may be extremely slow in some circumstances. 17064 17065 gzsetparams 17066 17067 Name 17068 17069 gzsetparams -- dynamically set compression parameters 17070 17071 Synopsis 17072 17073 #include 17074 17075 int gzsetparams (gzFile file, int level, int strategy); 17076 17077 Description 17078 17079 The gzsetparams() function shall set the compression level and 17080 compression strategy on the compressed file stream referenced 17081 by file. The compressed file stream shall have been opened in 17082 a write mode. The level and strategy are as defined in 17083 deflateInit2_. If there is any data pending writing, it shall 17084 be flushed before the parameters are updated. 17085 17086 Return Value 17087 17088 On success, the gzsetparams() function shall return Z_OK. 17089 17090 Errors 17091 17092 On error, gzsetparams() shall return one of the following 17093 error indications: 17094 17095 Z_STREAM_ERROR 17096 17097 Invalid parameter, or file not open for writing. 17098 Z_BUF_ERROR 17099 17100 An internal inconsistency was detected while flushing the 17101 previous buffer. 17102 17103 gztell 17104 17105 Name 17106 17107 gztell -- find position on a compressed file stream 17108 17109 Synopsis 17110 17111 #include 17112 17113 z_off_t gztell (gzFile file ); 17114 17115 Description 17116 17117 The gztell() function shall return the starting position for 17118 the next read or write operation on compressed file stream 17119 file. This position represents the number of bytes from the 17120 beginning of file in the uncompressed data. 17121 17122 gztell() is equivalent to 17123 gzseek(file, 0L, SEEK_SET) 17124 17125 . 17126 17127 Return Value 17128 17129 gztell() shall return the current offset in the file expressed 17130 as a byte position in the uncompressed data stream. On error, 17131 gztell() shall return -1, and may set the error value for file 17132 accordingly. 17133 17134 Errors 17135 17136 On error, gztell() shall return -1, indicating that file is 17137 NULL, or does not represent an open compressed file stream. 17138 17139 gzwrite 17140 17141 Name 17142 17143 gzwrite -- write to a compressed file 17144 17145 Synopsis 17146 17147 #include 17148 17149 int gzwrite (gzFile file, voidpc buf, unsigned int len); 17150 17151 Description 17152 17153 The gzwrite() function shall write data to the compressed file 17154 referenced by file, which shall have been opened in a write 17155 mode (see gzopen() and gzdopen()). On entry, buf shall point 17156 to a buffer containing lenbytes of uncompressed data. The 17157 gzwrite() function shall compress this data and write it to 17158 file. The gzwrite() function shall return the number of 17159 uncompressed bytes actually written. 17160 17161 Return Value 17162 17163 On success, gzwrite() shall return the number of uncompressed 17164 bytes actually written to file. On error gzwrite() shall 17165 return a value less than or equal to 0. Applications may 17166 examine the cause using gzerror(). 17167 17168 Errors 17169 17170 On error, gzwrite() shall set the error number associated with 17171 the stream identified by file to indicate the error. 17172 Applications should use gzerror() to access this error value. 17173 17174 Z_ERRNO 17175 17176 An underlying base library function has indicated an error. 17177 The global variable errno may be examined for further 17178 information. 17179 Z_STREAM_ERROR 17180 17181 The stream is invalid, is not open for writing, or is in an 17182 invalid state. 17183 Z_BUF_ERROR 17184 17185 no compression progress is possible (see deflate()). 17186 Z_MEM_ERROR 17187 17188 Insufficient memory available to compress. 17189 17190 inflate 17191 17192 Name 17193 17194 inflate -- decompress data 17195 17196 Synopsis 17197 17198 #include 17199 17200 int inflate(z_streamp stream, int flush); 17201 17202 Description 17203 17204 The inflate() function shall attempt to decompress data until 17205 either the input buffer is empty or the output buffer is full. 17206 The stream references a z_stream structure. Before the first 17207 call to inflate(), this structure should have been initialized 17208 by a call to inflateInit2_(). 17209 17210 Note: inflateInit2_() is only in the binary standard; 17211 source level applications should initialize stream via a 17212 call to inflateInit() or inflateInit2(). 17213 17214 In addition, the stream input and output buffers should have 17215 been initialized as follows: 17216 17217 next_in 17218 17219 should point to the data to be decompressed. 17220 avail_in 17221 17222 should contain the number of bytes of data in the buffer 17223 referenced by next_in. 17224 next_out 17225 17226 should point to a buffer where decompressed data may be 17227 placed. 17228 avail_out 17229 17230 should contain the size in bytes of the buffer referenced by 17231 next_out 17232 17233 The inflate() function shall perform one or both of the 17234 following actions: 17235 17236 1. Decompress input data from next_in and update next_in, 17237 avail_in and total_in to reflect the data that has been 17238 decompressed. 17239 2. Fill the output buffer referenced by next_out, and update 17240 next_out, avail_out, and total_out to reflect the 17241 decompressed data that has been placed there. If flush is 17242 not Z_NO_FLUSH, and avail_out indicates that there is 17243 still space in output buffer, this action shall always 17244 occur (see below for further details). 17245 17246 The inflate() function shall return when either avail_in 17247 reaches zero (indicating that all the input data has been 17248 compressed), or avail_out reaches zero (indicating that the 17249 output buffer is full). 17250 17251 On success, the inflate() function shall set the adler field 17252 of the stream to the Adler-32 checksum of all the input data 17253 compressed so far (represented by total_in). 17254 17255 Flush Operation 17256 17257 The parameter flush determines when uncompressed bytes are 17258 added to the output buffer in next_out. If flush is 17259 Z_NO_FLUSH, inflate() may return with some data pending 17260 output, and not yet added to the output buffer. 17261 17262 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 17263 output to next_out, and update next_out and avail_out 17264 accordingly. 17265 17266 If flush is set to Z_BLOCK, inflate() shall stop adding data 17267 to the output buffer if and when the next compressed block 17268 boundary is reached (see RFC 1951: DEFLATE Compressed Data 17269 Format Specification). 17270 17271 If flush is set to Z_FINISH, all of the compressed input shall 17272 be decompressed and added to the output. If there is 17273 insufficient output space (i.e. the compressed input data 17274 uncompresses to more than avail_out bytes), then inflate() 17275 shall fail and return Z_BUF_ERROR. 17276 17277 Return Value 17278 17279 On success, inflate() shall return Z_OK if decompression 17280 progress has been made, or Z_STREAM_END if all of the input 17281 data has been decompressed and there was sufficient space in 17282 the output buffer to store the uncompressed result. On error, 17283 inflate() shall return a value to indicate the error. 17284 17285 Note: If inflate() returns Z_OK and has set avail_out to 17286 zero, the function should be called again with the same 17287 value for flush, and with updated next_out and avail_out 17288 until inflate() returns with either Z_OK or Z_STREAM_END 17289 and a non-zero avail_out. 17290 17291 On success, inflate() shall set the adler to the Adler-32 17292 checksum of the output produced so far (i.e. total_out bytes). 17293 17294 Errors 17295 17296 On error, inflate() shall return a value as described below, 17297 and may set the msg field of stream to point to a string 17298 describing the error: 17299 17300 Z_BUF_ERROR 17301 17302 No progress is possible; either avail_in or avail_out was 17303 zero. 17304 Z_MEM_ERROR 17305 17306 Insufficient memory. 17307 Z_STREAM_ERROR 17308 17309 The state (as represented in stream) is inconsistent, or 17310 stream was NULL. 17311 Z_NEED_DICT 17312 17313 A preset dictionary is required. The adler field shall be set 17314 to the Adler-32 checksum of the dictionary chosen by the 17315 compressor. 17316 17317 inflateEnd 17318 17319 Name 17320 17321 inflateEnd -- free decompression stream state 17322 17323 Synopsis 17324 17325 #include 17326 17327 int inflateEnd(z_streamp stream); 17328 17329 Description 17330 17331 The inflateEnd() function shall free all allocated state 17332 information referenced by stream. All pending output is 17333 discarded, and unprocessed input is ignored. 17334 17335 Return Value 17336 17337 On success, inflateEnd() shall return Z_OK. Otherwise it shall 17338 return Z_STREAM_ERROR to indicate the error. 17339 17340 Errors 17341 17342 On error, inflateEnd() shall return Z_STREAM_ERROR. The 17343 following conditions shall be treated as an error: 17344 17345 * The state in stream is inconsistent. 17346 * stream is NULL. 17347 * The zfree function pointer is NULL. 17348 17349 inflateInit2_ 17350 17351 Name 17352 17353 inflateInit2_ -- initialize decompression system 17354 17355 Synopsis 17356 17357 #include 17358 17359 int inflateInit2_ (z_streamp strm, int windowBits, char * 17360 version, int stream_size); 17361 17362 Description 17363 17364 The inflateInit2_() function shall initialize the 17365 decompression system. On entry, strm shall refer to a user 17366 supplied z_stream object (a z_stream_s structure). The 17367 following fields shall be set on entry: 17368 17369 zalloc 17370 17371 a pointer to an alloc_func function, used to allocate state 17372 information. If this is NULL, a default allocation function 17373 will be used. 17374 zfree 17375 17376 a pointer to a free_func function, used to free memory 17377 allocated by the zalloc function. If this is NULL a default 17378 free function will be used. 17379 opaque 17380 17381 If alloc_func is not NULL, opaque is a user supplied pointer 17382 to data that will be passed to the alloc_func and free_func 17383 functions. 17384 17385 If the version requested is not compatible with the version 17386 implemented, or if the size of the z_stream_s structure 17387 provided in stream_size does not match the size in the library 17388 implementation, inflateInit2_() shall fail, and return 17389 Z_VERSION_ERROR. 17390 17391 The windowBits parameter shall be a base 2 logarithm of the 17392 maximum window size to use, and shall be a value between 8 and 17393 15. If the input data was compressed with a larger window 17394 size, subsequent attempts to decompress this data will fail 17395 with Z_DATA_ERROR, rather than try to allocate a larger 17396 window. 17397 17398 The inflateInit2_() function is not in the source standard; it 17399 is only in the binary standard. Source applications should use 17400 the inflateInit2() macro. 17401 17402 Return Value 17403 17404 On success, the inflateInit2_() function shall return Z_OK. 17405 Otherwise, inflateInit2_() shall return a value as described 17406 below to indicate the error. 17407 17408 Errors 17409 17410 On error, inflateInit2_() shall return one of the following 17411 error indicators: 17412 17413 Z_STREAM_ERROR 17414 17415 Invalid parameter. 17416 Z_MEM_ERROR 17417 17418 Insufficient memory available. 17419 Z_VERSION_ERROR 17420 17421 The version requested is not compatible with the library 17422 version, or the z_stream size differs from that used by the 17423 library. 17424 17425 In addition, the msg field of the strm may be set to an error 17426 message. 17427 17428 inflateInit_ 17429 17430 Name 17431 17432 inflateInit_ -- initialize decompression system 17433 17434 Synopsis 17435 17436 #include 17437 17438 int inflateInit_(z_streamp stream, const char * version, int 17439 stream_size); 17440 17441 Description 17442 17443 The inflateInit_() function shall initialize the decompression 17444 system. On entry, stream shall refer to a user supplied 17445 z_stream object (a z_stream_s structure). The following fields 17446 shall be set on entry: 17447 17448 zalloc 17449 17450 a pointer to an alloc_func function, used to allocate state 17451 information. If this is NULL, a default allocation function 17452 will be used. 17453 zfree 17454 17455 a pointer to a free_func function, used to free memory 17456 allocated by the zalloc function. If this is NULL a default 17457 free function will be used. 17458 opaque 17459 17460 If alloc_func is not NULL, opaque is a user supplied pointer 17461 to data that will be passed to the alloc_func and free_func 17462 functions. 17463 17464 If the version requested is not compatible with the version 17465 implemented, or if the size of the z_stream_s structure 17466 provided in stream_size does not match the size in the library 17467 implementation, inflateInit_() shall fail, and return 17468 Z_VERSION_ERROR. 17469 17470 The inflateInit_() function is not in the source standard; it 17471 is only in the binary standard. Source applications should use 17472 the inflateInit() macro. 17473 17474 The inflateInit_() shall be equivalent to 17475 inflateInit2_(strm, DEF_WBITS, version, stream_size); 17476 17477 Return Value 17478 17479 On success, the inflateInit_() function shall return Z_OK. 17480 Otherwise, inflateInit_() shall return a value as described 17481 below to indicate the error. 17482 17483 Errors 17484 17485 On error, inflateInit_() shall return one of the following 17486 error indicators: 17487 17488 Z_STREAM_ERROR 17489 17490 Invalid parameter. 17491 Z_MEM_ERROR 17492 17493 Insufficient memory available. 17494 Z_VERSION_ERROR 17495 17496 The version requested is not compatible with the library 17497 version, or the z_stream size differs from that used by the 17498 library. 17499 17500 In addition, the msg field of the strm may be set to an error 17501 message. 17502 17503 inflateReset 17504 17505 Name 17506 17507 inflateReset -- reset decompression stream state 17508 17509 Synopsis 17510 17511 #include 17512 17513 int inflateReset(z_streamp stream); 17514 17515 Description 17516 17517 The inflateReset() function shall reset all state associated 17518 with stream. All pending output shall be discarded, and the 17519 counts of processed bytes (total_in and total_out) shall be 17520 reset to zero. 17521 17522 Return Value 17523 17524 On success, inflateReset() shall return Z_OK. Otherwise it 17525 shall return Z_STREAM_ERROR to indicate the error. 17526 17527 Errors 17528 17529 On error, inflateReset() shall return Z_STREAM_ERROR. The 17530 following conditions shall be treated as an error: 17531 17532 * The state in stream is inconsistent or inappropriate. 17533 * stream is NULL. 17534 17535 inflateSetDictionary 17536 17537 Name 17538 17539 inflateSetDictionary -- initialize decompression dictionary 17540 17541 Synopsis 17542 17543 #include 17544 17545 int inflateSetDictionary(z_streamp stream, const Bytef * 17546 dictionary, uInt dictlen); 17547 17548 Description 17549 17550 The inflateSetDictionary() function shall initialize the 17551 decompression dictionary associated with stream using the 17552 dictlen bytes referenced by dictionary. 17553 17554 The inflateSetDictionary() function should be called 17555 immediately after a call to inflate() has failed with return 17556 value Z_NEED_DICT. The dictionary must have the same Adler-32 17557 checksum as the dictionary used for the compression (see 17558 deflateSetDictionary()). 17559 17560 stream shall reference an initialized decompression stream, 17561 with total_in zero (i.e. no data has been decompressed since 17562 the stream was initialized). 17563 17564 Return Value 17565 17566 On success, inflateSetDictionary() shall return Z_OK. 17567 Otherwise it shall return a value as indicated below. 17568 17569 Errors 17570 17571 On error, inflateSetDictionary() shall return a value as 17572 described below: 17573 17574 Z_STREAM_ERROR 17575 17576 The state in stream is inconsistent, or stream was NULL. 17577 Z_DATA_ERROR 17578 17579 The Adler-32 checksum of the supplied dictionary does not 17580 match that used for the compression. 17581 17582 Application Usage (informative) 17583 17584 The application should provide a dictionary consisting of 17585 strings {{{ed note: do we really mean "strings"? Null 17586 terminated?}}} that are likely to be encountered in the data 17587 to be compressed. The application should ensure that the 17588 dictionary is sorted such that the most commonly used strings 17589 occur at the end of the dictionary. 17590 17591 The use of a dictionary is optional; however if the data to be 17592 compressed is relatively short and has a predictable 17593 structure, the use of a dictionary can substantially improve 17594 the compression ratio. 17595 17596 inflateSync 17597 17598 Name 17599 17600 inflateSync -- advance compression stream to next sync point 17601 17602 Synopsis 17603 17604 #include 17605 17606 int inflateSync(z_streamp stream); 17607 17608 Description 17609 17610 The inflateSync() function shall advance through the 17611 compressed data in stream, skipping any invalid compressed 17612 data, until the next full flush point is reached, or all input 17613 is exhausted. See the description for deflate() with flush 17614 level Z_FULL_FLUSH. No output is placed in next_out. 17615 17616 Return Value 17617 17618 On success, inflateSync() shall return Z_OK, and update the 17619 next_in,, avail_in, and, total_in fields of stream to reflect 17620 the number of bytes of compressed data that have been skipped. 17621 Otherwise, inflateSync() shall return a value as described 17622 below to indicate the error. 17623 17624 Errors 17625 17626 On error, inflateSync() shall return a value as described 17627 below: 17628 17629 Z_STREAM_ERROR 17630 17631 The state (as represented in stream) is inconsistent, or 17632 stream was NULL. 17633 Z_BUF_ERROR 17634 17635 There is no data available to skip over. 17636 Z_DATA_ERROR 17637 17638 No sync point was found. 17639 17640 inflateSyncPoint 17641 17642 Name 17643 17644 inflateSyncPoint -- test for synchronization point 17645 17646 Synopsis 17647 17648 #include 17649 17650 int inflateSyncPoint(z_streamp stream); 17651 17652 Description 17653 17654 The inflateSyncPoint() function shall return a non-zero calue 17655 if the compressed data stream referenced by stream is at a 17656 synchronization point. 17657 17658 Return Value 17659 17660 If the compressed data in stream is at a synchronization point 17661 (see deflate() with a flush level of Z_SYNC_FLUSH or 17662 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 17663 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 17664 valid, inflateSyncPoint() shall return 0. If stream is 17665 invalid, or in an invalid state, inflateSyncPoint() shall 17666 return Z_STREAM_ERROR to indicate the error. 17667 17668 Errors 17669 17670 On error, inflateSyncPoint() shall return a value as described 17671 below: 17672 17673 Z_STREAM_ERROR 17674 17675 The state (as represented in stream) is inconsistent, or 17676 stream was NULL. 17677 17678 uncompress 17679 17680 Name 17681 17682 uncompress -- uncompress data 17683 17684 Synopsis 17685 17686 #include 17687 17688 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 17689 source, uLong sourceLen); 17690 17691 Description 17692 17693 The uncompress() function shall attempt to uncompress 17694 sourceLen bytes of data in the buffer source, placing the 17695 result in the buffer dest. 17696 17697 On entry, destLen should point to a value describing the size 17698 of the dest buffer. The application should ensure that this 17699 value is large enough to hold the entire uncompressed data. 17700 17701 Note: The LSB does not describe any mechanism by which a 17702 compressor can communicate the size required to the 17703 uncompressor. 17704 17705 On successful exit, the variable referenced by destLen shall 17706 be updated to hold the length of uncompressed data in dest. 17707 17708 Return Value 17709 17710 On success, uncompress() shall return Z_OK. Otherwise, 17711 uncompress() shall return a value to indicate the error. 17712 17713 Errors 17714 17715 On error, uncompress() shall return a value as described 17716 below: 17717 17718 Z_BUF_ERROR 17719 17720 The buffer dest was not large enough to hold the uncompressed 17721 data. 17722 Z_MEM_ERROR 17723 17724 Insufficient memory. 17725 Z_DATA_ERROR 17726 17727 The compressed data (referenced by source) was corrupted. 17728 17729 zError 17730 17731 Name 17732 17733 zError -- translate error number to string 17734 17735 Synopsis 17736 17737 #include 17738 17739 const char * zError(int err); 17740 17741 Description 17742 17743 The zError() function shall return the string identifying the 17744 error associated with err. This allows for conversion from 17745 error code to string for functions such as compress() and 17746 uncompress(), that do not always set the string version of an 17747 error. 17748 17749 Return Value 17750 17751 The zError() function shall return a the string identifying 17752 the error associated with err, or NULL if err is not a valid 17753 error code. 17754 17755 It is unspecified if the string returned is determined by the 17756 setting of the LC_MESSAGES category in the current locale. 17757 17758 Errors 17759 17760 None defined. 17761 17762 zlibVersion 17763 17764 Name 17765 17766 zlibVersion -- discover library version at run time 17767 17768 Synopsis 17769 17770 #include 17771 17772 const char * zlibVersion (void); 17773 17774 Description 17775 17776 The zlibVersion() function shall return the string identifying 17777 the interface version at the time the library was built. 17778 17779 Applications should compare the value returned from 17780 zlibVersion() with the macro constant ZLIB_VERSION for 17781 compatibility. 17782 17783 Return Value 17784 17785 The zlibVersion() function shall return a the string 17786 identifying the version of the library currently implemented. 17787 17788 Errors 17789 17790 None defined. 17791 _________________________________________________________ 17792 17793 14.5. Interfaces for libncurses 17794 17795 Table 14-3 defines the library name and shared object name for 17796 the libncurses library 17797 17798 Table 14-3. libncurses Definition 17799 Library: libncurses 17800 SONAME: libncurses.so.5 17801 17802 The Parameters or return value of the following interface have 17803 had the const qualifier added as shown here. 17804 extern const char *keyname (int); 17805 extern int mvscanw (int, int, const char *, ...); 17806 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 17807 extern SCREEN *newterm (const char *, FILE *, FILE *); 17808 extern int scanw (const char *, ...); 17809 extern int vwscanw (WINDOW *, const char *, va_list); 17810 extern int vw_scanw (WINDOW *, const char *, va_list); 17811 extern int wscanw (WINDOW *, const char *, ...); 17812 17813 The behavior of the interfaces in this library is specified by 17814 the following specifications: 17815 17816 [SUS-CURSES] X/Open Curses 17817 _________________________________________________________ 17818 17819 14.5.1. Curses 17820 _________________________________________________________ 17821 17822 14.5.1.1. Interfaces for Curses 17823 17824 An LSB conforming implementation shall provide the generic 17825 functions for Curses specified in Table 14-4, with the full 17826 mandatory functionality as described in the referenced 17827 underlying specification. 17828 17829 Table 14-4. libncurses - Curses Function Interfaces 17830 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr 17831 [SUS-CURSES] addnstr [SUS-CURSES] 17832 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off 17833 [SUS-CURSES] attr_on [SUS-CURSES] 17834 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 17835 attrset [SUS-CURSES] 17836 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 17837 bkgdset [SUS-CURSES] 17838 border [SUS-CURSES] box [SUS-CURSES] can_change_color 17839 [SUS-CURSES] cbreak [SUS-CURSES] 17840 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 17841 clrtobot [SUS-CURSES] 17842 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 17843 [SUS-CURSES] copywin [SUS-CURSES] 17844 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] 17845 def_shell_mode [SUS-CURSES] del_curterm [SUS-CURSES] 17846 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 17847 [SUS-CURSES] delscreen [SUS-CURSES] 17848 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 17849 dupwin [SUS-CURSES] 17850 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 17851 erase [SUS-CURSES] 17852 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 17853 flushinp [SUS-CURSES] 17854 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 17855 getstr [SUS-CURSES] 17856 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 17857 [SUS-CURSES] has_ic [SUS-CURSES] 17858 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] 17859 idlok [SUS-CURSES] 17860 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [SUS-CURSES] 17861 inchstr [SUS-CURSES] 17862 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 17863 [SUS-CURSES] innstr [SUS-CURSES] 17864 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 17865 insnstr [SUS-CURSES] 17866 insstr [SUS-CURSES] instr [SUS-CURSES] intrflush [SUS-CURSES] 17867 is_linetouched [SUS-CURSES] 17868 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 17869 [SUS-CURSES] keypad [SUS-CURSES] 17870 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 17871 [SUS-CURSES] meta [SUS-CURSES] 17872 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr 17873 [SUS-CURSES] mvaddchstr [SUS-CURSES] 17874 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 17875 [SUS-CURSES] mvcur [SUS-CURSES] 17876 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch 17877 [SUS-CURSES] mvgetnstr [SUS-CURSES] 17878 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 17879 mvinchnstr [SUS-CURSES] 17880 mvinchstr [SUS-CURSES] mvinnstr [SUS-CURSES] mvinsch 17881 [SUS-CURSES] mvinsnstr [SUS-CURSES] 17882 mvinsstr [SUS-CURSES] mvinstr [SUS-CURSES] mvprintw 17883 [SUS-CURSES] mvscanw [SUS-CURSES] 17884 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 17885 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 17886 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 17887 [SUS-CURSES] mvwdelch [SUS-CURSES] 17888 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 17889 [SUS-CURSES] mvwhline [SUS-CURSES] 17890 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr 17891 [SUS-CURSES] mvwinchstr [SUS-CURSES] 17892 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 17893 [SUS-CURSES] mvwinsstr [SUS-CURSES] 17894 mvwinstr [SUS-CURSES] mvwprintw [SUS-CURSES] mvwscanw 17895 [SUS-CURSES] mvwvline [SUS-CURSES] 17896 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 17897 newwin [SUS-CURSES] 17898 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 17899 noecho [SUS-CURSES] 17900 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 17901 notimeout [SUS-CURSES] 17902 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 17903 [SUS-CURSES] pechochar [SUS-CURSES] 17904 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 17905 [SUS-CURSES] putp [SUS-CURSES] 17906 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 17907 redrawwin [SUS-CURSES] 17908 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 17909 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 17910 restartterm [SUS-CURSES] ripoffline [SUS-CURSES] savetty 17911 [SUS-CURSES] scanw [SUS-CURSES] 17912 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 17913 [SUS-CURSES] scr_set [SUS-CURSES] 17914 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 17915 set_curterm [SUS-CURSES] 17916 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 17917 [SUS-CURSES] slk_attr_set [SUS-CURSES] 17918 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 17919 [SUS-CURSES] slk_clear [SUS-CURSES] 17920 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 17921 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 17922 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 17923 [SUS-CURSES] slk_touch [SUS-CURSES] 17924 standend [SUS-CURSES] standout [SUS-CURSES] start_color 17925 [SUS-CURSES] subpad [SUS-CURSES] 17926 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 17927 termname [SUS-CURSES] 17928 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum 17929 [SUS-CURSES] tgetstr [SUS-CURSES] 17930 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum 17931 [SUS-CURSES] tigetstr [SUS-CURSES] 17932 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 17933 [SUS-CURSES] tparm [SUS-CURSES] 17934 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 17935 ungetch [SUS-CURSES] 17936 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 17937 [SUS-CURSES] vidputs [SUS-CURSES] 17938 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw 17939 [SUS-CURSES] vwprintw [SUS-CURSES] 17940 vwscanw [SUS-CURSES] waddch [SUS-CURSES] waddchnstr 17941 [SUS-CURSES] waddchstr [SUS-CURSES] 17942 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 17943 [SUS-CURSES] wattr_off [SUS-CURSES] 17944 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 17945 [SUS-CURSES] wattron [SUS-CURSES] 17946 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 17947 wborder [SUS-CURSES] 17948 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 17949 wclrtoeol [SUS-CURSES] 17950 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 17951 [SUS-CURSES] wdeleteln [SUS-CURSES] 17952 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 17953 wgetnstr [SUS-CURSES] 17954 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 17955 winchnstr [SUS-CURSES] 17956 winchstr [SUS-CURSES] winnstr [SUS-CURSES] winsch [SUS-CURSES] 17957 winsdelln [SUS-CURSES] 17958 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 17959 [SUS-CURSES] winstr [SUS-CURSES] 17960 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 17961 [SUS-CURSES] wredrawln [SUS-CURSES] 17962 wrefresh [SUS-CURSES] wscanw [SUS-CURSES] wscrl [SUS-CURSES] 17963 wsetscrreg [SUS-CURSES] 17964 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 17965 [SUS-CURSES] wsyncup [SUS-CURSES] 17966 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline 17967 [SUS-CURSES] 17968 17969 An LSB conforming implementation shall provide the generic 17970 data interfaces for Curses specified in Table 14-5, with the 17971 full mandatory functionality as described in the referenced 17972 underlying specification. 17973 17974 Table 14-5. libncurses - Curses Data Interfaces 17975 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 17976 LINES [SUS-CURSES] 17977 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 17978 stdscr [SUS-CURSES] 17979 _________________________________________________________ 17980 17981 14.6. Data Definitions for libncurses 17982 17983 This section defines global identifiers and their values that 17984 are associated with interfaces contained in libncurses. These 17985 definitions are organized into groups that correspond to 17986 system headers. This convention is used as a convenience for 17987 the reader, and does not imply the existence of these headers, 17988 or their content. Where an interface is defined as requiring a 17989 particular system header file all of the data definitions for 17990 that system header file presented here shall be in effect. 17991 17992 This section gives data definitions to promote binary 17993 application portability, not to repeat source interface 17994 definitions available elsewhere. System providers and 17995 application developers should use this ABI to supplement - not 17996 to replace - source interface definition specifications. 17997 17998 This specification uses the ISO C (1999) C Language as the 17999 reference programming language, and data definitions are 18000 specified in ISO C format. The C language is used here as a 18001 convenient notation. Using a C language description of these 18002 data objects does not preclude their use by other programming 18003 languages. 18004 _________________________________________________________ 18005 18006 14.6.1. curses.h 18007 18008 #define ERR (-1) 18009 #define OK (0) 18010 #define ACS_RARROW (acs_map['+']) 18011 #define ACS_LARROW (acs_map[',']) 18012 #define ACS_UARROW (acs_map['-']) 18013 #define ACS_DARROW (acs_map['.']) 18014 #define ACS_BLOCK (acs_map['0']) 18015 #define ACS_CKBOARD (acs_map['a']) 18016 #define ACS_DEGREE (acs_map['f']) 18017 #define ACS_PLMINUS (acs_map['g']) 18018 #define ACS_BOARD (acs_map['h']) 18019 #define ACS_LANTERN (acs_map['i']) 18020 #define ACS_LRCORNER (acs_map['j']) 18021 #define ACS_URCORNER (acs_map['k']) 18022 #define ACS_ULCORNER (acs_map['l']) 18023 #define ACS_LLCORNER (acs_map['m']) 18024 #define ACS_PLUS (acs_map['n']) 18025 #define ACS_S1 (acs_map['o']) 18026 #define ACS_HLINE (acs_map['q']) 18027 #define ACS_S9 (acs_map['s']) 18028 #define ACS_LTEE (acs_map['t']) 18029 #define ACS_RTEE (acs_map['u']) 18030 #define ACS_BTEE (acs_map['v']) 18031 #define ACS_TTEE (acs_map['w']) 18032 #define ACS_VLINE (acs_map['x']) 18033 #define ACS_DIAMOND (acs_map['`']) 18034 #define ACS_BULLET (acs_map['~']) 18035 #define getmaxyx(win,y,x) \ 18036 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 18037 #define getbegyx(win,y,x) \ 18038 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 18039 #define getyx(win,y,x) \ 18040 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 18041 #define getparyx(win,y,x) \ 18042 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 18043 18044 #define WA_ALTCHARSET A_ALTCHARSET 18045 #define WA_ATTRIBUTES A_ATTRIBUTES 18046 #define WA_BLINK A_BLINK 18047 #define WA_BOLD A_BOLD 18048 #define WA_DIM A_DIM 18049 #define WA_HORIZONTAL A_HORIZONTAL 18050 #define WA_INVIS A_INVIS 18051 #define WA_LEFT A_LEFT 18052 #define WA_LOW A_LOW 18053 #define WA_NORMAL A_NORMAL 18054 #define WA_PROTECT A_PROTECT 18055 #define WA_REVERSE A_REVERSE 18056 #define WA_RIGHT A_RIGHT 18057 #define WA_STANDOUT A_STANDOUT 18058 #define WA_TOP A_TOP 18059 #define WA_UNDERLINE A_UNDERLINE 18060 #define WA_VERTICAL A_VERTICAL 18061 #define A_REVERSE NCURSES_BITS(1UL,10) 18062 18063 #define COLOR_BLACK 0 18064 #define COLOR_RED 1 18065 #define COLOR_GREEN 2 18066 #define COLOR_YELLOW 3 18067 #define COLOR_BLUE 4 18068 #define COLOR_MAGENTA 5 18069 #define COLOR_CYAN 6 18070 #define COLOR_WHITE 7 18071 18072 #define _SUBWIN 0x01 18073 #define _ENDLINE 0x02 18074 #define _FULLWIN 0x04 18075 #define _ISPAD 0x10 18076 #define _HASMOVED 0x20 18077 18078 typedef unsigned char bool; 18079 18080 typedef unsigned long int chtype; 18081 typedef struct screen SCREEN; 18082 typedef struct _win_st WINDOW; 18083 typedef chtype attr_t; 18084 typedef struct { 18085 attr_t attr; 18086 wchar_t chars[5]; 18087 } cchar_t; 18088 struct pdat { 18089 short _pad_y; 18090 short _pad_x; 18091 short _pad_top; 18092 short _pad_left; 18093 short _pad_bottom; 18094 short _pad_right; 18095 }; 18096 18097 struct _win_st { 18098 short _cury; 18099 short _curx; 18100 short _maxy; 18101 short _maxx; 18102 short _begy; 18103 short _begx; 18104 short _flags; 18105 attr_t _attrs; 18106 chtype _bkgd; 18107 bool _notimeout; 18108 bool _clear; 18109 bool _leaveok; 18110 bool _scroll; 18111 bool _idlok; 18112 bool _idcok; 18113 bool _immed; 18114 bool _sync; 18115 bool _use_keypad; 18116 int _delay; 18117 struct ldat *_line; 18118 short _regtop; 18119 short _regbottom; 18120 int _parx; 18121 int _pary; 18122 WINDOW *_parent; 18123 struct pdat _pad; 18124 short _yoffset; 18125 cchar_t _bkgrnd; 18126 }; 18127 18128 #define KEY_CODE_YES 0400 18129 #define KEY_BREAK 0401 18130 #define KEY_MIN 0401 18131 #define KEY_DOWN 0402 18132 #define KEY_UP 0403 18133 #define KEY_LEFT 0404 18134 #define KEY_RIGHT 0405 18135 #define KEY_HOME 0406 18136 #define KEY_BACKSPACE 0407 18137 #define KEY_F0 0410 18138 #define KEY_DL 0510 18139 #define KEY_IL 0511 18140 #define KEY_DC 0512 18141 #define KEY_IC 0513 18142 #define KEY_EIC 0514 18143 #define KEY_CLEAR 0515 18144 #define KEY_EOS 0516 18145 #define KEY_EOL 0517 18146 #define KEY_SF 0520 18147 #define KEY_SR 0521 18148 #define KEY_NPAGE 0522 18149 #define KEY_PPAGE 0523 18150 #define KEY_STAB 0524 18151 #define KEY_CTAB 0525 18152 #define KEY_CATAB 0526 18153 #define KEY_ENTER 0527 18154 #define KEY_SRESET 0530 18155 #define KEY_RESET 0531 18156 #define KEY_PRINT 0532 18157 #define KEY_LL 0533 18158 #define KEY_A1 0534 18159 #define KEY_A3 0535 18160 #define KEY_B2 0536 18161 #define KEY_C1 0537 18162 #define KEY_C3 0540 18163 #define KEY_BTAB 0541 18164 #define KEY_BEG 0542 18165 #define KEY_CANCEL 0543 18166 #define KEY_CLOSE 0544 18167 #define KEY_COMMAND 0545 18168 #define KEY_COPY 0546 18169 #define KEY_CREATE 0547 18170 #define KEY_END 0550 18171 #define KEY_EXIT 0551 18172 #define KEY_FIND 0552 18173 #define KEY_HELP 0553 18174 #define KEY_MARK 0554 18175 #define KEY_MESSAGE 0555 18176 #define KEY_MOVE 0556 18177 #define KEY_NEXT 0557 18178 #define KEY_OPEN 0560 18179 #define KEY_OPTIONS 0561 18180 #define KEY_PREVIOUS 0562 18181 #define KEY_REDO 0563 18182 #define KEY_REFERENCE 0564 18183 #define KEY_REFRESH 0565 18184 #define KEY_REPLACE 0566 18185 #define KEY_RESTART 0567 18186 #define KEY_RESUME 0570 18187 #define KEY_SAVE 0571 18188 #define KEY_SBEG 0572 18189 #define KEY_SCANCEL 0573 18190 #define KEY_SCOMMAND 0574 18191 #define KEY_SCOPY 0575 18192 #define KEY_SCREATE 0576 18193 #define KEY_SDC 0577 18194 #define KEY_SDL 0600 18195 #define KEY_SELECT 0601 18196 #define KEY_SEND 0602 18197 #define KEY_SEOL 0603 18198 #define KEY_SEXIT 0604 18199 #define KEY_SFIND 0605 18200 #define KEY_SHELP 0606 18201 #define KEY_SHOME 0607 18202 #define KEY_SIC 0610 18203 #define KEY_SLEFT 0611 18204 #define KEY_SMESSAGE 0612 18205 #define KEY_SMOVE 0613 18206 #define KEY_SNEXT 0614 18207 #define KEY_SOPTIONS 0615 18208 #define KEY_SPREVIOUS 0616 18209 #define KEY_SPRINT 0617 18210 #define KEY_SREDO 0620 18211 #define KEY_SREPLACE 0621 18212 #define KEY_SRIGHT 0622 18213 #define KEY_SRSUME 0623 18214 #define KEY_SSAVE 0624 18215 #define KEY_SSUSPEND 0625 18216 #define KEY_SUNDO 0626 18217 #define KEY_SUSPEND 0627 18218 #define KEY_UNDO 0630 18219 #define KEY_MOUSE 0631 18220 #define KEY_RESIZE 0632 18221 #define KEY_MAX 0777 18222 18223 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 18224 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 18225 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 18226 #define A_NORMAL 0L 18227 #define NCURSES_ATTR_SHIFT 8 18228 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 18229 #define A_BLINK NCURSES_BITS(1UL,11) 18230 #define A_DIM NCURSES_BITS(1UL,12) 18231 #define A_BOLD NCURSES_BITS(1UL,13) 18232 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 18233 #define A_INVIS NCURSES_BITS(1UL,15) 18234 #define A_PROTECT NCURSES_BITS(1UL,16) 18235 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 18236 #define A_LEFT NCURSES_BITS(1UL,18) 18237 #define A_LOW NCURSES_BITS(1UL,19) 18238 #define A_RIGHT NCURSES_BITS(1UL,20) 18239 #define A_TOP NCURSES_BITS(1UL,21) 18240 #define A_VERTICAL NCURSES_BITS(1UL,22) 18241 #define A_STANDOUT NCURSES_BITS(1UL,8) 18242 #define A_UNDERLINE NCURSES_BITS(1UL,9) 18243 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 18244 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 18245 18246 extern int addch(const chtype); 18247 extern int addchnstr(const chtype *, int); 18248 extern int addchstr(const chtype *); 18249 extern int addnstr(const char *, int); 18250 extern int addstr(const char *); 18251 extern int attroff(int); 18252 extern int attron(int); 18253 extern int attrset(int); 18254 extern int attr_get(attr_t *, short *, void *); 18255 extern int attr_off(attr_t, void *); 18256 extern int attr_on(attr_t, void *); 18257 extern int attr_set(attr_t, short, void *); 18258 extern int baudrate(void); 18259 extern int beep(void); 18260 extern int bkgd(chtype); 18261 extern void bkgdset(chtype); 18262 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 18263 chtype); 18264 extern int box(WINDOW *, chtype, chtype); 18265 extern bool can_change_color(void); 18266 extern int cbreak(void); 18267 extern int chgat(int, attr_t, short, const void *); 18268 extern int clear(void); 18269 extern int clearok(WINDOW *, bool); 18270 extern int clrtobot(void); 18271 extern int clrtoeol(void); 18272 extern int color_content(short, short *, short *, short *); 18273 extern int color_set(short, void *); 18274 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 18275 int); 18276 extern int curs_set(int); 18277 extern int def_prog_mode(void); 18278 extern int def_shell_mode(void); 18279 extern int delay_output(int); 18280 extern int delch(void); 18281 extern void delscreen(SCREEN *); 18282 extern int delwin(WINDOW *); 18283 extern int deleteln(void); 18284 extern WINDOW *derwin(WINDOW *, int, int, int, int); 18285 extern int doupdate(void); 18286 extern WINDOW *dupwin(WINDOW *); 18287 extern int echo(void); 18288 extern int echochar(const chtype); 18289 extern int erase(void); 18290 extern int endwin(void); 18291 extern char erasechar(void); 18292 extern void filter(void); 18293 extern int flash(void); 18294 extern int flushinp(void); 18295 extern chtype getbkgd(WINDOW *); 18296 extern int getch(void); 18297 extern int getnstr(char *, int); 18298 extern int getstr(char *); 18299 extern WINDOW *getwin(FILE *); 18300 extern int halfdelay(int); 18301 extern bool has_colors(void); 18302 extern bool has_ic(void); 18303 extern bool has_il(void); 18304 extern int hline(chtype, int); 18305 extern void idcok(WINDOW *, bool); 18306 extern int idlok(WINDOW *, bool); 18307 extern void immedok(WINDOW *, bool); 18308 extern chtype inch(void); 18309 extern int inchnstr(chtype *, int); 18310 extern int inchstr(chtype *); 18311 extern WINDOW *initscr(void); 18312 extern int init_color(short, short, short, short); 18313 extern int init_pair(short, short, short); 18314 extern int innstr(char *, int); 18315 extern int insch(chtype); 18316 extern int insdelln(int); 18317 extern int insertln(void); 18318 extern int insnstr(const char *, int); 18319 extern int insstr(const char *); 18320 extern int instr(char *); 18321 extern int intrflush(WINDOW *, bool); 18322 extern bool isendwin(void); 18323 extern bool is_linetouched(WINDOW *, int); 18324 extern bool is_wintouched(WINDOW *); 18325 extern const char *keyname(int); 18326 extern int keypad(WINDOW *, bool); 18327 extern char killchar(void); 18328 extern int leaveok(WINDOW *, bool); 18329 extern char *longname(void); 18330 extern int meta(WINDOW *, bool); 18331 extern int move(int, int); 18332 extern int mvaddch(int, int, const chtype); 18333 extern int mvaddchnstr(int, int, const chtype *, int); 18334 extern int mvaddchstr(int, int, const chtype *); 18335 extern int mvaddnstr(int, int, const char *, int); 18336 extern int mvaddstr(int, int, const char *); 18337 extern int mvchgat(int, int, int, attr_t, short, const void *); 18338 extern int mvcur(int, int, int, int); 18339 extern int mvdelch(int, int); 18340 extern int mvderwin(WINDOW *, int, int); 18341 extern int mvgetch(int, int); 18342 extern int mvgetnstr(int, int, char *, int); 18343 extern int mvgetstr(int, int, char *); 18344 extern int mvhline(int, int, chtype, int); 18345 extern chtype mvinch(int, int); 18346 extern int mvinchnstr(int, int, chtype *, int); 18347 extern int mvinchstr(int, int, chtype *); 18348 extern int mvinnstr(int, int, char *, int); 18349 extern int mvinsch(int, int, chtype); 18350 extern int mvinsnstr(int, int, const char *, int); 18351 extern int mvinsstr(int, int, const char *); 18352 extern int mvinstr(int, int, char *); 18353 extern int mvprintw(int, int, char *, ...); 18354 extern int mvscanw(int, int, const char *, ...); 18355 extern int mvvline(int, int, chtype, int); 18356 extern int mvwaddch(WINDOW *, int, int, const chtype); 18357 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 18358 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 18359 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 18360 extern int mvwaddstr(WINDOW *, int, int, const char *); 18361 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void*); 18362 extern int mvwdelch(WINDOW *, int, int); 18363 extern int mvwgetch(WINDOW *, int, int); 18364 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 18365 extern int mvwgetstr(WINDOW *, int, int, char *); 18366 extern int mvwhline(WINDOW *, int, int, chtype, int); 18367 extern int mvwin(WINDOW *, int, int); 18368 extern chtype mvwinch(WINDOW *, int, int); 18369 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 18370 extern int mvwinchstr(WINDOW *, int, int, chtype *); 18371 extern int mvwinnstr(WINDOW *, int, int, char *, int); 18372 extern int mvwinsch(WINDOW *, int, int, chtype); 18373 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 18374 extern int mvwinsstr(WINDOW *, int, int, const char *); 18375 extern int mvwinstr(WINDOW *, int, int, char *); 18376 extern int mvwprintw(WINDOW *, int, int, char *, ...); 18377 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 18378 extern int mvwvline(WINDOW *, int, int, chtype, int); 18379 extern int napms(int); 18380 extern WINDOW *newpad(int, int); 18381 extern SCREEN *newterm(const char *, FILE *, FILE *); 18382 extern WINDOW *newwin(int, int, int, int); 18383 extern int nl(void); 18384 extern int nocbreak(void); 18385 extern int nodelay(WINDOW *, bool); 18386 extern int noecho(void); 18387 extern int nonl(void); 18388 extern void noqiflush(void); 18389 extern int noraw(void); 18390 extern int notimeout(WINDOW *, bool); 18391 extern int overlay(const WINDOW *, WINDOW *); 18392 extern int overwrite(const WINDOW *, WINDOW *); 18393 extern int pair_content(short, short *, short *); 18394 extern int pechochar(WINDOW *, chtype); 18395 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 18396 extern int prefresh(WINDOW *, int, int, int, int, int, int); 18397 extern int printw(char *, ...); 18398 extern int putwin(WINDOW *, FILE *); 18399 extern void qiflush(void); 18400 extern int raw(void); 18401 extern int redrawwin(WINDOW *); 18402 extern int refresh(void); 18403 extern int resetty(void); 18404 extern int reset_prog_mode(void); 18405 extern int reset_shell_mode(void); 18406 extern int ripoffline(int, int (*init) (WINDOW *, int) 18407 ); 18408 extern int savetty(void); 18409 extern int scanw(const char *, ...); 18410 extern int scr_dump(const char *); 18411 extern int scr_init(const char *); 18412 extern int scrl(int); 18413 extern int scroll(WINDOW *); 18414 extern int scrollok(WINDOW *, typedef unsigned char bool); 18415 extern int scr_restore(const char *); 18416 extern int scr_set(const char *); 18417 extern int setscrreg(int, int); 18418 extern SCREEN *set_term(SCREEN *); 18419 extern int slk_attroff(const typedef unsigned long int chtype); 18420 extern int slk_attron(const typedef unsigned long int chtype); 18421 extern int slk_attrset(const typedef unsigned long int chtype); 18422 extern int slk_attr_set(const typedef chtype attr_t, short, void *); 18423 extern int slk_clear(void); 18424 extern int slk_color(short); 18425 extern int slk_init(int); 18426 extern char *slk_label(int); 18427 extern int slk_noutrefresh(void); 18428 extern int slk_refresh(void); 18429 extern int slk_restore(void); 18430 extern int slk_set(int, const char *, int); 18431 extern int slk_touch(void); 18432 extern int standout(void); 18433 extern int standend(void); 18434 extern int start_color(void); 18435 extern WINDOW *subpad(WINDOW *, int, int, int, int); 18436 extern WINDOW *subwin(WINDOW *, int, int, int, int); 18437 extern int syncok(WINDOW *, typedef unsigned char bool); 18438 extern typedef unsigned long int chtype termattrs(void); 18439 extern char *termname(void); 18440 extern void timeout(int); 18441 extern int typeahead(int); 18442 extern int ungetch(int); 18443 extern int untouchwin(WINDOW *); 18444 extern void use_env(typedef unsigned char bool); 18445 extern int vidattr(typedef unsigned long int chtype); 18446 extern int vidputs(typedef unsigned long int chtype, 18447 int (*vidputs_int) (int) 18448 ); 18449 extern int vline(typedef unsigned long int chtype, int); 18450 extern int vwprintw(WINDOW *, char *, typedef void *va_list); 18451 extern int vw_printw(WINDOW *, const char *, typedef void *va_list); 18452 extern int vwscanw(WINDOW *, const char *, typedef void *va_list); 18453 extern int vw_scanw(WINDOW *, const char *, typedef void *va_list); 18454 extern int waddch(WINDOW *, const typedef unsigned long int chtype); 18455 extern int waddchnstr(WINDOW *, const typedef unsigned long int chtype*, 18456 int); 18457 extern int waddchstr(WINDOW *, const typedef unsigned long int chtype *); 18458 extern int waddnstr(WINDOW *, const char *, int); 18459 extern int waddstr(WINDOW *, const char *); 18460 extern int wattron(WINDOW *, int); 18461 extern int wattroff(WINDOW *, int); 18462 extern int wattrset(WINDOW *, int); 18463 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 18464 extern int wattr_on(WINDOW *, typedef chtype attr_t, void *); 18465 extern int wattr_off(WINDOW *, typedef chtype attr_t, void *); 18466 extern int wattr_set(WINDOW *, typedef chtype attr_t, short, void *); 18467 extern int wbkgd(WINDOW *, typedef unsigned long int chtype); 18468 extern void wbkgdset(WINDOW *, typedef unsigned long int chtype); 18469 extern int wborder(WINDOW *, typedef unsigned long int chtype, 18470 typedef unsigned long int chtype, 18471 typedef unsigned long int chtype, 18472 typedef unsigned long int chtype, 18473 typedef unsigned long int chtype, 18474 typedef unsigned long int chtype, 18475 typedef unsigned long int chtype, 18476 typedef unsigned long int chtype); 18477 extern int wchgat(WINDOW *, int, typedef chtype attr_t, short, 18478 const void *); 18479 extern int wclear(WINDOW *); 18480 extern int wclrtobot(WINDOW *); 18481 extern int wclrtoeol(WINDOW *); 18482 extern int wcolor_set(WINDOW *, short, void *); 18483 extern void wcursyncup(WINDOW *); 18484 extern int wdelch(WINDOW *); 18485 extern int wdeleteln(WINDOW *); 18486 extern int wechochar(WINDOW *, const typedef unsigned long int chtype); 18487 extern int werase(WINDOW *); 18488 extern int wgetch(WINDOW *); 18489 extern int wgetnstr(WINDOW *, char *, int); 18490 extern int wgetstr(WINDOW *, char *); 18491 extern int whline(WINDOW *, typedef unsigned long int chtype, int); 18492 extern typedef unsigned long int chtype winch(WINDOW *); 18493 extern int winchnstr(WINDOW *, chtype *, int); 18494 extern int winchstr(WINDOW *, chtype *); 18495 extern int winnstr(WINDOW *, char *, int); 18496 extern int winsch(WINDOW *, typedef unsigned long int chtype); 18497 extern int winsdelln(WINDOW *, int); 18498 extern int winsertln(WINDOW *); 18499 extern int winsnstr(WINDOW *, const char *, int); 18500 extern int winsstr(WINDOW *, const char *); 18501 extern int winstr(WINDOW *, char *); 18502 extern int wmove(WINDOW *, int, int); 18503 extern int wnoutrefresh(WINDOW *); 18504 extern int wprintw(WINDOW *, char *, ...); 18505 extern int wredrawln(WINDOW *, int, int); 18506 extern int wrefresh(WINDOW *); 18507 extern int wscanw(WINDOW *, const char *, ...); 18508 extern int wscrl(WINDOW *, int); 18509 extern int wsetscrreg(WINDOW *, int, int); 18510 extern int wstandout(WINDOW *); 18511 extern int wstandend(WINDOW *); 18512 extern void wsyncdown(WINDOW *); 18513 extern void wsyncup(WINDOW *); 18514 extern void wtimeout(WINDOW *, int); 18515 extern int wtouchln(WINDOW *, int, int, int); 18516 extern int wvline(WINDOW *, typedef unsigned long int chtype, int); 18517 extern char *unctrl(typedef unsigned long int chtype); 18518 extern int COLORS(void); 18519 extern int COLOR_PAIRS(void); 18520 extern chtype acs_map(void); 18521 extern WINDOW *curscr(void); 18522 extern WINDOW *stdscr(void); 18523 extern int COLS(void); 18524 extern int LINES(void); 18525 extern int touchline(WINDOW *, int, int); 18526 extern int touchwin(WINDOW *); 18527 _________________________________________________________ 18528 18529 14.6.2. term.h 18530 18531 extern int putp(const char *); 18532 extern int tigetflag(const char *); 18533 extern int tigetnum(const char *); 18534 extern char *tigetstr(const char *); 18535 extern char *tparm(const char *, ...); 18536 extern TERMINAL *set_curterm(TERMINAL *); 18537 extern int del_curterm(TERMINAL *); 18538 extern int restartterm(char *, int, int *); 18539 extern int setupterm(char *, int, int *); 18540 extern char *tgetstr(char *, char **); 18541 extern char *tgoto(const char *, int, int); 18542 extern int tgetent(char *, const char *); 18543 extern int tgetflag(char *); 18544 extern int tgetnum(char *); 18545 extern int tputs(const char *, int, int (*putcproc) (int) 18546 ); 18547 extern TERMINAL *cur_term(void); 18548 _________________________________________________________ 18549 18550 14.7. Interfaces for libutil 18551 18552 Table 14-6 defines the library name and shared object name for 18553 the libutil library 18554 18555 Table 14-6. libutil Definition 18556 Library: libutil 18557 SONAME: libutil.so.1 18558 18559 The behavior of the interfaces in this library is specified by 18560 the following specifications: 18561 18562 [LSB] This Specification 18563 _________________________________________________________ 18564 18565 14.7.1. Utility Functions 18566 _________________________________________________________ 18567 18568 14.7.1.1. Interfaces for Utility Functions 18569 18570 An LSB conforming implementation shall provide the generic 18571 functions for Utility Functions specified in Table 14-7, with 18572 the full mandatory functionality as described in the 18573 referenced underlying specification. 18574 18575 Table 14-7. libutil - Utility Functions Function Interfaces 18576 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 18577 logwtmp [LSB] openpty [LSB] 18578 _________________________________________________________ 18579 18580 14.8. Interface Definitions for libutil 18581 18582 Table of Contents 18583 forkpty -- Create a new process attached to an available 18584 pseudo-terminal 18585 18586 login -- login utility function 18587 login_tty -- Prepare a terminal for login 18588 logout -- logout utility function 18589 logwtmp -- append an entry to the wtmp file 18590 openpty -- find and open an available pseudo-terminal 18591 18592 The interfaces defined on the following pages are included in 18593 libutil and are defined by this specification. Unless 18594 otherwise noted, these interfaces shall be included in the 18595 source standard. 18596 18597 Other interfaces listed in Section 14.7 shall behave as 18598 described in the referenced base document. 18599 18600 forkpty 18601 18602 Name 18603 18604 forkpty -- Create a new process attached to an available 18605 pseudo-terminal 18606 18607 Synopsis 18608 18609 #include 18610 18611 int forkpty(int * amaster, char * name, struct termios * 18612 termp, struct winsize * winp); 18613 18614 Description 18615 18616 The forkpty() function shall find and open a pseudo-terminal 18617 device pair in the same manner as the openpty() function. If a 18618 pseudo-terminal is available, forkpty() shall create a new 18619 process in the same manner as the fork() function, and 18620 prepares the new process for login in the same manner as 18621 login_tty(). 18622 18623 If termp is not null, it shall refer to a termios structure 18624 that shall be used to initialize the characteristics of the 18625 slave device. If winp is not null, it shall refer to a winsize 18626 structure used to initialize the window size of the slave 18627 device. 18628 18629 Return Value 18630 18631 On success, the parent process shall return the process id of 18632 the child, and the child shall return 0. On error, no new 18633 process shall be created, -1 shall be returned, and errno 18634 shall be set appropriately. On success, the parent process 18635 shall receive the file descriptor of the master side of the 18636 pseudo-terminal in the location referenced by amaster, and, if 18637 name is not NULL, the filename of the slave device in name. 18638 18639 Errors 18640 18641 EAGAIN 18642 18643 Unable to create a new process. 18644 ENOENT 18645 18646 There are no available pseudo-terminals. 18647 ENOMEM 18648 18649 Insufficient memory was available. 18650 18651 login 18652 18653 Name 18654 18655 login -- login utility function 18656 18657 Synopsis 18658 18659 #include 18660 18661 void login (struct utmp * ut ); 18662 18663 Description 18664 18665 The login() function shall update the user accounting 18666 databases. The ut parameter shall reference a utmp structure 18667 for all fields except the following: 18668 18669 1. The ut_type field shall be set to USER_PROCESS. 18670 2. The ut_pid field shall be set to the process identifier 18671 for the current process. 18672 3. The ut_line field shall be set to the name of the 18673 controlling terminal device. The name shall be found by 18674 examining the device associated with the standard input, 18675 output and error streams in sequence, until one associated 18676 with a terminal device is found. If none of these streams 18677 refers to a terminal device, the ut_line field shall be 18678 set to "???". If the terminal device is in the /dev 18679 directory hierarchy, the ut_line field shall not contain 18680 the leading "/dev/", otherwise it shall be set to the 18681 final component of the pathname of the device. If the user 18682 accounting database imposes a limit on the size of the 18683 ut_line field, it shall truncate the name, but any such 18684 limit shall not be smaller than UT_LINESIZE (including a 18685 terminating null character). 18686 18687 Return Value 18688 18689 None 18690 18691 Errors 18692 18693 None 18694 18695 login_tty 18696 18697 Name 18698 18699 login_tty -- Prepare a terminal for login 18700 18701 Synopsis 18702 18703 #include 18704 18705 int login_tty (int fdr); 18706 18707 Description 18708 18709 The login_tty() function shall prepare the terminal device 18710 referenced by the file descriptor fdr. This function shall 18711 create a new session, make the terminal the controlling 18712 terminal for the current process, and set the standard input, 18713 output, and error streams of the current process to the 18714 terminal. If fdr is not the standard input, output or error 18715 stream, then login_tty() shall close fdr. 18716 18717 Return Value 18718 18719 On success, login_tty() shall return zero; otherwise -1 is 18720 returned, and errno shall be set appropriately. 18721 18722 Errors 18723 18724 ENOTTY 18725 18726 fdr does not refer to a terminal device. 18727 18728 logout 18729 18730 Name 18731 18732 logout -- logout utility function 18733 18734 Synopsis 18735 18736 #include 18737 18738 int logout (const char * line ); 18739 18740 Description 18741 18742 Given the device line, the logout() function shall search the 18743 user accounting database which is read by getutent() for an 18744 entry with the corresponding line, and with the type of 18745 USER_PROCESS. If a corresponding entry is located, it shall be 18746 updated as follows: 18747 18748 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 18749 bytes). 18750 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 18751 bytes). 18752 3. The ut_tv shall be set to the current time of day. 18753 4. The ut_type field shall be set to DEAD_PROCESS. 18754 18755 Return Value 18756 18757 On success, the logout() function shall return non-zero. Zero 18758 is returned if there was no entry to remove, or if the utmp 18759 file could not be opened or updated. 18760 18761 logwtmp 18762 18763 Name 18764 18765 logwtmp -- append an entry to the wtmp file 18766 18767 Synopsis 18768 18769 #include 18770 18771 void logwtmp (const char * line , const char * name , const 18772 char * host ); 18773 18774 Description 18775 18776 If the process has permission to update the user accounting 18777 databases, the logwtmp() function shall append a record to the 18778 user accounting database that records all logins and logouts. 18779 The record to be appended shall be constructed as follows: 18780 18781 1. The ut_line field shall be initialized from line. If the 18782 user accounting database imposes a limit on the size of 18783 the ut_line field, it shall truncate the value, but any 18784 such limit shall not be smaller than UT_LINESIZE 18785 (including a terminating null character). 18786 2. The ut_name field shall be initialized from name. If the 18787 user accounting database imposes a limit on the size of 18788 the ut_name field, it shall truncate the value, but any 18789 such limit shall not be smaller than UT_NAMESIZE 18790 (including a terminating null character). 18791 3. The ut_host field shall be initialized from host. If the 18792 user accounting database imposes a limit on the size of 18793 the ut_host field, it shall truncate the value, but any 18794 such limit shall not be smaller than UT_HOSTSIZE 18795 (including a terminating null character). 18796 4. If the name parameter does not refer to an empty string 18797 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 18798 otherwise the ut_type field shall be set to DEAD_PROCESS. 18799 5. The ut_id field shall be set to the process identifier for 18800 the current process. 18801 6. The ut_tv field shall be set to the current time of day. 18802 18803 Note: If a process does not have write access to the the 18804 user accounting database, the logwtmp() function will not 18805 update it. Since the function does not return any value, an 18806 application has no way of knowing whether it succeeded or 18807 failed. 18808 18809 Return Value 18810 18811 None. 18812 18813 openpty 18814 18815 Name 18816 18817 openpty -- find and open an available pseudo-terminal 18818 18819 Synopsis 18820 18821 #include 18822 18823 int openpty(int *amaster, int *aslave, char *name, struct 18824 termios *termp, struct winsize *winp); 18825 18826 Description 18827 18828 The openpty() function shall find an available pseudo-terminal 18829 and return file descriptors for the master and slave devices 18830 in the locations referenced by amaster and aslave 18831 respectively. If name is not NULL, the filename of the slave 18832 shall be placed in the user supplied buffer referenced by 18833 name. If termp is not NULL, it shall point to a termios 18834 structure used to initialize the terminal parameters of the 18835 slave pseudo-terminal device. If winp is not NULL, it shall 18836 point to a winsize structure used to initialize the window 18837 size parameters of the slave pseudo-terminal device. 18838 18839 Return Value 18840 18841 On success, zero is returned. On error, -1 is returned, and 18842 errno is set appropriately. 18843 18844 Errors 18845 18846 ENOENT 18847 18848 There are no available pseudo-terminals. 18849 18850 V. Commands and Utilities 18851 18852 Table of Contents 18853 15. Commands and Utilities 18854 18855 15.1. Commands and Utilities 18856 15.2. Command Behavior 18857 18858 ar -- create and maintain library archives 18859 (DEPRECATED) 18860 18861 at -- examine or delete jobs for later execution 18862 awk -- pattern scanning and processing language 18863 batch -- schedule commands to be executed in a 18864 batch queue 18865 18866 bc -- an arbitrary precision calculator language 18867 chfn -- change user name and information 18868 chsh -- change login shell 18869 col -- filter reverse line feeds from input 18870 cpio -- copy file archives in and out 18871 crontab -- maintain crontab files for individual 18872 users 18873 18874 cut -- split a file into sections determined by 18875 context lines 18876 18877 df -- report file system disk space usage 18878 dmesg -- print or control the system message buffer 18879 du -- estimate file space usage 18880 echo -- write arguments to standard output 18881 egrep -- search a file with an Extended Regular 18882 Expression pattern 18883 18884 fgrep -- search a file with a fixed pattern 18885 file -- determine file type 18886 find -- search for files in a directory hierarchy 18887 fuser -- identify processes using files or sockets 18888 gettext -- retrieve text string from message 18889 catalog 18890 18891 grep -- print lines matching a pattern 18892 groupadd -- create a new group 18893 groupdel -- delete a group 18894 groupmod -- modify a group 18895 groups -- display a group 18896 gunzip -- uncompress files 18897 gzip -- compress or expand files 18898 hostname -- show or set the system's host name 18899 install -- copy files and set attributes 18900 install_initd -- activate an init script 18901 ipcrm -- remove IPC Resources 18902 ipcs -- provide information on ipc facilities 18903 killall -- kill processes by name 18904 lpr -- off line print 18905 ls -- list directory contents 18906 lsb_release -- print distribution specific 18907 information 18908 18909 m4 -- macro processor 18910 md5sum -- generate or check MD5 message digests 18911 mknod -- make special files 18912 mktemp -- make temporary file name (unique) 18913 more -- display files on a page-by-page basis 18914 mount -- mount a file system 18915 msgfmt -- create a message object from a message 18916 file 18917 18918 newgrp -- change group ID 18919 od -- dump files in octal and other formats 18920 passwd -- change user password 18921 patch -- apply a diff file to an original 18922 pidof -- find the process ID of a running program 18923 remove_initd -- clean up init script system 18924 modifications introduced by install_initd 18925 18926 renice -- alter priority of running processes 18927 sed -- stream editor 18928 sendmail -- an electronic mail transport agent 18929 sh -- shell, the standard command language 18930 interpreter 18931 18932 shutdown -- shut the system down 18933 su -- change user ID 18934 sync -- flush file system buffers 18935 tar -- file archiver 18936 umount -- unmount file systems 18937 useradd -- create a new user or update default new 18938 user information 18939 18940 userdel -- delete a user account and related files 18941 usermod -- modify a user account 18942 xargs -- build and execute command lines from 18943 standard input 18944 _________________________________________________________ 18945 18946 Chapter 15. Commands and Utilities 18947 18948 15.1. Commands and Utilities 18949 18950 An LSB conforming implementation shall provide the commands 18951 and utilities as described in Table 15-1, with at least the 18952 behavior described as mandatory in the referenced underlying 18953 specification, with the following exceptions: 18954 18955 1. If any operand (except one which follows --) starts with a 18956 hyphen, the behavior is unspecified. 18957 18958 Rationale (Informative): Applications should place options 18959 before operands, or use --, as needed. This text is needed 18960 because, by default, GNU option parsing differs from POSIX, 18961 unless the environment variable POSIXLY_CORRECT is set. For 18962 example, ls . -a in GNU ls means to list the current 18963 directory, showing all files (that is, "." is an operand 18964 and -a is an option). In POSIX, "." and -a are both 18965 operands, and the command means to list the current 18966 directory, and also the file named -a. Suggesting that 18967 applications rely on the setting of the POSIXLY_CORRECT 18968 environment variable, or try to set it, seems worse than 18969 just asking the applictions to invoke commands in ways 18970 which work with either the POSIX or GNU behaviors. 18971 18972 Table 15-1. Commands And Utilities 18973 [ [1] dmesg [2] id [1] mount [2] sort [1] 18974 ar [2] du [2] install [2] msgfmt [2] split [1] 18975 at [2] echo [2] install_initd [2] mv [1] strip [1] 18976 awk [2] ed [1] ipcrm [2] newgrp [2] stty [1] 18977 basename [1] egrep [2] ipcs [2] nice [1] su [2] 18978 batch [2] env [1] join [1] nl [1] sync [2] 18979 bc [2] expand [1] kill [1] nohup [1] tail [1] 18980 cat [1] expr [1] killall [2] od [2] tar [2] 18981 chfn [2] false [1] ln [1] passwd [2] tee [1] 18982 chgrp [1] fgrep [2] locale [1] paste [1] test [1] 18983 chmod [1] file [2] localedef [1] patch [2] time [1] 18984 chown [1] find [2] logger [1] pathchk [1] touch [1] 18985 chsh [2] fold [1] logname [1] pax [1] tr [1] 18986 cksum [1] fuser [2] lp [1] pidof [2] true [1] 18987 cmp [1] gencat [1] lpr [2] pr [1] tsort [1] 18988 col [2] getconf [1] ls [2] printf [1] tty [1] 18989 comm [1] gettext [2] lsb_release [2] ps [1] umount [2] 18990 cp [1] grep [2] m4 [2] pwd [1] uname [1] 18991 cpio [2] groupadd [2] mailx [1] remove_initd [2] unexpand [1] 18992 crontab [2] groupdel [2] make [1] renice [2] uniq [1] 18993 csplit [1] groupmod [2] man [1] rm [1] useradd [2] 18994 cut [2] groups [2] md5sum [2] rmdir [1] userdel [2] 18995 date [1] gunzip [2] mkdir [1] sed [2] usermod [2] 18996 dd [1] gzip [2] mkfifo [1] sendmail [2] wc [1] 18997 df [2] head [1] mknod [2] sh [2] xargs [2] 18998 diff [1] hostname [2] mktemp [2] shutdown [2] 18999 dirname [1] iconv [1] more [2] sleep [1] 19000 19001 Referenced Specification(s) 19002 19003 [1]. ISO POSIX (2003) 19004 19005 [2]. This Specification 19006 19007 An LSB conforming implementation shall provide the shell built 19008 in utilities as described in Table 15-2, with at least the 19009 behavior described as mandatory in the referenced underlying 19010 specification, with the following exceptions: 19011 19012 1. The built in commands and utilities shall be provided by 19013 the sh utility itself, and need not be implemented in a 19014 manner so that they can be accessed via the exec family of 19015 functions as defined in ISO POSIX (2003) and should not be 19016 invoked directly by those standard utilities that execute 19017 other utilities ( env, find, nice, nohup, time, xargs). 19018 19019 Rationale (Informative): Since the built in utilities must 19020 affect the environment of the calling process, they have no 19021 effect when executed as a file. 19022 19023 Table 15-2. Built In Utilities 19024 cd [1] getopts [1] read [1] umask [1] wait [1] 19025 19026 Referenced Specification(s) 19027 19028 [1]. ISO POSIX (2003) 19029 _________________________________________________________ 19030 19031 15.2. Command Behavior 19032 19033 Table of Contents 19034 ar -- create and maintain library archives (DEPRECATED) 19035 at -- examine or delete jobs for later execution 19036 awk -- pattern scanning and processing language 19037 batch -- schedule commands to be executed in a batch queue 19038 bc -- an arbitrary precision calculator language 19039 chfn -- change user name and information 19040 chsh -- change login shell 19041 col -- filter reverse line feeds from input 19042 cpio -- copy file archives in and out 19043 crontab -- maintain crontab files for individual users 19044 cut -- split a file into sections determined by context lines 19045 df -- report file system disk space usage 19046 dmesg -- print or control the system message buffer 19047 du -- estimate file space usage 19048 echo -- write arguments to standard output 19049 egrep -- search a file with an Extended Regular Expression 19050 pattern 19051 19052 fgrep -- search a file with a fixed pattern 19053 file -- determine file type 19054 find -- search for files in a directory hierarchy 19055 fuser -- identify processes using files or sockets 19056 gettext -- retrieve text string from message catalog 19057 grep -- print lines matching a pattern 19058 groupadd -- create a new group 19059 groupdel -- delete a group 19060 groupmod -- modify a group 19061 groups -- display a group 19062 gunzip -- uncompress files 19063 gzip -- compress or expand files 19064 hostname -- show or set the system's host name 19065 install -- copy files and set attributes 19066 install_initd -- activate an init script 19067 ipcrm -- remove IPC Resources 19068 ipcs -- provide information on ipc facilities 19069 killall -- kill processes by name 19070 lpr -- off line print 19071 ls -- list directory contents 19072 lsb_release -- print distribution specific information 19073 m4 -- macro processor 19074 md5sum -- generate or check MD5 message digests 19075 mknod -- make special files 19076 mktemp -- make temporary file name (unique) 19077 more -- display files on a page-by-page basis 19078 mount -- mount a file system 19079 msgfmt -- create a message object from a message file 19080 newgrp -- change group ID 19081 od -- dump files in octal and other formats 19082 passwd -- change user password 19083 patch -- apply a diff file to an original 19084 pidof -- find the process ID of a running program 19085 remove_initd -- clean up init script system modifications 19086 introduced by install_initd 19087 19088 renice -- alter priority of running processes 19089 sed -- stream editor 19090 sendmail -- an electronic mail transport agent 19091 sh -- shell, the standard command language interpreter 19092 shutdown -- shut the system down 19093 su -- change user ID 19094 sync -- flush file system buffers 19095 tar -- file archiver 19096 umount -- unmount file systems 19097 useradd -- create a new user or update default new user 19098 information 19099 19100 userdel -- delete a user account and related files 19101 usermod -- modify a user account 19102 xargs -- build and execute command lines from standard input 19103 19104 This section contains descriptions for commands and utilities 19105 whose specified behavior in the LSB contradicts or extends the 19106 standards referenced. It also contains commands and utilities 19107 only required by the LSB and not specified by other standards. 19108 19109 ar 19110 19111 Name 19112 19113 ar -- create and maintain library archives (DEPRECATED) 19114 19115 Description 19116 19117 ar is deprecated from the LSB and is expected to disappear 19118 from a future version of the LSB. 19119 19120 Rationale: The LSB generally does not include software 19121 development utilities nor does it specify .o and .a file 19122 formats. 19123 19124 ar is as specified in ISO POSIX (2003) but with differences as 19125 listed below. 19126 19127 Differences 19128 19129 -T, -C 19130 19131 need not be accepted. 19132 -l 19133 19134 has unspecified behavior. 19135 -q 19136 19137 has unspecified behavior; using -r is suggested. 19138 19139 at 19140 19141 Name 19142 19143 at -- examine or delete jobs for later execution 19144 19145 Description 19146 19147 at is as specified in ISO POSIX (2003) but with differences as 19148 listed below. 19149 19150 Differences 19151 19152 Options 19153 19154 -d 19155 19156 is functionally equivalent to the -r option specified in ISO 19157 POSIX (2003). 19158 -r 19159 19160 need not be supported, but the '-d' option is equivalent. 19161 -t time 19162 19163 need not be supported. 19164 19165 Optional Control Files 19166 19167 The implementation shall support the XSI optional behavior for 19168 access control; however the files at.allow and at.deny may 19169 reside in /etc rather than /usr/lib/cron. 19170 19171 awk 19172 19173 Name 19174 19175 awk -- pattern scanning and processing language 19176 19177 Description 19178 19179 awk is as specified in ISO POSIX (2003) but with differences 19180 as listed below. 19181 19182 Differences 19183 19184 Certain aspects of internationalized regular expressions are 19185 optional; see Internationalization and Regular Expressions. 19186 19187 batch 19188 19189 Name 19190 19191 batch -- schedule commands to be executed in a batch queue 19192 19193 Description 19194 19195 The specification for batch is as specified in ISO POSIX 19196 (2003), but with differences as listed below. 19197 19198 Optional Control Files 19199 19200 The implementation shall support the XSI optional behavior for 19201 access control; however the files at.allow and at.deny may 19202 reside in /etc rather than /usr/lib/cron. 19203 19204 bc 19205 19206 Name 19207 19208 bc -- an arbitrary precision calculator language 19209 19210 Description 19211 19212 bc is as specified in ISO POSIX (2003) but with extensions as 19213 listed below. 19214 19215 Extensions 19216 19217 The bc language may be extended in an implementation defined 19218 manner. If an implementation supports extensions, it shall 19219 also support the additional options: 19220 19221 -s|--standard 19222 19223 processes exactly the POSIX bc language. 19224 -w|--warn 19225 19226 gives warnings for extensions to POSIX bc. 19227 19228 chfn 19229 19230 Name 19231 19232 chfn -- change user name and information 19233 19234 Synopsis 19235 19236 chfn [-f full_name] [-h home_phone] [user] 19237 19238 Description 19239 19240 chfn shall update the user database. An unprivileged user may 19241 only change the fields for their own account, a user with 19242 appropriate privileges may change the fields for any account. 19243 19244 The fields full_name and home_phone may contain any character 19245 except: 19246 19247 any control character 19248 comma 19249 colon 19250 equal sign 19251 19252 If none of the options are selected, chfn operates in an 19253 interactive fashion. The prompts and expected input in 19254 interactive mode are unspecified and should not be relied 19255 upon. 19256 19257 As it is possible for the system to be configured to restrict 19258 which fields a non-privileged user is permitted to change, 19259 applications should be written to gracefully handle these 19260 situations. 19261 19262 Standard Options 19263 19264 -f full_name 19265 19266 sets the user's full name. 19267 -h home_phone 19268 19269 sets the user's home phone number. 19270 19271 Future Directions 19272 19273 The following two options are expected to be added in a future 19274 version of the LSB: 19275 19276 -o office 19277 19278 sets the user's office room number. 19279 -p office_phone 19280 19281 sets the user's office phone number. 19282 19283 Note that some implementations contain a "-o other" option 19284 which specifies an additional field called "other". 19285 Traditionally, this field is not subject to the constraints 19286 about legitimate characters in fields. Also, one traditionally 19287 shall have appropriate privileges to change the other field. 19288 At this point there is no consensus about whether it is 19289 desirable to specify the other field; applications may wish to 19290 avoid using it. 19291 19292 The "-w work_phone" field found in some implementations should 19293 be replaced by the "-p office_phone" field. The "-r 19294 room_number" field found in some implementations is the 19295 equivalent of the "-o office" option mentioned above; which 19296 one of these two options to specify will depend on 19297 implementation experience and the decision regarding the other 19298 field. 19299 19300 chsh 19301 19302 Name 19303 19304 chsh -- change login shell 19305 19306 Synopsis 19307 19308 chsh [-s login_shell] [user] 19309 19310 Description 19311 19312 chsh changes the user login shell. This determines the name of 19313 the user's initial login command. An unprivileged user may 19314 only change the login shell for their own account, a user with 19315 appropriate privilege may change the login shell for any 19316 account specified by user. 19317 19318 Unless the user has appropriate privilege, the initial login 19319 command name shall be one of those listed in /etc/shells. The 19320 login_shell shall be the absolute path (i.e. it must start 19321 with '/') to an executable file. Accounts which are restricted 19322 (in an implementation-defined manner) may not change their 19323 login shell. 19324 19325 If the -s option is not selected, chsh operates in an 19326 interactive mode. The prompts and expected input in this mode 19327 are unspecified. 19328 19329 Standard Options 19330 19331 -s login_shell 19332 19333 sets the login shell. 19334 19335 col 19336 19337 Name 19338 19339 col -- filter reverse line feeds from input 19340 19341 Description 19342 19343 col is as specified in SUSv2 but with differences as listed 19344 below. 19345 19346 Differences 19347 19348 The -p option has unspecified behavior. 19349 19350 Note: Although col is shown as legacy in SUSv2, it is not 19351 (yet) deprecated in the LSB. 19352 19353 cpio 19354 19355 Name 19356 19357 cpio -- copy file archives in and out 19358 19359 Description 19360 19361 cpio is as specified in ISO POSIX (2003), but with differences 19362 as listed below. 19363 19364 Differences 19365 19366 Some elements of the Pattern Matching Notation are optional; 19367 see Internationalization and Pattern Matching Notation. 19368 19369 crontab 19370 19371 Name 19372 19373 crontab -- maintain crontab files for individual users 19374 19375 Synopsis 19376 19377 crontab [-u user] file 19378 crontab [-u user] {-l | -r | -e} 19379 19380 Description 19381 19382 crontab is as specified in ISO POSIX (2003), but with 19383 differences as listed below. 19384 19385 Optional Control Files 19386 19387 The implementation shall support the XSI optional behavior for 19388 access control; however the files cron.allow and cron.deny may 19389 reside in /etc rather than /usr/lib/cron. 19390 19391 cut 19392 19393 Name 19394 19395 cut -- split a file into sections determined by context lines 19396 19397 Description 19398 19399 cut is as specified in ISO POSIX (2003), but with differences 19400 as listed below. 19401 19402 Differences 19403 19404 -n 19405 19406 has unspecified behavior. 19407 19408 df 19409 19410 Name 19411 19412 df -- report file system disk space usage 19413 19414 Description 19415 19416 The df command shall behave as specified in ISO POSIX (2003), 19417 but with differences as listed below. 19418 19419 Differences 19420 19421 Options 19422 19423 If the -k option is not specified, disk space is shown in 19424 unspecified units. If the -P option is specified, the size of 19425 the unit shall be printed on the header line in the format 19426 "%4s-blocks". Applications should specify -k. 19427 19428 The XSI option -t has unspecified behavior. Applications 19429 should not specify -t. 19430 19431 Rationale: The most common implementation of df uses the -t 19432 option for a different purpose (restricting output to a 19433 particular file system type), and use of -t is therefore 19434 non-portable. 19435 19436 Operand May Identify Special File 19437 19438 If an argument is the absolute file name of a special file 19439 containing a mounted file system, df shall show the space 19440 available on that file system rather than on the file system 19441 containing the special file (which is typically the root file 19442 system). 19443 19444 Note: In ISO POSIX (2003) the XSI optional behavior permits 19445 an operand to name a special file, but appears to require 19446 the operation be performed on the file system containing 19447 the special file. A defect report has been submitted for 19448 this case. 19449 19450 dmesg 19451 19452 Name 19453 19454 dmesg -- print or control the system message buffer 19455 19456 Synopsis 19457 19458 dmesg [-c | -n level | -s bufsize] 19459 19460 Description 19461 19462 dmesg examines or controls the system message buffer. Only a 19463 user with appropriate privileges may modify the system message 19464 buffer parameters or contents. 19465 19466 Standard Options 19467 19468 -c 19469 19470 If the user has appropriate privilege, clears the system 19471 message buffer contents after printing. 19472 -n level 19473 19474 If the user has appropriate privilege, sets the level at which 19475 logging of messages is done to the console. 19476 -s bufsize 19477 19478 uses a buffer of bufsize to query the system message buffer. 19479 This is 16392 by default. 19480 19481 du 19482 19483 Name 19484 19485 du -- estimate file space usage 19486 19487 Description 19488 19489 du is as specified in ISO POSIX (2003), but with differences 19490 as listed below. 19491 19492 Differences 19493 19494 If the -k option is not specified, disk space is shown in 19495 unspecified units. Applications should specify -k. 19496 19497 echo 19498 19499 Name 19500 19501 echo -- write arguments to standard output 19502 19503 Synopsis 19504 19505 echo [string...] 19506 19507 Description 19508 19509 The echo command is as specified in ISO POSIX (2003), but with 19510 the following differences. 19511 19512 Implementations may support implementation-defined options to 19513 echo. The behavior of echo if any arguments contain 19514 backslashes is also implementation defined. 19515 19516 Application Usage 19517 19518 Conforming applications should not run echo with a first 19519 argument starting with a hyphen, or with any arguments 19520 containing backslashes; they should use printf in those cases. 19521 19522 Note: The behavior specified here is similar to that 19523 specified by ISO POSIX (2003) without the XSI option. 19524 However, the LSB strongly recommends conforming 19525 applications not use any options (even if the 19526 implementation provides them) while ISO POSIX (2003) 19527 specifies behavior if the first operand is the string -n. 19528 19529 egrep 19530 19531 Name 19532 19533 egrep -- search a file with an Extended Regular Expression 19534 pattern 19535 19536 Description 19537 19538 egrep is equivalent to grep -E. For further details, see the 19539 specification for grep. 19540 19541 fgrep 19542 19543 Name 19544 19545 fgrep -- search a file with a fixed pattern 19546 19547 Description 19548 19549 fgrep is equivalent to grep -F. For further details, see the 19550 specification for grep. 19551 19552 file 19553 19554 Name 19555 19556 file -- determine file type 19557 19558 Description 19559 19560 file is as specified in ISO POSIX (2003), but with differences 19561 as listed below. 19562 19563 Differences 19564 19565 The -M, -h, -d, and -i options need not be supported. 19566 19567 find 19568 19569 Name 19570 19571 find -- search for files in a directory hierarchy 19572 19573 Description 19574 19575 find shall behave as specified in ISO POSIX (2003), except as 19576 described below. 19577 19578 Differences 19579 19580 Pattern Matching 19581 19582 Some elements of the Pattern Matching Notation are optional; 19583 see Internationalization and Pattern Matching Notation. 19584 19585 Option and Operand Handling 19586 19587 Options and operands to find shall behave as described in ISO 19588 POSIX (2003), except as follows: 19589 19590 -H 19591 19592 need not be supported 19593 -L 19594 19595 need not be supported 19596 -exec ... + 19597 19598 argument aggregation need not be supported 19599 19600 Rationale: The -H and -L options are not yet widely 19601 available in implementations of the find command, nor is 19602 argument aggregation. A future version of this 19603 specification will require these features be supported. 19604 19605 fuser 19606 19607 Name 19608 19609 fuser -- identify processes using files or sockets 19610 19611 Description 19612 19613 fuser is as specified in ISO POSIX (2003), but with 19614 differences as listed below. 19615 19616 Differences 19617 19618 The fuser command is a system administration utility, see Path 19619 For System Administration Utilities. 19620 19621 Option Differences 19622 19623 -c 19624 19625 has unspecified behavior. 19626 -f 19627 19628 has unspecified behavior. 19629 19630 gettext 19631 19632 Name 19633 19634 gettext -- retrieve text string from message catalog 19635 19636 Synopsis 19637 19638 gettext [options] [textdomain] msgid 19639 gettext -s [options] msgid... 19640 19641 Description 19642 19643 The gettext utility retrieves a translated text string 19644 corresponding to string msgid from a message object generated 19645 with msgfmt utility. 19646 19647 The message object name is derived from the optional argument 19648 textdomain if present, otherwise from the TEXTDOMAIN 19649 environment variable. If no domain is specified, or if a 19650 corresponding string cannot be found, gettext prints msgid. 19651 19652 Ordinarily gettext looks for its message object in 19653 dirname/lang/LC_MESSAGES where dirname is the 19654 implementation-defined default directory and lang is the 19655 locale name. If present, the TEXTDOMAINDIR environment 19656 variable replaces the dirname. 19657 19658 This utility interprets C escape sequences such as \t for tab. 19659 Use \\ to print a backslash. To produce a message on a line of 19660 its own, either put a \n at the end of msgid, or use this 19661 command in conjunction with the printf utility. 19662 19663 When used with the -s option the gettext utility behaves like 19664 the echo utility, except that the message corresponding to 19665 msgid in the selected catalog provides the arguments. 19666 19667 Options 19668 19669 -d domainname, --domain=domainname 19670 19671 PARAMETER translated messages from domainname. 19672 -e 19673 19674 Enable expansion of some escape sequences. 19675 -n 19676 19677 Suppress trailing newline. 19678 19679 Operands 19680 19681 The following operands are supported: 19682 19683 textdomain 19684 19685 A domain name used to retrieve the messages. 19686 msgid 19687 19688 A key to retrieve the localized message. 19689 19690 Environment Variables 19691 19692 LANGUAGE 19693 19694 Specifies one or more locale names. 19695 LANG 19696 19697 Specifies locale name. 19698 LC_MESSAGES 19699 19700 Specifies messaging locale, and if present overrides LANG for 19701 messages. 19702 TEXTDOMAIN 19703 19704 Specifies the text domain name, which is identical to the 19705 message object filename without .mo suffix. 19706 TEXTDOMAINDIR 19707 19708 Specifies the pathname to the message catalog, and if present 19709 replaces the implementation-defined default directory. 19710 19711 Exit Status 19712 19713 The following exit values are returned: 19714 19715 0 19716 19717 Successful completion. 19718 >0 19719 19720 An error occurred. 19721 19722 grep 19723 19724 Name 19725 19726 grep -- print lines matching a pattern 19727 19728 Description 19729 19730 grep is as specified in ISO POSIX (2003), but with differences 19731 as listed below. 19732 19733 LSB Differences 19734 19735 Certain aspects of regular expression matching are optional; 19736 see Internationalization and Regular Expressions. 19737 19738 groupadd 19739 19740 Name 19741 19742 groupadd -- create a new group 19743 19744 Synopsis 19745 19746 groupadd [-g gid [-o]] group 19747 19748 Description 19749 19750 If the caller has appropriate privilege, the groupadd command 19751 shall create a new group named group. The group name shall be 19752 unique in the group database. If no gid is specified, groupadd 19753 shall create the new group with a unique group ID. 19754 19755 The groupadd command is a system administration utility, see 19756 Path For System Administration Utilities. 19757 19758 Options 19759 19760 -g gid [-o] 19761 19762 The new group shall have group ID gid. If the -o option is not 19763 used, no other group shall have this group ID. The value of 19764 gid shall be non-negative. 19765 19766 groupdel 19767 19768 Name 19769 19770 groupdel -- delete a group 19771 19772 Synopsis 19773 19774 groupdel group 19775 19776 Description 19777 19778 If the caller has sufficient privilege, the groupdel command 19779 shall modify the system group database, deleting the group 19780 named group. If the group named group does not exist, groupdel 19781 shall issue a diagnostic message and exit with a non-zero exit 19782 status. 19783 19784 The groupdel command is a system administration utility, see 19785 Path For System Administration Utilities. 19786 19787 groupmod 19788 19789 Name 19790 19791 groupmod -- modify a group 19792 19793 Synopsis 19794 19795 groupmod [-g gid [-o]] [-n group_name] group 19796 19797 Description 19798 19799 If the caller has appropriate privilege, the groupmod command 19800 shall modify the entry in the system group database 19801 corresponding to a group named group. 19802 19803 The groupmod command is a system administration utility, see 19804 Path For System Administration Utilities. 19805 19806 Options 19807 19808 -g gid [-o] 19809 19810 Modify the group's group ID, setting it to gid. If the -o 19811 option is not used, no other group shall have this group ID. 19812 The value of gidshall be non-negative. 19813 19814 Note: Only the group ID in the database is altered; any 19815 files with group ownership set to the original group ID are 19816 unchanged by this modification. 19817 19818 -n group_name 19819 19820 changes the name of the group from group to group_name. 19821 19822 groups 19823 19824 Name 19825 19826 groups -- display a group 19827 19828 Synopsis 19829 19830 groups [user] 19831 19832 Description 19833 19834 The groups command shall behave as id -Gn [user], as specified 19835 in ISO POSIX (2003). The optional user parameter will display 19836 the groups for the named user. 19837 19838 gunzip 19839 19840 Name 19841 19842 gunzip -- uncompress files 19843 19844 Description 19845 19846 gunzip is equivalent to gzip -d. See the specification for 19847 gzip for further details. 19848 19849 gzip 19850 19851 Name 19852 19853 gzip -- compress or expand files 19854 19855 Synopsis 19856 19857 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 19858 19859 Description 19860 19861 The gzip command shall attempt to reduce the size of the named 19862 files. Whenever possible, each file is replaced by one with 19863 the extension .gz, while keeping the same ownership, modes, 19864 access and modification times. If no files are specified, or 19865 if a file name is -, the standard input is compressed to the 19866 standard output. gzip shall only attempt to compress regular 19867 files. In particular, it will ignore symbolic links. 19868 19869 When compressing, gzip uses the deflate algorithm specified in 19870 RFC 1951: DEFLATE Compressed Data Format Specification and 19871 stores the result in a file using the gzip file format 19872 specified in RFC 1952: GZIP File Format Specification. 19873 19874 Options 19875 19876 -c, --stdout, --to-stdout 19877 writes output on standard output, leaving the original 19878 files unchanged. If there are several input files, the 19879 output consists of a sequence of independently 19880 compressed members. To obtain better compression, 19881 concatenate all input files before compressing them. 19882 19883 -d, --decompress, --uncompress 19884 the name operands are compressed files, and gzip shall 19885 decompress them. 19886 19887 -f, --force 19888 forces compression or decompression even if the file 19889 has multiple links or the corresponding file already 19890 exists, or if the compressed data is read from or 19891 written to a terminal. If the input data is not in a 19892 format recognized by gzip, and if the option --stdout 19893 is also given, copy the input data without change to 19894 the standard ouput: let gzip behave as cat. If -f is 19895 not given, and when not running in the background, gzip 19896 prompts to verify whether an existing file should be 19897 overwritten. 19898 19899 -l, --list 19900 lists the compressed size, uncompressed size, ratio and 19901 uncompressed name for each compressed file. For files 19902 that are not in gzip format, the uncompressed size 19903 shall be given as -1. If the --verbose or -v option is 19904 also specified, the crc and timestamp for the 19905 uncompressed file shall also be displayed. 19906 19907 For decompression, gzip shall support at least the 19908 following compression methods: 19909 19910 + deflate (RFC 1951: DEFLATE Compressed Data Format 19911 Specification) 19912 + compress (ISO POSIX (2003)) 19913 19914 The crc shall be given as ffffffff for a file not in 19915 gzip format. 19916 19917 If the --name or -N option is also specified, the 19918 uncompressed name, date and time are those stored 19919 within the compressed file, if present. 19920 19921 If the --quiet or -q option is also specified, the 19922 title and totals lines are not displayed. 19923 19924 -L, --license 19925 displays the gzip license and quit. 19926 19927 -n, --no-name 19928 does not save the original file name and time stamp by 19929 default when compressing. (The original name is always 19930 saved if the name had to be truncated.) When 19931 decompressing, do not restore the original file name if 19932 present (remove only the gzip suffix from the 19933 compressed file name) and do not restore the original 19934 time stamp if present (copy it from the compressed 19935 file). This option is the default when decompressing. 19936 19937 -N, --name 19938 always saves the original file name and time stamp when 19939 compressing; this is the default. When decompressing, 19940 restore the original file name and time stamp if 19941 present. This option is useful on systems which have a 19942 limit on file name length or when the time stamp has 19943 been lost after a file transfer. 19944 19945 -q, --quiet 19946 suppresses all warnings. 19947 19948 -r, --recursive 19949 travels the directory structure recursively. If any of 19950 the file names specified on the command line are 19951 directories, gzip will descend into the directory and 19952 compress all the files it finds there (or decompress 19953 them in the case of gunzip). 19954 19955 -S .suf, --sufix .suf 19956 uses suffix .suf instead of .gz. 19957 19958 -t, --test 19959 checks the compressed file integrity. 19960 19961 -v, --verbose 19962 displays the name and percentage reduction for each 19963 file compressed or decompressed. 19964 19965 -#, --fast, --best 19966 regulates the speed of compression using the specified 19967 digit #, where -1 or --fast indicates the fastest 19968 compression method (less compression) and -9 or --best 19969 indicates the slowest compression method (best 19970 compression). The default compression level is -6 (that 19971 is, biased towards high compression at expense of 19972 speed). 19973 19974 LSB Deprecated Options 19975 19976 The behaviors specified in this section are expected to 19977 disappear from a future version of the LSB; applications 19978 should only use the non-LSB-deprecated behaviors. 19979 19980 -V, --version 19981 19982 displays the version number and compilation options, then 19983 quits. 19984 19985 hostname 19986 19987 Name 19988 19989 hostname -- show or set the system's host name 19990 19991 Synopsis 19992 19993 hostname [name] 19994 19995 Description 19996 19997 hostname is used to either display or, with appropriate 19998 privileges, set the current host name of the system. The host 19999 name is used by many applications to identify the machine. 20000 20001 When called without any arguments, the program displays the 20002 name of the system as returned by the gethostname() function. 20003 20004 When called with a name argument, and the user has appropriate 20005 privilege, the command sets the host name. 20006 20007 Note: It is not specified if the hostname displayed will be 20008 a fully qualified domain name. Applications requiring a 20009 particular format of hostname should check the output and 20010 take appropriate action. 20011 20012 install 20013 20014 Name 20015 20016 install -- copy files and set attributes 20017 20018 Synopsis 20019 20020 install [option...] SOURCE DEST 20021 install [option...] SOURCE... DEST 20022 install [-d | --directory] [option...] DIRECTORY... 20023 20024 Description 20025 20026 In the first two formats, copy SOURCE to DEST or multiple 20027 SOURCE(s) to the existing DEST directory, optionally setting 20028 permission modes and file ownership. In the third format, each 20029 DIRECTORY and any missing parent directories shall be created. 20030 20031 Standard Options 20032 20033 --backup[=METHOD] 20034 makes a backup of each existing destination file. 20035 METHOD may be one of the following: 20036 20037 none or off 20038 20039 never make backups. 20040 numbered or t 20041 20042 make numbered backups. A numbered backup has the form 20043 "%s.~%d~", target_name, version_number. Each backup shall 20044 increment the version number by 1. 20045 existing or nil 20046 20047 behave as numbered if numbered backups exist, or simple 20048 otherwise. 20049 simple or never 20050 20051 append a suffix to the name. The default suffix is '~', but 20052 can be overriden by setting SIMPLE_BACKUP_SUFFIX in the 20053 environment, or via the -S or --suffix option. 20054 20055 If no METHOD is specified, the environment variable 20056 VERSION_CONTROL shall be examined for one of the above. 20057 Unambiguous abbreviations of METHOD shall be accepted. 20058 If no METHOD is specified, or if METHOD is empty, the 20059 backup method shall default to existing. 20060 20061 If METHOD is invalid or ambiguous, install shall fail 20062 and issue a diagnostic message. 20063 20064 -b 20065 is equivalent to --backup=existing. 20066 20067 -d, --directory 20068 treats all arguments as directory names; creates all 20069 components of the specified directories. 20070 20071 -D 20072 creates all leading components of DEST except the last, 20073 then copies SOURCE to DEST; useful in the 1st format. 20074 20075 -g GROUP, --group=GROUP 20076 if the user has appropriate privilege, sets group 20077 ownership, instead of process' current group. GROUP is 20078 either a name in the user group database, or a positive 20079 integer, which shall be used as a group-id. 20080 20081 -m MODE, --mode=MODE 20082 sets permission mode (specified as in chmod), instead 20083 of the default rwxr-xr-x. 20084 20085 -o OWNER, --owner=OWNER 20086 if the user has appropriate privilege, sets ownership. 20087 OWNER is either a name in the user login database, or a 20088 positive integer, which shall be used as a user-id. 20089 20090 -p, --preserve-timestamps 20091 copies the access and modification times of SOURCE 20092 files to corresponding destination files. 20093 20094 -s, --strip 20095 strips symbol tables, only for 1st and 2nd formats. 20096 20097 -S SUFFIX, --suffix=SUFFIX 20098 equivalent to --backup=existing, except if a simple 20099 suffix is required, use SUFFIX. 20100 20101 --verbose 20102 prints the name of each directory as it is created. 20103 20104 -v, --verbose 20105 print the name of each file before copying it to 20106 stdout. 20107 20108 install_initd 20109 20110 Name 20111 20112 install_initd -- activate an init script 20113 20114 Synopsis 20115 20116 /usr/lib/lsb/install_initd initd_file 20117 20118 Description 20119 20120 install_initd shall activate a system initialization file that 20121 has been copied to an implementation defined location such 20122 that this file shall be run at the appropriate point during 20123 system initialization. The install_initd command is typically 20124 called in the postinstall script of a package, after the 20125 script has been copied to /etc/init.d. See also Installation 20126 and Removal of Init Scripts. 20127 20128 ipcrm 20129 20130 Name 20131 20132 ipcrm -- remove IPC Resources 20133 20134 Synopsis 20135 20136 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid 20137 | -M shmkey]... 20138 ipcrm [shm | msg | msg] id... 20139 20140 Description 20141 20142 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 20143 the ipcrm shall behave as described in ISO POSIX (2003). 20144 20145 Otherwise, ipcrm shall remove the resource of the specified 20146 type identified by id. 20147 20148 Future Directions 20149 20150 A future revision of this specification may deprecate the 20151 second synopsis form. 20152 20153 Rationale: In its first Linux implementation, ipcrm used 20154 the second syntax shown in the SYNOPSIS. Functionality 20155 present in other implementations of ipcrm has since been 20156 added, namely the ability to delete resources by key (not 20157 just identifier), and to respect the same command line 20158 syntax. The previous syntax is still supported for 20159 backwards compatibility only. 20160 20161 ipcs 20162 20163 Name 20164 20165 ipcs -- provide information on ipc facilities 20166 20167 Synopsis 20168 20169 ipcs [-smq] [-tcp] 20170 20171 Description 20172 20173 ipcs provides information on the ipc facilities for which the 20174 calling process has read access. 20175 20176 Note: Although this command has many similarities with the 20177 optional ipcs utility described in ISO POSIX (2003), it has 20178 substantial differences and is therefore described 20179 separately. The options specified here have similar meaning 20180 to those in ISO POSIX (2003); other options specified there 20181 have unspecified behavior on an LSB conforming 20182 implementation. See Application Usage below. The output 20183 format is not specified. 20184 20185 Resource display options 20186 20187 -m 20188 20189 shared memory segments. 20190 -q 20191 20192 message queues. 20193 -s 20194 20195 semaphore arrays. 20196 20197 Output format options 20198 20199 -t 20200 20201 time. 20202 -p 20203 20204 pid. 20205 -c 20206 20207 creator. 20208 20209 Application Usage 20210 20211 In some implementations of ipcs the -a option will print all 20212 information available. In other implementations the -a option 20213 will print all resource types. Therefore, applications shall 20214 not use the -a option. 20215 20216 Some implementations of ipcs provide more output formats than 20217 are specified here. These options are not consistent between 20218 differing implementations of ipcs. Therefore, only the -t, -c 20219 and -p option formatting flags may be used. At least one of 20220 the -t, -c and -p options and at least one of -m, -q and -s 20221 options shall be specified. If no options are specified, the 20222 output is unspecified. 20223 20224 killall 20225 20226 Name 20227 20228 killall -- kill processes by name 20229 20230 Synopsis 20231 20232 killall [-egiqvw] [-signal] name... 20233 killall -l 20234 killall -V 20235 20236 Description 20237 20238 killall sends a signal to all processes running any of the 20239 specified commands. If no signal name is specified, SIGTERM is 20240 sent. 20241 20242 Signals can be specified either by name (e.g. -HUP) or by 20243 number (e.g. -1). Signal 0 (check if a process exists) can 20244 only be specified by number. 20245 20246 If the command name contains a slash (/), processes executing 20247 that particular file will be selected for killing, independent 20248 of their name. 20249 20250 killall returns a non-zero return code if no process has been 20251 killed for any of the listed commands. If at least one process 20252 has been killed for each command, killall returns zero. 20253 20254 A killall process never kills itself (but may kill other 20255 killall processes). 20256 20257 Standard Options 20258 20259 -e 20260 20261 requires an exact match for very long names. If a command name 20262 is longer than 15 characters, the full name may be unavailable 20263 (i.e. it is swapped out). In this case, killall will kill 20264 everything that matches within the first 15 characters. With 20265 -e, such entries are skipped. killall prints a message for 20266 each skipped entry if -v is specified in addition to -e. 20267 -g 20268 20269 kills the process group to which the process belongs. The kill 20270 signal is only sent once per group, even if multiple processes 20271 belonging to the same process group were found. 20272 -i 20273 20274 asks interactively for confirmation before killing. 20275 -l 20276 20277 lists all known signal names. 20278 -q 20279 20280 does not complain if no processes were killed. 20281 -v 20282 20283 reports if the signal was successfully sent. 20284 20285 LSB Deprecated Options 20286 20287 The behaviors specified in this section are expected to 20288 disappear from a future version of the LSB; applications 20289 should only use the non-LSB-deprecated behaviors. 20290 20291 -V 20292 20293 displays version information. 20294 20295 lpr 20296 20297 Name 20298 20299 lpr -- off line print 20300 20301 Synopsis 20302 20303 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 20304 title] [name ......] 20305 20306 Description 20307 20308 lpr uses a spooling daemon to print the named files when 20309 facilities become available. If no names appear, the standard 20310 input is assumed. 20311 20312 Standard Options 20313 20314 -l 20315 20316 identifies binary data that is not to be filtered but sent as 20317 raw input to printer. 20318 -p 20319 20320 formats with "pr" before sending to printer. 20321 -Pprinter 20322 20323 sends output to the printer named printer instead of the 20324 default printer. 20325 -h 20326 20327 suppresses header page. 20328 -s 20329 20330 uses symbolic links. 20331 -#copies 20332 20333 specifies copies as the number of copies to print. 20334 -J name 20335 20336 specifies name as the job name for the header page. 20337 -T title 20338 20339 specifies title as the title used for "pr". 20340 20341 ls 20342 20343 Name 20344 20345 ls -- list directory contents 20346 20347 Description 20348 20349 ls shall behave as specified in ISO POSIX (2003), but with 20350 extensions listed below. 20351 20352 Extensions 20353 20354 -l 20355 20356 If the file is a character special or block special file, the 20357 size of the file shall be replaced with two unsigned numbers 20358 in the format "%u, %u", representing the major and minor 20359 device numbers associated with the special file. 20360 20361 Note: The LSB does not specify the meaning of the major and 20362 minor devices numbers. 20363 20364 -p 20365 20366 in addition to ISO POSIX (2003) XSI optional behavior of 20367 printing a slash for a directory, ls -p may display other 20368 characters for other file types. 20369 20370 lsb_release 20371 20372 Name 20373 20374 lsb_release -- print distribution specific information 20375 20376 Synopsis 20377 20378 lsb_release [OPTION...] 20379 20380 Description 20381 20382 The lsb_release command prints certain LSB (Linux Standard 20383 Base) and Distribution information. 20384 20385 If no options are given, the -v option is assumed. 20386 20387 Options 20388 20389 -v, --version 20390 20391 displays version of LSB against which distribution is 20392 compliant. The version is expressed as a colon separated list 20393 of LSB module descriptions. LSB module descriptions are dash 20394 separated tuples containing the module name, version, and 20395 architecture name. The output is a single line of text of the 20396 following format: 20397 20398 LSB Version:\tListAsDescribedAbove 20399 20400 Note: An implementation may support multiple releases of 20401 the same module. Version specific library interfaces, if 20402 any, will be selected by the program interpreter, which 20403 changes from release to release. Version specific commands 20404 and utilities, if any, will be described in the relevant 20405 specification. 20406 20407 -i, --id 20408 20409 displays string id of distributor. The output is a single line 20410 of text of the following format: 20411 20412 Distributor ID:\tDistributorID 20413 -d, --description 20414 20415 displays single line text description of distribution. The 20416 output is of the following format: 20417 20418 Description:\tDescription 20419 -r, --release 20420 20421 displays release number of distribution. The output is a 20422 single line of text of the following format: 20423 20424 Release:\tRelease 20425 -c, --codename 20426 20427 displays codename according to distribution release. The 20428 output is a single line of text of the following format. 20429 20430 Codename:\tCodename 20431 -a, --all 20432 20433 displays all of the above information. 20434 -s, --short 20435 20436 displays all of the above information in short output format. 20437 -h, --help 20438 20439 displays a human-readable help message. 20440 20441 Examples 20442 20443 The following command will list the LSB Profiles which are 20444 currently supported on this platform. 20445 example% lsb_release -v 20446 LSB Version: core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch 20447 20448 m4 20449 20450 Name 20451 20452 m4 -- macro processor 20453 20454 Description 20455 20456 m4 is as specified in ISO POSIX (2003), but with extensions as 20457 listed below. 20458 20459 Extensions 20460 20461 -P 20462 20463 forces all builtins to be prefixed with m4_. For example, 20464 define becomes m4_define. 20465 -I directory 20466 20467 Add directory to the end of the search path for includes. 20468 20469 md5sum 20470 20471 Name 20472 20473 md5sum -- generate or check MD5 message digests 20474 20475 Synopsis 20476 20477 md5sum [-c [file] | file...] 20478 20479 Description 20480 20481 For each file, write to standard output a line containing the 20482 MD5 message digest of that file, followed by one or more blank 20483 characters, followed by the name of the file. The MD5 message 20484 digest shall be calculated according to RFC 1321: The MD5 20485 Message-Digest Algorithm and output as 32 hexadecimal digits. 20486 20487 If no file names are specified as operands, read from standard 20488 input and use "-" as the file name in the output. 20489 20490 Options 20491 20492 -c [file] 20493 20494 checks the MD5 message digest of all files named in file 20495 against the message digest listed in the same file. The actual 20496 format of file is the same as the output of md5sum. That is, 20497 each line in the file describes a file. If file is not 20498 specified, read message digests from stdin. 20499 20500 Exit Status 20501 20502 md5sum shall exit with status 0 if the sum was generated 20503 successfully, or, in check mode, if the check matched. 20504 Otherwise, md5sum shall exit with a non-zero status. 20505 20506 mknod 20507 20508 Name 20509 20510 mknod -- make special files 20511 20512 Synopsis 20513 20514 mknod [-m mode | --mode=mode] name type [major minor] 20515 mknod [--version] 20516 20517 Description 20518 20519 The mknod command shall create a special file named name of 20520 the given type. 20521 20522 The type shall be one of the following: 20523 20524 b 20525 20526 creates a block (buffered) special file with the specified 20527 major and minor device numbers. 20528 c, u 20529 20530 creates a character (unbuffered) special file with the 20531 specified major and minor device numbers. 20532 p 20533 20534 creates a FIFO. 20535 20536 Options 20537 20538 -m mode, --mode=mode 20539 20540 create the special file with file access permissions set as 20541 described in mode. The permissions may be any absolute value 20542 (i.e. one not containing '+' or '-') acceptable to the chmod 20543 command. 20544 --version 20545 20546 output version information and exit. 20547 20548 Note: This option may be deprecated in a future release of 20549 this specification. 20550 20551 If type is p, major and minor shall not be specified. 20552 Otherwise, these parameters are mandatory. 20553 20554 Future Directions 20555 20556 This command may be deprecated in a future version of this 20557 specification. The major and minor operands are insufficently 20558 portable to be specified usefully here. Only a FIFO can be 20559 portably created by this command, and the mkfifo command is a 20560 simpler interface for that purpose. 20561 20562 mktemp 20563 20564 Name 20565 20566 mktemp -- make temporary file name (unique) 20567 20568 Synopsis 20569 20570 mktemp [-q] [-u] template 20571 20572 Description 20573 20574 The mktemp command takes the given file name template and 20575 overwrites a portion of it to create a file name. This file 20576 name shall be unique and suitable for use by the application. 20577 20578 The template should have at least six trailing 'X' characters. 20579 These characters are replaced with characters from the 20580 portable filename character set in order to generate a unique 20581 name. 20582 20583 If mktemp can successfully generate a unique file name, and 20584 the -u option is not present, the file shall be created with 20585 read and write permission only for the current user. The 20586 mktemp command shall write the filename generated to the 20587 standard output. 20588 20589 Options 20590 20591 -q 20592 20593 fail silently if an error occurs. Diagnostic messages to 20594 stderr are suppressed, but the command shall still exit with a 20595 non-zero exit status if an error occurs. 20596 -u 20597 20598 operates in `unsafe' mode. A unique name is generated, but the 20599 temporary file shall be unlinked before mktemp exits. Use of 20600 this option is not encouraged. 20601 20602 more 20603 20604 Name 20605 20606 more -- display files on a page-by-page basis 20607 20608 Description 20609 20610 more is as specified in ISO POSIX (2003), but with differences 20611 as listed below. 20612 20613 Differences 20614 20615 The more command need not respect the LINES and COLUMNS 20616 environment variables. 20617 20618 The following additional options may be supported: 20619 20620 -num 20621 20622 specifies an integer which is the screen size (in lines). 20623 +num 20624 20625 starts at line number num. 20626 +/pattern 20627 20628 Start at the first line matching the pattern, equivalent to 20629 executing the search forward (/) command with the given 20630 pattern immediately after opening each file. 20631 20632 The following options from ISO POSIX (2003) may behave 20633 differently: 20634 20635 -e 20636 20637 has unspecified behavior. 20638 -i 20639 20640 has unspecified behavior. 20641 -n 20642 20643 has unspecified behavior. 20644 -p 20645 20646 Either clear the whole screen before displaying any text 20647 (instead of the usual scrolling behavior), or provide the 20648 behavior specified by ISO POSIX (2003). In the latter case, 20649 the syntax is "-p command". 20650 -t 20651 20652 has unspecified behavior. 20653 20654 The more command need not support the following interactive 20655 commands: 20656 20657 g 20658 G 20659 u 20660 control u 20661 control f 20662 newline 20663 j 20664 k 20665 r 20666 R 20667 m 20668 ' (return to mark) 20669 /! 20670 ? 20671 N 20672 :e 20673 :t 20674 control g 20675 ZZ 20676 20677 Rationale 20678 20679 The +num and +/string options are deprecated in SUSv2, and 20680 have been removed in ISO POSIX (2003); however this 20681 specification continues to specify them because the publicly 20682 available util-linux package does not support the replacement 20683 (-p command). The +command option as found in SUSv2 is more 20684 general than is specified here, but the util-linux package 20685 appears to only support the more specific +num and +/string 20686 forms. 20687 20688 mount 20689 20690 Name 20691 20692 mount -- mount a file system 20693 20694 Synopsis 20695 20696 mount [-hV] 20697 mount [-a] [-fFnrsvw] [-t vfstype] 20698 mount [-fnrsvw] [-o options [,...]] [device | dir] 20699 mount [-fnrsvw] [-t vfstype] [-o options] device dir 20700 20701 Description 20702 20703 As described in ISO POSIX (2003), all files in the system are 20704 organized in a directed graph, known as the file hierarchy, 20705 rooted at /. These files can be spread out over several 20706 underlying devices. The mount command shall attach the file 20707 system found on some underlying device to the file hierarchy. 20708 20709 Options 20710 20711 -v 20712 20713 invoke verbose mode. The mount command shall provide 20714 diagnostic messages on stdout. 20715 -a 20716 20717 mount all file systems (of the given types) mentioned in 20718 /etc/fstab. 20719 -F 20720 20721 If the -a option is also present, fork a new incarnation of 20722 mount for each device to be mounted. This will do the mounts 20723 on different devices or different NFS servers in parallel. 20724 -f 20725 20726 cause everything to be done except for the actual system call; 20727 if it's not obvious, this `fakes' mounting the file system. 20728 -n 20729 20730 mount without writing in /etc/mtab. This is necessary for 20731 example when /etc is on a read-only file system. 20732 -s 20733 20734 ignore mount options not supported by a file system type. Not 20735 all file systems support this option. 20736 -r 20737 20738 mount the file system read-only. A synonym is -o ro. 20739 -w 20740 20741 mount the file system read/write. (default) A synonym is -o 20742 rw. 20743 -L label 20744 20745 If the file /proc/partitions is supported, mount the partition 20746 that has the specified label. 20747 -U uuid 20748 20749 If the file /proc/partitions is supported, mount the partition 20750 that has the specified uuid. 20751 -t vfstype 20752 20753 indicate a file system type of vfstype. 20754 20755 More than one type may be specified in a comma separated list. 20756 The list of file system types can be prefixed with no to 20757 specify the file system types on which no action should be 20758 taken. 20759 -o 20760 20761 options are specified with a -o flag followed by a 20762 comma-separated string of options. Some of these options are 20763 only useful when they appear in the /etc/fstab file. The 20764 following options apply to any file system that is being 20765 mounted: 20766 20767 async 20768 20769 perform all I/O to the file system asynchronously. 20770 atime 20771 20772 update inode access time for each access. (default) 20773 auto 20774 20775 in /etc/fstab, indicate the device is mountable with -a. 20776 defaults 20777 20778 use default options: rw, suid, dev, exec, auto, nouser, async. 20779 dev 20780 20781 interpret character or block special devices on the file 20782 system. 20783 exec 20784 20785 permit execution of binaries. 20786 noatime 20787 20788 do not update file access times on this file system. 20789 noauto 20790 20791 in /etc/fstab, indicates the device is only explicitly 20792 mountable. 20793 nodev 20794 20795 do not interpret character or block special devices on the 20796 file system. 20797 noexec 20798 20799 do not allow execution of any binaries on the mounted file 20800 system. 20801 nosuid 20802 20803 do not allow set-user-identifier or set-group-identifier bits 20804 to take effect. 20805 nouser 20806 20807 forbid an unprivileged user to mount the file system. 20808 (default) 20809 remount 20810 20811 remount an already-mounted file system. This is commonly used 20812 to change the mount options for a file system, especially to 20813 make a read-only file system writable. 20814 ro 20815 20816 mount the file system read-only. 20817 rw 20818 20819 mount the file system read-write. 20820 suid 20821 20822 allow set-user-identifier or set-group-identifier bits to take 20823 effect. 20824 sync 20825 20826 do all I/O to the file system synchronously. 20827 user 20828 20829 allow an unprivilieged user to mount the file system. This 20830 option implies the options noexec, nosuid, nodev unless 20831 overridden by subsequent options. 20832 20833 LSB Deprecated Options 20834 20835 The behaviors specified in this section are expected to 20836 disappear from a future version of the LSB; applications 20837 should only use the non-LSB-deprecated behaviors. 20838 20839 -V 20840 20841 output version and exit. 20842 20843 msgfmt 20844 20845 Name 20846 20847 msgfmt -- create a message object from a message file 20848 20849 Synopsis 20850 20851 msgfmt [options...] filename... 20852 20853 Description 20854 20855 The msgfmt command generates a binary message catalog from a 20856 textual translation description. Message catalogs, or message 20857 object files, are stored in files with a .mo extension. 20858 20859 Note: The format of message object files is not guaranteed 20860 to be portable. Message catalogs should always be generated 20861 on the target architecture using the msgfmt command. 20862 20863 The source message files, otherwise known as portable object 20864 files, have a .po extension. 20865 20866 The filename operands shall be portable object files. The .po 20867 file contains messages to be displayed to users by system 20868 utilities or by application programs. The portable object 20869 files are text files, and the messages in them can be 20870 rewritten in any language supported by the system. 20871 20872 If any filename is -, a portable object file shall be read 20873 from the standard input. 20874 20875 The msgfmt command interprets data as characters according to 20876 the current setting of the LC_CTYPE locale category. 20877 20878 Options 20879 20880 -c, --check 20881 Detect and diagnose input file anomalies which might 20882 represent translation errors. The msgid and msgstr 20883 strings are studied and compared. It is considered 20884 abnormal that one string starts or ends with a newline 20885 while the other does not. 20886 20887 If the message is flagged as c-format (see Comment 20888 Handling), check that the msgid string and the msgstr 20889 translation have the same number of % format 20890 specifiers, with matching types. 20891 20892 -D directory, --directory=directory 20893 Add directory to list for input files search. If 20894 filename is not an absolute pathname and filename 20895 cannot be opened, search for it in directory. This 20896 option may be repeated. Directories shall be searched 20897 in order, with the leftmost directory searched first. 20898 20899 -f, --use-fuzzy 20900 Use entries marked as fuzzy in output. If this option 20901 is not specified, such entries are not included into 20902 the output. See Comment Handling below. 20903 20904 -o output-file, --output-file=output-file 20905 Specify the output file name as output-file. If 20906 multiple domains or duplicate msgids in the .po file 20907 are present, the behavior is unspecified. If 20908 output-file is -, output is written to standard output. 20909 20910 --strict 20911 Ensure that all output files have a .mo extension. 20912 Output files are named either by the -o (or 20913 --output-file) option, or by domains found in the input 20914 files. 20915 20916 -v, --verbose 20917 Print additional information to the standard error, 20918 including the number of translated strings processed. 20919 20920 Operands 20921 20922 The filename operands are treated as portable object files. 20923 The format of portable object files is defined in EXTENDED 20924 DESCRIPTION. 20925 20926 Standard Input 20927 20928 The standard input is not used unless a filename operand is 20929 specified as "-". 20930 20931 Environment Variables 20932 20933 LANGUAGE 20934 20935 Specifies one or more locale names. 20936 LANG 20937 20938 Specifies locale name. 20939 LC_ALL 20940 20941 Specifies locale name for all categories. If defined, 20942 overrides LANG, LC_CTYPE and LC_MESSAGES. 20943 LC_CTYPE 20944 20945 Determine the locale for the interpretation of sequences of 20946 bytes of text data as characters (for example, single-byte as 20947 opposed to multi-byte characters in arguments and input 20948 files). 20949 LC_MESSAGES 20950 20951 Specifies messaging locale, and if present overrides LANG for 20952 messages. 20953 20954 Standard Output 20955 20956 The standard output is not used unless the option-argument of 20957 the -o option is specified as -. 20958 20959 Extended Description 20960 20961 The format of portable object files (.po files) is defined as 20962 follows. Each .po file contains one or more lines, with each 20963 line containing either a comment or a statement. Comments 20964 start the line with a hash mark (#) and end with the newline 20965 character. Empty lines, or lines containing only white-space, 20966 shall be ignored. Comments can in certain circumstances alter 20967 the behavior of msgfmt. See Comment Handling below for details 20968 on comment processing. The format of a statement is: 20969 20970 directive value 20971 20972 Each directive starts at the beginning of the line and is 20973 separated from value by white space (such as one or more space 20974 or tab characters). The value consists of one or more quoted 20975 strings separated by white space. If two or more strings are 20976 specified as value, they are normalized into single string 20977 using the string normalization syntax specified in ISO C 20978 (1999). The following directives are supported: 20979 20980 domain domainname 20981 20982 msgid message_identifier 20983 20984 msgid_plural untranslated_string_plural 20985 20986 msgstr message_string 20987 20988 msgstr[n] message_string 20989 20990 The behavior of the domain directive is affected by the 20991 options used. See OPTIONS for the behavior when the -o option 20992 is specified. If the -o option is not specified, the behavior 20993 of the domain directive is as follows: 20994 20995 1. All msgids from the beginning of each .po file to the 20996 first domain directive are put into a default message 20997 object file, messages (or messages.mo if the --strict 20998 option is specified). 20999 2. When msgfmt encounters a domain domainname directive in 21000 the .po file, all following msgids until the next domain 21001 directive are put into the message object file domainname 21002 (or domainname.mo if --strict option is specified). 21003 3. Duplicate msgids are defined in the scope of each domain. 21004 That is, a msgid is considered a duplicate only if the 21005 identical msgid exists in the same domain. 21006 4. All duplicate msgids are ignored. 21007 21008 The msgid directive specifies the value of a message 21009 identifier associated with the directive that follows it. The 21010 msgid_plural directive specifies the plural form message 21011 specified to the plural message handling functions ngettext(), 21012 dngettext() or dcngettext(). The message_identifier string 21013 identifies a target string to be used at retrieval time. Each 21014 statement containing a msgid directive shall be followed by a 21015 statement containing a msgstr directive or msgstr[n] 21016 directives. 21017 21018 The msgstr directive specifies the target string associated 21019 with the message_identifier string declared in the immediately 21020 preceding msgid directive. 21021 21022 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 21023 target string to be used with plural form handling functions 21024 ngettext(), dngettext() and dcngettext(). 21025 21026 Message strings can contain the following escape sequences: 21027 21028 Table 15-1. Escape Sequences 21029 \n newline 21030 \t tab 21031 \v vertical tab 21032 \b backspace 21033 \r carriage return 21034 \f formfeed 21035 \\ backslash 21036 \" double quote 21037 \ddd octal bit pattern 21038 \xHH hexadecimal bit pattern 21039 21040 Comment Handling 21041 21042 Comments are introduced by a #, and continue to the end of the 21043 line. The second character (i.e. the character following the 21044 #) has special meaning. Regular comments should follow a space 21045 character. Other comment types include: 21046 21047 # normal-comments 21048 21049 #. automatic-comments 21050 21051 #: reference... 21052 21053 #, flag 21054 21055 Automatic and reference comments are typically generated by 21056 external utilities, and are not specified by the LSB. The 21057 msgfmt command shall ignore such comments. 21058 21059 Note: Portable object files may be produced by unspecified 21060 tools. Some of the comment types described here may arise 21061 from the use of such tools. It is beyond the scope of this 21062 specification to describe these tools. 21063 21064 The #, comments require one or more flags separated by the 21065 comma (,) character. The following flags can be specified: 21066 21067 fuzzy 21068 21069 This flag shows that the following msgstr string might not be 21070 a correct translation. Only the translator (i.e. the 21071 individual undertaking the translation) can judge if the 21072 translation requires further modification, or is acceptable as 21073 is. Once satisfied with the translation, the translator then 21074 removes this fuzzy flag. 21075 21076 If this flag is specified, the msgfmt utility will not 21077 generate the entry for the immediately following msgid in the 21078 output message catalog, unless the --use-fuzzy is specified. 21079 c-format, no-c-format 21080 21081 The c-format flag indicates that the msgid string is used as 21082 format string by printf()-like functions. If the c-format flag 21083 is given for a string the msgfmt utility may perform 21084 additional tests to check the validity of the translation. 21085 21086 Plurals 21087 21088 The msgid entry with empty string ("") is called the header 21089 entry and is treated specially. If the message string for the 21090 header entry contains nplurals=value, the value indicates the 21091 number of plural forms. For example, if nplurals=4, there are 21092 4 plural forms. If nplurals is defined, there should be a 21093 plural=expression on the same line, separated by a semicolon 21094 (;) character. The expression is a C language expression to 21095 determine which version of msgstr[n] to be used based on the 21096 value of n, the last argument of ngettext(), dngettext() or 21097 dcngettext(). For example: 21098 nplurals=2; plural=n == 1 ? 0 : 1 21099 21100 indicates that there are 2 plural forms in the language; 21101 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 21102 Another example: 21103 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 21104 21105 indicates that there are 3 plural forms in the language; 21106 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 21107 otherwise msgstr[2] is used. 21108 21109 If the header entry contains charset=codeset string, the 21110 codeset is used to indicate the codeset to be used to encode 21111 the message strings. If the output string's codeset is 21112 different from the message string's codeset, codeset 21113 conversion from the message strings's codeset to the output 21114 string's codeset will be performed upon the call of gettext(), 21115 dgettext(), dcgettext(), ngettext(), dngettext(), and 21116 dcngettext(). The output string's codeset is determined by the 21117 current locale's codeset (the return value of 21118 nl_langinfo(CODESET)) by default, and can be changed by the 21119 call of bind_textdomain_codeset(). 21120 21121 Exit Status 21122 21123 The following exit values are returned: 21124 21125 0 21126 21127 Successful completion. 21128 >0 21129 21130 An error occurred. 21131 21132 Application Usage 21133 21134 Neither msgfmt nor any gettext() function imposes a limit on 21135 the total length of a message. Installing message catalogs 21136 under the C locale is pointless, since they are ignored for 21137 the sake of efficiency. 21138 21139 Examples 21140 21141 Example 1: Examples of creating message objects from message 21142 files. 21143 21144 In this example module1.po, module2.po and module3.po are 21145 portable message object files. 21146 example% cat module1.po 21147 21148 # default domain "messages" 21149 21150 msgid "message one" 21151 21152 msgstr "mensaje nśmero uno" 21153 21154 # 21155 21156 domain "help_domain" 21157 21158 msgid "help two" 21159 21160 msgstr "ayuda nśmero dos" 21161 21162 # 21163 21164 domain "error_domain" 21165 21166 msgid "error three" 21167 21168 msgstr "error nśmero tres" 21169 21170 example% cat module2.po 21171 21172 # default domain "messages" 21173 21174 msgid "message four" 21175 21176 msgstr "mensaje nśmero cuatro" 21177 21178 # 21179 21180 domain "error_domain" 21181 21182 msgid "error five" 21183 21184 msgstr "error nśmero cinco" 21185 21186 # 21187 21188 domain "window_domain" 21189 21190 msgid "window six" 21191 21192 msgstr "ventana nśmero seises" 21193 21194 example% cat module3.po 21195 21196 # default domain "messages" 21197 21198 msgid "message seven" 21199 21200 msgstr "mensaje nśmero siete" 21201 21202 The following command will produce the output files messages, 21203 help_domain, and error_domain. 21204 example% msgfmt module1.po 21205 21206 The following command will produce the output files 21207 messages.mo, help_domain.mo, error_domain.mo, and 21208 window_domain.mo. 21209 example% msgfmt module1.po module2.po 21210 21211 The following example will produce the output file hello.mo. 21212 example% msgfmt -o hello.mo module3.po 21213 21214 newgrp 21215 21216 Name 21217 21218 newgrp -- change group ID 21219 21220 Synopsis 21221 21222 newgrp [group] 21223 21224 Description 21225 21226 The newgrp command is as specified in ISO POSIX (2003), but 21227 with differences as listed below. 21228 21229 Differences 21230 21231 The -l option specified in ISO POSIX (2003) need not be 21232 supported. 21233 21234 od 21235 21236 Name 21237 21238 od -- dump files in octal and other formats 21239 21240 Synopsis 21241 21242 od [-abcdfilox] [-w width | --width-width] [-v] [-A 21243 address_base] [-j skip] [-n count] [-t type_string] [file...] 21244 od --traditional [options] [file] [[+]offset [.] [b]] 21245 [[+]label [.] [b]] 21246 21247 Description 21248 21249 The od command shall provide all of the madatory functionality 21250 specified in ISO POSIX (2003), but with extensions and 21251 differences to the XSI optional behavior as listed below. 21252 21253 Extensions and Differences 21254 21255 -s 21256 unspecified behavior. 21257 21258 Note: Applications wishing to achieve the ISO POSIX (2003) 21259 behavior for -s should instead use -t d2. 21260 21261 -wwidth, --width[=width] 21262 each output line is limited to width bytes from the 21263 input. 21264 21265 --traditional 21266 accepts arguments in traditional form, see Traditional 21267 Usage below. 21268 21269 Note: The XSI optional behavior for offset handling 21270 described in ISO POSIX (2003) is not supported unless the 21271 --traditional option is also specified. 21272 21273 Pre-POSIX and XSI Specifications 21274 21275 The LSB supports mixing options between the mandatory and XSI 21276 optional synopsis forms in ISO POSIX (2003). The LSB shall 21277 support the following options: 21278 21279 -a 21280 21281 is equivalent to -t a, selects named characters. 21282 -b 21283 21284 is equivalent to -t o1, selects octal bytes. 21285 -c 21286 21287 is equivalent to -t c, selects characters. 21288 -d 21289 21290 is equivalent to -t u2, selects unsigned decimal two byte 21291 units. 21292 -f 21293 21294 is equivalent to -t fF, selects floats. 21295 -i 21296 21297 is equivalent to -t d2, selects decimal two byte units. 21298 21299 Note: This usage may change in future releases; portable 21300 applications should use -t d2. 21301 21302 -l 21303 21304 is equivalent to -t d4, selects decimal longs. 21305 -o 21306 21307 is equivalent to -t o2, selects octal two byte units. 21308 -x 21309 21310 is equivalent to -t x2, selects hexadecimal two byte units. 21311 21312 Note that the XSI option -s need not be supported. 21313 21314 Traditional Usage 21315 21316 If the --traditional option is specified, there may be between 21317 zero and three operands specified. 21318 21319 If no operands are specified, then od shall read the standard 21320 input. 21321 21322 If there is exactly one operand, and it is an offset of the 21323 form [+]offset[.][b], then it shall be interpreted as 21324 specified in ISO POSIX (2003). The file to be dumped shall be 21325 the standard input. 21326 21327 If there are exactly two operands, and they are both of the 21328 form [+]offset[.][b], then the first shall be treated as an 21329 offset (as above), and the second shall be a label, in the 21330 same format as the offset. If a label is specified, then the 21331 first output line produced for each input block shall be 21332 preceded by the input offset, cumulative across input files, 21333 of the next byte to be written, followed by the label, in 21334 parentheses. The label shall increment in the same manner as 21335 the offset. 21336 21337 If there are three operands, then the first shall be the file 21338 to dump, the second the offset, and the third the label. 21339 21340 Note: Recent versions of coreutils contain an od utility 21341 that conforms to ISO POSIX (2003). However, in April 2005, 21342 this version was not in widespread use. A future version of 21343 this specification may remove the differences. 21344 21345 passwd 21346 21347 Name 21348 21349 passwd -- change user password 21350 21351 Synopsis 21352 21353 passwd [-x max] [-n min] [-w warn] [-i inact] name 21354 passwd {-l | -u} name 21355 21356 Description 21357 21358 passwd changes authentication information for user and group 21359 accounts, including passwords and password expiry details, and 21360 may be used to enable and disable accounts. Only a user with 21361 appropriate privilege may change the password for other users 21362 or modify the expiry information. 21363 21364 Options 21365 21366 -x max 21367 21368 sets the maximum number of days a password remains valid. 21369 -n min 21370 21371 sets the minimum number of days before a password may be 21372 changed. 21373 -w warn 21374 21375 sets the number of days warning the user will receive before 21376 their password will expire. 21377 -i inactive 21378 21379 disables an account after the password has been expired for 21380 the given number of days. 21381 -l 21382 21383 disables an account by changing the password to a value which 21384 matches no possible encrypted value. 21385 -u 21386 21387 re-enables an account by changing the password back to its 21388 previous value. 21389 21390 patch 21391 21392 Name 21393 21394 patch -- apply a diff file to an original 21395 21396 Description 21397 21398 patch is as specified in ISO POSIX (2003), but with extensions 21399 as listed below. 21400 21401 Extensions 21402 21403 --binary 21404 21405 reads and write all files in binary mode, except for standard 21406 output and /dev/tty. This option has no effect on 21407 POSIX-compliant systems. 21408 -u, --unified 21409 21410 interprets the patch file as a unified context diff. 21411 21412 pidof 21413 21414 Name 21415 21416 pidof -- find the process ID of a running program 21417 21418 Synopsis 21419 21420 pidof [-s] [-x] [-o omitpid...] program... 21421 21422 Description 21423 21424 Return the process ID of a process which is running the 21425 program named on the command line. 21426 21427 The pidof command is a system administration utility, see Path 21428 For System Administration Utilities. 21429 21430 Options 21431 21432 -s 21433 21434 instructs the program to only return one pid. 21435 -x 21436 21437 causes the program to also return process id's of shells 21438 running the named scripts. 21439 -o 21440 21441 omits processes with specified process id. 21442 21443 remove_initd 21444 21445 Name 21446 21447 remove_initd -- clean up init script system modifications 21448 introduced by install_initd 21449 21450 Synopsis 21451 21452 /usr/lib/lsb/remove_initd initd_file 21453 21454 Description 21455 21456 remove_initd processes the removal of the modifications made 21457 to a distribution's init script system by the install_initd 21458 program. This cleanup is performed in the preuninstall script 21459 of a package; however, the package manager is still 21460 responsible for removing the script from the repository. See 21461 also Installation and Removal of Init Scripts. 21462 21463 renice 21464 21465 Name 21466 21467 renice -- alter priority of running processes 21468 21469 Description 21470 21471 renice is as specified in ISO POSIX (2003), but with 21472 differences as listed below. 21473 21474 Differences 21475 21476 -n increment 21477 21478 has unspecified behavior. 21479 21480 sed 21481 21482 Name 21483 21484 sed -- stream editor 21485 21486 Description 21487 21488 sed is as specified in ISO POSIX (2003), but with differences 21489 as listed below. 21490 21491 LSB Differences 21492 21493 Certain aspects of internationalized regular expressions are 21494 optional; see Internationalization and Regular Expressions. 21495 21496 sendmail 21497 21498 Name 21499 21500 sendmail -- an electronic mail transport agent 21501 21502 Synopsis 21503 21504 /usr/sbin/sendmail [options] [address...] 21505 21506 Description 21507 21508 To deliver electronic mail (email), applications shall support 21509 the interface provided by sendmail (described here). This 21510 interface shall be the default delivery method for 21511 applications. 21512 21513 This program sends an email message to one or more recipients, 21514 routing the message as necessary. This program is not intended 21515 as a user interface routine. 21516 21517 With no options, sendmail reads its standard input up to an 21518 end-of-file or a line consisting only of a single dot and 21519 sends a copy of the message found there to all of the 21520 addresses listed. It determines the network(s) to use based on 21521 the syntax and contents of the addresses. 21522 21523 If an address is preceded by a backslash, '\', it is 21524 unspecified if the address is subject to local alias 21525 expansion. 21526 21527 The format of messages shall be as defined in RFC 21528 2822:Internet Message Format. 21529 21530 Note: The name sendmail was chosen for historical reasons, 21531 but the sendmail command specified here is intended to 21532 reflect functionality provided by smail, exim and other 21533 implementations, not just the sendmail implementation. 21534 21535 Options 21536 21537 -bm 21538 21539 read mail from standard input and deliver it to the recipient 21540 addresses. This is the default mode of operation. 21541 -bp 21542 21543 If the user has sufficient privilege, list information about 21544 messages currently in the mail queue. 21545 -bs 21546 21547 use the SMTP protocol as described in RFC 2821:Simple Mail 21548 Transfer Protocol; read SMTP commands on standard input and 21549 write SMTP responses on standard output. 21550 21551 In this mode, sendmail shall accept \r\n (CR-LF), as required 21552 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 21553 terminators. 21554 -F fullname 21555 21556 explicitly set the full name of the sender for incoming mail 21557 unless the message already contains a From: message header. 21558 21559 If the user running sendmail is not sufficiently trusted, then 21560 the actual sender may be indicated in the message, depending 21561 on the configuration of the agent. 21562 -f name 21563 21564 explicitly set the envelope sender address for incoming mail. 21565 If there is no From: header, the address specified in the 21566 From: header will also be set. 21567 21568 If the user running sendmail is not sufficiently trusted, then 21569 the actual sender shall be indicated in the message. 21570 -i 21571 21572 ignore dots alone on lines by themselves in incoming messages. 21573 If this options is not specified, a line consisting of a 21574 single dot shall terminate the input. If -bs is also used, the 21575 behavior is unspecified. 21576 -odb 21577 21578 deliver any mail in background, if supported; otherwise 21579 ignored. 21580 -odf 21581 21582 deliver any mail in foreground, if supported; otherwise 21583 ignored. 21584 -oem or -em 21585 21586 mail errors back to the sender. (default) 21587 -oep or -ep 21588 21589 write errors to the standard error output. 21590 -oeq or -eq 21591 21592 do not send notification of errors to the sender. This only 21593 works for mail delivered locally. 21594 -oi 21595 21596 is equivalent to -i. 21597 -om 21598 21599 indicate that the sender of a message should receive a copy of 21600 the message if the sender appears in an alias expansion. 21601 Ignored if aliases are not supported. 21602 -t 21603 21604 read the message to obtain recipients from the To:, Cc:, and 21605 Bcc: headers in the message instead of from the command 21606 arguments. If a Bcc: header is present, it is removed from the 21607 message unless there is no To: or Cc: header, in which case a 21608 Bcc: header with no data is created, in accordance with RFC 21609 2822:Internet Message Format. 21610 21611 If there are any operands, the recipients list is unspecified. 21612 21613 This option may be ignored when not in -bm mode (the default). 21614 21615 Note: It is recommended that applications use as few 21616 options as necessary, none if possible. 21617 21618 Exit status 21619 21620 0 21621 21622 successful completion on all addresses. This does not indicate 21623 successful delivery. 21624 >0 21625 21626 there was an error. 21627 21628 sh 21629 21630 Name 21631 21632 sh -- shell, the standard command language interpreter 21633 21634 Description 21635 21636 The sh utility shall behave as specified in ISO POSIX (2003), 21637 but with extensions listed below. 21638 21639 Shell Invocation 21640 21641 The shell shall support an additional option, -l (the letter 21642 ell). If the -l option is specified, or if the first character 21643 of argument zero (the command name) is a '-', this invokation 21644 of the shell is a login shell. 21645 21646 An interactive shell, as specified in ISO POSIX (2003), that 21647 is also a login shell, or any shell if invoked with the -l 21648 option, shall, prior to reading from the input file, first 21649 read and execute commands from the file /etc/profile, if that 21650 file exists, and then from a file called ~/.profile, if such a 21651 file exists. 21652 21653 Note: This specification requires that the sh utility shall 21654 also read and execute commands in its current execution 21655 environment from all the shell scripts in the directory 21656 /etc/profile.d. Such scripts are read and executed as a 21657 part of reading and executing /etc/profile. 21658 21659 shutdown 21660 21661 Name 21662 21663 shutdown -- shut the system down 21664 21665 Synopsis 21666 21667 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 21668 [warning-message] 21669 /sbin/shutdown -c [warning-message] 21670 21671 Description 21672 21673 The shutdown command shall shut the system down in a secure 21674 way (first synopsis), or cancel a pending shutdown (second 21675 synopsis). When the shutdown is initiated, all logged-in users 21676 shall be notified immediately that the system is going down, 21677 and users shall be prevented from logging in to the system. 21678 The time specifies when the actual shutdown shall commence. 21679 See below for details. At the specified time all processes are 21680 first notified that the system is going down by the signal 21681 SIGTERM. After an interval (see -t) all processes shall be 21682 sent the signal SIGKILL. If neither the -h or the -r argument 21683 is specified, then the default behavior shall be to take the 21684 system to a runlevel where administrative tasks can be run. 21685 See also Run Levels. 21686 21687 Note: This is sometimes referred to as "single user mode". 21688 21689 The -h and -r options are mutually exclusive. If either the -h 21690 or -r options are specified, the system shall be halted or 21691 rebooted respectively. 21692 21693 Standard Options 21694 21695 -a 21696 21697 use access control. See below. 21698 -t sec 21699 21700 tell the system to wait sec seconds between sending processes 21701 the warning and the kill signal, before changing to another 21702 runlevel. The default period is unspecified. 21703 -k 21704 21705 do not really shutdown; only send the warning messages to 21706 everybody. 21707 -r 21708 21709 reboot after shutdown. 21710 -h 21711 21712 halt after shutdown. Actions after halting are unspecified 21713 (e.g. power off). 21714 -f 21715 21716 advise the system to skip file system consistency checks on 21717 reboot. 21718 -F 21719 21720 advise the system to force file system consistency checks on 21721 reboot. 21722 -c 21723 21724 cancel an already running shutdown. 21725 time 21726 21727 specify when to shut down. 21728 21729 The time argument shall have the following format: [now | 21730 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 21731 hour (1 or 2 digits) and mm is the minute of the hour (exactly 21732 two digits), and the shutdown shall commence at the next 21733 occurence of the specified time. If the format is mins (or 21734 +mins), where mins is a decimal number, shutdown shall 21735 commence in the specified number of minutes. The word now is 21736 an alias for +0. 21737 warning-message 21738 21739 specify a message to send to all users. 21740 21741 Access Control 21742 21743 If the shutdown utility is invoked with the -a option, it 21744 shall check that an authorized user is currently logged in on 21745 the system console. Authorized users are listed, one per line, 21746 in the file /etc/shutdown.allow. Lines in this file that begin 21747 with a '#' or are blank shall be ignored. 21748 21749 Note: The intent of this scheme is to allow a keyboard 21750 sequence entered on the system console (e.g. CTRL-ALT-DEL, 21751 or STOP-A) to automatically invoke shutdown -a, and can be 21752 used to prevent unauthorized users from shutting the system 21753 down in this fashion. 21754 21755 su 21756 21757 Name 21758 21759 su -- change user ID 21760 21761 Synopsis 21762 21763 su [options] [-] [username [ARGS]] 21764 21765 Description 21766 21767 The su command shall start a shell running with the real and 21768 effective user and group IDs of the user username. If username 21769 is not specified, su shall default to an unspecified user with 21770 all appropriate privileges. If the -s or --shell is not 21771 specified, the shell to be invoked shall be that specified for 21772 username in the user database (see getpwnam()), or /bin/sh if 21773 there is no shell specified in the user database. 21774 21775 If the - option is specified, or if the first operand is -, 21776 the environment for the shell shall be initialized as if the 21777 new shell was a login shell (see Shell Invocation). 21778 21779 If the invoking user does not have appropriate privileges, the 21780 su command shall prompt for a password and validate this 21781 before continuing. Invalid passwords shall produce an error 21782 message. The su command shall log in an unspecified manner all 21783 invokations, whether successful or unsuccessful. 21784 21785 Any operands specified after the username shall be passed to 21786 the invoked shell. 21787 21788 If the option - is not specified, and if the first operand is 21789 not -, the environemnt for the new shell shall be intialized 21790 from the current environment. If none of the -m, -p, or 21791 --preserve-environment options are specified, the environment 21792 may be modified in unspecified ways before invoking the shell. 21793 If any of the -m, -p, or --preserve-environment options are 21794 specified, the environment shall not be altered. 21795 21796 Note: Although the su command shall not alter the 21797 environment, the invoked shell may still alter it before it 21798 is ready to intepret any commands. 21799 21800 Standard Options 21801 21802 - 21803 the invoked shell shall be a login shell. 21804 21805 -c command, --command=command 21806 Invoke the shell with the option -c command. 21807 21808 -m, -p, --preserve-environment 21809 The current environment shall be passed to the invoked 21810 shell. If the environment variable SHELL is set, it 21811 shall specify the shell to invoke, if it matches an 21812 entry in /etc/shells. If there is no matching entry in 21813 /etc/shells, this option shall be ignored if the - 21814 option is also specified, or if the first operand is -. 21815 21816 -s shell, --shell=shell 21817 Invoke shell as the comamnd interpreter. The shell 21818 specified shall be present in /etc/shells. 21819 21820 sync 21821 21822 Name 21823 21824 sync -- flush file system buffers 21825 21826 Synopsis 21827 21828 sync 21829 21830 Description 21831 21832 Force changed blocks to disk, update the super block. 21833 21834 tar 21835 21836 Name 21837 21838 tar -- file archiver 21839 21840 Description 21841 21842 tar is as specified in SUSv2, but with differences as listed 21843 below. 21844 21845 Differences 21846 21847 Some elements of the Pattern Matching Notation are optional; 21848 see Internationalization and Pattern Matching Notation. 21849 21850 -h 21851 21852 doesn't dump symlinks; dumps the files they point to. 21853 -z 21854 21855 filters the archive through gzip. 21856 21857 umount 21858 21859 Name 21860 21861 umount -- unmount file systems 21862 21863 Synopsis 21864 21865 umount [-hV] 21866 umount -a [-nrv] [-t vfstype] 21867 umount [-nrv] device | dir... 21868 21869 Description 21870 21871 umount detaches the file system(s) mentioned from the file 21872 hierarchy. A file system is specified by giving the directory 21873 where it has been mounted. 21874 21875 Standard Options 21876 21877 -v 21878 21879 invokes verbose mode. 21880 -n 21881 21882 unmounts without writing in /etc/mtab. 21883 -r 21884 21885 tries to remount read-only if unmounting fails. 21886 -a 21887 21888 unmounts all of the file systems described in /etc/mtab except 21889 for the proc file system. 21890 -t vfstype 21891 21892 indicates that the actions should only be taken on file 21893 systems of the specified type. More than one type may be 21894 specified in a comma separated list. The list of file system 21895 types can be prefixed with no to specify the file system types 21896 on which no action should be taken. 21897 -f 21898 21899 forces unmount (in case of an unreachable NFS system). 21900 21901 LSB Deprecated Options 21902 21903 The behaviors specified in this section are expected to 21904 disappear from a future version of the LSB; applications 21905 should only use the non-LSB-deprecated behaviors. 21906 21907 -V 21908 21909 print version and exits. 21910 21911 useradd 21912 21913 Name 21914 21915 useradd -- create a new user or update default new user 21916 information 21917 21918 Synopsis 21919 21920 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 21921 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 21922 [-u uid [-o]] login 21923 useradd -D [-g default_group] [-b default_home] [-s 21924 default_shell] 21925 21926 Description 21927 21928 When invoked without the -D option, and with appropriate 21929 privilege, useradd creates a new user account using the values 21930 specified on the command line and the default values from the 21931 system. The new user account will be entered into the system 21932 files as needed, the home directory will be created, and 21933 initial files copied, depending on the command line options. 21934 21935 When invoked with the -D option, useradd will either display 21936 the current default values, or, with appropriate privilege, 21937 update the default values from the command line. If no options 21938 are specified, useradd displays the current default values. 21939 21940 The useradd command is a system administration utility, see 21941 Path For System Administration Utilities. 21942 21943 Standard Options 21944 21945 -c comment 21946 21947 specifies the new user's password file comment field value. 21948 -d home_dir 21949 21950 creates the new user using home_dir as the value for the 21951 user's login directory. The default is to append the login 21952 name to default_home and use that as the login directory name. 21953 -g initial_group 21954 21955 specifies the group name or number of the user's initial login 21956 group. The group name shall exist. A group number shall refer 21957 to an already existing group. If -g is not specified, the 21958 implementation will follow the normal user default for that 21959 system. This may create a new group or choose a default group 21960 that normal users are placed in. Applications which require 21961 control of the groups into which a user is placed should 21962 specify -g. 21963 -G group[,...] 21964 21965 specifies a list of supplementary groups which the user is 21966 also a member of. Each group is separated from the next by a 21967 comma, with no intervening whitespace. The groups are subject 21968 to the same restrictions as the group given with the -g 21969 option. The default is for the user to belong only to the 21970 initial group. 21971 -m [-k skeleton_dir] 21972 21973 specifies the user's home directory will be created if it does 21974 not exist. The files contained in skeleton_dir will be copied 21975 to the home directory if the -k option is used, otherwise the 21976 files contained in /etc/skel will be used instead. Any 21977 directories contained in skeleton_dir or /etc/skel will be 21978 created in the user's home directory as well. The -k option is 21979 only valid in conjunction with the -m option. The default is 21980 to not create the directory and to not copy any files. 21981 -p passwd 21982 21983 is the encrypted password, as returned by crypt(). The default 21984 is to disable the account. 21985 -r 21986 21987 creates a system account, that is, a user with a User ID in 21988 the range reserved for system account users. If there is not a 21989 User ID free in the reserved range the command will fail. 21990 -s shell 21991 21992 specifies the name of the user's login shell. The default is 21993 to leave this field blank, which causes the system to select 21994 the default login shell. 21995 -u uid [-o] 21996 21997 specifies the numerical value of the user's ID. This value 21998 shall be unique, unless the -o option is used. The value shall 21999 be non-negative. The default is the smallest ID value greater 22000 than 499 which is not yet used. 22001 22002 Change Default Options 22003 22004 -b default_home 22005 22006 specifies the initial path prefix for a new user's home 22007 directory. The user's name will be affixed to the end of 22008 default_home to create the new directory name if the -d option 22009 is not used when creating a new account. 22010 -g default_group 22011 22012 specifies the group name or ID for a new user's initial group. 22013 The named group shall exist, and a numerical group ID shall 22014 have an existing entry. 22015 -s default_shell 22016 22017 specifies the name of the new user's login shell. The named 22018 program will be used for all future new user accounts. 22019 -c comment 22020 22021 specifies the new user's password file comment field value. 22022 22023 Application Usage 22024 22025 The -D option will typically be used by system administration 22026 packages. Most applications should not change defaults which 22027 will affect other applications and users. 22028 22029 userdel 22030 22031 Name 22032 22033 userdel -- delete a user account and related files 22034 22035 Synopsis 22036 22037 userdel [-r] login 22038 22039 Description 22040 22041 Delete the user account named login. If there is also a group 22042 named login, this command may delete the group as well, or may 22043 leave it alone. 22044 22045 The userdel command is a system administration utility, see 22046 Path For System Administration Utilities. 22047 22048 Options 22049 22050 -r 22051 22052 removes files in the user's home directory along with the home 22053 directory itself. Files located in other file system will have 22054 to be searched for and deleted manually. 22055 22056 usermod 22057 22058 Name 22059 22060 usermod -- modify a user account 22061 22062 Synopsis 22063 22064 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] 22065 [-G group [,...]] [-l login_name] [-p passwd] [-s shell] [-u 22066 uid [ -o]] login 22067 22068 Description 22069 22070 The usermod command shall modify an entry in the user account 22071 database. 22072 22073 The usermod command is a system administration utility, see 22074 Path For System Administration Utilities. 22075 22076 Options 22077 22078 -c comment 22079 22080 specifies the new value of the user's password file comment 22081 field. 22082 -d home_dir 22083 22084 specifies the user's new login directory. If the -m option is 22085 given the contents of the current home directory will be moved 22086 to the new home directory, which is created if it does not 22087 already exist. 22088 -g initial_group 22089 22090 specifies the group name or number of the user's new initial 22091 login group. The group name shall exist. A group number shall 22092 refer to an already existing group. 22093 -G group,[...] 22094 22095 specifies a list of supplementary groups which the user is 22096 also a member of. Each group is separated from the next by a 22097 comma, with no intervening whitespace. The groups are subject 22098 to the same restrictions as the group given with the -g 22099 option. If the user is currently a member of a group which is 22100 not listed, the user will be removed from the group. 22101 -l login_name 22102 22103 changes the name of the user from login to login_name. Nothing 22104 else is changed. In particular, the user's home directory name 22105 should probably be changed to reflect the new login name. 22106 -p passwd 22107 22108 is the encrypted password, as returned by crypt(3). 22109 -s shell 22110 22111 specifies the name of the user's new login shell. Setting this 22112 field to blank causes the system to select the default login 22113 shell. 22114 -u uid [-o] 22115 22116 specifies the numerical value of the user's ID. This value 22117 shall be unique, unless the -o option is used. The value shall 22118 be non-negative. Any files which the user owns and which are 22119 located in the directory tree rooted at the user's home 22120 directory will have the file user ID changed automatically. 22121 Files outside of the user's home directory shall be altered 22122 manually. 22123 22124 xargs 22125 22126 Name 22127 22128 xargs -- build and execute command lines from standard input 22129 22130 Description 22131 22132 xargs is as specified in ISO POSIX (2003), but with 22133 differences as listed below. 22134 22135 Differences 22136 22137 -E 22138 22139 has unspecified behavior. 22140 -I 22141 22142 has unspecified behavior. 22143 -L 22144 22145 has unspecified behavior. 22146 22147 Note: These options have been implemented in 22148 findutils-4.2.9, but this version of the utilities is not 22149 in widespread use as of April 2005. However, future 22150 versions of this specification will require support for 22151 these arguments. 22152 22153 VI. Execution Environment 22154 22155 Table of Contents 22156 16. File System Hierarchy 22157 22158 16.1. /dev: Device Files 22159 16.2. /etc: Host-specific system configuration 22160 22161 16.2.1. File Naming Conventions 22162 22163 16.3. User Accounting Databases 22164 16.4. Path For System Administration Utilities 22165 22166 17. Additional Recommendations 22167 22168 17.1. Recommendations for applications on ownership and 22169 permissions 22170 22171 17.1.1. Directory Write Permissions 22172 17.1.2. File Write Permissions 22173 17.1.3. File Read and execute Permissions 22174 17.1.4. SUID and SGID Permissions 22175 17.1.5. Privileged users 22176 17.1.6. Changing permissions 22177 17.1.7. Removable Media (Cdrom, Floppy, etc.) 22178 17.1.8. Installable applications 22179 22180 18. Additional Behaviors 22181 22182 18.1. Mandatory Optional Behaviors 22183 22184 18.1.1. Special Requirements 22185 22186 19. Localization 22187 22188 19.1. Introduction 22189 19.2. Regular Expressions 22190 19.3. Pattern Matching Notation 22191 _________________________________________________________ 22192 22193 Chapter 16. File System Hierarchy 22194 22195 An LSB conforming implementation shall provide the mandatory 22196 portions of the file system hierarchy specified in the 22197 Filesystem Hierarchy Standard (FHS), together with any 22198 additional requirements made in this specification. 22199 22200 An LSB conforming application shall conform to the Filesystem 22201 Hierarchy Standard. 22202 22203 The FHS allows many components or subsystems to be optional. 22204 An application shall check for the existence of an optional 22205 component before using it, and should behave in a reasonable 22206 manner if the optional component is not present. 22207 22208 The FHS requirement to locate the operating system kernel in 22209 either / or /boot does not apply if the operating system 22210 kernel does not exist as a file in the file system. 22211 22212 The FHS specifies certain behaviors for a variety of commands 22213 if they are present (for example, ping or python). However, 22214 LSB conforming applications shall not rely on any commands 22215 beyond those specified by the LSB. The mere existence of a 22216 command may not be used as an indication that the command 22217 behaves in any particular way. 22218 22219 The following directories or links need not be present: 22220 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 22221 _________________________________________________________ 22222 22223 16.1. /dev: Device Files 22224 22225 The following shall exist under /dev. Other devices may also 22226 exist in /dev. Device names may exist as symbolic links to 22227 other device nodes located in /dev or subdirectories of /dev. 22228 There is no requirement concerning major/minor number values. 22229 22230 /dev/null 22231 22232 An infinite data source and data sink. Data written to this 22233 device shall be discarded. Reads from this device shall always 22234 return end-of-file (EOF). 22235 /dev/zero 22236 22237 This device is a source of zeroed out data. All data written 22238 to this device shall be discarded. A read from this device 22239 shall always return the requested number of bytes, each 22240 initialized to the value '\0'. 22241 /dev/tty 22242 22243 In each process, a synonym for the controlling terminal 22244 associated with the process group of that process, if any. All 22245 reads and writes to this device shall behave as if the actual 22246 controlling terminal device had been opened. 22247 _________________________________________________________ 22248 22249 16.2. /etc: Host-specific system configuration 22250 22251 In addition to the requirements for /etc in the Filesystem 22252 Hierarchy Standard, an LSB conforming system shall also 22253 provide the following directories or symbolic links to 22254 directories: 22255 22256 /etc/cron.d 22257 22258 A directory containing extended crontab files; see Cron Jobs. 22259 /etc/cron.daily 22260 22261 A directory containing shell scripts to be executed once a 22262 day; see Cron Jobs. 22263 /etc/cron.hourly 22264 22265 A directory containing shell scripts to be executed once per 22266 hour; see Cron Jobs. 22267 /etc/cron.monthly 22268 22269 A directory containing shell scripts to be executed once per 22270 month; see Cron Jobs. 22271 /etc/cron.weekly 22272 22273 A directory containing shell scripts to be executed once a 22274 week; see Cron Jobs. 22275 /etc/init.d 22276 22277 A directory containing system initialization scripts; see 22278 Installation and Removal of Init Scripts. 22279 /etc/profile.d 22280 22281 A directory containing shell scripts. Script names should 22282 follow the same conventions as specified for cron jobs (see 22283 Cron Jobs, but should have the suffix .sh. The behavior is 22284 unspecified if a script is installed in this directory that 22285 does not have the suffix .sh. 22286 22287 The sh utility shall read and execute commands in its current 22288 execution environment from all the shell scripts in this 22289 directory that have the suffix .sh when invoked as an 22290 interactive login shell, or if the -l (the letter ell) is 22291 specified (see Shell Invocation). 22292 22293 Future Directions: These directories are required at this 22294 version of the LSB since there is not yet an agreed method 22295 for abstracting the implementation so that applications 22296 need not be aware of these locations during installation. 22297 However, Future Directions describes a tool, lsbinstall, 22298 that will make these directories implementation specific 22299 and no longer required. 22300 _________________________________________________________ 22301 22302 16.2.1. File Naming Conventions 22303 22304 Conforming implemetnations and applications installing files 22305 into any of the above locations under /etc may only use 22306 filenames from the following managed namespaces: 22307 22308 * Assigned names. Such names must be chosen from the 22309 character set [a-z0-9]. In order to avoid conflicts these 22310 names shall be reserved through the Linux Assigned Names 22311 and Numbers Authority (LANANA). Information about the 22312 LANANA may be found at www.lanana.org. 22313 22314 Note: Commonly used names should be reserved in advance; 22315 developers for projects are encouraged to reserve names 22316 from LANANA, so that each distribution can use the same 22317 name, and to avoid conflicts with other projects. 22318 * Hierarchical names. Script names in this category take the 22319 form: --...-, where name is taken from 22320 the character set [a-z0-9], and where there may be one or 22321 more components. may either be an LSB 22322 provider name assigned by the LANANA, or it may be owners' 22323 DNS name in lower case, with at least one '.'. e.g. 22324 "debian.org", "staroffice.sun.com", etc. The LSB provider 22325 name assigned by LANANA shall only consist of the ASCII 22326 characters [a-z0-9]. 22327 * Reserved names. Names that begin with the character '_' 22328 are reserved for distribution use only. These names should 22329 be used for essential system packages only. 22330 22331 Note: A non-conforming application may still have polluted 22332 these managed namespaces with unregistered filenames; a 22333 conforming application should check for namespace 22334 collisions and take appropriate steps if they occur. 22335 22336 In general, if a package or some system function is likely 22337 to be used on multiple systems, the package developers or 22338 the distribution should get a registered name through 22339 LANANA, and distributions should strive to use the same 22340 name whenever possible. For applications which may not be 22341 essential or may not be commonly installed, the 22342 hierarchical namespace may be more appropriate. An 22343 advantage to the hierarchical namespace is that there is no 22344 need to consult with the LANANA before obtaining an 22345 assigned name. 22346 22347 Short names are highly desirable, since system 22348 administrators may need to manually start and stop 22349 services. Given this, they should be standardized on a 22350 per-package basis. This is the rationale behind having the 22351 LANANA organization assign these names. The LANANA may be 22352 called upon to handle other namespace issues, such as 22353 package/prerequisites naming. 22354 _________________________________________________________ 22355 22356 16.3. User Accounting Databases 22357 22358 The Filesystem Hierarchy Standard specifies two optional 22359 locations for user accounting databases used by the 22360 getutent(), getutent_r(), getutxent(), getutxid(), 22361 getutxline(), and pututxline() functions. These are 22362 /var/run/utmp and /var/run/wtmp. 22363 22364 The LSB does not specify the format or structure of these 22365 files, or even if they are files at all. They should be used 22366 only as "magic cookies" to the utmpname() function. 22367 _________________________________________________________ 22368 22369 16.4. Path For System Administration Utilities 22370 22371 Certain utilities used for system administration (and other 22372 privileged commands) may be stored in /sbin, /usr/sbin, and 22373 /usr/local/sbin. Applications requiring to use commands 22374 identified as system administration utilities should add these 22375 directories to their PATH. By default, as described in ISO 22376 POSIX (2003), standard utilities shall be found on the PATH 22377 returned by getconf PATH (or command -p getconf PATH to be 22378 guaranteed to invoke the correct version of getconf). 22379 _________________________________________________________ 22380 22381 Chapter 17. Additional Recommendations 22382 22383 17.1. Recommendations for applications on ownership and permissions 22384 22385 17.1.1. Directory Write Permissions 22386 22387 The application should not depend on having directory write 22388 permission in any directory except /tmp, /var/tmp, and the 22389 invoking user's home directory. 22390 22391 In addition, the application may store variable data in 22392 /var/opt/package, (where package is the name of the 22393 application package), if such a directory is created with 22394 appropriate permissions during the package installation. 22395 22396 For these directories the application should be able to work 22397 with directory write permissions restricted by the S_ISVTXT 22398 bit, implementing the restricted deletion mode as described 22399 for the XSI option for ISO POSIX (2003).. 22400 _________________________________________________________ 22401 22402 17.1.2. File Write Permissions 22403 22404 The application should not depend on file write permission to 22405 any file that it does not itself create. 22406 _________________________________________________________ 22407 22408 17.1.3. File Read and execute Permissions 22409 22410 The application should not depend on having read permission to 22411 every file and directory. 22412 _________________________________________________________ 22413 22414 17.1.4. SUID and SGID Permissions 22415 22416 The application should not depend on the set user ID or set 22417 group ID (the S_ISUID or S_ISGID permission bits) permissions 22418 of a file not packaged with the application. Instead, the 22419 distribution is responsible for assuming that all system 22420 commands have the required permissions and work correctly. 22421 22422 Rationale: In order to implement common security policies 22423 it is strongly advisable for applications to use the 22424 minimum set of security attributes necessary for correct 22425 operation. Applications that require substantial 22426 appropriate privilege are likely to cause problems with 22427 such security policies. 22428 _________________________________________________________ 22429 22430 17.1.5. Privileged users 22431 22432 In general, applications should not depend on running as a 22433 privileged user. This specification uses the term "appropriate 22434 privilege" throughout to identify operations that cannot be 22435 achieved without some special granting of additional 22436 privilege. 22437 22438 Applications that have a reason to run with appropriate 22439 privilege should outline this reason clearly in their 22440 documentation. Users of the application should be informed, 22441 that "this application demands security privileges, which 22442 could interfere with system security". 22443 22444 The application should not contain binary-only software that 22445 requires being run with appropriate privilege, as this makes 22446 security auditing harder or even impossible. 22447 _________________________________________________________ 22448 22449 17.1.6. Changing permissions 22450 22451 The application shall not change permissions of files and 22452 directories that do not belong to its own package. Should an 22453 application require that certain files and directories not 22454 directly belonging to the package have a particular ownership, 22455 the application shall document this requirement, and may fail 22456 during installation if the permissions on these files is 22457 inappropriate. 22458 _________________________________________________________ 22459 22460 17.1.7. Removable Media (Cdrom, Floppy, etc.) 22461 22462 Applications that expect to be runnable from removable media 22463 should not depend on logging in as a privileged user, and 22464 should be prepared to deal with a restrictive environment. 22465 Examples of such restrictions could be default mount options 22466 that disable set-user/group-ID attributes, disabling block or 22467 character-special files on the medium, or remapping the user 22468 and group IDs of files away from any privileged value. 22469 22470 Rationale: System vendors and local system administrators 22471 want to run applications from removable media, but want the 22472 possibility to control what the application can do. 22473 _________________________________________________________ 22474 22475 17.1.8. Installable applications 22476 22477 Where the installation of an application needs additional 22478 privileges, it must clearly document all files and system 22479 databases that are modified outside of those in /opt/pkg-name 22480 and /var/opt/pkg-name, other than those that may be updated by 22481 system logging or auditing activities. 22482 22483 Without this, the local system administrator would have to 22484 blindly trust a piece of software, particularly with respect 22485 to its security. 22486 _________________________________________________________ 22487 22488 Chapter 18. Additional Behaviors 22489 22490 18.1. Mandatory Optional Behaviors 22491 22492 This section specifies behaviors in which there is optional 22493 behavior in one of the standards on which the LSB relies, and 22494 where the LSB requires a specific behavior. 22495 22496 Note: The LSB does not require the kernel to be Linux; the 22497 set of mandated options reflects current existing practice, 22498 but may be modified in future releases. 22499 22500 LSB conforming implementations shall support the following 22501 options defined within the ISO POSIX (2003): 22502 22503 _POSIX_FSYNC 22504 _POSIX_MAPPED_FILES 22505 _POSIX_MEMLOCK 22506 _POSIX_MEMLOCK_RANGE 22507 _POSIX_MEMORY_PROTECTION 22508 _POSIX_PRIORITY_SCHEDULING 22509 _POSIX_REALTIME_SIGNALS 22510 _POSIX_THREAD_ATTR_STACKADDR 22511 _POSIX_THREAD_ATTR_STACKSIZE 22512 _POSIX_THREAD_PROCESS_SHARED 22513 _POSIX_THREAD_SAFE_FUNCTIONS 22514 _POSIX_THREADS 22515 22516 The opendir() function shall consume a file descriptor in the 22517 same fashion as open(), and therefore may fail with EMFILE or 22518 ENFILE. 22519 22520 The START and STOP termios characters shall be changeable, as 22521 described as optional behavior in the "General Terminal 22522 Interface" section of the ISO POSIX (2003). 22523 22524 The access() function function shall fail with errno set to 22525 EINVAL if the amode argument contains bits other than those 22526 set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 22527 22528 The link() function shall require access to the existing file 22529 in order to succeed, as described as optional behavior in the 22530 ISO POSIX (2003). 22531 22532 Calling unlink() on a directory shall fail. Calling link() 22533 specifying a directory as the first argument shall fail. See 22534 also unlink. 22535 22536 Note: Linux allows rename() on a directory without having 22537 write access, but the LSB does not require this. 22538 _________________________________________________________ 22539 22540 18.1.1. Special Requirements 22541 22542 LSB conforming systems shall enforce certain special 22543 additional restrictions above and beyond those required by ISO 22544 POSIX (2003). 22545 22546 Note: These additional restrictions are required in order 22547 to support the testing and certification programs 22548 associated with the LSB. In each case, these are values 22549 that defined macros must not have; conforming applications 22550 that use these values shall trigger a failure in the 22551 interface that is otherwise described as a "may fail". 22552 22553 The fcntl() function shall treat the "cmd" value -1 as 22554 invalid. 22555 22556 The whence value -1 shall be an invalid value for the lseek(), 22557 fseek() and fcntl() functions. 22558 22559 The value -5 shall be an invalid signal number. 22560 22561 If the sigaddset() or sigdelset() functions are passed an 22562 invalid signal number, they shall return with EINVAL. 22563 Implementations are only required to enforce this requirement 22564 for signal numbers which are specified to be invalid by this 22565 specification (such as the -5 mentioned above). 22566 22567 The mode value -1 to the access() function shall be treated as 22568 invalid. 22569 22570 A value of -1 shall be an invalid "_PC_..." value for 22571 pathconf(). 22572 22573 A value of -1 shall be an invalid "_SC..." value for 22574 sysconf(). 22575 22576 The nl_item value -1 shall be invalid for nl_langinfo(). 22577 22578 The value -1 shall be an invalid "_CS_..." value for 22579 confstr(). 22580 22581 The value "a" shall be an invalid mode argument to popen(). 22582 22583 The fcntl() function shall fail and set errno to EDEADLK if 22584 the cmd argument is F_SETLKW, and the lock is blocked by a 22585 lock from another process already blocked by the current 22586 process. 22587 22588 The opendir() function shall consume a file descriptor; the 22589 readdir() function shall fail and set errno to EBADF if the 22590 underlying file descriptor is closed. 22591 22592 The link() function shall not work across file systems, and 22593 shall fail and set errno to EXDEV as described as optional 22594 behavior in ISO POSIX (2003). 22595 _________________________________________________________ 22596 22597 Chapter 19. Localization 22598 22599 19.1. Introduction 22600 22601 In order to install a message catalog, the installation 22602 procedure shall supply the message catalog in a format 22603 readable by the msgfmt utility, which shall be invoked to 22604 compile the message catalog into an appropriate binary format 22605 on the target system. 22606 22607 Rationale: The original intent was to allow an application 22608 to contain the binary GNU MO format files. However, the 22609 format of these files is not officially stable, hence it is 22610 necessary to compile these catalogs on the target system. 22611 These binary catalogs may differ from architecture to 22612 architecture as well. 22613 22614 The resulting binary message catalog shall be located in the 22615 package's private area under /opt, and the application may use 22616 bindtextdomain() to specify this location. 22617 22618 Implementations shall support the POSIX and C locales as 22619 specified in ISO POSIX (2003). Other locales may be supported. 22620 22621 Implementations may define additional locale categories not 22622 defined by that standard. 22623 22624 Note: Implementations choosing additional locale categories 22625 should be aware of ISO/IEC TR14652 and are advised not to 22626 choose names that conflict with that specification. If 22627 implementations provide locale categories whose names are 22628 part of the FDCC set of ISO/IEC TR14652, they should behave 22629 as defined by that specification. 22630 _________________________________________________________ 22631 22632 19.2. Regular Expressions 22633 22634 Utilities that process regular expressions shall support Basic 22635 Regular Expressions and Extended Regular Expressions as 22636 specified in ISO POSIX (2003), with the following exceptions: 22637 22638 Range expression (such as [a-z]) can be based on code point 22639 order instead of collating element order. 22640 22641 Equivalence class expression (such as [=a=]) and 22642 multi-character collating element expression (such as [.ch.]) 22643 are optional. 22644 22645 Handling of a multi-character collating element is optional. 22646 22647 This affects at least the following utilities: 22648 22649 * awk (see awk) 22650 * grep (see grep) (including egrep, see egrep) 22651 * sed (see sed) 22652 22653 It also affects the behavior of interfaces in the base 22654 libraries, including at least 22655 22656 * regexec() (see regexec) 22657 _________________________________________________________ 22658 22659 19.3. Pattern Matching Notation 22660 22661 Utilities that perform filename pattern matching (also known 22662 as Filename Globbing) shall do it as specified in ISO POSIX 22663 (2003), Pattern Matching Notation, with the following 22664 exceptions: 22665 22666 Pattern bracket expressions (such as [a-z]) can be based on 22667 code point order instead of collating element order. 22668 22669 Equivalence class expression (such as [=a=]) and 22670 multi-character collating element expression (such as [.ch.]) 22671 are optional. 22672 22673 Handling of a multi-character collating element is optional. 22674 22675 This affects at least the following utilities: cpio (cpio), 22676 find (find) and tar (tar). 22677 22678 VII. System Initialization 22679 22680 Table of Contents 22681 20. System Initialization 22682 22683 20.1. Cron Jobs 22684 20.2. Init Script Actions 22685 20.3. Comment Conventions for Init Scripts 22686 20.4. Installation and Removal of Init Scripts 22687 20.5. Run Levels 22688 20.6. Facility Names 22689 20.7. Script Names 22690 20.8. Init Script Functions 22691 _________________________________________________________ 22692 22693 Chapter 20. System Initialization 22694 22695 20.1. Cron Jobs 22696 22697 In addition to the individual user crontab files specified by 22698 ISO POSIX (2003) stored under /var/spool/cron, the process 22699 that executes scheduled commands shall also process the 22700 following additional crontab files: /etc/crontab, 22701 /etc/cron.d/*. The installation of a package shall not modify 22702 the configuration file /etc/crontab. 22703 22704 If a package wishes to install a job that has to be executed 22705 periodically, it shall place an executable cron script in one 22706 of the following directories: 22707 22708 /etc/cron.hourly 22709 /etc/cron.daily 22710 /etc/cron.weekly 22711 /etc/cron.monthly 22712 22713 As these directory names suggest, the files within them are 22714 executed on a hourly, daily, weekly, or monthly basis, 22715 respectively, under the control of an entry in one of the 22716 system crontab files, at an unspecified time of day. See below 22717 for the rules concerning the names of cron scripts. 22718 22719 Note: It is recommended that cron scripts installed in any 22720 of these directories be script files rather than compiled 22721 binaries so that they may be modified by the local system 22722 administrator. Conforming applications may only install 22723 cron scripts which use an interpreter required by this 22724 specification or provided by this or another conforming 22725 application. 22726 22727 This specification does not define the concept of a package 22728 upgrade. Implementations may do different things when 22729 packages are upgraded, including not replacing a cron 22730 script if it marked as a configuration file, particularly 22731 if the cron script appears to have been modified since 22732 installation. In some circumstances, the cron script may 22733 not be removed when the package is uninstalled. 22734 Applications should design their installation procedure and 22735 cron scripts to be robust in the face of such behavior. In 22736 particular, cron scripts should not fail obscurely if run 22737 in unexpected circumstances. Testing for the existence of 22738 application binaries before executing them is suggested. 22739 22740 Future versions of this specification may remove the need 22741 to install file directly into these directories, and 22742 instead abstract the interface to the cron utility in such 22743 a way as to hide the implementation. Please see Future 22744 Directions. 22745 22746 If a certain task has to be executed at other than the 22747 predefined frequencies, the package shall install a file 22748 /etc/cron.d/cron-name. The file shall have the same format as 22749 that described for the crontab command in ISO POSIX (2003), 22750 except that there shall be an additional field, username, 22751 before the name of the command to execute. For completeness, 22752 the seven fields shall be: 22753 22754 1. Minute [0,59] 22755 2. Hour [0,23] 22756 3. Day of the month [1,31] 22757 4. Month of the year [1,12] 22758 5. Day of the week [0,6] (with 0=Sunday) 22759 6. Username 22760 7. command [args ...] 22761 22762 This file shall be processed by the system automatically, with 22763 the named command being run at the specified time, as the 22764 specified username. 22765 22766 Applications installing files in these directories shall use 22767 the LSB naming conventions (see File Naming Conventions). 22768 _________________________________________________________ 22769 22770 20.2. Init Script Actions 22771 22772 Conforming applications which need to execute commands on 22773 changes to the system run level (including boot and shutdown), 22774 may install one or more init scripts. Init scripts provided by 22775 conforming applications shall accept a single argument which 22776 selects the action: 22777 22778 start start the service 22779 stop stop the service 22780 restart stop and restart the service if the service is already 22781 running, otherwise start the service 22782 try-restart restart the service if the service is already 22783 running 22784 reload cause the configuration of the service to be reloaded 22785 without actually stopping and restarting the service 22786 force-reload cause the configuration to be reloaded if the 22787 service supports this, otherwise restart the service if it is 22788 running 22789 status print the current status of the service 22790 22791 The start, stop, restart, force-reload, and status actions 22792 shall be supported by all init scripts; the reload and the 22793 try-restart actions are optional. Other init-script actions 22794 may be defined by the init script. 22795 22796 Init scripts shall ensure that they will behave sensibly if 22797 invoked with start when the service is already running, or 22798 with stop when not running, and that they do not kill 22799 similarly-named user processes. The best way to achieve this 22800 is to use the init-script functions provided by 22801 /lib/lsb/init-functions (see Init Script Functions) 22802 22803 If a service reloads its configuration automatically (as in 22804 the case of cron, for example), the reload action of the init 22805 script shall behave as if the configuration was reloaded 22806 successfully. The restart, try-restart, reload and 22807 force-reload actions may be atomic; that is if a service is 22808 known not to be operational after a restart or reload, the 22809 script may return an error without any further action. 22810 22811 Note: This specification does not define the concept of a 22812 package upgrade. Implementations may do different things 22813 when packages are upgraded, including not replacing an init 22814 script if it is marked as a configuration file, 22815 particularly if the file appears to have been modified 22816 since installation. In some circumstances, the init script 22817 may not be removed when the package is uninstalled. 22818 Applications should design their installation procedure and 22819 init scripts to be robust in the face of such behavior. In 22820 particular, init scripts should not fail obscurely if run 22821 in unexpected circumstances. Testing for the existence of 22822 application binaries before executing them is suggested. 22823 22824 If the status action is requested, the init script will return 22825 the following exit status codes. 22826 22827 0 program is running or service is OK 22828 1 program is dead and /var/run pid file exists 22829 2 program is dead and /var/lock lock file exists 22830 3 program is not running 22831 4 program or service status is unknown 22832 5-99 reserved for future LSB use 22833 100-149 reserved for distribution use 22834 150-199 reserved for application use 22835 200-254 reserved 22836 22837 For all other init-script actions, the init script shall 22838 return an exit status of zero if the action was successful. 22839 Otherwise, the exit status shall be non-zero, as defined 22840 below. In addition to straightforward success, the following 22841 situations are also to be considered successful: 22842 22843 * restarting a service (instead of reloading it) with the 22844 force-reload argument 22845 * running start on a service already running 22846 * running stop on a service already stopped or not running 22847 * running restart on a service already stopped or not 22848 running 22849 * running try-restart on a service already stopped or not 22850 running 22851 22852 In case of an error while processing any init-script action 22853 except for status, the init script shall print an error 22854 message and exit with a non-zero status code: 22855 22856 1 generic or unspecified error (current practice) 22857 2 invalid or excess argument(s) 22858 3 unimplemented feature (for example, "reload") 22859 4 user had insufficient privilege 22860 5 program is not installed 22861 6 program is not configured 22862 7 program is not running 22863 8-99 reserved for future LSB use 22864 100-149 reserved for distribution use 22865 150-199 reserved for application use 22866 200-254 reserved 22867 22868 Error and status messages should be printed with the logging 22869 functions (see Init Script Functions) log_success_msg(), 22870 log_failure_msg() and log_warning_msg(). Scripts may write to 22871 standard error or standard output, but implementations need 22872 not present text written to standard error/output to the user 22873 or do anything else with it. 22874 22875 Note: Since init scripts may be run manually by a system 22876 administrator with non-standard environment variable values 22877 for PATH, USER, LOGNAME, etc., init scripts should not 22878 depend on the values of these environment variables. They 22879 should set them to some known/default values if they are 22880 needed. 22881 _________________________________________________________ 22882 22883 20.3. Comment Conventions for Init Scripts 22884 22885 Conforming applications may install one or more init scripts. 22886 These init scripts must be activated by invoking the 22887 install_initd command. Prior to package removal, the changes 22888 applied by install_initd must be undone by invoking 22889 remove_initd. See Installation and Removal of Init Scripts for 22890 more details. 22891 22892 install_initd and remove_initd determine actions to take by 22893 decoding a specially formatted block of lines in the script. 22894 This block shall be delimited by the lines 22895 ### BEGIN INIT INFO 22896 ### END INIT INFO 22897 22898 The delimiter lines may contain trailing whitespace, which 22899 shall be ignored. All lines inside the block shall begin with 22900 a hash character '#' in the first column, so the shell 22901 interprets them as comment lines which do not affect operation 22902 of the script. The lines shall be of the form: 22903 # {keyword}: arg1 [arg2...] 22904 22905 with exactly one space character between the '#' and the 22906 keyword, with a single exception. In lines following a line 22907 containing the Description keyword, and until the next keyword 22908 or block ending delimiter is seen, a line where the '#' is 22909 followed by more than one space or a tab character shall be 22910 treated as a continuation of the previous line. 22911 22912 The information extracted from the block is used by the 22913 installation tool or the init-script system to assure that 22914 init scripts are run in the correct order. It is unspecified 22915 whether the information is evaluated only when install_initd 22916 runs, when the init scripts are executed, or both. The 22917 information extracted includes run levels, defined in Run 22918 Levels, and boot facilities, defined in Facility Names. 22919 22920 The following keywords, with their arguments, are defined: 22921 22922 Provides: boot_facility_1 [boot_facility_2...] 22923 boot facilities provided by this init script. When an 22924 init script is run with a start argument, the boot 22925 facility or facilities specified by the Provides 22926 keyword shall be deemed present and hence init scripts 22927 which require those boot facilities should be started 22928 later. When an init script is run with a stop argument, 22929 the boot facilities specified by the Provides keyword 22930 are deemed no longer present. 22931 22932 Required-Start: boot_facility_1 [boot_facility_2...] 22933 facilities which must be available during startup of 22934 this service. The init-script system should insure init 22935 scripts which provide the Required-Start facilities are 22936 started before starting this script. 22937 22938 Required-Stop: boot_facility_1 [boot_facility_2...] 22939 facilities which must be available during the shutdown 22940 of this service. The init-script system should avoid 22941 stopping init scripts which provide the Required-Stop 22942 facilities until this script is stopped. 22943 22944 Should-Start: boot_facility_1 [boot_facility_2...] 22945 facilities which, if present, should be available 22946 during startup of this service. This allows for weak 22947 dependencies which do not cause the service to fail if 22948 a facility is not available. The service may provide 22949 reduced functionality in this situation. Conforming 22950 applications should not rely on the existence of this 22951 feature. 22952 22953 Should-Stop: boot_facility_1 [boot_facility_2...] 22954 facilities which should be available during shutdown of 22955 this service. 22956 22957 Default-Start: run_level_1 [run_level_2...], Default-Stop: 22958 run_level_1 [run_level_2...] 22959 which run levels should by default run the init script 22960 with a start (stop) argument to start (stop) the 22961 services controlled by the init script. 22962 22963 For example, if a service should run in runlevels 3, 4, 22964 and 5 only, specify "Default-Start: 3 4 5" and 22965 "Default-Stop: 0 1 2 6". 22966 22967 Short-Description: short_description 22968 provide a brief description of the actions of the init 22969 script. Limited to a single line of text. 22970 22971 Description: multiline_description 22972 provide a more complete description of the actions of 22973 the init script. May span mulitple lines. In a 22974 multiline description, each continuation line shall 22975 begin with a '#' followed by tab character or a '#' 22976 followed by at least two space characters. The 22977 multiline description is terminated by the first line 22978 that does not match this criteria. 22979 22980 Additional keywords may be defined in future versions of this 22981 specification. Also, implementations may define local 22982 extensions by using the prefix X-implementor. For example, 22983 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 22984 22985 Example: 22986 22987 ### BEGIN INIT INFO 22988 # Provides: lsb-ourdb 22989 # Required-Start: $local_fs $network $remote_fs 22990 # Required-Stop: $local_fs $network $remote_fs 22991 # Default-Start: 2 3 4 5 22992 # Default-Stop: 0 1 6 22993 # Short-Description: start and stop OurDB 22994 # Description: OurDB is a very fast and reliable database 22995 # engine used for illustrating init scripts 22996 ### END INIT INFO 22997 22998 The comment conventions described in this section are only 22999 required for init scripts installed by conforming 23000 applications. Conforming runtime implementations are not 23001 required to use this scheme in their system provided init 23002 scripts. 23003 23004 Note: This specification does not require, but is designed 23005 to allow, the development of a system which runs init 23006 scripts in parallel. Hence, enforced-serialization of 23007 scripts is avoided unless it is explicitly necessary. 23008 _________________________________________________________ 23009 23010 20.4. Installation and Removal of Init Scripts 23011 23012 Conforming applications may install one or more initialization 23013 scripts (or init scripts). An init script shall be installed 23014 in /etc/init.d (which may be a symbolic link to another 23015 location), by the package installer. 23016 23017 Note: The requirement to install scripts in /etc/init.d may 23018 be removed in future versions of this specification. See 23019 Host-specific system configuration and Future Directions 23020 for further details. 23021 23022 During the installer's post-install processing phase the 23023 program /usr/lib/lsb/install_initd must be called to activate 23024 the init script. Activation consists of arranging for the init 23025 script to be called in the correct order on system run-level 23026 changes (including system boot and shutdown), based on 23027 dependencies supplied in the init script (see Comment 23028 Conventions for Init Scripts). The install_initd command 23029 should be thought of as a wrapper which hides the 23030 implementation details; how any given implementation arranges 23031 for the init script to be called at the appropriate time is 23032 not specified. 23033 23034 Example: if an init script specified "Default-Start: 3 4 5" 23035 and "Default-Stop: 0 1 2 6", install_initd might create 23036 "start" symbolic links with names starting with 'S' in 23037 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 23038 links with names starting with 'K' in /etc/rc0.d, 23039 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 23040 be similar to the System V Init mechanism, but is by no 23041 means the only way this specification could be implemented. 23042 23043 The install_initd command takes a single argument, the full 23044 pathname of the installed init script. The init script must 23045 already be installed in /etc/init.d. The install_initd command 23046 will not copy it there, only activate it once it has been 23047 installed. For example: 23048 23049 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 23050 23051 The install_initd command shall return an exit status of zero 23052 if the init-script activation was successful or if the init 23053 script was already activated. If the dependencies in the init 23054 script (see Comment Conventions for Init Scripts) cannot be 23055 met, an exit status of one shall be returned and the init 23056 script shall not be activated. 23057 23058 When a software package is removed, /usr/lib/lsb/remove_initd 23059 must be called to deactivate the init script. This must occur 23060 before the init script itself is removed, as the dependency 23061 information in the script may be required for successful 23062 completion. Thus the installer's pre-remove processing phase 23063 must call remove_initd, and pass the full pathname of the 23064 installed init script. The package installer is still 23065 responsible for removing the init script. For example: 23066 23067 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 23068 23069 The remove_initd program shall return an exit status of zero 23070 if the init script has been successfully deactivated or if the 23071 init script is not activated. If another init script which 23072 depends on a boot facility provided by this init script is 23073 activated, an exit status of one shall be returned and the 23074 init script shall remain activated. The installer must fail on 23075 such an exit code so it does not subsequently remove the init 23076 script. 23077 23078 Note: This specification does not describe a mechanism for 23079 the system administrator to manipulate the run levels at 23080 which an init script is started or stopped. There is no 23081 assurance that modifying the comment block for this purpose 23082 will have the desired effect. 23083 _________________________________________________________ 23084 23085 20.5. Run Levels 23086 23087 The following run levels are specified for use by the 23088 Default-Start and Default-Stop actions defined in Comment 23089 Conventions for Init Scripts as hints to the install_initd 23090 command. Conforming implementations are not required to 23091 provide these exact run levels or give them the meanings 23092 described here, and may map any level described here to a 23093 different level which provides the equivalent functionality. 23094 Applications may not depend on specific run-level numbers. 23095 23096 0 halt 23097 1 single user mode 23098 2 multiuser with no network services exported 23099 3 normal/full multiuser 23100 4 reserved for local use, default is normal/full multiuser 23101 5 multiuser with a display manager or equivalent 23102 6 reboot 23103 23104 Note: These run levels were chosen as reflecting the most 23105 frequent existing practice, and in the absence of other 23106 considerations, implementors are strongly encouraged to 23107 follow this convention to provide consistency for system 23108 administrators who need to work with multiple 23109 distributions. 23110 _________________________________________________________ 23111 23112 20.6. Facility Names 23113 23114 Boot facilities are used to indicate dependencies in 23115 initialization scripts, as defined in Comment Conventions for 23116 Init Scripts. Facility names are assigned to scripts by the 23117 Provides: keyword. Facility names that begin with a dollar 23118 sign ('$') are reserved system facility names. 23119 23120 Note: Facility names are only recognized in the context of 23121 the init script comment block and are not available in the 23122 body of the init script. In particular, the use of the 23123 leading '$' character does not imply system facility names 23124 are subject to shell variable expansion, since they appear 23125 inside comments. 23126 23127 Conforming applications shall not provide facilities that 23128 begin with a dollar sign. Implementations shall provide the 23129 following facility names: 23130 23131 $local_fs 23132 23133 all local file systems are mounted 23134 $network 23135 23136 basic networking support is available. Example: a server 23137 program could listen on a socket. 23138 $named 23139 23140 IP name-to-address translation, using the interfaces described 23141 in this specification, are available to the level the system 23142 normally provides them. Example: if a DNS query daemon 23143 normally provides this facility, then that daemon has been 23144 started. 23145 $portmap 23146 23147 daemons providing SunRPC/ONCRPC portmapping service as defined 23148 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 23149 present) are running. 23150 $remote_fs 23151 23152 all remote file systems are available. In some configurations, 23153 file systems such as /usr may be remote. Many applications 23154 that require $local_fs will probably also require $remote_fs. 23155 $syslog 23156 23157 system logger is operational. 23158 $time 23159 23160 the system time has been set, for example by using a 23161 network-based time program such as ntp or rdate, or via the 23162 hardware Real Time Clock. 23163 23164 Other (non-system) facilities may be defined by other 23165 conforming applications. These facilities shall be named using 23166 the same conventions defined for naming init scripts (see 23167 Script Names). Commonly, the facility provided by a conforming 23168 init script will have the same name as the name assigned to 23169 the init script. 23170 _________________________________________________________ 23171 23172 20.7. Script Names 23173 23174 Since init scripts live in a single directory, they must share 23175 a single namespace. To avoid conflicts, applications 23176 installing files in this directories shall use the LSB naming 23177 conventions (see File Naming Conventions). 23178 _________________________________________________________ 23179 23180 20.8. Init Script Functions 23181 23182 Each conforming init script shall execute the commands in the 23183 file /lib/lsb/init-functions in the current environment (see 23184 shell special built-in command dot). This file shall cause the 23185 following shell script commands to be defined in an 23186 unspecified manner. 23187 23188 Note: This can be done either by adding a directory to the 23189 PATH variable which defines these commands, or by defining 23190 shell aliases or functions. 23191 23192 Although the commands made available via this mechanism 23193 need not be conforming applications in their own right, 23194 applications that use them should only depend on features 23195 described in this specification. 23196 23197 Conforming scripts shall not specify the "exit on error" 23198 option (i.e. set -e) when sourcing this file, or calling any 23199 of the commands thus made available. 23200 23201 The start_daemon, killproc and pidofproc functions shall use 23202 the following algorithm for determining the status and the 23203 process identifiers of the specified program. 23204 23205 1. If the -p pidfile option is specified, and the named 23206 pidfile exists, a single line at the start of the pidfile 23207 shall be read. If this line contains one or more numeric 23208 values, separated by spaces, these values shall be used. 23209 If the -p pidfile option is specified and the named 23210 pidfile does not exist, the functions shall assume that 23211 the daemon is not running. 23212 2. Otherwise, /var/run/basename.pid shall be read in a 23213 similar fashion. If this contains one or more numeric 23214 values on the first line, these values shall be used. 23215 Optionally, implementations may use unspecified additional 23216 methods to locate the process identifiers required. 23217 23218 The method used to determine the status is implementation 23219 defined, but should allow for non-binary programs. 23220 23221 Note: Commonly used methods check either for the existence 23222 of the /proc/pid directory or use /proc/pid/exe and 23223 /proc/pid/cmdline. Relying only on /proc/pid/exe is 23224 discouraged since this specification does not specify the 23225 existence of, or semantics for, /proc. Additionally, using 23226 /proc/pid/exe may result in a not-running status for 23227 daemons that are written in a script language. 23228 23229 Conforming implementations may use other mechanisms besides 23230 those based on pidfiles, unless the -p pidfile option has been 23231 used. Conforming applications should not rely on such 23232 mechanisms and should always use a pidfile. When a program is 23233 stopped, it should delete its pidfile. Multiple process 23234 identifiers shall be separated by a single space in the 23235 pidfile and in the output of pidofproc. 23236 23237 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 23238 [args...] 23239 runs the specified program as a daemon. The 23240 start_daemon function shall check if the program is 23241 already running using the algorithm given above. If so, 23242 it shall not start another copy of the daemon unless 23243 the -f option is given. The -n option specifies a nice 23244 level. See nice. start_daemon shall return the LSB 23245 defined exit status codes. It shall return 0 if the 23246 program has been successfully started or is running and 23247 not 0 otherwise. 23248 23249 killproc [-p pidfile] pathname [signal] 23250 The killproc function shall stop the specified program. 23251 The program is found using the algorithm given above. 23252 If a signal is specified, using the -signal_name or 23253 -signal_number syntaxes as specified by the kill 23254 command, the program is sent that signal. Otherwise, a 23255 SIGTERM followed by a SIGKILL after an unspecified 23256 number of seconds shall be sent. If a program has been 23257 terminated, the pidfile should be removed if the 23258 terminated process has not already done so. The 23259 killproc function shall return the LSB defined exit 23260 status codes. If called without a signal, it shall 23261 return 0 if the program has been stopped or is not 23262 running and not 0 otherwise. If a signal is given, it 23263 shall return 0 only if the program is running. 23264 23265 pidofproc [-p pidfile] pathname 23266 The pidofproc function shall return one or more process 23267 identifiers for a particular daemon using the algorithm 23268 given above. Only process identifiers of running 23269 processes should be returned. Multiple process 23270 identifiers shall be separated by a single space. 23271 23272 Note: A process may exit between pidofproc discovering its 23273 identity and the caller of pidofproc being able to act on 23274 that identity. As a result, no test assertion can be made 23275 that the process identifiers returned by pidofproc shall be 23276 running processes. 23277 23278 The pidofproc function shall return the LSB defined 23279 exit status codes for "status". It shall return 0 if 23280 the program is running and not 0 otherwise. 23281 23282 log_success_msg message 23283 The log_success_msg function shall cause the system to 23284 write a success message to an unspecified log file. The 23285 format of the message is unspecified. The 23286 log_success_msg function may also write a message to 23287 the standard output. 23288 23289 Note: The message should be relatively short; no more than 23290 60 characters is highly desirable. 23291 23292 log_failure_msg message 23293 The log_failure_msg function shall cause the system to 23294 write a failure message to an unspecified log file. The 23295 format of the message is unspecified. The 23296 log_failure_msg function may also write a message to 23297 the standard output. 23298 23299 Note: The message should be relatively short; no more than 23300 60 characters is highly desirable. 23301 23302 log_warning_msg message 23303 The log_warning_msg function shall cause the system to 23304 write a warning message to an unspecified log file. The 23305 format of the message is unspecified. The 23306 log_warning_msg function may also write a message to 23307 the standard output. 23308 23309 Note: The message should be relatively short; no more than 23310 60 characters is highly desirable. 23311 23312 VIII. Users & Groups 23313 23314 Table of Contents 23315 21. Users & Groups 23316 23317 21.1. User and Group Database 23318 21.2. User & Group Names 23319 21.3. User ID Ranges 23320 21.4. Rationale 23321 _________________________________________________________ 23322 23323 Chapter 21. Users & Groups 23324 23325 21.1. User and Group Database 23326 23327 The format of the User and Group databases is not specified. 23328 Programs may only read these databases using the provided API. 23329 Changes to these databases should be made using the provided 23330 commands. 23331 _________________________________________________________ 23332 23333 21.2. User & Group Names 23334 23335 Table 21-1 describes required mnemonic user and group names. 23336 This specification makes no attempt to numerically assign user 23337 or group identity numbers, with the exception that both the 23338 User ID and Group ID for the user root shall be equal to 0. 23339 23340 Table 21-1. Required User & Group Names 23341 User Group Comments 23342 root root Administrative user with all appropriate privileges 23343 bin bin Legacy User ID/Group ID[a] 23344 daemon daemon Legacy User ID/Group ID[b] 23345 Notes: 23346 a. The bin User ID/Group ID is included for compatibility with 23347 legacy applications. New applications should no longer use the 23348 bin User ID/Group ID. 23349 b. The daemon User ID/Group ID was used as an unprivileged 23350 User ID/Group ID for daemons to execute under in order to 23351 limit their access to the system. Generally daemons should now 23352 run under individual User ID/Group IDs in order to further 23353 partition daemons from one another. 23354 23355 Table 21-2 is a table of optional mnemonic user and group 23356 names. This specification makes no attempt to numerically 23357 assign uid or gid numbers. If the username exists on a system, 23358 then they should be in the suggested corresponding group. 23359 These user and group names are for use by distributions, not 23360 by applications. 23361 23362 Table 21-2. Optional User & Group Names 23363 User Group Comments 23364 adm adm Administrative special privileges 23365 lp lp Printer special privileges 23366 sync sync Login to sync the system 23367 shutdown shutdown Login to shutdown the system 23368 halt halt Login to halt the system 23369 mail mail Mail special privileges 23370 news news News special privileges 23371 uucp uucp UUCP special privileges 23372 operator root Operator special privileges 23373 man man Man special privileges 23374 nobody nobody Used by NFS 23375 23376 Only a minimum working set of "user names" and their 23377 corresponding "user groups" are required. Applications cannot 23378 assume non system user or group names will be defined. 23379 23380 Applications cannot assume any policy for the default file 23381 creation mask (umask) or the default directory permissions a 23382 user may have. Applications should enforce user only file 23383 permissions on private files such as mailboxes. The location 23384 of the users home directory is also not defined by policy 23385 other than the recommendations of the Filesystem Hierarchy 23386 Standard and should be obtained by the getpwnam(), 23387 getpwnam_r(), getpwent(), getpwuid(), and getpwuid_r() 23388 functions. 23389 _________________________________________________________ 23390 23391 21.3. User ID Ranges 23392 23393 The system User IDs from 0 to 99 should be statically 23394 allocated by the system, and shall not be created by 23395 applications. 23396 23397 The system User IDs from 100 to 499 should be reserved for 23398 dynamic allocation by system administrators and post install 23399 scripts using useradd. 23400 _________________________________________________________ 23401 23402 21.4. Rationale 23403 23404 The purpose of specifying optional users and groups is to 23405 reduce the potential for name conflicts between applications 23406 and distributions. 23407 23408 IX. Package Format and Installation 23409 23410 Table of Contents 23411 22. Software Installation 23412 23413 22.1. Introduction 23414 22.2. Package File Format 23415 23416 22.2.1. Lead Section 23417 22.2.2. Header Structure 23418 22.2.3. Signature Section 23419 22.2.4. Header Section 23420 22.2.5. Payload Section 23421 23422 22.3. Package Script Restrictions 23423 22.4. Package Tools 23424 22.5. Package Naming 23425 22.6. Package Dependencies 23426 22.7. Package Architecture Considerations 23427 _________________________________________________________ 23428 23429 Chapter 22. Software Installation 23430 23431 22.1. Introduction 23432 23433 Applications shall either be packaged in the RPM packaging 23434 format as defined in this specification, or supply an 23435 installer which is LSB conforming (for example, calls LSB 23436 commands and utilities). 23437 23438 Note: Supplying an RPM format package is encouraged because 23439 it makes systems easier to manage. This specification does 23440 not require the implementation to use RPM as the package 23441 manager; it only specifies the format of the package file. 23442 23443 Applications are also encouraged to uninstall cleanly. 23444 23445 A package in RPM format may include a dependency on the LSB 23446 Core and other LSB specifications, as described in Section 23447 22.6. Packages that are not in RPM format may test for the 23448 presence of a conforming implementation by means of the 23449 lsb_release utility. 23450 23451 Implementations shall provide a mechanism for installing 23452 applications in this packaging format with some restrictions 23453 listed below. 23454 23455 Note: The implementation itself may use a different 23456 packaging format for its own packages, and of course it may 23457 use any available mechanism for installing the 23458 LSB-conformant packages. 23459 _________________________________________________________ 23460 23461 22.2. Package File Format 23462 23463 An RPM format file consists of 4 sections, the Lead, 23464 Signature, Header, and the Payload. All values are stored in 23465 network byte order. 23466 23467 Table 22-1. RPM File Format 23468 Lead 23469 Signature 23470 Header 23471 Payload 23472 23473 These 4 sections shall exist in the order specified. 23474 23475 The lead section is used to identify the package file. 23476 23477 The signature section is used to verify the integrity, and 23478 optionally, the authenticity of the majority of the package 23479 file. 23480 23481 The header section contains all available information about 23482 the package. Entries such as the package's name, version, and 23483 file list, are contained in the header. 23484 23485 The payload section holds the files to be installed. 23486 _________________________________________________________ 23487 23488 22.2.1. Lead Section 23489 23490 struct rpmlead { 23491 unsigned char magic[4]; 23492 unsigned char major, minor; 23493 short type; 23494 short archnum; 23495 char name[66]; 23496 short osnum; 23497 short signature_type; 23498 char reserved[16]; 23499 } ; 23500 23501 magic 23502 23503 Value identifying this file as an RPM format file. This value 23504 shall be "\355\253\356\333". 23505 major 23506 23507 Value indicating the major version number of the file format 23508 version. This value shall be 3. 23509 minor 23510 23511 Value indicating the minor revision number of file format 23512 version. This value shall be 0. 23513 type 23514 23515 Value indicating whether this is a source or binary package. 23516 This value shall be 0 to indicate a binary package. 23517 archnum 23518 23519 Value indicating the architecture for which this package is 23520 valid. This value is specified in the architecture specific 23521 supplement. 23522 name 23523 23524 A NUL terminated string that provides the package name. This 23525 name shall conform with the Package Naming section of this 23526 specification. 23527 osnum 23528 23529 Value indicating the Operating System for which this package 23530 is valid. This value shall be 1. 23531 signature_type 23532 23533 Value indicating the type of the signature used in the 23534 Signature part of the file. This value shall be 5. 23535 reserved 23536 23537 Reserved space. The value is undefined. 23538 _________________________________________________________ 23539 23540 22.2.2. Header Structure 23541 23542 The Header structure is used for both the Signature and Header 23543 Sections. A Header Structure consists of 3 parts, a Header 23544 record, followed by 1 or more Index records, followed by 0 or 23545 more bytes of data associated with the Index records. A Header 23546 structure shall be aligned to an 8 byte boundary. 23547 23548 Table 22-2. Signature Format 23549 Header Record 23550 Array of Index Records 23551 Store of Index Values 23552 _________________________________________________________ 23553 23554 22.2.2.1. Header Record 23555 23556 struct rpmheader { 23557 unsigned char magic[4]; 23558 unsigned char reserved[4]; 23559 int nindex; 23560 int hsize; 23561 } ; 23562 23563 magic 23564 23565 Value identifying this record as an RPM header record. This 23566 value shall be "\216\255\350\001". 23567 reserved 23568 23569 Reserved space. This value shall be "\000\000\000\000". 23570 nindex 23571 23572 The number of Index Records that follow this Header Record. 23573 There should be at least 1 Index Record. 23574 hsize 23575 23576 The size in bytes of the storage area for the data pointed to 23577 by the Index Records. 23578 _________________________________________________________ 23579 23580 22.2.2.2. Index Record 23581 23582 struct rpmhdrindex { 23583 int tag; 23584 int type; 23585 int offset; 23586 int count; 23587 } ; 23588 23589 tag 23590 23591 Value identifying the purpose of the data associated with this 23592 Index Record. The value of this field is dependent on the 23593 context in which the Index Record is used, and is defined 23594 below and in later sections. 23595 type 23596 23597 Value identifying the type of the data associated with this 23598 Index Record. The possible type values are defined below. 23599 offset 23600 23601 Location in the Store of the data associated with this Index 23602 Record. This value should between 0 and the value contained in 23603 the hsize of the Header Structure. 23604 count 23605 23606 Size of the data associated with this Index Record. The count 23607 is the number of elements whose size is defined by the type of 23608 this Record. 23609 _________________________________________________________ 23610 23611 22.2.2.2.1. Index Type Values 23612 23613 The possible values for the type field are defined in this 23614 table. 23615 23616 Table 22-3. Index Type values 23617 Type Value Size (in bytes) Alignment 23618 RPM_NULL_TYPE 0 Not Implemented. 23619 RPM_CHAR_TYPE 1 1 1 23620 RPM_INT8_TYPE 2 1 1 23621 RPM_INT16_TYPE 3 2 2 23622 RPM_INT32_TYPE 4 4 4 23623 RPM_INT64_TYPE 5 Reserved. 23624 RPM_STRING_TYPE 6 variable, NUL terminated 1 23625 RPM_BIN_TYPE 7 1 1 23626 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 23627 strings 1 23628 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 23629 strings 1 23630 23631 The string arrays specified for entries of type 23632 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 23633 strings in a contiguous block of memory, each element 23634 separated from its neighbors by a NUL character. 23635 23636 Index records with type RPM_I18NSTRING_TYPE shall always have 23637 a count of 1. The array entries in an index of type 23638 RPM_I18NSTRING_TYPE correspond to the locale names contained 23639 in the RPMTAG_HDRI18NTABLE index. 23640 _________________________________________________________ 23641 23642 22.2.2.2.2. Index Tag Values 23643 23644 Some values are designated as header private, and may appear 23645 in any header structure. These are defined here. Additional 23646 values are defined in later sections. 23647 23648 Table 22-4. Header Private Tag Values 23649 Name Tag Value Type Count Status 23650 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 23651 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 23652 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Optional 23653 23654 RPMTAG_HEADERSIGNATURES 23655 The signature tag differentiates a signature header 23656 from a metadata header, and identifies the original 23657 contents of the signature header. 23658 23659 RPMTAG_HEADERIMMUTABLE 23660 This tag contains an index record which specifies the 23661 portion of the Header Record which was used for the 23662 calculation of a signature. This data shall be 23663 preserved or any header-only signature will be 23664 invalidated. 23665 23666 RPMTAG_HEADERI18NTABLE 23667 Contains a list of locales for which strings are 23668 provided in other parts of the package. 23669 23670 Not all Index records defined here will be present in all 23671 packages. Each tag value has a status which is defined here. 23672 23673 Required 23674 23675 This Index Record shall be present. 23676 Optional 23677 23678 This Index Record may be present. 23679 Informational 23680 23681 This Index Record may be present, but does not contribute to 23682 the processing of the package. 23683 Deprecated 23684 23685 This Index Record should not be present. 23686 Obsolete 23687 23688 This Index Record shall not be present. 23689 Reserved 23690 23691 This Index Record shall not be present. 23692 _________________________________________________________ 23693 23694 22.2.2.3. Header Store 23695 23696 The header store contains the values specified by the Index 23697 structures. These values are aligned according to their type 23698 and padding is used if needed. The store is located 23699 immediately following the Index structures. 23700 _________________________________________________________ 23701 23702 22.2.3. Signature Section 23703 23704 The Signature section is implemented using the Header 23705 structure. The signature section defines the following 23706 additional tag values which may be used in the Index 23707 structures. 23708 23709 These values exist to provide additional information about the 23710 rest of the package. 23711 23712 Table 22-5. Signature Tag Values 23713 Name Tag Value Type Count Status 23714 RPMSIGTAG_SIZE 1000 INT32 1 Required 23715 RPMSIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 23716 23717 RPMSIGTAG_SIZE 23718 This tag specifies the combined size of the Header and 23719 Payload sections. 23720 23721 RPMSIGTAG_PAYLOADSIZE 23722 This tag specifies the uncompressed size of the Payload 23723 archive, including the cpio headers. 23724 23725 These values exist to ensure the integrity of the rest of the 23726 package. 23727 23728 Table 22-6. Signature Digest Tag Values 23729 Name Tag Value Type Count Status 23730 RPMSIGTAG_SHA1 269 STRING 1 Optional 23731 RPMSIGTAG_MD5 1004 BIN 16 Required 23732 23733 RPMSIGTAG_SHA1 23734 23735 This index contains the SHA1 checksum of the entire Header 23736 Section, including the Header Record, Index Records and Header 23737 store. 23738 RPMSIGTAG_MD5 23739 23740 This tag specifies the 128-bit MD5 checksum of the combined 23741 Header and Archive sections. 23742 23743 These values exist to provide authentication of the package. 23744 23745 Table 22-7. Signature Signing Tag Values 23746 Name Tag Value Type Count Status 23747 RPMSIGTAG_DSA 267 BIN 1 Optional 23748 RPMSIGTAG_RSA 268 BIN 1 Optional 23749 RPMSIGTAG_PGP 1002 BIN 1 Optional 23750 RPMSIGTAG_GPG 1005 BIN 65 Optional 23751 23752 RPMSIGTAG_DSA 23753 23754 The tag contains the DSA signature of the Header section. The 23755 data is formatted as a Version 3 Signature Packet as specified 23756 in RFC 2440: OpenPGP Message Format. If this tag is 23757 present,then the SIGTAG_GPG tag shall also be present. 23758 RPMSIGTAG_RSA 23759 23760 The tag contains the RSA signature of the Header section.The 23761 data is formatted as a Version 3 Signature Packet as specified 23762 in RFC 2440: OpenPGP Message Format. If this tag is present, 23763 then the SIGTAG_PGP shall also be present. 23764 RPMSIGTAG_PGP 23765 23766 This tag specifies the RSA signature of the combined Header 23767 and Payload sections. The data is formatted as a Version 3 23768 Signature Packet as specified in RFC 2440: OpenPGP Message 23769 Format. 23770 RPMSIGTAG_GPG 23771 23772 The tag contains the DSA signature of the combined Header and 23773 Payload sections. The data is formatted as a Version 3 23774 Signature Packet as specified in RFC 2440: OpenPGP Message 23775 Format. 23776 _________________________________________________________ 23777 23778 22.2.4. Header Section 23779 23780 The Header section is implemented using the Header structure. 23781 The Header section defines the following additional tag values 23782 which may be used in the Index structures. 23783 _________________________________________________________ 23784 23785 22.2.4.1. Package Information 23786 23787 The following tag values are used to indicate information that 23788 describes the package as a whole. 23789 23790 Table 22-8. Package Info Tag Values 23791 Name Tag Value Type Count Status 23792 RPMTAG_NAME 1000 STRING 1 Required 23793 RPMTAG_VERSION 1001 STRING 1 Required 23794 RPMTAG_RELEASE 1002 STRING 1 Required 23795 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 23796 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 23797 RPMTAG_SIZE 1009 INT32 1 Required 23798 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 23799 RPMTAG_VENDOR 1011 STRING 1 Informational 23800 RPMTAG_LICENSE 1014 STRING 1 Required 23801 RPMTAG_PACKAGER 1015 STRING 1 Informational 23802 RPMTAG_GROUP 1016 I18NSTRING 1 Required 23803 RPMTAG_URL 1020 STRING 1 Informational 23804 RPMTAG_OS 1021 STRING 1 Required 23805 RPMTAG_ARCH 1022 STRING 1 Required 23806 RPMTAG_SOURCERPM 1044 STRING 1 Informational 23807 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 23808 RPMTAG_RPMVERSION 1064 STRING 1 Informational 23809 RPMTAG_COOKIE 1094 STRING 1 Optional 23810 RPMTAG_DISTURL 1123 STRING 1 Informational 23811 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 23812 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 23813 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 23814 23815 RPMTAG_NAME 23816 This tag specifies the name of the package. 23817 23818 RPMTAG_VERSION 23819 This tag specifies the version of the package. 23820 23821 RPMTAG_RELEASE 23822 This tag specifies the release of the package. 23823 23824 RPMTAG_SUMMARY 23825 This tag specifies the summary description of the 23826 package. The summary value pointed to by this index 23827 record contains a one line description of the package. 23828 23829 RPMTAG_DESCRIPTION 23830 This tag specifies the description of the package. The 23831 description value pointed to by this index record 23832 contains a full desription of the package. 23833 23834 RPMTAG_SIZE 23835 This tag specifies the sum of the sizes of the regular 23836 files in the archive. 23837 23838 RPMTAG_DISTRIBUTION 23839 A string containing the name of the distribution on 23840 which the package was built. 23841 23842 RPMTAG_VENDOR 23843 A string containing the name of the organization that 23844 produced the package. 23845 23846 RPMTAG_LICENSE 23847 This tag specifies the license which applies to this 23848 package. 23849 23850 RPMTAG_PACKAGER 23851 A string identifying the tool used to build the 23852 package. 23853 23854 RPMTAG_GROUP 23855 This tag specifies the administrative group to which 23856 this package belongs. 23857 23858 RPMTAG_URL 23859 Generic package information URL 23860 23861 RPMTAG_OS 23862 This tag specifies the OS of the package. The OS value 23863 pointed to by this index record shall be "linux". 23864 23865 RPMTAG_ARCH 23866 This tag specifies the architecture of the package. The 23867 architecture value pointed to by this index record is 23868 defined in architecture specific LSB specification. 23869 23870 RPMTAG_SOURCERPM 23871 This tag specifies the name of the source RPM 23872 23873 RPMTAG_ARCHIVESIZE 23874 This tag specifies the uncompressed size of the Payload 23875 archive, including the cpio headers. 23876 23877 RPMTAG_RPMVERSION 23878 This tag indicates the version of RPM tool used to 23879 build this package. The value is unused. 23880 23881 RPMTAG_COOKIE 23882 This tag contains an opaque string whose contents are 23883 undefined. 23884 23885 RPMTAG_DISTURL 23886 URL for package 23887 23888 RPMTAG_PAYLOADFORMAT 23889 This tag specifies the format of the Archive section. 23890 The format value pointed to by this index record shall 23891 be 'cpio'. 23892 23893 RPMTAG_PAYLOADCOMPRESSOR 23894 This tag specifies the compression used on the Archive 23895 section. The compression value pointed to by this index 23896 record shall be 'gzip' 23897 23898 RPMTAG_PAYLOADFLAGS 23899 This tag indicates the compression level used for the 23900 Payload. This value shall always be '9'. 23901 _________________________________________________________ 23902 23903 22.2.4.2. Installation Information 23904 23905 The following tag values are used to provide information 23906 needed during the installation of the package. 23907 23908 Table 22-9. Installation Tag Values 23909 Name Tag Value Type Count Status 23910 RPMTAG_PREIN 1023 STRING 1 Optional 23911 RPMTAG_POSTIN 1024 STRING 1 Optional 23912 RPMTAG_PREUN 1025 STRING 1 Optional 23913 RPMTAG_POSTUN 1026 STRING 1 Optional 23914 RPMTAG_PREINPROG 1085 STRING 1 Optional 23915 RPMTAG_POSTINPROG 1086 STRING 1 Optional 23916 RPMTAG_PREUNPROG 1087 STRING 1 Optional 23917 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 23918 23919 RPMTAG_PREIN 23920 23921 This tag specifies the preinstall scriptlet. If present, then 23922 RPMTAG_PREINPROG shall also be present. 23923 RPMTAG_POSTIN 23924 23925 This tag specifies the postinstall scriptlet. If present, then 23926 RPMTAG_POSTINPROG shall also be present. 23927 RPMTAG_PREUN 23928 23929 his tag specifies the preuninstall scriptlet. If present, then 23930 RPMTAG_PREUNPROG shall also be present. 23931 RPMTAG_POSTUN 23932 23933 This tag specified the postuninstall scriptlet. If present, 23934 then RPMTAG_POSTUNPROG shall also be present. 23935 RPMTAG_PREINPROG 23936 23937 This tag specifies the name of the intepreter to which the 23938 preinstall scriptlet will be passed. The intepreter pointed to 23939 by this index record shall be /bin/sh. 23940 RPMTAG_POSTINPROG 23941 23942 This tag specifies the name of the intepreter to which the 23943 postinstall scriptlet will be passed. The intepreter pointed 23944 to by this index record shall be /bin/sh. 23945 RPMTAG_PREUNPROG 23946 23947 This tag specifies the name of the intepreter to which the 23948 preuninstall scriptlet will be passed. The intepreter pointed 23949 to by this index record shall be /bin/sh. 23950 RPMTAG_POSTUNPROG 23951 23952 This program specifies the name of the intepreter to which the 23953 postuninstall scriptlet will be passed. The intepreter pointed 23954 to by this index record shall be /bin/sh. 23955 _________________________________________________________ 23956 23957 22.2.4.3. File Information 23958 23959 The following tag values are used to provide information about 23960 the files in the payload. This information is provided in the 23961 header to allow more efficient access of the information. 23962 23963 Table 22-10. File Info Tag Values 23964 Name Tag Value Type Count Status 23965 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 23966 RPMTAG_FILESIZES 1028 INT32 Required 23967 RPMTAG_FILEMODES 1030 INT16 Required 23968 RPMTAG_FILERDEVS 1033 INT16 Required 23969 RPMTAG_FILEMTIMES 1034 INT32 Required 23970 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 23971 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 23972 RPMTAG_FILEFLAGS 1037 INT32 Required 23973 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 23974 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 23975 RPMTAG_FILEDEVICES 1095 INT32 Required 23976 RPMTAG_FILEINODES 1096 INT32 Required 23977 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 23978 RPMTAG_DIRINDEXES 1116 INT32 Optional 23979 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 23980 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 23981 23982 RPMTAG_OLDFILENAMES 23983 23984 This tag specifies the filenames when not in a compressed 23985 format as determined by the absence of 23986 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME index. 23987 RPMTAG_FILESIZES 23988 23989 This tag specifies the size of each file in the archive. 23990 RPMTAG_FILEMODES 23991 23992 This tag specifies the mode of each file in the archive. 23993 RPMTAG_FILERDEVS 23994 23995 This tag specifies the device number from which the file was 23996 copied. 23997 RPMTAG_FILEMTIMES 23998 23999 This tag specifies the modification time in seconds since the 24000 epoch of each file in the archive. 24001 RPMTAG_FILEMD5S 24002 24003 This tag specifies the ASCII representation of the MD5 sum of 24004 the corresponding file contents. This value is empty if the 24005 corresponding archive entry is not a regular file. 24006 RPMTAG_FILELINKTOS 24007 24008 The target for a symlink, otherwise NULL. 24009 RPMTAG_FILEFLAGS 24010 24011 This tag specifies the bit(s) to classify and control how 24012 files are to be installed. See below. 24013 RPMTAG_FILEUSERNAME 24014 24015 This tag specifies the owner of the corresponding file. 24016 RPMTAG_FILEGROUPNAME 24017 24018 This tag specifies the group of the corresponding file. 24019 RPMTAG_FILEDEVICES 24020 24021 This tag specifies the 16 bit device number from which the 24022 file was copied. 24023 RPMTAG_FILEINODES 24024 24025 This tag specifies the inode value from the original file 24026 system on the the system on which it was built. 24027 RPMTAG_FILELANGS 24028 24029 This tag specifies a per-file locale marker used to install 24030 only locale specific subsets of files when the package is 24031 installed. 24032 RPMTAG_DIRINDEXES 24033 24034 This tag specifies the index into the array provided by the 24035 RPMTAG_DIRNAMES Index which contains the directory name for 24036 the corresponding filename. 24037 RPMTAG_BASENAMES 24038 24039 This tag specifies the base portion of the corresponding 24040 filename. 24041 RPMTAG_DIRNAMES 24042 24043 One of RPMTAG_OLDFILENAMES or the tuple 24044 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 24045 present, but not both. 24046 _________________________________________________________ 24047 24048 22.2.4.3.1. File Flags 24049 24050 The RPMTAG_FILEFLAGS tag value shall identify various 24051 characteristics of the file in the payload that it describes. 24052 It shall be an INT32 value consisting of either the value 24053 RPMFILE_NONE (0) or the bitwise inclusive or of one or more of 24054 the following values: 24055 24056 Table 22-11. File Flags 24057 Name Value 24058 RPMFILE_CONFIG (1 << 0) 24059 RPMFILE_DOC (1 << 1) 24060 RPMFILE_DONOTUSE (1 << 2) 24061 RPMFILE_MISSINGOK (1 << 3) 24062 RPMFILE_NOREPLACE (1 << 4) 24063 RPMFILE_SPECFILE (1 << 5) 24064 RPMFILE_GHOST (1 << 6) 24065 RPMFILE_LICENSE (1 << 7) 24066 RPMFILE_README (1 << 8) 24067 RPMFILE_EXCLUDE (1 << 9) 24068 24069 These bits have the following meaning: 24070 24071 RPMFILE_CONFIG 24072 24073 The file is a configuration file, and an existing file should 24074 be saved during a package upgrade operation and not removed 24075 during a pakage removal operation. 24076 RPMFILE_DOC 24077 24078 The file contains documentation. 24079 RPMFILE_DONOTUSE 24080 24081 This value is reserved for future use; conforming packages may 24082 not use this flag. 24083 RPMFILE_MISSINGOK 24084 24085 The file need not exist on the installed system. 24086 RPMFILE_NOREPLACE 24087 24088 Similar to the RPMFILE_CONFIG, this flag indicates that during 24089 an upgrade operation the original file on the system should 24090 not be altered. 24091 RPMFILE_SPECFILE 24092 24093 The file is a package specification. 24094 RPMFILE_GHOST 24095 24096 The file is not actually included in the payload, but should 24097 still be considered as a part of the package. For example, a 24098 log file generated by the application at run time. 24099 RPMFILE_LICENSE 24100 24101 The file contains the license conditions. 24102 RPMFILE_README 24103 24104 The file contains high level notes about the package. 24105 RPMFILE_EXCLUDE 24106 24107 The corresponding file is not a part of the package, and 24108 should not be installed. 24109 _________________________________________________________ 24110 24111 22.2.4.4. Dependency Information 24112 24113 The following tag values are used to provide information about 24114 interdependencies between packages. 24115 24116 Table 22-12. Package Dependency Tag Values 24117 Name Tag Value Type Count Status 24118 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 24119 RPMTAG_REQUIREFLAGS 1048 INT32 Required 24120 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 24121 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 24122 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 24123 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 24124 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 24125 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 24126 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 24127 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 24128 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 24129 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 24130 24131 RPMTAG_PROVIDENAME 24132 This tag indicates the name of the dependency provided 24133 by this package. 24134 24135 RPMTAG_REQUIREFLAGS 24136 Bits(s) to specify the dependency range and context. 24137 24138 RPMTAG_REQUIRENAME 24139 This tag indicates the dependencies for this package. 24140 24141 RPMTAG_REQUIREVERSION 24142 This tag indicates the versions associated with the 24143 values found in the RPMTAG_REQUIRENAME Index. 24144 24145 RPMTAG_CONFLICTFLAGS 24146 Bits(s) to specify the conflict range and context. 24147 24148 RPMTAG_CONFLICTNAME 24149 This tag indicates the conflicting dependencies for 24150 this package. 24151 24152 RPMTAG_CONFLICTVERSION 24153 This tag indicates the versions associated with the 24154 values found in the RPMTAG_CONFLICTNAME Index. 24155 24156 RPMTAG_OBSOLETENAME 24157 This tag indicates the obsoleted dependencies for this 24158 package. 24159 24160 RPMTAG_PROVIDEFLAGS 24161 Bits(s) to specify the conflict range and context. 24162 24163 RPMTAG_PROVIDEVERSION 24164 This tag indicates the versions associated with the 24165 values found in the RPMTAG_PROVIDENAME Index. 24166 24167 RPMTAG_OBSOLETEFLAGS 24168 Bits(s) to specify the conflict range and context. 24169 24170 RPMTAG_OBSOLETEVERSION 24171 This tag indicates the versions associated with the 24172 values found in the RPMTAG_OBSOLETENAME Index. 24173 _________________________________________________________ 24174 24175 22.2.4.4.1. Package Dependency Values 24176 24177 The package dependencies are stored in the RPMTAG_REQUIRENAME 24178 and RPMTAG_REQUIREVERSION index records. The following values 24179 may be used. 24180 24181 Table 22-13. Index Type values 24182 Name Version Meaning Status 24183 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 24184 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 24185 RPMTAG_PREREQ records that have a version associated with 24186 them. Optional 24187 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames 24188 in the Archive have had "." prepended to them. Optional 24189 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 24190 filenames in the Payload are represented in the 24191 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES 24192 indexes. Optional 24193 /bin/sh Interpreter usually required for installation 24194 scripts. Optional 24195 24196 Additional dependencies are specified in the Package 24197 Dependencies section of this specification, and the 24198 architecture specific supplements. 24199 _________________________________________________________ 24200 24201 22.2.4.4.2. Package Dependencies Attributes 24202 24203 The package dependency attributes are stored in the 24204 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 24205 RPMTAG_OBSOLETEFLAGS index records. The following values may 24206 be used. 24207 24208 Table 22-14. Package Dependency Attributes 24209 Name Value Meaning 24210 RPMSENSE_LESS 0x02 24211 RPMSENSE_GREATER 0x04 24212 RPMSENSE_EQUAL 0x08 24213 RPMSENSE_PREREQ 0x40 24214 RPMSENSE_INTERP 0x100 24215 RPMSENSE_SCRIPT_PRE 0x200 24216 RPMSENSE_SCRIPT_POST 0x400 24217 RPMSENSE_SCRIPT_PREUN 0x800 24218 RPMSENSE_SCRIPT_POSTUN 0x1000 24219 RPMSENSE_RPMLIB 0x1000000 24220 _________________________________________________________ 24221 24222 22.2.4.5. Other Information 24223 24224 The following tag values are also found in the Header section. 24225 24226 Table 22-15. Other Tag Values 24227 Name Tag Value Type Count Status 24228 RPMTAG_BUILDTIME 1006 INT32 1 Informational 24229 RPMTAG_BUILDHOST 1007 STRING 1 Informational 24230 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 24231 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 24232 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 24233 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 24234 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 24235 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 24236 RPMTAG_PLATFORM 1132 STRING 1 Informational 24237 24238 RPMTAG_BUILDTIME 24239 This tag specifies the time as seconds since the epoch 24240 at which the package was built. 24241 24242 RPMTAG_BUILDHOST 24243 This tag specifies the hostname of the system on which 24244 which the package was built. 24245 24246 RPMTAG_FILEVERIFYFLAGS 24247 This tag specifies the bit(s) to control how files are 24248 to be verified after install, specifying which checks 24249 should be performed. 24250 24251 RPMTAG_CHANGELOGTIME 24252 This tag specifies the Unix time in seconds since the 24253 epoch associated with each entry in the Changelog file. 24254 24255 RPMTAG_CHANGELOGNAME 24256 This tag specifies the name of who made a change to 24257 this package 24258 24259 RPMTAG_CHANGELOGTEXT 24260 This tag specifies the changes asssociated with a 24261 changelog entry. 24262 24263 RPMTAG_OPTFLAGS 24264 This tag indicates additional flags which may have been 24265 passed to the compiler when building this package. 24266 24267 RPMTAG_RHNPLATFORM 24268 This tag contains an opaque string whose contents are 24269 undefined. 24270 24271 RPMTAG_PLATFORM 24272 This tag contains an opaque string whose contents are 24273 undefined. 24274 _________________________________________________________ 24275 24276 22.2.5. Payload Section 24277 24278 The Payload section contains a compressed cpio archive. The 24279 format of this section is defined by RFC 1952: GZIP File 24280 Format Specification. 24281 24282 When uncompressed, the cpio archive contains a sequence of 24283 records for each file. Each record contains a CPIO Header, 24284 Filename, Padding, and File Data. 24285 24286 Table 22-16. CPIO File Format 24287 CPIO Header Header structure as defined below. 24288 Filename NUL terminated ASCII string containing the name of 24289 the file. 24290 Padding 0-3 bytes as needed to align the file stream to a 4 24291 byte boundary. 24292 File data The contents of the file. 24293 Padding 0-3 bytes as needed to align the file stream to a 4 24294 byte boundary. 24295 24296 The CPIO Header uses the following header structure (sometimes 24297 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 24298 stored as ASCII representations of their hexadecimal value 24299 with leading zeros as needed to fill the field. With the 24300 exception of c_namesize and the corresponding name string, and 24301 c_checksum, all information contained in the CPIO Header is 24302 also represented in the Header Section. The values in the CPIO 24303 Header shall match the values contained in the Header Section. 24304 struct { 24305 char c_magic[6]; 24306 char c_ino[8]; 24307 char c_mode[8]; 24308 char c_uid[8]; 24309 char c_gid[8]; 24310 char c_nlink[8]; 24311 char c_mtime[8]; 24312 char c_filesize[8]; 24313 char c_devmajor[8]; 24314 char c_devminor[8]; 24315 char c_rdevmajor[8]; 24316 char c_rdevminor[8]; 24317 char c_namesize[8]; 24318 char c_checksum[8]; 24319 }; 24320 24321 c_magic 24322 24323 Value identifying this cpio format. This value shall be 24324 "070701". 24325 c_ino 24326 24327 This field contains the inode number from the filesystem from 24328 which the file was read. This field is ignored when installing 24329 a package. This field shall match the corresponding value in 24330 the RPMTAG_FILEINODES index in the Header section. 24331 c_mode 24332 24333 Permission bits of the file. This is an ascii representation 24334 of the hexadecimal number representing the bit as defined for 24335 the st_mode field of the stat structure defined for the stat 24336 function. This field shall match the corresponding value in 24337 the RPMTAG_FILEMODES index in the Header section. 24338 c_uid 24339 24340 Value identifying this owner of this file. This value matches 24341 the uid value of the corresponding user in the 24342 RPMTAG_FILEUSERNAME as found on the system where this package 24343 was built. The username specified in RPMTAG_FILEUSERNAME 24344 should take precedence when installing the package. 24345 c_gid 24346 24347 Value identifying this group of this file. This value matches 24348 the gid value of the corresponding user in the 24349 RPMTAG_FILEGROUPNAME as found on the system where this package 24350 was built. The groupname specified in RPMTAG_FILEGROUPNAME 24351 should take precedence when installing the package. 24352 c_nlink 24353 24354 Value identifying the number of links associated with this 24355 file. If the value is greater than 1, then this filename will 24356 be linked to 1 or more files in this archive that has a 24357 matching value for the c_ino, c_devmajor and c_devminor 24358 fields. 24359 c_mtime 24360 24361 Value identifying the modification time of the file when it 24362 was read. This field shall match the corresponding value in 24363 the RPMTAG_FILEMTIMES index in the Header section. 24364 c_filesize 24365 24366 Value identifying the size of the file. This field shall match 24367 the corresponding value in the RPMTAG_FILESIZES index in the 24368 Header section. 24369 c_devmajor 24370 24371 The major number of the device containing the file system from 24372 which the file was read. With the exception of processing 24373 files with c_nlink >1, this field is ignored when installing a 24374 package. This field shall match the corresponding value in the 24375 RPMTAG_FILEDEVICES index in the Header section. 24376 c_devminor 24377 24378 The minor number of the device containing the file system from 24379 which the file was read. With the exception of processing 24380 files with c_nlink >1, this field is ignored when installing a 24381 package. This field shall match the corresponding value in the 24382 RPMTAG_FILEDEVICES index in the Header section. 24383 c_rdevmajor 24384 24385 The major number of the raw device containing the file system 24386 from which the file was read. This field is ignored when 24387 installing a package. This field shall match the corresponding 24388 value in the RPMTAG_RDEVS index in the Header section. 24389 c_rdevminor 24390 24391 The minor number of the raw device containing the file system 24392 from which the file was read. This field is ignored when 24393 installing a package. This field shall match the corresponding 24394 value in the RPMTAG_RDEVS index in the Header section. 24395 c_namesize 24396 24397 Value identifying the length of the filename, which is located 24398 immediately following the CPIO Header structure. 24399 c_checksum 24400 24401 Value containing the CRC checksum of the file data. This field 24402 is not used, and shall contain the value "00000000". This 24403 field is ignored when installing a package. 24404 24405 A record with the filename "TRAILER!!!" indicates the last 24406 record in the archive. 24407 _________________________________________________________ 24408 24409 22.3. Package Script Restrictions 24410 24411 Scripts used as part of the package install and uninstall 24412 shall only use commands and interfaces that are specified by 24413 the LSB. All other commands are not guaranteed to be present, 24414 or to behave in expected ways. 24415 24416 Packages shall not use RPM triggers. 24417 24418 Packages shall not depend on the order in which scripts are 24419 executed (pre-install, pre-uninstall, etc), when doing an 24420 upgrade. 24421 _________________________________________________________ 24422 24423 22.4. Package Tools 24424 24425 The LSB does not specify the interface to the tools used to 24426 manipulate LSB-conformant packages. Each conforming 24427 implementation shall provide documentation for installing LSB 24428 packages. 24429 _________________________________________________________ 24430 24431 22.5. Package Naming 24432 24433 Packages supplied by implementations and applications shall 24434 follow the following rules for the name field within the 24435 package. These rules are not required for the filename of the 24436 package file itself. 24437 24438 Note: There are discrepancies among implementations 24439 concerning whether the name might be 24440 frobnicator-1.7-21-ppc32.rpm or 24441 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 24442 recommended practice is for the filename of the package 24443 file to match the name within the package. 24444 24445 The following rules apply to the name field alone, not 24446 including any release or version. 24447 24448 Note: If the name with the release and version is 24449 frobnicator-1.7-21, the name part is frobnicator and falls 24450 under the rules for a name with no hyphens. 24451 24452 * If the name begins with lsb- and contains no other 24453 hyphens, the name shall be assigned by the Linux Assigned 24454 Names and Numbers Authority (LANANA), which shall maintain 24455 a registry of LSB names. The name may be registered by 24456 either an implementation or an application. 24457 * If the package name begins with lsb- and contains more 24458 than one hyphen (for example 24459 lsb-distro.example.com-database or lsb-gnome-gnumeric), 24460 then the portion of the package name between first and 24461 second hyphens shall either be an LSB provider name 24462 assigned by the LANANA, or it may be one of the owners' 24463 fully-qualified domain names in lower case (e.g., 24464 debian.org, staroffice.sun.com). The LSB provider name 24465 assigned by LANANA shall only consist of the ASCII 24466 characters [a-z0-9]. The provider name or domain name may 24467 be either that of an implementation or an application. 24468 * Package names containing no hyphens are reserved for use 24469 by implementations. Applications shall not use such names. 24470 * Package names which do not start with lsb- and which 24471 contain a hyphen are open to both implementations and 24472 applications. Implementations may name packages in any 24473 part of this namespace. They are encouraged to use names 24474 from one of the other namespaces available to them, but 24475 this is not required due to the large amount of current 24476 practice to the contrary. 24477 24478 Note: Widespread existing practice includes such names as 24479 ssh-common, ssh-client, kernel-pcmcia, and the like. 24480 Possible alternative names include sshcommon, 24481 foolinux-ssh-common (where foolinux is registered to the 24482 implementation), or lsb-foolinux-ssh-common. 24483 Applications may name their packages this way, but only if 24484 the portion of the name before the first hyphen is a 24485 provider name or registered domain name as described 24486 above. 24487 24488 Note: If an application vendor has domain name such as 24489 visicalc.example.com and has registered visicalc as a 24490 provider name, they might name packages visicalc-base, 24491 visicalc.example.com-charting, and the like. 24492 Package names in this namespace are available to both the 24493 implementation and an application. Implementations and 24494 applications will need to consider this potential for 24495 conflicts when deciding to use these names rather than the 24496 alternatives (such as names starting with lsb-). 24497 _________________________________________________________ 24498 24499 22.6. Package Dependencies 24500 24501 Packages shall have a dependency that indicates which LSB 24502 modules are required. LSB module descriptions are dash 24503 seperated tuples containing the name 'lsb', the module name, 24504 and the architecture name. The following dependencies may be 24505 used. 24506 24507 lsb-core-arch 24508 24509 This dependency is used to indicate that the application is 24510 dependent on features contained in the LSB-Core specification. 24511 lsb-core-noarch 24512 24513 This dependency is used to indicate that the application is 24514 dependent on features contained in the LSB-Core specification 24515 and that the package does not contain any architecture 24516 specific files. 24517 24518 These dependencies shall have a version of 3.0. 24519 24520 Packages shall not depend on other system-provided 24521 dependencies. They shall not depend on non-system-provided 24522 dependencies unless those dependencies are fulfilled by 24523 packages which are part of the same application. A package may 24524 only provide a virtual package name which is registered to 24525 that application. 24526 24527 Other modules in the LSB may supplement this list. The 24528 architecture specific dependencies are described in the 24529 relevant architecture specific LSB. 24530 _________________________________________________________ 24531 24532 22.7. Package Architecture Considerations 24533 24534 Packages which do not contain any architecture specific files 24535 should specify an architecture of noarch. An LSB runtime 24536 environment shall accept values noarch, or the value specified 24537 in the architecture specific supplement. 24538 24539 Additional specifications or restrictions may be found in the 24540 architecture specific LSB specification. 24541 _________________________________________________________ 24542 24543 Appendix A. Alphabetical Listing of Interfaces 24544 _________________________________________________________ 24545 24546 A.1. libc 24547 24548 The behavior of the interfaces in this library is specified by 24549 the following Standards. 24550 24551 Large File Support 24552 This Specification 24553 SUSv2 24554 ISO POSIX (2003) 24555 SVID Issue 3 24556 SVID Issue 4 24557 24558 Table A-1. libc Function Interfaces 24559 _Exit(GLIBC_2.1.1)[1] getpwuid_r(GLIBC_2.1.1)[1] 24560 sigaddset(GLIBC_2.1.1)[1] 24561 _IO_feof(GLIBC_2.0)[1] getrlimit(GLIBC_2.0)[1] 24562 sigaltstack(GLIBC_2.0)[1] 24563 _IO_getc(GLIBC_2.0)[1] getrlimit64(GLIBC_2.0)[1] 24564 sigandset(GLIBC_2.0)[1] 24565 _IO_putc(GLIBC_2.0)[1] getrusage(GLIBC_2.0)[1] 24566 sigdelset(GLIBC_2.0)[1] 24567 _IO_puts(GLIBC_2.0)[1] getservbyname(GLIBC_2.0)[1] 24568 sigemptyset(GLIBC_2.0)[1] 24569 __assert_fail(GLIBC_2.0)[1] getservbyport(GLIBC_2.0)[1] 24570 sigfillset(GLIBC_2.0)[1] 24571 __ctype_b_loc[1] getservent()[1] sighold()[1] 24572 __ctype_get_mb_cur_max(GLIBC_2.0)[1] getsid(GLIBC_2.0)[1] 24573 sigignore(GLIBC_2.0)[1] 24574 __ctype_tolower_loc[1] getsockname()[1] siginterrupt()[1] 24575 __ctype_toupper_loc[1] getsockopt()[1] sigisemptyset()[1] 24576 __cxa_atexit(GLIBC_2.1.3)[1] getsubopt(GLIBC_2.1.3)[1] 24577 sigismember(GLIBC_2.1.3)[1] 24578 __errno_location(GLIBC_2.0)[1] gettext(GLIBC_2.0)[1] 24579 siglongjmp(GLIBC_2.0)[1] 24580 __fpending(GLIBC_2.2)[1] gettimeofday(GLIBC_2.2)[1] 24581 signal(GLIBC_2.2)[1] 24582 __fxstat(GLIBC_2.0)[1] getuid(GLIBC_2.0)[1] 24583 sigorset(GLIBC_2.0)[1] 24584 __fxstat64(GLIBC_2.2)[1] getutent(GLIBC_2.2)[1] 24585 sigpause(GLIBC_2.2)[1] 24586 __getpagesize(GLIBC_2.0)[1] getutent_r(GLIBC_2.0)[1] 24587 sigpending(GLIBC_2.0)[1] 24588 __getpgid(GLIBC_2.0)[1] getutxent(GLIBC_2.0)[1] 24589 sigprocmask(GLIBC_2.0)[1] 24590 __h_errno_location[1] getutxid()[1] sigqueue()[1] 24591 __isinf[1] getutxline()[1] sigrelse()[1] 24592 __isinff[1] getw()[1] sigreturn()[1] 24593 __isinfl[1] getwc()[1] sigset()[1] 24594 __isnan[1] getwchar()[1] sigsuspend()[1] 24595 __isnanf[1] getwd()[1] sigtimedwait()[1] 24596 __isnanl[1] glob()[1] sigwait()[1] 24597 __libc_current_sigrtmax(GLIBC_2.1)[1] glob64(GLIBC_2.1)[1] 24598 sigwaitinfo(GLIBC_2.1)[1] 24599 __libc_current_sigrtmin(GLIBC_2.1)[1] globfree(GLIBC_2.1)[1] 24600 sleep(GLIBC_2.1)[1] 24601 __libc_start_main(GLIBC_2.0)[1] globfree64(GLIBC_2.0)[1] 24602 snprintf(GLIBC_2.0)[1] 24603 __lxstat(GLIBC_2.0)[1] gmtime(GLIBC_2.0)[1] sockatmark[1] 24604 __lxstat64(GLIBC_2.2)[1] gmtime_r(GLIBC_2.2)[1] 24605 socket(GLIBC_2.2)[1] 24606 __mempcpy(GLIBC_2.0)[1] grantpt(GLIBC_2.0)[1] 24607 socketpair(GLIBC_2.0)[1] 24608 __rawmemchr(GLIBC_2.1)[1] hcreate(GLIBC_2.1)[1] 24609 sprintf(GLIBC_2.1)[1] 24610 __register_atfork[1] hdestroy()[1] srand()[1] 24611 __sigsetjmp(GLIBC_2.0)[1] hsearch(GLIBC_2.0)[1] 24612 srand48(GLIBC_2.0)[1] 24613 __stpcpy(GLIBC_2.0)[1] htonl(GLIBC_2.0)[1] 24614 srandom(GLIBC_2.0)[1] 24615 __strdup(GLIBC_2.0)[1] htons(GLIBC_2.0)[1] 24616 sscanf(GLIBC_2.0)[1] 24617 __strtod_internal(GLIBC_2.0)[1] iconv(GLIBC_2.0)[1] 24618 statvfs(GLIBC_2.0)[1] 24619 __strtof_internal(GLIBC_2.0)[1] iconv_close(GLIBC_2.0)[1] 24620 statvfs64[1] 24621 __strtok_r(GLIBC_2.0)[1] iconv_open(GLIBC_2.0)[1] 24622 stime(GLIBC_2.0)[1] 24623 __strtol_internal(GLIBC_2.0)[1] if_freenameindex[1] 24624 stpcpy(GLIBC_2.0)[1] 24625 __strtold_internal(GLIBC_2.0)[1] if_indextoname[1] 24626 stpncpy(GLIBC_2.0)[1] 24627 __strtoll_internal(GLIBC_2.0)[1] if_nameindex[1] 24628 strcasecmp(GLIBC_2.0)[1] 24629 __strtoul_internal(GLIBC_2.0)[1] if_nametoindex[1] 24630 strcasestr(GLIBC_2.0)[1] 24631 __strtoull_internal(GLIBC_2.0)[1] imaxabs(GLIBC_2.0)[1] 24632 strcat(GLIBC_2.0)[1] 24633 __sysconf(GLIBC_2.2)[1] imaxdiv(GLIBC_2.2)[1] 24634 strchr(GLIBC_2.2)[1] 24635 __sysv_signal(GLIBC_2.0)[1] index(GLIBC_2.0)[1] 24636 strcmp(GLIBC_2.0)[1] 24637 __wcstod_internal(GLIBC_2.0)[1] inet_addr(GLIBC_2.0)[1] 24638 strcoll(GLIBC_2.0)[1] 24639 __wcstof_internal(GLIBC_2.0)[1] inet_ntoa(GLIBC_2.0)[1] 24640 strcpy(GLIBC_2.0)[1] 24641 __wcstol_internal(GLIBC_2.0)[1] inet_ntop[1] 24642 strcspn(GLIBC_2.0)[1] 24643 __wcstold_internal(GLIBC_2.0)[1] inet_pton[1] 24644 strdup(GLIBC_2.0)[1] 24645 __wcstoul_internal(GLIBC_2.0)[1] initgroups(GLIBC_2.0)[1] 24646 strerror(GLIBC_2.0)[1] 24647 __xmknod(GLIBC_2.0)[1] initstate(GLIBC_2.0)[1] 24648 strerror_r(GLIBC_2.0)[1] 24649 __xstat(GLIBC_2.0)[1] insque(GLIBC_2.0)[1] 24650 strfmon(GLIBC_2.0)[1] 24651 __xstat64(GLIBC_2.2)[1] ioctl(GLIBC_2.2)[1] 24652 strftime(GLIBC_2.2)[1] 24653 _exit(GLIBC_2.0)[1] isalnum(GLIBC_2.0)[1] strlen(GLIBC_2.0)[1] 24654 _longjmp(GLIBC_2.0)[1] isalpha(GLIBC_2.0)[1] 24655 strncasecmp(GLIBC_2.0)[1] 24656 _setjmp(GLIBC_2.0)[1] isascii(GLIBC_2.0)[1] 24657 strncat(GLIBC_2.0)[1] 24658 _tolower(GLIBC_2.0)[1] isatty(GLIBC_2.0)[1] 24659 strncmp(GLIBC_2.0)[1] 24660 _toupper(GLIBC_2.0)[1] isblank(GLIBC_2.0)[1] 24661 strncpy(GLIBC_2.0)[1] 24662 a64l(GLIBC_2.0)[1] iscntrl(GLIBC_2.0)[1] strndup(GLIBC_2.0)[1] 24663 abort(GLIBC_2.0)[1] isdigit(GLIBC_2.0)[1] 24664 strnlen(GLIBC_2.0)[1] 24665 abs(GLIBC_2.0)[1] isgraph(GLIBC_2.0)[1] strpbrk(GLIBC_2.0)[1] 24666 accept(GLIBC_2.0)[1] islower(GLIBC_2.0)[1] 24667 strptime(GLIBC_2.0)[1] 24668 access(GLIBC_2.0)[1] isprint(GLIBC_2.0)[1] 24669 strrchr(GLIBC_2.0)[1] 24670 acct(GLIBC_2.0)[1] ispunct(GLIBC_2.0)[1] strsep(GLIBC_2.0)[1] 24671 adjtime(GLIBC_2.0)[1] isspace(GLIBC_2.0)[1] 24672 strsignal(GLIBC_2.0)[1] 24673 alarm(GLIBC_2.0)[1] isupper(GLIBC_2.0)[1] strspn(GLIBC_2.0)[1] 24674 asctime(GLIBC_2.0)[1] iswalnum(GLIBC_2.0)[1] 24675 strstr(GLIBC_2.0)[1] 24676 asctime_r(GLIBC_2.0)[1] iswalpha(GLIBC_2.0)[1] 24677 strtod(GLIBC_2.0)[1] 24678 asprintf(GLIBC_2.0)[1] iswblank(GLIBC_2.0)[1] 24679 strtof(GLIBC_2.0)[1] 24680 atof(GLIBC_2.0)[1] iswcntrl(GLIBC_2.0)[1] 24681 strtoimax(GLIBC_2.0)[1] 24682 atoi(GLIBC_2.0)[1] iswctype(GLIBC_2.0)[1] strtok(GLIBC_2.0)[1] 24683 atol(GLIBC_2.0)[1] iswdigit(GLIBC_2.0)[1] 24684 strtok_r(GLIBC_2.0)[1] 24685 atoll[1] iswgraph()[1] strtol()[1] 24686 authnone_create(GLIBC_2.0)[1] iswlower(GLIBC_2.0)[1] 24687 strtold(GLIBC_2.0)[1] 24688 basename(GLIBC_2.0)[1] iswprint(GLIBC_2.0)[1] 24689 strtoll(GLIBC_2.0)[1] 24690 bcmp(GLIBC_2.0)[1] iswpunct(GLIBC_2.0)[1] strtoq(GLIBC_2.0)[1] 24691 bcopy(GLIBC_2.0)[1] iswspace(GLIBC_2.0)[1] 24692 strtoul(GLIBC_2.0)[1] 24693 bind(GLIBC_2.0)[1] iswupper(GLIBC_2.0)[1] 24694 strtoull(GLIBC_2.0)[1] 24695 bind_textdomain_codeset[1] iswxdigit()[1] strtoumax()[1] 24696 bindresvport(GLIBC_2.0)[1] isxdigit(GLIBC_2.0)[1] 24697 strtouq(GLIBC_2.0)[1] 24698 bindtextdomain(GLIBC_2.0)[1] jrand48(GLIBC_2.0)[1] 24699 strxfrm(GLIBC_2.0)[1] 24700 brk(GLIBC_2.0)[1] key_decryptsession(GLIBC_2.0)[1] 24701 svc_getreqset(GLIBC_2.0)[1] 24702 bsd_signal(GLIBC_2.0)[1] kill(GLIBC_2.0)[1] 24703 svc_register(GLIBC_2.0)[1] 24704 bsearch(GLIBC_2.0)[1] killpg(GLIBC_2.0)[1] 24705 svc_run(GLIBC_2.0)[1] 24706 btowc(GLIBC_2.0)[1] l64a(GLIBC_2.0)[1] 24707 svc_sendreply(GLIBC_2.0)[1] 24708 bzero(GLIBC_2.0)[1] labs(GLIBC_2.0)[1] 24709 svcerr_auth(GLIBC_2.0)[1] 24710 calloc(GLIBC_2.0)[1] lchown(GLIBC_2.0)[1] 24711 svcerr_decode(GLIBC_2.0)[1] 24712 catclose(GLIBC_2.0)[1] lcong48(GLIBC_2.0)[1] 24713 svcerr_noproc(GLIBC_2.0)[1] 24714 catgets(GLIBC_2.0)[1] ldiv(GLIBC_2.0)[1] 24715 svcerr_noprog(GLIBC_2.0)[1] 24716 catopen(GLIBC_2.0)[1] lfind(GLIBC_2.0)[1] 24717 svcerr_progvers(GLIBC_2.0)[1] 24718 cfgetispeed(GLIBC_2.0)[1] link(GLIBC_2.0)[1] 24719 svcerr_systemerr(GLIBC_2.0)[1] 24720 cfgetospeed(GLIBC_2.0)[1] listen(GLIBC_2.0)[1] 24721 svcerr_weakauth(GLIBC_2.0)[1] 24722 cfmakeraw(GLIBC_2.0)[1] llabs(GLIBC_2.0)[1] 24723 svctcp_create(GLIBC_2.0)[1] 24724 cfsetispeed(GLIBC_2.0)[1] lldiv(GLIBC_2.0)[1] 24725 svcudp_create(GLIBC_2.0)[1] 24726 cfsetospeed(GLIBC_2.0)[1] localeconv(GLIBC_2.0)[1] 24727 swab(GLIBC_2.0)[1] 24728 cfsetspeed(GLIBC_2.0)[1] localtime(GLIBC_2.0)[1] 24729 swapcontext(GLIBC_2.0)[1] 24730 chdir(GLIBC_2.0)[1] localtime_r(GLIBC_2.0)[1] 24731 swprintf(GLIBC_2.0)[1] 24732 chmod(GLIBC_2.0)[1] lockf(GLIBC_2.0)[1] swscanf(GLIBC_2.0)[1] 24733 chown(GLIBC_2.1)[1] lockf64(GLIBC_2.1)[1] 24734 symlink(GLIBC_2.1)[1] 24735 chroot(GLIBC_2.0)[1] longjmp(GLIBC_2.0)[1] sync(GLIBC_2.0)[1] 24736 clearerr(GLIBC_2.0)[1] lrand48(GLIBC_2.0)[1] 24737 sysconf(GLIBC_2.0)[1] 24738 clnt_create(GLIBC_2.0)[1] lsearch(GLIBC_2.0)[1] 24739 syslog(GLIBC_2.0)[1] 24740 clnt_pcreateerror(GLIBC_2.0)[1] lseek(GLIBC_2.0)[1] 24741 system(GLIBC_2.0)[1] 24742 clnt_perrno(GLIBC_2.0)[1] makecontext(GLIBC_2.0)[1] 24743 tcdrain(GLIBC_2.0)[1] 24744 clnt_perror(GLIBC_2.0)[1] malloc(GLIBC_2.0)[1] 24745 tcflow(GLIBC_2.0)[1] 24746 clnt_spcreateerror(GLIBC_2.0)[1] mblen(GLIBC_2.0)[1] 24747 tcflush(GLIBC_2.0)[1] 24748 clnt_sperrno(GLIBC_2.0)[1] mbrlen(GLIBC_2.0)[1] 24749 tcgetattr(GLIBC_2.0)[1] 24750 clnt_sperror(GLIBC_2.0)[1] mbrtowc(GLIBC_2.0)[1] 24751 tcgetpgrp(GLIBC_2.0)[1] 24752 clock(GLIBC_2.0)[1] mbsinit(GLIBC_2.0)[1] 24753 tcgetsid(GLIBC_2.0)[1] 24754 close(GLIBC_2.0)[1] mbsnrtowcs(GLIBC_2.0)[1] 24755 tcsendbreak(GLIBC_2.0)[1] 24756 closedir(GLIBC_2.0)[1] mbsrtowcs(GLIBC_2.0)[1] 24757 tcsetattr(GLIBC_2.0)[1] 24758 closelog(GLIBC_2.0)[1] mbstowcs(GLIBC_2.0)[1] 24759 tcsetpgrp(GLIBC_2.0)[1] 24760 confstr(GLIBC_2.0)[1] mbtowc(GLIBC_2.0)[1] tdelete[1] 24761 connect(GLIBC_2.0)[1] memccpy(GLIBC_2.0)[1] 24762 telldir(GLIBC_2.0)[1] 24763 creat(GLIBC_2.0)[1] memchr(GLIBC_2.0)[1] tempnam(GLIBC_2.0)[1] 24764 creat64(GLIBC_2.1)[1] memcmp(GLIBC_2.1)[1] 24765 textdomain(GLIBC_2.1)[1] 24766 ctermid(GLIBC_2.0)[1] memcpy(GLIBC_2.0)[1] tfind(GLIBC_2.0)[1] 24767 ctime(GLIBC_2.0)[1] memmem(GLIBC_2.0)[1] time(GLIBC_2.0)[1] 24768 ctime_r(GLIBC_2.0)[1] memmove(GLIBC_2.0)[1] 24769 times(GLIBC_2.0)[1] 24770 cuserid(GLIBC_2.0)[1] memrchr(GLIBC_2.0)[1] 24771 tmpfile(GLIBC_2.0)[1] 24772 daemon(GLIBC_2.0)[1] memset(GLIBC_2.0)[1] 24773 tmpfile64(GLIBC_2.0)[1] 24774 dcgettext(GLIBC_2.0)[1] mkdir(GLIBC_2.0)[1] 24775 tmpnam(GLIBC_2.0)[1] 24776 dcngettext[1] mkfifo()[1] toascii()[1] 24777 dgettext[1] mkstemp()[1] tolower()[1] 24778 difftime(GLIBC_2.0)[1] mkstemp64(GLIBC_2.0)[1] 24779 toupper(GLIBC_2.0)[1] 24780 dirname(GLIBC_2.0)[1] mktemp(GLIBC_2.0)[1] 24781 towctrans(GLIBC_2.0)[1] 24782 div(GLIBC_2.0)[1] mktime(GLIBC_2.0)[1] towlower(GLIBC_2.0)[1] 24783 dngettext[1] mlock()[1] towupper()[1] 24784 drand48(GLIBC_2.0)[1] mlockall(GLIBC_2.0)[1] 24785 truncate(GLIBC_2.0)[1] 24786 dup(GLIBC_2.0)[1] mmap(GLIBC_2.0)[1] truncate64(GLIBC_2.0)[1] 24787 dup2(GLIBC_2.0)[1] mmap64(GLIBC_2.0)[1] tsearch(GLIBC_2.0)[1] 24788 duplocale[1] mprotect()[1] ttyname()[1] 24789 ecvt(GLIBC_2.0)[1] mrand48(GLIBC_2.0)[1] 24790 ttyname_r(GLIBC_2.0)[1] 24791 endgrent(GLIBC_2.0)[1] msgctl(GLIBC_2.0)[1] 24792 twalk(GLIBC_2.0)[1] 24793 endprotoent(GLIBC_2.0)[1] msgget(GLIBC_2.0)[1] 24794 tzset(GLIBC_2.0)[1] 24795 endpwent(GLIBC_2.0)[1] msgrcv(GLIBC_2.0)[1] 24796 ualarm(GLIBC_2.0)[1] 24797 endservent(GLIBC_2.0)[1] msgsnd(GLIBC_2.0)[1] 24798 ulimit(GLIBC_2.0)[1] 24799 endutent(GLIBC_2.0)[1] msync(GLIBC_2.0)[1] umask(GLIBC_2.0)[1] 24800 endutxent(GLIBC_2.1)[1] munlock(GLIBC_2.1)[1] 24801 uname(GLIBC_2.1)[1] 24802 erand48(GLIBC_2.0)[1] munlockall(GLIBC_2.0)[1] 24803 ungetc(GLIBC_2.0)[1] 24804 err(GLIBC_2.0)[1] munmap(GLIBC_2.0)[1] ungetwc(GLIBC_2.0)[1] 24805 error(GLIBC_2.0)[1] nanosleep(GLIBC_2.0)[1] 24806 unlink(GLIBC_2.0)[1] 24807 errx(GLIBC_2.0)[1] newlocale[1] unlockpt(GLIBC_2.0)[1] 24808 execl(GLIBC_2.0)[1] nftw(GLIBC_2.0)[1] unsetenv[1] 24809 execle(GLIBC_2.0)[1] nftw64(GLIBC_2.0)[1] uselocale[1] 24810 execlp(GLIBC_2.0)[1] ngettext[1] usleep(GLIBC_2.0)[1] 24811 execv(GLIBC_2.0)[1] nice(GLIBC_2.0)[1] utime(GLIBC_2.0)[1] 24812 execve(GLIBC_2.0)[1] nl_langinfo(GLIBC_2.0)[1] 24813 utimes(GLIBC_2.0)[1] 24814 execvp(GLIBC_2.0)[1] nrand48(GLIBC_2.0)[1] utmpname[1] 24815 exit(GLIBC_2.0)[1] ntohl(GLIBC_2.0)[1] vasprintf(GLIBC_2.0)[1] 24816 fchdir(GLIBC_2.0)[1] ntohs(GLIBC_2.0)[1] 24817 vdprintf(GLIBC_2.0)[1] 24818 fchmod(GLIBC_2.0)[1] open(GLIBC_2.0)[1] verrx(GLIBC_2.0)[1] 24819 fchown(GLIBC_2.0)[1] opendir(GLIBC_2.0)[1] vfork(GLIBC_2.0)[1] 24820 fclose(GLIBC_2.1)[1] openlog(GLIBC_2.1)[1] 24821 vfprintf(GLIBC_2.1)[1] 24822 fcntl(GLIBC_2.0)[1] pathconf(GLIBC_2.0)[1] vfscanf[1] 24823 fcvt(GLIBC_2.0)[1] pause(GLIBC_2.0)[1] vfwprintf(GLIBC_2.0)[1] 24824 fdatasync(GLIBC_2.0)[1] pclose(GLIBC_2.0)[1] 24825 vfwscanf(GLIBC_2.0)[1] 24826 fdopen(GLIBC_2.1)[1] perror(GLIBC_2.1)[1] 24827 vprintf(GLIBC_2.1)[1] 24828 feof(GLIBC_2.0)[1] pipe(GLIBC_2.0)[1] vscanf[1] 24829 ferror(GLIBC_2.0)[1] pmap_getport(GLIBC_2.0)[1] 24830 vsnprintf(GLIBC_2.0)[1] 24831 fflush(GLIBC_2.0)[1] pmap_set(GLIBC_2.0)[1] 24832 vsprintf(GLIBC_2.0)[1] 24833 fflush_unlocked(GLIBC_2.0)[1] pmap_unset(GLIBC_2.0)[1] 24834 vsscanf[1] 24835 ffs(GLIBC_2.0)[1] poll(GLIBC_2.0)[1] vswprintf(GLIBC_2.0)[1] 24836 fgetc(GLIBC_2.0)[1] popen(GLIBC_2.0)[1] vswscanf(GLIBC_2.0)[1] 24837 fgetpos(GLIBC_2.0)[1] posix_memalign(GLIBC_2.0)[1] vsyslog[1] 24838 fgetpos64(GLIBC_2.1)[1] posix_openpt[1] vwprintf(GLIBC_2.1)[1] 24839 fgets(GLIBC_2.0)[1] printf(GLIBC_2.0)[1] vwscanf(GLIBC_2.0)[1] 24840 fgetwc(GLIBC_2.2)[1] psignal(GLIBC_2.2)[1] wait(GLIBC_2.2)[1] 24841 fgetwc_unlocked(GLIBC_2.2)[1] ptsname(GLIBC_2.2)[1] 24842 wait4(GLIBC_2.2)[1] 24843 fgetws(GLIBC_2.2)[1] putc(GLIBC_2.2)[1] waitpid(GLIBC_2.2)[1] 24844 fileno(GLIBC_2.0)[1] putc_unlocked(GLIBC_2.0)[1] 24845 warn(GLIBC_2.0)[1] 24846 flock(GLIBC_2.0)[1] putchar(GLIBC_2.0)[1] warnx(GLIBC_2.0)[1] 24847 flockfile(GLIBC_2.0)[1] putchar_unlocked(GLIBC_2.0)[1] 24848 wcpcpy(GLIBC_2.0)[1] 24849 fmtmsg(GLIBC_2.1)[1] putenv(GLIBC_2.1)[1] 24850 wcpncpy(GLIBC_2.1)[1] 24851 fnmatch(GLIBC_2.2.3)[1] puts(GLIBC_2.2.3)[1] 24852 wcrtomb(GLIBC_2.2.3)[1] 24853 fopen(GLIBC_2.1)[1] pututxline(GLIBC_2.1)[1] 24854 wcscasecmp(GLIBC_2.1)[1] 24855 fopen64(GLIBC_2.1)[1] putw(GLIBC_2.1)[1] wcscat(GLIBC_2.1)[1] 24856 fork(GLIBC_2.0)[1] putwc(GLIBC_2.0)[1] wcschr(GLIBC_2.0)[1] 24857 fpathconf(GLIBC_2.0)[1] putwchar(GLIBC_2.0)[1] 24858 wcscmp(GLIBC_2.0)[1] 24859 fprintf(GLIBC_2.0)[1] qsort(GLIBC_2.0)[1] 24860 wcscoll(GLIBC_2.0)[1] 24861 fputc(GLIBC_2.0)[1] raise(GLIBC_2.0)[1] wcscpy(GLIBC_2.0)[1] 24862 fputs(GLIBC_2.0)[1] rand(GLIBC_2.0)[1] wcscspn(GLIBC_2.0)[1] 24863 fputwc(GLIBC_2.2)[1] rand_r(GLIBC_2.2)[1] wcsdup(GLIBC_2.2)[1] 24864 fputws(GLIBC_2.2)[1] random(GLIBC_2.2)[1] 24865 wcsftime(GLIBC_2.2)[1] 24866 fread(GLIBC_2.0)[1] read(GLIBC_2.0)[1] wcslen(GLIBC_2.0)[1] 24867 free(GLIBC_2.0)[1] readdir(GLIBC_2.0)[1] 24868 wcsncasecmp(GLIBC_2.0)[1] 24869 freeaddrinfo[1] readdir64()[1] wcsncat()[1] 24870 freelocale[1] readdir_r[1] wcsncmp()[1] 24871 freopen(GLIBC_2.0)[1] readlink(GLIBC_2.0)[1] 24872 wcsncpy(GLIBC_2.0)[1] 24873 freopen64(GLIBC_2.1)[1] readv(GLIBC_2.1)[1] 24874 wcsnlen(GLIBC_2.1)[1] 24875 fscanf(GLIBC_2.0)[1] realloc(GLIBC_2.0)[1] 24876 wcsnrtombs(GLIBC_2.0)[1] 24877 fseek(GLIBC_2.0)[1] realpath(GLIBC_2.0)[1] 24878 wcspbrk(GLIBC_2.0)[1] 24879 fseeko(GLIBC_2.1)[1] recv(GLIBC_2.1)[1] wcsrchr(GLIBC_2.1)[1] 24880 fseeko64(GLIBC_2.1)[1] recvfrom(GLIBC_2.1)[1] 24881 wcsrtombs(GLIBC_2.1)[1] 24882 fsetpos(GLIBC_2.0)[1] recvmsg(GLIBC_2.0)[1] 24883 wcsspn(GLIBC_2.0)[1] 24884 fsetpos64(GLIBC_2.1)[1] regcomp(GLIBC_2.1)[1] 24885 wcsstr(GLIBC_2.1)[1] 24886 fstatvfs(GLIBC_2.1)[1] regerror(GLIBC_2.1)[1] 24887 wcstod(GLIBC_2.1)[1] 24888 fstatvfs64(GLIBC_2.1)[1] regexec(GLIBC_2.1)[1] 24889 wcstof(GLIBC_2.1)[1] 24890 fsync(GLIBC_2.0)[1] regfree(GLIBC_2.0)[1] 24891 wcstoimax(GLIBC_2.0)[1] 24892 ftell(GLIBC_2.0)[1] remove(GLIBC_2.0)[1] wcstok(GLIBC_2.0)[1] 24893 ftello(GLIBC_2.1)[1] remque(GLIBC_2.1)[1] wcstol(GLIBC_2.1)[1] 24894 ftello64(GLIBC_2.1)[1] rename(GLIBC_2.1)[1] 24895 wcstold(GLIBC_2.1)[1] 24896 ftime(GLIBC_2.0)[1] rewind(GLIBC_2.0)[1] wcstoll(GLIBC_2.0)[1] 24897 ftok(GLIBC_2.0)[1] rewinddir(GLIBC_2.0)[1] 24898 wcstombs(GLIBC_2.0)[1] 24899 ftruncate(GLIBC_2.0)[1] rindex(GLIBC_2.0)[1] 24900 wcstoq(GLIBC_2.0)[1] 24901 ftruncate64(GLIBC_2.1)[1] rmdir(GLIBC_2.1)[1] 24902 wcstoul(GLIBC_2.1)[1] 24903 ftrylockfile(GLIBC_2.0)[1] sbrk(GLIBC_2.0)[1] 24904 wcstoull(GLIBC_2.0)[1] 24905 ftw(GLIBC_2.0)[1] scanf(GLIBC_2.0)[1] wcstoumax(GLIBC_2.0)[1] 24906 ftw64(GLIBC_2.1)[1] sched_get_priority_max(GLIBC_2.1)[1] 24907 wcstouq(GLIBC_2.1)[1] 24908 funlockfile(GLIBC_2.0)[1] sched_get_priority_min(GLIBC_2.0)[1] 24909 wcswcs(GLIBC_2.0)[1] 24910 fwide(GLIBC_2.2)[1] sched_getparam(GLIBC_2.2)[1] 24911 wcswidth(GLIBC_2.2)[1] 24912 fwprintf(GLIBC_2.2)[1] sched_getscheduler(GLIBC_2.2)[1] 24913 wcsxfrm(GLIBC_2.2)[1] 24914 fwrite(GLIBC_2.0)[1] sched_rr_get_interval(GLIBC_2.0)[1] 24915 wctob(GLIBC_2.0)[1] 24916 fwscanf(GLIBC_2.2)[1] sched_setparam(GLIBC_2.2)[1] 24917 wctomb(GLIBC_2.2)[1] 24918 gai_strerror[1] sched_setscheduler()[1] wctrans()[1] 24919 gcvt(GLIBC_2.0)[1] sched_yield(GLIBC_2.0)[1] 24920 wctype(GLIBC_2.0)[1] 24921 getaddrinfo[1] seed48()[1] wcwidth()[1] 24922 getc(GLIBC_2.0)[1] seekdir(GLIBC_2.0)[1] wmemchr(GLIBC_2.0)[1] 24923 getc_unlocked(GLIBC_2.0)[1] select(GLIBC_2.0)[1] 24924 wmemcmp(GLIBC_2.0)[1] 24925 getchar(GLIBC_2.0)[1] semctl(GLIBC_2.0)[1] 24926 wmemcpy(GLIBC_2.0)[1] 24927 getchar_unlocked(GLIBC_2.0)[1] semget(GLIBC_2.0)[1] 24928 wmemmove(GLIBC_2.0)[1] 24929 getcontext(GLIBC_2.1)[1] semop(GLIBC_2.1)[1] 24930 wmemset(GLIBC_2.1)[1] 24931 getcwd(GLIBC_2.0)[1] send(GLIBC_2.0)[1] wordexp(GLIBC_2.0)[1] 24932 getdate(GLIBC_2.1)[1] sendmsg(GLIBC_2.1)[1] 24933 wordfree(GLIBC_2.1)[1] 24934 getegid(GLIBC_2.0)[1] sendto(GLIBC_2.0)[1] 24935 wprintf(GLIBC_2.0)[1] 24936 getenv(GLIBC_2.0)[1] setbuf(GLIBC_2.0)[1] write(GLIBC_2.0)[1] 24937 geteuid(GLIBC_2.0)[1] setbuffer(GLIBC_2.0)[1] 24938 writev(GLIBC_2.0)[1] 24939 getgid(GLIBC_2.0)[1] setcontext(GLIBC_2.0)[1] 24940 wscanf(GLIBC_2.0)[1] 24941 getgrent(GLIBC_2.0)[1] setegid(GLIBC_2.0)[1] 24942 xdr_accepted_reply(GLIBC_2.0)[1] 24943 getgrgid(GLIBC_2.0)[1] setenv[1] xdr_array(GLIBC_2.0)[1] 24944 getgrgid_r(GLIBC_2.0)[1] seteuid(GLIBC_2.0)[1] 24945 xdr_bool(GLIBC_2.0)[1] 24946 getgrnam(GLIBC_2.0)[1] setgid(GLIBC_2.0)[1] 24947 xdr_bytes(GLIBC_2.0)[1] 24948 getgrnam_r(GLIBC_2.0)[1] setgrent(GLIBC_2.0)[1] 24949 xdr_callhdr(GLIBC_2.0)[1] 24950 getgrouplist[1] setgroups()[1] xdr_callmsg()[1] 24951 getgroups(GLIBC_2.0)[1] sethostname(GLIBC_2.0)[1] 24952 xdr_char(GLIBC_2.0)[1] 24953 gethostbyaddr(GLIBC_2.0)[1] setitimer(GLIBC_2.0)[1] 24954 xdr_double(GLIBC_2.0)[1] 24955 gethostbyname(GLIBC_2.0)[1] setlocale(GLIBC_2.0)[1] 24956 xdr_enum(GLIBC_2.0)[1] 24957 gethostid(GLIBC_2.0)[1] setlogmask(GLIBC_2.0)[1] 24958 xdr_float(GLIBC_2.0)[1] 24959 gethostname(GLIBC_2.0)[1] setpgid(GLIBC_2.0)[1] 24960 xdr_free(GLIBC_2.0)[1] 24961 getitimer(GLIBC_2.0)[1] setpgrp(GLIBC_2.0)[1] 24962 xdr_int(GLIBC_2.0)[1] 24963 getloadavg(GLIBC_2.2)[1] setpriority(GLIBC_2.2)[1] 24964 xdr_long(GLIBC_2.2)[1] 24965 getlogin(GLIBC_2.0)[1] setprotoent(GLIBC_2.0)[1] 24966 xdr_opaque(GLIBC_2.0)[1] 24967 getlogin_r[1] setpwent()[1] xdr_opaque_auth()[1] 24968 getnameinfo[1] setregid()[1] xdr_pointer()[1] 24969 getopt(GLIBC_2.0)[1] setreuid(GLIBC_2.0)[1] 24970 xdr_reference(GLIBC_2.0)[1] 24971 getopt_long(GLIBC_2.0)[1] setrlimit(GLIBC_2.0)[1] 24972 xdr_rejected_reply(GLIBC_2.0)[1] 24973 getopt_long_only(GLIBC_2.0)[1] setrlimit64[1] 24974 xdr_replymsg(GLIBC_2.0)[1] 24975 getpagesize(GLIBC_2.0)[1] setservent(GLIBC_2.0)[1] 24976 xdr_short(GLIBC_2.0)[1] 24977 getpeername(GLIBC_2.0)[1] setsid(GLIBC_2.0)[1] 24978 xdr_string(GLIBC_2.0)[1] 24979 getpgid(GLIBC_2.0)[1] setsockopt(GLIBC_2.0)[1] 24980 xdr_u_char(GLIBC_2.0)[1] 24981 getpgrp(GLIBC_2.0)[1] setstate(GLIBC_2.0)[1] 24982 xdr_u_int(GLIBC_2.0)[1] 24983 getpid(GLIBC_2.0)[1] setuid(GLIBC_2.0)[1] 24984 xdr_u_long(GLIBC_2.0)[1] 24985 getppid(GLIBC_2.0)[1] setutent(GLIBC_2.0)[1] 24986 xdr_u_short(GLIBC_2.0)[1] 24987 getpriority(GLIBC_2.0)[1] setutxent(GLIBC_2.0)[1] 24988 xdr_union(GLIBC_2.0)[1] 24989 getprotobyname(GLIBC_2.0)[1] setvbuf(GLIBC_2.0)[1] 24990 xdr_vector(GLIBC_2.0)[1] 24991 getprotobynumber(GLIBC_2.0)[1] shmat(GLIBC_2.0)[1] 24992 xdr_void(GLIBC_2.0)[1] 24993 getprotoent(GLIBC_2.0)[1] shmctl(GLIBC_2.0)[1] 24994 xdr_wrapstring(GLIBC_2.0)[1] 24995 getpwent(GLIBC_2.0)[1] shmdt(GLIBC_2.0)[1] 24996 xdrmem_create(GLIBC_2.0)[1] 24997 getpwnam(GLIBC_2.0)[1] shmget(GLIBC_2.0)[1] 24998 xdrrec_create(GLIBC_2.0)[1] 24999 getpwnam_r(GLIBC_2.0)[1] shutdown(GLIBC_2.0)[1] 25000 xdrrec_eof(GLIBC_2.0)[1] 25001 getpwuid(GLIBC_2.0)[1] sigaction(GLIBC_2.0)[1] 25002 25003 Table A-2. libc Data Interfaces 25004 __daylight __timezone _sys_errlist 25005 __environ __tzname 25006 _________________________________________________________ 25007 25008 A.2. libcrypt 25009 25010 The behavior of the interfaces in this library is specified by 25011 the following Standards. 25012 25013 ISO POSIX (2003) 25014 25015 Table A-3. libcrypt Function Interfaces 25016 crypt(GLIBC_2.0)[1] encrypt(GLIBC_2.0)[1] setkey(GLIBC_2.0)[1] 25017 _________________________________________________________ 25018 25019 A.3. libdl 25020 25021 The behavior of the interfaces in this library is specified by 25022 the following Standards. 25023 25024 This Specification 25025 ISO POSIX (2003) 25026 25027 Table A-4. libdl Function Interfaces 25028 dladdr(GLIBC_2.0)[1] dlerror(GLIBC_2.0)[1] dlsym(GLIBC_2.0)[1] 25029 dlclose(GLIBC_2.0)[1] dlopen(GLIBC_2.0)[1] 25030 _________________________________________________________ 25031 25032 A.4. libm 25033 25034 The behavior of the interfaces in this library is specified by 25035 the following Standards. 25036 25037 ISO C (1999) 25038 This Specification 25039 SUSv2 25040 ISO POSIX (2003) 25041 25042 Table A-5. libm Function Interfaces 25043 __finite[1] csinhf()[1] log10()[1] 25044 __finitef[1] csinhl()[1] log10f[1] 25045 __finitel[1] csinl()[1] log10l[1] 25046 __fpclassify[1] csqrt()[1] log1p()[1] 25047 __fpclassifyf[1] csqrtf()[1] log1pf[1] 25048 __signbit[1] csqrtl()[1] log1pl[1] 25049 __signbitf[1] ctan()[1] log2[1] 25050 acos(GLIBC_2.0)[1] ctanf(GLIBC_2.0)[1] log2f[1] 25051 acosf(GLIBC_2.0)[1] ctanh(GLIBC_2.0)[1] log2l[1] 25052 acosh(GLIBC_2.0)[1] ctanhf(GLIBC_2.0)[1] logb(GLIBC_2.0)[1] 25053 acoshf(GLIBC_2.0)[1] ctanhl(GLIBC_2.0)[1] logbf[1] 25054 acoshl(GLIBC_2.0)[1] ctanl(GLIBC_2.0)[1] logbl[1] 25055 acosl(GLIBC_2.0)[1] dremf(GLIBC_2.0)[1] logf[1] 25056 asin(GLIBC_2.0)[1] dreml(GLIBC_2.0)[1] logl[1] 25057 asinf(GLIBC_2.0)[1] erf(GLIBC_2.0)[1] lrint(GLIBC_2.0)[1] 25058 asinh(GLIBC_2.0)[1] erfc(GLIBC_2.0)[1] lrintf(GLIBC_2.0)[1] 25059 asinhf(GLIBC_2.0)[1] erfcf(GLIBC_2.0)[1] lrintl(GLIBC_2.0)[1] 25060 asinhl(GLIBC_2.0)[1] erfcl(GLIBC_2.0)[1] lround(GLIBC_2.0)[1] 25061 asinl(GLIBC_2.0)[1] erff(GLIBC_2.0)[1] lroundf(GLIBC_2.0)[1] 25062 atan(GLIBC_2.0)[1] erfl(GLIBC_2.0)[1] lroundl(GLIBC_2.0)[1] 25063 atan2(GLIBC_2.0)[1] exp(GLIBC_2.0)[1] matherr(GLIBC_2.0)[1] 25064 atan2f(GLIBC_2.0)[1] exp2[1] modf(GLIBC_2.0)[1] 25065 atan2l(GLIBC_2.0)[1] exp2f[1] modff(GLIBC_2.0)[1] 25066 atanf(GLIBC_2.0)[1] expf[1] modfl(GLIBC_2.0)[1] 25067 atanh(GLIBC_2.0)[1] expl[1] nan(GLIBC_2.0)[1] 25068 atanhf(GLIBC_2.0)[1] expm1(GLIBC_2.0)[1] nanf(GLIBC_2.0)[1] 25069 atanhl(GLIBC_2.0)[1] expm1f[1] nanl(GLIBC_2.0)[1] 25070 atanl(GLIBC_2.0)[1] expm1l[1] nearbyint(GLIBC_2.0)[1] 25071 cabs(GLIBC_2.1)[1] fabs(GLIBC_2.1)[1] nearbyintf(GLIBC_2.1)[1] 25072 cabsf(GLIBC_2.1)[1] fabsf(GLIBC_2.1)[1] 25073 nearbyintl(GLIBC_2.1)[1] 25074 cabsl(GLIBC_2.1)[1] fabsl(GLIBC_2.1)[1] 25075 nextafter(GLIBC_2.1)[1] 25076 cacos(GLIBC_2.1)[1] fdim(GLIBC_2.1)[1] 25077 nextafterf(GLIBC_2.1)[1] 25078 cacosf(GLIBC_2.1)[1] fdimf(GLIBC_2.1)[1] 25079 nextafterl(GLIBC_2.1)[1] 25080 cacosh(GLIBC_2.1)[1] fdiml(GLIBC_2.1)[1] 25081 nexttoward(GLIBC_2.1)[1] 25082 cacoshf(GLIBC_2.1)[1] feclearexcept(GLIBC_2.1)[1] 25083 nexttowardf(GLIBC_2.1)[1] 25084 cacoshl(GLIBC_2.1)[1] fegetenv(GLIBC_2.1)[1] 25085 nexttowardl(GLIBC_2.1)[1] 25086 cacosl(GLIBC_2.1)[1] fegetexceptflag(GLIBC_2.1)[1] 25087 pow(GLIBC_2.1)[1] 25088 carg(GLIBC_2.1)[1] fegetround(GLIBC_2.1)[1] 25089 pow10(GLIBC_2.1)[1] 25090 cargf(GLIBC_2.1)[1] feholdexcept(GLIBC_2.1)[1] 25091 pow10f(GLIBC_2.1)[1] 25092 cargl(GLIBC_2.1)[1] feraiseexcept(GLIBC_2.1)[1] 25093 pow10l(GLIBC_2.1)[1] 25094 casin(GLIBC_2.1)[1] fesetenv(GLIBC_2.1)[1] powf(GLIBC_2.1)[1] 25095 casinf(GLIBC_2.1)[1] fesetexceptflag(GLIBC_2.1)[1] 25096 powl(GLIBC_2.1)[1] 25097 casinh(GLIBC_2.1)[1] fesetround(GLIBC_2.1)[1] 25098 remainder(GLIBC_2.1)[1] 25099 casinhf(GLIBC_2.1)[1] fetestexcept(GLIBC_2.1)[1] 25100 remainderf(GLIBC_2.1)[1] 25101 casinhl(GLIBC_2.1)[1] feupdateenv(GLIBC_2.1)[1] 25102 remainderl(GLIBC_2.1)[1] 25103 casinl(GLIBC_2.1)[1] finite(GLIBC_2.1)[1] remquo(GLIBC_2.1)[1] 25104 catan(GLIBC_2.1)[1] finitef(GLIBC_2.1)[1] 25105 remquof(GLIBC_2.1)[1] 25106 catanf(GLIBC_2.1)[1] finitel(GLIBC_2.1)[1] 25107 remquol(GLIBC_2.1)[1] 25108 catanh(GLIBC_2.1)[1] floor(GLIBC_2.1)[1] rint(GLIBC_2.1)[1] 25109 catanhf(GLIBC_2.1)[1] floorf(GLIBC_2.1)[1] rintf(GLIBC_2.1)[1] 25110 catanhl(GLIBC_2.1)[1] floorl(GLIBC_2.1)[1] rintl(GLIBC_2.1)[1] 25111 catanl(GLIBC_2.1)[1] fma(GLIBC_2.1)[1] round(GLIBC_2.1)[1] 25112 cbrt(GLIBC_2.0)[1] fmaf(GLIBC_2.0)[1] roundf(GLIBC_2.0)[1] 25113 cbrtf(GLIBC_2.0)[1] fmal(GLIBC_2.0)[1] roundl(GLIBC_2.0)[1] 25114 cbrtl(GLIBC_2.0)[1] fmax(GLIBC_2.0)[1] scalb(GLIBC_2.0)[1] 25115 ccos(GLIBC_2.1)[1] fmaxf(GLIBC_2.1)[1] scalbf(GLIBC_2.1)[1] 25116 ccosf(GLIBC_2.1)[1] fmaxl(GLIBC_2.1)[1] scalbl(GLIBC_2.1)[1] 25117 ccosh(GLIBC_2.1)[1] fmin(GLIBC_2.1)[1] scalbln(GLIBC_2.1)[1] 25118 ccoshf(GLIBC_2.1)[1] fminf(GLIBC_2.1)[1] 25119 scalblnf(GLIBC_2.1)[1] 25120 ccoshl(GLIBC_2.1)[1] fminl(GLIBC_2.1)[1] 25121 scalblnl(GLIBC_2.1)[1] 25122 ccosl(GLIBC_2.1)[1] fmod(GLIBC_2.1)[1] scalbn(GLIBC_2.1)[1] 25123 ceil(GLIBC_2.0)[1] fmodf(GLIBC_2.0)[1] scalbnf(GLIBC_2.0)[1] 25124 ceilf(GLIBC_2.0)[1] fmodl(GLIBC_2.0)[1] scalbnl(GLIBC_2.0)[1] 25125 ceill(GLIBC_2.0)[1] frexp(GLIBC_2.0)[1] 25126 significand(GLIBC_2.0)[1] 25127 cexp(GLIBC_2.1)[1] frexpf(GLIBC_2.1)[1] 25128 significandf(GLIBC_2.1)[1] 25129 cexpf(GLIBC_2.1)[1] frexpl(GLIBC_2.1)[1] 25130 significandl(GLIBC_2.1)[1] 25131 cexpl(GLIBC_2.1)[1] gamma(GLIBC_2.1)[1] sin(GLIBC_2.1)[1] 25132 cimag(GLIBC_2.1)[1] gammaf(GLIBC_2.1)[1] sincos(GLIBC_2.1)[1] 25133 cimagf(GLIBC_2.1)[1] gammal(GLIBC_2.1)[1] 25134 sincosf(GLIBC_2.1)[1] 25135 cimagl(GLIBC_2.1)[1] hypot(GLIBC_2.1)[1] sincosl(GLIBC_2.1)[1] 25136 clog(GLIBC_2.1)[1] hypotf(GLIBC_2.1)[1] sinf(GLIBC_2.1)[1] 25137 clog10(GLIBC_2.1)[1] hypotl(GLIBC_2.1)[1] sinh(GLIBC_2.1)[1] 25138 clog10f(GLIBC_2.1)[1] ilogb(GLIBC_2.1)[1] sinhf(GLIBC_2.1)[1] 25139 clog10l(GLIBC_2.1)[1] ilogbf(GLIBC_2.1)[1] sinhl(GLIBC_2.1)[1] 25140 clogf(GLIBC_2.1)[1] ilogbl(GLIBC_2.1)[1] sinl(GLIBC_2.1)[1] 25141 clogl(GLIBC_2.1)[1] j0(GLIBC_2.1)[1] sqrt(GLIBC_2.1)[1] 25142 conj(GLIBC_2.1)[1] j0f(GLIBC_2.1)[1] sqrtf(GLIBC_2.1)[1] 25143 conjf(GLIBC_2.1)[1] j0l(GLIBC_2.1)[1] sqrtl(GLIBC_2.1)[1] 25144 conjl(GLIBC_2.1)[1] j1(GLIBC_2.1)[1] tan(GLIBC_2.1)[1] 25145 copysign(GLIBC_2.0)[1] j1f(GLIBC_2.0)[1] tanf(GLIBC_2.0)[1] 25146 copysignf(GLIBC_2.0)[1] j1l(GLIBC_2.0)[1] tanh(GLIBC_2.0)[1] 25147 copysignl(GLIBC_2.0)[1] jn(GLIBC_2.0)[1] tanhf(GLIBC_2.0)[1] 25148 cos(GLIBC_2.0)[1] jnf(GLIBC_2.0)[1] tanhl(GLIBC_2.0)[1] 25149 cosf(GLIBC_2.0)[1] jnl(GLIBC_2.0)[1] tanl(GLIBC_2.0)[1] 25150 cosh(GLIBC_2.0)[1] ldexp(GLIBC_2.0)[1] tgamma(GLIBC_2.0)[1] 25151 coshf(GLIBC_2.0)[1] ldexpf(GLIBC_2.0)[1] tgammaf(GLIBC_2.0)[1] 25152 coshl(GLIBC_2.0)[1] ldexpl(GLIBC_2.0)[1] tgammal(GLIBC_2.0)[1] 25153 cosl(GLIBC_2.0)[1] lgamma(GLIBC_2.0)[1] trunc(GLIBC_2.0)[1] 25154 cpow(GLIBC_2.1)[1] lgamma_r(GLIBC_2.1)[1] truncf(GLIBC_2.1)[1] 25155 cpowf(GLIBC_2.1)[1] lgammaf(GLIBC_2.1)[1] truncl(GLIBC_2.1)[1] 25156 cpowl(GLIBC_2.1)[1] lgammaf_r(GLIBC_2.1)[1] y0(GLIBC_2.1)[1] 25157 cproj(GLIBC_2.1)[1] lgammal(GLIBC_2.1)[1] y0f(GLIBC_2.1)[1] 25158 cprojf(GLIBC_2.1)[1] lgammal_r(GLIBC_2.1)[1] y0l(GLIBC_2.1)[1] 25159 cprojl(GLIBC_2.1)[1] llrint(GLIBC_2.1)[1] y1(GLIBC_2.1)[1] 25160 creal(GLIBC_2.1)[1] llrintf(GLIBC_2.1)[1] y1f(GLIBC_2.1)[1] 25161 crealf(GLIBC_2.1)[1] llrintl(GLIBC_2.1)[1] y1l(GLIBC_2.1)[1] 25162 creall(GLIBC_2.1)[1] llround(GLIBC_2.1)[1] yn(GLIBC_2.1)[1] 25163 csin(GLIBC_2.1)[1] llroundf(GLIBC_2.1)[1] ynf(GLIBC_2.1)[1] 25164 csinf(GLIBC_2.1)[1] llroundl(GLIBC_2.1)[1] ynl(GLIBC_2.1)[1] 25165 csinh(GLIBC_2.1)[1] log(GLIBC_2.1)[1] 25166 25167 Table A-6. libm Data Interfaces 25168 signgam 25169 _________________________________________________________ 25170 25171 A.5. libncurses 25172 25173 The behavior of the interfaces in this library is specified by 25174 the following Standards. 25175 25176 X/Open Curses 25177 25178 Table A-7. libncurses Function Interfaces 25179 addch[1] mvdelch[1] slk_refresh[1] 25180 addchnstr[1] mvderwin[1] slk_restore[1] 25181 addchstr[1] mvgetch[1] slk_set[1] 25182 addnstr[1] mvgetnstr[1] slk_touch[1] 25183 addstr[1] mvgetstr[1] standend[1] 25184 attr_get[1] mvhline[1] standout[1] 25185 attr_off[1] mvinch[1] start_color[1] 25186 attr_on[1] mvinchnstr[1] subpad[1] 25187 attr_set[1] mvinchstr[1] subwin[1] 25188 attroff[1] mvinnstr[1] syncok[1] 25189 attron[1] mvinsch[1] termattrs[1] 25190 attrset[1] mvinsnstr[1] termname[1] 25191 baudrate[1] mvinsstr[1] tgetent[1] 25192 beep[1] mvinstr[1] tgetflag[1] 25193 bkgd[1] mvprintw[1] tgetnum[1] 25194 bkgdset[1] mvscanw[1] tgetstr[1] 25195 border[1] mvvline[1] tgoto[1] 25196 box[1] mvwaddch[1] tigetflag[1] 25197 can_change_color[1] mvwaddchnstr[1] tigetnum[1] 25198 cbreak[1] mvwaddchstr[1] tigetstr[1] 25199 chgat[1] mvwaddnstr[1] timeout[1] 25200 clear[1] mvwaddstr[1] touchline[1] 25201 clearok[1] mvwchgat[1] touchwin[1] 25202 clrtobot[1] mvwdelch[1] tparm[1] 25203 clrtoeol[1] mvwgetch[1] tputs[1] 25204 color_content[1] mvwgetnstr[1] typeahead[1] 25205 color_set[1] mvwgetstr[1] unctrl[1] 25206 copywin[1] mvwhline[1] ungetch[1] 25207 curs_set[1] mvwin[1] untouchwin[1] 25208 def_prog_mode[1] mvwinch[1] use_env[1] 25209 def_shell_mode[1] mvwinchnstr[1] vidattr[1] 25210 del_curterm[1] mvwinchstr[1] vidputs[1] 25211 delay_output[1] mvwinnstr[1] vline[1] 25212 delch[1] mvwinsch[1] vw_printw[1] 25213 deleteln[1] mvwinsnstr[1] vw_scanw[1] 25214 delscreen[1] mvwinsstr[1] vwprintw[1] 25215 delwin[1] mvwinstr[1] vwscanw[1] 25216 derwin[1] mvwprintw[1] waddch[1] 25217 doupdate[1] mvwscanw[1] waddchnstr[1] 25218 dupwin[1] mvwvline[1] waddchstr[1] 25219 echo[1] napms[1] waddnstr[1] 25220 echochar[1] newpad[1] waddstr[1] 25221 endwin[1] newterm[1] wattr_get[1] 25222 erase[1] newwin[1] wattr_off[1] 25223 erasechar[1] nl[1] wattr_on[1] 25224 filter[1] nocbreak[1] wattr_set[1] 25225 flash[1] nodelay[1] wattroff[1] 25226 flushinp[1] noecho[1] wattron[1] 25227 getbkgd[1] nonl[1] wattrset[1] 25228 getch[1] noqiflush[1] wbkgd[1] 25229 getnstr[1] noraw[1] wbkgdset[1] 25230 getstr[1] notimeout[1] wborder[1] 25231 getwin[1] overlay[1] wchgat[1] 25232 halfdelay[1] overwrite[1] wclear[1] 25233 has_colors[1] pair_content[1] wclrtobot[1] 25234 has_ic[1] pechochar[1] wclrtoeol[1] 25235 has_il[1] pnoutrefresh[1] wcolor_set[1] 25236 hline[1] prefresh[1] wcursyncup[1] 25237 idcok[1] printw[1] wdelch[1] 25238 idlok[1] putp[1] wdeleteln[1] 25239 immedok[1] putwin[1] wechochar[1] 25240 inch[1] qiflush[1] werase[1] 25241 inchnstr[1] raw[1] wgetch[1] 25242 inchstr[1] redrawwin[1] wgetnstr[1] 25243 init_color[1] refresh[1] wgetstr[1] 25244 init_pair[1] reset_prog_mode[1] whline[1] 25245 initscr[1] reset_shell_mode[1] winch[1] 25246 innstr[1] resetty[1] winchnstr[1] 25247 insch[1] restartterm[1] winchstr[1] 25248 insdelln[1] ripoffline[1] winnstr[1] 25249 insertln[1] savetty[1] winsch[1] 25250 insnstr[1] scanw[1] winsdelln[1] 25251 insstr[1] scr_dump[1] winsertln[1] 25252 instr[1] scr_init[1] winsnstr[1] 25253 intrflush[1] scr_restore[1] winsstr[1] 25254 is_linetouched[1] scr_set[1] winstr[1] 25255 is_wintouched[1] scrl[1] wmove[1] 25256 isendwin[1] scroll[1] wnoutrefresh[1] 25257 keyname[1] scrollok[1] wprintw[1] 25258 keypad[1] set_curterm[1] wredrawln[1] 25259 killchar[1] set_term[1] wrefresh[1] 25260 leaveok[1] setscrreg[1] wscanw[1] 25261 longname[1] setupterm[1] wscrl[1] 25262 meta[1] slk_attr_set[1] wsetscrreg[1] 25263 move[1] slk_attroff[1] wstandend[1] 25264 mvaddch[1] slk_attron[1] wstandout[1] 25265 mvaddchnstr[1] slk_attrset[1] wsyncdown[1] 25266 mvaddchstr[1] slk_clear[1] wsyncup[1] 25267 mvaddnstr[1] slk_color[1] wtimeout[1] 25268 mvaddstr[1] slk_init[1] wtouchln[1] 25269 mvchgat[1] slk_label[1] wvline[1] 25270 mvcur[1] slk_noutrefresh[1] 25271 25272 Table A-8. libncurses Data Interfaces 25273 COLORS LINES curscr 25274 COLOR_PAIRS acs_map stdscr 25275 COLS cur_term 25276 _________________________________________________________ 25277 25278 A.6. libpam 25279 25280 The behavior of the interfaces in this library is specified by 25281 the following Standards. 25282 25283 This Specification 25284 25285 Table A-9. libpam Function Interfaces 25286 pam_acct_mgmt[1] pam_fail_delay[1] pam_setcred[1] 25287 pam_authenticate[1] pam_get_item[1] pam_start[1] 25288 pam_chauthtok[1] pam_getenvlist[1] pam_strerror[1] 25289 pam_close_session[1] pam_open_session[1] 25290 pam_end[1] pam_set_item[1] 25291 _________________________________________________________ 25292 25293 A.7. libpthread 25294 25295 The behavior of the interfaces in this library is specified by 25296 the following Standards. 25297 25298 Large File Support 25299 This Specification 25300 ISO POSIX (2003) 25301 25302 Table A-10. libpthread Function Interfaces 25303 _pthread_cleanup_pop[1] pthread_cond_wait()[1] 25304 pthread_rwlock_timedwrlock[1] 25305 _pthread_cleanup_push[1] pthread_condattr_destroy()[1] 25306 pthread_rwlock_tryrdlock()[1] 25307 lseek64(GLIBC_2.1)[1] pthread_condattr_getpshared[1] 25308 pthread_rwlock_trywrlock(GLIBC_2.1)[1] 25309 open64(GLIBC_2.1)[1] pthread_condattr_init(GLIBC_2.1)[1] 25310 pthread_rwlock_unlock(GLIBC_2.1)[1] 25311 pread(GLIBC_2.1)[1] pthread_condattr_setpshared[1] 25312 pthread_rwlock_wrlock(GLIBC_2.1)[1] 25313 pread64(GLIBC_2.1)[1] pthread_create(GLIBC_2.1)[1] 25314 pthread_rwlockattr_destroy(GLIBC_2.1)[1] 25315 pthread_attr_destroy(GLIBC_2.0)[1] 25316 pthread_detach(GLIBC_2.0)[1] 25317 pthread_rwlockattr_getpshared(GLIBC_2.0)[1] 25318 pthread_attr_getdetachstate(GLIBC_2.0)[1] 25319 pthread_equal(GLIBC_2.0)[1] 25320 pthread_rwlockattr_init(GLIBC_2.0)[1] 25321 pthread_attr_getguardsize(GLIBC_2.1)[1] 25322 pthread_exit(GLIBC_2.1)[1] 25323 pthread_rwlockattr_setpshared(GLIBC_2.1)[1] 25324 pthread_attr_getinheritsched(GLIBC_2.0)[1] 25325 pthread_getconcurrency[1] pthread_self(GLIBC_2.0)[1] 25326 pthread_attr_getschedparam(GLIBC_2.0)[1] 25327 pthread_getschedparam(GLIBC_2.0)[1] 25328 pthread_setcancelstate(GLIBC_2.0)[1] 25329 pthread_attr_getschedpolicy(GLIBC_2.0)[1] 25330 pthread_getspecific(GLIBC_2.0)[1] 25331 pthread_setcanceltype(GLIBC_2.0)[1] 25332 pthread_attr_getscope(GLIBC_2.0)[1] pthread_join(GLIBC_2.0)[1] 25333 pthread_setconcurrency[1] 25334 pthread_attr_getstack[1] pthread_key_create()[1] 25335 pthread_setschedparam()[1] 25336 pthread_attr_getstackaddr(GLIBC_2.1)[1] 25337 pthread_key_delete(GLIBC_2.1)[1] pthread_setschedprio[1] 25338 pthread_attr_getstacksize(GLIBC_2.1)[1] 25339 pthread_kill(GLIBC_2.1)[1] pthread_setspecific(GLIBC_2.1)[1] 25340 pthread_attr_init(GLIBC_2.1)[1] 25341 pthread_mutex_destroy(GLIBC_2.1)[1] 25342 pthread_sigmask(GLIBC_2.1)[1] 25343 pthread_attr_setdetachstate(GLIBC_2.0)[1] 25344 pthread_mutex_init(GLIBC_2.0)[1] 25345 pthread_testcancel(GLIBC_2.0)[1] 25346 pthread_attr_setguardsize(GLIBC_2.1)[1] 25347 pthread_mutex_lock(GLIBC_2.1)[1] pwrite(GLIBC_2.1)[1] 25348 pthread_attr_setinheritsched(GLIBC_2.0)[1] 25349 pthread_mutex_trylock(GLIBC_2.0)[1] pwrite64(GLIBC_2.0)[1] 25350 pthread_attr_setschedparam(GLIBC_2.0)[1] 25351 pthread_mutex_unlock(GLIBC_2.0)[1] sem_close(GLIBC_2.0)[1] 25352 pthread_attr_setschedpolicy(GLIBC_2.0)[1] 25353 pthread_mutexattr_destroy(GLIBC_2.0)[1] 25354 sem_destroy(GLIBC_2.0)[1] 25355 pthread_attr_setscope(GLIBC_2.0)[1] 25356 pthread_mutexattr_getpshared(GLIBC_2.0)[1] 25357 sem_getvalue(GLIBC_2.0)[1] 25358 pthread_attr_setstack[1] pthread_mutexattr_gettype()[1] 25359 sem_init()[1] 25360 pthread_attr_setstackaddr(GLIBC_2.1)[1] 25361 pthread_mutexattr_init(GLIBC_2.1)[1] sem_open(GLIBC_2.1)[1] 25362 pthread_attr_setstacksize(GLIBC_2.1)[1] 25363 pthread_mutexattr_setpshared(GLIBC_2.1)[1] 25364 sem_post(GLIBC_2.1)[1] 25365 pthread_cancel(GLIBC_2.0)[1] 25366 pthread_mutexattr_settype(GLIBC_2.0)[1] 25367 sem_timedwait(GLIBC_2.0)[1] 25368 pthread_cond_broadcast(GLIBC_2.0)[1] 25369 pthread_once(GLIBC_2.0)[1] sem_trywait(GLIBC_2.0)[1] 25370 pthread_cond_destroy(GLIBC_2.0)[1] 25371 pthread_rwlock_destroy(GLIBC_2.0)[1] sem_unlink(GLIBC_2.0)[1] 25372 pthread_cond_init(GLIBC_2.0)[1] 25373 pthread_rwlock_init(GLIBC_2.0)[1] sem_wait(GLIBC_2.0)[1] 25374 pthread_cond_signal(GLIBC_2.0)[1] 25375 pthread_rwlock_rdlock(GLIBC_2.0)[1] 25376 pthread_cond_timedwait(GLIBC_2.0)[1] 25377 pthread_rwlock_timedrdlock[1] 25378 _________________________________________________________ 25379 25380 A.8. librt 25381 25382 The behavior of the interfaces in this library is specified by 25383 the following Standards. 25384 25385 ISO POSIX (2003) 25386 25387 Table A-11. librt Function Interfaces 25388 clock_getcpuclockid(GLIBC_2.2)[1] clock_settime(GLIBC_2.2)[1] 25389 timer_delete(GLIBC_2.2)[1] 25390 clock_getres(GLIBC_2.2)[1] shm_open(GLIBC_2.2)[1] 25391 timer_getoverrun(GLIBC_2.2)[1] 25392 clock_gettime(GLIBC_2.2)[1] shm_unlink(GLIBC_2.2)[1] 25393 timer_gettime(GLIBC_2.2)[1] 25394 clock_nanosleep(GLIBC_2.2)[1] timer_create(GLIBC_2.2)[1] 25395 timer_settime(GLIBC_2.2)[1] 25396 _________________________________________________________ 25397 25398 A.9. libutil 25399 25400 The behavior of the interfaces in this library is specified by 25401 the following Standards. 25402 25403 This Specification 25404 25405 Table A-12. libutil Function Interfaces 25406 forkpty(GLIBC_2.0)[1] login_tty(GLIBC_2.0)[1] 25407 logwtmp(GLIBC_2.0)[1] 25408 login(GLIBC_2.0)[1] logout(GLIBC_2.0)[1] openpty(GLIBC_2.0)[1] 25409 _________________________________________________________ 25410 25411 A.10. libz 25412 25413 The behavior of the interfaces in this library is specified by 25414 the following Standards. 25415 25416 This Specification 25417 25418 Table A-13. libz Function Interfaces 25419 adler32[1] gzclose[1] gztell[1] 25420 compress[1] gzdopen[1] gzwrite[1] 25421 compress2[1] gzeof[1] inflate[1] 25422 compressBound[1] gzerror[1] inflateEnd[1] 25423 crc32[1] gzflush[1] inflateInit2_[1] 25424 deflate[1] gzgetc[1] inflateInit_[1] 25425 deflateBound[1] gzgets[1] inflateReset[1] 25426 deflateCopy[1] gzopen[1] inflateSetDictionary[1] 25427 deflateEnd[1] gzprintf[1] inflateSync[1] 25428 deflateInit2_[1] gzputc[1] inflateSyncPoint[1] 25429 deflateInit_[1] gzputs[1] uncompress[1] 25430 deflateParams[1] gzread[1] zError[1] 25431 deflateReset[1] gzrewind[1] zlibVersion[1] 25432 deflateSetDictionary[1] gzseek[1] 25433 get_crc_table[1] gzsetparams[1] 25434 _________________________________________________________ 25435 25436 Appendix B. Future Directions (Informative) 25437 25438 B.1. Introduction 25439 25440 This appendix describes interfaces that are under development 25441 and aimed at future releases of this specification. At this 25442 stage, such interfaces are at best recommended practice, and 25443 do not constitute normative requirements of this 25444 specification. Applications may not assume that any system 25445 provides these interfaces. 25446 25447 We encourage system implementors and ISVs to provide these 25448 interfaces, and to provide feedback on their specification to 25449 lsbspec@freestandards.org. These interfaces may well be 25450 further modified during the development process, and may be 25451 withdrawn if concensus cannot be reached. 25452 _________________________________________________________ 25453 25454 B.2. Commands And Utilities 25455 25456 Table of Contents 25457 lsbinstall -- installation tool for various types of data 25458 25459 lsbinstall 25460 25461 Name 25462 25463 lsbinstall -- installation tool for various types of data 25464 25465 Synopsis 25466 25467 /usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] { -t 25468 type | --type=type } [-p package | --package=package] 25469 operand... 25470 25471 Description 25472 25473 The lsbinstall utility may be used to install certain types of 25474 files into system specific locations, repositories, or 25475 databases. This command may be used during a package post 25476 installation script to add package specific data to system 25477 wide repositories. A user may need appropriate privilege to 25478 invoke lsbinstall. 25479 25480 The operand (or operands) name an object of type type (see 25481 below) that belongs to a package named package. The 25482 combination of package name, object type and object name 25483 should be unique amongst all objects installed by lsbinstall. 25484 The lsbinstall utility may rename an object if another package 25485 already owns an object of the same type with the same name. 25486 25487 Note: If a namespace collision is detected by lsbinstall, 25488 it is unspecified how the object is renamed, although 25489 typical implementations may prepend the package name to the 25490 object in some way (e.g. package.obj-name). The lsbinstall 25491 utility may maintain a database of the mappings it has 25492 performed during installation in order to ensure that the 25493 correct object is removed during a subsequent removal 25494 operation. 25495 25496 Scripts installed by lsbinstall should not make use of the 25497 script name in order to decide on their functionality. 25498 25499 Note: It is appropriate for such a script to use the script 25500 name in error messages, usage statements, etc. The only 25501 guarantee made by lsbinstall is the effect that an 25502 installation (or removal) should have, not where a script 25503 is installed, or how it is named. 25504 25505 The -p pkg or --package=pkg is required for all object types 25506 unless explicitly noted below. 25507 25508 If the -c or --check option is specified, lsbinstall should 25509 test to see if there is an existing object of the type 25510 specified already installed. If there is, lsbinstall should 25511 print a message to its standard output and immediately exit 25512 with a status of zero. If there is no object of the type and 25513 name specified already installed, lsbinstall should exit with 25514 a non-zero status and take no further action. 25515 25516 If the -r or --remove is specified, the named object of the 25517 specified type should be removed or disabled from the system, 25518 except as noted below. The behavior is unspecified if the 25519 named object was not previously installed by lsbinstall. 25520 25521 Note: lsbinstall may rename objects during installation in 25522 order to prevent name collisions where another package has 25523 already installed an object with the given name. Using 25524 lsbinstall --remove will remove only the object belonging 25525 to the named package, and not the object belonging to 25526 another package. 25527 25528 Also note that the intent of the --remove option is to 25529 prevent the effect of the installed object; it should be 25530 sufficient to disable or comment out the addition in some 25531 way, while leaving the content behind. It is not intended 25532 that --remove be required to be the exact reverse of 25533 installation. 25534 25535 Object Types 25536 25537 The -t type or --type=type option should support at least the 25538 following types: 25539 25540 profile 25541 25542 install a profile script into a system specific location. 25543 There should be one operand, that names a profile shell 25544 script. The behavior is unspecified if this name does not have 25545 the suffix .sh. 25546 25547 The sh utility should read and execute commands in its current 25548 execution environment from all such installed profile shell 25549 scripts when invoked as an interactive login shell, or if the 25550 -l (the letter ell) is specified (see Shell Invocation). 25551 service 25552 25553 ensure a service name and number pair is known to the system 25554 service database. When installing, there must be at least two 25555 operands. The first operand should have the format %d/%s with 25556 the port number and protocol values (e.g. 22/tcp), and the 25557 second operand should be the name of the service. Any 25558 subsequent operands provide aliases for this service. The -p 25559 pkg or --package=pkg option is not required for service 25560 objects, and is ignored if specified. If any of the -r, 25561 --remove, -c or --check options are specified, there should be 25562 a single operand identifying the port and protocol values 25563 (with the same format as above). 25564 25565 It should not be an error to attempt to add a service name to 25566 the system service database if that service name already 25567 exists for the same port and protocol combination. If the port 25568 and protocol combination was already present, but the name 25569 unknown, the name should be added as an alias to the existing 25570 entry. It should be an error to attempt to add a second entry 25571 for a given service name and protocol, but where the port 25572 number differs from an existing entry. 25573 25574 If the -r or --remove is specified, the system service 25575 database need not be updated to remove or disable the named 25576 service. 25577 inet 25578 25579 add an entry to the system's network super daemon 25580 configuration. If none of the -r, --remove, -c or --check 25581 options are specified, the first operand should have the 25582 format: 25583 "%s:%s:%s:%s:%s:%s" 25584 25585 Otherwise, the first operand should have the format 25586 "%s:%s" 25587 25588 The fields in the first operand have the following meaning, in 25589 order: 25590 25591 svc_name 25592 25593 The name of this service. If the name does not contain a /, 25594 this should match the name of an already installed service 25595 (see also getservbyname()). If the name contains a / 25596 character, the behavior is unspecified. 25597 25598 Rationale: This version of the LSB does not specify 25599 getrpcbyname() nor the existence or format of the /etc/rpc 25600 file. Therefore, installation of RPC based services is not 25601 specified at this point. A future version of this 25602 specification may require names containing a / character to 25603 be Remote Procedure Call based services. 25604 25605 protocol 25606 25607 The name of a protocol. The name should be one of those listed 25608 in /etc/protocols. If this attribute is not specified (i.e. a 25609 null value is passed), the system should use an implementation 25610 defined default protocol. 25611 socket_type 25612 25613 One of the following values: 25614 25615 stream 25616 25617 the service will use a stream type socket. 25618 dgram 25619 25620 the service will use a datagram type socket. 25621 seqpacket 25622 25623 the service will use a sequenced packet type socket. 25624 This field is not required for the -c, --check, -r, or 25625 --remove options. 25626 wait_flag 25627 25628 If the value of this attribute is wait, once the service is 25629 started, no further requests for that service will be handled 25630 until the service exits. If the value is nowait, the network 25631 super daemon should continue to handle further requests for 25632 the given service while that service is running. 25633 25634 Note: If the service has the socket_type attribute set to 25635 dgram, the wait_flag attribute should be set to wait, since 25636 such services do not have any distinction between the 25637 socket used for listening and that used for accepting. 25638 25639 This field is not required for the -c, --check, -r, or 25640 --remove options. 25641 user[.group] 25642 25643 The name of a user from the user login database, optionally 25644 followed by the name of a group from the group database. The 25645 service started to handle this request should run with the 25646 privileges of the specified user and group. This field is not 25647 required for the -c, --check, -r, or --remove options. 25648 server [arg ...] 25649 25650 The name of a program to run to handle the request, optionally 25651 followed by any arguments required. The server name and each 25652 of its arguments is separated by whitespace. This field is not 25653 required for the -c, --check, -r, or --remove options. 25654 If the implementation supports additional controls over 25655 services started through the inet super daemon, there may be 25656 additional, implementation-defined, operands. 25657 25658 Rationale: Systems that use the xinetd super daemon may 25659 support additional controls such as IP address 25660 restrictions, logging requirements, etc. The LSB does not 25661 require these additional controls. However, it was believed 25662 to be of sufficient benefit that implementations are 25663 granted permission to extend this interface as required. 25664 25665 Examples 25666 25667 lsbinstall --package=myapp --type=profile myco.com-prod.sh 25668 25669 Install the profile shell script for myco.com-prod.sh, part of 25670 the myapp package.. 25671 lsbinstall --package=myapp --check --type=profile myco.com-prod.sh 25672 25673 Test to see if the profile shell script for myco.com-prod.sh, 25674 as part of the myapp package, is installed correctly. 25675 25676 Exit Status 25677 25678 If the -c or --check option is specified, lsbinstall should 25679 exit with a zero status if an object of the specified type and 25680 name is already installed, or non-zero otherwise. Otherwise, 25681 lsbinstall should exit with a zero status if the object with 25682 the specified type and name was successfully installed (or 25683 removed if the -r or --remove option was specified), and 25684 non-zero if the installation (or removal) failed. On failure, 25685 a diagnostic message should be printed to the standard error 25686 file descriptor. 25687 _________________________________________________________ 25688 25689 Appendix C. GNU Free Documentation License (Informative) 25690 25691 This specification is published under the terms of the GNU 25692 Free Documentation License, Version 1.1, March 2000 25693 25694 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 25695 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 25696 permitted to copy and distribute verbatim copies of this 25697 license document, but changing it is not allowed. 25698 _________________________________________________________ 25699 25700 C.1. PREAMBLE 25701 25702 The purpose of this License is to make a manual, textbook, or 25703 other written document "free" in the sense of freedom: to 25704 assure everyone the effective freedom to copy and redistribute 25705 it, with or without modifying it, either commercially or 25706 noncommercially. Secondarily, this License preserves for the 25707 author and publisher a way to get credit for their work, while 25708 not being considered responsible for modifications made by 25709 others. 25710 25711 This License is a kind of "copyleft", which means that 25712 derivative works of the document must themselves be free in 25713 the same sense. It complements the GNU General Public License, 25714 which is a copyleft license designed for free software. 25715 25716 We have designed this License in order to use it for manuals 25717 for free software, because free software needs free 25718 documentation: a free program should come with manuals 25719 providing the same freedoms that the software does. But this 25720 License is not limited to software manuals; it can be used for 25721 any textual work, regardless of subject matter or whether it 25722 is published as a printed book. We recommend this License 25723 principally for works whose purpose is instruction or 25724 reference. 25725 _________________________________________________________ 25726 25727 C.2. APPLICABILITY AND DEFINITIONS 25728 25729 This License applies to any manual or other work that contains 25730 a notice placed by the copyright holder saying it can be 25731 distributed under the terms of this License. The "Document", 25732 below, refers to any such manual or work. Any member of the 25733 public is a licensee, and is addressed as "you". 25734 25735 A "Modified Version" of the Document means any work containing 25736 the Document or a portion of it, either copied verbatim, or 25737 with modifications and/or translated into another language. 25738 25739 A "Secondary Section" is a named appendix or a front-matter 25740 section of the Document that deals exclusively with the 25741 relationship of the publishers or authors of the Document to 25742 the Document's overall subject (or to related matters) and 25743 contains nothing that could fall directly within that overall 25744 subject. (For example, if the Document is in part a textbook 25745 of mathematics, a Secondary Section may not explain any 25746 mathematics.) The relationship could be a matter of historical 25747 connection with the subject or with related matters, or of 25748 legal, commercial, philosophical, ethical or political 25749 position regarding them. 25750 25751 The "Invariant Sections" are certain Secondary Sections whose 25752 titles are designated, as being those of Invariant Sections, 25753 in the notice that says that the Document is released under 25754 this License. 25755 25756 The "Cover Texts" are certain short passages of text that are 25757 listed, as Front-Cover Texts or Back-Cover Texts, in the 25758 notice that says that the Document is released under this 25759 License. 25760 25761 A "Transparent" copy of the Document means a machine-readable 25762 copy, represented in a format whose specification is available 25763 to the general public, whose contents can be viewed and edited 25764 directly and straightforwardly with generic text editors or 25765 (for images composed of pixels) generic paint programs or (for 25766 drawings) some widely available drawing editor, and that is 25767 suitable for input to text formatters or for automatic 25768 translation to a variety of formats suitable for input to text 25769 formatters. A copy made in an otherwise Transparent file 25770 format whose markup has been designed to thwart or discourage 25771 subsequent modification by readers is not Transparent. A copy 25772 that is not "Transparent" is called "Opaque". 25773 25774 Examples of suitable formats for Transparent copies include 25775 plain ASCII without markup, Texinfo input format, LaTeX input 25776 format, SGML or XML using a publicly available DTD, and 25777 standard-conforming simple HTML designed for human 25778 modification. Opaque formats include PostScript, PDF, 25779 proprietary formats that can be read and edited only by 25780 proprietary word processors, SGML or XML for which the DTD 25781 and/or processing tools are not generally available, and the 25782 machine-generated HTML produced by some word processors for 25783 output purposes only. 25784 25785 The "Title Page" means, for a printed book, the title page 25786 itself, plus such following pages as are needed to hold, 25787 legibly, the material this License requires to appear in the 25788 title page. For works in formats which do not have any title 25789 page as such, "Title Page" means the text near the most 25790 prominent appearance of the work's title, preceding the 25791 beginning of the body of the text. 25792 _________________________________________________________ 25793 25794 C.3. VERBATIM COPYING 25795 25796 You may copy and distribute the Document in any medium, either 25797 commercially or noncommercially, provided that this License, 25798 the copyright notices, and the license notice saying this 25799 License applies to the Document are reproduced in all copies, 25800 and that you add no other conditions whatsoever to those of 25801 this License. You may not use technical measures to obstruct 25802 or control the reading or further copying of the copies you 25803 make or distribute. However, you may accept compensation in 25804 exchange for copies. If you distribute a large enough number 25805 of copies you must also follow the conditions in section 3. 25806 25807 You may also lend copies, under the same conditions stated 25808 above, and you may publicly display copies. 25809 _________________________________________________________ 25810 25811 C.4. COPYING IN QUANTITY 25812 25813 If you publish printed copies of the Document numbering more 25814 than 100, and the Document's license notice requires Cover 25815 Texts, you must enclose the copies in covers that carry, 25816 clearly and legibly, all these Cover Texts: Front-Cover Texts 25817 on the front cover, and Back-Cover Texts on the back cover. 25818 Both covers must also clearly and legibly identify you as the 25819 publisher of these copies. The front cover must present the 25820 full title with all words of the title equally prominent and 25821 visible. You may add other material on the covers in addition. 25822 Copying with changes limited to the covers, as long as they 25823 preserve the title of the Document and satisfy these 25824 conditions, can be treated as verbatim copying in other 25825 respects. 25826 25827 If the required texts for either cover are too voluminous to 25828 fit legibly, you should put the first ones listed (as many as 25829 fit reasonably) on the actual cover, and continue the rest 25830 onto adjacent pages. 25831 25832 If you publish or distribute Opaque copies of the Document 25833 numbering more than 100, you must either include a 25834 machine-readable Transparent copy along with each Opaque copy, 25835 or state in or with each Opaque copy a publicly-accessible 25836 computer-network location containing a complete Transparent 25837 copy of the Document, free of added material, which the 25838 general network-using public has access to download 25839 anonymously at no charge using public-standard network 25840 protocols. If you use the latter option, you must take 25841 reasonably prudent steps, when you begin distribution of 25842 Opaque copies in quantity, to ensure that this Transparent 25843 copy will remain thus accessible at the stated location until 25844 at least one year after the last time you distribute an Opaque 25845 copy (directly or through your agents or retailers) of that 25846 edition to the public. 25847 25848 It is requested, but not required, that you contact the 25849 authors of the Document well before redistributing any large 25850 number of copies, to give them a chance to provide you with an 25851 updated version of the Document. 25852 _________________________________________________________ 25853 25854 C.5. MODIFICATIONS 25855 25856 You may copy and distribute a Modified Version of the Document 25857 under the conditions of sections 2 and 3 above, provided that 25858 you release the Modified Version under precisely this License, 25859 with the Modified Version filling the role of the Document, 25860 thus licensing distribution and modification of the Modified 25861 Version to whoever possesses a copy of it. In addition, you 25862 must do these things in the Modified Version: 25863 25864 A. Use in the Title Page (and on the covers, if any) a title 25865 distinct from that of the Document, and from those of 25866 previous versions (which should, if there were any, be 25867 listed in the History section of the Document). You may 25868 use the same title as a previous version if the original 25869 publisher of that version gives permission. 25870 B. List on the Title Page, as authors, one or more persons or 25871 entities responsible for authorship of the modifications 25872 in the Modified Version, together with at least five of 25873 the principal authors of the Document (all of its 25874 principal authors, if it has less than five). 25875 C. State on the Title page the name of the publisher of the 25876 Modified Version, as the publisher. 25877 D. Preserve all the copyright notices of the Document. 25878 E. Add an appropriate copyright notice for your modifications 25879 adjacent to the other copyright notices. 25880 F. Include, immediately after the copyright notices, a 25881 license notice giving the public permission to use the 25882 Modified Version under the terms of this License, in the 25883 form shown in the Addendum below. 25884 G. Preserve in that license notice the full lists of 25885 Invariant Sections and required Cover Texts given in the 25886 Document's license notice. 25887 H. Include an unaltered copy of this License. 25888 I. Preserve the section entitled "History", and its title, 25889 and add to it an item stating at least the title, year, 25890 new authors, and publisher of the Modified Version as 25891 given on the Title Page. If there is no section entitled 25892 "History" in the Document, create one stating the title, 25893 year, authors, and publisher of the Document as given on 25894 its Title Page, then add an item describing the Modified 25895 Version as stated in the previous sentence. 25896 J. Preserve the network location, if any, given in the 25897 Document for public access to a Transparent copy of the 25898 Document, and likewise the network locations given in the 25899 Document for previous versions it was based on. These may 25900 be placed in the "History" section. You may omit a network 25901 location for a work that was published at least four years 25902 before the Document itself, or if the original publisher 25903 of the version it refers to gives permission. 25904 K. In any section entitled "Acknowledgements" or 25905 "Dedications", preserve the section's title, and preserve 25906 in the section all the substance and tone of each of the 25907 contributor acknowledgements and/or dedications given 25908 therein. 25909 L. Preserve all the Invariant Sections of the Document, 25910 unaltered in their text and in their titles. Section 25911 numbers or the equivalent are not considered part of the 25912 section titles. 25913 M. Delete any section entitled "Endorsements". Such a section 25914 may not be included in the Modified Version. 25915 N. Do not retitle any existing section as "Endorsements" or 25916 to conflict in title with any Invariant Section. 25917 25918 If the Modified Version includes new front-matter sections or 25919 appendices that qualify as Secondary Sections and contain no 25920 material copied from the Document, you may at your option 25921 designate some or all of these sections as invariant. To do 25922 this, add their titles to the list of Invariant Sections in 25923 the Modified Version's license notice. These titles must be 25924 distinct from any other section titles. 25925 25926 You may add a section entitled "Endorsements", provided it 25927 contains nothing but endorsements of your Modified Version by 25928 various parties--for example, statements of peer review or 25929 that the text has been approved by an organization as the 25930 authoritative definition of a standard. 25931 25932 You may add a passage of up to five words as a Front-Cover 25933 Text, and a passage of up to 25 words as a Back-Cover Text, to 25934 the end of the list of Cover Texts in the Modified Version. 25935 Only one passage of Front-Cover Text and one of Back-Cover 25936 Text may be added by (or through arrangements made by) any one 25937 entity. If the Document already includes a cover text for the 25938 same cover, previously added by you or by arrangement made by 25939 the same entity you are acting on behalf of, you may not add 25940 another; but you may replace the old one, on explicit 25941 permission from the previous publisher that added the old one. 25942 25943 The author(s) and publisher(s) of the Document do not by this 25944 License give permission to use their names for publicity for 25945 or to assert or imply endorsement of any Modified Version. 25946 _________________________________________________________ 25947 25948 C.6. COMBINING DOCUMENTS 25949 25950 You may combine the Document with other documents released 25951 under this License, under the terms defined in section 4 above 25952 for modified versions, provided that you include in the 25953 combination all of the Invariant Sections of all of the 25954 original documents, unmodified, and list them all as Invariant 25955 Sections of your combined work in its license notice. 25956 25957 The combined work need only contain one copy of this License, 25958 and multiple identical Invariant Sections may be replaced with 25959 a single copy. If there are multiple Invariant Sections with 25960 the same name but different contents, make the title of each 25961 such section unique by adding at the end of it, in 25962 parentheses, the name of the original author or publisher of 25963 that section if known, or else a unique number. Make the same 25964 adjustment to the section titles in the list of Invariant 25965 Sections in the license notice of the combined work. 25966 25967 In the combination, you must combine any sections entitled 25968 "History" in the various original documents, forming one 25969 section entitled "History"; likewise combine any sections 25970 entitled "Acknowledgements", and any sections entitled 25971 "Dedications". You must delete all sections entitled 25972 "Endorsements." 25973 _________________________________________________________ 25974 25975 C.7. COLLECTIONS OF DOCUMENTS 25976 25977 You may make a collection consisting of the Document and other 25978 documents released under this License, and replace the 25979 individual copies of this License in the various documents 25980 with a single copy that is included in the collection, 25981 provided that you follow the rules of this License for 25982 verbatim copying of each of the documents in all other 25983 respects. 25984 25985 You may extract a single document from such a collection, and 25986 distribute it individually under this License, provided you 25987 insert a copy of this License into the extracted document, and 25988 follow this License in all other respects regarding verbatim 25989 copying of that document. 25990 _________________________________________________________ 25991 25992 C.8. AGGREGATION WITH INDEPENDENT WORKS 25993 25994 A compilation of the Document or its derivatives with other 25995 separate and independent documents or works, in or on a volume 25996 of a storage or distribution medium, does not as a whole count 25997 as a Modified Version of the Document, provided no compilation 25998 copyright is claimed for the compilation. Such a compilation 25999 is called an "aggregate", and this License does not apply to 26000 the other self-contained works thus compiled with the 26001 Document, on account of their being thus compiled, if they are 26002 not themselves derivative works of the Document. 26003 26004 If the Cover Text requirement of section 3 is applicable to 26005 these copies of the Document, then if the Document is less 26006 than one quarter of the entire aggregate, the Document's Cover 26007 Texts may be placed on covers that surround only the Document 26008 within the aggregate. Otherwise they must appear on covers 26009 around the whole aggregate. 26010 _________________________________________________________ 26011 26012 C.9. TRANSLATION 26013 26014 Translation is considered a kind of modification, so you may 26015 distribute translations of the Document under the terms of 26016 section 4. Replacing Invariant Sections with translations 26017 requires special permission from their copyright holders, but 26018 you may include translations of some or all Invariant Sections 26019 in addition to the original versions of these Invariant 26020 Sections. You may include a translation of this License 26021 provided that you also include the original English version of 26022 this License. In case of a disagreement between the 26023 translation and the original English version of this License, 26024 the original English version will prevail. 26025 _________________________________________________________ 26026 26027 C.10. TERMINATION 26028 26029 You may not copy, modify, sublicense, or distribute the 26030 Document except as expressly provided for under this License. 26031 Any other attempt to copy, modify, sublicense or distribute 26032 the Document is void, and will automatically terminate your 26033 rights under this License. However, parties who have received 26034 copies, or rights, from you under this License will not have 26035 their licenses terminated so long as such parties remain in 26036 full compliance. 26037 _________________________________________________________ 26038 26039 C.11. FUTURE REVISIONS OF THIS LICENSE 26040 26041 The Free Software Foundation may publish new, revised versions 26042 of the GNU Free Documentation License from time to time. Such 26043 new versions will be similar in spirit to the present version, 26044 but may differ in detail to address new problems or concerns. 26045 See http://www.gnu.org/copyleft/. 26046 26047 Each version of the License is given a distinguishing version 26048 number. If the Document specifies that a particular numbered 26049 version of this License "or any later version" applies to it, 26050 you have the option of following the terms and conditions 26051 either of that specified version or of any later version that 26052 has been published (not as a draft) by the Free Software 26053 Foundation. If the Document does not specify a version number 26054 of this License, you may choose any version ever published 26055 (not as a draft) by the Free Software Foundation. 26056 _________________________________________________________ 26057 26058 C.12. How to use this License for your documents 26059 26060 To use this License in a document you have written, include a 26061 copy of the License in the document and put the following 26062 copyright and license notices just after the title page: 26063 26064 Copyright (c) YEAR YOUR NAME. Permission is granted to 26065 copy, distribute and/or modify this document under the 26066 terms of the GNU Free Documentation License, Version 1.1 or 26067 any later version published by the Free Software 26068 Foundation; with the Invariant Sections being LIST THEIR 26069 TITLES, with the Front-Cover Texts being LIST, and with the 26070 Back-Cover Texts being LIST. A copy of the license is 26071 included in the section entitled "GNU Free Documentation 26072 License". 26073 26074 If you have no Invariant Sections, write "with no Invariant 26075 Sections" instead of saying which ones are invariant. If you 26076 have no Front-Cover Texts, write "no Front-Cover Texts" 26077 instead of "Front-Cover Texts being LIST"; likewise for 26078 Back-Cover Texts. 26079 26080 If your document contains nontrivial examples of program code, 26081 we recommend releasing these examples in parallel under your 26082 choice of free software license, such as the GNU General 26083 Public License, to permit their use in free software.