1 2 Linux Standard Base Core Specification 3.1 3 4 Copyright © 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 the registered trademark of Linus Torvalds in the 28 U.S. and other countries. 29 30 UNIX is a registered trademark of The Open Group. 31 32 LSB is a trademark of the Free Standards Group in the United 33 States and 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 trademark of Intel Corporation. 39 40 PowerPC is a registered trademark and PowerPC Architecture is 41 a trademark of the IBM Corporation. 42 43 S/390 is a registered trademark of the IBM Corporation. 44 45 OpenGL is a registered trademark of Silicon Graphics, Inc. 46 _________________________________________________________ 47 48 Table of Contents 49 Foreword 50 Introduction 51 I. Introductory Elements 52 53 1. Scope 54 55 1.1. General 56 1.2. Module Specific Scope 57 58 2. References 59 60 2.1. Normative References 61 2.2. Informative References/Bibliography 62 63 3. Requirements 64 65 3.1. Relevant Libraries 66 3.2. LSB Implementation Conformance 67 3.3. LSB Application Conformance 68 69 4. Definitions 70 5. Terminology 71 6. Documentation Conventions 72 7. Relationship To ISO/IEC 9945 POSIX 73 8. Relationship To Other Free Standards Group 74 Specifications 75 76 II. Executable And Linking Format (ELF) 77 78 9. Introduction 79 10. Low Level System Information 80 81 10.1. Operating System Interface 82 10.2. Machine Interface 83 84 11. Object Format 85 86 11.1. Object Files 87 11.2. Sections 88 11.3. Special Sections 89 11.4. Symbol Mapping 90 11.5. DWARF Extensions 91 11.6. Exception Frames 92 11.7. Symbol Versioning 93 11.8. ABI note tag 94 95 12. Dynamic Linking 96 97 12.1. Program Loading and Dynamic Linking 98 12.2. Program Header 99 12.3. Dynamic Entries 100 101 III. Base Libraries 102 103 13. Base Libraries 104 105 13.1. Introduction 106 13.2. Program Interpreter 107 13.3. Interfaces for libc 108 13.4. Data Definitions for libc 109 13.5. Interface Definitions for libc 110 13.6. Interfaces for libm 111 13.7. Data Definitions for libm 112 13.8. Interface Definitions for libm 113 13.9. Interfaces for libpthread 114 13.10. Data Definitions for libpthread 115 13.11. Interface Definitions for libpthread 116 13.12. Interfaces for libgcc_s 117 13.13. Data Definitions for libgcc_s 118 13.14. Interfaces for libdl 119 13.15. Data Definitions for libdl 120 13.16. Interface Definitions for libdl 121 13.17. Interfaces for librt 122 13.18. Interfaces for libcrypt 123 13.19. Interfaces for libpam 124 13.20. Data Definitions for libpam 125 13.21. Interface Definitions for libpam 126 127 IV. Utility Libraries 128 129 14. Utility Libraries 130 131 14.1. Introduction 132 14.2. Interfaces for libz 133 14.3. Data Definitions for libz 134 14.4. Interface Definitions for libz 135 14.5. Interfaces for libncurses 136 14.6. Data Definitions for libncurses 137 14.7. Interfaces for libutil 138 14.8. Interface Definitions for libutil 139 140 V. Commands and Utilities 141 142 15. Commands and Utilities 143 144 15.1. Commands and Utilities 145 15.2. Command Behavior 146 147 VI. Execution Environment 148 149 16. File System Hierarchy 150 151 16.1. /dev: Device Files 152 16.2. /etc: Host-specific system configuration 153 16.3. User Accounting Databases 154 16.4. Path For System Administration Utilities 155 156 17. Additional Recommendations 157 158 17.1. Recommendations for applications on ownership 159 and permissions 160 161 18. Additional Behaviors 162 163 18.1. Mandatory Optional Behaviors 164 165 19. Localization 166 167 19.1. Introduction 168 19.2. Regular Expressions 169 19.3. Pattern Matching Notation 170 171 VII. System Initialization 172 173 20. System Initialization 174 175 20.1. Cron Jobs 176 20.2. Init Script Actions 177 20.3. Comment Conventions for Init Scripts 178 20.4. Installation and Removal of Init Scripts 179 20.5. Run Levels 180 20.6. Facility Names 181 20.7. Script Names 182 20.8. Init Script Functions 183 184 VIII. Users & Groups 185 186 21. Users & Groups 187 188 21.1. User and Group Database 189 21.2. User & Group Names 190 21.3. User ID Ranges 191 21.4. Rationale 192 193 IX. Package Format and Installation 194 195 22. Software Installation 196 197 22.1. Introduction 198 22.2. Package File Format 199 22.3. Package Script Restrictions 200 22.4. Package Tools 201 22.5. Package Naming 202 22.6. Package Dependencies 203 22.7. Package Architecture Considerations 204 205 A. Alphabetical Listing of Interfaces 206 207 A.1. libc 208 A.2. libcrypt 209 A.3. libdl 210 A.4. libm 211 A.5. libncurses 212 A.6. libpam 213 A.7. libpthread 214 A.8. librt 215 A.9. libutil 216 A.10. libz 217 218 B. Future Directions (Informative) 219 220 B.1. Introduction 221 B.2. Commands And Utilities 222 223 lsbinstall -- installation tool for various types 224 of data 225 226 C. GNU Free Documentation License (Informative) 227 228 C.1. PREAMBLE 229 C.2. APPLICABILITY AND DEFINITIONS 230 C.3. VERBATIM COPYING 231 C.4. COPYING IN QUANTITY 232 C.5. MODIFICATIONS 233 C.6. COMBINING DOCUMENTS 234 C.7. COLLECTIONS OF DOCUMENTS 235 C.8. AGGREGATION WITH INDEPENDENT WORKS 236 C.9. TRANSLATION 237 C.10. TERMINATION 238 C.11. FUTURE REVISIONS OF THIS LICENSE 239 C.12. How to use this License for your documents 240 241 List of Figures 242 11-1. Version Definition Entries 243 11-2. Version Definition Auxiliary Entries 244 11-3. Version Needed Entries 245 11-4. Version Needed Auxiliary Entries 246 12-1. Dynamic Structure 247 248 List of Tables 249 2-1. Normative References 250 2-2. Other References 251 3-1. Standard Library Names 252 3-2. Standard Library Names defined in the Architecture 253 Specific Parts of ISO/IEC 23360 254 255 10-1. Scalar Types 256 11-1. ELF Section Types 257 11-2. Additional Section Types 258 11-3. ELF Special Sections 259 11-4. Additional Special Sections 260 11-5. DWARF Exception Header value format 261 11-6. DWARF Exception Header application 262 11-7. Additional DWARF Call Frame Instructions 263 11-8. Call Frame Information Format 264 11-9. Common Information Entry Format 265 11-10. Frame Description Entry Format 266 11-11. .eh_frame_hdr Section Format 267 12-1. Linux Segment Types 268 13-1. libc Definition 269 13-2. libc - RPC Function Interfaces 270 13-3. libc - System Calls Function Interfaces 271 13-4. libc - Standard I/O Function Interfaces 272 13-5. libc - Standard I/O Data Interfaces 273 13-6. libc - Signal Handling Function Interfaces 274 13-7. libc - Signal Handling Data Interfaces 275 13-8. libc - Localization Functions Function Interfaces 276 13-9. libc - Localization Functions Data Interfaces 277 13-10. libc - Socket Interface Function Interfaces 278 13-11. libc - Wide Characters Function Interfaces 279 13-12. libc - String Functions Function Interfaces 280 13-13. libc - IPC Functions Function Interfaces 281 13-14. libc - Regular Expressions Function Interfaces 282 13-15. libc - Character Type Functions Function Interfaces 283 13-16. libc - Time Manipulation Function Interfaces 284 13-17. libc - Time Manipulation Data Interfaces 285 13-18. libc - Terminal Interface Functions Function Interfaces 286 13-19. libc - System Database Interface Function Interfaces 287 13-20. libc - Language Support Function Interfaces 288 13-21. libc - Large File Support Function Interfaces 289 13-22. libc - Standard Library Function Interfaces 290 13-23. libc - Standard Library Data Interfaces 291 13-24. libm Definition 292 13-25. libm - Math Function Interfaces 293 13-26. libm - Math Data Interfaces 294 13-27. libpthread Definition 295 13-28. libpthread - Realtime Threads Function Interfaces 296 13-29. libpthread - Posix Threads Function Interfaces 297 13-30. libpthread - Thread aware versions of libc interfaces 298 Function Interfaces 299 300 13-31. libgcc_s Definition 301 13-32. libdl Definition 302 13-33. libdl - Dynamic Loader Function Interfaces 303 13-34. librt Definition 304 13-35. librt - Shared Memory Objects Function Interfaces 305 13-36. librt - Clock Function Interfaces 306 13-37. librt - Timers Function Interfaces 307 13-38. libcrypt Definition 308 13-39. libcrypt - Encryption Function Interfaces 309 13-40. libpam Definition 310 13-41. libpam - Pluggable Authentication API Function 311 Interfaces 312 313 14-1. libz Definition 314 14-2. libz - Compression Library Function Interfaces 315 14-3. libncurses Definition 316 14-4. libncurses - Curses Function Interfaces 317 14-5. libncurses - Curses Data Interfaces 318 14-6. libutil Definition 319 14-7. libutil - Utility Functions Function Interfaces 320 15-1. Commands And Utilities 321 15-2. Built In Utilities 322 15-1. Escape Sequences 323 21-1. Required User & Group Names 324 21-2. Optional User & Group Names 325 22-1. RPM File Format 326 22-2. Signature Format 327 22-3. Index Type values 328 22-4. Header Private Tag Values 329 22-5. Signature Tag Values 330 22-6. Signature Digest Tag Values 331 22-7. Signature Signing Tag Values 332 22-8. Package Info Tag Values 333 22-9. Installation Tag Values 334 22-10. File Info Tag Values 335 22-11. File Flags 336 22-12. Package Dependency Tag Values 337 22-13. Index Type values 338 22-14. Package Dependency Attributes 339 22-15. Other Tag Values 340 22-16. CPIO File Format 341 A-1. libc Function Interfaces 342 A-2. libc Data Interfaces 343 A-3. libcrypt Function Interfaces 344 A-4. libdl Function Interfaces 345 A-5. libm Function Interfaces 346 A-6. libm Data Interfaces 347 A-7. libncurses Function Interfaces 348 A-8. libncurses Data Interfaces 349 A-9. libpam Function Interfaces 350 A-10. libpthread Function Interfaces 351 A-11. librt Function Interfaces 352 A-12. libutil Function Interfaces 353 A-13. libz Function Interfaces 354 _________________________________________________________ 355 356 Foreword 357 358 This is version 3.1 of the Linux Standard Base Core 359 Specification. This specification is part of a family of 360 specifications under the general title "Linux Standard Base". 361 Developers of applications or implementations interested in 362 using the LSB trademark should see the Free Standards Group 363 Certification Policy for details. 364 _________________________________________________________ 365 366 Introduction 367 368 The LSB defines a binary interface for application programs 369 that are compiled and packaged for LSB-conforming 370 implementations on many different hardware architectures. 371 Since a binary specification shall include information 372 specific to the computer processor architecture for which it 373 is intended, it is not possible for a single document to 374 specify the interface for all possible LSB-conforming 375 implementations. Therefore, the LSB is a family of 376 specifications, rather than a single one. 377 378 This document should be used in conjunction with the documents 379 it references. This document enumerates the system components 380 it includes, but descriptions of those components may be 381 included entirely or partly in this document, partly in other 382 documents, or entirely in other reference documents. For 383 example, the section that describes system service routines 384 includes a list of the system routines supported in this 385 interface, formal declarations of the data structures they use 386 that are visible to applications, and a pointer to the 387 underlying referenced specification for information about the 388 syntax and semantics of each call. Only those routines not 389 described in standards referenced by this document, or 390 extensions to those standards, are described in the detail. 391 Information referenced in this way is as much a part of this 392 document as is the information explicitly included here. 393 394 The specification carries a version number of either the form 395 x.y or x.y.z. This version number carries the following 396 meaning: 397 398 * The first number (x) is the major version number. All 399 versions with the same major version number should share 400 binary compatibility. Any addition or deletion of a new 401 library results in a new version number. Interfaces marked 402 as deprecated may be removed from the specification at a 403 major version change. 404 * The second number (y) is the minor version number. 405 Individual interfaces may be added if all certified 406 implementations already had that (previously undocumented) 407 interface. Interfaces may be marked as deprecated at a 408 minor version change. Other minor changes may be permitted 409 at the discretion of the LSB workgroup. 410 * The third number (z), if present, is the editorial level. 411 Only editorial changes should be included in such 412 versions. 413 414 Since this specification is a descriptive Application Binary 415 Interface, and not a source level API specification, it is not 416 possible to make a guarantee of 100% backward compatibility 417 between major releases. However, it is the intent that those 418 parts of the binary interface that are visible in the source 419 level API will remain backward compatible from version to 420 version, except where a feature marked as "Deprecated" in one 421 release may be removed from a future release. 422 423 Implementors are strongly encouraged to make use of symbol 424 versioning to permit simultaneous support of applications 425 conforming to different releases of this specification. 426 427 I. Introductory Elements 428 429 Table of Contents 430 1. Scope 431 432 1.1. General 433 1.2. Module Specific Scope 434 435 2. References 436 437 2.1. Normative References 438 2.2. Informative References/Bibliography 439 440 3. Requirements 441 442 3.1. Relevant Libraries 443 3.2. LSB Implementation Conformance 444 3.3. LSB Application Conformance 445 446 4. Definitions 447 5. Terminology 448 6. Documentation Conventions 449 7. Relationship To ISO/IEC 9945 POSIX 450 8. Relationship To Other Free Standards Group Specifications 451 _________________________________________________________ 452 453 Chapter 1. Scope 454 455 1.1. General 456 457 The Linux Standard Base (LSB) defines a system interface for 458 compiled applications and a minimal environment for support of 459 installation scripts. Its purpose is to enable a uniform 460 industry standard environment for high-volume applications 461 conforming to the LSB. 462 463 These specifications are composed of two basic parts: A common 464 specification ("LSB-generic" or "generic LSB"), ISO/IEC 23360 465 Part 1, describing those parts of the interface that remain 466 constant across all implementations of the LSB, and an 467 architecture-specific part ("LSB-arch" or "archLSB") 468 describing the parts of the interface that vary by processor 469 architecture. Together, the LSB-generic and the relevant 470 architecture-specific part of ISO/IEC 23360 for a single 471 hardware architecture provide a complete interface 472 specification for compiled application programs on systems 473 that share a common hardware architecture. 474 475 ISO/IEC 23360 Part 1, the LSB-generic document, should be used 476 in conjunction with an architecture-specific part. Whenever a 477 section of the LSB-generic specification is supplemented by 478 architecture-specific information, the LSB-generic document 479 includes a reference to the architecture part. 480 Architecture-specific parts of ISO/IEC 23360 may also contain 481 additional information that is not referenced in the 482 LSB-generic document. 483 484 The LSB contains both a set of Application Program Interfaces 485 (APIs) and Application Binary Interfaces (ABIs). APIs may 486 appear in the source code of portable applications, while the 487 compiled binary of that application may use the larger set of 488 ABIs. A conforming implementation provides all of the ABIs 489 listed here. The compilation system may replace (e.g. by macro 490 definition) certain APIs with calls to one or more of the 491 underlying binary interfaces, and may insert calls to binary 492 interfaces as needed. 493 494 The LSB is primarily a binary interface definition. Not all of 495 the source level APIs available to applications may be 496 contained in this specification. 497 _________________________________________________________ 498 499 1.2. Module Specific Scope 500 501 This is the Core module of the Linux Standard Base (LSB), 502 ISO/IEC 23360 Part 1. This module provides the fundamental 503 system interfaces, libraries, and runtime environment upon 504 which all conforming applications and libraries depend. 505 506 Interfaces described in this part of ISO/IEC 23360 are 507 mandatory except where explicitly listed otherwise. Core 508 interfaces may be supplemented by other modules; all modules 509 are built upon the core. 510 _________________________________________________________ 511 512 Chapter 2. References 513 514 2.1. Normative References 515 516 The following referenced documents are indispensable for the 517 application of this document. For dated references, only the 518 edition cited applies. For undated references, the latest 519 edition of the referenced document (including any amendments) 520 applies. 521 522 Note: Where copies of a document are available on the World 523 Wide Web, a Uniform Resource Locator (URL) is given for 524 informative purposes only. This may point to a more recent 525 copy of the referenced specification, or may be out of 526 date. Reference copies of specifications at the revision 527 level indicated may be found at the Free Standards Group's 528 Reference Specifications site. 529 530 Table 2-1. Normative References 531 Name Title URL 532 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 533 (FHS) 2.3 http://www.pathname.com/fhs/ 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(TM) C++ ABI Itanium(TM) 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 SVID Issue 3 American Telephone and Telegraph Company, System 561 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 562 1989.(ISBN 0201566524) 563 SVID Issue 4 System V Interface Definition,Fourth Edition 564 System V ABI System V Application Binary Interface, Edition 565 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 566 System V ABI Update System V Application Binary Interface - 567 DRAFT - 17 December 2003 568 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 569 l 570 X/Open Curses CAE Specification, May 1996, X/Open Curses, 571 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 572 Corrigendum U018 573 http://www.opengroup.org/publications/catalog/un.htm 574 _________________________________________________________ 575 576 2.2. Informative References/Bibliography 577 578 In addition, the specifications listed below provide essential 579 background information to implementors of this specification. 580 These references are included for information only. 581 582 Table 2-2. Other References 583 Name Title URL 584 DWARF Debugging Information Format, Revision 2.0.0 DWARF 585 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 586 http://refspecs.freestandards.org/dwarf/dwarf-2.0.0.pdf 587 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 588 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 589 http://refspecs.freestandards.org/dwarf/ 590 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 591 floating-point arithmetic for microprocessor systems 592 http://www.ieee.org/ 593 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 594 Specification method for cultural conventions 595 ITU-T V.42 International Telecommunication Union 596 Recommendation V.42 (2002): Error-correcting procedures for 597 DCEs using asynchronous-to-synchronous conversionITUV 598 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 599 parent=T-REC-V.42 600 Li18nux Globalization Specification LI18NUX 2000 Globalization 601 Specification, Version 1.0 with Amendment 4 602 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 603 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 604 http://www.lanana.org/docs/device-list/devices.txt 605 PAM Open Software Foundation, Request For Comments: 86.0 , 606 October 1995, V. Samar & R.Schemers (SunSoft) 607 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 608 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 609 MD5 Message-Digest Algorithm 610 http://www.ietf.org/rfc/rfc1321.txt 611 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 612 http://www.ietf.org/ 613 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 614 1833: Binding Protocols for ONC RPC Version 2 615 http://www.ietf.org/rfc/rfc1833.txt 616 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 617 1950: ZLIB Compressed Data Format Specification 618 http://www.ietf.org/rfc/rfc1950.txt 619 RFC 1951: DEFLATE Compressed Data Format Specification IETF 620 RFC 1951: DEFLATE Compressed Data Format Specification version 621 1.3 http://www.ietf.org/rfc/rfc1951.txt 622 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 623 file format specification version 4.3 624 http://www.ietf.org/rfc/rfc1952.txt 625 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 626 Message Format http://www.ietf.org/rfc/rfc2440.txt 627 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 628 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 629 RFC 2822:Internet Message Format IETF RFC 2822: Internet 630 Message Format http://www.ietf.org/rfc/rfc2822.txt 631 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 632 Specification http://www.ietf.org/rfc/rfc791.txt 633 RPM Package Format RPM Package Format V3.0 634 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format. 635 html 636 SUSv2 Commands and Utilities The Single UNIX 637 Specification(SUS) Version 2, Commands and Utilities (XCU), 638 Issue 5 (ISBN: 1-85912-191-8, C604) 639 http://www.opengroup.org/publications/catalog/un.htm 640 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 641 _________________________________________________________ 642 643 Chapter 3. Requirements 644 645 3.1. Relevant Libraries 646 647 The libraries listed in Table 3-1 shall be available on a 648 Linux Standard Base system, with the specified runtime names. 649 The libraries listed in Table 3-2 are architecture specific, 650 but shall be available on all LSB conforming systems. This 651 list may be supplemented or amended by the relevant 652 architecture specific part of ISO/IEC 23360. 653 654 Table 3-1. Standard Library Names 655 Library Runtime Name 656 libdl libdl.so.2 657 libcrypt libcrypt.so.1 658 libz libz.so.1 659 libncurses libncurses.so.5 660 libutil libutil.so.1 661 libpthread libpthread.so.0 662 librt librt.so.1 663 libpam libpam.so.0 664 libgcc_s libgcc_s.so.1 665 666 Table 3-2. Standard Library Names defined in the Architecture 667 Specific Parts of ISO/IEC 23360 668 Library Runtime Name 669 libm See archLSB 670 libc See archLSB 671 proginterp See archLSB 672 673 These libraries will be in an implementation-defined directory 674 which the dynamic linker shall search by default. 675 _________________________________________________________ 676 677 3.2. LSB Implementation Conformance 678 679 A conforming implementation is necessarily architecture 680 specific, and must provide the interfaces specified by both 681 the generic LSB Core specification (ISO/IEC 23360 Part 1) and 682 the relevant architecture specific part of ISO/IEC 23360. 683 684 Rationale: An implementation must provide at least the 685 interfaces specified in these specifications. It may also 686 provide additional interfaces. 687 688 A conforming implementation shall satisfy the following 689 requirements: 690 691 * A processor architecture represents a family of related 692 processors which may not have identical feature sets. The 693 architecture specific parts of ISO/IEC 23360 that 694 supplement this specification for a given target processor 695 architecture describe a minimum acceptable processor. The 696 implementation shall provide all features of this 697 processor, whether in hardware or through emulation 698 transparent to the application. 699 * The implementation shall be capable of executing compiled 700 applications having the format and using the system 701 interfaces described in this document. 702 * The implementation shall provide libraries containing the 703 interfaces specified by this document, and shall provide a 704 dynamic linking mechanism that allows these interfaces to 705 be attached to applications at runtime. All the interfaces 706 shall behave as specified in this document. 707 * The map of virtual memory provided by the implementation 708 shall conform to the requirements of this document. 709 * The implementation's low-level behavior with respect to 710 function call linkage, system traps, signals, and other 711 such activities shall conform to the formats described in 712 this document. 713 * The implementation shall provide all of the mandatory 714 interfaces in their entirety. 715 * The implementation may provide one or more of the optional 716 interfaces. Each optional interface that is provided shall 717 be provided in its entirety. The product documentation 718 shall state which optional interfaces are provided. 719 * The implementation shall provide all files and utilities 720 specified as part of this document in the format defined 721 here and in other referenced documents. All commands and 722 utilities shall behave as required by this document. The 723 implementation shall also provide all mandatory components 724 of an application's runtime environment that are included 725 or referenced in this document. 726 * The implementation, when provided with standard data 727 formats and values at a named interface, shall provide the 728 behavior defined for those values and data formats at that 729 interface. However, a conforming implementation may 730 consist of components which are separately packaged and/or 731 sold. For example, a vendor of a conforming implementation 732 might sell the hardware, operating system, and windowing 733 system as separately packaged items. 734 * The implementation may provide additional interfaces with 735 different names. It may also provide additional behavior 736 corresponding to data values outside the standard ranges, 737 for standard named interfaces. 738 _________________________________________________________ 739 740 3.3. LSB Application Conformance 741 742 A conforming application is necessarily architecture specific, 743 and must conform to both the generic LSB Core specification 744 (ISO/IEC 23360 Part 1)and the relevant architecture specific 745 part of ISO/IEC 23360. 746 747 A conforming application shall satisfy the following 748 requirements: 749 750 * Its executable files shall be either shell scripts or 751 object files in the format defined for the Object File 752 Format system interface. 753 * Its object files shall participate in dynamic linking as 754 defined in the Program Loading and Linking System 755 interface. 756 * It shall employ only the instructions, traps, and other 757 low-level facilities defined in the Low-Level System 758 interface as being for use by applications. 759 * If it requires any optional interface defined in this 760 document in order to be installed or to execute 761 successfully, the requirement for that optional interface 762 shall be stated in the application's documentation. 763 * It shall not use any interface or data format that is not 764 required to be provided by a conforming implementation, 765 unless: 766 + If such an interface or data format is supplied by 767 another application through direct invocation of that 768 application during execution, that application shall 769 be in turn an LSB conforming application. 770 + The use of that interface or data format, as well as 771 its source, shall be identified in the documentation 772 of the application. 773 * It shall not use any values for a named interface that are 774 reserved for vendor extensions. 775 776 A strictly conforming application shall not require or use any 777 interface, facility, or implementation-defined extension that 778 is not defined in this document in order to be installed or to 779 execute successfully. 780 _________________________________________________________ 781 782 Chapter 4. Definitions 783 784 For the purposes of this document, the following definitions, 785 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 786 Edition, apply: 787 788 can 789 790 be able to; there is a possibility of; it is possible to 791 cannot 792 793 be unable to; there is no possibilty of; it is not possible to 794 may 795 796 is permitted; is allowed; is permissible 797 need not 798 799 it is not required that; no...is required 800 shall 801 802 is to; is required to; it is required that; has to; only...is 803 permitted; it is necessary 804 shall not 805 806 is not allowed [permitted] [acceptable] [permissible]; is 807 required to be not; is required that...be not; is not to be 808 should 809 810 it is recommended that; ought to 811 should not 812 813 it is not recommended that; ought not to 814 _________________________________________________________ 815 816 Chapter 5. Terminology 817 818 For the purposes of this document, the following terms apply: 819 820 archLSB 821 The architectural part of the LSB Specification which 822 describes the specific parts of the interface that are 823 platform specific. The archLSB is complementary to the 824 gLSB. 825 826 Binary Standard 827 The total set of interfaces that are available to be 828 used in the compiled binary code of a conforming 829 application. 830 831 gLSB 832 The common part of the LSB Specification that describes 833 those parts of the interface that remain constant 834 across all hardware implementations of the LSB. 835 836 implementation-defined 837 Describes a value or behavior that is not defined by 838 this document but is selected by an implementor. The 839 value or behavior may vary among implementations that 840 conform to this document. An application should not 841 rely on the existence of the value or behavior. An 842 application that relies on such a value or behavior 843 cannot be assured to be portable across conforming 844 implementations. The implementor shall document such a 845 value or behavior so that it can be used correctly by 846 an application. 847 848 Shell Script 849 A file that is read by an interpreter (e.g., awk). The 850 first line of the shell script includes a reference to 851 its interpreter binary. 852 853 Source Standard 854 The set of interfaces that are available to be used in 855 the source code of a conforming application. 856 857 undefined 858 Describes the nature of a value or behavior not defined 859 by this document which results from use of an invalid 860 program construct or invalid data input. The value or 861 behavior may vary among implementations that conform to 862 this document. An application should not rely on the 863 existence or validity of the value or behavior. An 864 application that relies on any particular value or 865 behavior cannot be assured to be portable across 866 conforming implementations. 867 868 unspecified 869 Describes the nature of a value or behavior not 870 specified by this document which results from use of a 871 valid program construct or valid data input. The value 872 or behavior may vary among implementations that conform 873 to this document. An application should not rely on the 874 existence or validity of the value or behavior. An 875 application that relies on any particular value or 876 behavior cannot be assured to be portable across 877 conforming implementations. 878 879 Other terms and definitions used in this document shall have 880 the same meaning as defined in Chapter 3 of the Base 881 Definitions volume of ISO POSIX (2003). 882 _________________________________________________________ 883 884 Chapter 6. Documentation Conventions 885 886 Throughout this document, the following typographic 887 conventions are used: 888 889 function() 890 891 the name of a function 892 command 893 894 the name of a command or utility 895 CONSTANT 896 897 a constant value 898 parameter 899 900 a parameter 901 variable 902 903 a variable 904 905 Throughout this specification, several tables of interfaces 906 are presented. Each entry in these tables has the following 907 format: 908 909 name 910 911 the name of the interface 912 (symver) 913 914 An optional symbol version identifier, if required. 915 [refno] 916 917 A reference number indexing the table of referenced 918 specifications that follows this table. 919 920 For example, 921 922 forkpty(GLIBC_2.0) [SUSv3] 923 924 refers to the interface named forkpty() with symbol version 925 GLIBC_2.0 that is defined in the SUSv3 reference. 926 927 Note: Symbol versions are defined in the architecture 928 specific parts of ISO/IEC 23360 only. 929 _________________________________________________________ 930 931 Chapter 7. Relationship To ISO/IEC 9945 POSIX 932 933 This specification includes many interfaces described in ISO 934 POSIX (2003). Unless otherwise specified, such interfaces 935 should behave exactly as described in that specification. Any 936 conflict between the requirements described here and the ISO 937 POSIX (2003) standard is unintentional, except as explicitly 938 noted otherwise. 939 940 Note: In addition to the differences noted inline in this 941 specification, PDTR 24715 has extracted the differences 942 between this specification and ISO POSIX (2003) into a 943 single place. It is the long term plan of the Free 944 Standards Group to converge the LSB Core Specification with 945 ISO/IEC 9945 POSIX. 946 947 The LSB Specification Authority is responsible for deciding 948 the meaning of conformance to normative referenced standards 949 in the LSB context. Problem Reports regarding underlying or 950 referenced standards in any other context will be referred to 951 the relevant maintenance body for that standard. 952 _________________________________________________________ 953 954 Chapter 8. Relationship To Other Free Standards Group Specifications 955 956 The LSB is the base for several other specification projects 957 under the umbrella of the Free Standards Group (FSG). This 958 specification is the foundation, and other specifications 959 build on the interfaces defined here. However, beyond those 960 specifications listed as Normative References, this 961 specification has no dependencies on other FSG projects. 962 963 II. Executable And Linking Format (ELF) 964 965 Table of Contents 966 9. Introduction 967 10. Low Level System Information 968 969 10.1. Operating System Interface 970 10.2. Machine Interface 971 972 10.2.1. Data Representation 973 974 11. Object Format 975 976 11.1. Object Files 977 11.2. Sections 978 979 11.2.1. Introduction 980 11.2.2. Sections Types 981 982 11.3. Special Sections 983 984 11.3.1. Special Sections 985 986 11.4. Symbol Mapping 987 988 11.4.1. Introduction 989 990 11.5. DWARF Extensions 991 992 11.5.1. DWARF Exception Header Encoding 993 11.5.2. DWARF CFI Extensions 994 995 11.6. Exception Frames 996 997 11.6.1. The .eh_frame section 998 11.6.2. The .eh_frame_hdr section 999 1000 11.7. Symbol Versioning 1001 1002 11.7.1. Introduction 1003 11.7.2. Symbol Version Table 1004 11.7.3. Version Definitions 1005 11.7.4. Version Requirements 1006 11.7.5. Startup Sequence 1007 11.7.6. Symbol Resolution 1008 1009 11.8. ABI note tag 1010 1011 12. Dynamic Linking 1012 1013 12.1. Program Loading and Dynamic Linking 1014 12.2. Program Header 1015 12.3. Dynamic Entries 1016 1017 12.3.1. Introduction 1018 12.3.2. Dynamic Entries 1019 _________________________________________________________ 1020 1021 Chapter 9. Introduction 1022 1023 Executable and Linking Format (ELF) defines the object format 1024 for compiled applications. This specification supplements the 1025 information found in System V ABI Update and is intended to 1026 document additions made since the publication of that 1027 document. 1028 _________________________________________________________ 1029 1030 Chapter 10. Low Level System Information 1031 1032 10.1. Operating System Interface 1033 1034 LSB-conforming applications shall assume that stack, heap and 1035 other allocated memory regions will be non-executable. The 1036 application must take steps to make them executable if needed. 1037 _________________________________________________________ 1038 1039 10.2. Machine Interface 1040 1041 10.2.1. Data Representation 1042 1043 LSB-conforming applications shall use the data representation 1044 as defined in the Arcitecture specific ELF documents. 1045 _________________________________________________________ 1046 1047 10.2.1.1. Fundamental Types 1048 1049 In addition to the fundamental types specified in the relevant 1050 architecture specific part of ISO/IEC 23360, a 1 byte data 1051 type is defined here. 1052 1053 Table 10-1. Scalar Types 1054 Type C C++ sizeof Alignment (bytes) Architecture 1055 Representation 1056 Integral _Bool bool 1 1 byte 1057 _________________________________________________________ 1058 1059 Chapter 11. Object Format 1060 1061 11.1. Object Files 1062 1063 LSB-conforming implementations shall support the object file 1064 Executable and Linking Format (ELF), which is defined by the 1065 following documents: 1066 1067 * System V ABI 1068 * System V ABI Update 1069 * this specification 1070 * the relevant architecture specific part of ISO/IEC 23360 1071 1072 Conforming implementations may also support other unspecified 1073 object file formats. 1074 _________________________________________________________ 1075 1076 11.2. Sections 1077 1078 11.2.1. Introduction 1079 1080 As described in System V ABI, an ELF object file contains a 1081 number of sections. 1082 _________________________________________________________ 1083 1084 11.2.2. Sections Types 1085 1086 The section header table is an array of Elf32_Shdr or 1087 Elf64_Shdr structures as described in System V ABI. The 1088 sh_type member shall be either a value from Table 11-1, drawn 1089 from the System V ABI, or one of the additional values 1090 specified in Table 11-2. 1091 1092 A section header's sh_type member specifies the sections's 1093 semantics. 1094 _________________________________________________________ 1095 1096 11.2.2.1. ELF Section Types 1097 1098 The following section types are defined in the System V ABI 1099 and the System V ABI Update. 1100 1101 Table 11-1. ELF Section Types 1102 Name Value Description 1103 SHT_DYNAMIC 0x6 The section holds information for dynamic 1104 linking. Currently, an object file shall have only one dynamic 1105 section, but this restriction may be relaxed in the future. 1106 See `Dynamic Section' in Chapter 5 for details. 1107 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1108 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1109 an object file may have either a section of SHT_SYMTAB type or 1110 a section of SHT_DYNSYM type, but not both. This restriction 1111 may be relaxed in the future. 1112 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1113 to termination functions, as described in `Initialization and 1114 Termination Functions' in Chapter 5. Each pointer in the array 1115 is taken as a parameterless procedure with a void return. 1116 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1117 an object file shall have only one hash table, but this 1118 restriction may be relaxed in the future. See `Hash Table' in 1119 the Chapter 5 for details. 1120 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1121 to initialization functions, as described in `Initialization 1122 and Termination Functions' in Chapter 5. Each pointer in the 1123 array is taken as a parameterless procedure with a void 1124 return. 1125 SHT_NOBITS 0x8 A section of this type occupies no space in the 1126 file but otherwise resembles SHT_PROGBITS. Although this 1127 section contains no bytes, the sh_offset member contains the 1128 conceptual file offset. 1129 SHT_NOTE 0x7 The section holds information that marks the file 1130 in some way. See `Note Section' in Chapter 5 for details. 1131 SHT_NULL 0x0 This value marks the section header as inactive; 1132 it does not have an associated section. Other members of the 1133 section header have undefined values. 1134 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1135 pointers to functions that are invoked before all other 1136 initialization functions, as described in `Initialization and 1137 Termination Functions' in Chapter 5. Each pointer in the array 1138 is taken as a parameterless proceure with a void return. 1139 SHT_PROGBITS 0x1 The section holds information defined by the 1140 program, whose format and meaning are determined solely by the 1141 program. 1142 SHT_REL 0x9 The section holds relocation entries without 1143 explicit addends, such as type Elf32_Rel for the 32-bit class 1144 of object files or type Elf64_Rel for the 64-bit class of 1145 object files. An object file may have multiple relocation 1146 sections. See "Relocation" 1147 SHT_RELA 0x4 The section holds relocation entries with 1148 explicit addends, such as type Elf32_Rela for the 32-bit class 1149 of object files or type Elf64_Rela for the 64-bit class of 1150 object files. An object file may have multiple relocation 1151 sections. `Relocation' b 1152 SHT_STRTAB 0x3 The section holds a string table. An object 1153 file may have multiple string table sections. See `String 1154 Table' below for details. 1155 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 1156 an object file may have either a section of SHT_SYMTAB type or 1157 a section of SHT_DYNSYM type, but not both. This restriction 1158 may be relaxed in the future. Typically, SHT_SYMTAB provides 1159 symbols for link editing, though it may also be used for 1160 dynamic linking. As a complete symbol table, it may contain 1161 many symbols unnecessary for dynamic linking. 1162 _________________________________________________________ 1163 1164 11.2.2.2. Additional Section Types 1165 1166 The following additional section types are defined here. 1167 1168 Table 11-2. Additional Section Types 1169 Name Value Description 1170 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1171 versions that are provided. 1172 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1173 versions that are required. 1174 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1175 Version Table. 1176 _________________________________________________________ 1177 1178 11.3. Special Sections 1179 1180 11.3.1. Special Sections 1181 1182 Various sections hold program and control information. 1183 Sections in the lists below are used by the system and have 1184 the indicated types and attributes. 1185 _________________________________________________________ 1186 1187 11.3.1.1. ELF Special Sections 1188 1189 The following sections are defined in the System V ABI and the 1190 System V ABI Update. 1191 1192 Table 11-3. ELF Special Sections 1193 Name Type Attributes 1194 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1195 .comment SHT_PROGBITS 0 1196 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1197 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1198 .debug SHT_PROGBITS 0 1199 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1200 .dynstr SHT_STRTAB SHF_ALLOC 1201 .dynsym SHT_DYNSYM SHF_ALLOC 1202 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1203 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1204 .hash SHT_HASH SHF_ALLOC 1205 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1206 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1207 .interp SHT_PROGBITS SHF_ALLOC 1208 .line SHT_PROGBITS 0 1209 .note SHT_NOTE 0 1210 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1211 .rodata SHT_PROGBITS SHF_ALLOC 1212 .rodata1 SHT_PROGBITS SHF_ALLOC 1213 .shstrtab SHT_STRTAB 0 1214 .strtab SHT_STRTAB SHF_ALLOC 1215 .symtab SHT_SYMTAB SHF_ALLOC 1216 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1217 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1218 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1219 1220 .bss 1221 1222 This section holds data that contributes to the program's 1223 memory image. The program may treat this data as 1224 uninitialized. However, the system shall initialize this data 1225 with zeroes when the program begins to run. The section 1226 occupies no file space, as indicated by the section type, 1227 SHT_NOBITS 1228 .comment 1229 1230 This section holds version control information. 1231 .data 1232 1233 This section holds initialized data that contribute to the 1234 program's memory image. 1235 .data1 1236 1237 This section holds initialized data that contribute to the 1238 program's memory image. 1239 .debug 1240 1241 This section holds information for symbolic debugging. The 1242 contents are unspecified. All section names with the prefix 1243 .debug hold information for symbolic debugging. The contents 1244 of these sections are unspecified. 1245 .dynamic 1246 1247 This section holds dynamic linking information. The section's 1248 attributes will include the SHF_ALLOC bit. Whether the 1249 SHF_WRITE bit is set is processor specific. See Chapter 5 for 1250 more information. 1251 .dynstr 1252 1253 This section holds strings needed for dynamic linking, most 1254 commonly the strings that represent the names associated with 1255 symbol table entries. See Chapter 5 for more information. 1256 .dynsym 1257 1258 This section holds the dynamic linking symbol table, as 1259 described in `Symbol Table'. See Chapter 5 for more 1260 information. 1261 .fini 1262 1263 This section holds executable instructions that contribute to 1264 the process termination code. That is, when a program exits 1265 normally, the system arranges to execute the code in this 1266 section. 1267 .fini_array 1268 1269 This section holds an array of function pointers that 1270 contributes to a single termination array for the executable 1271 or shared object containing the section. 1272 .hash 1273 1274 This section holds a symbol hash table. See `Hash Table' in 1275 Chapter 5 for more information. 1276 .init 1277 1278 This section holds executable instructions that contribute to 1279 the process initialization code. When a program starts to run, 1280 the system arranges to execute the code in this section before 1281 calling the main program entry point (called main for C 1282 programs) 1283 .init_array 1284 1285 This section holds an array of function pointers that 1286 contributes to a single initialization array for the 1287 executable or shared object containing the section. 1288 .interp 1289 1290 This section holds the path name of a program interpreter. If 1291 the file has a loadable segment that includes relocation, the 1292 sections' attributes will include the SHF_ALLOC bit; 1293 otherwise, that bit will be off. See Chapter 5 for more 1294 information. 1295 .line 1296 1297 This section holds line number information for symbolic 1298 debugging, which describes the correspondence between the 1299 source program and the machine code. The contents are 1300 unspecified. 1301 .note 1302 1303 This section holds information in the format that `Note 1304 Section' in Chapter 5 describes of the System V Application 1305 Binary Interface, Edition 4.1. 1306 .preinit_array 1307 1308 This section holds an array of function pointers that 1309 contributes to a single pre-initialization array for the 1310 executable or shared object containing the section. 1311 .rodata 1312 1313 This section holds read-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 .rodata1 1317 1318 This section hold sread-only data that typically contribute to 1319 a non-writable segment in the process image. See `Program 1320 Header' in Chapter 5 for more information. 1321 .shstrtab 1322 1323 This section holds section names. 1324 .strtab 1325 1326 This section holds strings, most commonly the strings that 1327 represent the names associated with symbol table entries. If 1328 the file has a loadable segment that includes the symbol 1329 string table, the section's attributes will include the 1330 SHF_ALLOC bit; otherwi 1331 .symtab 1332 1333 This section holds a symbol table, as `Symbol Table'. in this 1334 chapter describes. If the file has a loadable segment that 1335 includes the symbol table, the section's attributes will 1336 include the SHF_ALLOC bit; otherwise, that bit will be off. 1337 .tbss 1338 1339 This section holds uninitialized thread-local data that 1340 contribute to the program's memory image. By definition, the 1341 system initializes the data with zeros when the data is 1342 instantiated for each new execution flow. The section occupies 1343 no file space, as indicated by the section type, SHT_NOBITS. 1344 Implementations need not support thread-local storage. 1345 .tdata 1346 1347 This section holds initialized thread-local data that 1348 contributes to the program's memory image. A copy of its 1349 contents is instantiated by the system for each new execution 1350 flow. Implementations need not support thread-local storage. 1351 .text 1352 1353 This section holds the `text,' or executable instructions, of 1354 a program. 1355 _________________________________________________________ 1356 1357 11.3.1.2. Additional Special Sections 1358 1359 Object files in an LSB conforming application may also contain 1360 one or more of the additional special sections described 1361 below. 1362 1363 Table 11-4. Additional Special Sections 1364 Name Type Attributes 1365 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1366 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1367 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1368 .eh_frame SHT_PROGBITS SHF_ALLOC 1369 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1370 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1371 .gnu.version SHT_GNU_versym SHF_ALLOC 1372 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1373 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1374 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1375 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1376 .note.ABI-tag SHT_NOTE SHF_ALLOC 1377 .stab SHT_PROGBITS 0 1378 .stabstr SHT_STRTAB 0 1379 1380 .ctors 1381 1382 This section contains a list of global constructor function 1383 pointers. 1384 .data.rel.ro 1385 1386 This section holds initialized data that contribute to the 1387 program's memory image. This section may be made read-only 1388 after relocations have been applied. 1389 .dtors 1390 1391 This section contains a list of global destructor function 1392 pointers. 1393 .eh_frame 1394 1395 This section contains information necessary for frame 1396 unwinding during exception handling. See Section 11.6.1. 1397 .eh_frame_hdr 1398 1399 This section contains a pointer to the .eh_frame section which 1400 is accessible to the runtime support code of a C++ 1401 application. This section may also contain a binary search 1402 table which may be used by the runtime support code to more 1403 efficiently access records in the .eh_frame section. See 1404 Section 11.6.2. 1405 .gcc_except_table 1406 1407 This section holds Language Specific Data. 1408 .gnu.version 1409 1410 This section contains the Symbol Version Table. See Section 1411 11.7.2. 1412 .gnu.version_d 1413 1414 This section contains the Version Definitions. See Section 1415 11.7.3. 1416 .gnu.version_r 1417 1418 This section contains the Version Requirements. See Section 1419 11.7.4. 1420 .got.plt 1421 1422 This section holds the read-only portion of the GLobal Offset 1423 Table. This section may be made read-only after relocations 1424 have been applied. 1425 .jcr 1426 1427 This section contains information necessary for registering 1428 compiled Java classes. The contents are compiler-specific and 1429 used by compiler initialization functions. 1430 .note.ABI-tag 1431 1432 Specify ABI details. See Section 11.8. 1433 .stab 1434 1435 This section contains debugging information. The contents are 1436 not specified as part of the LSB. 1437 .stabstr 1438 1439 This section contains strings associated with the debugging 1440 infomation contained in the .stab section. 1441 _________________________________________________________ 1442 1443 11.4. Symbol Mapping 1444 1445 11.4.1. Introduction 1446 1447 Symbols in a source program are translated by the compilation 1448 system into symbols that exist in the object file. 1449 _________________________________________________________ 1450 1451 11.4.1.1. C Language 1452 1453 External C symbols shall be unchanged in an object file's 1454 symbol table. 1455 _________________________________________________________ 1456 1457 11.5. DWARF Extensions 1458 1459 The LSB does not specify debugging information, however, some 1460 additional sections contain information which is encoded using 1461 the the encoding as specified by DWARF Debugging Information 1462 Format, Revision 2.0.0 with extensions defined here. 1463 1464 Note: The extensions specified here also exist in DWARF 1465 Debugging Information Format, Revision 3.0.0 (Draft). It is 1466 expected that future versions of the LSB will reference the 1467 final version of that document, and that the definitions 1468 here will be taken from that document instead of being 1469 specified here. 1470 _________________________________________________________ 1471 1472 11.5.1. DWARF Exception Header Encoding 1473 1474 The DWARF Exception Header Encoding is used to describe the 1475 type of data used in the .eh_frame and .eh_frame_hdr section. 1476 The upper 4 bits indicate how the value is to be applied. The 1477 lower 4 bits indicate the format of the data. 1478 1479 Table 11-5. DWARF Exception Header value format 1480 Name Value Meaning 1481 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1482 is determined by the architecture. 1483 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1484 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1485 Information Format, Revision 2.0.0. 1486 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1487 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1488 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1489 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1490 Endian Base 128 (LEB128) as defined by DWARF Debugging 1491 Information Format, Revision 2.0.0. 1492 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1493 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1494 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1495 1496 Table 11-6. DWARF Exception Header application 1497 Name Value Meaning 1498 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1499 counter. 1500 DW_EH_PE_textrel 0x20 Value is relative to the beginning of 1501 the .text section. 1502 DW_EH_PE_datarel 0x30 Value is relative to the beginning of 1503 the .got or .eh_frame_hdr section. 1504 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of 1505 the function. 1506 DW_EH_PE_aligned 0x50 Value is aligned to an address unit 1507 sized boundary. 1508 1509 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1510 indicate that no value ispresent. 1511 _________________________________________________________ 1512 1513 11.5.2. DWARF CFI Extensions 1514 1515 In addition to the Call Frame Instructions defined in section 1516 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1517 the following additional Call Frame Instructions may also be 1518 used. 1519 1520 Table 11-7. Additional DWARF Call Frame Instructions 1521 Name Value Meaning 1522 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1523 two operands: an unsigned LEB128 value representing a register 1524 number, and a DW_FORM_block value representing a DWARF 1525 expression. The required action is to establish the DWARF 1526 expression as the means by which the address in which the 1527 given register contents are found may be computed. The value 1528 of the CFA is pushed on the DWARF evaluation stack prior to 1529 execution of the DWARF expression. The DW_OP_call2, 1530 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1531 DWARF operators (see Section 2.4.1 of DWARF Debugging 1532 Information Format, Revision 2.0.0) cannot be used in such a 1533 DWARF expression. 1534 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1535 instruction takes two operands: an unsigned LEB128 value 1536 representing a register number and a signed LEB128 factored 1537 offset. This instruction is identical to 1538 DW_CFA_offset_extended except that the second operand is 1539 signed. 1540 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1541 two operands: an unsigned LEB128 value representing a register 1542 number and a signed LEB128 factored offset. This instruction 1543 is identical to DW_CFA_def_cfa except that the second operand 1544 is signed and factored. 1545 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1546 instruction takes a signed LEB128 operand representing a 1547 factored offset. This instruction is identical to 1548 DW_CFA_def_cfa_offset except that the operand is signed and 1549 factored. 1550 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1551 takes an unsigned LEB128 operand representing an argument 1552 size. This instruction specifies the total of the size of the 1553 arguments which have been pushed onto the stack. 1554 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1555 instruction takes two operands: an unsigned LEB128 value 1556 representing a register number and an unsigned LEB128 which 1557 represents the magnitude of the offset. This instruction is 1558 identical to DW_CFA_offset_extended_sf except that the operand 1559 is subtracted to produce the offset. This instructions is 1560 obsoleted by DW_CFA_offset_extended_sf. 1561 _________________________________________________________ 1562 1563 11.6. Exception Frames 1564 1565 When using languages that support exceptions, such as C++, 1566 additional information must be provided to the runtime 1567 environment that describes the call frames that must be 1568 unwound during the processing of an exception. This 1569 information is contained in the special sections .eh_frame and 1570 .eh_framehdr. 1571 1572 Note: The format of the .eh_frame section is similar in 1573 format and purpose to the .debug_frame section which is 1574 specified in DWARF Debugging Information Format, Revision 1575 3.0.0 (Draft). Readers are advised that there are some 1576 subtle difference, and care should be taken when comparing 1577 the two sections. 1578 _________________________________________________________ 1579 1580 11.6.1. The .eh_frame section 1581 1582 The .eh_frame section shall contain 1 or more Call Frame 1583 Information (CFI) records. The number of records present shall 1584 be determined by size of the section as contained in the 1585 section header. Each CFI record contains a Common Information 1586 Entry (CIE) record followed by 1 or more Frame Description 1587 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1588 addressing unit sized boundary. 1589 1590 Table 11-8. Call Frame Information Format 1591 Common Information Entry Record 1592 Frame Description Entry Record(s) 1593 _________________________________________________________ 1594 1595 11.6.1.1. The Common Information Entry Format 1596 1597 Table 11-9. Common Information Entry Format 1598 Length Required 1599 Extended Length Optional 1600 CIE ID Required 1601 Version Required 1602 Augmentation String Required 1603 Code Alignment Factor Required 1604 Data Alignment Factor Required 1605 Return Address Register Required 1606 Augmentation Data Length Optional 1607 Augmentation Data Optional 1608 Initial Instructions Required 1609 Padding 1610 1611 Length 1612 A 4 byte unsigned value indicating the length in bytes 1613 of the CIE structure, not including the Length field 1614 itself. If Length contains the value 0xffffffff, then 1615 the length is contained in the Extended Length field. 1616 If Length contains the value 0, then this CIE shall be 1617 considered a terminator and processing shall end. 1618 1619 Extended Length 1620 A 8 byte unsigned value indicating the length in bytes 1621 of the CIE structure, not including the Length and 1622 Extended Length fields. 1623 1624 CIE ID 1625 A 4 byte unsigned value that is used to distinguish CIE 1626 records from FDE records. This value shall always be 0, 1627 which indicates this record is a CIE. 1628 1629 Version 1630 A 1 byte value that identifies the version number of 1631 the frame information structure. This value shall be 1. 1632 1633 Augmentation String 1634 This value is a NUL terminated string that identifies 1635 the augmentation to the CIE or to the FDEs associated 1636 with this CIE. A zero length string indicates that no 1637 augmentation data is present. The augmentation string 1638 is case sensitive and shall be interpreted as described 1639 below. 1640 1641 Code Alignment Factor 1642 An unsigned LEB128 encoded value that is factored out 1643 of all advance location instructions that are 1644 associated with this CIE or its FDEs. This value shall 1645 be multiplied by the delta argument of an adavance 1646 location instruction to obtain the new location value. 1647 1648 Data Alignment Factor 1649 A signed LEB128 encoded value that is factored out of 1650 all offset instructions that are associated with this 1651 CIE or its FDEs. This value shall be multiplied by the 1652 register offset argument of an offset instruction to 1653 obtain the new offset value. 1654 1655 Augmentation Length 1656 An unsigned LEB128 encoded value indicating the length 1657 in bytes of the Augmentation Data. This field is only 1658 present if the Augmentation String contains the 1659 character 'z'. 1660 1661 Augmentation Data 1662 A block of data whose contents are defined by the 1663 contents of the Augmentation String as described below. 1664 This field is only present if the Augmentation String 1665 contains the character 'z'. The size of this data is 1666 given by the Augentation Length. 1667 1668 Initial Instructions 1669 Initial set of Call Frame Instructions. The number of 1670 instructions is determined by the remaining space in 1671 the CIE record. 1672 1673 Padding 1674 Extra bytes to align the CIE structure to an addressing 1675 unit size boundary. 1676 _________________________________________________________ 1677 1678 11.6.1.1.1. Augmentation String Format 1679 1680 The Agumentation String indicates the presence of some 1681 optional fields, and how those fields should be intepreted. 1682 This string is case sensitive. Each character in the 1683 augmentation string in the CIE can be interpreted as below: 1684 1685 'z' 1686 1687 A 'z' may be present as the first character of the string. If 1688 present, the Augmentation Data field shall be present. The 1689 contents of the Augmentation Data shall be intepreted 1690 according to other characters in the Augmentation String. 1691 'L' 1692 1693 A 'L' may be present at any position after the first character 1694 of the string. This character may only be present if 'z' is 1695 the first character of the string. If present, it indicates 1696 the presence of one argument in the Augmentation Data of the 1697 CIE, and a corresponding argument in the Augmentation Data of 1698 the FDE. The argument in the Augmentation Data of the CIE is 1699 1-byte and represents the pointer encoding used for the 1700 argument in the Augmentation Data of the FDE, which is the 1701 address of a language-specific data area (LSDA). The size of 1702 the LSDA pointer is specified by the pointer encoding used. 1703 'P' 1704 1705 A 'P' may be present at any position after the first character 1706 of the string. This character may only be present if 'z' is 1707 the first character of the string. If present, it indicates 1708 the presence of two arguments in the Augmentation Data of the 1709 CIE. The first argument is 1-byte and represents the pointer 1710 encoding used for the second argument, which is the address of 1711 a personality routine handler. The personality routine is used 1712 to handle language and vendor-specific tasks. The system 1713 unwind library interface accesses the language-specific 1714 exception handling semantics via the pointer to the 1715 personality routine. The personality routine does not have an 1716 ABI-specific name. The size of the personality routine pointer 1717 is specified by the pointer encoding used. 1718 'R' 1719 1720 A 'R' may be present at any position after the first character 1721 of the string. This character may only be present if 'z' is 1722 the first character of the string. If present, The 1723 Augmentation Data shall include a 1 byte argument that 1724 represents the pointer encoding for the address pointers used 1725 in the FDE. 1726 _________________________________________________________ 1727 1728 11.6.1.2. The Frame Description Entry Format 1729 1730 Table 11-10. Frame Description Entry Format 1731 Length Required 1732 Extended Length Optional 1733 CIE Pointer Required 1734 PC Begin Required 1735 PC Range Required 1736 Augmentation Data Length Optional 1737 Augmentation Data Optional 1738 Call Frame Instructions Required 1739 Padding 1740 1741 Length 1742 A 4 byte unsigned value indicating the length in bytes 1743 of the CIE structure, not including the Length field 1744 itself. If Length contains the value 0xffffffff, then 1745 the length is contained the Extended Length field. If 1746 Length contains the value 0, then this CIE shall be 1747 considered a terminator and processing shall end. 1748 1749 Extended Length 1750 A 8 byte unsigned value indicating the length in bytes 1751 of the CIE structure, not including the Length field 1752 itself. 1753 1754 CIE Pointer 1755 A 4 byte unsigned value that when subtracted from the 1756 offset of the the CIE Pointer in the current FDE yields 1757 the offset of the start of the associated CIE. This 1758 value shall never be 0. 1759 1760 PC Begin 1761 An encoded value that indicates the address of the 1762 initial location associated with this FDE. The encoding 1763 format is specified in the Augmentation Data. 1764 1765 PC Range 1766 An absolute value that indicates the number of bytes of 1767 instructions associated with this FDE. 1768 1769 Augmentation Length 1770 An unsigned LEB128 encoded value indicating the length 1771 in bytes of the Augmentation Data. This field is only 1772 present if the Augmentation String in the associated 1773 CIE contains the character 'z'. 1774 1775 Augmentation Data 1776 A block of data whose contents are defined by the 1777 contents of the Augmentation String in the associated 1778 CIE as described above. This field is only present if 1779 the Augmentation String in the associated CIE contains 1780 the character 'z'. The size of this data is given by 1781 the Augentation Length. 1782 1783 Call Frame Instructions 1784 A set of Call Frame Instructions. 1785 1786 Padding 1787 Extra bytes to align the FDE structure to an addressing 1788 unit size boundary. 1789 _________________________________________________________ 1790 1791 11.6.2. The .eh_frame_hdr section 1792 1793 The .eh_frame_hdr section contains additional information 1794 about the .eh_frame section. A pointer to the start of the 1795 .eh_frame data, and optionally, a binary search table of 1796 pointers to the .eh_frame records are found in this section. 1797 1798 Data in this section is encoded according to Section 11.5.1. 1799 1800 Table 11-11. .eh_frame_hdr Section Format 1801 Encoding Field 1802 unsigned byte version 1803 unsigned byte eh_frame_ptr_enc 1804 unsigned byte fde_count_enc 1805 unsigned byte table_enc 1806 encoded eh_frame_ptr 1807 encoded fde_count 1808 binary search table 1809 1810 version 1811 1812 Version of the .eh_frame_hdr format. This value shall be 1. 1813 eh_frame_ptr_enc 1814 1815 The encoding format of the eh_frame_ptr field. 1816 fde_count_enc 1817 1818 The encoding format of the fde_count field. A value of 1819 DW_EH_PE_omit indicates the binary search table is not 1820 present. 1821 table_enc 1822 1823 The encoding format of the entries in the binary search table. 1824 A value of DW_EH_PE_omit indicates the binary search table is 1825 not present. 1826 eh_frame_ptr 1827 1828 The encoded value of the pointer to the start of the .eh_frame 1829 section. 1830 fde_count 1831 1832 The encoded value of the count of entries in the binary search 1833 table. 1834 binary search table 1835 1836 A binary search table containing fde_count entries. Each entry 1837 of the table consist of two encoded values, the initial 1838 location, and the address. The entries are sorted in an 1839 increasing order by the initial location value. 1840 _________________________________________________________ 1841 1842 11.7. Symbol Versioning 1843 1844 11.7.1. Introduction 1845 1846 This chapter describes the Symbol Versioning mechanism. All 1847 ELF objects may provide or depend on versioned symbols. Symbol 1848 Versioning is implemented by 3 section types: SHT_GNU_versym, 1849 SHT_GNU_verdef, and SHT_GNU_verneed. 1850 1851 The prefix Elfxx in the following descriptions and code 1852 fragments stands for either "Elf32" or "Elf64", depending on 1853 the architecture. 1854 1855 Versions are described by strings. The structures that are 1856 used for symbol versions also contain a member that holds the 1857 ELF hashing values of the strings. This allows for more 1858 efficient processing. 1859 _________________________________________________________ 1860 1861 11.7.2. Symbol Version Table 1862 1863 The special section .gnu.version which has a section type of 1864 SHT_GNU_versym shall contain the Symbol Version Table. This 1865 section shall have the same number of entries as the Dynamic 1866 Symbol Table in the .dynsym section. 1867 1868 The .gnu.version section shall contain an array of elements of 1869 type Elfxx_Half. Each entry specifies the version defined for 1870 or required by the corresponding symbol in the Dynamic Symbol 1871 Table. 1872 1873 The values in the Symbol Version Table are specific to the 1874 object in which they are located. These values are identifiers 1875 that are provided by the the vna_other member of the 1876 Elfxx_Vernaux structure or the vd_ndx member of the 1877 Elfxx_Verdef structure. 1878 1879 The values 0 and 1 are reserved. 1880 1881 0 1882 1883 The symbol is local, not available outside the object. 1884 1 1885 1886 The symbol is defined in this object and is globally 1887 available. 1888 1889 All other values are used to identify version strings located 1890 in one of the other Symbol Version sections. The value itself 1891 is not the version associated with the symbol. The string 1892 identified by the value defines the version of the symbol. 1893 _________________________________________________________ 1894 1895 11.7.3. Version Definitions 1896 1897 The special section .gnu.version_d which has a section type of 1898 SHT_GNU_verdef shall contain symbol version definitions. The 1899 number of entries in this section shall be contained in the 1900 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The 1901 sh_link member of the section header (see figure 4-8 in the 1902 System V ABI) shall point to the section that contains the 1903 strings referenced by this section. 1904 1905 The section shall contain an array of Elfxx_Verdef structures, 1906 as described in Figure 11-1, optionally followed by an array 1907 of Elfxx_Verdaux structures, as defined in Figure 11-2. 1908 typedef struct { 1909 Elfxx_Half vd_version; 1910 Elfxx_Half vd_flags; 1911 Elfxx_Half vd_ndx; 1912 Elfxx_Half vd_cnt; 1913 Elfxx_Word vd_hash; 1914 Elfxx_Word vd_aux; 1915 Elfxx_Word vd_next; 1916 } Elfxx_Verdef; 1917 1918 Figure 11-1. Version Definition Entries 1919 1920 vd_version 1921 1922 Version revision. This field shall be set to 1. 1923 vd_flags 1924 1925 Version information flag bitmask. 1926 vd_ndx 1927 1928 Version index numeric value referencing the SHT_GNU_versym 1929 section. 1930 vd_cnt 1931 1932 Number of associated verdaux array entries. 1933 vd_hash 1934 1935 Version name hash value (ELF hash function). 1936 vd_aux 1937 1938 Offset in bytes to a corresponding entry in an array of 1939 Elfxx_Verdaux structures as defined in Figure 11-2 1940 vd_next 1941 1942 Offset to the next verdef entry, in bytes. 1943 typedef struct { 1944 Elfxx_Word vda_name; 1945 Elfxx_Word vda_next; 1946 } Elfxx_Verdaux; 1947 1948 Figure 11-2. Version Definition Auxiliary Entries 1949 1950 vda_name 1951 1952 Offset to the version or dependency name string in the section 1953 header, in bytes. 1954 vda_next 1955 1956 Offset to the next verdaux entry, in bytes. 1957 _________________________________________________________ 1958 1959 11.7.4. Version Requirements 1960 1961 The special section .gnu.version_r which has a section type of 1962 SHT_GNU_verneed shall contain required symbol version 1963 definitions. The number of entries in this section shall be 1964 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1965 .dynamic. The sh_link member of the section header (see figure 1966 4-8 in System V ABI) shall point to the section that contains 1967 the strings referenced by this section. 1968 1969 The section shall contain an array of Elfxx_Verneed 1970 structures, as described in Figure 11-3, optionally followed 1971 by an array of Elfxx_Vernaux structures, as defined in Figure 1972 11-4. 1973 typedef struct { 1974 Elfxx_Half vn_version; 1975 Elfxx_Half vn_cnt; 1976 Elfxx_Word vn_file; 1977 Elfxx_Word vn_aux; 1978 Elfxx_Word vn_next; 1979 } Elfxx_Verneed; 1980 1981 Figure 11-3. Version Needed Entries 1982 1983 vn_version 1984 1985 Version of structure. This value is currently set to 1, and 1986 will be reset if the versioning implementation is incompatibly 1987 altered. 1988 vn_cnt 1989 1990 Number of associated verneed array entries. 1991 vn_file 1992 1993 Offset to the file name string in the section header, in 1994 bytes. 1995 vn_aux 1996 1997 Offset to a corresponding entry in the vernaux array, in 1998 bytes. 1999 vn_next 2000 2001 Offset to the next verneed entry, in bytes. 2002 typedef struct { 2003 Elfxx_Word vna_hash; 2004 Elfxx_Half vna_flags; 2005 Elfxx_Half vna_other; 2006 Elfxx_Word vna_name; 2007 Elfxx_Word vna_next; 2008 } Elfxx_Vernaux; 2009 2010 Figure 11-4. Version Needed Auxiliary Entries 2011 2012 vna_hash 2013 2014 Dependency name hash value (ELF hash function). 2015 vna_flags 2016 2017 Dependency information flag bitmask. 2018 vna_other 2019 2020 Object file version identifier used in the .gnu.version symbol 2021 version array. Bit number 15 controls whether or not the 2022 object is hidden; if this bit is set, the object cannot be 2023 used and the static linker will ignore the symbol's presence 2024 in the object. 2025 vna_name 2026 2027 Offset to the dependency name string in the section header, in 2028 bytes. 2029 vna_next 2030 2031 Offset to the next vernaux entry, in bytes. 2032 _________________________________________________________ 2033 2034 11.7.5. Startup Sequence 2035 2036 When loading a sharable object the system shall analyze 2037 version definition data from the loaded object to assure that 2038 it meets the version requirements of the calling object. This 2039 step is referred to as definition testing. The dynamic loader 2040 shall retrieve the entries in the caller's Elfxx_Verneed array 2041 and attempt to find matching definition information in the 2042 loaded Elfxx_Verdef table. 2043 2044 Each object and dependency shall be tested in turn. If a 2045 symbol definition is missing and the vna_flags bit for 2046 VER_FLG_WEAK is not set, the loader shall return an error and 2047 exit. If the vna_flags bit for VER_FLG_WEAK is set in the 2048 Elfxx_Vernaux entry, and the loader shall issue a warning and 2049 continue operation. 2050 2051 When the versions referenced by undefined symbols in the 2052 loaded object are found, version availability is certified. 2053 The test completes without error and the object shall be made 2054 available. 2055 _________________________________________________________ 2056 2057 11.7.6. Symbol Resolution 2058 2059 When symbol versioning is used in an object, relocations 2060 extend definition testing beyond the simple match of symbol 2061 name strings: the version of the reference shall also equal 2062 the name of the definition. 2063 2064 The same index that is used in the symbol table can be 2065 referenced in the SHT_GNU_versym section, and the value of 2066 this index is then used to acquire name data. The 2067 corresponding requirement string is retrieved from the 2068 Elfxx_Verneed array, and likewise, the corresponding 2069 definition string from the Elfxx_Verdef table. 2070 2071 If the high order bit (bit number 15) of the version symbolis 2072 set, the object cannot be used and the static linker shall 2073 ignore the symbol's presence in the object. 2074 2075 When an object with a reference and an object with the 2076 definition are being linked, the following rules shall govern 2077 the result: 2078 2079 * The object with the reference and the object with the 2080 definitions both use versioning. All described matching is 2081 processed in this case. A fatal error shall be triggered 2082 when no matching definition can be found in the object 2083 whose name is the one referenced by the vn_name element in 2084 the Elfxx_Verneed entry. 2085 * The object with the reference does not use versioning, 2086 while the object with the definitions does. In this 2087 instance, only the definitions with index numbers 1 and 2 2088 will be used in the reference match, the same identified 2089 by the static linker as the base definition. In cases 2090 where the static linker was not used, such as in calls to 2091 dlopen(), a version that does not have the base definition 2092 index shall be acceptable if it is the only version for 2093 which the symbol is defined. 2094 * The object with the reference uses versioning, but the 2095 object with the definitions specifies none. A matching 2096 symbol shall be accepted in this case. A fatal error shall 2097 be triggered if a corruption in the required symbols list 2098 obscures an outdated object file and causes a match on the 2099 object filename in the Elfxx_Verneed entry. 2100 * Neither the object with the reference nor the object with 2101 the definitions use versioning. The behavior in this 2102 instance shall default to pre-existing symbol rules. 2103 _________________________________________________________ 2104 2105 11.8. ABI note tag 2106 2107 Every executable shall contain a section named .note.ABI-tag 2108 of type SHT_NOTE. This section is structured as a note section 2109 as documented in the ELF spec. The section shall contain at 2110 least the following entry. The name field (namesz/name) 2111 contains the string "GNU". The type field shall be 1. The 2112 descsz field shall be at least 16, and the first 16 bytes of 2113 the desc field shall be as follows. 2114 2115 The first 32-bit word of the desc field shall be 0 (this 2116 signifies a Linux executable). The second, third, and fourth 2117 32-bit words of the desc field contain the earliest compatible 2118 kernel version. For example, if the 3 words are 2, 2, and 5, 2119 this signifies a 2.2.5 kernel. 2120 _________________________________________________________ 2121 2122 Chapter 12. Dynamic Linking 2123 2124 12.1. Program Loading and Dynamic Linking 2125 2126 LSB-conforming implementations shall support the object file 2127 information and system actions that create running programs as 2128 specified in the System V ABI and System V ABI Update and as 2129 further required by this specification and the relevant 2130 architecture specific part of ISO/IEC 23360. 2131 2132 Any shared object that is loaded shall contain sufficient 2133 DT_NEEDED records to satisfy the symbols on the shared 2134 library. 2135 _________________________________________________________ 2136 2137 12.2. Program Header 2138 2139 In addition to the Segment Types defined in the System V ABI 2140 and System V ABI Update the following Segment Types shall also 2141 be supported. 2142 2143 Table 12-1. Linux Segment Types 2144 Name Value 2145 PT_GNU_EH_FRAME 0x6474e550 2146 PT_GNU_STACK 0x6474e551 2147 PT_GNU_RELRO 0x6474e552 2148 2149 PT_GNU_EH_FRAME 2150 2151 The array element specifies the location and size of the 2152 exception handling information as defined by the .eh_frame_hdr 2153 section. 2154 PT_GNU_STACK 2155 2156 The p_flags member specifies the permissions on the segment 2157 containing the stack and is used to indicate wether the stack 2158 should be executable. The absense of this header indicates 2159 that the stack will be executable. 2160 PT_GNU_RELRO 2161 2162 The array element specifies the location and size of a segment 2163 which may be made read-only after relocation shave been 2164 processed. 2165 _________________________________________________________ 2166 2167 12.3. Dynamic Entries 2168 2169 12.3.1. Introduction 2170 2171 As described in System V ABI, if an object file 2172 CHAPTERicipates in dynamic linking, its program header table 2173 shall have an element of type PT_DYNAMIC. This `segment' 2174 contains the .dynamic section. A special symbol, _DYNAMIC, 2175 labels the section, which contains an array of the following 2176 structures. 2177 typedef struct { 2178 Elf32_Sword d_tag; 2179 union { 2180 Elf32_Word d_val; 2181 Elf32_Addr d_ptr; 2182 } d_un; 2183 } Elf32_Dyn; 2184 2185 extern Elf32_Dyn _DYNAMIC[]; 2186 2187 typedef struct { 2188 Elf64_Sxword d_tag; 2189 union { 2190 Elf64_Xword d_val; 2191 Elf64_Addr d_ptr; 2192 } d_un; 2193 } Elf64_Dyn; 2194 2195 extern Elf64_Dyn _DYNAMIC[]; 2196 2197 Figure 12-1. Dynamic Structure 2198 2199 For each object with this type, d_tag controls the 2200 interpretation of d_un. 2201 _________________________________________________________ 2202 2203 12.3.2. Dynamic Entries 2204 _________________________________________________________ 2205 2206 12.3.2.1. ELF Dynamic Entries 2207 2208 The following dynamic entries are defined in the System V ABI 2209 and System V ABI Update. 2210 2211 DT_BIND_NOW 2212 2213 Process relocations of object 2214 DT_DEBUG 2215 2216 For debugging; unspecified 2217 DT_FINI 2218 2219 Address of termination function 2220 DT_HASH 2221 2222 Address of symbol hash table 2223 DT_HIPROC 2224 2225 End of processor-specific 2226 DT_INIT 2227 2228 Address of init function 2229 DT_JMPREL 2230 2231 Address of PLT relocs 2232 DT_LOPROC 2233 2234 Start of processor-specific 2235 DT_NEEDED 2236 2237 Name of needed library 2238 DT_NULL 2239 2240 Marks end of dynamic section 2241 DT_PLTREL 2242 2243 Type of reloc in PLT 2244 DT_PLTRELSZ 2245 2246 Size in bytes of PLT relocs 2247 DT_REL 2248 2249 Address of Rel relocs 2250 DT_RELA 2251 2252 Address of Rela relocs 2253 DT_RELAENT 2254 2255 Size of one Rela reloc 2256 DT_RELASZ 2257 2258 Total size of Rela relocs 2259 DT_RELENT 2260 2261 Size of one Rel reloc 2262 DT_RELSZ 2263 2264 Total size of Rel relocs 2265 DT_RPATH 2266 2267 Library search path 2268 DT_SONAME 2269 2270 Name of shared object 2271 DT_STRSZ 2272 2273 Size of string table 2274 DT_STRTAB 2275 2276 Address of string table 2277 DT_SYMBOLIC 2278 2279 Start symbol search here 2280 DT_SYMENT 2281 2282 Size of one symbol table entry 2283 DT_SYMTAB 2284 2285 Address of symbol table 2286 DT_TEXTREL 2287 2288 Reloc might modify .text 2289 _________________________________________________________ 2290 2291 12.3.2.2. Additional Dynamic Entries 2292 2293 An LSB conforming object may also use the following additional 2294 Dynamic Entry types. 2295 2296 DT_ADDRRNGHI 2297 2298 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2299 definition by an archLSB. 2300 DT_ADDRRNGLO 2301 2302 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2303 definition by an archLSB. 2304 DT_AUXILIARY 2305 2306 Shared object to load before self 2307 DT_FILTER 2308 2309 Shared object to get values from 2310 DT_FINI_ARRAY 2311 2312 The address of an array of pointers to termination functions. 2313 DT_FINI_ARRAYSZ 2314 2315 Size in bytes of DT_FINI_ARRAY 2316 DT_HIOS 2317 2318 Values from DT_LOOS through DT_HIOS are reserved for 2319 definition by specific operating systems. 2320 DT_INIT_ARRAY 2321 2322 The address of an array of pointers to initialization 2323 functions. 2324 DT_INIT_ARRAYSZ 2325 2326 Size in bytes of DT_INIT_ARRAY 2327 DT_LOOS 2328 2329 Values from DT_LOOS through DT_HIOS are reserved for 2330 definition by specific operating systems. 2331 DT_NUM 2332 2333 Number of dynamic entry tags defined (excepting reserved 2334 ranges). 2335 DT_POSFLAG_1 2336 2337 Flags for DT_* entries, effecting the following DT_* entry 2338 DT_RELCOUNT 2339 2340 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2341 single block and this entry specifies the number of entries in 2342 that block. This permits ld.so.1 to streamline the processing 2343 of RELATIVE relocations. 2344 DT_RUNPATH 2345 2346 null-terminated library search path string 2347 DT_SYMINENT 2348 2349 Entry size of syminfo 2350 DT_SYMINFO 2351 2352 Address of the Syminfo table. 2353 DT_SYMINSZ 2354 2355 Size of syminfo table (in bytes) 2356 DT_VALRNGHI 2357 2358 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2359 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2360 DT_VALRNGLO 2361 2362 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2363 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2364 DT_VERDEF 2365 2366 Address of version definition table 2367 DT_VERDEFNUM 2368 2369 Number of version definitions 2370 DT_VERNEED 2371 2372 Address of table with needed versions 2373 DT_VERNEEDNUM 2374 2375 Number of needed versions 2376 DT_VERSYM 2377 2378 Address of the table provided by the .gnu.version section. 2379 2380 III. Base Libraries 2381 2382 Table of Contents 2383 13. Base Libraries 2384 2385 13.1. Introduction 2386 13.2. Program Interpreter 2387 13.3. Interfaces for libc 2388 2389 13.3.1. RPC 2390 13.3.2. System Calls 2391 13.3.3. Standard I/O 2392 13.3.4. Signal Handling 2393 13.3.5. Localization Functions 2394 13.3.6. Socket Interface 2395 13.3.7. Wide Characters 2396 13.3.8. String Functions 2397 13.3.9. IPC Functions 2398 13.3.10. Regular Expressions 2399 13.3.11. Character Type Functions 2400 13.3.12. Time Manipulation 2401 13.3.13. Terminal Interface Functions 2402 13.3.14. System Database Interface 2403 13.3.15. Language Support 2404 13.3.16. Large File Support 2405 13.3.17. Standard Library 2406 2407 13.4. Data Definitions for libc 2408 2409 13.4.1. arpa/inet.h 2410 13.4.2. assert.h 2411 13.4.3. ctype.h 2412 13.4.4. dirent.h 2413 13.4.5. err.h 2414 13.4.6. errno.h 2415 13.4.7. fcntl.h 2416 13.4.8. fmtmsg.h 2417 13.4.9. fnmatch.h 2418 13.4.10. ftw.h 2419 13.4.11. getopt.h 2420 13.4.12. glob.h 2421 13.4.13. grp.h 2422 13.4.14. iconv.h 2423 13.4.15. inttypes.h 2424 13.4.16. langinfo.h 2425 13.4.17. libgen.h 2426 13.4.18. libintl.h 2427 13.4.19. limits.h 2428 13.4.20. locale.h 2429 13.4.21. monetary.h 2430 13.4.22. net/if.h 2431 13.4.23. netdb.h 2432 13.4.24. netinet/in.h 2433 13.4.25. netinet/ip.h 2434 13.4.26. netinet/tcp.h 2435 13.4.27. netinet/udp.h 2436 13.4.28. nl_types.h 2437 13.4.29. poll.h 2438 13.4.30. pty.h 2439 13.4.31. pwd.h 2440 13.4.32. regex.h 2441 13.4.33. rpc/auth.h 2442 13.4.34. rpc/clnt.h 2443 13.4.35. rpc/pmap_clnt.h 2444 13.4.36. rpc/rpc_msg.h 2445 13.4.37. rpc/svc.h 2446 13.4.38. rpc/types.h 2447 13.4.39. rpc/xdr.h 2448 13.4.40. sched.h 2449 13.4.41. search.h 2450 13.4.42. setjmp.h 2451 13.4.43. signal.h 2452 13.4.44. stddef.h 2453 13.4.45. stdio.h 2454 13.4.46. stdlib.h 2455 13.4.47. string.h 2456 13.4.48. sys/file.h 2457 13.4.49. sys/ioctl.h 2458 13.4.50. sys/ipc.h 2459 13.4.51. sys/mman.h 2460 13.4.52. sys/msg.h 2461 13.4.53. sys/param.h 2462 13.4.54. sys/poll.h 2463 13.4.55. sys/resource.h 2464 13.4.56. sys/sem.h 2465 13.4.57. sys/shm.h 2466 13.4.58. sys/socket.h 2467 13.4.59. sys/stat.h 2468 13.4.60. sys/statfs.h 2469 13.4.61. sys/statvfs.h 2470 13.4.62. sys/time.h 2471 13.4.63. sys/timeb.h 2472 13.4.64. sys/times.h 2473 13.4.65. sys/types.h 2474 13.4.66. sys/uio.h 2475 13.4.67. sys/un.h 2476 13.4.68. sys/utsname.h 2477 13.4.69. sys/wait.h 2478 13.4.70. syslog.h 2479 13.4.71. termios.h 2480 13.4.72. time.h 2481 13.4.73. ucontext.h 2482 13.4.74. ulimit.h 2483 13.4.75. unistd.h 2484 13.4.76. utime.h 2485 13.4.77. utmp.h 2486 13.4.78. utmpx.h 2487 13.4.79. wchar.h 2488 13.4.80. wctype.h 2489 13.4.81. wordexp.h 2490 2491 13.5. Interface Definitions for libc 2492 2493 _IO_feof -- alias for feof 2494 _IO_getc -- alias for getc 2495 _IO_putc -- alias for putc 2496 _IO_puts -- alias for puts 2497 __assert_fail -- abort the program after false 2498 assertion 2499 2500 __ctype_b_loc -- accessor function for __ctype_b 2501 array for ctype functions 2502 2503 __ctype_get_mb_cur_max -- maximum length of a 2504 multibyte character in the current locale 2505 2506 __ctype_tolower_loc -- accessor function for 2507 __ctype_b_tolower array for ctype tolower() 2508 function 2509 2510 __ctype_toupper_loc -- accessor function for 2511 __ctype_b_toupper() array for ctype 2512 toupper() function 2513 2514 __cxa_atexit -- register a function to be called by 2515 exit or when a shared library is unloaded 2516 2517 __daylight -- daylight savings time flag 2518 __environ -- alias for environ - user environment 2519 __errno_location -- address of errno variable 2520 __fpending -- returns in bytes the amount of output 2521 pending on a stream 2522 2523 __getpagesize -- alias for getpagesize - get 2524 current page size 2525 2526 __getpgid -- get the process group id 2527 __h_errno_location -- address of h_errno variable 2528 __isinf -- test for infinity 2529 __isinff -- test for infinity 2530 __isinfl -- test for infinity 2531 __isnan -- test for infinity 2532 __isnanf -- test for infinity 2533 __isnanl -- test for infinity 2534 __libc_current_sigrtmax -- return number of 2535 available real-time signal with lowest 2536 priority 2537 2538 __libc_current_sigrtmin -- return number of 2539 available real-time signal with highest 2540 priority 2541 2542 __libc_start_main -- initialization routine 2543 __lxstat -- inline wrapper around call to lxstat 2544 __mempcpy -- copy given number of bytes of source 2545 to destination 2546 2547 __rawmemchr -- scan memory 2548 __register_atfork -- alias for register_atfork 2549 __sigsetjmp -- save stack context for non-local 2550 goto 2551 2552 __stpcpy -- alias for stpcpy 2553 __strdup -- alias for strdup 2554 __strtod_internal -- underlying function for strtod 2555 __strtof_internal -- underlying function for strtof 2556 __strtok_r -- alias for strtok_r 2557 __strtol_internal -- alias for strtol 2558 __strtold_internal -- underlying function for 2559 strtold 2560 2561 __strtoll_internal -- underlying function for 2562 strtoll 2563 2564 __strtoul_internal -- underlying function for 2565 strtoul 2566 2567 __strtoull_internal -- underlying function for 2568 strtoull 2569 2570 __sysconf -- get configuration information at 2571 runtime 2572 2573 __sysv_signal -- signal handling 2574 __timezone -- global variable containing timezone 2575 __tzname -- global variable containing the timezone 2576 __wcstod_internal -- underlying function for wcstod 2577 __wcstof_internal -- underlying function for wcstof 2578 __wcstol_internal -- underlying function for wcstol 2579 __wcstold_internal -- underlying function for 2580 wcstold 2581 2582 __wcstoul_internal -- underlying function for 2583 wcstoul 2584 2585 __xmknod -- make block or character special file 2586 __xstat -- get File Status 2587 __xstat64 -- get File Status 2588 _environ -- alias for environ - user environment 2589 _nl_msg_cat_cntr -- new catalog load counter 2590 _sys_errlist -- array containing the "C" locale 2591 strings used by strerror() 2592 2593 _sys_siglist -- array containing the names of the 2594 signal names 2595 2596 acct -- switch process accounting on or off 2597 adjtime -- correct the time to allow 2598 synchronization of the system clock 2599 2600 asprintf -- write formatted output to a dynamically 2601 allocated string 2602 2603 bind_textdomain_codeset -- specify encoding for 2604 message retrieval 2605 2606 bindresvport -- bind socket to privileged IP port 2607 bindtextdomain -- specify the location of a message 2608 catalog 2609 2610 cfmakeraw -- get and set terminal attributes 2611 cfsetspeed -- set terminal input and output data 2612 rate 2613 2614 daemon -- run in the background 2615 dcgettext -- perform domain and category specific 2616 lookup in message catalog 2617 2618 dcngettext -- perform domain and category specific 2619 lookup in message catalog with plural 2620 2621 dgettext -- perform lookup in message catalog for 2622 the current LC_MESSAGES locale 2623 2624 dngettext -- perform lookup in message catalog for 2625 the current locale 2626 2627 duplocale -- provide new handle for selection of 2628 locale 2629 2630 endutent -- access utmp file entries 2631 err -- display formatted error messages 2632 error -- print error message 2633 errx -- display formatted error message and exit 2634 fcntl -- file control 2635 fflush_unlocked -- non thread safe fflush 2636 fgetwc_unlocked -- non thread safe fgetwc 2637 flock -- apply or remove an advisory lock on an 2638 open file 2639 2640 freelocale -- free a locale object 2641 fscanf -- convert formatted input 2642 fstatfs -- (deprecated) 2643 fstatfs64 -- (deprecated) 2644 fwscanf -- convert formatted input 2645 getgrouplist -- get network group entry 2646 getloadavg -- get system load averages 2647 getopt -- parse command line options 2648 getopt_long -- parse command line options 2649 getopt_long_only -- parse command line options 2650 getsockopt -- get socket options 2651 gettext -- search message catalogs for a string 2652 getutent -- access user accounting database entries 2653 2654 getutent_r -- access user accounting database 2655 entries 2656 2657 glob64 -- find pathnames matching a pattern (Large 2658 File Support) 2659 2660 globfree64 -- free memory from glob64() (Large File 2661 Support) 2662 2663 initgroups -- initialize the supplementary group 2664 access list 2665 2666 ioctl -- control device 2667 sockio -- socket ioctl commands 2668 ttyio -- tty ioctl commands 2669 kill -- send a signal 2670 link -- create a link to a file 2671 mbsnrtowcs -- convert a multibyte string to a wide 2672 character string 2673 2674 memmem -- locate bytes 2675 memrchr -- scan memory for a character 2676 newlocale -- allocate a locale object 2677 ngettext -- search message catalogs for plural 2678 string 2679 2680 pmap_getport -- find the port number assigned to a 2681 service registered with a portmapper. 2682 2683 pmap_set -- establishes mapping to machine's RPC 2684 Bind service. 2685 2686 pmap_unset -- destroys RPC Binding 2687 psignal -- print signal message 2688 regexec -- regular expression matching 2689 scanf -- convert formatted input 2690 setbuffer -- stream buffering operation 2691 setgroups -- set list of supplementary group IDs 2692 sethostname -- set host name 2693 setsockopt -- set socket options 2694 setutent -- access user accounting database entries 2695 sigandset -- build a new signal set by combining 2696 the two input sets using logical AND 2697 2698 sigisemptyset -- check for empty signal set 2699 sigorset -- build a new signal set by combining the 2700 two input sets using logical OR 2701 2702 sigreturn -- return from signal handler and cleanup 2703 stack frame 2704 2705 sscanf -- convert formatted input 2706 statfs -- (deprecated) 2707 statfs64 -- (deprecated) 2708 stime -- set time 2709 stpcpy -- copy a string returning a pointer to its 2710 end 2711 2712 stpncpy -- copy a fixed-size string, returning a 2713 pointer to its end 2714 2715 strcasestr -- locate a substring ignoring case 2716 strerror_r -- reentrant version of strerror 2717 strndup -- return a malloc'd copy of at most the 2718 specified number of bytes of a string 2719 2720 strnlen -- determine the length of a fixed-size 2721 string 2722 2723 strptime -- parse a time string 2724 strsep -- extract token from string 2725 strsignal -- return string describing signal 2726 strtoq -- convert string value to a long or quad_t 2727 integer 2728 2729 strtouq -- convert a string to an unsigned long 2730 long 2731 2732 svc_register -- register Remote Procedure Call 2733 interface 2734 2735 svc_run -- waits for RPC requests to arrive and 2736 calls service procedure 2737 2738 svc_sendreply -- called by RPC service's dispatch 2739 routine 2740 2741 svctcp_create -- create a TCP/IP-based RPC service 2742 transport 2743 2744 svcudp_create -- create a UDP-based RPC service 2745 transport 2746 2747 swscanf -- convert formatted input 2748 system -- execute a shell command 2749 textdomain -- set the current default message 2750 domain 2751 2752 unlink -- remove a directory entry 2753 uselocale -- set locale for thread 2754 utmpname -- set user accounting database 2755 vasprintf -- write formatted output to a 2756 dynamically allocated string 2757 2758 vdprintf -- write formatted output to a file 2759 descriptor 2760 2761 verrx -- display formatted error message and exit 2762 vfscanf -- convert formatted input 2763 vfwscanf -- convert formatted input 2764 vscanf -- convert formatted input 2765 vsscanf -- convert formatted input 2766 vswscanf -- convert formatted input 2767 vsyslog -- log to system log 2768 vwscanf -- convert formatted input 2769 wait4 -- wait for process termination, BSD style 2770 waitpid -- wait for child process 2771 warn -- formatted error messages 2772 warnx -- formatted error messages 2773 wcpcpy -- copy a wide character string, returning a 2774 pointer to its end 2775 2776 wcpncpy -- copy a fixed-size string of wide 2777 characters, returning a pointer to its end 2778 2779 wcscasecmp -- compare two wide-character strings, 2780 ignoring case 2781 2782 wcsdup -- duplicate a wide-character string 2783 wcsncasecmp -- compare two fixed-size 2784 wide-character strings, ignoring case 2785 2786 wcsnlen -- determine the length of a fixed-size 2787 wide-character string 2788 2789 wcsnrtombs -- convert a wide character string to a 2790 multi-byte string 2791 2792 wcstoq -- convert wide string to long long int 2793 representation 2794 2795 wcstouq -- convert wide string to unsigned long 2796 long int representation 2797 2798 wscanf -- convert formatted input 2799 xdr_u_int -- library routines for external data 2800 representation 2801 2802 13.6. Interfaces for libm 2803 2804 13.6.1. Math 2805 2806 13.7. Data Definitions for libm 2807 2808 13.7.1. complex.h 2809 13.7.2. fenv.h 2810 13.7.3. math.h 2811 2812 13.8. Interface Definitions for libm 2813 2814 __fpclassify -- Classify real floating type 2815 __fpclassifyf -- Classify real floating type 2816 2817 13.9. Interfaces for libpthread 2818 2819 13.9.1. Realtime Threads 2820 13.9.2. Advanced Realtime Threads 2821 13.9.3. Posix Threads 2822 13.9.4. Thread aware versions of libc interfaces 2823 2824 13.10. Data Definitions for libpthread 2825 2826 13.10.1. pthread.h 2827 13.10.2. semaphore.h 2828 2829 13.11. Interface Definitions for libpthread 2830 2831 _pthread_cleanup_pop -- establish cancellation 2832 handlers 2833 2834 _pthread_cleanup_push -- establish cancellation 2835 handlers 2836 2837 13.12. Interfaces for libgcc_s 2838 2839 13.12.1. Unwind Library 2840 2841 13.13. Data Definitions for libgcc_s 2842 2843 13.13.1. unwind.h 2844 2845 13.14. Interfaces for libdl 2846 2847 13.14.1. Dynamic Loader 2848 2849 13.15. Data Definitions for libdl 2850 2851 13.15.1. dlfcn.h 2852 2853 13.16. Interface Definitions for libdl 2854 2855 dladdr -- find the shared object containing a given 2856 address 2857 2858 dlopen -- open dynamic object 2859 dlsym -- obtain the address of a symbol from a 2860 dlopen object 2861 2862 13.17. Interfaces for librt 2863 2864 13.17.1. Shared Memory Objects 2865 13.17.2. Clock 2866 13.17.3. Timers 2867 2868 13.18. Interfaces for libcrypt 2869 2870 13.18.1. Encryption 2871 2872 13.19. Interfaces for libpam 2873 2874 13.19.1. Pluggable Authentication API 2875 2876 13.20. Data Definitions for libpam 2877 2878 13.20.1. security/pam_appl.h 2879 2880 13.21. Interface Definitions for libpam 2881 2882 pam_acct_mgmt -- establish the status of a user's 2883 account 2884 2885 pam_authenticate -- authenticate the user 2886 pam_chauthtok -- change the authentication token 2887 for a given user 2888 2889 pam_close_session -- indicate that an authenticated 2890 session has ended 2891 2892 pam_end -- terminate the use of the PAM library 2893 pam_fail_delay -- specify delay time to use on 2894 authentication error 2895 2896 pam_get_item -- obtain the value of the indicated 2897 item. 2898 2899 pam_getenvlist -- returns a pointer to the complete 2900 PAM environment. 2901 2902 pam_open_session -- indicate session has started 2903 pam_set_item -- (re)set the value of an item. 2904 pam_setcred -- set the module-specific credentials 2905 of the user 2906 2907 pam_start -- initialize the PAM library 2908 pam_strerror -- returns a string describing the PAM 2909 error 2910 _________________________________________________________ 2911 2912 Chapter 13. Base Libraries 2913 2914 13.1. Introduction 2915 2916 An LSB-conforming implementation shall support the following 2917 base libraries which provide interfaces for accessing the 2918 operating system, processor and other hardware in the system. 2919 2920 * libc 2921 * libm 2922 * libgcc_s 2923 * libdl 2924 * librt 2925 * libcrypt 2926 * libpam 2927 2928 There are three main parts to the definition of each of these 2929 libraries. 2930 2931 The "Interfaces" section defines the required library name and 2932 version, and the required public symbols (interfaces and 2933 global data), as well as symbol versions, if any. 2934 2935 The "Interface Definitions" section provides complete or 2936 partial definitions of certain interfaces where either this 2937 specification is the source specification, or where there are 2938 variations from the source specification. If an interface 2939 definition requires one or more header files, one of those 2940 headers shall include the function prototype for the 2941 interface. 2942 2943 For source definitions of interfaces which include a reference 2944 to a header file, the contents of such header files form a 2945 part of the specification. The "Data Definitions" section 2946 provides the binary-level details for the header files from 2947 the source specifications, such as values for macros and 2948 enumerated types, as well as structure layouts, sizes and 2949 padding, etc. These data definitions, although presented in 2950 the form of header files for convenience, should not be taken 2951 a representing complete header files, as they are a supplement 2952 to the source specifications. Application developers should 2953 follow the guidelines of the source specifications when 2954 determining which header files need to be included to 2955 completely resolve all references. 2956 2957 Note: While the Data Definitions supplement the source 2958 specifications, this specification itself does not require 2959 conforming implementations to supply any header files. 2960 _________________________________________________________ 2961 2962 13.2. Program Interpreter 2963 2964 The Program Interpreter is specified in the appropriate 2965 architecture specific part of ISO/IEC 23360. 2966 _________________________________________________________ 2967 2968 13.3. Interfaces for libc 2969 2970 Table 13-1 defines the library name and shared object name for 2971 the libc library 2972 2973 Table 13-1. libc Definition 2974 Library: libc 2975 SONAME: See archLSB. 2976 2977 The behavior of the interfaces in this library is specified by 2978 the following specifications: 2979 2980 [LFS] Large File Support 2981 [LSB] This Specification 2982 [SUSv2] SUSv2 2983 [SUSv3] ISO POSIX (2003) 2984 [SVID.3] SVID Issue 3 2985 [SVID.4] SVID Issue 4 2986 _________________________________________________________ 2987 2988 13.3.1. RPC 2989 _________________________________________________________ 2990 2991 13.3.1.1. Interfaces for RPC 2992 2993 An LSB conforming implementation shall provide the generic 2994 functions for RPC specified in Table 13-2, with the full 2995 mandatory functionality as described in the referenced 2996 underlying specification. 2997 2998 Table 13-2. libc - RPC Function Interfaces 2999 authnone_create [SVID.4] clnt_create [SVID.4] 3000 clnt_pcreateerror [SVID.4] clnt_perrno [SVID.4] 3001 clnt_perror [SVID.4] clnt_spcreateerror [SVID.4] clnt_sperrno 3002 [SVID.4] clnt_sperror [SVID.4] 3003 key_decryptsession [SVID.3] pmap_getport [LSB] pmap_set [LSB] 3004 pmap_unset [LSB] 3005 svc_getreqset [SVID.3] svc_register [LSB] svc_run [LSB] 3006 svc_sendreply [LSB] 3007 svcerr_auth [SVID.3] svcerr_decode [SVID.3] svcerr_noproc 3008 [SVID.3] svcerr_noprog [SVID.3] 3009 svcerr_progvers [SVID.3] svcerr_systemerr [SVID.3] 3010 svcerr_weakauth [SVID.3] svctcp_create [LSB] 3011 svcudp_create [LSB] xdr_accepted_reply [SVID.3] xdr_array 3012 [SVID.3] xdr_bool [SVID.3] 3013 xdr_bytes [SVID.3] xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] 3014 xdr_char [SVID.3] 3015 xdr_double [SVID.3] xdr_enum [SVID.3] xdr_float [SVID.3] 3016 xdr_free [SVID.3] 3017 xdr_int [SVID.3] xdr_long [SVID.3] xdr_opaque [SVID.3] 3018 xdr_opaque_auth [SVID.3] 3019 xdr_pointer [SVID.3] xdr_reference [SVID.3] xdr_rejected_reply 3020 [SVID.3] xdr_replymsg [SVID.3] 3021 xdr_short [SVID.3] xdr_string [SVID.3] xdr_u_char [SVID.3] 3022 xdr_u_int [LSB] 3023 xdr_u_long [SVID.3] xdr_u_short [SVID.3] xdr_union [SVID.3] 3024 xdr_vector [SVID.3] 3025 xdr_void [SVID.3] xdr_wrapstring [SVID.3] xdrmem_create 3026 [SVID.3] xdrrec_create [SVID.3] 3027 xdrrec_eof [SVID.3] 3028 _________________________________________________________ 3029 3030 13.3.2. System Calls 3031 _________________________________________________________ 3032 3033 13.3.2.1. Interfaces for System Calls 3034 3035 An LSB conforming implementation shall provide the generic 3036 functions for System Calls specified in Table 13-3, with the 3037 full mandatory functionality as described in the referenced 3038 underlying specification. 3039 3040 Table 13-3. libc - System Calls Function Interfaces 3041 __fxstat [LSB] __getpgid [LSB] __lxstat [LSB] __xmknod [LSB] 3042 __xstat [LSB] access [SUSv3] acct [LSB] alarm [SUSv3] 3043 brk [SUSv2] chdir [SUSv3] chmod [SUSv3] chown [SUSv3] 3044 chroot [SUSv2] clock [SUSv3] close [SUSv3] closedir [SUSv3] 3045 creat [SUSv3] dup [SUSv3] dup2 [SUSv3] execl [SUSv3] 3046 execle [SUSv3] execlp [SUSv3] execv [SUSv3] execve [SUSv3] 3047 execvp [SUSv3] exit [SUSv3] fchdir [SUSv3] fchmod [SUSv3] 3048 fchown [SUSv3] fcntl [LSB] fdatasync [SUSv3] flock [LSB] 3049 fork [SUSv3] fstatfs [LSB] fstatvfs [SUSv3] fsync [SUSv3] 3050 ftime [SUSv3] ftruncate [SUSv3] getcontext [SUSv3] getegid 3051 [SUSv3] 3052 geteuid [SUSv3] getgid [SUSv3] getgroups [SUSv3] getitimer 3053 [SUSv3] 3054 getloadavg [LSB] getpagesize [SUSv2] getpgid [SUSv3] getpgrp 3055 [SUSv3] 3056 getpid [SUSv3] getppid [SUSv3] getpriority [SUSv3] getrlimit 3057 [SUSv3] 3058 getrusage [SUSv3] getsid [SUSv3] getuid [SUSv3] getwd [SUSv3] 3059 initgroups [LSB] ioctl [LSB] kill [LSB] killpg [SUSv3] 3060 lchown [SUSv3] link [LSB] lockf [SUSv3] lseek [SUSv3] 3061 mkdir [SUSv3] mkfifo [SUSv3] mlock [SUSv3] mlockall [SUSv3] 3062 mmap [SUSv3] mprotect [SUSv3] msync [SUSv3] munlock [SUSv3] 3063 munlockall [SUSv3] munmap [SUSv3] nanosleep [SUSv3] nice 3064 [SUSv3] 3065 open [SUSv3] opendir [SUSv3] pathconf [SUSv3] pause [SUSv3] 3066 pipe [SUSv3] poll [SUSv3] read [SUSv3] readdir [SUSv3] 3067 readdir_r [SUSv3] readlink [SUSv3] readv [SUSv3] rename 3068 [SUSv3] 3069 rmdir [SUSv3] sbrk [SUSv2] sched_get_priority_max [SUSv3] 3070 sched_get_priority_min [SUSv3] 3071 sched_getparam [SUSv3] sched_getscheduler [SUSv3] 3072 sched_rr_get_interval [SUSv3] sched_setparam [SUSv3] 3073 sched_setscheduler [SUSv3] sched_yield [SUSv3] select [SUSv3] 3074 setcontext [SUSv3] 3075 setegid [SUSv3] seteuid [SUSv3] setgid [SUSv3] setitimer 3076 [SUSv3] 3077 setpgid [SUSv3] setpgrp [SUSv3] setpriority [SUSv3] setregid 3078 [SUSv3] 3079 setreuid [SUSv3] setrlimit [SUSv3] setrlimit64 [LFS] setsid 3080 [SUSv3] 3081 setuid [SUSv3] sleep [SUSv3] statfs [LSB] statvfs [SUSv3] 3082 stime [LSB] symlink [SUSv3] sync [SUSv3] sysconf [SUSv3] 3083 time [SUSv3] times [SUSv3] truncate [SUSv3] ulimit [SUSv3] 3084 umask [SUSv3] uname [SUSv3] unlink [LSB] utime [SUSv3] 3085 utimes [SUSv3] vfork [SUSv3] wait [SUSv3] wait4 [LSB] 3086 waitpid [LSB] write [SUSv3] writev [SUSv3] 3087 _________________________________________________________ 3088 3089 13.3.3. Standard I/O 3090 _________________________________________________________ 3091 3092 13.3.3.1. Interfaces for Standard I/O 3093 3094 An LSB conforming implementation shall provide the generic 3095 functions for Standard I/O specified in Table 13-4, with the 3096 full mandatory functionality as described in the referenced 3097 underlying specification. 3098 3099 Table 13-4. libc - Standard I/O Function Interfaces 3100 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 3101 asprintf [LSB] clearerr [SUSv3] ctermid [SUSv3] fclose [SUSv3] 3102 fdopen [SUSv3] feof [SUSv3] ferror [SUSv3] fflush [SUSv3] 3103 fflush_unlocked [LSB] fgetc [SUSv3] fgetpos [SUSv3] fgets 3104 [SUSv3] 3105 fgetwc_unlocked [LSB] fileno [SUSv3] flockfile [SUSv3] fopen 3106 [SUSv3] 3107 fprintf [SUSv3] fputc [SUSv3] fputs [SUSv3] fread [SUSv3] 3108 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 3109 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 3110 getc [SUSv3] getc_unlocked [SUSv3] getchar [SUSv3] 3111 getchar_unlocked [SUSv3] 3112 getw [SUSv2] pclose [SUSv3] popen [SUSv3] printf [SUSv3] 3113 putc [SUSv3] putc_unlocked [SUSv3] putchar [SUSv3] 3114 putchar_unlocked [SUSv3] 3115 puts [SUSv3] putw [SUSv2] remove [SUSv3] rewind [SUSv3] 3116 rewinddir [SUSv3] scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] 3117 setbuffer [LSB] setvbuf [SUSv3] snprintf [SUSv3] sprintf 3118 [SUSv3] 3119 sscanf [LSB] telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] 3120 vasprintf [LSB] vdprintf [LSB] vfprintf [SUSv3] vprintf 3121 [SUSv3] 3122 vsnprintf [SUSv3] vsprintf [SUSv3] 3123 3124 An LSB conforming implementation shall provide the generic 3125 data interfaces for Standard I/O specified in Table 13-5, with 3126 the full mandatory functionality as described in the 3127 referenced underlying specification. 3128 3129 Table 13-5. libc - Standard I/O Data Interfaces 3130 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 3131 _________________________________________________________ 3132 3133 13.3.4. Signal Handling 3134 _________________________________________________________ 3135 3136 13.3.4.1. Interfaces for Signal Handling 3137 3138 An LSB conforming implementation shall provide the generic 3139 functions for Signal Handling specified in Table 13-6, with 3140 the full mandatory functionality as described in the 3141 referenced underlying specification. 3142 3143 Table 13-6. libc - Signal Handling Function Interfaces 3144 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 3145 __sigsetjmp [LSB] __sysv_signal [LSB] 3146 bsd_signal [SUSv3] psignal [LSB] raise [SUSv3] sigaction 3147 [SUSv3] 3148 sigaddset [SUSv3] sigaltstack [SUSv3] sigandset [LSB] 3149 sigdelset [SUSv3] 3150 sigemptyset [SUSv3] sigfillset [SUSv3] sighold [SUSv3] 3151 sigignore [SUSv3] 3152 siginterrupt [SUSv3] sigisemptyset [LSB] sigismember [SUSv3] 3153 siglongjmp [SUSv3] 3154 signal [SUSv3] sigorset [LSB] sigpause [SUSv3] sigpending 3155 [SUSv3] 3156 sigprocmask [SUSv3] sigqueue [SUSv3] sigrelse [SUSv3] 3157 sigreturn [LSB] 3158 sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait [SUSv3] sigwait 3159 [SUSv3] 3160 sigwaitinfo [SUSv3] 3161 3162 An LSB conforming implementation shall provide the generic 3163 data interfaces for Signal Handling specified in Table 13-7, 3164 with the full mandatory functionality as described in the 3165 referenced underlying specification. 3166 3167 Table 13-7. libc - Signal Handling Data Interfaces 3168 _sys_siglist [LSB] 3169 _________________________________________________________ 3170 3171 13.3.5. Localization Functions 3172 _________________________________________________________ 3173 3174 13.3.5.1. Interfaces for Localization Functions 3175 3176 An LSB conforming implementation shall provide the generic 3177 functions for Localization Functions specified in Table 13-8, 3178 with the full mandatory functionality as described in the 3179 referenced underlying specification. 3180 3181 Table 13-8. libc - Localization Functions Function Interfaces 3182 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 3183 [SUSv3] catgets [SUSv3] 3184 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext 3185 [LSB] 3186 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 3187 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 3188 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] 3189 localeconv [SUSv3] 3190 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 3191 setlocale [SUSv3] 3192 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 3193 3194 An LSB conforming implementation shall provide the generic 3195 data interfaces for Localization Functions specified in Table 3196 13-9, with the full mandatory functionality as described in 3197 the referenced underlying specification. 3198 3199 Table 13-9. libc - Localization Functions Data Interfaces 3200 _nl_msg_cat_cntr [LSB] 3201 _________________________________________________________ 3202 3203 13.3.6. Socket Interface 3204 _________________________________________________________ 3205 3206 13.3.6.1. Interfaces for Socket Interface 3207 3208 An LSB conforming implementation shall provide the generic 3209 functions for Socket Interface specified in Table 13-10, with 3210 the full mandatory functionality as described in the 3211 referenced underlying specification. 3212 3213 Table 13-10. libc - Socket Interface Function Interfaces 3214 __h_errno_location [LSB] accept [SUSv3] bind [SUSv3] 3215 bindresvport [LSB] 3216 connect [SUSv3] gethostid [SUSv3] gethostname [SUSv3] 3217 getpeername [SUSv3] 3218 getsockname [SUSv3] getsockopt [LSB] if_freenameindex [SUSv3] 3219 if_indextoname [SUSv3] 3220 if_nameindex [SUSv3] if_nametoindex [SUSv3] listen [SUSv3] 3221 recv [SUSv3] 3222 recvfrom [SUSv3] recvmsg [SUSv3] send [SUSv3] sendmsg [SUSv3] 3223 sendto [SUSv3] setsockopt [LSB] shutdown [SUSv3] sockatmark 3224 [SUSv3] 3225 socket [SUSv3] socketpair [SUSv3] 3226 _________________________________________________________ 3227 3228 13.3.7. Wide Characters 3229 _________________________________________________________ 3230 3231 13.3.7.1. Interfaces for Wide Characters 3232 3233 An LSB conforming implementation shall provide the generic 3234 functions for Wide Characters specified in Table 13-11, with 3235 the full mandatory functionality as described in the 3236 referenced underlying specification. 3237 3238 Table 13-11. libc - Wide Characters Function Interfaces 3239 __wcstod_internal [LSB] __wcstof_internal [LSB] 3240 __wcstol_internal [LSB] __wcstold_internal [LSB] 3241 __wcstoul_internal [LSB] btowc [SUSv3] fgetwc [SUSv3] fgetws 3242 [SUSv3] 3243 fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] fwprintf [SUSv3] 3244 fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] mblen [SUSv3] 3245 mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] mbsnrtowcs 3246 [LSB] 3247 mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc [SUSv3] putwc 3248 [SUSv3] 3249 putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] towctrans 3250 [SUSv3] 3251 towlower [SUSv3] towupper [SUSv3] ungetwc [SUSv3] vfwprintf 3252 [SUSv3] 3253 vfwscanf [LSB] vswprintf [SUSv3] vswscanf [LSB] vwprintf 3254 [SUSv3] 3255 vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] wcrtomb [SUSv3] 3256 wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] wcscmp [SUSv3] 3257 wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] wcsdup [LSB] 3258 wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] wcsncat 3259 [SUSv3] 3260 wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] wcsnrtombs [LSB] 3261 wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs [SUSv3] wcsspn 3262 [SUSv3] 3263 wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] wcstoimax [SUSv3] 3264 wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] wcstoll [SUSv3] 3265 wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] wcstoull [SUSv3] 3266 wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] wcswidth 3267 [SUSv3] 3268 wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] wctrans [SUSv3] 3269 wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] wmemcmp [SUSv3] 3270 wmemcpy [SUSv3] wmemmove [SUSv3] wmemset [SUSv3] wprintf 3271 [SUSv3] 3272 wscanf [LSB] 3273 _________________________________________________________ 3274 3275 13.3.8. String Functions 3276 _________________________________________________________ 3277 3278 13.3.8.1. Interfaces for String Functions 3279 3280 An LSB conforming implementation shall provide the generic 3281 functions for String Functions specified in Table 13-12, with 3282 the full mandatory functionality as described in the 3283 referenced underlying specification. 3284 3285 Table 13-12. libc - String Functions Function Interfaces 3286 __mempcpy [LSB] __rawmemchr [LSB] __stpcpy [LSB] __strdup 3287 [LSB] 3288 __strtod_internal [LSB] __strtof_internal [LSB] __strtok_r 3289 [LSB] __strtol_internal [LSB] 3290 __strtold_internal [LSB] __strtoll_internal [LSB] 3291 __strtoul_internal [LSB] __strtoull_internal [LSB] 3292 bcmp [SUSv3] bcopy [SUSv3] bzero [SUSv3] ffs [SUSv3] 3293 index [SUSv3] memccpy [SUSv3] memchr [SUSv3] memcmp [SUSv3] 3294 memcpy [SUSv3] memmove [SUSv3] memrchr [LSB] memset [SUSv3] 3295 rindex [SUSv3] stpcpy [LSB] stpncpy [LSB] strcasecmp [SUSv3] 3296 strcasestr [LSB] strcat [SUSv3] strchr [SUSv3] strcmp [SUSv3] 3297 strcoll [SUSv3] strcpy [SUSv3] strcspn [SUSv3] strdup [SUSv3] 3298 strerror [SUSv3] strerror_r [LSB] strfmon [SUSv3] strftime 3299 [SUSv3] 3300 strlen [SUSv3] strncasecmp [SUSv3] strncat [SUSv3] strncmp 3301 [SUSv3] 3302 strncpy [SUSv3] strndup [LSB] strnlen [LSB] strpbrk [SUSv3] 3303 strptime [LSB] strrchr [SUSv3] strsep [LSB] strsignal [LSB] 3304 strspn [SUSv3] strstr [SUSv3] strtof [SUSv3] strtoimax [SUSv3] 3305 strtok [SUSv3] strtok_r [SUSv3] strtold [SUSv3] strtoll 3306 [SUSv3] 3307 strtoq [LSB] strtoull [SUSv3] strtoumax [SUSv3] strtouq [LSB] 3308 strxfrm [SUSv3] swab [SUSv3] 3309 _________________________________________________________ 3310 3311 13.3.9. IPC Functions 3312 _________________________________________________________ 3313 3314 13.3.9.1. Interfaces for IPC Functions 3315 3316 An LSB conforming implementation shall provide the generic 3317 functions for IPC Functions specified in Table 13-13, with the 3318 full mandatory functionality as described in the referenced 3319 underlying specification. 3320 3321 Table 13-13. libc - IPC Functions Function Interfaces 3322 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 3323 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 3324 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 3325 _________________________________________________________ 3326 3327 13.3.10. Regular Expressions 3328 _________________________________________________________ 3329 3330 13.3.10.1. Interfaces for Regular Expressions 3331 3332 An LSB conforming implementation shall provide the generic 3333 functions for Regular Expressions specified in Table 13-14, 3334 with the full mandatory functionality as described in the 3335 referenced underlying specification. 3336 3337 Table 13-14. libc - Regular Expressions Function Interfaces 3338 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 3339 _________________________________________________________ 3340 3341 13.3.11. Character Type Functions 3342 _________________________________________________________ 3343 3344 13.3.11.1. Interfaces for Character Type Functions 3345 3346 An LSB conforming implementation shall provide the generic 3347 functions for Character Type Functions specified in Table 3348 13-15, with the full mandatory functionality as described in 3349 the referenced underlying specification. 3350 3351 Table 13-15. libc - Character Type Functions Function 3352 Interfaces 3353 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 3354 __ctype_tolower_loc(GLIBC_2.3) [LSB] 3355 __ctype_toupper_loc(GLIBC_2.3) [LSB] 3356 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 3357 [SUSv3] 3358 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph 3359 [SUSv3] 3360 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace 3361 [SUSv3] 3362 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 3363 [SUSv3] 3364 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 3365 [SUSv3] 3366 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 3367 [SUSv3] 3368 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 3369 [SUSv3] 3370 tolower [SUSv3] toupper [SUSv3] 3371 _________________________________________________________ 3372 3373 13.3.12. Time Manipulation 3374 _________________________________________________________ 3375 3376 13.3.12.1. Interfaces for Time Manipulation 3377 3378 An LSB conforming implementation shall provide the generic 3379 functions for Time Manipulation specified in Table 13-16, with 3380 the full mandatory functionality as described in the 3381 referenced underlying specification. 3382 3383 Table 13-16. libc - Time Manipulation Function Interfaces 3384 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 3385 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 3386 [SUSv3] 3387 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 3388 [SUSv3] 3389 ualarm [SUSv3] 3390 3391 An LSB conforming implementation shall provide the generic 3392 data interfaces for Time Manipulation specified in Table 3393 13-17, with the full mandatory functionality as described in 3394 the referenced underlying specification. 3395 3396 Table 13-17. libc - Time Manipulation Data Interfaces 3397 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 3398 [SUSv3] 3399 timezone [SUSv3] tzname [SUSv3] 3400 _________________________________________________________ 3401 3402 13.3.13. Terminal Interface Functions 3403 _________________________________________________________ 3404 3405 13.3.13.1. Interfaces for Terminal Interface Functions 3406 3407 An LSB conforming implementation shall provide the generic 3408 functions for Terminal Interface Functions specified in Table 3409 13-18, with the full mandatory functionality as described in 3410 the referenced underlying specification. 3411 3412 Table 13-18. libc - Terminal Interface Functions Function 3413 Interfaces 3414 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 3415 cfsetispeed [SUSv3] 3416 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 3417 [SUSv3] 3418 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 3419 [SUSv3] 3420 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 3421 _________________________________________________________ 3422 3423 13.3.14. System Database Interface 3424 _________________________________________________________ 3425 3426 13.3.14.1. Interfaces for System Database Interface 3427 3428 An LSB conforming implementation shall provide the generic 3429 functions for System Database Interface specified in Table 3430 13-19, with the full mandatory functionality as described in 3431 the referenced underlying specification. 3432 3433 Table 13-19. libc - System Database Interface Function 3434 Interfaces 3435 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 3436 endservent [SUSv3] 3437 endutent [LSB] endutxent [SUSv3] getgrent [SUSv3] getgrgid 3438 [SUSv3] 3439 getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r [SUSv3] 3440 getgrouplist [LSB] 3441 gethostbyaddr [SUSv3] gethostbyname [SUSv3] getprotobyname 3442 [SUSv3] getprotobynumber [SUSv3] 3443 getprotoent [SUSv3] getpwent [SUSv3] getpwnam [SUSv3] 3444 getpwnam_r [SUSv3] 3445 getpwuid [SUSv3] getpwuid_r [SUSv3] getservbyname [SUSv3] 3446 getservbyport [SUSv3] 3447 getservent [SUSv3] getutent [LSB] getutent_r [LSB] getutxent 3448 [SUSv3] 3449 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] 3450 setgrent [SUSv3] 3451 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] 3452 setservent [SUSv3] 3453 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 3454 _________________________________________________________ 3455 3456 13.3.15. Language Support 3457 _________________________________________________________ 3458 3459 13.3.15.1. Interfaces for Language Support 3460 3461 An LSB conforming implementation shall provide the generic 3462 functions for Language Support specified in Table 13-20, with 3463 the full mandatory functionality as described in the 3464 referenced underlying specification. 3465 3466 Table 13-20. libc - Language Support Function Interfaces 3467 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 3468 _________________________________________________________ 3469 3470 13.3.16. Large File Support 3471 _________________________________________________________ 3472 3473 13.3.16.1. Interfaces for Large File Support 3474 3475 An LSB conforming implementation shall provide the generic 3476 functions for Large File Support specified in Table 13-21, 3477 with the full mandatory functionality as described in the 3478 referenced underlying specification. 3479 3480 Table 13-21. libc - Large File Support Function Interfaces 3481 __fxstat64 [LSB] __lxstat64 [LSB] __xstat64 [LSB] creat64 3482 [LFS] 3483 fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] fseeko64 [LFS] 3484 fsetpos64 [LFS] fstatfs64 [LSB] fstatvfs64 [LFS] ftello64 3485 [LFS] 3486 ftruncate64 [LFS] ftw64 [LFS] getrlimit64 [LFS] lockf64 [LFS] 3487 mkstemp64 [LFS] mmap64 [LFS] nftw64 [LFS] readdir64 [LFS] 3488 statfs64 [LSB] statvfs64 [LFS] tmpfile64 [LFS] truncate64 3489 [LFS] 3490 _________________________________________________________ 3491 3492 13.3.17. Standard Library 3493 _________________________________________________________ 3494 3495 13.3.17.1. Interfaces for Standard Library 3496 3497 An LSB conforming implementation shall provide the generic 3498 functions for Standard Library specified in Table 13-22, with 3499 the full mandatory functionality as described in the 3500 referenced underlying specification. 3501 3502 Table 13-22. libc - Standard Library Function Interfaces 3503 _Exit [SUSv3] __assert_fail [LSB] __cxa_atexit [LSB] 3504 __errno_location [LSB] 3505 __fpending [LSB] __getpagesize [LSB] __isinf [LSB] __isinff 3506 [LSB] 3507 __isinfl [LSB] __isnan [LSB] __isnanf [LSB] __isnanl [LSB] 3508 __sysconf [LSB] _exit [SUSv3] _longjmp [SUSv3] _setjmp [SUSv3] 3509 a64l [SUSv3] abort [SUSv3] abs [SUSv3] atof [SUSv3] 3510 atoi [SUSv3] atol [SUSv3] atoll [SUSv3] basename [SUSv3] 3511 bsearch [SUSv3] calloc [SUSv3] closelog [SUSv3] confstr 3512 [SUSv3] 3513 cuserid [SUSv2] daemon [LSB] dirname [SUSv3] div [SUSv3] 3514 drand48 [SUSv3] ecvt [SUSv3] erand48 [SUSv3] err [LSB] 3515 error [LSB] errx [LSB] fcvt [SUSv3] fmtmsg [SUSv3] 3516 fnmatch [SUSv3] fpathconf [SUSv3] free [SUSv3] freeaddrinfo 3517 [SUSv3] 3518 ftrylockfile [SUSv3] ftw [SUSv3] funlockfile [SUSv3] 3519 gai_strerror [SUSv3] 3520 gcvt [SUSv3] getaddrinfo [SUSv3] getcwd [SUSv3] getdate 3521 [SUSv3] 3522 getenv [SUSv3] getlogin [SUSv3] getlogin_r [SUSv3] getnameinfo 3523 [SUSv3] 3524 getopt [LSB] getopt_long [LSB] getopt_long_only [LSB] 3525 getsubopt [SUSv3] 3526 gettimeofday [SUSv3] glob [SUSv3] glob64 [LSB] globfree 3527 [SUSv3] 3528 globfree64 [LSB] grantpt [SUSv3] hcreate [SUSv3] hdestroy 3529 [SUSv3] 3530 hsearch [SUSv3] htonl [SUSv3] htons [SUSv3] imaxabs [SUSv3] 3531 imaxdiv [SUSv3] inet_addr [SUSv3] inet_ntoa [SUSv3] inet_ntop 3532 [SUSv3] 3533 inet_pton [SUSv3] initstate [SUSv3] insque [SUSv3] isatty 3534 [SUSv3] 3535 isblank [SUSv3] jrand48 [SUSv3] l64a [SUSv3] labs [SUSv3] 3536 lcong48 [SUSv3] ldiv [SUSv3] lfind [SUSv3] llabs [SUSv3] 3537 lldiv [SUSv3] longjmp [SUSv3] lrand48 [SUSv3] lsearch [SUSv3] 3538 makecontext [SUSv3] malloc [SUSv3] memmem [LSB] mkstemp 3539 [SUSv3] 3540 mktemp [SUSv3] mrand48 [SUSv3] nftw [SUSv3] nrand48 [SUSv3] 3541 ntohl [SUSv3] ntohs [SUSv3] openlog [SUSv3] perror [SUSv3] 3542 posix_memalign [SUSv3] posix_openpt [SUSv3] ptsname [SUSv3] 3543 putenv [SUSv3] 3544 qsort [SUSv3] rand [SUSv3] rand_r [SUSv3] random [SUSv3] 3545 realloc [SUSv3] realpath [SUSv3] remque [SUSv3] seed48 [SUSv3] 3546 setenv [SUSv3] sethostname [LSB] setlogmask [SUSv3] setstate 3547 [SUSv3] 3548 srand [SUSv3] srand48 [SUSv3] srandom [SUSv3] strtod [SUSv3] 3549 strtol [SUSv3] strtoul [SUSv3] swapcontext [SUSv3] syslog 3550 [SUSv3] 3551 system [LSB] tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] 3552 tmpnam [SUSv3] tsearch [SUSv3] ttyname [SUSv3] ttyname_r 3553 [SUSv3] 3554 twalk [SUSv3] unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] 3555 verrx [LSB] vfscanf [LSB] vscanf [LSB] vsscanf [LSB] 3556 vsyslog [LSB] warn [LSB] warnx [LSB] wordexp [SUSv3] 3557 wordfree [SUSv3] 3558 3559 An LSB conforming implementation shall provide the generic 3560 data interfaces for Standard Library specified in Table 13-23, 3561 with the full mandatory functionality as described in the 3562 referenced underlying specification. 3563 3564 Table 13-23. libc - Standard Library Data Interfaces 3565 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 3566 [SUSv3] 3567 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 3568 [SUSv3] 3569 optopt [SUSv3] 3570 _________________________________________________________ 3571 3572 13.4. Data Definitions for libc 3573 3574 This section defines global identifiers and their values that 3575 are associated with interfaces contained in libc. These 3576 definitions are organized into groups that correspond to 3577 system headers. This convention is used as a convenience for 3578 the reader, and does not imply the existence of these headers, 3579 or their content. Where an interface is defined as requiring a 3580 particular system header file all of the data definitions for 3581 that system header file presented here shall be in effect. 3582 3583 This section gives data definitions to promote binary 3584 application portability, not to repeat source interface 3585 definitions available elsewhere. System providers and 3586 application developers should use this ABI to supplement - not 3587 to replace - source interface definition specifications. 3588 3589 This specification uses the ISO C (1999) C Language as the 3590 reference programming language, and data definitions are 3591 specified in ISO C format. The C language is used here as a 3592 convenient notation. Using a C language description of these 3593 data objects does not preclude their use by other programming 3594 languages. 3595 _________________________________________________________ 3596 3597 13.4.1. arpa/inet.h 3598 3599 extern uint32_t htonl(uint32_t); 3600 extern uint16_t htons(uint16_t); 3601 extern in_addr_t inet_addr(const char *); 3602 extern char *inet_ntoa(struct in_addr); 3603 extern const char *inet_ntop(int, const void *, char *, socklen_t); 3604 extern int inet_pton(int, const char *, void *); 3605 extern uint32_t ntohl(uint32_t); 3606 extern uint16_t ntohs(uint16_t); 3607 _________________________________________________________ 3608 3609 13.4.2. assert.h 3610 3611 The assert.h header shall define the assert() macro. It refers 3612 to the macro NDEBUG, which is not defined in this header. If 3613 NDEBUG is defined before the inclusion of this header, the 3614 assert() macro shall be defined as described below, otherwise 3615 the macro shall behave as described in assert() in ISO/IEC 3616 9945 POSIX. 3617 extern void __assert_fail(const char *, const char *, unsigned int, 3618 const char *); 3619 _________________________________________________________ 3620 3621 13.4.3. ctype.h 3622 3623 enum { 3624 _ISupper = 256, 3625 _ISlower = 512, 3626 _ISalpha = 1024, 3627 _ISdigit = 2048, 3628 _ISxdigit = 4096, 3629 _ISspace = 8192, 3630 _ISprint = 16384, 3631 _ISgraph = 32768, 3632 _ISblank = 1, 3633 _IScntrl = 2, 3634 _ISpunct = 4, 3635 _ISalnum = 8 3636 }; 3637 extern int _tolower(int); 3638 extern int _toupper(int); 3639 extern int isalnum(int); 3640 extern int isalpha(int); 3641 extern int isascii(int); 3642 extern int iscntrl(int); 3643 extern int isdigit(int); 3644 extern int isgraph(int); 3645 extern int islower(int); 3646 extern int isprint(int); 3647 extern int ispunct(int); 3648 extern int isspace(int); 3649 extern int isupper(int); 3650 extern int isxdigit(int); 3651 extern int toascii(int); 3652 extern int tolower(int); 3653 extern int toupper(int); 3654 extern int isblank(int); 3655 extern const unsigned short **__ctype_b_loc(void); 3656 extern const int32_t **__ctype_toupper_loc(void); 3657 extern const int32_t **__ctype_tolower_loc(void); 3658 _________________________________________________________ 3659 3660 13.4.4. dirent.h 3661 3662 typedef struct __dirstream DIR; 3663 3664 struct dirent { 3665 long int d_ino; 3666 off_t d_off; 3667 unsigned short d_reclen; 3668 unsigned char d_type; 3669 char d_name[256]; 3670 }; 3671 struct dirent64 { 3672 uint64_t d_ino; 3673 int64_t d_off; 3674 unsigned short d_reclen; 3675 unsigned char d_type; 3676 char d_name[256]; 3677 }; 3678 extern void rewinddir(DIR *); 3679 extern void seekdir(DIR *, long int); 3680 extern long int telldir(DIR *); 3681 extern int closedir(DIR *); 3682 extern DIR *opendir(const char *); 3683 extern struct dirent *readdir(DIR *); 3684 extern struct dirent64 *readdir64(DIR *); 3685 extern int readdir_r(DIR *, struct dirent *, struct dirent **); 3686 _________________________________________________________ 3687 3688 13.4.5. err.h 3689 3690 extern void err(int, const char *, ...); 3691 extern void errx(int, const char *, ...); 3692 extern void warn(const char *, ...); 3693 extern void warnx(const char *, ...); 3694 extern void error(int, int, const char *, ...); 3695 _________________________________________________________ 3696 3697 13.4.6. errno.h 3698 3699 ISO POSIX (2003) requires that each error value shall be 3700 unique, with permission for EAGAIN and EWOULDBLOCK possibly 3701 having the same value. This specification also requires that 3702 ENOTSUP and EOPNOTSUPP have the same value. 3703 3704 Note: A defect report against ISO POSIX (2003) has been 3705 filed to request that specification also permit these two 3706 symbols to have the same value. 3707 3708 #define errno (*__errno_location()) 3709 3710 #define EPERM 1 3711 #define ECHILD 10 3712 #define ENETDOWN 100 3713 #define ENETUNREACH 101 3714 #define ENETRESET 102 3715 #define ECONNABORTED 103 3716 #define ECONNRESET 104 3717 #define ENOBUFS 105 3718 #define EISCONN 106 3719 #define ENOTCONN 107 3720 #define ESHUTDOWN 108 3721 #define ETOOMANYREFS 109 3722 #define EAGAIN 11 3723 #define ETIMEDOUT 110 3724 #define ECONNREFUSED 111 3725 #define EHOSTDOWN 112 3726 #define EHOSTUNREACH 113 3727 #define EALREADY 114 3728 #define EINPROGRESS 115 3729 #define ESTALE 116 3730 #define EUCLEAN 117 3731 #define ENOTNAM 118 3732 #define ENAVAIL 119 3733 #define ENOMEM 12 3734 #define EISNAM 120 3735 #define EREMOTEIO 121 3736 #define EDQUOT 122 3737 #define ENOMEDIUM 123 3738 #define EMEDIUMTYPE 124 3739 #define ECANCELED 125 3740 #define EACCES 13 3741 #define EFAULT 14 3742 #define ENOTBLK 15 3743 #define EBUSY 16 3744 #define EEXIST 17 3745 #define EXDEV 18 3746 #define ENODEV 19 3747 #define ENOENT 2 3748 #define ENOTDIR 20 3749 #define EISDIR 21 3750 #define EINVAL 22 3751 #define ENFILE 23 3752 #define EMFILE 24 3753 #define ENOTTY 25 3754 #define ETXTBSY 26 3755 #define EFBIG 27 3756 #define ENOSPC 28 3757 #define ESPIPE 29 3758 #define ESRCH 3 3759 #define EROFS 30 3760 #define EMLINK 31 3761 #define EPIPE 32 3762 #define EDOM 33 3763 #define ERANGE 34 3764 #define EDEADLK 35 3765 #define ENAMETOOLONG 36 3766 #define ENOLCK 37 3767 #define ENOSYS 38 3768 #define ENOTEMPTY 39 3769 #define EINTR 4 3770 #define ELOOP 40 3771 #define ENOMSG 42 3772 #define EIDRM 43 3773 #define ECHRNG 44 3774 #define EL2NSYNC 45 3775 #define EL3HLT 46 3776 #define EL3RST 47 3777 #define ELNRNG 48 3778 #define EUNATCH 49 3779 #define EIO 5 3780 #define ENOANO 55 3781 #define EBADRQC 56 3782 #define EBADSLT 57 3783 #define EBFONT 59 3784 #define ENXIO 6 3785 #define ENOSTR 60 3786 #define ENODATA 61 3787 #define ETIME 62 3788 #define ENOSR 63 3789 #define ENONET 64 3790 #define ENOPKG 65 3791 #define EREMOTE 66 3792 #define ENOLINK 67 3793 #define EADV 68 3794 #define ESRMNT 69 3795 #define E2BIG 7 3796 #define ECOMM 70 3797 #define EPROTO 71 3798 #define EMULTIHOP 72 3799 #define EDOTDOT 73 3800 #define EBADMSG 74 3801 #define EOVERFLOW 75 3802 #define ENOTUNIQ 76 3803 #define EBADFD 77 3804 #define EREMCHG 78 3805 #define ELIBACC 79 3806 #define ENOEXEC 8 3807 #define ELIBBAD 80 3808 #define ELIBSCN 81 3809 #define ELIBMAX 82 3810 #define ELIBEXEC 83 3811 #define EILSEQ 84 3812 #define ERESTART 85 3813 #define ESTRPIPE 86 3814 #define EUSERS 87 3815 #define ENOTSOCK 88 3816 #define EDESTADDRREQ 89 3817 #define EBADF 9 3818 #define EMSGSIZE 90 3819 #define EPROTOTYPE 91 3820 #define ENOPROTOOPT 92 3821 #define EPROTONOSUPPORT 93 3822 #define ESOCKTNOSUPPORT 94 3823 #define EOPNOTSUPP 95 3824 #define EPFNOSUPPORT 96 3825 #define EAFNOSUPPORT 97 3826 #define EADDRINUSE 98 3827 #define EADDRNOTAVAIL 99 3828 #define EWOULDBLOCK EAGAIN 3829 #define ENOTSUP EOPNOTSUPP 3830 3831 extern int *__errno_location(void); 3832 _________________________________________________________ 3833 3834 13.4.7. fcntl.h 3835 3836 #define O_RDONLY 00 3837 #define O_ACCMODE 0003 3838 #define O_WRONLY 01 3839 #define O_CREAT 0100 3840 #define O_TRUNC 01000 3841 #define O_SYNC 010000 3842 #define O_RDWR 02 3843 #define O_EXCL 0200 3844 #define O_APPEND 02000 3845 #define O_ASYNC 020000 3846 #define O_NOCTTY 0400 3847 #define O_NDELAY 04000 3848 #define O_NONBLOCK 04000 3849 #define FD_CLOEXEC 1 3850 3851 struct flock { 3852 short l_type; 3853 short l_whence; 3854 off_t l_start; 3855 off_t l_len; 3856 pid_t l_pid; 3857 }; 3858 struct flock64 { 3859 short l_type; 3860 short l_whence; 3861 loff_t l_start; 3862 loff_t l_len; 3863 pid_t l_pid; 3864 }; 3865 3866 #define F_DUPFD 0 3867 #define F_RDLCK 0 3868 #define F_GETFD 1 3869 #define F_WRLCK 1 3870 #define F_SETFD 2 3871 #define F_UNLCK 2 3872 #define F_GETFL 3 3873 #define F_SETFL 4 3874 #define F_GETLK 5 3875 #define F_SETLK 6 3876 #define F_SETLKW 7 3877 #define F_SETOWN 8 3878 #define F_GETOWN 9 3879 3880 extern int lockf64(int, int, off64_t); 3881 extern int fcntl(int, int, ...); 3882 _________________________________________________________ 3883 3884 13.4.8. fmtmsg.h 3885 3886 #define MM_HARD 1 3887 #define MM_NRECOV 128 3888 #define MM_UTIL 16 3889 #define MM_SOFT 2 3890 #define MM_OPSYS 32 3891 #define MM_FIRM 4 3892 #define MM_RECOVER 64 3893 #define MM_APPL 8 3894 3895 #define MM_NOSEV 0 3896 #define MM_HALT 1 3897 #define MM_ERROR 2 3898 3899 #define MM_NULLLBL ((char *) 0) 3900 3901 extern int fmtmsg(long int, const char *, int, const char *, const char *, 3902 const char *); 3903 _________________________________________________________ 3904 3905 13.4.9. fnmatch.h 3906 3907 #define FNM_PATHNAME (1<<0) 3908 #define FNM_NOESCAPE (1<<1) 3909 #define FNM_PERIOD (1<<2) 3910 #define FNM_NOMATCH 1 3911 3912 extern int fnmatch(const char *, const char *, int); 3913 _________________________________________________________ 3914 3915 13.4.10. ftw.h 3916 3917 #define FTW_D FTW_D 3918 #define FTW_DNR FTW_DNR 3919 #define FTW_DP FTW_DP 3920 #define FTW_F FTW_F 3921 #define FTW_NS FTW_NS 3922 #define FTW_SL FTW_SL 3923 #define FTW_SLN FTW_SLN 3924 3925 enum { 3926 FTW_F, 3927 FTW_D, 3928 FTW_DNR, 3929 FTW_NS, 3930 FTW_SL, 3931 FTW_DP, 3932 FTW_SLN 3933 }; 3934 3935 enum { 3936 FTW_PHYS = 1, 3937 FTW_MOUNT = 2, 3938 FTW_CHDIR = 4, 3939 FTW_DEPTH = 8 3940 }; 3941 3942 struct FTW { 3943 int base; 3944 int level; 3945 }; 3946 3947 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 3948 int __flag); 3949 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 3950 int __flag); 3951 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 3952 int __flag, struct FTW * __info); 3953 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 3954 int __flag, struct FTW * __info); 3955 extern int ftw(const char *, __ftw_func_t, int); 3956 extern int ftw64(const char *, __ftw64_func_t, int); 3957 extern int nftw(const char *, __nftw_func_t, int, int); 3958 extern int nftw64(const char *, __nftw64_func_t, int, int); 3959 _________________________________________________________ 3960 3961 13.4.11. getopt.h 3962 3963 #define no_argument 0 3964 #define required_argument 1 3965 #define optional_argument 2 3966 3967 struct option { 3968 const char *name; 3969 int has_arg; 3970 int *flag; 3971 int val; 3972 }; 3973 extern int getopt_long(int, char *const, const char *, 3974 const struct option *, int *); 3975 extern int getopt_long_only(int, char *const, const char *, 3976 const struct option *, int *); 3977 _________________________________________________________ 3978 3979 13.4.12. glob.h 3980 3981 #define GLOB_ERR (1<<0) 3982 #define GLOB_MARK (1<<1) 3983 #define GLOB_BRACE (1<<10) 3984 #define GLOB_NOMAGIC (1<<11) 3985 #define GLOB_TILDE (1<<12) 3986 #define GLOB_ONLYDIR (1<<13) 3987 #define GLOB_TILDE_CHECK (1<<14) 3988 #define GLOB_NOSORT (1<<2) 3989 #define GLOB_DOOFFS (1<<3) 3990 #define GLOB_NOCHECK (1<<4) 3991 #define GLOB_APPEND (1<<5) 3992 #define GLOB_NOESCAPE (1<<6) 3993 #define GLOB_PERIOD (1<<7) 3994 #define GLOB_MAGCHAR (1<<8) 3995 #define GLOB_ALTDIRFUNC (1<<9) 3996 3997 #define GLOB_NOSPACE 1 3998 #define GLOB_ABORTED 2 3999 #define GLOB_NOMATCH 3 4000 #define GLOB_NOSYS 4 4001 4002 typedef struct { 4003 size_t gl_pathc; 4004 char **gl_pathv; 4005 size_t gl_offs; 4006 int gl_flags; 4007 void (*gl_closedir) (void *); 4008 struct dirent *(*gl_readdir) (void *); 4009 void *(*gl_opendir) (const char *); 4010 int (*gl_lstat) (const char *, struct stat *); 4011 int (*gl_stat) (const char *, struct stat *); 4012 } glob_t; 4013 4014 typedef struct { 4015 size_t gl_pathc; 4016 char **gl_pathv; 4017 size_t gl_offs; 4018 int gl_flags; 4019 void (*gl_closedir) (void *); 4020 struct dirent64 *(*gl_readdir) (void *); 4021 void *(*gl_opendir) (const char *); 4022 int (*gl_lstat) (const char *, struct stat *); 4023 int (*gl_stat) (const char *, struct stat *); 4024 } glob64_t; 4025 extern int glob(const char *, int, int (*gl_stat) (const char *p1, intp2) 4026 , glob_t *); 4027 extern int glob64(const char *, int, 4028 int (*gl_stat) (const char *p1, int p2) 4029 , glob64_t *); 4030 extern void globfree(glob_t *); 4031 extern void globfree64(glob64_t *); 4032 _________________________________________________________ 4033 4034 13.4.13. grp.h 4035 4036 struct group { 4037 char *gr_name; 4038 char *gr_passwd; 4039 gid_t gr_gid; 4040 char **gr_mem; 4041 }; 4042 4043 extern void endgrent(void); 4044 extern struct group *getgrent(void); 4045 extern struct group *getgrgid(gid_t); 4046 extern struct group *getgrnam(char *); 4047 extern int initgroups(const char *, gid_t); 4048 extern void setgrent(void); 4049 extern int setgroups(size_t, const gid_t *); 4050 extern int getgrgid_r(gid_t, struct group *, char *, size_t, 4051 struct group **); 4052 extern int getgrnam_r(const char *, struct group *, char *, size_t, 4053 struct group **); 4054 extern int getgrouplist(const char *, gid_t, gid_t *, int *); 4055 _________________________________________________________ 4056 4057 13.4.14. iconv.h 4058 4059 typedef void *iconv_t; 4060 extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); 4061 extern int iconv_close(iconv_t); 4062 extern iconv_t iconv_open(char *, char *); 4063 _________________________________________________________ 4064 4065 13.4.15. inttypes.h 4066 4067 typedef lldiv_t imaxdiv_t; 4068 typedef unsigned char uint8_t; 4069 typedef unsigned short uint16_t; 4070 typedef unsigned int uint32_t; 4071 4072 extern intmax_t strtoimax(const char *, char **, int); 4073 extern uintmax_t strtoumax(const char *, char **, int); 4074 extern intmax_t wcstoimax(const wchar_t *, wchar_t * *, int); 4075 extern uintmax_t wcstoumax(const wchar_t *, wchar_t * *, int); 4076 extern intmax_t imaxabs(intmax_t); 4077 extern imaxdiv_t imaxdiv(intmax_t, intmax_t); 4078 _________________________________________________________ 4079 4080 13.4.16. langinfo.h 4081 4082 #define ABDAY_1 0x20000 4083 #define ABDAY_2 0x20001 4084 #define ABDAY_3 0x20002 4085 #define ABDAY_4 0x20003 4086 #define ABDAY_5 0x20004 4087 #define ABDAY_6 0x20005 4088 #define ABDAY_7 0x20006 4089 4090 #define DAY_1 0x20007 4091 #define DAY_2 0x20008 4092 #define DAY_3 0x20009 4093 #define DAY_4 0x2000A 4094 #define DAY_5 0x2000B 4095 #define DAY_6 0x2000C 4096 #define DAY_7 0x2000D 4097 4098 #define ABMON_1 0x2000E 4099 #define ABMON_2 0x2000F 4100 #define ABMON_3 0x20010 4101 #define ABMON_4 0x20011 4102 #define ABMON_5 0x20012 4103 #define ABMON_6 0x20013 4104 #define ABMON_7 0x20014 4105 #define ABMON_8 0x20015 4106 #define ABMON_9 0x20016 4107 #define ABMON_10 0x20017 4108 #define ABMON_11 0x20018 4109 #define ABMON_12 0x20019 4110 4111 #define MON_1 0x2001A 4112 #define MON_2 0x2001B 4113 #define MON_3 0x2001C 4114 #define MON_4 0x2001D 4115 #define MON_5 0x2001E 4116 #define MON_6 0x2001F 4117 #define MON_7 0x20020 4118 #define MON_8 0x20021 4119 #define MON_9 0x20022 4120 #define MON_10 0x20023 4121 #define MON_11 0x20024 4122 #define MON_12 0x20025 4123 4124 #define AM_STR 0x20026 4125 #define PM_STR 0x20027 4126 4127 #define D_T_FMT 0x20028 4128 #define D_FMT 0x20029 4129 #define T_FMT 0x2002A 4130 #define T_FMT_AMPM 0x2002B 4131 4132 #define ERA 0x2002C 4133 #define ERA_D_FMT 0x2002E 4134 #define ALT_DIGITS 0x2002F 4135 #define ERA_D_T_FMT 0x20030 4136 #define ERA_T_FMT 0x20031 4137 4138 #define CODESET 14 4139 4140 #define CRNCYSTR 0x4000F 4141 4142 #define RADIXCHAR 0x10000 4143 #define THOUSEP 0x10001 4144 #define YESEXPR 0x50000 4145 #define NOEXPR 0x50001 4146 #define YESSTR 0x50002 4147 #define NOSTR 0x50003 4148 4149 extern char *nl_langinfo(nl_item); 4150 _________________________________________________________ 4151 4152 13.4.17. libgen.h 4153 4154 extern char *basename(const char *); 4155 extern char *dirname(char *); 4156 _________________________________________________________ 4157 4158 13.4.18. libintl.h 4159 4160 extern char *bindtextdomain(const char *, const char *); 4161 extern char *dcgettext(const char *, const char *, int); 4162 extern char *dgettext(const char *, const char *); 4163 extern char *gettext(const char *); 4164 extern char *textdomain(const char *); 4165 extern char *bind_textdomain_codeset(const char *, const char *); 4166 extern char *dcngettext(const char *, const char *, const char *, 4167 unsigned long int, int); 4168 extern char *dngettext(const char *, const char *, const char *, 4169 unsigned long int); 4170 extern char *ngettext(const char *, const char *, unsigned long int); 4171 _________________________________________________________ 4172 4173 13.4.19. limits.h 4174 4175 #define LLONG_MIN (-LLONG_MAX-1LL) 4176 #define ULLONG_MAX 18446744073709551615ULL 4177 #define OPEN_MAX 256 4178 #define PATH_MAX 4096 4179 #define LLONG_MAX 9223372036854775807LL 4180 #define SSIZE_MAX LONG_MAX 4181 4182 #define MB_LEN_MAX 16 4183 4184 #define SCHAR_MIN (-128) 4185 #define SCHAR_MAX 127 4186 #define UCHAR_MAX 255 4187 #define CHAR_BIT 8 4188 4189 #define SHRT_MIN (-32768) 4190 #define SHRT_MAX 32767 4191 #define USHRT_MAX 65535 4192 4193 #define INT_MIN (-INT_MAX-1) 4194 #define INT_MAX 2147483647 4195 #define UINT_MAX 4294967295U 4196 4197 #define LONG_MIN (-LONG_MAX-1L) 4198 4199 #define PTHREAD_KEYS_MAX 1024 4200 #define PTHREAD_THREADS_MAX 16384 4201 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 4202 _________________________________________________________ 4203 4204 13.4.20. locale.h 4205 4206 struct lconv { 4207 char *decimal_point; 4208 char *thousands_sep; 4209 char *grouping; 4210 char *int_curr_symbol; 4211 char *currency_symbol; 4212 char *mon_decimal_point; 4213 char *mon_thousands_sep; 4214 char *mon_grouping; 4215 char *positive_sign; 4216 char *negative_sign; 4217 char int_frac_digits; 4218 char frac_digits; 4219 char p_cs_precedes; 4220 char p_sep_by_space; 4221 char n_cs_precedes; 4222 char n_sep_by_space; 4223 char p_sign_posn; 4224 char n_sign_posn; 4225 char int_p_cs_precedes; 4226 char int_p_sep_by_space; 4227 char int_n_cs_precedes; 4228 char int_n_sep_by_space; 4229 char int_p_sign_posn; 4230 char int_n_sign_posn; 4231 }; 4232 4233 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 4234 #define LC_CTYPE 0 4235 #define LC_NUMERIC 1 4236 #define LC_TELEPHONE 10 4237 #define LC_MEASUREMENT 11 4238 #define LC_IDENTIFICATION 12 4239 #define LC_TIME 2 4240 #define LC_COLLATE 3 4241 #define LC_MONETARY 4 4242 #define LC_MESSAGES 5 4243 #define LC_ALL 6 4244 #define LC_PAPER 7 4245 #define LC_NAME 8 4246 #define LC_ADDRESS 9 4247 4248 struct __locale_struct { 4249 struct locale_data *__locales[13]; 4250 const unsigned short *__ctype_b; 4251 const int *__ctype_tolower; 4252 const int *__ctype_toupper; 4253 const char *__names[13]; 4254 }; 4255 typedef struct __locale_struct *__locale_t; 4256 4257 typedef struct __locale_struct *locale_t; 4258 4259 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 4260 #define LC_COLLATE_MASK (1 << LC_COLLATE) 4261 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 4262 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 4263 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 4264 #define LC_MONETARY_MASK (1 << LC_MONETARY) 4265 #define LC_NAME_MASK (1 << LC_NAME) 4266 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 4267 #define LC_PAPER_MASK (1 << LC_PAPER) 4268 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 4269 #define LC_TIME_MASK (1 << LC_TIME) 4270 #define LC_CTYPE_MASK (1<cl_ops->cl_control)(cl,rq,in)) 4705 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 4706 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 4707 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 4708 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 4709 #define NULLPROC ((u_long)0) 4710 #define CLSET_TIMEOUT 1 4711 #define CLGET_XID 10 4712 #define CLSET_XID 11 4713 #define CLGET_VERS 12 4714 #define CLSET_VERS 13 4715 #define CLGET_PROG 14 4716 #define CLSET_PROG 15 4717 #define CLGET_TIMEOUT 2 4718 #define CLGET_SERVER_ADDR 3 4719 #define CLSET_RETRY_TIMEOUT 4 4720 #define CLGET_RETRY_TIMEOUT 5 4721 #define CLGET_FD 6 4722 #define CLGET_SVC_ADDR 7 4723 #define CLSET_FD_CLOSE 8 4724 #define CLSET_FD_NCLOSE 9 4725 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 4726 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 4727 4728 enum clnt_stat { 4729 RPC_SUCCESS = 0, 4730 RPC_CANTENCODEARGS = 1, 4731 RPC_CANTDECODERES = 2, 4732 RPC_CANTSEND = 3, 4733 RPC_CANTRECV = 4, 4734 RPC_TIMEDOUT = 5, 4735 RPC_VERSMISMATCH = 6, 4736 RPC_AUTHERROR = 7, 4737 RPC_PROGUNAVAIL = 8, 4738 RPC_PROGVERSMISMATCH = 9, 4739 RPC_PROCUNAVAIL = 10, 4740 RPC_CANTDECODEARGS = 11, 4741 RPC_SYSTEMERROR = 12, 4742 RPC_NOBROADCAST = 21, 4743 RPC_UNKNOWNHOST = 13, 4744 RPC_UNKNOWNPROTO = 17, 4745 RPC_UNKNOWNADDR = 19, 4746 RPC_RPCBFAILURE = 14, 4747 RPC_PROGNOTREGISTERED = 15, 4748 RPC_N2AXLATEFAILURE = 22, 4749 RPC_FAILED = 16, 4750 RPC_INTR = 18, 4751 RPC_TLIERROR = 20, 4752 RPC_UDERROR = 23, 4753 RPC_INPROGRESS = 24, 4754 RPC_STALERACHANDLE = 25 4755 }; 4756 struct rpc_err { 4757 enum clnt_stat re_status; 4758 union { 4759 int RE_errno; 4760 enum auth_stat RE_why; 4761 struct { 4762 u_long low; 4763 u_long high; 4764 } RE_vers; 4765 struct { 4766 long int s1; 4767 long int s2; 4768 } RE_lb; 4769 } ru; 4770 }; 4771 4772 typedef struct CLIENT { 4773 struct AUTH *cl_auth; 4774 struct clnt_ops *cl_ops; 4775 caddr_t cl_private; 4776 } CLIENT; 4777 4778 struct clnt_ops { 4779 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 4780 xdrproc_t, caddr_t, struct timeval); 4781 void (*cl_abort) (void); 4782 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 4783 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 4784 void (*cl_destroy) (struct CLIENT *); 4785 bool_t(*cl_control) (struct CLIENT *, int, char *); 4786 }; 4787 extern struct CLIENT *clnt_create(const char *, const u_long, const u_long, 4788 const char *); 4789 extern void clnt_pcreateerror(const char *); 4790 extern void clnt_perrno(enum clnt_stat); 4791 extern void clnt_perror(struct CLIENT *, const char *); 4792 extern char *clnt_spcreateerror(const char *); 4793 extern char *clnt_sperrno(enum clnt_stat); 4794 extern char *clnt_sperror(struct CLIENT *, const char *); 4795 _________________________________________________________ 4796 4797 13.4.35. rpc/pmap_clnt.h 4798 4799 extern u_short pmap_getport(struct sockaddr_in *, const u_long, 4800 const u_long, u_int); 4801 extern bool_t pmap_set(const u_long, const u_long, int, u_short); 4802 extern bool_t pmap_unset(u_long, u_long); 4803 _________________________________________________________ 4804 4805 13.4.36. rpc/rpc_msg.h 4806 4807 enum msg_type { 4808 CALL = 0, 4809 REPLY = 1 4810 }; 4811 enum reply_stat { 4812 MSG_ACCEPTED = 0, 4813 MSG_DENIED = 1 4814 }; 4815 enum accept_stat { 4816 SUCCESS = 0, 4817 PROG_UNAVAIL = 1, 4818 PROG_MISMATCH = 2, 4819 PROC_UNAVAIL = 3, 4820 GARBAGE_ARGS = 4, 4821 SYSTEM_ERR = 5 4822 }; 4823 enum reject_stat { 4824 RPC_MISMATCH = 0, 4825 AUTH_ERROR = 1 4826 }; 4827 4828 struct accepted_reply { 4829 struct opaque_auth ar_verf; 4830 enum accept_stat ar_stat; 4831 union { 4832 struct { 4833 unsigned long int low; 4834 unsigned long int high; 4835 } AR_versions; 4836 struct { 4837 caddr_t where; 4838 xdrproc_t proc; 4839 } AR_results; 4840 } ru; 4841 }; 4842 4843 struct rejected_reply { 4844 enum reject_stat rj_stat; 4845 union { 4846 struct { 4847 unsigned long int low; 4848 unsigned long int high; 4849 } RJ_versions; 4850 enum auth_stat RJ_why; 4851 } ru; 4852 }; 4853 4854 struct reply_body { 4855 enum reply_stat rp_stat; 4856 union { 4857 struct accepted_reply RP_ar; 4858 struct rejected_reply RP_dr; 4859 } ru; 4860 }; 4861 4862 struct call_body { 4863 unsigned long int cb_rpcvers; 4864 unsigned long int cb_prog; 4865 unsigned long int cb_vers; 4866 unsigned long int cb_proc; 4867 struct opaque_auth cb_cred; 4868 struct opaque_auth cb_verf; 4869 }; 4870 4871 struct rpc_msg { 4872 unsigned long int rm_xid; 4873 enum msg_type rm_direction; 4874 union { 4875 struct call_body RM_cmb; 4876 struct reply_body RM_rmb; 4877 } ru; 4878 }; 4879 extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); 4880 _________________________________________________________ 4881 4882 13.4.37. rpc/svc.h 4883 4884 #define RPC_ANYSOCK -1 4885 #define svc_freeargs(xprt,xargs, argsp) \ 4886 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 4887 #define svc_getargs(xprt,xargs, argsp) \ 4888 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 4889 4890 enum xprt_stat { 4891 XPRT_DIED, 4892 XPRT_MOREREQS, 4893 XPRT_IDLE 4894 }; 4895 4896 typedef struct SVCXPRT { 4897 int xp_sock; 4898 u_short xp_port; 4899 struct xp_ops *xp_ops; 4900 int xp_addrlen; 4901 struct sockaddr_in xp_raddr; 4902 struct opaque_auth xp_verf; 4903 caddr_t xp_p1; 4904 caddr_t xp_p2; 4905 char xp_pad[256]; 4906 } SVCXPRT; 4907 4908 struct svc_req { 4909 rpcprog_t rq_prog; 4910 rpcvers_t rq_vers; 4911 rpcproc_t rq_proc; 4912 struct opaque_auth rq_cred; 4913 caddr_t rq_clntcred; 4914 SVCXPRT *rq_xprt; 4915 }; 4916 4917 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 4918 4919 struct xp_ops { 4920 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 4921 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 4922 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 4923 caddr_t args_ptr); 4924 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 4925 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 4926 caddr_t args_ptr); 4927 void (*xp_destroy) (SVCXPRT * __xprt); 4928 }; 4929 extern void svc_getreqset(fd_set *); 4930 extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, 4931 __dispatch_fn_t, rpcprot_t); 4932 extern void svc_run(void); 4933 extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); 4934 extern void svcerr_auth(SVCXPRT *, enum auth_stat); 4935 extern void svcerr_decode(SVCXPRT *); 4936 extern void svcerr_noproc(SVCXPRT *); 4937 extern void svcerr_noprog(SVCXPRT *); 4938 extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); 4939 extern void svcerr_systemerr(SVCXPRT *); 4940 extern void svcerr_weakauth(SVCXPRT *); 4941 extern SVCXPRT *svctcp_create(int, u_int, u_int); 4942 extern SVCXPRT *svcudp_create(int); 4943 _________________________________________________________ 4944 4945 13.4.38. rpc/types.h 4946 4947 typedef int bool_t; 4948 typedef int enum_t; 4949 typedef unsigned long int rpcprog_t; 4950 typedef unsigned long int rpcvers_t; 4951 typedef unsigned long int rpcproc_t; 4952 typedef unsigned long int rpcprot_t; 4953 _________________________________________________________ 4954 4955 13.4.39. rpc/xdr.h 4956 4957 enum xdr_op { 4958 XDR_ENCODE, 4959 XDR_DECODE, 4960 XDR_FREE 4961 }; 4962 typedef struct XDR { 4963 enum xdr_op x_op; 4964 struct xdr_ops *x_ops; 4965 caddr_t x_public; 4966 caddr_t x_private; 4967 caddr_t x_base; 4968 int x_handy; 4969 } XDR; 4970 4971 struct xdr_ops { 4972 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 4973 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 4974 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 4975 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 4976 u_int(*x_getpostn) (XDR * __xdrs); 4977 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 4978 int32_t *(*x_inline) (XDR * __xdrs, int __len); 4979 void (*x_destroy) (XDR * __xdrs); 4980 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 4981 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 4982 }; 4983 4984 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 4985 4986 struct xdr_discrim { 4987 int value; 4988 xdrproc_t proc; 4989 }; 4990 extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, 4991 xdrproc_t); 4992 extern bool_t xdr_bool(XDR *, bool_t *); 4993 extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); 4994 extern bool_t xdr_char(XDR *, char *); 4995 extern bool_t xdr_double(XDR *, double *); 4996 extern bool_t xdr_enum(XDR *, enum_t *); 4997 extern bool_t xdr_float(XDR *, float *); 4998 extern void xdr_free(xdrproc_t, char *); 4999 extern bool_t xdr_int(XDR *, int *); 5000 extern bool_t xdr_long(XDR *, long int *); 5001 extern bool_t xdr_opaque(XDR *, caddr_t, u_int); 5002 extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); 5003 extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); 5004 extern bool_t xdr_short(XDR *, short *); 5005 extern bool_t xdr_string(XDR *, char **, u_int); 5006 extern bool_t xdr_u_char(XDR *, u_char *); 5007 extern bool_t xdr_u_int(XDR *, u_int *); 5008 extern bool_t xdr_u_long(XDR *, u_long *); 5009 extern bool_t xdr_u_short(XDR *, u_short *); 5010 extern bool_t xdr_union(XDR *, enum_t *, char *, 5011 const struct xdr_discrim *, xdrproc_t); 5012 extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); 5013 extern bool_t xdr_void(void); 5014 extern bool_t xdr_wrapstring(XDR *, char **); 5015 extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); 5016 extern void xdrrec_create(XDR *, u_int, u_int, caddr_t, 5017 int (*proc) (char *p1, char *p2, int p3) 5018 , int (*proc) (char *p1, char *p2, int p3) 5019 ); 5020 extern bool_t xdrrec_eof(XDR *); 5021 _________________________________________________________ 5022 5023 13.4.40. sched.h 5024 5025 #define SCHED_OTHER 0 5026 #define SCHED_FIFO 1 5027 #define SCHED_RR 2 5028 5029 struct sched_param { 5030 int sched_priority; 5031 }; 5032 extern int sched_get_priority_max(int); 5033 extern int sched_get_priority_min(int); 5034 extern int sched_getparam(pid_t, struct sched_param *); 5035 extern int sched_getscheduler(pid_t); 5036 extern int sched_rr_get_interval(pid_t, struct timespec *); 5037 extern int sched_setparam(pid_t, const struct sched_param *); 5038 extern int sched_setscheduler(pid_t, int, const struct sched_param *); 5039 extern int sched_yield(void); 5040 _________________________________________________________ 5041 5042 13.4.41. search.h 5043 5044 typedef struct entry { 5045 char *key; 5046 void *data; 5047 } ENTRY; 5048 typedef enum { 5049 FIND, 5050 ENTER 5051 } ACTION; 5052 typedef enum { 5053 preorder, 5054 postorder, 5055 endorder, 5056 leaf 5057 } VISIT; 5058 5059 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 5060 extern int hcreate(size_t); 5061 extern ENTRY *hsearch(ENTRY, ACTION); 5062 extern void insque(void *, void *); 5063 extern void *lfind(const void *, const void *, size_t *, size_t, 5064 __compar_fn_t); 5065 extern void *lsearch(const void *, void *, size_t *, size_t, 5066 __compar_fn_t); 5067 extern void remque(void *); 5068 extern void hdestroy(void); 5069 extern void *tdelete(const void *, void **, __compar_fn_t); 5070 extern void *tfind(const void *, void *const *, __compar_fn_t); 5071 extern void *tsearch(const void *, void **, __compar_fn_t); 5072 extern void twalk(const void *, __action_fn_t); 5073 _________________________________________________________ 5074 5075 13.4.42. setjmp.h 5076 5077 #define setjmp(env) _setjmp(env) 5078 #define sigsetjmp(a,b) __sigsetjmp(a,b) 5079 5080 struct __jmp_buf_tag { 5081 __jmp_buf __jmpbuf; 5082 int __mask_was_saved; 5083 sigset_t __saved_mask; 5084 }; 5085 5086 typedef struct __jmp_buf_tag jmp_buf[1]; 5087 typedef jmp_buf sigjmp_buf; 5088 extern int __sigsetjmp(jmp_buf, int); 5089 extern void longjmp(jmp_buf, int); 5090 extern void siglongjmp(sigjmp_buf, int); 5091 extern void _longjmp(jmp_buf, int); 5092 extern int _setjmp(jmp_buf); 5093 _________________________________________________________ 5094 5095 13.4.43. signal.h 5096 5097 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 5098 #define SIGRTMAX (__libc_current_sigrtmax ()) 5099 #define SIGRTMIN (__libc_current_sigrtmin ()) 5100 #define SIG_BLOCK 0 5101 #define SIG_UNBLOCK 1 5102 #define SIG_SETMASK 2 5103 #define NSIG 65 5104 5105 typedef int sig_atomic_t; 5106 5107 typedef void (*sighandler_t) (int); 5108 5109 #define SIG_HOLD ((sighandler_t) 2) 5110 #define SIG_ERR ((sighandler_t)-1) 5111 #define SIG_DFL ((sighandler_t)0) 5112 #define SIG_IGN ((sighandler_t)1) 5113 5114 #define SIGHUP 1 5115 #define SIGUSR1 10 5116 #define SIGSEGV 11 5117 #define SIGUSR2 12 5118 #define SIGPIPE 13 5119 #define SIGALRM 14 5120 #define SIGTERM 15 5121 #define SIGSTKFLT 16 5122 #define SIGCHLD 17 5123 #define SIGCONT 18 5124 #define SIGSTOP 19 5125 #define SIGINT 2 5126 #define SIGTSTP 20 5127 #define SIGTTIN 21 5128 #define SIGTTOU 22 5129 #define SIGURG 23 5130 #define SIGXCPU 24 5131 #define SIGXFSZ 25 5132 #define SIGVTALRM 26 5133 #define SIGPROF 27 5134 #define SIGWINCH 28 5135 #define SIGIO 29 5136 #define SIGQUIT 3 5137 #define SIGPWR 30 5138 #define SIGSYS 31 5139 #define SIGUNUSED 31 5140 #define SIGILL 4 5141 #define SIGTRAP 5 5142 #define SIGABRT 6 5143 #define SIGIOT 6 5144 #define SIGBUS 7 5145 #define SIGFPE 8 5146 #define SIGKILL 9 5147 #define SIGCLD SIGCHLD 5148 #define SIGPOLL SIGIO 5149 5150 #define SV_ONSTACK (1<<0) 5151 #define SV_INTERRUPT (1<<1) 5152 #define SV_RESETHAND (1<<2) 5153 5154 typedef union sigval { 5155 int sival_int; 5156 void *sival_ptr; 5157 } sigval_t; 5158 5159 #define SIGEV_SIGNAL 0 5160 #define SIGEV_NONE 1 5161 #define SIGEV_THREAD 2 5162 #define SIGEV_MAX_SIZE 64 5163 5164 typedef struct sigevent { 5165 sigval_t sigev_value; 5166 int sigev_signo; 5167 int sigev_notify; 5168 union { 5169 int _pad[SIGEV_PAD_SIZE]; 5170 struct { 5171 void (*_function) (sigval_t); 5172 void *_attribute; 5173 } _sigev_thread; 5174 } _sigev_un; 5175 } sigevent_t; 5176 5177 #define SI_MAX_SIZE 128 5178 #define si_pid _sifields._kill._pid 5179 #define si_uid _sifields._kill._uid 5180 #define si_value _sifields._rt._sigval 5181 #define si_int _sifields._rt._sigval.sival_int 5182 #define si_ptr _sifields._rt._sigval.sival_ptr 5183 #define si_status _sifields._sigchld._status 5184 #define si_stime _sifields._sigchld._stime 5185 #define si_utime _sifields._sigchld._utime 5186 #define si_addr _sifields._sigfault._addr 5187 #define si_band _sifields._sigpoll._band 5188 #define si_fd _sifields._sigpoll._fd 5189 #define si_timer1 _sifields._timer._timer1 5190 #define si_timer2 _sifields._timer._timer2 5191 5192 typedef struct siginfo { 5193 int si_signo; 5194 int si_errno; 5195 int si_code; 5196 union { 5197 int _pad[SI_PAD_SIZE]; 5198 struct { 5199 pid_t _pid; 5200 uid_t _uid; 5201 } _kill; 5202 struct { 5203 unsigned int _timer1; 5204 unsigned int _timer2; 5205 } _timer; 5206 struct { 5207 pid_t _pid; 5208 uid_t _uid; 5209 sigval_t _sigval; 5210 } _rt; 5211 struct { 5212 pid_t _pid; 5213 uid_t _uid; 5214 int _status; 5215 clock_t _utime; 5216 clock_t _stime; 5217 } _sigchld; 5218 struct { 5219 void *_addr; 5220 } _sigfault; 5221 struct { 5222 int _band; 5223 int _fd; 5224 } _sigpoll; 5225 } _sifields; 5226 } siginfo_t; 5227 5228 #define SI_QUEUE -1 5229 #define SI_TIMER -2 5230 #define SI_MESGQ -3 5231 #define SI_ASYNCIO -4 5232 #define SI_SIGIO -5 5233 #define SI_TKILL -6 5234 #define SI_ASYNCNL -60 5235 #define SI_USER 0 5236 #define SI_KERNEL 0x80 5237 5238 #define ILL_ILLOPC 1 5239 #define ILL_ILLOPN 2 5240 #define ILL_ILLADR 3 5241 #define ILL_ILLTRP 4 5242 #define ILL_PRVOPC 5 5243 #define ILL_PRVREG 6 5244 #define ILL_COPROC 7 5245 #define ILL_BADSTK 8 5246 5247 #define FPE_INTDIV 1 5248 #define FPE_INTOVF 2 5249 #define FPE_FLTDIV 3 5250 #define FPE_FLTOVF 4 5251 #define FPE_FLTUND 5 5252 #define FPE_FLTRES 6 5253 #define FPE_FLTINV 7 5254 #define FPE_FLTSUB 8 5255 5256 #define SEGV_MAPERR 1 5257 #define SEGV_ACCERR 2 5258 5259 #define BUS_ADRALN 1 5260 #define BUS_ADRERR 2 5261 #define BUS_OBJERR 3 5262 5263 #define TRAP_BRKPT 1 5264 #define TRAP_TRACE 2 5265 5266 #define CLD_EXITED 1 5267 #define CLD_KILLED 2 5268 #define CLD_DUMPED 3 5269 #define CLD_TRAPPED 4 5270 #define CLD_STOPPED 5 5271 #define CLD_CONTINUED 6 5272 5273 #define POLL_IN 1 5274 #define POLL_OUT 2 5275 #define POLL_MSG 3 5276 #define POLL_ERR 4 5277 #define POLL_PRI 5 5278 #define POLL_HUP 6 5279 5280 typedef struct { 5281 unsigned long int sig[_SIGSET_NWORDS]; 5282 } sigset_t; 5283 5284 #define SA_NOCLDSTOP 0x00000001 5285 #define SA_NOCLDWAIT 0x00000002 5286 #define SA_SIGINFO 0x00000004 5287 #define SA_ONSTACK 0x08000000 5288 #define SA_RESTART 0x10000000 5289 #define SA_INTERRUPT 0x20000000 5290 #define SA_NODEFER 0x40000000 5291 #define SA_RESETHAND 0x80000000 5292 #define SA_NOMASK SA_NODEFER 5293 #define SA_ONESHOT SA_RESETHAND 5294 5295 typedef struct sigaltstack { 5296 void *ss_sp; 5297 int ss_flags; 5298 size_t ss_size; 5299 } stack_t; 5300 5301 #define SS_ONSTACK 1 5302 #define SS_DISABLE 2 5303 5304 extern int __libc_current_sigrtmax(void); 5305 extern int __libc_current_sigrtmin(void); 5306 extern sighandler_t __sysv_signal(int, sighandler_t); 5307 extern char *const _sys_siglist[]; 5308 extern int killpg(pid_t, int); 5309 extern void psignal(int, const char *); 5310 extern int raise(int); 5311 extern int sigaddset(sigset_t *, int); 5312 extern int sigandset(sigset_t *, const sigset_t *, const sigset_t *); 5313 extern int sigdelset(sigset_t *, int); 5314 extern int sigemptyset(sigset_t *); 5315 extern int sigfillset(sigset_t *); 5316 extern int sighold(int); 5317 extern int sigignore(int); 5318 extern int siginterrupt(int, int); 5319 extern int sigisemptyset(const sigset_t *); 5320 extern int sigismember(const sigset_t *, int); 5321 extern int sigorset(sigset_t *, const sigset_t *, const sigset_t *); 5322 extern int sigpending(sigset_t *); 5323 extern int sigrelse(int); 5324 extern sighandler_t sigset(int, sighandler_t); 5325 extern int pthread_kill(pthread_t, int); 5326 extern int pthread_sigmask(int, sigset_t *, sigset_t *); 5327 extern int sigaction(int, const struct sigaction *, struct sigaction *); 5328 extern int sigwait(sigset_t *, int *); 5329 extern int kill(pid_t, int); 5330 extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); 5331 extern sighandler_t signal(int, sighandler_t); 5332 extern int sigpause(int); 5333 extern int sigprocmask(int, const sigset_t *, sigset_t *); 5334 extern int sigreturn(struct sigcontext *); 5335 extern int sigsuspend(const sigset_t *); 5336 extern int sigqueue(pid_t, int, const union sigval); 5337 extern int sigwaitinfo(const sigset_t *, siginfo_t *); 5338 extern int sigtimedwait(const sigset_t *, siginfo_t *, 5339 const struct timespec *); 5340 extern sighandler_t bsd_signal(int, sighandler_t); 5341 _________________________________________________________ 5342 5343 13.4.44. stddef.h 5344 5345 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 5346 #define NULL (0L) 5347 5348 typedef int wchar_t; 5349 _________________________________________________________ 5350 5351 13.4.45. stdio.h 5352 5353 #define EOF (-1) 5354 #define P_tmpdir "/tmp" 5355 #define FOPEN_MAX 16 5356 #define L_tmpnam 20 5357 #define FILENAME_MAX 4096 5358 #define BUFSIZ 8192 5359 #define L_ctermid 9 5360 #define L_cuserid 9 5361 5362 typedef struct { 5363 off_t __pos; 5364 mbstate_t __state; 5365 } fpos_t; 5366 typedef struct { 5367 off64_t __pos; 5368 mbstate_t __state; 5369 } fpos64_t; 5370 5371 typedef struct _IO_FILE FILE; 5372 5373 #define _IOFBF 0 5374 #define _IOLBF 1 5375 #define _IONBF 2 5376 5377 extern char *const _sys_errlist[]; 5378 extern void clearerr(FILE *); 5379 extern int fclose(FILE *); 5380 extern FILE *fdopen(int, const char *); 5381 extern int fflush_unlocked(FILE *); 5382 extern int fileno(FILE *); 5383 extern FILE *fopen(const char *, const char *); 5384 extern int fprintf(FILE *, const char *, ...); 5385 extern int fputc(int, FILE *); 5386 extern FILE *freopen(const char *, const char *, FILE *); 5387 extern FILE *freopen64(const char *, const char *, FILE *); 5388 extern int fscanf(FILE *, const char *, ...); 5389 extern int fseek(FILE *, long int, int); 5390 extern int fseeko(FILE *, off_t, int); 5391 extern int fseeko64(FILE *, loff_t, int); 5392 extern off_t ftello(FILE *); 5393 extern loff_t ftello64(FILE *); 5394 extern int getchar(void); 5395 extern int getchar_unlocked(void); 5396 extern int getw(FILE *); 5397 extern int pclose(FILE *); 5398 extern void perror(const char *); 5399 extern FILE *popen(const char *, const char *); 5400 extern int printf(const char *, ...); 5401 extern int putc_unlocked(int, FILE *); 5402 extern int putchar(int); 5403 extern int putchar_unlocked(int); 5404 extern int putw(int, FILE *); 5405 extern int remove(const char *); 5406 extern void rewind(FILE *); 5407 extern int scanf(const char *, ...); 5408 extern void setbuf(FILE *, char *); 5409 extern int sprintf(char *, const char *, ...); 5410 extern int sscanf(const char *, const char *, ...); 5411 extern FILE *stderr; 5412 extern FILE *stdin; 5413 extern FILE *stdout; 5414 extern char *tempnam(const char *, const char *); 5415 extern FILE *tmpfile64(void); 5416 extern FILE *tmpfile(void); 5417 extern char *tmpnam(char *); 5418 extern int vfprintf(FILE *, const char *, va_list); 5419 extern int vprintf(const char *, va_list); 5420 extern int feof(FILE *); 5421 extern int ferror(FILE *); 5422 extern int fflush(FILE *); 5423 extern int fgetc(FILE *); 5424 extern int fgetpos(FILE *, fpos_t *); 5425 extern char *fgets(char *, int, FILE *); 5426 extern int fputs(const char *, FILE *); 5427 extern size_t fread(void *, size_t, size_t, FILE *); 5428 extern int fsetpos(FILE *, const fpos_t *); 5429 extern long int ftell(FILE *); 5430 extern size_t fwrite(const void *, size_t, size_t, FILE *); 5431 extern int getc(FILE *); 5432 extern int putc(int, FILE *); 5433 extern int puts(const char *); 5434 extern int setvbuf(FILE *, char *, int, size_t); 5435 extern int snprintf(char *, size_t, const char *, ...); 5436 extern int ungetc(int, FILE *); 5437 extern int vsnprintf(char *, size_t, const char *, va_list); 5438 extern int vsprintf(char *, const char *, va_list); 5439 extern void flockfile(FILE *); 5440 extern int asprintf(char **, const char *, ...); 5441 extern int fgetpos64(FILE *, fpos64_t *); 5442 extern FILE *fopen64(const char *, const char *); 5443 extern int fsetpos64(FILE *, const fpos64_t *); 5444 extern int ftrylockfile(FILE *); 5445 extern void funlockfile(FILE *); 5446 extern int getc_unlocked(FILE *); 5447 extern void setbuffer(FILE *, char *, size_t); 5448 extern int vasprintf(char **, const char *, va_list); 5449 extern int vdprintf(int, const char *, va_list); 5450 extern int vfscanf(FILE *, const char *, va_list); 5451 extern int vscanf(const char *, va_list); 5452 extern int vsscanf(const char *, const char *, va_list); 5453 extern size_t __fpending(FILE *); 5454 _________________________________________________________ 5455 5456 13.4.46. stdlib.h 5457 5458 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 5459 #define EXIT_SUCCESS 0 5460 #define EXIT_FAILURE 1 5461 #define RAND_MAX 2147483647 5462 5463 typedef int (*__compar_fn_t) (const void *, const void *); 5464 struct random_data { 5465 int32_t *fptr; 5466 int32_t *rptr; 5467 int32_t *state; 5468 int rand_type; 5469 int rand_deg; 5470 int rand_sep; 5471 int32_t *end_ptr; 5472 }; 5473 5474 typedef struct { 5475 int quot; 5476 int rem; 5477 } div_t; 5478 5479 typedef struct { 5480 long int quot; 5481 long int rem; 5482 } ldiv_t; 5483 5484 typedef struct { 5485 long long int quot; 5486 long long int rem; 5487 } lldiv_t; 5488 extern double __strtod_internal(const char *, char **, int); 5489 extern float __strtof_internal(const char *, char **, int); 5490 extern long int __strtol_internal(const char *, char **, int, int); 5491 extern long double __strtold_internal(const char *, char **, int); 5492 extern long long int __strtoll_internal(const char *, char **, int, int); 5493 extern unsigned long int __strtoul_internal(const char *, char **, int, 5494 int); 5495 extern unsigned long long int __strtoull_internal(const char *, char **, 5496 int, int); 5497 extern long int a64l(const char *); 5498 extern void abort(void); 5499 extern int abs(int); 5500 extern double atof(const char *); 5501 extern int atoi(char *); 5502 extern long int atol(char *); 5503 extern long long int atoll(const char *); 5504 extern void *bsearch(const void *, const void *, size_t, size_t, 5505 __compar_fn_t); 5506 extern div_t div(int, int); 5507 extern double drand48(void); 5508 extern char *ecvt(double, int, int *, int *); 5509 extern double erand48(unsigned short); 5510 extern void exit(int); 5511 extern char *fcvt(double, int, int *, int *); 5512 extern char *gcvt(double, int, char *); 5513 extern char *getenv(const char *); 5514 extern int getsubopt(char **, char *const *, char **); 5515 extern int grantpt(int); 5516 extern long int jrand48(unsigned short); 5517 extern char *l64a(long int); 5518 extern long int labs(long int); 5519 extern void lcong48(unsigned short); 5520 extern ldiv_t ldiv(long int, long int); 5521 extern long long int llabs(long long int); 5522 extern lldiv_t lldiv(long long int, long long int); 5523 extern long int lrand48(void); 5524 extern int mblen(const char *, size_t); 5525 extern size_t mbstowcs(wchar_t *, const char *, size_t); 5526 extern int mbtowc(wchar_t *, const char *, size_t); 5527 extern char *mktemp(char *); 5528 extern long int mrand48(void); 5529 extern long int nrand48(unsigned short); 5530 extern char *ptsname(int); 5531 extern int putenv(char *); 5532 extern void qsort(void *, size_t, size_t, __compar_fn_t); 5533 extern int rand(void); 5534 extern int rand_r(unsigned int *); 5535 extern unsigned short *seed48(unsigned short); 5536 extern void srand48(long int); 5537 extern int unlockpt(int); 5538 extern size_t wcstombs(char *, const wchar_t *, size_t); 5539 extern int wctomb(char *, wchar_t); 5540 extern int system(const char *); 5541 extern void *calloc(size_t, size_t); 5542 extern void free(void *); 5543 extern char *initstate(unsigned int, char *, size_t); 5544 extern void *malloc(size_t); 5545 extern long int random(void); 5546 extern void *realloc(void *, size_t); 5547 extern char *setstate(char *); 5548 extern void srand(unsigned int); 5549 extern void srandom(unsigned int); 5550 extern double strtod(char *, char **); 5551 extern float strtof(const char *, char **); 5552 extern long int strtol(char *, char **, int); 5553 extern long double strtold(const char *, char **); 5554 extern long long int strtoll(const char *, char **, int); 5555 extern long long int strtoq(const char *, char **, int); 5556 extern unsigned long int strtoul(const char *, char **, int); 5557 extern unsigned long long int strtoull(const char *, char **, int); 5558 extern unsigned long long int strtouq(const char *, char **, int); 5559 extern void _Exit(int); 5560 extern size_t __ctype_get_mb_cur_max(void); 5561 extern char **environ; 5562 extern char *realpath(const char *, char *); 5563 extern int setenv(const char *, const char *, int); 5564 extern int unsetenv(const char *); 5565 extern int getloadavg(double, int); 5566 extern int mkstemp64(char *); 5567 extern int posix_memalign(void **, size_t, size_t); 5568 extern int posix_openpt(int); 5569 _________________________________________________________ 5570 5571 13.4.47. string.h 5572 5573 extern void *__mempcpy(void *, const void *, size_t); 5574 extern char *__stpcpy(char *, const char *); 5575 extern char *__strdup(const char *); 5576 extern char *__strtok_r(char *, const char *, char **); 5577 extern void bcopy(void *, void *, size_t); 5578 extern void *memchr(void *, int, size_t); 5579 extern int memcmp(void *, void *, size_t); 5580 extern void *memcpy(void *, void *, size_t); 5581 extern void *memmem(const void *, size_t, const void *, size_t); 5582 extern void *memmove(void *, const void *, size_t); 5583 extern void *memset(void *, int, size_t); 5584 extern char *strcat(char *, const char *); 5585 extern char *strchr(char *, int); 5586 extern int strcmp(char *, char *); 5587 extern int strcoll(const char *, const char *); 5588 extern char *strcpy(char *, char *); 5589 extern size_t strcspn(const char *, const char *); 5590 extern char *strerror(int); 5591 extern size_t strlen(char *); 5592 extern char *strncat(char *, char *, size_t); 5593 extern int strncmp(char *, char *, size_t); 5594 extern char *strncpy(char *, char *, size_t); 5595 extern char *strpbrk(const char *, const char *); 5596 extern char *strrchr(char *, int); 5597 extern char *strsignal(int); 5598 extern size_t strspn(const char *, const char *); 5599 extern char *strstr(char *, char *); 5600 extern char *strtok(char *, const char *); 5601 extern size_t strxfrm(char *, const char *, size_t); 5602 extern int bcmp(void *, void *, size_t); 5603 extern void bzero(void *, size_t); 5604 extern int ffs(int); 5605 extern char *index(char *, int); 5606 extern void *memccpy(void *, const void *, int, size_t); 5607 extern char *rindex(char *, int); 5608 extern int strcasecmp(char *, char *); 5609 extern char *strdup(char *); 5610 extern int strncasecmp(char *, char *, size_t); 5611 extern char *strndup(const char *, size_t); 5612 extern size_t strnlen(const char *, size_t); 5613 extern char *strsep(char **, const char *); 5614 extern char *strerror_r(int, char *, size_t); 5615 extern char *strtok_r(char *, const char *, char **); 5616 extern char *strcasestr(const char *, const char *); 5617 extern char *stpcpy(char *, const char *); 5618 extern char *stpncpy(char *, const char *, size_t); 5619 extern void *memrchr(const void *, int, size_t); 5620 _________________________________________________________ 5621 5622 13.4.48. sys/file.h 5623 5624 #define LOCK_SH 1 5625 #define LOCK_EX 2 5626 #define LOCK_NB 4 5627 #define LOCK_UN 8 5628 5629 extern int flock(int, int); 5630 _________________________________________________________ 5631 5632 13.4.49. sys/ioctl.h 5633 5634 struct winsize { 5635 unsigned short ws_row; 5636 unsigned short ws_col; 5637 unsigned short ws_xpixel; 5638 unsigned short ws_ypixel; 5639 }; 5640 extern int ioctl(int, unsigned long int, ...); 5641 _________________________________________________________ 5642 5643 13.4.50. sys/ipc.h 5644 5645 #define IPC_PRIVATE ((key_t)0) 5646 #define IPC_RMID 0 5647 #define IPC_CREAT 00001000 5648 #define IPC_EXCL 00002000 5649 #define IPC_NOWAIT 00004000 5650 #define IPC_SET 1 5651 #define IPC_STAT 2 5652 5653 extern key_t ftok(char *, int); 5654 _________________________________________________________ 5655 5656 13.4.51. sys/mman.h 5657 5658 #define MAP_FAILED ((void*)-1) 5659 #define PROT_NONE 0x0 5660 #define MAP_SHARED 0x01 5661 #define MAP_PRIVATE 0x02 5662 #define PROT_READ 0x1 5663 #define MAP_FIXED 0x10 5664 #define PROT_WRITE 0x2 5665 #define MAP_ANONYMOUS 0x20 5666 #define PROT_EXEC 0x4 5667 #define MS_ASYNC 1 5668 #define MS_INVALIDATE 2 5669 #define MS_SYNC 4 5670 #define MAP_ANON MAP_ANONYMOUS 5671 5672 extern int msync(void *, size_t, int); 5673 extern int mlock(const void *, size_t); 5674 extern int mlockall(int); 5675 extern void *mmap(void *, size_t, int, int, int, off_t); 5676 extern int mprotect(void *, size_t, int); 5677 extern int munlock(const void *, size_t); 5678 extern int munlockall(void); 5679 extern int munmap(void *, size_t); 5680 extern void *mmap64(void *, size_t, int, int, int, off64_t); 5681 extern int shm_open(const char *, int, mode_t); 5682 extern int shm_unlink(const char *); 5683 _________________________________________________________ 5684 5685 13.4.52. sys/msg.h 5686 5687 #define MSG_NOERROR 010000 5688 5689 extern int msgctl(int, int, struct msqid_ds *); 5690 extern int msgget(key_t, int); 5691 extern int msgrcv(int, void *, size_t, long int, int); 5692 extern int msgsnd(int, const void *, size_t, int); 5693 _________________________________________________________ 5694 5695 13.4.53. sys/param.h 5696 5697 #define NOFILE 256 5698 #define MAXPATHLEN 4096 5699 _________________________________________________________ 5700 5701 13.4.54. sys/poll.h 5702 5703 #define POLLIN 0x0001 5704 #define POLLPRI 0x0002 5705 #define POLLOUT 0x0004 5706 #define POLLERR 0x0008 5707 #define POLLHUP 0x0010 5708 #define POLLNVAL 0x0020 5709 5710 struct pollfd { 5711 int fd; 5712 short events; 5713 short revents; 5714 }; 5715 typedef unsigned long int nfds_t; 5716 _________________________________________________________ 5717 5718 13.4.55. sys/resource.h 5719 5720 #define RUSAGE_CHILDREN (-1) 5721 #define RLIM_INFINITY (~0UL) 5722 #define RLIM_SAVED_CUR -1 5723 #define RLIM_SAVED_MAX -1 5724 #define RLIMIT_CPU 0 5725 #define RUSAGE_SELF 0 5726 #define RLIMIT_FSIZE 1 5727 #define RLIMIT_DATA 2 5728 #define RLIMIT_STACK 3 5729 #define RLIMIT_CORE 4 5730 #define RLIMIT_NOFILE 7 5731 #define RLIMIT_AS 9 5732 5733 typedef unsigned long int rlim_t; 5734 typedef unsigned long long int rlim64_t; 5735 typedef int __rlimit_resource_t; 5736 5737 struct rlimit { 5738 rlim_t rlim_cur; 5739 rlim_t rlim_max; 5740 }; 5741 struct rlimit64 { 5742 rlim64_t rlim_cur; 5743 rlim64_t rlim_max; 5744 }; 5745 5746 struct rusage { 5747 struct timeval ru_utime; 5748 struct timeval ru_stime; 5749 long int ru_maxrss; 5750 long int ru_ixrss; 5751 long int ru_idrss; 5752 long int ru_isrss; 5753 long int ru_minflt; 5754 long int ru_majflt; 5755 long int ru_nswap; 5756 long int ru_inblock; 5757 long int ru_oublock; 5758 long int ru_msgsnd; 5759 long int ru_msgrcv; 5760 long int ru_nsignals; 5761 long int ru_nvcsw; 5762 long int ru_nivcsw; 5763 }; 5764 5765 enum __priority_which { 5766 PRIO_PROCESS = 0, 5767 PRIO_PGRP = 1, 5768 PRIO_USER = 2 5769 }; 5770 5771 #define PRIO_PGRP PRIO_PGRP 5772 #define PRIO_PROCESS PRIO_PROCESS 5773 #define PRIO_USER PRIO_USER 5774 5775 typedef enum __priority_which __priority_which_t; 5776 extern int getpriority(__priority_which_t, id_t); 5777 extern int getrlimit64(id_t, struct rlimit64 *); 5778 extern int setpriority(__priority_which_t, id_t, int); 5779 extern int setrlimit(__rlimit_resource_t, const struct rlimit *); 5780 extern int setrlimit64(__rlimit_resource_t, const struct rlimit64 *); 5781 extern int getrlimit(__rlimit_resource_t, struct rlimit *); 5782 extern int getrusage(int, struct rusage *); 5783 _________________________________________________________ 5784 5785 13.4.56. sys/sem.h 5786 5787 #define SEM_UNDO 0x1000 5788 #define GETPID 11 5789 #define GETVAL 12 5790 #define GETALL 13 5791 #define GETNCNT 14 5792 #define GETZCNT 15 5793 #define SETVAL 16 5794 #define SETALL 17 5795 5796 struct sembuf { 5797 short sem_num; 5798 short sem_op; 5799 short sem_flg; 5800 }; 5801 extern int semctl(int, int, int, ...); 5802 extern int semget(key_t, int, int); 5803 extern int semop(int, struct sembuf *, size_t); 5804 _________________________________________________________ 5805 5806 13.4.57. sys/shm.h 5807 5808 #define SHM_RDONLY 010000 5809 #define SHM_W 0200 5810 #define SHM_RND 020000 5811 #define SHM_R 0400 5812 #define SHM_REMAP 040000 5813 #define SHM_LOCK 11 5814 #define SHM_UNLOCK 12 5815 5816 extern int __getpagesize(void); 5817 extern void *shmat(int, const void *, int); 5818 extern int shmctl(int, int, struct shmid_ds *); 5819 extern int shmdt(const void *); 5820 extern int shmget(key_t, size_t, int); 5821 _________________________________________________________ 5822 5823 13.4.58. sys/socket.h 5824 5825 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 5826 #define SCM_RIGHTS 0x01 5827 #define SOL_SOCKET 1 5828 #define SOMAXCONN 128 5829 #define SOL_RAW 255 5830 #define CMSG_ALIGN(len) \ 5831 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 5832 #define CMSG_DATA(cmsg) \ 5833 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 5834 #define CMSG_SPACE(len) \ 5835 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 5836 #define CMSG_FIRSTHDR(msg) \ 5837 ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ 5838 (struct cmsghdr *)(msg)->msg_control : \ 5839 (struct cmsghdr *)NULL) 5840 #define CMSG_NXTHDR(mhdr,cmsg) \ 5841 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 5842 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 5843 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 5844 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ?\ 5845 (struct cmsghdr *)NULL : \ 5846 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 5847 5848 struct linger { 5849 int l_onoff; 5850 int l_linger; 5851 }; 5852 struct cmsghdr { 5853 size_t cmsg_len; 5854 int cmsg_level; 5855 int cmsg_type; 5856 }; 5857 struct iovec { 5858 void *iov_base; 5859 size_t iov_len; 5860 }; 5861 5862 typedef unsigned short sa_family_t; 5863 typedef unsigned int socklen_t; 5864 5865 struct sockaddr { 5866 sa_family_t sa_family; 5867 char sa_data[14]; 5868 }; 5869 struct sockaddr_storage { 5870 sa_family_t ss_family; 5871 __ss_aligntype __ss_align; 5872 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 5873 }; 5874 5875 struct msghdr { 5876 void *msg_name; 5877 int msg_namelen; 5878 struct iovec *msg_iov; 5879 size_t msg_iovlen; 5880 void *msg_control; 5881 size_t msg_controllen; 5882 unsigned int msg_flags; 5883 }; 5884 5885 #define AF_UNSPEC 0 5886 #define AF_UNIX 1 5887 #define AF_INET6 10 5888 #define AF_INET 2 5889 5890 #define PF_INET AF_INET 5891 #define PF_INET6 AF_INET6 5892 #define PF_UNIX AF_UNIX 5893 #define PF_UNSPEC AF_UNSPEC 5894 5895 #define SOCK_STREAM 1 5896 #define SOCK_PACKET 10 5897 #define SOCK_DGRAM 2 5898 #define SOCK_RAW 3 5899 #define SOCK_RDM 4 5900 #define SOCK_SEQPACKET 5 5901 5902 #define SO_DEBUG 1 5903 #define SO_OOBINLINE 10 5904 #define SO_NO_CHECK 11 5905 #define SO_PRIORITY 12 5906 #define SO_LINGER 13 5907 #define SO_REUSEADDR 2 5908 #define SO_TYPE 3 5909 #define SO_ACCEPTCONN 30 5910 #define SO_ERROR 4 5911 #define SO_DONTROUTE 5 5912 #define SO_BROADCAST 6 5913 #define SO_SNDBUF 7 5914 #define SO_RCVBUF 8 5915 #define SO_KEEPALIVE 9 5916 5917 #define SIOCGIFNAME 0x8910 5918 #define SIOCGIFCONF 0x8912 5919 #define SIOCGIFFLAGS 0x8913 5920 #define SIOCGIFADDR 0x8915 5921 #define SIOCGIFDSTADDR 0x8917 5922 #define SIOCGIFBRDADDR 0x8919 5923 #define SIOCGIFNETMASK 0x891b 5924 #define SIOCGIFMTU 0x8921 5925 #define SIOCGIFHWADDR 0x8927 5926 5927 #define SHUT_RD 0 5928 #define SHUT_WR 1 5929 #define SHUT_RDWR 2 5930 #define MSG_DONTROUTE 4 5931 5932 #define MSG_WAITALL 0x100 5933 #define MSG_TRUNC 0x20 5934 #define MSG_EOR 0x80 5935 #define MSG_OOB 1 5936 #define MSG_PEEK 2 5937 #define MSG_CTRUNC 8 5938 5939 extern int bind(int, const struct sockaddr *, socklen_t); 5940 extern int getnameinfo(const struct sockaddr *, socklen_t, char *, 5941 socklen_t, char *, socklen_t, unsigned int); 5942 extern int getsockname(int, struct sockaddr *, socklen_t *); 5943 extern int listen(int, int); 5944 extern int setsockopt(int, int, int, const void *, socklen_t); 5945 extern int accept(int, struct sockaddr *, socklen_t *); 5946 extern int connect(int, const struct sockaddr *, socklen_t); 5947 extern ssize_t recv(int, void *, size_t, int); 5948 extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, 5949 socklen_t *); 5950 extern ssize_t recvmsg(int, struct msghdr *, int); 5951 extern ssize_t send(int, const void *, size_t, int); 5952 extern ssize_t sendmsg(int, const struct msghdr *, int); 5953 extern ssize_t sendto(int, const void *, size_t, int, 5954 const struct sockaddr *, socklen_t); 5955 extern int getpeername(int, struct sockaddr *, socklen_t *); 5956 extern int getsockopt(int, int, int, void *, socklen_t *); 5957 extern int shutdown(int, int); 5958 extern int socket(int, int, int); 5959 extern int socketpair(int, int, int, int); 5960 extern int sockatmark(int); 5961 _________________________________________________________ 5962 5963 13.4.59. sys/stat.h 5964 5965 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 5966 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 5967 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 5968 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 5969 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 5970 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 5971 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 5972 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 5973 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 5974 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 5975 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 5976 #define S_IROTH (S_IRGRP>>3) 5977 #define S_IRGRP (S_IRUSR>>3) 5978 #define S_IRWXO (S_IRWXG>>3) 5979 #define S_IRWXG (S_IRWXU>>3) 5980 #define S_IWOTH (S_IWGRP>>3) 5981 #define S_IWGRP (S_IWUSR>>3) 5982 #define S_IXOTH (S_IXGRP>>3) 5983 #define S_IXGRP (S_IXUSR>>3) 5984 #define S_ISVTX 01000 5985 #define S_IXUSR 0x0040 5986 #define S_IWUSR 0x0080 5987 #define S_IRUSR 0x0100 5988 #define S_ISGID 0x0400 5989 #define S_ISUID 0x0800 5990 #define S_IFIFO 0x1000 5991 #define S_IFCHR 0x2000 5992 #define S_IFDIR 0x4000 5993 #define S_IFBLK 0x6000 5994 #define S_IFREG 0x8000 5995 #define S_IFLNK 0xa000 5996 #define S_IFSOCK 0xc000 5997 #define S_IFMT 0xf000 5998 #define st_atime st_atim.tv_sec 5999 #define st_ctime st_ctim.tv_sec 6000 #define st_mtime st_mtim.tv_sec 6001 #define S_IREAD S_IRUSR 6002 #define S_IWRITE S_IWUSR 6003 #define S_IEXEC S_IXUSR 6004 6005 extern int __fxstat(int, int, struct stat *); 6006 extern int __fxstat64(int, int, struct stat64 *); 6007 extern int __lxstat(int, char *, struct stat *); 6008 extern int __lxstat64(int, const char *, struct stat64 *); 6009 extern int __xmknod(int, const char *, mode_t, dev_t *); 6010 extern int __xstat(int, const char *, struct stat *); 6011 extern int __xstat64(int, const char *, struct stat64 *); 6012 extern int mkfifo(const char *, mode_t); 6013 extern int chmod(const char *, mode_t); 6014 extern int fchmod(int, mode_t); 6015 extern mode_t umask(mode_t); 6016 _________________________________________________________ 6017 6018 13.4.60. sys/statfs.h 6019 6020 #define NFS_SUPER_MAGIC 0x6969 6021 6022 struct statfs { 6023 int f_type; 6024 int f_bsize; 6025 fsblkcnt_t f_blocks; 6026 fsblkcnt_t f_bfree; 6027 fsblkcnt_t f_bavail; 6028 fsblkcnt_t f_files; 6029 fsblkcnt_t f_ffree; 6030 fsid_t f_fsid; 6031 int f_namelen; 6032 int f_spare[6]; 6033 }; 6034 struct statfs64 { 6035 int f_type; 6036 int f_bsize; 6037 fsblkcnt64_t f_blocks; 6038 fsblkcnt64_t f_bfree; 6039 fsblkcnt64_t f_bavail; 6040 fsblkcnt64_t f_files; 6041 fsblkcnt64_t f_ffree; 6042 fsid_t f_fsid; 6043 int f_namelen; 6044 int f_spare[6]; 6045 }; 6046 extern int fstatfs64(int, struct statfs64 *); 6047 extern int statfs64(const char *, struct stat64 *); 6048 extern int fstatfs(int, struct statfs *); 6049 extern int statfs(const char *, struct statfs *); 6050 _________________________________________________________ 6051 6052 13.4.61. sys/statvfs.h 6053 6054 extern int fstatvfs(int, struct statvfs *); 6055 extern int fstatvfs64(int, struct statvfs64 *); 6056 extern int statvfs(const char *, struct statvfs *); 6057 extern int statvfs64(const char *, struct statvfs64 *); 6058 _________________________________________________________ 6059 6060 13.4.62. sys/time.h 6061 6062 #define ITIMER_REAL 0 6063 #define ITIMER_VIRTUAL 1 6064 #define ITIMER_PROF 2 6065 6066 struct timezone { 6067 int tz_minuteswest; 6068 int tz_dsttime; 6069 }; 6070 6071 typedef int __itimer_which_t; 6072 6073 struct timespec { 6074 time_t tv_sec; 6075 long int tv_nsec; 6076 }; 6077 6078 struct timeval { 6079 time_t tv_sec; 6080 suseconds_t tv_usec; 6081 }; 6082 6083 struct itimerval { 6084 struct timeval it_interval; 6085 struct timeval it_value; 6086 }; 6087 extern int getitimer(__itimer_which_t, struct itimerval *); 6088 extern int setitimer(__itimer_which_t, const struct itimerval *, 6089 struct itimerval *); 6090 extern int adjtime(const struct timeval *, struct timeval *); 6091 extern int gettimeofday(struct timeval *, struct timezone *); 6092 extern int utimes(const char *, const struct timeval *); 6093 _________________________________________________________ 6094 6095 13.4.63. sys/timeb.h 6096 6097 struct timeb { 6098 time_t time; 6099 unsigned short millitm; 6100 short timezone; 6101 short dstflag; 6102 }; 6103 extern int ftime(struct timeb *); 6104 _________________________________________________________ 6105 6106 13.4.64. sys/times.h 6107 6108 struct tms { 6109 clock_t tms_utime; 6110 clock_t tms_stime; 6111 clock_t tms_cutime; 6112 clock_t tms_cstime; 6113 }; 6114 extern clock_t times(struct tms *); 6115 _________________________________________________________ 6116 6117 13.4.65. sys/types.h 6118 6119 #define FALSE 0 6120 #define TRUE 1 6121 #define FD_SETSIZE 1024 6122 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 6123 #define FD_ISSET(d,set) \ 6124 ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) 6125 #define FD_CLR(d,set) \ 6126 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) 6127 #define FD_SET(d,set) \ 6128 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 6129 6130 typedef signed char int8_t; 6131 typedef short int16_t; 6132 typedef int int32_t; 6133 typedef unsigned char u_int8_t; 6134 typedef unsigned short u_int16_t; 6135 typedef unsigned int u_int32_t; 6136 typedef unsigned int uid_t; 6137 typedef int pid_t; 6138 typedef long int off_t; 6139 typedef int key_t; 6140 typedef long int suseconds_t; 6141 typedef unsigned int u_int; 6142 typedef struct { 6143 int __val[2]; 6144 } fsid_t; 6145 typedef unsigned int useconds_t; 6146 typedef long int blksize_t; 6147 typedef long int fd_mask; 6148 typedef int timer_t; 6149 typedef int clockid_t; 6150 6151 typedef unsigned int id_t; 6152 6153 typedef unsigned long long int ino64_t; 6154 typedef long long int loff_t; 6155 typedef long int blkcnt_t; 6156 typedef unsigned long int fsblkcnt_t; 6157 typedef unsigned long int fsfilcnt_t; 6158 typedef long long int blkcnt64_t; 6159 typedef unsigned long long int fsblkcnt64_t; 6160 typedef unsigned long long int fsfilcnt64_t; 6161 typedef unsigned char u_char; 6162 typedef unsigned short u_short; 6163 typedef unsigned long int u_long; 6164 6165 typedef unsigned long int ino_t; 6166 typedef unsigned int gid_t; 6167 typedef unsigned long long int dev_t; 6168 typedef unsigned int mode_t; 6169 typedef unsigned long int nlink_t; 6170 typedef char *caddr_t; 6171 6172 typedef struct { 6173 unsigned long int fds_bits[__FDSET_LONGS]; 6174 } fd_set; 6175 6176 typedef long int clock_t; 6177 typedef long int time_t; 6178 _________________________________________________________ 6179 6180 13.4.66. sys/uio.h 6181 6182 extern ssize_t readv(int, const struct iovec *, int); 6183 extern ssize_t writev(int, const struct iovec *, int); 6184 _________________________________________________________ 6185 6186 13.4.67. sys/un.h 6187 6188 #define UNIX_PATH_MAX 108 6189 6190 struct sockaddr_un { 6191 sa_family_t sun_family; 6192 char sun_path[UNIX_PATH_MAX]; 6193 }; 6194 _________________________________________________________ 6195 6196 13.4.68. sys/utsname.h 6197 6198 #define SYS_NMLN 65 6199 6200 struct utsname { 6201 char sysname[65]; 6202 char nodename[65]; 6203 char release[65]; 6204 char version[65]; 6205 char machine[65]; 6206 char domainname[65]; 6207 }; 6208 extern int uname(struct utsname *); 6209 _________________________________________________________ 6210 6211 13.4.69. sys/wait.h 6212 6213 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 6214 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 6215 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 6216 #define WTERMSIG(status) ((status) & 0x7f) 6217 #define WCOREDUMP(status) ((status) & 0x80) 6218 #define WIFEXITED(status) (WTERMSIG(status) == 0) 6219 #define WNOHANG 0x00000001 6220 #define WUNTRACED 0x00000002 6221 #define WCOREFLAG 0x80 6222 #define WSTOPSIG(status) WEXITSTATUS(status) 6223 6224 typedef enum { 6225 P_ALL, 6226 P_PID, 6227 P_PGID 6228 } idtype_t; 6229 extern pid_t wait(int *); 6230 extern pid_t waitpid(pid_t, int *, int); 6231 extern pid_t wait4(pid_t, int *, int, struct rusage *); 6232 _________________________________________________________ 6233 6234 13.4.70. syslog.h 6235 6236 #define LOG_EMERG 0 6237 #define LOG_PRIMASK 0x07 6238 #define LOG_ALERT 1 6239 #define LOG_CRIT 2 6240 #define LOG_ERR 3 6241 #define LOG_WARNING 4 6242 #define LOG_NOTICE 5 6243 #define LOG_INFO 6 6244 #define LOG_DEBUG 7 6245 6246 #define LOG_KERN (0<<3) 6247 #define LOG_AUTHPRIV (10<<3) 6248 #define LOG_FTP (11<<3) 6249 #define LOG_USER (1<<3) 6250 #define LOG_MAIL (2<<3) 6251 #define LOG_DAEMON (3<<3) 6252 #define LOG_AUTH (4<<3) 6253 #define LOG_SYSLOG (5<<3) 6254 #define LOG_LPR (6<<3) 6255 #define LOG_NEWS (7<<3) 6256 #define LOG_UUCP (8<<3) 6257 #define LOG_CRON (9<<3) 6258 #define LOG_FACMASK 0x03f8 6259 6260 #define LOG_LOCAL0 (16<<3) 6261 #define LOG_LOCAL1 (17<<3) 6262 #define LOG_LOCAL2 (18<<3) 6263 #define LOG_LOCAL3 (19<<3) 6264 #define LOG_LOCAL4 (20<<3) 6265 #define LOG_LOCAL5 (21<<3) 6266 #define LOG_LOCAL6 (22<<3) 6267 #define LOG_LOCAL7 (23<<3) 6268 6269 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 6270 #define LOG_MASK(pri) (1 << (pri)) 6271 6272 #define LOG_PID 0x01 6273 #define LOG_CONS 0x02 6274 #define LOG_ODELAY 0x04 6275 #define LOG_NDELAY 0x08 6276 #define LOG_NOWAIT 0x10 6277 #define LOG_PERROR 0x20 6278 6279 extern void closelog(void); 6280 extern void openlog(const char *, int, int); 6281 extern int setlogmask(int); 6282 extern void syslog(int, const char *, ...); 6283 extern void vsyslog(int, const char *, va_list); 6284 _________________________________________________________ 6285 6286 13.4.71. termios.h 6287 6288 #define TCIFLUSH 0 6289 #define TCOOFF 0 6290 #define TCSANOW 0 6291 #define BS0 0000000 6292 #define CR0 0000000 6293 #define FF0 0000000 6294 #define NL0 0000000 6295 #define TAB0 0000000 6296 #define VT0 0000000 6297 #define OPOST 0000001 6298 #define OCRNL 0000010 6299 #define ONOCR 0000020 6300 #define ONLRET 0000040 6301 #define OFILL 0000100 6302 #define OFDEL 0000200 6303 #define NL1 0000400 6304 #define TCOFLUSH 1 6305 #define TCOON 1 6306 #define TCSADRAIN 1 6307 #define TCIOFF 2 6308 #define TCIOFLUSH 2 6309 #define TCSAFLUSH 2 6310 #define TCION 3 6311 6312 typedef unsigned int speed_t; 6313 typedef unsigned char cc_t; 6314 typedef unsigned int tcflag_t; 6315 6316 #define NCCS 32 6317 6318 struct termios { 6319 tcflag_t c_iflag; 6320 tcflag_t c_oflag; 6321 tcflag_t c_cflag; 6322 tcflag_t c_lflag; 6323 cc_t c_line; 6324 cc_t c_cc[NCCS]; 6325 speed_t c_ispeed; 6326 speed_t c_ospeed; 6327 }; 6328 6329 #define VINTR 0 6330 #define VQUIT 1 6331 #define VLNEXT 15 6332 #define VERASE 2 6333 #define VKILL 3 6334 #define VEOF 4 6335 6336 #define IGNBRK 0000001 6337 #define BRKINT 0000002 6338 #define IGNPAR 0000004 6339 #define PARMRK 0000010 6340 #define INPCK 0000020 6341 #define ISTRIP 0000040 6342 #define INLCR 0000100 6343 #define IGNCR 0000200 6344 #define ICRNL 0000400 6345 #define IXANY 0004000 6346 #define IMAXBEL 0020000 6347 6348 #define CS5 0000000 6349 6350 #define ECHO 0000010 6351 6352 #define B0 0000000 6353 #define B50 0000001 6354 #define B75 0000002 6355 #define B110 0000003 6356 #define B134 0000004 6357 #define B150 0000005 6358 #define B200 0000006 6359 #define B300 0000007 6360 #define B600 0000010 6361 #define B1200 0000011 6362 #define B1800 0000012 6363 #define B2400 0000013 6364 #define B4800 0000014 6365 #define B9600 0000015 6366 #define B19200 0000016 6367 #define B38400 0000017 6368 6369 extern speed_t cfgetispeed(const struct termios *); 6370 extern speed_t cfgetospeed(const struct termios *); 6371 extern void cfmakeraw(struct termios *); 6372 extern int cfsetispeed(struct termios *, speed_t); 6373 extern int cfsetospeed(struct termios *, speed_t); 6374 extern int cfsetspeed(struct termios *, speed_t); 6375 extern int tcflow(int, int); 6376 extern int tcflush(int, int); 6377 extern pid_t tcgetsid(int); 6378 extern int tcsendbreak(int, int); 6379 extern int tcsetattr(int, int, const struct termios *); 6380 extern int tcdrain(int); 6381 extern int tcgetattr(int, struct termios *); 6382 _________________________________________________________ 6383 6384 13.4.72. time.h 6385 6386 #define CLK_TCK ((clock_t)__sysconf(2)) 6387 #define CLOCK_REALTIME 0 6388 #define TIMER_ABSTIME 1 6389 #define CLOCKS_PER_SEC 1000000l 6390 6391 struct tm { 6392 int tm_sec; 6393 int tm_min; 6394 int tm_hour; 6395 int tm_mday; 6396 int tm_mon; 6397 int tm_year; 6398 int tm_wday; 6399 int tm_yday; 6400 int tm_isdst; 6401 long int tm_gmtoff; 6402 char *tm_zone; 6403 }; 6404 struct itimerspec { 6405 struct timespec it_interval; 6406 struct timespec it_value; 6407 }; 6408 6409 extern int __daylight; 6410 extern long int __timezone; 6411 extern char *__tzname[]; 6412 extern char *asctime(const struct tm *); 6413 extern clock_t clock(void); 6414 extern char *ctime(const time_t *); 6415 extern char *ctime_r(const time_t *, char *); 6416 extern double difftime(time_t, time_t); 6417 extern struct tm *getdate(const char *); 6418 extern int getdate_err; 6419 extern struct tm *gmtime(const time_t *); 6420 extern struct tm *localtime(const time_t *); 6421 extern time_t mktime(struct tm *); 6422 extern int stime(const time_t *); 6423 extern size_t strftime(char *, size_t, const char *, const struct tm *); 6424 extern char *strptime(const char *, const char *, struct tm *); 6425 extern time_t time(time_t *); 6426 extern int nanosleep(const struct timespec *, struct timespec *); 6427 extern int daylight; 6428 extern long int timezone; 6429 extern char *tzname[]; 6430 extern void tzset(void); 6431 extern char *asctime_r(const struct tm *, char *); 6432 extern struct tm *gmtime_r(const time_t *, struct tm *); 6433 extern struct tm *localtime_r(const time_t *, struct tm *); 6434 extern int clock_getcpuclockid(pid_t, clockid_t *); 6435 extern int clock_getres(clockid_t, struct timespec *); 6436 extern int clock_gettime(clockid_t, struct timespec *); 6437 extern int clock_nanosleep(clockid_t, int, const struct timespec *, 6438 struct timespec *); 6439 extern int clock_settime(clockid_t, const struct timespec *); 6440 extern int timer_create(clockid_t, struct sigevent *, timer_t *); 6441 extern int timer_delete(timer_t); 6442 extern int timer_getoverrun(timer_t); 6443 extern int timer_gettime(timer_t, struct itimerspec *); 6444 extern int timer_settime(timer_t, int, const struct itimerspec *, 6445 struct itimerspec *); 6446 _________________________________________________________ 6447 6448 13.4.73. ucontext.h 6449 6450 extern int getcontext(ucontext_t *); 6451 extern int makecontext(ucontext_t *, void (*)(void) 6452 , int, ...); 6453 extern int setcontext(const struct ucontext *); 6454 extern int swapcontext(ucontext_t *, const struct ucontext *); 6455 _________________________________________________________ 6456 6457 13.4.74. ulimit.h 6458 6459 #define UL_GETFSIZE 1 6460 #define UL_SETFSIZE 2 6461 6462 extern long int ulimit(int, ...); 6463 _________________________________________________________ 6464 6465 13.4.75. unistd.h 6466 6467 #define SEEK_SET 0 6468 #define STDIN_FILENO 0 6469 #define SEEK_CUR 1 6470 #define STDOUT_FILENO 1 6471 #define SEEK_END 2 6472 #define STDERR_FILENO 2 6473 6474 typedef long long int off64_t; 6475 6476 #define F_OK 0 6477 #define X_OK 1 6478 #define W_OK 2 6479 #define R_OK 4 6480 6481 #define _POSIX_VDISABLE '\0' 6482 #define _POSIX_CHOWN_RESTRICTED 1 6483 #define _POSIX_JOB_CONTROL 1 6484 #define _POSIX_NO_TRUNC 1 6485 #define _POSIX_SHELL 1 6486 #define _POSIX_FSYNC 200112 6487 #define _POSIX_MAPPED_FILES 200112 6488 #define _POSIX_MEMLOCK 200112 6489 #define _POSIX_MEMLOCK_RANGE 200112 6490 #define _POSIX_MEMORY_PROTECTION 200112 6491 #define _POSIX_SEMAPHORES 200112 6492 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 6493 #define _POSIX_TIMERS 200112 6494 #define _POSIX2_C_BIND 200112L 6495 #define _POSIX_THREADS 200112L 6496 6497 #define _PC_LINK_MAX 0 6498 #define _PC_MAX_CANON 1 6499 #define _PC_ASYNC_IO 10 6500 #define _PC_PRIO_IO 11 6501 #define _PC_FILESIZEBITS 13 6502 #define _PC_REC_INCR_XFER_SIZE 14 6503 #define _PC_REC_MIN_XFER_SIZE 16 6504 #define _PC_REC_XFER_ALIGN 17 6505 #define _PC_ALLOC_SIZE_MIN 18 6506 #define _PC_MAX_INPUT 2 6507 #define _PC_2_SYMLINKS 20 6508 #define _PC_NAME_MAX 3 6509 #define _PC_PATH_MAX 4 6510 #define _PC_PIPE_BUF 5 6511 #define _PC_CHOWN_RESTRICTED 6 6512 #define _PC_NO_TRUNC 7 6513 #define _PC_VDISABLE 8 6514 #define _PC_SYNC_IO 9 6515 6516 #define _SC_ARG_MAX 0 6517 #define _SC_CHILD_MAX 1 6518 #define _SC_PRIORITY_SCHEDULING 10 6519 #define _SC_TIMERS 11 6520 #define _SC_ASYNCHRONOUS_IO 12 6521 #define _SC_XBS5_ILP32_OFF32 125 6522 #define _SC_XBS5_ILP32_OFFBIG 126 6523 #define _SC_XBS5_LP64_OFF64 127 6524 #define _SC_XBS5_LPBIG_OFFBIG 128 6525 #define _SC_XOPEN_LEGACY 129 6526 #define _SC_PRIORITIZED_IO 13 6527 #define _SC_XOPEN_REALTIME 130 6528 #define _SC_XOPEN_REALTIME_THREADS 131 6529 #define _SC_ADVISORY_INFO 132 6530 #define _SC_BARRIERS 133 6531 #define _SC_CLOCK_SELECTION 137 6532 #define _SC_CPUTIME 138 6533 #define _SC_THREAD_CPUTIME 139 6534 #define _SC_SYNCHRONIZED_IO 14 6535 #define _SC_MONOTONIC_CLOCK 149 6536 #define _SC_FSYNC 15 6537 #define _SC_READER_WRITER_LOCKS 153 6538 #define _SC_SPIN_LOCKS 154 6539 #define _SC_REGEXP 155 6540 #define _SC_SHELL 157 6541 #define _SC_SPAWN 159 6542 #define _SC_MAPPED_FILES 16 6543 #define _SC_SPORADIC_SERVER 160 6544 #define _SC_THREAD_SPORADIC_SERVER 161 6545 #define _SC_TIMEOUTS 164 6546 #define _SC_TYPED_MEMORY_OBJECTS 165 6547 #define _SC_2_PBS_ACCOUNTING 169 6548 #define _SC_MEMLOCK 17 6549 #define _SC_2_PBS_LOCATE 170 6550 #define _SC_2_PBS_MESSAGE 171 6551 #define _SC_2_PBS_TRACK 172 6552 #define _SC_SYMLOOP_MAX 173 6553 #define _SC_2_PBS_CHECKPOINT 175 6554 #define _SC_V6_ILP32_OFF32 176 6555 #define _SC_V6_ILP32_OFFBIG 177 6556 #define _SC_V6_LP64_OFF64 178 6557 #define _SC_V6_LPBIG_OFFBIG 179 6558 #define _SC_MEMLOCK_RANGE 18 6559 #define _SC_HOST_NAME_MAX 180 6560 #define _SC_TRACE 181 6561 #define _SC_TRACE_EVENT_FILTER 182 6562 #define _SC_TRACE_INHERIT 183 6563 #define _SC_TRACE_LOG 184 6564 #define _SC_MEMORY_PROTECTION 19 6565 #define _SC_CLK_TCK 2 6566 #define _SC_MESSAGE_PASSING 20 6567 #define _SC_SEMAPHORES 21 6568 #define _SC_SHARED_MEMORY_OBJECTS 22 6569 #define _SC_AIO_LISTIO_MAX 23 6570 #define _SC_AIO_MAX 24 6571 #define _SC_AIO_PRIO_DELTA_MAX 25 6572 #define _SC_DELAYTIMER_MAX 26 6573 #define _SC_MQ_OPEN_MAX 27 6574 #define _SC_MQ_PRIO_MAX 28 6575 #define _SC_VERSION 29 6576 #define _SC_NGROUPS_MAX 3 6577 #define _SC_PAGESIZE 30 6578 #define _SC_PAGE_SIZE 30 6579 #define _SC_RTSIG_MAX 31 6580 #define _SC_SEM_NSEMS_MAX 32 6581 #define _SC_SEM_VALUE_MAX 33 6582 #define _SC_SIGQUEUE_MAX 34 6583 #define _SC_TIMER_MAX 35 6584 #define _SC_BC_BASE_MAX 36 6585 #define _SC_BC_DIM_MAX 37 6586 #define _SC_BC_SCALE_MAX 38 6587 #define _SC_BC_STRING_MAX 39 6588 #define _SC_OPEN_MAX 4 6589 #define _SC_COLL_WEIGHTS_MAX 40 6590 #define _SC_EXPR_NEST_MAX 42 6591 #define _SC_LINE_MAX 43 6592 #define _SC_RE_DUP_MAX 44 6593 #define _SC_2_VERSION 46 6594 #define _SC_2_C_BIND 47 6595 #define _SC_2_C_DEV 48 6596 #define _SC_2_FORT_DEV 49 6597 #define _SC_STREAM_MAX 5 6598 #define _SC_2_FORT_RUN 50 6599 #define _SC_2_SW_DEV 51 6600 #define _SC_2_LOCALEDEF 52 6601 #define _SC_TZNAME_MAX 6 6602 #define _SC_IOV_MAX 60 6603 #define _SC_THREADS 67 6604 #define _SC_THREAD_SAFE_FUNCTIONS 68 6605 #define _SC_GETGR_R_SIZE_MAX 69 6606 #define _SC_JOB_CONTROL 7 6607 #define _SC_GETPW_R_SIZE_MAX 70 6608 #define _SC_LOGIN_NAME_MAX 71 6609 #define _SC_TTY_NAME_MAX 72 6610 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 6611 #define _SC_THREAD_KEYS_MAX 74 6612 #define _SC_THREAD_STACK_MIN 75 6613 #define _SC_THREAD_THREADS_MAX 76 6614 #define _SC_THREAD_ATTR_STACKADDR 77 6615 #define _SC_THREAD_ATTR_STACKSIZE 78 6616 #define _SC_THREAD_PRIORITY_SCHEDULING 79 6617 #define _SC_SAVED_IDS 8 6618 #define _SC_THREAD_PRIO_INHERIT 80 6619 #define _SC_THREAD_PRIO_PROTECT 81 6620 #define _SC_THREAD_PROCESS_SHARED 82 6621 #define _SC_ATEXIT_MAX 87 6622 #define _SC_PASS_MAX 88 6623 #define _SC_XOPEN_VERSION 89 6624 #define _SC_REALTIME_SIGNALS 9 6625 #define _SC_XOPEN_UNIX 91 6626 #define _SC_XOPEN_CRYPT 92 6627 #define _SC_XOPEN_ENH_I18N 93 6628 #define _SC_XOPEN_SHM 94 6629 #define _SC_2_CHAR_TERM 95 6630 #define _SC_2_C_VERSION 96 6631 #define _SC_2_UPE 97 6632 6633 #define _CS_PATH 0 6634 #define _POSIX_REGEXP 1 6635 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 6636 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 6637 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 6638 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 6639 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 6640 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 6641 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 6642 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 6643 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 6644 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 6645 #define _CS_XBS5_LP64_OFF64_LIBS 1110 6646 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 6647 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 6648 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 6649 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 6650 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 6651 6652 #define _XOPEN_XPG4 1 6653 6654 #define F_ULOCK 0 6655 #define F_LOCK 1 6656 #define F_TLOCK 2 6657 #define F_TEST 3 6658 6659 extern char **__environ; 6660 extern pid_t __getpgid(pid_t); 6661 extern void _exit(int); 6662 extern int acct(const char *); 6663 extern unsigned int alarm(unsigned int); 6664 extern int chown(const char *, uid_t, gid_t); 6665 extern int chroot(const char *); 6666 extern size_t confstr(int, char *, size_t); 6667 extern int creat(const char *, mode_t); 6668 extern int creat64(const char *, mode_t); 6669 extern char *ctermid(char *); 6670 extern char *cuserid(char *); 6671 extern int daemon(int, int); 6672 extern int execl(const char *, const char *, ...); 6673 extern int execle(const char *, const char *, ...); 6674 extern int execlp(const char *, const char *, ...); 6675 extern int execv(const char *, char *const); 6676 extern int execvp(const char *, char *const); 6677 extern int fdatasync(int); 6678 extern int ftruncate64(int, off64_t); 6679 extern long int gethostid(void); 6680 extern char *getlogin(void); 6681 extern int getlogin_r(char *, size_t); 6682 extern int getopt(int, char *const, const char *); 6683 extern pid_t getpgrp(void); 6684 extern pid_t getsid(pid_t); 6685 extern char *getwd(char *); 6686 extern int lockf(int, int, off_t); 6687 extern int mkstemp(char *); 6688 extern int nice(int); 6689 extern char *optarg; 6690 extern int opterr; 6691 extern int optind; 6692 extern int optopt; 6693 extern int rename(const char *, const char *); 6694 extern int setegid(gid_t); 6695 extern int seteuid(uid_t); 6696 extern int sethostname(const char *, size_t); 6697 extern int setpgrp(void); 6698 extern void swab(const void *, void *, ssize_t); 6699 extern void sync(void); 6700 extern pid_t tcgetpgrp(int); 6701 extern int tcsetpgrp(int, pid_t); 6702 extern int truncate(const char *, off_t); 6703 extern int truncate64(const char *, off64_t); 6704 extern char *ttyname(int); 6705 extern unsigned int ualarm(useconds_t, useconds_t); 6706 extern int usleep(useconds_t); 6707 extern int close(int); 6708 extern int fsync(int); 6709 extern off_t lseek(int, off_t, int); 6710 extern int open(const char *, int, ...); 6711 extern int pause(void); 6712 extern ssize_t read(int, void *, size_t); 6713 extern ssize_t write(int, const void *, size_t); 6714 extern char *crypt(char *, char *); 6715 extern void encrypt(char *, int); 6716 extern void setkey(const char *); 6717 extern int access(const char *, int); 6718 extern int brk(void *); 6719 extern int chdir(const char *); 6720 extern int dup(int); 6721 extern int dup2(int, int); 6722 extern int execve(const char *, char *const, char *const); 6723 extern int fchdir(int); 6724 extern int fchown(int, uid_t, gid_t); 6725 extern pid_t fork(void); 6726 extern gid_t getegid(void); 6727 extern uid_t geteuid(void); 6728 extern gid_t getgid(void); 6729 extern int getgroups(int, gid_t); 6730 extern int gethostname(char *, size_t); 6731 extern pid_t getpgid(pid_t); 6732 extern pid_t getpid(void); 6733 extern uid_t getuid(void); 6734 extern int lchown(const char *, uid_t, gid_t); 6735 extern int link(const char *, const char *); 6736 extern int mkdir(const char *, mode_t); 6737 extern long int pathconf(const char *, int); 6738 extern int pipe(int); 6739 extern int readlink(const char *, char *, size_t); 6740 extern int rmdir(const char *); 6741 extern void *sbrk(ptrdiff_t); 6742 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 6743 extern int setgid(gid_t); 6744 extern int setpgid(pid_t, pid_t); 6745 extern int setregid(gid_t, gid_t); 6746 extern int setreuid(uid_t, uid_t); 6747 extern pid_t setsid(void); 6748 extern int setuid(uid_t); 6749 extern unsigned int sleep(unsigned int); 6750 extern int symlink(const char *, const char *); 6751 extern long int sysconf(int); 6752 extern int unlink(const char *); 6753 extern pid_t vfork(void); 6754 extern ssize_t pread(int, void *, size_t, off_t); 6755 extern ssize_t pwrite(int, const void *, size_t, off_t); 6756 extern char **_environ; 6757 extern long int fpathconf(int, int); 6758 extern int ftruncate(int, off_t); 6759 extern char *getcwd(char *, size_t); 6760 extern int getpagesize(void); 6761 extern pid_t getppid(void); 6762 extern int isatty(int); 6763 extern loff_t lseek64(int, loff_t, int); 6764 extern int open64(const char *, int, ...); 6765 extern ssize_t pread64(int, void *, size_t, off64_t); 6766 extern ssize_t pwrite64(int, const void *, size_t, off64_t); 6767 extern int ttyname_r(int, char *, size_t); 6768 _________________________________________________________ 6769 6770 13.4.76. utime.h 6771 6772 struct utimbuf { 6773 time_t actime; 6774 time_t modtime; 6775 }; 6776 extern int utime(const char *, const struct utimbuf *); 6777 _________________________________________________________ 6778 6779 13.4.77. utmp.h 6780 6781 #define UT_HOSTSIZE 256 6782 #define UT_LINESIZE 32 6783 #define UT_NAMESIZE 32 6784 6785 struct exit_status { 6786 short e_termination; 6787 short e_exit; 6788 }; 6789 6790 #define EMPTY 0 6791 #define RUN_LVL 1 6792 #define BOOT_TIME 2 6793 #define NEW_TIME 3 6794 #define OLD_TIME 4 6795 #define INIT_PROCESS 5 6796 #define LOGIN_PROCESS 6 6797 #define USER_PROCESS 7 6798 #define DEAD_PROCESS 8 6799 #define ACCOUNTING 9 6800 6801 extern void endutent(void); 6802 extern struct utmp *getutent(void); 6803 extern void setutent(void); 6804 extern int getutent_r(struct utmp *, struct utmp **); 6805 extern int utmpname(const char *); 6806 extern int login_tty(int); 6807 extern void login(const struct utmp *); 6808 extern int logout(const char *); 6809 extern void logwtmp(const char *, const char *, const char *); 6810 _________________________________________________________ 6811 6812 13.4.78. utmpx.h 6813 6814 extern void endutxent(void); 6815 extern struct utmpx *getutxent(void); 6816 extern struct utmpx *getutxid(const struct utmpx *); 6817 extern struct utmpx *getutxline(const struct utmpx *); 6818 extern struct utmpx *pututxline(const struct utmpx *); 6819 extern void setutxent(void); 6820 _________________________________________________________ 6821 6822 13.4.79. wchar.h 6823 6824 #define WEOF (0xffffffffu) 6825 #define WCHAR_MAX 0x7FFFFFFF 6826 #define WCHAR_MIN 0x80000000 6827 6828 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 6829 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 6830 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 6831 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 6832 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t **, 6833 int, int); 6834 extern wchar_t *wcscat(wchar_t *, const wchar_t *); 6835 extern wchar_t *wcschr(const wchar_t *, wchar_t); 6836 extern int wcscmp(const wchar_t *, const wchar_t *); 6837 extern int wcscoll(const wchar_t *, const wchar_t *); 6838 extern wchar_t *wcscpy(wchar_t *, const wchar_t *); 6839 extern size_t wcscspn(const wchar_t *, const wchar_t *); 6840 extern wchar_t *wcsdup(const wchar_t *); 6841 extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); 6842 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); 6843 extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); 6844 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *); 6845 extern wchar_t *wcsrchr(const wchar_t *, wchar_t); 6846 extern size_t wcsspn(const wchar_t *, const wchar_t *); 6847 extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); 6848 extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t * *); 6849 extern int wcswidth(const wchar_t *, size_t); 6850 extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); 6851 extern int wctob(wint_t); 6852 extern int wcwidth(wchar_t); 6853 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); 6854 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t); 6855 extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); 6856 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 6857 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); 6858 extern size_t mbrlen(const char *, size_t, mbstate_t *); 6859 extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); 6860 extern int mbsinit(const mbstate_t *); 6861 extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, 6862 mbstate_t *); 6863 extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); 6864 extern wchar_t *wcpcpy(wchar_t *, const wchar_t *); 6865 extern wchar_t *wcpncpy(wchar_t *, const wchar_t *, size_t); 6866 extern size_t wcrtomb(char *, wchar_t, mbstate_t *); 6867 extern size_t wcslen(const wchar_t *); 6868 extern size_t wcsnrtombs(char *, const wchar_t * *, size_t, size_t, 6869 mbstate_t *); 6870 extern size_t wcsrtombs(char *, const wchar_t * *, size_t, mbstate_t *); 6871 extern double wcstod(const wchar_t *, wchar_t * *); 6872 extern float wcstof(const wchar_t *, wchar_t * *); 6873 extern long int wcstol(const wchar_t *, wchar_t * *, int); 6874 extern long double wcstold(const wchar_t *, wchar_t * *); 6875 extern long long int wcstoq(const wchar_t *, wchar_t * *, int); 6876 extern unsigned long int wcstoul(const wchar_t *, wchar_t * *, int); 6877 extern unsigned long long int wcstouq(const wchar_t *, wchar_t * *, int); 6878 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); 6879 extern int wcscasecmp(const wchar_t *, const wchar_t *); 6880 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 6881 extern size_t wcsnlen(const wchar_t *, size_t); 6882 extern long long int wcstoll(const wchar_t *, wchar_t * *, int); 6883 extern unsigned long long int wcstoull(const wchar_t *, wchar_t * *, int); 6884 extern wint_t btowc(int); 6885 extern wint_t fgetwc(FILE *); 6886 extern wint_t fgetwc_unlocked(FILE *); 6887 extern wchar_t *fgetws(wchar_t *, int, FILE *); 6888 extern wint_t fputwc(wchar_t, FILE *); 6889 extern int fputws(const wchar_t *, FILE *); 6890 extern int fwide(FILE *, int); 6891 extern int fwprintf(FILE *, const wchar_t *, ...); 6892 extern int fwscanf(FILE *, const wchar_t *, ...); 6893 extern wint_t getwc(FILE *); 6894 extern wint_t getwchar(void); 6895 extern wint_t putwc(wchar_t, FILE *); 6896 extern wint_t putwchar(wchar_t); 6897 extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); 6898 extern int swscanf(const wchar_t *, const wchar_t *, ...); 6899 extern wint_t ungetwc(wint_t, FILE *); 6900 extern int vfwprintf(FILE *, const wchar_t *, va_list); 6901 extern int vfwscanf(FILE *, const wchar_t *, va_list); 6902 extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); 6903 extern int vswscanf(const wchar_t *, const wchar_t *, va_list); 6904 extern int vwprintf(const wchar_t *, va_list); 6905 extern int vwscanf(const wchar_t *, va_list); 6906 extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, 6907 const struct tm *); 6908 extern int wprintf(const wchar_t *, ...); 6909 extern int wscanf(const wchar_t *, ...); 6910 _________________________________________________________ 6911 6912 13.4.80. wctype.h 6913 6914 typedef unsigned long int wctype_t; 6915 typedef unsigned int wint_t; 6916 typedef const int32_t *wctrans_t; 6917 typedef struct { 6918 int count; 6919 wint_t value; 6920 } __mbstate_t; 6921 6922 typedef __mbstate_t mbstate_t; 6923 extern int iswblank(wint_t); 6924 extern wint_t towlower(wint_t); 6925 extern wint_t towupper(wint_t); 6926 extern wctrans_t wctrans(const char *); 6927 extern int iswalnum(wint_t); 6928 extern int iswalpha(wint_t); 6929 extern int iswcntrl(wint_t); 6930 extern int iswctype(wint_t, wctype_t); 6931 extern int iswdigit(wint_t); 6932 extern int iswgraph(wint_t); 6933 extern int iswlower(wint_t); 6934 extern int iswprint(wint_t); 6935 extern int iswpunct(wint_t); 6936 extern int iswspace(wint_t); 6937 extern int iswupper(wint_t); 6938 extern int iswxdigit(wint_t); 6939 extern wctype_t wctype(const char *); 6940 extern wint_t towctrans(wint_t, wctrans_t); 6941 _________________________________________________________ 6942 6943 13.4.81. wordexp.h 6944 6945 enum { 6946 WRDE_DOOFFS = 1, 6947 WRDE_APPEND = 2, 6948 WRDE_NOCMD = 4, 6949 WRDE_REUSE = 8, 6950 WRDE_SHOWERR = 16, 6951 WRDE_UNDEF = 32 6952 }; 6953 6954 typedef struct { 6955 size_t we_wordc; 6956 char **we_wordv; 6957 size_t we_offs; 6958 } wordexp_t; 6959 6960 enum { 6961 WRDE_NOSYS = -1, 6962 WRDE_NOSPACE = 1, 6963 WRDE_BADCHAR = 2, 6964 WRDE_BADVAL = 3, 6965 WRDE_CMDSUB = 4, 6966 WRDE_SYNTAX = 5 6967 }; 6968 extern int wordexp(const char *, wordexp_t *, int); 6969 extern void wordfree(wordexp_t *); 6970 _________________________________________________________ 6971 6972 13.5. Interface Definitions for libc 6973 6974 Table of Contents 6975 _IO_feof -- alias for feof 6976 _IO_getc -- alias for getc 6977 _IO_putc -- alias for putc 6978 _IO_puts -- alias for puts 6979 __assert_fail -- abort the program after false assertion 6980 __ctype_b_loc -- accessor function for __ctype_b array for 6981 ctype functions 6982 6983 __ctype_get_mb_cur_max -- maximum length of a multibyte 6984 character in the current locale 6985 6986 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 6987 array for ctype tolower() function 6988 6989 __ctype_toupper_loc -- accessor function for 6990 __ctype_b_toupper() array for ctype toupper() function 6991 6992 __cxa_atexit -- register a function to be called by exit or 6993 when a shared library is unloaded 6994 6995 __daylight -- daylight savings time flag 6996 __environ -- alias for environ - user environment 6997 __errno_location -- address of errno variable 6998 __fpending -- returns in bytes the amount of output pending on 6999 a stream 7000 7001 __getpagesize -- alias for getpagesize - get current page size 7002 7003 __getpgid -- get the process group id 7004 __h_errno_location -- address of h_errno variable 7005 __isinf -- test for infinity 7006 __isinff -- test for infinity 7007 __isinfl -- test for infinity 7008 __isnan -- test for infinity 7009 __isnanf -- test for infinity 7010 __isnanl -- test for infinity 7011 __libc_current_sigrtmax -- return number of available 7012 real-time signal with lowest priority 7013 7014 __libc_current_sigrtmin -- return number of available 7015 real-time signal with highest priority 7016 7017 __libc_start_main -- initialization routine 7018 __lxstat -- inline wrapper around call to lxstat 7019 __mempcpy -- copy given number of bytes of source to 7020 destination 7021 7022 __rawmemchr -- scan memory 7023 __register_atfork -- alias for register_atfork 7024 __sigsetjmp -- save stack context for non-local goto 7025 __stpcpy -- alias for stpcpy 7026 __strdup -- alias for strdup 7027 __strtod_internal -- underlying function for strtod 7028 __strtof_internal -- underlying function for strtof 7029 __strtok_r -- alias for strtok_r 7030 __strtol_internal -- alias for strtol 7031 __strtold_internal -- underlying function for strtold 7032 __strtoll_internal -- underlying function for strtoll 7033 __strtoul_internal -- underlying function for strtoul 7034 __strtoull_internal -- underlying function for strtoull 7035 __sysconf -- get configuration information at runtime 7036 __sysv_signal -- signal handling 7037 __timezone -- global variable containing timezone 7038 __tzname -- global variable containing the timezone 7039 __wcstod_internal -- underlying function for wcstod 7040 __wcstof_internal -- underlying function for wcstof 7041 __wcstol_internal -- underlying function for wcstol 7042 __wcstold_internal -- underlying function for wcstold 7043 __wcstoul_internal -- underlying function for wcstoul 7044 __xmknod -- make block or character special file 7045 __xstat -- get File Status 7046 __xstat64 -- get File Status 7047 _environ -- alias for environ - user environment 7048 _nl_msg_cat_cntr -- new catalog load counter 7049 _sys_errlist -- array containing the "C" locale strings used 7050 by strerror() 7051 7052 _sys_siglist -- array containing the names of the signal names 7053 acct -- switch process accounting on or off 7054 adjtime -- correct the time to allow synchronization of the 7055 system clock 7056 7057 asprintf -- write formatted output to a dynamically allocated 7058 string 7059 7060 bind_textdomain_codeset -- specify encoding for message 7061 retrieval 7062 7063 bindresvport -- bind socket to privileged IP port 7064 bindtextdomain -- specify the location of a message catalog 7065 cfmakeraw -- get and set terminal attributes 7066 cfsetspeed -- set terminal input and output data rate 7067 daemon -- run in the background 7068 dcgettext -- perform domain and category specific lookup in 7069 message catalog 7070 7071 dcngettext -- perform domain and category specific lookup in 7072 message catalog with plural 7073 7074 dgettext -- perform lookup in message catalog for the current 7075 LC_MESSAGES locale 7076 7077 dngettext -- perform lookup in message catalog for the current 7078 locale 7079 7080 duplocale -- provide new handle for selection of locale 7081 endutent -- access utmp file entries 7082 err -- display formatted error messages 7083 error -- print error message 7084 errx -- display formatted error message and exit 7085 fcntl -- file control 7086 fflush_unlocked -- non thread safe fflush 7087 fgetwc_unlocked -- non thread safe fgetwc 7088 flock -- apply or remove an advisory lock on an open file 7089 freelocale -- free a locale object 7090 fscanf -- convert formatted input 7091 fstatfs -- (deprecated) 7092 fstatfs64 -- (deprecated) 7093 fwscanf -- convert formatted input 7094 getgrouplist -- get network group entry 7095 getloadavg -- get system load averages 7096 getopt -- parse command line options 7097 getopt_long -- parse command line options 7098 getopt_long_only -- parse command line options 7099 getsockopt -- get socket options 7100 gettext -- search message catalogs for a string 7101 getutent -- access user accounting database entries 7102 getutent_r -- access user accounting database entries 7103 glob64 -- find pathnames matching a pattern (Large File 7104 Support) 7105 7106 globfree64 -- free memory from glob64() (Large File Support) 7107 initgroups -- initialize the supplementary group access list 7108 ioctl -- control device 7109 sockio -- socket ioctl commands 7110 ttyio -- tty ioctl commands 7111 kill -- send a signal 7112 link -- create a link to a file 7113 mbsnrtowcs -- convert a multibyte string to a wide character 7114 string 7115 7116 memmem -- locate bytes 7117 memrchr -- scan memory for a character 7118 newlocale -- allocate a locale object 7119 ngettext -- search message catalogs for plural string 7120 pmap_getport -- find the port number assigned to a service 7121 registered with a portmapper. 7122 7123 pmap_set -- establishes mapping to machine's RPC Bind service. 7124 pmap_unset -- destroys RPC Binding 7125 psignal -- print signal message 7126 regexec -- regular expression matching 7127 scanf -- convert formatted input 7128 setbuffer -- stream buffering operation 7129 setgroups -- set list of supplementary group IDs 7130 sethostname -- set host name 7131 setsockopt -- set socket options 7132 setutent -- access user accounting database entries 7133 sigandset -- build a new signal set by combining the two input 7134 sets using logical AND 7135 7136 sigisemptyset -- check for empty signal set 7137 sigorset -- build a new signal set by combining the two input 7138 sets using logical OR 7139 7140 sigreturn -- return from signal handler and cleanup stack 7141 frame 7142 7143 sscanf -- convert formatted input 7144 statfs -- (deprecated) 7145 statfs64 -- (deprecated) 7146 stime -- set time 7147 stpcpy -- copy a string returning a pointer to its end 7148 stpncpy -- copy a fixed-size string, returning a pointer to 7149 its end 7150 7151 strcasestr -- locate a substring ignoring case 7152 strerror_r -- reentrant version of strerror 7153 strndup -- return a malloc'd copy of at most the specified 7154 number of bytes of a string 7155 7156 strnlen -- determine the length of a fixed-size string 7157 strptime -- parse a time string 7158 strsep -- extract token from string 7159 strsignal -- return string describing signal 7160 strtoq -- convert string value to a long or quad_t integer 7161 strtouq -- convert a string to an unsigned long long 7162 svc_register -- register Remote Procedure Call interface 7163 svc_run -- waits for RPC requests to arrive and calls service 7164 procedure 7165 7166 svc_sendreply -- called by RPC service's dispatch routine 7167 svctcp_create -- create a TCP/IP-based RPC service transport 7168 svcudp_create -- create a UDP-based RPC service transport 7169 swscanf -- convert formatted input 7170 system -- execute a shell command 7171 textdomain -- set the current default message domain 7172 unlink -- remove a directory entry 7173 uselocale -- set locale for thread 7174 utmpname -- set user accounting database 7175 vasprintf -- write formatted output to a dynamically allocated 7176 string 7177 7178 vdprintf -- write formatted output to a file descriptor 7179 verrx -- display formatted error message and exit 7180 vfscanf -- convert formatted input 7181 vfwscanf -- convert formatted input 7182 vscanf -- convert formatted input 7183 vsscanf -- convert formatted input 7184 vswscanf -- convert formatted input 7185 vsyslog -- log to system log 7186 vwscanf -- convert formatted input 7187 wait4 -- wait for process termination, BSD style 7188 waitpid -- wait for child process 7189 warn -- formatted error messages 7190 warnx -- formatted error messages 7191 wcpcpy -- copy a wide character string, returning a pointer to 7192 its end 7193 7194 wcpncpy -- copy a fixed-size string of wide characters, 7195 returning a pointer to its end 7196 7197 wcscasecmp -- compare two wide-character strings, ignoring 7198 case 7199 7200 wcsdup -- duplicate a wide-character string 7201 wcsncasecmp -- compare two fixed-size wide-character strings, 7202 ignoring case 7203 7204 wcsnlen -- determine the length of a fixed-size wide-character 7205 string 7206 7207 wcsnrtombs -- convert a wide character string to a multi-byte 7208 string 7209 7210 wcstoq -- convert wide string to long long int representation 7211 wcstouq -- convert wide string to unsigned long long int 7212 representation 7213 7214 wscanf -- convert formatted input 7215 xdr_u_int -- library routines for external data representation 7216 7217 The interfaces defined on the following pages are included in 7218 libc and are defined by this specification. Unless otherwise 7219 noted, these interfaces shall be included in the source 7220 standard. 7221 7222 Other interfaces listed in Section 13.3 shall behave as 7223 described in the referenced base document. 7224 7225 _IO_feof 7226 7227 Name 7228 7229 _IO_feof -- alias for feof 7230 7231 Synopsis 7232 7233 int _IO_feof(_IO_FILE * __fp); 7234 7235 Description 7236 7237 _IO_feof() tests the end-of-file indicator for the stream 7238 pointed to by __fp, returning a non-zero value if it is set. 7239 7240 _IO_feof() is not in the source standard; it is only in the 7241 binary standard. 7242 7243 _IO_getc 7244 7245 Name 7246 7247 _IO_getc -- alias for getc 7248 7249 Synopsis 7250 7251 int _IO_getc(_IO_FILE * __fp); 7252 7253 Description 7254 7255 _IO_getc() reads the next character from __fp and returns it 7256 as an unsigned char cast to an int, or EOF on end-of-file or 7257 error. 7258 7259 _IO_getc() is not in the source standard; it is only in the 7260 binary standard. 7261 7262 _IO_putc 7263 7264 Name 7265 7266 _IO_putc -- alias for putc 7267 7268 Synopsis 7269 7270 int _IO_putc(int __c, _IO_FILE * __fp); 7271 7272 Description 7273 7274 _IO_putc() writes the character __c, cast to an unsigned char, 7275 to __fp. 7276 7277 _IO_putc() is not in the source standard; it is only in the 7278 binary standard. 7279 7280 _IO_puts 7281 7282 Name 7283 7284 _IO_puts -- alias for puts 7285 7286 Synopsis 7287 7288 int _IO_puts(const char * __c); 7289 7290 Description 7291 7292 _IO_puts() writes the string __s and a trailing newline to 7293 stdout. 7294 7295 _IO_puts() is not in the source standard; it is only in the 7296 binary standard. 7297 7298 __assert_fail 7299 7300 Name 7301 7302 __assert_fail -- abort the program after false assertion 7303 7304 Synopsis 7305 7306 void __assert_fail(const char * assertion, const char * file, 7307 unsigned int line, const char * function); 7308 7309 Description 7310 7311 The __assert_fail() function is used to implement the assert() 7312 interface of ISO POSIX (2003). The __assert_fail() function 7313 shall print the given file filename, line line number, 7314 function function name and a message on the standard error 7315 stream in an unspecified format, and abort program execution 7316 via the abort() function. For example: 7317 7318 a.c:10: foobar: Assertion a == b failed. 7319 7320 If function is NULL, __assert_fail() shall omit information 7321 about the function. 7322 7323 assertion, file, and line shall be non-NULL. 7324 7325 The __assert_fail() function is not in the source standard; it 7326 is only in the binary standard. The assert() interface is not 7327 in the binary standard; it is only in the source standard. The 7328 assert() may be implemented as a macro. 7329 7330 __ctype_b_loc 7331 7332 Name 7333 7334 __ctype_b_loc -- accessor function for __ctype_b array for 7335 ctype functions 7336 7337 Synopsis 7338 7339 #include 7340 7341 const unsigned short * * __ctype_b_loc (void); 7342 7343 Description 7344 7345 The __ctype_b_loc() function shall return a pointer into an 7346 array of characters in the current locale that contains 7347 characteristics for each character in the current character 7348 set. The array shall contain a total of 384 characters, and 7349 can be indexed with any signed or unsigned char (i.e. with an 7350 index value between -128 and 255). If the application is 7351 multithreaded, the array shall be local to the current thread. 7352 7353 This interface is not in the source standard; it is only in 7354 the binary standard. 7355 7356 Return Value 7357 7358 The __ctype_b_loc() function shall return a pointer to the 7359 array of characters to be used for the ctype() family of 7360 functions (see ). 7361 7362 __ctype_get_mb_cur_max 7363 7364 Name 7365 7366 __ctype_get_mb_cur_max -- maximum length of a multibyte 7367 character in the current locale 7368 7369 Synopsis 7370 7371 size_t __ctype_get_mb_cur_max(void); 7372 7373 Description 7374 7375 __ctype_get_mb_cur_max() returns the maximum length of a 7376 multibyte character in the current locale. 7377 7378 __ctype_get_mb_cur_max() is not in the source standard; it is 7379 only in the binary standard. 7380 7381 __ctype_tolower_loc 7382 7383 Name 7384 7385 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 7386 array for ctype tolower() function 7387 7388 Synopsis 7389 7390 #include 7391 7392 int32_t * * __ctype_tolower_loc(void); 7393 7394 Description 7395 7396 The __ctype_tolower_loc() function shall return a pointer into 7397 an array of characters in the current locale that contains 7398 lower case equivalents for each character in the current 7399 character set. The array shall contain a total of 384 7400 characters, and can be indexed with any signed or unsigned 7401 char (i.e. with an index value between -128 and 255). If the 7402 application is multithreaded, the array shall be local to the 7403 current thread. 7404 7405 This interface is not in the source standard; it is only in 7406 the binary standard. 7407 7408 Return Value 7409 7410 The __ctype_tolower_loc() function shall return a pointer to 7411 the array of characters to be used for the ctype() family of 7412 functions (see ). 7413 7414 __ctype_toupper_loc 7415 7416 Name 7417 7418 __ctype_toupper_loc -- accessor function for 7419 __ctype_b_toupper() array for ctype toupper() function 7420 7421 Synopsis 7422 7423 #include 7424 7425 int32_t * * __ctype_toupper_loc(void); 7426 7427 Description 7428 7429 The __ctype_toupper_loc() function shall return a pointer into 7430 an array of characters in the current locale that contains 7431 upper case equivalents for each character in the current 7432 character set. The array shall contain a total of 384 7433 characters, and can be indexed with any signed or unsigned 7434 char (i.e. with an index value between -128 and 255). If the 7435 application is multithreaded, the array shall be local to the 7436 current thread. 7437 7438 This interface is not in the source standard; it is only in 7439 the binary standard. 7440 7441 Return Value 7442 7443 The __ctype_toupper_loc() function shall return a pointer to 7444 the array of characters to be used for the ctype() family of 7445 functions (see ). 7446 7447 __cxa_atexit 7448 7449 Name 7450 7451 __cxa_atexit -- register a function to be called by exit or 7452 when a shared library is unloaded 7453 7454 Synopsis 7455 7456 int __cxa_atexit(void (*func) (void *), void * arg, void * 7457 dso_handle); 7458 7459 Description 7460 7461 As described in the Itanium(TM) C++ ABI, __cxa_atexit() 7462 registers a destructor function to be called by exit() or when 7463 a shared library is unloaded. When a shared library is 7464 unloaded, any destructor function associated with that shared 7465 library, identified by dso_handle, shall be called with the 7466 single argument arg, and then that function shall be removed, 7467 or marked as complete, from the list of functions to run at 7468 exit(). On a call to exit(), any remaining functions 7469 registered shall be called with the single argument arg. 7470 Destructor functions shall always be called in the reverse 7471 order to their registration (i.e. the most recently registered 7472 function shall be called first), 7473 7474 The __cxa_atexit() function is used to implement atexit(), as 7475 described in ISO POSIX (2003). Calling atexit(func) from the 7476 statically linked part of an application shall be equivalent 7477 to __cxa_atexit(func, NULL, NULL). 7478 7479 __cxa_atexit() is not in the source standard; it is only in 7480 the binary standard. 7481 7482 Note: atexit() is not in the binary standard; it is only in 7483 the source standard. 7484 7485 __daylight 7486 7487 Name 7488 7489 __daylight -- daylight savings time flag 7490 7491 Synopsis 7492 7493 int __daylight; 7494 7495 Description 7496 7497 The integer variable __daylight shall implement the daylight 7498 savings time flag daylight as specified in the ISO POSIX 7499 (2003) header file . 7500 7501 __daylight is not in the source standard; it is only in the 7502 binary standard. daylight is not in the binary standard; it is 7503 only in the source standard. 7504 7505 __environ 7506 7507 Name 7508 7509 __environ -- alias for environ - user environment 7510 7511 Synopsis 7512 7513 extern char * *__environ; 7514 7515 Description 7516 7517 __environ is an alias for environ - user environment. 7518 7519 __environ has the same specification as environ. 7520 7521 __environ is not in the source standard; it is only in the 7522 binary standard. 7523 7524 __errno_location 7525 7526 Name 7527 7528 __errno_location -- address of errno variable 7529 7530 Synopsis 7531 7532 int * __errno_location(void); 7533 7534 Description 7535 7536 The __errno_location() function shall return the address of 7537 the errno variable for the current thread. 7538 7539 __errno_location() is not in the source standard; it is only 7540 in the binary standard. 7541 7542 __fpending 7543 7544 Name 7545 7546 __fpending -- returns in bytes the amount of output pending on 7547 a stream 7548 7549 Synopsis 7550 7551 size_t __fpending(FILE * stream); 7552 7553 Description 7554 7555 __fpending() returns the amount of output in bytes pending on 7556 a stream. 7557 7558 __fpending() is not in the source standard; it is only in the 7559 binary standard. 7560 7561 __getpagesize 7562 7563 Name 7564 7565 __getpagesize -- alias for getpagesize - get current page size 7566 7567 Synopsis 7568 7569 int __getpagesize(void); 7570 7571 Description 7572 7573 __getpagesize() is an alias for getpagesize() - get current 7574 page size. 7575 7576 __getpagesize() has the same specification as getpagesize(). 7577 7578 __getpagesize() is not in the source standard; it is only in 7579 the binary standard. 7580 7581 __getpgid 7582 7583 Name 7584 7585 __getpgid -- get the process group id 7586 7587 Synopsis 7588 7589 pid_t __getpgid(pid_t pid); 7590 7591 Description 7592 7593 __getpgid() has the same specification as getpgid(). 7594 7595 __getpgid() is not in the source standard; it is only in the 7596 binary standard. 7597 7598 __h_errno_location 7599 7600 Name 7601 7602 __h_errno_location -- address of h_errno variable 7603 7604 Synopsis 7605 7606 int * __h_errno_location(void); 7607 7608 Description 7609 7610 __h_errno_location() returns the address of the h_errno 7611 variable, where h_errno is as specified in ISO POSIX (2003). 7612 7613 __h_errno_location() is not in the source standard; it is only 7614 in the binary standard. Note that h_errno itself is only in 7615 the source standard; it is not in the binary standard. 7616 7617 __isinf 7618 7619 Name 7620 7621 __isinf -- test for infinity 7622 7623 Synopsis 7624 7625 int __isinf(double arg); 7626 7627 Description 7628 7629 __isinf() has the same specification as isinf() in ISO POSIX 7630 (2003), except that the argument type for __isinf() is known 7631 to be double. 7632 7633 __isinf() is not in the source standard; it is only in the 7634 binary standard. 7635 7636 __isinff 7637 7638 Name 7639 7640 __isinff -- test for infinity 7641 7642 Synopsis 7643 7644 int __isinff(float arg); 7645 7646 Description 7647 7648 __isinff() has the same specification as isinf() in ISO POSIX 7649 (2003) except that the argument type for __isinff() is known 7650 to be float. 7651 7652 __isinff() is not in the source standard; it is only in the 7653 binary standard. 7654 7655 __isinfl 7656 7657 Name 7658 7659 __isinfl -- test for infinity 7660 7661 Synopsis 7662 7663 int __isinfl(long double arg); 7664 7665 Description 7666 7667 __isinfl() has the same specification as isinf() in the ISO 7668 POSIX (2003), except that the argument type for __isinfl() is 7669 known to be long double. 7670 7671 __isinfl() is not in the source standard; it is only in the 7672 binary standard. 7673 7674 __isnan 7675 7676 Name 7677 7678 __isnan -- test for infinity 7679 7680 Synopsis 7681 7682 int __isnan(double arg); 7683 7684 Description 7685 7686 __isnan() has the same specification as isnan() in ISO POSIX 7687 (2003), except that the argument type for __isnan() is known 7688 to be double. 7689 7690 __isnan() is not in the source standard; it is only in the 7691 binary standard. 7692 7693 __isnanf 7694 7695 Name 7696 7697 __isnanf -- test for infinity 7698 7699 Synopsis 7700 7701 int __isnanf(float arg); 7702 7703 Description 7704 7705 __isnanf() has the same specification as isnan() in ISO POSIX 7706 (2003), except that the argument type for __isnanf() is known 7707 to be float. 7708 7709 __isnanf() is not in the source standard; it is only in the 7710 binary standard. 7711 7712 __isnanl 7713 7714 Name 7715 7716 __isnanl -- test for infinity 7717 7718 Synopsis 7719 7720 int __isnanl(long double arg); 7721 7722 Description 7723 7724 __isnanl() has the same specification as isnan() in ISO POSIX 7725 (2003), except that the argument type for __isnanl() is known 7726 to be long double. 7727 7728 __isnanl() is not in the source standard; it is only in the 7729 binary standard. 7730 7731 __libc_current_sigrtmax 7732 7733 Name 7734 7735 __libc_current_sigrtmax -- return number of available 7736 real-time signal with lowest priority 7737 7738 Synopsis 7739 7740 int __libc_current_sigrtmax(void); 7741 7742 Description 7743 7744 __libc_current_sigrtmax() returns the number of an available 7745 real-time signal with the lowest priority. 7746 7747 __libc_current_sigrtmax() is not in the source standard; it is 7748 only in the binary standard. 7749 7750 __libc_current_sigrtmin 7751 7752 Name 7753 7754 __libc_current_sigrtmin -- return number of available 7755 real-time signal with highest priority 7756 7757 Synopsis 7758 7759 int __libc_current_sigrtmin(void); 7760 7761 Description 7762 7763 __libc_current_sigrtmin() returns the number of an available 7764 real-time signal with the highest priority. 7765 7766 __libc_current_sigrtmin() is not in the source standard; it is 7767 only in the binary standard. 7768 7769 __libc_start_main 7770 7771 Name 7772 7773 __libc_start_main -- initialization routine 7774 7775 Synopsis 7776 7777 int __libc_start_main(int (*main) (int, char * *, char * *), 7778 int argc, char * * ubp_av, void (*init) (void), void (*fini) 7779 (void), void (*rtld_fini) (void), void (* stack_end)); 7780 7781 Description 7782 7783 The __libc_start_main() function shall perform any necessary 7784 initialization of the execution environment, call the main 7785 function with appropriate arguments, and handle the return 7786 from main(). If the main() function returns, the return value 7787 shall be passed to the exit() function. 7788 7789 Note: While this specification is intended to be 7790 implementation independent, process and library 7791 initialization may include: 7792 7793 * performing any necessary security checks if the effective 7794 user ID is not the same as the real user ID. 7795 * initialize the threading subsystem. 7796 * registering the rtld_fini to release resources when this 7797 dynamic shared object exits (or is unloaded). 7798 * registering the fini handler to run at program exit. 7799 * calling the initializer function (*init)(). 7800 * calling main() with appropriate arguments. 7801 * calling exit() with the return value from main(). 7802 7803 This list is an example only. 7804 7805 __libc_start_main() is not in the source standard; it is only 7806 in the binary standard. 7807 7808 See Also 7809 7810 The section on Process Initialization in each of the 7811 architecture specific parts of ISO/IEC 23360. 7812 7813 __lxstat 7814 7815 Name 7816 7817 __lxstat -- inline wrapper around call to lxstat 7818 7819 Synopsis 7820 7821 #include 7822 7823 int __lxstat(int version, char * __path, struct stat 7824 __statbuf); 7825 7826 Description 7827 7828 __lxstat() is an inline wrapper around call to lxstat(). 7829 7830 __lxstat() is not in the source standard; it is only in the 7831 binary standard. 7832 7833 __mempcpy 7834 7835 Name 7836 7837 __mempcpy -- copy given number of bytes of source to 7838 destination 7839 7840 Synopsis 7841 7842 #include 7843 7844 void * __mempcpy(void * restrict dest, const void * restrict 7845 src, size_t n); 7846 7847 Description 7848 7849 __mempcpy() copies n bytes of src to dest, returning a pointer 7850 to the byte after the last written byte. 7851 7852 __mempcpy() is not in the source standard; it is only in the 7853 binary standard. 7854 7855 __rawmemchr 7856 7857 Name 7858 7859 __rawmemchr -- scan memory 7860 7861 Synopsis 7862 7863 #include 7864 7865 void * __rawmemchr(const void * s, int c); 7866 7867 Description 7868 7869 __rawmemchr() searches in s for c. 7870 7871 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 7872 memchr(), but it has no length limit. 7873 7874 __rawmemchr() is not in the source standard; it is only in the 7875 binary standard. 7876 7877 __register_atfork 7878 7879 Name 7880 7881 __register_atfork -- alias for register_atfork 7882 7883 Synopsis 7884 7885 int __register_atfork(void (*prepare) (void), void (*parent) 7886 (void), void (*child) (void), void * __dso_handle); 7887 7888 Description 7889 7890 __register_atfork() implements pthread_atfork() as specified 7891 in ISO POSIX (2003). The additional parameter __dso_handle 7892 allows a shared object to pass in it's handle so that 7893 functions registered by __register_atfork() can be 7894 unregistered by the runtime when the shared object is 7895 unloaded. 7896 7897 __sigsetjmp 7898 7899 Name 7900 7901 __sigsetjmp -- save stack context for non-local goto 7902 7903 Synopsis 7904 7905 int __sigsetjmp(jmp_buf env, int savemask); 7906 7907 Description 7908 7909 __sigsetjmp() has the same behavior as sigsetjmp() as 7910 specified by ISO POSIX (2003). 7911 7912 __sigsetjmp() is not in the source standard; it is only in the 7913 binary standard. 7914 7915 __stpcpy 7916 7917 Name 7918 7919 __stpcpy -- alias for stpcpy 7920 7921 Synopsis 7922 7923 #include 7924 7925 char * __stpcpy(char * dest, const char * src); 7926 7927 Description 7928 7929 The __stpcpy() function has the same specification as the 7930 stpcpy(). 7931 7932 __stpcpy() is not in the source standard; it is only in the 7933 binary standard. 7934 7935 __strdup 7936 7937 Name 7938 7939 __strdup -- alias for strdup 7940 7941 Synopsis 7942 7943 char * __strdup(const char * string); 7944 7945 Description 7946 7947 __strdup() has the same specification as strdup(). 7948 7949 __strdup() is not in the source standard; it is only in the 7950 binary standard. 7951 7952 __strtod_internal 7953 7954 Name 7955 7956 __strtod_internal -- underlying function for strtod 7957 7958 Synopsis 7959 7960 double __strtod_internal(const char * __nptr, char * * 7961 __endptr, int __group); 7962 7963 Description 7964 7965 __group shall be 0 or the behavior of __strtod_internal() is 7966 undefined. 7967 7968 __strtod_internal(__nptr, __endptr, 0)() has the same 7969 specification as strtod(__nptr, __endptr)(). 7970 7971 __strtod_internal() is not in the source standard; it is only 7972 in the binary standard. 7973 7974 __strtof_internal 7975 7976 Name 7977 7978 __strtof_internal -- underlying function for strtof 7979 7980 Synopsis 7981 7982 float __strtof_internal(const char * __nptr, char * * 7983 __endptr, int __group); 7984 7985 Description 7986 7987 __group shall be 0 or the behavior of __strtof_internal() is 7988 undefined. 7989 7990 __strtof_internal(__nptr, __endptr, 0)() has the same 7991 specification as strtof(__nptr, __endptr)(). 7992 7993 __strtof_internal() is not in the source standard; it is only 7994 in the binary standard. 7995 7996 __strtok_r 7997 7998 Name 7999 8000 __strtok_r -- alias for strtok_r 8001 8002 Synopsis 8003 8004 char * __strtok_r(char * restrict s, const char * restrict 8005 delim, char * * restrict save_ptr); 8006 8007 Description 8008 8009 __strtok_r() has the same specification as strtok_r(). 8010 8011 __strtok_r() is not in the source standard; it is only in the 8012 binary standard. 8013 8014 __strtol_internal 8015 8016 Name 8017 8018 __strtol_internal -- alias for strtol 8019 8020 Synopsis 8021 8022 long int __strtol_internal(const char * __nptr, char * * 8023 __endptr, int __base, int __group); 8024 8025 Description 8026 8027 __group shall be 0 or the behavior of __strtol_internal() is 8028 undefined. 8029 8030 __strtol_internal(__nptr, __endptr, __base, 0) has the same 8031 specification as strtol(__nptr, __endptr, __base). 8032 8033 __strtol_internal() is not in the source standard; it is only 8034 in the binary standard. 8035 8036 __strtold_internal 8037 8038 Name 8039 8040 __strtold_internal -- underlying function for strtold 8041 8042 Synopsis 8043 8044 long double __strtold_internal(const char * __nptr, char * * 8045 __endptr, int __group); 8046 8047 Description 8048 8049 __group shall be 0 or the behavior of __strtold_internal() is 8050 undefined. 8051 8052 __strtold_internal(__nptr, __endptr, 0) has the same 8053 specification as strtold(__nptr, __endptr). 8054 8055 __strtold_internal() is not in the source standard; it is only 8056 in the binary standard. 8057 8058 __strtoll_internal 8059 8060 Name 8061 8062 __strtoll_internal -- underlying function for strtoll 8063 8064 Synopsis 8065 8066 long long __strtoll_internal(const char * __nptr, char * * 8067 __endptr, int __base, int __group); 8068 8069 Description 8070 8071 __group shall be 0 or the behavior of __strtoll_internal() is 8072 undefined. 8073 8074 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 8075 specification as strtoll(__nptr, __endptr, __base). 8076 8077 __strtoll_internal() is not in the source standard; it is only 8078 in the binary standard. 8079 8080 __strtoul_internal 8081 8082 Name 8083 8084 __strtoul_internal -- underlying function for strtoul 8085 8086 Synopsis 8087 8088 unsigned long int __strtoul_internal(const char * __nptr, char 8089 * * __endptr, int __base, int __group); 8090 8091 Description 8092 8093 __group shall be 0 or the behavior of __strtoul_internal() is 8094 undefined. 8095 8096 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 8097 specification as strtoul(__nptr, __endptr, __base). 8098 8099 __strtoul_internal() is not in the source standard; it is only 8100 in the binary standard. 8101 8102 __strtoull_internal 8103 8104 Name 8105 8106 __strtoull_internal -- underlying function for strtoull 8107 8108 Synopsis 8109 8110 unsigned long long __strtoull_internal(const char * __nptr, 8111 char * * __endptr, int __base, int __group); 8112 8113 Description 8114 8115 __group shall be 0 or the behavior of __strtoull_internal() is 8116 undefined. 8117 8118 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 8119 specification as strtoull(__nptr, __endptr, __base). 8120 8121 __strtoull_internal() is not in the source standard; it is 8122 only in the binary standard. 8123 8124 __sysconf 8125 8126 Name 8127 8128 __sysconf -- get configuration information at runtime 8129 8130 Synopsis 8131 8132 #include 8133 8134 long __sysconf(int name); 8135 8136 Description 8137 8138 __sysconf() gets configuration information at runtime. 8139 8140 __sysconf() is weak alias to sysconf(). 8141 8142 __sysconf() has the same specification as sysconf(). 8143 8144 __sysconf() is not in the source standard; it is only in the 8145 binary standard. 8146 8147 __sysv_signal 8148 8149 Name 8150 8151 __sysv_signal -- signal handling 8152 8153 Synopsis 8154 8155 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 8156 8157 Description 8158 8159 __sysv_signal() has the same behavior as signal() as specified 8160 by ISO POSIX (2003). 8161 8162 __sysv_signal() is not in the source standard; it is only in 8163 the binary standard. 8164 8165 __timezone 8166 8167 Name 8168 8169 -- global variable containing timezone 8170 8171 Synopsis 8172 8173 long int __timezone; 8174 8175 Description 8176 8177 __timezone() has the same specification as timezone() in the 8178 ISO POSIX (2003) 8179 8180 __tzname 8181 8182 Name 8183 8184 -- global variable containing the timezone 8185 8186 Synopsis 8187 8188 char * __tzname[2]; 8189 8190 Description 8191 8192 __tzname has the same specification as tzname in the ISO POSIX 8193 (2003). 8194 8195 Note that the array size of 2 is explicit in the ISO POSIX 8196 (2003), but not in the SUSv2. 8197 8198 __wcstod_internal 8199 8200 Name 8201 8202 __wcstod_internal -- underlying function for wcstod 8203 8204 Synopsis 8205 8206 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 8207 endptr, int group); 8208 8209 Description 8210 8211 group shall be 0 or the behavior of __wcstod_internal() is 8212 undefined. 8213 8214 __wcstod_internal(nptr, endptr, 0) shall behave as 8215 wcstod(nptr, endptr) as specified by ISO POSIX (2003). 8216 8217 __wcstod_internal() is not in the source standard; it is only 8218 in the binary standard. 8219 8220 __wcstof_internal 8221 8222 Name 8223 8224 __wcstof_internal -- underlying function for wcstof 8225 8226 Synopsis 8227 8228 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 8229 endptr, int group); 8230 8231 Description 8232 8233 group shall be 0 or the behavior of __wcstof_internal() is 8234 undefined. 8235 8236 __wcstof_internal(nptr, endptr, 0) shall behave as 8237 wcstof(nptr, endptr) as specified in ISO POSIX (2003). 8238 8239 __wcstof_internal() is not in the source standard; it is only 8240 in the binary standard. 8241 8242 __wcstol_internal 8243 8244 Name 8245 8246 __wcstol_internal -- underlying function for wcstol 8247 8248 Synopsis 8249 8250 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 8251 endptr, int base, int group); 8252 8253 Description 8254 8255 group shall be 0 or the behavior of __wcstol_internal() is 8256 undefined. 8257 8258 __wcstol_internal(nptr, endptr, base, 0) shall behave as 8259 wcstol(nptr, endptr, base) as specified by ISO POSIX (2003). 8260 8261 __wcstol_internal() is not in the source standard; it is only 8262 in the binary standard. 8263 8264 __wcstold_internal 8265 8266 Name 8267 8268 __wcstold_internal -- underlying function for wcstold 8269 8270 Synopsis 8271 8272 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 8273 * endptr, int group); 8274 8275 Description 8276 8277 group shall be 0 or the behavior of __wcstold_internal() is 8278 undefined. 8279 8280 __wcstold_internal(nptr, endptr, 0) shall behave as 8281 wcstold(nptr, endptr) as specified by ISO POSIX (2003). 8282 8283 __wcstold_internal() is not in the source standard; it is only 8284 in the binary standard. 8285 8286 __wcstoul_internal 8287 8288 Name 8289 8290 __wcstoul_internal -- underlying function for wcstoul 8291 8292 Synopsis 8293 8294 unsigned long __wcstoul_internal(const wchar_t * restrict 8295 nptr, wchar_t * * restrict endptr, int base, int group); 8296 8297 Description 8298 8299 group shall be 0 or the behavior of __wcstoul_internal() is 8300 undefined. 8301 8302 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 8303 wcstoul(nptr, endptr, base)() as specified by ISO POSIX 8304 (2003). 8305 8306 __wcstoul_internal() is not in the source standard; it is only 8307 in the binary standard. 8308 8309 __xmknod 8310 8311 Name 8312 8313 __xmknod -- make block or character special file 8314 8315 Synopsis 8316 8317 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 8318 dev); 8319 8320 Description 8321 8322 The __xmknod() function shall implement the mknod() interface 8323 from ISO POSIX (2003). 8324 8325 The value of ver shall be 1 or the behavior of __xmknod() is 8326 undefined. 8327 8328 __xmknod(1, path, mode, dev) shall behave as mknod(path, mode, 8329 dev) as specified by ISO POSIX (2003). 8330 8331 The __xmknod() function is not in the source standard; it is 8332 only in the binary standard. 8333 8334 Note: The mknod() function is not in the binary standard; 8335 it is only in the source standard. 8336 8337 __xstat 8338 8339 Name 8340 8341 __xstat -- get File Status 8342 8343 Synopsis 8344 8345 #include 8346 #include 8347 8348 int __xstat(int ver, const char * path, struct stat * 8349 stat_buf); 8350 8351 int __lxstat(int ver, const char * path, struct stat * 8352 stat_buf); 8353 8354 int __fxstat(int ver, int fildes, struct stat * stat_buf); 8355 8356 Description 8357 8358 The functions __xstat(), __lxstat(), and __fxstat() shall 8359 implement the ISO POSIX (2003) functions stat(), lstat(), and 8360 fstat() respectively. 8361 8362 ver shall be 3 or the behavior of these functions is 8363 undefined. 8364 8365 __xstat(3, path, stat_buf) shall implement stat(path, 8366 stat_buf) as specified by ISO POSIX (2003). 8367 8368 __lxstat(3, path, stat_buf) shall implement lstat(path, 8369 stat_buf) as specified by ISO POSIX (2003). 8370 8371 __fxstat(3, fildes, stat_buf) shall implement fstat(fildes, 8372 stat_buf) as specified by ISO POSIX (2003). 8373 8374 __xstat(), __lxstat(), and __fxstat() are not in the source 8375 standard; they are only in the binary standard. 8376 8377 stat(), lstat(), and fstat() are not in the binary standard; 8378 they are only in the source standard. 8379 8380 __xstat64 8381 8382 Name 8383 8384 __xstat64 -- get File Status 8385 8386 Synopsis 8387 8388 #define _LARGEFILE_SOURCE 1 8389 #include 8390 #include 8391 8392 int __xstat64(int ver, const char * path, struct stat64 * 8393 stat_buf); 8394 8395 int __lxstat64(int ver, const char * path, struct stat64 * 8396 stat_buf); 8397 8398 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 8399 8400 Description 8401 8402 The functions __xstat64(), __lxstat64(), and __fxstat64() 8403 shall implement the Large File Support functions stat64(), 8404 lstat64(), and fstat64() respectively. 8405 8406 ver shall be 3 or the behavior of these functions is 8407 undefined. 8408 8409 __xstat64(3, path, stat_buf) shall behave as stat(path, 8410 stat_buf) as specified by Large File Support. 8411 8412 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 8413 stat_buf) as specified by Large File Support. 8414 8415 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 8416 stat_buf) as specified by Large File Support. 8417 8418 __xstat64(), __lxstat64(), and __fxstat64() are not in the 8419 source standard; they are only in the binary standard. 8420 8421 stat64(), lstat64(), and fstat64() are not in the binary 8422 standard; they are only in the source standard. 8423 8424 _environ 8425 8426 Name 8427 8428 _environ -- alias for environ - user environment 8429 8430 Synopsis 8431 8432 extern char * *_environ; 8433 8434 Description 8435 8436 _environ is an alias for environ - user environment. 8437 8438 _nl_msg_cat_cntr 8439 8440 Name 8441 8442 _nl_msg_cat_cntr -- new catalog load counter 8443 8444 Synopsis 8445 8446 #include 8447 8448 extern int _nl_msg_cat_cntr; 8449 8450 Description 8451 8452 The global variable _nl_msg_cat_cntr is incremented each time 8453 a new catalog is loaded. This variable is only in the binary 8454 standard; it is not in the source standard. 8455 8456 _sys_errlist 8457 8458 Name 8459 8460 _sys_errlist -- array containing the "C" locale strings used 8461 by strerror() 8462 8463 Synopsis 8464 8465 #include 8466 8467 extern const char *const _sys_errlist[]; 8468 8469 Description 8470 8471 _sys_errlist is an array containing the "C" locale strings 8472 used by strerror(). This normally should not be used directly. 8473 strerror() provides all of the needed functionality. 8474 8475 _sys_siglist 8476 8477 Name 8478 8479 _sys_siglist -- array containing the names of the signal names 8480 8481 Synopsis 8482 8483 #include 8484 8485 extern const char *const _sys_siglist[NSIG]; 8486 8487 Description 8488 8489 _sys_siglist is an array containing the names of the signal 8490 names. 8491 8492 The _sys_siglist array is only in the binary standard; it is 8493 not in the source standard. Applications wishing to access the 8494 names of signals should use the strsignal() function. 8495 8496 acct 8497 8498 Name 8499 8500 acct -- switch process accounting on or off 8501 8502 Synopsis 8503 8504 #include 8505 8506 int acct(const char * filename); 8507 8508 Description 8509 8510 When filename is the name of an existing file, acct() turns 8511 accounting on and appends a record to filename for each 8512 terminating process. When filename is NULL, acct() turns 8513 accounting off. 8514 8515 Return Value 8516 8517 On success, 0 is returned. On error, -1 is returned and the 8518 global variable errno is set appropriately. 8519 8520 Errors 8521 8522 ENOSYS 8523 8524 BSD process accounting has not been enabled when the operating 8525 system kernel was compiled. The kernel configuration parameter 8526 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 8527 ENOMEM 8528 8529 Out of memory. 8530 EPERM 8531 8532 The calling process has no permission to enable process 8533 accounting. 8534 EACCES 8535 8536 filename is not a regular file. 8537 EIO 8538 8539 Error writing to the filename. 8540 EUSERS 8541 8542 There are no more free file structures or we run out of 8543 memory. 8544 8545 adjtime 8546 8547 Name 8548 8549 adjtime -- correct the time to allow synchronization of the 8550 system clock 8551 8552 Synopsis 8553 8554 #include 8555 8556 int adjtime(const struct timeval * delta, struct timeval * 8557 olddelta); 8558 8559 Description 8560 8561 adjtime() makes small adjustments to the system time as 8562 returned by gettimeofday()(2), advancing or retarding it by 8563 the time specified by the timeval delta. If delta is negative, 8564 the clock is slowed down by incrementing it more slowly than 8565 normal until the correction is complete. If delta is positive, 8566 a larger increment than normal is used. The skew used to 8567 perform the correction is generally a fraction of one percent. 8568 Thus, the time is always a monotonically increasing function. 8569 A time correction from an earlier call to adjtime() may not be 8570 finished when adjtime() is called again. If olddelta is 8571 non-NULL, the structure pointed to will contain, upon return, 8572 the number of microseconds still to be corrected from the 8573 earlier call. 8574 8575 adjtime() may be used by time servers that synchronize the 8576 clocks of computers in a local area network. Such time servers 8577 would slow down the clocks of some machines and speed up the 8578 clocks of others to bring them to the average network time. 8579 8580 Appropriate privilege is required to adjust the system time. 8581 8582 Return Value 8583 8584 On success, 0 is returned. On error, -1 is returned and the 8585 global variable errno is set appropriately. 8586 8587 Errors 8588 8589 EFAULT 8590 8591 An argument points outside the process's allocated address 8592 space. 8593 EPERM 8594 8595 The process does not have appropriate privilege. 8596 8597 asprintf 8598 8599 Name 8600 8601 asprintf -- write formatted output to a dynamically allocated 8602 string 8603 8604 Synopsis 8605 8606 #include 8607 8608 int asprintf(char ** restrict ptr, const char * restrict 8609 format, ...); 8610 8611 Description 8612 8613 The asprintf() function shall behave as sprintf(), except that 8614 the output string shall be dynamically allocated space of 8615 sufficient length to hold the resulting string. The address of 8616 this dynamically allocated string shall be stored in the 8617 location referenced by ptr. 8618 8619 Return Value 8620 8621 Refer to fprintf(). 8622 8623 Errors 8624 8625 Refer to fprintf(). 8626 8627 bind_textdomain_codeset 8628 8629 Name 8630 8631 bind_textdomain_codeset -- specify encoding for message 8632 retrieval 8633 8634 Synopsis 8635 8636 #include 8637 8638 char * bind_textdomain_codeset (const char * domainname , 8639 const char * codeset ); 8640 8641 Description 8642 8643 The bind_textdomain_codeset() function can be used to specify 8644 the output codeset for message catalogs for domain domainname. 8645 The codeset argument shall be a valid codeset name which can 8646 be used tor the iconv_open function, or a null pointer. If the 8647 codeset argument is the null pointer, then function returns 8648 the currently selected codeset for the domain with the name 8649 domainname. It shall return a null pointer if no codeset has 8650 yet been selected. 8651 8652 Each successive call to bind_textdomain_codeset() function 8653 overrrides the settings made by the preceding call with the 8654 same domainname. 8655 8656 The bind_textdomain_codeset() function shall return a pointer 8657 to a string containing the name of the selected codeset. The 8658 string shall be allocated internally in the function and shall 8659 not be changed or freed by the user. 8660 8661 Parameters 8662 8663 domainname 8664 8665 The domainname argument is applied to the currently active 8666 LC_MESSAGE locale. It is equivalent in syntax and meaning to 8667 the domainname argument to textdomain, except that the 8668 selection of the domain is valid only for the duration of the 8669 call. 8670 codeset 8671 8672 The name of the output codeset for the selected domain, or 8673 NULL to select the current codeset. 8674 8675 If domainname is the null pointer, or is an empty string, 8676 bind_textdomain_codeset() shall fail, but need not set errno. 8677 8678 Return Value 8679 8680 Returns the currently selected codeset name. It returns a null 8681 pointer if no codeset has yet been selected. 8682 8683 Errors 8684 8685 ENOMEM 8686 8687 Insufficient memory available to allocate return value. 8688 8689 See Also 8690 8691 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8692 textdomain, bindtextdomain 8693 8694 bindresvport 8695 8696 Name 8697 8698 bindresvport -- bind socket to privileged IP port 8699 8700 Synopsis 8701 8702 #include 8703 #include 8704 8705 int bindresvport(int sd, struct sockaddr_in * sin); 8706 8707 Description 8708 8709 If the process has appropriate privilege, the bindresvport() 8710 function shall bind a socket to a privileged IP port. 8711 8712 Return Value 8713 8714 On success, 0 is returned. On error, -1 is returned and the 8715 global variable errno is set appropriately. 8716 8717 Errors 8718 8719 EPERM 8720 8721 The process did not have appropriate privilege. 8722 EPFNOSUPPORT 8723 8724 Address of sin did not match address family of sd. 8725 8726 bindtextdomain 8727 8728 Name 8729 8730 bindtextdomain -- specify the location of a message catalog 8731 8732 Synopsis 8733 8734 #include 8735 8736 char * bindtextdomain(const char * domainname, const char * 8737 dirname); 8738 8739 Description 8740 8741 The bindtextdomain() shall set the the base directory of the 8742 hierarchy containing message catalogs for a given message 8743 domain. 8744 8745 The bindtextdomain() function specifies that the domainname 8746 message catalog can be found in the dirname directory 8747 hierarchy, rather than in the system default locale data base. 8748 8749 If dirname is not NULL, the base directory for message 8750 catalogs belonging to domain domainname shall be set to 8751 dirname. If dirname is NULL, the base directory for message 8752 catalogs shall not be altered. 8753 8754 The function shall make copies of the argument strings as 8755 needed. 8756 8757 dirname can be an absolute or relative pathname. 8758 8759 Note: Applications that wish to use chdir() should always 8760 use absolute pathnames to avoid misadvertently selecting 8761 the wrong or non-existant directory. 8762 8763 If domainname is the null pointer, or is an empty string, 8764 bindtextdomain() shall fail, but need not set errno. 8765 8766 The bindtextdomain() function shall return a pointer to a 8767 string containing the name of the selected directory. The 8768 string shall be allocated internally in the function and shall 8769 not be changed or freed by the user. 8770 8771 Return Value 8772 8773 On success, bindtextdomain() shall return a pointer to a 8774 string containing the directory pathname currently bound to 8775 the domain. On failure, a NULL pointer is returned, and the 8776 global variable errno may be set to indicate the error. 8777 8778 Errors 8779 8780 ENOMEM 8781 8782 Insufficient memory was available. 8783 8784 See Also 8785 8786 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8787 textdomain, bind_textdomain_codeset 8788 8789 cfmakeraw 8790 8791 Name 8792 8793 cfmakeraw -- get and set terminal attributes 8794 8795 Synopsis 8796 8797 #include 8798 8799 void cfmakeraw(struct termios * termios_p); 8800 8801 Description 8802 8803 The cfmakeraw() function shall set the attributes of the 8804 termios structure referenced by termios_p as follows: 8805 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 8806 |INLCR|IGNCR|ICRNL|IXON); 8807 8808 termios_p->c_oflag &= ~OPOST; 8809 8810 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 8811 8812 termios_p->c_cflag &= ~(CSIZE|PARENB); 8813 8814 termios_p->c_cflag |= CS8; 8815 8816 termios_p shall point to a termios structure that contains the 8817 following members: 8818 tcflag_t c_iflag; /* input modes */ 8819 tcflag_t c_oflag; /* output modes */ 8820 tcflag_t c_cflag; /* control modes */ 8821 tcflag_t c_lflag; /* local modes */ 8822 cc_t c_cc[NCCS]; /* control chars */ 8823 8824 cfsetspeed 8825 8826 Name 8827 8828 cfsetspeed -- set terminal input and output data rate 8829 8830 Synopsis 8831 8832 #include 8833 8834 int cfsetspeed(struct termios *t, speed_t speed); 8835 8836 Description 8837 8838 The cfsetspeed() function shall set the input and output 8839 speeds in t to the value specified by speed. The effects of 8840 the function on the terminal as described below do not become 8841 effective, nor are all errors detected, until the tcsetattr() 8842 function is called. Certain values for baud rates set in 8843 termios and passed to tcsetattr() have special meanings. 8844 8845 Return Value 8846 8847 On success, 0 is returned. On error, -1 is returned and the 8848 global variable errno is set appropriately. 8849 8850 Errors 8851 8852 EINVAL 8853 8854 Invalid speed argument 8855 8856 daemon 8857 8858 Name 8859 8860 daemon -- run in the background 8861 8862 Synopsis 8863 8864 #include 8865 8866 int daemon(int nochdir, int noclose); 8867 8868 Description 8869 8870 The daemon() function shall create a new process, detached 8871 from the controlling terminal. If successful, the calling 8872 process shall exit and the new process shall continue to 8873 execute the application in the background. If nochdir 8874 evaluates to true, the current directory shall not be changed. 8875 Otherwise, daemon() shall change the current working directory 8876 to the root (`/'). If noclose evaluates to true the standard 8877 input, standard output, and standard error file descriptors 8878 shall not be altered. Otherwise, daemon() shall close the 8879 standard input, standard output and standard error file 8880 descriptors and reopen them attached to /dev/null. 8881 8882 Return Value 8883 8884 On error, -1 is returned, and the global variable errno is set 8885 to any of the errors specified for the library functions 8886 fork() and setsid(). 8887 8888 dcgettext 8889 8890 Name 8891 8892 dcgettext -- perform domain and category specific lookup in 8893 message catalog 8894 8895 Synopsis 8896 8897 #include 8898 #include 8899 8900 char * dcgettext(const char * domainname, const char * msgid, 8901 int category); 8902 8903 Description 8904 8905 The dcgettext() function is a domain specified version of 8906 gettext(). 8907 8908 The dcgettext() function shall lookup the translation in the 8909 current locale of the message identified by msgid in the 8910 domain specified by domainname and in the locale category 8911 specified by category. If domainname is NULL, the current 8912 default domain shall be used. The msgid argument shall be a 8913 NULL-terminated string to be matched in the catalogue. 8914 category shall specify the locale category to be used for 8915 retrieving message strings. The category parameter shall be 8916 one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, 8917 LC_NUMERIC, or LC_TIME. The default domain shall not be 8918 changed by a call to dcgettext(). 8919 8920 Return Value 8921 8922 If a translation was found in one of the specified catalogs, 8923 it shall be converted to the current locale's codeset and 8924 returned. The resulting NULL-terminated string shall be 8925 allocated by the dcgettext function, and must not be modified 8926 or freed. If no translation was found, or category was 8927 invalid, msgid shall be returned. 8928 8929 Errors 8930 8931 dcgettext() shall not modify the errno global variable. 8932 8933 See Also 8934 8935 gettext, dgettext, ngettext, dngettext, dcngettext, 8936 textdomain, bindtextdomain, bind_textdomain_codeset 8937 8938 dcngettext 8939 8940 Name 8941 8942 dcngettext -- perform domain and category specific lookup in 8943 message catalog with plural 8944 8945 Synopsis 8946 8947 #include 8948 #include 8949 8950 char * dcngettext(const char * domainname, const char * 8951 msgid1, const char * msgid2, unsigned long int n, int 8952 category); 8953 8954 Description 8955 8956 The dcngettext() function is a domain specific version of 8957 gettext, capable of returning either a singular or plural form 8958 of the message. The dcngettext() function shall lookup the 8959 translation in the current locale of the message identified by 8960 msgid1 in the domain specified by domainname and in the locale 8961 category specified by category. If domainname is NULL, the 8962 current default domain shall be used. The msgid1 argument 8963 shall be a NULL-terminated string to be matched in the 8964 catalogue. category shall specify the locale category to be 8965 used for retrieving message strings. The category parameter 8966 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, 8967 LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall 8968 not be changed by a call to dcngettext(). If n is 1 then the 8969 singular version of the message is returned, otherwise one of 8970 the plural forms is returned, depending on the value of n and 8971 the current locale settings. 8972 8973 Return Value 8974 8975 If a translation corresponding to the value of n was found in 8976 one of the specified catalogs for msgid1, it shall be 8977 converted to the current locale's codeset and returned. The 8978 resulting NULL-terminated string shall be allocated by the 8979 dcngettext() function, and must not be modified or freed. If 8980 no translation was found, or category was invalid, msgid1 8981 shall be returned if n has the value 1, otherwise msgid2 shall 8982 be returned. 8983 8984 Errors 8985 8986 dcngettext() shall not modify the errno global variable. 8987 8988 See Also 8989 8990 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 8991 bindtextdomain, bind_textdomain_codeset 8992 8993 dgettext 8994 8995 Name 8996 8997 dgettext -- perform lookup in message catalog for the current 8998 LC_MESSAGES locale 8999 9000 Synopsis 9001 9002 #include 9003 9004 char * dgettext(const char * domainname, const char * msgid); 9005 9006 Description 9007 9008 dgettext() is a domain specified version of gettext(). 9009 9010 The dgettext() function shall search the currently selected 9011 message catalogs in the domain domainname for a string 9012 identified by the string msgid. If a string is located, that 9013 string shall be returned. The domain specified by domainname 9014 applies to the currently active LC_MESSAGE locale. The default 9015 domain shall not be changed by a call to dgettext(). 9016 9017 Note: The usage of domainanme is equivalent in syntax and 9018 meaning to the textdomain() function's application of 9019 domainname, except that the selection of the domain in 9020 dgettext() is valid only for the duration of the call. 9021 9022 The dgettext() function is equivalent to dcgettext(domainname, 9023 msgid, LC_MESSAGES). 9024 9025 Return Value 9026 9027 On success of a msgid query, the translated NULL-terminated 9028 string is returned. On error, the original msgid is returned. 9029 The length of the string returned is undetermined until 9030 dgettext() is called. 9031 9032 Errors 9033 9034 dgettext() shall not modify the errno global variable. 9035 9036 See Also 9037 9038 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 9039 textdomain, bindtextdomain, bind_textdomain_codeset 9040 9041 dngettext 9042 9043 Name 9044 9045 dngettext -- perform lookup in message catalog for the current 9046 locale 9047 9048 Synopsis 9049 9050 #include 9051 9052 char * dngettext(const char * domainname, const char * msgid1, 9053 const char * msgid2, unsigned long int n); 9054 9055 Description 9056 9057 dngettext() shall be equivalent to a call to 9058 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 9059 9060 See dcngettext() for more information. 9061 9062 See Also 9063 9064 gettext, dgettext, ngettext, dcgettext, dcngettext, 9065 textdomain, bindtextdomain, bind_textdomain_codeset 9066 9067 duplocale 9068 9069 Name 9070 9071 duplocale -- provide new handle for selection of locale 9072 9073 Synopsis 9074 9075 #include 9076 9077 locale_t duplocale(locale_t locale); 9078 9079 Description 9080 9081 The duplocale() function shall provide a new locale object 9082 based on the locale object provided in locale, suitable for 9083 use in the newlocale() or uselocale() functions. The new 9084 object may be released by calling freelocale(). 9085 9086 Return Value 9087 9088 On success, the duplocale() function shall return a locale 9089 object. Otherwise, it shall return NULL, and set errno to 9090 indicate the error. 9091 9092 Errors 9093 9094 The duplocale() function shall fail if: 9095 9096 ENOMEM 9097 9098 Insufficient memory. 9099 9100 See Also 9101 9102 setlocale(), freelocale(), newlocale(), uselocale() 9103 9104 endutent 9105 9106 Name 9107 9108 endutent -- access utmp file entries 9109 9110 Synopsis 9111 9112 #include 9113 9114 void endutent(void); 9115 9116 Description 9117 9118 endutent() closes the utmp file. It should be called when the 9119 user code is done accessing the file with the other functions. 9120 9121 err 9122 9123 Name 9124 9125 err -- display formatted error messages 9126 9127 Synopsis 9128 9129 #include 9130 9131 void err(int eval, const char * fmt, ...); 9132 9133 Description 9134 9135 The err() function shall display a formatted error message on 9136 the standard error stream. First, err() shall write the last 9137 component of the program name, a colon character, and a space 9138 character. If fmt is non-NULL, it shall be used as a format 9139 string for the printf() family of functions, and err() shall 9140 write the formatted message, a colon character, and a space. 9141 Finally, the error message string affiliated with the current 9142 value of the global variable errno shall be written, followed 9143 by a newline character. 9144 9145 The err() function shall not return, the program shall 9146 terminate with the exit value of eval. 9147 9148 See Also 9149 9150 error(), errx() 9151 9152 Return Value 9153 9154 None. 9155 9156 Errors 9157 9158 None. 9159 9160 error 9161 9162 Name 9163 9164 error -- print error message 9165 9166 Synopsis 9167 9168 #include 9169 9170 void error(int exitstatus, int errnum, const char * format, 9171 ...); 9172 9173 Description 9174 9175 error() shall print a message to standard error. 9176 9177 error() shall build the message from the following elements in 9178 their specified order: 9179 9180 1. the program name. If the application has provided a 9181 function named error_print_progname(), error() shall call 9182 this to supply the program name; otherwise, error() uses 9183 the content of the global variable program_name. 9184 2. the colon and space characters, then the result of using 9185 the printf-style format and the optional arguments. 9186 3. if errnum is nonzero, error() shall add the colon and 9187 space characters, then the result of strerror(errnum). 9188 4. a newline. 9189 9190 If exitstatus is nonzero, error() shall call exit(exitstatus). 9191 9192 See Also 9193 9194 err(), errx() 9195 9196 errx 9197 9198 Name 9199 9200 errx -- display formatted error message and exit 9201 9202 Synopsis 9203 9204 #include 9205 9206 void errx(int eval, const char * fmt, ...); 9207 9208 Description 9209 9210 The errx() function shall display a formatted error message on 9211 the standard error stream. The last component of the program 9212 name, a colon character, and a space shall be output. If fmt 9213 is non-NULL, it shall be used as the format string for the 9214 printf() family of functions, and the formatted error message, 9215 a colon character, and a space shall be output. The output 9216 shall be followed by a newline character. 9217 9218 errx() does not return, but shall exit with the value of eval. 9219 9220 Return Value 9221 9222 None. 9223 9224 Errors 9225 9226 None. 9227 9228 See Also 9229 9230 error(), err() 9231 9232 fcntl 9233 9234 Name 9235 9236 fcntl -- file control 9237 9238 Description 9239 9240 fcntl() is as specified in ISO POSIX (2003), but with 9241 differences as listed below. 9242 9243 Implementation may set O_LARGEFILE 9244 9245 According to ISO POSIX (2003), only an application sets 9246 fcntl() flags, for example O_LARGEFILE. However, this 9247 specification also allows an implementation to set the 9248 O_LARGEFILE flag in the case where the programming environment 9249 is one of _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 9250 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX 9251 (2003) for a description of these environments. Thus, calling 9252 fcntl() with the F_GETFL command may return O_LARGEFILE as 9253 well as flags explicitly set by the application in the case 9254 that both the implementation and the application support an 9255 off_t of at least 64 bits. 9256 9257 fflush_unlocked 9258 9259 Name 9260 9261 fflush_unlocked -- non thread safe fflush 9262 9263 Description 9264 9265 fflush_unlocked() is the same as fflush() except that it need 9266 not be thread safe. That is, it may only be invoked in the 9267 ways which are legal for getc_unlocked(). 9268 9269 fgetwc_unlocked 9270 9271 Name 9272 9273 fgetwc_unlocked -- non thread safe fgetwc 9274 9275 Description 9276 9277 fgetwc_unlocked() is the same as fgetwc() except that it need 9278 not be thread safe. That is, it may only be invoked in the 9279 ways which are legal for getc_unlocked(). 9280 9281 flock 9282 9283 Name 9284 9285 flock -- apply or remove an advisory lock on an open file 9286 9287 Synopsis 9288 9289 int flock(int fd, int operation); 9290 9291 Description 9292 9293 flock() applies or removes an advisory lock on the open file 9294 fd. Valid operation types are: 9295 9296 LOCK_SH 9297 9298 Shared lock. More than one process may hold a shared lock for 9299 a given file at a given time. 9300 LOCK_EX 9301 9302 Exclusive lock. Only one process may hold an exclusive lock 9303 for a given file at a given time. 9304 LOCK_UN 9305 9306 Unlock. 9307 LOCK_NB 9308 9309 Don't block when locking. May be specified (by oring) along 9310 with one of the other operations. 9311 9312 A single file may not simultaneously have both shared and 9313 exclusive locks. 9314 9315 Return Value 9316 9317 On success, 0 is returned. On error, -1 is returned and the 9318 global variable errno is set appropriately. 9319 9320 Errors 9321 9322 EWOULDBLOCK 9323 9324 The file is locked and the LOCK_NB flag was selected. 9325 EBADF 9326 9327 fd is not a not an open file descriptor. 9328 EINTR 9329 9330 While waiting to acquire a lock, the call was interrupted by 9331 delivery of a signal caught by a handler. 9332 EINVAL 9333 9334 The operation is invalid. 9335 EWOULDBLOCK 9336 9337 The implementation ran out of memory for allocating lock 9338 records. 9339 9340 freelocale 9341 9342 Name 9343 9344 freelocale -- free a locale object 9345 9346 Synopsis 9347 9348 #include 9349 9350 void freelocale(locale_t locale); 9351 9352 Description 9353 9354 The freelocale() function shall free the locale object locale, 9355 and release any resources associated with it. 9356 9357 Return Value 9358 9359 None. 9360 9361 Errors 9362 9363 None defined. 9364 9365 See Also 9366 9367 setlocale(), newlocale(), duplocale(), uselocale() 9368 9369 fscanf 9370 9371 Name 9372 9373 fscanf -- convert formatted input 9374 9375 Description 9376 9377 The scanf() family of functions shall behave as described in 9378 ISO POSIX (2003), except as noted below. 9379 9380 Differences 9381 9382 The %s, %S and %[ conversion specifiers shall accept an option 9383 length modifier a, which shall cause a memory buffer to be 9384 allocated to hold the string converted. In such a case, the 9385 argument corresponding to the conversion specifier should be a 9386 reference to a pointer value that will receive a pointer to 9387 the allocated buffer. If there is insufficient memory to 9388 allocate a buffer, the function may set errno to ENOMEM and a 9389 conversion error results. 9390 9391 Note: This directly conflicts with the ISO C (1999) usage 9392 of %a as a conversion specifier for hexadecimal float 9393 values. While this conversion specifier should be 9394 supported, a format specifier such as "%aseconds" will have 9395 a different meaning on an LSB conforming system. 9396 9397 fstatfs 9398 9399 Name 9400 9401 fstatfs -- (deprecated) 9402 9403 Synopsis 9404 9405 #include 9406 9407 int fstatfs(int fd, struct statfs * buf); 9408 9409 Description 9410 9411 The fstatfs() function returns information about a mounted 9412 file system. The file system is identified by fd, a file 9413 descriptor of an open file within the mounted filesystem. The 9414 results are placed in the structure pointed to by buf. 9415 9416 Fields that are undefined for a particular file system shall 9417 be set to 0. 9418 9419 Note: Application developers should use the fstatvfs() 9420 function to obtain general file system information. 9421 Applications should only use the fstatfs() function if they 9422 must determine the file system type, which need not be 9423 provided by fstatvfs(). 9424 9425 Return Value 9426 9427 On success, the fstatfs() function shall return 0 and set the 9428 fields of the structure idenfitied by buf accordingly. On 9429 error, the fstatfs() function shall return -1 and set errno 9430 accordingly. 9431 9432 Errors 9433 9434 EBADF 9435 9436 fd is not a valid open file descriptor. 9437 EFAULT 9438 9439 buf points to an invalid address. 9440 EIO 9441 9442 An I/O error occurred while reading from or writing to the 9443 file system. 9444 ENOSYS 9445 9446 The filesystem fd is open on does not support statfs(). 9447 9448 fstatfs64 9449 9450 Name 9451 9452 fstatfs64 -- (deprecated) 9453 9454 Synopsis 9455 9456 #include 9457 9458 int fstatfs64(int fd, struct statfs64 * buf); 9459 9460 Description 9461 9462 The fstatfs64() function returns information about a mounted 9463 file system. The file system is identified by fd, a file 9464 descriptor of an open file within the mounted filesystem. The 9465 results are placed in the structure pointed to by buf. 9466 9467 Fields that are undefined for a particular file system shall 9468 be set to 0. 9469 9470 fstatfs64() is the 64-bit version of fstatfs(). 9471 9472 Note: Application developers should use the fstatvfs64() 9473 function to obtain general file system information. 9474 Applications should only use the fstatfs64() function if 9475 they must determine the file system type, which need not be 9476 provided by fstatvfs64(). 9477 9478 Return Value 9479 9480 On success, the fstatfs64() function shall return 0 and set 9481 the fields of the structure idenfitied by buf accordingly. On 9482 error, the fstatfs64() function shall return -1 and set errno 9483 accordingly. 9484 9485 Errors 9486 9487 See fstatfs(). 9488 9489 fwscanf 9490 9491 Name 9492 9493 fwscanf -- convert formatted input 9494 9495 Description 9496 9497 The scanf() family of functions shall behave as described in 9498 ISO POSIX (2003), except as noted below. 9499 9500 Differences 9501 9502 The %s, %S and %[ conversion specifiers shall accept an option 9503 length modifier a, which shall cause a memory buffer to be 9504 allocated to hold the string converted. In such a case, the 9505 argument corresponding to the conversion specifier should be a 9506 reference to a pointer value that will receive a pointer to 9507 the allocated buffer. If there is insufficient memory to 9508 allocate a buffer, the function may set errno to ENOMEM and a 9509 conversion error results. 9510 9511 Note: This directly conflicts with the ISO C (1999) usage 9512 of %a as a conversion specifier for hexadecimal float 9513 values. While this conversion specifier should be 9514 supported, a format specifier such as "%aseconds" will have 9515 a different meaning on an LSB conforming system. 9516 9517 getgrouplist 9518 9519 Name 9520 9521 getgrouplist -- get network group entry 9522 9523 Synopsis 9524 9525 #include 9526 9527 int getgrouplist(const char * user, gid_t group, gid_t * 9528 groups, int * ngroups); 9529 9530 Description 9531 9532 The getgrouplist() function shall fill in the array groups 9533 with the supplementary groups for the user specified by user. 9534 On entry, ngroups shall refer to an integer containing the 9535 maximum number of gid_t members in the groups array. The group 9536 group shall also be included. On success, the value referred 9537 to by ngroups shall be updated to contain the number of gid_t 9538 objects copied. 9539 9540 Return Value 9541 9542 On success, if there was sufficient room to copy all the 9543 supplementatry group identifiers to the array identified by 9544 groups, getgrouplist() shall return the number of gid_t 9545 objects copied, and the value referenced by ngroups shall be 9546 updated. If there was not sufficient room to copy all the 9547 supplementary group identifiers, grouplist() shall return -1, 9548 and update the value referenced by ngroups to the number 9549 actually copied. 9550 9551 If user does not refer to a valid user on the system, 9552 getgrouplist() shall return 0, and set the value referenced by 9553 ngroups to 0. 9554 9555 Errors 9556 9557 None defined. 9558 9559 See Also 9560 9561 getgroups() 9562 9563 getloadavg 9564 9565 Name 9566 9567 getloadavg -- get system load averages 9568 9569 Synopsis 9570 9571 #include 9572 9573 int getloadavg(double loadavg[], int nelem); 9574 9575 Description 9576 9577 getloadavg() returns the number of processes in the system run 9578 queue averaged over various periods of time. Up to nelem 9579 samples are retrieved and assigned to successive elements of 9580 loadavg[]. The system imposes a maximum of 3 samples, 9581 representing averages over the last 1, 5, and 15 minutes, 9582 respectively. 9583 9584 getopt 9585 9586 Name 9587 9588 getopt -- parse command line options 9589 9590 Synopsis 9591 9592 #include 9593 9594 int getopt(int argc, char * const argv[], const char * 9595 optstring); 9596 9597 extern char *optarg; 9598 extern int optind, opterr, optopt; 9599 9600 Description 9601 9602 The getopt() function shall parse command line arguments as 9603 described in ISO POSIX (2003), with the following exceptions, 9604 where LSB and POSIX specifications vary. LSB systems shall 9605 implement the modified behaviors described below. 9606 9607 Argument Ordering 9608 9609 The getopt() function can process command line arguments 9610 referenced by argv in one of three ways: 9611 9612 PERMUTE 9613 9614 the order of arguments in argv is altered so that all options 9615 (and their arguments) are moved in front of all of the 9616 operands. This is the default behavior. 9617 9618 Note: This behavior has undefined results if argv is not 9619 modifiable. This is to support historic behavior predating 9620 the use of const and ISO C (1999). The function prototype 9621 was aligned with ISO POSIX (2003) despite the fact that it 9622 modifies argv, and the library maintainers are unwilling to 9623 change this. 9624 9625 REQUIRE_ORDER 9626 9627 The arguments in argv are processed in exactly the order 9628 given, and option processing stops when the first non-option 9629 argument is reached, or when the element of argv is "--". This 9630 ordering can be enforced either by setting the environment 9631 variable POSIXLY_CORRECT, or by setting the first character of 9632 optstring to '+'. 9633 RETURN_IN_ORDER 9634 9635 The order of arguments is not altered, and all arguments are 9636 processed. Non-option arguments (operands) are handled as if 9637 they were the argument to an option with the value 1 ('\001'). 9638 This ordering is selected by setting the first character of 9639 optstring to '-'; 9640 9641 Option Characteristics 9642 9643 LSB specifies that: 9644 9645 * an element of argv that starts with "-" (and is not 9646 exactly "-" or "--") is an option element. 9647 * characters of an option element, aside from the initial 9648 "-", are option characters. 9649 9650 POSIX specifies that: 9651 9652 * applications using getopt() shall obey the following 9653 syntax guidelines: 9654 + option name is a single alphanumeric character from 9655 the portable character set 9656 + option is preceded by the '-' delimiter character 9657 + options without option-arguments should be accepted 9658 when grouped behind one '-' delimiter 9659 + each option and option-argument is a separate 9660 argument 9661 + option-arguments are not optional 9662 + all options should precede operands on the command 9663 line 9664 + the argument "--" is accepted as a delimiter 9665 indicating the end of options and the consideration 9666 of subsequent arguments, if any, as operands 9667 * historical implementations of getopt() support other 9668 characters as options as an allowed extension, but 9669 applications that use extensions are not maximally 9670 portable. 9671 * support for multi-byte option characters is only possible 9672 when such characters can be represented as type int. 9673 * applications that call any utility with a first operand 9674 starting with '-' should usually specify "--" to mark the 9675 end of the options. Standard utilities that do not support 9676 this guideline indicate that fact in the OPTIONS section 9677 of the utility description. 9678 9679 Extensions 9680 9681 LSB specifies that: 9682 9683 * if a character is followed by two colons, the option takes 9684 an optional argument; if there is text in the current argv 9685 element, it is returned in optarg, otherwise optarg is set 9686 to 0. 9687 * if optstring contains W followed by a semi-colon (;), then 9688 -W foo is treated as the long option --foo. 9689 9690 Note: See getopt_long() for a description of long options. 9691 * The first character of optstring shall modify the behavior 9692 of getopt() as follows: 9693 + if the first character is '+', then REQUIRE_ORDER 9694 processing shall be in effect (see above) 9695 + if the first character is '-', then RETURN_IN_ORDER 9696 processing shall be in effect (see above) 9697 + if the first character is ':', then getopt() shall 9698 return ':' instead of '?' to indicate a missing 9699 option argument, and shall not print any diagnostic 9700 message to stderr. 9701 9702 POSIX specifies that: 9703 9704 * the -W option is reserved for implementation extensions. 9705 9706 Return Values 9707 9708 LSB specifies the following additional getopt() return values: 9709 9710 * '\001' is returned if RETURN_IN_ORDER argument ordering is 9711 in effect, and the next argument is an operand, not an 9712 option. The argument is available in optarg. 9713 9714 Any other return value has the same meaning as for POSIX. 9715 9716 POSIX specifies the following getopt() return values: 9717 9718 * the next option character is returned, if found 9719 successfully. 9720 * ':' is returned if a parameter is missing for one of the 9721 options and the first character of optstring is ':'. 9722 * '?' is returned if an unknown option character not in 9723 optstring is encountered, or if getopt() detects a missing 9724 argument and the first character of optstring is not ':'. 9725 * -1 is returned for the end of the option list. 9726 9727 Environment Variables 9728 9729 LSB specifies that: 9730 9731 * if the variable POSIXLY_CORRECT is set, option processing 9732 stops as soon as a non-option argument is encountered. 9733 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 9734 is the process ID for the current process), contains a 9735 space separated list of arguments that should not be 9736 treated as arguments even though they appear to be so. 9737 9738 Rationale: This was used by bash 2.0 to communicate to GNU 9739 libc which arguments resulted from wildcard expansion and 9740 so should not be considered as options. This behavior was 9741 removed in bash version 2.01, but the support remains in 9742 GNU libc. 9743 This behavior is DEPRECATED in this version of the LSB; 9744 future revisions of this specification may not include 9745 this requirement. 9746 9747 getopt_long 9748 9749 Name 9750 9751 getopt_long -- parse command line options 9752 9753 Synopsis 9754 9755 #define _GNU_SOURCE 9756 #include 9757 9758 int getopt_long(int argc, char * const argv[], const char * 9759 opstring, const struct option * longopts, int * longindex); 9760 9761 Description 9762 9763 getopt_long() works like getopt() except that it also accepts 9764 long options, started out by two dashes. Long option names may 9765 be abbreviated if the abbreviation is unique or is an exact 9766 match for some defined option. A long option may take a 9767 parameter, of the form --arg=param or --arg param. 9768 9769 longopts is a pointer to the first element of an array of 9770 struct option declared in getopt.h as: 9771 struct option { 9772 const char *name; 9773 int has_arg; 9774 int *flag; 9775 int val; 9776 }; 9777 9778 The fields in this structure have the following meaning: 9779 9780 name 9781 9782 The name of the long option. 9783 has_arg 9784 9785 One of: 9786 9787 no_argument (or 0) if the option does not take an argument, 9788 required_argument (or 1) if the option requires an argument, 9789 or 9790 optional_argument (or 2) if the option takes an optional 9791 argument. 9792 9793 flag 9794 9795 specifies how results are returned for a long option. If flag 9796 is NULL, then getopt_long() shall return val. (For example, 9797 the calling program may set val to the equivalent short option 9798 character.) Otherwise, getopt_long() returns 0, and flag shall 9799 point to a variable which shall be set to val if the option is 9800 found, but left unchanged if the option is not found. 9801 val 9802 9803 The value to return, or to load into the variable pointed to 9804 by flag. 9805 9806 If longindex is not NULL, it points to a variable which is set 9807 to the index of the long option relative to longopts. 9808 9809 Return Value 9810 9811 getopt_long() returns the option character if a short option 9812 was found successfully, or ":" if there was a missing 9813 parameter for one of the options, or "?" for an unknown option 9814 character, or -1 for the end of the option list. 9815 9816 For a long option, getopt_long() returns val if flag is NULL, 9817 and 0 otherwise. Error and -1 returns are the same as for 9818 getopt(), plus "?" for an ambiguous match or an extraneous 9819 parameter. 9820 9821 getopt_long_only 9822 9823 Name 9824 9825 getopt_long_only -- parse command line options 9826 9827 Synopsis 9828 9829 #define _GNU_SOURCE 9830 #include 9831 9832 int getopt_long_only(int argc, char * const argv[], const char 9833 * optstring, const struct option * longopts, int * longindex); 9834 9835 Description 9836 9837 getopt_long_only() is like getopt_long(), but "-" as well as 9838 "--" can indicate a long option. If an option that starts with 9839 "-" (not "--") doesn't match a long option, but does match a 9840 short option, it is parsed as a short option instead. 9841 9842 Note: The getopt_long_only() function is intended only for 9843 supporting certain programs whose command line syntax was 9844 designed before the Utility Syntax Guidelines of ISO POSIX 9845 (2003) were developed. New programs should generally call 9846 getopt_long() instead, which provides the --option syntax 9847 for long options, which is preferred by GNU and consistent 9848 with ISO POSIX (2003). 9849 9850 Return Value 9851 9852 getopt_long_only() returns the option character if the option 9853 was found successfully, or ":" if there was a missing 9854 parameter for one of the options, or "?" for an unknown option 9855 character, or -1 for the end of the option list. 9856 9857 getopt_long_only() also returns the option character when a 9858 short option is recognized. For a long option, they return val 9859 if flag is NULL, and 0 otherwise. Error and -1 returns are the 9860 same as for getopt(), plus "?" for an ambiguous match or an 9861 extraneous parameter. 9862 9863 getsockopt 9864 9865 Name 9866 9867 getsockopt -- get socket options 9868 9869 Synopsis 9870 9871 #include 9872 #include 9873 9874 int getsockopt(int socket, int level, int option_name, void * 9875 restrict option_value, socklen_t * restrict option_len); 9876 9877 Description 9878 9879 The getsockopt() function shall behave as specified in ISO 9880 POSIX (2003), with the following extensions. 9881 9882 IP Protocol Level Options 9883 9884 If the level parameter is IPPROTO_IP, the following values 9885 shall be supported for option_name (see RFC 791:Internet 9886 Protocol for further details): 9887 9888 IP_OPTIONS 9889 9890 Get the Internet Protocol options sent with every packet from 9891 this socket. The option_value shall point to a memory buffer 9892 in which the options shall be placed; on entry option_len 9893 shall point to an integer value indicating the maximum size of 9894 the memory buffer, in bytes. On successful return, the value 9895 referenced by option_len shall be updated to the size of data 9896 copied to the buffer. For IPv4, the maximum length of options 9897 is 40 bytes. 9898 IP_TTL 9899 9900 Get the current unicast Internet Protocol Time To Live value 9901 used when sending packets with this socket. The option_value 9902 shall point to a buffer large enough to hold the time to live 9903 value (at least 1 byte), and option_len shall point to an 9904 integer value holding the maximum size of that buffer. On 9905 successful return, the value referenced by option_len shall be 9906 updated to contain the number of bytes copied into the buffer, 9907 which shall be no larger than the initial value, and 9908 option_value shall point to an integer containing the time to 9909 live value. 9910 IP_TOS 9911 9912 Get the Internet Protocol type of service indicator used when 9913 sending packets with this socket. The option_value shall point 9914 to a buffer large enough to hold the type of service indicator 9915 (at least 1 byte), and option_len shall point to an integer 9916 value holding the maximum size of that buffer. On successful 9917 return, the value referenced by option_len shall be updated to 9918 contain the number of bytes copied into the buffer, which 9919 shall be no larger than the initial value, and option_value 9920 shall point to an integer containing the time to live value. 9921 9922 gettext 9923 9924 Name 9925 9926 gettext -- search message catalogs for a string 9927 9928 Synopsis 9929 9930 #include 9931 9932 char * gettext(const char * msgid); 9933 9934 Description 9935 9936 The gettext() function shall search the currently selected 9937 message catalogs for a string identified by the string msgid. 9938 If a string is located, that string shall be returned. 9939 9940 The gettext() function is equivalent to dcgettext(NULL, msgid, 9941 LC_MESSAGES). 9942 9943 Return Value 9944 9945 If a string is found in the currently selected message 9946 catalogs for msgid, then a pointer to that string shall be 9947 returned. Otherwise, a pointer to msgid shall be returned. 9948 9949 Applications shall not modify the string returned by 9950 gettext(). 9951 9952 Errors 9953 9954 None. 9955 9956 The gettext() function shall not modify errno. 9957 9958 See Also 9959 9960 dgettext, ngettext, dngettext, dcgettext, dcngettext, 9961 textdomain, bindtextdomain, bind_textdomain_codeset 9962 9963 getutent 9964 9965 Name 9966 9967 getutent -- access user accounting database entries 9968 9969 Synopsis 9970 9971 #include 9972 9973 struct utmp *getutent(void); 9974 9975 Description 9976 9977 The getutent() function shall read the next entry from the 9978 user accounting database. 9979 9980 Return Value 9981 9982 Upon successful completion, getutent() shall return a pointer 9983 to a utmp structure containing a copy of the requested entry 9984 in the user accounting database. Otherwise, a null pointer 9985 shall be returned. The return value may point to a static area 9986 which is overwritten by a subsequent call to getutent(). 9987 9988 Errors 9989 9990 None defined. 9991 9992 getutent_r 9993 9994 Name 9995 9996 getutent_r -- access user accounting database entries 9997 9998 Synopsis 9999 10000 int getutent_r(struct utmp * buffer, struct utmp ** result); 10001 10002 Description 10003 10004 The getutent_r() function is a reentrant version of the 10005 getutent() function. On entry, buffer should point to a user 10006 supplied buffer to which the next entry in the database will 10007 be copied, and result should point to a location where the 10008 result will be stored. 10009 10010 Return Value 10011 10012 On success, getutent_r() shall return 0 and set the location 10013 referenced by result to a pointer to buffer. Otherwise, 10014 getutent_r() shall return -1 and set the location referenced 10015 by result to NULL. 10016 10017 glob64 10018 10019 Name 10020 10021 glob64 -- find pathnames matching a pattern (Large File 10022 Support) 10023 10024 Synopsis 10025 10026 #include 10027 10028 int glob64(const char * pattern, int flags, int (*errfunc) 10029 (const char *, int), glob64_t * pglob); 10030 10031 Description 10032 10033 The glob64() function is a large-file version of the glob() 10034 defined in ISO POSIX (2003). It shall search for pathnames 10035 matching pattern according to the rules used by the shell, 10036 /bin/sh. No tilde expansion or parameter substitution is done; 10037 see wordexp(). 10038 10039 The results of a glob64() call are stored in the structure 10040 pointed to by pglob, which is a glob64_t declared in glob.h 10041 with the following members: 10042 typedef struct 10043 { 10044 size_t gl_pathc; 10045 char **gl_pathv; 10046 size_t gl_offs; 10047 int gl_flags; 10048 void (*gl_closedir) (void *); 10049 struct dirent64 *(*gl_readdir64) (void *); 10050 void *(*gl_opendir) (const char *); 10051 int (*gl_lstat) (const char *, struct stat *); 10052 int (*gl_stat) (const char *, struct stat *); 10053 } 10054 glob64_t; 10055 10056 Structure members with the same name as corresponding members 10057 of a glob_t as defined in ISO POSIX (2003) shall have the same 10058 purpose. 10059 10060 Other members are defined as follows: 10061 10062 gl_flags 10063 10064 reserved for internal use 10065 gl_closedir 10066 10067 pointer to a function capable of closing a directory opened by 10068 gl_opendir 10069 gl_readdir64 10070 10071 pointer to a function capable of reading entries in a large 10072 directory 10073 gl_opendir 10074 10075 pointer to a function capable of opening a large directory 10076 gl_stat 10077 10078 pointer to a function capable of returning file status for a 10079 large file 10080 gl_lstat 10081 10082 pointer to a function capable of returning file status 10083 information for a large file or symbolic link 10084 10085 A large file or large directory is one with a size which 10086 cannot be represented by a variable of type off_t. 10087 10088 Return Value 10089 10090 On success, 0 is returned. Other possible returns are: 10091 10092 GLOB_NOSPACE 10093 10094 out of memory 10095 GLOB_ABORTED 10096 10097 read error 10098 GLOB_NOMATCH 10099 10100 no match found 10101 10102 globfree64 10103 10104 Name 10105 10106 globfree64 -- free memory from glob64() (Large File Support) 10107 10108 Synopsis 10109 10110 #include 10111 10112 void globfree64(glob64_t * pglob); 10113 10114 Description 10115 10116 globfree64() frees the dynamically allocated storage from an 10117 earlier call to glob64(). 10118 10119 globfree64() is a 64-bit version of globfree(). 10120 10121 initgroups 10122 10123 Name 10124 10125 initgroups -- initialize the supplementary group access list 10126 10127 Synopsis 10128 10129 #include 10130 #include 10131 10132 int initgroups(const char * user, gid_t group); 10133 10134 Description 10135 10136 If the process has appropriate privilege, the initgroups() 10137 function shall initialize the Supplementary Group IDs for the 10138 current process by reading the group database and using all 10139 groups of which user is a member. The additional group group 10140 is also added to the list. 10141 10142 Return Value 10143 10144 On success, 0 is returned. On error, -1 is returned and the 10145 global variable errno is set appropriately. 10146 10147 Errors 10148 10149 EPERM 10150 10151 The calling process does not have sufficient privileges. 10152 ENOMEM 10153 10154 Insufficient memory to allocate group information structure. 10155 10156 See Also 10157 10158 setgroups() 10159 10160 ioctl 10161 10162 Name 10163 10164 ioctl -- control device 10165 10166 Synopsis 10167 10168 #include 10169 10170 int ioctl (int fildes , int request , ...); 10171 10172 Description 10173 10174 The ioctl() function shall manipulate the underlying device 10175 parameters of special files. fildes shall be an open file 10176 descriptor referring to a special file. The ioctl() function 10177 shall take three parameters; the type and value of the third 10178 parameter is dependent on the device and request. 10179 10180 Conforming LSB applications shall not call ioctl() except in 10181 situations explicitly stated in this specification. 10182 10183 Return Value 10184 10185 On success, 0 is returned. An ioctl() may use the return value 10186 as an output parameter and return a non-negative value on 10187 success. On error, -1 is returned and the global variable 10188 errno is set appropriately. 10189 10190 Errors 10191 10192 EBADF 10193 10194 fildes is not a valid descriptor. 10195 EFAULT 10196 10197 The third parameter references an inaccessible memory area. 10198 ENOTTY 10199 10200 fildes is not associated with a character special device. 10201 ENOTTY 10202 10203 The specified request does not apply to the kind of object 10204 that fildes references. 10205 EINVAL 10206 10207 request or the third parameter is not valid. 10208 10209 Relationship to POSIX (Informative) 10210 10211 It should be noted that ISO POSIX (2003) contains an interface 10212 named ioctl(). The LSB only defines behavior when fildes 10213 refers to a socket (see sockio) or terminal device (see 10214 ttyio), while ISO POSIX (2003) only defines behavior when 10215 fildes refers to a STREAMS device. An implementation may 10216 support both behaviors; the LSB does not require any STREAMS 10217 support. 10218 10219 sockio 10220 10221 Name 10222 10223 sockio -- socket ioctl commands 10224 10225 Synopsis 10226 10227 #include 10228 #include 10229 #include 10230 #include 10231 10232 int ioctl(int sockfd, int request, void * argp); 10233 10234 Description 10235 10236 Socket ioctl() commands are a subset of the ioctl() calls, 10237 which can perform a variety of functions on sockets. sockfd 10238 shall be an open file descriptor referring to a socket (see 10239 the socket() or accept() functions). 10240 10241 Socket ioctl() commands apply to the underlying network 10242 interfaces, and affect the entire system, not just the file 10243 descriptor used to issue the ioctl(). 10244 10245 The following values for request are accepted: 10246 10247 SIOCGIFCONF (Deprecated) 10248 Get the interface configuration list for the system. 10249 10250 Note: The SIOCGIFCONF interface is superceded by the 10251 if_nameindex() family of functions (see ISO POSIX (2003)). 10252 A future version of this specification may withdraw this 10253 value for request. 10254 10255 argp shall point to a ifconf structure, as described in 10256 . Before calling, the caller shall set the 10257 ifc_ifcu.ifcu_req field to point to an array of ifreq 10258 structures, and set ifc_len to the size in bytes of 10259 this allocated array. Upon return, ifc_len will contain 10260 the size in bytes of the array which was actually used. 10261 If it is the same as the length upon calling, the 10262 caller should assume that the array was too small and 10263 try again with a larger array. 10264 10265 On success, SIOCGIFCONF shall return a nonnegative 10266 value. 10267 10268 Rationale: Historical UNIX systems disagree on the meaning 10269 of the return value. 10270 10271 SIOCGIFFLAGS 10272 Get the interface flags for the indicated interface. 10273 argp shall point to a ifreq structure. Before calling, 10274 the caller should fill in the ifr_name field with the 10275 interface name, and upon return, the 10276 ifr_ifru.ifru_flags field is set with the interface 10277 flags. 10278 10279 SIOCGIFADDR 10280 Get the interface address for the given interface. argp 10281 shall point to a ifreq structure. Before calling, the 10282 caller should fill in the ifr_name field with the 10283 interface name, and upon return, the ifr_ifru.ifru_addr 10284 field is set with the interface address. 10285 10286 SIOCGIFBRDADDR 10287 Get the interface broadcast address for the given 10288 interface. argp shall point to a ifreq structure. 10289 Before calling, the caller should fill in the ifr_name 10290 field with the interface name, and upon return, the 10291 ifr_ifru.ifru_broadcast field is set with the interface 10292 broadcast address. 10293 10294 SIOCGIFDSTADDR 10295 Get the point-to-point address for the given interface. 10296 argp shall point to a ifreq structure. Before calling, 10297 the caller should fill in the ifr_name field with the 10298 interface name, and upon return, the ifr_dstaddr field 10299 is set with the point-to-point address. 10300 10301 SIOCGIFNAME 10302 Get the name of an interface. argp shall point to a 10303 ifreq structure. Before calling, the caller should fill 10304 in the ifr_ifindex field with the number (index) of the 10305 interface, and upon return, the ifr_name field is set 10306 with the interface name. 10307 10308 SIOCGIFNETMASK 10309 Get the network mask for the given interface. argp 10310 shall point to a ifreq structure. Before calling, the 10311 caller should fill in the ifr_name field with the 10312 interface name, and upon return, the 10313 ifr_ifru.ifru_netmask field is set with the network 10314 mask. 10315 10316 SIOCGIFMTU 10317 Get the Maximum Transmission Unit (MTU) size for the 10318 given interface. argp shall point to a ifreq structure. 10319 Before calling, the caller should fill in the ifr_name 10320 field with the interface name, and upon return, the 10321 ifr_ifru.ifru_mtu field is set with the MTU. Note: The 10322 range of valid values for MTU varies for an interface 10323 depending on the interface type. 10324 10325 FIONREAD 10326 Get the amount of queued unread data in the receive 10327 buffer. argp shall point to an integer where the result 10328 is to be placed. 10329 10330 Note: Some implementations may also support the use of 10331 FIONREAD on other types of file descriptor. However, the 10332 LSB only specifies its behavior for a socket related file 10333 descriptor. 10334 10335 Return Value 10336 10337 On success, if request is SIOCGIFCONF, a non-negative integer 10338 shall be returned. If request is not SIOCGIFCONF, on success 0 10339 is returned. On error, -1 is returned and the global variable 10340 errno is set appropriately. 10341 10342 Errors 10343 10344 EBADF 10345 10346 sockfd is not a valid descriptor. 10347 EFAULT 10348 10349 argp references an inaccessible memory area. 10350 ENOTTY 10351 10352 The specified request does not apply to the kind of object 10353 that the descriptor sockfd references. 10354 EINVAL 10355 10356 Either request or argp is invalid. 10357 ENOTCONN 10358 10359 The operation is only defined on a connected socket, but the 10360 socket wasn't connected. 10361 10362 ttyio 10363 10364 Name 10365 10366 ttyio -- tty ioctl commands 10367 10368 Synopsis 10369 10370 #include 10371 #include 10372 10373 int ioctl(int fd, unsigned long request, int * argp); 10374 10375 Description 10376 10377 Tty ioctl commands are a subset of the ioctl() calls, which 10378 can perform a variety of functions on tty devices. fd shall be 10379 an open file descriptor referring to a terminal device. 10380 10381 The following ioctl()s are provided: 10382 10383 TIOCGWINSZ 10384 10385 Get the size attributes of the terminal or pseudo-terminal 10386 identified by fd. On entry, argp shall reference a winsize 10387 structure. On return, the structure will have ws_row set to 10388 the number of rows of text (i.e. lines of text) that can be 10389 viewed on the device, and ws_col set to the number of columns 10390 (i.e. text width). 10391 10392 Note: The number of columns stored in ws_col assumes that 10393 the terminal device is using a mono-spaced font. 10394 10395 Return Value 10396 10397 On success, 0 is returned. On error, -1 is returned and the 10398 global variable errno is set appropriately. 10399 10400 Errors 10401 10402 EBADF 10403 10404 fd is not a valid descriptor. 10405 EFAULT 10406 10407 argp references an inaccessible memory area. 10408 EINVAL 10409 10410 request and argp are not valid. 10411 10412 kill 10413 10414 Name 10415 10416 kill -- send a signal 10417 10418 Synopsis 10419 10420 #include 10421 10422 int kill(pid_t pid, int sig); 10423 10424 Description 10425 10426 kill() is as specified in the ISO POSIX (2003), but with 10427 differences as listed below. 10428 10429 Process ID -1 doesn't affect calling process 10430 10431 If pid is specified as -1, sig shall not be sent to the 10432 calling process. Other than this, the rules in the ISO POSIX 10433 (2003) apply. 10434 10435 Rationale: This was a deliberate Linus decision after an 10436 unpopular experiment in including the calling process in 10437 the 2.5.1 kernel. See "What does it mean to signal 10438 everybody?", Linux Weekly News, 20 December 2001, 10439 http://lwn.net/2001/1220/kernel.php3 10440 10441 link 10442 10443 Name 10444 10445 link -- create a link to a file 10446 10447 Synopsis 10448 10449 #include 10450 10451 int link(const char * path1, const char * path2); 10452 10453 Description 10454 10455 The link() function shall behave as specified in ISO POSIX 10456 (2003), except with differences as listed below. 10457 10458 Need Not Follow Symlinks 10459 10460 ISO POSIX (2003) specifies that pathname resolution shall 10461 follow symbolic links during pathname resolution unless the 10462 function is required to act on the symbolic link itself, or 10463 certain arguments direct that the function act on the symbolic 10464 link itself. The link() function in ISO POSIX (2003) contains 10465 no such requirement to operate on a symbolic link. However, a 10466 conforming LSB implementation need not follow a symbolic link 10467 for the path1 argument. 10468 10469 mbsnrtowcs 10470 10471 Name 10472 10473 mbsnrtowcs -- convert a multibyte string to a wide character 10474 string 10475 10476 Synopsis 10477 10478 #include 10479 10480 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 10481 nms, size_t len, mbstate_t * ps); 10482 10483 Description 10484 10485 mbsnrtowcs() is like mbsrtowcs(), except that the number of 10486 bytes to be converted, starting at src, is limited to nms. 10487 10488 If dest is not a NULL pointer, mbsnrtowcs() converts at most 10489 nms bytes from the multibyte string src to a wide-character 10490 string starting at dest. At most, len wide characters are 10491 written to dest. The state ps is updated. 10492 10493 The conversion is effectively performed by repeatedly calling: 10494 10495 mbrtowc(dest, *src, n, ps) 10496 10497 where n is some positive number, as long as this call 10498 succeeds, and then incrementing dest by one and src by the 10499 number of bytes consumed. 10500 10501 The conversion can stop for three reasons: 10502 10503 * An invalid multibyte sequence has been encountered. In 10504 this case src is left pointing to the invalid multibyte 10505 sequence, (size_t)(-1) is returned, and errno is set to 10506 EILSEQ. 10507 * The nms limit forces a stop, or len non-L'\0' wide 10508 characters have been stored at dest. In this case, src is 10509 left pointing to the next multibyte sequence to be 10510 converted, and the number of wide characters written to 10511 dest is returned. 10512 * The multibyte string has been completely converted, 10513 including the terminating '\0' (which has the side effect 10514 of bringing back ps to the initial state). In this case, 10515 src is set to NULL, and the number of wide characters 10516 written to dest, excluding the terminating L'\0' 10517 character, is returned. 10518 10519 If dest is NULL, len is ignored, and the conversion proceeds 10520 as above, except that the converted wide characters are not 10521 written out to memory, and that no destination length limit 10522 exists. 10523 10524 In both of the above cases, if ps is a NULL pointer, a static 10525 anonymous state only known to mbsnrtowcs() is used instead. 10526 10527 The programmer shall ensure that there is room for at least 10528 len wide characters at dest. 10529 10530 Return Value 10531 10532 mbsnrtowcs() returns the number of wide characters that make 10533 up the converted part of the wide character string, not 10534 including the terminating null wide character. If an invalid 10535 multibyte sequence was encountered, (size_t)(-1) is returned, 10536 and the global variable errno is set to EILSEQ. 10537 10538 Notes 10539 10540 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 10541 of the current locale. 10542 10543 Passing NULL as ps is not multi-thread safe. 10544 10545 memmem 10546 10547 Name 10548 10549 memmem -- locate bytes 10550 10551 Synopsis 10552 10553 #define _GNU_SOURCE 10554 #include 10555 10556 void * memmem(const void * haystack, size_t haystacklen, const 10557 void * needle, size_t needlelen); 10558 10559 Description 10560 10561 memmem() finds the start of the first occurrence of the byte 10562 array referenced by needle of length needlelen in the memory 10563 area haystack of length haystacklen. 10564 10565 Return Value 10566 10567 memmem() returns a pointer to the beginning of the byte array, 10568 or NULL if the byte array is not found. 10569 10570 Notes 10571 10572 Earlier versions of the C library (prior to glibc 2.1) 10573 contained a memmem() with various problems, and application 10574 developers should treat this function with care. 10575 10576 memrchr 10577 10578 Name 10579 10580 memrchr -- scan memory for a character 10581 10582 Synopsis 10583 10584 #include 10585 10586 void * memrchr(const void * s, int c, size_t n); 10587 10588 Description 10589 10590 The memrchr() function shall locate the last occurence of c 10591 (converted to an unsigned char) in the initial n bytes (each 10592 interpreted as an unsigned char) of the object pointed to by 10593 s. 10594 10595 Return Value 10596 10597 The memrchr() shall return a pointer to the located byte, or a 10598 null pointer if the byte does not occur in the object. 10599 10600 Errors 10601 10602 No errors are defined. 10603 10604 See Also 10605 10606 memchr() 10607 10608 newlocale 10609 10610 Name 10611 10612 newlocale -- allocate a locale object 10613 10614 Synopsis 10615 10616 #include 10617 10618 locale_t newlocale(int category_mask, const char * locale, 10619 locale_t base); 10620 10621 Description 10622 10623 The newlocale() function shall initialize a locale object. If 10624 base is NULL, then newlocale() shall first allocate the 10625 object; otherwise it shall use the locale object referenced by 10626 base. 10627 10628 The object shall be initialized for the locale named by 10629 locale, and for the categories selected in category_mask. The 10630 category_mask value is a bitwise inclusive OR of the required 10631 LC_name_MASK values, or the value LC_ALL_MASK. 10632 10633 Return Value 10634 10635 On success, the newlocale() function shall return the 10636 initialized locale object. Otherwise, it shall return NULL, 10637 and set errno to indicate the error. 10638 10639 Errors 10640 10641 The newlocale() function shall fail if: 10642 10643 ENOMEM 10644 10645 Insufficient memory. 10646 EINVAL 10647 10648 An invalid category_mask was provided, or the locale was NULL. 10649 ENOENT 10650 10651 For any of the categories in category_mask, the locale data is 10652 not available. 10653 10654 Application Usage (Informative) 10655 10656 The only portable way to allocate a locale object is to call 10657 newlocale() with a NULL base. The allocated object may be 10658 reinitialized to a new locale by passing it back to 10659 newlocale(). The new object may be released by calling 10660 freelocale(). 10661 10662 See Also 10663 10664 setlocale(), freelocale(), duplocale(), uselocale() 10665 10666 ngettext 10667 10668 Name 10669 10670 ngettext -- search message catalogs for plural string 10671 10672 Synopsis 10673 10674 #include 10675 10676 char * ngettext(const char * msgid1, const char * msgid2, 10677 unsigned long int n); 10678 10679 Description 10680 10681 The ngettext() function shall search the currently selected 10682 message catalogs for a string matching the singular string 10683 msgid1. If a string is located, and if n is 1, that string 10684 shall be returned. If n is not 1, a pluralized version 10685 (dependent on n) of the string shall be returned. 10686 10687 The ngettext() function is equivalent to dcngettext(NULL, 10688 msgid1, msgid2, n, LC_MESSAGES)(). 10689 10690 Return Value 10691 10692 If a string is found in the currently selected message 10693 catalogs for msgid1, then if n is 1 a pointer to the located 10694 string shall be returned. If n is not 1, a pointer to an 10695 appropriately pluralized version of the string shall be 10696 returned. If no message could be found in the currently 10697 selected mesage catalogs, then if n is 1, a pointer to msgid1 10698 shall be returned, otherwise a pointer to msgid2 shall be 10699 returned. 10700 10701 Applications shall not modify the string returned by 10702 ngettext(). 10703 10704 Errors 10705 10706 None. 10707 10708 The ngettext() function shall not modify errno. 10709 10710 See Also 10711 10712 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 10713 textdomain, bindtextdomain, bind_textdomain_codeset 10714 10715 pmap_getport 10716 10717 Name 10718 10719 pmap_getport -- find the port number assigned to a service 10720 registered with a portmapper. 10721 10722 Synopsis 10723 10724 #include 10725 10726 u_short * pmap_getport(struct sockaddr_in * address, const 10727 u_long program, const u_long * version, u_int protocol); 10728 10729 Description 10730 10731 The pmap_getport() function shall return the port number 10732 assigned to a service registered with a RPC Binding service 10733 running on a given target system, using the protocol described 10734 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 10735 pmap_getport() function shall be called given the RPC program 10736 number program, the program version version, and transport 10737 protocol protocol. Conforming implementations shall support 10738 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 10739 shall specify the address of the system on which the 10740 portmapper to be contacted resides. The value of 10741 address->sin_port shall be ignored, and the standard value for 10742 the portmapper port shall always be used. 10743 10744 Note: Security and network restrictions may prevent a 10745 conforming application from contacting a remote RPC Binding 10746 Service. 10747 10748 Return Value 10749 10750 On success, the pmap_getport() function shall return the port 10751 number in host byte order of the RPC application registered 10752 with the remote portmapper. On failure, if either the program 10753 was not registered or the remote portmapper service could not 10754 be reached, the pmap_getport() function shall return 0. If the 10755 remote portmap service could not be reached, the status is 10756 left in the global variable rpc_createerr. 10757 10758 pmap_set 10759 10760 Name 10761 10762 pmap_set -- establishes mapping to machine's RPC Bind service. 10763 10764 Synopsis 10765 10766 #include 10767 10768 bool_t pmap_set(const u_long program, const u_long version, 10769 int protocol, u_short port); 10770 10771 Description 10772 10773 pmap_set() establishes a mapping between the triple 10774 [program,version,protocol] and port on the machine's RPC Bind 10775 service. The value of protocol is most likely IPPROTO_UDP or 10776 IPPROTO_TCP. Automatically done by svc_register(). 10777 10778 Return Value 10779 10780 pmap_set() returns non-zero if it suceeds, 0 otherwise. 10781 10782 pmap_unset 10783 10784 Name 10785 10786 pmap_unset -- destroys RPC Binding 10787 10788 Synopsis 10789 10790 #include 10791 10792 bool_t pmap_unset(u_long prognum, u_long versnum); 10793 10794 Description 10795 10796 As a user interface to the RPC Bind service, pmap_unset() 10797 destroys all mapping between the triple [prognum,versnum, *] 10798 and ports on the machine's RPC Bind service. 10799 10800 Return Value 10801 10802 pmap_unset() returns non-zero if it succeeds, zero otherwise. 10803 10804 psignal 10805 10806 Name 10807 10808 psignal -- print signal message 10809 10810 Synopsis 10811 10812 #include 10813 10814 void psignal(int sig, const char * s); 10815 10816 extern const char *const sys_siglist[] 10817 10818 Description 10819 10820 The psignal() function shall display a message on the stderr 10821 stream. If s is not the null pointer, and does not point to an 10822 empty string (e.g. "\0"), the message shall consist of the 10823 string s, a colon, a space, and a string describing the signal 10824 number sig; otherwise psignal() shall display only a message 10825 describing the signal number sig. If sig is invalid, the 10826 message displayed shall indicate an unknown signal. 10827 10828 The array sys_siglist holds the signal description strings 10829 indexed by signal number. 10830 10831 Return Value 10832 10833 psignal() returns no value. 10834 10835 regexec 10836 10837 Name 10838 10839 regexec -- regular expression matching 10840 10841 Description 10842 10843 The regexec() function shall behave as specified in ISO POSIX 10844 (2003), except with differences as listed below. 10845 10846 Differences 10847 10848 Certain aspects of regular expression matching are optional; 10849 see Regular Expressions. 10850 10851 scanf 10852 10853 Name 10854 10855 scanf -- convert formatted input 10856 10857 Description 10858 10859 The scanf() family of functions shall behave as described in 10860 ISO POSIX (2003), except as noted below. 10861 10862 Differences 10863 10864 The %s, %S and %[ conversion specifiers shall accept an option 10865 length modifier a, which shall cause a memory buffer to be 10866 allocated to hold the string converted. In such a case, the 10867 argument corresponding to the conversion specifier should be a 10868 reference to a pointer value that will receive a pointer to 10869 the allocated buffer. If there is insufficient memory to 10870 allocate a buffer, the function may set errno to ENOMEM and a 10871 conversion error results. 10872 10873 Note: This directly conflicts with the ISO C (1999) usage 10874 of %a as a conversion specifier for hexadecimal float 10875 values. While this conversion specifier should be 10876 supported, a format specifier such as "%aseconds" will have 10877 a different meaning on an LSB conforming system. 10878 10879 setbuffer 10880 10881 Name 10882 10883 setbuffer -- stream buffering operation 10884 10885 Synopsis 10886 10887 #include 10888 10889 void setbuffer(FILE * stream, char * buf, size_t size); 10890 10891 Description 10892 10893 setbuffer() is an alias for the call to setvbuf(). It works 10894 the same, except that the size of the buffer in setbuffer() is 10895 up to the caller, rather than being determined by the default 10896 BUFSIZ. 10897 10898 setgroups 10899 10900 Name 10901 10902 setgroups -- set list of supplementary group IDs 10903 10904 Synopsis 10905 10906 #include 10907 10908 int setgroups(size_t size, const gid_t * list); 10909 10910 Description 10911 10912 If the process has appropriate privilege, the setgroups() 10913 function shall set the supplementary group IDs for the current 10914 process. list shall reference an array of size group IDs. A 10915 process may have at most NGROUPS_MAX supplementary group IDs. 10916 10917 Return Value 10918 10919 On successful completion, 0 is returned. On error, -1 is 10920 returned and the errno is set to indicate the error. 10921 10922 Errors 10923 10924 EFAULT 10925 10926 list has an invalid address. 10927 EPERM 10928 10929 The process does not have appropriate privileges. 10930 EINVAL 10931 10932 size is greater than NGROUPS_MAX. 10933 10934 sethostname 10935 10936 Name 10937 10938 sethostname -- set host name 10939 10940 Synopsis 10941 10942 #include 10943 #include 10944 #include 10945 10946 int sethostname(const char * name, size_t len); 10947 10948 Description 10949 10950 If the process has appropriate privileges, the sethostname() 10951 function shall change the host name for the current machine. 10952 The name shall point to a null-terminated string of at most 10953 len bytes that holds the new hostname. 10954 10955 If the symbol HOST_NAME_MAX is defined, or if 10956 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 10957 this value shall represent the maximum length of the new 10958 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 10959 value shall represent the maximum length for the new hostname. 10960 If none of these values are defined, the maximum length shall 10961 be the size of the nodename field of the utsname structure. 10962 10963 Return Value 10964 10965 On success, 0 is returned. On error, -1 is returned and the 10966 global variable errno is set appropriately. 10967 10968 Errors 10969 10970 EINVAL 10971 10972 len is negative or larger than the maximum allowed size. 10973 EPERM 10974 10975 the process did not have appropriate privilege. 10976 EFAULT 10977 10978 name is an invalid address. 10979 10980 Rationale 10981 10982 ISO POSIX (2003) guarantees that: 10983 10984 Maximum length of a host name (not including the 10985 terminating null) as returned from the gethostname() 10986 function shall be at least 255 bytes. 10987 10988 The glibc C library does not currently define HOST_NAME_MAX, 10989 and although it provides the name _SC_HOST_NAME_MAX a call to 10990 sysconf() returns -1 and does not alter errno in this case 10991 (indicating that there is no restriction on the hostname 10992 length). However, the glibc manual idicates that some 10993 implementations may have MAXHOSTNAMELEN as a means of 10994 detecting the maximum length, while the Linux kernel at 10995 release 2.4 and 2.6 stores this hostname in the utsname 10996 structure. While the glibc manual suggests simply shortening 10997 the name until sethostname() succeeds, the LSB requires that 10998 one of the first four mechanisms works. Future versions of 10999 glibc may provide a more reasonable result from 11000 sysconf(_SC_HOST_NAME_MAX). 11001 11002 setsockopt 11003 11004 Name 11005 11006 setsockopt -- set socket options 11007 11008 Synopsis 11009 11010 #include 11011 #include 11012 11013 int setsockopt(int socket, int level, int option_name, const 11014 void * option_value, socklen_t option_len); 11015 11016 Description 11017 11018 The setsockopt() function shall behave as specified in ISO 11019 POSIX (2003), with the following extensions. 11020 11021 IP Protocol Level Options 11022 11023 If the level parameter is IPPROTO_IP, the following values 11024 shall be supported for option_name (see RFC 791:Internet 11025 Protocol for further details): 11026 11027 IP_OPTIONS 11028 11029 Set the Internet Protocol options sent with every packet from 11030 this socket. The option_value shall point to a memory buffer 11031 containing the options and option_len shall contain the size 11032 in bytes of that buffer. For IPv4, the maximum length of 11033 options is 40 bytes. 11034 IP_TOS 11035 11036 Set the Type of Service flags to use when sending packets with 11037 this socket. The option_value shall point to a value 11038 containing the type of service value. The least significant 11039 two bits of the value shall contain the new Type of Service 11040 indicator. Use of other bits in the value is unspecified. The 11041 option_len parameter shall hold the size, in bytes, of the 11042 buffer referred to by option_value. 11043 IP_TTL 11044 11045 Set the current unicast Internet Protocol Time To Live value 11046 used when sending packets with this socket. The option_value 11047 shall point to a value containing the time to live value, 11048 which shall be between 1 and 255. The option_len parameter 11049 shall hold the size, in bytes, of the buffer referred to by 11050 option_value. 11051 IP_MULTICAST_TTL 11052 11053 Sets the Time To Live value of outgoing multicast packets for 11054 this socket. optval shall point to an integer which contains 11055 the new TTL value. If the new TTL value is -1, the 11056 implementation should use an unspecified default TTL value. If 11057 the new TTL value is out of the range of acceptable values 11058 (0-255), setsockopt() shall return -1 and set errno to 11059 indicate the error. 11060 IP_MULTICAST_LOOP 11061 11062 Sets a boolean flag indicating whether multicast packets 11063 originating locally should be looped back to the local 11064 sockets. optval shall point to an integer which contains the 11065 new flag value. 11066 IP_ADD_MEMBERSHIP 11067 11068 Join a multicast group. optval shall point to a ip_mreq 11069 structure. Before calling, the caller should fill in the 11070 imr_multiaddr field with the multicast group address and the 11071 imr_address field with the address of the local interface. If 11072 imr_address is set to INADDR_ANY, then an appropriate 11073 interface is chosen by the system. 11074 IP_DROP_MEMBERSHIP 11075 11076 Leave a multicast group. optval shall point to a ip_mreq 11077 structure containing the same values as were used with 11078 IP_ADD_MEMBERSHIP. 11079 IP_MULTICAST_IF 11080 11081 Set the local device for a multicast socket. optval shall 11082 point to a ip_mreq structure initialized in the same manner as 11083 with IP_ADD_MEMBERSHIP. 11084 11085 The ip_mreq structure contains two struct in_addr fields: 11086 imr_multiaddr and imr_address. 11087 11088 Return Value 11089 11090 On success, 0 is returned. On error, -1 is returned and the 11091 global variable errno is set appropriately. 11092 11093 Errors 11094 11095 As defined in ISO POSIX (2003). 11096 11097 setutent 11098 11099 Name 11100 11101 setutent -- access user accounting database entries 11102 11103 Synopsis 11104 11105 #include 11106 11107 void setutent(void); 11108 11109 Description 11110 11111 The setutent() function shall reset the user accounting 11112 database such that the next call to getutent() shall return 11113 the first record in the database. It is recommended to call it 11114 before any of the other functions that operate on the user 11115 accounting databases (e.g. getutent()) 11116 11117 Return Value 11118 11119 None. 11120 11121 sigandset 11122 11123 Name 11124 11125 sigandset -- build a new signal set by combining the two input 11126 sets using logical AND 11127 11128 Synopsis 11129 11130 #include 11131 11132 int sigandset(sigset_t * set, const sigset_t * left, const 11133 sigset_t * right); 11134 11135 Description 11136 11137 The sigandset() shall combine the two signal sets referenced 11138 by left and right, using a logical AND operation, and shall 11139 place the result in the location referenced by set, The 11140 resulting signal set shall contain only signals that are in 11141 both the set referenced by left and the set referenced by 11142 right. 11143 11144 Return Value 11145 11146 On success, sigandset() shall return 0. Otherise, sigandset() 11147 shall return -1 and set errno to indicate the error. 11148 11149 Errors 11150 11151 EINVAL 11152 11153 One or more of set, left, or right was a null pointer. 11154 11155 See Also 11156 11157 sigorset() 11158 11159 sigisemptyset 11160 11161 Name 11162 11163 sigisemptyset -- check for empty signal set 11164 11165 Synopsis 11166 11167 #include 11168 11169 int sigisemptyset(const sigset_t * set); 11170 11171 Description 11172 11173 The sigisemptyset() function shall check for empty signal set 11174 referenced by set. 11175 11176 Return Value 11177 11178 The sigisemptyset() function shall return a positive non-zero 11179 value if the signal set referenced by set is empty, or zero if 11180 this set is empty. On error, sigisemptyset() shall return -1 11181 and set errno to indicate the error. 11182 11183 Errors 11184 11185 EINVAL 11186 11187 set is a null pointer. 11188 11189 sigorset 11190 11191 Name 11192 11193 sigorset -- build a new signal set by combining the two input 11194 sets using logical OR 11195 11196 Synopsis 11197 11198 #include 11199 11200 int sigorset(sigset_t * set, const sigset_t * left, const 11201 sigset_t * right); 11202 11203 Description 11204 11205 The sigorset() shall combine the two signal sets referenced by 11206 left and right, using a logical OR operation, and shall place 11207 the result in the location referenced by set, The resulting 11208 signal set shall contain only signals that are in either the 11209 set referenced by left or the set referenced by right. 11210 11211 Return Value 11212 11213 On success, sigorset() shall return 0. Otherise, sigorset() 11214 shall return -1 and set errno to indicate the error. 11215 11216 Errors 11217 11218 EINVAL 11219 11220 One or more of set, left, or right was a null pointer. 11221 11222 See Also 11223 11224 sigandset() 11225 11226 sigreturn 11227 11228 Name 11229 11230 sigreturn -- return from signal handler and cleanup stack 11231 frame 11232 11233 Synopsis 11234 11235 int sigreturn(struct sigcontext * scp); 11236 11237 Description 11238 11239 The sigreturn() function is used by the system to cleanup 11240 after a signal handler has returned. This function is not in 11241 the source standard; it is only in the binary standard. 11242 11243 Return Value 11244 11245 sigreturn() never returns. 11246 11247 sscanf 11248 11249 Name 11250 11251 sscanf -- convert formatted input 11252 11253 Description 11254 11255 The scanf() family of functions shall behave as described in 11256 ISO POSIX (2003), except as noted below. 11257 11258 Differences 11259 11260 The %s, %S and %[ conversion specifiers shall accept an option 11261 length modifier a, which shall cause a memory buffer to be 11262 allocated to hold the string converted. In such a case, the 11263 argument corresponding to the conversion specifier should be a 11264 reference to a pointer value that will receive a pointer to 11265 the allocated buffer. If there is insufficient memory to 11266 allocate a buffer, the function may set errno to ENOMEM and a 11267 conversion error results. 11268 11269 Note: This directly conflicts with the ISO C (1999) usage 11270 of %a as a conversion specifier for hexadecimal float 11271 values. While this conversion specifier should be 11272 supported, a format specifier such as "%aseconds" will have 11273 a different meaning on an LSB conforming system. 11274 11275 statfs 11276 11277 Name 11278 11279 statfs -- (deprecated) 11280 11281 Synopsis 11282 11283 #include 11284 11285 int statfs(const char *path, (struct statfs * buf)); 11286 11287 Description 11288 11289 The statfs() function returns information about a mounted file 11290 system. The file system is identified by path, a path name of 11291 a file within the mounted filesystem. The results are placed 11292 in the structure pointed to by 11293 11294 Fields that are undefined for a particular file system shall 11295 be set to 0. 11296 11297 Note: Application developers should use the statvfs() 11298 function to obtain general file system information. 11299 Applications should only use the statfs() function if they 11300 must determine the file system type, which need not be 11301 provided by statvfs(). 11302 11303 Return Value 11304 11305 On success, the statfs() function shall return 0 and set the 11306 fields of the structure idenfitied by buf accordingly. On 11307 error, the statfs() function shall return -1 and set errno 11308 accordingly. 11309 11310 Errors 11311 11312 ENOTDIR 11313 11314 A component of the path prefix of path is not a directory. 11315 ENAMETOOLONG 11316 11317 path is too long. 11318 ENOENT 11319 11320 The file referred to by path does not exist. 11321 EACCES 11322 11323 Search permission is denied for a component of the path prefix 11324 of path. 11325 ELOOP 11326 11327 Too many symbolic links were encountered in translating path. 11328 EFAULT 11329 11330 buf or path points to an invalid address. 11331 EIO 11332 11333 An I/O error occurred while reading from or writing to the 11334 file system. 11335 ENOMEM 11336 11337 Insufficient kernel memory was available. 11338 ENOSYS 11339 11340 The filesystem path is on does not support statfs(). 11341 11342 statfs64 11343 11344 Name 11345 11346 statfs64 -- (deprecated) 11347 11348 Synopsis 11349 11350 #include 11351 11352 int statfs64(const char * path, (struct statfs64 * buf)); 11353 11354 Description 11355 11356 The statfs64() function returns information about a mounted 11357 file system. The file system is identified by path, a path 11358 name of a file within the mounted filesystem. The results are 11359 placed in the structure pointed to by buf. 11360 11361 statfs64() is the 64-bit version of statfs(). 11362 11363 Fields that are undefined for a particular file system shall 11364 be set to 0. 11365 11366 Note: Application developers should use the statvfs64() 11367 function to obtain general file system information. 11368 Applications should only use the statfs64() function if 11369 they must determine the file system type, which need not be 11370 provided by statvfs64(). 11371 11372 Return Value 11373 11374 On success, the statfs64() function shall return 0 and set the 11375 fields of the structure idenfitied by buf accordingly. On 11376 error, the statfs64() function shall return -1 and set errno 11377 accordingly. 11378 11379 Errors 11380 11381 See fstatfs(). 11382 11383 stime 11384 11385 Name 11386 11387 stime -- set time 11388 11389 Synopsis 11390 11391 #define _SVID_SOURCE 11392 #include 11393 11394 int stime(const time_t * t); 11395 11396 Description 11397 11398 If the process has appropriate privilege, the stime() function 11399 shall set the system's idea of the time and date. Time, 11400 referenced by t, is measured in seconds from the epoch 11401 (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 11402 11403 Return Value 11404 11405 On success, stime() shall return 0. Otherwise, stime() shall 11406 return -1 and errno shall be set to indicate the error. 11407 11408 Errors 11409 11410 EPERM 11411 11412 The process does not have appropriate privilege. 11413 EINVAL 11414 11415 t is a null pointer. 11416 11417 stpcpy 11418 11419 Name 11420 11421 stpcpy -- copy a string returning a pointer to its end 11422 11423 Synopsis 11424 11425 #include 11426 11427 char * stpcpy(char * restrict dest, const char * restrict 11428 src); 11429 11430 Description 11431 11432 The stpcpy() function shall copy the string pointed to by src 11433 (including the terminating null character) to the array 11434 pointed to by dest. The strings may not overlap, and the 11435 destination string dest shall be large enough to receive the 11436 copy. 11437 11438 Return Value 11439 11440 stpcpy() returns a pointer to the end of the string dest (that 11441 is, the address of the terminating null character) rather than 11442 the beginning. 11443 11444 Example 11445 11446 This program uses stpcpy() to concatenate foo and bar to 11447 produce foobar, which it then prints. 11448 #include 11449 11450 int 11451 main (void) 11452 { 11453 char buffer[256]; 11454 char *to = buffer; 11455 to = stpcpy (to, "foo"); 11456 to = stpcpy (to, "bar"); 11457 printf ("%s\n", buffer); 11458 } 11459 11460 stpncpy 11461 11462 Name 11463 11464 stpncpy -- copy a fixed-size string, returning a pointer to 11465 its end 11466 11467 Synopsis 11468 11469 #include 11470 11471 char * stpncpy(char * restrict dest, const char * restrict 11472 src, size_t n); 11473 11474 Description 11475 11476 The stpncpy() function shall copy at most n characters from 11477 the string pointed to by src, including the terminating null 11478 character, to the array pointed to by dest. Exactly n 11479 characters are written at dest. If the length strlen()(src) is 11480 smaller than n, the remaining characters in dest are filled 11481 with '\0' characters. If the length strlen(src) is greater 11482 than or equal to n, dest will not be null terminated. 11483 11484 The strings may not overlap. 11485 11486 The programmer shall ensure that there is room for at least n 11487 characters at dest. 11488 11489 Return Value 11490 11491 The stpncpy() function shall return a pointer to the 11492 terminating NULL in dest, or, if dest is not NULL-terminated, 11493 dest + n. 11494 11495 strcasestr 11496 11497 Name 11498 11499 strcasestr -- locate a substring ignoring case 11500 11501 Synopsis 11502 11503 #include 11504 11505 char * strcasestr(const char * s1, const char * s2); 11506 11507 Description 11508 11509 The strcasestr() shall behave as strstr(), except that it 11510 shall ignore the case of both strings. The strcasestr() 11511 function shall be locale aware; that is strcasestr() shall 11512 behave as if both strings had been converted to lower case in 11513 the current locale before the comparison is performed. 11514 11515 Return Value 11516 11517 Upon successful completion, strcasestr() shall return a 11518 pointer to the located string or a null pointer if the string 11519 is not found. If s2 points to a string with zero length, the 11520 function shall return s1. 11521 11522 strerror_r 11523 11524 Name 11525 11526 strerror_r -- reentrant version of strerror 11527 11528 Synopsis 11529 11530 #include 11531 11532 char * strerror_r(int errnum, char * buf, size_t buflen); 11533 11534 Description 11535 11536 The strerror_r() shall behave as specified in ISO POSIX 11537 (2003), except as described below. 11538 11539 Returns String, not Error Value 11540 11541 The strerror_r() function shall return a pointer to the string 11542 corresponding to errno. The returned pointer may point within 11543 the buffer buf (at most buflen bytes). 11544 11545 Return Value 11546 11547 On success, strerror_r() shall return a pointer to the 11548 generated message string (determined by the setting of the 11549 LC_MESSAGES category in the current locale). Otherwise, 11550 strerror_r() shall return the string corresponding to "Unknown 11551 error". 11552 11553 strndup 11554 11555 Name 11556 11557 strndup -- return a malloc'd copy of at most the specified 11558 number of bytes of a string 11559 11560 Synopsis 11561 11562 #include 11563 11564 char * strndup(const char * string, size_t n); 11565 11566 Description 11567 11568 The strndup() function shall return a malloc()'d copy of at 11569 most n bytes of string. The resultant string shall be 11570 terminated even if no NULL terminator appears before string+n. 11571 11572 Return Value 11573 11574 On success, strndup() shall return a pointer to a newly 11575 allocated block of memory containing a copy of at most n bytes 11576 of string. Otherwise, strndup() shall return NULL and set 11577 errno to indicate the error. 11578 11579 Errors 11580 11581 ENOMEM 11582 11583 Insufficient memory available. 11584 11585 strnlen 11586 11587 Name 11588 11589 strnlen -- determine the length of a fixed-size string 11590 11591 Synopsis 11592 11593 #include 11594 11595 size_t strnlen(const char * s, size_t maxlen); 11596 11597 Description 11598 11599 The strnlen() function shall compute the number of bytes in 11600 the array to which s points, stopping at maxlen bytes. A null 11601 byte and any bytes following it are not counted. 11602 11603 Return Value 11604 11605 The strnlen() function shall return the length of s if that is 11606 less than maxlen, or maxlen if there is no null byte in the 11607 first maxlen bytes. 11608 11609 Errors 11610 11611 No errors are defined. 11612 11613 strptime 11614 11615 Name 11616 11617 strptime -- parse a time string 11618 11619 Description 11620 11621 The strptime() shall behave as specified in the ISO POSIX 11622 (2003) with differences as listed below. 11623 11624 Number of leading zeroes may be limited 11625 11626 The ISO POSIX (2003) specifies fields for which "leading zeros 11627 are permitted but not required"; however, applications shall 11628 not expect to be able to supply more leading zeroes for these 11629 fields than would be implied by the range of the field. 11630 Implementations may choose to either match an input with 11631 excess leading zeroes, or treat this as a non-matching input. 11632 For example, %j has a range of 001 to 366, so 0, 00, 000, 001, 11633 and 045 are acceptable inputs, but inputs such as 0000, 0366 11634 and the like are not. 11635 11636 Rationale 11637 11638 glibc developers consider it appropriate behavior to forbid 11639 excess leading zeroes. When trying to parse a given input 11640 against several format strings, forbidding excess leading 11641 zeroes could be helpful. For example, if one matches 11642 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it 11643 seems useful for the first match to fail, as it would be 11644 perverse to parse that date as November 12, year 26. The 11645 second pattern parses it as December 26, year 11. 11646 11647 The ISO POSIX (2003) is not explicit that an unlimited number 11648 of leading zeroes are required, although it may imply this. 11649 The LSB explicitly allows implementations to have either 11650 behavior. Future versions of this standard may require 11651 implementations to forbid excess leading zeroes. 11652 11653 An Interpretation Request is currently pending against ISO 11654 POSIX (2003) for this matter. 11655 11656 strsep 11657 11658 Name 11659 11660 strsep -- extract token from string 11661 11662 Synopsis 11663 11664 #include 11665 11666 char * strsep(char * * stringp, const char * delim); 11667 11668 Description 11669 11670 The strsep() function shall find the first token in the string 11671 referenced by the pointer stringp, using the characters in 11672 delim as delimiters. 11673 11674 If stringp is NULL, strsep() shall return NULL and do nothing 11675 else. 11676 11677 If stringp is non-NULL, strsep() shall find the first token in 11678 the string referenced by stringp, where tokens are delimited 11679 by characters in the string delim. This token shall be 11680 terminated with a \0 character by overwriting the delimiter, 11681 and stringp shall be updated to point past the token. In case 11682 no delimiter was found, the token is taken to be the entire 11683 string referenced by stringp, and the location referenced by 11684 stringp is made NULL. 11685 11686 Return Value 11687 11688 strsep() shall return a pointer to the beginning of the token. 11689 11690 Notes 11691 11692 The strsep() function was introduced as a replacement for 11693 strtok(), since the latter cannot handle empty fields. 11694 However, strtok() conforms to ISO C (1999) and to ISO POSIX 11695 (2003) and hence is more portable. 11696 11697 See Also 11698 11699 strtok(), strtok_r(). 11700 11701 strsignal 11702 11703 Name 11704 11705 strsignal -- return string describing signal 11706 11707 Synopsis 11708 11709 #define _GNU_SOURCE 11710 #include 11711 11712 char * strsignal(int sig); 11713 11714 extern const char * const sys_siglist[]; 11715 11716 Description 11717 11718 The strsignal() function shall return a pointer to a string 11719 describing the signal number sig. The string can only be used 11720 until the next call to strsignal(). 11721 11722 The array sys_siglist holds the signal description strings 11723 indexed by signal number. This array should not be accessed 11724 directly by applications. 11725 11726 Return Value 11727 11728 If sig is a valid signal number, strsignal() shall return a 11729 pointer to the appropriate description string. Otherwise, 11730 strsignal() shall return either a pointer to the string 11731 "unknown signal", or a null pointer. 11732 11733 Although the function is not declared as returning a pointer 11734 to a constant character string, applications shall not modify 11735 the returned string. 11736 11737 strtoq 11738 11739 Name 11740 11741 strtoq -- convert string value to a long or quad_t integer 11742 11743 Synopsis 11744 11745 #include 11746 #include 11747 #include 11748 11749 long long strtoq(const char * nptr, char * * endptr, int 11750 base); 11751 11752 Description 11753 11754 strtoq() converts the string nptr to a quadt value. The 11755 conversion is done according to the given base, which shall be 11756 between 2 and 36 inclusive, or be the special value 0. 11757 11758 nptr may begin with an arbitrary amount of white space (as 11759 determined by isspace()), followed by a single optional + or - 11760 sign character. If base is 0 or 16, the string may then 11761 include a 0x prefix, and the number will be read in base 16; 11762 otherwise, a 0 base is taken as 10 (decimal), unless the next 11763 character is 0, in which case it is taken as 8 (octal). 11764 11765 The remainder of the string is converted to a long value in 11766 the obvious manner, stopping at the first character which is 11767 not a valid digit in the given base. (In bases above 10, the 11768 letter A in either upper or lower case represents 10, B 11769 represents 11, and so forth, with Z representing 35.) 11770 11771 Return Value 11772 11773 strtoq() returns the result of the conversion, unless the 11774 value would underflow or overflow. If an underflow occurs, 11775 strtoq() returns QUAD_MIN. If an overflow occurs, strtoq() 11776 returns QUAD_MAX. In both cases, the global variable errno is 11777 set to ERANGE. 11778 11779 Errors 11780 11781 ERANGE 11782 11783 The given string was out of range; the value converted has 11784 been clamped. 11785 11786 strtouq 11787 11788 Name 11789 11790 strtouq -- convert a string to an unsigned long long 11791 11792 Synopsis 11793 11794 #include 11795 #include 11796 #include 11797 11798 unsigned long long strtouq(const char * nptr, char * * endptr, 11799 int base); 11800 11801 Description 11802 11803 strtouq() converts the string nptr to an unsigned long long 11804 value. The conversion is done according to the given base, 11805 which shall be between 2 and 36 inclusive, or be the special 11806 value 0. 11807 11808 nptr may begin with an arbitrary amount of white space (as 11809 determined by isspace()), followed by a single optional + or - 11810 sign character. If base is 0 or 16, the string may then 11811 include a 0x prefix, and the number will be read in base 16; 11812 otherwise, a 0 base is taken as 10 (decimal), unless the next 11813 character is 0, in which case it is taken as 8 (octal). 11814 11815 The remainder of the string is converted to an unsigned long 11816 value in the obvious manner, stopping at the end of the string 11817 or at the first character that does not produce a valid digit 11818 in the given base. (In bases above 10, the letter A in either 11819 upper or lower case represents 10, B represents 11, and so 11820 forth, with Z representing 35.) 11821 11822 Return Value 11823 11824 On success, strtouq() returns either the result of the 11825 conversion or, if there was a leading minus sign, the negation 11826 of the result of the conversion, unless the original 11827 (non-negated) value would overflow. In the case of an overflow 11828 the function returns UQUAD_MAX and the global variable errno 11829 is set to ERANGE. 11830 11831 Errors 11832 11833 ERANGE 11834 11835 The given string was out of range; the value converted has 11836 been clamped. 11837 11838 svc_register 11839 11840 Name 11841 11842 svc_register -- register Remote Procedure Call interface 11843 11844 Synopsis 11845 11846 #include 11847 11848 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 11849 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 11850 protocol); 11851 11852 Description 11853 11854 The svc_register() function shall associate the program 11855 identified by prognum at version versnum with the service 11856 dispatch procedure, dispatch. If protocol is zero, the service 11857 is not registered with the portmap service. If protocol is 11858 non-zero, then a mapping of the triple [prognum, versnum, 11859 protocol] to xprt->xp_port is established with the local 11860 portmap service. The procedure dispatch has the following 11861 form: 11862 11863 int dispatch(struct svc_req * request, SVCXPRT * xprt); 11864 11865 Return Value 11866 11867 svc_register() returns 1 if it succeeds, and zero otherwise. 11868 11869 svc_run 11870 11871 Name 11872 11873 svc_run -- waits for RPC requests to arrive and calls service 11874 procedure 11875 11876 Synopsis 11877 11878 #include 11879 11880 void svc_run(void); 11881 11882 Description 11883 11884 The svc_run() function shall wait for RPC requests to arrive, 11885 read and unpack each request, and dispatch it to the 11886 appropriate registered handler. Under normal conditions, 11887 svc_run() shall not return; it shall only return if serious 11888 errors occur that prevent further processing. 11889 11890 svc_sendreply 11891 11892 Name 11893 11894 svc_sendreply -- called by RPC service's dispatch routine 11895 11896 Synopsis 11897 11898 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 11899 out); 11900 11901 Description 11902 11903 Called by an RPC service's dispatch routine to send the 11904 results of a remote procedure call. The parameter xprt is the 11905 request's associated transport handle; outproc is the XDR 11906 routine which is used to encode the results; and out is the 11907 address of the results. This routine returns one if it 11908 succeeds, zero otherwise. 11909 11910 svctcp_create 11911 11912 Name 11913 11914 svctcp_create -- create a TCP/IP-based RPC service transport 11915 11916 Synopsis 11917 11918 #include 11919 11920 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 11921 recv_buf_size); 11922 11923 Description 11924 11925 svctcp_create() creates a TCP/IP-based RPC service transport, 11926 to which it returns a pointer. The transport is associated 11927 with the socket sock, which may be RPC_ANYSOCK, in which case 11928 a new socket is created. If the socket is not bound to a local 11929 TCP port, then this routine binds it to an arbitrary port. 11930 Upon completion, xprt->xp_sock is the transport's socket 11931 descriptor, and xprt->xp_port is the transport's port number. 11932 Since TCP-based RPC uses buffered I/O, users may specify the 11933 size of buffers; values of zero choose suitable defaults. 11934 11935 Return Value 11936 11937 svctcp_create() returns NULL if it fails, or a pointer to the 11938 RPC service transport otherwise. 11939 11940 svcudp_create 11941 11942 Name 11943 11944 svcudp_create -- create a UDP-based RPC service transport 11945 11946 Synopsis 11947 11948 SVCXPRT * 11949 11950 svcudp_create(int sock); 11951 11952 Description 11953 11954 The svcudp_create() function shall create a UDP/IP-based RPC 11955 service transport, and return a pointer to its descriptor. The 11956 transport is associated with the socket sock, which may be 11957 RPC_ANYSOCK, in which case a new socket shall be created. If 11958 the socket is not bound to a local UDP port, then 11959 svcudp_create() shall bind it to an arbitrary port. 11960 11961 If svcudp_create() returns successfully, then the xp_sock 11962 field in the result shall be the transport's socket 11963 descriptor, and the xp_port field shall be the transport's 11964 port number. 11965 11966 Return Value 11967 11968 Upon successful completion, svcudp_create() shall return a 11969 pointer to a RPC service transport; otherwise, a null pointer 11970 shall be returned. 11971 11972 swscanf 11973 11974 Name 11975 11976 swscanf -- convert formatted input 11977 11978 Description 11979 11980 The scanf() family of functions shall behave as described in 11981 ISO POSIX (2003), except as noted below. 11982 11983 Differences 11984 11985 The %s, %S and %[ conversion specifiers shall accept an option 11986 length modifier a, which shall cause a memory buffer to be 11987 allocated to hold the string converted. In such a case, the 11988 argument corresponding to the conversion specifier should be a 11989 reference to a pointer value that will receive a pointer to 11990 the allocated buffer. If there is insufficient memory to 11991 allocate a buffer, the function may set errno to ENOMEM and a 11992 conversion error results. 11993 11994 Note: This directly conflicts with the ISO C (1999) usage 11995 of %a as a conversion specifier for hexadecimal float 11996 values. While this conversion specifier should be 11997 supported, a format specifier such as "%aseconds" will have 11998 a different meaning on an LSB conforming system. 11999 12000 system 12001 12002 Name 12003 12004 system -- execute a shell command 12005 12006 Synopsis 12007 12008 #include 12009 12010 int system(const char * string); 12011 12012 Description 12013 12014 The system() function shall behave as described in ISO POSIX 12015 (2003). 12016 12017 Notes 12018 12019 The fact that system() ignores interrupts is often not what a 12020 program wants. ISO POSIX (2003) describes some of the 12021 consequences; an additional consequence is that a program 12022 calling system() from a loop cannot be reliably interrupted. 12023 Many programs will want to use the exec() family of functions 12024 instead. 12025 12026 Do not use system() from a program with suid or sgid 12027 privileges, because unexpected values for some environment 12028 variables might be used to subvert system integrity. Use the 12029 exec() family of functions instead, but not execlp() or 12030 execvp(). system() will not, in fact, work properly from 12031 programs with suid or sgid privileges on systems on which 12032 /bin/sh is bash version 2, since bash 2 drops privileges on 12033 startup. (Debian uses a modified bash which does not do this 12034 when invoked as sh.) 12035 12036 The check for the availability of /bin/sh is not actually 12037 performed; it is always assumed to be available. ISO C (1999) 12038 specifies the check, but ISO POSIX (2003) specifies that the 12039 return shall always be nonzero, since a system without the 12040 shell is not conforming, and it is this that is implemented. 12041 12042 It is possible for the shell command to return 127, so that 12043 code is not a sure indication that the execve() call failed; 12044 check the global variable errno to make sure. 12045 12046 textdomain 12047 12048 Name 12049 12050 textdomain -- set the current default message domain 12051 12052 Synopsis 12053 12054 #include 12055 12056 char * textdomain(const char * domainname); 12057 12058 Description 12059 12060 The textdomain() function shall set the current default 12061 message domain to domainname. Subsequent calls to gettext() 12062 and ngettext() use the default message domain. 12063 12064 If domainname is NULL, the default message domain shall not be 12065 altered. 12066 12067 If domainname is "", textdomain() shall reset the default 12068 domain to the system default of "messages". 12069 12070 Return 12071 12072 On success, textdomain() shall return the currently selected 12073 domain. Otherwise, a null pointer shall be returned, and errno 12074 is set to indicate the error. 12075 12076 Errors 12077 12078 ENOMEM 12079 12080 Insufficent memory available. 12081 12082 unlink 12083 12084 Name 12085 12086 unlink -- remove a directory entry 12087 12088 Synopsis 12089 12090 int unlink(const char * path); 12091 12092 Description 12093 12094 unlink() is as specified in ISO POSIX (2003), but with 12095 differences as listed below. 12096 12097 See also Section 18.1, Additional behaviors: unlink/link on 12098 directory. 12099 12100 May return EISDIR on directories 12101 12102 If path specifies a directory, the implementation may return 12103 EISDIR instead of EPERM as specified by ISO POSIX (2003). 12104 12105 Rationale: The Linux kernel has deliberately chosen EISDIR 12106 for this case and does not expect to change. 12107 12108 uselocale 12109 12110 Name 12111 12112 uselocale -- set locale for thread 12113 12114 Synopsis 12115 12116 #include 12117 12118 locale_t uselocale(locale_t newloc); 12119 12120 Description 12121 12122 The uselocale() function shall set the locale for the calling 12123 thread to the locale specified by newloc. 12124 12125 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 12126 shall be set to the process current global locale, as set by 12127 setlocale(). If newloc is NULL, the thread's locale is not 12128 altered. 12129 12130 Return Value 12131 12132 The uselocale() function shall return the previous locale, or 12133 LC_GLOBAL_LOCALE if the thread local locale has not been 12134 previously set. 12135 12136 Errors 12137 12138 None defined. 12139 12140 See Also 12141 12142 setlocale(), freelocale(), duplocale(), newlocale() 12143 12144 utmpname 12145 12146 Name 12147 12148 utmpname -- set user accounting database 12149 12150 Synopsis 12151 12152 #include 12153 12154 int utmpname(const char * dbname); 12155 12156 Description 12157 12158 The utmpname() function shall cause the user accounting 12159 database used by the getutent(), getutent_r(), getutxent(), 12160 getutxid(), getutxline(), and pututxline() functions to be 12161 that named by dbname, instead of the system default database. 12162 See Section 16.3 for further information. 12163 12164 Note: The LSB does not specify the format of the user 12165 accounting database, nor the names of the file or files 12166 that may contain it. 12167 12168 Return Value 12169 12170 None. 12171 12172 Errors 12173 12174 None defined. 12175 12176 vasprintf 12177 12178 Name 12179 12180 vasprintf -- write formatted output to a dynamically allocated 12181 string 12182 12183 Synopsis 12184 12185 #include 12186 #include 12187 12188 int vasprintf(char * * restrict ptr, const char * restrict 12189 format, va_list arg); 12190 12191 Description 12192 12193 The vasprintf() function shall write formatted output to a 12194 dynamically allocated string, and store the address of that 12195 string in the location referenced by ptr. It shall behave as 12196 asprintf(), except that instead of being called with a 12197 variable number of arguments, it is called with an argument 12198 list as defined by . 12199 12200 Return Value 12201 12202 Refer to fprintf(). 12203 12204 Errors 12205 12206 Refer to fprintf(). 12207 12208 vdprintf 12209 12210 Name 12211 12212 vdprintf -- write formatted output to a file descriptor 12213 12214 Synopsis 12215 12216 #include 12217 12218 int vdprintf(int fd, const char * restrict format, va_list 12219 arg); 12220 12221 Description 12222 12223 The vdprintf() function shall behave as vfprintf(), except 12224 that vdprintf() shall write output to the file associated with 12225 the file descriptor specified by the fd argument, rather than 12226 place output on a stream (as defined by ISO POSIX (2003)). 12227 12228 Return Value 12229 12230 Refer to fprintf(). 12231 12232 Errors 12233 12234 Refer to fprintf(). 12235 12236 verrx 12237 12238 Name 12239 12240 verrx -- display formatted error message and exit 12241 12242 Synopsis 12243 12244 #include 12245 #include 12246 12247 void verrx(int eval, const char * fmt, va_list args); 12248 12249 Description 12250 12251 The verrx() shall behave as errx() except that instead of 12252 being called with a variable number of arguments, it is called 12253 with an argument list as defined by . 12254 12255 verrx() does not return, but exits with the value of eval. 12256 12257 Return Value 12258 12259 None. 12260 12261 Errors 12262 12263 None. 12264 12265 vfscanf 12266 12267 Name 12268 12269 vfscanf -- convert formatted input 12270 12271 Description 12272 12273 The scanf() family of functions shall behave as described in 12274 ISO POSIX (2003), except as noted below. 12275 12276 Differences 12277 12278 The %s, %S and %[ conversion specifiers shall accept an option 12279 length modifier a, which shall cause a memory buffer to be 12280 allocated to hold the string converted. In such a case, the 12281 argument corresponding to the conversion specifier should be a 12282 reference to a pointer value that will receive a pointer to 12283 the allocated buffer. If there is insufficient memory to 12284 allocate a buffer, the function may set errno to ENOMEM and a 12285 conversion error results. 12286 12287 Note: This directly conflicts with the ISO C (1999) usage 12288 of %a as a conversion specifier for hexadecimal float 12289 values. While this conversion specifier should be 12290 supported, a format specifier such as "%aseconds" will have 12291 a different meaning on an LSB conforming system. 12292 12293 vfwscanf 12294 12295 Name 12296 12297 vfwscanf -- convert formatted input 12298 12299 Description 12300 12301 The scanf() family of functions shall behave as described in 12302 ISO POSIX (2003), except as noted below. 12303 12304 Differences 12305 12306 The %s, %S and %[ conversion specifiers shall accept an option 12307 length modifier a, which shall cause a memory buffer to be 12308 allocated to hold the string converted. In such a case, the 12309 argument corresponding to the conversion specifier should be a 12310 reference to a pointer value that will receive a pointer to 12311 the allocated buffer. If there is insufficient memory to 12312 allocate a buffer, the function may set errno to ENOMEM and a 12313 conversion error results. 12314 12315 Note: This directly conflicts with the ISO C (1999) usage 12316 of %a as a conversion specifier for hexadecimal float 12317 values. While this conversion specifier should be 12318 supported, a format specifier such as "%aseconds" will have 12319 a different meaning on an LSB conforming system. 12320 12321 vscanf 12322 12323 Name 12324 12325 vscanf -- convert formatted input 12326 12327 Description 12328 12329 The scanf() family of functions shall behave as described in 12330 ISO POSIX (2003), except as noted below. 12331 12332 Differences 12333 12334 The %s, %S and %[ conversion specifiers shall accept an option 12335 length modifier a, which shall cause a memory buffer to be 12336 allocated to hold the string converted. In such a case, the 12337 argument corresponding to the conversion specifier should be a 12338 reference to a pointer value that will receive a pointer to 12339 the allocated buffer. If there is insufficient memory to 12340 allocate a buffer, the function may set errno to ENOMEM and a 12341 conversion error results. 12342 12343 Note: This directly conflicts with the ISO C (1999) usage 12344 of %a as a conversion specifier for hexadecimal float 12345 values. While this conversion specifier should be 12346 supported, a format specifier such as "%aseconds" will have 12347 a different meaning on an LSB conforming system. 12348 12349 vsscanf 12350 12351 Name 12352 12353 vsscanf -- convert formatted input 12354 12355 Description 12356 12357 The scanf() family of functions shall behave as described in 12358 ISO POSIX (2003), except as noted below. 12359 12360 Differences 12361 12362 The %s, %S and %[ conversion specifiers shall accept an option 12363 length modifier a, which shall cause a memory buffer to be 12364 allocated to hold the string converted. In such a case, the 12365 argument corresponding to the conversion specifier should be a 12366 reference to a pointer value that will receive a pointer to 12367 the allocated buffer. If there is insufficient memory to 12368 allocate a buffer, the function may set errno to ENOMEM and a 12369 conversion error results. 12370 12371 Note: This directly conflicts with the ISO C (1999) usage 12372 of %a as a conversion specifier for hexadecimal float 12373 values. While this conversion specifier should be 12374 supported, a format specifier such as "%aseconds" will have 12375 a different meaning on an LSB conforming system. 12376 12377 vswscanf 12378 12379 Name 12380 12381 vswscanf -- convert formatted input 12382 12383 Description 12384 12385 The scanf() family of functions shall behave as described in 12386 ISO POSIX (2003), except as noted below. 12387 12388 Differences 12389 12390 The %s, %S and %[ conversion specifiers shall accept an option 12391 length modifier a, which shall cause a memory buffer to be 12392 allocated to hold the string converted. In such a case, the 12393 argument corresponding to the conversion specifier should be a 12394 reference to a pointer value that will receive a pointer to 12395 the allocated buffer. If there is insufficient memory to 12396 allocate a buffer, the function may set errno to ENOMEM and a 12397 conversion error results. 12398 12399 Note: This directly conflicts with the ISO C (1999) usage 12400 of %a as a conversion specifier for hexadecimal float 12401 values. While this conversion specifier should be 12402 supported, a format specifier such as "%aseconds" will have 12403 a different meaning on an LSB conforming system. 12404 12405 vsyslog 12406 12407 Name 12408 12409 vsyslog -- log to system log 12410 12411 Synopsis 12412 12413 #include 12414 #include 12415 12416 void vsyslog(int priority, char * message, va_list arglist); 12417 12418 Description 12419 12420 The vsyslog() function is identical to syslog() as specified 12421 in ISO POSIX (2003), except that arglist (as defined by 12422 stdarg.h) replaces the variable number of arguments. 12423 12424 vwscanf 12425 12426 Name 12427 12428 vwscanf -- convert formatted input 12429 12430 Description 12431 12432 The scanf() family of functions shall behave as described in 12433 ISO POSIX (2003), except as noted below. 12434 12435 Differences 12436 12437 The %s, %S and %[ conversion specifiers shall accept an option 12438 length modifier a, which shall cause a memory buffer to be 12439 allocated to hold the string converted. In such a case, the 12440 argument corresponding to the conversion specifier should be a 12441 reference to a pointer value that will receive a pointer to 12442 the allocated buffer. If there is insufficient memory to 12443 allocate a buffer, the function may set errno to ENOMEM and a 12444 conversion error results. 12445 12446 Note: This directly conflicts with the ISO C (1999) usage 12447 of %a as a conversion specifier for hexadecimal float 12448 values. While this conversion specifier should be 12449 supported, a format specifier such as "%aseconds" will have 12450 a different meaning on an LSB conforming system. 12451 12452 wait4 12453 12454 Name 12455 12456 wait4 -- wait for process termination, BSD style 12457 12458 Synopsis 12459 12460 #include 12461 #include 12462 #include 12463 12464 pid_t wait4(pid_t pid, int * status, int options, struct 12465 rusage * rusage); 12466 12467 Description 12468 12469 wait4() suspends execution of the current process until a 12470 child (as specified by pid) has exited, or until a signal is 12471 delivered whose action is to terminate the current process or 12472 to call a signal handling function. If a child (as requested 12473 by pid) has already exited by the time of the call (a 12474 so-called "zombie" process), the function returns immediately. 12475 Any system resources used by the child are freed. 12476 12477 The value of pid can be one of: 12478 12479 < -1 12480 12481 wait for any child process whose process group ID is equal to 12482 the absolute value of pid. 12483 -1 12484 12485 wait for any child process; this is equivalent to calling 12486 wait3(). 12487 0 12488 12489 wait for any child process whose process group ID is equal to 12490 that of the calling process. 12491 > 0 12492 12493 wait for the child whose process ID is equal to the value of 12494 pid. 12495 12496 The value of options is a bitwise or of zero or more of the 12497 following constants: 12498 12499 WNOHANG 12500 12501 return immediately if no child is there to be waited for. 12502 WUNTRACED 12503 12504 return for children that are stopped, and whose status has not 12505 been reported. 12506 12507 If status is not NULL, wait4() stores status information in 12508 the location status. This status can be evaluated with the 12509 following macros: 12510 12511 Note: These macros take the status value (an int) as an 12512 argument -- not a pointer to the value! 12513 12514 WIFEXITED(status) 12515 12516 is nonzero if the child exited normally. 12517 WEXITSTATUS(status) 12518 12519 evaluates to the least significant eight bits of the return 12520 code of the child that terminated, which may have been set as 12521 the argument to a call to exit() or as the argument for a 12522 return statement in the main program. This macro can only be 12523 evaluated if WIFEXITED() returned nonzero. 12524 WIFSIGNALED(status) 12525 12526 returns true if the child process exited because of a signal 12527 that was not caught. 12528 WTERMSIG(status) 12529 12530 returns the number of the signal that caused the child process 12531 to terminate. This macro can only be evaluated if 12532 WIFSIGNALED() returned nonzero. 12533 WIFSTOPPED(status) 12534 12535 returns true if the child process that caused the return is 12536 currently stopped; this is only possible if the call was done 12537 using WUNTRACED(). 12538 WSTOPSIG(status) 12539 12540 returns the number of the signal that caused the child to 12541 stop. This macro can only be evaluated if WIFSTOPPED() 12542 returned nonzero. 12543 12544 If rusage is not NULL, the struct rusage (as defined in 12545 sys/resource.h) that it points to will be filled with 12546 accounting information. See getrusage() for details. 12547 12548 Return Value 12549 12550 On success, the process ID of the child that exited is 12551 returned. On error, -1 is returned (in particular, when no 12552 unwaited-for child processes of the specified kind exist), or 12553 0 if WNOHANG() was used and no child was available yet. In the 12554 latter two cases, the global variable errno is set 12555 appropriately. 12556 12557 Errors 12558 12559 ECHILD 12560 12561 No unwaited-for child process as specified does exist. 12562 ERESTARTSYS 12563 12564 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 12565 was caught. This error is returned by the system call. The 12566 library interface is not allowed to return ERESTARTSYS, but 12567 will return EINTR. 12568 12569 waitpid 12570 12571 Name 12572 12573 waitpid -- wait for child process 12574 12575 Description 12576 12577 waitpid() is as specified in ISO POSIX (2003), but with 12578 differences as listed below. 12579 12580 Need not support WCONTINUED or WIFCONTINUED 12581 12582 Implementations need not support the XSI optional 12583 functionality of WCONTINUED() or WIFCONTINUED(). 12584 12585 warn 12586 12587 Name 12588 12589 warn -- formatted error messages 12590 12591 Synopsis 12592 12593 #include 12594 12595 void warn(const char * fmt, ...); 12596 12597 Description 12598 12599 The warn() function shall display a formatted error message on 12600 the standard error stream. The output shall consist of the 12601 last component of the program name, a colon character, and a 12602 space character. If fmt is non-NULL, it shall be used as a 12603 format string for the printf() family of functions, and the 12604 formatted message, a colon character, and a space are written 12605 to stderr. Finally, the error message string affiliated with 12606 the current value of the global variable errno shall be 12607 written to stderr, followed by a newline character. 12608 12609 Return Value 12610 12611 None. 12612 12613 Errors 12614 12615 None. 12616 12617 warnx 12618 12619 Name 12620 12621 warnx -- formatted error messages 12622 12623 Synopsis 12624 12625 #include 12626 12627 void warnx(const char * fmt, ...); 12628 12629 Description 12630 12631 The warnx() function shall display a formatted error message 12632 on the standard error stream. The last component of the 12633 program name, a colon character, and a space shall be output. 12634 If fmt is non-NULL, it shall be used as the format string for 12635 the printf() family of functions, and the formatted error 12636 message, a colon character, and a space shall be output. The 12637 output shall be followed by a newline character. 12638 12639 Return Value 12640 12641 None. 12642 12643 Errors 12644 12645 None. 12646 12647 wcpcpy 12648 12649 Name 12650 12651 wcpcpy -- copy a wide character string, returning a pointer to 12652 its end 12653 12654 Synopsis 12655 12656 #include 12657 12658 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 12659 12660 Description 12661 12662 wcpcpy() is the wide-character equivalent of stpcpy(). It 12663 copies the wide character string src, including the 12664 terminating null wide character code, to the array dest. 12665 12666 The strings may not overlap. 12667 12668 The programmer shall ensure that there is room for at least 12669 wcslen()(src)+1 wide characters at dest. 12670 12671 Return Value 12672 12673 wcpcpy() returns a pointer to the end of the wide-character 12674 string dest, that is, a pointer to the terminating null wide 12675 character code. 12676 12677 wcpncpy 12678 12679 Name 12680 12681 wcpncpy -- copy a fixed-size string of wide characters, 12682 returning a pointer to its end 12683 12684 Synopsis 12685 12686 #include 12687 12688 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 12689 n); 12690 12691 Description 12692 12693 wcpncpy() is the wide-character equivalent of stpncpy(). It 12694 copies at most n wide characters from the wide-character 12695 string src, including the terminating null wide character 12696 code, to the array dest. Exactly n wide characters are written 12697 at dest. If the length wcslen()(src) is smaller than n, the 12698 remaining wide characters in the array dest are filled with 12699 null wide character codes. If the length wcslen()(src) is 12700 greater than or equal to n, the string dest will not be 12701 terminated with a null wide character code. 12702 12703 The strings may not overlap. 12704 12705 The programmer shall ensure that there is room for at least n 12706 wide characters at dest. 12707 12708 Return Value 12709 12710 wcpncpy() returns a pointer to the wide character one past the 12711 last non-null wide character written. 12712 12713 wcscasecmp 12714 12715 Name 12716 12717 wcscasecmp -- compare two wide-character strings, ignoring 12718 case 12719 12720 Synopsis 12721 12722 #include 12723 12724 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 12725 12726 Description 12727 12728 wcscasecmp() is the wide-character equivalent of strcasecmp(). 12729 It compares the wide-character string s1 and the 12730 wide-character string s2, ignoring case differences (towupper, 12731 towlower). 12732 12733 Return Value 12734 12735 The wcscasecmp() function shall return 0 if the wide-character 12736 strings s1 and s2 are equal except for case distinctions. It 12737 shall return a positive integer if s1 is greater than s2, 12738 ignoring case. It shall return a negative integer if s1 is 12739 less than s2, ignoring case. 12740 12741 Notes 12742 12743 The behavior of wcscasecmp() depends upon the LC_CTYPE 12744 category of the current locale. 12745 12746 wcsdup 12747 12748 Name 12749 12750 wcsdup -- duplicate a wide-character string 12751 12752 Synopsis 12753 12754 #include 12755 12756 wchar_t * wcsdup(const wchar_t * s); 12757 12758 Description 12759 12760 The wcsdup() function is the wide-character equivalent of 12761 strdup(). The wcsdup() function shall return a pointer to a 12762 new wide character string, which is a duplicate of the wide 12763 character string pointed to by s. The returned pointer can be 12764 passed to free(). A null pointer is returned if the new string 12765 cannot be created. 12766 12767 Return Value 12768 12769 The wcsdup() function returns a pointer to a new 12770 wide-character string on success. Otherwise, it shall return 12771 NULL and set errno to indicate the error. 12772 12773 Errors 12774 12775 ENOMEM 12776 12777 Insufficient memory available. 12778 12779 wcsncasecmp 12780 12781 Name 12782 12783 wcsncasecmp -- compare two fixed-size wide-character strings, 12784 ignoring case 12785 12786 Synopsis 12787 12788 #include 12789 12790 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 12791 n); 12792 12793 Description 12794 12795 wcsncasecmp() is the wide-character equivalent of 12796 strncasecmp(). It compares the wide-character string s1 and 12797 the wide-character string s2, but at most n wide characters 12798 from each string, ignoring case differences (towupper, 12799 towlower). 12800 12801 Return Value 12802 12803 wcscasecmp() returns 0 if the wide-character strings s1 and 12804 s2, truncated to at most length n, are equal except for case 12805 distinctions. It returns a positive integer if truncated s1 is 12806 greater than truncated s2, ignoring case. It returns a 12807 negative integer if truncated s1 is smaller than truncated s2, 12808 ignoring case. 12809 12810 Notes 12811 12812 The behavior of wcsncasecmp() depends upon the LC_CTYPE 12813 category of the current locale. 12814 12815 wcsnlen 12816 12817 Name 12818 12819 wcsnlen -- determine the length of a fixed-size wide-character 12820 string 12821 12822 Synopsis 12823 12824 #include 12825 12826 size_t wcsnlen(const wchar_t * s, size_t maxlen); 12827 12828 Description 12829 12830 wcsnlen() is the wide-character equivalent of strnlen(). It 12831 returns the number of wide-characters in the string s, not 12832 including the terminating null wide character code, but at 12833 most maxlen. In doing this, wcsnlen() looks only at the first 12834 maxlen wide-characters at s and never beyond s + maxlen. 12835 12836 Return Value 12837 12838 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 12839 maxlen if there is no null wide character code among the first 12840 maxlen wide characters pointed to by s. 12841 12842 wcsnrtombs 12843 12844 Name 12845 12846 wcsnrtombs -- convert a wide character string to a multi-byte 12847 string 12848 12849 Synopsis 12850 12851 #include 12852 12853 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 12854 nwc, size_t len, mbstate_t * ps); 12855 12856 Description 12857 12858 wcsnrtombs() is like wcsrtombs(), except that the number of 12859 wide characters to be converted, starting at src, is limited 12860 to nwc. 12861 12862 If dest is not a NULL pointer, wcsnrtombs() converts at most 12863 nwc wide characters from the wide-character string src to a 12864 multibyte string starting at dest. At most len bytes are 12865 written to dest. The state ps is updated. 12866 12867 The conversion is effectively performed by repeatedly calling: 12868 wcrtomb(dest, *src, ps) 12869 12870 as long as this call succeeds, and then incrementing dest by 12871 the number of bytes written and src by 1. 12872 12873 The conversion can stop for three reasons: 12874 12875 * A wide character has been encountered that cannot be 12876 represented as a multibyte sequence (according to the 12877 current locale). In this case src is left pointing to the 12878 invalid wide character, (size_t)(-1) is returned, and 12879 errno is set to EILSEQ. 12880 * nws wide characters have been converted without 12881 encountering a null wide character code, or the length 12882 limit forces a stop. In this case, src is left pointing to 12883 the next wide character to be converted, and the number 12884 bytes written to dest is returned. 12885 * The wide-character string has been completely converted, 12886 including the terminating null wide character code (which 12887 has the side effect of bringing back ps to the initial 12888 state). In this case, src is set to NULL, and the number 12889 of bytes written to dest, excluding the terminating null 12890 wide character code, is returned. 12891 12892 If dest is NULL, len is ignored, and the conversion proceeds 12893 as above, except that the converted bytes are not written out 12894 to memory, and that no destination length limit exists. 12895 12896 In both of the above cases, if ps is a NULL pointer, a static 12897 anonymous state only known to wcsnrtombs() is used instead. 12898 12899 The programmer shall ensure that there is room for at least 12900 len bytes at dest. 12901 12902 Return Value 12903 12904 wcsnrtombs() returns the number of bytes that make up the 12905 converted part of multibyte sequence, not including the 12906 terminating null wide character code. If a wide character was 12907 encountered which could not be converted, (size_t)(-1) is 12908 returned, and the global variable errno set to EILSEQ. 12909 12910 Notes 12911 12912 The behavior of wcsnrtombs() depends on the LC_CTYPE category 12913 of the current locale. 12914 12915 Passing NULL as ps is not multi-thread safe. 12916 12917 wcstoq 12918 12919 Name 12920 12921 wcstoq -- convert wide string to long long int representation 12922 12923 Synopsis 12924 12925 #include 12926 12927 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 12928 restrict endptr, int base); 12929 12930 Description 12931 12932 The wcstoq() function shall convert the initial portion of the 12933 wide string nptr to long long int representation. It is 12934 identical to wcstoll(). 12935 12936 Return Value 12937 12938 Refer to wcstoll(). 12939 12940 Errors 12941 12942 Refer to wcstoll(). 12943 12944 wcstouq 12945 12946 Name 12947 12948 wcstouq -- convert wide string to unsigned long long int 12949 representation 12950 12951 Synopsis 12952 12953 #include 12954 12955 unsigned long long wcstouq(const wchar_t * restrict nptr, 12956 wchar_t ** restrict endptr, int base); 12957 12958 Description 12959 12960 The wcstouq() function shall convert the initial portion of 12961 the wide string nptr to unsigned long long int representation. 12962 It is identical to wcstoull(). 12963 12964 Return Value 12965 12966 Refer to wcstoull(). 12967 12968 Errors 12969 12970 Refer to wcstoull(). 12971 12972 wscanf 12973 12974 Name 12975 12976 wscanf -- convert formatted input 12977 12978 Description 12979 12980 The scanf() family of functions shall behave as described in 12981 ISO POSIX (2003), except as noted below. 12982 12983 Differences 12984 12985 The %s, %S and %[ conversion specifiers shall accept an option 12986 length modifier a, which shall cause a memory buffer to be 12987 allocated to hold the string converted. In such a case, the 12988 argument corresponding to the conversion specifier should be a 12989 reference to a pointer value that will receive a pointer to 12990 the allocated buffer. If there is insufficient memory to 12991 allocate a buffer, the function may set errno to ENOMEM and a 12992 conversion error results. 12993 12994 Note: This directly conflicts with the ISO C (1999) usage 12995 of %a as a conversion specifier for hexadecimal float 12996 values. While this conversion specifier should be 12997 supported, a format specifier such as "%aseconds" will have 12998 a different meaning on an LSB conforming system. 12999 13000 xdr_u_int 13001 13002 Name 13003 13004 xdr_u_int -- library routines for external data representation 13005 13006 Synopsis 13007 13008 int xdr_u_int(XDR * xdrs, unsigned int * up); 13009 13010 Description 13011 13012 xdr_u_int() is a filter primitive that translates between C 13013 unsigned integers and their external representations. 13014 13015 Return Value 13016 13017 On success, 1 is returned. On error, 0 is returned. 13018 _________________________________________________________ 13019 13020 13.6. Interfaces for libm 13021 13022 Table 13-24 defines the library name and shared object name 13023 for the libm library 13024 13025 Table 13-24. libm Definition 13026 Library: libm 13027 SONAME: See archLSB. 13028 13029 The behavior of the interfaces in this library is specified by 13030 the following specifications: 13031 13032 [ISOC99] ISO C (1999) 13033 [LSB] This Specification 13034 [SUSv2] SUSv2 13035 [SUSv3] ISO POSIX (2003) 13036 [SVID.3] SVID Issue 3 13037 _________________________________________________________ 13038 13039 13.6.1. Math 13040 _________________________________________________________ 13041 13042 13.6.1.1. Interfaces for Math 13043 13044 An LSB conforming implementation shall provide the generic 13045 functions for Math specified in Table 13-25, with the full 13046 mandatory functionality as described in the referenced 13047 underlying specification. 13048 13049 Table 13-25. libm - Math Function Interfaces 13050 __finite [ISOC99] __finitef [ISOC99] __finitel [ISOC99] 13051 __fpclassify [LSB] 13052 __fpclassifyf [LSB] __signbit [ISOC99] __signbitf [ISOC99] 13053 acos [SUSv3] 13054 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 13055 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 13056 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 13057 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 13058 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 13059 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 13060 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 13061 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 13062 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 13063 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 13064 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 13065 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 13066 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 13067 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 13068 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 13069 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [ISOC99] 13070 clog10f [ISOC99] clog10l [ISOC99] clogf [SUSv3] clogl [SUSv3] 13071 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 13072 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 13073 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 13074 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 13075 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 13076 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 13077 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 13078 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 13079 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 13080 dremf [ISOC99] dreml [ISOC99] erf [SUSv3] erfc [SUSv3] 13081 erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] erfl [SUSv3] 13082 exp [SUSv3] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 13083 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 13084 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 13085 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] fegetenv 13086 [SUSv3] 13087 fegetexceptflag [SUSv3] fegetround [SUSv3] feholdexcept 13088 [SUSv3] feraiseexcept [SUSv3] 13089 fesetenv [SUSv3] fesetexceptflag [SUSv3] fesetround [SUSv3] 13090 fetestexcept [SUSv3] 13091 feupdateenv [SUSv3] finite [SUSv2] finitef [ISOC99] finitel 13092 [ISOC99] 13093 floor [SUSv3] floorf [SUSv3] floorl [SUSv3] fma [SUSv3] 13094 fmaf [SUSv3] fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] 13095 fmaxl [SUSv3] fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] 13096 fmod [SUSv3] fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] 13097 frexpf [SUSv3] frexpl [SUSv3] gamma [SUSv2] gammaf [ISOC99] 13098 gammal [ISOC99] hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] 13099 ilogb [SUSv3] ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] 13100 j0f [ISOC99] j0l [ISOC99] j1 [SUSv3] j1f [ISOC99] 13101 j1l [ISOC99] jn [SUSv3] jnf [ISOC99] jnl [ISOC99] 13102 ldexp [SUSv3] ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] 13103 lgamma_r [ISOC99] lgammaf [SUSv3] lgammaf_r [ISOC99] lgammal 13104 [SUSv3] 13105 lgammal_r [ISOC99] llrint [SUSv3] llrintf [SUSv3] llrintl 13106 [SUSv3] 13107 llround [SUSv3] llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] 13108 log10 [SUSv3] log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] 13109 log1pf [SUSv3] log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] 13110 log2l [SUSv3] logb [SUSv3] logbf [SUSv3] logbl [SUSv3] 13111 logf [SUSv3] logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] 13112 lrintl [SUSv3] lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] 13113 matherr [SVID.3] modf [SUSv3] modff [SUSv3] modfl [SUSv3] 13114 nan [SUSv3] nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] 13115 nearbyintf [SUSv3] nearbyintl [SUSv3] nextafter [SUSv3] 13116 nextafterf [SUSv3] 13117 nextafterl [SUSv3] nexttoward [SUSv3] nexttowardf [SUSv3] 13118 nexttowardl [SUSv3] 13119 pow [SUSv3] pow10 [ISOC99] pow10f [ISOC99] pow10l [ISOC99] 13120 powf [SUSv3] powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] 13121 remainderl [SUSv3] remquo [SUSv3] remquof [SUSv3] remquol 13122 [SUSv3] 13123 rint [SUSv3] rintf [SUSv3] rintl [SUSv3] round [SUSv3] 13124 roundf [SUSv3] roundl [SUSv3] scalb [SUSv3] scalbf [ISOC99] 13125 scalbl [ISOC99] scalbln [SUSv3] scalblnf [SUSv3] scalblnl 13126 [SUSv3] 13127 scalbn [SUSv3] scalbnf [SUSv3] scalbnl [SUSv3] significand 13128 [ISOC99] 13129 significandf [ISOC99] significandl [ISOC99] sin [SUSv3] sincos 13130 [ISOC99] 13131 sincosf [ISOC99] sincosl [ISOC99] sinf [SUSv3] sinh [SUSv3] 13132 sinhf [SUSv3] sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] 13133 sqrtf [SUSv3] sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] 13134 tanh [SUSv3] tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] 13135 tgamma [SUSv3] tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] 13136 truncf [SUSv3] truncl [SUSv3] y0 [SUSv3] y0f [ISOC99] 13137 y0l [ISOC99] y1 [SUSv3] y1f [ISOC99] y1l [ISOC99] 13138 yn [SUSv3] ynf [ISOC99] ynl [ISOC99] 13139 13140 An LSB conforming implementation shall provide the generic 13141 data interfaces for Math specified in Table 13-26, with the 13142 full mandatory functionality as described in the referenced 13143 underlying specification. 13144 13145 Table 13-26. libm - Math Data Interfaces 13146 signgam [SUSv3] 13147 _________________________________________________________ 13148 13149 13.7. Data Definitions for libm 13150 13151 This section defines global identifiers and their values that 13152 are associated with interfaces contained in libm. These 13153 definitions are organized into groups that correspond to 13154 system headers. This convention is used as a convenience for 13155 the reader, and does not imply the existence of these headers, 13156 or their content. Where an interface is defined as requiring a 13157 particular system header file all of the data definitions for 13158 that system header file presented here shall be in effect. 13159 13160 This section gives data definitions to promote binary 13161 application portability, not to repeat source interface 13162 definitions available elsewhere. System providers and 13163 application developers should use this ABI to supplement - not 13164 to replace - source interface definition specifications. 13165 13166 This specification uses the ISO C (1999) C Language as the 13167 reference programming language, and data definitions are 13168 specified in ISO C format. The C language is used here as a 13169 convenient notation. Using a C language description of these 13170 data objects does not preclude their use by other programming 13171 languages. 13172 _________________________________________________________ 13173 13174 13.7.1. complex.h 13175 13176 #define complex _Complex 13177 13178 extern double cabs(double complex); 13179 extern float cabsf(float complex); 13180 extern long double cabsl(long double complex); 13181 extern double complex cacos(double complex); 13182 extern float complex cacosf(float complex); 13183 extern double complex cacosh(double complex); 13184 extern float complex cacoshf(float complex); 13185 extern long double complex cacoshl(long double complex); 13186 extern long double complex cacosl(long double complex); 13187 extern double carg(double complex); 13188 extern float cargf(float complex); 13189 extern long double cargl(long double complex); 13190 extern double complex casin(double complex); 13191 extern float complex casinf(float complex); 13192 extern double complex casinh(double complex); 13193 extern float complex casinhf(float complex); 13194 extern long double complex casinhl(long double complex); 13195 extern long double complex casinl(long double complex); 13196 extern double complex catan(double complex); 13197 extern float complex catanf(float complex); 13198 extern double complex catanh(double complex); 13199 extern float complex catanhf(float complex); 13200 extern long double complex catanhl(long double complex); 13201 extern long double complex catanl(long double complex); 13202 extern double complex ccos(double complex); 13203 extern float complex ccosf(float complex); 13204 extern double complex ccosh(double complex); 13205 extern float complex ccoshf(float complex); 13206 extern long double complex ccoshl(long double complex); 13207 extern long double complex ccosl(long double complex); 13208 extern double complex cexp(double complex); 13209 extern float complex cexpf(float complex); 13210 extern long double complex cexpl(long double complex); 13211 extern double cimag(double complex); 13212 extern float cimagf(float complex); 13213 extern long double cimagl(long double complex); 13214 extern double complex clog(double complex); 13215 extern double complex clog10(void); 13216 extern float complex clog10f(float complex); 13217 extern long double complex clog10l(long double complex); 13218 extern float complex clogf(float complex); 13219 extern long double complex clogl(long double complex); 13220 extern double complex conj(double complex); 13221 extern float complex conjf(float complex); 13222 extern long double complex conjl(long double complex); 13223 extern double complex cpow(double complex, double complex); 13224 extern float complex cpowf(float complex, float complex); 13225 extern long double complex cpowl(long double complex, long double complex); 13226 extern double complex cproj(double complex); 13227 extern float complex cprojf(float complex); 13228 extern long double complex cprojl(long double complex); 13229 extern double creal(double complex); 13230 extern float crealf(float complex); 13231 extern long double creall(long double complex); 13232 extern double complex csin(double complex); 13233 extern float complex csinf(float complex); 13234 extern double complex csinh(double complex); 13235 extern float complex csinhf(float complex); 13236 extern long double complex csinhl(long double complex); 13237 extern long double complex csinl(long double complex); 13238 extern double complex csqrt(double complex); 13239 extern float complex csqrtf(float complex); 13240 extern long double complex csqrtl(long double complex); 13241 extern double complex ctan(double complex); 13242 extern float complex ctanf(float complex); 13243 extern double complex ctanh(double complex); 13244 extern float complex ctanhf(float complex); 13245 extern long double complex ctanhl(long double complex); 13246 extern long double complex ctanl(long double complex); 13247 _________________________________________________________ 13248 13249 13.7.2. fenv.h 13250 13251 extern int feclearexcept(int); 13252 extern int fegetenv(fenv_t *); 13253 extern int fegetexceptflag(fexcept_t *, int); 13254 extern int fegetround(void); 13255 extern int feholdexcept(fenv_t *); 13256 extern int feraiseexcept(int); 13257 extern int fesetenv(const fenv_t *); 13258 extern int fesetexceptflag(const fexcept_t *, int); 13259 extern int fesetround(int); 13260 extern int fetestexcept(int); 13261 extern int feupdateenv(const fenv_t *); 13262 _________________________________________________________ 13263 13264 13.7.3. math.h 13265 13266 #define DOMAIN 1 13267 #define SING 2 13268 13269 struct exception { 13270 int type; 13271 char *name; 13272 double arg1; 13273 double arg2; 13274 double retval; 13275 }; 13276 13277 #define FP_NAN 0 13278 #define FP_INFINITE 1 13279 #define FP_ZERO 2 13280 #define FP_SUBNORMAL 3 13281 #define FP_NORMAL 4 13282 13283 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 13284 #define isfinite(x) \ 13285 (sizeof (x) == sizeof (float) ? __finitef (x) : sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) 13286 #define isinf(x) \ 13287 (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 13288 #define isnan(x) \ 13289 (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 13290 13291 #define HUGE_VAL 0x1.0p2047 13292 #define HUGE_VALF 0x1.0p255f 13293 #define HUGE_VALL 0x1.0p32767L 13294 13295 #define NAN ((float)0x7fc00000UL) 13296 #define M_1_PI 0.31830988618379067154 13297 #define M_LOG10E 0.43429448190325182765 13298 #define M_2_PI 0.63661977236758134308 13299 #define M_LN2 0.69314718055994530942 13300 #define M_SQRT1_2 0.70710678118654752440 13301 #define M_PI_4 0.78539816339744830962 13302 #define M_2_SQRTPI 1.12837916709551257390 13303 #define M_SQRT2 1.41421356237309504880 13304 #define M_LOG2E 1.4426950408889634074 13305 #define M_PI_2 1.57079632679489661923 13306 #define M_LN10 2.30258509299404568402 13307 #define M_E 2.7182818284590452354 13308 #define M_PI 3.14159265358979323846 13309 #define INFINITY HUGE_VALF 13310 13311 #define MATH_ERRNO 1 13312 #define MATH_ERREXCEPT 2 13313 13314 #define isunordered(u, v) \ 13315 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) 13316 #define islessgreater(x, y) \ 13317 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) 13318 #define isless(x,y) \ 13319 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) 13320 #define islessequal(x, y) \ 13321 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) 13322 #define isgreater(x,y) \ 13323 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) 13324 #define isgreaterequal(x,y) \ 13325 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) 13326 13327 extern int __finite(double); 13328 extern int __finitef(float); 13329 extern int __finitel(long double); 13330 extern int __isinf(double); 13331 extern int __isinff(float); 13332 extern int __isinfl(long double); 13333 extern int __isnan(double); 13334 extern int __isnanf(float); 13335 extern int __isnanl(long double); 13336 extern int __signbit(double); 13337 extern int __signbitf(float); 13338 extern int __fpclassify(double); 13339 extern int __fpclassifyf(float); 13340 extern int signgam; 13341 extern double copysign(double, double); 13342 extern int finite(double); 13343 extern double frexp(double, int *); 13344 extern double ldexp(double, int); 13345 extern double modf(double, double *); 13346 extern double acos(double); 13347 extern double acosh(double); 13348 extern double asinh(double); 13349 extern double atanh(double); 13350 extern double asin(double); 13351 extern double atan(double); 13352 extern double atan2(double, double); 13353 extern double cbrt(double); 13354 extern double ceil(double); 13355 extern double cos(double); 13356 extern double cosh(double); 13357 extern double erf(double); 13358 extern double erfc(double); 13359 extern double exp(double); 13360 extern double expm1(double); 13361 extern double fabs(double); 13362 extern double floor(double); 13363 extern double fmod(double, double); 13364 extern double gamma(double); 13365 extern double hypot(double, double); 13366 extern int ilogb(double); 13367 extern double j0(double); 13368 extern double j1(double); 13369 extern double jn(int, double); 13370 extern double lgamma(double); 13371 extern double log(double); 13372 extern double log10(double); 13373 extern double log1p(double); 13374 extern double logb(double); 13375 extern double nextafter(double, double); 13376 extern double pow(double, double); 13377 extern double remainder(double, double); 13378 extern double rint(double); 13379 extern double scalb(double, double); 13380 extern double sin(double); 13381 extern double sinh(double); 13382 extern double sqrt(double); 13383 extern double tan(double); 13384 extern double tanh(double); 13385 extern double y0(double); 13386 extern double y1(double); 13387 extern double yn(int, double); 13388 extern float copysignf(float, float); 13389 extern long double copysignl(long double, long double); 13390 extern int finitef(float); 13391 extern int finitel(long double); 13392 extern float frexpf(float, int *); 13393 extern long double frexpl(long double, int *); 13394 extern float ldexpf(float, int); 13395 extern long double ldexpl(long double, int); 13396 extern float modff(float, float *); 13397 extern long double modfl(long double, long double *); 13398 extern double scalbln(double, long int); 13399 extern float scalblnf(float, long int); 13400 extern long double scalblnl(long double, long int); 13401 extern double scalbn(double, int); 13402 extern float scalbnf(float, int); 13403 extern long double scalbnl(long double, int); 13404 extern float acosf(float); 13405 extern float acoshf(float); 13406 extern long double acoshl(long double); 13407 extern long double acosl(long double); 13408 extern float asinf(float); 13409 extern float asinhf(float); 13410 extern long double asinhl(long double); 13411 extern long double asinl(long double); 13412 extern float atan2f(float, float); 13413 extern long double atan2l(long double, long double); 13414 extern float atanf(float); 13415 extern float atanhf(float); 13416 extern long double atanhl(long double); 13417 extern long double atanl(long double); 13418 extern float cbrtf(float); 13419 extern long double cbrtl(long double); 13420 extern float ceilf(float); 13421 extern long double ceill(long double); 13422 extern float cosf(float); 13423 extern float coshf(float); 13424 extern long double coshl(long double); 13425 extern long double cosl(long double); 13426 extern float dremf(float, float); 13427 extern long double dreml(long double, long double); 13428 extern float erfcf(float); 13429 extern long double erfcl(long double); 13430 extern float erff(float); 13431 extern long double erfl(long double); 13432 extern double exp2(double); 13433 extern float exp2f(float); 13434 extern float expf(float); 13435 extern long double expl(long double); 13436 extern float expm1f(float); 13437 extern long double expm1l(long double); 13438 extern float fabsf(float); 13439 extern long double fabsl(long double); 13440 extern double fdim(double, double); 13441 extern float fdimf(float, float); 13442 extern long double fdiml(long double, long double); 13443 extern float floorf(float); 13444 extern long double floorl(long double); 13445 extern double fma(double, double, double); 13446 extern float fmaf(float, float, float); 13447 extern long double fmal(long double, long double, long double); 13448 extern double fmax(double, double); 13449 extern float fmaxf(float, float); 13450 extern long double fmaxl(long double, long double); 13451 extern double fmin(double, double); 13452 extern float fminf(float, float); 13453 extern long double fminl(long double, long double); 13454 extern float fmodf(float, float); 13455 extern long double fmodl(long double, long double); 13456 extern float gammaf(float); 13457 extern long double gammal(long double); 13458 extern float hypotf(float, float); 13459 extern long double hypotl(long double, long double); 13460 extern int ilogbf(float); 13461 extern int ilogbl(long double); 13462 extern float j0f(float); 13463 extern long double j0l(long double); 13464 extern float j1f(float); 13465 extern long double j1l(long double); 13466 extern float jnf(int, float); 13467 extern long double jnl(int, long double); 13468 extern double lgamma_r(double, int *); 13469 extern float lgammaf(float); 13470 extern float lgammaf_r(float, int *); 13471 extern long double lgammal(long double); 13472 extern long double lgammal_r(long double, int *); 13473 extern long long int llrint(double); 13474 extern long long int llrintf(float); 13475 extern long long int llrintl(long double); 13476 extern long long int llround(double); 13477 extern long long int llroundf(float); 13478 extern long long int llroundl(long double); 13479 extern float log10f(float); 13480 extern long double log10l(long double); 13481 extern float log1pf(float); 13482 extern long double log1pl(long double); 13483 extern double log2(double); 13484 extern float log2f(float); 13485 extern long double log2l(long double); 13486 extern float logbf(float); 13487 extern long double logbl(long double); 13488 extern float logf(float); 13489 extern long double logl(long double); 13490 extern long int lrint(double); 13491 extern long int lrintf(float); 13492 extern long int lrintl(long double); 13493 extern long int lround(double); 13494 extern long int lroundf(float); 13495 extern long int lroundl(long double); 13496 extern int matherr(struct exception *); 13497 extern double nan(const char *); 13498 extern float nanf(const char *); 13499 extern long double nanl(const char *); 13500 extern double nearbyint(double); 13501 extern float nearbyintf(float); 13502 extern long double nearbyintl(long double); 13503 extern float nextafterf(float, float); 13504 extern long double nextafterl(long double, long double); 13505 extern double nexttoward(double, long double); 13506 extern float nexttowardf(float, long double); 13507 extern long double nexttowardl(long double, long double); 13508 extern double pow10(double); 13509 extern float pow10f(float); 13510 extern long double pow10l(long double); 13511 extern float powf(float, float); 13512 extern long double powl(long double, long double); 13513 extern float remainderf(float, float); 13514 extern long double remainderl(long double, long double); 13515 extern double remquo(double, double, int *); 13516 extern float remquof(float, float, int *); 13517 extern long double remquol(long double, long double, int *); 13518 extern float rintf(float); 13519 extern long double rintl(long double); 13520 extern double round(double); 13521 extern float roundf(float); 13522 extern long double roundl(long double); 13523 extern float scalbf(float, float); 13524 extern long double scalbl(long double, long double); 13525 extern double significand(double); 13526 extern float significandf(float); 13527 extern long double significandl(long double); 13528 extern void sincos(double, double *, double *); 13529 extern void sincosf(float, float *, float *); 13530 extern void sincosl(long double, long double *, long double *); 13531 extern float sinf(float); 13532 extern float sinhf(float); 13533 extern long double sinhl(long double); 13534 extern long double sinl(long double); 13535 extern float sqrtf(float); 13536 extern long double sqrtl(long double); 13537 extern float tanf(float); 13538 extern float tanhf(float); 13539 extern long double tanhl(long double); 13540 extern long double tanl(long double); 13541 extern double tgamma(double); 13542 extern float tgammaf(float); 13543 extern long double tgammal(long double); 13544 extern double trunc(double); 13545 extern float truncf(float); 13546 extern long double truncl(long double); 13547 extern float y0f(float); 13548 extern long double y0l(long double); 13549 extern float y1f(float); 13550 extern long double y1l(long double); 13551 extern float ynf(int, float); 13552 extern long double ynl(int, long double); 13553 _________________________________________________________ 13554 13555 13.8. Interface Definitions for libm 13556 13557 Table of Contents 13558 __fpclassify -- Classify real floating type 13559 __fpclassifyf -- Classify real floating type 13560 13561 The interfaces defined on the following pages are included in 13562 libm and are defined by this specification. Unless otherwise 13563 noted, these interfaces shall be included in the source 13564 standard. 13565 13566 Other interfaces listed in Section 13.6 shall behave as 13567 described in the referenced base document. 13568 13569 __fpclassify 13570 13571 Name 13572 13573 __fpclassify -- Classify real floating type 13574 13575 Synopsis 13576 13577 int __fpclassify(double arg); 13578 13579 Description 13580 13581 __fpclassify() has the same specification as fpclassify() in 13582 ISO POSIX (2003), except that the argument type for 13583 __fpclassify() is known to be double. 13584 13585 __fpclassify() is not in the source standard; it is only in 13586 the binary standard. 13587 13588 __fpclassifyf 13589 13590 Name 13591 13592 __fpclassifyf -- Classify real floating type 13593 13594 Synopsis 13595 13596 int __fpclassifyf(float arg); 13597 13598 Description 13599 13600 __fpclassifyf() has the same specification as fpclassify() in 13601 ISO POSIX (2003), except that the argument type for 13602 __fpclassifyf() is known to be float. 13603 13604 __fpclassifyf() is not in the source standard; it is only in 13605 the binary standard. 13606 _________________________________________________________ 13607 13608 13.9. Interfaces for libpthread 13609 13610 Table 13-27 defines the library name and shared object name 13611 for the libpthread library 13612 13613 Table 13-27. libpthread Definition 13614 Library: libpthread 13615 SONAME: libpthread.so.0 13616 13617 The behavior of the interfaces in this library is specified by 13618 the following specifications: 13619 13620 [LFS] Large File Support 13621 [LSB] This Specification 13622 [SUSv3] ISO POSIX (2003) 13623 _________________________________________________________ 13624 13625 13.9.1. Realtime Threads 13626 _________________________________________________________ 13627 13628 13.9.1.1. Interfaces for Realtime Threads 13629 13630 An LSB conforming implementation shall provide the generic 13631 functions for Realtime Threads specified in Table 13-28, with 13632 the full mandatory functionality as described in the 13633 referenced underlying specification. 13634 13635 Table 13-28. libpthread - Realtime Threads Function Interfaces 13636 pthread_attr_getinheritsched [SUSv3] 13637 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 13638 [SUSv3] pthread_attr_setinheritsched [SUSv3] 13639 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 13640 [SUSv3] pthread_getschedparam [SUSv3] pthread_setschedparam 13641 [SUSv3] 13642 pthread_setschedprio(GLIBC_2.3.4) [SUSv3] 13643 _________________________________________________________ 13644 13645 13.9.2. Advanced Realtime Threads 13646 _________________________________________________________ 13647 13648 13.9.2.1. Interfaces for Advanced Realtime Threads 13649 13650 No external functions are defined for libpthread - Advanced 13651 Realtime Threads in this part of the specification. See also 13652 the relevant architecture specific part of ISO/IEC 23360. 13653 _________________________________________________________ 13654 13655 13.9.3. Posix Threads 13656 _________________________________________________________ 13657 13658 13.9.3.1. Interfaces for Posix Threads 13659 13660 An LSB conforming implementation shall provide the generic 13661 functions for Posix Threads specified in Table 13-29, with the 13662 full mandatory functionality as described in the referenced 13663 underlying specification. 13664 13665 Table 13-29. libpthread - Posix Threads Function Interfaces 13666 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 13667 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 13668 [SUSv3] 13669 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 13670 [SUSv3] pthread_attr_getstack [SUSv3] 13671 pthread_attr_getstackaddr [SUSv3] 13672 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 13673 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 13674 [SUSv3] 13675 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 13676 [SUSv3] pthread_attr_setstackaddr [SUSv3] 13677 pthread_attr_setstacksize [SUSv3] 13678 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 13679 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 13680 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 13681 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 13682 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 13683 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 13684 [SUSv3] 13685 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 13686 [SUSv3] pthread_getconcurrency [SUSv3] 13687 pthread_getspecific [SUSv3] pthread_join [SUSv3] 13688 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 13689 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 13690 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 13691 pthread_mutex_trylock [SUSv3] pthread_mutex_unlock [SUSv3] 13692 pthread_mutexattr_destroy [SUSv3] pthread_mutexattr_getpshared 13693 [SUSv3] 13694 pthread_mutexattr_gettype [SUSv3] pthread_mutexattr_init 13695 [SUSv3] pthread_mutexattr_setpshared [SUSv3] 13696 pthread_mutexattr_settype [SUSv3] 13697 pthread_once [SUSv3] pthread_rwlock_destroy [SUSv3] 13698 pthread_rwlock_init [SUSv3] pthread_rwlock_rdlock [SUSv3] 13699 pthread_rwlock_timedrdlock [SUSv3] pthread_rwlock_timedwrlock 13700 [SUSv3] pthread_rwlock_tryrdlock [SUSv3] 13701 pthread_rwlock_trywrlock [SUSv3] 13702 pthread_rwlock_unlock [SUSv3] pthread_rwlock_wrlock [SUSv3] 13703 pthread_rwlockattr_destroy [SUSv3] 13704 pthread_rwlockattr_getpshared [SUSv3] 13705 pthread_rwlockattr_init [SUSv3] pthread_rwlockattr_setpshared 13706 [SUSv3] pthread_self [SUSv3] pthread_setcancelstate [SUSv3] 13707 pthread_setcanceltype [SUSv3] pthread_setconcurrency [SUSv3] 13708 pthread_setspecific [SUSv3] pthread_sigmask [SUSv3] 13709 pthread_testcancel [SUSv3] sem_close [SUSv3] sem_destroy 13710 [SUSv3] sem_getvalue [SUSv3] 13711 sem_init [SUSv3] sem_open [SUSv3] sem_post [SUSv3] 13712 sem_timedwait [SUSv3] 13713 sem_trywait [SUSv3] sem_unlink [SUSv3] sem_wait [SUSv3] 13714 _________________________________________________________ 13715 13716 13.9.4. Thread aware versions of libc interfaces 13717 _________________________________________________________ 13718 13719 13.9.4.1. Interfaces for Thread aware versions of libc interfaces 13720 13721 An LSB conforming implementation shall provide the generic 13722 functions for Thread aware versions of libc interfaces 13723 specified in Table 13-30, with the full mandatory 13724 functionality as described in the referenced underlying 13725 specification. 13726 13727 Table 13-30. libpthread - Thread aware versions of libc 13728 interfaces Function Interfaces 13729 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LFS] 13730 pwrite [SUSv3] pwrite64 [LFS] 13731 _________________________________________________________ 13732 13733 13.10. Data Definitions for libpthread 13734 13735 This section defines global identifiers and their values that 13736 are associated with interfaces contained in libpthread. These 13737 definitions are organized into groups that correspond to 13738 system headers. This convention is used as a convenience for 13739 the reader, and does not imply the existence of these headers, 13740 or their content. Where an interface is defined as requiring a 13741 particular system header file all of the data definitions for 13742 that system header file presented here shall be in effect. 13743 13744 This section gives data definitions to promote binary 13745 application portability, not to repeat source interface 13746 definitions available elsewhere. System providers and 13747 application developers should use this ABI to supplement - not 13748 to replace - source interface definition specifications. 13749 13750 This specification uses the ISO C (1999) C Language as the 13751 reference programming language, and data definitions are 13752 specified in ISO C format. The C language is used here as a 13753 convenient notation. Using a C language description of these 13754 data objects does not preclude their use by other programming 13755 languages. 13756 _________________________________________________________ 13757 13758 13.10.1. pthread.h 13759 13760 #define PTHREAD_MUTEX_DEFAULT 0 13761 #define PTHREAD_MUTEX_NORMAL 0 13762 #define PTHREAD_SCOPE_SYSTEM 0 13763 #define PTHREAD_MUTEX_RECURSIVE 1 13764 #define PTHREAD_SCOPE_PROCESS 1 13765 #define PTHREAD_MUTEX_ERRORCHECK 2 13766 #define PTHREAD_RWLOCK_DEFAULT_NP 2 13767 #define PTHREAD_MUTEX_INITIALIZER \ 13768 {0,0,0,PTHREAD_MUTEX_NORMAL,__LOCK_INITIALIZER} 13769 #define PTHREAD_RWLOCK_INITIALIZER \ 13770 { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP,\ 13771 PTHREAD_PROCESS_PRIVATE } 13772 #define pthread_cleanup_push(routine,arg) \ 13773 {struct _pthread_cleanup_buffer _buffer;\ 13774 _pthread_cleanup_push(&_buffer,(routine),(arg)); 13775 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 13776 #define __LOCK_INITIALIZER { 0, 0 } 13777 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 13778 13779 struct _pthread_cleanup_buffer { 13780 void (*__routine) (void *); 13781 void *__arg; 13782 int __canceltype; 13783 struct _pthread_cleanup_buffer *__prev; 13784 }; 13785 typedef unsigned int pthread_key_t; 13786 typedef int pthread_once_t; 13787 typedef long long int __pthread_cond_align_t; 13788 13789 typedef unsigned long int pthread_t; 13790 struct _pthread_fastlock { 13791 long int __status; 13792 int __spinlock; 13793 }; 13794 13795 typedef struct _pthread_descr_struct *_pthread_descr; 13796 13797 typedef struct { 13798 int __m_reserved; 13799 int __m_count; 13800 _pthread_descr __m_owner; 13801 int __m_kind; 13802 struct _pthread_fastlock __m_lock; 13803 } pthread_mutex_t; 13804 typedef struct { 13805 int __mutexkind; 13806 } pthread_mutexattr_t; 13807 13808 typedef struct { 13809 int __detachstate; 13810 int __schedpolicy; 13811 struct sched_param __schedparam; 13812 int __inheritsched; 13813 int __scope; 13814 size_t __guardsize; 13815 int __stackaddr_set; 13816 void *__stackaddr; 13817 unsigned long int __stacksize; 13818 } pthread_attr_t; 13819 13820 typedef struct { 13821 struct _pthread_fastlock __c_lock; 13822 _pthread_descr __c_waiting; 13823 char __padding[48 - sizeof(struct _pthread_fastlock) - 13824 sizeof(_pthread_descr) - 13825 sizeof(__pthread_cond_align_t)]; 13826 __pthread_cond_align_t __align; 13827 } pthread_cond_t; 13828 typedef struct { 13829 int __dummy; 13830 } pthread_condattr_t; 13831 13832 typedef struct _pthread_rwlock_t { 13833 struct _pthread_fastlock __rw_lock; 13834 int __rw_readers; 13835 _pthread_descr __rw_writer; 13836 _pthread_descr __rw_read_waiting; 13837 _pthread_descr __rw_write_waiting; 13838 int __rw_kind; 13839 int __rw_pshared; 13840 } pthread_rwlock_t; 13841 typedef struct { 13842 int __lockkind; 13843 int __pshared; 13844 } pthread_rwlockattr_t; 13845 13846 #define PTHREAD_CREATE_JOINABLE 0 13847 #define PTHREAD_INHERIT_SCHED 0 13848 #define PTHREAD_ONCE_INIT 0 13849 #define PTHREAD_PROCESS_PRIVATE 0 13850 #define PTHREAD_CREATE_DETACHED 1 13851 #define PTHREAD_EXPLICIT_SCHED 1 13852 #define PTHREAD_PROCESS_SHARED 1 13853 13854 #define PTHREAD_CANCELED ((void*)-1) 13855 #define PTHREAD_CANCEL_DEFERRED 0 13856 #define PTHREAD_CANCEL_ENABLE 0 13857 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 13858 #define PTHREAD_CANCEL_DISABLE 1 13859 13860 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 13861 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 13862 void (*__pshared) (void *) 13863 , void *); 13864 extern int pthread_attr_destroy(pthread_attr_t *); 13865 extern int pthread_attr_getdetachstate(const pthread_attr_t *, int *); 13866 extern int pthread_attr_getinheritsched(const pthread_attr_t *, int *); 13867 extern int pthread_attr_getschedparam(const pthread_attr_t *, 13868 struct sched_param *); 13869 extern int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); 13870 extern int pthread_attr_getscope(const pthread_attr_t *, int *); 13871 extern int pthread_attr_init(pthread_attr_t *); 13872 extern int pthread_attr_setdetachstate(pthread_attr_t *, int); 13873 extern int pthread_attr_setinheritsched(pthread_attr_t *, int); 13874 extern int pthread_attr_setschedparam(pthread_attr_t *, 13875 const struct sched_param *); 13876 extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); 13877 extern int pthread_attr_setscope(pthread_attr_t *, int); 13878 extern int pthread_cancel(pthread_t); 13879 extern int pthread_cond_broadcast(pthread_cond_t *); 13880 extern int pthread_cond_destroy(pthread_cond_t *); 13881 extern int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); 13882 extern int pthread_cond_signal(pthread_cond_t *); 13883 extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, 13884 const struct timespec *); 13885 extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); 13886 extern int pthread_condattr_destroy(pthread_condattr_t *); 13887 extern int pthread_condattr_init(pthread_condattr_t *); 13888 extern int pthread_create(pthread_t *, const pthread_attr_t *, 13889 void *(*__pshared) (void *p1) 13890 , void *); 13891 extern int pthread_detach(pthread_t); 13892 extern int pthread_equal(pthread_t, pthread_t); 13893 extern void pthread_exit(void *); 13894 extern int pthread_getschedparam(pthread_t, int *, struct sched_param *); 13895 extern void *pthread_getspecific(pthread_key_t); 13896 extern int pthread_join(pthread_t, void **); 13897 extern int pthread_key_create(pthread_key_t *, void (*__pshared) (void*) 13898 ); 13899 extern int pthread_key_delete(pthread_key_t); 13900 extern int pthread_mutex_destroy(pthread_mutex_t *); 13901 extern int pthread_mutex_init(pthread_mutex_t *, 13902 const pthread_mutexattr_t *); 13903 extern int pthread_mutex_lock(pthread_mutex_t *); 13904 extern int pthread_mutex_trylock(pthread_mutex_t *); 13905 extern int pthread_mutex_unlock(pthread_mutex_t *); 13906 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); 13907 extern int pthread_mutexattr_init(pthread_mutexattr_t *); 13908 extern int pthread_once(pthread_once_t *, void (*__pshared) (void) 13909 ); 13910 extern int pthread_rwlock_destroy(pthread_rwlock_t *); 13911 extern int pthread_rwlock_init(pthread_rwlock_t *, pthread_rwlockattr_t *); 13912 extern int pthread_rwlock_rdlock(pthread_rwlock_t *); 13913 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); 13914 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); 13915 extern int pthread_rwlock_unlock(pthread_rwlock_t *); 13916 extern int pthread_rwlock_wrlock(pthread_rwlock_t *); 13917 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); 13918 extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, 13919 int *); 13920 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); 13921 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); 13922 extern pthread_t pthread_self(void); 13923 extern int pthread_setcancelstate(int, int *); 13924 extern int pthread_setcanceltype(int, int *); 13925 extern int pthread_setschedparam(pthread_t, int, 13926 const struct sched_param *); 13927 extern int pthread_setspecific(pthread_key_t, const void *); 13928 extern void pthread_testcancel(void); 13929 extern int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); 13930 extern int pthread_attr_setguardsize(pthread_attr_t *, size_t); 13931 extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); 13932 extern int pthread_attr_getstackaddr(const pthread_attr_t *, void **); 13933 extern int pthread_attr_setstacksize(pthread_attr_t *, size_t); 13934 extern int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); 13935 extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *, int *); 13936 extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); 13937 extern int pthread_getconcurrency(void); 13938 extern int pthread_setconcurrency(int); 13939 extern int pthread_attr_getstack(const pthread_attr_t *, void **, 13940 size_t *); 13941 extern int pthread_attr_setstack(pthread_attr_t *, void *, size_t); 13942 extern int pthread_condattr_getpshared(const pthread_condattr_t *, int*); 13943 extern int pthread_condattr_setpshared(pthread_condattr_t *, int); 13944 extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, 13945 int *); 13946 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); 13947 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *, 13948 const struct timespec *); 13949 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *, 13950 const struct timespec *); 13951 extern int __register_atfork(void (*__pshared) (void) 13952 , void (*__pshared) (void) 13953 , void (*__pshared) (void) 13954 , void *); 13955 extern int pthread_setschedprio(pthread_t, int); 13956 _________________________________________________________ 13957 13958 13.10.2. semaphore.h 13959 13960 typedef struct { 13961 struct _pthread_fastlock __sem_lock; 13962 int __sem_value; 13963 _pthread_descr __sem_waiting; 13964 } sem_t; 13965 13966 #define SEM_FAILED ((sem_t*)0) 13967 13968 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 13969 13970 extern int sem_close(sem_t *); 13971 extern int sem_destroy(sem_t *); 13972 extern int sem_getvalue(sem_t *, int *); 13973 extern int sem_init(sem_t *, int, unsigned int); 13974 extern sem_t *sem_open(const char *, int, ...); 13975 extern int sem_post(sem_t *); 13976 extern int sem_trywait(sem_t *); 13977 extern int sem_unlink(const char *); 13978 extern int sem_wait(sem_t *); 13979 extern int sem_timedwait(sem_t *, const struct timespec *); 13980 _________________________________________________________ 13981 13982 13.11. Interface Definitions for libpthread 13983 13984 Table of Contents 13985 _pthread_cleanup_pop -- establish cancellation handlers 13986 _pthread_cleanup_push -- establish cancellation handlers 13987 13988 The interfaces defined on the following pages are included in 13989 libpthread and are defined by this specification. Unless 13990 otherwise noted, these interfaces shall be included in the 13991 source standard. 13992 13993 Other interfaces listed in Section 13.9 shall behave as 13994 described in the referenced base document. 13995 13996 _pthread_cleanup_pop 13997 13998 Name 13999 14000 _pthread_cleanup_pop -- establish cancellation handlers 14001 14002 Synopsis 14003 14004 #include 14005 14006 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 14007 int); 14008 14009 Description 14010 14011 The _pthread_cleanup_pop() function provides an implementation 14012 of the pthread_cleanup_pop() macro described in ISO POSIX 14013 (2003). 14014 14015 The _pthread_cleanup_pop() function is not in the source 14016 standard; it is only in the binary standard. 14017 14018 _pthread_cleanup_push 14019 14020 Name 14021 14022 _pthread_cleanup_push -- establish cancellation handlers 14023 14024 Synopsis 14025 14026 #include 14027 14028 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 14029 void (*) (void *), void *); 14030 14031 Description 14032 14033 The _pthread_cleanup_push() function provides an 14034 implementation of the pthread_cleanup_push() macro described 14035 in ISO POSIX (2003). 14036 14037 The _pthread_cleanup_push() function is not in the source 14038 standard; it is only in the binary standard. 14039 _________________________________________________________ 14040 14041 13.12. Interfaces for libgcc_s 14042 14043 Table 13-31 defines the library name and shared object name 14044 for the libgcc_s library 14045 14046 Table 13-31. libgcc_s Definition 14047 Library: libgcc_s 14048 SONAME: libgcc_s.so.1 14049 _________________________________________________________ 14050 14051 13.12.1. Unwind Library 14052 _________________________________________________________ 14053 14054 13.12.1.1. Interfaces for Unwind Library 14055 14056 No external functions are defined for libgcc_s - Unwind 14057 Library in this part of the specification. See also the 14058 relevant architecture specific part of ISO/IEC 23360. 14059 _________________________________________________________ 14060 14061 13.13. Data Definitions for libgcc_s 14062 14063 This section defines global identifiers and their values that 14064 are associated with interfaces contained in libgcc_s. These 14065 definitions are organized into groups that correspond to 14066 system headers. This convention is used as a convenience for 14067 the reader, and does not imply the existence of these headers, 14068 or their content. Where an interface is defined as requiring a 14069 particular system header file all of the data definitions for 14070 that system header file presented here shall be in effect. 14071 14072 This section gives data definitions to promote binary 14073 application portability, not to repeat source interface 14074 definitions available elsewhere. System providers and 14075 application developers should use this ABI to supplement - not 14076 to replace - source interface definition specifications. 14077 14078 This specification uses the ISO C (1999) C Language as the 14079 reference programming language, and data definitions are 14080 specified in ISO C format. The C language is used here as a 14081 convenient notation. Using a C language description of these 14082 data objects does not preclude their use by other programming 14083 languages. 14084 _________________________________________________________ 14085 14086 13.13.1. unwind.h 14087 14088 struct _Unwind_Context; 14089 14090 typedef void *_Unwind_Ptr; 14091 typedef unsigned int _Unwind_Word; 14092 14093 typedef enum { 14094 _URC_NO_REASON = 0, 14095 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, 14096 _URC_FATAL_PHASE2_ERROR = 2, 14097 _URC_FATAL_PHASE1_ERROR = 3, 14098 _URC_NORMAL_STOP = 4, 14099 _URC_END_OF_STACK = 5, 14100 _URC_HANDLER_FOUND = 6, 14101 _URC_INSTALL_CONTEXT = 7, 14102 _URC_CONTINUE_UNWIND = 8 14103 } _Unwind_Reason_Code; 14104 14105 struct _Unwind_Exception { 14106 u_int64_t exception_class; 14107 _Unwind_Exception_Cleanup_Fn exception_cleanup; 14108 u_int64_t private_1; 14109 u_int64_t private_2; 14110 }; 14111 14112 #define _UA_SEARCH_PHASE 1 14113 #define _UA_END_OF_STACK 16 14114 #define _UA_CLEANUP_PHASE 2 14115 #define _UA_HANDLER_FRAME 4 14116 #define _UA_FORCE_UNWIND 8 14117 _________________________________________________________ 14118 14119 13.14. Interfaces for libdl 14120 14121 Table 13-32 defines the library name and shared object name 14122 for the libdl library 14123 14124 Table 13-32. libdl Definition 14125 Library: libdl 14126 SONAME: libdl.so.2 14127 14128 The behavior of the interfaces in this library is specified by 14129 the following specifications: 14130 14131 [LSB] This Specification 14132 [SUSv3] ISO POSIX (2003) 14133 _________________________________________________________ 14134 14135 13.14.1. Dynamic Loader 14136 _________________________________________________________ 14137 14138 13.14.1.1. Interfaces for Dynamic Loader 14139 14140 An LSB conforming implementation shall provide the generic 14141 functions for Dynamic Loader specified in Table 13-33, with 14142 the full mandatory functionality as described in the 14143 referenced underlying specification. 14144 14145 Table 13-33. libdl - Dynamic Loader Function Interfaces 14146 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 14147 dlsym [LSB] 14148 _________________________________________________________ 14149 14150 13.15. Data Definitions for libdl 14151 14152 This section defines global identifiers and their values that 14153 are associated with interfaces contained in libdl. These 14154 definitions are organized into groups that correspond to 14155 system headers. This convention is used as a convenience for 14156 the reader, and does not imply the existence of these headers, 14157 or their content. Where an interface is defined as requiring a 14158 particular system header file all of the data definitions for 14159 that system header file presented here shall be in effect. 14160 14161 This section gives data definitions to promote binary 14162 application portability, not to repeat source interface 14163 definitions available elsewhere. System providers and 14164 application developers should use this ABI to supplement - not 14165 to replace - source interface definition specifications. 14166 14167 This specification uses the ISO C (1999) C Language as the 14168 reference programming language, and data definitions are 14169 specified in ISO C format. The C language is used here as a 14170 convenient notation. Using a C language description of these 14171 data objects does not preclude their use by other programming 14172 languages. 14173 _________________________________________________________ 14174 14175 13.15.1. dlfcn.h 14176 14177 #define RTLD_NEXT ((void *) -1l) 14178 #define RTLD_LOCAL 0 14179 #define RTLD_LAZY 0x00001 14180 #define RTLD_NOW 0x00002 14181 #define RTLD_GLOBAL 0x00100 14182 14183 typedef struct { 14184 char *dli_fname; 14185 void *dli_fbase; 14186 char *dli_sname; 14187 void *dli_saddr; 14188 } Dl_info; 14189 extern int dladdr(const void *, Dl_info *); 14190 extern int dlclose(void *); 14191 extern char *dlerror(void); 14192 extern void *dlopen(char *, int); 14193 extern void *dlsym(void *, char *); 14194 _________________________________________________________ 14195 14196 13.16. Interface Definitions for libdl 14197 14198 Table of Contents 14199 dladdr -- find the shared object containing a given address 14200 dlopen -- open dynamic object 14201 dlsym -- obtain the address of a symbol from a dlopen object 14202 14203 The interfaces defined on the following pages are included in 14204 libdl and are defined by this specification. Unless otherwise 14205 noted, these interfaces shall be included in the source 14206 standard. 14207 14208 Other interfaces listed in Section 13.14 shall behave as 14209 described in the referenced base document. 14210 14211 dladdr 14212 14213 Name 14214 14215 dladdr -- find the shared object containing a given address 14216 14217 Synopsis 14218 14219 #include 14220 14221 typedef struct { 14222 const char *dli_fname; 14223 void *dli_fbase; 14224 const char *dli_sname; 14225 void *dli_saddr; 14226 } Dl_info; 14227 14228 int dladdr(const void * addr, Dl_info * dlip); 14229 14230 Description 14231 14232 The dladdr() function shall query the dynamic linker for 14233 information about the shared object containing the address 14234 addr. The information shall be returned in the user supplied 14235 data structure referenced by dlip. 14236 14237 The structure shall contain at least the following members: 14238 14239 dli_fname 14240 14241 The pathname of the shared object containing the address 14242 dli_fbase 14243 14244 The base address at which the shared object is mapped into the 14245 address space of the calling process. 14246 dli_sname 14247 14248 The name of the nearest runtime symbol with value less than or 14249 equal to addr. Where possible, the symbol name shall be 14250 returned as it would appear in C source code. 14251 14252 If no symbol with a suitable value is found, both this field 14253 and dli_saddr shall be set to NULL. 14254 dli_saddr 14255 14256 The address of the symbol returned in dli_sname. This address 14257 has type "pointer to type", where type is the type of the 14258 symbol dli_sname. 14259 14260 Example: If the symbol in dli_sname is a function, then the 14261 type of dli_saddr is of type "pointer to function". 14262 14263 The behavior of dladdr() is only specified in dynamically 14264 linked programs. 14265 14266 Return Value 14267 14268 On success, dladdr() shall return non-zero, and the structure 14269 referenced by dlip shall be filled in as described. Otherwise, 14270 dladdr() shall return zero, and the cause of the error can be 14271 fetched with dlerror(). 14272 14273 Errors 14274 14275 See dlerror(). 14276 14277 Environment 14278 14279 LD_LIBRARY_PATH 14280 14281 directory search-path for object files 14282 14283 dlopen 14284 14285 Name 14286 14287 dlopen -- open dynamic object 14288 14289 Synopsis 14290 14291 #include 14292 14293 void * dlopen(const char * filename, int flag); 14294 14295 Description 14296 14297 The dlopen() function shall behave as specified in ISO POSIX 14298 (2003), but with additional behaviors listed below. 14299 14300 If the file argument does not contain a slash character, then 14301 the system shall look for a library of that name in at least 14302 the following directories, and use the first one which is 14303 found: 14304 14305 * The directories specified by the DT_RPATH dynamic entry. 14306 * The directories specified in the LD_LIBRARY_PATH 14307 environment variable (which is a colon separated list of 14308 pathnames). This step shall be skipped for setuid and 14309 setgid executables. 14310 * A set of directories sufficient to contain the libraries 14311 specified in this standard. 14312 14313 Note: Traditionally, /lib and /usr/lib. This case would 14314 also cover cases in which the system used the mechanism of 14315 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 14316 Example: An application which is not linked against libm 14317 may choose to dlopen libm. 14318 14319 dlsym 14320 14321 Name 14322 14323 dlsym -- obtain the address of a symbol from a dlopen object 14324 14325 Description 14326 14327 dlsym() is as specified in the ISO POSIX (2003), but with 14328 differences as listed below. 14329 14330 The special purpose value for handle RTLD_NEXT 14331 14332 The value RTLD_NEXT, which is reserved for future use shall be 14333 available, with the behavior as described in ISO POSIX (2003). 14334 _________________________________________________________ 14335 14336 13.17. Interfaces for librt 14337 14338 Table 13-34 defines the library name and shared object name 14339 for the librt library 14340 14341 Table 13-34. librt Definition 14342 Library: librt 14343 SONAME: librt.so.1 14344 14345 The behavior of the interfaces in this library is specified by 14346 the following specifications: 14347 14348 [SUSv3] ISO POSIX (2003) 14349 _________________________________________________________ 14350 14351 13.17.1. Shared Memory Objects 14352 _________________________________________________________ 14353 14354 13.17.1.1. Interfaces for Shared Memory Objects 14355 14356 An LSB conforming implementation shall provide the generic 14357 functions for Shared Memory Objects specified in Table 13-35, 14358 with the full mandatory functionality as described in the 14359 referenced underlying specification. 14360 14361 Table 13-35. librt - Shared Memory Objects Function Interfaces 14362 shm_open [SUSv3] shm_unlink [SUSv3] 14363 _________________________________________________________ 14364 14365 13.17.2. Clock 14366 _________________________________________________________ 14367 14368 13.17.2.1. Interfaces for Clock 14369 14370 An LSB conforming implementation shall provide the generic 14371 functions for Clock specified in Table 13-36, with the full 14372 mandatory functionality as described in the referenced 14373 underlying specification. 14374 14375 Table 13-36. librt - Clock Function Interfaces 14376 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 14377 [SUSv3] clock_nanosleep [SUSv3] 14378 clock_settime [SUSv3] 14379 _________________________________________________________ 14380 14381 13.17.3. Timers 14382 _________________________________________________________ 14383 14384 13.17.3.1. Interfaces for Timers 14385 14386 An LSB conforming implementation shall provide the generic 14387 functions for Timers specified in Table 13-37, with the full 14388 mandatory functionality as described in the referenced 14389 underlying specification. 14390 14391 Table 13-37. librt - Timers Function Interfaces 14392 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 14393 [SUSv3] timer_gettime [SUSv3] 14394 timer_settime [SUSv3] 14395 _________________________________________________________ 14396 14397 13.18. Interfaces for libcrypt 14398 14399 Table 13-38 defines the library name and shared object name 14400 for the libcrypt library 14401 14402 Table 13-38. libcrypt Definition 14403 Library: libcrypt 14404 SONAME: libcrypt.so.1 14405 14406 The behavior of the interfaces in this library is specified by 14407 the following specifications: 14408 14409 [SUSv3] ISO POSIX (2003) 14410 _________________________________________________________ 14411 14412 13.18.1. Encryption 14413 _________________________________________________________ 14414 14415 13.18.1.1. Interfaces for Encryption 14416 14417 An LSB conforming implementation shall provide the generic 14418 functions for Encryption specified in Table 13-39, with the 14419 full mandatory functionality as described in the referenced 14420 underlying specification. 14421 14422 Table 13-39. libcrypt - Encryption Function Interfaces 14423 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 14424 _________________________________________________________ 14425 14426 13.19. Interfaces for libpam 14427 14428 Table 13-40 defines the library name and shared object name 14429 for the libpam library 14430 14431 Table 13-40. libpam Definition 14432 Library: libpam 14433 SONAME: libpam.so.0 14434 14435 The Pluggable Authentication Module (PAM) interfaces allow 14436 applications to request authentication via a system 14437 administrator defined mechanism, known as a service. 14438 14439 A single service name, other, shall always be present. The 14440 behavior of this service shall be determined by the system 14441 administrator. Additional service names may also exist. 14442 14443 Note: Future versions of this specification might define 14444 additional service names. 14445 14446 The behavior of the interfaces in this library is specified by 14447 the following specifications: 14448 14449 [LSB] This Specification 14450 _________________________________________________________ 14451 14452 13.19.1. Pluggable Authentication API 14453 _________________________________________________________ 14454 14455 13.19.1.1. Interfaces for Pluggable Authentication API 14456 14457 An LSB conforming implementation shall provide the generic 14458 functions for Pluggable Authentication API specified in Table 14459 13-41, with the full mandatory functionality as described in 14460 the referenced underlying specification. 14461 14462 Table 13-41. libpam - Pluggable Authentication API Function 14463 Interfaces 14464 pam_acct_mgmt [LSB] pam_authenticate [LSB] pam_chauthtok [LSB] 14465 pam_close_session [LSB] 14466 pam_end [LSB] pam_fail_delay [LSB] pam_get_item [LSB] 14467 pam_getenvlist [LSB] 14468 pam_open_session [LSB] pam_set_item [LSB] pam_setcred [LSB] 14469 pam_start [LSB] 14470 pam_strerror [LSB] 14471 _________________________________________________________ 14472 14473 13.20. Data Definitions for libpam 14474 14475 This section defines global identifiers and their values that 14476 are associated with interfaces contained in libpam. These 14477 definitions are organized into groups that correspond to 14478 system headers. This convention is used as a convenience for 14479 the reader, and does not imply the existence of these headers, 14480 or their content. Where an interface is defined as requiring a 14481 particular system header file all of the data definitions for 14482 that system header file presented here shall be in effect. 14483 14484 This section gives data definitions to promote binary 14485 application portability, not to repeat source interface 14486 definitions available elsewhere. System providers and 14487 application developers should use this ABI to supplement - not 14488 to replace - source interface definition specifications. 14489 14490 This specification uses the ISO C (1999) C Language as the 14491 reference programming language, and data definitions are 14492 specified in ISO C format. The C language is used here as a 14493 convenient notation. Using a C language description of these 14494 data objects does not preclude their use by other programming 14495 languages. 14496 _________________________________________________________ 14497 14498 13.20.1. security/pam_appl.h 14499 14500 typedef struct pam_handle pam_handle_t; 14501 struct pam_message { 14502 int msg_style; 14503 const char *msg; 14504 }; 14505 struct pam_response { 14506 char *resp; 14507 int resp_retcode; 14508 }; 14509 14510 struct pam_conv { 14511 int (*conv) (int num_msg, const struct pam_message * *msg, 14512 struct pam_response * *resp, void *appdata_ptr); 14513 void *appdata_ptr; 14514 }; 14515 14516 #define PAM_PROMPT_ECHO_OFF 1 14517 #define PAM_PROMPT_ECHO_ON 2 14518 #define PAM_ERROR_MSG 3 14519 #define PAM_TEXT_INFO 4 14520 14521 #define PAM_SERVICE 1 14522 #define PAM_USER 2 14523 #define PAM_TTY 3 14524 #define PAM_RHOST 4 14525 #define PAM_CONV 5 14526 #define PAM_RUSER 8 14527 #define PAM_USER_PROMPT 9 14528 14529 #define PAM_SUCCESS 0 14530 #define PAM_OPEN_ERR 1 14531 #define PAM_USER_UNKNOWN 10 14532 #define PAM_MAXTRIES 11 14533 #define PAM_NEW_AUTHTOK_REQD 12 14534 #define PAM_ACCT_EXPIRED 13 14535 #define PAM_SESSION_ERR 14 14536 #define PAM_CRED_UNAVAIL 15 14537 #define PAM_CRED_EXPIRED 16 14538 #define PAM_CRED_ERR 17 14539 #define PAM_CONV_ERR 19 14540 #define PAM_SYMBOL_ERR 2 14541 #define PAM_AUTHTOK_ERR 20 14542 #define PAM_AUTHTOK_RECOVER_ERR 21 14543 #define PAM_AUTHTOK_LOCK_BUSY 22 14544 #define PAM_AUTHTOK_DISABLE_AGING 23 14545 #define PAM_TRY_AGAIN 24 14546 #define PAM_ABORT 26 14547 #define PAM_AUTHTOK_EXPIRED 27 14548 #define PAM_BAD_ITEM 29 14549 #define PAM_SERVICE_ERR 3 14550 #define PAM_SYSTEM_ERR 4 14551 #define PAM_BUF_ERR 5 14552 #define PAM_PERM_DENIED 6 14553 #define PAM_AUTH_ERR 7 14554 #define PAM_CRED_INSUFFICIENT 8 14555 #define PAM_AUTHINFO_UNAVAIL 9 14556 14557 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 14558 #define PAM_ESTABLISH_CRED 0x0002U 14559 #define PAM_DELETE_CRED 0x0004U 14560 #define PAM_REINITIALIZE_CRED 0x0008U 14561 #define PAM_REFRESH_CRED 0x0010U 14562 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 14563 #define PAM_SILENT 0x8000U 14564 14565 extern int pam_set_item(pam_handle_t *, int, const void *); 14566 extern int pam_get_item(const pam_handle_t *, int, const void **); 14567 extern const char *pam_strerror(pam_handle_t *, int); 14568 extern char **pam_getenvlist(pam_handle_t *); 14569 extern int pam_fail_delay(pam_handle_t *, unsigned int); 14570 extern int pam_start(const char *, const char *, const struct pam_conv*, 14571 pam_handle_t * *); 14572 extern int pam_end(pam_handle_t *, int); 14573 extern int pam_authenticate(pam_handle_t *, int); 14574 extern int pam_setcred(pam_handle_t *, int); 14575 extern int pam_acct_mgmt(pam_handle_t *, int); 14576 extern int pam_open_session(pam_handle_t *, int); 14577 extern int pam_close_session(pam_handle_t *, int); 14578 extern int pam_chauthtok(pam_handle_t *, int); 14579 _________________________________________________________ 14580 14581 13.21. Interface Definitions for libpam 14582 14583 Table of Contents 14584 pam_acct_mgmt -- establish the status of a user's account 14585 pam_authenticate -- authenticate the user 14586 pam_chauthtok -- change the authentication token for a given 14587 user 14588 14589 pam_close_session -- indicate that an authenticated session 14590 has ended 14591 14592 pam_end -- terminate the use of the PAM library 14593 pam_fail_delay -- specify delay time to use on authentication 14594 error 14595 14596 pam_get_item -- obtain the value of the indicated item. 14597 pam_getenvlist -- returns a pointer to the complete PAM 14598 environment. 14599 14600 pam_open_session -- indicate session has started 14601 pam_set_item -- (re)set the value of an item. 14602 pam_setcred -- set the module-specific credentials of the user 14603 pam_start -- initialize the PAM library 14604 pam_strerror -- returns a string describing the PAM error 14605 14606 The interfaces defined on the following pages are included in 14607 libpam and are defined by this specification. Unless otherwise 14608 noted, these interfaces shall be included in the source 14609 standard. 14610 14611 Other interfaces listed in Section 13.19 shall behave as 14612 described in the referenced base document. 14613 14614 pam_acct_mgmt 14615 14616 Name 14617 14618 pam_acct_mgmt -- establish the status of a user's account 14619 14620 Synopsis 14621 14622 #include 14623 14624 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 14625 14626 Description 14627 14628 pam_acct_mgmt() establishes the account's usability and the 14629 user's accessibility to the system. It is typically called 14630 after the user has been authenticated. 14631 14632 flags may be specified as any valid flag (namely, one of those 14633 applicable to the flags argument of pam_authenticate()). 14634 Additionally, the value of flags may be logically or'd with 14635 PAM_SILENT. 14636 14637 Return Value 14638 14639 PAM_SUCCESS 14640 14641 Success. 14642 PAM_NEW_AUTHTOK_REQD 14643 14644 User is valid, but user's authentication token has expired. 14645 The correct response to this return-value is to require that 14646 the user satisfy the pam_chauthtok() function before obtaining 14647 service. It may not be possible for an application to do this. 14648 In such a case, the user should be denied access until the 14649 account password is updated. 14650 PAM_ACCT_EXPIRED 14651 14652 User is no longer permitted access to the system. 14653 PAM_AUTH_ERR 14654 14655 Authentication error. 14656 PAM_PERM_DENIED 14657 14658 User is not permitted to gain access at this time. 14659 PAM_USER_UNKNOWN 14660 14661 User is not known to a module's account management component. 14662 14663 Note: Errors may be translated to text with pam_strerror(). 14664 14665 pam_authenticate 14666 14667 Name 14668 14669 pam_authenticate -- authenticate the user 14670 14671 Synopsis 14672 14673 #include 14674 14675 int pam_authenticate(pam_handle_t * pamh, int flags); 14676 14677 Description 14678 14679 pam_authenticate() serves as an interface to the 14680 authentication mechanisms of the loaded modules. 14681 14682 flags is an optional parameter that may be specified by the 14683 following value: 14684 14685 PAM_DISALLOW_NULL_AUTHTOK 14686 Instruct the authentication modules to return 14687 PAM_AUTH_ERR if the user does not have a registered 14688 authorization token. 14689 14690 Additionally, the value of flags may be logically or'd with 14691 PAM_SILENT. 14692 14693 The process may need to be privileged in order to successfully 14694 call this function. 14695 14696 Return Value 14697 14698 PAM_SUCCESS 14699 Success. 14700 14701 PAM_AUTH_ERR 14702 User was not authenticated or process did not have 14703 sufficient privileges to perform authentication. 14704 14705 PAM_CRED_INSUFFICIENT 14706 Application does not have sufficient credentials to 14707 authenticate the user. 14708 14709 PAM_AUTHINFO_UNAVAIL 14710 Modules were not able to access the authentication 14711 information. This might be due to a network or hardware 14712 failure, etc. 14713 14714 PAM_USER_UNKNOWN 14715 Supplied username is not known to the authentication 14716 service. 14717 14718 PAM_MAXTRIES 14719 One or more authentication modules has reached its 14720 limit of tries authenticating the user. Do not try 14721 again. 14722 14723 PAM_ABORT 14724 One or more authentication modules failed to load. 14725 14726 Note: Errors may be translated to text with pam_strerror(). 14727 14728 pam_chauthtok 14729 14730 Name 14731 14732 pam_chauthtok -- change the authentication token for a given 14733 user 14734 14735 Synopsis 14736 14737 #include 14738 14739 int pam_chauthtok(pam_handle_t * pamh, const int flags); 14740 14741 Description 14742 14743 pam_chauthtok() is used to change the authentication token for 14744 a given user as indicated by the state associated with the 14745 handle pamh. 14746 14747 flags is an optional parameter that may be specified by the 14748 following value: 14749 14750 PAM_CHANGE_EXPIRED_AUTHTOK 14751 User's authentication token should only be changed if 14752 it has expired. 14753 14754 Additionally, the value of flags may be logically or'd with 14755 PAM_SILENT. 14756 14757 RETURN VALUE 14758 14759 PAM_SUCCESS 14760 Success. 14761 14762 PAM_AUTHTOK_ERR 14763 A module was unable to obtain the new authentication 14764 token. 14765 14766 PAM_AUTHTOK_RECOVER_ERR 14767 A module was unable to obtain the old authentication 14768 token. 14769 14770 PAM_AUTHTOK_LOCK_BUSY 14771 One or more modules were unable to change the 14772 authentication token since it is currently locked. 14773 14774 PAM_AUTHTOK_DISABLE_AGING 14775 Authentication token aging has been disabled for at 14776 least one of the modules. 14777 14778 PAM_PERM_DENIED 14779 Permission denied. 14780 14781 PAM_TRY_AGAIN 14782 Not all modules were in a position to update the 14783 authentication token(s). In such a case, none of the 14784 user's authentication tokens are updated. 14785 14786 PAM_USER_UNKNOWN 14787 User is not known to the authentication token changing 14788 service. 14789 14790 Note: Errors may be translated to text with pam_strerror(). 14791 14792 pam_close_session 14793 14794 Name 14795 14796 pam_close_session -- indicate that an authenticated session 14797 has ended 14798 14799 Synopsis 14800 14801 #include 14802 14803 int pam_close_session(pam_handle_t * pamh, int flags); 14804 14805 Description 14806 14807 pam_close_session() is used to indicate that an authenticated 14808 session has ended. It is used to inform the module that the 14809 user is exiting a session. It should be possible for the PAM 14810 library to open a session and close the same session from 14811 different applications. 14812 14813 flags may have the value PAM_SILENT to indicate that no output 14814 should be generated as a result of this function call. 14815 14816 Return Value 14817 14818 PAM_SUCCESS 14819 14820 Success. 14821 PAM_SESSION_ERR 14822 14823 One of the required loaded modules was unable to close a 14824 session for the user. 14825 14826 Note: Errors may be translated to text with pam_strerror(). 14827 14828 pam_end 14829 14830 Name 14831 14832 pam_end -- terminate the use of the PAM library 14833 14834 Synopsis 14835 14836 #include 14837 14838 int pam_end(pam_handle_t * pamh, int pam_status); 14839 14840 Description 14841 14842 pam_end() terminates use of the PAM library. On success, the 14843 contents of *pamh are no longer valid, and all memory 14844 associated with it is invalid. 14845 14846 Normally, pam_status is passed the value PAM_SUCCESS, but in 14847 the event of an unsuccessful service application, the 14848 appropriate PAM error return value should be used. 14849 14850 Return Value 14851 14852 PAM_SUCCESS 14853 14854 Success. 14855 14856 Note: Errors may be translated to text with pam_strerror(). 14857 14858 pam_fail_delay 14859 14860 Name 14861 14862 pam_fail_delay -- specify delay time to use on authentication 14863 error 14864 14865 Synopsis 14866 14867 #include 14868 14869 int pam_fail_delay(pam_handle_t * pamh, unsigned int 14870 micro_sec); 14871 14872 Description 14873 14874 pam_fail_delay() specifies the minimum delay for the PAM 14875 library to use when an authentication error occurs. The actual 14876 delay can vary by as much at 25%. If this function is called 14877 multiple times, the longest time specified by any of the call 14878 will be used. 14879 14880 The delay is invoked if an authentication error occurs during 14881 the pam_authenticate() or pam_chauthtok() function calls. 14882 14883 Independent of the success of pam_authenticate() or 14884 pam_chauthtok(), the delay time is reset to its default value 14885 of 0 when the PAM library returns control to the application 14886 from these two functions. 14887 14888 Return Value 14889 14890 PAM_SUCCESS 14891 14892 Success. 14893 14894 Note: Errors may be translated to text with pam_strerror(). 14895 14896 pam_get_item 14897 14898 Name 14899 14900 pam_get_item -- obtain the value of the indicated item. 14901 14902 Synopsis 14903 14904 #include 14905 14906 int pam_get_item(const pam_handle_t * pamh, int item_type, 14907 const void * * item); 14908 14909 Description 14910 14911 pam_get_item() obtains the value of the indicated item_type. 14912 The possible values of item_type are the same as listed for 14913 pam_set_item(). 14914 14915 On success, item contains a pointer to the value of the 14916 corresponding item. Note that this is a pointer to the actual 14917 data and should not be free()'d or over-written. 14918 14919 Return Value 14920 14921 PAM_SUCCESS 14922 14923 Success. 14924 PAM_PERM_DENIED 14925 14926 Application passed a NULL pointer for item. 14927 PAM_BAD_ITEM 14928 14929 Application attempted to get an undefined item. 14930 14931 Note: Errors may be translated to text with pam_strerror(). 14932 14933 pam_getenvlist 14934 14935 Name 14936 14937 pam_getenvlist -- returns a pointer to the complete PAM 14938 environment. 14939 14940 Synopsis 14941 14942 #include 14943 14944 char * const * pam_getenvlist(pam_handle_t * pamh); 14945 14946 Description 14947 14948 pam_getenvlist() returns a pointer to the complete PAM 14949 environment. This pointer points to an array of pointers to 14950 NUL-terminated strings and must be terminated by a NULL 14951 pointer. Each string has the form "name=value". 14952 14953 The PAM library module allocates memory for the returned value 14954 and the associated strings. The calling application is 14955 responsible for freeing this memory. 14956 14957 Return Value 14958 14959 pam_getenvlist() returns an array of string pointers 14960 containing the PAM environment. On error, NULL is returned. 14961 14962 pam_open_session 14963 14964 Name 14965 14966 pam_open_session -- indicate session has started 14967 14968 Synopsis 14969 14970 #include 14971 14972 int pam_open_session(pam_handle_t * pamh, int flags); 14973 14974 Description 14975 14976 The pam_open_session() function is used to indicate that an 14977 authenticated session has begun, after the user has been 14978 identified (see pam_authenticate()) and, if necessary, granted 14979 credentials (see pam_setcred()). It is used to inform the 14980 module that the user is currently in a session. It should be 14981 possible for the PAM library to open a session and close the 14982 same session from different applications. 14983 14984 flags may have the value PAM_SILENT to indicate that no output 14985 be generated as a result of this function call. 14986 14987 Return Value 14988 14989 PAM_SUCCESS 14990 14991 Success. 14992 PAM_SESSION_ERR 14993 14994 One of the loaded modules was unable to open a session for the 14995 user. 14996 14997 Note: Errors may be translated to text with pam_strerror(). 14998 14999 pam_set_item 15000 15001 Name 15002 15003 pam_set_item -- (re)set the value of an item. 15004 15005 Synopsis 15006 15007 #include 15008 15009 int pam_set_item(pam_handle_t * pamh, int item_type, const 15010 void * item); 15011 15012 Description 15013 15014 pam_set_item() (re)sets the value of one of the following 15015 item_types: 15016 15017 PAM_SERVICE 15018 15019 service name 15020 PAM_USER 15021 15022 user name 15023 PAM_TTY 15024 15025 terminal name 15026 15027 The value for a device file should include the /dev/ prefix. 15028 The value for graphical, X-based, applications should be the 15029 $DISPLAY variable. 15030 PAM_RHOST 15031 15032 remote host name 15033 PAM_CONV 15034 15035 conversation structure 15036 PAM_RUSER 15037 15038 remote user name 15039 PAM_USER_PROMPT 15040 15041 string to be used when prompting for a user's name 15042 15043 The default value for this string is Please enter username: . 15044 15045 For all item_types other than PAM_CONV, item is a pointer to a 15046 NULL-terminated character string. In the case of PAM_CONV, 15047 item points to an initialized pam_conv structure. 15048 15049 Return Value 15050 15051 PAM_SUCCESS 15052 15053 Success. 15054 PAM_PERM_DENIED 15055 15056 An attempt was made to replace the conversation structure with 15057 a NULL value. 15058 PAM_BUF_ERR 15059 15060 Function ran out of memory making a copy of the item. 15061 PAM_BAD_ITEM 15062 15063 Application attempted to set an undefined item. 15064 15065 Note: Errors may be translated to text with pam_strerror(). 15066 15067 pam_setcred 15068 15069 Name 15070 15071 pam_setcred -- set the module-specific credentials of the user 15072 15073 Synopsis 15074 15075 #include 15076 15077 extern int pam_setcred(pam_handle_t * pamh, int flags); 15078 15079 Description 15080 15081 pam_setcred() sets the module-specific credentials of the 15082 user. It is usually called after the user has been 15083 authenticated, after the account management function has been 15084 called and after a session has been opened for the user. 15085 15086 flags maybe specified from among the following values: 15087 15088 PAM_ESTABLISH_CRED 15089 set credentials for the authentication service 15090 15091 PAM_DELETE_CRED 15092 delete credentials associated with the authentication 15093 service 15094 15095 PAM_REINITIALIZE_CRED 15096 reinitialize the user credentials 15097 15098 PAM_REFRESH_CRED 15099 extend lifetime of the user credentials 15100 15101 Additionally, the value of flags may be logically or'd with 15102 PAM_SILENT. 15103 15104 Return Value 15105 15106 PAM_SUCCESS 15107 15108 Success. 15109 PAM_CRED_UNAVAIL 15110 15111 Module cannot retrieve the user's credentials. 15112 PAM_CRED_EXPIRED 15113 15114 User's credentials have expired. 15115 PAM_USER_UNKNOWN 15116 15117 User is not known to an authentication module. 15118 PAM_CRED_ERR 15119 15120 Module was unable to set the credentials of the user. 15121 15122 Note: Errors may be translated to text with pam_strerror(). 15123 15124 pam_start 15125 15126 Name 15127 15128 pam_start -- initialize the PAM library 15129 15130 Synopsis 15131 15132 #include 15133 15134 int pam_start(const char * service_name, const char * user, 15135 const struct pam_conv * pam_conversation, pam_handle_t * * 15136 pamh); 15137 15138 Description 15139 15140 pam_start() is used to initialize the PAM library. It must be 15141 called prior to any other usage of the PAM library. On 15142 success, *pamh becomes a handle that provides continuity for 15143 successive calls to the PAM library. pam_start() expects 15144 arguments as follows: the service_name of the program, the 15145 username of the individual to be authenticated, a pointer to 15146 an application-supplied pam_conv structure, and a pointer to a 15147 pam_handle_t pointer. 15148 15149 An application must provide the conversation function used for 15150 direct communication between a loaded module and the 15151 application. The application also typically provides a means 15152 for the module to prompt the user for a password, etc. 15153 15154 The structure, pam_conv, is defined to be, 15155 struct pam_conv { 15156 int (*conv) (int num_msg, 15157 const struct pam_message * *msg, 15158 struct pam_response * *resp, 15159 void *appdata_ptr); 15160 void *appdata_ptr; 15161 }; 15162 15163 It is initialized by the application before it is passed to 15164 the library. The contents of this structure are attached to 15165 the *pamh handle. The point of this argument is to provide a 15166 mechanism for any loaded module to interact directly with the 15167 application program; this is why it is called a conversation 15168 structure. 15169 15170 When a module calls the referenced conv() function, 15171 appdata_ptr is set to the second element of this structure. 15172 15173 The other arguments of a call to conv() concern the 15174 information exchanged by module and application. num_msg holds 15175 the length of the array of pointers passed via msg. On 15176 success, the pointer resp points to an array of num_msg 15177 pam_response structures, holding the application-supplied 15178 text. Note that resp is a struct pam_response array and not an 15179 array of pointers. 15180 15181 Return Value 15182 15183 PAM_SUCCESS 15184 15185 Success. 15186 PAM_BUF_ERR 15187 15188 Memory allocation error. 15189 PAM_ABORT 15190 15191 Internal failure. 15192 15193 ERRORS 15194 15195 May be translated to text with pam_strerror(). 15196 15197 pam_strerror 15198 15199 Name 15200 15201 pam_strerror -- returns a string describing the PAM error 15202 15203 Synopsis 15204 15205 #include 15206 15207 const char * pam_strerror(pam_handle_t * pamh, int errnum); 15208 15209 Description 15210 15211 pam_strerror() returns a string describing the PAM error 15212 associated with errnum. 15213 15214 Return Value 15215 15216 On success, this function returns a description of the 15217 indicated error. The application should not free or modify 15218 this string. Otherwise, a string indicating that the error is 15219 unknown shall be returned. It is unspecified whether or not 15220 the string returned is translated according to the setting of 15221 LC_MESSAGES. 15222 15223 IV. Utility Libraries 15224 15225 Table of Contents 15226 14. Utility Libraries 15227 15228 14.1. Introduction 15229 14.2. Interfaces for libz 15230 15231 14.2.1. Compression Library 15232 15233 14.3. Data Definitions for libz 15234 15235 14.3.1. zlib.h 15236 15237 14.4. Interface Definitions for libz 15238 15239 adler32 -- compute Adler 32 Checksum 15240 compress -- compress data 15241 compress2 -- compress data at a specified level 15242 compressBound -- compute compressed data size 15243 crc32 -- compute CRC-32 Checksum 15244 deflate -- compress data 15245 deflateBound -- compute compressed data size 15246 deflateCopy -- copy compression stream 15247 deflateEnd -- free compression stream state 15248 deflateInit2_ -- initialize compression system 15249 deflateInit_ -- initialize compression system 15250 deflateParams -- set compression parameters 15251 deflateReset -- reset compression stream state 15252 deflateSetDictionary -- initialize compression 15253 dictionary 15254 15255 get_crc_table -- generate a table for crc 15256 calculations 15257 15258 gzclose -- close a compressed file stream 15259 gzdopen -- open a compressed file 15260 gzeof -- check for end-of-file on a compressed file 15261 stream 15262 15263 gzerror -- decode an error on a compressed file 15264 stream 15265 15266 gzflush -- flush a compressed file stream 15267 gzgetc -- read a character from a compressed file 15268 gzgets -- read a string from a compressed file 15269 gzopen -- open a compressed file 15270 gzprintf -- format data and compress 15271 gzputc -- write character to a compressed file 15272 gzputs -- string write to a compressed file 15273 gzread -- read from a compressed file 15274 gzrewind -- reset the file-position indicator on a 15275 compressed file stream 15276 15277 gzseek -- reposition a file-position indicator in a 15278 compressed file stream 15279 15280 gzsetparams -- dynamically set compression 15281 parameters 15282 15283 gztell -- find position on a compressed file stream 15284 gzwrite -- write to a compressed file 15285 inflate -- decompress data 15286 inflateEnd -- free decompression stream state 15287 inflateInit2_ -- initialize decompression system 15288 inflateInit_ -- initialize decompression system 15289 inflateReset -- reset decompression stream state 15290 inflateSetDictionary -- initialize decompression 15291 dictionary 15292 15293 inflateSync -- advance compression stream to next 15294 sync point 15295 15296 inflateSyncPoint -- test for synchronization point 15297 uncompress -- uncompress data 15298 zError -- translate error number to string 15299 zlibVersion -- discover library version at run time 15300 15301 14.5. Interfaces for libncurses 15302 15303 14.5.1. Curses 15304 15305 14.6. Data Definitions for libncurses 15306 15307 14.6.1. curses.h 15308 14.6.2. term.h 15309 15310 14.7. Interfaces for libutil 15311 15312 14.7.1. Utility Functions 15313 15314 14.8. Interface Definitions for libutil 15315 15316 forkpty -- Create a new process attached to an 15317 available pseudo-terminal 15318 15319 login -- login utility function 15320 login_tty -- Prepare a terminal for login 15321 logout -- logout utility function 15322 logwtmp -- append an entry to the wtmp file 15323 openpty -- find and open an available 15324 pseudo-terminal 15325 _________________________________________________________ 15326 15327 Chapter 14. Utility Libraries 15328 15329 14.1. Introduction 15330 15331 An LSB-conforming implementation shall also support the 15332 following utility libraries which are built on top of the 15333 interfaces provided by the base libraries. These libraries 15334 implement common functionality, and hide additional system 15335 dependent information such as file formats and device names. 15336 15337 * libz 15338 * libcurses 15339 * libutil 15340 15341 The structure of the definitions for these libraries follows 15342 the same model as used for Base Libraries. 15343 _________________________________________________________ 15344 15345 14.2. Interfaces for libz 15346 15347 Table 14-1 defines the library name and shared object name for 15348 the libz library 15349 15350 Table 14-1. libz Definition 15351 Library: libz 15352 SONAME: libz.so.1 15353 15354 The behavior of the interfaces in this library is specified by 15355 the following specifications: 15356 15357 [LSB] This Specification 15358 _________________________________________________________ 15359 15360 14.2.1. Compression Library 15361 _________________________________________________________ 15362 15363 14.2.1.1. Interfaces for Compression Library 15364 15365 An LSB conforming implementation shall provide the generic 15366 functions for Compression Library specified in Table 14-2, 15367 with the full mandatory functionality as described in the 15368 referenced underlying specification. 15369 15370 Table 14-2. libz - Compression Library Function Interfaces 15371 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 15372 [LSB] 15373 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 15374 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 15375 deflateParams [LSB] 15376 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 15377 [LSB] gzclose [LSB] 15378 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 15379 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 15380 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 15381 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 15382 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] 15383 inflateInit_ [LSB] 15384 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync 15385 [LSB] inflateSyncPoint [LSB] 15386 uncompress [LSB] zError [LSB] zlibVersion [LSB] 15387 _________________________________________________________ 15388 15389 14.3. Data Definitions for libz 15390 15391 This section defines global identifiers and their values that 15392 are associated with interfaces contained in libz. These 15393 definitions are organized into groups that correspond to 15394 system headers. This convention is used as a convenience for 15395 the reader, and does not imply the existence of these headers, 15396 or their content. Where an interface is defined as requiring a 15397 particular system header file all of the data definitions for 15398 that system header file presented here shall be in effect. 15399 15400 This section gives data definitions to promote binary 15401 application portability, not to repeat source interface 15402 definitions available elsewhere. System providers and 15403 application developers should use this ABI to supplement - not 15404 to replace - source interface definition specifications. 15405 15406 This specification uses the ISO C (1999) C Language as the 15407 reference programming language, and data definitions are 15408 specified in ISO C format. The C language is used here as a 15409 convenient notation. Using a C language description of these 15410 data objects does not preclude their use by other programming 15411 languages. 15412 _________________________________________________________ 15413 15414 14.3.1. zlib.h 15415 15416 In addition to the values below, the zlib.h header shall 15417 define the ZLIB_VERSION macro. This macro may be used to check 15418 that the version of the library at run time matches that at 15419 compile time. 15420 15421 See also the zlibVersion() function, which returns the library 15422 version at run time. The first character of the version at 15423 compile time should always match the first character at run 15424 time. 15425 #define Z_NULL 0 15426 #define MAX_WBITS 15 15427 #define MAX_MEM_LEVEL 9 15428 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) 15429 \ 15430 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 15431 #define deflateInit(strm,level) \ 15432 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 15433 #define inflateInit2(strm,windowBits) \ 15434 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 15435 #define inflateInit(strm) \ 15436 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 15437 15438 typedef char charf; 15439 typedef int intf; 15440 15441 typedef void *voidpf; 15442 typedef unsigned int uInt; 15443 typedef unsigned long int uLong; 15444 typedef uLong uLongf; 15445 typedef void *voidp; 15446 typedef unsigned char Byte; 15447 typedef off_t z_off_t; 15448 typedef void *const voidpc; 15449 15450 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 15451 typedef void (*free_func) (voidpf opaque, voidpf address); 15452 struct internal_state { 15453 int dummy; 15454 }; 15455 typedef Byte Bytef; 15456 typedef uInt uIntf; 15457 15458 typedef struct z_stream_s { 15459 Bytef *next_in; 15460 uInt avail_in; 15461 uLong total_in; 15462 Bytef *next_out; 15463 uInt avail_out; 15464 uLong total_out; 15465 char *msg; 15466 struct internal_state *state; 15467 alloc_func zalloc; 15468 free_func zfree; 15469 voidpf opaque; 15470 int data_type; 15471 uLong adler; 15472 uLong reserved; 15473 } z_stream; 15474 15475 typedef z_stream *z_streamp; 15476 typedef voidp gzFile; 15477 15478 #define Z_NO_FLUSH 0 15479 #define Z_PARTIAL_FLUSH 1 15480 #define Z_SYNC_FLUSH 2 15481 #define Z_FULL_FLUSH 3 15482 #define Z_FINISH 4 15483 #define Z_BLOCK 5 15484 15485 #define Z_ERRNO (-1) 15486 #define Z_STREAM_ERROR (-2) 15487 #define Z_DATA_ERROR (-3) 15488 #define Z_MEM_ERROR (-4) 15489 #define Z_BUF_ERROR (-5) 15490 #define Z_VERSION_ERROR (-6) 15491 #define Z_OK 0 15492 #define Z_STREAM_END 1 15493 #define Z_NEED_DICT 2 15494 15495 #define Z_DEFAULT_COMPRESSION (-1) 15496 #define Z_NO_COMPRESSION 0 15497 #define Z_BEST_SPEED 1 15498 #define Z_BEST_COMPRESSION 9 15499 15500 #define Z_DEFAULT_STRATEGY 0 15501 #define Z_FILTERED 1 15502 #define Z_HUFFMAN_ONLY 2 15503 15504 #define Z_BINARY 0 15505 #define Z_ASCII 1 15506 #define Z_UNKNOWN 2 15507 15508 #define Z_DEFLATED 8 15509 15510 extern int gzread(gzFile, voidp, unsigned int); 15511 extern int gzclose(gzFile); 15512 extern gzFile gzopen(const char *, const char *); 15513 extern gzFile gzdopen(int, const char *); 15514 extern int gzwrite(gzFile, voidpc, unsigned int); 15515 extern int gzflush(gzFile, int); 15516 extern const char *gzerror(gzFile, int *); 15517 extern uLong adler32(uLong, const Bytef *, uInt); 15518 extern int compress(Bytef *, uLongf *, const Bytef *, uLong); 15519 extern int compress2(Bytef *, uLongf *, const Bytef *, uLong, int); 15520 extern uLong crc32(uLong, const Bytef *, uInt); 15521 extern int deflate(z_streamp, int); 15522 extern int deflateCopy(z_streamp, z_streamp); 15523 extern int deflateEnd(z_streamp); 15524 extern int deflateInit2_(z_streamp, int, int, int, int, int, const char *, 15525 int); 15526 extern int deflateInit_(z_streamp, int, const char *, int); 15527 extern int deflateParams(z_streamp, int, int); 15528 extern int deflateReset(z_streamp); 15529 extern int deflateSetDictionary(z_streamp, const Bytef *, uInt); 15530 extern const uLongf *get_crc_table(void); 15531 extern int gzeof(gzFile); 15532 extern int gzgetc(gzFile); 15533 extern char *gzgets(gzFile, char *, int); 15534 extern int gzprintf(gzFile, const char *, ...); 15535 extern int gzputc(gzFile, int); 15536 extern int gzputs(gzFile, const char *); 15537 extern int gzrewind(gzFile); 15538 extern z_off_t gzseek(gzFile, z_off_t, int); 15539 extern int gzsetparams(gzFile, int, int); 15540 extern z_off_t gztell(gzFile); 15541 extern int inflate(z_streamp, int); 15542 extern int inflateEnd(z_streamp); 15543 extern int inflateInit2_(z_streamp, int, const char *, int); 15544 extern int inflateInit_(z_streamp, const char *, int); 15545 extern int inflateReset(z_streamp); 15546 extern int inflateSetDictionary(z_streamp, const Bytef *, uInt); 15547 extern int inflateSync(z_streamp); 15548 extern int inflateSyncPoint(z_streamp); 15549 extern int uncompress(Bytef *, uLongf *, const Bytef *, uLong); 15550 extern const char *zError(int); 15551 extern const char *zlibVersion(void); 15552 extern uLong deflateBound(z_streamp, uLong); 15553 extern uLong compressBound(uLong); 15554 _________________________________________________________ 15555 15556 14.4. Interface Definitions for libz 15557 15558 Table of Contents 15559 adler32 -- compute Adler 32 Checksum 15560 compress -- compress data 15561 compress2 -- compress data at a specified level 15562 compressBound -- compute compressed data size 15563 crc32 -- compute CRC-32 Checksum 15564 deflate -- compress data 15565 deflateBound -- compute compressed data size 15566 deflateCopy -- copy compression stream 15567 deflateEnd -- free compression stream state 15568 deflateInit2_ -- initialize compression system 15569 deflateInit_ -- initialize compression system 15570 deflateParams -- set compression parameters 15571 deflateReset -- reset compression stream state 15572 deflateSetDictionary -- initialize compression dictionary 15573 get_crc_table -- generate a table for crc calculations 15574 gzclose -- close a compressed file stream 15575 gzdopen -- open a compressed file 15576 gzeof -- check for end-of-file on a compressed file stream 15577 gzerror -- decode an error on a compressed file stream 15578 gzflush -- flush a compressed file stream 15579 gzgetc -- read a character from a compressed file 15580 gzgets -- read a string from a compressed file 15581 gzopen -- open a compressed file 15582 gzprintf -- format data and compress 15583 gzputc -- write character to a compressed file 15584 gzputs -- string write to a compressed file 15585 gzread -- read from a compressed file 15586 gzrewind -- reset the file-position indicator on a compressed 15587 file stream 15588 15589 gzseek -- reposition a file-position indicator in a compressed 15590 file stream 15591 15592 gzsetparams -- dynamically set compression parameters 15593 gztell -- find position on a compressed file stream 15594 gzwrite -- write to a compressed file 15595 inflate -- decompress data 15596 inflateEnd -- free decompression stream state 15597 inflateInit2_ -- initialize decompression system 15598 inflateInit_ -- initialize decompression system 15599 inflateReset -- reset decompression stream state 15600 inflateSetDictionary -- initialize decompression dictionary 15601 inflateSync -- advance compression stream to next sync point 15602 inflateSyncPoint -- test for synchronization point 15603 uncompress -- uncompress data 15604 zError -- translate error number to string 15605 zlibVersion -- discover library version at run time 15606 15607 The interfaces defined on the following pages are included in 15608 libz and are defined by this specification. Unless otherwise 15609 noted, these interfaces shall be included in the source 15610 standard. 15611 15612 Other interfaces listed in Section 14.2 shall behave as 15613 described in the referenced base document. 15614 15615 adler32 15616 15617 Name 15618 15619 adler32 -- compute Adler 32 Checksum 15620 15621 Synopsis 15622 15623 #include 15624 15625 uLong adler32(uLong adler, const Bytef * buf, uInt len); 15626 15627 Description 15628 15629 The adler32() function shall compute a running Adler-32 15630 checksum (as described in RFC 1950: ZLIB Compressed Data 15631 Format Specication). On entry, adler is the previous value for 15632 the checksum, and buf shall point to an array of len bytes of 15633 data to be added to this checksum. The adler32() function 15634 shall return the new checksum. 15635 15636 If buf is NULL (or Z_NULL), adler32() shall return the initial 15637 checksum. 15638 15639 Return Value 15640 15641 The adler32() function shall return the new checksum value. 15642 15643 Errors 15644 15645 None defined. 15646 15647 Application Usage (informative) 15648 15649 The following code fragment demonstrates typical usage of the 15650 adler32() function: 15651 uLong adler = adler32(0L, Z_NULL, 0); 15652 15653 while (read_buffer(buffer, length) != EOF) { 15654 adler = adler32(adler, buffer, length); 15655 } 15656 if (adler != original_adler) error(); 15657 15658 compress 15659 15660 Name 15661 15662 compress -- compress data 15663 15664 Synopsis 15665 15666 #include 15667 15668 int compress(Bytef * dest, uLongf * destLen, const Bytef * 15669 source, uLong sourceLen); 15670 15671 Description 15672 15673 The compress() function shall attempt to compress sourceLen 15674 bytes of data in the buffer source, placing the result in the 15675 buffer dest. 15676 15677 On entry, destLen should point to a value describing the size 15678 of the dest buffer. The application should ensure that this 15679 value be at least (sourceLen × 1.001) + 12. On successful 15680 exit, the variable referenced by destLen shall be updated to 15681 hold the length of compressed data in dest. 15682 15683 The compress() function is equivalent to compress2() with a 15684 level of Z_DEFAULT_COMPRESSION. 15685 15686 Return Value 15687 15688 On success, compress() shall return Z_OK. Otherwise, 15689 compress() shall return a value to indicate the error. 15690 15691 Errors 15692 15693 On error, compress() shall return a value as described below: 15694 15695 Z_BUF_ERROR 15696 15697 The buffer dest was not large enough to hold the compressed 15698 data. 15699 Z_MEM_ERROR 15700 15701 Insufficient memory. 15702 15703 compress2 15704 15705 Name 15706 15707 compress2 -- compress data at a specified level 15708 15709 Synopsis 15710 15711 #include 15712 15713 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 15714 source, uLong sourceLen, int level); 15715 15716 Description 15717 15718 The compress2() function shall attempt to compress sourceLen 15719 bytes of data in the buffer source, placing the result in the 15720 buffer dest, at the level described by level. The level 15721 supplied shall be a value between 0 and 9, or the value 15722 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 15723 speed, while a level of 9 requests the highest compression. A 15724 level of 0 indicates that no compression should be used, and 15725 the output shall be the same as the input. 15726 15727 On entry, destLen should point to a value describing the size 15728 of the dest buffer. The application should ensure that this 15729 value be at least (sourceLen × 1.001) + 12. On successful 15730 exit, the variable referenced by destLen shall be updated to 15731 hold the length of compressed data in dest. 15732 15733 The compress() function is equivalent to compress2() with a 15734 level of Z_DEFAULT_COMPRESSION. 15735 15736 Return Value 15737 15738 On success, compress2() shall return Z_OK. Otherwise, 15739 compress2() shall return a value to indicate the error. 15740 15741 Errors 15742 15743 On error, compress2() shall return a value as described below: 15744 15745 Z_BUF_ERROR 15746 15747 The buffer dest was not large enough to hold the compressed 15748 data. 15749 Z_MEM_ERROR 15750 15751 Insufficient memory. 15752 Z_STREAM_ERROR 15753 15754 The level was not Z_DEFAULT_COMPRESSION, or was not between 0 15755 and 9. 15756 15757 compressBound 15758 15759 Name 15760 15761 compressBound -- compute compressed data size 15762 15763 Synopsis 15764 15765 #include 15766 15767 int compressBound(uLong sourceLen); 15768 15769 Description 15770 15771 The compressBound() function shall estimate the size of buffer 15772 required to compress sourceLen bytes of data using the 15773 compress() or compress2() functions. If successful, the value 15774 returned shall be an upper bound for the size of buffer 15775 required to compress sourceLen bytes of data, using the 15776 parameters stored in stream, in a single call to compress() or 15777 compress2(). 15778 15779 Return Value 15780 15781 The compressBound() shall return a value representing the 15782 upper bound of an array to allocate to hold the compressed 15783 data in a single call to compress() or compress2(). This 15784 function may return a conservative value that may be larger 15785 than sourceLen. 15786 15787 Errors 15788 15789 None defined. 15790 15791 crc32 15792 15793 Name 15794 15795 crc32 -- compute CRC-32 Checksum 15796 15797 Synopsis 15798 15799 #include 15800 15801 uLong crc32(uLong crc, const Bytef * buf, uInt len); 15802 15803 Description 15804 15805 The crc32() function shall compute a running Cyclic Redundancy 15806 Check checksum, as defined in ITU-T V.42. On entry, crc is the 15807 previous value for the checksum, and buf shall point to an 15808 array of len bytes of data to be added to this checksum. The 15809 crc32() function shall return the new checksum. 15810 15811 If buf is NULL (or Z_NULL), crc32() shall return the initial 15812 checksum. 15813 15814 Return Value 15815 15816 The crc32() function shall return the new checksum value. 15817 15818 Errors 15819 15820 None defined. 15821 15822 Application Usage (informative) 15823 15824 The following code fragment demonstrates typical usage of the 15825 crc32() function: 15826 uLong crc = crc32(0L, Z_NULL, 0); 15827 15828 while (read_buffer(buffer, length) != EOF) { 15829 crc = crc32(crc, buffer, length); 15830 } 15831 if (crc != original_crc) error(); 15832 15833 deflate 15834 15835 Name 15836 15837 deflate -- compress data 15838 15839 Synopsis 15840 15841 #include 15842 15843 int deflate(z_streamp stream, int flush); 15844 15845 Description 15846 15847 The deflate() function shall attempt to compress data until 15848 either the input buffer is empty or the output buffer is full. 15849 The stream references a z_stream structure. Before the first 15850 call to deflate(), this structure should have been initialized 15851 by a call to deflateInit2_(). 15852 15853 Note: deflateInit2_() is only in the binary standard; 15854 source level applications should initialize stream via a 15855 call to deflateInit() or deflateInit2(). 15856 15857 In addition, the stream input and output buffers should have 15858 been initialized as follows: 15859 15860 next_in 15861 15862 should point to the data to be compressed. 15863 avail_in 15864 15865 should contain the number of bytes of data in the buffer 15866 referenced by next_in. 15867 next_out 15868 15869 should point to a buffer where compressed data may be placed. 15870 avail_out 15871 15872 should contain the size in bytes of the buffer referenced by 15873 next_out 15874 15875 The deflate() function shall perform one or both of the 15876 following actions: 15877 15878 1. Compress input data from next_in and update next_in, 15879 avail_in and total_in to reflect the data that has been 15880 compressed. 15881 2. Fill the output buffer referenced by next_out, and update 15882 next_out, avail_out and total_out to reflect the 15883 compressed data that has been placed there. If flush is 15884 not Z_NO_FLUSH, and avail_out indicates that there is 15885 still space in output buffer, this action shall always 15886 occur (see below for further details). 15887 15888 The deflate() function shall return when either avail_in 15889 reaches zero (indicating that all the input data has been 15890 compressed), or avail_out reaches zero (indicating that the 15891 output buffer is full). 15892 15893 On success, the deflate() function shall set the adler field 15894 of the stream to the adler32() checksum of all the input data 15895 compressed so far (represented by total_in). 15896 15897 If the deflate() function shall attempt to determine the type 15898 of input data, and set field data_type in stream to Z_ASCII if 15899 the majority of the data bytes fall within the ASCII (ISO 646) 15900 printable character range. Otherwise, it shall set data_type 15901 to Z_BINARY. This data type is informational only, and does 15902 not affect the compression algorithm. 15903 15904 Note: Future versions of the LSB may remove this 15905 requirement, since it is based on an outdated character set 15906 that does not support Internationalization, and does not 15907 affect the algorithm. It is included for information only 15908 at this release. Applications should not depend on this 15909 field. 15910 15911 Flush Operation 15912 15913 The parameter flush determines when compressed bits are added 15914 to the output buffer in next_out. If flush is Z_NO_FLUSH, 15915 deflate() may return with some data pending output, and not 15916 yet added to the output buffer. 15917 15918 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 15919 output to next_out and align the output to a byte boundary. A 15920 synchronization point is generated in the output. 15921 15922 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 15923 Z_SYNC_FLUSH, and the compression state shall be reset. A 15924 synchronization point is generated in the output. 15925 15926 Rationale: Z_SYNC_FLUSH is intended to ensure that the 15927 compressed data contains all the data compressed so far, 15928 and allows a decompressor to reconstruct all of the input 15929 data. Z_FULL_FLUSH allows decompression to restart from 15930 this point if the previous compressed data has been lost or 15931 damaged. Flushing is likely to degrade the performance of 15932 the compression system, and should only be used where 15933 necessary. 15934 15935 If flush is set to Z_FINISH, all pending input shall be 15936 processed and deflate() shall return with Z_STREAM_END if 15937 there is sufficient space in the output buffer at next_out, as 15938 indicated by avail_out. If deflate() is called with flush set 15939 to Z_FINISH and there is insufficient space to store the 15940 compressed data, and no other error has occurred during 15941 compression, deflate() shall return Z_OK, and the application 15942 should call deflate() again with flush unchanged, and having 15943 updated next_out and avail_out. 15944 15945 If all the compression is to be done in a single step, 15946 deflate() may be called with flush set to Z_FINISH immediately 15947 after the stream has been initialized if avail_out is set to 15948 at least the value returned by deflateBound(). 15949 15950 Return Value 15951 15952 On success, deflate() shall return Z_OK, unless flush was set 15953 to Z_FINISH and there was sufficient space in the output 15954 buffer to compress all of the input data. In this case, 15955 deflate() shall return Z_STREAM_END. On error, deflate() shall 15956 return a value to indicate the error. 15957 15958 Note: If deflate() returns Z_OK and has set avail_out to 15959 zero, the function should be called again with the same 15960 value for flush, and with updated next_out and avail_out 15961 until deflate() returns with Z_OK (or Z_STREAM_END if flush 15962 is set to Z_FINISH) and a non-zero avail_out. 15963 15964 Errors 15965 15966 On error, deflate() shall return a value as described below, 15967 and set the msg field of stream to point to a string 15968 describing the error: 15969 15970 Z_BUF_ERROR 15971 15972 No progress is possible; either avail_in or avail_out was 15973 zero. 15974 Z_MEM_ERROR 15975 15976 Insufficient memory. 15977 Z_STREAM_ERROR 15978 15979 The state (as represented in stream) is inconsistent, or 15980 stream was NULL. 15981 15982 deflateBound 15983 15984 Name 15985 15986 deflateBound -- compute compressed data size 15987 15988 Synopsis 15989 15990 #include 15991 15992 int deflateBound(z_streamp stream, uLong sourceLen); 15993 15994 Description 15995 15996 The deflateBound() function shall estimate the size of buffer 15997 required to compress sourceLen bytes of data. If successful, 15998 the value returned shall be an upper bound for the size of 15999 buffer required to compress sourceLen bytes of data, using the 16000 parameters stored in stream, in a single call to deflate() 16001 with flush set to Z_FINISH. 16002 16003 On entry, stream should have been initialized via a call to 16004 deflateInit_() or deflateInit2_(). 16005 16006 Return Value 16007 16008 The deflateBound() shall return a value representing the upper 16009 bound of an array to allocate to hold the compressed data in a 16010 single call to deflate(). If the stream is not correctly 16011 initialized, or is NULL, then deflateBound() may return a 16012 conservative value that may be larger than sourceLen. 16013 16014 Errors 16015 16016 None defined. 16017 16018 deflateCopy 16019 16020 Name 16021 16022 deflateCopy -- copy compression stream 16023 16024 Synopsis 16025 16026 #include 16027 16028 int deflateCopy(z_streamp dest, z_streamp source); 16029 16030 Description 16031 16032 The deflateCopy() function shall copy the compression state 16033 information in source to the uninitialized z_stream structure 16034 referenced by dest. 16035 16036 On successful return, dest will be an exact copy of the stream 16037 referenced by source. The input and output buffer pointers in 16038 next_in and next_out will reference the same data. 16039 16040 Return Value 16041 16042 On success, deflateCopy() shall return Z_OK. Otherwise it 16043 shall return a value less than zero to indicate the error. 16044 16045 Errors 16046 16047 On error, deflateCopy() shall return a value as described 16048 below: 16049 16050 Z_STREAM_ERROR 16051 16052 The state in source is inconsistent, or either source or dest 16053 was NULL. 16054 Z_MEM_ERROR 16055 16056 Insufficient memory available. 16057 16058 Application Usage (informative) 16059 16060 This function can be useful when several compression 16061 strategies will be tried, for example when there are several 16062 ways of pre-processing the input data with a filter. The 16063 streams that will be discarded should then be freed by calling 16064 deflateEnd(). Note that deflateCopy() duplicates the internal 16065 compression state which can be quite large, so this strategy 16066 may be slow and can consume lots of memory. 16067 16068 deflateEnd 16069 16070 Name 16071 16072 deflateEnd -- free compression stream state 16073 16074 Synopsis 16075 16076 #include 16077 16078 int deflateEnd(z_streamp stream); 16079 16080 Description 16081 16082 The deflateEnd() function shall free all allocated state 16083 information referenced by stream. All pending output is 16084 discarded, and unprocessed input is ignored. 16085 16086 Return Value 16087 16088 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 16089 there was pending output discarded or input unprocessed. 16090 Otherwise it shall return Z_STREAM_ERROR to indicate the 16091 error. 16092 16093 Errors 16094 16095 On error, deflateEnd() shall return Z_STREAM_ERROR. The 16096 following conditions shall be treated as an error: 16097 16098 * The state in stream is inconsistent or inappropriate. 16099 * stream is NULL. 16100 16101 deflateInit2_ 16102 16103 Name 16104 16105 deflateInit2_ -- initialize compression system 16106 16107 Synopsis 16108 16109 #include 16110 16111 int deflateInit2_ (z_streamp strm, int level, int method, int 16112 windowBits, int memLevel, int strategy, char * version, int 16113 stream_size); 16114 16115 Description 16116 16117 The deflateInit2_() function shall initialize the compression 16118 system. On entry, strm shall refer to a user supplied z_stream 16119 object (a z_stream_s structure). The following fields shall be 16120 set on entry: 16121 16122 zalloc 16123 16124 a pointer to an alloc_func function, used to allocate state 16125 information. If this is NULL, a default allocation function 16126 will be used. 16127 zfree 16128 16129 a pointer to a free_func function, used to free memory 16130 allocated by the zalloc function. If this is NULL a default 16131 free function will be used. 16132 opaque 16133 16134 If alloc_func is not NULL, opaque is a user supplied pointer 16135 to data that will be passed to the alloc_func and free_func 16136 functions. 16137 16138 If the version requested is not compatible with the version 16139 implemented, or if the size of the z_stream_s structure 16140 provided in stream_size does not match the size in the library 16141 implementation, deflateInit2_() shall fail, and return 16142 Z_VERSION_ERROR. 16143 16144 The level supplied shall be a value between 0 and 9, or the 16145 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16146 speed, while a level of 9 requests the highest compression. A 16147 level of 0 indicates that no compression should be used, and 16148 the output shall be the same as the input. 16149 16150 The method selects the compression algorithm to use. LSB 16151 conforming implementation shall support the Z_DEFLATED method, 16152 and may support other implementation defined methods. 16153 16154 The windowBits parameter shall be a base 2 logarithm of the 16155 window size to use, and shall be a value between 8 and 15. A 16156 smaller value will use less memory, but will result in a 16157 poorer compression ratio, while a higher value will give 16158 better compression but utilize more memory. 16159 16160 The memLevel parameter specifies how much memory to use for 16161 the internal state. The value of memLevel shall be between 1 16162 and MAX_MEM_LEVEL. Smaller values use less memory but are 16163 slower, while higher values use more memory to gain 16164 compression speed. 16165 16166 The strategy parameter selects the compression strategy to 16167 use: 16168 16169 Z_DEFAULT_STRATEGY 16170 16171 use the system default compression strategy. 16172 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 16173 Z_FILTERED 16174 16175 use a compression strategy tuned for data consisting largely 16176 of small values with a fairly random distribution. Z_FILTERED 16177 uses more Huffman encoding and less string matching than 16178 Z_DEFAULT_STRATEGY. 16179 Z_HUFFMAN_ONLY 16180 16181 force Huffman encoding only, with no string match. 16182 16183 The deflateInit2_() function is not in the source standard; it 16184 is only in the binary standard. Source applications should use 16185 the deflateInit2() macro. 16186 16187 Return Value 16188 16189 On success, the deflateInit2_() function shall return Z_OK. 16190 Otherwise, deflateInit2_() shall return a value as described 16191 below to indicate the error. 16192 16193 Errors 16194 16195 On error, deflateInit2_() shall return one of the following 16196 error indicators: 16197 16198 Z_STREAM_ERROR 16199 16200 Invalid parameter. 16201 Z_MEM_ERROR 16202 16203 Insufficient memory available. 16204 Z_VERSION_ERROR 16205 16206 The version requested is not compatible with the library 16207 version, or the z_stream size differs from that used by the 16208 library. 16209 16210 In addition, the msg field of the strm may be set to an error 16211 message. 16212 16213 deflateInit_ 16214 16215 Name 16216 16217 deflateInit_ -- initialize compression system 16218 16219 Synopsis 16220 16221 #include 16222 16223 int deflateInit_(z_streamp stream, int level, const char * 16224 version, int stream_size); 16225 16226 Description 16227 16228 The deflateInit_() function shall initialize the compression 16229 system. On entry, stream shall refer to a user supplied 16230 z_stream object (a z_stream_s structure). The following fields 16231 shall be set on entry: 16232 16233 zalloc 16234 16235 a pointer to an alloc_func function, used to allocate state 16236 information. If this is NULL, a default allocation function 16237 will be used. 16238 zfree 16239 16240 a pointer to a free_func function, used to free memory 16241 allocated by the zalloc function. If this is NULL a default 16242 free function will be used. 16243 opaque 16244 16245 If alloc_func is not NULL, opaque is a user supplied pointer 16246 to data that will be passed to the alloc_func and free_func 16247 functions. 16248 16249 If the version requested is not compatible with the version 16250 implemented, or if the size of the z_stream_s structure 16251 provided in stream_size does not match the size in the library 16252 implementation, deflateInit_() shall fail, and return 16253 Z_VERSION_ERROR. 16254 16255 The level supplied shall be a value between 0 and 9, or the 16256 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16257 speed, while a level of 9 requests the highest compression. A 16258 level of 0 indicates that no compression should be used, and 16259 the output shall be the same as the input. 16260 16261 The deflateInit_() function is not in the source standard; it 16262 is only in the binary standard. Source applications should use 16263 the deflateInit() macro. 16264 16265 The deflateInit_() function is equivalent to 16266 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, MAX_MEM_LEVEL, 16267 Z_DEFAULT_STRATEGY, version, stream_size); 16268 16269 Return Value 16270 16271 On success, the deflateInit_() function shall return Z_OK. 16272 Otherwise, deflateInit_() shall return a value as described 16273 below to indicate the error. 16274 16275 Errors 16276 16277 On error, deflateInit_() shall return one of the following 16278 error indicators: 16279 16280 Z_STREAM_ERROR 16281 16282 Invalid parameter. 16283 Z_MEM_ERROR 16284 16285 Insufficient memory available. 16286 Z_VERSION_ERROR 16287 16288 The version requested is not compatible with the library 16289 version, or the z_stream size differs from that used by the 16290 library. 16291 16292 In addition, the msg field of the stream may be set to an 16293 error message. 16294 16295 deflateParams 16296 16297 Name 16298 16299 deflateParams -- set compression parameters 16300 16301 Synopsis 16302 16303 #include 16304 16305 int deflateParams(z_streamp stream, int level, int strategy); 16306 16307 Description 16308 16309 The deflateParams() function shall dynamically alter the 16310 compression parameters for the compression stream object 16311 stream. On entry, stream shall refer to a user supplied 16312 z_stream object (a z_stream_s structure), already initialized 16313 via a call to deflateInit_() or deflateInit2_(). 16314 16315 The level supplied shall be a value between 0 and 9, or the 16316 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 16317 speed, while a level of 9 requests the highest compression. A 16318 level of 0 indicates that no compression should be used, and 16319 the output shall be the same as the input. If the compression 16320 level is altered by deflateParams(), and some data has already 16321 been compressed with this stream (i.e. total_in is not zero), 16322 and the new level requires a different underlying compression 16323 method, then stream shall be flushed by a call to deflate(). 16324 16325 The strategy parameter selects the compression strategy to 16326 use: 16327 16328 Z_DEFAULT_STRATEGY 16329 16330 use the system default compression strategy. 16331 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 16332 Z_FILTERED 16333 16334 use a compression strategy tuned for data consisting largely 16335 of small values with a fairly random distribution. Z_FILTERED 16336 uses more Huffman encoding and less string matching than 16337 Z_DEFAULT_STRATEGY. 16338 Z_HUFFMAN_ONLY 16339 16340 force Huffman encoding only, with no string match. 16341 16342 Return Value 16343 16344 On success, the deflateParams() function shall return Z_OK. 16345 Otherwise, deflateParams() shall return a value as described 16346 below to indicate the error. 16347 16348 Errors 16349 16350 On error, deflateParams() shall return one of the following 16351 error indicators: 16352 16353 Z_STREAM_ERROR 16354 16355 Invalid parameter. 16356 Z_MEM_ERROR 16357 16358 Insufficient memory available. 16359 Z_BUF_ERROR 16360 16361 Insufficient space in stream to flush the current output. 16362 16363 In addition, the msg field of the strm may be set to an error 16364 message. 16365 16366 Application Usage (Informative) 16367 16368 Applications should ensure that the stream is flushed, e.g. by 16369 a call to deflate(stream, Z_SYNC_FLUSH) before calling 16370 deflateParams(), or ensure that there is sufficient space in 16371 next_out (as identified by avail_out) to ensure that all 16372 pending output and all uncompressed input can be flushed in a 16373 single call to deflate(). 16374 16375 Rationale: Although the deflateParams() function should 16376 flush pending output and compress all pending input, the 16377 result is unspecified if there is insufficient space in the 16378 output buffer. Applications should only call 16379 deflateParams() when the stream is effectively empty 16380 (flushed). 16381 16382 The deflateParams() can be used to switch between 16383 compression and straight copy of the input data, or to 16384 switch to a different kind of input data requiring a 16385 different strategy. 16386 16387 deflateReset 16388 16389 Name 16390 16391 deflateReset -- reset compression stream state 16392 16393 Synopsis 16394 16395 #include 16396 16397 int deflateReset(z_streamp stream); 16398 16399 Description 16400 16401 The deflateReset() function shall reset all state associated 16402 with stream. All pending output shall be discarded, and the 16403 counts of processed bytes (total_in and total_out) shall be 16404 reset to zero. 16405 16406 Return Value 16407 16408 On success, deflateReset() shall return Z_OK. Otherwise it 16409 shall return Z_STREAM_ERROR to indicate the error. 16410 16411 Errors 16412 16413 On error, deflateReset() shall return Z_STREAM_ERROR. The 16414 following conditions shall be treated as an error: 16415 16416 * The state in stream is inconsistent or inappropriate. 16417 * stream is NULL. 16418 16419 deflateSetDictionary 16420 16421 Name 16422 16423 deflateSetDictionary -- initialize compression dictionary 16424 16425 Synopsis 16426 16427 #include 16428 16429 int deflateSetDictionary(z_streamp stream, const Bytef * 16430 dictionary, uInt dictlen); 16431 16432 Description 16433 16434 The deflateSetDictionary() function shall initialize the 16435 compression dictionary associated with stream using the 16436 dictlen bytes referenced by dictionary. 16437 16438 The implementation may silently use a subset of the provided 16439 dictionary if the dictionary cannot fit in the current window 16440 associated with stream (see deflateInit2_()). The application 16441 should ensure that the dictionary is sorted such that the most 16442 commonly used strings occur at the end of the dictionary. 16443 16444 If the dictionary is successfully set, the Adler32 checksum of 16445 the entire provided dictionary shall be stored in the adler 16446 member of stream. This value may be used by the decompression 16447 system to select the correct dictionary. The compression and 16448 decompression systems must use the same dictionary. 16449 16450 stream shall reference an initialized compression stream, with 16451 total_in zero (i.e. no data has been compressed since the 16452 stream was initialized). 16453 16454 Return Value 16455 16456 On success, deflateSetDictionary() shall return Z_OK. 16457 Otherwise it shall return Z_STREAM_ERROR to indicate an error. 16458 16459 Errors 16460 16461 On error, deflateSetDictionary() shall return a value as 16462 described below: 16463 16464 Z_STREAM_ERROR 16465 16466 The state in stream is inconsistent, or stream was NULL. 16467 16468 Application Usage (informative) 16469 16470 The application should provide a dictionary consisting of 16471 strings {{{ed note: do we really mean "strings"? Null 16472 terminated?}}} that are likely to be encountered in the data 16473 to be compressed. The application should ensure that the 16474 dictionary is sorted such that the most commonly used strings 16475 occur at the end of the dictionary. 16476 16477 The use of a dictionary is optional; however if the data to be 16478 compressed is relatively short and has a predictable 16479 structure, the use of a dictionary can substantially improve 16480 the compression ratio. 16481 16482 get_crc_table 16483 16484 Name 16485 16486 get_crc_table -- generate a table for crc calculations 16487 16488 Synopsis 16489 16490 #include 16491 16492 const uLongf * get_crc_table(void); 16493 16494 Description 16495 16496 Generate tables for a byte-wise 32-bit CRC calculation based 16497 on the polynomial: 16498 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+ 16499 1 16500 16501 In a multi-threaded application, get_crc_table() should be 16502 called by one thread to initialize the tables before any other 16503 thread calls any libz function. 16504 16505 Return Value 16506 16507 The get_crc_table() function shall return a pointer to the 16508 first of a set of tables used internally to calculate CRC-32 16509 values (see crc32()). 16510 16511 Errors 16512 16513 None defined. 16514 16515 gzclose 16516 16517 Name 16518 16519 gzclose -- close a compressed file stream 16520 16521 Synopsis 16522 16523 #include 16524 16525 int gzclose (gzFile file ); 16526 16527 Description 16528 16529 The gzclose() function shall close the compressed file stream 16530 file. If file was open for writing, gzclose() shall first 16531 flush any pending output. Any state information allocated 16532 shall be freed. 16533 16534 Return Value 16535 16536 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 16537 shall return an error value as described below. 16538 16539 Errors 16540 16541 On error, gzclose() may set the global variable errno to 16542 indicate the error. The gzclose() shall return a value other 16543 than Z_OK on error. 16544 16545 Z_STREAM_ERROR 16546 16547 file was NULL (or Z_NULL), or did not refer to an open 16548 compressed file stream. 16549 Z_ERRNO 16550 16551 An error occurred in the underlying base libraries, and the 16552 application should check errno for further information. 16553 Z_BUF_ERROR 16554 16555 no compression progress is possible during buffer flush (see 16556 deflate()). 16557 16558 gzdopen 16559 16560 Name 16561 16562 gzdopen -- open a compressed file 16563 16564 Synopsis 16565 16566 #include 16567 16568 gzFile gzdopen ( int fd, const char *mode ); 16569 16570 Description 16571 16572 The gzdopen() function shall attempt to associate the open 16573 file referenced by fd with a gzFile object. The mode argument 16574 is based on that of fopen(), but the mode parameter may also 16575 contain the following characters: 16576 16577 digit 16578 16579 set the compression level to digit. A low value (e.g. 1) means 16580 high speed, while a high value (e.g. 9) means high 16581 compression. A compression level of 0 (zero) means no 16582 compression. See deflateInit2_() for further details. 16583 [fhR] 16584 16585 set the compression strategy to [fhR]. The letter f 16586 corresponds to filtered data, the letter h corresponds to 16587 Huffman only compression, and the letter R corresponds to Run 16588 Length Encoding. See deflateInit2_() for further details. 16589 16590 If fd refers to an uncompressed file, and mode refers to a 16591 read mode, gzdopen() shall attempt to open the file and return 16592 a gzFile object suitable for reading directly from the file 16593 without any decompression. 16594 16595 If mode is NULL, or if mode does not contain one of r, w, or 16596 a, gzdopen() shall return Z_NULL, and need not set any other 16597 error condition. 16598 16599 Example 16600 16601 gzdopen(fileno(stdin), "r"); 16602 16603 Attempt to associate the standard input with a gzFile object. 16604 16605 Return Value 16606 16607 On success, gzdopen() shall return a gzFile object. On 16608 failure, gzdopen() shall return Z_NULL and may set errno 16609 accordingly. 16610 16611 Note: At version 1.2.2, zlib does not set errno for several 16612 error conditions. Applications may not be able to determine 16613 the cause of an error. 16614 16615 Errors 16616 16617 On error, gzdopen() may set the global variable errno to 16618 indicate the error. 16619 16620 gzeof 16621 16622 Name 16623 16624 gzeof -- check for end-of-file on a compressed file stream 16625 16626 Synopsis 16627 16628 #include 16629 16630 int gzeof (gzFile file ); 16631 16632 Description 16633 16634 The gzeof() function shall test the compressed file stream 16635 file for end of file. 16636 16637 Return Value 16638 16639 If file was open for reading and end of file has been reached, 16640 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 16641 16642 Errors 16643 16644 None defined. 16645 16646 gzerror 16647 16648 Name 16649 16650 gzerror -- decode an error on a compressed file stream 16651 16652 Synopsis 16653 16654 #include 16655 16656 const char * gzerror (gzFile file, int * errnum); 16657 16658 Description 16659 16660 The gzerror() function shall return a string describing the 16661 last error to have occurred associated with the open 16662 compressed file stream referred to by file. It shall also set 16663 the location referenced by errnum to an integer value that 16664 further identifies the error. 16665 16666 Return Value 16667 16668 The gzerror() function shall return a string that describes 16669 the last error associated with the given file compressed file 16670 stream. This string shall have the format "%s: %s", with the 16671 name of the file, followed by a colon, a space, and the 16672 description of the error. If the compressed file stream was 16673 opened by a call to gzdopen(), the format of the filename is 16674 unspecified. 16675 16676 Rationale: Although in all current implementations of libz 16677 file descriptors are named "", the code suggests 16678 that this is for debugging purposes only, and may change in 16679 a future release. 16680 16681 It is unspecified if the string returned is determined by the 16682 setting of the LC_MESSAGES category in the current locale. 16683 16684 Errors 16685 16686 None defined. 16687 16688 gzflush 16689 16690 Name 16691 16692 gzflush -- flush a compressed file stream 16693 16694 Synopsis 16695 16696 #include 16697 16698 int gzflush(gzFile file, int flush); 16699 16700 Description 16701 16702 The gzflush() function shall flush pending output to the 16703 compressed file stream identified by file, which must be open 16704 for writing. 16705 16706 Flush Operation 16707 16708 The parameter flush determines which compressed bits are added 16709 to the output file. If flush is Z_NO_FLUSH, gzflush() may 16710 return with some data pending output, and not yet written to 16711 the file. 16712 16713 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 16714 output to file and align the output to a byte boundary. There 16715 may still be data pending compression that is not flushed. 16716 16717 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 16718 Z_SYNC_FLUSH, and the compression state shall be reset. There 16719 may still be data pending compression that is not flushed. 16720 16721 Rationale: Z_SYNC_FLUSH is intended to ensure that the 16722 compressed data contains all the data compressed so far, 16723 and allows a decompressor to reconstruct all of the input 16724 data. Z_FULL_FLUSH allows decompression to restart from 16725 this point if the previous compressed data has been lost or 16726 damaged. Flushing is likely to degrade the performance of 16727 the compression system, and should only be used where 16728 necessary. 16729 16730 If flush is set to Z_FINISH, all pending uncompressed data 16731 shall be compressed and all output shall be flushed. 16732 16733 Return Value 16734 16735 On success, gzflush() shall return the value Z_OK. Otherwise 16736 gzflush() shall return a value to indicate the error, and may 16737 set the error number associated with the compressed file 16738 stream file. 16739 16740 Note: If flush is set to Z_FINISH and the flush operation 16741 is successful, gzflush() will return Z_OK, but the 16742 compressed file stream error value may be set to 16743 Z_STREAM_END. 16744 16745 Errors 16746 16747 On error, gzflush() shall return an error value, and may set 16748 the error number associated with the stream identified by file 16749 to indicate the error. Applications may use gzerror() to 16750 access this error value. 16751 16752 Z_ERRNO 16753 16754 An underlying base library function has indicated an error. 16755 The global variable errno may be examined for further 16756 information. 16757 Z_STREAM_ERROR 16758 16759 The stream is invalid, is not open for writing, or is in an 16760 invalid state. 16761 Z_BUF_ERROR 16762 16763 no compression progress is possible (see deflate()). 16764 Z_MEM_ERROR 16765 16766 Insufficient memory available to compress. 16767 16768 gzgetc 16769 16770 Name 16771 16772 gzgetc -- read a character from a compressed file 16773 16774 Synopsis 16775 16776 #include 16777 16778 int gzgetc (gzFile file); 16779 16780 Description 16781 16782 The gzgetc() function shall read the next single character 16783 from the compressed file stream referenced by file, which 16784 shall have been opened in a read mode (see gzopen() and 16785 gzdopen()). 16786 16787 Return Value 16788 16789 On success, gzgetc() shall return the uncompressed character 16790 read, otherwise, on end of file or error, gzgetc() shall 16791 return -1. 16792 16793 Errors 16794 16795 On end of file or error, gzgetc() shall return -1. Further 16796 information can be found by calling gzerror() with a pointer 16797 to the compressed file stream. 16798 16799 gzgets 16800 16801 Name 16802 16803 gzgets -- read a string from a compressed file 16804 16805 Synopsis 16806 16807 #include 16808 16809 char * gzgets (gzFile file, char * buf, int len); 16810 16811 Description 16812 16813 The gzgets() function shall attempt to read data from the 16814 compressed file stream file, uncompressing it into buf until 16815 either len-1 bytes have been inserted into buf, or until a 16816 newline character has been uncompressed into buf. A null byte 16817 shall be appended to the uncompressed data. The file shall 16818 have been opened in for reading (see gzopen() and gzdopen()). 16819 16820 Return Value 16821 16822 On success, gzgets() shall return a pointer to buf. Otherwise, 16823 gzgets() shall return Z_NULL. Applications may examine the 16824 cause using gzerror(). 16825 16826 Errors 16827 16828 On error, gzgets() shall return Z_NULL. The following 16829 conditions shall always be treated as an error: 16830 16831 file is NULL, or does not refer to a file open for reading; 16832 buf is NULL; 16833 len is less than or equal to zero. 16834 16835 gzopen 16836 16837 Name 16838 16839 gzopen -- open a compressed file 16840 16841 Synopsis 16842 16843 #include 16844 16845 gzFile gzopen (const char *path , const char *mode ); 16846 16847 Description 16848 16849 The gzopen() function shall open the compressed file named by 16850 path. The mode argument is based on that of fopen(), but the 16851 mode parameter may also contain the following characters: 16852 16853 digit 16854 16855 set the compression level to digit. A low value (e.g. 1) means 16856 high speed, while a high value (e.g. 9) means high 16857 compression. A compression level of 0 (zero) means no 16858 compression. See deflateInit2_() for further details. 16859 [fhR] 16860 16861 set the compression strategy to [fhR]. The letter f 16862 corresponds to filtered data, the letter h corresponds to 16863 Huffman only compression, and the letter R corresponds to Run 16864 Length Encoding. See deflateInit2_() for further details. 16865 16866 If path refers to an uncompressed file, and mode refers to a 16867 read mode, gzopen() shall attempt to open the file and return 16868 a gzFile object suitable for reading directly from the file 16869 without any decompression. 16870 16871 If path or mode is NULL, or if mode does not contain one of r, 16872 w, or a, gzopen() shall return Z_NULL, and need not set any 16873 other error condition. 16874 16875 The gzFile object is also referred to as a compressed file 16876 stream. 16877 16878 Example 16879 16880 gzopen("file.gz", "w6h"); 16881 16882 Attempt to create a new compressed file, file.gz, at 16883 compression level 6 using Huffman only compression. 16884 16885 Return Value 16886 16887 On success, gzopen() shall return a gzFile object (also known 16888 as a compressed file stream). On failure, gzopen() shall 16889 return Z_NULL and may set errno accordingly. 16890 16891 Note: At version 1.2.2, zlib does not set errno for several 16892 error conditions. Applications may not be able to determine 16893 the cause of an error. 16894 16895 Errors 16896 16897 On error, gzopen() may set the global variable errno to 16898 indicate the error. 16899 16900 gzprintf 16901 16902 Name 16903 16904 gzprintf -- format data and compress 16905 16906 Synopsis 16907 16908 #include 16909 16910 int gzprintf (gzFile file, const char * fmt, ...); 16911 16912 Description 16913 16914 The gzprintf() function shall format data as for fprintf(), 16915 and write the resulting string to the compressed file stream 16916 file. 16917 16918 Return Value 16919 16920 The gzprintf() function shall return the number of 16921 uncompressed bytes actually written, or a value less than or 16922 equal to 0 in the event of an error. 16923 16924 Errors 16925 16926 If file is NULL, or refers to a compressed file stream that 16927 has not been opened for writing, gzprintf() shall return 16928 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 16929 16930 gzputc 16931 16932 Name 16933 16934 gzputc -- write character to a compressed file 16935 16936 Synopsis 16937 16938 #include 16939 16940 int gzputc (gzFile file, int c); 16941 16942 Description 16943 16944 The gzputc() function shall write the single character c, 16945 converted from integer to unsigned character, to the 16946 compressed file referenced by file, which shall have been 16947 opened in a write mode (see gzopen() and gzdopen()). 16948 16949 Return Value 16950 16951 On success, gzputc() shall return the value written, otherwise 16952 gzputc() shall return -1. 16953 16954 Errors 16955 16956 On error, gzputc() shall return -1. 16957 16958 gzputs 16959 16960 Name 16961 16962 gzputs -- string write to a compressed file 16963 16964 Synopsis 16965 16966 #include 16967 16968 int gzputs (gzFile file, const char * s); 16969 16970 Description 16971 16972 The gzputs() function shall write the null terminated string s 16973 to the compressed file referenced by file, which shall have 16974 been opened in a write mode (see gzopen() and gzdopen()). The 16975 terminating null character shall not be written. The gzputs() 16976 function shall return the number of uncompressed bytes 16977 actually written. 16978 16979 Return Value 16980 16981 On success, gzputs() shall return the number of uncompressed 16982 bytes actually written to file. On error gzputs() shall return 16983 a value less than or equal to 0. Applications may examine the 16984 cause using gzerror(). 16985 16986 Errors 16987 16988 On error, gzputs() shall set the error number associated with 16989 the stream identified by file to indicate the error. 16990 Applications should use gzerror() to access this error value. 16991 If file is NULL, gzputs() shall return Z_STREAM_ERR. 16992 16993 Z_ERRNO 16994 16995 An underlying base library function has indicated an error. 16996 The global variable errno may be examined for further 16997 information. 16998 Z_STREAM_ERROR 16999 17000 The stream is invalid, is not open for writing, or is in an 17001 invalid state. 17002 Z_BUF_ERROR 17003 17004 no compression progress is possible (see deflate()). 17005 Z_MEM_ERROR 17006 17007 Insufficient memory available to compress. 17008 17009 gzread 17010 17011 Name 17012 17013 gzread -- read from a compressed file 17014 17015 Synopsis 17016 17017 #include 17018 17019 int gzread (gzFile file, voidp buf, unsigned int len); 17020 17021 Description 17022 17023 The gzread() function shall read data from the compressed file 17024 referenced by file, which shall have been opened in a read 17025 mode (see gzopen() and gzdopen()). The gzread() function shall 17026 read data from file, and uncompress it into buf. At most, len 17027 bytes of uncompressed data shall be copied to buf. If the file 17028 is not compressed, gzread() shall simply copy data from file 17029 to buf without alteration. 17030 17031 Return Value 17032 17033 On success, gzread() shall return the number of bytes 17034 decompressed into buf. If gzread() returns 0, either the 17035 end-of-file has been reached or an underlying read error has 17036 occurred. Applications should use gzerror() or gzeof() to 17037 determine which occurred. On other errors, gzread() shall 17038 return a value less than 0 and applications may examine the 17039 cause using gzerror(). 17040 17041 Errors 17042 17043 On error, gzread() shall set the error number associated with 17044 the stream identified by file to indicate the error. 17045 Applications should use gzerror() to access this error value. 17046 17047 Z_ERRNO 17048 17049 An underlying base library function has indicated an error. 17050 The global variable errno may be examined for further 17051 information. 17052 Z_STREAM_END 17053 17054 End of file has been reached on input. 17055 Z_DATA_ERROR 17056 17057 A CRC error occurred when reading data; the file is corrupt. 17058 Z_STREAM_ERROR 17059 17060 The stream is invalid, or is in an invalid state. 17061 Z_NEED_DICT 17062 17063 A dictionary is needed (see inflateSetDictionary()). 17064 Z_MEM_ERROR 17065 17066 Insufficient memory available to decompress. 17067 17068 gzrewind 17069 17070 Name 17071 17072 gzrewind -- reset the file-position indicator on a compressed 17073 file stream 17074 17075 Synopsis 17076 17077 #include 17078 17079 int gzrewind(gzFile file); 17080 17081 Description 17082 17083 The gzrewind() function shall set the starting position for 17084 the next read on compressed file stream file to the beginning 17085 of file. file must be open for reading. 17086 17087 gzrewind() is equivalent to 17088 (int)gzseek(file, 0L, SEEK_SET) 17089 17090 . 17091 17092 Return Value 17093 17094 On success, gzrewind() shall return 0. On error, gzrewind() 17095 shall return -1, and may set the error value for file 17096 accordingly. 17097 17098 Errors 17099 17100 On error, gzrewind() shall return -1, indicating that file is 17101 NULL, or does not represent an open compressed file stream, or 17102 represents a compressed file stream that is open for writing 17103 and is not currently at the beginning of file. 17104 17105 gzseek 17106 17107 Name 17108 17109 gzseek -- reposition a file-position indicator in a compressed 17110 file stream 17111 17112 Synopsis 17113 17114 #include 17115 17116 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 17117 17118 Description 17119 17120 The gzseek() function shall set the file-position indicator 17121 for the compressed file stream file. The file-position 17122 indicator controls where the next read or write operation on 17123 the compressed file stream shall take place. The offset 17124 indicates a byte offset in the uncompressed data. The whence 17125 parameter may be one of: 17126 17127 SEEK_SET 17128 17129 the offset is relative to the start of the uncompressed data. 17130 SEEK_CUR 17131 17132 the offset is relative to the current positition in the 17133 uncompressed data. 17134 17135 Note: The value SEEK_END need not be supported. 17136 17137 If the file is open for writing, the new offset must be 17138 greater than or equal to the current offset. In this case, 17139 gzseek() shall compress a sequence of null bytes to fill the 17140 gap from the previous offset to the new offset. 17141 17142 Return Value 17143 17144 On success, gzseek() shall return the resulting offset in the 17145 file expressed as a byte position in the uncompressed data 17146 stream. On error, gzseek() shall return -1, and may set the 17147 error value for file accordingly. 17148 17149 Errors 17150 17151 On error, gzseek() shall return -1. The following conditions 17152 shall always result in an error: 17153 17154 * file is NULL 17155 * file does not represent an open compressed file stream. 17156 * file refers to a compressed file stream that is open for 17157 writing, and the newly computed offset is less than the 17158 current offset. 17159 * The newly computed offset is less than zero. 17160 * whence is not one of the supported values. 17161 17162 Application Usage (informative) 17163 17164 If file is open for reading, the implementation may still need 17165 to uncompress all of the data up to the new offset. As a 17166 result, gzseek() may be extremely slow in some circumstances. 17167 17168 gzsetparams 17169 17170 Name 17171 17172 gzsetparams -- dynamically set compression parameters 17173 17174 Synopsis 17175 17176 #include 17177 17178 int gzsetparams (gzFile file, int level, int strategy); 17179 17180 Description 17181 17182 The gzsetparams() function shall set the compression level and 17183 compression strategy on the compressed file stream referenced 17184 by file. The compressed file stream shall have been opened in 17185 a write mode. The level and strategy are as defined in 17186 deflateInit2.. If there is any data pending writing, it shall 17187 be flushed before the parameters are updated. 17188 17189 Return Value 17190 17191 On success, the gzsetparams() function shall return Z_OK. 17192 17193 Errors 17194 17195 On error, gzsetparams() shall return one of the following 17196 error indications: 17197 17198 Z_STREAM_ERROR 17199 17200 Invalid parameter, or file not open for writing. 17201 Z_BUF_ERROR 17202 17203 An internal inconsistency was detected while flushing the 17204 previous buffer. 17205 17206 gztell 17207 17208 Name 17209 17210 gztell -- find position on a compressed file stream 17211 17212 Synopsis 17213 17214 #include 17215 17216 z_off_t gztell (gzFile file ); 17217 17218 Description 17219 17220 The gztell() function shall return the starting position for 17221 the next read or write operation on compressed file stream 17222 file. This position represents the number of bytes from the 17223 beginning of file in the uncompressed data. 17224 17225 gztell() is equivalent to 17226 gzseek(file, 0L, SEEK_CUR) 17227 17228 . 17229 17230 Return Value 17231 17232 gztell() shall return the current offset in the file expressed 17233 as a byte position in the uncompressed data stream. On error, 17234 gztell() shall return -1, and may set the error value for file 17235 accordingly. 17236 17237 Errors 17238 17239 On error, gztell() shall return -1, indicating that file is 17240 NULL, or does not represent an open compressed file stream. 17241 17242 gzwrite 17243 17244 Name 17245 17246 gzwrite -- write to a compressed file 17247 17248 Synopsis 17249 17250 #include 17251 17252 int gzwrite (gzFile file, voidpc buf, unsigned int len); 17253 17254 Description 17255 17256 The gzwrite() function shall write data to the compressed file 17257 referenced by file, which shall have been opened in a write 17258 mode (see gzopen() and gzdopen()). On entry, buf shall point 17259 to a buffer containing len bytes of uncompressed data. The 17260 gzwrite() function shall compress this data and write it to 17261 file. The gzwrite() function shall return the number of 17262 uncompressed bytes actually written. 17263 17264 Return Value 17265 17266 On success, gzwrite() shall return the number of uncompressed 17267 bytes actually written to file. On error gzwrite() shall 17268 return a value less than or equal to 0. Applications may 17269 examine the cause using gzerror(). 17270 17271 Errors 17272 17273 On error, gzwrite() shall set the error number associated with 17274 the stream identified by file to indicate the error. 17275 Applications should use gzerror() to access this error value. 17276 17277 Z_ERRNO 17278 17279 An underlying base library function has indicated an error. 17280 The global variable errno may be examined for further 17281 information. 17282 Z_STREAM_ERROR 17283 17284 The stream is invalid, is not open for writing, or is in an 17285 invalid state. 17286 Z_BUF_ERROR 17287 17288 no compression progress is possible (see deflate()). 17289 Z_MEM_ERROR 17290 17291 Insufficient memory available to compress. 17292 17293 inflate 17294 17295 Name 17296 17297 inflate -- decompress data 17298 17299 Synopsis 17300 17301 #include 17302 17303 int inflate(z_streamp stream, int flush); 17304 17305 Description 17306 17307 The inflate() function shall attempt to decompress data until 17308 either the input buffer is empty or the output buffer is full. 17309 The stream references a z_stream structure. Before the first 17310 call to inflate(), this structure should have been initialized 17311 by a call to inflateInit2_(). 17312 17313 Note: inflateInit2_() is only in the binary standard; 17314 source level applications should initialize stream via a 17315 call to inflateInit() or inflateInit2(). 17316 17317 In addition, the stream input and output buffers should have 17318 been initialized as follows: 17319 17320 next_in 17321 17322 should point to the data to be decompressed. 17323 avail_in 17324 17325 should contain the number of bytes of data in the buffer 17326 referenced by next_in. 17327 next_out 17328 17329 should point to a buffer where decompressed data may be 17330 placed. 17331 avail_out 17332 17333 should contain the size in bytes of the buffer referenced by 17334 next_out 17335 17336 The inflate() function shall perform one or both of the 17337 following actions: 17338 17339 1. Decompress input data from next_in and update next_in, 17340 avail_in and total_in to reflect the data that has been 17341 decompressed. 17342 2. Fill the output buffer referenced by next_out, and update 17343 next_out, avail_out, and total_out to reflect the 17344 decompressed data that has been placed there. If flush is 17345 not Z_NO_FLUSH, and avail_out indicates that there is 17346 still space in output buffer, this action shall always 17347 occur (see below for further details). 17348 17349 The inflate() function shall return when either avail_in 17350 reaches zero (indicating that all the input data has been 17351 compressed), or avail_out reaches zero (indicating that the 17352 output buffer is full). 17353 17354 Flush Operation 17355 17356 The parameter flush determines when uncompressed bytes are 17357 added to the output buffer in next_out. If flush is 17358 Z_NO_FLUSH, inflate() may return with some data pending 17359 output, and not yet added to the output buffer. 17360 17361 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 17362 output to next_out, and update next_out and avail_out 17363 accordingly. 17364 17365 If flush is set to Z_BLOCK, inflate() shall stop adding data 17366 to the output buffer if and when the next compressed block 17367 boundary is reached (see RFC 1951: DEFLATE Compressed Data 17368 Format Specification). 17369 17370 If flush is set to Z_FINISH, all of the compressed input shall 17371 be decompressed and added to the output. If there is 17372 insufficient output space (i.e. the compressed input data 17373 uncompresses to more than avail_out bytes), then inflate() 17374 shall fail and return Z_BUF_ERROR. 17375 17376 Return Value 17377 17378 On success, inflate() shall return Z_OK if decompression 17379 progress has been made, or Z_STREAM_END if all of the input 17380 data has been decompressed and there was sufficient space in 17381 the output buffer to store the uncompressed result. On error, 17382 inflate() shall return a value to indicate the error. 17383 17384 Note: If inflate() returns Z_OK and has set avail_out to 17385 zero, the function should be called again with the same 17386 value for flush, and with updated next_out and avail_out 17387 until inflate() returns with either Z_OK or Z_STREAM_END 17388 and a non-zero avail_out. 17389 17390 On success, inflate() shall set the adler to the Adler-32 17391 checksum of the output produced so far (i.e. total_out bytes). 17392 17393 Errors 17394 17395 On error, inflate() shall return a value as described below, 17396 and may set the msg field of stream to point to a string 17397 describing the error: 17398 17399 Z_BUF_ERROR 17400 17401 No progress is possible; either avail_in or avail_out was 17402 zero. 17403 Z_MEM_ERROR 17404 17405 Insufficient memory. 17406 Z_STREAM_ERROR 17407 17408 The state (as represented in stream) is inconsistent, or 17409 stream was NULL. 17410 Z_NEED_DICT 17411 17412 A preset dictionary is required. The adler field shall be set 17413 to the Adler-32 checksum of the dictionary chosen by the 17414 compressor. 17415 17416 inflateEnd 17417 17418 Name 17419 17420 inflateEnd -- free decompression stream state 17421 17422 Synopsis 17423 17424 #include 17425 17426 int inflateEnd(z_streamp stream); 17427 17428 Description 17429 17430 The inflateEnd() function shall free all allocated state 17431 information referenced by stream. All pending output is 17432 discarded, and unprocessed input is ignored. 17433 17434 Return Value 17435 17436 On success, inflateEnd() shall return Z_OK. Otherwise it shall 17437 return Z_STREAM_ERROR to indicate the error. 17438 17439 Errors 17440 17441 On error, inflateEnd() shall return Z_STREAM_ERROR. The 17442 following conditions shall be treated as an error: 17443 17444 * The state in stream is inconsistent. 17445 * stream is NULL. 17446 * The zfree function pointer is NULL. 17447 17448 inflateInit2_ 17449 17450 Name 17451 17452 inflateInit2_ -- initialize decompression system 17453 17454 Synopsis 17455 17456 #include 17457 17458 int inflateInit2_ (z_streamp strm, int windowBits, char * 17459 version, int stream_size); 17460 17461 Description 17462 17463 The inflateInit2_() function shall initialize the 17464 decompression system. On entry, strm shall refer to a user 17465 supplied z_stream object (a z_stream_s structure). The 17466 following fields shall be set on entry: 17467 17468 zalloc 17469 17470 a pointer to an alloc_func function, used to allocate state 17471 information. If this is NULL, a default allocation function 17472 will be used. 17473 zfree 17474 17475 a pointer to a free_func function, used to free memory 17476 allocated by the zalloc function. If this is NULL a default 17477 free function will be used. 17478 opaque 17479 17480 If alloc_func is not NULL, opaque is a user supplied pointer 17481 to data that will be passed to the alloc_func and free_func 17482 functions. 17483 17484 If the version requested is not compatible with the version 17485 implemented, or if the size of the z_stream_s structure 17486 provided in stream_size does not match the size in the library 17487 implementation, inflateInit2_() shall fail, and return 17488 Z_VERSION_ERROR. 17489 17490 The windowBits parameter shall be a base 2 logarithm of the 17491 maximum window size to use, and shall be a value between 8 and 17492 15. If the input data was compressed with a larger window 17493 size, subsequent attempts to decompress this data will fail 17494 with Z_DATA_ERROR, rather than try to allocate a larger 17495 window. 17496 17497 The inflateInit2_() function is not in the source standard; it 17498 is only in the binary standard. Source applications should use 17499 the inflateInit2() macro. 17500 17501 Return Value 17502 17503 On success, the inflateInit2_() function shall return Z_OK. 17504 Otherwise, inflateInit2_() shall return a value as described 17505 below to indicate the error. 17506 17507 Errors 17508 17509 On error, inflateInit2_() shall return one of the following 17510 error indicators: 17511 17512 Z_STREAM_ERROR 17513 17514 Invalid parameter. 17515 Z_MEM_ERROR 17516 17517 Insufficient memory available. 17518 Z_VERSION_ERROR 17519 17520 The version requested is not compatible with the library 17521 version, or the z_stream size differs from that used by the 17522 library. 17523 17524 In addition, the msg field of the strm may be set to an error 17525 message. 17526 17527 inflateInit_ 17528 17529 Name 17530 17531 inflateInit_ -- initialize decompression system 17532 17533 Synopsis 17534 17535 #include 17536 17537 int inflateInit_(z_streamp stream, const char * version, int 17538 stream_size); 17539 17540 Description 17541 17542 The inflateInit_() function shall initialize the decompression 17543 system. On entry, stream shall refer to a user supplied 17544 z_stream object (a z_stream_s structure). The following fields 17545 shall be set on entry: 17546 17547 zalloc 17548 17549 a pointer to an alloc_func function, used to allocate state 17550 information. If this is NULL, a default allocation function 17551 will be used. 17552 zfree 17553 17554 a pointer to a free_func function, used to free memory 17555 allocated by the zalloc function. If this is NULL a default 17556 free function will be used. 17557 opaque 17558 17559 If alloc_func is not NULL, opaque is a user supplied pointer 17560 to data that will be passed to the alloc_func and free_func 17561 functions. 17562 17563 If the version requested is not compatible with the version 17564 implemented, or if the size of the z_stream_s structure 17565 provided in stream_size does not match the size in the library 17566 implementation, inflateInit_() shall fail, and return 17567 Z_VERSION_ERROR. 17568 17569 The inflateInit_() function is not in the source standard; it 17570 is only in the binary standard. Source applications should use 17571 the inflateInit() macro. 17572 17573 The inflateInit_() shall be equivalent to 17574 inflateInit2_(strm, MAX_WBITS, version, stream_size); 17575 17576 Return Value 17577 17578 On success, the inflateInit_() function shall return Z_OK. 17579 Otherwise, inflateInit_() shall return a value as described 17580 below to indicate the error. 17581 17582 Errors 17583 17584 On error, inflateInit_() shall return one of the following 17585 error indicators: 17586 17587 Z_STREAM_ERROR 17588 17589 Invalid parameter. 17590 Z_MEM_ERROR 17591 17592 Insufficient memory available. 17593 Z_VERSION_ERROR 17594 17595 The version requested is not compatible with the library 17596 version, or the z_stream size differs from that used by the 17597 library. 17598 17599 In addition, the msg field of the strm may be set to an error 17600 message. 17601 17602 inflateReset 17603 17604 Name 17605 17606 inflateReset -- reset decompression stream state 17607 17608 Synopsis 17609 17610 #include 17611 17612 int inflateReset(z_streamp stream); 17613 17614 Description 17615 17616 The inflateReset() function shall reset all state associated 17617 with stream. All pending output shall be discarded, and the 17618 counts of processed bytes (total_in and total_out) shall be 17619 reset to zero. 17620 17621 Return Value 17622 17623 On success, inflateReset() shall return Z_OK. Otherwise it 17624 shall return Z_STREAM_ERROR to indicate the error. 17625 17626 Errors 17627 17628 On error, inflateReset() shall return Z_STREAM_ERROR. The 17629 following conditions shall be treated as an error: 17630 17631 * The state in stream is inconsistent or inappropriate. 17632 * stream is NULL. 17633 17634 inflateSetDictionary 17635 17636 Name 17637 17638 inflateSetDictionary -- initialize decompression dictionary 17639 17640 Synopsis 17641 17642 #include 17643 17644 int inflateSetDictionary(z_streamp stream, const Bytef * 17645 dictionary, uInt dictlen); 17646 17647 Description 17648 17649 The inflateSetDictionary() function shall initialize the 17650 decompression dictionary associated with stream using the 17651 dictlen bytes referenced by dictionary. 17652 17653 The inflateSetDictionary() function should be called 17654 immediately after a call to inflate() has failed with return 17655 value Z_NEED_DICT. The dictionary must have the same Adler-32 17656 checksum as the dictionary used for the compression (see 17657 deflateSetDictionary()). 17658 17659 stream shall reference an initialized decompression stream, 17660 with total_in zero (i.e. no data has been decompressed since 17661 the stream was initialized). 17662 17663 Return Value 17664 17665 On success, inflateSetDictionary() shall return Z_OK. 17666 Otherwise it shall return a value as indicated below. 17667 17668 Errors 17669 17670 On error, inflateSetDictionary() shall return a value as 17671 described below: 17672 17673 Z_STREAM_ERROR 17674 17675 The state in stream is inconsistent, or stream was NULL. 17676 Z_DATA_ERROR 17677 17678 The Adler-32 checksum of the supplied dictionary does not 17679 match that used for the compression. 17680 17681 Application Usage (informative) 17682 17683 The application should provide a dictionary consisting of 17684 strings {{{ed note: do we really mean "strings"? Null 17685 terminated?}}} that are likely to be encountered in the data 17686 to be compressed. The application should ensure that the 17687 dictionary is sorted such that the most commonly used strings 17688 occur at the end of the dictionary. 17689 17690 The use of a dictionary is optional; however if the data to be 17691 compressed is relatively short and has a predictable 17692 structure, the use of a dictionary can substantially improve 17693 the compression ratio. 17694 17695 inflateSync 17696 17697 Name 17698 17699 inflateSync -- advance compression stream to next sync point 17700 17701 Synopsis 17702 17703 #include 17704 17705 int inflateSync(z_streamp stream); 17706 17707 Description 17708 17709 The inflateSync() function shall advance through the 17710 compressed data in stream, skipping any invalid compressed 17711 data, until the next full flush point is reached, or all input 17712 is exhausted. See the description for deflate() with flush 17713 level Z_FULL_FLUSH. No output is placed in next_out. 17714 17715 Return Value 17716 17717 On success, inflateSync() shall return Z_OK, and update the 17718 next_in, avail_in, and total_in fields of stream to reflect 17719 the number of bytes of compressed data that have been skipped. 17720 Otherwise, inflateSync() shall return a value as described 17721 below to indicate the error. 17722 17723 Errors 17724 17725 On error, inflateSync() shall return a value as described 17726 below: 17727 17728 Z_STREAM_ERROR 17729 17730 The state (as represented in stream) is inconsistent, or 17731 stream was NULL. 17732 Z_BUF_ERROR 17733 17734 There is no data available to skip over. 17735 Z_DATA_ERROR 17736 17737 No sync point was found. 17738 17739 inflateSyncPoint 17740 17741 Name 17742 17743 inflateSyncPoint -- test for synchronization point 17744 17745 Synopsis 17746 17747 #include 17748 17749 int inflateSyncPoint(z_streamp stream); 17750 17751 Description 17752 17753 The inflateSyncPoint() function shall return a non-zero value 17754 if the compressed data stream referenced by stream is at a 17755 synchronization point. 17756 17757 Return Value 17758 17759 If the compressed data in stream is at a synchronization point 17760 (see deflate() with a flush level of Z_SYNC_FLUSH or 17761 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 17762 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 17763 valid, inflateSyncPoint() shall return 0. If stream is 17764 invalid, or in an invalid state, inflateSyncPoint() shall 17765 return Z_STREAM_ERROR to indicate the error. 17766 17767 Errors 17768 17769 On error, inflateSyncPoint() shall return a value as described 17770 below: 17771 17772 Z_STREAM_ERROR 17773 17774 The state (as represented in stream) is inconsistent, or 17775 stream was NULL. 17776 17777 uncompress 17778 17779 Name 17780 17781 uncompress -- uncompress data 17782 17783 Synopsis 17784 17785 #include 17786 17787 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 17788 source, uLong sourceLen); 17789 17790 Description 17791 17792 The uncompress() function shall attempt to uncompress 17793 sourceLen bytes of data in the buffer source, placing the 17794 result in the buffer dest. 17795 17796 On entry, destLen should point to a value describing the size 17797 of the dest buffer. The application should ensure that this 17798 value is large enough to hold the entire uncompressed data. 17799 17800 Note: The LSB does not describe any mechanism by which a 17801 compressor can communicate the size required to the 17802 uncompressor. 17803 17804 On successful exit, the variable referenced by destLen shall 17805 be updated to hold the length of uncompressed data in dest. 17806 17807 Return Value 17808 17809 On success, uncompress() shall return Z_OK. Otherwise, 17810 uncompress() shall return a value to indicate the error. 17811 17812 Errors 17813 17814 On error, uncompress() shall return a value as described 17815 below: 17816 17817 Z_BUF_ERROR 17818 17819 The buffer dest was not large enough to hold the uncompressed 17820 data. 17821 Z_MEM_ERROR 17822 17823 Insufficient memory. 17824 Z_DATA_ERROR 17825 17826 The compressed data (referenced by source) was corrupted. 17827 17828 zError 17829 17830 Name 17831 17832 zError -- translate error number to string 17833 17834 Synopsis 17835 17836 #include 17837 17838 const char * zError(int err); 17839 17840 Description 17841 17842 The zError() function shall return the string identifying the 17843 error associated with err. This allows for conversion from 17844 error code to string for functions such as compress() and 17845 uncompress(), that do not always set the string version of an 17846 error. 17847 17848 Return Value 17849 17850 The zError() function shall return a the string identifying 17851 the error associated with err, or NULL if err is not a valid 17852 error code. 17853 17854 It is unspecified if the string returned is determined by the 17855 setting of the LC_MESSAGES category in the current locale. 17856 17857 Errors 17858 17859 None defined. 17860 17861 zlibVersion 17862 17863 Name 17864 17865 zlibVersion -- discover library version at run time 17866 17867 Synopsis 17868 17869 #include 17870 17871 const char * zlibVersion (void); 17872 17873 Description 17874 17875 The zlibVersion() function shall return the string identifying 17876 the interface version at the time the library was built. 17877 17878 Applications should compare the value returned from 17879 zlibVersion() with the macro constant ZLIB_VERSION for 17880 compatibility. 17881 17882 Return Value 17883 17884 The zlibVersion() function shall return a the string 17885 identifying the version of the library currently implemented. 17886 17887 Errors 17888 17889 None defined. 17890 _________________________________________________________ 17891 17892 14.5. Interfaces for libncurses 17893 17894 Table 14-3 defines the library name and shared object name for 17895 the libncurses library 17896 17897 Table 14-3. libncurses Definition 17898 Library: libncurses 17899 SONAME: libncurses.so.5 17900 17901 The Parameters or return value of the following interface have 17902 had the const qualifier added as shown here. 17903 extern const char *keyname (int); 17904 extern int mvscanw (int, int, const char *, ...); 17905 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 17906 extern SCREEN *newterm (const char *, FILE *, FILE *); 17907 extern int scanw (const char *, ...); 17908 extern int vwscanw (WINDOW *, const char *, va_list); 17909 extern int vw_scanw (WINDOW *, const char *, va_list); 17910 extern int wscanw (WINDOW *, const char *, ...); 17911 17912 The behavior of the interfaces in this library is specified by 17913 the following specifications: 17914 17915 [SUS-CURSES] X/Open Curses 17916 _________________________________________________________ 17917 17918 14.5.1. Curses 17919 _________________________________________________________ 17920 17921 14.5.1.1. Interfaces for Curses 17922 17923 An LSB conforming implementation shall provide the generic 17924 functions for Curses specified in Table 14-4, with the full 17925 mandatory functionality as described in the referenced 17926 underlying specification. 17927 17928 Table 14-4. libncurses - Curses Function Interfaces 17929 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr 17930 [SUS-CURSES] addnstr [SUS-CURSES] 17931 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off 17932 [SUS-CURSES] attr_on [SUS-CURSES] 17933 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 17934 attrset [SUS-CURSES] 17935 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 17936 bkgdset [SUS-CURSES] 17937 border [SUS-CURSES] box [SUS-CURSES] can_change_color 17938 [SUS-CURSES] cbreak [SUS-CURSES] 17939 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 17940 clrtobot [SUS-CURSES] 17941 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 17942 [SUS-CURSES] copywin [SUS-CURSES] 17943 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] 17944 def_shell_mode [SUS-CURSES] del_curterm [SUS-CURSES] 17945 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 17946 [SUS-CURSES] delscreen [SUS-CURSES] 17947 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 17948 dupwin [SUS-CURSES] 17949 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 17950 erase [SUS-CURSES] 17951 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 17952 flushinp [SUS-CURSES] 17953 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 17954 getstr [SUS-CURSES] 17955 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 17956 [SUS-CURSES] has_ic [SUS-CURSES] 17957 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] 17958 idlok [SUS-CURSES] 17959 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [SUS-CURSES] 17960 inchstr [SUS-CURSES] 17961 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 17962 [SUS-CURSES] innstr [SUS-CURSES] 17963 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 17964 insnstr [SUS-CURSES] 17965 insstr [SUS-CURSES] instr [SUS-CURSES] intrflush [SUS-CURSES] 17966 is_linetouched [SUS-CURSES] 17967 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 17968 [SUS-CURSES] keypad [SUS-CURSES] 17969 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 17970 [SUS-CURSES] meta [SUS-CURSES] 17971 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr 17972 [SUS-CURSES] mvaddchstr [SUS-CURSES] 17973 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 17974 [SUS-CURSES] mvcur [SUS-CURSES] 17975 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch 17976 [SUS-CURSES] mvgetnstr [SUS-CURSES] 17977 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 17978 mvinchnstr [SUS-CURSES] 17979 mvinchstr [SUS-CURSES] mvinnstr [SUS-CURSES] mvinsch 17980 [SUS-CURSES] mvinsnstr [SUS-CURSES] 17981 mvinsstr [SUS-CURSES] mvinstr [SUS-CURSES] mvprintw 17982 [SUS-CURSES] mvscanw [SUS-CURSES] 17983 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 17984 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 17985 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 17986 [SUS-CURSES] mvwdelch [SUS-CURSES] 17987 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 17988 [SUS-CURSES] mvwhline [SUS-CURSES] 17989 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr 17990 [SUS-CURSES] mvwinchstr [SUS-CURSES] 17991 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 17992 [SUS-CURSES] mvwinsstr [SUS-CURSES] 17993 mvwinstr [SUS-CURSES] mvwprintw [SUS-CURSES] mvwscanw 17994 [SUS-CURSES] mvwvline [SUS-CURSES] 17995 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 17996 newwin [SUS-CURSES] 17997 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 17998 noecho [SUS-CURSES] 17999 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 18000 notimeout [SUS-CURSES] 18001 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 18002 [SUS-CURSES] pechochar [SUS-CURSES] 18003 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 18004 [SUS-CURSES] putp [SUS-CURSES] 18005 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 18006 redrawwin [SUS-CURSES] 18007 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 18008 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 18009 restartterm [SUS-CURSES] ripoffline [SUS-CURSES] savetty 18010 [SUS-CURSES] scanw [SUS-CURSES] 18011 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 18012 [SUS-CURSES] scr_set [SUS-CURSES] 18013 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 18014 set_curterm [SUS-CURSES] 18015 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 18016 [SUS-CURSES] slk_attr_set [SUS-CURSES] 18017 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 18018 [SUS-CURSES] slk_clear [SUS-CURSES] 18019 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 18020 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 18021 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 18022 [SUS-CURSES] slk_touch [SUS-CURSES] 18023 standend [SUS-CURSES] standout [SUS-CURSES] start_color 18024 [SUS-CURSES] subpad [SUS-CURSES] 18025 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 18026 termname [SUS-CURSES] 18027 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum 18028 [SUS-CURSES] tgetstr [SUS-CURSES] 18029 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum 18030 [SUS-CURSES] tigetstr [SUS-CURSES] 18031 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 18032 [SUS-CURSES] tparm [SUS-CURSES] 18033 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 18034 ungetch [SUS-CURSES] 18035 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 18036 [SUS-CURSES] vidputs [SUS-CURSES] 18037 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw 18038 [SUS-CURSES] vwprintw [SUS-CURSES] 18039 vwscanw [SUS-CURSES] waddch [SUS-CURSES] waddchnstr 18040 [SUS-CURSES] waddchstr [SUS-CURSES] 18041 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 18042 [SUS-CURSES] wattr_off [SUS-CURSES] 18043 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 18044 [SUS-CURSES] wattron [SUS-CURSES] 18045 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 18046 wborder [SUS-CURSES] 18047 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 18048 wclrtoeol [SUS-CURSES] 18049 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 18050 [SUS-CURSES] wdeleteln [SUS-CURSES] 18051 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 18052 wgetnstr [SUS-CURSES] 18053 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 18054 winchnstr [SUS-CURSES] 18055 winchstr [SUS-CURSES] winnstr [SUS-CURSES] winsch [SUS-CURSES] 18056 winsdelln [SUS-CURSES] 18057 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 18058 [SUS-CURSES] winstr [SUS-CURSES] 18059 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 18060 [SUS-CURSES] wredrawln [SUS-CURSES] 18061 wrefresh [SUS-CURSES] wscanw [SUS-CURSES] wscrl [SUS-CURSES] 18062 wsetscrreg [SUS-CURSES] 18063 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 18064 [SUS-CURSES] wsyncup [SUS-CURSES] 18065 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline 18066 [SUS-CURSES] 18067 18068 An LSB conforming implementation shall provide the generic 18069 data interfaces for Curses specified in Table 14-5, with the 18070 full mandatory functionality as described in the referenced 18071 underlying specification. 18072 18073 Table 14-5. libncurses - Curses Data Interfaces 18074 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 18075 LINES [SUS-CURSES] 18076 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 18077 stdscr [SUS-CURSES] 18078 _________________________________________________________ 18079 18080 14.6. Data Definitions for libncurses 18081 18082 This section defines global identifiers and their values that 18083 are associated with interfaces contained in libncurses. These 18084 definitions are organized into groups that correspond to 18085 system headers. This convention is used as a convenience for 18086 the reader, and does not imply the existence of these headers, 18087 or their content. Where an interface is defined as requiring a 18088 particular system header file all of the data definitions for 18089 that system header file presented here shall be in effect. 18090 18091 This section gives data definitions to promote binary 18092 application portability, not to repeat source interface 18093 definitions available elsewhere. System providers and 18094 application developers should use this ABI to supplement - not 18095 to replace - source interface definition specifications. 18096 18097 This specification uses the ISO C (1999) C Language as the 18098 reference programming language, and data definitions are 18099 specified in ISO C format. The C language is used here as a 18100 convenient notation. Using a C language description of these 18101 data objects does not preclude their use by other programming 18102 languages. 18103 _________________________________________________________ 18104 18105 14.6.1. curses.h 18106 18107 #define ERR (-1) 18108 #define OK (0) 18109 #define ACS_RARROW (acs_map['+']) 18110 #define ACS_LARROW (acs_map[',']) 18111 #define ACS_UARROW (acs_map['-']) 18112 #define ACS_DARROW (acs_map['.']) 18113 #define ACS_BLOCK (acs_map['0']) 18114 #define ACS_CKBOARD (acs_map['a']) 18115 #define ACS_DEGREE (acs_map['f']) 18116 #define ACS_PLMINUS (acs_map['g']) 18117 #define ACS_BOARD (acs_map['h']) 18118 #define ACS_LANTERN (acs_map['i']) 18119 #define ACS_LRCORNER (acs_map['j']) 18120 #define ACS_URCORNER (acs_map['k']) 18121 #define ACS_ULCORNER (acs_map['l']) 18122 #define ACS_LLCORNER (acs_map['m']) 18123 #define ACS_PLUS (acs_map['n']) 18124 #define ACS_S1 (acs_map['o']) 18125 #define ACS_HLINE (acs_map['q']) 18126 #define ACS_S9 (acs_map['s']) 18127 #define ACS_LTEE (acs_map['t']) 18128 #define ACS_RTEE (acs_map['u']) 18129 #define ACS_BTEE (acs_map['v']) 18130 #define ACS_TTEE (acs_map['w']) 18131 #define ACS_VLINE (acs_map['x']) 18132 #define ACS_DIAMOND (acs_map['`']) 18133 #define ACS_BULLET (acs_map['~']) 18134 #define getmaxyx(win,y,x) \ 18135 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 18136 #define getbegyx(win,y,x) \ 18137 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 18138 #define getyx(win,y,x) \ 18139 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 18140 #define getparyx(win,y,x) \ 18141 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 18142 18143 #define WA_ALTCHARSET A_ALTCHARSET 18144 #define WA_ATTRIBUTES A_ATTRIBUTES 18145 #define WA_BLINK A_BLINK 18146 #define WA_BOLD A_BOLD 18147 #define WA_DIM A_DIM 18148 #define WA_HORIZONTAL A_HORIZONTAL 18149 #define WA_INVIS A_INVIS 18150 #define WA_LEFT A_LEFT 18151 #define WA_LOW A_LOW 18152 #define WA_NORMAL A_NORMAL 18153 #define WA_PROTECT A_PROTECT 18154 #define WA_REVERSE A_REVERSE 18155 #define WA_RIGHT A_RIGHT 18156 #define WA_STANDOUT A_STANDOUT 18157 #define WA_TOP A_TOP 18158 #define WA_UNDERLINE A_UNDERLINE 18159 #define WA_VERTICAL A_VERTICAL 18160 #define A_REVERSE NCURSES_BITS(1UL,10) 18161 18162 #define COLOR_BLACK 0 18163 #define COLOR_RED 1 18164 #define COLOR_GREEN 2 18165 #define COLOR_YELLOW 3 18166 #define COLOR_BLUE 4 18167 #define COLOR_MAGENTA 5 18168 #define COLOR_CYAN 6 18169 #define COLOR_WHITE 7 18170 18171 #define _SUBWIN 0x01 18172 #define _ENDLINE 0x02 18173 #define _FULLWIN 0x04 18174 #define _SCROLLWIN 0x08 18175 #define _ISPAD 0x10 18176 #define _HASMOVED 0x20 18177 18178 typedef unsigned char bool; 18179 18180 typedef unsigned long int chtype; 18181 typedef struct screen SCREEN; 18182 typedef struct _win_st WINDOW; 18183 typedef chtype attr_t; 18184 typedef struct { 18185 attr_t attr; 18186 wchar_t chars[5]; 18187 } cchar_t; 18188 struct pdat { 18189 short _pad_y; 18190 short _pad_x; 18191 short _pad_top; 18192 short _pad_left; 18193 short _pad_bottom; 18194 short _pad_right; 18195 }; 18196 18197 struct _win_st { 18198 short _cury; 18199 short _curx; 18200 short _maxy; 18201 short _maxx; 18202 short _begy; 18203 short _begx; 18204 short _flags; 18205 attr_t _attrs; 18206 chtype _bkgd; 18207 bool _notimeout; 18208 bool _clear; 18209 bool _leaveok; 18210 bool _scroll; 18211 bool _idlok; 18212 bool _idcok; 18213 bool _immed; 18214 bool _sync; 18215 bool _use_keypad; 18216 int _delay; 18217 struct ldat *_line; 18218 short _regtop; 18219 short _regbottom; 18220 int _parx; 18221 int _pary; 18222 WINDOW *_parent; 18223 struct pdat _pad; 18224 short _yoffset; 18225 cchar_t _bkgrnd; 18226 }; 18227 18228 #define KEY_CODE_YES 0400 18229 #define KEY_BREAK 0401 18230 #define KEY_MIN 0401 18231 #define KEY_DOWN 0402 18232 #define KEY_UP 0403 18233 #define KEY_LEFT 0404 18234 #define KEY_RIGHT 0405 18235 #define KEY_HOME 0406 18236 #define KEY_BACKSPACE 0407 18237 #define KEY_F0 0410 18238 #define KEY_DL 0510 18239 #define KEY_IL 0511 18240 #define KEY_DC 0512 18241 #define KEY_IC 0513 18242 #define KEY_EIC 0514 18243 #define KEY_CLEAR 0515 18244 #define KEY_EOS 0516 18245 #define KEY_EOL 0517 18246 #define KEY_SF 0520 18247 #define KEY_SR 0521 18248 #define KEY_NPAGE 0522 18249 #define KEY_PPAGE 0523 18250 #define KEY_STAB 0524 18251 #define KEY_CTAB 0525 18252 #define KEY_CATAB 0526 18253 #define KEY_ENTER 0527 18254 #define KEY_SRESET 0530 18255 #define KEY_RESET 0531 18256 #define KEY_PRINT 0532 18257 #define KEY_LL 0533 18258 #define KEY_A1 0534 18259 #define KEY_A3 0535 18260 #define KEY_B2 0536 18261 #define KEY_C1 0537 18262 #define KEY_C3 0540 18263 #define KEY_BTAB 0541 18264 #define KEY_BEG 0542 18265 #define KEY_CANCEL 0543 18266 #define KEY_CLOSE 0544 18267 #define KEY_COMMAND 0545 18268 #define KEY_COPY 0546 18269 #define KEY_CREATE 0547 18270 #define KEY_END 0550 18271 #define KEY_EXIT 0551 18272 #define KEY_FIND 0552 18273 #define KEY_HELP 0553 18274 #define KEY_MARK 0554 18275 #define KEY_MESSAGE 0555 18276 #define KEY_MOVE 0556 18277 #define KEY_NEXT 0557 18278 #define KEY_OPEN 0560 18279 #define KEY_OPTIONS 0561 18280 #define KEY_PREVIOUS 0562 18281 #define KEY_REDO 0563 18282 #define KEY_REFERENCE 0564 18283 #define KEY_REFRESH 0565 18284 #define KEY_REPLACE 0566 18285 #define KEY_RESTART 0567 18286 #define KEY_RESUME 0570 18287 #define KEY_SAVE 0571 18288 #define KEY_SBEG 0572 18289 #define KEY_SCANCEL 0573 18290 #define KEY_SCOMMAND 0574 18291 #define KEY_SCOPY 0575 18292 #define KEY_SCREATE 0576 18293 #define KEY_SDC 0577 18294 #define KEY_SDL 0600 18295 #define KEY_SELECT 0601 18296 #define KEY_SEND 0602 18297 #define KEY_SEOL 0603 18298 #define KEY_SEXIT 0604 18299 #define KEY_SFIND 0605 18300 #define KEY_SHELP 0606 18301 #define KEY_SHOME 0607 18302 #define KEY_SIC 0610 18303 #define KEY_SLEFT 0611 18304 #define KEY_SMESSAGE 0612 18305 #define KEY_SMOVE 0613 18306 #define KEY_SNEXT 0614 18307 #define KEY_SOPTIONS 0615 18308 #define KEY_SPREVIOUS 0616 18309 #define KEY_SPRINT 0617 18310 #define KEY_SREDO 0620 18311 #define KEY_SREPLACE 0621 18312 #define KEY_SRIGHT 0622 18313 #define KEY_SRSUME 0623 18314 #define KEY_SSAVE 0624 18315 #define KEY_SSUSPEND 0625 18316 #define KEY_SUNDO 0626 18317 #define KEY_SUSPEND 0627 18318 #define KEY_UNDO 0630 18319 #define KEY_MOUSE 0631 18320 #define KEY_RESIZE 0632 18321 #define KEY_MAX 0777 18322 18323 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 18324 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 18325 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 18326 #define A_NORMAL 0L 18327 #define NCURSES_ATTR_SHIFT 8 18328 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 18329 #define A_BLINK NCURSES_BITS(1UL,11) 18330 #define A_DIM NCURSES_BITS(1UL,12) 18331 #define A_BOLD NCURSES_BITS(1UL,13) 18332 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 18333 #define A_INVIS NCURSES_BITS(1UL,15) 18334 #define A_PROTECT NCURSES_BITS(1UL,16) 18335 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 18336 #define A_LEFT NCURSES_BITS(1UL,18) 18337 #define A_LOW NCURSES_BITS(1UL,19) 18338 #define A_RIGHT NCURSES_BITS(1UL,20) 18339 #define A_TOP NCURSES_BITS(1UL,21) 18340 #define A_VERTICAL NCURSES_BITS(1UL,22) 18341 #define A_STANDOUT NCURSES_BITS(1UL,8) 18342 #define A_UNDERLINE NCURSES_BITS(1UL,9) 18343 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 18344 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 18345 18346 extern int addch(const chtype); 18347 extern int addchnstr(const chtype *, int); 18348 extern int addchstr(const chtype *); 18349 extern int addnstr(const char *, int); 18350 extern int addstr(const char *); 18351 extern int attroff(int); 18352 extern int attron(int); 18353 extern int attrset(int); 18354 extern int attr_get(attr_t *, short *, void *); 18355 extern int attr_off(attr_t, void *); 18356 extern int attr_on(attr_t, void *); 18357 extern int attr_set(attr_t, short, void *); 18358 extern int baudrate(void); 18359 extern int beep(void); 18360 extern int bkgd(chtype); 18361 extern void bkgdset(chtype); 18362 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 18363 chtype); 18364 extern int box(WINDOW *, chtype, chtype); 18365 extern bool can_change_color(void); 18366 extern int cbreak(void); 18367 extern int chgat(int, attr_t, short, const void *); 18368 extern int clear(void); 18369 extern int clearok(WINDOW *, bool); 18370 extern int clrtobot(void); 18371 extern int clrtoeol(void); 18372 extern int color_content(short, short *, short *, short *); 18373 extern int color_set(short, void *); 18374 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 18375 int); 18376 extern int curs_set(int); 18377 extern int def_prog_mode(void); 18378 extern int def_shell_mode(void); 18379 extern int delay_output(int); 18380 extern int delch(void); 18381 extern void delscreen(SCREEN *); 18382 extern int delwin(WINDOW *); 18383 extern int deleteln(void); 18384 extern WINDOW *derwin(WINDOW *, int, int, int, int); 18385 extern int doupdate(void); 18386 extern WINDOW *dupwin(WINDOW *); 18387 extern int echo(void); 18388 extern int echochar(const chtype); 18389 extern int erase(void); 18390 extern int endwin(void); 18391 extern char erasechar(void); 18392 extern void filter(void); 18393 extern int flash(void); 18394 extern int flushinp(void); 18395 extern chtype getbkgd(WINDOW *); 18396 extern int getch(void); 18397 extern int getnstr(char *, int); 18398 extern int getstr(char *); 18399 extern WINDOW *getwin(FILE *); 18400 extern int halfdelay(int); 18401 extern bool has_colors(void); 18402 extern bool has_ic(void); 18403 extern bool has_il(void); 18404 extern int hline(chtype, int); 18405 extern void idcok(WINDOW *, bool); 18406 extern int idlok(WINDOW *, bool); 18407 extern void immedok(WINDOW *, bool); 18408 extern chtype inch(void); 18409 extern int inchnstr(chtype *, int); 18410 extern int inchstr(chtype *); 18411 extern WINDOW *initscr(void); 18412 extern int init_color(short, short, short, short); 18413 extern int init_pair(short, short, short); 18414 extern int innstr(char *, int); 18415 extern int insch(chtype); 18416 extern int insdelln(int); 18417 extern int insertln(void); 18418 extern int insnstr(const char *, int); 18419 extern int insstr(const char *); 18420 extern int instr(char *); 18421 extern int intrflush(WINDOW *, bool); 18422 extern bool isendwin(void); 18423 extern bool is_linetouched(WINDOW *, int); 18424 extern bool is_wintouched(WINDOW *); 18425 extern const char *keyname(int); 18426 extern int keypad(WINDOW *, bool); 18427 extern char killchar(void); 18428 extern int leaveok(WINDOW *, bool); 18429 extern char *longname(void); 18430 extern int meta(WINDOW *, bool); 18431 extern int move(int, int); 18432 extern int mvaddch(int, int, const chtype); 18433 extern int mvaddchnstr(int, int, const chtype *, int); 18434 extern int mvaddchstr(int, int, const chtype *); 18435 extern int mvaddnstr(int, int, const char *, int); 18436 extern int mvaddstr(int, int, const char *); 18437 extern int mvchgat(int, int, int, attr_t, short, const void *); 18438 extern int mvcur(int, int, int, int); 18439 extern int mvdelch(int, int); 18440 extern int mvderwin(WINDOW *, int, int); 18441 extern int mvgetch(int, int); 18442 extern int mvgetnstr(int, int, char *, int); 18443 extern int mvgetstr(int, int, char *); 18444 extern int mvhline(int, int, chtype, int); 18445 extern chtype mvinch(int, int); 18446 extern int mvinchnstr(int, int, chtype *, int); 18447 extern int mvinchstr(int, int, chtype *); 18448 extern int mvinnstr(int, int, char *, int); 18449 extern int mvinsch(int, int, chtype); 18450 extern int mvinsnstr(int, int, const char *, int); 18451 extern int mvinsstr(int, int, const char *); 18452 extern int mvinstr(int, int, char *); 18453 extern int mvprintw(int, int, char *, ...); 18454 extern int mvscanw(int, int, const char *, ...); 18455 extern int mvvline(int, int, chtype, int); 18456 extern int mvwaddch(WINDOW *, int, int, const chtype); 18457 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 18458 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 18459 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 18460 extern int mvwaddstr(WINDOW *, int, int, const char *); 18461 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void*); 18462 extern int mvwdelch(WINDOW *, int, int); 18463 extern int mvwgetch(WINDOW *, int, int); 18464 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 18465 extern int mvwgetstr(WINDOW *, int, int, char *); 18466 extern int mvwhline(WINDOW *, int, int, chtype, int); 18467 extern int mvwin(WINDOW *, int, int); 18468 extern chtype mvwinch(WINDOW *, int, int); 18469 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 18470 extern int mvwinchstr(WINDOW *, int, int, chtype *); 18471 extern int mvwinnstr(WINDOW *, int, int, char *, int); 18472 extern int mvwinsch(WINDOW *, int, int, chtype); 18473 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 18474 extern int mvwinsstr(WINDOW *, int, int, const char *); 18475 extern int mvwinstr(WINDOW *, int, int, char *); 18476 extern int mvwprintw(WINDOW *, int, int, char *, ...); 18477 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 18478 extern int mvwvline(WINDOW *, int, int, chtype, int); 18479 extern int napms(int); 18480 extern WINDOW *newpad(int, int); 18481 extern SCREEN *newterm(const char *, FILE *, FILE *); 18482 extern WINDOW *newwin(int, int, int, int); 18483 extern int nl(void); 18484 extern int nocbreak(void); 18485 extern int nodelay(WINDOW *, bool); 18486 extern int noecho(void); 18487 extern int nonl(void); 18488 extern void noqiflush(void); 18489 extern int noraw(void); 18490 extern int notimeout(WINDOW *, bool); 18491 extern int overlay(const WINDOW *, WINDOW *); 18492 extern int overwrite(const WINDOW *, WINDOW *); 18493 extern int pair_content(short, short *, short *); 18494 extern int pechochar(WINDOW *, chtype); 18495 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 18496 extern int prefresh(WINDOW *, int, int, int, int, int, int); 18497 extern int printw(char *, ...); 18498 extern int putwin(WINDOW *, FILE *); 18499 extern void qiflush(void); 18500 extern int raw(void); 18501 extern int redrawwin(WINDOW *); 18502 extern int refresh(void); 18503 extern int resetty(void); 18504 extern int reset_prog_mode(void); 18505 extern int reset_shell_mode(void); 18506 extern int ripoffline(int, int (*_bkgrnd) (WINDOW *, int) 18507 ); 18508 extern int savetty(void); 18509 extern int scanw(const char *, ...); 18510 extern int scr_dump(const char *); 18511 extern int scr_init(const char *); 18512 extern int scrl(int); 18513 extern int scroll(WINDOW *); 18514 extern int scrollok(WINDOW *, bool); 18515 extern int scr_restore(const char *); 18516 extern int scr_set(const char *); 18517 extern int setscrreg(int, int); 18518 extern SCREEN *set_term(SCREEN *); 18519 extern int slk_attroff(const chtype); 18520 extern int slk_attron(const chtype); 18521 extern int slk_attrset(const chtype); 18522 extern int slk_attr_set(const attr_t, short, void *); 18523 extern int slk_clear(void); 18524 extern int slk_color(short); 18525 extern int slk_init(int); 18526 extern char *slk_label(int); 18527 extern int slk_noutrefresh(void); 18528 extern int slk_refresh(void); 18529 extern int slk_restore(void); 18530 extern int slk_set(int, const char *, int); 18531 extern int slk_touch(void); 18532 extern int standout(void); 18533 extern int standend(void); 18534 extern int start_color(void); 18535 extern WINDOW *subpad(WINDOW *, int, int, int, int); 18536 extern WINDOW *subwin(WINDOW *, int, int, int, int); 18537 extern int syncok(WINDOW *, bool); 18538 extern chtype termattrs(void); 18539 extern char *termname(void); 18540 extern void timeout(int); 18541 extern int typeahead(int); 18542 extern int ungetch(int); 18543 extern int untouchwin(WINDOW *); 18544 extern void use_env(bool); 18545 extern int vidattr(chtype); 18546 extern int vidputs(chtype, int (*_bkgrnd) (int) 18547 ); 18548 extern int vline(chtype, int); 18549 extern int vwprintw(WINDOW *, char *, va_list); 18550 extern int vw_printw(WINDOW *, const char *, va_list); 18551 extern int vwscanw(WINDOW *, const char *, va_list); 18552 extern int vw_scanw(WINDOW *, const char *, va_list); 18553 extern int waddch(WINDOW *, const chtype); 18554 extern int waddchnstr(WINDOW *, const chtype *, int); 18555 extern int waddchstr(WINDOW *, const chtype *); 18556 extern int waddnstr(WINDOW *, const char *, int); 18557 extern int waddstr(WINDOW *, const char *); 18558 extern int wattron(WINDOW *, int); 18559 extern int wattroff(WINDOW *, int); 18560 extern int wattrset(WINDOW *, int); 18561 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 18562 extern int wattr_on(WINDOW *, attr_t, void *); 18563 extern int wattr_off(WINDOW *, attr_t, void *); 18564 extern int wattr_set(WINDOW *, attr_t, short, void *); 18565 extern int wbkgd(WINDOW *, chtype); 18566 extern void wbkgdset(WINDOW *, chtype); 18567 extern int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, 18568 chtype, chtype, chtype); 18569 extern int wchgat(WINDOW *, int, attr_t, short, const void *); 18570 extern int wclear(WINDOW *); 18571 extern int wclrtobot(WINDOW *); 18572 extern int wclrtoeol(WINDOW *); 18573 extern int wcolor_set(WINDOW *, short, void *); 18574 extern void wcursyncup(WINDOW *); 18575 extern int wdelch(WINDOW *); 18576 extern int wdeleteln(WINDOW *); 18577 extern int wechochar(WINDOW *, const chtype); 18578 extern int werase(WINDOW *); 18579 extern int wgetch(WINDOW *); 18580 extern int wgetnstr(WINDOW *, char *, int); 18581 extern int wgetstr(WINDOW *, char *); 18582 extern int whline(WINDOW *, chtype, int); 18583 extern chtype winch(WINDOW *); 18584 extern int winchnstr(WINDOW *, chtype *, int); 18585 extern int winchstr(WINDOW *, chtype *); 18586 extern int winnstr(WINDOW *, char *, int); 18587 extern int winsch(WINDOW *, chtype); 18588 extern int winsdelln(WINDOW *, int); 18589 extern int winsertln(WINDOW *); 18590 extern int winsnstr(WINDOW *, const char *, int); 18591 extern int winsstr(WINDOW *, const char *); 18592 extern int winstr(WINDOW *, char *); 18593 extern int wmove(WINDOW *, int, int); 18594 extern int wnoutrefresh(WINDOW *); 18595 extern int wprintw(WINDOW *, char *, ...); 18596 extern int wredrawln(WINDOW *, int, int); 18597 extern int wrefresh(WINDOW *); 18598 extern int wscanw(WINDOW *, const char *, ...); 18599 extern int wscrl(WINDOW *, int); 18600 extern int wsetscrreg(WINDOW *, int, int); 18601 extern int wstandout(WINDOW *); 18602 extern int wstandend(WINDOW *); 18603 extern void wsyncdown(WINDOW *); 18604 extern void wsyncup(WINDOW *); 18605 extern void wtimeout(WINDOW *, int); 18606 extern int wtouchln(WINDOW *, int, int, int); 18607 extern int wvline(WINDOW *, chtype, int); 18608 extern char *unctrl(chtype); 18609 extern int COLORS; 18610 extern int COLOR_PAIRS; 18611 extern chtype acs_map[]; 18612 extern WINDOW *curscr; 18613 extern WINDOW *stdscr; 18614 extern int COLS; 18615 extern int LINES; 18616 extern int touchline(WINDOW *, int, int); 18617 extern int touchwin(WINDOW *); 18618 _________________________________________________________ 18619 18620 14.6.2. term.h 18621 18622 extern int putp(const char *); 18623 extern int tigetflag(const char *); 18624 extern int tigetnum(const char *); 18625 extern char *tigetstr(const char *); 18626 extern char *tparm(const char *, ...); 18627 extern TERMINAL *set_curterm(TERMINAL *); 18628 extern int del_curterm(TERMINAL *); 18629 extern int restartterm(char *, int, int *); 18630 extern int setupterm(char *, int, int *); 18631 extern char *tgetstr(char *, char **); 18632 extern char *tgoto(const char *, int, int); 18633 extern int tgetent(char *, const char *); 18634 extern int tgetflag(char *); 18635 extern int tgetnum(char *); 18636 extern int tputs(const char *, int, int (*)(int) 18637 ); 18638 extern TERMINAL *cur_term; 18639 _________________________________________________________ 18640 18641 14.7. Interfaces for libutil 18642 18643 Table 14-6 defines the library name and shared object name for 18644 the libutil library 18645 18646 Table 14-6. libutil Definition 18647 Library: libutil 18648 SONAME: libutil.so.1 18649 18650 The behavior of the interfaces in this library is specified by 18651 the following specifications: 18652 18653 [LSB] This Specification 18654 _________________________________________________________ 18655 18656 14.7.1. Utility Functions 18657 _________________________________________________________ 18658 18659 14.7.1.1. Interfaces for Utility Functions 18660 18661 An LSB conforming implementation shall provide the generic 18662 functions for Utility Functions specified in Table 14-7, with 18663 the full mandatory functionality as described in the 18664 referenced underlying specification. 18665 18666 Table 14-7. libutil - Utility Functions Function Interfaces 18667 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 18668 logwtmp [LSB] openpty [LSB] 18669 _________________________________________________________ 18670 18671 14.8. Interface Definitions for libutil 18672 18673 Table of Contents 18674 forkpty -- Create a new process attached to an available 18675 pseudo-terminal 18676 18677 login -- login utility function 18678 login_tty -- Prepare a terminal for login 18679 logout -- logout utility function 18680 logwtmp -- append an entry to the wtmp file 18681 openpty -- find and open an available pseudo-terminal 18682 18683 The interfaces defined on the following pages are included in 18684 libutil and are defined by this specification. Unless 18685 otherwise noted, these interfaces shall be included in the 18686 source standard. 18687 18688 Other interfaces listed in Section 14.7 shall behave as 18689 described in the referenced base document. 18690 18691 forkpty 18692 18693 Name 18694 18695 forkpty -- Create a new process attached to an available 18696 pseudo-terminal 18697 18698 Synopsis 18699 18700 #include 18701 18702 int forkpty(int * amaster, char * name, struct termios * 18703 termp, struct winsize * winp); 18704 18705 Description 18706 18707 The forkpty() function shall find and open a pseudo-terminal 18708 device pair in the same manner as the openpty() function. If a 18709 pseudo-terminal is available, forkpty() shall create a new 18710 process in the same manner as the fork() function, and 18711 prepares the new process for login in the same manner as 18712 login_tty(). 18713 18714 If termp is not null, it shall refer to a termios structure 18715 that shall be used to initialize the characteristics of the 18716 slave device. If winp is not null, it shall refer to a winsize 18717 structure used to initialize the window size of the slave 18718 device. 18719 18720 Return Value 18721 18722 On success, the parent process shall return the process id of 18723 the child, and the child shall return 0. On error, no new 18724 process shall be created, -1 shall be returned, and errno 18725 shall be set appropriately. On success, the parent process 18726 shall receive the file descriptor of the master side of the 18727 pseudo-terminal in the location referenced by amaster, and, if 18728 name is not NULL, the filename of the slave device in name. 18729 18730 Errors 18731 18732 EAGAIN 18733 18734 Unable to create a new process. 18735 ENOENT 18736 18737 There are no available pseudo-terminals. 18738 ENOMEM 18739 18740 Insufficient memory was available. 18741 18742 login 18743 18744 Name 18745 18746 login -- login utility function 18747 18748 Synopsis 18749 18750 #include 18751 18752 void login (struct utmp * ut ); 18753 18754 Description 18755 18756 The login() function shall update the user accounting 18757 databases. The ut parameter shall reference a utmp structure 18758 for all fields except the following: 18759 18760 1. The ut_type field shall be set to USER_PROCESS. 18761 2. The ut_pid field shall be set to the process identifier 18762 for the current process. 18763 3. The ut_line field shall be set to the name of the 18764 controlling terminal device. The name shall be found by 18765 examining the device associated with the standard input, 18766 output and error streams in sequence, until one associated 18767 with a terminal device is found. If none of these streams 18768 refers to a terminal device, the ut_line field shall be 18769 set to "???". If the terminal device is in the /dev 18770 directory hierarchy, the ut_line field shall not contain 18771 the leading "/dev/", otherwise it shall be set to the 18772 final component of the pathname of the device. If the user 18773 accounting database imposes a limit on the size of the 18774 ut_line field, it shall truncate the name, but any such 18775 limit shall not be smaller than UT_LINESIZE (including a 18776 terminating null character). 18777 18778 Return Value 18779 18780 None 18781 18782 Errors 18783 18784 None 18785 18786 login_tty 18787 18788 Name 18789 18790 login_tty -- Prepare a terminal for login 18791 18792 Synopsis 18793 18794 #include 18795 18796 int login_tty (int fdr); 18797 18798 Description 18799 18800 The login_tty() function shall prepare the terminal device 18801 referenced by the file descriptor fdr. This function shall 18802 create a new session, make the terminal the controlling 18803 terminal for the current process, and set the standard input, 18804 output, and error streams of the current process to the 18805 terminal. If fdr is not the standard input, output or error 18806 stream, then login_tty() shall close fdr. 18807 18808 Return Value 18809 18810 On success, login_tty() shall return zero; otherwise -1 is 18811 returned, and errno shall be set appropriately. 18812 18813 Errors 18814 18815 ENOTTY 18816 18817 fdr does not refer to a terminal device. 18818 18819 logout 18820 18821 Name 18822 18823 logout -- logout utility function 18824 18825 Synopsis 18826 18827 #include 18828 18829 int logout (const char * line ); 18830 18831 Description 18832 18833 Given the device line, the logout() function shall search the 18834 user accounting database which is read by getutent() for an 18835 entry with the corresponding line, and with the type of 18836 USER_PROCESS. If a corresponding entry is located, it shall be 18837 updated as follows: 18838 18839 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 18840 bytes). 18841 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 18842 bytes). 18843 3. The ut_tv shall be set to the current time of day. 18844 4. The ut_type field shall be set to DEAD_PROCESS. 18845 18846 Return Value 18847 18848 On success, the logout() function shall return non-zero. Zero 18849 is returned if there was no entry to remove, or if the utmp 18850 file could not be opened or updated. 18851 18852 logwtmp 18853 18854 Name 18855 18856 logwtmp -- append an entry to the wtmp file 18857 18858 Synopsis 18859 18860 #include 18861 18862 void logwtmp (const char * line , const char * name , const 18863 char * host ); 18864 18865 Description 18866 18867 If the process has permission to update the user accounting 18868 databases, the logwtmp() function shall append a record to the 18869 user accounting database that records all logins and logouts. 18870 The record to be appended shall be constructed as follows: 18871 18872 1. The ut_line field shall be initialized from line. If the 18873 user accounting database imposes a limit on the size of 18874 the ut_line field, it shall truncate the value, but any 18875 such limit shall not be smaller than UT_LINESIZE 18876 (including a terminating null character). 18877 2. The ut_name field shall be initialized from name. If the 18878 user accounting database imposes a limit on the size of 18879 the ut_name field, it shall truncate the value, but any 18880 such limit shall not be smaller than UT_NAMESIZE 18881 (including a terminating null character). 18882 3. The ut_host field shall be initialized from host. If the 18883 user accounting database imposes a limit on the size of 18884 the ut_host field, it shall truncate the value, but any 18885 such limit shall not be smaller than UT_HOSTSIZE 18886 (including a terminating null character). 18887 4. If the name parameter does not refer to an empty string 18888 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 18889 otherwise the ut_type field shall be set to DEAD_PROCESS. 18890 5. The ut_id field shall be set to the process identifier for 18891 the current process. 18892 6. The ut_tv field shall be set to the current time of day. 18893 18894 Note: If a process does not have write access to the the 18895 user accounting database, the logwtmp() function will not 18896 update it. Since the function does not return any value, an 18897 application has no way of knowing whether it succeeded or 18898 failed. 18899 18900 Return Value 18901 18902 None. 18903 18904 openpty 18905 18906 Name 18907 18908 openpty -- find and open an available pseudo-terminal 18909 18910 Synopsis 18911 18912 #include 18913 18914 int openpty(int *amaster, int *aslave, char *name, struct 18915 termios *termp, struct winsize *winp); 18916 18917 Description 18918 18919 The openpty() function shall find an available pseudo-terminal 18920 and return file descriptors for the master and slave devices 18921 in the locations referenced by amaster and aslave 18922 respectively. If name is not NULL, the filename of the slave 18923 shall be placed in the user supplied buffer referenced by 18924 name. If termp is not NULL, it shall point to a termios 18925 structure used to initialize the terminal parameters of the 18926 slave pseudo-terminal device. If winp is not NULL, it shall 18927 point to a winsize structure used to initialize the window 18928 size parameters of the slave pseudo-terminal device. 18929 18930 Return Value 18931 18932 On success, zero is returned. On error, -1 is returned, and 18933 errno is set appropriately. 18934 18935 Errors 18936 18937 ENOENT 18938 18939 There are no available pseudo-terminals. 18940 18941 V. Commands and Utilities 18942 18943 Table of Contents 18944 15. Commands and Utilities 18945 18946 15.1. Commands and Utilities 18947 15.2. Command Behavior 18948 18949 ar -- create and maintain library archives 18950 (DEPRECATED) 18951 18952 at -- examine or delete jobs for later execution 18953 awk -- pattern scanning and processing language 18954 batch -- schedule commands to be executed in a 18955 batch queue 18956 18957 bc -- an arbitrary precision calculator language 18958 chfn -- change user name and information 18959 chsh -- change login shell 18960 col -- filter reverse line feeds from input 18961 cpio -- copy file archives in and out 18962 crontab -- maintain crontab files for individual 18963 users 18964 18965 cut -- split a file into sections determined by 18966 context lines 18967 18968 df -- report file system disk space usage 18969 dmesg -- print or control the system message buffer 18970 du -- estimate file space usage 18971 echo -- write arguments to standard output 18972 egrep -- search a file with an Extended Regular 18973 Expression pattern 18974 18975 fgrep -- search a file with a fixed pattern 18976 file -- determine file type 18977 find -- search for files in a directory hierarchy 18978 fuser -- identify processes using files or sockets 18979 gettext -- retrieve text string from message 18980 catalog 18981 18982 grep -- print lines matching a pattern 18983 groupadd -- create a new group 18984 groupdel -- delete a group 18985 groupmod -- modify a group 18986 groups -- display a group 18987 gunzip -- uncompress files 18988 gzip -- compress or expand files 18989 hostname -- show or set the system's host name 18990 install -- copy files and set attributes 18991 install_initd -- activate an init script 18992 ipcrm -- remove IPC Resources 18993 ipcs -- provide information on ipc facilities 18994 killall -- kill processes by name 18995 lpr -- off line print 18996 ls -- list directory contents 18997 lsb_release -- print distribution specific 18998 information 18999 19000 m4 -- macro processor 19001 md5sum -- generate or check MD5 message digests 19002 mknod -- make special files 19003 mktemp -- make temporary file name (unique) 19004 more -- display files on a page-by-page basis 19005 mount -- mount a file system 19006 msgfmt -- create a message object from a message 19007 file 19008 19009 newgrp -- change group ID 19010 od -- dump files in octal and other formats 19011 passwd -- change user password 19012 patch -- apply a diff file to an original 19013 pidof -- find the process ID of a running program 19014 remove_initd -- clean up init script system 19015 modifications introduced by install_initd 19016 19017 renice -- alter priority of running processes 19018 sed -- stream editor 19019 sendmail -- an electronic mail transport agent 19020 sh -- shell, the standard command language 19021 interpreter 19022 19023 shutdown -- shut the system down 19024 su -- change user ID 19025 sync -- flush file system buffers 19026 tar -- file archiver 19027 umount -- unmount file systems 19028 useradd -- create a new user or update default new 19029 user information 19030 19031 userdel -- delete a user account and related files 19032 usermod -- modify a user account 19033 xargs -- build and execute command lines from 19034 standard input 19035 _________________________________________________________ 19036 19037 Chapter 15. Commands and Utilities 19038 19039 15.1. Commands and Utilities 19040 19041 An LSB conforming implementation shall provide the commands 19042 and utilities as described in Table 15-1, with at least the 19043 behavior described as mandatory in the referenced underlying 19044 specification, with the following exceptions: 19045 19046 1. If any operand (except one which follows --) starts with a 19047 hyphen, the behavior is unspecified. 19048 19049 Rationale (Informative): Applications should place options 19050 before operands, or use --, as needed. This text is needed 19051 because, by default, GNU option parsing differs from POSIX, 19052 unless the environment variable POSIXLY_CORRECT is set. For 19053 example, ls . -a in GNU ls means to list the current 19054 directory, showing all files (that is, "." is an operand 19055 and -a is an option). In POSIX, "." and -a are both 19056 operands, and the command means to list the current 19057 directory, and also the file named -a. Suggesting that 19058 applications rely on the setting of the POSIXLY_CORRECT 19059 environment variable, or try to set it, seems worse than 19060 just asking the applictions to invoke commands in ways 19061 which work with either the POSIX or GNU behaviors. 19062 19063 Table 15-1. Commands And Utilities 19064 [ [1] dmesg [2] id [1] mount [2] sort [1] 19065 ar [2] du [2] install [2] msgfmt [2] split [1] 19066 at [2] echo [2] install_initd [2] mv [1] strip [1] 19067 awk [2] ed [1] ipcrm [2] newgrp [2] stty [1] 19068 basename [1] egrep [2] ipcs [2] nice [1] su [2] 19069 batch [2] env [1] join [1] nl [1] sync [2] 19070 bc [2] expand [1] kill [1] nohup [1] tail [1] 19071 cat [1] expr [1] killall [2] od [2] tar [2] 19072 chfn [2] false [1] ln [1] passwd [2] tee [1] 19073 chgrp [1] fgrep [2] locale [1] paste [1] test [1] 19074 chmod [1] file [2] localedef [1] patch [2] time [1] 19075 chown [1] find [2] logger [1] pathchk [1] touch [1] 19076 chsh [2] fold [1] logname [1] pax [1] tr [1] 19077 cksum [1] fuser [2] lp [1] pidof [2] true [1] 19078 cmp [1] gencat [1] lpr [2] pr [1] tsort [1] 19079 col [2] getconf [1] ls [2] printf [1] tty [1] 19080 comm [1] gettext [2] lsb_release [2] ps [1] umount [2] 19081 cp [1] grep [2] m4 [2] pwd [1] uname [1] 19082 cpio [2] groupadd [2] mailx [1] remove_initd [2] unexpand [1] 19083 crontab [2] groupdel [2] make [1] renice [2] uniq [1] 19084 csplit [1] groupmod [2] man [1] rm [1] useradd [2] 19085 cut [2] groups [2] md5sum [2] rmdir [1] userdel [2] 19086 date [1] gunzip [2] mkdir [1] sed [2] usermod [2] 19087 dd [1] gzip [2] mkfifo [1] sendmail [2] wc [1] 19088 df [2] head [1] mknod [2] sh [2] xargs [2] 19089 diff [1] hostname [2] mktemp [2] shutdown [2] 19090 dirname [1] iconv [1] more [2] sleep [1] 19091 19092 Referenced Specification(s) 19093 19094 [1]. ISO POSIX (2003) 19095 19096 [2]. This Specification 19097 19098 An LSB conforming implementation shall provide the shell built 19099 in utilities as described in Table 15-2, with at least the 19100 behavior described as mandatory in the referenced underlying 19101 specification, with the following exceptions: 19102 19103 1. The built in commands and utilities shall be provided by 19104 the sh utility itself, and need not be implemented in a 19105 manner so that they can be accessed via the exec family of 19106 functions as defined in ISO POSIX (2003) and should not be 19107 invoked directly by those standard utilities that execute 19108 other utilities ( env, find, nice, nohup, time, xargs). 19109 19110 Rationale (Informative): Since the built in utilities must 19111 affect the environment of the calling process, they have no 19112 effect when executed as a file. 19113 19114 Table 15-2. Built In Utilities 19115 cd [1] getopts [1] read [1] umask [1] wait [1] 19116 19117 Referenced Specification(s) 19118 19119 [1]. ISO POSIX (2003) 19120 _________________________________________________________ 19121 19122 15.2. Command Behavior 19123 19124 Table of Contents 19125 ar -- create and maintain library archives (DEPRECATED) 19126 at -- examine or delete jobs for later execution 19127 awk -- pattern scanning and processing language 19128 batch -- schedule commands to be executed in a batch queue 19129 bc -- an arbitrary precision calculator language 19130 chfn -- change user name and information 19131 chsh -- change login shell 19132 col -- filter reverse line feeds from input 19133 cpio -- copy file archives in and out 19134 crontab -- maintain crontab files for individual users 19135 cut -- split a file into sections determined by context lines 19136 df -- report file system disk space usage 19137 dmesg -- print or control the system message buffer 19138 du -- estimate file space usage 19139 echo -- write arguments to standard output 19140 egrep -- search a file with an Extended Regular Expression 19141 pattern 19142 19143 fgrep -- search a file with a fixed pattern 19144 file -- determine file type 19145 find -- search for files in a directory hierarchy 19146 fuser -- identify processes using files or sockets 19147 gettext -- retrieve text string from message catalog 19148 grep -- print lines matching a pattern 19149 groupadd -- create a new group 19150 groupdel -- delete a group 19151 groupmod -- modify a group 19152 groups -- display a group 19153 gunzip -- uncompress files 19154 gzip -- compress or expand files 19155 hostname -- show or set the system's host name 19156 install -- copy files and set attributes 19157 install_initd -- activate an init script 19158 ipcrm -- remove IPC Resources 19159 ipcs -- provide information on ipc facilities 19160 killall -- kill processes by name 19161 lpr -- off line print 19162 ls -- list directory contents 19163 lsb_release -- print distribution specific information 19164 m4 -- macro processor 19165 md5sum -- generate or check MD5 message digests 19166 mknod -- make special files 19167 mktemp -- make temporary file name (unique) 19168 more -- display files on a page-by-page basis 19169 mount -- mount a file system 19170 msgfmt -- create a message object from a message file 19171 newgrp -- change group ID 19172 od -- dump files in octal and other formats 19173 passwd -- change user password 19174 patch -- apply a diff file to an original 19175 pidof -- find the process ID of a running program 19176 remove_initd -- clean up init script system modifications 19177 introduced by install_initd 19178 19179 renice -- alter priority of running processes 19180 sed -- stream editor 19181 sendmail -- an electronic mail transport agent 19182 sh -- shell, the standard command language interpreter 19183 shutdown -- shut the system down 19184 su -- change user ID 19185 sync -- flush file system buffers 19186 tar -- file archiver 19187 umount -- unmount file systems 19188 useradd -- create a new user or update default new user 19189 information 19190 19191 userdel -- delete a user account and related files 19192 usermod -- modify a user account 19193 xargs -- build and execute command lines from standard input 19194 19195 This section contains descriptions for commands and utilities 19196 whose specified behavior in the LSB contradicts or extends the 19197 standards referenced. It also contains commands and utilities 19198 only required by the LSB and not specified by other standards. 19199 19200 ar 19201 19202 Name 19203 19204 ar -- create and maintain library archives (DEPRECATED) 19205 19206 Description 19207 19208 ar is deprecated from the LSB and is expected to disappear 19209 from a future version of the LSB. 19210 19211 Rationale: The LSB generally does not include software 19212 development utilities nor does it specify .o and .a file 19213 formats. 19214 19215 ar is as specified in ISO POSIX (2003) but with differences as 19216 listed below. 19217 19218 Differences 19219 19220 -T, -C 19221 19222 need not be accepted. 19223 -l 19224 19225 has unspecified behavior. 19226 -q 19227 19228 has unspecified behavior; using -r is suggested. 19229 19230 at 19231 19232 Name 19233 19234 at -- examine or delete jobs for later execution 19235 19236 Description 19237 19238 at is as specified in ISO POSIX (2003) but with differences as 19239 listed below. 19240 19241 Differences 19242 19243 Options 19244 19245 -d 19246 19247 is functionally equivalent to the -r option specified in ISO 19248 POSIX (2003). 19249 -r 19250 19251 need not be supported, but the '-d' option is equivalent. 19252 -t time 19253 19254 need not be supported. 19255 19256 Optional Control Files 19257 19258 The implementation shall support the XSI optional behavior for 19259 access control; however the files at.allow and at.deny may 19260 reside in /etc rather than /usr/lib/cron. 19261 19262 awk 19263 19264 Name 19265 19266 awk -- pattern scanning and processing language 19267 19268 Description 19269 19270 awk is as specified in ISO POSIX (2003) but with differences 19271 as listed below. 19272 19273 Differences 19274 19275 Certain aspects of internationalized regular expressions are 19276 optional; see Regular Expressions. 19277 19278 batch 19279 19280 Name 19281 19282 batch -- schedule commands to be executed in a batch queue 19283 19284 Description 19285 19286 The specification for batch is as specified in ISO POSIX 19287 (2003), but with differences as listed below. 19288 19289 Optional Control Files 19290 19291 The implementation shall support the XSI optional behavior for 19292 access control; however the files at.allow and at.deny may 19293 reside in /etc rather than /usr/lib/cron. 19294 19295 bc 19296 19297 Name 19298 19299 bc -- an arbitrary precision calculator language 19300 19301 Description 19302 19303 bc is as specified in ISO POSIX (2003) but with extensions as 19304 listed below. 19305 19306 Extensions 19307 19308 The bc language may be extended in an implementation defined 19309 manner. If an implementation supports extensions, it shall 19310 also support the additional options: 19311 19312 -s|--standard 19313 19314 processes exactly the POSIX bc language. 19315 -w|--warn 19316 19317 gives warnings for extensions to POSIX bc. 19318 19319 chfn 19320 19321 Name 19322 19323 chfn -- change user name and information 19324 19325 Synopsis 19326 19327 chfn [-f full_name] [-h home_phone] [user] 19328 19329 Description 19330 19331 chfn shall update the user database. An unprivileged user may 19332 only change the fields for their own account, a user with 19333 appropriate privileges may change the fields for any account. 19334 19335 The fields full_name and home_phone may contain any character 19336 except: 19337 19338 any control character 19339 comma 19340 colon 19341 equal sign 19342 19343 If none of the options are selected, chfn operates in an 19344 interactive fashion. The prompts and expected input in 19345 interactive mode are unspecified and should not be relied 19346 upon. 19347 19348 As it is possible for the system to be configured to restrict 19349 which fields a non-privileged user is permitted to change, 19350 applications should be written to gracefully handle these 19351 situations. 19352 19353 Standard Options 19354 19355 -f full_name 19356 19357 sets the user's full name. 19358 -h home_phone 19359 19360 sets the user's home phone number. 19361 19362 Future Directions 19363 19364 The following two options are expected to be added in a future 19365 version of the LSB: 19366 19367 -o office 19368 19369 sets the user's office room number. 19370 -p office_phone 19371 19372 sets the user's office phone number. 19373 19374 Note that some implementations contain a "-o other" option 19375 which specifies an additional field called "other". 19376 Traditionally, this field is not subject to the constraints 19377 about legitimate characters in fields. Also, one traditionally 19378 shall have appropriate privileges to change the other field. 19379 At this point there is no consensus about whether it is 19380 desirable to specify the other field; applications may wish to 19381 avoid using it. 19382 19383 The "-w work_phone" field found in some implementations should 19384 be replaced by the "-p office_phone" field. The "-r 19385 room_number" field found in some implementations is the 19386 equivalent of the "-o office" option mentioned above; which 19387 one of these two options to specify will depend on 19388 implementation experience and the decision regarding the other 19389 field. 19390 19391 chsh 19392 19393 Name 19394 19395 chsh -- change login shell 19396 19397 Synopsis 19398 19399 chsh [-s login_shell] [user] 19400 19401 Description 19402 19403 chsh changes the user login shell. This determines the name of 19404 the user's initial login command. An unprivileged user may 19405 only change the login shell for their own account, a user with 19406 appropriate privilege may change the login shell for any 19407 account specified by user. 19408 19409 Unless the user has appropriate privilege, the initial login 19410 command name shall be one of those listed in /etc/shells. The 19411 login_shell shall be the absolute path (i.e. it must start 19412 with '/') to an executable file. Accounts which are restricted 19413 (in an implementation-defined manner) may not change their 19414 login shell. 19415 19416 If the -s option is not selected, chsh operates in an 19417 interactive mode. The prompts and expected input in this mode 19418 are unspecified. 19419 19420 Standard Options 19421 19422 -s login_shell 19423 19424 sets the login shell. 19425 19426 col 19427 19428 Name 19429 19430 col -- filter reverse line feeds from input 19431 19432 Description 19433 19434 col is as specified in SUSv2 but with differences as listed 19435 below. 19436 19437 Differences 19438 19439 The -p option has unspecified behavior. 19440 19441 Note: Although col is shown as legacy in SUSv2, it is not 19442 (yet) deprecated in the LSB. 19443 19444 cpio 19445 19446 Name 19447 19448 cpio -- copy file archives in and out 19449 19450 Description 19451 19452 cpio is as specified in SUSv2, but with differences as listed 19453 below. 19454 19455 Differences 19456 19457 Some elements of the Pattern Matching Notation are optional; 19458 see Pattern Matching Notation. 19459 19460 crontab 19461 19462 Name 19463 19464 crontab -- maintain crontab files for individual users 19465 19466 Synopsis 19467 19468 crontab [-u user] file 19469 crontab [-u user] {-l | -r | -e} 19470 19471 Description 19472 19473 crontab is as specified in ISO POSIX (2003), but with 19474 differences as listed below. 19475 19476 Optional Control Files 19477 19478 The implementation shall support the XSI optional behavior for 19479 access control; however the files cron.allow and cron.deny may 19480 reside in /etc rather than /usr/lib/cron. 19481 19482 cut 19483 19484 Name 19485 19486 cut -- split a file into sections determined by context lines 19487 19488 Description 19489 19490 cut is as specified in ISO POSIX (2003), but with differences 19491 as listed below. 19492 19493 Differences 19494 19495 -n 19496 19497 has unspecified behavior. 19498 19499 df 19500 19501 Name 19502 19503 df -- report file system disk space usage 19504 19505 Description 19506 19507 The df command shall behave as specified in ISO POSIX (2003), 19508 but with differences as listed below. 19509 19510 Differences 19511 19512 Options 19513 19514 If the -k option is not specified, disk space is shown in 19515 unspecified units. If the -P option is specified, the size of 19516 the unit shall be printed on the header line in the format 19517 "%4s-blocks". Applications should specify -k. 19518 19519 The XSI option -t has unspecified behavior. Applications 19520 should not specify -t. 19521 19522 Rationale: The most common implementation of df uses the -t 19523 option for a different purpose (restricting output to a 19524 particular file system type), and use of -t is therefore 19525 non-portable. 19526 19527 Operand May Identify Special File 19528 19529 If an argument is the absolute file name of a special file 19530 containing a mounted file system, df shall show the space 19531 available on that file system rather than on the file system 19532 containing the special file (which is typically the root file 19533 system). 19534 19535 Note: In ISO POSIX (2003) the XSI optional behavior permits 19536 an operand to name a special file, but appears to require 19537 the operation be performed on the file system containing 19538 the special file. A defect report has been submitted for 19539 this case. 19540 19541 dmesg 19542 19543 Name 19544 19545 dmesg -- print or control the system message buffer 19546 19547 Synopsis 19548 19549 dmesg [-c | -n level | -s bufsize] 19550 19551 Description 19552 19553 dmesg examines or controls the system message buffer. Only a 19554 user with appropriate privileges may modify the system message 19555 buffer parameters or contents. 19556 19557 Standard Options 19558 19559 -c 19560 19561 If the user has appropriate privilege, clears the system 19562 message buffer contents after printing. 19563 -n level 19564 19565 If the user has appropriate privilege, sets the level at which 19566 logging of messages is done to the console. 19567 -s bufsize 19568 19569 uses a buffer of bufsize to query the system message buffer. 19570 This is 16392 by default. 19571 19572 du 19573 19574 Name 19575 19576 du -- estimate file space usage 19577 19578 Description 19579 19580 du is as specified in ISO POSIX (2003), but with differences 19581 as listed below. 19582 19583 Differences 19584 19585 If the -k option is not specified, disk space is shown in 19586 unspecified units. Applications should specify -k. 19587 19588 echo 19589 19590 Name 19591 19592 echo -- write arguments to standard output 19593 19594 Synopsis 19595 19596 echo [string...] 19597 19598 Description 19599 19600 The echo command is as specified in ISO POSIX (2003), but with 19601 the following differences. 19602 19603 Implementations may support implementation-defined options to 19604 echo. The behavior of echo if any arguments contain 19605 backslashes is also implementation defined. 19606 19607 Application Usage 19608 19609 Conforming applications should not run echo with a first 19610 argument starting with a hyphen, or with any arguments 19611 containing backslashes; they should use printf in those cases. 19612 19613 Note: The behavior specified here is similar to that 19614 specified by ISO POSIX (2003) without the XSI option. 19615 However, the LSB strongly recommends conforming 19616 applications not use any options (even if the 19617 implementation provides them) while ISO POSIX (2003) 19618 specifies behavior if the first operand is the string -n. 19619 19620 egrep 19621 19622 Name 19623 19624 egrep -- search a file with an Extended Regular Expression 19625 pattern 19626 19627 Description 19628 19629 egrep is equivalent to grep -E. For further details, see the 19630 specification for grep. 19631 19632 fgrep 19633 19634 Name 19635 19636 fgrep -- search a file with a fixed pattern 19637 19638 Description 19639 19640 fgrep is equivalent to grep -F. For further details, see the 19641 specification for grep. 19642 19643 file 19644 19645 Name 19646 19647 file -- determine file type 19648 19649 Description 19650 19651 file is as specified in ISO POSIX (2003), but with differences 19652 as listed below. 19653 19654 Differences 19655 19656 The -M, -h, -d, and -i options need not be supported. 19657 19658 find 19659 19660 Name 19661 19662 find -- search for files in a directory hierarchy 19663 19664 Description 19665 19666 find shall behave as specified in ISO POSIX (2003), except as 19667 described below. 19668 19669 Differences 19670 19671 Pattern Matching 19672 19673 Some elements of the Pattern Matching Notation are optional; 19674 see Pattern Matching Notation. 19675 19676 Option and Operand Handling 19677 19678 Options and operands to find shall behave as described in ISO 19679 POSIX (2003), except as follows: 19680 19681 -H 19682 19683 need not be supported 19684 -L 19685 19686 need not be supported 19687 -exec ... + 19688 19689 argument aggregation need not be supported 19690 19691 Rationale: The -H and -L options are not yet widely 19692 available in implementations of the find command, nor is 19693 argument aggregation. A future version of this 19694 specification will require these features be supported. 19695 19696 fuser 19697 19698 Name 19699 19700 fuser -- identify processes using files or sockets 19701 19702 Description 19703 19704 fuser is as specified in ISO POSIX (2003), but with 19705 differences as listed below. 19706 19707 Differences 19708 19709 The fuser command is a system administration utility, see Path 19710 For System Administration Utilities. 19711 19712 Option Differences 19713 19714 -c 19715 19716 has unspecified behavior. 19717 -f 19718 19719 has unspecified behavior. 19720 19721 gettext 19722 19723 Name 19724 19725 gettext -- retrieve text string from message catalog 19726 19727 Synopsis 19728 19729 gettext [options] [textdomain] msgid 19730 gettext -s [options] msgid... 19731 19732 Description 19733 19734 The gettext utility retrieves a translated text string 19735 corresponding to string msgid from a message object generated 19736 with msgfmt utility. 19737 19738 The message object name is derived from the optional argument 19739 textdomain if present, otherwise from the TEXTDOMAIN 19740 environment variable. If no domain is specified, or if a 19741 corresponding string cannot be found, gettext prints msgid. 19742 19743 Ordinarily gettext looks for its message object in 19744 dirname/lang/LC_MESSAGES where dirname is the 19745 implementation-defined default directory and lang is the 19746 locale name. If present, the TEXTDOMAINDIR environment 19747 variable replaces the dirname. 19748 19749 This utility interprets C escape sequences such as \t for tab. 19750 Use \\ to print a backslash. To produce a message on a line of 19751 its own, either put a \n at the end of msgid, or use this 19752 command in conjunction with the printf utility. 19753 19754 When used with the -s option the gettext utility behaves like 19755 the echo utility, except that the message corresponding to 19756 msgid in the selected catalog provides the arguments. 19757 19758 Options 19759 19760 -d domainname, --domain=domainname 19761 19762 PARAMETER translated messages from domainname. 19763 -e 19764 19765 Enable expansion of some escape sequences. 19766 -n 19767 19768 Suppress trailing newline. 19769 19770 Operands 19771 19772 The following operands are supported: 19773 19774 textdomain 19775 19776 A domain name used to retrieve the messages. 19777 msgid 19778 19779 A key to retrieve the localized message. 19780 19781 Environment Variables 19782 19783 LANGUAGE 19784 19785 Specifies one or more locale names. 19786 LANG 19787 19788 Specifies locale name. 19789 LC_MESSAGES 19790 19791 Specifies messaging locale, and if present overrides LANG for 19792 messages. 19793 TEXTDOMAIN 19794 19795 Specifies the text domain name, which is identical to the 19796 message object filename without .mo suffix. 19797 TEXTDOMAINDIR 19798 19799 Specifies the pathname to the message catalog, and if present 19800 replaces the implementation-defined default directory. 19801 19802 Exit Status 19803 19804 The following exit values are returned: 19805 19806 0 19807 19808 Successful completion. 19809 >0 19810 19811 An error occurred. 19812 19813 grep 19814 19815 Name 19816 19817 grep -- print lines matching a pattern 19818 19819 Description 19820 19821 grep is as specified in ISO POSIX (2003), but with differences 19822 as listed below. 19823 19824 LSB Differences 19825 19826 Certain aspects of regular expression matching are optional; 19827 see Regular Expressions. 19828 19829 groupadd 19830 19831 Name 19832 19833 groupadd -- create a new group 19834 19835 Synopsis 19836 19837 groupadd [-g gid [-o]] group 19838 19839 Description 19840 19841 If the caller has appropriate privilege, the groupadd command 19842 shall create a new group named group. The group name shall be 19843 unique in the group database. If no gid is specified, groupadd 19844 shall create the new group with a unique group ID. 19845 19846 The groupadd command is a system administration utility, see 19847 Path For System Administration Utilities. 19848 19849 Options 19850 19851 -g gid [-o] 19852 19853 The new group shall have group ID gid. If the -o option is not 19854 used, no other group shall have this group ID. The value of 19855 gid shall be non-negative. 19856 19857 groupdel 19858 19859 Name 19860 19861 groupdel -- delete a group 19862 19863 Synopsis 19864 19865 groupdel group 19866 19867 Description 19868 19869 If the caller has sufficient privilege, the groupdel command 19870 shall modify the system group database, deleting the group 19871 named group. If the group named group does not exist, groupdel 19872 shall issue a diagnostic message and exit with a non-zero exit 19873 status. 19874 19875 The groupdel command is a system administration utility, see 19876 Path For System Administration Utilities. 19877 19878 groupmod 19879 19880 Name 19881 19882 groupmod -- modify a group 19883 19884 Synopsis 19885 19886 groupmod [-g gid [-o]] [-n group_name] group 19887 19888 Description 19889 19890 If the caller has appropriate privilege, the groupmod command 19891 shall modify the entry in the system group database 19892 corresponding to a group named group. 19893 19894 The groupmod command is a system administration utility, see 19895 Path For System Administration Utilities. 19896 19897 Options 19898 19899 -g gid [-o] 19900 19901 Modify the group's group ID, setting it to gid. If the -o 19902 option is not used, no other group shall have this group ID. 19903 The value of gidshall be non-negative. 19904 19905 Note: Only the group ID in the database is altered; any 19906 files with group ownership set to the original group ID are 19907 unchanged by this modification. 19908 19909 -n group_name 19910 19911 changes the name of the group from group to group_name. 19912 19913 groups 19914 19915 Name 19916 19917 groups -- display a group 19918 19919 Synopsis 19920 19921 groups [user] 19922 19923 Description 19924 19925 The groups command shall behave as id -Gn [user], as specified 19926 in ISO POSIX (2003). The optional user parameter will display 19927 the groups for the named user. 19928 19929 gunzip 19930 19931 Name 19932 19933 gunzip -- uncompress files 19934 19935 Description 19936 19937 gunzip is equivalent to gzip -d. See the specification for 19938 gzip for further details. 19939 19940 gzip 19941 19942 Name 19943 19944 gzip -- compress or expand files 19945 19946 Synopsis 19947 19948 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 19949 19950 Description 19951 19952 The gzip command shall attempt to reduce the size of the named 19953 files. Whenever possible, each file is replaced by one with 19954 the extension .gz, while keeping the same ownership, modes, 19955 access and modification times. If no files are specified, or 19956 if a file name is -, the standard input is compressed to the 19957 standard output. gzip shall only attempt to compress regular 19958 files. In particular, it will ignore symbolic links. 19959 19960 When compressing, gzip uses the deflate algorithm specified in 19961 RFC 1951: DEFLATE Compressed Data Format Specification and 19962 stores the result in a file using the gzip file format 19963 specified in RFC 1952: GZIP File Format Specification. 19964 19965 Options 19966 19967 -c, --stdout, --to-stdout 19968 writes output on standard output, leaving the original 19969 files unchanged. If there are several input files, the 19970 output consists of a sequence of independently 19971 compressed members. To obtain better compression, 19972 concatenate all input files before compressing them. 19973 19974 -d, --decompress, --uncompress 19975 the name operands are compressed files, and gzip shall 19976 decompress them. 19977 19978 -f, --force 19979 forces compression or decompression even if the file 19980 has multiple links or the corresponding file already 19981 exists, or if the compressed data is read from or 19982 written to a terminal. If the input data is not in a 19983 format recognized by gzip, and if the option --stdout 19984 is also given, copy the input data without change to 19985 the standard ouput: let gzip behave as cat. If -f is 19986 not given, and when not running in the background, gzip 19987 prompts to verify whether an existing file should be 19988 overwritten. 19989 19990 -l, --list 19991 lists the compressed size, uncompressed size, ratio and 19992 uncompressed name for each compressed file. For files 19993 that are not in gzip format, the uncompressed size 19994 shall be given as -1. If the --verbose or -v option is 19995 also specified, the crc and timestamp for the 19996 uncompressed file shall also be displayed. 19997 19998 For decompression, gzip shall support at least the 19999 following compression methods: 20000 20001 + deflate (RFC 1951: DEFLATE Compressed Data Format 20002 Specification) 20003 + compress (ISO POSIX (2003)) 20004 20005 The crc shall be given as ffffffff for a file not in 20006 gzip format. 20007 20008 If the --name or -N option is also specified, the 20009 uncompressed name, date and time are those stored 20010 within the compressed file, if present. 20011 20012 If the --quiet or -q option is also specified, the 20013 title and totals lines are not displayed. 20014 20015 -L, --license 20016 displays the gzip license and quit. 20017 20018 -n, --no-name 20019 does not save the original file name and time stamp by 20020 default when compressing. (The original name is always 20021 saved if the name had to be truncated.) When 20022 decompressing, do not restore the original file name if 20023 present (remove only the gzip suffix from the 20024 compressed file name) and do not restore the original 20025 time stamp if present (copy it from the compressed 20026 file). This option is the default when decompressing. 20027 20028 -N, --name 20029 always saves the original file name and time stamp when 20030 compressing; this is the default. When decompressing, 20031 restore the original file name and time stamp if 20032 present. This option is useful on systems which have a 20033 limit on file name length or when the time stamp has 20034 been lost after a file transfer. 20035 20036 -q, --quiet 20037 suppresses all warnings. 20038 20039 -r, --recursive 20040 travels the directory structure recursively. If any of 20041 the file names specified on the command line are 20042 directories, gzip will descend into the directory and 20043 compress all the files it finds there (or decompress 20044 them in the case of gunzip). 20045 20046 -S .suf, --sufix .suf 20047 uses suffix .suf instead of .gz. 20048 20049 -t, --test 20050 checks the compressed file integrity. 20051 20052 -v, --verbose 20053 displays the name and percentage reduction for each 20054 file compressed or decompressed. 20055 20056 -#, --fast, --best 20057 regulates the speed of compression using the specified 20058 digit #, where -1 or --fast indicates the fastest 20059 compression method (less compression) and -9 or --best 20060 indicates the slowest compression method (best 20061 compression). The default compression level is -6 (that 20062 is, biased towards high compression at expense of 20063 speed). 20064 20065 LSB Deprecated Options 20066 20067 The behaviors specified in this section are expected to 20068 disappear from a future version of the LSB; applications 20069 should only use the non-LSB-deprecated behaviors. 20070 20071 -V, --version 20072 20073 displays the version number and compilation options, then 20074 quits. 20075 20076 hostname 20077 20078 Name 20079 20080 hostname -- show or set the system's host name 20081 20082 Synopsis 20083 20084 hostname [name] 20085 20086 Description 20087 20088 hostname is used to either display or, with appropriate 20089 privileges, set the current host name of the system. The host 20090 name is used by many applications to identify the machine. 20091 20092 When called without any arguments, the program displays the 20093 name of the system as returned by the gethostname() function. 20094 20095 When called with a name argument, and the user has appropriate 20096 privilege, the command sets the host name. 20097 20098 Note: It is not specified if the hostname displayed will be 20099 a fully qualified domain name. Applications requiring a 20100 particular format of hostname should check the output and 20101 take appropriate action. 20102 20103 install 20104 20105 Name 20106 20107 install -- copy files and set attributes 20108 20109 Synopsis 20110 20111 install [option...] SOURCE DEST 20112 install [option...] SOURCE... DEST 20113 install [-d | --directory] [option...] DIRECTORY... 20114 20115 Description 20116 20117 In the first two formats, copy SOURCE to DEST or multiple 20118 SOURCE(s) to the existing DEST directory, optionally setting 20119 permission modes and file ownership. In the third format, each 20120 DIRECTORY and any missing parent directories shall be created. 20121 20122 Standard Options 20123 20124 --backup[=METHOD] 20125 makes a backup of each existing destination file. 20126 METHOD may be one of the following: 20127 20128 none or off 20129 20130 never make backups. 20131 numbered or t 20132 20133 make numbered backups. A numbered backup has the form 20134 "%s.~%d~", target_name, version_number. Each backup shall 20135 increment the version number by 1. 20136 existing or nil 20137 20138 behave as numbered if numbered backups exist, or simple 20139 otherwise. 20140 simple or never 20141 20142 append a suffix to the name. The default suffix is '~', but 20143 can be overriden by setting SIMPLE_BACKUP_SUFFIX in the 20144 environment, or via the -S or --suffix option. 20145 20146 If no METHOD is specified, the environment variable 20147 VERSION_CONTROL shall be examined for one of the above. 20148 Unambiguous abbreviations of METHOD shall be accepted. 20149 If no METHOD is specified, or if METHOD is empty, the 20150 backup method shall default to existing. 20151 20152 If METHOD is invalid or ambiguous, install shall fail 20153 and issue a diagnostic message. 20154 20155 -b 20156 is equivalent to --backup=existing. 20157 20158 -d, --directory 20159 treats all arguments as directory names; creates all 20160 components of the specified directories. 20161 20162 -D 20163 creates all leading components of DEST except the last, 20164 then copies SOURCE to DEST; useful in the 1st format. 20165 20166 -g GROUP, --group=GROUP 20167 if the user has appropriate privilege, sets group 20168 ownership, instead of process' current group. GROUP is 20169 either a name in the user group database, or a positive 20170 integer, which shall be used as a group-id. 20171 20172 -m MODE, --mode=MODE 20173 sets permission mode (specified as in chmod), instead 20174 of the default rwxr-xr-x. 20175 20176 -o OWNER, --owner=OWNER 20177 if the user has appropriate privilege, sets ownership. 20178 OWNER is either a name in the user login database, or a 20179 positive integer, which shall be used as a user-id. 20180 20181 -p, --preserve-timestamps 20182 copies the access and modification times of SOURCE 20183 files to corresponding destination files. 20184 20185 -s, --strip 20186 strips symbol tables, only for 1st and 2nd formats. 20187 20188 -S SUFFIX, --suffix=SUFFIX 20189 equivalent to --backup=existing, except if a simple 20190 suffix is required, use SUFFIX. 20191 20192 --verbose 20193 prints the name of each directory as it is created. 20194 20195 -v, --verbose 20196 print the name of each file before copying it to 20197 stdout. 20198 20199 install_initd 20200 20201 Name 20202 20203 install_initd -- activate an init script 20204 20205 Synopsis 20206 20207 /usr/lib/lsb/install_initd initd_file 20208 20209 Description 20210 20211 install_initd shall activate a system initialization file that 20212 has been copied to an implementation defined location such 20213 that this file shall be run at the appropriate point during 20214 system initialization. The install_initd command is typically 20215 called in the postinstall script of a package, after the 20216 script has been copied to /etc/init.d. See also Installation 20217 and Removal of Init Scripts. 20218 20219 ipcrm 20220 20221 Name 20222 20223 ipcrm -- remove IPC Resources 20224 20225 Synopsis 20226 20227 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid 20228 | -M shmkey]... 20229 ipcrm [shm | msg | msg] id... 20230 20231 Description 20232 20233 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 20234 the ipcrm shall behave as described in ISO POSIX (2003). 20235 20236 Otherwise, ipcrm shall remove the resource of the specified 20237 type identified by id. 20238 20239 Future Directions 20240 20241 A future revision of this specification may deprecate the 20242 second synopsis form. 20243 20244 Rationale: In its first Linux implementation, ipcrm used 20245 the second syntax shown in the SYNOPSIS. Functionality 20246 present in other implementations of ipcrm has since been 20247 added, namely the ability to delete resources by key (not 20248 just identifier), and to respect the same command line 20249 syntax. The previous syntax is still supported for 20250 backwards compatibility only. 20251 20252 ipcs 20253 20254 Name 20255 20256 ipcs -- provide information on ipc facilities 20257 20258 Synopsis 20259 20260 ipcs [-smq] [-tcp] 20261 20262 Description 20263 20264 ipcs provides information on the ipc facilities for which the 20265 calling process has read access. 20266 20267 Note: Although this command has many similarities with the 20268 optional ipcs utility described in ISO POSIX (2003), it has 20269 substantial differences and is therefore described 20270 separately. The options specified here have similar meaning 20271 to those in ISO POSIX (2003); other options specified there 20272 have unspecified behavior on an LSB conforming 20273 implementation. See Application Usage below. The output 20274 format is not specified. 20275 20276 Resource display options 20277 20278 -m 20279 20280 shared memory segments. 20281 -q 20282 20283 message queues. 20284 -s 20285 20286 semaphore arrays. 20287 20288 Output format options 20289 20290 -t 20291 20292 time. 20293 -p 20294 20295 pid. 20296 -c 20297 20298 creator. 20299 20300 Application Usage 20301 20302 In some implementations of ipcs the -a option will print all 20303 information available. In other implementations the -a option 20304 will print all resource types. Therefore, applications shall 20305 not use the -a option. 20306 20307 Some implementations of ipcs provide more output formats than 20308 are specified here. These options are not consistent between 20309 differing implementations of ipcs. Therefore, only the -t, -c 20310 and -p option formatting flags may be used. At least one of 20311 the -t, -c and -p options and at least one of -m, -q and -s 20312 options shall be specified. If no options are specified, the 20313 output is unspecified. 20314 20315 killall 20316 20317 Name 20318 20319 killall -- kill processes by name 20320 20321 Synopsis 20322 20323 killall [-egiqvw] [-signal] name... 20324 killall -l 20325 killall -V 20326 20327 Description 20328 20329 killall sends a signal to all processes running any of the 20330 specified commands. If no signal name is specified, SIGTERM is 20331 sent. 20332 20333 Signals can be specified either by name (e.g. -HUP) or by 20334 number (e.g. -1). Signal 0 (check if a process exists) can 20335 only be specified by number. 20336 20337 If the command name contains a slash (/), processes executing 20338 that particular file will be selected for killing, independent 20339 of their name. 20340 20341 killall returns a non-zero return code if no process has been 20342 killed for any of the listed commands. If at least one process 20343 has been killed for each command, killall returns zero. 20344 20345 A killall process never kills itself (but may kill other 20346 killall processes). 20347 20348 Standard Options 20349 20350 -e 20351 20352 requires an exact match for very long names. If a command name 20353 is longer than 15 characters, the full name may be unavailable 20354 (i.e. it is swapped out). In this case, killall will kill 20355 everything that matches within the first 15 characters. With 20356 -e, such entries are skipped. killall prints a message for 20357 each skipped entry if -v is specified in addition to -e. 20358 -g 20359 20360 kills the process group to which the process belongs. The kill 20361 signal is only sent once per group, even if multiple processes 20362 belonging to the same process group were found. 20363 -i 20364 20365 asks interactively for confirmation before killing. 20366 -l 20367 20368 lists all known signal names. 20369 -q 20370 20371 does not complain if no processes were killed. 20372 -v 20373 20374 reports if the signal was successfully sent. 20375 20376 LSB Deprecated Options 20377 20378 The behaviors specified in this section are expected to 20379 disappear from a future version of the LSB; applications 20380 should only use the non-LSB-deprecated behaviors. 20381 20382 -V 20383 20384 displays version information. 20385 20386 lpr 20387 20388 Name 20389 20390 lpr -- off line print 20391 20392 Synopsis 20393 20394 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 20395 title] [name ......] 20396 20397 Description 20398 20399 lpr uses a spooling daemon to print the named files when 20400 facilities become available. If no names appear, the standard 20401 input is assumed. 20402 20403 Standard Options 20404 20405 -l 20406 20407 identifies binary data that is not to be filtered but sent as 20408 raw input to printer. 20409 -p 20410 20411 formats with "pr" before sending to printer. 20412 -Pprinter 20413 20414 sends output to the printer named printer instead of the 20415 default printer. 20416 -h 20417 20418 suppresses header page. 20419 -s 20420 20421 uses symbolic links. 20422 -#copies 20423 20424 specifies copies as the number of copies to print. 20425 -J name 20426 20427 specifies name as the job name for the header page. 20428 -T title 20429 20430 specifies title as the title used for "pr". 20431 20432 ls 20433 20434 Name 20435 20436 ls -- list directory contents 20437 20438 Description 20439 20440 ls shall behave as specified in ISO POSIX (2003), but with 20441 extensions listed below. 20442 20443 Extensions 20444 20445 -l 20446 20447 If the file is a character special or block special file, the 20448 size of the file shall be replaced with two unsigned numbers 20449 in the format "%u, %u", representing the major and minor 20450 device numbers associated with the special file. 20451 20452 Note: The LSB does not specify the meaning of the major and 20453 minor devices numbers. 20454 20455 -p 20456 20457 in addition to ISO POSIX (2003) XSI optional behavior of 20458 printing a slash for a directory, ls -p may display other 20459 characters for other file types. 20460 20461 lsb_release 20462 20463 Name 20464 20465 lsb_release -- print distribution specific information 20466 20467 Synopsis 20468 20469 lsb_release [OPTION...] 20470 20471 Description 20472 20473 The lsb_release command prints certain LSB (Linux Standard 20474 Base) and Distribution information. 20475 20476 If no options are given, the -v option is assumed. 20477 20478 Options 20479 20480 -v, --version 20481 20482 displays version of LSB against which distribution is 20483 compliant. The version is expressed as a colon separated list 20484 of LSB module descriptions. LSB module descriptions are dash 20485 separated tuples containing the module name, version, and 20486 architecture name. The output is a single line of text of the 20487 following format: 20488 20489 LSB Version:\tListAsDescribedAbove 20490 20491 Note: An implementation may support multiple releases of 20492 the same module. Version specific library interfaces, if 20493 any, will be selected by the program interpreter, which 20494 changes from release to release. Version specific commands 20495 and utilities, if any, will be described in the relevant 20496 specification. 20497 20498 -i, --id 20499 20500 displays string id of distributor. The output is a single line 20501 of text of the following format: 20502 20503 Distributor ID:\tDistributorID 20504 -d, --description 20505 20506 displays single line text description of distribution. The 20507 output is of the following format: 20508 20509 Description:\tDescription 20510 -r, --release 20511 20512 displays release number of distribution. The output is a 20513 single line of text of the following format: 20514 20515 Release:\tRelease 20516 -c, --codename 20517 20518 displays codename according to distribution release. The 20519 output is a single line of text of the following format. 20520 20521 Codename:\tCodename 20522 -a, --all 20523 20524 displays all of the above information. 20525 -s, --short 20526 20527 displays all of the above information in short output format. 20528 -h, --help 20529 20530 displays a human-readable help message. 20531 20532 Example 20533 20534 The following command will list the LSB Profiles which are 20535 currently supported on this platform. 20536 example% lsb_release -v 20537 LSB Version: core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch 20538 20539 m4 20540 20541 Name 20542 20543 m4 -- macro processor 20544 20545 Description 20546 20547 m4 is as specified in ISO POSIX (2003), but with extensions as 20548 listed below. 20549 20550 Extensions 20551 20552 -P 20553 20554 forces all builtins to be prefixed with m4_. For example, 20555 define becomes m4_define. 20556 -I directory 20557 20558 Add directory to the end of the search path for includes. 20559 20560 md5sum 20561 20562 Name 20563 20564 md5sum -- generate or check MD5 message digests 20565 20566 Synopsis 20567 20568 md5sum [-c [file] | file...] 20569 20570 Description 20571 20572 For each file, write to standard output a line containing the 20573 MD5 message digest of that file, followed by one or more blank 20574 characters, followed by the name of the file. The MD5 message 20575 digest shall be calculated according to RFC 1321: The MD5 20576 Message-Digest Algorithm and output as 32 hexadecimal digits. 20577 20578 If no file names are specified as operands, read from standard 20579 input and use "-" as the file name in the output. 20580 20581 Options 20582 20583 -c [file] 20584 20585 checks the MD5 message digest of all files named in file 20586 against the message digest listed in the same file. The actual 20587 format of file is the same as the output of md5sum. That is, 20588 each line in the file describes a file. If file is not 20589 specified, read message digests from stdin. 20590 20591 Exit Status 20592 20593 md5sum shall exit with status 0 if the sum was generated 20594 successfully, or, in check mode, if the check matched. 20595 Otherwise, md5sum shall exit with a non-zero status. 20596 20597 mknod 20598 20599 Name 20600 20601 mknod -- make special files 20602 20603 Synopsis 20604 20605 mknod [-m mode | --mode=mode] name type [major minor] 20606 mknod [--version] 20607 20608 Description 20609 20610 The mknod command shall create a special file named name of 20611 the given type. 20612 20613 The type shall be one of the following: 20614 20615 b 20616 20617 creates a block (buffered) special file with the specified 20618 major and minor device numbers. 20619 c, u 20620 20621 creates a character (unbuffered) special file with the 20622 specified major and minor device numbers. 20623 p 20624 20625 creates a FIFO. 20626 20627 Options 20628 20629 -m mode, --mode=mode 20630 20631 create the special file with file access permissions set as 20632 described in mode. The permissions may be any absolute value 20633 (i.e. one not containing '+' or '-') acceptable to the chmod 20634 command. 20635 --version 20636 20637 output version information and exit. 20638 20639 Note: This option may be deprecated in a future release of 20640 this specification. 20641 20642 If type is p, major and minor shall not be specified. 20643 Otherwise, these parameters are mandatory. 20644 20645 Future Directions 20646 20647 This command may be deprecated in a future version of this 20648 specification. The major and minor operands are insufficently 20649 portable to be specified usefully here. Only a FIFO can be 20650 portably created by this command, and the mkfifo command is a 20651 simpler interface for that purpose. 20652 20653 mktemp 20654 20655 Name 20656 20657 mktemp -- make temporary file name (unique) 20658 20659 Synopsis 20660 20661 mktemp [-q] [-u] template 20662 20663 Description 20664 20665 The mktemp command takes the given file name template and 20666 overwrites a portion of it to create a file name. This file 20667 name shall be unique and suitable for use by the application. 20668 20669 The template should have at least six trailing 'X' characters. 20670 These characters are replaced with characters from the 20671 portable filename character set in order to generate a unique 20672 name. 20673 20674 If mktemp can successfully generate a unique file name, and 20675 the -u option is not present, the file shall be created with 20676 read and write permission only for the current user. The 20677 mktemp command shall write the filename generated to the 20678 standard output. 20679 20680 Options 20681 20682 -q 20683 20684 fail silently if an error occurs. Diagnostic messages to 20685 stderr are suppressed, but the command shall still exit with a 20686 non-zero exit status if an error occurs. 20687 -u 20688 20689 operates in `unsafe' mode. A unique name is generated, but the 20690 temporary file shall be unlinked before mktemp exits. Use of 20691 this option is not encouraged. 20692 20693 more 20694 20695 Name 20696 20697 more -- display files on a page-by-page basis 20698 20699 Description 20700 20701 more is as specified in ISO POSIX (2003), but with differences 20702 as listed below. 20703 20704 Differences 20705 20706 The more command need not respect the LINES and COLUMNS 20707 environment variables. 20708 20709 The following additional options may be supported: 20710 20711 -num 20712 20713 specifies an integer which is the screen size (in lines). 20714 +num 20715 20716 starts at line number num. 20717 +/pattern 20718 20719 Start at the first line matching the pattern, equivalent to 20720 executing the search forward (/) command with the given 20721 pattern immediately after opening each file. 20722 20723 The following options from ISO POSIX (2003) may behave 20724 differently: 20725 20726 -e 20727 20728 has unspecified behavior. 20729 -i 20730 20731 has unspecified behavior. 20732 -n 20733 20734 has unspecified behavior. 20735 -p 20736 20737 Either clear the whole screen before displaying any text 20738 (instead of the usual scrolling behavior), or provide the 20739 behavior specified by ISO POSIX (2003). In the latter case, 20740 the syntax is "-p command". 20741 -t 20742 20743 has unspecified behavior. 20744 20745 The more command need not support the following interactive 20746 commands: 20747 20748 g 20749 G 20750 u 20751 control u 20752 control f 20753 newline 20754 j 20755 k 20756 r 20757 R 20758 m 20759 ' (return to mark) 20760 /! 20761 ? 20762 N 20763 :e 20764 :t 20765 control g 20766 ZZ 20767 20768 Rationale 20769 20770 The +num and +/string options are deprecated in SUSv2, and 20771 have been removed in ISO POSIX (2003); however this 20772 specification continues to specify them because the publicly 20773 available util-linux package does not support the replacement 20774 (-p command). The +command option as found in SUSv2 is more 20775 general than is specified here, but the util-linux package 20776 appears to only support the more specific +num and +/string 20777 forms. 20778 20779 mount 20780 20781 Name 20782 20783 mount -- mount a file system 20784 20785 Synopsis 20786 20787 mount [-hV] 20788 mount [-a] [-fFnrsvw] [-t vfstype] 20789 mount [-fnrsvw] [-o options [,...]] [device | dir] 20790 mount [-fnrsvw] [-t vfstype] [-o options] device dir 20791 20792 Description 20793 20794 As described in ISO POSIX (2003), all files in the system are 20795 organized in a directed graph, known as the file hierarchy, 20796 rooted at /. These files can be spread out over several 20797 underlying devices. The mount command shall attach the file 20798 system found on some underlying device to the file hierarchy. 20799 20800 Options 20801 20802 -v 20803 20804 invoke verbose mode. The mount command shall provide 20805 diagnostic messages on stdout. 20806 -a 20807 20808 mount all file systems (of the given types) mentioned in 20809 /etc/fstab. 20810 -F 20811 20812 If the -a option is also present, fork a new incarnation of 20813 mount for each device to be mounted. This will do the mounts 20814 on different devices or different NFS servers in parallel. 20815 -f 20816 20817 cause everything to be done except for the actual system call; 20818 if it's not obvious, this `fakes' mounting the file system. 20819 -n 20820 20821 mount without writing in /etc/mtab. This is necessary for 20822 example when /etc is on a read-only file system. 20823 -s 20824 20825 ignore mount options not supported by a file system type. Not 20826 all file systems support this option. 20827 -r 20828 20829 mount the file system read-only. A synonym is -o ro. 20830 -w 20831 20832 mount the file system read/write. (default) A synonym is -o 20833 rw. 20834 -L label 20835 20836 If the file /proc/partitions is supported, mount the partition 20837 that has the specified label. 20838 -U uuid 20839 20840 If the file /proc/partitions is supported, mount the partition 20841 that has the specified uuid. 20842 -t vfstype 20843 20844 indicate a file system type of vfstype. 20845 20846 More than one type may be specified in a comma separated list. 20847 The list of file system types can be prefixed with no to 20848 specify the file system types on which no action should be 20849 taken. 20850 -o 20851 20852 options are specified with a -o flag followed by a 20853 comma-separated string of options. Some of these options are 20854 only useful when they appear in the /etc/fstab file. The 20855 following options apply to any file system that is being 20856 mounted: 20857 20858 async 20859 20860 perform all I/O to the file system asynchronously. 20861 atime 20862 20863 update inode access time for each access. (default) 20864 auto 20865 20866 in /etc/fstab, indicate the device is mountable with -a. 20867 defaults 20868 20869 use default options: rw, suid, dev, exec, auto, nouser, async. 20870 dev 20871 20872 interpret character or block special devices on the file 20873 system. 20874 exec 20875 20876 permit execution of binaries. 20877 noatime 20878 20879 do not update file access times on this file system. 20880 noauto 20881 20882 in /etc/fstab, indicates the device is only explicitly 20883 mountable. 20884 nodev 20885 20886 do not interpret character or block special devices on the 20887 file system. 20888 noexec 20889 20890 do not allow execution of any binaries on the mounted file 20891 system. 20892 nosuid 20893 20894 do not allow set-user-identifier or set-group-identifier bits 20895 to take effect. 20896 nouser 20897 20898 forbid an unprivileged user to mount the file system. 20899 (default) 20900 remount 20901 20902 remount an already-mounted file system. This is commonly used 20903 to change the mount options for a file system, especially to 20904 make a read-only file system writable. 20905 ro 20906 20907 mount the file system read-only. 20908 rw 20909 20910 mount the file system read-write. 20911 suid 20912 20913 allow set-user-identifier or set-group-identifier bits to take 20914 effect. 20915 sync 20916 20917 do all I/O to the file system synchronously. 20918 user 20919 20920 allow an unprivilieged user to mount the file system. This 20921 option implies the options noexec, nosuid, nodev unless 20922 overridden by subsequent options. 20923 20924 LSB Deprecated Options 20925 20926 The behaviors specified in this section are expected to 20927 disappear from a future version of the LSB; applications 20928 should only use the non-LSB-deprecated behaviors. 20929 20930 -V 20931 20932 output version and exit. 20933 20934 msgfmt 20935 20936 Name 20937 20938 msgfmt -- create a message object from a message file 20939 20940 Synopsis 20941 20942 msgfmt [options...] filename... 20943 20944 Description 20945 20946 The msgfmt command generates a binary message catalog from a 20947 textual translation description. Message catalogs, or message 20948 object files, are stored in files with a .mo extension. 20949 20950 Note: The format of message object files is not guaranteed 20951 to be portable. Message catalogs should always be generated 20952 on the target architecture using the msgfmt command. 20953 20954 The source message files, otherwise known as portable object 20955 files, have a .po extension. 20956 20957 The filename operands shall be portable object files. The .po 20958 file contains messages to be displayed to users by system 20959 utilities or by application programs. The portable object 20960 files are text files, and the messages in them can be 20961 rewritten in any language supported by the system. 20962 20963 If any filename is -, a portable object file shall be read 20964 from the standard input. 20965 20966 The msgfmt command interprets data as characters according to 20967 the current setting of the LC_CTYPE locale category. 20968 20969 Options 20970 20971 -c, --check 20972 Detect and diagnose input file anomalies which might 20973 represent translation errors. The msgid and msgstr 20974 strings are studied and compared. It is considered 20975 abnormal that one string starts or ends with a newline 20976 while the other does not. 20977 20978 If the message is flagged as c-format (see Comment 20979 Handling), check that the msgid string and the msgstr 20980 translation have the same number of % format 20981 specifiers, with matching types. 20982 20983 -D directory, --directory=directory 20984 Add directory to list for input files search. If 20985 filename is not an absolute pathname and filename 20986 cannot be opened, search for it in directory. This 20987 option may be repeated. Directories shall be searched 20988 in order, with the leftmost directory searched first. 20989 20990 -f, --use-fuzzy 20991 Use entries marked as fuzzy in output. If this option 20992 is not specified, such entries are not included into 20993 the output. See Comment Handling below. 20994 20995 -o output-file, --output-file=output-file 20996 Specify the output file name as output-file. If 20997 multiple domains or duplicate msgids in the .po file 20998 are present, the behavior is unspecified. If 20999 output-file is -, output is written to standard output. 21000 21001 --strict 21002 Ensure that all output files have a .mo extension. 21003 Output files are named either by the -o (or 21004 --output-file) option, or by domains found in the input 21005 files. 21006 21007 -v, --verbose 21008 Print additional information to the standard error, 21009 including the number of translated strings processed. 21010 21011 Operands 21012 21013 The filename operands are treated as portable object files. 21014 The format of portable object files is defined in EXTENDED 21015 DESCRIPTION. 21016 21017 Standard Input 21018 21019 The standard input is not used unless a filename operand is 21020 specified as "-". 21021 21022 Environment Variables 21023 21024 LANGUAGE 21025 21026 Specifies one or more locale names. 21027 LANG 21028 21029 Specifies locale name. 21030 LC_ALL 21031 21032 Specifies locale name for all categories. If defined, 21033 overrides LANG, LC_CTYPE and LC_MESSAGES. 21034 LC_CTYPE 21035 21036 Determine the locale for the interpretation of sequences of 21037 bytes of text data as characters (for example, single-byte as 21038 opposed to multi-byte characters in arguments and input 21039 files). 21040 LC_MESSAGES 21041 21042 Specifies messaging locale, and if present overrides LANG for 21043 messages. 21044 21045 Standard Output 21046 21047 The standard output is not used unless the option-argument of 21048 the -o option is specified as -. 21049 21050 Extended Description 21051 21052 The format of portable object files (.po files) is defined as 21053 follows. Each .po file contains one or more lines, with each 21054 line containing either a comment or a statement. Comments 21055 start the line with a hash mark (#) and end with the newline 21056 character. Empty lines, or lines containing only white-space, 21057 shall be ignored. Comments can in certain circumstances alter 21058 the behavior of msgfmt. See Comment Handling below for details 21059 on comment processing. The format of a statement is: 21060 21061 directive value 21062 21063 Each directive starts at the beginning of the line and is 21064 separated from value by white space (such as one or more space 21065 or tab characters). The value consists of one or more quoted 21066 strings separated by white space. If two or more strings are 21067 specified as value, they are normalized into single string 21068 using the string normalization syntax specified in ISO C 21069 (1999). The following directives are supported: 21070 21071 domain domainname 21072 21073 msgid message_identifier 21074 21075 msgid_plural untranslated_string_plural 21076 21077 msgstr message_string 21078 21079 msgstr[n] message_string 21080 21081 The behavior of the domain directive is affected by the 21082 options used. See OPTIONS for the behavior when the -o option 21083 is specified. If the -o option is not specified, the behavior 21084 of the domain directive is as follows: 21085 21086 1. All msgids from the beginning of each .po file to the 21087 first domain directive are put into a default message 21088 object file, messages (or messages.mo if the --strict 21089 option is specified). 21090 2. When msgfmt encounters a domain domainname directive in 21091 the .po file, all following msgids until the next domain 21092 directive are put into the message object file domainname 21093 (or domainname.mo if --strict option is specified). 21094 3. Duplicate msgids are defined in the scope of each domain. 21095 That is, a msgid is considered a duplicate only if the 21096 identical msgid exists in the same domain. 21097 4. All duplicate msgids are ignored. 21098 21099 The msgid directive specifies the value of a message 21100 identifier associated with the directive that follows it. The 21101 msgid_plural directive specifies the plural form message 21102 specified to the plural message handling functions ngettext(), 21103 dngettext() or dcngettext(). The message_identifier string 21104 identifies a target string to be used at retrieval time. Each 21105 statement containing a msgid directive shall be followed by a 21106 statement containing a msgstr directive or msgstr[n] 21107 directives. 21108 21109 The msgstr directive specifies the target string associated 21110 with the message_identifier string declared in the immediately 21111 preceding msgid directive. 21112 21113 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 21114 target string to be used with plural form handling functions 21115 ngettext(), dngettext() and dcngettext(). 21116 21117 Message strings can contain the following escape sequences: 21118 21119 Table 15-1. Escape Sequences 21120 \n newline 21121 \t tab 21122 \v vertical tab 21123 \b backspace 21124 \r carriage return 21125 \f formfeed 21126 \\ backslash 21127 \" double quote 21128 \ddd octal bit pattern 21129 \xHH hexadecimal bit pattern 21130 21131 Comment Handling 21132 21133 Comments are introduced by a #, and continue to the end of the 21134 line. The second character (i.e. the character following the 21135 #) has special meaning. Regular comments should follow a space 21136 character. Other comment types include: 21137 21138 # normal-comments 21139 21140 #. automatic-comments 21141 21142 #: reference... 21143 21144 #, flag 21145 21146 Automatic and reference comments are typically generated by 21147 external utilities, and are not specified by the LSB. The 21148 msgfmt command shall ignore such comments. 21149 21150 Note: Portable object files may be produced by unspecified 21151 tools. Some of the comment types described here may arise 21152 from the use of such tools. It is beyond the scope of this 21153 specification to describe these tools. 21154 21155 The #, comments require one or more flags separated by the 21156 comma (,) character. The following flags can be specified: 21157 21158 fuzzy 21159 21160 This flag shows that the following msgstr string might not be 21161 a correct translation. Only the translator (i.e. the 21162 individual undertaking the translation) can judge if the 21163 translation requires further modification, or is acceptable as 21164 is. Once satisfied with the translation, the translator then 21165 removes this fuzzy flag. 21166 21167 If this flag is specified, the msgfmt utility will not 21168 generate the entry for the immediately following msgid in the 21169 output message catalog, unless the --use-fuzzy is specified. 21170 c-format, no-c-format 21171 21172 The c-format flag indicates that the msgid string is used as 21173 format string by printf()-like functions. If the c-format flag 21174 is given for a string the msgfmt utility may perform 21175 additional tests to check the validity of the translation. 21176 21177 Plurals 21178 21179 The msgid entry with empty string ("") is called the header 21180 entry and is treated specially. If the message string for the 21181 header entry contains nplurals=value, the value indicates the 21182 number of plural forms. For example, if nplurals=4, there are 21183 4 plural forms. If nplurals is defined, there should be a 21184 plural=expression on the same line, separated by a semicolon 21185 (;) character. The expression is a C language expression to 21186 determine which version of msgstr[n] to be used based on the 21187 value of n, the last argument of ngettext(), dngettext() or 21188 dcngettext(). For example: 21189 nplurals=2; plural=n == 1 ? 0 : 1 21190 21191 indicates that there are 2 plural forms in the language; 21192 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 21193 Another example: 21194 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 21195 21196 indicates that there are 3 plural forms in the language; 21197 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 21198 otherwise msgstr[2] is used. 21199 21200 If the header entry contains charset=codeset string, the 21201 codeset is used to indicate the codeset to be used to encode 21202 the message strings. If the output string's codeset is 21203 different from the message string's codeset, codeset 21204 conversion from the message strings's codeset to the output 21205 string's codeset will be performed upon the call of gettext(), 21206 dgettext(), dcgettext(), ngettext(), dngettext(), and 21207 dcngettext(). The output string's codeset is determined by the 21208 current locale's codeset (the return value of 21209 nl_langinfo(CODESET)) by default, and can be changed by the 21210 call of bind_textdomain_codeset(). 21211 21212 Exit Status 21213 21214 The following exit values are returned: 21215 21216 0 21217 21218 Successful completion. 21219 >0 21220 21221 An error occurred. 21222 21223 Application Usage 21224 21225 Neither msgfmt nor any gettext() function imposes a limit on 21226 the total length of a message. Installing message catalogs 21227 under the C locale is pointless, since they are ignored for 21228 the sake of efficiency. 21229 21230 Examples 21231 21232 Example 1: Examples of creating message objects from message 21233 files. 21234 21235 In this example module1.po, module2.po and module3.po are 21236 portable message object files. 21237 example% cat module1.po 21238 21239 # default domain "messages" 21240 21241 msgid "message one" 21242 21243 msgstr "mensaje número uno" 21244 21245 # 21246 21247 domain "help_domain" 21248 21249 msgid "help two" 21250 21251 msgstr "ayuda número dos" 21252 21253 # 21254 21255 domain "error_domain" 21256 21257 msgid "error three" 21258 21259 msgstr "error número tres" 21260 21261 example% cat module2.po 21262 21263 # default domain "messages" 21264 21265 msgid "message four" 21266 21267 msgstr "mensaje número cuatro" 21268 21269 # 21270 21271 domain "error_domain" 21272 21273 msgid "error five" 21274 21275 msgstr "error número cinco" 21276 21277 # 21278 21279 domain "window_domain" 21280 21281 msgid "window six" 21282 21283 msgstr "ventana número seises" 21284 21285 example% cat module3.po 21286 21287 # default domain "messages" 21288 21289 msgid "message seven" 21290 21291 msgstr "mensaje número siete" 21292 21293 The following command will produce the output files messages, 21294 help_domain, and error_domain. 21295 example% msgfmt module1.po 21296 21297 The following command will produce the output files 21298 messages.mo, help_domain.mo, error_domain.mo, and 21299 window_domain.mo. 21300 example% msgfmt module1.po module2.po 21301 21302 The following example will produce the output file hello.mo. 21303 example% msgfmt -o hello.mo module3.po 21304 21305 newgrp 21306 21307 Name 21308 21309 newgrp -- change group ID 21310 21311 Synopsis 21312 21313 newgrp [group] 21314 21315 Description 21316 21317 The newgrp command is as specified in ISO POSIX (2003), but 21318 with differences as listed below. 21319 21320 Differences 21321 21322 The -l option specified in ISO POSIX (2003) need not be 21323 supported. 21324 21325 od 21326 21327 Name 21328 21329 od -- dump files in octal and other formats 21330 21331 Synopsis 21332 21333 od [-abcdfilox] [-w width | --width-width] [-v] [-A 21334 address_base] [-j skip] [-n count] [-t type_string] [file...] 21335 od --traditional [options] [file] [[+]offset [.] [b]] 21336 [[+]label [.] [b]] 21337 21338 Description 21339 21340 The od command shall provide all of the madatory functionality 21341 specified in ISO POSIX (2003), but with extensions and 21342 differences to the XSI optional behavior as listed below. 21343 21344 Extensions and Differences 21345 21346 -s 21347 unspecified behavior. 21348 21349 Note: Applications wishing to achieve the ISO POSIX (2003) 21350 behavior for -s should instead use -t d2. 21351 21352 -wwidth, --width[=width] 21353 each output line is limited to width bytes from the 21354 input. 21355 21356 --traditional 21357 accepts arguments in traditional form, see Traditional 21358 Usage below. 21359 21360 Note: The XSI optional behavior for offset handling 21361 described in ISO POSIX (2003) is not supported unless the 21362 --traditional option is also specified. 21363 21364 Pre-POSIX and XSI Specifications 21365 21366 The LSB supports mixing options between the mandatory and XSI 21367 optional synopsis forms in ISO POSIX (2003). The LSB shall 21368 support the following options: 21369 21370 -a 21371 21372 is equivalent to -t a, selects named characters. 21373 -b 21374 21375 is equivalent to -t o1, selects octal bytes. 21376 -c 21377 21378 is equivalent to -t c, selects characters. 21379 -d 21380 21381 is equivalent to -t u2, selects unsigned decimal two byte 21382 units. 21383 -f 21384 21385 is equivalent to -t fF, selects floats. 21386 -i 21387 21388 is equivalent to -t d2, selects decimal two byte units. 21389 21390 Note: This usage may change in future releases; portable 21391 applications should use -t d2. 21392 21393 -l 21394 21395 is equivalent to -t d4, selects decimal longs. 21396 -o 21397 21398 is equivalent to -t o2, selects octal two byte units. 21399 -x 21400 21401 is equivalent to -t x2, selects hexadecimal two byte units. 21402 21403 Note that the XSI option -s need not be supported. 21404 21405 Traditional Usage 21406 21407 If the --traditional option is specified, there may be between 21408 zero and three operands specified. 21409 21410 If no operands are specified, then od shall read the standard 21411 input. 21412 21413 If there is exactly one operand, and it is an offset of the 21414 form [+]offset[.][b], then it shall be interpreted as 21415 specified in ISO POSIX (2003). The file to be dumped shall be 21416 the standard input. 21417 21418 If there are exactly two operands, and they are both of the 21419 form [+]offset[.][b], then the first shall be treated as an 21420 offset (as above), and the second shall be a label, in the 21421 same format as the offset. If a label is specified, then the 21422 first output line produced for each input block shall be 21423 preceded by the input offset, cumulative across input files, 21424 of the next byte to be written, followed by the label, in 21425 parentheses. The label shall increment in the same manner as 21426 the offset. 21427 21428 If there are three operands, then the first shall be the file 21429 to dump, the second the offset, and the third the label. 21430 21431 Note: Recent versions of coreutils contain an od utility 21432 that conforms to ISO POSIX (2003). However, in April 2005, 21433 this version was not in widespread use. A future version of 21434 this specification may remove the differences. 21435 21436 passwd 21437 21438 Name 21439 21440 passwd -- change user password 21441 21442 Synopsis 21443 21444 passwd [-x max] [-n min] [-w warn] [-i inact] name 21445 passwd {-l | -u} name 21446 21447 Description 21448 21449 passwd changes authentication information for user and group 21450 accounts, including passwords and password expiry details, and 21451 may be used to enable and disable accounts. Only a user with 21452 appropriate privilege may change the password for other users 21453 or modify the expiry information. 21454 21455 Options 21456 21457 -x max 21458 21459 sets the maximum number of days a password remains valid. 21460 -n min 21461 21462 sets the minimum number of days before a password may be 21463 changed. 21464 -w warn 21465 21466 sets the number of days warning the user will receive before 21467 their password will expire. 21468 -i inactive 21469 21470 disables an account after the password has been expired for 21471 the given number of days. 21472 -l 21473 21474 disables an account by changing the password to a value which 21475 matches no possible encrypted value. 21476 -u 21477 21478 re-enables an account by changing the password back to its 21479 previous value. 21480 21481 patch 21482 21483 Name 21484 21485 patch -- apply a diff file to an original 21486 21487 Description 21488 21489 patch is as specified in ISO POSIX (2003), but with extensions 21490 as listed below. 21491 21492 Extensions 21493 21494 --binary 21495 21496 reads and write all files in binary mode, except for standard 21497 output and /dev/tty. This option has no effect on 21498 POSIX-compliant systems. 21499 -u, --unified 21500 21501 interprets the patch file as a unified context diff. 21502 21503 pidof 21504 21505 Name 21506 21507 pidof -- find the process ID of a running program 21508 21509 Synopsis 21510 21511 pidof [-s] [-x] [-o omitpid...] program... 21512 21513 Description 21514 21515 Return the process ID of a process which is running the 21516 program named on the command line. 21517 21518 The pidof command is a system administration utility, see Path 21519 For System Administration Utilities. 21520 21521 Options 21522 21523 -s 21524 21525 instructs the program to only return one pid. 21526 -x 21527 21528 causes the program to also return process id's of shells 21529 running the named scripts. 21530 -o 21531 21532 omits processes with specified process id. 21533 21534 remove_initd 21535 21536 Name 21537 21538 remove_initd -- clean up init script system modifications 21539 introduced by install_initd 21540 21541 Synopsis 21542 21543 /usr/lib/lsb/remove_initd initd_file 21544 21545 Description 21546 21547 remove_initd processes the removal of the modifications made 21548 to a distribution's init script system by the install_initd 21549 program. This cleanup is performed in the preuninstall script 21550 of a package; however, the package manager is still 21551 responsible for removing the script from the repository. See 21552 also Installation and Removal of Init Scripts. 21553 21554 renice 21555 21556 Name 21557 21558 renice -- alter priority of running processes 21559 21560 Description 21561 21562 renice is as specified in ISO POSIX (2003), but with 21563 differences as listed below. 21564 21565 Differences 21566 21567 -n increment 21568 21569 has unspecified behavior. 21570 21571 sed 21572 21573 Name 21574 21575 sed -- stream editor 21576 21577 Description 21578 21579 sed is as specified in ISO POSIX (2003), but with differences 21580 as listed below. 21581 21582 LSB Differences 21583 21584 Certain aspects of internationalized regular expressions are 21585 optional; see Regular Expressions. 21586 21587 sendmail 21588 21589 Name 21590 21591 sendmail -- an electronic mail transport agent 21592 21593 Synopsis 21594 21595 /usr/sbin/sendmail [options] [address...] 21596 21597 Description 21598 21599 To deliver electronic mail (email), applications shall support 21600 the interface provided by sendmail (described here). This 21601 interface shall be the default delivery method for 21602 applications. 21603 21604 This program sends an email message to one or more recipients, 21605 routing the message as necessary. This program is not intended 21606 as a user interface routine. 21607 21608 With no options, sendmail reads its standard input up to an 21609 end-of-file or a line consisting only of a single dot and 21610 sends a copy of the message found there to all of the 21611 addresses listed. It determines the network(s) to use based on 21612 the syntax and contents of the addresses. 21613 21614 If an address is preceded by a backslash, '\', it is 21615 unspecified if the address is subject to local alias 21616 expansion. 21617 21618 The format of messages shall be as defined in RFC 21619 2822:Internet Message Format. 21620 21621 Note: The name sendmail was chosen for historical reasons, 21622 but the sendmail command specified here is intended to 21623 reflect functionality provided by smail, exim and other 21624 implementations, not just the sendmail implementation. 21625 21626 Options 21627 21628 -bm 21629 21630 read mail from standard input and deliver it to the recipient 21631 addresses. This is the default mode of operation. 21632 -bp 21633 21634 If the user has sufficient privilege, list information about 21635 messages currently in the mail queue. 21636 -bs 21637 21638 use the SMTP protocol as described in RFC 2821:Simple Mail 21639 Transfer Protocol; read SMTP commands on standard input and 21640 write SMTP responses on standard output. 21641 21642 In this mode, sendmail shall accept \r\n (CR-LF), as required 21643 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 21644 terminators. 21645 -F fullname 21646 21647 explicitly set the full name of the sender for incoming mail 21648 unless the message already contains a From: message header. 21649 21650 If the user running sendmail is not sufficiently trusted, then 21651 the actual sender may be indicated in the message, depending 21652 on the configuration of the agent. 21653 -f name 21654 21655 explicitly set the envelope sender address for incoming mail. 21656 If there is no From: header, the address specified in the 21657 From: header will also be set. 21658 21659 If the user running sendmail is not sufficiently trusted, then 21660 the actual sender shall be indicated in the message. 21661 -i 21662 21663 ignore dots alone on lines by themselves in incoming messages. 21664 If this options is not specified, a line consisting of a 21665 single dot shall terminate the input. If -bs is also used, the 21666 behavior is unspecified. 21667 -odb 21668 21669 deliver any mail in background, if supported; otherwise 21670 ignored. 21671 -odf 21672 21673 deliver any mail in foreground, if supported; otherwise 21674 ignored. 21675 -oem or -em 21676 21677 mail errors back to the sender. (default) 21678 -oep or -ep 21679 21680 write errors to the standard error output. 21681 -oeq or -eq 21682 21683 do not send notification of errors to the sender. This only 21684 works for mail delivered locally. 21685 -oi 21686 21687 is equivalent to -i. 21688 -om 21689 21690 indicate that the sender of a message should receive a copy of 21691 the message if the sender appears in an alias expansion. 21692 Ignored if aliases are not supported. 21693 -t 21694 21695 read the message to obtain recipients from the To:, Cc:, and 21696 Bcc: headers in the message instead of from the command 21697 arguments. If a Bcc: header is present, it is removed from the 21698 message unless there is no To: or Cc: header, in which case a 21699 Bcc: header with no data is created, in accordance with RFC 21700 2822:Internet Message Format. 21701 21702 If there are any operands, the recipients list is unspecified. 21703 21704 This option may be ignored when not in -bm mode (the default). 21705 21706 Note: It is recommended that applications use as few 21707 options as necessary, none if possible. 21708 21709 Exit status 21710 21711 0 21712 21713 successful completion on all addresses. This does not indicate 21714 successful delivery. 21715 >0 21716 21717 there was an error. 21718 21719 sh 21720 21721 Name 21722 21723 sh -- shell, the standard command language interpreter 21724 21725 Description 21726 21727 The sh utility shall behave as specified in ISO POSIX (2003), 21728 but with extensions listed below. 21729 21730 Shell Invocation 21731 21732 The shell shall support an additional option, -l (the letter 21733 ell). If the -l option is specified, or if the first character 21734 of argument zero (the command name) is a '-', this invokation 21735 of the shell is a login shell. 21736 21737 An interactive shell, as specified in ISO POSIX (2003), that 21738 is also a login shell, or any shell if invoked with the -l 21739 option, shall, prior to reading from the input file, first 21740 read and execute commands from the file /etc/profile, if that 21741 file exists, and then from a file called ~/.profile, if such a 21742 file exists. 21743 21744 Note: This specification requires that the sh utility shall 21745 also read and execute commands in its current execution 21746 environment from all the shell scripts in the directory 21747 /etc/profile.d. Such scripts are read and executed as a 21748 part of reading and executing /etc/profile. 21749 21750 shutdown 21751 21752 Name 21753 21754 shutdown -- shut the system down 21755 21756 Synopsis 21757 21758 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 21759 [warning-message] 21760 /sbin/shutdown -c [warning-message] 21761 21762 Description 21763 21764 The shutdown command shall shut the system down in a secure 21765 way (first synopsis), or cancel a pending shutdown (second 21766 synopsis). When the shutdown is initiated, all logged-in users 21767 shall be notified immediately that the system is going down, 21768 and users shall be prevented from logging in to the system. 21769 The time specifies when the actual shutdown shall commence. 21770 See below for details. At the specified time all processes are 21771 first notified that the system is going down by the signal 21772 SIGTERM. After an interval (see -t) all processes shall be 21773 sent the signal SIGKILL. If neither the -h or the -r argument 21774 is specified, then the default behavior shall be to take the 21775 system to a runlevel where administrative tasks can be run. 21776 See also Run Levels. 21777 21778 Note: This is sometimes referred to as "single user mode". 21779 21780 The -h and -r options are mutually exclusive. If either the -h 21781 or -r options are specified, the system shall be halted or 21782 rebooted respectively. 21783 21784 Standard Options 21785 21786 -a 21787 21788 use access control. See below. 21789 -t sec 21790 21791 tell the system to wait sec seconds between sending processes 21792 the warning and the kill signal, before changing to another 21793 runlevel. The default period is unspecified. 21794 -k 21795 21796 do not really shutdown; only send the warning messages to 21797 everybody. 21798 -r 21799 21800 reboot after shutdown. 21801 -h 21802 21803 halt after shutdown. Actions after halting are unspecified 21804 (e.g. power off). 21805 -f 21806 21807 advise the system to skip file system consistency checks on 21808 reboot. 21809 -F 21810 21811 advise the system to force file system consistency checks on 21812 reboot. 21813 -c 21814 21815 cancel an already running shutdown. 21816 time 21817 21818 specify when to shut down. 21819 21820 The time argument shall have the following format: [now | 21821 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 21822 hour (1 or 2 digits) and mm is the minute of the hour (exactly 21823 two digits), and the shutdown shall commence at the next 21824 occurence of the specified time. If the format is mins (or 21825 +mins), where mins is a decimal number, shutdown shall 21826 commence in the specified number of minutes. The word now is 21827 an alias for +0. 21828 warning-message 21829 21830 specify a message to send to all users. 21831 21832 Access Control 21833 21834 If the shutdown utility is invoked with the -a option, it 21835 shall check that an authorized user is currently logged in on 21836 the system console. Authorized users are listed, one per line, 21837 in the file /etc/shutdown.allow. Lines in this file that begin 21838 with a '#' or are blank shall be ignored. 21839 21840 Note: The intent of this scheme is to allow a keyboard 21841 sequence entered on the system console (e.g. CTRL-ALT-DEL, 21842 or STOP-A) to automatically invoke shutdown -a, and can be 21843 used to prevent unauthorized users from shutting the system 21844 down in this fashion. 21845 21846 su 21847 21848 Name 21849 21850 su -- change user ID 21851 21852 Synopsis 21853 21854 su [options] [-] [username [ARGS]] 21855 21856 Description 21857 21858 The su command shall start a shell running with the real and 21859 effective user and group IDs of the user username. If username 21860 is not specified, su shall default to an unspecified user with 21861 all appropriate privileges. If the -s or --shell is not 21862 specified, the shell to be invoked shall be that specified for 21863 username in the user database (see getpwnam()), or /bin/sh if 21864 there is no shell specified in the user database. 21865 21866 If the - option is specified, or if the first operand is -, 21867 the environment for the shell shall be initialized as if the 21868 new shell was a login shell (see Shell Invocation). 21869 21870 If the invoking user does not have appropriate privileges, the 21871 su command shall prompt for a password and validate this 21872 before continuing. Invalid passwords shall produce an error 21873 message. The su command shall log in an unspecified manner all 21874 invokations, whether successful or unsuccessful. 21875 21876 Any operands specified after the username shall be passed to 21877 the invoked shell. 21878 21879 If the option - is not specified, and if the first operand is 21880 not -, the environemnt for the new shell shall be intialized 21881 from the current environment. If none of the -m, -p, or 21882 --preserve-environment options are specified, the environment 21883 may be modified in unspecified ways before invoking the shell. 21884 If any of the -m, -p, or --preserve-environment options are 21885 specified, the environment shall not be altered. 21886 21887 Note: Although the su command shall not alter the 21888 environment, the invoked shell may still alter it before it 21889 is ready to intepret any commands. 21890 21891 Standard Options 21892 21893 - 21894 the invoked shell shall be a login shell. 21895 21896 -c command, --command=command 21897 Invoke the shell with the option -c command. 21898 21899 -m, -p, --preserve-environment 21900 The current environment shall be passed to the invoked 21901 shell. If the environment variable SHELL is set, it 21902 shall specify the shell to invoke, if it matches an 21903 entry in /etc/shells. If there is no matching entry in 21904 /etc/shells, this option shall be ignored if the - 21905 option is also specified, or if the first operand is -. 21906 21907 -s shell, --shell=shell 21908 Invoke shell as the comamnd interpreter. The shell 21909 specified shall be present in /etc/shells. 21910 21911 sync 21912 21913 Name 21914 21915 sync -- flush file system buffers 21916 21917 Synopsis 21918 21919 sync 21920 21921 Description 21922 21923 Force changed blocks to disk, update the super block. 21924 21925 tar 21926 21927 Name 21928 21929 tar -- file archiver 21930 21931 Description 21932 21933 tar is as specified in SUSv2, but with differences as listed 21934 below. 21935 21936 Differences 21937 21938 Some elements of the Pattern Matching Notation are optional; 21939 see Pattern Matching Notation. 21940 21941 -h 21942 21943 doesn't dump symlinks; dumps the files they point to. 21944 -z 21945 21946 filters the archive through gzip. 21947 21948 umount 21949 21950 Name 21951 21952 umount -- unmount file systems 21953 21954 Synopsis 21955 21956 umount [-hV] 21957 umount -a [-nrv] [-t vfstype] 21958 umount [-nrv] device | dir... 21959 21960 Description 21961 21962 umount detaches the file system(s) mentioned from the file 21963 hierarchy. A file system is specified by giving the directory 21964 where it has been mounted. 21965 21966 Standard Options 21967 21968 -v 21969 21970 invokes verbose mode. 21971 -n 21972 21973 unmounts without writing in /etc/mtab. 21974 -r 21975 21976 tries to remount read-only if unmounting fails. 21977 -a 21978 21979 unmounts all of the file systems described in /etc/mtab except 21980 for the proc file system. 21981 -t vfstype 21982 21983 indicates that the actions should only be taken on file 21984 systems of the specified type. More than one type may be 21985 specified in a comma separated list. The list of file system 21986 types can be prefixed with no to specify the file system types 21987 on which no action should be taken. 21988 -f 21989 21990 forces unmount (in case of an unreachable NFS system). 21991 21992 LSB Deprecated Options 21993 21994 The behaviors specified in this section are expected to 21995 disappear from a future version of the LSB; applications 21996 should only use the non-LSB-deprecated behaviors. 21997 21998 -V 21999 22000 print version and exits. 22001 22002 useradd 22003 22004 Name 22005 22006 useradd -- create a new user or update default new user 22007 information 22008 22009 Synopsis 22010 22011 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 22012 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 22013 [-u uid [-o]] login 22014 useradd -D [-g default_group] [-b default_home] [-s 22015 default_shell] 22016 22017 Description 22018 22019 When invoked without the -D option, and with appropriate 22020 privilege, useradd creates a new user account using the values 22021 specified on the command line and the default values from the 22022 system. The new user account will be entered into the system 22023 files as needed, the home directory will be created, and 22024 initial files copied, depending on the command line options. 22025 22026 When invoked with the -D option, useradd will either display 22027 the current default values, or, with appropriate privilege, 22028 update the default values from the command line. If no options 22029 are specified, useradd displays the current default values. 22030 22031 The useradd command is a system administration utility, see 22032 Path For System Administration Utilities. 22033 22034 Standard Options 22035 22036 -c comment 22037 22038 specifies the new user's password file comment field value. 22039 -d home_dir 22040 22041 creates the new user using home_dir as the value for the 22042 user's login directory. The default is to append the login 22043 name to default_home and use that as the login directory name. 22044 -g initial_group 22045 22046 specifies the group name or number of the user's initial login 22047 group. The group name shall exist. A group number shall refer 22048 to an already existing group. If -g is not specified, the 22049 implementation will follow the normal user default for that 22050 system. This may create a new group or choose a default group 22051 that normal users are placed in. Applications which require 22052 control of the groups into which a user is placed should 22053 specify -g. 22054 -G group[,...] 22055 22056 specifies a list of supplementary groups which the user is 22057 also a member of. Each group is separated from the next by a 22058 comma, with no intervening whitespace. The groups are subject 22059 to the same restrictions as the group given with the -g 22060 option. The default is for the user to belong only to the 22061 initial group. 22062 -m [-k skeleton_dir] 22063 22064 specifies the user's home directory will be created if it does 22065 not exist. The files contained in skeleton_dir will be copied 22066 to the home directory if the -k option is used, otherwise the 22067 files contained in /etc/skel will be used instead. Any 22068 directories contained in skeleton_dir or /etc/skel will be 22069 created in the user's home directory as well. The -k option is 22070 only valid in conjunction with the -m option. The default is 22071 to not create the directory and to not copy any files. 22072 -p passwd 22073 22074 is the encrypted password, as returned by crypt(). The default 22075 is to disable the account. 22076 -r 22077 22078 creates a system account, that is, a user with a User ID in 22079 the range reserved for system account users. If there is not a 22080 User ID free in the reserved range the command will fail. 22081 -s shell 22082 22083 specifies the name of the user's login shell. The default is 22084 to leave this field blank, which causes the system to select 22085 the default login shell. 22086 -u uid [-o] 22087 22088 specifies the numerical value of the user's ID. This value 22089 shall be unique, unless the -o option is used. The value shall 22090 be non-negative. The default is the smallest ID value greater 22091 than 499 which is not yet used. 22092 22093 Change Default Options 22094 22095 -b default_home 22096 22097 specifies the initial path prefix for a new user's home 22098 directory. The user's name will be affixed to the end of 22099 default_home to create the new directory name if the -d option 22100 is not used when creating a new account. 22101 -g default_group 22102 22103 specifies the group name or ID for a new user's initial group. 22104 The named group shall exist, and a numerical group ID shall 22105 have an existing entry. 22106 -s default_shell 22107 22108 specifies the name of the new user's login shell. The named 22109 program will be used for all future new user accounts. 22110 -c comment 22111 22112 specifies the new user's password file comment field value. 22113 22114 Application Usage 22115 22116 The -D option will typically be used by system administration 22117 packages. Most applications should not change defaults which 22118 will affect other applications and users. 22119 22120 userdel 22121 22122 Name 22123 22124 userdel -- delete a user account and related files 22125 22126 Synopsis 22127 22128 userdel [-r] login 22129 22130 Description 22131 22132 Delete the user account named login. If there is also a group 22133 named login, this command may delete the group as well, or may 22134 leave it alone. 22135 22136 The userdel command is a system administration utility, see 22137 Path For System Administration Utilities. 22138 22139 Options 22140 22141 -r 22142 22143 removes files in the user's home directory along with the home 22144 directory itself. Files located in other file system will have 22145 to be searched for and deleted manually. 22146 22147 usermod 22148 22149 Name 22150 22151 usermod -- modify a user account 22152 22153 Synopsis 22154 22155 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] 22156 [-G group [,...]] [-l login_name] [-p passwd] [-s shell] [-u 22157 uid [ -o]] login 22158 22159 Description 22160 22161 The usermod command shall modify an entry in the user account 22162 database. 22163 22164 The usermod command is a system administration utility, see 22165 Path For System Administration Utilities. 22166 22167 Options 22168 22169 -c comment 22170 22171 specifies the new value of the user's password file comment 22172 field. 22173 -d home_dir 22174 22175 specifies the user's new login directory. If the -m option is 22176 given the contents of the current home directory will be moved 22177 to the new home directory, which is created if it does not 22178 already exist. 22179 -g initial_group 22180 22181 specifies the group name or number of the user's new initial 22182 login group. The group name shall exist. A group number shall 22183 refer to an already existing group. 22184 -G group,[...] 22185 22186 specifies a list of supplementary groups which the user is 22187 also a member of. Each group is separated from the next by a 22188 comma, with no intervening whitespace. The groups are subject 22189 to the same restrictions as the group given with the -g 22190 option. If the user is currently a member of a group which is 22191 not listed, the user will be removed from the group. 22192 -l login_name 22193 22194 changes the name of the user from login to login_name. Nothing 22195 else is changed. In particular, the user's home directory name 22196 should probably be changed to reflect the new login name. 22197 -p passwd 22198 22199 is the encrypted password, as returned by crypt(3). 22200 -s shell 22201 22202 specifies the name of the user's new login shell. Setting this 22203 field to blank causes the system to select the default login 22204 shell. 22205 -u uid [-o] 22206 22207 specifies the numerical value of the user's ID. This value 22208 shall be unique, unless the -o option is used. The value shall 22209 be non-negative. Any files which the user owns and which are 22210 located in the directory tree rooted at the user's home 22211 directory will have the file user ID changed automatically. 22212 Files outside of the user's home directory shall be altered 22213 manually. 22214 22215 xargs 22216 22217 Name 22218 22219 xargs -- build and execute command lines from standard input 22220 22221 Description 22222 22223 xargs is as specified in ISO POSIX (2003), but with 22224 differences as listed below. 22225 22226 Differences 22227 22228 -E 22229 22230 has unspecified behavior. 22231 -I 22232 22233 has unspecified behavior. 22234 -L 22235 22236 has unspecified behavior. 22237 22238 Note: These options have been implemented in 22239 findutils-4.2.9, but this version of the utilities is not 22240 in widespread use as of April 2005. However, future 22241 versions of this specification will require support for 22242 these arguments. 22243 22244 VI. Execution Environment 22245 22246 Table of Contents 22247 16. File System Hierarchy 22248 22249 16.1. /dev: Device Files 22250 16.2. /etc: Host-specific system configuration 22251 22252 16.2.1. File Naming Conventions 22253 22254 16.3. User Accounting Databases 22255 16.4. Path For System Administration Utilities 22256 22257 17. Additional Recommendations 22258 22259 17.1. Recommendations for applications on ownership and 22260 permissions 22261 22262 17.1.1. Directory Write Permissions 22263 17.1.2. File Write Permissions 22264 17.1.3. File Read and execute Permissions 22265 17.1.4. SUID and SGID Permissions 22266 17.1.5. Privileged users 22267 17.1.6. Changing permissions 22268 17.1.7. Removable Media (Cdrom, Floppy, etc.) 22269 17.1.8. Installable applications 22270 22271 18. Additional Behaviors 22272 22273 18.1. Mandatory Optional Behaviors 22274 22275 18.1.1. Special Requirements 22276 22277 19. Localization 22278 22279 19.1. Introduction 22280 19.2. Regular Expressions 22281 19.3. Pattern Matching Notation 22282 _________________________________________________________ 22283 22284 Chapter 16. File System Hierarchy 22285 22286 An LSB conforming implementation shall provide the mandatory 22287 portions of the file system hierarchy specified in the 22288 Filesystem Hierarchy Standard (FHS), together with any 22289 additional requirements made in this specification. 22290 22291 An LSB conforming application shall conform to the Filesystem 22292 Hierarchy Standard. 22293 22294 The FHS allows many components or subsystems to be optional. 22295 An application shall check for the existence of an optional 22296 component before using it, and should behave in a reasonable 22297 manner if the optional component is not present. 22298 22299 The FHS requirement to locate the operating system kernel in 22300 either / or /boot does not apply if the operating system 22301 kernel does not exist as a file in the file system. 22302 22303 The FHS specifies certain behaviors for a variety of commands 22304 if they are present (for example, ping or python). However, 22305 LSB conforming applications shall not rely on any commands 22306 beyond those specified by the LSB. The mere existence of a 22307 command may not be used as an indication that the command 22308 behaves in any particular way. 22309 22310 The following directories or links need not be present: 22311 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 22312 _________________________________________________________ 22313 22314 16.1. /dev: Device Files 22315 22316 The following shall exist under /dev. Other devices may also 22317 exist in /dev. Device names may exist as symbolic links to 22318 other device nodes located in /dev or subdirectories of /dev. 22319 There is no requirement concerning major/minor number values. 22320 22321 /dev/null 22322 22323 An infinite data source and data sink. Data written to this 22324 device shall be discarded. Reads from this device shall always 22325 return end-of-file (EOF). 22326 /dev/zero 22327 22328 This device is a source of zeroed out data. All data written 22329 to this device shall be discarded. A read from this device 22330 shall always return the requested number of bytes, each 22331 initialized to the value '\0'. 22332 /dev/tty 22333 22334 In each process, a synonym for the controlling terminal 22335 associated with the process group of that process, if any. All 22336 reads and writes to this device shall behave as if the actual 22337 controlling terminal device had been opened. 22338 _________________________________________________________ 22339 22340 16.2. /etc: Host-specific system configuration 22341 22342 In addition to the requirements for /etc in the Filesystem 22343 Hierarchy Standard, an LSB conforming system shall also 22344 provide the following directories or symbolic links to 22345 directories: 22346 22347 /etc/cron.d 22348 22349 A directory containing extended crontab files; see Cron Jobs. 22350 /etc/cron.daily 22351 22352 A directory containing shell scripts to be executed once a 22353 day; see Cron Jobs. 22354 /etc/cron.hourly 22355 22356 A directory containing shell scripts to be executed once per 22357 hour; see Cron Jobs. 22358 /etc/cron.monthly 22359 22360 A directory containing shell scripts to be executed once per 22361 month; see Cron Jobs. 22362 /etc/cron.weekly 22363 22364 A directory containing shell scripts to be executed once a 22365 week; see Cron Jobs. 22366 /etc/init.d 22367 22368 A directory containing system initialization scripts; see 22369 Installation and Removal of Init Scripts. 22370 /etc/profile.d 22371 22372 A directory containing shell scripts. Script names should 22373 follow the same conventions as specified for cron jobs (see 22374 Cron Jobs, but should have the suffix .sh. The behavior is 22375 unspecified if a script is installed in this directory that 22376 does not have the suffix .sh. 22377 22378 The sh utility shall read and execute commands in its current 22379 execution environment from all the shell scripts in this 22380 directory that have the suffix .sh when invoked as an 22381 interactive login shell, or if the -l (the letter ell) is 22382 specified (see Shell Invocation). 22383 22384 Future Directions: These directories are required at this 22385 version of the LSB since there is not yet an agreed method 22386 for abstracting the implementation so that applications 22387 need not be aware of these locations during installation. 22388 However, Future Directions describes a tool, lsbinstall, 22389 that will make these directories implementation specific 22390 and no longer required. 22391 _________________________________________________________ 22392 22393 16.2.1. File Naming Conventions 22394 22395 Conforming implemetnations and applications installing files 22396 into any of the above locations under /etc may only use 22397 filenames from the following managed namespaces: 22398 22399 * Assigned names. Such names must be chosen from the 22400 character set [a-z0-9]. In order to avoid conflicts these 22401 names shall be reserved through the Linux Assigned Names 22402 and Numbers Authority (LANANA). Information about the 22403 LANANA may be found at www.lanana.org. 22404 22405 Note: Commonly used names should be reserved in advance; 22406 developers for projects are encouraged to reserve names 22407 from LANANA, so that each distribution can use the same 22408 name, and to avoid conflicts with other projects. 22409 * Hierarchical names. Script names in this category take the 22410 form: --...-, where name is taken from 22411 the character set [a-z0-9], and where there may be one or 22412 more components. may either be an LSB 22413 provider name assigned by the LANANA, or it may be owners' 22414 DNS name in lower case, with at least one '.'. e.g. 22415 "debian.org", "staroffice.sun.com", etc. The LSB provider 22416 name assigned by LANANA shall only consist of the ASCII 22417 characters [a-z0-9]. 22418 * Reserved names. Names that begin with the character '_' 22419 are reserved for distribution use only. These names should 22420 be used for essential system packages only. 22421 22422 Note: A non-conforming application may still have polluted 22423 these managed namespaces with unregistered filenames; a 22424 conforming application should check for namespace 22425 collisions and take appropriate steps if they occur. 22426 22427 In general, if a package or some system function is likely 22428 to be used on multiple systems, the package developers or 22429 the distribution should get a registered name through 22430 LANANA, and distributions should strive to use the same 22431 name whenever possible. For applications which may not be 22432 essential or may not be commonly installed, the 22433 hierarchical namespace may be more appropriate. An 22434 advantage to the hierarchical namespace is that there is no 22435 need to consult with the LANANA before obtaining an 22436 assigned name. 22437 22438 Short names are highly desirable, since system 22439 administrators may need to manually start and stop 22440 services. Given this, they should be standardized on a 22441 per-package basis. This is the rationale behind having the 22442 LANANA organization assign these names. The LANANA may be 22443 called upon to handle other namespace issues, such as 22444 package/prerequisites naming. 22445 _________________________________________________________ 22446 22447 16.3. User Accounting Databases 22448 22449 The Filesystem Hierarchy Standard specifies two optional 22450 locations for user accounting databases used by the 22451 getutent(), getutent_r(), getutxent(), getutxid(), 22452 getutxline(), and pututxline() functions. These are 22453 /var/run/utmp and /var/run/wtmp. 22454 22455 The LSB does not specify the format or structure of these 22456 files, or even if they are files at all. They should be used 22457 only as "magic cookies" to the utmpname() function. 22458 _________________________________________________________ 22459 22460 16.4. Path For System Administration Utilities 22461 22462 Certain utilities used for system administration (and other 22463 privileged commands) may be stored in /sbin, /usr/sbin, and 22464 /usr/local/sbin. Applications requiring to use commands 22465 identified as system administration utilities should add these 22466 directories to their PATH. By default, as described in ISO 22467 POSIX (2003), standard utilities shall be found on the PATH 22468 returned by getconf PATH (or command -p getconf PATH to be 22469 guaranteed to invoke the correct version of getconf). 22470 _________________________________________________________ 22471 22472 Chapter 17. Additional Recommendations 22473 22474 17.1. Recommendations for applications on ownership and permissions 22475 22476 17.1.1. Directory Write Permissions 22477 22478 The application should not depend on having directory write 22479 permission in any directory except /tmp, /var/tmp, and the 22480 invoking user's home directory. 22481 22482 In addition, the application may store variable data in 22483 /var/opt/package, (where package is the name of the 22484 application package), if such a directory is created with 22485 appropriate permissions during the package installation. 22486 22487 For these directories the application should be able to work 22488 with directory write permissions restricted by the S_ISVTXT 22489 bit, implementing the restricted deletion mode as described 22490 for the XSI option for ISO POSIX (2003).. 22491 _________________________________________________________ 22492 22493 17.1.2. File Write Permissions 22494 22495 The application should not depend on file write permission to 22496 any file that it does not itself create. 22497 _________________________________________________________ 22498 22499 17.1.3. File Read and execute Permissions 22500 22501 The application should not depend on having read permission to 22502 every file and directory. 22503 _________________________________________________________ 22504 22505 17.1.4. SUID and SGID Permissions 22506 22507 The application should not depend on the set user ID or set 22508 group ID (the S_ISUID or S_ISGID permission bits) permissions 22509 of a file not packaged with the application. Instead, the 22510 distribution is responsible for assuming that all system 22511 commands have the required permissions and work correctly. 22512 22513 Rationale: In order to implement common security policies 22514 it is strongly advisable for applications to use the 22515 minimum set of security attributes necessary for correct 22516 operation. Applications that require substantial 22517 appropriate privilege are likely to cause problems with 22518 such security policies. 22519 _________________________________________________________ 22520 22521 17.1.5. Privileged users 22522 22523 In general, applications should not depend on running as a 22524 privileged user. This specification uses the term "appropriate 22525 privilege" throughout to identify operations that cannot be 22526 achieved without some special granting of additional 22527 privilege. 22528 22529 Applications that have a reason to run with appropriate 22530 privilege should outline this reason clearly in their 22531 documentation. Users of the application should be informed, 22532 that "this application demands security privileges, which 22533 could interfere with system security". 22534 22535 The application should not contain binary-only software that 22536 requires being run with appropriate privilege, as this makes 22537 security auditing harder or even impossible. 22538 _________________________________________________________ 22539 22540 17.1.6. Changing permissions 22541 22542 The application shall not change permissions of files and 22543 directories that do not belong to its own package. Should an 22544 application require that certain files and directories not 22545 directly belonging to the package have a particular ownership, 22546 the application shall document this requirement, and may fail 22547 during installation if the permissions on these files is 22548 inappropriate. 22549 _________________________________________________________ 22550 22551 17.1.7. Removable Media (Cdrom, Floppy, etc.) 22552 22553 Applications that expect to be runnable from removable media 22554 should not depend on logging in as a privileged user, and 22555 should be prepared to deal with a restrictive environment. 22556 Examples of such restrictions could be default mount options 22557 that disable set-user/group-ID attributes, disabling block or 22558 character-special files on the medium, or remapping the user 22559 and group IDs of files away from any privileged value. 22560 22561 Rationale: System vendors and local system administrators 22562 want to run applications from removable media, but want the 22563 possibility to control what the application can do. 22564 _________________________________________________________ 22565 22566 17.1.8. Installable applications 22567 22568 Where the installation of an application needs additional 22569 privileges, it must clearly document all files and system 22570 databases that are modified outside of those in /opt/pkg-name 22571 and /var/opt/pkg-name, other than those that may be updated by 22572 system logging or auditing activities. 22573 22574 Without this, the local system administrator would have to 22575 blindly trust a piece of software, particularly with respect 22576 to its security. 22577 _________________________________________________________ 22578 22579 Chapter 18. Additional Behaviors 22580 22581 18.1. Mandatory Optional Behaviors 22582 22583 This section specifies behaviors in which there is optional 22584 behavior in one of the standards on which the LSB relies, and 22585 where the LSB requires a specific behavior. 22586 22587 Note: The LSB does not require the kernel to be Linux; the 22588 set of mandated options reflects current existing practice, 22589 but may be modified in future releases. 22590 22591 LSB conforming implementations shall support the following 22592 options defined within the ISO POSIX (2003): 22593 22594 _POSIX_FSYNC 22595 _POSIX_MAPPED_FILES 22596 _POSIX_MEMLOCK 22597 _POSIX_MEMLOCK_RANGE 22598 _POSIX_MEMORY_PROTECTION 22599 _POSIX_PRIORITY_SCHEDULING 22600 _POSIX_REALTIME_SIGNALS 22601 _POSIX_THREAD_ATTR_STACKADDR 22602 _POSIX_THREAD_ATTR_STACKSIZE 22603 _POSIX_THREAD_PROCESS_SHARED 22604 _POSIX_THREAD_SAFE_FUNCTIONS 22605 _POSIX_THREADS 22606 22607 The opendir() function shall consume a file descriptor in the 22608 same fashion as open(), and therefore may fail with EMFILE or 22609 ENFILE. 22610 22611 The START and STOP termios characters shall be changeable, as 22612 described as optional behavior in the "General Terminal 22613 Interface" section of the ISO POSIX (2003). 22614 22615 The access() function function shall fail with errno set to 22616 EINVAL if the amode argument contains bits other than those 22617 set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 22618 22619 The link() function shall require access to the existing file 22620 in order to succeed, as described as optional behavior in the 22621 ISO POSIX (2003). 22622 22623 Calling unlink() on a directory shall fail. Calling link() 22624 specifying a directory as the first argument shall fail. See 22625 also unlink. 22626 22627 Note: Linux allows rename() on a directory without having 22628 write access, but the LSB does not require this. 22629 _________________________________________________________ 22630 22631 18.1.1. Special Requirements 22632 22633 LSB conforming systems shall enforce certain special 22634 additional restrictions above and beyond those required by ISO 22635 POSIX (2003). 22636 22637 Note: These additional restrictions are required in order 22638 to support the testing and certification programs 22639 associated with the LSB. In each case, these are values 22640 that defined macros must not have; conforming applications 22641 that use these values shall trigger a failure in the 22642 interface that is otherwise described as a "may fail". 22643 22644 The fcntl() function shall treat the "cmd" value -1 as 22645 invalid. 22646 22647 The whence value -1 shall be an invalid value for the lseek(), 22648 fseek() and fcntl() functions. 22649 22650 The value -5 shall be an invalid signal number. 22651 22652 If the sigaddset() or sigdelset() functions are passed an 22653 invalid signal number, they shall return with EINVAL. 22654 Implementations are only required to enforce this requirement 22655 for signal numbers which are specified to be invalid by this 22656 specification (such as the -5 mentioned above). 22657 22658 The mode value -1 to the access() function shall be treated as 22659 invalid. 22660 22661 A value of -1 shall be an invalid "_PC_..." value for 22662 pathconf(). 22663 22664 A value of -1 shall be an invalid "_SC..." value for 22665 sysconf(). 22666 22667 The nl_item value -1 shall be invalid for nl_langinfo(). 22668 22669 The value -1 shall be an invalid "_CS_..." value for 22670 confstr(). 22671 22672 The value "a" shall be an invalid mode argument to popen(). 22673 22674 The fcntl() function shall fail and set errno to EDEADLK if 22675 the cmd argument is F_SETLKW, and the lock is blocked by a 22676 lock from another process already blocked by the current 22677 process. 22678 22679 The opendir() function shall consume a file descriptor; the 22680 readdir() function shall fail and set errno to EBADF if the 22681 underlying file descriptor is closed. 22682 22683 The link() function shall not work across file systems, and 22684 shall fail and set errno to EXDEV as described as optional 22685 behavior in ISO POSIX (2003). 22686 _________________________________________________________ 22687 22688 Chapter 19. Localization 22689 22690 19.1. Introduction 22691 22692 In order to install a message catalog, the installation 22693 procedure shall supply the message catalog in a format 22694 readable by the msgfmt utility, which shall be invoked to 22695 compile the message catalog into an appropriate binary format 22696 on the target system. 22697 22698 Rationale: The original intent was to allow an application 22699 to contain the binary GNU MO format files. However, the 22700 format of these files is not officially stable, hence it is 22701 necessary to compile these catalogs on the target system. 22702 These binary catalogs may differ from architecture to 22703 architecture as well. 22704 22705 The resulting binary message catalog shall be located in the 22706 package's private area under /opt, and the application may use 22707 bindtextdomain() to specify this location. 22708 22709 Implementations shall support the POSIX and C locales as 22710 specified in ISO POSIX (2003). Other locales may be supported. 22711 22712 Implementations may define additional locale categories not 22713 defined by that standard. 22714 22715 Note: Implementations choosing additional locale categories 22716 should be aware of ISO/IEC TR14652 and are advised not to 22717 choose names that conflict with that specification. If 22718 implementations provide locale categories whose names are 22719 part of the FDCC set of ISO/IEC TR14652, they should behave 22720 as defined by that specification. 22721 _________________________________________________________ 22722 22723 19.2. Regular Expressions 22724 22725 Utilities that process regular expressions shall support Basic 22726 Regular Expressions and Extended Regular Expressions as 22727 specified in ISO POSIX (2003), with the following exceptions: 22728 22729 Range expression (such as [a-z]) can be based on code point 22730 order instead of collating element order. 22731 22732 Equivalence class expression (such as [=a=]) and 22733 multi-character collating element expression (such as [.ch.]) 22734 are optional. 22735 22736 Handling of a multi-character collating element is optional. 22737 22738 This affects at least the following utilities: 22739 22740 * awk (see awk) 22741 * grep (see grep) (including egrep, see egrep) 22742 * sed (see sed) 22743 22744 It also affects the behavior of interfaces in the base 22745 libraries, including at least 22746 22747 * regexec() (see regexec) 22748 _________________________________________________________ 22749 22750 19.3. Pattern Matching Notation 22751 22752 Utilities that perform filename pattern matching (also known 22753 as Filename Globbing) shall do it as specified in ISO POSIX 22754 (2003), Pattern Matching Notation, with the following 22755 exceptions: 22756 22757 Pattern bracket expressions (such as [a-z]) can be based on 22758 code point order instead of collating element order. 22759 22760 Equivalence class expression (such as [=a=]) and 22761 multi-character collating element expression (such as [.ch.]) 22762 are optional. 22763 22764 Handling of a multi-character collating element is optional. 22765 22766 This affects at least the following utilities: cpio (cpio), 22767 find (find) and tar (tar). 22768 22769 VII. System Initialization 22770 22771 Table of Contents 22772 20. System Initialization 22773 22774 20.1. Cron Jobs 22775 20.2. Init Script Actions 22776 20.3. Comment Conventions for Init Scripts 22777 20.4. Installation and Removal of Init Scripts 22778 20.5. Run Levels 22779 20.6. Facility Names 22780 20.7. Script Names 22781 20.8. Init Script Functions 22782 _________________________________________________________ 22783 22784 Chapter 20. System Initialization 22785 22786 20.1. Cron Jobs 22787 22788 In addition to the individual user crontab files specified by 22789 ISO POSIX (2003) stored under /var/spool/cron, the process 22790 that executes scheduled commands shall also process the 22791 following additional crontab files: /etc/crontab, 22792 /etc/cron.d/*. The installation of a package shall not modify 22793 the configuration file /etc/crontab. 22794 22795 If a package wishes to install a job that has to be executed 22796 periodically, it shall place an executable cron script in one 22797 of the following directories: 22798 22799 /etc/cron.hourly 22800 /etc/cron.daily 22801 /etc/cron.weekly 22802 /etc/cron.monthly 22803 22804 As these directory names suggest, the files within them are 22805 executed on a hourly, daily, weekly, or monthly basis, 22806 respectively, under the control of an entry in one of the 22807 system crontab files, at an unspecified time of day. See below 22808 for the rules concerning the names of cron scripts. 22809 22810 Note: It is recommended that cron scripts installed in any 22811 of these directories be script files rather than compiled 22812 binaries so that they may be modified by the local system 22813 administrator. Conforming applications may only install 22814 cron scripts which use an interpreter required by this 22815 specification or provided by this or another conforming 22816 application. 22817 22818 This specification does not define the concept of a package 22819 upgrade. Implementations may do different things when 22820 packages are upgraded, including not replacing a cron 22821 script if it marked as a configuration file, particularly 22822 if the cron script appears to have been modified since 22823 installation. In some circumstances, the cron script may 22824 not be removed when the package is uninstalled. 22825 Applications should design their installation procedure and 22826 cron scripts to be robust in the face of such behavior. In 22827 particular, cron scripts should not fail obscurely if run 22828 in unexpected circumstances. Testing for the existence of 22829 application binaries before executing them is suggested. 22830 22831 Future versions of this specification may remove the need 22832 to install file directly into these directories, and 22833 instead abstract the interface to the cron utility in such 22834 a way as to hide the implementation. Please see Future 22835 Directions. 22836 22837 If a certain task has to be executed at other than the 22838 predefined frequencies, the package shall install a file 22839 /etc/cron.d/cron-name. The file shall have the same format as 22840 that described for the crontab command in ISO POSIX (2003), 22841 except that there shall be an additional field, username, 22842 before the name of the command to execute. For completeness, 22843 the seven fields shall be: 22844 22845 1. Minute [0,59] 22846 2. Hour [0,23] 22847 3. Day of the month [1,31] 22848 4. Month of the year [1,12] 22849 5. Day of the week [0,6] (with 0=Sunday) 22850 6. Username 22851 7. command [args ...] 22852 22853 This file shall be processed by the system automatically, with 22854 the named command being run at the specified time, as the 22855 specified username. 22856 22857 Applications installing files in these directories shall use 22858 the LSB naming conventions (see File Naming Conventions). 22859 _________________________________________________________ 22860 22861 20.2. Init Script Actions 22862 22863 Conforming applications which need to execute commands on 22864 changes to the system run level (including boot and shutdown), 22865 may install one or more init scripts. Init scripts provided by 22866 conforming applications shall accept a single argument which 22867 selects the action: 22868 22869 start start the service 22870 stop stop the service 22871 restart stop and restart the service if the service is already 22872 running, otherwise start the service 22873 try-restart restart the service if the service is already 22874 running 22875 reload cause the configuration of the service to be reloaded 22876 without actually stopping and restarting the service 22877 force-reload cause the configuration to be reloaded if the 22878 service supports this, otherwise restart the service if it is 22879 running 22880 status print the current status of the service 22881 22882 The start, stop, restart, force-reload, and status actions 22883 shall be supported by all init scripts; the reload and the 22884 try-restart actions are optional. Other init-script actions 22885 may be defined by the init script. 22886 22887 Init scripts shall ensure that they will behave sensibly if 22888 invoked with start when the service is already running, or 22889 with stop when not running, and that they do not kill 22890 similarly-named user processes. The best way to achieve this 22891 is to use the init-script functions provided by 22892 /lib/lsb/init-functions (see Init Script Functions) 22893 22894 If a service reloads its configuration automatically (as in 22895 the case of cron, for example), the reload action of the init 22896 script shall behave as if the configuration was reloaded 22897 successfully. The restart, try-restart, reload and 22898 force-reload actions may be atomic; that is if a service is 22899 known not to be operational after a restart or reload, the 22900 script may return an error without any further action. 22901 22902 Note: This specification does not define the concept of a 22903 package upgrade. Implementations may do different things 22904 when packages are upgraded, including not replacing an init 22905 script if it is marked as a configuration file, 22906 particularly if the file appears to have been modified 22907 since installation. In some circumstances, the init script 22908 may not be removed when the package is uninstalled. 22909 Applications should design their installation procedure and 22910 init scripts to be robust in the face of such behavior. In 22911 particular, init scripts should not fail obscurely if run 22912 in unexpected circumstances. Testing for the existence of 22913 application binaries before executing them is suggested. 22914 22915 If the status action is requested, the init script will return 22916 the following exit status codes. 22917 22918 0 program is running or service is OK 22919 1 program is dead and /var/run pid file exists 22920 2 program is dead and /var/lock lock file exists 22921 3 program is not running 22922 4 program or service status is unknown 22923 5-99 reserved for future LSB use 22924 100-149 reserved for distribution use 22925 150-199 reserved for application use 22926 200-254 reserved 22927 22928 For all other init-script actions, the init script shall 22929 return an exit status of zero if the action was successful. 22930 Otherwise, the exit status shall be non-zero, as defined 22931 below. In addition to straightforward success, the following 22932 situations are also to be considered successful: 22933 22934 * restarting a service (instead of reloading it) with the 22935 force-reload argument 22936 * running start on a service already running 22937 * running stop on a service already stopped or not running 22938 * running restart on a service already stopped or not 22939 running 22940 * running try-restart on a service already stopped or not 22941 running 22942 22943 In case of an error while processing any init-script action 22944 except for status, the init script shall print an error 22945 message and exit with a non-zero status code: 22946 22947 1 generic or unspecified error (current practice) 22948 2 invalid or excess argument(s) 22949 3 unimplemented feature (for example, "reload") 22950 4 user had insufficient privilege 22951 5 program is not installed 22952 6 program is not configured 22953 7 program is not running 22954 8-99 reserved for future LSB use 22955 100-149 reserved for distribution use 22956 150-199 reserved for application use 22957 200-254 reserved 22958 22959 Error and status messages should be printed with the logging 22960 functions (see Init Script Functions) log_success_msg(), 22961 log_failure_msg() and log_warning_msg(). Scripts may write to 22962 standard error or standard output, but implementations need 22963 not present text written to standard error/output to the user 22964 or do anything else with it. 22965 22966 Note: Since init scripts may be run manually by a system 22967 administrator with non-standard environment variable values 22968 for PATH, USER, LOGNAME, etc., init scripts should not 22969 depend on the values of these environment variables. They 22970 should set them to some known/default values if they are 22971 needed. 22972 _________________________________________________________ 22973 22974 20.3. Comment Conventions for Init Scripts 22975 22976 Conforming applications may install one or more init scripts. 22977 These init scripts must be activated by invoking the 22978 install_initd command. Prior to package removal, the changes 22979 applied by install_initd must be undone by invoking 22980 remove_initd. See Installation and Removal of Init Scripts for 22981 more details. 22982 22983 install_initd and remove_initd determine actions to take by 22984 decoding a specially formatted block of lines in the script. 22985 This block shall be delimited by the lines 22986 ### BEGIN INIT INFO 22987 ### END INIT INFO 22988 22989 The delimiter lines may contain trailing whitespace, which 22990 shall be ignored. All lines inside the block shall begin with 22991 a hash character '#' in the first column, so the shell 22992 interprets them as comment lines which do not affect operation 22993 of the script. The lines shall be of the form: 22994 # {keyword}: arg1 [arg2...] 22995 22996 with exactly one space character between the '#' and the 22997 keyword, with a single exception. In lines following a line 22998 containing the Description keyword, and until the next keyword 22999 or block ending delimiter is seen, a line where the '#' is 23000 followed by more than one space or a tab character shall be 23001 treated as a continuation of the previous line. 23002 23003 The information extracted from the block is used by the 23004 installation tool or the init-script system to assure that 23005 init scripts are run in the correct order. It is unspecified 23006 whether the information is evaluated only when install_initd 23007 runs, when the init scripts are executed, or both. The 23008 information extracted includes run levels, defined in Run 23009 Levels, and boot facilities, defined in Facility Names. 23010 23011 The following keywords, with their arguments, are defined: 23012 23013 Provides: boot_facility_1 [boot_facility_2...] 23014 boot facilities provided by this init script. When an 23015 init script is run with a start argument, the boot 23016 facility or facilities specified by the Provides 23017 keyword shall be deemed present and hence init scripts 23018 which require those boot facilities should be started 23019 later. When an init script is run with a stop argument, 23020 the boot facilities specified by the Provides keyword 23021 are deemed no longer present. 23022 23023 Required-Start: boot_facility_1 [boot_facility_2...] 23024 facilities which must be available during startup of 23025 this service. The init-script system should insure init 23026 scripts which provide the Required-Start facilities are 23027 started before starting this script. 23028 23029 Required-Stop: boot_facility_1 [boot_facility_2...] 23030 facilities which must be available during the shutdown 23031 of this service. The init-script system should avoid 23032 stopping init scripts which provide the Required-Stop 23033 facilities until this script is stopped. 23034 23035 Should-Start: boot_facility_1 [boot_facility_2...] 23036 facilities which, if present, should be available 23037 during startup of this service. This allows for weak 23038 dependencies which do not cause the service to fail if 23039 a facility is not available. The service may provide 23040 reduced functionality in this situation. Conforming 23041 applications should not rely on the existence of this 23042 feature. 23043 23044 Should-Stop: boot_facility_1 [boot_facility_2...] 23045 facilities which should be available during shutdown of 23046 this service. 23047 23048 Default-Start: run_level_1 [run_level_2...], Default-Stop: 23049 run_level_1 [run_level_2...] 23050 which run levels should by default run the init script 23051 with a start (stop) argument to start (stop) the 23052 services controlled by the init script. 23053 23054 For example, if a service should run in runlevels 3, 4, 23055 and 5 only, specify "Default-Start: 3 4 5" and 23056 "Default-Stop: 0 1 2 6". 23057 23058 Short-Description: short_description 23059 provide a brief description of the actions of the init 23060 script. Limited to a single line of text. 23061 23062 Description: multiline_description 23063 provide a more complete description of the actions of 23064 the init script. May span mulitple lines. In a 23065 multiline description, each continuation line shall 23066 begin with a '#' followed by tab character or a '#' 23067 followed by at least two space characters. The 23068 multiline description is terminated by the first line 23069 that does not match this criteria. 23070 23071 Additional keywords may be defined in future versions of this 23072 specification. Also, implementations may define local 23073 extensions by using the prefix X-implementor. For example, 23074 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 23075 23076 Example: 23077 23078 ### BEGIN INIT INFO 23079 # Provides: lsb-ourdb 23080 # Required-Start: $local_fs $network $remote_fs 23081 # Required-Stop: $local_fs $network $remote_fs 23082 # Default-Start: 2 3 4 5 23083 # Default-Stop: 0 1 6 23084 # Short-Description: start and stop OurDB 23085 # Description: OurDB is a very fast and reliable database 23086 # engine used for illustrating init scripts 23087 ### END INIT INFO 23088 23089 The comment conventions described in this section are only 23090 required for init scripts installed by conforming 23091 applications. Conforming runtime implementations are not 23092 required to use this scheme in their system provided init 23093 scripts. 23094 23095 Note: This specification does not require, but is designed 23096 to allow, the development of a system which runs init 23097 scripts in parallel. Hence, enforced-serialization of 23098 scripts is avoided unless it is explicitly necessary. 23099 _________________________________________________________ 23100 23101 20.4. Installation and Removal of Init Scripts 23102 23103 Conforming applications may install one or more initialization 23104 scripts (or init scripts). An init script shall be installed 23105 in /etc/init.d (which may be a symbolic link to another 23106 location), by the package installer. 23107 23108 Note: The requirement to install scripts in /etc/init.d may 23109 be removed in future versions of this specification. See 23110 Host-specific system configuration and Future Directions 23111 for further details. 23112 23113 During the installer's post-install processing phase the 23114 program /usr/lib/lsb/install_initd must be called to activate 23115 the init script. Activation consists of arranging for the init 23116 script to be called in the correct order on system run-level 23117 changes (including system boot and shutdown), based on 23118 dependencies supplied in the init script (see Comment 23119 Conventions for Init Scripts). The install_initd command 23120 should be thought of as a wrapper which hides the 23121 implementation details; how any given implementation arranges 23122 for the init script to be called at the appropriate time is 23123 not specified. 23124 23125 Example: if an init script specified "Default-Start: 3 4 5" 23126 and "Default-Stop: 0 1 2 6", install_initd might create 23127 "start" symbolic links with names starting with 'S' in 23128 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 23129 links with names starting with 'K' in /etc/rc0.d, 23130 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 23131 be similar to the System V Init mechanism, but is by no 23132 means the only way this specification could be implemented. 23133 23134 The install_initd command takes a single argument, the full 23135 pathname of the installed init script. The init script must 23136 already be installed in /etc/init.d. The install_initd command 23137 will not copy it there, only activate it once it has been 23138 installed. For example: 23139 23140 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 23141 23142 The install_initd command shall return an exit status of zero 23143 if the init-script activation was successful or if the init 23144 script was already activated. If the dependencies in the init 23145 script (see Comment Conventions for Init Scripts) cannot be 23146 met, an exit status of one shall be returned and the init 23147 script shall not be activated. 23148 23149 When a software package is removed, /usr/lib/lsb/remove_initd 23150 must be called to deactivate the init script. This must occur 23151 before the init script itself is removed, as the dependency 23152 information in the script may be required for successful 23153 completion. Thus the installer's pre-remove processing phase 23154 must call remove_initd, and pass the full pathname of the 23155 installed init script. The package installer is still 23156 responsible for removing the init script. For example: 23157 23158 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 23159 23160 The remove_initd program shall return an exit status of zero 23161 if the init script has been successfully deactivated or if the 23162 init script is not activated. If another init script which 23163 depends on a boot facility provided by this init script is 23164 activated, an exit status of one shall be returned and the 23165 init script shall remain activated. The installer must fail on 23166 such an exit code so it does not subsequently remove the init 23167 script. 23168 23169 Note: This specification does not describe a mechanism for 23170 the system administrator to manipulate the run levels at 23171 which an init script is started or stopped. There is no 23172 assurance that modifying the comment block for this purpose 23173 will have the desired effect. 23174 _________________________________________________________ 23175 23176 20.5. Run Levels 23177 23178 The following run levels are specified for use by the 23179 Default-Start and Default-Stop actions defined in Comment 23180 Conventions for Init Scripts as hints to the install_initd 23181 command. Conforming implementations are not required to 23182 provide these exact run levels or give them the meanings 23183 described here, and may map any level described here to a 23184 different level which provides the equivalent functionality. 23185 Applications may not depend on specific run-level numbers. 23186 23187 0 halt 23188 1 single user mode 23189 2 multiuser with no network services exported 23190 3 normal/full multiuser 23191 4 reserved for local use, default is normal/full multiuser 23192 5 multiuser with a display manager or equivalent 23193 6 reboot 23194 23195 Note: These run levels were chosen as reflecting the most 23196 frequent existing practice, and in the absence of other 23197 considerations, implementors are strongly encouraged to 23198 follow this convention to provide consistency for system 23199 administrators who need to work with multiple 23200 distributions. 23201 _________________________________________________________ 23202 23203 20.6. Facility Names 23204 23205 Boot facilities are used to indicate dependencies in 23206 initialization scripts, as defined in Comment Conventions for 23207 Init Scripts. Facility names are assigned to scripts by the 23208 Provides: keyword. Facility names that begin with a dollar 23209 sign ('$') are reserved system facility names. 23210 23211 Note: Facility names are only recognized in the context of 23212 the init script comment block and are not available in the 23213 body of the init script. In particular, the use of the 23214 leading '$' character does not imply system facility names 23215 are subject to shell variable expansion, since they appear 23216 inside comments. 23217 23218 Conforming applications shall not provide facilities that 23219 begin with a dollar sign. Implementations shall provide the 23220 following facility names: 23221 23222 $local_fs 23223 23224 all local file systems are mounted 23225 $network 23226 23227 basic networking support is available. Example: a server 23228 program could listen on a socket. 23229 $named 23230 23231 IP name-to-address translation, using the interfaces described 23232 in this specification, are available to the level the system 23233 normally provides them. Example: if a DNS query daemon 23234 normally provides this facility, then that daemon has been 23235 started. 23236 $portmap 23237 23238 daemons providing SunRPC/ONCRPC portmapping service as defined 23239 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 23240 present) are running. 23241 $remote_fs 23242 23243 all remote file systems are available. In some configurations, 23244 file systems such as /usr may be remote. Many applications 23245 that require $local_fs will probably also require $remote_fs. 23246 $syslog 23247 23248 system logger is operational. 23249 $time 23250 23251 the system time has been set, for example by using a 23252 network-based time program such as ntp or rdate, or via the 23253 hardware Real Time Clock. 23254 23255 Other (non-system) facilities may be defined by other 23256 conforming applications. These facilities shall be named using 23257 the same conventions defined for naming init scripts (see 23258 Script Names). Commonly, the facility provided by a conforming 23259 init script will have the same name as the name assigned to 23260 the init script. 23261 _________________________________________________________ 23262 23263 20.7. Script Names 23264 23265 Since init scripts live in a single directory, they must share 23266 a single namespace. To avoid conflicts, applications 23267 installing files in this directories shall use the LSB naming 23268 conventions (see File Naming Conventions). 23269 _________________________________________________________ 23270 23271 20.8. Init Script Functions 23272 23273 Each conforming init script shall execute the commands in the 23274 file /lib/lsb/init-functions in the current environment (see 23275 shell special built-in command dot). This file shall cause the 23276 following shell script commands to be defined in an 23277 unspecified manner. 23278 23279 Note: This can be done either by adding a directory to the 23280 PATH variable which defines these commands, or by defining 23281 shell aliases or functions. 23282 23283 Although the commands made available via this mechanism 23284 need not be conforming applications in their own right, 23285 applications that use them should only depend on features 23286 described in this specification. 23287 23288 Conforming scripts shall not specify the "exit on error" 23289 option (i.e. set -e) when sourcing this file, or calling any 23290 of the commands thus made available. 23291 23292 The start_daemon, killproc and pidofproc functions shall use 23293 the following algorithm for determining the status and the 23294 process identifiers of the specified program. 23295 23296 1. If the -p pidfile option is specified, and the named 23297 pidfile exists, a single line at the start of the pidfile 23298 shall be read. If this line contains one or more numeric 23299 values, separated by spaces, these values shall be used. 23300 If the -p pidfile option is specified and the named 23301 pidfile does not exist, the functions shall assume that 23302 the daemon is not running. 23303 2. Otherwise, /var/run/basename.pid shall be read in a 23304 similar fashion. If this contains one or more numeric 23305 values on the first line, these values shall be used. 23306 Optionally, implementations may use unspecified additional 23307 methods to locate the process identifiers required. 23308 23309 The method used to determine the status is implementation 23310 defined, but should allow for non-binary programs. 23311 23312 Note: Commonly used methods check either for the existence 23313 of the /proc/pid directory or use /proc/pid/exe and 23314 /proc/pid/cmdline. Relying only on /proc/pid/exe is 23315 discouraged since this specification does not specify the 23316 existence of, or semantics for, /proc. Additionally, using 23317 /proc/pid/exe may result in a not-running status for 23318 daemons that are written in a script language. 23319 23320 Conforming implementations may use other mechanisms besides 23321 those based on pidfiles, unless the -p pidfile option has been 23322 used. Conforming applications should not rely on such 23323 mechanisms and should always use a pidfile. When a program is 23324 stopped, it should delete its pidfile. Multiple process 23325 identifiers shall be separated by a single space in the 23326 pidfile and in the output of pidofproc. 23327 23328 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 23329 [args...] 23330 runs the specified program as a daemon. The 23331 start_daemon function shall check if the program is 23332 already running using the algorithm given above. If so, 23333 it shall not start another copy of the daemon unless 23334 the -f option is given. The -n option specifies a nice 23335 level. See nice. start_daemon shall return the LSB 23336 defined exit status codes. It shall return 0 if the 23337 program has been successfully started or is running and 23338 not 0 otherwise. 23339 23340 killproc [-p pidfile] pathname [signal] 23341 The killproc function shall stop the specified program. 23342 The program is found using the algorithm given above. 23343 If a signal is specified, using the -signal_name or 23344 -signal_number syntaxes as specified by the kill 23345 command, the program is sent that signal. Otherwise, a 23346 SIGTERM followed by a SIGKILL after an unspecified 23347 number of seconds shall be sent. If a program has been 23348 terminated, the pidfile should be removed if the 23349 terminated process has not already done so. The 23350 killproc function shall return the LSB defined exit 23351 status codes. If called without a signal, it shall 23352 return 0 if the program has been stopped or is not 23353 running and not 0 otherwise. If a signal is given, it 23354 shall return 0 only if the program is running. 23355 23356 pidofproc [-p pidfile] pathname 23357 The pidofproc function shall return one or more process 23358 identifiers for a particular daemon using the algorithm 23359 given above. Only process identifiers of running 23360 processes should be returned. Multiple process 23361 identifiers shall be separated by a single space. 23362 23363 Note: A process may exit between pidofproc discovering its 23364 identity and the caller of pidofproc being able to act on 23365 that identity. As a result, no test assertion can be made 23366 that the process identifiers returned by pidofproc shall be 23367 running processes. 23368 23369 The pidofproc function shall return the LSB defined 23370 exit status codes for "status". It shall return 0 if 23371 the program is running and not 0 otherwise. 23372 23373 log_success_msg message 23374 The log_success_msg function shall cause the system to 23375 write a success message to an unspecified log file. The 23376 format of the message is unspecified. The 23377 log_success_msg function may also write a message to 23378 the standard output. 23379 23380 Note: The message should be relatively short; no more than 23381 60 characters is highly desirable. 23382 23383 log_failure_msg message 23384 The log_failure_msg function shall cause the system to 23385 write a failure message to an unspecified log file. The 23386 format of the message is unspecified. The 23387 log_failure_msg function may also write a message to 23388 the standard output. 23389 23390 Note: The message should be relatively short; no more than 23391 60 characters is highly desirable. 23392 23393 log_warning_msg message 23394 The log_warning_msg function shall cause the system to 23395 write a warning message to an unspecified log file. The 23396 format of the message is unspecified. The 23397 log_warning_msg function may also write a message to 23398 the standard output. 23399 23400 Note: The message should be relatively short; no more than 23401 60 characters is highly desirable. 23402 23403 VIII. Users & Groups 23404 23405 Table of Contents 23406 21. Users & Groups 23407 23408 21.1. User and Group Database 23409 21.2. User & Group Names 23410 21.3. User ID Ranges 23411 21.4. Rationale 23412 _________________________________________________________ 23413 23414 Chapter 21. Users & Groups 23415 23416 21.1. User and Group Database 23417 23418 The format of the User and Group databases is not specified. 23419 Programs may only read these databases using the provided API. 23420 Changes to these databases should be made using the provided 23421 commands. 23422 _________________________________________________________ 23423 23424 21.2. User & Group Names 23425 23426 Table 21-1 describes required mnemonic user and group names. 23427 This specification makes no attempt to numerically assign user 23428 or group identity numbers, with the exception that both the 23429 User ID and Group ID for the user root shall be equal to 0. 23430 23431 Table 21-1. Required User & Group Names 23432 User Group Comments 23433 root root Administrative user with all appropriate privileges 23434 bin bin Legacy User ID/Group ID[a] 23435 daemon daemon Legacy User ID/Group ID[b] 23436 Notes: 23437 a. The bin User ID/Group ID is included for compatibility with 23438 legacy applications. New applications should no longer use the 23439 bin User ID/Group ID. 23440 b. The daemon User ID/Group ID was used as an unprivileged 23441 User ID/Group ID for daemons to execute under in order to 23442 limit their access to the system. Generally daemons should now 23443 run under individual User ID/Group IDs in order to further 23444 partition daemons from one another. 23445 23446 Table 21-2 is a table of optional mnemonic user and group 23447 names. This specification makes no attempt to numerically 23448 assign uid or gid numbers. If the username exists on a system, 23449 then they should be in the suggested corresponding group. 23450 These user and group names are for use by distributions, not 23451 by applications. 23452 23453 Table 21-2. Optional User & Group Names 23454 User Group Comments 23455 adm adm Administrative special privileges 23456 lp lp Printer special privileges 23457 sync sync Login to sync the system 23458 shutdown shutdown Login to shutdown the system 23459 halt halt Login to halt the system 23460 mail mail Mail special privileges 23461 news news News special privileges 23462 uucp uucp UUCP special privileges 23463 operator root Operator special privileges 23464 man man Man special privileges 23465 nobody nobody Used by NFS 23466 23467 Only a minimum working set of "user names" and their 23468 corresponding "user groups" are required. Applications cannot 23469 assume non system user or group names will be defined. 23470 23471 Applications cannot assume any policy for the default file 23472 creation mask (umask) or the default directory permissions a 23473 user may have. Applications should enforce user only file 23474 permissions on private files such as mailboxes. The location 23475 of the users home directory is also not defined by policy 23476 other than the recommendations of the Filesystem Hierarchy 23477 Standard and should be obtained by the getpwnam(), 23478 getpwnam_r(), getpwent(), getpwuid(), and getpwuid_r() 23479 functions. 23480 _________________________________________________________ 23481 23482 21.3. User ID Ranges 23483 23484 The system User IDs from 0 to 99 should be statically 23485 allocated by the system, and shall not be created by 23486 applications. 23487 23488 The system User IDs from 100 to 499 should be reserved for 23489 dynamic allocation by system administrators and post install 23490 scripts using useradd. 23491 _________________________________________________________ 23492 23493 21.4. Rationale 23494 23495 The purpose of specifying optional users and groups is to 23496 reduce the potential for name conflicts between applications 23497 and distributions. 23498 23499 IX. Package Format and Installation 23500 23501 Table of Contents 23502 22. Software Installation 23503 23504 22.1. Introduction 23505 22.2. Package File Format 23506 23507 22.2.1. Lead Section 23508 22.2.2. Header Structure 23509 22.2.3. Signature Section 23510 22.2.4. Header Section 23511 22.2.5. Payload Section 23512 23513 22.3. Package Script Restrictions 23514 22.4. Package Tools 23515 22.5. Package Naming 23516 22.6. Package Dependencies 23517 22.7. Package Architecture Considerations 23518 _________________________________________________________ 23519 23520 Chapter 22. Software Installation 23521 23522 22.1. Introduction 23523 23524 Applications shall either be packaged in the RPM packaging 23525 format as defined in this specification, or supply an 23526 installer which is LSB conforming (for example, calls LSB 23527 commands and utilities). 23528 23529 Note: Supplying an RPM format package is encouraged because 23530 it makes systems easier to manage. This specification does 23531 not require the implementation to use RPM as the package 23532 manager; it only specifies the format of the package file. 23533 23534 Applications are also encouraged to uninstall cleanly. 23535 23536 A package in RPM format may include a dependency on the LSB 23537 Core and other LSB specifications, as described in Section 23538 22.6. Packages that are not in RPM format may test for the 23539 presence of a conforming implementation by means of the 23540 lsb_release utility. 23541 23542 Implementations shall provide a mechanism for installing 23543 applications in this packaging format with some restrictions 23544 listed below. 23545 23546 Note: The implementation itself may use a different 23547 packaging format for its own packages, and of course it may 23548 use any available mechanism for installing the 23549 LSB-conformant packages. 23550 _________________________________________________________ 23551 23552 22.2. Package File Format 23553 23554 An RPM format file consists of 4 sections, the Lead, 23555 Signature, Header, and the Payload. All values are stored in 23556 network byte order. 23557 23558 Table 22-1. RPM File Format 23559 Lead 23560 Signature 23561 Header 23562 Payload 23563 23564 These 4 sections shall exist in the order specified. 23565 23566 The lead section is used to identify the package file. 23567 23568 The signature section is used to verify the integrity, and 23569 optionally, the authenticity of the majority of the package 23570 file. 23571 23572 The header section contains all available information about 23573 the package. Entries such as the package's name, version, and 23574 file list, are contained in the header. 23575 23576 The payload section holds the files to be installed. 23577 _________________________________________________________ 23578 23579 22.2.1. Lead Section 23580 23581 struct rpmlead { 23582 unsigned char magic[4]; 23583 unsigned char major, minor; 23584 short type; 23585 short archnum; 23586 char name[66]; 23587 short osnum; 23588 short signature_type; 23589 char reserved[16]; 23590 } ; 23591 23592 magic 23593 23594 Value identifying this file as an RPM format file. This value 23595 shall be "\355\253\356\333". 23596 major 23597 23598 Value indicating the major version number of the file format 23599 version. This value shall be 3. 23600 minor 23601 23602 Value indicating the minor revision number of file format 23603 version. This value shall be 0. 23604 type 23605 23606 Value indicating whether this is a source or binary package. 23607 This value shall be 0 to indicate a binary package. 23608 archnum 23609 23610 Value indicating the architecture for which this package is 23611 valid. This value is specified in the relevant architecture 23612 specific part of ISO/IEC 23360. 23613 name 23614 23615 A NUL terminated string that provides the package name. This 23616 name shall conform with the Package Naming section of this 23617 specification. 23618 osnum 23619 23620 Value indicating the Operating System for which this package 23621 is valid. This value shall be 1. 23622 signature_type 23623 23624 Value indicating the type of the signature used in the 23625 Signature part of the file. This value shall be 5. 23626 reserved 23627 23628 Reserved space. The value is undefined. 23629 _________________________________________________________ 23630 23631 22.2.2. Header Structure 23632 23633 The Header structure is used for both the Signature and Header 23634 Sections. A Header Structure consists of 3 parts, a Header 23635 record, followed by 1 or more Index records, followed by 0 or 23636 more bytes of data associated with the Index records. A Header 23637 structure shall be aligned to an 8 byte boundary. 23638 23639 Table 22-2. Signature Format 23640 Header Record 23641 Array of Index Records 23642 Store of Index Values 23643 _________________________________________________________ 23644 23645 22.2.2.1. Header Record 23646 23647 struct rpmheader { 23648 unsigned char magic[4]; 23649 unsigned char reserved[4]; 23650 int nindex; 23651 int hsize; 23652 } ; 23653 23654 magic 23655 23656 Value identifying this record as an RPM header record. This 23657 value shall be "\216\255\350\001". 23658 reserved 23659 23660 Reserved space. This value shall be "\000\000\000\000". 23661 nindex 23662 23663 The number of Index Records that follow this Header Record. 23664 There should be at least 1 Index Record. 23665 hsize 23666 23667 The size in bytes of the storage area for the data pointed to 23668 by the Index Records. 23669 _________________________________________________________ 23670 23671 22.2.2.2. Index Record 23672 23673 struct rpmhdrindex { 23674 int tag; 23675 int type; 23676 int offset; 23677 int count; 23678 } ; 23679 23680 tag 23681 23682 Value identifying the purpose of the data associated with this 23683 Index Record. The value of this field is dependent on the 23684 context in which the Index Record is used, and is defined 23685 below and in later sections. 23686 type 23687 23688 Value identifying the type of the data associated with this 23689 Index Record. The possible type values are defined below. 23690 offset 23691 23692 Location in the Store of the data associated with this Index 23693 Record. This value should between 0 and the value contained in 23694 the hsize of the Header Structure. 23695 count 23696 23697 Size of the data associated with this Index Record. The count 23698 is the number of elements whose size is defined by the type of 23699 this Record. 23700 _________________________________________________________ 23701 23702 22.2.2.2.1. Index Type Values 23703 23704 The possible values for the type field are defined in this 23705 table. 23706 23707 Table 22-3. Index Type values 23708 Type Value Size (in bytes) Alignment 23709 RPM_NULL_TYPE 0 Not Implemented. 23710 RPM_CHAR_TYPE 1 1 1 23711 RPM_INT8_TYPE 2 1 1 23712 RPM_INT16_TYPE 3 2 2 23713 RPM_INT32_TYPE 4 4 4 23714 RPM_INT64_TYPE 5 Reserved. 23715 RPM_STRING_TYPE 6 variable, NUL terminated 1 23716 RPM_BIN_TYPE 7 1 1 23717 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 23718 strings 1 23719 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 23720 strings 1 23721 23722 The string arrays specified for entries of type 23723 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 23724 strings in a contiguous block of memory, each element 23725 separated from its neighbors by a NUL character. 23726 23727 Index records with type RPM_I18NSTRING_TYPE shall always have 23728 a count of 1. The array entries in an index of type 23729 RPM_I18NSTRING_TYPE correspond to the locale names contained 23730 in the RPMTAG_HDRI18NTABLE index. 23731 _________________________________________________________ 23732 23733 22.2.2.2.2. Index Tag Values 23734 23735 Some values are designated as header private, and may appear 23736 in any header structure. These are defined here. Additional 23737 values are defined in later sections. 23738 23739 Table 22-4. Header Private Tag Values 23740 Name Tag Value Type Count Status 23741 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 23742 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 23743 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Optional 23744 23745 RPMTAG_HEADERSIGNATURES 23746 The signature tag differentiates a signature header 23747 from a metadata header, and identifies the original 23748 contents of the signature header. 23749 23750 RPMTAG_HEADERIMMUTABLE 23751 This tag contains an index record which specifies the 23752 portion of the Header Record which was used for the 23753 calculation of a signature. This data shall be 23754 preserved or any header-only signature will be 23755 invalidated. 23756 23757 RPMTAG_HEADERI18NTABLE 23758 Contains a list of locales for which strings are 23759 provided in other parts of the package. 23760 23761 Not all Index records defined here will be present in all 23762 packages. Each tag value has a status which is defined here. 23763 23764 Required 23765 23766 This Index Record shall be present. 23767 Optional 23768 23769 This Index Record may be present. 23770 Informational 23771 23772 This Index Record may be present, but does not contribute to 23773 the processing of the package. 23774 Deprecated 23775 23776 This Index Record should not be present. 23777 Obsolete 23778 23779 This Index Record shall not be present. 23780 Reserved 23781 23782 This Index Record shall not be present. 23783 _________________________________________________________ 23784 23785 22.2.2.3. Header Store 23786 23787 The header store contains the values specified by the Index 23788 structures. These values are aligned according to their type 23789 and padding is used if needed. The store is located 23790 immediately following the Index structures. 23791 _________________________________________________________ 23792 23793 22.2.3. Signature Section 23794 23795 The Signature section is implemented using the Header 23796 structure. The signature section defines the following 23797 additional tag values which may be used in the Index 23798 structures. 23799 23800 These values exist to provide additional information about the 23801 rest of the package. 23802 23803 Table 22-5. Signature Tag Values 23804 Name Tag Value Type Count Status 23805 RPMSIGTAG_SIZE 1000 INT32 1 Required 23806 RPMSIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 23807 23808 RPMSIGTAG_SIZE 23809 This tag specifies the combined size of the Header and 23810 Payload sections. 23811 23812 RPMSIGTAG_PAYLOADSIZE 23813 This tag specifies the uncompressed size of the Payload 23814 archive, including the cpio headers. 23815 23816 These values exist to ensure the integrity of the rest of the 23817 package. 23818 23819 Table 22-6. Signature Digest Tag Values 23820 Name Tag Value Type Count Status 23821 RPMSIGTAG_SHA1 269 STRING 1 Optional 23822 RPMSIGTAG_MD5 1004 BIN 16 Required 23823 23824 RPMSIGTAG_SHA1 23825 23826 This index contains the SHA1 checksum of the entire Header 23827 Section, including the Header Record, Index Records and Header 23828 store. 23829 RPMSIGTAG_MD5 23830 23831 This tag specifies the 128-bit MD5 checksum of the combined 23832 Header and Archive sections. 23833 23834 These values exist to provide authentication of the package. 23835 23836 Table 22-7. Signature Signing Tag Values 23837 Name Tag Value Type Count Status 23838 RPMSIGTAG_DSA 267 BIN 65 Optional 23839 RPMSIGTAG_RSA 268 BIN 1 Optional 23840 RPMSIGTAG_PGP 1002 BIN 1 Optional 23841 RPMSIGTAG_GPG 1005 BIN 65 Optional 23842 23843 RPMSIGTAG_DSA 23844 23845 The tag contains the DSA signature of the Header section. The 23846 data is formatted as a Version 3 Signature Packet as specified 23847 in RFC 2440: OpenPGP Message Format. If this tag is 23848 present,then the SIGTAG_GPG tag shall also be present. 23849 RPMSIGTAG_RSA 23850 23851 The tag contains the RSA signature of the Header section.The 23852 data is formatted as a Version 3 Signature Packet as specified 23853 in RFC 2440: OpenPGP Message Format. If this tag is present, 23854 then the SIGTAG_PGP shall also be present. 23855 RPMSIGTAG_PGP 23856 23857 This tag specifies the RSA signature of the combined Header 23858 and Payload sections. The data is formatted as a Version 3 23859 Signature Packet as specified in RFC 2440: OpenPGP Message 23860 Format. 23861 RPMSIGTAG_GPG 23862 23863 The tag contains the DSA signature of the combined Header and 23864 Payload sections. The data is formatted as a Version 3 23865 Signature Packet as specified in RFC 2440: OpenPGP Message 23866 Format. 23867 _________________________________________________________ 23868 23869 22.2.4. Header Section 23870 23871 The Header section is implemented using the Header structure. 23872 The Header section defines the following additional tag values 23873 which may be used in the Index structures. 23874 _________________________________________________________ 23875 23876 22.2.4.1. Package Information 23877 23878 The following tag values are used to indicate information that 23879 describes the package as a whole. 23880 23881 Table 22-8. Package Info Tag Values 23882 Name Tag Value Type Count Status 23883 RPMTAG_NAME 1000 STRING 1 Required 23884 RPMTAG_VERSION 1001 STRING 1 Required 23885 RPMTAG_RELEASE 1002 STRING 1 Required 23886 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 23887 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 23888 RPMTAG_SIZE 1009 INT32 1 Required 23889 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 23890 RPMTAG_VENDOR 1011 STRING 1 Informational 23891 RPMTAG_LICENSE 1014 STRING 1 Required 23892 RPMTAG_PACKAGER 1015 STRING 1 Informational 23893 RPMTAG_GROUP 1016 I18NSTRING 1 Required 23894 RPMTAG_URL 1020 STRING 1 Informational 23895 RPMTAG_OS 1021 STRING 1 Required 23896 RPMTAG_ARCH 1022 STRING 1 Required 23897 RPMTAG_SOURCERPM 1044 STRING 1 Informational 23898 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 23899 RPMTAG_RPMVERSION 1064 STRING 1 Informational 23900 RPMTAG_COOKIE 1094 STRING 1 Optional 23901 RPMTAG_DISTURL 1123 STRING 1 Informational 23902 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 23903 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 23904 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 23905 23906 RPMTAG_NAME 23907 This tag specifies the name of the package. 23908 23909 RPMTAG_VERSION 23910 This tag specifies the version of the package. 23911 23912 RPMTAG_RELEASE 23913 This tag specifies the release of the package. 23914 23915 RPMTAG_SUMMARY 23916 This tag specifies the summary description of the 23917 package. The summary value pointed to by this index 23918 record contains a one line description of the package. 23919 23920 RPMTAG_DESCRIPTION 23921 This tag specifies the description of the package. The 23922 description value pointed to by this index record 23923 contains a full desription of the package. 23924 23925 RPMTAG_SIZE 23926 This tag specifies the sum of the sizes of the regular 23927 files in the archive. 23928 23929 RPMTAG_DISTRIBUTION 23930 A string containing the name of the distribution on 23931 which the package was built. 23932 23933 RPMTAG_VENDOR 23934 A string containing the name of the organization that 23935 produced the package. 23936 23937 RPMTAG_LICENSE 23938 This tag specifies the license which applies to this 23939 package. 23940 23941 RPMTAG_PACKAGER 23942 A string identifying the tool used to build the 23943 package. 23944 23945 RPMTAG_GROUP 23946 This tag specifies the administrative group to which 23947 this package belongs. 23948 23949 RPMTAG_URL 23950 Generic package information URL 23951 23952 RPMTAG_OS 23953 This tag specifies the OS of the package. The OS value 23954 pointed to by this index record shall be "linux". 23955 23956 RPMTAG_ARCH 23957 This tag specifies the architecture of the package. The 23958 architecture value pointed to by this index record is 23959 defined in architecture specific LSB specification. 23960 23961 RPMTAG_SOURCERPM 23962 This tag specifies the name of the source RPM 23963 23964 RPMTAG_ARCHIVESIZE 23965 This tag specifies the uncompressed size of the Payload 23966 archive, including the cpio headers. 23967 23968 RPMTAG_RPMVERSION 23969 This tag indicates the version of RPM tool used to 23970 build this package. The value is unused. 23971 23972 RPMTAG_COOKIE 23973 This tag contains an opaque string whose contents are 23974 undefined. 23975 23976 RPMTAG_DISTURL 23977 URL for package 23978 23979 RPMTAG_PAYLOADFORMAT 23980 This tag specifies the format of the Archive section. 23981 The format value pointed to by this index record shall 23982 be 'cpio'. 23983 23984 RPMTAG_PAYLOADCOMPRESSOR 23985 This tag specifies the compression used on the Archive 23986 section. The compression value pointed to by this index 23987 record shall be 'gzip' 23988 23989 RPMTAG_PAYLOADFLAGS 23990 This tag indicates the compression level used for the 23991 Payload. This value shall always be '9'. 23992 _________________________________________________________ 23993 23994 22.2.4.2. Installation Information 23995 23996 The following tag values are used to provide information 23997 needed during the installation of the package. 23998 23999 Table 22-9. Installation Tag Values 24000 Name Tag Value Type Count Status 24001 RPMTAG_PREIN 1023 STRING 1 Optional 24002 RPMTAG_POSTIN 1024 STRING 1 Optional 24003 RPMTAG_PREUN 1025 STRING 1 Optional 24004 RPMTAG_POSTUN 1026 STRING 1 Optional 24005 RPMTAG_PREINPROG 1085 STRING 1 Optional 24006 RPMTAG_POSTINPROG 1086 STRING 1 Optional 24007 RPMTAG_PREUNPROG 1087 STRING 1 Optional 24008 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 24009 24010 RPMTAG_PREIN 24011 24012 This tag specifies the preinstall scriptlet. If present, then 24013 RPMTAG_PREINPROG shall also be present. 24014 RPMTAG_POSTIN 24015 24016 This tag specifies the postinstall scriptlet. If present, then 24017 RPMTAG_POSTINPROG shall also be present. 24018 RPMTAG_PREUN 24019 24020 his tag specifies the preuninstall scriptlet. If present, then 24021 RPMTAG_PREUNPROG shall also be present. 24022 RPMTAG_POSTUN 24023 24024 This tag specified the postuninstall scriptlet. If present, 24025 then RPMTAG_POSTUNPROG shall also be present. 24026 RPMTAG_PREINPROG 24027 24028 This tag specifies the name of the intepreter to which the 24029 preinstall scriptlet will be passed. The intepreter pointed to 24030 by this index record shall be /bin/sh. 24031 RPMTAG_POSTINPROG 24032 24033 This tag specifies the name of the intepreter to which the 24034 postinstall scriptlet will be passed. The intepreter pointed 24035 to by this index record shall be /bin/sh. 24036 RPMTAG_PREUNPROG 24037 24038 This tag specifies the name of the intepreter to which the 24039 preuninstall scriptlet will be passed. The intepreter pointed 24040 to by this index record shall be /bin/sh. 24041 RPMTAG_POSTUNPROG 24042 24043 This program specifies the name of the intepreter to which the 24044 postuninstall scriptlet will be passed. The intepreter pointed 24045 to by this index record shall be /bin/sh. 24046 _________________________________________________________ 24047 24048 22.2.4.3. File Information 24049 24050 The following tag values are used to provide information about 24051 the files in the payload. This information is provided in the 24052 header to allow more efficient access of the information. 24053 24054 Table 22-10. File Info Tag Values 24055 Name Tag Value Type Count Status 24056 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 24057 RPMTAG_FILESIZES 1028 INT32 Required 24058 RPMTAG_FILEMODES 1030 INT16 Required 24059 RPMTAG_FILERDEVS 1033 INT16 Required 24060 RPMTAG_FILEMTIMES 1034 INT32 Required 24061 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 24062 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 24063 RPMTAG_FILEFLAGS 1037 INT32 Required 24064 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 24065 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 24066 RPMTAG_FILEDEVICES 1095 INT32 Required 24067 RPMTAG_FILEINODES 1096 INT32 Required 24068 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 24069 RPMTAG_DIRINDEXES 1116 INT32 Optional 24070 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 24071 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 24072 24073 RPMTAG_OLDFILENAMES 24074 24075 This tag specifies the filenames when not in a compressed 24076 format as determined by the absence of 24077 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME index. 24078 RPMTAG_FILESIZES 24079 24080 This tag specifies the size of each file in the archive. 24081 RPMTAG_FILEMODES 24082 24083 This tag specifies the mode of each file in the archive. 24084 RPMTAG_FILERDEVS 24085 24086 This tag specifies the device number from which the file was 24087 copied. 24088 RPMTAG_FILEMTIMES 24089 24090 This tag specifies the modification time in seconds since the 24091 epoch of each file in the archive. 24092 RPMTAG_FILEMD5S 24093 24094 This tag specifies the ASCII representation of the MD5 sum of 24095 the corresponding file contents. This value is empty if the 24096 corresponding archive entry is not a regular file. 24097 RPMTAG_FILELINKTOS 24098 24099 The target for a symlink, otherwise NULL. 24100 RPMTAG_FILEFLAGS 24101 24102 This tag specifies the bit(s) to classify and control how 24103 files are to be installed. See below. 24104 RPMTAG_FILEUSERNAME 24105 24106 This tag specifies the owner of the corresponding file. 24107 RPMTAG_FILEGROUPNAME 24108 24109 This tag specifies the group of the corresponding file. 24110 RPMTAG_FILEDEVICES 24111 24112 This tag specifies the 16 bit device number from which the 24113 file was copied. 24114 RPMTAG_FILEINODES 24115 24116 This tag specifies the inode value from the original file 24117 system on the the system on which it was built. 24118 RPMTAG_FILELANGS 24119 24120 This tag specifies a per-file locale marker used to install 24121 only locale specific subsets of files when the package is 24122 installed. 24123 RPMTAG_DIRINDEXES 24124 24125 This tag specifies the index into the array provided by the 24126 RPMTAG_DIRNAMES Index which contains the directory name for 24127 the corresponding filename. 24128 RPMTAG_BASENAMES 24129 24130 This tag specifies the base portion of the corresponding 24131 filename. 24132 RPMTAG_DIRNAMES 24133 24134 One of RPMTAG_OLDFILENAMES or the tuple 24135 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 24136 present, but not both. 24137 _________________________________________________________ 24138 24139 22.2.4.3.1. File Flags 24140 24141 The RPMTAG_FILEFLAGS tag value shall identify various 24142 characteristics of the file in the payload that it describes. 24143 It shall be an INT32 value consisting of either the value 24144 RPMFILE_NONE (0) or the bitwise inclusive or of one or more of 24145 the following values: 24146 24147 Table 22-11. File Flags 24148 Name Value 24149 RPMFILE_CONFIG (1 << 0) 24150 RPMFILE_DOC (1 << 1) 24151 RPMFILE_DONOTUSE (1 << 2) 24152 RPMFILE_MISSINGOK (1 << 3) 24153 RPMFILE_NOREPLACE (1 << 4) 24154 RPMFILE_SPECFILE (1 << 5) 24155 RPMFILE_GHOST (1 << 6) 24156 RPMFILE_LICENSE (1 << 7) 24157 RPMFILE_README (1 << 8) 24158 RPMFILE_EXCLUDE (1 << 9) 24159 24160 These bits have the following meaning: 24161 24162 RPMFILE_CONFIG 24163 24164 The file is a configuration file, and an existing file should 24165 be saved during a package upgrade operation and not removed 24166 during a pakage removal operation. 24167 RPMFILE_DOC 24168 24169 The file contains documentation. 24170 RPMFILE_DONOTUSE 24171 24172 This value is reserved for future use; conforming packages may 24173 not use this flag. 24174 RPMFILE_MISSINGOK 24175 24176 The file need not exist on the installed system. 24177 RPMFILE_NOREPLACE 24178 24179 Similar to the RPMFILE_CONFIG, this flag indicates that during 24180 an upgrade operation the original file on the system should 24181 not be altered. 24182 RPMFILE_SPECFILE 24183 24184 The file is a package specification. 24185 RPMFILE_GHOST 24186 24187 The file is not actually included in the payload, but should 24188 still be considered as a part of the package. For example, a 24189 log file generated by the application at run time. 24190 RPMFILE_LICENSE 24191 24192 The file contains the license conditions. 24193 RPMFILE_README 24194 24195 The file contains high level notes about the package. 24196 RPMFILE_EXCLUDE 24197 24198 The corresponding file is not a part of the package, and 24199 should not be installed. 24200 _________________________________________________________ 24201 24202 22.2.4.4. Dependency Information 24203 24204 The following tag values are used to provide information about 24205 interdependencies between packages. 24206 24207 Table 22-12. Package Dependency Tag Values 24208 Name Tag Value Type Count Status 24209 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 24210 RPMTAG_REQUIREFLAGS 1048 INT32 Required 24211 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 24212 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 24213 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 24214 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 24215 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 24216 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 24217 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 24218 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 24219 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 24220 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 24221 24222 RPMTAG_PROVIDENAME 24223 This tag indicates the name of the dependency provided 24224 by this package. 24225 24226 RPMTAG_REQUIREFLAGS 24227 Bits(s) to specify the dependency range and context. 24228 24229 RPMTAG_REQUIRENAME 24230 This tag indicates the dependencies for this package. 24231 24232 RPMTAG_REQUIREVERSION 24233 This tag indicates the versions associated with the 24234 values found in the RPMTAG_REQUIRENAME Index. 24235 24236 RPMTAG_CONFLICTFLAGS 24237 Bits(s) to specify the conflict range and context. 24238 24239 RPMTAG_CONFLICTNAME 24240 This tag indicates the conflicting dependencies for 24241 this package. 24242 24243 RPMTAG_CONFLICTVERSION 24244 This tag indicates the versions associated with the 24245 values found in the RPMTAG_CONFLICTNAME Index. 24246 24247 RPMTAG_OBSOLETENAME 24248 This tag indicates the obsoleted dependencies for this 24249 package. 24250 24251 RPMTAG_PROVIDEFLAGS 24252 Bits(s) to specify the conflict range and context. 24253 24254 RPMTAG_PROVIDEVERSION 24255 This tag indicates the versions associated with the 24256 values found in the RPMTAG_PROVIDENAME Index. 24257 24258 RPMTAG_OBSOLETEFLAGS 24259 Bits(s) to specify the conflict range and context. 24260 24261 RPMTAG_OBSOLETEVERSION 24262 This tag indicates the versions associated with the 24263 values found in the RPMTAG_OBSOLETENAME Index. 24264 _________________________________________________________ 24265 24266 22.2.4.4.1. Package Dependency Values 24267 24268 The package dependencies are stored in the RPMTAG_REQUIRENAME 24269 and RPMTAG_REQUIREVERSION index records. The following values 24270 may be used. 24271 24272 Table 22-13. Index Type values 24273 Name Version Meaning Status 24274 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 24275 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 24276 RPMTAG_PREREQ records that have a version associated with 24277 them. Optional 24278 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames 24279 in the Archive have had "." prepended to them. Optional 24280 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 24281 filenames in the Payload are represented in the 24282 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES 24283 indexes. Optional 24284 /bin/sh Interpreter usually required for installation 24285 scripts. Optional 24286 24287 Additional dependencies are specified in the Package 24288 Dependencies section of this specification, and in the 24289 relevant architecture specific part of ISO/IEC 23360. 24290 _________________________________________________________ 24291 24292 22.2.4.4.2. Package Dependencies Attributes 24293 24294 The package dependency attributes are stored in the 24295 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 24296 RPMTAG_OBSOLETEFLAGS index records. The following values may 24297 be used. 24298 24299 Table 22-14. Package Dependency Attributes 24300 Name Value Meaning 24301 RPMSENSE_LESS 0x02 24302 RPMSENSE_GREATER 0x04 24303 RPMSENSE_EQUAL 0x08 24304 RPMSENSE_PREREQ 0x40 24305 RPMSENSE_INTERP 0x100 24306 RPMSENSE_SCRIPT_PRE 0x200 24307 RPMSENSE_SCRIPT_POST 0x400 24308 RPMSENSE_SCRIPT_PREUN 0x800 24309 RPMSENSE_SCRIPT_POSTUN 0x1000 24310 RPMSENSE_RPMLIB 0x1000000 24311 _________________________________________________________ 24312 24313 22.2.4.5. Other Information 24314 24315 The following tag values are also found in the Header section. 24316 24317 Table 22-15. Other Tag Values 24318 Name Tag Value Type Count Status 24319 RPMTAG_BUILDTIME 1006 INT32 1 Informational 24320 RPMTAG_BUILDHOST 1007 STRING 1 Informational 24321 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 24322 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 24323 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 24324 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 24325 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 24326 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 24327 RPMTAG_PLATFORM 1132 STRING 1 Informational 24328 24329 RPMTAG_BUILDTIME 24330 This tag specifies the time as seconds since the epoch 24331 at which the package was built. 24332 24333 RPMTAG_BUILDHOST 24334 This tag specifies the hostname of the system on which 24335 which the package was built. 24336 24337 RPMTAG_FILEVERIFYFLAGS 24338 This tag specifies the bit(s) to control how files are 24339 to be verified after install, specifying which checks 24340 should be performed. 24341 24342 RPMTAG_CHANGELOGTIME 24343 This tag specifies the Unix time in seconds since the 24344 epoch associated with each entry in the Changelog file. 24345 24346 RPMTAG_CHANGELOGNAME 24347 This tag specifies the name of who made a change to 24348 this package 24349 24350 RPMTAG_CHANGELOGTEXT 24351 This tag specifies the changes asssociated with a 24352 changelog entry. 24353 24354 RPMTAG_OPTFLAGS 24355 This tag indicates additional flags which may have been 24356 passed to the compiler when building this package. 24357 24358 RPMTAG_RHNPLATFORM 24359 This tag contains an opaque string whose contents are 24360 undefined. 24361 24362 RPMTAG_PLATFORM 24363 This tag contains an opaque string whose contents are 24364 undefined. 24365 _________________________________________________________ 24366 24367 22.2.5. Payload Section 24368 24369 The Payload section contains a compressed cpio archive. The 24370 format of this section is defined by RFC 1952: GZIP File 24371 Format Specification. 24372 24373 When uncompressed, the cpio archive contains a sequence of 24374 records for each file. Each record contains a CPIO Header, 24375 Filename, Padding, and File Data. 24376 24377 Table 22-16. CPIO File Format 24378 CPIO Header Header structure as defined below. 24379 Filename NUL terminated ASCII string containing the name of 24380 the file. 24381 Padding 0-3 bytes as needed to align the file stream to a 4 24382 byte boundary. 24383 File data The contents of the file. 24384 Padding 0-3 bytes as needed to align the file stream to a 4 24385 byte boundary. 24386 24387 The CPIO Header uses the following header structure (sometimes 24388 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 24389 stored as ASCII representations of their hexadecimal value 24390 with leading zeros as needed to fill the field. With the 24391 exception of c_namesize and the corresponding name string, and 24392 c_checksum, all information contained in the CPIO Header is 24393 also represented in the Header Section. The values in the CPIO 24394 Header shall match the values contained in the Header Section. 24395 struct { 24396 char c_magic[6]; 24397 char c_ino[8]; 24398 char c_mode[8]; 24399 char c_uid[8]; 24400 char c_gid[8]; 24401 char c_nlink[8]; 24402 char c_mtime[8]; 24403 char c_filesize[8]; 24404 char c_devmajor[8]; 24405 char c_devminor[8]; 24406 char c_rdevmajor[8]; 24407 char c_rdevminor[8]; 24408 char c_namesize[8]; 24409 char c_checksum[8]; 24410 }; 24411 24412 c_magic 24413 24414 Value identifying this cpio format. This value shall be 24415 "070701". 24416 c_ino 24417 24418 This field contains the inode number from the filesystem from 24419 which the file was read. This field is ignored when installing 24420 a package. This field shall match the corresponding value in 24421 the RPMTAG_FILEINODES index in the Header section. 24422 c_mode 24423 24424 Permission bits of the file. This is an ascii representation 24425 of the hexadecimal number representing the bit as defined for 24426 the st_mode field of the stat structure defined for the stat 24427 function. This field shall match the corresponding value in 24428 the RPMTAG_FILEMODES index in the Header section. 24429 c_uid 24430 24431 Value identifying this owner of this file. This value matches 24432 the uid value of the corresponding user in the 24433 RPMTAG_FILEUSERNAME as found on the system where this package 24434 was built. The username specified in RPMTAG_FILEUSERNAME 24435 should take precedence when installing the package. 24436 c_gid 24437 24438 Value identifying this group of this file. This value matches 24439 the gid value of the corresponding user in the 24440 RPMTAG_FILEGROUPNAME as found on the system where this package 24441 was built. The groupname specified in RPMTAG_FILEGROUPNAME 24442 should take precedence when installing the package. 24443 c_nlink 24444 24445 Value identifying the number of links associated with this 24446 file. If the value is greater than 1, then this filename will 24447 be linked to 1 or more files in this archive that has a 24448 matching value for the c_ino, c_devmajor and c_devminor 24449 fields. 24450 c_mtime 24451 24452 Value identifying the modification time of the file when it 24453 was read. This field shall match the corresponding value in 24454 the RPMTAG_FILEMTIMES index in the Header section. 24455 c_filesize 24456 24457 Value identifying the size of the file. This field shall match 24458 the corresponding value in the RPMTAG_FILESIZES index in the 24459 Header section. 24460 c_devmajor 24461 24462 The major number of the device containing the file system from 24463 which the file was read. With the exception of processing 24464 files with c_nlink >1, this field is ignored when installing a 24465 package. This field shall match the corresponding value in the 24466 RPMTAG_FILEDEVICES index in the Header section. 24467 c_devminor 24468 24469 The minor number of the device containing the file system from 24470 which the file was read. With the exception of processing 24471 files with c_nlink >1, this field is ignored when installing a 24472 package. This field shall match the corresponding value in the 24473 RPMTAG_FILEDEVICES index in the Header section. 24474 c_rdevmajor 24475 24476 The major number of the raw device containing the file system 24477 from which the file was read. This field is ignored when 24478 installing a package. This field shall match the corresponding 24479 value in the RPMTAG_RDEVS index in the Header section. 24480 c_rdevminor 24481 24482 The minor number of the raw device containing the file system 24483 from which the file was read. This field is ignored when 24484 installing a package. This field shall match the corresponding 24485 value in the RPMTAG_RDEVS index in the Header section. 24486 c_namesize 24487 24488 Value identifying the length of the filename, which is located 24489 immediately following the CPIO Header structure. 24490 c_checksum 24491 24492 Value containing the CRC checksum of the file data. This field 24493 is not used, and shall contain the value "00000000". This 24494 field is ignored when installing a package. 24495 24496 A record with the filename "TRAILER!!!" indicates the last 24497 record in the archive. 24498 _________________________________________________________ 24499 24500 22.3. Package Script Restrictions 24501 24502 Scripts used as part of the package install and uninstall 24503 shall only use commands and interfaces that are specified by 24504 the LSB. All other commands are not guaranteed to be present, 24505 or to behave in expected ways. 24506 24507 Packages shall not use RPM triggers. 24508 24509 Packages shall not depend on the order in which scripts are 24510 executed (pre-install, pre-uninstall, etc), when doing an 24511 upgrade. 24512 _________________________________________________________ 24513 24514 22.4. Package Tools 24515 24516 The LSB does not specify the interface to the tools used to 24517 manipulate LSB-conformant packages. Each conforming 24518 implementation shall provide documentation for installing LSB 24519 packages. 24520 _________________________________________________________ 24521 24522 22.5. Package Naming 24523 24524 Packages supplied by implementations and applications shall 24525 follow the following rules for the name field within the 24526 package. These rules are not required for the filename of the 24527 package file itself. 24528 24529 Note: There are discrepancies among implementations 24530 concerning whether the name might be 24531 frobnicator-1.7-21-ppc32.rpm or 24532 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 24533 recommended practice is for the filename of the package 24534 file to match the name within the package. 24535 24536 The following rules apply to the name field alone, not 24537 including any release or version. 24538 24539 Note: If the name with the release and version is 24540 frobnicator-1.7-21, the name part is frobnicator and falls 24541 under the rules for a name with no hyphens. 24542 24543 * If the name begins with lsb- and contains no other 24544 hyphens, the name shall be assigned by the Linux Assigned 24545 Names and Numbers Authority (LANANA), which shall maintain 24546 a registry of LSB names. The name may be registered by 24547 either an implementation or an application. 24548 * If the package name begins with lsb- and contains more 24549 than one hyphen (for example 24550 lsb-distro.example.com-database or lsb-gnome-gnumeric), 24551 then the portion of the package name between first and 24552 second hyphens shall either be an LSB provider name 24553 assigned by the LANANA, or it may be one of the owners' 24554 fully-qualified domain names in lower case (e.g., 24555 debian.org, staroffice.sun.com). The LSB provider name 24556 assigned by LANANA shall only consist of the ASCII 24557 characters [a-z0-9]. The provider name or domain name may 24558 be either that of an implementation or an application. 24559 * Package names containing no hyphens are reserved for use 24560 by implementations. Applications shall not use such names. 24561 * Package names which do not start with lsb- and which 24562 contain a hyphen are open to both implementations and 24563 applications. Implementations may name packages in any 24564 part of this namespace. They are encouraged to use names 24565 from one of the other namespaces available to them, but 24566 this is not required due to the large amount of current 24567 practice to the contrary. 24568 24569 Note: Widespread existing practice includes such names as 24570 ssh-common, ssh-client, kernel-pcmcia, and the like. 24571 Possible alternative names include sshcommon, 24572 foolinux-ssh-common (where foolinux is registered to the 24573 implementation), or lsb-foolinux-ssh-common. 24574 Applications may name their packages this way, but only if 24575 the portion of the name before the first hyphen is a 24576 provider name or registered domain name as described 24577 above. 24578 24579 Note: If an application vendor has domain name such as 24580 visicalc.example.com and has registered visicalc as a 24581 provider name, they might name packages visicalc-base, 24582 visicalc.example.com-charting, and the like. 24583 Package names in this namespace are available to both the 24584 implementation and an application. Implementations and 24585 applications will need to consider this potential for 24586 conflicts when deciding to use these names rather than the 24587 alternatives (such as names starting with lsb-). 24588 _________________________________________________________ 24589 24590 22.6. Package Dependencies 24591 24592 Packages shall have a dependency that indicates which LSB 24593 modules are required. LSB module descriptions are dash 24594 seperated tuples containing the name 'lsb', the module name, 24595 and the architecture name. The following dependencies may be 24596 used. 24597 24598 lsb-core-arch 24599 24600 This dependency is used to indicate that the application is 24601 dependent on features contained in the LSB-Core specification. 24602 lsb-core-noarch 24603 24604 This dependency is used to indicate that the application is 24605 dependent on features contained in the LSB-Core specification 24606 and that the package does not contain any architecture 24607 specific files. 24608 24609 These dependencies shall have a version of 3.0. 24610 24611 Packages shall not depend on other system-provided 24612 dependencies. They shall not depend on non-system-provided 24613 dependencies unless those dependencies are fulfilled by 24614 packages which are part of the same application. A package may 24615 only provide a virtual package name which is registered to 24616 that application. 24617 24618 Other modules in the LSB may supplement this list. The 24619 architecture specific dependencies are described in the 24620 relevant architecture specific LSB. 24621 _________________________________________________________ 24622 24623 22.7. Package Architecture Considerations 24624 24625 Packages which do not contain any architecture specific files 24626 should specify an architecture of noarch. An LSB runtime 24627 environment shall accept values noarch, or the value specified 24628 in the relevant architecture specific part of ISO/IEC 23360. 24629 24630 Additional specifications or restrictions may be found in the 24631 architecture specific LSB specification. 24632 _________________________________________________________ 24633 24634 Appendix A. Alphabetical Listing of Interfaces 24635 _________________________________________________________ 24636 24637 A.1. libc 24638 24639 The behavior of the interfaces in this library is specified by 24640 the following Standards. 24641 24642 Large File Support [LFS] 24643 This Specification [LSB] 24644 SUSv2 [SUSv2] 24645 ISO POSIX (2003) [SUSv3] 24646 SVID Issue 3 [SVID.3] 24647 SVID Issue 4 [SVID.4] 24648 24649 Table A-1. libc Function Interfaces 24650 _Exit(GLIBC_2.1.1)[SUSv3] getpwuid(GLIBC_2.0)[SUSv3] 24651 sigaddset(GLIBC_2.0)[SUSv3] 24652 _IO_feof(GLIBC_2.0)[LSB] getpwuid_r(GLIBC_2.0)[SUSv3] 24653 sigaltstack(GLIBC_2.0)[SUSv3] 24654 _IO_getc(GLIBC_2.0)[LSB] getrlimit(GLIBC_2.2)[SUSv3] 24655 sigandset(GLIBC_2.0)[LSB] 24656 _IO_putc(GLIBC_2.0)[LSB] getrlimit64(GLIBC_2.1)[LFS] 24657 sigdelset(GLIBC_2.0)[SUSv3] 24658 _IO_puts(GLIBC_2.0)[LSB] getrusage(GLIBC_2.0)[SUSv3] 24659 sigemptyset(GLIBC_2.0)[SUSv3] 24660 __assert_fail(GLIBC_2.0)[LSB] getservbyname(GLIBC_2.0)[SUSv3] 24661 sigfillset(GLIBC_2.0)[SUSv3] 24662 __ctype_b_loc[LSB] getservbyport(GLIBC_2.0)[SUSv3] 24663 sighold(GLIBC_2.1)[SUSv3] 24664 __ctype_get_mb_cur_max(GLIBC_2.0)[LSB] 24665 getservent(GLIBC_2.0)[SUSv3] sigignore(GLIBC_2.1)[SUSv3] 24666 __ctype_tolower_loc[LSB] getsid(GLIBC_2.0)[SUSv3] 24667 siginterrupt(GLIBC_2.0)[SUSv3] 24668 __ctype_toupper_loc[LSB] getsockname(GLIBC_2.0)[SUSv3] 24669 sigisemptyset(GLIBC_2.0)[LSB] 24670 __cxa_atexit(GLIBC_2.1.3)[LSB] getsockopt(GLIBC_2.0)[LSB] 24671 sigismember(GLIBC_2.0)[SUSv3] 24672 __errno_location(GLIBC_2.0)[LSB] getsubopt(GLIBC_2.0)[SUSv3] 24673 siglongjmp(GLIBC_2.0)[SUSv3] 24674 __fpending(GLIBC_2.2)[LSB] gettext(GLIBC_2.0)[LSB] 24675 signal(GLIBC_2.0)[SUSv3] 24676 __fxstat(GLIBC_2.0)[LSB] gettimeofday(GLIBC_2.0)[SUSv3] 24677 sigorset(GLIBC_2.0)[LSB] 24678 __fxstat64(GLIBC_2.2)[LSB] getuid(GLIBC_2.0)[SUSv3] 24679 sigpause(GLIBC_2.0)[SUSv3] 24680 __getpagesize(GLIBC_2.0)[LSB] getutent(GLIBC_2.0)[LSB] 24681 sigpending(GLIBC_2.0)[SUSv3] 24682 __getpgid(GLIBC_2.0)[LSB] getutent_r(GLIBC_2.0)[LSB] 24683 sigprocmask(GLIBC_2.0)[SUSv3] 24684 __h_errno_location[LSB] getutxent(GLIBC_2.1)[SUSv3] 24685 sigqueue(GLIBC_2.1)[SUSv3] 24686 __isinf[LSB] getutxid(GLIBC_2.1)[SUSv3] 24687 sigrelse(GLIBC_2.1)[SUSv3] 24688 __isinff[LSB] getutxline(GLIBC_2.1)[SUSv3] 24689 sigreturn(GLIBC_2.0)[LSB] 24690 __isinfl[LSB] getw(GLIBC_2.0)[SUSv2] sigset(GLIBC_2.1)[SUSv3] 24691 __isnan[LSB] getwc(GLIBC_2.2)[SUSv3] 24692 sigsuspend(GLIBC_2.0)[SUSv3] 24693 __isnanf[LSB] getwchar(GLIBC_2.2)[SUSv3] 24694 sigtimedwait(GLIBC_2.1)[SUSv3] 24695 __isnanl[LSB] getwd(GLIBC_2.0)[SUSv3] 24696 sigwait(GLIBC_2.0)[SUSv3] 24697 __libc_current_sigrtmax(GLIBC_2.1)[LSB] glob(GLIBC_2.0)[SUSv3] 24698 sigwaitinfo(GLIBC_2.1)[SUSv3] 24699 __libc_current_sigrtmin(GLIBC_2.1)[LSB] glob64(GLIBC_2.1)[LSB] 24700 sleep(GLIBC_2.0)[SUSv3] 24701 __libc_start_main(GLIBC_2.0)[LSB] globfree(GLIBC_2.0)[SUSv3] 24702 snprintf(GLIBC_2.0)[SUSv3] 24703 __lxstat(GLIBC_2.0)[LSB] globfree64(GLIBC_2.1)[LSB] 24704 sockatmark[SUSv3] 24705 __lxstat64(GLIBC_2.2)[LSB] gmtime(GLIBC_2.0)[SUSv3] 24706 socket(GLIBC_2.0)[SUSv3] 24707 __mempcpy(GLIBC_2.0)[LSB] gmtime_r(GLIBC_2.0)[SUSv3] 24708 socketpair(GLIBC_2.0)[SUSv3] 24709 __rawmemchr(GLIBC_2.1)[LSB] grantpt(GLIBC_2.1)[SUSv3] 24710 sprintf(GLIBC_2.0)[SUSv3] 24711 __register_atfork[LSB] hcreate(GLIBC_2.0)[SUSv3] 24712 srand(GLIBC_2.0)[SUSv3] 24713 __sigsetjmp(GLIBC_2.0)[LSB] hdestroy(GLIBC_2.0)[SUSv3] 24714 srand48(GLIBC_2.0)[SUSv3] 24715 __stpcpy(GLIBC_2.0)[LSB] hsearch(GLIBC_2.0)[SUSv3] 24716 srandom(GLIBC_2.0)[SUSv3] 24717 __strdup(GLIBC_2.0)[LSB] htonl(GLIBC_2.0)[SUSv3] 24718 sscanf(GLIBC_2.0)[LSB] 24719 __strtod_internal(GLIBC_2.0)[LSB] htons(GLIBC_2.0)[SUSv3] 24720 statfs(GLIBC_2.0)[LSB] 24721 __strtof_internal(GLIBC_2.0)[LSB] iconv(GLIBC_2.1)[SUSv3] 24722 statfs64(GLIBC_2.1)[LSB] 24723 __strtok_r(GLIBC_2.0)[LSB] iconv_close(GLIBC_2.1)[SUSv3] 24724 statvfs(GLIBC_2.1)[SUSv3] 24725 __strtol_internal(GLIBC_2.0)[LSB] iconv_open(GLIBC_2.1)[SUSv3] 24726 statvfs64(GLIBC_2.1)[LFS] 24727 __strtold_internal(GLIBC_2.0)[LSB] if_freenameindex[SUSv3] 24728 stime(GLIBC_2.0)[LSB] 24729 __strtoll_internal(GLIBC_2.0)[LSB] if_indextoname[SUSv3] 24730 stpcpy(GLIBC_2.0)[LSB] 24731 __strtoul_internal(GLIBC_2.0)[LSB] if_nameindex[SUSv3] 24732 stpncpy(GLIBC_2.0)[LSB] 24733 __strtoull_internal(GLIBC_2.0)[LSB] if_nametoindex[SUSv3] 24734 strcasecmp(GLIBC_2.0)[SUSv3] 24735 __sysconf(GLIBC_2.2)[LSB] imaxabs(GLIBC_2.1.1)[SUSv3] 24736 strcasestr(GLIBC_2.1)[LSB] 24737 __sysv_signal(GLIBC_2.0)[LSB] imaxdiv(GLIBC_2.1.1)[SUSv3] 24738 strcat(GLIBC_2.0)[SUSv3] 24739 __wcstod_internal(GLIBC_2.0)[LSB] index(GLIBC_2.0)[SUSv3] 24740 strchr(GLIBC_2.0)[SUSv3] 24741 __wcstof_internal(GLIBC_2.0)[LSB] inet_addr(GLIBC_2.0)[SUSv3] 24742 strcmp(GLIBC_2.0)[SUSv3] 24743 __wcstol_internal(GLIBC_2.0)[LSB] inet_ntoa(GLIBC_2.0)[SUSv3] 24744 strcoll(GLIBC_2.0)[SUSv3] 24745 __wcstold_internal(GLIBC_2.0)[LSB] inet_ntop[SUSv3] 24746 strcpy(GLIBC_2.0)[SUSv3] 24747 __wcstoul_internal(GLIBC_2.0)[LSB] inet_pton[SUSv3] 24748 strcspn(GLIBC_2.0)[SUSv3] 24749 __xmknod(GLIBC_2.0)[LSB] initgroups(GLIBC_2.0)[LSB] 24750 strdup(GLIBC_2.0)[SUSv3] 24751 __xstat(GLIBC_2.0)[LSB] initstate(GLIBC_2.0)[SUSv3] 24752 strerror(GLIBC_2.0)[SUSv3] 24753 __xstat64(GLIBC_2.2)[LSB] insque(GLIBC_2.0)[SUSv3] 24754 strerror_r(GLIBC_2.0)[LSB] 24755 _exit(GLIBC_2.0)[SUSv3] ioctl(GLIBC_2.0)[LSB] 24756 strfmon(GLIBC_2.0)[SUSv3] 24757 _longjmp(GLIBC_2.0)[SUSv3] isalnum(GLIBC_2.0)[SUSv3] 24758 strftime(GLIBC_2.0)[SUSv3] 24759 _setjmp(GLIBC_2.0)[SUSv3] isalpha(GLIBC_2.0)[SUSv3] 24760 strlen(GLIBC_2.0)[SUSv3] 24761 _tolower(GLIBC_2.0)[SUSv3] isascii(GLIBC_2.0)[SUSv3] 24762 strncasecmp(GLIBC_2.0)[SUSv3] 24763 _toupper(GLIBC_2.0)[SUSv3] isatty(GLIBC_2.0)[SUSv3] 24764 strncat(GLIBC_2.0)[SUSv3] 24765 a64l(GLIBC_2.0)[SUSv3] isblank(GLIBC_2.0)[SUSv3] 24766 strncmp(GLIBC_2.0)[SUSv3] 24767 abort(GLIBC_2.0)[SUSv3] iscntrl(GLIBC_2.0)[SUSv3] 24768 strncpy(GLIBC_2.0)[SUSv3] 24769 abs(GLIBC_2.0)[SUSv3] isdigit(GLIBC_2.0)[SUSv3] 24770 strndup(GLIBC_2.0)[LSB] 24771 accept(GLIBC_2.0)[SUSv3] isgraph(GLIBC_2.0)[SUSv3] 24772 strnlen(GLIBC_2.0)[LSB] 24773 access(GLIBC_2.0)[SUSv3] islower(GLIBC_2.0)[SUSv3] 24774 strpbrk(GLIBC_2.0)[SUSv3] 24775 acct(GLIBC_2.0)[LSB] isprint(GLIBC_2.0)[SUSv3] 24776 strptime(GLIBC_2.0)[LSB] 24777 adjtime(GLIBC_2.0)[LSB] ispunct(GLIBC_2.0)[SUSv3] 24778 strrchr(GLIBC_2.0)[SUSv3] 24779 alarm(GLIBC_2.0)[SUSv3] isspace(GLIBC_2.0)[SUSv3] 24780 strsep(GLIBC_2.0)[LSB] 24781 asctime(GLIBC_2.0)[SUSv3] isupper(GLIBC_2.0)[SUSv3] 24782 strsignal(GLIBC_2.0)[LSB] 24783 asctime_r(GLIBC_2.0)[SUSv3] iswalnum(GLIBC_2.0)[SUSv3] 24784 strspn(GLIBC_2.0)[SUSv3] 24785 asprintf(GLIBC_2.0)[LSB] iswalpha(GLIBC_2.0)[SUSv3] 24786 strstr(GLIBC_2.0)[SUSv3] 24787 atof(GLIBC_2.0)[SUSv3] iswblank(GLIBC_2.1)[SUSv3] 24788 strtod(GLIBC_2.0)[SUSv3] 24789 atoi(GLIBC_2.0)[SUSv3] iswcntrl(GLIBC_2.0)[SUSv3] 24790 strtof(GLIBC_2.0)[SUSv3] 24791 atol(GLIBC_2.0)[SUSv3] iswctype(GLIBC_2.0)[SUSv3] 24792 strtoimax(GLIBC_2.1)[SUSv3] 24793 atoll[SUSv3] iswdigit(GLIBC_2.0)[SUSv3] 24794 strtok(GLIBC_2.0)[SUSv3] 24795 authnone_create(GLIBC_2.0)[SVID.4] iswgraph(GLIBC_2.0)[SUSv3] 24796 strtok_r(GLIBC_2.0)[SUSv3] 24797 basename(GLIBC_2.0)[SUSv3] iswlower(GLIBC_2.0)[SUSv3] 24798 strtol(GLIBC_2.0)[SUSv3] 24799 bcmp(GLIBC_2.0)[SUSv3] iswprint(GLIBC_2.0)[SUSv3] 24800 strtold(GLIBC_2.0)[SUSv3] 24801 bcopy(GLIBC_2.0)[SUSv3] iswpunct(GLIBC_2.0)[SUSv3] 24802 strtoll(GLIBC_2.0)[SUSv3] 24803 bind(GLIBC_2.0)[SUSv3] iswspace(GLIBC_2.0)[SUSv3] 24804 strtoq(GLIBC_2.0)[LSB] 24805 bind_textdomain_codeset[LSB] iswupper(GLIBC_2.0)[SUSv3] 24806 strtoul(GLIBC_2.0)[SUSv3] 24807 bindresvport(GLIBC_2.0)[LSB] iswxdigit(GLIBC_2.0)[SUSv3] 24808 strtoull(GLIBC_2.0)[SUSv3] 24809 bindtextdomain(GLIBC_2.0)[LSB] isxdigit(GLIBC_2.0)[SUSv3] 24810 strtoumax(GLIBC_2.1)[SUSv3] 24811 brk(GLIBC_2.0)[SUSv2] jrand48(GLIBC_2.0)[SUSv3] 24812 strtouq(GLIBC_2.0)[LSB] 24813 bsd_signal(GLIBC_2.0)[SUSv3] 24814 key_decryptsession(GLIBC_2.1)[SVID.3] 24815 strxfrm(GLIBC_2.0)[SUSv3] 24816 bsearch(GLIBC_2.0)[SUSv3] kill(GLIBC_2.0)[LSB] 24817 svc_getreqset(GLIBC_2.0)[SVID.3] 24818 btowc(GLIBC_2.0)[SUSv3] killpg(GLIBC_2.0)[SUSv3] 24819 svc_register(GLIBC_2.0)[LSB] 24820 bzero(GLIBC_2.0)[SUSv3] l64a(GLIBC_2.0)[SUSv3] 24821 svc_run(GLIBC_2.0)[LSB] 24822 calloc(GLIBC_2.0)[SUSv3] labs(GLIBC_2.0)[SUSv3] 24823 svc_sendreply(GLIBC_2.0)[LSB] 24824 catclose(GLIBC_2.0)[SUSv3] lchown(GLIBC_2.0)[SUSv3] 24825 svcerr_auth(GLIBC_2.0)[SVID.3] 24826 catgets(GLIBC_2.0)[SUSv3] lcong48(GLIBC_2.0)[SUSv3] 24827 svcerr_decode(GLIBC_2.0)[SVID.3] 24828 catopen(GLIBC_2.0)[SUSv3] ldiv(GLIBC_2.0)[SUSv3] 24829 svcerr_noproc(GLIBC_2.0)[SVID.3] 24830 cfgetispeed(GLIBC_2.0)[SUSv3] lfind(GLIBC_2.0)[SUSv3] 24831 svcerr_noprog(GLIBC_2.0)[SVID.3] 24832 cfgetospeed(GLIBC_2.0)[SUSv3] link(GLIBC_2.0)[LSB] 24833 svcerr_progvers(GLIBC_2.0)[SVID.3] 24834 cfmakeraw(GLIBC_2.0)[LSB] listen(GLIBC_2.0)[SUSv3] 24835 svcerr_systemerr(GLIBC_2.0)[SVID.3] 24836 cfsetispeed(GLIBC_2.0)[SUSv3] llabs(GLIBC_2.0)[SUSv3] 24837 svcerr_weakauth(GLIBC_2.0)[SVID.3] 24838 cfsetospeed(GLIBC_2.0)[SUSv3] lldiv(GLIBC_2.0)[SUSv3] 24839 svctcp_create(GLIBC_2.0)[LSB] 24840 cfsetspeed(GLIBC_2.0)[LSB] localeconv(GLIBC_2.0)[SUSv3] 24841 svcudp_create(GLIBC_2.0)[LSB] 24842 chdir(GLIBC_2.0)[SUSv3] localtime(GLIBC_2.0)[SUSv3] 24843 swab(GLIBC_2.0)[SUSv3] 24844 chmod(GLIBC_2.0)[SUSv3] localtime_r(GLIBC_2.0)[SUSv3] 24845 swapcontext(GLIBC_2.1)[SUSv3] 24846 chown(GLIBC_2.1)[SUSv3] lockf(GLIBC_2.0)[SUSv3] 24847 swprintf(GLIBC_2.2)[SUSv3] 24848 chroot(GLIBC_2.0)[SUSv2] lockf64(GLIBC_2.1)[LFS] 24849 swscanf(GLIBC_2.2)[LSB] 24850 clearerr(GLIBC_2.0)[SUSv3] longjmp(GLIBC_2.0)[SUSv3] 24851 symlink(GLIBC_2.0)[SUSv3] 24852 clnt_create(GLIBC_2.0)[SVID.4] lrand48(GLIBC_2.0)[SUSv3] 24853 sync(GLIBC_2.0)[SUSv3] 24854 clnt_pcreateerror(GLIBC_2.0)[SVID.4] lsearch(GLIBC_2.0)[SUSv3] 24855 sysconf(GLIBC_2.0)[SUSv3] 24856 clnt_perrno(GLIBC_2.0)[SVID.4] lseek(GLIBC_2.0)[SUSv3] 24857 syslog(GLIBC_2.0)[SUSv3] 24858 clnt_perror(GLIBC_2.0)[SVID.4] makecontext(GLIBC_2.1)[SUSv3] 24859 system(GLIBC_2.0)[LSB] 24860 clnt_spcreateerror(GLIBC_2.0)[SVID.4] malloc(GLIBC_2.0)[SUSv3] 24861 tcdrain(GLIBC_2.0)[SUSv3] 24862 clnt_sperrno(GLIBC_2.0)[SVID.4] mblen(GLIBC_2.0)[SUSv3] 24863 tcflow(GLIBC_2.0)[SUSv3] 24864 clnt_sperror(GLIBC_2.0)[SVID.4] mbrlen(GLIBC_2.0)[SUSv3] 24865 tcflush(GLIBC_2.0)[SUSv3] 24866 clock(GLIBC_2.0)[SUSv3] mbrtowc(GLIBC_2.0)[SUSv3] 24867 tcgetattr(GLIBC_2.0)[SUSv3] 24868 close(GLIBC_2.0)[SUSv3] mbsinit(GLIBC_2.0)[SUSv3] 24869 tcgetpgrp(GLIBC_2.0)[SUSv3] 24870 closedir(GLIBC_2.0)[SUSv3] mbsnrtowcs(GLIBC_2.0)[LSB] 24871 tcgetsid(GLIBC_2.1)[SUSv3] 24872 closelog(GLIBC_2.0)[SUSv3] mbsrtowcs(GLIBC_2.0)[SUSv3] 24873 tcsendbreak(GLIBC_2.0)[SUSv3] 24874 confstr(GLIBC_2.0)[SUSv3] mbstowcs(GLIBC_2.0)[SUSv3] 24875 tcsetattr(GLIBC_2.0)[SUSv3] 24876 connect(GLIBC_2.0)[SUSv3] mbtowc(GLIBC_2.0)[SUSv3] 24877 tcsetpgrp(GLIBC_2.0)[SUSv3] 24878 creat(GLIBC_2.0)[SUSv3] memccpy(GLIBC_2.0)[SUSv3] 24879 tdelete[SUSv3] 24880 creat64(GLIBC_2.1)[LFS] memchr(GLIBC_2.0)[SUSv3] 24881 telldir(GLIBC_2.0)[SUSv3] 24882 ctermid(GLIBC_2.0)[SUSv3] memcmp(GLIBC_2.0)[SUSv3] 24883 tempnam(GLIBC_2.0)[SUSv3] 24884 ctime(GLIBC_2.0)[SUSv3] memcpy(GLIBC_2.0)[SUSv3] 24885 textdomain(GLIBC_2.0)[LSB] 24886 ctime_r(GLIBC_2.0)[SUSv3] memmem(GLIBC_2.0)[LSB] 24887 tfind(GLIBC_2.0)[SUSv3] 24888 cuserid(GLIBC_2.0)[SUSv2] memmove(GLIBC_2.0)[SUSv3] 24889 time(GLIBC_2.0)[SUSv3] 24890 daemon(GLIBC_2.0)[LSB] memrchr(GLIBC_2.2)[LSB] 24891 times(GLIBC_2.0)[SUSv3] 24892 dcgettext(GLIBC_2.0)[LSB] memset(GLIBC_2.0)[SUSv3] 24893 tmpfile(GLIBC_2.1)[SUSv3] 24894 dcngettext[LSB] mkdir(GLIBC_2.0)[SUSv3] 24895 tmpfile64(GLIBC_2.1)[LFS] 24896 dgettext[LSB] mkfifo(GLIBC_2.0)[SUSv3] 24897 tmpnam(GLIBC_2.0)[SUSv3] 24898 difftime(GLIBC_2.0)[SUSv3] mkstemp(GLIBC_2.0)[SUSv3] 24899 toascii(GLIBC_2.0)[SUSv3] 24900 dirname(GLIBC_2.0)[SUSv3] mkstemp64(GLIBC_2.2)[LFS] 24901 tolower(GLIBC_2.0)[SUSv3] 24902 div(GLIBC_2.0)[SUSv3] mktemp(GLIBC_2.0)[SUSv3] 24903 toupper(GLIBC_2.0)[SUSv3] 24904 dngettext[LSB] mktime(GLIBC_2.0)[SUSv3] 24905 towctrans(GLIBC_2.0)[SUSv3] 24906 drand48(GLIBC_2.0)[SUSv3] mlock(GLIBC_2.0)[SUSv3] 24907 towlower(GLIBC_2.0)[SUSv3] 24908 dup(GLIBC_2.0)[SUSv3] mlockall(GLIBC_2.0)[SUSv3] 24909 towupper(GLIBC_2.0)[SUSv3] 24910 dup2(GLIBC_2.0)[SUSv3] mmap(GLIBC_2.0)[SUSv3] 24911 truncate(GLIBC_2.0)[SUSv3] 24912 duplocale[LSB] mmap64(GLIBC_2.1)[LFS] 24913 truncate64(GLIBC_2.1)[LFS] 24914 ecvt(GLIBC_2.0)[SUSv3] mprotect(GLIBC_2.0)[SUSv3] 24915 tsearch(GLIBC_2.0)[SUSv3] 24916 endgrent(GLIBC_2.0)[SUSv3] mrand48(GLIBC_2.0)[SUSv3] 24917 ttyname(GLIBC_2.0)[SUSv3] 24918 endprotoent(GLIBC_2.0)[SUSv3] msgctl(GLIBC_2.0)[SUSv3] 24919 ttyname_r(GLIBC_2.0)[SUSv3] 24920 endpwent(GLIBC_2.0)[SUSv3] msgget(GLIBC_2.0)[SUSv3] 24921 twalk(GLIBC_2.0)[SUSv3] 24922 endservent(GLIBC_2.0)[SUSv3] msgrcv(GLIBC_2.0)[SUSv3] 24923 tzset(GLIBC_2.0)[SUSv3] 24924 endutent(GLIBC_2.0)[LSB] msgsnd(GLIBC_2.0)[SUSv3] 24925 ualarm(GLIBC_2.0)[SUSv3] 24926 endutxent(GLIBC_2.1)[SUSv3] msync(GLIBC_2.0)[SUSv3] 24927 ulimit(GLIBC_2.0)[SUSv3] 24928 erand48(GLIBC_2.0)[SUSv3] munlock(GLIBC_2.0)[SUSv3] 24929 umask(GLIBC_2.0)[SUSv3] 24930 err(GLIBC_2.0)[LSB] munlockall(GLIBC_2.0)[SUSv3] 24931 uname(GLIBC_2.0)[SUSv3] 24932 error(GLIBC_2.0)[LSB] munmap(GLIBC_2.0)[SUSv3] 24933 ungetc(GLIBC_2.0)[SUSv3] 24934 errx(GLIBC_2.0)[LSB] nanosleep(GLIBC_2.0)[SUSv3] 24935 ungetwc(GLIBC_2.2)[SUSv3] 24936 execl(GLIBC_2.0)[SUSv3] newlocale[LSB] unlink(GLIBC_2.0)[LSB] 24937 execle(GLIBC_2.0)[SUSv3] nftw(GLIBC_2.1)[SUSv3] 24938 unlockpt(GLIBC_2.1)[SUSv3] 24939 execlp(GLIBC_2.0)[SUSv3] nftw64(GLIBC_2.1)[LFS] 24940 unsetenv[SUSv3] 24941 execv(GLIBC_2.0)[SUSv3] ngettext[LSB] uselocale[LSB] 24942 execve(GLIBC_2.0)[SUSv3] nice(GLIBC_2.0)[SUSv3] 24943 usleep(GLIBC_2.0)[SUSv3] 24944 execvp(GLIBC_2.0)[SUSv3] nl_langinfo(GLIBC_2.0)[SUSv3] 24945 utime(GLIBC_2.0)[SUSv3] 24946 exit(GLIBC_2.0)[SUSv3] nrand48(GLIBC_2.0)[SUSv3] 24947 utimes(GLIBC_2.0)[SUSv3] 24948 fchdir(GLIBC_2.0)[SUSv3] ntohl(GLIBC_2.0)[SUSv3] utmpname[LSB] 24949 fchmod(GLIBC_2.0)[SUSv3] ntohs(GLIBC_2.0)[SUSv3] 24950 vasprintf(GLIBC_2.0)[LSB] 24951 fchown(GLIBC_2.0)[SUSv3] open(GLIBC_2.0)[SUSv3] 24952 vdprintf(GLIBC_2.0)[LSB] 24953 fclose(GLIBC_2.1)[SUSv3] opendir(GLIBC_2.0)[SUSv3] 24954 verrx(GLIBC_2.0)[LSB] 24955 fcntl(GLIBC_2.0)[LSB] openlog(GLIBC_2.0)[SUSv3] 24956 vfork(GLIBC_2.0)[SUSv3] 24957 fcvt(GLIBC_2.0)[SUSv3] pathconf(GLIBC_2.0)[SUSv3] 24958 vfprintf(GLIBC_2.0)[SUSv3] 24959 fdatasync(GLIBC_2.0)[SUSv3] pause(GLIBC_2.0)[SUSv3] 24960 vfscanf[LSB] 24961 fdopen(GLIBC_2.1)[SUSv3] pclose(GLIBC_2.1)[SUSv3] 24962 vfwprintf(GLIBC_2.2)[SUSv3] 24963 feof(GLIBC_2.0)[SUSv3] perror(GLIBC_2.0)[SUSv3] 24964 vfwscanf(GLIBC_2.2)[LSB] 24965 ferror(GLIBC_2.0)[SUSv3] pipe(GLIBC_2.0)[SUSv3] 24966 vprintf(GLIBC_2.0)[SUSv3] 24967 fflush(GLIBC_2.0)[SUSv3] pmap_getport(GLIBC_2.0)[LSB] 24968 vscanf[LSB] 24969 fflush_unlocked(GLIBC_2.0)[LSB] pmap_set(GLIBC_2.0)[LSB] 24970 vsnprintf(GLIBC_2.0)[SUSv3] 24971 ffs(GLIBC_2.0)[SUSv3] pmap_unset(GLIBC_2.0)[LSB] 24972 vsprintf(GLIBC_2.0)[SUSv3] 24973 fgetc(GLIBC_2.0)[SUSv3] poll(GLIBC_2.0)[SUSv3] vsscanf[LSB] 24974 fgetpos(GLIBC_2.0)[SUSv3] popen(GLIBC_2.1)[SUSv3] 24975 vswprintf(GLIBC_2.2)[SUSv3] 24976 fgetpos64(GLIBC_2.1)[LFS] posix_memalign(GLIBC_2.2)[SUSv3] 24977 vswscanf(GLIBC_2.2)[LSB] 24978 fgets(GLIBC_2.0)[SUSv3] posix_openpt[SUSv3] vsyslog[LSB] 24979 fgetwc(GLIBC_2.2)[SUSv3] printf(GLIBC_2.0)[SUSv3] 24980 vwprintf(GLIBC_2.2)[SUSv3] 24981 fgetwc_unlocked(GLIBC_2.2)[LSB] psignal(GLIBC_2.0)[LSB] 24982 vwscanf(GLIBC_2.2)[LSB] 24983 fgetws(GLIBC_2.2)[SUSv3] ptsname(GLIBC_2.1)[SUSv3] 24984 wait(GLIBC_2.0)[SUSv3] 24985 fileno(GLIBC_2.0)[SUSv3] putc(GLIBC_2.0)[SUSv3] 24986 wait4(GLIBC_2.0)[LSB] 24987 flock(GLIBC_2.0)[LSB] putc_unlocked(GLIBC_2.0)[SUSv3] 24988 waitpid(GLIBC_2.0)[LSB] 24989 flockfile(GLIBC_2.0)[SUSv3] putchar(GLIBC_2.0)[SUSv3] 24990 warn(GLIBC_2.0)[LSB] 24991 fmtmsg(GLIBC_2.1)[SUSv3] putchar_unlocked(GLIBC_2.0)[SUSv3] 24992 warnx(GLIBC_2.0)[LSB] 24993 fnmatch(GLIBC_2.2.3)[SUSv3] putenv(GLIBC_2.0)[SUSv3] 24994 wcpcpy(GLIBC_2.0)[LSB] 24995 fopen(GLIBC_2.1)[SUSv3] puts(GLIBC_2.0)[SUSv3] 24996 wcpncpy(GLIBC_2.0)[LSB] 24997 fopen64(GLIBC_2.1)[LFS] pututxline(GLIBC_2.1)[SUSv3] 24998 wcrtomb(GLIBC_2.0)[SUSv3] 24999 fork(GLIBC_2.0)[SUSv3] putw(GLIBC_2.0)[SUSv2] 25000 wcscasecmp(GLIBC_2.1)[LSB] 25001 fpathconf(GLIBC_2.0)[SUSv3] putwc(GLIBC_2.2)[SUSv3] 25002 wcscat(GLIBC_2.0)[SUSv3] 25003 fprintf(GLIBC_2.0)[SUSv3] putwchar(GLIBC_2.2)[SUSv3] 25004 wcschr(GLIBC_2.0)[SUSv3] 25005 fputc(GLIBC_2.0)[SUSv3] qsort(GLIBC_2.0)[SUSv3] 25006 wcscmp(GLIBC_2.0)[SUSv3] 25007 fputs(GLIBC_2.0)[SUSv3] raise(GLIBC_2.0)[SUSv3] 25008 wcscoll(GLIBC_2.0)[SUSv3] 25009 fputwc(GLIBC_2.2)[SUSv3] rand(GLIBC_2.0)[SUSv3] 25010 wcscpy(GLIBC_2.0)[SUSv3] 25011 fputws(GLIBC_2.2)[SUSv3] rand_r(GLIBC_2.0)[SUSv3] 25012 wcscspn(GLIBC_2.0)[SUSv3] 25013 fread(GLIBC_2.0)[SUSv3] random(GLIBC_2.0)[SUSv3] 25014 wcsdup(GLIBC_2.0)[LSB] 25015 free(GLIBC_2.0)[SUSv3] read(GLIBC_2.0)[SUSv3] 25016 wcsftime(GLIBC_2.2)[SUSv3] 25017 freeaddrinfo[SUSv3] readdir(GLIBC_2.0)[SUSv3] 25018 wcslen(GLIBC_2.0)[SUSv3] 25019 freelocale[LSB] readdir64(GLIBC_2.2)[LFS] 25020 wcsncasecmp(GLIBC_2.1)[LSB] 25021 freopen(GLIBC_2.0)[SUSv3] readdir_r[SUSv3] 25022 wcsncat(GLIBC_2.0)[SUSv3] 25023 freopen64(GLIBC_2.1)[LFS] readlink(GLIBC_2.0)[SUSv3] 25024 wcsncmp(GLIBC_2.0)[SUSv3] 25025 fscanf(GLIBC_2.0)[LSB] readv(GLIBC_2.0)[SUSv3] 25026 wcsncpy(GLIBC_2.0)[SUSv3] 25027 fseek(GLIBC_2.0)[SUSv3] realloc(GLIBC_2.0)[SUSv3] 25028 wcsnlen(GLIBC_2.1)[LSB] 25029 fseeko(GLIBC_2.1)[SUSv3] realpath(GLIBC_2.0)[SUSv3] 25030 wcsnrtombs(GLIBC_2.0)[LSB] 25031 fseeko64(GLIBC_2.1)[LFS] recv(GLIBC_2.0)[SUSv3] 25032 wcspbrk(GLIBC_2.0)[SUSv3] 25033 fsetpos(GLIBC_2.0)[SUSv3] recvfrom(GLIBC_2.0)[SUSv3] 25034 wcsrchr(GLIBC_2.0)[SUSv3] 25035 fsetpos64(GLIBC_2.1)[LFS] recvmsg(GLIBC_2.0)[SUSv3] 25036 wcsrtombs(GLIBC_2.0)[SUSv3] 25037 fstatfs(GLIBC_2.0)[LSB] regcomp(GLIBC_2.0)[SUSv3] 25038 wcsspn(GLIBC_2.0)[SUSv3] 25039 fstatfs64(GLIBC_2.1)[LSB] regerror(GLIBC_2.0)[SUSv3] 25040 wcsstr(GLIBC_2.0)[SUSv3] 25041 fstatvfs(GLIBC_2.1)[SUSv3] regexec(GLIBC_2.0)[LSB] 25042 wcstod(GLIBC_2.0)[SUSv3] 25043 fstatvfs64(GLIBC_2.1)[LFS] regfree(GLIBC_2.0)[SUSv3] 25044 wcstof(GLIBC_2.0)[SUSv3] 25045 fsync(GLIBC_2.0)[SUSv3] remove(GLIBC_2.0)[SUSv3] 25046 wcstoimax(GLIBC_2.1)[SUSv3] 25047 ftell(GLIBC_2.0)[SUSv3] remque(GLIBC_2.0)[SUSv3] 25048 wcstok(GLIBC_2.0)[SUSv3] 25049 ftello(GLIBC_2.1)[SUSv3] rename(GLIBC_2.0)[SUSv3] 25050 wcstol(GLIBC_2.0)[SUSv3] 25051 ftello64(GLIBC_2.1)[LFS] rewind(GLIBC_2.0)[SUSv3] 25052 wcstold(GLIBC_2.0)[SUSv3] 25053 ftime(GLIBC_2.0)[SUSv3] rewinddir(GLIBC_2.0)[SUSv3] 25054 wcstoll(GLIBC_2.1)[SUSv3] 25055 ftok(GLIBC_2.0)[SUSv3] rindex(GLIBC_2.0)[SUSv3] 25056 wcstombs(GLIBC_2.0)[SUSv3] 25057 ftruncate(GLIBC_2.0)[SUSv3] rmdir(GLIBC_2.0)[SUSv3] 25058 wcstoq(GLIBC_2.0)[LSB] 25059 ftruncate64(GLIBC_2.1)[LFS] sbrk(GLIBC_2.0)[SUSv2] 25060 wcstoul(GLIBC_2.0)[SUSv3] 25061 ftrylockfile(GLIBC_2.0)[SUSv3] scanf(GLIBC_2.0)[LSB] 25062 wcstoull(GLIBC_2.1)[SUSv3] 25063 ftw(GLIBC_2.0)[SUSv3] sched_get_priority_max(GLIBC_2.0)[SUSv3] 25064 wcstoumax(GLIBC_2.1)[SUSv3] 25065 ftw64(GLIBC_2.1)[LFS] sched_get_priority_min(GLIBC_2.0)[SUSv3] 25066 wcstouq(GLIBC_2.0)[LSB] 25067 funlockfile(GLIBC_2.0)[SUSv3] sched_getparam(GLIBC_2.0)[SUSv3] 25068 wcswcs(GLIBC_2.1)[SUSv3] 25069 fwide(GLIBC_2.2)[SUSv3] sched_getscheduler(GLIBC_2.0)[SUSv3] 25070 wcswidth(GLIBC_2.0)[SUSv3] 25071 fwprintf(GLIBC_2.2)[SUSv3] 25072 sched_rr_get_interval(GLIBC_2.0)[SUSv3] 25073 wcsxfrm(GLIBC_2.0)[SUSv3] 25074 fwrite(GLIBC_2.0)[SUSv3] sched_setparam(GLIBC_2.0)[SUSv3] 25075 wctob(GLIBC_2.0)[SUSv3] 25076 fwscanf(GLIBC_2.2)[LSB] sched_setscheduler(GLIBC_2.0)[SUSv3] 25077 wctomb(GLIBC_2.0)[SUSv3] 25078 gai_strerror[SUSv3] sched_yield(GLIBC_2.0)[SUSv3] 25079 wctrans(GLIBC_2.0)[SUSv3] 25080 gcvt(GLIBC_2.0)[SUSv3] seed48(GLIBC_2.0)[SUSv3] 25081 wctype(GLIBC_2.0)[SUSv3] 25082 getaddrinfo[SUSv3] seekdir(GLIBC_2.0)[SUSv3] 25083 wcwidth(GLIBC_2.0)[SUSv3] 25084 getc(GLIBC_2.0)[SUSv3] select(GLIBC_2.0)[SUSv3] 25085 wmemchr(GLIBC_2.0)[SUSv3] 25086 getc_unlocked(GLIBC_2.0)[SUSv3] semctl(GLIBC_2.0)[SUSv3] 25087 wmemcmp(GLIBC_2.0)[SUSv3] 25088 getchar(GLIBC_2.0)[SUSv3] semget(GLIBC_2.0)[SUSv3] 25089 wmemcpy(GLIBC_2.0)[SUSv3] 25090 getchar_unlocked(GLIBC_2.0)[SUSv3] semop(GLIBC_2.0)[SUSv3] 25091 wmemmove(GLIBC_2.0)[SUSv3] 25092 getcontext(GLIBC_2.1)[SUSv3] send(GLIBC_2.0)[SUSv3] 25093 wmemset(GLIBC_2.0)[SUSv3] 25094 getcwd(GLIBC_2.0)[SUSv3] sendmsg(GLIBC_2.0)[SUSv3] 25095 wordexp(GLIBC_2.1)[SUSv3] 25096 getdate(GLIBC_2.1)[SUSv3] sendto(GLIBC_2.0)[SUSv3] 25097 wordfree(GLIBC_2.1)[SUSv3] 25098 getegid(GLIBC_2.0)[SUSv3] setbuf(GLIBC_2.0)[SUSv3] 25099 wprintf(GLIBC_2.2)[SUSv3] 25100 getenv(GLIBC_2.0)[SUSv3] setbuffer(GLIBC_2.0)[LSB] 25101 write(GLIBC_2.0)[SUSv3] 25102 geteuid(GLIBC_2.0)[SUSv3] setcontext(GLIBC_2.0)[SUSv3] 25103 writev(GLIBC_2.0)[SUSv3] 25104 getgid(GLIBC_2.0)[SUSv3] setegid(GLIBC_2.0)[SUSv3] 25105 wscanf(GLIBC_2.2)[LSB] 25106 getgrent(GLIBC_2.0)[SUSv3] setenv[SUSv3] 25107 xdr_accepted_reply(GLIBC_2.0)[SVID.3] 25108 getgrgid(GLIBC_2.0)[SUSv3] seteuid(GLIBC_2.0)[SUSv3] 25109 xdr_array(GLIBC_2.0)[SVID.3] 25110 getgrgid_r(GLIBC_2.0)[SUSv3] setgid(GLIBC_2.0)[SUSv3] 25111 xdr_bool(GLIBC_2.0)[SVID.3] 25112 getgrnam(GLIBC_2.0)[SUSv3] setgrent(GLIBC_2.0)[SUSv3] 25113 xdr_bytes(GLIBC_2.0)[SVID.3] 25114 getgrnam_r(GLIBC_2.0)[SUSv3] setgroups(GLIBC_2.0)[LSB] 25115 xdr_callhdr(GLIBC_2.0)[SVID.3] 25116 getgrouplist[LSB] sethostname(GLIBC_2.0)[LSB] 25117 xdr_callmsg(GLIBC_2.0)[SVID.3] 25118 getgroups(GLIBC_2.0)[SUSv3] setitimer(GLIBC_2.0)[SUSv3] 25119 xdr_char(GLIBC_2.0)[SVID.3] 25120 gethostbyaddr(GLIBC_2.0)[SUSv3] setlocale(GLIBC_2.0)[SUSv3] 25121 xdr_double(GLIBC_2.0)[SVID.3] 25122 gethostbyname(GLIBC_2.0)[SUSv3] setlogmask(GLIBC_2.0)[SUSv3] 25123 xdr_enum(GLIBC_2.0)[SVID.3] 25124 gethostid(GLIBC_2.0)[SUSv3] setpgid(GLIBC_2.0)[SUSv3] 25125 xdr_float(GLIBC_2.0)[SVID.3] 25126 gethostname(GLIBC_2.0)[SUSv3] setpgrp(GLIBC_2.0)[SUSv3] 25127 xdr_free(GLIBC_2.0)[SVID.3] 25128 getitimer(GLIBC_2.0)[SUSv3] setpriority(GLIBC_2.0)[SUSv3] 25129 xdr_int(GLIBC_2.0)[SVID.3] 25130 getloadavg(GLIBC_2.2)[LSB] setprotoent(GLIBC_2.0)[SUSv3] 25131 xdr_long(GLIBC_2.0)[SVID.3] 25132 getlogin(GLIBC_2.0)[SUSv3] setpwent(GLIBC_2.0)[SUSv3] 25133 xdr_opaque(GLIBC_2.0)[SVID.3] 25134 getlogin_r[SUSv3] setregid(GLIBC_2.0)[SUSv3] 25135 xdr_opaque_auth(GLIBC_2.0)[SVID.3] 25136 getnameinfo[SUSv3] setreuid(GLIBC_2.0)[SUSv3] 25137 xdr_pointer(GLIBC_2.0)[SVID.3] 25138 getopt(GLIBC_2.0)[LSB] setrlimit(GLIBC_2.2)[SUSv3] 25139 xdr_reference(GLIBC_2.0)[SVID.3] 25140 getopt_long(GLIBC_2.0)[LSB] setrlimit64[LFS] 25141 xdr_rejected_reply(GLIBC_2.0)[SVID.3] 25142 getopt_long_only(GLIBC_2.0)[LSB] setservent(GLIBC_2.0)[SUSv3] 25143 xdr_replymsg(GLIBC_2.0)[SVID.3] 25144 getpagesize(GLIBC_2.0)[SUSv2] setsid(GLIBC_2.0)[SUSv3] 25145 xdr_short(GLIBC_2.0)[SVID.3] 25146 getpeername(GLIBC_2.0)[SUSv3] setsockopt(GLIBC_2.0)[LSB] 25147 xdr_string(GLIBC_2.0)[SVID.3] 25148 getpgid(GLIBC_2.0)[SUSv3] setstate(GLIBC_2.0)[SUSv3] 25149 xdr_u_char(GLIBC_2.0)[SVID.3] 25150 getpgrp(GLIBC_2.0)[SUSv3] setuid(GLIBC_2.0)[SUSv3] 25151 xdr_u_int(GLIBC_2.0)[LSB] 25152 getpid(GLIBC_2.0)[SUSv3] setutent(GLIBC_2.0)[LSB] 25153 xdr_u_long(GLIBC_2.0)[SVID.3] 25154 getppid(GLIBC_2.0)[SUSv3] setutxent(GLIBC_2.1)[SUSv3] 25155 xdr_u_short(GLIBC_2.0)[SVID.3] 25156 getpriority(GLIBC_2.0)[SUSv3] setvbuf(GLIBC_2.0)[SUSv3] 25157 xdr_union(GLIBC_2.0)[SVID.3] 25158 getprotobyname(GLIBC_2.0)[SUSv3] shmat(GLIBC_2.0)[SUSv3] 25159 xdr_vector(GLIBC_2.0)[SVID.3] 25160 getprotobynumber(GLIBC_2.0)[SUSv3] shmctl(GLIBC_2.0)[SUSv3] 25161 xdr_void(GLIBC_2.0)[SVID.3] 25162 getprotoent(GLIBC_2.0)[SUSv3] shmdt(GLIBC_2.0)[SUSv3] 25163 xdr_wrapstring(GLIBC_2.0)[SVID.3] 25164 getpwent(GLIBC_2.0)[SUSv3] shmget(GLIBC_2.0)[SUSv3] 25165 xdrmem_create(GLIBC_2.0)[SVID.3] 25166 getpwnam(GLIBC_2.0)[SUSv3] shutdown(GLIBC_2.0)[SUSv3] 25167 xdrrec_create(GLIBC_2.0)[SVID.3] 25168 getpwnam_r(GLIBC_2.0)[SUSv3] sigaction(GLIBC_2.0)[SUSv3] 25169 xdrrec_eof(GLIBC_2.0)[SVID.3] 25170 25171 Table A-2. libc Data Interfaces 25172 __daylight[LSB] __timezone[LSB] _sys_errlist[LSB] 25173 __environ[LSB] __tzname[LSB] 25174 _________________________________________________________ 25175 25176 A.2. libcrypt 25177 25178 The behavior of the interfaces in this library is specified by 25179 the following Standards. 25180 25181 ISO POSIX (2003) [SUSv3] 25182 25183 Table A-3. libcrypt Function Interfaces 25184 crypt(GLIBC_2.0)[SUSv3] encrypt(GLIBC_2.0)[SUSv3] 25185 setkey(GLIBC_2.0)[SUSv3] 25186 _________________________________________________________ 25187 25188 A.3. libdl 25189 25190 The behavior of the interfaces in this library is specified by 25191 the following Standards. 25192 25193 This Specification [LSB] 25194 ISO POSIX (2003) [SUSv3] 25195 25196 Table A-4. libdl Function Interfaces 25197 dladdr(GLIBC_2.0)[LSB] dlerror(GLIBC_2.0)[SUSv3] 25198 dlsym(GLIBC_2.0)[LSB] 25199 dlclose(GLIBC_2.0)[SUSv3] dlopen(GLIBC_2.1)[LSB] 25200 _________________________________________________________ 25201 25202 A.4. libm 25203 25204 The behavior of the interfaces in this library is specified by 25205 the following Standards. 25206 25207 ISO C (1999) [ISOC99] 25208 This Specification [LSB] 25209 SUSv2 [SUSv2] 25210 ISO POSIX (2003) [SUSv3] 25211 SVID Issue 3 [SVID.3] 25212 25213 Table A-5. libm Function Interfaces 25214 __finite[ISOC99] csinhf(GLIBC_2.1)[SUSv3] 25215 log10(GLIBC_2.0)[SUSv3] 25216 __finitef[ISOC99] csinhl(GLIBC_2.1)[SUSv3] log10f[SUSv3] 25217 __finitel[ISOC99] csinl(GLIBC_2.1)[SUSv3] log10l[SUSv3] 25218 __fpclassify[LSB] csqrt(GLIBC_2.1)[SUSv3] 25219 log1p(GLIBC_2.0)[SUSv3] 25220 __fpclassifyf[LSB] csqrtf(GLIBC_2.1)[SUSv3] log1pf[SUSv3] 25221 __signbit[ISOC99] csqrtl(GLIBC_2.1)[SUSv3] log1pl[SUSv3] 25222 __signbitf[ISOC99] ctan(GLIBC_2.1)[SUSv3] log2[SUSv3] 25223 acos(GLIBC_2.0)[SUSv3] ctanf(GLIBC_2.1)[SUSv3] log2f[SUSv3] 25224 acosf(GLIBC_2.0)[SUSv3] ctanh(GLIBC_2.1)[SUSv3] log2l[SUSv3] 25225 acosh(GLIBC_2.0)[SUSv3] ctanhf(GLIBC_2.1)[SUSv3] 25226 logb(GLIBC_2.0)[SUSv3] 25227 acoshf(GLIBC_2.0)[SUSv3] ctanhl(GLIBC_2.1)[SUSv3] logbf[SUSv3] 25228 acoshl(GLIBC_2.0)[SUSv3] ctanl(GLIBC_2.1)[SUSv3] logbl[SUSv3] 25229 acosl(GLIBC_2.0)[SUSv3] dremf(GLIBC_2.0)[ISOC99] logf[SUSv3] 25230 asin(GLIBC_2.0)[SUSv3] dreml(GLIBC_2.0)[ISOC99] logl[SUSv3] 25231 asinf(GLIBC_2.0)[SUSv3] erf(GLIBC_2.0)[SUSv3] 25232 lrint(GLIBC_2.1)[SUSv3] 25233 asinh(GLIBC_2.0)[SUSv3] erfc(GLIBC_2.0)[SUSv3] 25234 lrintf(GLIBC_2.1)[SUSv3] 25235 asinhf(GLIBC_2.0)[SUSv3] erfcf(GLIBC_2.0)[SUSv3] 25236 lrintl(GLIBC_2.1)[SUSv3] 25237 asinhl(GLIBC_2.0)[SUSv3] erfcl(GLIBC_2.0)[SUSv3] 25238 lround(GLIBC_2.1)[SUSv3] 25239 asinl(GLIBC_2.0)[SUSv3] erff(GLIBC_2.0)[SUSv3] 25240 lroundf(GLIBC_2.1)[SUSv3] 25241 atan(GLIBC_2.0)[SUSv3] erfl(GLIBC_2.0)[SUSv3] 25242 lroundl(GLIBC_2.1)[SUSv3] 25243 atan2(GLIBC_2.0)[SUSv3] exp(GLIBC_2.0)[SUSv3] 25244 matherr(GLIBC_2.0)[SVID.3] 25245 atan2f(GLIBC_2.0)[SUSv3] exp2[SUSv3] modf(GLIBC_2.0)[SUSv3] 25246 atan2l(GLIBC_2.0)[SUSv3] exp2f[SUSv3] modff(GLIBC_2.0)[SUSv3] 25247 atanf(GLIBC_2.0)[SUSv3] expf[SUSv3] modfl(GLIBC_2.0)[SUSv3] 25248 atanh(GLIBC_2.0)[SUSv3] expl[SUSv3] nan(GLIBC_2.1)[SUSv3] 25249 atanhf(GLIBC_2.0)[SUSv3] expm1(GLIBC_2.0)[SUSv3] 25250 nanf(GLIBC_2.1)[SUSv3] 25251 atanhl(GLIBC_2.0)[SUSv3] expm1f[SUSv3] nanl(GLIBC_2.1)[SUSv3] 25252 atanl(GLIBC_2.0)[SUSv3] expm1l[SUSv3] 25253 nearbyint(GLIBC_2.1)[SUSv3] 25254 cabs(GLIBC_2.1)[SUSv3] fabs(GLIBC_2.0)[SUSv3] 25255 nearbyintf(GLIBC_2.1)[SUSv3] 25256 cabsf(GLIBC_2.1)[SUSv3] fabsf(GLIBC_2.0)[SUSv3] 25257 nearbyintl(GLIBC_2.1)[SUSv3] 25258 cabsl(GLIBC_2.1)[SUSv3] fabsl(GLIBC_2.0)[SUSv3] 25259 nextafter(GLIBC_2.0)[SUSv3] 25260 cacos(GLIBC_2.1)[SUSv3] fdim(GLIBC_2.1)[SUSv3] 25261 nextafterf(GLIBC_2.0)[SUSv3] 25262 cacosf(GLIBC_2.1)[SUSv3] fdimf(GLIBC_2.1)[SUSv3] 25263 nextafterl(GLIBC_2.0)[SUSv3] 25264 cacosh(GLIBC_2.1)[SUSv3] fdiml(GLIBC_2.1)[SUSv3] 25265 nexttoward(GLIBC_2.1)[SUSv3] 25266 cacoshf(GLIBC_2.1)[SUSv3] feclearexcept(GLIBC_2.1)[SUSv3] 25267 nexttowardf(GLIBC_2.1)[SUSv3] 25268 cacoshl(GLIBC_2.1)[SUSv3] fegetenv(GLIBC_2.1)[SUSv3] 25269 nexttowardl(GLIBC_2.1)[SUSv3] 25270 cacosl(GLIBC_2.1)[SUSv3] fegetexceptflag(GLIBC_2.1)[SUSv3] 25271 pow(GLIBC_2.0)[SUSv3] 25272 carg(GLIBC_2.1)[SUSv3] fegetround(GLIBC_2.1)[SUSv3] 25273 pow10(GLIBC_2.1)[ISOC99] 25274 cargf(GLIBC_2.1)[SUSv3] feholdexcept(GLIBC_2.1)[SUSv3] 25275 pow10f(GLIBC_2.1)[ISOC99] 25276 cargl(GLIBC_2.1)[SUSv3] feraiseexcept(GLIBC_2.1)[SUSv3] 25277 pow10l(GLIBC_2.1)[ISOC99] 25278 casin(GLIBC_2.1)[SUSv3] fesetenv(GLIBC_2.1)[SUSv3] 25279 powf(GLIBC_2.0)[SUSv3] 25280 casinf(GLIBC_2.1)[SUSv3] fesetexceptflag(GLIBC_2.1)[SUSv3] 25281 powl(GLIBC_2.0)[SUSv3] 25282 casinh(GLIBC_2.1)[SUSv3] fesetround(GLIBC_2.1)[SUSv3] 25283 remainder(GLIBC_2.0)[SUSv3] 25284 casinhf(GLIBC_2.1)[SUSv3] fetestexcept(GLIBC_2.1)[SUSv3] 25285 remainderf(GLIBC_2.0)[SUSv3] 25286 casinhl(GLIBC_2.1)[SUSv3] feupdateenv(GLIBC_2.1)[SUSv3] 25287 remainderl(GLIBC_2.0)[SUSv3] 25288 casinl(GLIBC_2.1)[SUSv3] finite(GLIBC_2.0)[SUSv2] 25289 remquo(GLIBC_2.1)[SUSv3] 25290 catan(GLIBC_2.1)[SUSv3] finitef(GLIBC_2.0)[ISOC99] 25291 remquof(GLIBC_2.1)[SUSv3] 25292 catanf(GLIBC_2.1)[SUSv3] finitel(GLIBC_2.0)[ISOC99] 25293 remquol(GLIBC_2.1)[SUSv3] 25294 catanh(GLIBC_2.1)[SUSv3] floor(GLIBC_2.0)[SUSv3] 25295 rint(GLIBC_2.0)[SUSv3] 25296 catanhf(GLIBC_2.1)[SUSv3] floorf(GLIBC_2.0)[SUSv3] 25297 rintf(GLIBC_2.0)[SUSv3] 25298 catanhl(GLIBC_2.1)[SUSv3] floorl(GLIBC_2.0)[SUSv3] 25299 rintl(GLIBC_2.0)[SUSv3] 25300 catanl(GLIBC_2.1)[SUSv3] fma(GLIBC_2.1)[SUSv3] 25301 round(GLIBC_2.1)[SUSv3] 25302 cbrt(GLIBC_2.0)[SUSv3] fmaf(GLIBC_2.1)[SUSv3] 25303 roundf(GLIBC_2.1)[SUSv3] 25304 cbrtf(GLIBC_2.0)[SUSv3] fmal(GLIBC_2.1)[SUSv3] 25305 roundl(GLIBC_2.1)[SUSv3] 25306 cbrtl(GLIBC_2.0)[SUSv3] fmax(GLIBC_2.1)[SUSv3] 25307 scalb(GLIBC_2.0)[SUSv3] 25308 ccos(GLIBC_2.1)[SUSv3] fmaxf(GLIBC_2.1)[SUSv3] 25309 scalbf(GLIBC_2.0)[ISOC99] 25310 ccosf(GLIBC_2.1)[SUSv3] fmaxl(GLIBC_2.1)[SUSv3] 25311 scalbl(GLIBC_2.0)[ISOC99] 25312 ccosh(GLIBC_2.1)[SUSv3] fmin(GLIBC_2.1)[SUSv3] 25313 scalbln(GLIBC_2.1)[SUSv3] 25314 ccoshf(GLIBC_2.1)[SUSv3] fminf(GLIBC_2.1)[SUSv3] 25315 scalblnf(GLIBC_2.1)[SUSv3] 25316 ccoshl(GLIBC_2.1)[SUSv3] fminl(GLIBC_2.1)[SUSv3] 25317 scalblnl(GLIBC_2.1)[SUSv3] 25318 ccosl(GLIBC_2.1)[SUSv3] fmod(GLIBC_2.0)[SUSv3] 25319 scalbn(GLIBC_2.0)[SUSv3] 25320 ceil(GLIBC_2.0)[SUSv3] fmodf(GLIBC_2.0)[SUSv3] 25321 scalbnf(GLIBC_2.0)[SUSv3] 25322 ceilf(GLIBC_2.0)[SUSv3] fmodl(GLIBC_2.0)[SUSv3] 25323 scalbnl(GLIBC_2.0)[SUSv3] 25324 ceill(GLIBC_2.0)[SUSv3] frexp(GLIBC_2.0)[SUSv3] 25325 significand(GLIBC_2.0)[ISOC99] 25326 cexp(GLIBC_2.1)[SUSv3] frexpf(GLIBC_2.0)[SUSv3] 25327 significandf(GLIBC_2.0)[ISOC99] 25328 cexpf(GLIBC_2.1)[SUSv3] frexpl(GLIBC_2.0)[SUSv3] 25329 significandl(GLIBC_2.0)[ISOC99] 25330 cexpl(GLIBC_2.1)[SUSv3] gamma(GLIBC_2.0)[SUSv2] 25331 sin(GLIBC_2.0)[SUSv3] 25332 cimag(GLIBC_2.1)[SUSv3] gammaf(GLIBC_2.0)[ISOC99] 25333 sincos(GLIBC_2.1)[ISOC99] 25334 cimagf(GLIBC_2.1)[SUSv3] gammal(GLIBC_2.0)[ISOC99] 25335 sincosf(GLIBC_2.1)[ISOC99] 25336 cimagl(GLIBC_2.1)[SUSv3] hypot(GLIBC_2.0)[SUSv3] 25337 sincosl(GLIBC_2.1)[ISOC99] 25338 clog(GLIBC_2.1)[SUSv3] hypotf(GLIBC_2.0)[SUSv3] 25339 sinf(GLIBC_2.0)[SUSv3] 25340 clog10(GLIBC_2.1)[ISOC99] hypotl(GLIBC_2.0)[SUSv3] 25341 sinh(GLIBC_2.0)[SUSv3] 25342 clog10f(GLIBC_2.1)[ISOC99] ilogb(GLIBC_2.0)[SUSv3] 25343 sinhf(GLIBC_2.0)[SUSv3] 25344 clog10l(GLIBC_2.1)[ISOC99] ilogbf(GLIBC_2.0)[SUSv3] 25345 sinhl(GLIBC_2.0)[SUSv3] 25346 clogf(GLIBC_2.1)[SUSv3] ilogbl(GLIBC_2.0)[SUSv3] 25347 sinl(GLIBC_2.0)[SUSv3] 25348 clogl(GLIBC_2.1)[SUSv3] j0(GLIBC_2.0)[SUSv3] 25349 sqrt(GLIBC_2.0)[SUSv3] 25350 conj(GLIBC_2.1)[SUSv3] j0f(GLIBC_2.0)[ISOC99] 25351 sqrtf(GLIBC_2.0)[SUSv3] 25352 conjf(GLIBC_2.1)[SUSv3] j0l(GLIBC_2.0)[ISOC99] 25353 sqrtl(GLIBC_2.0)[SUSv3] 25354 conjl(GLIBC_2.1)[SUSv3] j1(GLIBC_2.0)[SUSv3] 25355 tan(GLIBC_2.0)[SUSv3] 25356 copysign(GLIBC_2.0)[SUSv3] j1f(GLIBC_2.0)[ISOC99] 25357 tanf(GLIBC_2.0)[SUSv3] 25358 copysignf(GLIBC_2.0)[SUSv3] j1l(GLIBC_2.0)[ISOC99] 25359 tanh(GLIBC_2.0)[SUSv3] 25360 copysignl(GLIBC_2.0)[SUSv3] jn(GLIBC_2.0)[SUSv3] 25361 tanhf(GLIBC_2.0)[SUSv3] 25362 cos(GLIBC_2.0)[SUSv3] jnf(GLIBC_2.0)[ISOC99] 25363 tanhl(GLIBC_2.0)[SUSv3] 25364 cosf(GLIBC_2.0)[SUSv3] jnl(GLIBC_2.0)[ISOC99] 25365 tanl(GLIBC_2.0)[SUSv3] 25366 cosh(GLIBC_2.0)[SUSv3] ldexp(GLIBC_2.0)[SUSv3] 25367 tgamma(GLIBC_2.1)[SUSv3] 25368 coshf(GLIBC_2.0)[SUSv3] ldexpf(GLIBC_2.0)[SUSv3] 25369 tgammaf(GLIBC_2.1)[SUSv3] 25370 coshl(GLIBC_2.0)[SUSv3] ldexpl(GLIBC_2.0)[SUSv3] 25371 tgammal(GLIBC_2.1)[SUSv3] 25372 cosl(GLIBC_2.0)[SUSv3] lgamma(GLIBC_2.0)[SUSv3] 25373 trunc(GLIBC_2.1)[SUSv3] 25374 cpow(GLIBC_2.1)[SUSv3] lgamma_r(GLIBC_2.0)[ISOC99] 25375 truncf(GLIBC_2.1)[SUSv3] 25376 cpowf(GLIBC_2.1)[SUSv3] lgammaf(GLIBC_2.0)[SUSv3] 25377 truncl(GLIBC_2.1)[SUSv3] 25378 cpowl(GLIBC_2.1)[SUSv3] lgammaf_r(GLIBC_2.0)[ISOC99] 25379 y0(GLIBC_2.0)[SUSv3] 25380 cproj(GLIBC_2.1)[SUSv3] lgammal(GLIBC_2.0)[SUSv3] 25381 y0f(GLIBC_2.0)[ISOC99] 25382 cprojf(GLIBC_2.1)[SUSv3] lgammal_r(GLIBC_2.0)[ISOC99] 25383 y0l(GLIBC_2.0)[ISOC99] 25384 cprojl(GLIBC_2.1)[SUSv3] llrint(GLIBC_2.1)[SUSv3] 25385 y1(GLIBC_2.0)[SUSv3] 25386 creal(GLIBC_2.1)[SUSv3] llrintf(GLIBC_2.1)[SUSv3] 25387 y1f(GLIBC_2.0)[ISOC99] 25388 crealf(GLIBC_2.1)[SUSv3] llrintl(GLIBC_2.1)[SUSv3] 25389 y1l(GLIBC_2.0)[ISOC99] 25390 creall(GLIBC_2.1)[SUSv3] llround(GLIBC_2.1)[SUSv3] 25391 yn(GLIBC_2.0)[SUSv3] 25392 csin(GLIBC_2.1)[SUSv3] llroundf(GLIBC_2.1)[SUSv3] 25393 ynf(GLIBC_2.0)[ISOC99] 25394 csinf(GLIBC_2.1)[SUSv3] llroundl(GLIBC_2.1)[SUSv3] 25395 ynl(GLIBC_2.0)[ISOC99] 25396 csinh(GLIBC_2.1)[SUSv3] log(GLIBC_2.0)[SUSv3] 25397 25398 Table A-6. libm Data Interfaces 25399 signgam[SUSv3] 25400 _________________________________________________________ 25401 25402 A.5. libncurses 25403 25404 The behavior of the interfaces in this library is specified by 25405 the following Standards. 25406 25407 X/Open Curses [SUS-CURSES] 25408 25409 Table A-7. libncurses Function Interfaces 25410 addch[SUS-CURSES] mvdelch[SUS-CURSES] slk_refresh[SUS-CURSES] 25411 addchnstr[SUS-CURSES] mvderwin[SUS-CURSES] 25412 slk_restore[SUS-CURSES] 25413 addchstr[SUS-CURSES] mvgetch[SUS-CURSES] slk_set[SUS-CURSES] 25414 addnstr[SUS-CURSES] mvgetnstr[SUS-CURSES] 25415 slk_touch[SUS-CURSES] 25416 addstr[SUS-CURSES] mvgetstr[SUS-CURSES] standend[SUS-CURSES] 25417 attr_get[SUS-CURSES] mvhline[SUS-CURSES] standout[SUS-CURSES] 25418 attr_off[SUS-CURSES] mvinch[SUS-CURSES] 25419 start_color[SUS-CURSES] 25420 attr_on[SUS-CURSES] mvinchnstr[SUS-CURSES] subpad[SUS-CURSES] 25421 attr_set[SUS-CURSES] mvinchstr[SUS-CURSES] subwin[SUS-CURSES] 25422 attroff[SUS-CURSES] mvinnstr[SUS-CURSES] syncok[SUS-CURSES] 25423 attron[SUS-CURSES] mvinsch[SUS-CURSES] termattrs[SUS-CURSES] 25424 attrset[SUS-CURSES] mvinsnstr[SUS-CURSES] termname[SUS-CURSES] 25425 baudrate[SUS-CURSES] mvinsstr[SUS-CURSES] tgetent[SUS-CURSES] 25426 beep[SUS-CURSES] mvinstr[SUS-CURSES] tgetflag[SUS-CURSES] 25427 bkgd[SUS-CURSES] mvprintw[SUS-CURSES] tgetnum[SUS-CURSES] 25428 bkgdset[SUS-CURSES] mvscanw[SUS-CURSES] tgetstr[SUS-CURSES] 25429 border[SUS-CURSES] mvvline[SUS-CURSES] tgoto[SUS-CURSES] 25430 box[SUS-CURSES] mvwaddch[SUS-CURSES] tigetflag[SUS-CURSES] 25431 can_change_color[SUS-CURSES] mvwaddchnstr[SUS-CURSES] 25432 tigetnum[SUS-CURSES] 25433 cbreak[SUS-CURSES] mvwaddchstr[SUS-CURSES] 25434 tigetstr[SUS-CURSES] 25435 chgat[SUS-CURSES] mvwaddnstr[SUS-CURSES] timeout[SUS-CURSES] 25436 clear[SUS-CURSES] mvwaddstr[SUS-CURSES] touchline[SUS-CURSES] 25437 clearok[SUS-CURSES] mvwchgat[SUS-CURSES] touchwin[SUS-CURSES] 25438 clrtobot[SUS-CURSES] mvwdelch[SUS-CURSES] tparm[SUS-CURSES] 25439 clrtoeol[SUS-CURSES] mvwgetch[SUS-CURSES] tputs[SUS-CURSES] 25440 color_content[SUS-CURSES] mvwgetnstr[SUS-CURSES] 25441 typeahead[SUS-CURSES] 25442 color_set[SUS-CURSES] mvwgetstr[SUS-CURSES] unctrl[SUS-CURSES] 25443 copywin[SUS-CURSES] mvwhline[SUS-CURSES] ungetch[SUS-CURSES] 25444 curs_set[SUS-CURSES] mvwin[SUS-CURSES] untouchwin[SUS-CURSES] 25445 def_prog_mode[SUS-CURSES] mvwinch[SUS-CURSES] 25446 use_env[SUS-CURSES] 25447 def_shell_mode[SUS-CURSES] mvwinchnstr[SUS-CURSES] 25448 vidattr[SUS-CURSES] 25449 del_curterm[SUS-CURSES] mvwinchstr[SUS-CURSES] 25450 vidputs[SUS-CURSES] 25451 delay_output[SUS-CURSES] mvwinnstr[SUS-CURSES] 25452 vline[SUS-CURSES] 25453 delch[SUS-CURSES] mvwinsch[SUS-CURSES] vw_printw[SUS-CURSES] 25454 deleteln[SUS-CURSES] mvwinsnstr[SUS-CURSES] 25455 vw_scanw[SUS-CURSES] 25456 delscreen[SUS-CURSES] mvwinsstr[SUS-CURSES] 25457 vwprintw[SUS-CURSES] 25458 delwin[SUS-CURSES] mvwinstr[SUS-CURSES] vwscanw[SUS-CURSES] 25459 derwin[SUS-CURSES] mvwprintw[SUS-CURSES] waddch[SUS-CURSES] 25460 doupdate[SUS-CURSES] mvwscanw[SUS-CURSES] 25461 waddchnstr[SUS-CURSES] 25462 dupwin[SUS-CURSES] mvwvline[SUS-CURSES] waddchstr[SUS-CURSES] 25463 echo[SUS-CURSES] napms[SUS-CURSES] waddnstr[SUS-CURSES] 25464 echochar[SUS-CURSES] newpad[SUS-CURSES] waddstr[SUS-CURSES] 25465 endwin[SUS-CURSES] newterm[SUS-CURSES] wattr_get[SUS-CURSES] 25466 erase[SUS-CURSES] newwin[SUS-CURSES] wattr_off[SUS-CURSES] 25467 erasechar[SUS-CURSES] nl[SUS-CURSES] wattr_on[SUS-CURSES] 25468 filter[SUS-CURSES] nocbreak[SUS-CURSES] wattr_set[SUS-CURSES] 25469 flash[SUS-CURSES] nodelay[SUS-CURSES] wattroff[SUS-CURSES] 25470 flushinp[SUS-CURSES] noecho[SUS-CURSES] wattron[SUS-CURSES] 25471 getbkgd[SUS-CURSES] nonl[SUS-CURSES] wattrset[SUS-CURSES] 25472 getch[SUS-CURSES] noqiflush[SUS-CURSES] wbkgd[SUS-CURSES] 25473 getnstr[SUS-CURSES] noraw[SUS-CURSES] wbkgdset[SUS-CURSES] 25474 getstr[SUS-CURSES] notimeout[SUS-CURSES] wborder[SUS-CURSES] 25475 getwin[SUS-CURSES] overlay[SUS-CURSES] wchgat[SUS-CURSES] 25476 halfdelay[SUS-CURSES] overwrite[SUS-CURSES] wclear[SUS-CURSES] 25477 has_colors[SUS-CURSES] pair_content[SUS-CURSES] 25478 wclrtobot[SUS-CURSES] 25479 has_ic[SUS-CURSES] pechochar[SUS-CURSES] wclrtoeol[SUS-CURSES] 25480 has_il[SUS-CURSES] pnoutrefresh[SUS-CURSES] 25481 wcolor_set[SUS-CURSES] 25482 hline[SUS-CURSES] prefresh[SUS-CURSES] wcursyncup[SUS-CURSES] 25483 idcok[SUS-CURSES] printw[SUS-CURSES] wdelch[SUS-CURSES] 25484 idlok[SUS-CURSES] putp[SUS-CURSES] wdeleteln[SUS-CURSES] 25485 immedok[SUS-CURSES] putwin[SUS-CURSES] wechochar[SUS-CURSES] 25486 inch[SUS-CURSES] qiflush[SUS-CURSES] werase[SUS-CURSES] 25487 inchnstr[SUS-CURSES] raw[SUS-CURSES] wgetch[SUS-CURSES] 25488 inchstr[SUS-CURSES] redrawwin[SUS-CURSES] wgetnstr[SUS-CURSES] 25489 init_color[SUS-CURSES] refresh[SUS-CURSES] wgetstr[SUS-CURSES] 25490 init_pair[SUS-CURSES] reset_prog_mode[SUS-CURSES] 25491 whline[SUS-CURSES] 25492 initscr[SUS-CURSES] reset_shell_mode[SUS-CURSES] 25493 winch[SUS-CURSES] 25494 innstr[SUS-CURSES] resetty[SUS-CURSES] winchnstr[SUS-CURSES] 25495 insch[SUS-CURSES] restartterm[SUS-CURSES] winchstr[SUS-CURSES] 25496 insdelln[SUS-CURSES] ripoffline[SUS-CURSES] 25497 winnstr[SUS-CURSES] 25498 insertln[SUS-CURSES] savetty[SUS-CURSES] winsch[SUS-CURSES] 25499 insnstr[SUS-CURSES] scanw[SUS-CURSES] winsdelln[SUS-CURSES] 25500 insstr[SUS-CURSES] scr_dump[SUS-CURSES] winsertln[SUS-CURSES] 25501 instr[SUS-CURSES] scr_init[SUS-CURSES] winsnstr[SUS-CURSES] 25502 intrflush[SUS-CURSES] scr_restore[SUS-CURSES] 25503 winsstr[SUS-CURSES] 25504 is_linetouched[SUS-CURSES] scr_set[SUS-CURSES] 25505 winstr[SUS-CURSES] 25506 is_wintouched[SUS-CURSES] scrl[SUS-CURSES] wmove[SUS-CURSES] 25507 isendwin[SUS-CURSES] scroll[SUS-CURSES] 25508 wnoutrefresh[SUS-CURSES] 25509 keyname[SUS-CURSES] scrollok[SUS-CURSES] wprintw[SUS-CURSES] 25510 keypad[SUS-CURSES] set_curterm[SUS-CURSES] 25511 wredrawln[SUS-CURSES] 25512 killchar[SUS-CURSES] set_term[SUS-CURSES] wrefresh[SUS-CURSES] 25513 leaveok[SUS-CURSES] setscrreg[SUS-CURSES] wscanw[SUS-CURSES] 25514 longname[SUS-CURSES] setupterm[SUS-CURSES] wscrl[SUS-CURSES] 25515 meta[SUS-CURSES] slk_attr_set[SUS-CURSES] 25516 wsetscrreg[SUS-CURSES] 25517 move[SUS-CURSES] slk_attroff[SUS-CURSES] wstandend[SUS-CURSES] 25518 mvaddch[SUS-CURSES] slk_attron[SUS-CURSES] 25519 wstandout[SUS-CURSES] 25520 mvaddchnstr[SUS-CURSES] slk_attrset[SUS-CURSES] 25521 wsyncdown[SUS-CURSES] 25522 mvaddchstr[SUS-CURSES] slk_clear[SUS-CURSES] 25523 wsyncup[SUS-CURSES] 25524 mvaddnstr[SUS-CURSES] slk_color[SUS-CURSES] 25525 wtimeout[SUS-CURSES] 25526 mvaddstr[SUS-CURSES] slk_init[SUS-CURSES] wtouchln[SUS-CURSES] 25527 mvchgat[SUS-CURSES] slk_label[SUS-CURSES] wvline[SUS-CURSES] 25528 mvcur[SUS-CURSES] slk_noutrefresh[SUS-CURSES] 25529 25530 Table A-8. libncurses Data Interfaces 25531 COLORS[SUS-CURSES] LINES[SUS-CURSES] curscr[SUS-CURSES] 25532 COLOR_PAIRS[SUS-CURSES] acs_map[SUS-CURSES] stdscr[SUS-CURSES] 25533 COLS[SUS-CURSES] cur_term[SUS-CURSES] 25534 _________________________________________________________ 25535 25536 A.6. libpam 25537 25538 The behavior of the interfaces in this library is specified by 25539 the following Standards. 25540 25541 This Specification [LSB] 25542 25543 Table A-9. libpam Function Interfaces 25544 pam_acct_mgmt[LSB] pam_fail_delay[LSB] pam_setcred[LSB] 25545 pam_authenticate[LSB] pam_get_item[LSB] pam_start[LSB] 25546 pam_chauthtok[LSB] pam_getenvlist[LSB] pam_strerror[LSB] 25547 pam_close_session[LSB] pam_open_session[LSB] 25548 pam_end[LSB] pam_set_item[LSB] 25549 _________________________________________________________ 25550 25551 A.7. libpthread 25552 25553 The behavior of the interfaces in this library is specified by 25554 the following Standards. 25555 25556 Large File Support [LFS] 25557 This Specification [LSB] 25558 ISO POSIX (2003) [SUSv3] 25559 25560 Table A-10. libpthread Function Interfaces 25561 _pthread_cleanup_pop[LSB] pthread_cond_wait(GLIBC_2.0)[SUSv3] 25562 pthread_rwlock_timedwrlock[SUSv3] 25563 _pthread_cleanup_push[LSB] 25564 pthread_condattr_destroy(GLIBC_2.0)[SUSv3] 25565 pthread_rwlock_tryrdlock(GLIBC_2.1)[SUSv3] 25566 lseek64(GLIBC_2.1)[LFS] pthread_condattr_getpshared[SUSv3] 25567 pthread_rwlock_trywrlock(GLIBC_2.1)[SUSv3] 25568 open64(GLIBC_2.1)[LFS] pthread_condattr_init(GLIBC_2.0)[SUSv3] 25569 pthread_rwlock_unlock(GLIBC_2.1)[SUSv3] 25570 pread(GLIBC_2.1)[SUSv3] pthread_condattr_setpshared[SUSv3] 25571 pthread_rwlock_wrlock(GLIBC_2.1)[SUSv3] 25572 pread64(GLIBC_2.1)[LFS] pthread_create(GLIBC_2.0)[SUSv3] 25573 pthread_rwlockattr_destroy(GLIBC_2.1)[SUSv3] 25574 pthread_attr_destroy(GLIBC_2.0)[SUSv3] 25575 pthread_detach(GLIBC_2.0)[SUSv3] 25576 pthread_rwlockattr_getpshared(GLIBC_2.1)[SUSv3] 25577 pthread_attr_getdetachstate(GLIBC_2.0)[SUSv3] 25578 pthread_equal(GLIBC_2.0)[SUSv3] 25579 pthread_rwlockattr_init(GLIBC_2.1)[SUSv3] 25580 pthread_attr_getguardsize(GLIBC_2.1)[SUSv3] 25581 pthread_exit(GLIBC_2.0)[SUSv3] 25582 pthread_rwlockattr_setpshared(GLIBC_2.1)[SUSv3] 25583 pthread_attr_getinheritsched(GLIBC_2.0)[SUSv3] 25584 pthread_getconcurrency[SUSv3] pthread_self(GLIBC_2.0)[SUSv3] 25585 pthread_attr_getschedparam(GLIBC_2.0)[SUSv3] 25586 pthread_getschedparam(GLIBC_2.0)[SUSv3] 25587 pthread_setcancelstate(GLIBC_2.0)[SUSv3] 25588 pthread_attr_getschedpolicy(GLIBC_2.0)[SUSv3] 25589 pthread_getspecific(GLIBC_2.0)[SUSv3] 25590 pthread_setcanceltype(GLIBC_2.0)[SUSv3] 25591 pthread_attr_getscope(GLIBC_2.0)[SUSv3] 25592 pthread_join(GLIBC_2.0)[SUSv3] pthread_setconcurrency[SUSv3] 25593 pthread_attr_getstack[SUSv3] 25594 pthread_key_create(GLIBC_2.0)[SUSv3] 25595 pthread_setschedparam(GLIBC_2.0)[SUSv3] 25596 pthread_attr_getstackaddr(GLIBC_2.1)[SUSv3] 25597 pthread_key_delete(GLIBC_2.0)[SUSv3] 25598 pthread_setschedprio[SUSv3] 25599 pthread_attr_getstacksize(GLIBC_2.1)[SUSv3] 25600 pthread_kill(GLIBC_2.0)[SUSv3] 25601 pthread_setspecific(GLIBC_2.0)[SUSv3] 25602 pthread_attr_init(GLIBC_2.1)[SUSv3] 25603 pthread_mutex_destroy(GLIBC_2.0)[SUSv3] 25604 pthread_sigmask(GLIBC_2.0)[SUSv3] 25605 pthread_attr_setdetachstate(GLIBC_2.0)[SUSv3] 25606 pthread_mutex_init(GLIBC_2.0)[SUSv3] 25607 pthread_testcancel(GLIBC_2.0)[SUSv3] 25608 pthread_attr_setguardsize(GLIBC_2.1)[SUSv3] 25609 pthread_mutex_lock(GLIBC_2.0)[SUSv3] pwrite(GLIBC_2.1)[SUSv3] 25610 pthread_attr_setinheritsched(GLIBC_2.0)[SUSv3] 25611 pthread_mutex_trylock(GLIBC_2.0)[SUSv3] 25612 pwrite64(GLIBC_2.1)[LFS] 25613 pthread_attr_setschedparam(GLIBC_2.0)[SUSv3] 25614 pthread_mutex_unlock(GLIBC_2.0)[SUSv3] 25615 sem_close(GLIBC_2.1.1)[SUSv3] 25616 pthread_attr_setschedpolicy(GLIBC_2.0)[SUSv3] 25617 pthread_mutexattr_destroy(GLIBC_2.0)[SUSv3] 25618 sem_destroy(GLIBC_2.1)[SUSv3] 25619 pthread_attr_setscope(GLIBC_2.0)[SUSv3] 25620 pthread_mutexattr_getpshared(GLIBC_2.2)[SUSv3] 25621 sem_getvalue(GLIBC_2.1)[SUSv3] 25622 pthread_attr_setstack[SUSv3] 25623 pthread_mutexattr_gettype(GLIBC_2.1)[SUSv3] 25624 sem_init(GLIBC_2.1)[SUSv3] 25625 pthread_attr_setstackaddr(GLIBC_2.1)[SUSv3] 25626 pthread_mutexattr_init(GLIBC_2.0)[SUSv3] 25627 sem_open(GLIBC_2.1.1)[SUSv3] 25628 pthread_attr_setstacksize(GLIBC_2.1)[SUSv3] 25629 pthread_mutexattr_setpshared(GLIBC_2.2)[SUSv3] 25630 sem_post(GLIBC_2.1)[SUSv3] 25631 pthread_cancel(GLIBC_2.0)[SUSv3] 25632 pthread_mutexattr_settype(GLIBC_2.1)[SUSv3] 25633 sem_timedwait(GLIBC_2.2)[SUSv3] 25634 pthread_cond_broadcast(GLIBC_2.0)[SUSv3] 25635 pthread_once(GLIBC_2.0)[SUSv3] sem_trywait(GLIBC_2.1)[SUSv3] 25636 pthread_cond_destroy(GLIBC_2.0)[SUSv3] 25637 pthread_rwlock_destroy(GLIBC_2.1)[SUSv3] 25638 sem_unlink(GLIBC_2.1.1)[SUSv3] 25639 pthread_cond_init(GLIBC_2.0)[SUSv3] 25640 pthread_rwlock_init(GLIBC_2.1)[SUSv3] 25641 sem_wait(GLIBC_2.1)[SUSv3] 25642 pthread_cond_signal(GLIBC_2.0)[SUSv3] 25643 pthread_rwlock_rdlock(GLIBC_2.1)[SUSv3] 25644 pthread_cond_timedwait(GLIBC_2.0)[SUSv3] 25645 pthread_rwlock_timedrdlock[SUSv3] 25646 _________________________________________________________ 25647 25648 A.8. librt 25649 25650 The behavior of the interfaces in this library is specified by 25651 the following Standards. 25652 25653 ISO POSIX (2003) [SUSv3] 25654 25655 Table A-11. librt Function Interfaces 25656 clock_getcpuclockid(GLIBC_2.2)[SUSv3] 25657 clock_settime(GLIBC_2.2)[SUSv3] timer_delete(GLIBC_2.2)[SUSv3] 25658 clock_getres(GLIBC_2.2)[SUSv3] shm_open(GLIBC_2.2)[SUSv3] 25659 timer_getoverrun(GLIBC_2.2)[SUSv3] 25660 clock_gettime(GLIBC_2.2)[SUSv3] shm_unlink(GLIBC_2.2)[SUSv3] 25661 timer_gettime(GLIBC_2.2)[SUSv3] 25662 clock_nanosleep(GLIBC_2.2)[SUSv3] 25663 timer_create(GLIBC_2.2)[SUSv3] timer_settime(GLIBC_2.2)[SUSv3] 25664 _________________________________________________________ 25665 25666 A.9. libutil 25667 25668 The behavior of the interfaces in this library is specified by 25669 the following Standards. 25670 25671 This Specification [LSB] 25672 25673 Table A-12. libutil Function Interfaces 25674 forkpty(GLIBC_2.0)[LSB] login_tty(GLIBC_2.0)[LSB] 25675 logwtmp(GLIBC_2.0)[LSB] 25676 login(GLIBC_2.0)[LSB] logout(GLIBC_2.0)[LSB] 25677 openpty(GLIBC_2.0)[LSB] 25678 _________________________________________________________ 25679 25680 A.10. libz 25681 25682 The behavior of the interfaces in this library is specified by 25683 the following Standards. 25684 25685 This Specification [LSB] 25686 25687 Table A-13. libz Function Interfaces 25688 adler32[LSB] gzclose[LSB] gztell[LSB] 25689 compress[LSB] gzdopen[LSB] gzwrite[LSB] 25690 compress2[LSB] gzeof[LSB] inflate[LSB] 25691 compressBound[LSB] gzerror[LSB] inflateEnd[LSB] 25692 crc32[LSB] gzflush[LSB] inflateInit2_[LSB] 25693 deflate[LSB] gzgetc[LSB] inflateInit_[LSB] 25694 deflateBound[LSB] gzgets[LSB] inflateReset[LSB] 25695 deflateCopy[LSB] gzopen[LSB] inflateSetDictionary[LSB] 25696 deflateEnd[LSB] gzprintf[LSB] inflateSync[LSB] 25697 deflateInit2_[LSB] gzputc[LSB] inflateSyncPoint[LSB] 25698 deflateInit_[LSB] gzputs[LSB] uncompress[LSB] 25699 deflateParams[LSB] gzread[LSB] zError[LSB] 25700 deflateReset[LSB] gzrewind[LSB] zlibVersion[LSB] 25701 deflateSetDictionary[LSB] gzseek[LSB] 25702 get_crc_table[LSB] gzsetparams[LSB] 25703 _________________________________________________________ 25704 25705 Appendix B. Future Directions (Informative) 25706 25707 B.1. Introduction 25708 25709 This appendix describes interfaces that are under development 25710 and aimed at future releases of this specification. At this 25711 stage, such interfaces are at best recommended practice, and 25712 do not constitute normative requirements of this 25713 specification. Applications may not assume that any system 25714 provides these interfaces. 25715 25716 We encourage system implementors and ISVs to provide these 25717 interfaces, and to provide feedback on their specification to 25718 lsbspec@freestandards.org. These interfaces may well be 25719 further modified during the development process, and may be 25720 withdrawn if concensus cannot be reached. 25721 _________________________________________________________ 25722 25723 B.2. Commands And Utilities 25724 25725 Table of Contents 25726 lsbinstall -- installation tool for various types of data 25727 25728 lsbinstall 25729 25730 Name 25731 25732 lsbinstall -- installation tool for various types of data 25733 25734 Synopsis 25735 25736 /usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] { -t 25737 type | --type=type } [-p package | --package=package] 25738 operand... 25739 25740 Description 25741 25742 The lsbinstall utility may be used to install certain types of 25743 files into system specific locations, repositories, or 25744 databases. This command may be used during a package post 25745 installation script to add package specific data to system 25746 wide repositories. A user may need appropriate privilege to 25747 invoke lsbinstall. 25748 25749 The operand (or operands) name an object of type type (see 25750 below) that belongs to a package named package. The 25751 combination of package name, object type and object name 25752 should be unique amongst all objects installed by lsbinstall. 25753 The lsbinstall utility may rename an object if another package 25754 already owns an object of the same type with the same name. 25755 25756 Note: If a namespace collision is detected by lsbinstall, 25757 it is unspecified how the object is renamed, although 25758 typical implementations may prepend the package name to the 25759 object in some way (e.g. package.obj-name). The lsbinstall 25760 utility may maintain a database of the mappings it has 25761 performed during installation in order to ensure that the 25762 correct object is removed during a subsequent removal 25763 operation. 25764 25765 Scripts installed by lsbinstall should not make use of the 25766 script name in order to decide on their functionality. 25767 25768 Note: It is appropriate for such a script to use the script 25769 name in error messages, usage statements, etc. The only 25770 guarantee made by lsbinstall is the effect that an 25771 installation (or removal) should have, not where a script 25772 is installed, or how it is named. 25773 25774 The -p pkg or --package=pkg is required for all object types 25775 unless explicitly noted below. 25776 25777 If the -c or --check option is specified, lsbinstall should 25778 test to see if there is an existing object of the type 25779 specified already installed. If there is, lsbinstall should 25780 print a message to its standard output and immediately exit 25781 with a status of zero. If there is no object of the type and 25782 name specified already installed, lsbinstall should exit with 25783 a non-zero status and take no further action. 25784 25785 If the -r or --remove is specified, the named object of the 25786 specified type should be removed or disabled from the system, 25787 except as noted below. The behavior is unspecified if the 25788 named object was not previously installed by lsbinstall. 25789 25790 Note: lsbinstall may rename objects during installation in 25791 order to prevent name collisions where another package has 25792 already installed an object with the given name. Using 25793 lsbinstall --remove will remove only the object belonging 25794 to the named package, and not the object belonging to 25795 another package. 25796 25797 Also note that the intent of the --remove option is to 25798 prevent the effect of the installed object; it should be 25799 sufficient to disable or comment out the addition in some 25800 way, while leaving the content behind. It is not intended 25801 that --remove be required to be the exact reverse of 25802 installation. 25803 25804 Object Types 25805 25806 The -t type or --type=type option should support at least the 25807 following types: 25808 25809 profile 25810 25811 install a profile script into a system specific location. 25812 There should be one operand, that names a profile shell 25813 script. The behavior is unspecified if this name does not have 25814 the suffix .sh. 25815 25816 The sh utility should read and execute commands in its current 25817 execution environment from all such installed profile shell 25818 scripts when invoked as an interactive login shell, or if the 25819 -l (the letter ell) is specified (see Shell Invocation). 25820 service 25821 25822 ensure a service name and number pair is known to the system 25823 service database. When installing, there must be at least two 25824 operands. The first operand should have the format %d/%s with 25825 the port number and protocol values (e.g. 22/tcp), and the 25826 second operand should be the name of the service. Any 25827 subsequent operands provide aliases for this service. The -p 25828 pkg or --package=pkg option is not required for service 25829 objects, and is ignored if specified. If any of the -r, 25830 --remove, -c or --check options are specified, there should be 25831 a single operand identifying the port and protocol values 25832 (with the same format as above). 25833 25834 It should not be an error to attempt to add a service name to 25835 the system service database if that service name already 25836 exists for the same port and protocol combination. If the port 25837 and protocol combination was already present, but the name 25838 unknown, the name should be added as an alias to the existing 25839 entry. It should be an error to attempt to add a second entry 25840 for a given service name and protocol, but where the port 25841 number differs from an existing entry. 25842 25843 If the -r or --remove is specified, the system service 25844 database need not be updated to remove or disable the named 25845 service. 25846 inet 25847 25848 add an entry to the system's network super daemon 25849 configuration. If none of the -r, --remove, -c or --check 25850 options are specified, the first operand should have the 25851 format: 25852 "%s:%s:%s:%s:%s:%s" 25853 25854 Otherwise, the first operand should have the format 25855 "%s:%s" 25856 25857 The fields in the first operand have the following meaning, in 25858 order: 25859 25860 svc_name 25861 25862 The name of this service. If the name does not contain a /, 25863 this should match the name of an already installed service 25864 (see also getservbyname()). If the name contains a / 25865 character, the behavior is unspecified. 25866 25867 Rationale: This version of the LSB does not specify 25868 getrpcbyname() nor the existence or format of the /etc/rpc 25869 file. Therefore, installation of RPC based services is not 25870 specified at this point. A future version of this 25871 specification may require names containing a / character to 25872 be Remote Procedure Call based services. 25873 25874 protocol 25875 25876 The name of a protocol. The name should be one of those listed 25877 in /etc/protocols. If this attribute is not specified (i.e. a 25878 null value is passed), the system should use an implementation 25879 defined default protocol. 25880 socket_type 25881 25882 One of the following values: 25883 25884 stream 25885 25886 the service will use a stream type socket. 25887 dgram 25888 25889 the service will use a datagram type socket. 25890 seqpacket 25891 25892 the service will use a sequenced packet type socket. 25893 This field is not required for the -c, --check, -r, or 25894 --remove options. 25895 wait_flag 25896 25897 If the value of this attribute is wait, once the service is 25898 started, no further requests for that service will be handled 25899 until the service exits. If the value is nowait, the network 25900 super daemon should continue to handle further requests for 25901 the given service while that service is running. 25902 25903 Note: If the service has the socket_type attribute set to 25904 dgram, the wait_flag attribute should be set to wait, since 25905 such services do not have any distinction between the 25906 socket used for listening and that used for accepting. 25907 25908 This field is not required for the -c, --check, -r, or 25909 --remove options. 25910 user[.group] 25911 25912 The name of a user from the user login database, optionally 25913 followed by the name of a group from the group database. The 25914 service started to handle this request should run with the 25915 privileges of the specified user and group. This field is not 25916 required for the -c, --check, -r, or --remove options. 25917 server [arg ...] 25918 25919 The name of a program to run to handle the request, optionally 25920 followed by any arguments required. The server name and each 25921 of its arguments is separated by whitespace. This field is not 25922 required for the -c, --check, -r, or --remove options. 25923 If the implementation supports additional controls over 25924 services started through the inet super daemon, there may be 25925 additional, implementation-defined, operands. 25926 25927 Rationale: Systems that use the xinetd super daemon may 25928 support additional controls such as IP address 25929 restrictions, logging requirements, etc. The LSB does not 25930 require these additional controls. However, it was believed 25931 to be of sufficient benefit that implementations are 25932 granted permission to extend this interface as required. 25933 25934 Examples 25935 25936 lsbinstall --package=myapp --type=profile myco.com-prod.sh 25937 25938 Install the profile shell script for myco.com-prod.sh, part of 25939 the myapp package.. 25940 lsbinstall --package=myapp --check --type=profile myco.com-prod.sh 25941 25942 Test to see if the profile shell script for myco.com-prod.sh, 25943 as part of the myapp package, is installed correctly. 25944 25945 Exit Status 25946 25947 If the -c or --check option is specified, lsbinstall should 25948 exit with a zero status if an object of the specified type and 25949 name is already installed, or non-zero otherwise. Otherwise, 25950 lsbinstall should exit with a zero status if the object with 25951 the specified type and name was successfully installed (or 25952 removed if the -r or --remove option was specified), and 25953 non-zero if the installation (or removal) failed. On failure, 25954 a diagnostic message should be printed to the standard error 25955 file descriptor. 25956 _________________________________________________________ 25957 25958 Appendix C. GNU Free Documentation License (Informative) 25959 25960 This specification is published under the terms of the GNU 25961 Free Documentation License, Version 1.1, March 2000 25962 25963 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 25964 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 25965 permitted to copy and distribute verbatim copies of this 25966 license document, but changing it is not allowed. 25967 _________________________________________________________ 25968 25969 C.1. PREAMBLE 25970 25971 The purpose of this License is to make a manual, textbook, or 25972 other written document "free" in the sense of freedom: to 25973 assure everyone the effective freedom to copy and redistribute 25974 it, with or without modifying it, either commercially or 25975 noncommercially. Secondarily, this License preserves for the 25976 author and publisher a way to get credit for their work, while 25977 not being considered responsible for modifications made by 25978 others. 25979 25980 This License is a kind of "copyleft", which means that 25981 derivative works of the document must themselves be free in 25982 the same sense. It complements the GNU General Public License, 25983 which is a copyleft license designed for free software. 25984 25985 We have designed this License in order to use it for manuals 25986 for free software, because free software needs free 25987 documentation: a free program should come with manuals 25988 providing the same freedoms that the software does. But this 25989 License is not limited to software manuals; it can be used for 25990 any textual work, regardless of subject matter or whether it 25991 is published as a printed book. We recommend this License 25992 principally for works whose purpose is instruction or 25993 reference. 25994 _________________________________________________________ 25995 25996 C.2. APPLICABILITY AND DEFINITIONS 25997 25998 This License applies to any manual or other work that contains 25999 a notice placed by the copyright holder saying it can be 26000 distributed under the terms of this License. The "Document", 26001 below, refers to any such manual or work. Any member of the 26002 public is a licensee, and is addressed as "you". 26003 26004 A "Modified Version" of the Document means any work containing 26005 the Document or a portion of it, either copied verbatim, or 26006 with modifications and/or translated into another language. 26007 26008 A "Secondary Section" is a named appendix or a front-matter 26009 section of the Document that deals exclusively with the 26010 relationship of the publishers or authors of the Document to 26011 the Document's overall subject (or to related matters) and 26012 contains nothing that could fall directly within that overall 26013 subject. (For example, if the Document is in part a textbook 26014 of mathematics, a Secondary Section may not explain any 26015 mathematics.) The relationship could be a matter of historical 26016 connection with the subject or with related matters, or of 26017 legal, commercial, philosophical, ethical or political 26018 position regarding them. 26019 26020 The "Invariant Sections" are certain Secondary Sections whose 26021 titles are designated, as being those of Invariant Sections, 26022 in the notice that says that the Document is released under 26023 this License. 26024 26025 The "Cover Texts" are certain short passages of text that are 26026 listed, as Front-Cover Texts or Back-Cover Texts, in the 26027 notice that says that the Document is released under this 26028 License. 26029 26030 A "Transparent" copy of the Document means a machine-readable 26031 copy, represented in a format whose specification is available 26032 to the general public, whose contents can be viewed and edited 26033 directly and straightforwardly with generic text editors or 26034 (for images composed of pixels) generic paint programs or (for 26035 drawings) some widely available drawing editor, and that is 26036 suitable for input to text formatters or for automatic 26037 translation to a variety of formats suitable for input to text 26038 formatters. A copy made in an otherwise Transparent file 26039 format whose markup has been designed to thwart or discourage 26040 subsequent modification by readers is not Transparent. A copy 26041 that is not "Transparent" is called "Opaque". 26042 26043 Examples of suitable formats for Transparent copies include 26044 plain ASCII without markup, Texinfo input format, LaTeX input 26045 format, SGML or XML using a publicly available DTD, and 26046 standard-conforming simple HTML designed for human 26047 modification. Opaque formats include PostScript, PDF, 26048 proprietary formats that can be read and edited only by 26049 proprietary word processors, SGML or XML for which the DTD 26050 and/or processing tools are not generally available, and the 26051 machine-generated HTML produced by some word processors for 26052 output purposes only. 26053 26054 The "Title Page" means, for a printed book, the title page 26055 itself, plus such following pages as are needed to hold, 26056 legibly, the material this License requires to appear in the 26057 title page. For works in formats which do not have any title 26058 page as such, "Title Page" means the text near the most 26059 prominent appearance of the work's title, preceding the 26060 beginning of the body of the text. 26061 _________________________________________________________ 26062 26063 C.3. VERBATIM COPYING 26064 26065 You may copy and distribute the Document in any medium, either 26066 commercially or noncommercially, provided that this License, 26067 the copyright notices, and the license notice saying this 26068 License applies to the Document are reproduced in all copies, 26069 and that you add no other conditions whatsoever to those of 26070 this License. You may not use technical measures to obstruct 26071 or control the reading or further copying of the copies you 26072 make or distribute. However, you may accept compensation in 26073 exchange for copies. If you distribute a large enough number 26074 of copies you must also follow the conditions in section 3. 26075 26076 You may also lend copies, under the same conditions stated 26077 above, and you may publicly display copies. 26078 _________________________________________________________ 26079 26080 C.4. COPYING IN QUANTITY 26081 26082 If you publish printed copies of the Document numbering more 26083 than 100, and the Document's license notice requires Cover 26084 Texts, you must enclose the copies in covers that carry, 26085 clearly and legibly, all these Cover Texts: Front-Cover Texts 26086 on the front cover, and Back-Cover Texts on the back cover. 26087 Both covers must also clearly and legibly identify you as the 26088 publisher of these copies. The front cover must present the 26089 full title with all words of the title equally prominent and 26090 visible. You may add other material on the covers in addition. 26091 Copying with changes limited to the covers, as long as they 26092 preserve the title of the Document and satisfy these 26093 conditions, can be treated as verbatim copying in other 26094 respects. 26095 26096 If the required texts for either cover are too voluminous to 26097 fit legibly, you should put the first ones listed (as many as 26098 fit reasonably) on the actual cover, and continue the rest 26099 onto adjacent pages. 26100 26101 If you publish or distribute Opaque copies of the Document 26102 numbering more than 100, you must either include a 26103 machine-readable Transparent copy along with each Opaque copy, 26104 or state in or with each Opaque copy a publicly-accessible 26105 computer-network location containing a complete Transparent 26106 copy of the Document, free of added material, which the 26107 general network-using public has access to download 26108 anonymously at no charge using public-standard network 26109 protocols. If you use the latter option, you must take 26110 reasonably prudent steps, when you begin distribution of 26111 Opaque copies in quantity, to ensure that this Transparent 26112 copy will remain thus accessible at the stated location until 26113 at least one year after the last time you distribute an Opaque 26114 copy (directly or through your agents or retailers) of that 26115 edition to the public. 26116 26117 It is requested, but not required, that you contact the 26118 authors of the Document well before redistributing any large 26119 number of copies, to give them a chance to provide you with an 26120 updated version of the Document. 26121 _________________________________________________________ 26122 26123 C.5. MODIFICATIONS 26124 26125 You may copy and distribute a Modified Version of the Document 26126 under the conditions of sections 2 and 3 above, provided that 26127 you release the Modified Version under precisely this License, 26128 with the Modified Version filling the role of the Document, 26129 thus licensing distribution and modification of the Modified 26130 Version to whoever possesses a copy of it. In addition, you 26131 must do these things in the Modified Version: 26132 26133 A. Use in the Title Page (and on the covers, if any) a title 26134 distinct from that of the Document, and from those of 26135 previous versions (which should, if there were any, be 26136 listed in the History section of the Document). You may 26137 use the same title as a previous version if the original 26138 publisher of that version gives permission. 26139 B. List on the Title Page, as authors, one or more persons or 26140 entities responsible for authorship of the modifications 26141 in the Modified Version, together with at least five of 26142 the principal authors of the Document (all of its 26143 principal authors, if it has less than five). 26144 C. State on the Title page the name of the publisher of the 26145 Modified Version, as the publisher. 26146 D. Preserve all the copyright notices of the Document. 26147 E. Add an appropriate copyright notice for your modifications 26148 adjacent to the other copyright notices. 26149 F. Include, immediately after the copyright notices, a 26150 license notice giving the public permission to use the 26151 Modified Version under the terms of this License, in the 26152 form shown in the Addendum below. 26153 G. Preserve in that license notice the full lists of 26154 Invariant Sections and required Cover Texts given in the 26155 Document's license notice. 26156 H. Include an unaltered copy of this License. 26157 I. Preserve the section entitled "History", and its title, 26158 and add to it an item stating at least the title, year, 26159 new authors, and publisher of the Modified Version as 26160 given on the Title Page. If there is no section entitled 26161 "History" in the Document, create one stating the title, 26162 year, authors, and publisher of the Document as given on 26163 its Title Page, then add an item describing the Modified 26164 Version as stated in the previous sentence. 26165 J. Preserve the network location, if any, given in the 26166 Document for public access to a Transparent copy of the 26167 Document, and likewise the network locations given in the 26168 Document for previous versions it was based on. These may 26169 be placed in the "History" section. You may omit a network 26170 location for a work that was published at least four years 26171 before the Document itself, or if the original publisher 26172 of the version it refers to gives permission. 26173 K. In any section entitled "Acknowledgements" or 26174 "Dedications", preserve the section's title, and preserve 26175 in the section all the substance and tone of each of the 26176 contributor acknowledgements and/or dedications given 26177 therein. 26178 L. Preserve all the Invariant Sections of the Document, 26179 unaltered in their text and in their titles. Section 26180 numbers or the equivalent are not considered part of the 26181 section titles. 26182 M. Delete any section entitled "Endorsements". Such a section 26183 may not be included in the Modified Version. 26184 N. Do not retitle any existing section as "Endorsements" or 26185 to conflict in title with any Invariant Section. 26186 26187 If the Modified Version includes new front-matter sections or 26188 appendices that qualify as Secondary Sections and contain no 26189 material copied from the Document, you may at your option 26190 designate some or all of these sections as invariant. To do 26191 this, add their titles to the list of Invariant Sections in 26192 the Modified Version's license notice. These titles must be 26193 distinct from any other section titles. 26194 26195 You may add a section entitled "Endorsements", provided it 26196 contains nothing but endorsements of your Modified Version by 26197 various parties--for example, statements of peer review or 26198 that the text has been approved by an organization as the 26199 authoritative definition of a standard. 26200 26201 You may add a passage of up to five words as a Front-Cover 26202 Text, and a passage of up to 25 words as a Back-Cover Text, to 26203 the end of the list of Cover Texts in the Modified Version. 26204 Only one passage of Front-Cover Text and one of Back-Cover 26205 Text may be added by (or through arrangements made by) any one 26206 entity. If the Document already includes a cover text for the 26207 same cover, previously added by you or by arrangement made by 26208 the same entity you are acting on behalf of, you may not add 26209 another; but you may replace the old one, on explicit 26210 permission from the previous publisher that added the old one. 26211 26212 The author(s) and publisher(s) of the Document do not by this 26213 License give permission to use their names for publicity for 26214 or to assert or imply endorsement of any Modified Version. 26215 _________________________________________________________ 26216 26217 C.6. COMBINING DOCUMENTS 26218 26219 You may combine the Document with other documents released 26220 under this License, under the terms defined in section 4 above 26221 for modified versions, provided that you include in the 26222 combination all of the Invariant Sections of all of the 26223 original documents, unmodified, and list them all as Invariant 26224 Sections of your combined work in its license notice. 26225 26226 The combined work need only contain one copy of this License, 26227 and multiple identical Invariant Sections may be replaced with 26228 a single copy. If there are multiple Invariant Sections with 26229 the same name but different contents, make the title of each 26230 such section unique by adding at the end of it, in 26231 parentheses, the name of the original author or publisher of 26232 that section if known, or else a unique number. Make the same 26233 adjustment to the section titles in the list of Invariant 26234 Sections in the license notice of the combined work. 26235 26236 In the combination, you must combine any sections entitled 26237 "History" in the various original documents, forming one 26238 section entitled "History"; likewise combine any sections 26239 entitled "Acknowledgements", and any sections entitled 26240 "Dedications". You must delete all sections entitled 26241 "Endorsements." 26242 _________________________________________________________ 26243 26244 C.7. COLLECTIONS OF DOCUMENTS 26245 26246 You may make a collection consisting of the Document and other 26247 documents released under this License, and replace the 26248 individual copies of this License in the various documents 26249 with a single copy that is included in the collection, 26250 provided that you follow the rules of this License for 26251 verbatim copying of each of the documents in all other 26252 respects. 26253 26254 You may extract a single document from such a collection, and 26255 distribute it individually under this License, provided you 26256 insert a copy of this License into the extracted document, and 26257 follow this License in all other respects regarding verbatim 26258 copying of that document. 26259 _________________________________________________________ 26260 26261 C.8. AGGREGATION WITH INDEPENDENT WORKS 26262 26263 A compilation of the Document or its derivatives with other 26264 separate and independent documents or works, in or on a volume 26265 of a storage or distribution medium, does not as a whole count 26266 as a Modified Version of the Document, provided no compilation 26267 copyright is claimed for the compilation. Such a compilation 26268 is called an "aggregate", and this License does not apply to 26269 the other self-contained works thus compiled with the 26270 Document, on account of their being thus compiled, if they are 26271 not themselves derivative works of the Document. 26272 26273 If the Cover Text requirement of section 3 is applicable to 26274 these copies of the Document, then if the Document is less 26275 than one quarter of the entire aggregate, the Document's Cover 26276 Texts may be placed on covers that surround only the Document 26277 within the aggregate. Otherwise they must appear on covers 26278 around the whole aggregate. 26279 _________________________________________________________ 26280 26281 C.9. TRANSLATION 26282 26283 Translation is considered a kind of modification, so you may 26284 distribute translations of the Document under the terms of 26285 section 4. Replacing Invariant Sections with translations 26286 requires special permission from their copyright holders, but 26287 you may include translations of some or all Invariant Sections 26288 in addition to the original versions of these Invariant 26289 Sections. You may include a translation of this License 26290 provided that you also include the original English version of 26291 this License. In case of a disagreement between the 26292 translation and the original English version of this License, 26293 the original English version will prevail. 26294 _________________________________________________________ 26295 26296 C.10. TERMINATION 26297 26298 You may not copy, modify, sublicense, or distribute the 26299 Document except as expressly provided for under this License. 26300 Any other attempt to copy, modify, sublicense or distribute 26301 the Document is void, and will automatically terminate your 26302 rights under this License. However, parties who have received 26303 copies, or rights, from you under this License will not have 26304 their licenses terminated so long as such parties remain in 26305 full compliance. 26306 _________________________________________________________ 26307 26308 C.11. FUTURE REVISIONS OF THIS LICENSE 26309 26310 The Free Software Foundation may publish new, revised versions 26311 of the GNU Free Documentation License from time to time. Such 26312 new versions will be similar in spirit to the present version, 26313 but may differ in detail to address new problems or concerns. 26314 See http://www.gnu.org/copyleft/. 26315 26316 Each version of the License is given a distinguishing version 26317 number. If the Document specifies that a particular numbered 26318 version of this License "or any later version" applies to it, 26319 you have the option of following the terms and conditions 26320 either of that specified version or of any later version that 26321 has been published (not as a draft) by the Free Software 26322 Foundation. If the Document does not specify a version number 26323 of this License, you may choose any version ever published 26324 (not as a draft) by the Free Software Foundation. 26325 _________________________________________________________ 26326 26327 C.12. How to use this License for your documents 26328 26329 To use this License in a document you have written, include a 26330 copy of the License in the document and put the following 26331 copyright and license notices just after the title page: 26332 26333 Copyright (c) YEAR YOUR NAME. Permission is granted to 26334 copy, distribute and/or modify this document under the 26335 terms of the GNU Free Documentation License, Version 1.1 or 26336 any later version published by the Free Software 26337 Foundation; with the Invariant Sections being LIST THEIR 26338 TITLES, with the Front-Cover Texts being LIST, and with the 26339 Back-Cover Texts being LIST. A copy of the license is 26340 included in the section entitled "GNU Free Documentation 26341 License". 26342 26343 If you have no Invariant Sections, write "with no Invariant 26344 Sections" instead of saying which ones are invariant. If you 26345 have no Front-Cover Texts, write "no Front-Cover Texts" 26346 instead of "Front-Cover Texts being LIST"; likewise for 26347 Back-Cover Texts. 26348 26349 If your document contains nontrivial examples of program code, 26350 we recommend releasing these examples in parallel under your 26351 choice of free software license, such as the GNU General 26352 Public License, to permit their use in free software.