1 Linux Standard Base Core Specification 3.2 2 3 Copyright © 2007 Linux Foundation 4 5 Permission is granted to copy, distribute and/or modify this 6 document under the terms of the GNU Free Documentation License, 7 Version 1.1; with no Invariant Sections, with no Front-Cover 8 Texts, and with no Back-Cover Texts. A copy of the license is 9 included in the section entitled "GNU Free Documentation 10 License". 11 12 Portions of the text may be copyrighted by the following 13 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 * Apple Inc. 24 * Easy Software Products 25 * artofcode LLC 26 * Till Kamppeter 27 * Manfred Wassman 28 * Python Software Foundation 29 30 These excerpts are being used in accordance with their 31 respective licenses. 32 33 Linux is the registered trademark of Linus Torvalds in the U.S. 34 and other countries. 35 36 UNIX is a registered trademark of The Open Group. 37 38 LSB is a trademark of the Linux Foundation in the United States 39 and other countries. 40 41 AMD is a trademark of Advanced Micro Devices, Inc. 42 43 Intel and Itanium are registered trademarks and Intel386 is a 44 trademark of Intel Corporation. 45 46 PowerPC is a registered trademark and PowerPC Architecture is a 47 trademark of the IBM Corporation. 48 49 S/390 is a registered trademark of the IBM Corporation. 50 51 OpenGL is a registered trademark of Silicon Graphics, Inc. 52 __________________________________________________________ 53 54 Table of Contents 55 Foreword 56 Introduction 57 I. Introductory Elements 58 59 1. Scope 60 61 1.1. General 62 1.2. Module Specific Scope 63 64 2. References 65 66 2.1. Normative References 67 2.2. Informative References/Bibliography 68 69 3. Requirements 70 71 3.1. Relevant Libraries 72 3.2. LSB Implementation Conformance 73 3.3. LSB Application Conformance 74 75 4. Definitions 76 5. Terminology 77 6. Documentation Conventions 78 7. Relationship To ISO/IEC 9945 POSIX 79 8. Relationship To Other Linux Foundation Specifications 80 81 II. Executable And Linking Format (ELF) 82 83 9. Introduction 84 10. Low Level System Information 85 86 10.1. Operating System Interface 87 10.2. Machine Interface 88 89 11. Object Format 90 91 11.1. Object Files 92 11.2. Sections 93 11.3. Special Sections 94 11.4. Symbol Mapping 95 11.5. DWARF Extensions 96 11.6. Exception Frames 97 11.7. Symbol Versioning 98 11.8. ABI note tag 99 100 12. Dynamic Linking 101 102 12.1. Program Loading and Dynamic Linking 103 12.2. Program Header 104 12.3. Dynamic Entries 105 106 III. Base Libraries 107 108 13. Base Libraries 109 110 13.1. Introduction 111 13.2. Program Interpreter 112 13.3. Interfaces for libc 113 13.4. Data Definitions for libc 114 13.5. Interface Definitions for libc 115 13.6. Interfaces for libm 116 13.7. Data Definitions for libm 117 13.8. Interface Definitions for libm 118 13.9. Interfaces for libpthread 119 13.10. Data Definitions for libpthread 120 13.11. Interface Definitions for libpthread 121 13.12. Interfaces for libgcc_s 122 13.13. Data Definitions for libgcc_s 123 13.14. Interfaces for libdl 124 13.15. Data Definitions for libdl 125 13.16. Interface Definitions for libdl 126 13.17. Interfaces for librt 127 13.18. Data Definitions for librt 128 13.19. Interfaces for libcrypt 129 13.20. Interfaces for libpam 130 13.21. Data Definitions for libpam 131 13.22. Interface Definitions for libpam 132 133 IV. Utility Libraries 134 135 14. Utility Libraries 136 137 14.1. Introduction 138 14.2. Interfaces for libz 139 14.3. Data Definitions for libz 140 14.4. Interface Definitions for libz 141 14.5. Interfaces for libncurses 142 14.6. Data Definitions for libncurses 143 14.7. Interfaces for libutil 144 14.8. Interface Definitions for libutil 145 146 V. Commands and Utilities 147 148 15. Commands and Utilities 149 150 15.1. Commands and Utilities 151 15.2. Command Behavior 152 153 VI. Execution Environment 154 155 16. File System Hierarchy 156 157 16.1. /dev: Device Files 158 16.2. /etc: Host-specific system configuration 159 16.3. User Accounting Databases 160 16.4. Path For System Administration Utilities 161 162 17. Additional Recommendations 163 164 17.1. Recommendations for applications on ownership 165 and permissions 166 167 18. Additional Behaviors 168 169 18.1. Mandatory Optional Behaviors 170 171 19. Localization 172 173 19.1. Introduction 174 19.2. Regular Expressions 175 19.3. Pattern Matching Notation 176 177 VII. System Initialization 178 179 20. System Initialization 180 181 20.1. Cron Jobs 182 20.2. Init Script Actions 183 20.3. Comment Conventions for Init Scripts 184 20.4. Installation and Removal of Init Scripts 185 20.5. Run Levels 186 20.6. Facility Names 187 20.7. Script Names 188 20.8. Init Script Functions 189 190 VIII. Users & Groups 191 192 21. Users & Groups 193 194 21.1. User and Group Database 195 21.2. User & Group Names 196 21.3. User ID Ranges 197 21.4. Rationale 198 199 IX. Package Format and Installation 200 201 22. Software Installation 202 203 22.1. Introduction 204 22.2. Package File Format 205 22.3. Package Script Restrictions 206 22.4. Package Tools 207 22.5. Package Naming 208 22.6. Package Dependencies 209 22.7. Package Architecture Considerations 210 211 A. Alphabetical Listing of Interfaces 212 213 A.1. libc 214 A.2. libcrypt 215 A.3. libdl 216 A.4. libm 217 A.5. libncurses 218 A.6. libpam 219 A.7. libpthread 220 A.8. librt 221 A.9. libutil 222 A.10. libz 223 224 B. Future Directions (Informative) 225 226 B.1. Introduction 227 B.2. Commands And Utilities 228 229 lsbinstall -- installation tool for various types of 230 data 231 232 C. GNU Free Documentation License (Informative) 233 234 C.1. PREAMBLE 235 C.2. APPLICABILITY AND DEFINITIONS 236 C.3. VERBATIM COPYING 237 C.4. COPYING IN QUANTITY 238 C.5. MODIFICATIONS 239 C.6. COMBINING DOCUMENTS 240 C.7. COLLECTIONS OF DOCUMENTS 241 C.8. AGGREGATION WITH INDEPENDENT WORKS 242 C.9. TRANSLATION 243 C.10. TERMINATION 244 C.11. FUTURE REVISIONS OF THIS LICENSE 245 C.12. How to use this License for your documents 246 247 List of Figures 248 11-1. Version Definition Entries 249 11-2. Version Definition Auxiliary Entries 250 11-3. Version Needed Entries 251 11-4. Version Needed Auxiliary Entries 252 12-1. Dynamic Structure 253 254 List of Tables 255 2-1. Normative References 256 2-2. Other References 257 3-1. Standard Library Names 258 3-2. Standard Library Names defined in the Architecture 259 Specific Parts of ISO/IEC 23360 260 261 10-1. Scalar Types 262 11-1. ELF Section Types 263 11-2. Additional Section Types 264 11-3. ELF Special Sections 265 11-4. Additional Special Sections 266 11-5. DWARF Exception Header value format 267 11-6. DWARF Exception Header application 268 11-7. Additional DWARF Call Frame Instructions 269 11-8. Call Frame Information Format 270 11-9. Common Information Entry Format 271 11-10. Frame Description Entry Format 272 11-11. .eh_frame_hdr Section Format 273 12-1. Linux Segment Types 274 13-1. libc Definition 275 13-2. libc - RPC Function Interfaces 276 13-3. libc - System Calls Function Interfaces 277 13-4. libc - System Calls Deprecated Function Interfaces 278 13-5. libc - Standard I/O Function Interfaces 279 13-6. libc - Standard I/O Data Interfaces 280 13-7. libc - Signal Handling Function Interfaces 281 13-8. libc - Signal Handling Deprecated Function Interfaces 282 13-9. libc - Signal Handling Data Interfaces 283 13-10. libc - Localization Functions Function Interfaces 284 13-11. libc - Localization Functions Data Interfaces 285 13-12. libc - Posix Spawn Option Function Interfaces 286 13-13. libc - Posix Advisory Option Function Interfaces 287 13-14. libc - Socket Interface Function Interfaces 288 13-15. libc - Socket Interface Data Interfaces 289 13-16. libc - Wide Characters Function Interfaces 290 13-17. libc - String Functions Function Interfaces 291 13-18. libc - String Functions Deprecated Function Interfaces 292 13-19. libc - IPC Functions Function Interfaces 293 13-20. libc - Regular Expressions Function Interfaces 294 13-21. libc - Character Type Functions Function Interfaces 295 13-22. libc - Time Manipulation Function Interfaces 296 13-23. libc - Time Manipulation Data Interfaces 297 13-24. libc - Terminal Interface Functions Function Interfaces 298 13-25. libc - System Database Interface Function Interfaces 299 13-26. libc - System Database Interface Deprecated Function 300 Interfaces 301 302 13-27. libc - Language Support Function Interfaces 303 13-28. libc - Large File Support Function Interfaces 304 13-29. libc - Large File Support Deprecated Function Interfaces 305 13-30. libc - Standard Library Function Interfaces 306 13-31. libc - Standard Library Deprecated Function Interfaces 307 13-32. libc - Standard Library Data Interfaces 308 13-33. libm Definition 309 13-34. libm - Math Function Interfaces 310 13-35. libm - Math Deprecated Function Interfaces 311 13-36. libm - Math Data Interfaces 312 13-37. libpthread Definition 313 13-38. libpthread - Realtime Threads Function Interfaces 314 13-39. libpthread - Advanced Realtime Threads Function 315 Interfaces 316 317 13-40. libpthread - Posix Threads Function Interfaces 318 13-41. libpthread - Posix Threads Deprecated Function 319 Interfaces 320 321 13-42. libpthread - Thread aware versions of libc interfaces 322 Function Interfaces 323 324 13-43. libgcc_s Definition 325 13-44. libdl Definition 326 13-45. libdl - Dynamic Loader Function Interfaces 327 13-46. librt Definition 328 13-47. librt - Shared Memory Objects Function Interfaces 329 13-48. librt - Clock Function Interfaces 330 13-49. librt - Timers Function Interfaces 331 13-50. librt - Message Queues Function Interfaces 332 13-51. libcrypt Definition 333 13-52. libcrypt - Encryption Function Interfaces 334 13-53. libpam Definition 335 13-54. libpam - Pluggable Authentication API Function 336 Interfaces 337 338 14-1. libz Definition 339 14-2. libz - Compression Library Function Interfaces 340 14-3. libncurses Definition 341 14-4. libncurses - Curses Function Interfaces 342 14-5. libncurses - Curses Data Interfaces 343 14-6. libutil Definition 344 14-7. libutil - Utility Functions Function Interfaces 345 15-1. Commands And Utilities 346 15-2. Built In Utilities 347 15-1. Escape Sequences 348 21-1. Required User & Group Names 349 21-2. Optional User & Group Names 350 22-1. RPM File Format 351 22-2. Signature Format 352 22-3. Index Type values 353 22-4. Header Private Tag Values 354 22-5. Signature Tag Values 355 22-6. Signature Digest Tag Values 356 22-7. Signature Signing Tag Values 357 22-8. Package Info Tag Values 358 22-9. Installation Tag Values 359 22-10. File Info Tag Values 360 22-11. File Flags 361 22-12. Package Dependency Tag Values 362 22-13. Index Type values 363 22-14. Package Dependency Attributes 364 22-15. Other Tag Values 365 22-16. CPIO File Format 366 A-1. libc Function Interfaces 367 A-2. libc Data Interfaces 368 A-3. libcrypt Function Interfaces 369 A-4. libdl Function Interfaces 370 A-5. libm Function Interfaces 371 A-6. libm Data Interfaces 372 A-7. libncurses Function Interfaces 373 A-8. libncurses Data Interfaces 374 A-9. libpam Function Interfaces 375 A-10. libpthread Function Interfaces 376 A-11. librt Function Interfaces 377 A-12. libutil Function Interfaces 378 A-13. libz Function Interfaces 379 __________________________________________________________ 380 381 Foreword 382 383 This is version 3.2 of the Linux Standard Base Core 384 Specification. This specification is part of a family of 385 specifications under the general title "Linux Standard Base". 386 Developers of applications or implementations interested in 387 using the LSB trademark should see the Linux Foundation 388 Certification Policy for details. 389 __________________________________________________________ 390 391 Introduction 392 393 The LSB defines a binary interface for application programs 394 that are compiled and packaged for LSB-conforming 395 implementations on many different hardware architectures. Since 396 a binary specification shall include information specific to 397 the computer processor architecture for which it is intended, 398 it is not possible for a single document to specify the 399 interface for all possible LSB-conforming implementations. 400 Therefore, the LSB is a family of specifications, rather than a 401 single one. 402 403 This document should be used in conjunction with the documents 404 it references. This document enumerates the system components 405 it includes, but descriptions of those components may be 406 included entirely or partly in this document, partly in other 407 documents, or entirely in other reference documents. For 408 example, the section that describes system service routines 409 includes a list of the system routines supported in this 410 interface, formal declarations of the data structures they use 411 that are visible to applications, and a pointer to the 412 underlying referenced specification for information about the 413 syntax and semantics of each call. Only those routines not 414 described in standards referenced by this document, or 415 extensions to those standards, are described in the detail. 416 Information referenced in this way is as much a part of this 417 document as is the information explicitly included here. 418 419 The specification carries a version number of either the form 420 x.y or x.y.z. This version number carries the following 421 meaning: 422 423 * The first number (x) is the major version number. All 424 versions with the same major version number should share 425 binary compatibility. Any addition or deletion of a new 426 library results in a new version number. Interfaces marked 427 as deprecated may be removed from the specification at a 428 major version change. 429 * The second number (y) is the minor version number. 430 Individual interfaces may be added if all certified 431 implementations already had that (previously undocumented) 432 interface. Interfaces may be marked as deprecated at a 433 minor version change. Other minor changes may be permitted 434 at the discretion of the LSB workgroup. 435 * The third number (z), if present, is the editorial level. 436 Only editorial changes should be included in such versions. 437 438 Since this specification is a descriptive Application Binary 439 Interface, and not a source level API specification, it is not 440 possible to make a guarantee of 100% backward compatibility 441 between major releases. However, it is the intent that those 442 parts of the binary interface that are visible in the source 443 level API will remain backward compatible from version to 444 version, except where a feature marked as "Deprecated" in one 445 release may be removed from a future release. 446 447 Implementors are strongly encouraged to make use of symbol 448 versioning to permit simultaneous support of applications 449 conforming to different releases of this specification. 450 451 I. Introductory Elements 452 453 Table of Contents 454 1. Scope 455 456 1.1. General 457 1.2. Module Specific Scope 458 459 2. References 460 461 2.1. Normative References 462 2.2. Informative References/Bibliography 463 464 3. Requirements 465 466 3.1. Relevant Libraries 467 3.2. LSB Implementation Conformance 468 3.3. LSB Application Conformance 469 470 4. Definitions 471 5. Terminology 472 6. Documentation Conventions 473 7. Relationship To ISO/IEC 9945 POSIX 474 8. Relationship To Other Linux Foundation Specifications 475 __________________________________________________________ 476 477 Chapter 1. Scope 478 479 1.1. General 480 481 The Linux Standard Base (LSB) defines a system interface for 482 compiled applications and a minimal environment for support of 483 installation scripts. Its purpose is to enable a uniform 484 industry standard environment for high-volume applications 485 conforming to the LSB. 486 487 These specifications are composed of two basic parts: A common 488 specification ("LSB-generic" or "generic LSB"), ISO/IEC 23360 489 Part 1, describing those parts of the interface that remain 490 constant across all implementations of the LSB, and an 491 architecture-specific part ("LSB-arch" or "archLSB") describing 492 the parts of the interface that vary by processor architecture. 493 Together, the LSB-generic and the relevant 494 architecture-specific part of ISO/IEC 23360 for a single 495 hardware architecture provide a complete interface 496 specification for compiled application programs on systems that 497 share a common hardware architecture. 498 499 ISO/IEC 23360 Part 1, the LSB-generic document, should be used 500 in conjunction with an architecture-specific part. Whenever a 501 section of the LSB-generic specification is supplemented by 502 architecture-specific information, the LSB-generic document 503 includes a reference to the architecture part. 504 Architecture-specific parts of ISO/IEC 23360 may also contain 505 additional information that is not referenced in the 506 LSB-generic document. 507 508 The LSB contains both a set of Application Program Interfaces 509 (APIs) and Application Binary Interfaces (ABIs). APIs may 510 appear in the source code of portable applications, while the 511 compiled binary of that application may use the larger set of 512 ABIs. A conforming implementation provides all of the ABIs 513 listed here. The compilation system may replace (e.g. by macro 514 definition) certain APIs with calls to one or more of the 515 underlying binary interfaces, and may insert calls to binary 516 interfaces as needed. 517 518 The LSB is primarily a binary interface definition. Not all of 519 the source level APIs available to applications may be 520 contained in this specification. 521 __________________________________________________________ 522 523 1.2. Module Specific Scope 524 525 This is the Core module of the Linux Standard Base (LSB), 526 ISO/IEC 23360 Part 1. This module provides the fundamental 527 system interfaces, libraries, and runtime environment upon 528 which all conforming applications and libraries depend. 529 530 Interfaces described in this part of ISO/IEC 23360 are 531 mandatory except where explicitly listed otherwise. Core 532 interfaces may be supplemented by other modules; all modules 533 are built upon the core. 534 __________________________________________________________ 535 536 Chapter 2. References 537 538 2.1. Normative References 539 540 The following referenced documents are indispensable for the 541 application of this document. For dated references, only the 542 edition cited applies. For undated references, the latest 543 edition of the referenced document (including any amendments) 544 applies. 545 546 Note: Where copies of a document are available on the World 547 Wide Web, a Uniform Resource Locator (URL) is given for 548 informative purposes only. This may point to a more recent 549 copy of the referenced specification, or may be out of date. 550 Reference copies of specifications at the revision level 551 indicated may be found at the Linux Foundation's Reference 552 Specifications site. 553 554 Table 2-1. Normative References 555 Name Title URL 556 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 557 (FHS) 2.3 http://www.pathname.com/fhs/ 558 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 559 ISO POSIX (2003) 560 561 ISO/IEC 9945-1:2003 Information technology -- Portable 562 Operating System Interface (POSIX) -- Part 1: Base Definitions 563 564 ISO/IEC 9945-2:2003 Information technology -- Portable 565 Operating System Interface (POSIX) -- Part 2: System Interfaces 566 567 ISO/IEC 9945-3:2003 Information technology -- Portable 568 Operating System Interface (POSIX) -- Part 3: Shell and 569 Utilities 570 571 ISO/IEC 9945-4:2003 Information technology -- Portable 572 Operating System Interface (POSIX) -- Part 4: Rationale 573 574 Including Technical Cor. 1: 2004 575 http://www.unix.org/version3/ 576 Itanium(TM) C++ ABI Itanium(TM) C++ ABI (Revision 1.83) 577 http://refspecs.linux-foundation.org/cxxabi-1.83.html 578 Large File Support Large File Support 579 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 580 SUSv2 CAE Specification, January 1997, System Interfaces and 581 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 582 http://www.opengroup.org/publications/catalog/un.htm 583 SVID Issue 3 American Telephone and Telegraph Company, System V 584 Interface Definition, Issue 3; Morristown, NJ, UNIX Press, 585 1989. (ISBN 0201566524) 586 SVID Issue 4 System V Interface Definition, Fourth Edition 587 System V ABI System V Application Binary Interface, Edition 4.1 588 http://www.caldera.com/developers/devspecs/gabi41.pdf 589 System V ABI Update System V Application Binary Interface - 590 DRAFT - 17 December 2003 591 http://www.caldera.com/developers/gabi/2003-12-17/contents.html 592 X/Open Curses CAE Specification, May 1996, X/Open Curses, Issue 593 4, Version 2 (ISBN: 1-85912-171-3, C610), plus Corrigendum U018 594 http://www.opengroup.org/publications/catalog/un.htm 595 __________________________________________________________ 596 597 2.2. Informative References/Bibliography 598 599 In addition, the specifications listed below provide essential 600 background information to implementors of this specification. 601 These references are included for information only. 602 603 Table 2-2. Other References 604 Name Title URL 605 DWARF Debugging Information Format, Revision 2.0.0 DWARF 606 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 607 http://refspecs.linux-foundation.org/dwarf/dwarf-2.0.0.pdf 608 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 609 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 610 http://refspecs.linux-foundation.org/dwarf 611 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 612 floating-point arithmetic for microprocessor systems 613 http://www.ieee.org/ 614 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 615 Specification method for cultural conventions 616 ITU-T V.42 International Telecommunication Union Recommendation 617 V.42 (2002): Error-correcting procedures for DCEs using 618 asynchronous-to-synchronous conversionITUV 619 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&p 620 arent=T-REC-V.42 621 Li18nux Globalization Specification LI18NUX 2000 Globalization 622 Specification, Version 1.0 with Amendment 4 623 http://www.openi18n.org/docs/html/LI18NUX-2000-amd4.htm 624 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 625 http://www.lanana.org/docs/device-list/devices.txt 626 PAM Open Software Foundation, Request For Comments: 86.0 , 627 October 1995, V. Samar & R.Schemers (SunSoft) 628 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 629 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 630 MD5 Message-Digest Algorithm 631 http://www.ietf.org/rfc/rfc1321.txt 632 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 633 http://www.ietf.org/ 634 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 635 1833: Binding Protocols for ONC RPC Version 2 636 http://www.ietf.org/rfc/rfc1833.txt 637 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 638 1950: ZLIB Compressed Data Format Specification 639 http://www.ietf.org/rfc/rfc1950.txt 640 RFC 1951: DEFLATE Compressed Data Format Specification IETF RFC 641 1951: DEFLATE Compressed Data Format Specification version 1.3 642 http://www.ietf.org/rfc/rfc1951.txt 643 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 644 file format specification version 4.3 645 http://www.ietf.org/rfc/rfc1952.txt 646 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP Message 647 Format http://www.ietf.org/rfc/rfc2440.txt 648 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 649 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 650 RFC 2822:Internet Message Format IETF RFC 2822: Internet 651 Message Format http://www.ietf.org/rfc/rfc2822.txt 652 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 653 Specification http://www.ietf.org/rfc/rfc791.txt 654 RPM Package Format RPM Package Format V3.0 655 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.h 656 tml 657 SUSv2 Commands and Utilities The Single UNIX Specification(SUS) 658 Version 2, Commands and Utilities (XCU), Issue 5 (ISBN: 659 1-85912-191-8, C604) 660 http://www.opengroup.org/publications/catalog/un.htm 661 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 662 __________________________________________________________ 663 664 Chapter 3. Requirements 665 666 3.1. Relevant Libraries 667 668 The libraries listed in Table 3-1 shall be available on a Linux 669 Standard Base system, with the specified runtime names. The 670 libraries listed in Table 3-2 are architecture specific, but 671 shall be available on all LSB conforming systems. This list may 672 be supplemented or amended by the relevant architecture 673 specific part of ISO/IEC 23360. 674 675 Table 3-1. Standard Library Names 676 Library Runtime Name 677 libdl libdl.so.2 678 libcrypt libcrypt.so.1 679 libz libz.so.1 680 libncurses libncurses.so.5 681 libutil libutil.so.1 682 libpthread libpthread.so.0 683 librt librt.so.1 684 libpam libpam.so.0 685 libgcc_s libgcc_s.so.1 686 687 Table 3-2. Standard Library Names defined in the Architecture 688 Specific Parts of ISO/IEC 23360 689 Library Runtime Name 690 libm See archLSB 691 libc See archLSB 692 proginterp See archLSB 693 694 These libraries will be in an implementation-defined directory 695 which the dynamic linker shall search by default. 696 __________________________________________________________ 697 698 3.2. LSB Implementation Conformance 699 700 A conforming implementation is necessarily architecture 701 specific, and must provide the interfaces specified by both the 702 generic LSB Core specification (ISO/IEC 23360 Part 1) and the 703 relevant architecture specific part of ISO/IEC 23360. 704 705 Rationale: An implementation must provide at least the 706 interfaces specified in these specifications. It may also 707 provide additional interfaces. 708 709 A conforming implementation shall satisfy the following 710 requirements: 711 712 * A processor architecture represents a family of related 713 processors which may not have identical feature sets. The 714 architecture specific parts of ISO/IEC 23360 that 715 supplement this specification for a given target processor 716 architecture describe a minimum acceptable processor. The 717 implementation shall provide all features of this 718 processor, whether in hardware or through emulation 719 transparent to the application. 720 * The implementation shall be capable of executing compiled 721 applications having the format and using the system 722 interfaces described in this document. 723 * The implementation shall provide libraries containing the 724 interfaces specified by this document, and shall provide a 725 dynamic linking mechanism that allows these interfaces to 726 be attached to applications at runtime. All the interfaces 727 shall behave as specified in this document. 728 * The map of virtual memory provided by the implementation 729 shall conform to the requirements of this document. 730 * The implementation's low-level behavior with respect to 731 function call linkage, system traps, signals, and other 732 such activities shall conform to the formats described in 733 this document. 734 * The implementation shall provide all of the mandatory 735 interfaces in their entirety. 736 * The implementation may provide one or more of the optional 737 interfaces. Each optional interface that is provided shall 738 be provided in its entirety. The product documentation 739 shall state which optional interfaces are provided. 740 * The implementation shall provide all files and utilities 741 specified as part of this document in the format defined 742 here and in other referenced documents. All commands and 743 utilities shall behave as required by this document. The 744 implementation shall also provide all mandatory components 745 of an application's runtime environment that are included 746 or referenced in this document. 747 * The implementation, when provided with standard data 748 formats and values at a named interface, shall provide the 749 behavior defined for those values and data formats at that 750 interface. However, a conforming implementation may consist 751 of components which are separately packaged and/or sold. 752 For example, a vendor of a conforming implementation might 753 sell the hardware, operating system, and windowing system 754 as separately packaged items. 755 * The implementation may provide additional interfaces with 756 different names. It may also provide additional behavior 757 corresponding to data values outside the standard ranges, 758 for standard named interfaces. 759 __________________________________________________________ 760 761 3.3. LSB Application Conformance 762 763 A conforming application is necessarily architecture specific, 764 and must conform to both the generic LSB Core specification 765 (ISO/IEC 23360 Part 1)and the relevant architecture specific 766 part of ISO/IEC 23360. 767 768 A conforming application shall satisfy the following 769 requirements: 770 771 * Its executable files shall be either shell scripts or 772 object files in the format defined for the Object File 773 Format system interface. 774 * Its object files shall participate in dynamic linking as 775 defined in the Program Loading and Linking System 776 interface. 777 * It shall employ only the instructions, traps, and other 778 low-level facilities defined in the Low-Level System 779 interface as being for use by applications. 780 * If it requires any optional interface defined in this 781 document in order to be installed or to execute 782 successfully, the requirement for that optional interface 783 shall be stated in the application's documentation. 784 * It shall not use any interface or data format that is not 785 required to be provided by a conforming implementation, 786 unless: 787 + If such an interface or data format is supplied by 788 another application through direct invocation of that 789 application during execution, that application shall 790 be in turn an LSB conforming application. 791 + The use of that interface or data format, as well as 792 its source, shall be identified in the documentation 793 of the application. 794 * It shall not use any values for a named interface that are 795 reserved for vendor extensions. 796 797 A strictly conforming application shall not require or use any 798 interface, facility, or implementation-defined extension that 799 is not defined in this document in order to be installed or to 800 execute successfully. 801 __________________________________________________________ 802 803 Chapter 4. Definitions 804 805 For the purposes of this document, the following definitions, 806 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 807 Edition, apply: 808 809 can 810 811 be able to; there is a possibility of; it is possible to 812 cannot 813 814 be unable to; there is no possibilty of; it is not possible to 815 may 816 817 is permitted; is allowed; is permissible 818 need not 819 820 it is not required that; no...is required 821 shall 822 823 is to; is required to; it is required that; has to; only...is 824 permitted; it is necessary 825 shall not 826 827 is not allowed [permitted] [acceptable] [permissible]; is 828 required to be not; is required that...be not; is not to be 829 should 830 831 it is recommended that; ought to 832 should not 833 834 it is not recommended that; ought not to 835 __________________________________________________________ 836 837 Chapter 5. Terminology 838 839 For the purposes of this document, the following terms apply: 840 841 archLSB 842 The architectural part of the LSB Specification which 843 describes the specific parts of the interface that are 844 platform specific. The archLSB is complementary to the 845 gLSB. 846 847 Binary Standard 848 The total set of interfaces that are available to be 849 used in the compiled binary code of a conforming 850 application. 851 852 gLSB 853 The common part of the LSB Specification that describes 854 those parts of the interface that remain constant across 855 all hardware implementations of the LSB. 856 857 implementation-defined 858 Describes a value or behavior that is not defined by 859 this document but is selected by an implementor. The 860 value or behavior may vary among implementations that 861 conform to this document. An application should not rely 862 on the existence of the value or behavior. An 863 application that relies on such a value or behavior 864 cannot be assured to be portable across conforming 865 implementations. The implementor shall document such a 866 value or behavior so that it can be used correctly by an 867 application. 868 869 Shell Script 870 A file that is read by an interpreter (e.g., awk). The 871 first line of the shell script includes a reference to 872 its interpreter binary. 873 874 Source Standard 875 The set of interfaces that are available to be used in 876 the source code of a conforming application. 877 878 undefined 879 Describes the nature of a value or behavior not defined 880 by this document which results from use of an invalid 881 program construct or invalid data input. The value or 882 behavior may vary among implementations that conform to 883 this document. An application should not rely on the 884 existence or validity of the value or behavior. An 885 application that relies on any particular value or 886 behavior cannot be assured to be portable across 887 conforming implementations. 888 889 unspecified 890 Describes the nature of a value or behavior not 891 specified by this document which results from use of a 892 valid program construct or valid data input. The value 893 or behavior may vary among implementations that conform 894 to this document. An application should not rely on the 895 existence or validity of the value or behavior. An 896 application that relies on any particular value or 897 behavior cannot be assured to be portable across 898 conforming implementations. 899 900 Other terms and definitions used in this document shall have 901 the same meaning as defined in Chapter 3 of the Base 902 Definitions volume of ISO POSIX (2003). 903 __________________________________________________________ 904 905 Chapter 6. Documentation Conventions 906 907 Throughout this document, the following typographic conventions 908 are used: 909 910 function() 911 912 the name of a function 913 command 914 915 the name of a command or utility 916 CONSTANT 917 918 a constant value 919 parameter 920 921 a parameter 922 variable 923 924 a variable 925 926 Throughout this specification, several tables of interfaces are 927 presented. Each entry in these tables has the following format: 928 929 name 930 931 the name of the interface 932 (symver) 933 934 An optional symbol version identifier, if required. 935 [refno] 936 937 A reference number indexing the table of referenced 938 specifications that follows this table. 939 940 For example, 941 942 forkpty(GLIBC_2.0) [SUSv3] 943 944 refers to the interface named forkpty() with symbol version 945 GLIBC_2.0 that is defined in the SUSv3 reference. 946 947 Note: Symbol versions are defined in the architecture 948 specific parts of ISO/IEC 23360 only. 949 __________________________________________________________ 950 951 Chapter 7. Relationship To ISO/IEC 9945 POSIX 952 953 This specification includes many interfaces described in ISO 954 POSIX (2003). Unless otherwise specified, such interfaces 955 should behave exactly as described in that specification. Any 956 conflict between the requirements described here and the ISO 957 POSIX (2003) standard is unintentional, except as explicitly 958 noted otherwise. 959 960 Note: In addition to the differences noted inline in this 961 specification, PDTR 24715 has extracted the differences 962 between this specification and ISO POSIX (2003) into a 963 single place. It is the long term plan of the Linux 964 Foundation to converge the LSB Core Specification with 965 ISO/IEC 9945 POSIX. 966 967 The LSB Specification Authority is responsible for deciding the 968 meaning of conformance to normative referenced standards in the 969 LSB context. Problem Reports regarding underlying or referenced 970 standards in any other context will be referred to the relevant 971 maintenance body for that standard. 972 __________________________________________________________ 973 974 Chapter 8. Relationship To Other Linux Foundation Specifications 975 976 The LSB is the base for several other specification projects 977 under the umbrella of the Linux Foundation (LF). This 978 specification is the foundation, and other specifications build 979 on the interfaces defined here. However, beyond those 980 specifications listed as Normative References, this 981 specification has no dependencies on other LF projects. 982 983 II. Executable And Linking Format (ELF) 984 985 Table of Contents 986 9. Introduction 987 10. Low Level System Information 988 989 10.1. Operating System Interface 990 10.2. Machine Interface 991 992 10.2.1. Data Representation 993 994 11. Object Format 995 996 11.1. Object Files 997 11.2. Sections 998 999 11.2.1. Introduction 1000 11.2.2. Sections Types 1001 1002 11.3. Special Sections 1003 1004 11.3.1. Special Sections 1005 1006 11.4. Symbol Mapping 1007 1008 11.4.1. Introduction 1009 1010 11.5. DWARF Extensions 1011 1012 11.5.1. DWARF Exception Header Encoding 1013 11.5.2. DWARF CFI Extensions 1014 1015 11.6. Exception Frames 1016 1017 11.6.1. The .eh_frame section 1018 11.6.2. The .eh_frame_hdr section 1019 1020 11.7. Symbol Versioning 1021 1022 11.7.1. Introduction 1023 11.7.2. Symbol Version Table 1024 11.7.3. Version Definitions 1025 11.7.4. Version Requirements 1026 11.7.5. Startup Sequence 1027 11.7.6. Symbol Resolution 1028 1029 11.8. ABI note tag 1030 1031 12. Dynamic Linking 1032 1033 12.1. Program Loading and Dynamic Linking 1034 12.2. Program Header 1035 12.3. Dynamic Entries 1036 1037 12.3.1. Introduction 1038 12.3.2. Dynamic Entries 1039 __________________________________________________________ 1040 1041 Chapter 9. Introduction 1042 1043 Executable and Linking Format (ELF) defines the object format 1044 for compiled applications. This specification supplements the 1045 information found in System V ABI Update and is intended to 1046 document additions made since the publication of that document. 1047 __________________________________________________________ 1048 1049 Chapter 10. Low Level System Information 1050 1051 10.1. Operating System Interface 1052 1053 LSB-conforming applications shall assume that stack, heap and 1054 other allocated memory regions will be non-executable. The 1055 application must take steps to make them executable if needed. 1056 __________________________________________________________ 1057 1058 10.2. Machine Interface 1059 1060 10.2.1. Data Representation 1061 1062 LSB-conforming applications shall use the data representation 1063 as defined in the Arcitecture specific ELF documents. 1064 __________________________________________________________ 1065 1066 10.2.1.1. Fundamental Types 1067 1068 In addition to the fundamental types specified in the relevant 1069 architecture specific part of ISO/IEC 23360, a 1 byte data type 1070 is defined here. 1071 1072 Table 10-1. Scalar Types 1073 Type C C++ sizeof Alignment (bytes) Architecture Representation 1074 Integral _Bool bool 1 1 byte 1075 __________________________________________________________ 1076 1077 Chapter 11. Object Format 1078 1079 11.1. Object Files 1080 1081 LSB-conforming implementations shall support the object file 1082 Executable and Linking Format (ELF), which is defined by the 1083 following documents: 1084 1085 * System V ABI 1086 * System V ABI Update 1087 * this specification 1088 * the relevant architecture specific part of ISO/IEC 23360 1089 1090 Conforming implementations may also support other unspecified 1091 object file formats. 1092 __________________________________________________________ 1093 1094 11.2. Sections 1095 1096 11.2.1. Introduction 1097 1098 As described in System V ABI, an ELF object file contains a 1099 number of sections. 1100 __________________________________________________________ 1101 1102 11.2.2. Sections Types 1103 1104 The section header table is an array of Elf32_Shdr or 1105 Elf64_Shdr structures as described in System V ABI. The sh_type 1106 member shall be either a value from Table 11-1, drawn from the 1107 System V ABI, or one of the additional values specified in 1108 Table 11-2. 1109 1110 A section header's sh_type member specifies the sections's 1111 semantics. 1112 __________________________________________________________ 1113 1114 11.2.2.1. ELF Section Types 1115 1116 The following section types are defined in the System V ABI and 1117 the System V ABI Update. 1118 1119 Table 11-1. ELF Section Types 1120 Name Value Description 1121 SHT_DYNAMIC 0x6 The section holds information for dynamic 1122 linking. Currently, an object file shall have only one dynamic 1123 section, but this restriction may be relaxed in the future. See 1124 `Dynamic Section' in Chapter 5 of System V ABI Update for 1125 details. 1126 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1127 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1128 an object file may have either a section of SHT_SYMTAB type or 1129 a section of SHT_DYNSYM type, but not both. This restriction 1130 may be relaxed in the future. 1131 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1132 to termination functions, as described in `Initialization and 1133 Termination Functions' in Chapter 5 of System V ABI Update. 1134 Each pointer in the array is taken as a parameterless procedure 1135 with a void return. 1136 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1137 an object file shall have only one hash table, but this 1138 restriction may be relaxed in the future. See `Hash Table' in 1139 Chapter 5 of System V ABI Update for details. 1140 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1141 to initialization functions, as described in `Initialization 1142 and Termination Functions' in Chapter 5 of System V ABI Update. 1143 Each pointer in the array is taken as a parameterless procedure 1144 with a void return. 1145 SHT_NOBITS 0x8 A section of this type occupies no space in the 1146 file but otherwise resembles SHT_PROGBITS. Although this 1147 section contains no bytes, the sh_offset member contains the 1148 conceptual file offset. 1149 SHT_NOTE 0x7 The section holds information that marks the file 1150 in some way. See `Note Section' in Chapter 5 of System V ABI 1151 Update for details. 1152 SHT_NULL 0x0 This value marks the section header as inactive; 1153 it does not have an associated section. Other members of the 1154 section header have undefined values. 1155 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1156 pointers to functions that are invoked before all other 1157 initialization functions, as described in `Initialization and 1158 Termination Functions' in Chapter 5 of System V ABI Update. 1159 Each pointer in the array is taken as a parameterless proceure 1160 with a void return. 1161 SHT_PROGBITS 0x1 The section holds information defined by the 1162 program, whose format and meaning are determined solely by the 1163 program. 1164 SHT_REL 0x9 The section holds relocation entries without 1165 explicit addends, such as type Elf32_Rel for the 32-bit class 1166 of object files or type Elf64_Rel for the 64-bit class of 1167 object files. An object file may have multiple relocation 1168 sections. See `Relocation' in Chapter 4 of System V ABI Update 1169 for details. 1170 SHT_RELA 0x4 The section holds relocation entries with explicit 1171 addends, such as type Elf32_Rela for the 32-bit class of object 1172 files or type Elf64_Rela for the 64-bit class of object files. 1173 An object file may have multiple relocation sections. See 1174 `Relocation' in Chapter 4 of System V ABI Update for details. 1175 SHT_STRTAB 0x3 The section holds a string table. An object file 1176 may have multiple string table sections. See `String Table' in 1177 Chapter 4 of System V ABI Update for details. 1178 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, an 1179 object file may have either a section of SHT_SYMTAB type or a 1180 section of SHT_DYNSYM type, but not both. This restriction may 1181 be relaxed in the future. Typically, SHT_SYMTAB provides 1182 symbols for link editing, though it may also be used for 1183 dynamic linking. As a complete symbol table, it may contain 1184 many symbols unnecessary for dynamic linking. 1185 __________________________________________________________ 1186 1187 11.2.2.2. Additional Section Types 1188 1189 The following additional section types are defined here. 1190 1191 Table 11-2. Additional Section Types 1192 Name Value Description 1193 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1194 versions that are provided. 1195 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1196 versions that are required. 1197 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1198 Version Table. 1199 __________________________________________________________ 1200 1201 11.3. Special Sections 1202 1203 11.3.1. Special Sections 1204 1205 Various sections hold program and control information. Sections 1206 in the lists below are used by the system and have the 1207 indicated types and attributes. 1208 __________________________________________________________ 1209 1210 11.3.1.1. ELF Special Sections 1211 1212 The following sections are defined in the System V ABI and the 1213 System V ABI Update. 1214 1215 Table 11-3. ELF Special Sections 1216 Name Type Attributes 1217 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1218 .comment SHT_PROGBITS 0 1219 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1220 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1221 .debug SHT_PROGBITS 0 1222 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1223 .dynstr SHT_STRTAB SHF_ALLOC 1224 .dynsym SHT_DYNSYM SHF_ALLOC 1225 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1226 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1227 .hash SHT_HASH SHF_ALLOC 1228 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1229 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1230 .interp SHT_PROGBITS SHF_ALLOC 1231 .line SHT_PROGBITS 0 1232 .note SHT_NOTE 0 1233 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1234 .rodata SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1235 .rodata1 SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1236 .shstrtab SHT_STRTAB 0 1237 .strtab SHT_STRTAB SHF_ALLOC 1238 .symtab SHT_SYMTAB SHF_ALLOC 1239 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1240 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1241 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1242 1243 .bss 1244 1245 This section holds data that contributes to the program's 1246 memory image. The program may treat this data as uninitialized. 1247 However, the system shall initialize this data with zeroes when 1248 the program begins to run. The section occupies no file space, 1249 as indicated by the section type, SHT_NOBITS. 1250 .comment 1251 1252 This section holds version control information. 1253 .data 1254 1255 This section holds initialized data that contribute to the 1256 program's memory image. 1257 .data1 1258 1259 This section holds initialized data that contribute to the 1260 program's memory image. 1261 .debug 1262 1263 This section holds information for symbolic debugging. The 1264 contents are unspecified. All section names with the prefix 1265 .debug hold information for symbolic debugging. The contents of 1266 these sections are unspecified. 1267 .dynamic 1268 1269 This section holds dynamic linking information. The section's 1270 attributes will include the SHF_ALLOC bit. Whether the 1271 SHF_WRITE bit is set is processor specific. See Chapter 5 of 1272 System V ABI Update for more information. 1273 .dynstr 1274 1275 This section holds strings needed for dynamic linking, most 1276 commonly the strings that represent the names associated with 1277 symbol table entries. See Chapter 5 of System V ABI Update for 1278 more information. 1279 .dynsym 1280 1281 This section holds the dynamic linking symbol table, as 1282 described in `Symbol Table' of System V ABI Update. 1283 .fini 1284 1285 This section holds executable instructions that contribute to 1286 the process termination code. That is, when a program exits 1287 normally, the system arranges to execute the code in this 1288 section. 1289 .fini_array 1290 1291 This section holds an array of function pointers that 1292 contributes to a single termination array for the executable or 1293 shared object containing the section. 1294 .hash 1295 1296 This section holds a symbol hash table. See `Hash Table' in 1297 Chapter 5 of System V ABI Update for more information. 1298 .init 1299 1300 This section holds executable instructions that contribute to 1301 the process initialization code. When a program starts to run, 1302 the system arranges to execute the code in this section before 1303 calling the main program entry point (called main for C 1304 programs). 1305 .init_array 1306 1307 This section holds an array of function pointers that 1308 contributes to a single initialization array for the executable 1309 or shared object containing the section. 1310 .interp 1311 1312 This section holds the path name of a program interpreter. If 1313 the file has a loadable segment that includes relocation, the 1314 sections' attributes will include the SHF_ALLOC bit; otherwise, 1315 that bit will be off. See Chapter 5 of System V ABI Update for 1316 more information. 1317 .line 1318 1319 This section holds line number information for symbolic 1320 debugging, which describes the correspondence between the 1321 source program and the machine code. The contents are 1322 unspecified. 1323 .note 1324 1325 This section holds information in the format that `Note 1326 Section' in Chapter 5 of System V ABI Update describes. 1327 .preinit_array 1328 1329 This section holds an array of function pointers that 1330 contributes to a single pre-initialization array for the 1331 executable or shared object containing the section. 1332 .rodata 1333 1334 This section holds read-only data that typically contribute to 1335 a non-writable segment in the process image. See `Program 1336 Header' in Chapter 5 of System V ABI Update for more 1337 information. 1338 .rodata1 1339 1340 This section holds read-only data that typically contribute to 1341 a non-writable segment in the process image. See `Program 1342 Header' in Chapter 5 of System V ABI Update for more 1343 information. 1344 .shstrtab 1345 1346 This section holds section names. 1347 .strtab 1348 1349 This section holds strings, most commonly the strings that 1350 represent the names associated with symbol table entries. If 1351 the file has a loadable segment that includes the symbol string 1352 table, the section's attributes will include the SHF_ALLOC bit; 1353 otherwise, that bit will be off. 1354 .symtab 1355 1356 This section holds a symbol table, as `Symbol Table' in Chapter 1357 4 of System V ABI Update describes. If the file has a loadable 1358 segment that includes the symbol table, the section's 1359 attributes will include the SHF_ALLOC bit; otherwise, that bit 1360 will be off. 1361 .tbss 1362 1363 This section holds uninitialized thread-local data that 1364 contribute to the program's memory image. By definition, the 1365 system initializes the data with zeros when the data is 1366 instantiated for each new execution flow. The section occupies 1367 no file space, as indicated by the section type, SHT_NOBITS. 1368 Implementations need not support thread-local storage. 1369 .tdata 1370 1371 This section holds initialized thread-local data that 1372 contributes to the program's memory image. A copy of its 1373 contents is instantiated by the system for each new execution 1374 flow. Implementations need not support thread-local storage. 1375 .text 1376 1377 This section holds the `text', or executable instructions, of a 1378 program. 1379 __________________________________________________________ 1380 1381 11.3.1.2. Additional Special Sections 1382 1383 Object files in an LSB conforming application may also contain 1384 one or more of the additional special sections described below. 1385 1386 Table 11-4. Additional Special Sections 1387 Name Type Attributes 1388 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1389 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1390 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1391 .eh_frame SHT_PROGBITS SHF_ALLOC 1392 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1393 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1394 .gnu.version SHT_GNU_versym SHF_ALLOC 1395 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1396 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1397 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1398 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1399 .note.ABI-tag SHT_NOTE SHF_ALLOC 1400 .stab SHT_PROGBITS 0 1401 .stabstr SHT_STRTAB 0 1402 1403 .ctors 1404 1405 This section contains a list of global constructor function 1406 pointers. 1407 .data.rel.ro 1408 1409 This section holds initialized data that contribute to the 1410 program's memory image. This section may be made read-only 1411 after relocations have been applied. 1412 .dtors 1413 1414 This section contains a list of global destructor function 1415 pointers. 1416 .eh_frame 1417 1418 This section contains information necessary for frame unwinding 1419 during exception handling. See Section 11.6.1. 1420 .eh_frame_hdr 1421 1422 This section contains a pointer to the .eh_frame section which 1423 is accessible to the runtime support code of a C++ application. 1424 This section may also contain a binary search table which may 1425 be used by the runtime support code to more efficiently access 1426 records in the .eh_frame section. See Section 11.6.2. 1427 .gcc_except_table 1428 1429 This section holds Language Specific Data. 1430 .gnu.version 1431 1432 This section contains the Symbol Version Table. See Section 1433 11.7.2. 1434 .gnu.version_d 1435 1436 This section contains the Version Definitions. See Section 1437 11.7.3. 1438 .gnu.version_r 1439 1440 This section contains the Version Requirements. See Section 1441 11.7.4. 1442 .got.plt 1443 1444 This section holds the read-only portion of the GLobal Offset 1445 Table. This section may be made read-only after relocations 1446 have been applied. 1447 .jcr 1448 1449 This section contains information necessary for registering 1450 compiled Java classes. The contents are compiler-specific and 1451 used by compiler initialization functions. 1452 .note.ABI-tag 1453 1454 Specify ABI details. See Section 11.8. 1455 .stab 1456 1457 This section contains debugging information. The contents are 1458 not specified as part of the LSB. 1459 .stabstr 1460 1461 This section contains strings associated with the debugging 1462 infomation contained in the .stab section. 1463 __________________________________________________________ 1464 1465 11.4. Symbol Mapping 1466 1467 11.4.1. Introduction 1468 1469 Symbols in a source program are translated by the compilation 1470 system into symbols that exist in the object file. 1471 __________________________________________________________ 1472 1473 11.4.1.1. C Language 1474 1475 External C symbols shall be unchanged in an object file's 1476 symbol table. 1477 __________________________________________________________ 1478 1479 11.5. DWARF Extensions 1480 1481 The LSB does not specify debugging information, however, some 1482 additional sections contain information which is encoded using 1483 the the encoding as specified by DWARF Debugging Information 1484 Format, Revision 2.0.0 with extensions defined here. 1485 1486 Note: The extensions specified here also exist in DWARF 1487 Debugging Information Format, Revision 3.0.0 (Draft). It is 1488 expected that future versions of the LSB will reference the 1489 final version of that document, and that the definitions 1490 here will be taken from that document instead of being 1491 specified here. 1492 __________________________________________________________ 1493 1494 11.5.1. DWARF Exception Header Encoding 1495 1496 The DWARF Exception Header Encoding is used to describe the 1497 type of data used in the .eh_frame and .eh_frame_hdr section. 1498 The upper 4 bits indicate how the value is to be applied. The 1499 lower 4 bits indicate the format of the data. 1500 1501 Table 11-5. DWARF Exception Header value format 1502 Name Value Meaning 1503 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1504 is determined by the architecture. 1505 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1506 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1507 Information Format, Revision 2.0.0. 1508 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1509 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1510 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1511 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1512 Endian Base 128 (LEB128) as defined by DWARF Debugging 1513 Information Format, Revision 2.0.0. 1514 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1515 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1516 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1517 1518 Table 11-6. DWARF Exception Header application 1519 Name Value Meaning 1520 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1521 counter. 1522 DW_EH_PE_textrel 0x20 Value is relative to the beginning of the 1523 .text section. 1524 DW_EH_PE_datarel 0x30 Value is relative to the beginning of the 1525 .got or .eh_frame_hdr section. 1526 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of the 1527 function. 1528 DW_EH_PE_aligned 0x50 Value is aligned to an address unit sized 1529 boundary. 1530 1531 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1532 indicate that no value ispresent. 1533 __________________________________________________________ 1534 1535 11.5.2. DWARF CFI Extensions 1536 1537 In addition to the Call Frame Instructions defined in section 1538 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1539 the following additional Call Frame Instructions may also be 1540 used. 1541 1542 Table 11-7. Additional DWARF Call Frame Instructions 1543 Name Value Meaning 1544 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1545 two operands: an unsigned LEB128 value representing a register 1546 number, and a DW_FORM_block value representing a DWARF 1547 expression. The required action is to establish the DWARF 1548 expression as the means by which the address in which the given 1549 register contents are found may be computed. The value of the 1550 CFA is pushed on the DWARF evaluation stack prior to execution 1551 of the DWARF expression. The DW_OP_call2, DW_OP_call4, 1552 DW_OP_call_ref and DW_OP_push_object_address DWARF operators 1553 (see Section 2.4.1 of DWARF Debugging Information Format, 1554 Revision 2.0.0) cannot be used in such a DWARF expression. 1555 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1556 instruction takes two operands: an unsigned LEB128 value 1557 representing a register number and a signed LEB128 factored 1558 offset. This instruction is identical to DW_CFA_offset_extended 1559 except that the second operand is signed. 1560 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1561 two operands: an unsigned LEB128 value representing a register 1562 number and a signed LEB128 factored offset. This instruction is 1563 identical to DW_CFA_def_cfa except that the second operand is 1564 signed and factored. 1565 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1566 instruction takes a signed LEB128 operand representing a 1567 factored offset. This instruction is identical to 1568 DW_CFA_def_cfa_offset except that the operand is signed and 1569 factored. 1570 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1571 takes an unsigned LEB128 operand representing an argument size. 1572 This instruction specifies the total of the size of the 1573 arguments which have been pushed onto the stack. 1574 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1575 instruction takes two operands: an unsigned LEB128 value 1576 representing a register number and an unsigned LEB128 which 1577 represents the magnitude of the offset. This instruction is 1578 identical to DW_CFA_offset_extended_sf except that the operand 1579 is subtracted to produce the offset. This instructions is 1580 obsoleted by DW_CFA_offset_extended_sf. 1581 __________________________________________________________ 1582 1583 11.6. Exception Frames 1584 1585 When using languages that support exceptions, such as C++, 1586 additional information must be provided to the runtime 1587 environment that describes the call frames that must be unwound 1588 during the processing of an exception. This information is 1589 contained in the special sections .eh_frame and .eh_framehdr. 1590 1591 Note: The format of the .eh_frame section is similar in 1592 format and purpose to the .debug_frame section which is 1593 specified in DWARF Debugging Information Format, Revision 1594 3.0.0 (Draft). Readers are advised that there are some 1595 subtle difference, and care should be taken when comparing 1596 the two sections. 1597 __________________________________________________________ 1598 1599 11.6.1. The .eh_frame section 1600 1601 The .eh_frame section shall contain 1 or more Call Frame 1602 Information (CFI) records. The number of records present shall 1603 be determined by size of the section as contained in the 1604 section header. Each CFI record contains a Common Information 1605 Entry (CIE) record followed by 1 or more Frame Description 1606 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1607 addressing unit sized boundary. 1608 1609 Table 11-8. Call Frame Information Format 1610 Common Information Entry Record 1611 Frame Description Entry Record(s) 1612 __________________________________________________________ 1613 1614 11.6.1.1. The Common Information Entry Format 1615 1616 Table 11-9. Common Information Entry Format 1617 Length Required 1618 Extended Length Optional 1619 CIE ID Required 1620 Version Required 1621 Augmentation String Required 1622 Code Alignment Factor Required 1623 Data Alignment Factor Required 1624 Return Address Register Required 1625 Augmentation Data Length Optional 1626 Augmentation Data Optional 1627 Initial Instructions Required 1628 Padding 1629 1630 Length 1631 A 4 byte unsigned value indicating the length in bytes 1632 of the CIE structure, not including the Length field 1633 itself. If Length contains the value 0xffffffff, then 1634 the length is contained in the Extended Length field. If 1635 Length contains the value 0, then this CIE shall be 1636 considered a terminator and processing shall end. 1637 1638 Extended Length 1639 A 8 byte unsigned value indicating the length in bytes 1640 of the CIE structure, not including the Length and 1641 Extended Length fields. 1642 1643 CIE ID 1644 A 4 byte unsigned value that is used to distinguish CIE 1645 records from FDE records. This value shall always be 0, 1646 which indicates this record is a CIE. 1647 1648 Version 1649 A 1 byte value that identifies the version number of the 1650 frame information structure. This value shall be 1. 1651 1652 Augmentation String 1653 This value is a NUL terminated string that identifies 1654 the augmentation to the CIE or to the FDEs associated 1655 with this CIE. A zero length string indicates that no 1656 augmentation data is present. The augmentation string is 1657 case sensitive and shall be interpreted as described 1658 below. 1659 1660 Code Alignment Factor 1661 An unsigned LEB128 encoded value that is factored out of 1662 all advance location instructions that are associated 1663 with this CIE or its FDEs. This value shall be 1664 multiplied by the delta argument of an adavance location 1665 instruction to obtain the new location value. 1666 1667 Data Alignment Factor 1668 A signed LEB128 encoded value that is factored out of 1669 all offset instructions that are associated with this 1670 CIE or its FDEs. This value shall be multiplied by the 1671 register offset argument of an offset instruction to 1672 obtain the new offset value. 1673 1674 Augmentation Length 1675 An unsigned LEB128 encoded value indicating the length 1676 in bytes of the Augmentation Data. This field is only 1677 present if the Augmentation String contains the 1678 character 'z'. 1679 1680 Augmentation Data 1681 A block of data whose contents are defined by the 1682 contents of the Augmentation String as described below. 1683 This field is only present if the Augmentation String 1684 contains the character 'z'. The size of this data is 1685 given by the Augentation Length. 1686 1687 Initial Instructions 1688 Initial set of Call Frame Instructions. The number of 1689 instructions is determined by the remaining space in the 1690 CIE record. 1691 1692 Padding 1693 Extra bytes to align the CIE structure to an addressing 1694 unit size boundary. 1695 __________________________________________________________ 1696 1697 11.6.1.1.1. Augmentation String Format 1698 1699 The Agumentation String indicates the presence of some optional 1700 fields, and how those fields should be intepreted. This string 1701 is case sensitive. Each character in the augmentation string in 1702 the CIE can be interpreted as below: 1703 1704 'z' 1705 1706 A 'z' may be present as the first character of the string. If 1707 present, the Augmentation Data field shall be present. The 1708 contents of the Augmentation Data shall be intepreted according 1709 to other characters in the Augmentation String. 1710 'L' 1711 1712 A 'L' may be present at any position after the first character 1713 of the string. This character may only be present if 'z' is the 1714 first character of the string. If present, it indicates the 1715 presence of one argument in the Augmentation Data of the CIE, 1716 and a corresponding argument in the Augmentation Data of the 1717 FDE. The argument in the Augmentation Data of the CIE is 1-byte 1718 and represents the pointer encoding used for the argument in 1719 the Augmentation Data of the FDE, which is the address of a 1720 language-specific data area (LSDA). The size of the LSDA 1721 pointer is specified by the pointer encoding used. 1722 'P' 1723 1724 A 'P' may be present at any position after the first character 1725 of the string. This character may only be present if 'z' is the 1726 first character of the string. If present, it indicates the 1727 presence of two arguments in the Augmentation Data of the CIE. 1728 The first argument is 1-byte and represents the pointer 1729 encoding used for the second argument, which is the address of 1730 a personality routine handler. The personality routine is used 1731 to handle language and vendor-specific tasks. The system unwind 1732 library interface accesses the language-specific exception 1733 handling semantics via the pointer to the personality routine. 1734 The personality routine does not have an ABI-specific name. The 1735 size of the personality routine pointer is specified by the 1736 pointer encoding used. 1737 'R' 1738 1739 A 'R' may be present at any position after the first character 1740 of the string. This character may only be present if 'z' is the 1741 first character of the string. If present, The Augmentation 1742 Data shall include a 1 byte argument that represents the 1743 pointer encoding for the address pointers used in the FDE. 1744 __________________________________________________________ 1745 1746 11.6.1.2. The Frame Description Entry Format 1747 1748 Table 11-10. Frame Description Entry Format 1749 Length Required 1750 Extended Length Optional 1751 CIE Pointer Required 1752 PC Begin Required 1753 PC Range Required 1754 Augmentation Data Length Optional 1755 Augmentation Data Optional 1756 Call Frame Instructions Required 1757 Padding 1758 1759 Length 1760 A 4 byte unsigned value indicating the length in bytes 1761 of the CIE structure, not including the Length field 1762 itself. If Length contains the value 0xffffffff, then 1763 the length is contained the Extended Length field. If 1764 Length contains the value 0, then this CIE shall be 1765 considered a terminator and processing shall end. 1766 1767 Extended Length 1768 A 8 byte unsigned value indicating the length in bytes 1769 of the CIE structure, not including the Length field 1770 itself. 1771 1772 CIE Pointer 1773 A 4 byte unsigned value that when subtracted from the 1774 offset of the the CIE Pointer in the current FDE yields 1775 the offset of the start of the associated CIE. This 1776 value shall never be 0. 1777 1778 PC Begin 1779 An encoded value that indicates the address of the 1780 initial location associated with this FDE. The encoding 1781 format is specified in the Augmentation Data. 1782 1783 PC Range 1784 An absolute value that indicates the number of bytes of 1785 instructions associated with this FDE. 1786 1787 Augmentation Length 1788 An unsigned LEB128 encoded value indicating the length 1789 in bytes of the Augmentation Data. This field is only 1790 present if the Augmentation String in the associated CIE 1791 contains the character 'z'. 1792 1793 Augmentation Data 1794 A block of data whose contents are defined by the 1795 contents of the Augmentation String in the associated 1796 CIE as described above. This field is only present if 1797 the Augmentation String in the associated CIE contains 1798 the character 'z'. The size of this data is given by the 1799 Augentation Length. 1800 1801 Call Frame Instructions 1802 A set of Call Frame Instructions. 1803 1804 Padding 1805 Extra bytes to align the FDE structure to an addressing 1806 unit size boundary. 1807 __________________________________________________________ 1808 1809 11.6.2. The .eh_frame_hdr section 1810 1811 The .eh_frame_hdr section contains additional information about 1812 the .eh_frame section. A pointer to the start of the .eh_frame 1813 data, and optionally, a binary search table of pointers to the 1814 .eh_frame records are found in this section. 1815 1816 Data in this section is encoded according to Section 11.5.1. 1817 1818 Table 11-11. .eh_frame_hdr Section Format 1819 Encoding Field 1820 unsigned byte version 1821 unsigned byte eh_frame_ptr_enc 1822 unsigned byte fde_count_enc 1823 unsigned byte table_enc 1824 encoded eh_frame_ptr 1825 encoded fde_count 1826 binary search table 1827 1828 version 1829 1830 Version of the .eh_frame_hdr format. This value shall be 1. 1831 eh_frame_ptr_enc 1832 1833 The encoding format of the eh_frame_ptr field. 1834 fde_count_enc 1835 1836 The encoding format of the fde_count field. A value of 1837 DW_EH_PE_omit indicates the binary search table is not present. 1838 table_enc 1839 1840 The encoding format of the entries in the binary search table. 1841 A value of DW_EH_PE_omit indicates the binary search table is 1842 not present. 1843 eh_frame_ptr 1844 1845 The encoded value of the pointer to the start of the .eh_frame 1846 section. 1847 fde_count 1848 1849 The encoded value of the count of entries in the binary search 1850 table. 1851 binary search table 1852 1853 A binary search table containing fde_count entries. Each entry 1854 of the table consist of two encoded values, the initial 1855 location, and the address. The entries are sorted in an 1856 increasing order by the initial location value. 1857 __________________________________________________________ 1858 1859 11.7. Symbol Versioning 1860 1861 11.7.1. Introduction 1862 1863 This chapter describes the Symbol Versioning mechanism. All ELF 1864 objects may provide or depend on versioned symbols. Symbol 1865 Versioning is implemented by 3 section types: SHT_GNU_versym, 1866 SHT_GNU_verdef, and SHT_GNU_verneed. 1867 1868 The prefix Elfxx in the following descriptions and code 1869 fragments stands for either "Elf32" or "Elf64", depending on 1870 the architecture. 1871 1872 Versions are described by strings. The structures that are used 1873 for symbol versions also contain a member that holds the ELF 1874 hashing values of the strings. This allows for more efficient 1875 processing. 1876 __________________________________________________________ 1877 1878 11.7.2. Symbol Version Table 1879 1880 The special section .gnu.version which has a section type of 1881 SHT_GNU_versym shall contain the Symbol Version Table. This 1882 section shall have the same number of entries as the Dynamic 1883 Symbol Table in the .dynsym section. 1884 1885 The .gnu.version section shall contain an array of elements of 1886 type Elfxx_Half. Each entry specifies the version defined for 1887 or required by the corresponding symbol in the Dynamic Symbol 1888 Table. 1889 1890 The values in the Symbol Version Table are specific to the 1891 object in which they are located. These values are identifiers 1892 that are provided by the the vna_other member of the 1893 Elfxx_Vernaux structure or the vd_ndx member of the 1894 Elfxx_Verdef structure. 1895 1896 The values 0 and 1 are reserved. 1897 1898 0 1899 1900 The symbol is local, not available outside the object. 1901 1 1902 1903 The symbol is defined in this object and is globally available. 1904 1905 All other values are used to identify version strings located 1906 in one of the other Symbol Version sections. The value itself 1907 is not the version associated with the symbol. The string 1908 identified by the value defines the version of the symbol. 1909 __________________________________________________________ 1910 1911 11.7.3. Version Definitions 1912 1913 The special section .gnu.version_d which has a section type of 1914 SHT_GNU_verdef shall contain symbol version definitions. The 1915 number of entries in this section shall be contained in the 1916 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The sh_link 1917 member of the section header (see figure 4-8 in the System V 1918 ABI) shall point to the section that contains the strings 1919 referenced by this section. 1920 1921 The section shall contain an array of Elfxx_Verdef structures, 1922 as described in Figure 11-1, optionally followed by an array of 1923 Elfxx_Verdaux structures, as defined in Figure 11-2. 1924 typedef struct { 1925 Elfxx_Half vd_version; 1926 Elfxx_Half vd_flags; 1927 Elfxx_Half vd_ndx; 1928 Elfxx_Half vd_cnt; 1929 Elfxx_Word vd_hash; 1930 Elfxx_Word vd_aux; 1931 Elfxx_Word vd_next; 1932 } Elfxx_Verdef; 1933 1934 Figure 11-1. Version Definition Entries 1935 1936 vd_version 1937 1938 Version revision. This field shall be set to 1. 1939 vd_flags 1940 1941 Version information flag bitmask. 1942 vd_ndx 1943 1944 Version index numeric value referencing the SHT_GNU_versym 1945 section. 1946 vd_cnt 1947 1948 Number of associated verdaux array entries. 1949 vd_hash 1950 1951 Version name hash value (ELF hash function). 1952 vd_aux 1953 1954 Offset in bytes to a corresponding entry in an array of 1955 Elfxx_Verdaux structures as defined in Figure 11-2 1956 vd_next 1957 1958 Offset to the next verdef entry, in bytes. 1959 typedef struct { 1960 Elfxx_Word vda_name; 1961 Elfxx_Word vda_next; 1962 } Elfxx_Verdaux; 1963 1964 Figure 11-2. Version Definition Auxiliary Entries 1965 1966 vda_name 1967 1968 Offset to the version or dependency name string in the section 1969 header, in bytes. 1970 vda_next 1971 1972 Offset to the next verdaux entry, in bytes. 1973 __________________________________________________________ 1974 1975 11.7.4. Version Requirements 1976 1977 The special section .gnu.version_r which has a section type of 1978 SHT_GNU_verneed shall contain required symbol version 1979 definitions. The number of entries in this section shall be 1980 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1981 .dynamic. The sh_link member of the section header (see figure 1982 4-8 in System V ABI) shall point to the section that contains 1983 the strings referenced by this section. 1984 1985 The section shall contain an array of Elfxx_Verneed structures, 1986 as described in Figure 11-3, optionally followed by an array of 1987 Elfxx_Vernaux structures, as defined in Figure 11-4. 1988 typedef struct { 1989 Elfxx_Half vn_version; 1990 Elfxx_Half vn_cnt; 1991 Elfxx_Word vn_file; 1992 Elfxx_Word vn_aux; 1993 Elfxx_Word vn_next; 1994 } Elfxx_Verneed; 1995 1996 Figure 11-3. Version Needed Entries 1997 1998 vn_version 1999 2000 Version of structure. This value is currently set to 1, and 2001 will be reset if the versioning implementation is incompatibly 2002 altered. 2003 vn_cnt 2004 2005 Number of associated verneed array entries. 2006 vn_file 2007 2008 Offset to the file name string in the section header, in bytes. 2009 vn_aux 2010 2011 Offset to a corresponding entry in the vernaux array, in bytes. 2012 vn_next 2013 2014 Offset to the next verneed entry, in bytes. 2015 typedef struct { 2016 Elfxx_Word vna_hash; 2017 Elfxx_Half vna_flags; 2018 Elfxx_Half vna_other; 2019 Elfxx_Word vna_name; 2020 Elfxx_Word vna_next; 2021 } Elfxx_Vernaux; 2022 2023 Figure 11-4. Version Needed Auxiliary Entries 2024 2025 vna_hash 2026 2027 Dependency name hash value (ELF hash function). 2028 vna_flags 2029 2030 Dependency information flag bitmask. 2031 vna_other 2032 2033 Object file version identifier used in the .gnu.version symbol 2034 version array. Bit number 15 controls whether or not the object 2035 is hidden; if this bit is set, the object cannot be used and 2036 the static linker will ignore the symbol's presence in the 2037 object. 2038 vna_name 2039 2040 Offset to the dependency name string in the section header, in 2041 bytes. 2042 vna_next 2043 2044 Offset to the next vernaux entry, in bytes. 2045 __________________________________________________________ 2046 2047 11.7.5. Startup Sequence 2048 2049 When loading a sharable object the system shall analyze version 2050 definition data from the loaded object to assure that it meets 2051 the version requirements of the calling object. This step is 2052 referred to as definition testing. The dynamic loader shall 2053 retrieve the entries in the caller's Elfxx_Verneed array and 2054 attempt to find matching definition information in the loaded 2055 Elfxx_Verdef table. 2056 2057 Each object and dependency shall be tested in turn. If a symbol 2058 definition is missing and the vna_flags bit for VER_FLG_WEAK is 2059 not set, the loader shall return an error and exit. If the 2060 vna_flags bit for VER_FLG_WEAK is set in the Elfxx_Vernaux 2061 entry, and the loader shall issue a warning and continue 2062 operation. 2063 2064 When the versions referenced by undefined symbols in the loaded 2065 object are found, version availability is certified. The test 2066 completes without error and the object shall be made available. 2067 __________________________________________________________ 2068 2069 11.7.6. Symbol Resolution 2070 2071 When symbol versioning is used in an object, relocations extend 2072 definition testing beyond the simple match of symbol name 2073 strings: the version of the reference shall also equal the name 2074 of the definition. 2075 2076 The same index that is used in the symbol table can be 2077 referenced in the SHT_GNU_versym section, and the value of this 2078 index is then used to acquire name data. The corresponding 2079 requirement string is retrieved from the Elfxx_Verneed array, 2080 and likewise, the corresponding definition string from the 2081 Elfxx_Verdef table. 2082 2083 If the high order bit (bit number 15) of the version symbolis 2084 set, the object cannot be used and the static linker shall 2085 ignore the symbol's presence in the object. 2086 2087 When an object with a reference and an object with the 2088 definition are being linked, the following rules shall govern 2089 the result: 2090 2091 * The object with the reference and the object with the 2092 definitions both use versioning. All described matching is 2093 processed in this case. A fatal error shall be triggered 2094 when no matching definition can be found in the object 2095 whose name is the one referenced by the vn_name element in 2096 the Elfxx_Verneed entry. 2097 * The object with the reference does not use versioning, 2098 while the object with the definitions does. In this 2099 instance, only the definitions with index numbers 1 and 2 2100 will be used in the reference match, the same identified by 2101 the static linker as the base definition. In cases where 2102 the static linker was not used, such as in calls to 2103 dlopen(), a version that does not have the base definition 2104 index shall be acceptable if it is the only version for 2105 which the symbol is defined. 2106 * The object with the reference uses versioning, but the 2107 object with the definitions specifies none. A matching 2108 symbol shall be accepted in this case. A fatal error shall 2109 be triggered if a corruption in the required symbols list 2110 obscures an outdated object file and causes a match on the 2111 object filename in the Elfxx_Verneed entry. 2112 * Neither the object with the reference nor the object with 2113 the definitions use versioning. The behavior in this 2114 instance shall default to pre-existing symbol rules. 2115 __________________________________________________________ 2116 2117 11.8. ABI note tag 2118 2119 Every executable shall contain a section named .note.ABI-tag of 2120 type SHT_NOTE. This section is structured as a note section as 2121 documented in the ELF spec. The section shall contain at least 2122 the following entry. The name field (namesz/name) contains the 2123 string "GNU". The type field shall be 1. The descsz field shall 2124 be at least 16, and the first 16 bytes of the desc field shall 2125 be as follows. 2126 2127 The first 32-bit word of the desc field shall be 0 (this 2128 signifies a Linux executable). The second, third, and fourth 2129 32-bit words of the desc field contain the earliest compatible 2130 kernel version. For example, if the 3 words are 2, 2, and 5, 2131 this signifies a 2.2.5 kernel. 2132 __________________________________________________________ 2133 2134 Chapter 12. Dynamic Linking 2135 2136 12.1. Program Loading and Dynamic Linking 2137 2138 LSB-conforming implementations shall support the object file 2139 information and system actions that create running programs as 2140 specified in the System V ABI and System V ABI Update and as 2141 further required by this specification and the relevant 2142 architecture specific part of ISO/IEC 23360. 2143 2144 Any shared object that is loaded shall contain sufficient 2145 DT_NEEDED records to satisfy the symbols on the shared library. 2146 __________________________________________________________ 2147 2148 12.2. Program Header 2149 2150 In addition to the Segment Types defined in the System V ABI 2151 and System V ABI Update the following Segment Types shall also 2152 be supported. 2153 2154 Table 12-1. Linux Segment Types 2155 Name Value 2156 PT_GNU_EH_FRAME 0x6474e550 2157 PT_GNU_STACK 0x6474e551 2158 PT_GNU_RELRO 0x6474e552 2159 2160 PT_GNU_EH_FRAME 2161 2162 The array element specifies the location and size of the 2163 exception handling information as defined by the .eh_frame_hdr 2164 section. 2165 PT_GNU_STACK 2166 2167 The p_flags member specifies the permissions on the segment 2168 containing the stack and is used to indicate wether the stack 2169 should be executable. The absense of this header indicates that 2170 the stack will be executable. 2171 PT_GNU_RELRO 2172 2173 the array element specifies the location and size of a segment 2174 which may be made read-only after relocations have been 2175 processed. 2176 __________________________________________________________ 2177 2178 12.3. Dynamic Entries 2179 2180 12.3.1. Introduction 2181 2182 As described in System V ABI, if an object file participates in 2183 dynamic linking, its program header table shall have an element 2184 of type PT_DYNAMIC. This `segment' contains the .dynamic 2185 section. A special symbol, _DYNAMIC, labels the section, which 2186 contains an array of the following structures. 2187 typedef struct { 2188 Elf32_Sword d_tag; 2189 union { 2190 Elf32_Word d_val; 2191 Elf32_Addr d_ptr; 2192 } d_un; 2193 } Elf32_Dyn; 2194 2195 extern Elf32_Dyn _DYNAMIC[]; 2196 2197 typedef struct { 2198 Elf64_Sxword d_tag; 2199 union { 2200 Elf64_Xword d_val; 2201 Elf64_Addr d_ptr; 2202 } d_un; 2203 } Elf64_Dyn; 2204 2205 extern Elf64_Dyn _DYNAMIC[]; 2206 2207 Figure 12-1. Dynamic Structure 2208 2209 For each object with this type, d_tag controls the 2210 interpretation of d_un. 2211 __________________________________________________________ 2212 2213 12.3.2. Dynamic Entries 2214 __________________________________________________________ 2215 2216 12.3.2.1. ELF Dynamic Entries 2217 2218 The following dynamic entries are defined in the System V ABI 2219 and System V ABI Update. 2220 2221 DT_BIND_NOW 2222 2223 Process relocations of object 2224 DT_DEBUG 2225 2226 For debugging; unspecified 2227 DT_FINI 2228 2229 Address of termination function 2230 DT_HASH 2231 2232 Address of symbol hash table 2233 DT_HIPROC 2234 2235 End of processor-specific 2236 DT_INIT 2237 2238 Address of init function 2239 DT_JMPREL 2240 2241 Address of PLT relocs 2242 DT_LOPROC 2243 2244 Start of processor-specific 2245 DT_NEEDED 2246 2247 Name of needed library 2248 DT_NULL 2249 2250 Marks end of dynamic section 2251 DT_PLTREL 2252 2253 Type of reloc in PLT 2254 DT_PLTRELSZ 2255 2256 Size in bytes of PLT relocs 2257 DT_REL 2258 2259 Address of Rel relocs 2260 DT_RELA 2261 2262 Address of Rela relocs 2263 DT_RELAENT 2264 2265 Size of one Rela reloc 2266 DT_RELASZ 2267 2268 Total size of Rela relocs 2269 DT_RELENT 2270 2271 Size of one Rel reloc 2272 DT_RELSZ 2273 2274 Total size of Rel relocs 2275 DT_RPATH 2276 2277 Library search path 2278 DT_SONAME 2279 2280 Name of shared object 2281 DT_STRSZ 2282 2283 Size of string table 2284 DT_STRTAB 2285 2286 Address of string table 2287 DT_SYMBOLIC 2288 2289 Start symbol search here 2290 DT_SYMENT 2291 2292 Size of one symbol table entry 2293 DT_SYMTAB 2294 2295 Address of symbol table 2296 DT_TEXTREL 2297 2298 Reloc might modify .text 2299 __________________________________________________________ 2300 2301 12.3.2.2. Additional Dynamic Entries 2302 2303 An LSB conforming object may also use the following additional 2304 Dynamic Entry types. 2305 2306 DT_ADDRRNGHI 2307 2308 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2309 definition by an archLSB. 2310 DT_ADDRRNGLO 2311 2312 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2313 definition by an archLSB. 2314 DT_AUXILIARY 2315 2316 Shared object to load before self 2317 DT_FILTER 2318 2319 Shared object to get values from 2320 DT_FINI_ARRAY 2321 2322 The address of an array of pointers to termination functions. 2323 DT_FINI_ARRAYSZ 2324 2325 Size in bytes of DT_FINI_ARRAY 2326 DT_HIOS 2327 2328 Values from DT_LOOS through DT_HIOS are reserved for definition 2329 by specific operating systems. 2330 DT_INIT_ARRAY 2331 2332 The address of an array of pointers to initialization 2333 functions. 2334 DT_INIT_ARRAYSZ 2335 2336 Size in bytes of DT_INIT_ARRAY 2337 DT_LOOS 2338 2339 Values from DT_LOOS through DT_HIOS are reserved for definition 2340 by specific operating systems. 2341 DT_NUM 2342 2343 Number of dynamic entry tags defined (excepting reserved 2344 ranges). 2345 DT_POSFLAG_1 2346 2347 Flags for DT_* entries, effecting the following DT_* entry 2348 DT_RELCOUNT 2349 2350 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2351 single block and this entry specifies the number of entries in 2352 that block. This permits ld.so.1 to streamline the processing 2353 of RELATIVE relocations. 2354 DT_RUNPATH 2355 2356 null-terminated library search path string 2357 DT_SYMINENT 2358 2359 Entry size of syminfo 2360 DT_SYMINFO 2361 2362 Address of the Syminfo table. 2363 DT_SYMINSZ 2364 2365 Size of syminfo table (in bytes) 2366 DT_VALRNGHI 2367 2368 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2369 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2370 DT_VALRNGLO 2371 2372 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2373 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2374 DT_VERDEF 2375 2376 Address of version definition table 2377 DT_VERDEFNUM 2378 2379 Number of version definitions 2380 DT_VERNEED 2381 2382 Address of table with needed versions 2383 DT_VERNEEDNUM 2384 2385 Number of needed versions 2386 DT_VERSYM 2387 2388 Address of the table provided by the .gnu.version section. 2389 2390 III. Base Libraries 2391 2392 Table of Contents 2393 13. Base Libraries 2394 2395 13.1. Introduction 2396 13.2. Program Interpreter 2397 13.3. Interfaces for libc 2398 2399 13.3.1. RPC 2400 13.3.2. System Calls 2401 13.3.3. Standard I/O 2402 13.3.4. Signal Handling 2403 13.3.5. Localization Functions 2404 13.3.6. Posix Spawn Option 2405 13.3.7. Posix Advisory Option 2406 13.3.8. Socket Interface 2407 13.3.9. Wide Characters 2408 13.3.10. String Functions 2409 13.3.11. IPC Functions 2410 13.3.12. Regular Expressions 2411 13.3.13. Character Type Functions 2412 13.3.14. Time Manipulation 2413 13.3.15. Terminal Interface Functions 2414 13.3.16. System Database Interface 2415 13.3.17. Language Support 2416 13.3.18. Large File Support 2417 13.3.19. Standard Library 2418 2419 13.4. Data Definitions for libc 2420 2421 13.4.1. arpa/inet.h 2422 13.4.2. assert.h 2423 13.4.3. ctype.h 2424 13.4.4. dirent.h 2425 13.4.5. err.h 2426 13.4.6. errno.h 2427 13.4.7. fcntl.h 2428 13.4.8. fmtmsg.h 2429 13.4.9. fnmatch.h 2430 13.4.10. ftw.h 2431 13.4.11. getopt.h 2432 13.4.12. glob.h 2433 13.4.13. grp.h 2434 13.4.14. iconv.h 2435 13.4.15. inttypes.h 2436 13.4.16. langinfo.h 2437 13.4.17. libgen.h 2438 13.4.18. libintl.h 2439 13.4.19. limits.h 2440 13.4.20. locale.h 2441 13.4.21. monetary.h 2442 13.4.22. net/if.h 2443 13.4.23. netdb.h 2444 13.4.24. netinet/in.h 2445 13.4.25. netinet/ip.h 2446 13.4.26. netinet/tcp.h 2447 13.4.27. netinet/udp.h 2448 13.4.28. nl_types.h 2449 13.4.29. poll.h 2450 13.4.30. pty.h 2451 13.4.31. pwd.h 2452 13.4.32. regex.h 2453 13.4.33. rpc/auth.h 2454 13.4.34. rpc/clnt.h 2455 13.4.35. rpc/pmap_clnt.h 2456 13.4.36. rpc/rpc_msg.h 2457 13.4.37. rpc/svc.h 2458 13.4.38. rpc/types.h 2459 13.4.39. rpc/xdr.h 2460 13.4.40. sched.h 2461 13.4.41. search.h 2462 13.4.42. setjmp.h 2463 13.4.43. signal.h 2464 13.4.44. spawn.h 2465 13.4.45. stddef.h 2466 13.4.46. stdint.h 2467 13.4.47. stdio.h 2468 13.4.48. stdlib.h 2469 13.4.49. string.h 2470 13.4.50. strings.h 2471 13.4.51. sys/file.h 2472 13.4.52. sys/ioctl.h 2473 13.4.53. sys/ipc.h 2474 13.4.54. sys/mman.h 2475 13.4.55. sys/msg.h 2476 13.4.56. sys/param.h 2477 13.4.57. sys/poll.h 2478 13.4.58. sys/resource.h 2479 13.4.59. sys/select.h 2480 13.4.60. sys/sem.h 2481 13.4.61. sys/shm.h 2482 13.4.62. sys/socket.h 2483 13.4.63. sys/stat.h 2484 13.4.64. sys/statfs.h 2485 13.4.65. sys/statvfs.h 2486 13.4.66. sys/time.h 2487 13.4.67. sys/timeb.h 2488 13.4.68. sys/times.h 2489 13.4.69. sys/types.h 2490 13.4.70. sys/uio.h 2491 13.4.71. sys/un.h 2492 13.4.72. sys/utsname.h 2493 13.4.73. sys/wait.h 2494 13.4.74. syslog.h 2495 13.4.75. termios.h 2496 13.4.76. time.h 2497 13.4.77. ucontext.h 2498 13.4.78. ulimit.h 2499 13.4.79. unistd.h 2500 13.4.80. utime.h 2501 13.4.81. utmp.h 2502 13.4.82. utmpx.h 2503 13.4.83. wchar.h 2504 13.4.84. wctype.h 2505 13.4.85. wordexp.h 2506 2507 13.5. Interface Definitions for libc 2508 2509 _IO_feof -- alias for feof 2510 _IO_getc -- alias for getc 2511 _IO_putc -- alias for putc 2512 _IO_puts -- alias for puts 2513 __assert_fail -- abort the program after false 2514 assertion 2515 2516 __ctype_b_loc -- accessor function for __ctype_b 2517 array for ctype functions 2518 2519 __ctype_get_mb_cur_max -- maximum length of a 2520 multibyte character in the current locale 2521 2522 __ctype_tolower_loc -- accessor function for 2523 __ctype_b_tolower array for ctype tolower() 2524 function 2525 2526 __ctype_toupper_loc -- accessor function for 2527 __ctype_b_toupper() array for ctype 2528 toupper() function 2529 2530 __cxa_atexit -- register a function to be called by 2531 exit or when a shared library is unloaded 2532 2533 __cxa_finalize -- call destructors of global (or 2534 local static) C++ objects and exit functions 2535 registered with atexit 2536 2537 __daylight -- daylight savings time flag 2538 __environ -- alias for environ - user environment 2539 __errno_location -- address of errno variable 2540 __fpending -- returns in bytes the amount of output 2541 pending on a stream 2542 2543 __getpagesize -- alias for getpagesize - get current 2544 page size 2545 2546 __getpgid -- get the process group id 2547 __h_errno_location -- address of h_errno variable 2548 __isinf -- test for infinity 2549 __isinff -- test for infinity 2550 __isinfl -- test for infinity 2551 __isnan -- test for infinity 2552 __isnanf -- test for infinity 2553 __isnanl -- test for infinity 2554 __libc_current_sigrtmax -- return number of 2555 available real-time signal with lowest 2556 priority 2557 2558 __libc_current_sigrtmin -- return number of 2559 available real-time signal with highest 2560 priority 2561 2562 __libc_start_main -- initialization routine 2563 __lxstat -- inline wrapper around call to lxstat 2564 __mempcpy -- copy given number of bytes of source to 2565 destination 2566 2567 __rawmemchr -- scan memory 2568 __register_atfork -- alias for register_atfork 2569 __sigsetjmp -- save stack context for non-local goto 2570 __stpcpy -- alias for stpcpy 2571 __strdup -- alias for strdup 2572 __strtod_internal -- underlying function for strtod 2573 __strtof_internal -- underlying function for strtof 2574 __strtok_r -- alias for strtok_r 2575 __strtol_internal -- alias for strtol 2576 __strtold_internal -- underlying function for 2577 strtold 2578 2579 __strtoll_internal -- underlying function for 2580 strtoll 2581 2582 __strtoul_internal -- underlying function for 2583 strtoul 2584 2585 __strtoull_internal -- underlying function for 2586 strtoull 2587 2588 __sysconf -- get configuration information at 2589 runtime 2590 2591 __sysv_signal -- signal handling 2592 __timezone -- global variable containing timezone 2593 __tzname -- global variable containing the timezone 2594 __wcstod_internal -- underlying function for wcstod 2595 __wcstof_internal -- underlying function for wcstof 2596 __wcstol_internal -- underlying function for wcstol 2597 __wcstold_internal -- underlying function for 2598 wcstold 2599 2600 __wcstoul_internal -- underlying function for 2601 wcstoul 2602 2603 __xmknod -- make block or character special file 2604 __xpg_basename -- return the last component of a 2605 file name 2606 2607 __xpg_sigpause -- remove a signal from the signal 2608 mask and suspend the thread 2609 2610 __xpg_strerror_r -- return string describing error 2611 number 2612 2613 __xstat -- get File Status 2614 __xstat64 -- get File Status 2615 _environ -- alias for environ - user environment 2616 _nl_msg_cat_cntr -- new catalog load counter 2617 _sys_errlist -- array containing the "C" locale 2618 strings used by strerror() 2619 2620 _sys_siglist -- array containing the names of the 2621 signal names 2622 2623 acct -- switch process accounting on or off 2624 adjtime -- correct the time to allow synchronization 2625 of the system clock 2626 2627 asprintf -- write formatted output to a dynamically 2628 allocated string 2629 2630 basename -- return the last component of a file name 2631 bind_textdomain_codeset -- specify encoding for 2632 message retrieval 2633 2634 bindresvport -- bind socket to privileged IP port 2635 bindtextdomain -- specify the location of a message 2636 catalog 2637 2638 cfmakeraw -- get and set terminal attributes 2639 cfsetspeed -- set terminal input and output data 2640 rate 2641 2642 daemon -- run in the background 2643 dcgettext -- perform domain and category specific 2644 lookup in message catalog 2645 2646 dcngettext -- perform domain and category specific 2647 lookup in message catalog with plural 2648 2649 dgettext -- perform lookup in message catalog for 2650 the current LC_MESSAGES locale 2651 2652 dngettext -- perform lookup in message catalog for 2653 the current locale 2654 2655 duplocale -- provide new handle for selection of 2656 locale 2657 2658 endutent -- access utmp file entries 2659 err -- display formatted error messages 2660 error -- print error message 2661 errx -- display formatted error message and exit 2662 fcntl -- file control 2663 fflush_unlocked -- non thread safe fflush 2664 fgetwc_unlocked -- non thread safe fgetwc 2665 flock -- apply or remove an advisory lock on an open 2666 file 2667 2668 freelocale -- free a locale object 2669 fscanf -- convert formatted input 2670 fstatfs -- (deprecated) 2671 fstatfs64 -- (deprecated) 2672 fwscanf -- convert formatted input 2673 getdomainname -- get NIS domain name (DEPRECATED). 2674 getdtablesize -- get file descriptor table size 2675 (DEPRECATED) 2676 2677 getgrouplist -- get groups a user belongs to 2678 gethostbyaddr_r -- find network host database entry 2679 matching host name (DEPRECATED) 2680 2681 gethostbyname2 -- find network host database entry 2682 matching host name (DEPRECATED) 2683 2684 gethostbyname2_r -- find network host database entry 2685 matching host name (DEPRECATED) 2686 2687 gethostbyname_r -- find network host database entry 2688 matching host name (DEPRECATED) 2689 2690 getloadavg -- get system load averages 2691 getopt -- parse command line options 2692 getopt_long -- parse command line options 2693 getopt_long_only -- parse command line options 2694 getpagesize -- get memory page size (DEPRECATED) 2695 getsockopt -- get socket options 2696 gettext -- search message catalogs for a string 2697 getutent -- access user accounting database entries 2698 getutent_r -- access user accounting database 2699 entries 2700 2701 glob64 -- find pathnames matching a pattern (Large 2702 File Support) 2703 2704 globfree64 -- free memory from glob64() (Large File 2705 Support) 2706 2707 inet_aton -- Internet address manipulation routine 2708 initgroups -- initialize the supplementary group 2709 access list 2710 2711 ioctl -- control device 2712 sockio -- socket ioctl commands 2713 ttyio -- tty ioctl commands 2714 kill -- send a signal 2715 link -- create a link to a file 2716 mbsnrtowcs -- convert a multibyte string to a wide 2717 character string 2718 2719 memmem -- locate bytes 2720 memrchr -- scan memory for a character 2721 mremap -- remap a virtual memory address 2722 newlocale -- allocate a locale object 2723 ngettext -- search message catalogs for plural 2724 string 2725 2726 pmap_getport -- find the port number assigned to a 2727 service registered with a portmapper. 2728 2729 pmap_set -- establishes mapping to machine's RPC 2730 Bind service. 2731 2732 pmap_unset -- destroys RPC Binding 2733 posix_fadvise64 -- File advisory information (Large 2734 File Support) 2735 2736 posix_fallocate64 -- file space control (Large File 2737 Support) 2738 2739 psignal -- print signal message 2740 readdir64_r -- read a directory (Large File Support) 2741 regexec -- regular expression matching 2742 scanf -- convert formatted input 2743 sched_setscheduler -- set scheduling policy and 2744 parameters 2745 2746 setbuffer -- stream buffering operation 2747 setgroups -- set list of supplementary group IDs 2748 sethostname -- set host name 2749 setsockopt -- set socket options 2750 setutent -- access user accounting database entries 2751 sigandset -- build a new signal set by combining the 2752 two input sets using logical AND 2753 2754 sigisemptyset -- check for empty signal set 2755 sigorset -- build a new signal set by combining the 2756 two input sets using logical OR 2757 2758 sigpause -- remove a signal from the signal mask and 2759 suspend the thread (deprecated) 2760 2761 sigreturn -- return from signal handler and cleanup 2762 stack frame 2763 2764 sscanf -- convert formatted input 2765 statfs -- (deprecated) 2766 statfs64 -- (deprecated) 2767 stime -- set time 2768 stpcpy -- copy a string returning a pointer to its 2769 end 2770 2771 stpncpy -- copy a fixed-size string, returning a 2772 pointer to its end 2773 2774 strcasestr -- locate a substring ignoring case 2775 strerror_r -- return string describing error number 2776 strndup -- return a malloc'd copy of at most the 2777 specified number of bytes of a string 2778 2779 strnlen -- determine the length of a fixed-size 2780 string 2781 2782 strptime -- parse a time string 2783 strsep -- extract token from string 2784 strsignal -- return string describing signal 2785 strtoq -- convert string value to a long or quad_t 2786 integer 2787 2788 strtouq -- convert a string to an unsigned long long 2789 svc_register -- register Remote Procedure Call 2790 interface 2791 2792 svc_run -- waits for RPC requests to arrive and 2793 calls service procedure 2794 2795 svc_sendreply -- called by RPC service's dispatch 2796 routine 2797 2798 svctcp_create -- create a TCP/IP-based RPC service 2799 transport 2800 2801 svcudp_create -- create a UDP-based RPC service 2802 transport 2803 2804 swscanf -- convert formatted input 2805 sysconf -- Get configuration information at runtime 2806 system -- execute a shell command 2807 textdomain -- set the current default message domain 2808 unlink -- remove a directory entry 2809 uselocale -- set locale for thread 2810 utmpname -- set user accounting database 2811 vasprintf -- write formatted output to a dynamically 2812 allocated string 2813 2814 vdprintf -- write formatted output to a file 2815 descriptor 2816 2817 verrx -- display formatted error message and exit 2818 vfscanf -- convert formatted input 2819 vfwscanf -- convert formatted input 2820 vscanf -- convert formatted input 2821 vsscanf -- convert formatted input 2822 vswscanf -- convert formatted input 2823 vsyslog -- log to system log 2824 vwscanf -- convert formatted input 2825 wait4 -- wait for process termination, BSD style 2826 waitpid -- wait for child process 2827 warn -- formatted error messages 2828 warnx -- formatted error messages 2829 wcpcpy -- copy a wide character string, returning a 2830 pointer to its end 2831 2832 wcpncpy -- copy a fixed-size string of wide 2833 characters, returning a pointer to its end 2834 2835 wcscasecmp -- compare two wide-character strings, 2836 ignoring case 2837 2838 wcsdup -- duplicate a wide-character string 2839 wcsncasecmp -- compare two fixed-size wide-character 2840 strings, ignoring case 2841 2842 wcsnlen -- determine the length of a fixed-size 2843 wide-character string 2844 2845 wcsnrtombs -- convert a wide character string to a 2846 multi-byte string 2847 2848 wcstoq -- convert wide string to long long int 2849 representation 2850 2851 wcstouq -- convert wide string to unsigned long long 2852 int representation 2853 2854 wscanf -- convert formatted input 2855 xdr_u_int -- library routines for external data 2856 representation 2857 2858 xdrstdio_create -- library routines for external 2859 data representation 2860 2861 13.6. Interfaces for libm 2862 2863 13.6.1. Math 2864 2865 13.7. Data Definitions for libm 2866 2867 13.7.1. complex.h 2868 13.7.2. fenv.h 2869 13.7.3. math.h 2870 2871 13.8. Interface Definitions for libm 2872 2873 __finite -- test for infinity 2874 __finitef -- test for infinity 2875 __finitel -- test for infinity 2876 __fpclassify -- Classify real floating type 2877 __fpclassifyf -- Classify real floating type 2878 __signbit -- test sign of floating point value 2879 __signbitf -- test sign of floating point value 2880 clog10 -- Logarithm of a Complex Number 2881 clog10f -- Logarithm of a Complex Number 2882 clog10l -- Logarithm of a Complex Number 2883 drem -- Floating Point Remainder (DEPRECATED) 2884 dremf -- Floating Point Remainder (DEPRECATED) 2885 dreml -- Floating Point Remainder (DEPRECATED) 2886 exp10 -- Base-10 power function 2887 exp10f -- Base-10 power function 2888 exp10l -- Base-10 power function 2889 fedisableexcept -- disable floating point exceptions 2890 feenableexcept -- enable floating point exceptions 2891 fegetexcept -- query floating point exception 2892 handling state 2893 2894 finite -- test for infinity (DEPRECATED) 2895 finitef -- test for infinity (DEPRECATED) 2896 finitel -- test for infinity (DEPRECATED) 2897 gamma -- log gamma function (DEPRECATED) 2898 gammaf -- log gamma function (DEPRECATED) 2899 gammal -- log gamma function (DEPRECATED) 2900 j0f -- Bessel functions 2901 j0l -- Bessel functions 2902 j1f -- Bessel functions 2903 j1l -- Bessel functions 2904 jnf -- Bessel functions 2905 jnl -- Bessel functions 2906 lgamma_r -- log gamma functions 2907 lgammaf_r -- log gamma functions 2908 lgammal_r -- log gamma functions 2909 pow10 -- Base-10 power function 2910 pow10f -- Base-10 power function 2911 pow10l -- Base-10 power function 2912 significand -- floating point mantissa 2913 significandf -- floating point mantissa 2914 significandl -- floating point mantissa 2915 sincos -- trigonometric functions 2916 sincosf -- trigonometric functions 2917 sincosl -- trigonometric functions 2918 y0f -- Bessel functions 2919 y0l -- Bessel functions 2920 y1f -- Bessel functions 2921 y1l -- Bessel functions 2922 ynf -- Bessel functions 2923 ynl -- Bessel functions 2924 2925 13.9. Interfaces for libpthread 2926 2927 13.9.1. Realtime Threads 2928 13.9.2. Advanced Realtime Threads 2929 13.9.3. Posix Threads 2930 13.9.4. Thread aware versions of libc interfaces 2931 2932 13.10. Data Definitions for libpthread 2933 2934 13.10.1. pthread.h 2935 13.10.2. semaphore.h 2936 2937 13.11. Interface Definitions for libpthread 2938 2939 _pthread_cleanup_pop -- establish cancellation 2940 handlers 2941 2942 _pthread_cleanup_push -- establish cancellation 2943 handlers 2944 2945 13.12. Interfaces for libgcc_s 2946 2947 13.12.1. Unwind Library 2948 2949 13.13. Data Definitions for libgcc_s 2950 2951 13.13.1. unwind.h 2952 2953 13.14. Interfaces for libdl 2954 2955 13.14.1. Dynamic Loader 2956 2957 13.15. Data Definitions for libdl 2958 2959 13.15.1. dlfcn.h 2960 2961 13.16. Interface Definitions for libdl 2962 2963 dladdr -- find the shared object containing a given 2964 address 2965 2966 dlopen -- open dynamic object 2967 dlsym -- obtain the address of a symbol from a 2968 dlopen object 2969 2970 13.17. Interfaces for librt 2971 2972 13.17.1. Shared Memory Objects 2973 13.17.2. Clock 2974 13.17.3. Timers 2975 13.17.4. Message Queues 2976 2977 13.18. Data Definitions for librt 2978 2979 13.18.1. mqueue.h 2980 2981 13.19. Interfaces for libcrypt 2982 2983 13.19.1. Encryption 2984 2985 13.20. Interfaces for libpam 2986 2987 13.20.1. Pluggable Authentication API 2988 2989 13.21. Data Definitions for libpam 2990 2991 13.21.1. security/pam_appl.h 2992 2993 13.22. Interface Definitions for libpam 2994 2995 pam_acct_mgmt -- establish the status of a user's 2996 account 2997 2998 pam_authenticate -- authenticate the user 2999 pam_chauthtok -- change the authentication token for 3000 a given user 3001 3002 pam_close_session -- indicate that an authenticated 3003 session has ended 3004 3005 pam_end -- terminate the use of the PAM library 3006 pam_fail_delay -- specify delay time to use on 3007 authentication error 3008 3009 pam_get_item -- obtain the value of the indicated 3010 item. 3011 3012 pam_getenv -- get a PAM environment variable 3013 pam_getenvlist -- returns a pointer to the complete 3014 PAM environment. 3015 3016 pam_open_session -- indicate session has started 3017 pam_putenv -- Add, replace or delete a PAM 3018 environment variable 3019 3020 pam_set_item -- (re)set the value of an item. 3021 pam_setcred -- set the module-specific credentials 3022 of the user 3023 3024 pam_start -- initialize the PAM library 3025 pam_strerror -- returns a string describing the PAM 3026 error 3027 __________________________________________________________ 3028 3029 Chapter 13. Base Libraries 3030 3031 13.1. Introduction 3032 3033 An LSB-conforming implementation shall support the following 3034 base libraries which provide interfaces for accessing the 3035 operating system, processor and other hardware in the system. 3036 3037 * libc 3038 * libm 3039 * libgcc_s 3040 * libdl 3041 * librt 3042 * libcrypt 3043 * libpam 3044 3045 There are three main parts to the definition of each of these 3046 libraries. 3047 3048 The "Interfaces" section defines the required library name and 3049 version, and the required public symbols (interfaces and global 3050 data), as well as symbol versions, if any. 3051 3052 The "Interface Definitions" section provides complete or 3053 partial definitions of certain interfaces where either this 3054 specification is the source specification, or where there are 3055 variations from the source specification. If an interface 3056 definition requires one or more header files, one of those 3057 headers shall include the function prototype for the interface. 3058 3059 For source definitions of interfaces which include a reference 3060 to a header file, the contents of such header files form a part 3061 of the specification. The "Data Definitions" section provides 3062 the binary-level details for the header files from the source 3063 specifications, such as values for macros and enumerated types, 3064 as well as structure layouts, sizes and padding, etc. These 3065 data definitions, although presented in the form of header 3066 files for convenience, should not be taken a representing 3067 complete header files, as they are a supplement to the source 3068 specifications. Application developers should follow the 3069 guidelines of the source specifications when determining which 3070 header files need to be included to completely resolve all 3071 references. 3072 3073 Note: While the Data Definitions supplement the source 3074 specifications, this specification itself does not require 3075 conforming implementations to supply any header files. 3076 __________________________________________________________ 3077 3078 13.2. Program Interpreter 3079 3080 The Program Interpreter is specified in the appropriate 3081 architecture specific part of ISO/IEC 23360. 3082 __________________________________________________________ 3083 3084 13.3. Interfaces for libc 3085 3086 Table 13-1 defines the library name and shared object name for 3087 the libc library 3088 3089 Table 13-1. libc Definition 3090 Library: libc 3091 SONAME: See archLSB. 3092 3093 The behavior of the interfaces in this library is specified by 3094 the following specifications: 3095 3096 [LFS] Large File Support 3097 [LSB] This Specification 3098 [SUSv2] SUSv2 3099 [SUSv3] ISO POSIX (2003) 3100 [SVID.3] SVID Issue 3 3101 [SVID.4] SVID Issue 4 3102 __________________________________________________________ 3103 3104 13.3.1. RPC 3105 __________________________________________________________ 3106 3107 13.3.1.1. Interfaces for RPC 3108 3109 An LSB conforming implementation shall provide the generic 3110 functions for RPC specified in Table 13-2, with the full 3111 mandatory functionality as described in the referenced 3112 underlying specification. 3113 3114 Table 13-2. libc - RPC Function Interfaces 3115 authnone_create [SVID.4] clnt_create [SVID.4] clnt_pcreateerror 3116 [SVID.4] clnt_perrno [SVID.4] 3117 clnt_perror [SVID.4] clnt_spcreateerror [SVID.4] clnt_sperrno 3118 [SVID.4] clnt_sperror [SVID.4] 3119 key_decryptsession [SVID.3] pmap_getport [LSB] pmap_set [LSB] 3120 pmap_unset [LSB] 3121 svc_getreqset [SVID.3] svc_register [LSB] svc_run [LSB] 3122 svc_sendreply [LSB] 3123 svcerr_auth [SVID.3] svcerr_decode [SVID.3] svcerr_noproc 3124 [SVID.3] svcerr_noprog [SVID.3] 3125 svcerr_progvers [SVID.3] svcerr_systemerr [SVID.3] 3126 svcerr_weakauth [SVID.3] svctcp_create [LSB] 3127 svcudp_create [LSB] xdr_accepted_reply [SVID.3] xdr_array 3128 [SVID.3] xdr_bool [SVID.3] 3129 xdr_bytes [SVID.3] xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] 3130 xdr_char [SVID.3] 3131 xdr_double [SVID.3] xdr_enum [SVID.3] xdr_float [SVID.3] 3132 xdr_free [SVID.3] 3133 xdr_int [SVID.3] xdr_long [SVID.3] xdr_opaque [SVID.3] 3134 xdr_opaque_auth [SVID.3] 3135 xdr_pointer [SVID.3] xdr_reference [SVID.3] xdr_rejected_reply 3136 [SVID.3] xdr_replymsg [SVID.3] 3137 xdr_short [SVID.3] xdr_string [SVID.3] xdr_u_char [SVID.3] 3138 xdr_u_int [LSB] 3139 xdr_u_long [SVID.3] xdr_u_short [SVID.3] xdr_union [SVID.3] 3140 xdr_vector [SVID.3] 3141 xdr_void [SVID.3] xdr_wrapstring [SVID.3] xdrmem_create 3142 [SVID.3] xdrrec_create [SVID.3] 3143 xdrrec_eof [SVID.3] xdrstdio_create [LSB] 3144 __________________________________________________________ 3145 3146 13.3.2. System Calls 3147 __________________________________________________________ 3148 3149 13.3.2.1. Interfaces for System Calls 3150 3151 An LSB conforming implementation shall provide the generic 3152 functions for System Calls specified in Table 13-3, with the 3153 full mandatory functionality as described in the referenced 3154 underlying specification. 3155 3156 Table 13-3. libc - System Calls Function Interfaces 3157 __fxstat [LSB] __getpgid [LSB] __lxstat [LSB] __xmknod [LSB] 3158 __xstat [LSB] access [SUSv3] acct [LSB] alarm [SUSv3] 3159 brk [SUSv2] chdir [SUSv3] chmod [SUSv3] chown [SUSv3] 3160 chroot [SUSv2] clock [SUSv3] close [SUSv3] closedir [SUSv3] 3161 creat [SUSv3] dup [SUSv3] dup2 [SUSv3] execl [SUSv3] 3162 execle [SUSv3] execlp [SUSv3] execv [SUSv3] execve [SUSv3] 3163 execvp [SUSv3] exit [SUSv3] fchdir [SUSv3] fchmod [SUSv3] 3164 fchown [SUSv3] fcntl [LSB] fdatasync [SUSv3] flock [LSB] 3165 fork [SUSv3] fstatfs [LSB] fstatvfs [SUSv3] fsync [SUSv3] 3166 ftime [SUSv3] ftruncate [SUSv3] getcontext [SUSv3] 3167 getdtablesize [LSB] 3168 getegid [SUSv3] geteuid [SUSv3] getgid [SUSv3] getgroups 3169 [SUSv3] 3170 getitimer [SUSv3] getloadavg [LSB] getpagesize [LSB] getpgid 3171 [SUSv3] 3172 getpgrp [SUSv3] getpid [SUSv3] getppid [SUSv3] getpriority 3173 [SUSv3] 3174 getrlimit [SUSv3] getrusage [SUSv3] getsid [SUSv3] getuid 3175 [SUSv3] 3176 getwd [SUSv3] initgroups [LSB] ioctl [LSB] kill [LSB] 3177 killpg [SUSv3] lchown [SUSv3] link [LSB] lockf [SUSv3] 3178 lseek [SUSv3] mkdir [SUSv3] mkfifo [SUSv3] mlock [SUSv3] 3179 mlockall [SUSv3] mmap [SUSv3] mprotect [SUSv3] mremap [LSB] 3180 msync [SUSv3] munlock [SUSv3] munlockall [SUSv3] munmap [SUSv3] 3181 nanosleep [SUSv3] nice [SUSv3] open [SUSv3] opendir [SUSv3] 3182 pathconf [SUSv3] pause [SUSv3] pipe [SUSv3] poll [SUSv3] 3183 pselect [SUSv3] read [SUSv3] readdir [SUSv3] readdir_r [SUSv3] 3184 readlink [SUSv3] readv [SUSv3] rename [SUSv3] rmdir [SUSv3] 3185 sbrk [SUSv2] sched_get_priority_max [SUSv3] 3186 sched_get_priority_min [SUSv3] sched_getparam [SUSv3] 3187 sched_getscheduler [SUSv3] sched_rr_get_interval [SUSv3] 3188 sched_setparam [SUSv3] sched_setscheduler [LSB] 3189 sched_yield [SUSv3] select [SUSv3] setcontext [SUSv3] setegid 3190 [SUSv3] 3191 seteuid [SUSv3] setgid [SUSv3] setitimer [SUSv3] setpgid 3192 [SUSv3] 3193 setpgrp [SUSv3] setpriority [SUSv3] setregid [SUSv3] setreuid 3194 [SUSv3] 3195 setrlimit [SUSv3] setrlimit64 [LFS] setsid [SUSv3] setuid 3196 [SUSv3] 3197 sleep [SUSv3] statfs [LSB] statvfs [SUSv3] stime [LSB] 3198 symlink [SUSv3] sync [SUSv3] sysconf [LSB] time [SUSv3] 3199 times [SUSv3] truncate [SUSv3] ulimit [SUSv3] umask [SUSv3] 3200 uname [SUSv3] unlink [LSB] utime [SUSv3] utimes [SUSv3] 3201 vfork [SUSv3] wait [SUSv3] wait4 [LSB] waitid [SUSv3] 3202 waitpid [LSB] write [SUSv3] writev [SUSv3] 3203 3204 An LSB conforming implementation shall provide the generic 3205 deprecated functions for System Calls specified in Table 13-4, 3206 with the full mandatory functionality as described in the 3207 referenced underlying specification. 3208 3209 Note: These interfaces are deprecated, and applications 3210 should avoid using them. These interfaces may be withdrawn 3211 in future releases of this specification. 3212 3213 Table 13-4. libc - System Calls Deprecated Function Interfaces 3214 fstatfs [LSB] getdtablesize [LSB] getpagesize [LSB] getwd 3215 [SUSv3] 3216 statfs [LSB] 3217 __________________________________________________________ 3218 3219 13.3.3. Standard I/O 3220 __________________________________________________________ 3221 3222 13.3.3.1. Interfaces for Standard I/O 3223 3224 An LSB conforming implementation shall provide the generic 3225 functions for Standard I/O specified in Table 13-5, with the 3226 full mandatory functionality as described in the referenced 3227 underlying specification. 3228 3229 Table 13-5. libc - Standard I/O Function Interfaces 3230 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 3231 asprintf [LSB] clearerr [SUSv3] ctermid [SUSv3] fclose [SUSv3] 3232 fdopen [SUSv3] feof [SUSv3] ferror [SUSv3] fflush [SUSv3] 3233 fflush_unlocked [LSB] fgetc [SUSv3] fgetpos [SUSv3] fgets 3234 [SUSv3] 3235 fgetwc_unlocked [LSB] fileno [SUSv3] flockfile [SUSv3] fopen 3236 [SUSv3] 3237 fprintf [SUSv3] fputc [SUSv3] fputs [SUSv3] fread [SUSv3] 3238 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 3239 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 3240 getc [SUSv3] getc_unlocked [SUSv3] getchar [SUSv3] 3241 getchar_unlocked [SUSv3] 3242 getw [SUSv2] pclose [SUSv3] popen [SUSv3] printf [SUSv3] 3243 putc [SUSv3] putc_unlocked [SUSv3] putchar [SUSv3] 3244 putchar_unlocked [SUSv3] 3245 puts [SUSv3] putw [SUSv2] remove [SUSv3] rewind [SUSv3] 3246 rewinddir [SUSv3] scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] 3247 setbuffer [LSB] setvbuf [SUSv3] snprintf [SUSv3] sprintf 3248 [SUSv3] 3249 sscanf [LSB] telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] 3250 vasprintf [LSB] vdprintf [LSB] vfprintf [SUSv3] vprintf [SUSv3] 3251 vsnprintf [SUSv3] vsprintf [SUSv3] 3252 3253 An LSB conforming implementation shall provide the generic data 3254 interfaces for Standard I/O specified in Table 13-6, with the 3255 full mandatory functionality as described in the referenced 3256 underlying specification. 3257 3258 Table 13-6. libc - Standard I/O Data Interfaces 3259 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 3260 __________________________________________________________ 3261 3262 13.3.4. Signal Handling 3263 __________________________________________________________ 3264 3265 13.3.4.1. Interfaces for Signal Handling 3266 3267 An LSB conforming implementation shall provide the generic 3268 functions for Signal Handling specified in Table 13-7, with the 3269 full mandatory functionality as described in the referenced 3270 underlying specification. 3271 3272 Table 13-7. libc - Signal Handling Function Interfaces 3273 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 3274 __sigsetjmp [LSB] __sysv_signal [LSB] 3275 __xpg_sigpause [LSB] bsd_signal [SUSv3] psignal [LSB] raise 3276 [SUSv3] 3277 sigaction [SUSv3] sigaddset [SUSv3] sigaltstack [SUSv3] 3278 sigandset [LSB] 3279 sigdelset [SUSv3] sigemptyset [SUSv3] sigfillset [SUSv3] 3280 sighold [SUSv3] 3281 sigignore [SUSv3] siginterrupt [SUSv3] sigisemptyset [LSB] 3282 sigismember [SUSv3] 3283 siglongjmp [SUSv3] signal [SUSv3] sigorset [LSB] sigpause [LSB] 3284 sigpending [SUSv3] sigprocmask [SUSv3] sigqueue [SUSv3] 3285 sigrelse [SUSv3] 3286 sigreturn [LSB] sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait 3287 [SUSv3] 3288 sigwait [SUSv3] sigwaitinfo [SUSv3] 3289 3290 An LSB conforming implementation shall provide the generic 3291 deprecated functions for Signal Handling specified in Table 3292 13-8, with the full mandatory functionality as described in the 3293 referenced underlying specification. 3294 3295 Note: These interfaces are deprecated, and applications 3296 should avoid using them. These interfaces may be withdrawn 3297 in future releases of this specification. 3298 3299 Table 13-8. libc - Signal Handling Deprecated Function 3300 Interfaces 3301 sigpause [LSB] 3302 3303 An LSB conforming implementation shall provide the generic data 3304 interfaces for Signal Handling specified in Table 13-9, with 3305 the full mandatory functionality as described in the referenced 3306 underlying specification. 3307 3308 Table 13-9. libc - Signal Handling Data Interfaces 3309 _sys_siglist [LSB] 3310 __________________________________________________________ 3311 3312 13.3.5. Localization Functions 3313 __________________________________________________________ 3314 3315 13.3.5.1. Interfaces for Localization Functions 3316 3317 An LSB conforming implementation shall provide the generic 3318 functions for Localization Functions specified in Table 13-10, 3319 with the full mandatory functionality as described in the 3320 referenced underlying specification. 3321 3322 Table 13-10. libc - Localization Functions Function Interfaces 3323 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 3324 [SUSv3] catgets [SUSv3] 3325 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext [LSB] 3326 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 3327 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 3328 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] localeconv 3329 [SUSv3] 3330 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 3331 setlocale [SUSv3] 3332 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 3333 3334 An LSB conforming implementation shall provide the generic data 3335 interfaces for Localization Functions specified in Table 13-11, 3336 with the full mandatory functionality as described in the 3337 referenced underlying specification. 3338 3339 Table 13-11. libc - Localization Functions Data Interfaces 3340 _nl_msg_cat_cntr [LSB] 3341 __________________________________________________________ 3342 3343 13.3.6. Posix Spawn Option 3344 __________________________________________________________ 3345 3346 13.3.6.1. Interfaces for Posix Spawn Option 3347 3348 An LSB conforming implementation shall provide the generic 3349 functions for Posix Spawn Option specified in Table 13-12, with 3350 the full mandatory functionality as described in the referenced 3351 underlying specification. 3352 3353 Table 13-12. libc - Posix Spawn Option Function Interfaces 3354 posix_spawn [SUSv3] posix_spawn_file_actions_addclose [SUSv3] 3355 posix_spawn_file_actions_adddup2 [SUSv3] 3356 posix_spawn_file_actions_addopen [SUSv3] 3357 posix_spawn_file_actions_destroy [SUSv3] 3358 posix_spawn_file_actions_init [SUSv3] posix_spawnattr_destroy 3359 [SUSv3] posix_spawnattr_getflags [SUSv3] 3360 posix_spawnattr_getpgroup [SUSv3] posix_spawnattr_getschedparam 3361 [SUSv3] posix_spawnattr_getschedpolicy [SUSv3] 3362 posix_spawnattr_getsigdefault [SUSv3] 3363 posix_spawnattr_getsigmask [SUSv3] posix_spawnattr_init [SUSv3] 3364 posix_spawnattr_setflags [SUSv3] posix_spawnattr_setpgroup 3365 [SUSv3] 3366 posix_spawnattr_setschedparam [SUSv3] 3367 posix_spawnattr_setschedpolicy [SUSv3] 3368 posix_spawnattr_setsigdefault [SUSv3] 3369 posix_spawnattr_setsigmask [SUSv3] 3370 posix_spawnp [SUSv3] 3371 __________________________________________________________ 3372 3373 13.3.7. Posix Advisory Option 3374 __________________________________________________________ 3375 3376 13.3.7.1. Interfaces for Posix Advisory Option 3377 3378 An LSB conforming implementation shall provide the generic 3379 functions for Posix Advisory Option specified in Table 13-13, 3380 with the full mandatory functionality as described in the 3381 referenced underlying specification. 3382 3383 Table 13-13. libc - Posix Advisory Option Function Interfaces 3384 posix_fadvise [SUSv3] posix_fallocate [SUSv3] posix_madvise 3385 [SUSv3] posix_memalign [SUSv3] 3386 __________________________________________________________ 3387 3388 13.3.8. Socket Interface 3389 __________________________________________________________ 3390 3391 13.3.8.1. Interfaces for Socket Interface 3392 3393 An LSB conforming implementation shall provide the generic 3394 functions for Socket Interface specified in Table 13-14, with 3395 the full mandatory functionality as described in the referenced 3396 underlying specification. 3397 3398 Table 13-14. libc - Socket Interface Function Interfaces 3399 __h_errno_location [LSB] accept [SUSv3] bind [SUSv3] 3400 bindresvport [LSB] 3401 connect [SUSv3] gethostid [SUSv3] gethostname [SUSv3] 3402 getpeername [SUSv3] 3403 getsockname [SUSv3] getsockopt [LSB] if_freenameindex [SUSv3] 3404 if_indextoname [SUSv3] 3405 if_nameindex [SUSv3] if_nametoindex [SUSv3] listen [SUSv3] recv 3406 [SUSv3] 3407 recvfrom [SUSv3] recvmsg [SUSv3] send [SUSv3] sendmsg [SUSv3] 3408 sendto [SUSv3] setsockopt [LSB] shutdown [SUSv3] sockatmark 3409 [SUSv3] 3410 socket [SUSv3] socketpair [SUSv3] 3411 3412 An LSB conforming implementation shall provide the generic data 3413 interfaces for Socket Interface specified in Table 13-15, with 3414 the full mandatory functionality as described in the referenced 3415 underlying specification. 3416 3417 Table 13-15. libc - Socket Interface Data Interfaces 3418 in6addr_any [SUSv3] in6addr_loopback [SUSv3] 3419 __________________________________________________________ 3420 3421 13.3.9. Wide Characters 3422 __________________________________________________________ 3423 3424 13.3.9.1. Interfaces for Wide Characters 3425 3426 An LSB conforming implementation shall provide the generic 3427 functions for Wide Characters specified in Table 13-16, with 3428 the full mandatory functionality as described in the referenced 3429 underlying specification. 3430 3431 Table 13-16. libc - Wide Characters Function Interfaces 3432 __wcstod_internal [LSB] __wcstof_internal [LSB] 3433 __wcstol_internal [LSB] __wcstold_internal [LSB] 3434 __wcstoul_internal [LSB] btowc [SUSv3] fgetwc [SUSv3] fgetws 3435 [SUSv3] 3436 fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] fwprintf [SUSv3] 3437 fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] mblen [SUSv3] 3438 mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] mbsnrtowcs [LSB] 3439 mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc [SUSv3] putwc [SUSv3] 3440 putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] towctrans 3441 [SUSv3] 3442 towlower [SUSv3] towupper [SUSv3] ungetwc [SUSv3] vfwprintf 3443 [SUSv3] 3444 vfwscanf [LSB] vswprintf [SUSv3] vswscanf [LSB] vwprintf 3445 [SUSv3] 3446 vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] wcrtomb [SUSv3] 3447 wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] wcscmp [SUSv3] 3448 wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] wcsdup [LSB] 3449 wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] wcsncat 3450 [SUSv3] 3451 wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] wcsnrtombs [LSB] 3452 wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs [SUSv3] wcsspn 3453 [SUSv3] 3454 wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] wcstoimax [SUSv3] 3455 wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] wcstoll [SUSv3] 3456 wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] wcstoull [SUSv3] 3457 wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] wcswidth [SUSv3] 3458 wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] wctrans [SUSv3] 3459 wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] wmemcmp [SUSv3] 3460 wmemcpy [SUSv3] wmemmove [SUSv3] wmemset [SUSv3] wprintf 3461 [SUSv3] 3462 wscanf [LSB] 3463 __________________________________________________________ 3464 3465 13.3.10. String Functions 3466 __________________________________________________________ 3467 3468 13.3.10.1. Interfaces for String Functions 3469 3470 An LSB conforming implementation shall provide the generic 3471 functions for String Functions specified in Table 13-17, with 3472 the full mandatory functionality as described in the referenced 3473 underlying specification. 3474 3475 Table 13-17. libc - String Functions Function Interfaces 3476 __mempcpy [LSB] __rawmemchr [LSB] __stpcpy [LSB] __strdup [LSB] 3477 __strtod_internal [LSB] __strtof_internal [LSB] __strtok_r 3478 [LSB] __strtol_internal [LSB] 3479 __strtold_internal [LSB] __strtoll_internal [LSB] 3480 __strtoul_internal [LSB] __strtoull_internal [LSB] 3481 __xpg_strerror_r(GLIBC_2.3.4) [LSB] bcmp [SUSv3] bcopy [SUSv3] 3482 bzero [SUSv3] 3483 ffs [SUSv3] index [SUSv3] memccpy [SUSv3] memchr [SUSv3] 3484 memcmp [SUSv3] memcpy [SUSv3] memmove [SUSv3] memrchr [LSB] 3485 memset [SUSv3] rindex [SUSv3] stpcpy [LSB] stpncpy [LSB] 3486 strcasecmp [SUSv3] strcasestr [LSB] strcat [SUSv3] strchr 3487 [SUSv3] 3488 strcmp [SUSv3] strcoll [SUSv3] strcpy [SUSv3] strcspn [SUSv3] 3489 strdup [SUSv3] strerror [SUSv3] strerror_r [LSB] strfmon 3490 [SUSv3] 3491 strftime [SUSv3] strlen [SUSv3] strncasecmp [SUSv3] strncat 3492 [SUSv3] 3493 strncmp [SUSv3] strncpy [SUSv3] strndup [LSB] strnlen [LSB] 3494 strpbrk [SUSv3] strptime [LSB] strrchr [SUSv3] strsep [LSB] 3495 strsignal [LSB] strspn [SUSv3] strstr [SUSv3] strtof [SUSv3] 3496 strtoimax [SUSv3] strtok [SUSv3] strtok_r [SUSv3] strtold 3497 [SUSv3] 3498 strtoll [SUSv3] strtoq [LSB] strtoull [SUSv3] strtoumax [SUSv3] 3499 strtouq [LSB] strxfrm [SUSv3] swab [SUSv3] 3500 3501 An LSB conforming implementation shall provide the generic 3502 deprecated functions for String Functions specified in Table 3503 13-18, with the full mandatory functionality as described in 3504 the referenced underlying specification. 3505 3506 Note: These interfaces are deprecated, and applications 3507 should avoid using them. These interfaces may be withdrawn 3508 in future releases of this specification. 3509 3510 Table 13-18. libc - String Functions Deprecated Function 3511 Interfaces 3512 strerror_r [LSB] 3513 __________________________________________________________ 3514 3515 13.3.11. IPC Functions 3516 __________________________________________________________ 3517 3518 13.3.11.1. Interfaces for IPC Functions 3519 3520 An LSB conforming implementation shall provide the generic 3521 functions for IPC Functions specified in Table 13-19, with the 3522 full mandatory functionality as described in the referenced 3523 underlying specification. 3524 3525 Table 13-19. libc - IPC Functions Function Interfaces 3526 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 3527 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 3528 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 3529 __________________________________________________________ 3530 3531 13.3.12. Regular Expressions 3532 __________________________________________________________ 3533 3534 13.3.12.1. Interfaces for Regular Expressions 3535 3536 An LSB conforming implementation shall provide the generic 3537 functions for Regular Expressions specified in Table 13-20, 3538 with the full mandatory functionality as described in the 3539 referenced underlying specification. 3540 3541 Table 13-20. libc - Regular Expressions Function Interfaces 3542 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 3543 __________________________________________________________ 3544 3545 13.3.13. Character Type Functions 3546 __________________________________________________________ 3547 3548 13.3.13.1. Interfaces for Character Type Functions 3549 3550 An LSB conforming implementation shall provide the generic 3551 functions for Character Type Functions specified in Table 3552 13-21, with the full mandatory functionality as described in 3553 the referenced underlying specification. 3554 3555 Table 13-21. libc - Character Type Functions Function 3556 Interfaces 3557 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 3558 __ctype_tolower_loc(GLIBC_2.3) [LSB] 3559 __ctype_toupper_loc(GLIBC_2.3) [LSB] 3560 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 3561 [SUSv3] 3562 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph [SUSv3] 3563 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace [SUSv3] 3564 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 3565 [SUSv3] 3566 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 3567 [SUSv3] 3568 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 3569 [SUSv3] 3570 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 3571 [SUSv3] 3572 tolower [SUSv3] toupper [SUSv3] 3573 __________________________________________________________ 3574 3575 13.3.14. Time Manipulation 3576 __________________________________________________________ 3577 3578 13.3.14.1. Interfaces for Time Manipulation 3579 3580 An LSB conforming implementation shall provide the generic 3581 functions for Time Manipulation specified in Table 13-22, with 3582 the full mandatory functionality as described in the referenced 3583 underlying specification. 3584 3585 Table 13-22. libc - Time Manipulation Function Interfaces 3586 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 3587 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 3588 [SUSv3] 3589 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 3590 [SUSv3] 3591 ualarm [SUSv3] 3592 3593 An LSB conforming implementation shall provide the generic data 3594 interfaces for Time Manipulation specified in Table 13-23, with 3595 the full mandatory functionality as described in the referenced 3596 underlying specification. 3597 3598 Table 13-23. libc - Time Manipulation Data Interfaces 3599 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 3600 [SUSv3] 3601 timezone [SUSv3] tzname [SUSv3] 3602 __________________________________________________________ 3603 3604 13.3.15. Terminal Interface Functions 3605 __________________________________________________________ 3606 3607 13.3.15.1. Interfaces for Terminal Interface Functions 3608 3609 An LSB conforming implementation shall provide the generic 3610 functions for Terminal Interface Functions specified in Table 3611 13-24, with the full mandatory functionality as described in 3612 the referenced underlying specification. 3613 3614 Table 13-24. libc - Terminal Interface Functions Function 3615 Interfaces 3616 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 3617 cfsetispeed [SUSv3] 3618 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 3619 [SUSv3] 3620 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 3621 [SUSv3] 3622 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 3623 __________________________________________________________ 3624 3625 13.3.16. System Database Interface 3626 __________________________________________________________ 3627 3628 13.3.16.1. Interfaces for System Database Interface 3629 3630 An LSB conforming implementation shall provide the generic 3631 functions for System Database Interface specified in Table 3632 13-25, with the full mandatory functionality as described in 3633 the referenced underlying specification. 3634 3635 Table 13-25. libc - System Database Interface Function 3636 Interfaces 3637 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 3638 endservent [SUSv3] 3639 endutent [LSB] endutxent [SUSv3] getgrent [SUSv3] getgrgid 3640 [SUSv3] 3641 getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r [SUSv3] 3642 getgrouplist [LSB] 3643 gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] gethostbyname 3644 [SUSv3] gethostbyname2 [LSB] 3645 gethostbyname2_r [LSB] gethostbyname_r [LSB] getprotobyname 3646 [SUSv3] getprotobynumber [SUSv3] 3647 getprotoent [SUSv3] getpwent [SUSv3] getpwnam [SUSv3] 3648 getpwnam_r [SUSv3] 3649 getpwuid [SUSv3] getpwuid_r [SUSv3] getservbyname [SUSv3] 3650 getservbyport [SUSv3] 3651 getservent [SUSv3] getutent [LSB] getutent_r [LSB] getutxent 3652 [SUSv3] 3653 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] setgrent 3654 [SUSv3] 3655 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] setservent 3656 [SUSv3] 3657 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 3658 3659 An LSB conforming implementation shall provide the generic 3660 deprecated functions for System Database Interface specified in 3661 Table 13-26, with the full mandatory functionality as described 3662 in the referenced underlying specification. 3663 3664 Note: These interfaces are deprecated, and applications 3665 should avoid using them. These interfaces may be withdrawn 3666 in future releases of this specification. 3667 3668 Table 13-26. libc - System Database Interface Deprecated 3669 Function Interfaces 3670 gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] gethostbyname 3671 [SUSv3] gethostbyname2 [LSB] 3672 gethostbyname2_r [LSB] gethostbyname_r [LSB] 3673 __________________________________________________________ 3674 3675 13.3.17. Language Support 3676 __________________________________________________________ 3677 3678 13.3.17.1. Interfaces for Language Support 3679 3680 An LSB conforming implementation shall provide the generic 3681 functions for Language Support specified in Table 13-27, with 3682 the full mandatory functionality as described in the referenced 3683 underlying specification. 3684 3685 Table 13-27. libc - Language Support Function Interfaces 3686 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 3687 __________________________________________________________ 3688 3689 13.3.18. Large File Support 3690 __________________________________________________________ 3691 3692 13.3.18.1. Interfaces for Large File Support 3693 3694 An LSB conforming implementation shall provide the generic 3695 functions for Large File Support specified in Table 13-28, with 3696 the full mandatory functionality as described in the referenced 3697 underlying specification. 3698 3699 Table 13-28. libc - Large File Support Function Interfaces 3700 __fxstat64 [LSB] __lxstat64 [LSB] __xstat64 [LSB] creat64 [LFS] 3701 fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] fseeko64 [LFS] 3702 fsetpos64 [LFS] fstatfs64 [LSB] fstatvfs64 [LFS] ftello64 [LFS] 3703 ftruncate64 [LFS] ftw64 [LFS] getrlimit64 [LFS] lockf64 [LFS] 3704 mkstemp64 [LFS] mmap64 [LFS] nftw64 [LFS] posix_fadvise64 [LSB] 3705 posix_fallocate64 [LSB] readdir64 [LFS] readdir64_r [LSB] 3706 statfs64 [LSB] 3707 statvfs64 [LFS] tmpfile64 [LFS] truncate64 [LFS] 3708 3709 An LSB conforming implementation shall provide the generic 3710 deprecated functions for Large File Support specified in Table 3711 13-29, with the full mandatory functionality as described in 3712 the referenced underlying specification. 3713 3714 Note: These interfaces are deprecated, and applications 3715 should avoid using them. These interfaces may be withdrawn 3716 in future releases of this specification. 3717 3718 Table 13-29. libc - Large File Support Deprecated Function 3719 Interfaces 3720 fstatfs64 [LSB] statfs64 [LSB] 3721 __________________________________________________________ 3722 3723 13.3.19. Standard Library 3724 __________________________________________________________ 3725 3726 13.3.19.1. Interfaces for Standard Library 3727 3728 An LSB conforming implementation shall provide the generic 3729 functions for Standard Library specified in Table 13-30, with 3730 the full mandatory functionality as described in the referenced 3731 underlying specification. 3732 3733 Table 13-30. libc - Standard Library Function Interfaces 3734 _Exit [SUSv3] __assert_fail [LSB] __cxa_atexit [LSB] 3735 __cxa_finalize [LSB] 3736 __errno_location [LSB] __fpending [LSB] __getpagesize [LSB] 3737 __isinf [LSB] 3738 __isinff [LSB] __isinfl [LSB] __isnan [LSB] __isnanf [LSB] 3739 __isnanl [LSB] __sysconf [LSB] __xpg_basename [LSB] _exit 3740 [SUSv3] 3741 _longjmp [SUSv3] _setjmp [SUSv3] a64l [SUSv3] abort [SUSv3] 3742 abs [SUSv3] atof [SUSv3] atoi [SUSv3] atol [SUSv3] 3743 atoll [SUSv3] basename [LSB] bsearch [SUSv3] calloc [SUSv3] 3744 closelog [SUSv3] confstr [SUSv3] cuserid [SUSv2] daemon [LSB] 3745 dirname [SUSv3] div [SUSv3] drand48 [SUSv3] ecvt [SUSv3] 3746 erand48 [SUSv3] err [LSB] error [LSB] errx [LSB] 3747 fcvt [SUSv3] fmtmsg [SUSv3] fnmatch [SUSv3] fpathconf [SUSv3] 3748 free [SUSv3] freeaddrinfo [SUSv3] ftrylockfile [SUSv3] ftw 3749 [SUSv3] 3750 funlockfile [SUSv3] gai_strerror [SUSv3] gcvt [SUSv3] 3751 getaddrinfo [SUSv3] 3752 getcwd [SUSv3] getdate [SUSv3] getdomainname [LSB] getenv 3753 [SUSv3] 3754 getlogin [SUSv3] getlogin_r [SUSv3] getnameinfo [SUSv3] getopt 3755 [LSB] 3756 getopt_long [LSB] getopt_long_only [LSB] getsubopt [SUSv3] 3757 gettimeofday [SUSv3] 3758 glob [SUSv3] glob64 [LSB] globfree [SUSv3] globfree64 [LSB] 3759 grantpt [SUSv3] hcreate [SUSv3] hdestroy [SUSv3] hsearch 3760 [SUSv3] 3761 htonl [SUSv3] htons [SUSv3] imaxabs [SUSv3] imaxdiv [SUSv3] 3762 inet_addr [SUSv3] inet_aton [LSB] inet_ntoa [SUSv3] inet_ntop 3763 [SUSv3] 3764 inet_pton [SUSv3] initstate [SUSv3] insque [SUSv3] isatty 3765 [SUSv3] 3766 isblank [SUSv3] jrand48 [SUSv3] l64a [SUSv3] labs [SUSv3] 3767 lcong48 [SUSv3] ldiv [SUSv3] lfind [SUSv3] llabs [SUSv3] 3768 lldiv [SUSv3] longjmp [SUSv3] lrand48 [SUSv3] lsearch [SUSv3] 3769 makecontext [SUSv3] malloc [SUSv3] memmem [LSB] mkstemp [SUSv3] 3770 mktemp [SUSv3] mrand48 [SUSv3] nftw [SUSv3] nrand48 [SUSv3] 3771 ntohl [SUSv3] ntohs [SUSv3] openlog [SUSv3] perror [SUSv3] 3772 posix_openpt [SUSv3] ptsname [SUSv3] putenv [SUSv3] qsort 3773 [SUSv3] 3774 rand [SUSv3] rand_r [SUSv3] random [SUSv3] realloc [SUSv3] 3775 realpath [SUSv3] remque [SUSv3] seed48 [SUSv3] setenv [SUSv3] 3776 sethostname [LSB] setlogmask [SUSv3] setstate [SUSv3] srand 3777 [SUSv3] 3778 srand48 [SUSv3] srandom [SUSv3] strtod [SUSv3] strtol [SUSv3] 3779 strtoul [SUSv3] swapcontext [SUSv3] syslog [SUSv3] system [LSB] 3780 tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] tmpnam [SUSv3] 3781 tsearch [SUSv3] ttyname [SUSv3] ttyname_r [SUSv3] twalk [SUSv3] 3782 unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] verrx [LSB] 3783 vfscanf [LSB] vscanf [LSB] vsscanf [LSB] vsyslog [LSB] 3784 warn [LSB] warnx [LSB] wordexp [SUSv3] wordfree [SUSv3] 3785 3786 An LSB conforming implementation shall provide the generic 3787 deprecated functions for Standard Library specified in Table 3788 13-31, with the full mandatory functionality as described in 3789 the referenced underlying specification. 3790 3791 Note: These interfaces are deprecated, and applications 3792 should avoid using them. These interfaces may be withdrawn 3793 in future releases of this specification. 3794 3795 Table 13-31. libc - Standard Library Deprecated Function 3796 Interfaces 3797 basename [LSB] getdomainname [LSB] inet_aton [LSB] 3798 3799 An LSB conforming implementation shall provide the generic data 3800 interfaces for Standard Library specified in Table 13-32, with 3801 the full mandatory functionality as described in the referenced 3802 underlying specification. 3803 3804 Table 13-32. libc - Standard Library Data Interfaces 3805 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 3806 [SUSv3] 3807 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 3808 [SUSv3] 3809 optopt [SUSv3] 3810 __________________________________________________________ 3811 3812 13.4. Data Definitions for libc 3813 3814 This section defines global identifiers and their values that 3815 are associated with interfaces contained in libc. These 3816 definitions are organized into groups that correspond to system 3817 headers. This convention is used as a convenience for the 3818 reader, and does not imply the existence of these headers, or 3819 their content. Where an interface is defined as requiring a 3820 particular system header file all of the data definitions for 3821 that system header file presented here shall be in effect. 3822 3823 This section gives data definitions to promote binary 3824 application portability, not to repeat source interface 3825 definitions available elsewhere. System providers and 3826 application developers should use this ABI to supplement - not 3827 to replace - source interface definition specifications. 3828 3829 This specification uses the ISO C (1999) C Language as the 3830 reference programming language, and data definitions are 3831 specified in ISO C format. The C language is used here as a 3832 convenient notation. Using a C language description of these 3833 data objects does not preclude their use by other programming 3834 languages. 3835 __________________________________________________________ 3836 3837 13.4.1. arpa/inet.h 3838 3839 extern uint32_t htonl(uint32_t); 3840 extern uint16_t htons(uint16_t); 3841 extern in_addr_t inet_addr(const char *); 3842 extern int inet_aton(const char *, struct in_addr *); 3843 extern char *inet_ntoa(struct in_addr); 3844 extern const char *inet_ntop(int, const void *, char *, socklen_t); 3845 extern int inet_pton(int, const char *, void *); 3846 extern uint32_t ntohl(uint32_t); 3847 extern uint16_t ntohs(uint16_t); 3848 __________________________________________________________ 3849 3850 13.4.2. assert.h 3851 3852 The assert.h header shall define the assert() macro. It refers 3853 to the macro NDEBUG, which is not defined in this header. If 3854 NDEBUG is defined before the inclusion of this header, the 3855 assert() macro shall be defined as described below, otherwise 3856 the macro shall behave as described in assert() in ISO/IEC 9945 3857 POSIX. 3858 extern void __assert_fail(const char *, const char *, unsigned int, 3859 const char *); 3860 __________________________________________________________ 3861 3862 13.4.3. ctype.h 3863 3864 extern int _tolower(int); 3865 extern int _toupper(int); 3866 extern int isalnum(int); 3867 extern int isalpha(int); 3868 extern int isascii(int); 3869 extern int iscntrl(int); 3870 extern int isdigit(int); 3871 extern int isgraph(int); 3872 extern int islower(int); 3873 extern int isprint(int); 3874 extern int ispunct(int); 3875 extern int isspace(int); 3876 extern int isupper(int); 3877 extern int isxdigit(int); 3878 extern int toascii(int); 3879 extern int tolower(int); 3880 extern int toupper(int); 3881 extern int isblank(int); 3882 extern const unsigned short **__ctype_b_loc(void); 3883 extern const int32_t **__ctype_toupper_loc(void); 3884 extern const int32_t **__ctype_tolower_loc(void); 3885 __________________________________________________________ 3886 3887 13.4.4. dirent.h 3888 3889 typedef struct __dirstream DIR; 3890 3891 struct dirent { 3892 long int d_ino; 3893 off_t d_off; 3894 unsigned short d_reclen; 3895 unsigned char d_type; 3896 char d_name[256]; 3897 }; 3898 struct dirent64 { 3899 uint64_t d_ino; 3900 int64_t d_off; 3901 unsigned short d_reclen; 3902 unsigned char d_type; 3903 char d_name[256]; 3904 }; 3905 extern int readdir64_r(DIR *, struct dirent64 *, struct dirent64 **); 3906 extern void rewinddir(DIR *); 3907 extern void seekdir(DIR *, long int); 3908 extern long int telldir(DIR *); 3909 extern int closedir(DIR *); 3910 extern DIR *opendir(const char *); 3911 extern struct dirent *readdir(DIR *); 3912 extern struct dirent64 *readdir64(DIR *); 3913 extern int readdir_r(DIR *, struct dirent *, struct dirent **); 3914 __________________________________________________________ 3915 3916 13.4.5. err.h 3917 3918 extern void err(int, const char *, ...); 3919 extern void errx(int, const char *, ...); 3920 extern void warn(const char *, ...); 3921 extern void warnx(const char *, ...); 3922 extern void error(int, int, const char *, ...); 3923 __________________________________________________________ 3924 3925 13.4.6. errno.h 3926 3927 ISO POSIX (2003) requires that each error value shall be 3928 unique, with permission for EAGAIN and EWOULDBLOCK possibly 3929 having the same value. This specification also requires that 3930 ENOTSUP and EOPNOTSUPP have the same value. 3931 3932 Note: A defect report against ISO POSIX (2003) has been 3933 filed to request that specification also permit these two 3934 symbols to have the same value. 3935 3936 #define errno (*__errno_location()) 3937 3938 #define EPERM 1 3939 #define ECHILD 10 3940 #define ENETDOWN 100 3941 #define ENETUNREACH 101 3942 #define ENETRESET 102 3943 #define ECONNABORTED 103 3944 #define ECONNRESET 104 3945 #define ENOBUFS 105 3946 #define EISCONN 106 3947 #define ENOTCONN 107 3948 #define ESHUTDOWN 108 3949 #define ETOOMANYREFS 109 3950 #define EAGAIN 11 3951 #define ETIMEDOUT 110 3952 #define ECONNREFUSED 111 3953 #define EHOSTDOWN 112 3954 #define EHOSTUNREACH 113 3955 #define EALREADY 114 3956 #define EINPROGRESS 115 3957 #define ESTALE 116 3958 #define EUCLEAN 117 3959 #define ENOTNAM 118 3960 #define ENAVAIL 119 3961 #define ENOMEM 12 3962 #define EISNAM 120 3963 #define EREMOTEIO 121 3964 #define EDQUOT 122 3965 #define ENOMEDIUM 123 3966 #define EMEDIUMTYPE 124 3967 #define ECANCELED 125 3968 #define EACCES 13 3969 #define EFAULT 14 3970 #define ENOTBLK 15 3971 #define EBUSY 16 3972 #define EEXIST 17 3973 #define EXDEV 18 3974 #define ENODEV 19 3975 #define ENOENT 2 3976 #define ENOTDIR 20 3977 #define EISDIR 21 3978 #define EINVAL 22 3979 #define ENFILE 23 3980 #define EMFILE 24 3981 #define ENOTTY 25 3982 #define ETXTBSY 26 3983 #define EFBIG 27 3984 #define ENOSPC 28 3985 #define ESPIPE 29 3986 #define ESRCH 3 3987 #define EROFS 30 3988 #define EMLINK 31 3989 #define EPIPE 32 3990 #define EDOM 33 3991 #define ERANGE 34 3992 #define EDEADLK 35 3993 #define ENAMETOOLONG 36 3994 #define ENOLCK 37 3995 #define ENOSYS 38 3996 #define ENOTEMPTY 39 3997 #define EINTR 4 3998 #define ELOOP 40 3999 #define ENOMSG 42 4000 #define EIDRM 43 4001 #define ECHRNG 44 4002 #define EL2NSYNC 45 4003 #define EL3HLT 46 4004 #define EL3RST 47 4005 #define ELNRNG 48 4006 #define EUNATCH 49 4007 #define EIO 5 4008 #define ENOANO 55 4009 #define EBADRQC 56 4010 #define EBADSLT 57 4011 #define EBFONT 59 4012 #define ENXIO 6 4013 #define ENOSTR 60 4014 #define ENODATA 61 4015 #define ETIME 62 4016 #define ENOSR 63 4017 #define ENONET 64 4018 #define ENOPKG 65 4019 #define EREMOTE 66 4020 #define ENOLINK 67 4021 #define EADV 68 4022 #define ESRMNT 69 4023 #define E2BIG 7 4024 #define ECOMM 70 4025 #define EPROTO 71 4026 #define EMULTIHOP 72 4027 #define EDOTDOT 73 4028 #define EBADMSG 74 4029 #define EOVERFLOW 75 4030 #define ENOTUNIQ 76 4031 #define EBADFD 77 4032 #define EREMCHG 78 4033 #define ELIBACC 79 4034 #define ENOEXEC 8 4035 #define ELIBBAD 80 4036 #define ELIBSCN 81 4037 #define ELIBMAX 82 4038 #define ELIBEXEC 83 4039 #define EILSEQ 84 4040 #define ERESTART 85 4041 #define ESTRPIPE 86 4042 #define EUSERS 87 4043 #define ENOTSOCK 88 4044 #define EDESTADDRREQ 89 4045 #define EBADF 9 4046 #define EMSGSIZE 90 4047 #define EPROTOTYPE 91 4048 #define ENOPROTOOPT 92 4049 #define EPROTONOSUPPORT 93 4050 #define ESOCKTNOSUPPORT 94 4051 #define EOPNOTSUPP 95 4052 #define EPFNOSUPPORT 96 4053 #define EAFNOSUPPORT 97 4054 #define EADDRINUSE 98 4055 #define EADDRNOTAVAIL 99 4056 #define EWOULDBLOCK EAGAIN 4057 #define ENOTSUP EOPNOTSUPP 4058 4059 extern int *__errno_location(void); 4060 __________________________________________________________ 4061 4062 13.4.7. fcntl.h 4063 4064 #define O_RDONLY 00 4065 #define O_ACCMODE 0003 4066 #define O_WRONLY 01 4067 #define O_CREAT 0100 4068 #define O_TRUNC 01000 4069 #define O_SYNC 010000 4070 #define O_RDWR 02 4071 #define O_EXCL 0200 4072 #define O_APPEND 02000 4073 #define O_ASYNC 020000 4074 #define O_NOCTTY 0400 4075 #define O_NDELAY 04000 4076 #define O_NONBLOCK 04000 4077 #define FD_CLOEXEC 1 4078 4079 struct flock { 4080 short l_type; 4081 short l_whence; 4082 off_t l_start; 4083 off_t l_len; 4084 pid_t l_pid; 4085 }; 4086 struct flock64 { 4087 short l_type; 4088 short l_whence; 4089 loff_t l_start; 4090 loff_t l_len; 4091 pid_t l_pid; 4092 }; 4093 4094 #define F_DUPFD 0 4095 #define F_RDLCK 0 4096 #define F_GETFD 1 4097 #define F_WRLCK 1 4098 #define F_SETSIG 10 4099 #define F_GETSIG 11 4100 #define F_SETFD 2 4101 #define F_UNLCK 2 4102 #define F_GETFL 3 4103 #define F_SETFL 4 4104 #define F_GETLK 5 4105 #define F_SETLK 6 4106 #define F_SETLKW 7 4107 #define F_SETOWN 8 4108 #define F_GETOWN 9 4109 4110 extern int posix_fadvise(int, off_t, off_t, int); 4111 extern int posix_fallocate(int, off_t, off_t); 4112 extern int posix_fadvise64(int, off64_t, off64_t, int); 4113 extern int posix_fallocate64(int, off64_t, off64_t); 4114 extern int creat(const char *, mode_t); 4115 extern int creat64(const char *, mode_t); 4116 extern int fcntl(int, int, ...); 4117 extern int open(const char *, int, ...); 4118 extern int open64(const char *, int, ...); 4119 __________________________________________________________ 4120 4121 13.4.8. fmtmsg.h 4122 4123 #define MM_HARD 1 4124 #define MM_NRECOV 128 4125 #define MM_UTIL 16 4126 #define MM_SOFT 2 4127 #define MM_OPSYS 32 4128 #define MM_FIRM 4 4129 #define MM_RECOVER 64 4130 #define MM_APPL 8 4131 4132 #define MM_NOSEV 0 4133 #define MM_HALT 1 4134 #define MM_ERROR 2 4135 4136 #define MM_NULLLBL ((char *) 0) 4137 4138 extern int fmtmsg(long int, const char *, int, const char *, const char*, 4139 const char *); 4140 __________________________________________________________ 4141 4142 13.4.9. fnmatch.h 4143 4144 #define FNM_PATHNAME (1<<0) 4145 #define FNM_NOESCAPE (1<<1) 4146 #define FNM_PERIOD (1<<2) 4147 #define FNM_NOMATCH 1 4148 4149 extern int fnmatch(const char *, const char *, int); 4150 __________________________________________________________ 4151 4152 13.4.10. ftw.h 4153 4154 #define FTW_D FTW_D 4155 #define FTW_DNR FTW_DNR 4156 #define FTW_DP FTW_DP 4157 #define FTW_F FTW_F 4158 #define FTW_NS FTW_NS 4159 #define FTW_SL FTW_SL 4160 #define FTW_SLN FTW_SLN 4161 4162 enum { 4163 FTW_F, 4164 FTW_D, 4165 FTW_DNR, 4166 FTW_NS, 4167 FTW_SL, 4168 FTW_DP, 4169 FTW_SLN 4170 }; 4171 4172 enum { 4173 FTW_PHYS = 1, 4174 FTW_MOUNT = 2, 4175 FTW_CHDIR = 4, 4176 FTW_DEPTH = 8 4177 }; 4178 4179 struct FTW { 4180 int base; 4181 int level; 4182 }; 4183 4184 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 4185 int __flag); 4186 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 4187 int __flag); 4188 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 4189 int __flag, struct FTW * __info); 4190 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 4191 int __flag, struct FTW * __info); 4192 extern int ftw(const char *, __ftw_func_t, int); 4193 extern int ftw64(const char *, __ftw64_func_t, int); 4194 extern int nftw(const char *, __nftw_func_t, int, int); 4195 extern int nftw64(const char *, __nftw64_func_t, int, int); 4196 __________________________________________________________ 4197 4198 13.4.11. getopt.h 4199 4200 #define no_argument 0 4201 #define required_argument 1 4202 #define optional_argument 2 4203 4204 struct option { 4205 const char *name; 4206 int has_arg; 4207 int *flag; 4208 int val; 4209 }; 4210 extern int getopt_long(int, char *const, const char *, 4211 const struct option *, int *); 4212 extern int getopt_long_only(int, char *const, const char *, 4213 const struct option *, int *); 4214 __________________________________________________________ 4215 4216 13.4.12. glob.h 4217 4218 #define GLOB_ERR (1<<0) 4219 #define GLOB_MARK (1<<1) 4220 #define GLOB_BRACE (1<<10) 4221 #define GLOB_NOMAGIC (1<<11) 4222 #define GLOB_TILDE (1<<12) 4223 #define GLOB_ONLYDIR (1<<13) 4224 #define GLOB_TILDE_CHECK (1<<14) 4225 #define GLOB_NOSORT (1<<2) 4226 #define GLOB_DOOFFS (1<<3) 4227 #define GLOB_NOCHECK (1<<4) 4228 #define GLOB_APPEND (1<<5) 4229 #define GLOB_NOESCAPE (1<<6) 4230 #define GLOB_PERIOD (1<<7) 4231 #define GLOB_MAGCHAR (1<<8) 4232 #define GLOB_ALTDIRFUNC (1<<9) 4233 4234 #define GLOB_NOSPACE 1 4235 #define GLOB_ABORTED 2 4236 #define GLOB_NOMATCH 3 4237 #define GLOB_NOSYS 4 4238 4239 typedef struct { 4240 size_t gl_pathc; 4241 char **gl_pathv; 4242 size_t gl_offs; 4243 int gl_flags; 4244 void (*gl_closedir) (void *); 4245 struct dirent *(*gl_readdir) (void *); 4246 void *(*gl_opendir) (const char *); 4247 int (*gl_lstat) (const char *, struct stat *); 4248 int (*gl_stat) (const char *, struct stat *); 4249 } glob_t; 4250 4251 typedef struct { 4252 size_t gl_pathc; 4253 char **gl_pathv; 4254 size_t gl_offs; 4255 int gl_flags; 4256 void (*gl_closedir) (void *); 4257 struct dirent64 *(*gl_readdir) (void *); 4258 void *(*gl_opendir) (const char *); 4259 int (*gl_lstat) (const char *, struct stat *); 4260 int (*gl_stat) (const char *, struct stat *); 4261 } glob64_t; 4262 extern int glob(const char *, int, int (*gl_stat) (const char *p1, int p2) 4263 , glob_t *); 4264 extern int glob64(const char *, int, 4265 int (*gl_stat) (const char *p1, int p2) 4266 , glob64_t *); 4267 extern void globfree(glob_t *); 4268 extern void globfree64(glob64_t *); 4269 __________________________________________________________ 4270 4271 13.4.13. grp.h 4272 4273 struct group { 4274 char *gr_name; 4275 char *gr_passwd; 4276 gid_t gr_gid; 4277 char **gr_mem; 4278 }; 4279 4280 extern void endgrent(void); 4281 extern struct group *getgrent(void); 4282 extern struct group *getgrgid(gid_t); 4283 extern struct group *getgrnam(const char *); 4284 extern int initgroups(const char *, gid_t); 4285 extern void setgrent(void); 4286 extern int setgroups(size_t, const gid_t *); 4287 extern int getgrgid_r(gid_t, struct group *, char *, size_t, 4288 struct group **); 4289 extern int getgrnam_r(const char *, struct group *, char *, size_t, 4290 struct group **); 4291 extern int getgrouplist(const char *, gid_t, gid_t *, int *); 4292 __________________________________________________________ 4293 4294 13.4.14. iconv.h 4295 4296 typedef void *iconv_t; 4297 extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); 4298 extern int iconv_close(iconv_t); 4299 extern iconv_t iconv_open(const char *, const char *); 4300 __________________________________________________________ 4301 4302 13.4.15. inttypes.h 4303 4304 typedef lldiv_t imaxdiv_t; 4305 4306 extern intmax_t strtoimax(const char *, char **, int); 4307 extern uintmax_t strtoumax(const char *, char **, int); 4308 extern intmax_t wcstoimax(const wchar_t *, wchar_t * *, int); 4309 extern uintmax_t wcstoumax(const wchar_t *, wchar_t * *, int); 4310 extern intmax_t imaxabs(intmax_t); 4311 extern imaxdiv_t imaxdiv(intmax_t, intmax_t); 4312 __________________________________________________________ 4313 4314 13.4.16. langinfo.h 4315 4316 #define ABDAY_1 0x20000 4317 #define ABDAY_2 0x20001 4318 #define ABDAY_3 0x20002 4319 #define ABDAY_4 0x20003 4320 #define ABDAY_5 0x20004 4321 #define ABDAY_6 0x20005 4322 #define ABDAY_7 0x20006 4323 4324 #define DAY_1 0x20007 4325 #define DAY_2 0x20008 4326 #define DAY_3 0x20009 4327 #define DAY_4 0x2000A 4328 #define DAY_5 0x2000B 4329 #define DAY_6 0x2000C 4330 #define DAY_7 0x2000D 4331 4332 #define ABMON_1 0x2000E 4333 #define ABMON_2 0x2000F 4334 #define ABMON_3 0x20010 4335 #define ABMON_4 0x20011 4336 #define ABMON_5 0x20012 4337 #define ABMON_6 0x20013 4338 #define ABMON_7 0x20014 4339 #define ABMON_8 0x20015 4340 #define ABMON_9 0x20016 4341 #define ABMON_10 0x20017 4342 #define ABMON_11 0x20018 4343 #define ABMON_12 0x20019 4344 4345 #define MON_1 0x2001A 4346 #define MON_2 0x2001B 4347 #define MON_3 0x2001C 4348 #define MON_4 0x2001D 4349 #define MON_5 0x2001E 4350 #define MON_6 0x2001F 4351 #define MON_7 0x20020 4352 #define MON_8 0x20021 4353 #define MON_9 0x20022 4354 #define MON_10 0x20023 4355 #define MON_11 0x20024 4356 #define MON_12 0x20025 4357 4358 #define AM_STR 0x20026 4359 #define PM_STR 0x20027 4360 4361 #define D_T_FMT 0x20028 4362 #define D_FMT 0x20029 4363 #define T_FMT 0x2002A 4364 #define T_FMT_AMPM 0x2002B 4365 4366 #define ERA 0x2002C 4367 #define ERA_D_FMT 0x2002E 4368 #define ALT_DIGITS 0x2002F 4369 #define ERA_D_T_FMT 0x20030 4370 #define ERA_T_FMT 0x20031 4371 4372 #define CODESET 14 4373 4374 #define CRNCYSTR 0x4000F 4375 4376 #define RADIXCHAR 0x10000 4377 #define THOUSEP 0x10001 4378 #define YESEXPR 0x50000 4379 #define NOEXPR 0x50001 4380 #define YESSTR 0x50002 4381 #define NOSTR 0x50003 4382 4383 extern char *nl_langinfo(nl_item); 4384 __________________________________________________________ 4385 4386 13.4.17. libgen.h 4387 4388 #define basename __xpg_basename 4389 4390 extern char *dirname(char *); 4391 extern char *__xpg_basename(char *); 4392 __________________________________________________________ 4393 4394 13.4.18. libintl.h 4395 4396 extern char *bindtextdomain(const char *, const char *); 4397 extern char *dcgettext(const char *, const char *, int); 4398 extern char *dgettext(const char *, const char *); 4399 extern char *gettext(const char *); 4400 extern char *textdomain(const char *); 4401 extern char *bind_textdomain_codeset(const char *, const char *); 4402 extern char *dcngettext(const char *, const char *, const char *, 4403 unsigned long int, int); 4404 extern char *dngettext(const char *, const char *, const char *, 4405 unsigned long int); 4406 extern char *ngettext(const char *, const char *, unsigned long int); 4407 __________________________________________________________ 4408 4409 13.4.19. limits.h 4410 4411 #define LLONG_MIN (-LLONG_MAX-1LL) 4412 #define _POSIX_AIO_MAX 1 4413 #define _POSIX_QLIMIT 1 4414 #define _POSIX2_BC_STRING_MAX 1000 4415 #define _POSIX2_CHARCLASS_NAME_MAX 14 4416 #define _POSIX_NAME_MAX 14 4417 #define _POSIX_UIO_MAXIOV 16 4418 #define ULLONG_MAX 18446744073709551615ULL 4419 #define _POSIX2_COLL_WEIGHTS_MAX 2 4420 #define _POSIX_AIO_LISTIO_MAX 2 4421 #define _POSIX_OPEN_MAX 20 4422 #define _POSIX_CLOCKRES_MIN 20000000 4423 #define CHARCLASS_NAME_MAX 2048 4424 #define LINE_MAX 2048 4425 #define _POSIX2_BC_DIM_MAX 2048 4426 #define _POSIX2_LINE_MAX 2048 4427 #define _POSIX_CHILD_MAX 25 4428 #define COLL_WEIGHTS_MAX 255 4429 #define _POSIX2_RE_DUP_MAX 255 4430 #define _POSIX_HOST_NAME_MAX 255 4431 #define _POSIX_MAX_CANON 255 4432 #define _POSIX_MAX_INPUT 255 4433 #define _POSIX_RE_DUP_MAX 255 4434 #define _POSIX_SYMLINK_MAX 255 4435 #define OPEN_MAX 256 4436 #define _POSIX_PATH_MAX 256 4437 #define _POSIX_SEM_NSEMS_MAX 256 4438 #define _POSIX2_EXPR_NEST_MAX 32 4439 #define _POSIX_DELAYTIMER_MAX 32 4440 #define _POSIX_MQ_PRIO_MAX 32 4441 #define _POSIX_SIGQUEUE_MAX 32 4442 #define _POSIX_TIMER_MAX 32 4443 #define _POSIX_SEM_VALUE_MAX 32767 4444 #define _POSIX_SSIZE_MAX 32767 4445 #define PATH_MAX 4096 4446 #define _POSIX_ARG_MAX 4096 4447 #define _POSIX_PIPE_BUF 512 4448 #define _POSIX_TZNAME_MAX 6 4449 #define _POSIX_LINK_MAX 8 4450 #define _POSIX_MQ_OPEN_MAX 8 4451 #define _POSIX_NGROUPS_MAX 8 4452 #define _POSIX_RTSIG_MAX 8 4453 #define _POSIX_STREAM_MAX 8 4454 #define _POSIX_SYMLOOP_MAX 8 4455 #define _POSIX_LOGIN_NAME_MAX 9 4456 #define _POSIX_TTY_NAME_MAX 9 4457 #define LLONG_MAX 9223372036854775807LL 4458 #define _POSIX2_BC_BASE_MAX 99 4459 #define _POSIX2_BC_SCALE_MAX 99 4460 #define SSIZE_MAX LONG_MAX 4461 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX 4462 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX 4463 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX 4464 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX 4465 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX 4466 #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX 4467 #define _POSIX_HIWAT _POSIX_PIPE_BUF 4468 4469 #define MB_LEN_MAX 16 4470 4471 #define SCHAR_MIN (-128) 4472 #define SCHAR_MAX 127 4473 #define UCHAR_MAX 255 4474 #define CHAR_BIT 8 4475 4476 #define SHRT_MIN (-32768) 4477 #define SHRT_MAX 32767 4478 #define USHRT_MAX 65535 4479 4480 #define INT_MIN (-INT_MAX-1) 4481 #define INT_MAX 2147483647 4482 #define UINT_MAX 4294967295U 4483 4484 #define LONG_MIN (-LONG_MAX-1L) 4485 4486 #define PTHREAD_KEYS_MAX 1024 4487 #define PTHREAD_THREADS_MAX 16384 4488 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 4489 __________________________________________________________ 4490 4491 13.4.20. locale.h 4492 4493 struct lconv { 4494 char *decimal_point; 4495 char *thousands_sep; 4496 char *grouping; 4497 char *int_curr_symbol; 4498 char *currency_symbol; 4499 char *mon_decimal_point; 4500 char *mon_thousands_sep; 4501 char *mon_grouping; 4502 char *positive_sign; 4503 char *negative_sign; 4504 char int_frac_digits; 4505 char frac_digits; 4506 char p_cs_precedes; 4507 char p_sep_by_space; 4508 char n_cs_precedes; 4509 char n_sep_by_space; 4510 char p_sign_posn; 4511 char n_sign_posn; 4512 char int_p_cs_precedes; 4513 char int_p_sep_by_space; 4514 char int_n_cs_precedes; 4515 char int_n_sep_by_space; 4516 char int_p_sign_posn; 4517 char int_n_sign_posn; 4518 }; 4519 4520 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 4521 #define LC_CTYPE 0 4522 #define LC_NUMERIC 1 4523 #define LC_TELEPHONE 10 4524 #define LC_MEASUREMENT 11 4525 #define LC_IDENTIFICATION 12 4526 #define LC_TIME 2 4527 #define LC_COLLATE 3 4528 #define LC_MONETARY 4 4529 #define LC_MESSAGES 5 4530 #define LC_ALL 6 4531 #define LC_PAPER 7 4532 #define LC_NAME 8 4533 #define LC_ADDRESS 9 4534 4535 struct __locale_struct { 4536 struct locale_data *__locales[13]; 4537 const unsigned short *__ctype_b; 4538 const int *__ctype_tolower; 4539 const int *__ctype_toupper; 4540 const char *__names[13]; 4541 }; 4542 typedef struct __locale_struct *__locale_t; 4543 4544 typedef struct __locale_struct *locale_t; 4545 4546 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 4547 #define LC_COLLATE_MASK (1 << LC_COLLATE) 4548 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 4549 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 4550 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 4551 #define LC_MONETARY_MASK (1 << LC_MONETARY) 4552 #define LC_NAME_MASK (1 << LC_NAME) 4553 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 4554 #define LC_PAPER_MASK (1 << LC_PAPER) 4555 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 4556 #define LC_TIME_MASK (1 << LC_TIME) 4557 #define LC_CTYPE_MASK (1<ah_ops->ah_destroy))(auth)) 4956 4957 enum auth_stat { 4958 AUTH_OK = 0, 4959 AUTH_BADCRED = 1, 4960 AUTH_REJECTEDCRED = 2, 4961 AUTH_BADVERF = 3, 4962 AUTH_REJECTEDVERF = 4, 4963 AUTH_TOOWEAK = 5, 4964 AUTH_INVALIDRESP = 6, 4965 AUTH_FAILED = 7 4966 }; 4967 4968 union des_block { 4969 struct { 4970 u_int32_t high; 4971 u_int32_t low; 4972 } key; 4973 char c[8]; 4974 }; 4975 4976 struct opaque_auth { 4977 enum_t oa_flavor; 4978 caddr_t oa_base; 4979 u_int oa_length; 4980 }; 4981 4982 typedef struct AUTH { 4983 struct opaque_auth ah_cred; 4984 struct opaque_auth ah_verf; 4985 union des_block ah_key; 4986 struct auth_ops *ah_ops; 4987 caddr_t ah_private; 4988 } AUTH; 4989 4990 struct auth_ops { 4991 void (*ah_nextverf) (struct AUTH *); 4992 int (*ah_marshal) (struct AUTH *, XDR *); 4993 int (*ah_validate) (struct AUTH *, struct opaque_auth *); 4994 int (*ah_refresh) (struct AUTH *); 4995 void (*ah_destroy) (struct AUTH *); 4996 }; 4997 extern struct AUTH *authnone_create(void); 4998 extern int key_decryptsession(char *, union des_block *); 4999 extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); 5000 __________________________________________________________ 5001 5002 13.4.34. rpc/clnt.h 5003 5004 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 5005 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 5006 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 5007 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 5008 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 5009 #define NULLPROC ((u_long)0) 5010 #define CLSET_TIMEOUT 1 5011 #define CLGET_XID 10 5012 #define CLSET_XID 11 5013 #define CLGET_VERS 12 5014 #define CLSET_VERS 13 5015 #define CLGET_PROG 14 5016 #define CLSET_PROG 15 5017 #define CLGET_TIMEOUT 2 5018 #define CLGET_SERVER_ADDR 3 5019 #define CLSET_RETRY_TIMEOUT 4 5020 #define CLGET_RETRY_TIMEOUT 5 5021 #define CLGET_FD 6 5022 #define CLGET_SVC_ADDR 7 5023 #define CLSET_FD_CLOSE 8 5024 #define CLSET_FD_NCLOSE 9 5025 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 5026 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 5027 5028 enum clnt_stat { 5029 RPC_SUCCESS = 0, 5030 RPC_CANTENCODEARGS = 1, 5031 RPC_CANTDECODERES = 2, 5032 RPC_CANTSEND = 3, 5033 RPC_CANTRECV = 4, 5034 RPC_TIMEDOUT = 5, 5035 RPC_VERSMISMATCH = 6, 5036 RPC_AUTHERROR = 7, 5037 RPC_PROGUNAVAIL = 8, 5038 RPC_PROGVERSMISMATCH = 9, 5039 RPC_PROCUNAVAIL = 10, 5040 RPC_CANTDECODEARGS = 11, 5041 RPC_SYSTEMERROR = 12, 5042 RPC_NOBROADCAST = 21, 5043 RPC_UNKNOWNHOST = 13, 5044 RPC_UNKNOWNPROTO = 17, 5045 RPC_UNKNOWNADDR = 19, 5046 RPC_RPCBFAILURE = 14, 5047 RPC_PROGNOTREGISTERED = 15, 5048 RPC_N2AXLATEFAILURE = 22, 5049 RPC_FAILED = 16, 5050 RPC_INTR = 18, 5051 RPC_TLIERROR = 20, 5052 RPC_UDERROR = 23, 5053 RPC_INPROGRESS = 24, 5054 RPC_STALERACHANDLE = 25 5055 }; 5056 struct rpc_err { 5057 enum clnt_stat re_status; 5058 union { 5059 int RE_errno; 5060 enum auth_stat RE_why; 5061 struct { 5062 u_long low; 5063 u_long high; 5064 } RE_vers; 5065 struct { 5066 long int s1; 5067 long int s2; 5068 } RE_lb; 5069 } ru; 5070 }; 5071 5072 typedef struct CLIENT { 5073 struct AUTH *cl_auth; 5074 struct clnt_ops *cl_ops; 5075 caddr_t cl_private; 5076 } CLIENT; 5077 5078 struct clnt_ops { 5079 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 5080 xdrproc_t, caddr_t, struct timeval); 5081 void (*cl_abort) (void); 5082 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 5083 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 5084 void (*cl_destroy) (struct CLIENT *); 5085 bool_t(*cl_control) (struct CLIENT *, int, char *); 5086 }; 5087 extern struct CLIENT *clnt_create(const char *, const u_long, const u_long, 5088 const char *); 5089 extern void clnt_pcreateerror(const char *); 5090 extern void clnt_perrno(enum clnt_stat); 5091 extern void clnt_perror(struct CLIENT *, const char *); 5092 extern char *clnt_spcreateerror(const char *); 5093 extern char *clnt_sperrno(enum clnt_stat); 5094 extern char *clnt_sperror(struct CLIENT *, const char *); 5095 __________________________________________________________ 5096 5097 13.4.35. rpc/pmap_clnt.h 5098 5099 extern u_short pmap_getport(struct sockaddr_in *, const u_long, 5100 const u_long, u_int); 5101 extern bool_t pmap_set(const u_long, const u_long, int, u_short); 5102 extern bool_t pmap_unset(u_long, u_long); 5103 __________________________________________________________ 5104 5105 13.4.36. rpc/rpc_msg.h 5106 5107 enum msg_type { 5108 CALL = 0, 5109 REPLY = 1 5110 }; 5111 enum reply_stat { 5112 MSG_ACCEPTED = 0, 5113 MSG_DENIED = 1 5114 }; 5115 enum accept_stat { 5116 SUCCESS = 0, 5117 PROG_UNAVAIL = 1, 5118 PROG_MISMATCH = 2, 5119 PROC_UNAVAIL = 3, 5120 GARBAGE_ARGS = 4, 5121 SYSTEM_ERR = 5 5122 }; 5123 enum reject_stat { 5124 RPC_MISMATCH = 0, 5125 AUTH_ERROR = 1 5126 }; 5127 5128 struct accepted_reply { 5129 struct opaque_auth ar_verf; 5130 enum accept_stat ar_stat; 5131 union { 5132 struct { 5133 unsigned long int low; 5134 unsigned long int high; 5135 } AR_versions; 5136 struct { 5137 caddr_t where; 5138 xdrproc_t proc; 5139 } AR_results; 5140 } ru; 5141 }; 5142 5143 struct rejected_reply { 5144 enum reject_stat rj_stat; 5145 union { 5146 struct { 5147 unsigned long int low; 5148 unsigned long int high; 5149 } RJ_versions; 5150 enum auth_stat RJ_why; 5151 } ru; 5152 }; 5153 5154 struct reply_body { 5155 enum reply_stat rp_stat; 5156 union { 5157 struct accepted_reply RP_ar; 5158 struct rejected_reply RP_dr; 5159 } ru; 5160 }; 5161 5162 struct call_body { 5163 unsigned long int cb_rpcvers; 5164 unsigned long int cb_prog; 5165 unsigned long int cb_vers; 5166 unsigned long int cb_proc; 5167 struct opaque_auth cb_cred; 5168 struct opaque_auth cb_verf; 5169 }; 5170 5171 struct rpc_msg { 5172 unsigned long int rm_xid; 5173 enum msg_type rm_direction; 5174 union { 5175 struct call_body RM_cmb; 5176 struct reply_body RM_rmb; 5177 } ru; 5178 }; 5179 extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); 5180 extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); 5181 extern bool_t xdr_callmsg(XDR *, struct rpc_msg *); 5182 extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); 5183 extern bool_t xdr_replymsg(XDR *, struct rpc_msg *); 5184 __________________________________________________________ 5185 5186 13.4.37. rpc/svc.h 5187 5188 #define svc_getcaller(x) (&(x)->xp_raddr) 5189 #define svc_destroy(xprt) (*(xprt)->xp_ops->xp_destroy)(xprt) 5190 #define svc_recv(xprt,msg) (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) 5191 #define svc_reply(xprt,msg) (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) 5192 #define svc_stat(xprt) (*(xprt)->xp_ops->xp_stat)(xprt) 5193 #define RPC_ANYSOCK -1 5194 #define svc_freeargs(xprt,xargs, argsp) \ 5195 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 5196 #define svc_getargs(xprt,xargs, argsp) \ 5197 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 5198 5199 enum xprt_stat { 5200 XPRT_DIED, 5201 XPRT_MOREREQS, 5202 XPRT_IDLE 5203 }; 5204 5205 typedef struct SVCXPRT { 5206 int xp_sock; 5207 u_short xp_port; 5208 struct xp_ops *xp_ops; 5209 int xp_addrlen; 5210 struct sockaddr_in xp_raddr; 5211 struct opaque_auth xp_verf; 5212 caddr_t xp_p1; 5213 caddr_t xp_p2; 5214 char xp_pad[256]; 5215 } SVCXPRT; 5216 5217 struct svc_req { 5218 rpcprog_t rq_prog; 5219 rpcvers_t rq_vers; 5220 rpcproc_t rq_proc; 5221 struct opaque_auth rq_cred; 5222 caddr_t rq_clntcred; 5223 SVCXPRT *rq_xprt; 5224 }; 5225 5226 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 5227 5228 struct xp_ops { 5229 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 5230 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 5231 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 5232 caddr_t args_ptr); 5233 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 5234 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 5235 caddr_t args_ptr); 5236 void (*xp_destroy) (SVCXPRT * __xprt); 5237 }; 5238 extern void svc_getreqset(fd_set *); 5239 extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, 5240 __dispatch_fn_t, rpcprot_t); 5241 extern void svc_run(void); 5242 extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); 5243 extern void svcerr_auth(SVCXPRT *, enum auth_stat); 5244 extern void svcerr_decode(SVCXPRT *); 5245 extern void svcerr_noproc(SVCXPRT *); 5246 extern void svcerr_noprog(SVCXPRT *); 5247 extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); 5248 extern void svcerr_systemerr(SVCXPRT *); 5249 extern void svcerr_weakauth(SVCXPRT *); 5250 extern SVCXPRT *svctcp_create(int, u_int, u_int); 5251 extern SVCXPRT *svcudp_create(int); 5252 __________________________________________________________ 5253 5254 13.4.38. rpc/types.h 5255 5256 typedef int bool_t; 5257 typedef int enum_t; 5258 typedef unsigned long int rpcprog_t; 5259 typedef unsigned long int rpcvers_t; 5260 typedef unsigned long int rpcproc_t; 5261 typedef unsigned long int rpcprot_t; 5262 __________________________________________________________ 5263 5264 13.4.39. rpc/xdr.h 5265 5266 enum xdr_op { 5267 XDR_ENCODE, 5268 XDR_DECODE, 5269 XDR_FREE 5270 }; 5271 typedef struct XDR { 5272 enum xdr_op x_op; 5273 struct xdr_ops *x_ops; 5274 caddr_t x_public; 5275 caddr_t x_private; 5276 caddr_t x_base; 5277 int x_handy; 5278 } XDR; 5279 5280 struct xdr_ops { 5281 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 5282 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 5283 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 5284 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 5285 u_int(*x_getpostn) (XDR * __xdrs); 5286 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 5287 int32_t *(*x_inline) (XDR * __xdrs, int __len); 5288 void (*x_destroy) (XDR * __xdrs); 5289 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 5290 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 5291 }; 5292 5293 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 5294 5295 struct xdr_discrim { 5296 int value; 5297 xdrproc_t proc; 5298 }; 5299 extern void xdrstdio_create(XDR *, FILE *, enum xdr_op); 5300 extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, 5301 xdrproc_t); 5302 extern bool_t xdr_bool(XDR *, bool_t *); 5303 extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); 5304 extern bool_t xdr_char(XDR *, char *); 5305 extern bool_t xdr_double(XDR *, double *); 5306 extern bool_t xdr_enum(XDR *, enum_t *); 5307 extern bool_t xdr_float(XDR *, float *); 5308 extern void xdr_free(xdrproc_t, char *); 5309 extern bool_t xdr_int(XDR *, int *); 5310 extern bool_t xdr_long(XDR *, long int *); 5311 extern bool_t xdr_opaque(XDR *, caddr_t, u_int); 5312 extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); 5313 extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); 5314 extern bool_t xdr_short(XDR *, short *); 5315 extern bool_t xdr_string(XDR *, char **, u_int); 5316 extern bool_t xdr_u_char(XDR *, u_char *); 5317 extern bool_t xdr_u_int(XDR *, u_int *); 5318 extern bool_t xdr_u_long(XDR *, u_long *); 5319 extern bool_t xdr_u_short(XDR *, u_short *); 5320 extern bool_t xdr_union(XDR *, enum_t *, char *, 5321 const struct xdr_discrim *, xdrproc_t); 5322 extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); 5323 extern bool_t xdr_void(void); 5324 extern bool_t xdr_wrapstring(XDR *, char **); 5325 extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); 5326 extern void xdrrec_create(XDR *, u_int, u_int, caddr_t, 5327 int (*proc) (char *p1, char *p2, int p3) 5328 , int (*proc) (char *p1, char *p2, int p3) 5329 ); 5330 extern bool_t xdrrec_eof(XDR *); 5331 __________________________________________________________ 5332 5333 13.4.40. sched.h 5334 5335 #define SCHED_OTHER 0 5336 #define SCHED_FIFO 1 5337 #define SCHED_RR 2 5338 5339 struct sched_param { 5340 int sched_priority; 5341 }; 5342 extern int sched_get_priority_max(int); 5343 extern int sched_get_priority_min(int); 5344 extern int sched_getparam(pid_t, struct sched_param *); 5345 extern int sched_getscheduler(pid_t); 5346 extern int sched_rr_get_interval(pid_t, struct timespec *); 5347 extern int sched_setparam(pid_t, const struct sched_param *); 5348 extern int sched_setscheduler(pid_t, int, const struct sched_param *); 5349 extern int sched_yield(void); 5350 __________________________________________________________ 5351 5352 13.4.41. search.h 5353 5354 typedef struct entry { 5355 char *key; 5356 void *data; 5357 } ENTRY; 5358 typedef enum { 5359 FIND, 5360 ENTER 5361 } ACTION; 5362 typedef enum { 5363 preorder, 5364 postorder, 5365 endorder, 5366 leaf 5367 } VISIT; 5368 5369 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 5370 extern int hcreate(size_t); 5371 extern ENTRY *hsearch(ENTRY, ACTION); 5372 extern void insque(void *, void *); 5373 extern void *lfind(const void *, const void *, size_t *, size_t, 5374 __compar_fn_t); 5375 extern void *lsearch(const void *, void *, size_t *, size_t, 5376 __compar_fn_t); 5377 extern void remque(void *); 5378 extern void hdestroy(void); 5379 extern void *tdelete(const void *, void **, __compar_fn_t); 5380 extern void *tfind(const void *, void *const *, __compar_fn_t); 5381 extern void *tsearch(const void *, void **, __compar_fn_t); 5382 extern void twalk(const void *, __action_fn_t); 5383 __________________________________________________________ 5384 5385 13.4.42. setjmp.h 5386 5387 #define setjmp(env) _setjmp(env) 5388 #define sigsetjmp(a,b) __sigsetjmp(a,b) 5389 5390 struct __jmp_buf_tag { 5391 __jmp_buf __jmpbuf; 5392 int __mask_was_saved; 5393 sigset_t __saved_mask; 5394 }; 5395 5396 typedef struct __jmp_buf_tag jmp_buf[1]; 5397 typedef jmp_buf sigjmp_buf; 5398 extern int __sigsetjmp(jmp_buf, int); 5399 extern void longjmp(jmp_buf, int); 5400 extern void siglongjmp(sigjmp_buf, int); 5401 extern void _longjmp(jmp_buf, int); 5402 extern int _setjmp(jmp_buf); 5403 __________________________________________________________ 5404 5405 13.4.43. signal.h 5406 5407 #define sigpause __xpg_sigpause 5408 5409 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 5410 #define SIGRTMAX (__libc_current_sigrtmax ()) 5411 #define SIGRTMIN (__libc_current_sigrtmin ()) 5412 #define SIG_BLOCK 0 5413 #define SIG_UNBLOCK 1 5414 #define SIG_SETMASK 2 5415 #define NSIG 65 5416 5417 typedef int sig_atomic_t; 5418 5419 typedef void (*sighandler_t) (int); 5420 5421 #define SIG_HOLD ((sighandler_t) 2) 5422 #define SIG_ERR ((sighandler_t)-1) 5423 #define SIG_DFL ((sighandler_t)0) 5424 #define SIG_IGN ((sighandler_t)1) 5425 5426 #define SIGHUP 1 5427 #define SIGUSR1 10 5428 #define SIGSEGV 11 5429 #define SIGUSR2 12 5430 #define SIGPIPE 13 5431 #define SIGALRM 14 5432 #define SIGTERM 15 5433 #define SIGSTKFLT 16 5434 #define SIGCHLD 17 5435 #define SIGCONT 18 5436 #define SIGSTOP 19 5437 #define SIGINT 2 5438 #define SIGTSTP 20 5439 #define SIGTTIN 21 5440 #define SIGTTOU 22 5441 #define SIGURG 23 5442 #define SIGXCPU 24 5443 #define SIGXFSZ 25 5444 #define SIGVTALRM 26 5445 #define SIGPROF 27 5446 #define SIGWINCH 28 5447 #define SIGIO 29 5448 #define SIGQUIT 3 5449 #define SIGPWR 30 5450 #define SIGSYS 31 5451 #define SIGUNUSED 31 5452 #define SIGILL 4 5453 #define SIGTRAP 5 5454 #define SIGABRT 6 5455 #define SIGIOT 6 5456 #define SIGBUS 7 5457 #define SIGFPE 8 5458 #define SIGKILL 9 5459 #define SIGCLD SIGCHLD 5460 #define SIGPOLL SIGIO 5461 5462 #define SV_ONSTACK (1<<0) 5463 #define SV_INTERRUPT (1<<1) 5464 #define SV_RESETHAND (1<<2) 5465 5466 typedef union sigval { 5467 int sival_int; 5468 void *sival_ptr; 5469 } sigval_t; 5470 5471 #define SIGEV_SIGNAL 0 5472 #define SIGEV_NONE 1 5473 #define SIGEV_THREAD 2 5474 #define SIGEV_MAX_SIZE 64 5475 5476 typedef struct sigevent { 5477 sigval_t sigev_value; 5478 int sigev_signo; 5479 int sigev_notify; 5480 union { 5481 int _pad[SIGEV_PAD_SIZE]; 5482 struct { 5483 void (*_function) (sigval_t); 5484 void *_attribute; 5485 } _sigev_thread; 5486 } _sigev_un; 5487 } sigevent_t; 5488 5489 #define SI_MAX_SIZE 128 5490 #define si_pid _sifields._kill._pid 5491 #define si_uid _sifields._kill._uid 5492 #define si_value _sifields._rt._sigval 5493 #define si_int _sifields._rt._sigval.sival_int 5494 #define si_ptr _sifields._rt._sigval.sival_ptr 5495 #define si_status _sifields._sigchld._status 5496 #define si_stime _sifields._sigchld._stime 5497 #define si_utime _sifields._sigchld._utime 5498 #define si_addr _sifields._sigfault._addr 5499 #define si_band _sifields._sigpoll._band 5500 #define si_fd _sifields._sigpoll._fd 5501 #define si_timer1 _sifields._timer._timer1 5502 #define si_timer2 _sifields._timer._timer2 5503 5504 typedef struct siginfo { 5505 int si_signo; 5506 int si_errno; 5507 int si_code; 5508 union { 5509 int _pad[SI_PAD_SIZE]; 5510 struct { 5511 pid_t _pid; 5512 uid_t _uid; 5513 } _kill; 5514 struct { 5515 unsigned int _timer1; 5516 unsigned int _timer2; 5517 } _timer; 5518 struct { 5519 pid_t _pid; 5520 uid_t _uid; 5521 sigval_t _sigval; 5522 } _rt; 5523 struct { 5524 pid_t _pid; 5525 uid_t _uid; 5526 int _status; 5527 clock_t _utime; 5528 clock_t _stime; 5529 } _sigchld; 5530 struct { 5531 void *_addr; 5532 } _sigfault; 5533 struct { 5534 int _band; 5535 int _fd; 5536 } _sigpoll; 5537 } _sifields; 5538 } siginfo_t; 5539 5540 #define SI_QUEUE -1 5541 #define SI_TIMER -2 5542 #define SI_MESGQ -3 5543 #define SI_ASYNCIO -4 5544 #define SI_SIGIO -5 5545 #define SI_TKILL -6 5546 #define SI_ASYNCNL -60 5547 #define SI_USER 0 5548 #define SI_KERNEL 0x80 5549 5550 #define ILL_ILLOPC 1 5551 #define ILL_ILLOPN 2 5552 #define ILL_ILLADR 3 5553 #define ILL_ILLTRP 4 5554 #define ILL_PRVOPC 5 5555 #define ILL_PRVREG 6 5556 #define ILL_COPROC 7 5557 #define ILL_BADSTK 8 5558 5559 #define FPE_INTDIV 1 5560 #define FPE_INTOVF 2 5561 #define FPE_FLTDIV 3 5562 #define FPE_FLTOVF 4 5563 #define FPE_FLTUND 5 5564 #define FPE_FLTRES 6 5565 #define FPE_FLTINV 7 5566 #define FPE_FLTSUB 8 5567 5568 #define SEGV_MAPERR 1 5569 #define SEGV_ACCERR 2 5570 5571 #define BUS_ADRALN 1 5572 #define BUS_ADRERR 2 5573 #define BUS_OBJERR 3 5574 5575 #define TRAP_BRKPT 1 5576 #define TRAP_TRACE 2 5577 5578 #define CLD_EXITED 1 5579 #define CLD_KILLED 2 5580 #define CLD_DUMPED 3 5581 #define CLD_TRAPPED 4 5582 #define CLD_STOPPED 5 5583 #define CLD_CONTINUED 6 5584 5585 #define POLL_IN 1 5586 #define POLL_OUT 2 5587 #define POLL_MSG 3 5588 #define POLL_ERR 4 5589 #define POLL_PRI 5 5590 #define POLL_HUP 6 5591 5592 typedef struct { 5593 unsigned long int sig[_SIGSET_NWORDS]; 5594 } sigset_t; 5595 5596 #define SA_NOCLDSTOP 0x00000001 5597 #define SA_NOCLDWAIT 0x00000002 5598 #define SA_SIGINFO 0x00000004 5599 #define SA_ONSTACK 0x08000000 5600 #define SA_RESTART 0x10000000 5601 #define SA_INTERRUPT 0x20000000 5602 #define SA_NODEFER 0x40000000 5603 #define SA_RESETHAND 0x80000000 5604 #define SA_NOMASK SA_NODEFER 5605 #define SA_ONESHOT SA_RESETHAND 5606 5607 typedef struct sigaltstack { 5608 void *ss_sp; 5609 int ss_flags; 5610 size_t ss_size; 5611 } stack_t; 5612 5613 #define SS_ONSTACK 1 5614 #define SS_DISABLE 2 5615 5616 extern int __libc_current_sigrtmax(void); 5617 extern int __libc_current_sigrtmin(void); 5618 extern sighandler_t __sysv_signal(int, sighandler_t); 5619 extern char *const _sys_siglist[]; 5620 extern int killpg(pid_t, int); 5621 extern void psignal(int, const char *); 5622 extern int raise(int); 5623 extern int sigaddset(sigset_t *, int); 5624 extern int sigandset(sigset_t *, const sigset_t *, const sigset_t *); 5625 extern int sigdelset(sigset_t *, int); 5626 extern int sigemptyset(sigset_t *); 5627 extern int sigfillset(sigset_t *); 5628 extern int sighold(int); 5629 extern int sigignore(int); 5630 extern int siginterrupt(int, int); 5631 extern int sigisemptyset(const sigset_t *); 5632 extern int sigismember(const sigset_t *, int); 5633 extern int sigorset(sigset_t *, const sigset_t *, const sigset_t *); 5634 extern int sigpending(sigset_t *); 5635 extern int sigrelse(int); 5636 extern sighandler_t sigset(int, sighandler_t); 5637 extern int pthread_kill(pthread_t, int); 5638 extern int pthread_sigmask(int, const sigset_t *, sigset_t *); 5639 extern int sigaction(int, const struct sigaction *, struct sigaction *); 5640 extern int sigwait(const sigset_t *, int *); 5641 extern int kill(pid_t, int); 5642 extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); 5643 extern sighandler_t signal(int, sighandler_t); 5644 extern int sigprocmask(int, const sigset_t *, sigset_t *); 5645 extern int sigreturn(struct sigcontext *); 5646 extern int sigsuspend(const sigset_t *); 5647 extern int sigqueue(pid_t, int, const union sigval); 5648 extern int sigwaitinfo(const sigset_t *, siginfo_t *); 5649 extern int sigtimedwait(const sigset_t *, siginfo_t *, 5650 const struct timespec *); 5651 extern sighandler_t bsd_signal(int, sighandler_t); 5652 extern int __xpg_sigpause(int); 5653 __________________________________________________________ 5654 5655 13.4.44. spawn.h 5656 5657 #define POSIX_SPAWN_RESETIDS 0x01 5658 #define POSIX_SPAWN_SETPGROUP 0x02 5659 #define POSIX_SPAWN_SETSIGDEF 0x04 5660 #define POSIX_SPAWN_SETSIGMASK 0x08 5661 #define POSIX_SPAWN_SETSCHEDPARAM 0x10 5662 #define POSIX_SPAWN_SETSCHEDULER 0x20 5663 5664 typedef struct { 5665 int __allocated; 5666 int __used; 5667 struct __spawn_action *__actions; 5668 int __pad[16]; 5669 } posix_spawn_file_actions_t; 5670 typedef struct { 5671 short __flags; 5672 pid_t __pgrp; 5673 sigset_t __sd; 5674 sigset_t __ss; 5675 struct sched_param __sp; 5676 int __policy; 5677 int __pad[16]; 5678 } posix_spawnattr_t; 5679 extern int posix_spawn(pid_t *, const char *, 5680 const posix_spawn_file_actions_t *, 5681 const posix_spawnattr_t *, char *const, 5682 char *const); 5683 extern int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t*, 5684 int); 5685 extern int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, 5686 int, int); 5687 extern int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *, 5688 int, const char *, int, 5689 mode_t); 5690 extern int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *); 5691 extern int posix_spawn_file_actions_init(posix_spawn_file_actions_t *); 5692 extern int posix_spawnattr_destroy(posix_spawnattr_t *); 5693 extern int posix_spawnattr_getflags(const posix_spawnattr_t *, 5694 short int *); 5695 extern int posix_spawnattr_getpgroup(const posix_spawnattr_t *, pid_t *); 5696 extern int posix_spawnattr_getschedparam(const posix_spawnattr_t *, 5697 struct sched_param *); 5698 extern int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *, 5699 int *); 5700 extern int posix_spawnattr_getsigdefault(const posix_spawnattr_t *, 5701 sigset_t *); 5702 extern int posix_spawnattr_getsigmask(const posix_spawnattr_t *, 5703 sigset_t *); 5704 extern int posix_spawnattr_init(posix_spawnattr_t *); 5705 extern int posix_spawnattr_setflags(posix_spawnattr_t *, short int); 5706 extern int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t); 5707 extern int posix_spawnattr_setschedparam(posix_spawnattr_t *, 5708 const struct sched_param *); 5709 extern int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); 5710 extern int posix_spawnattr_setsigdefault(posix_spawnattr_t *, 5711 const sigset_t *); 5712 extern int posix_spawnattr_setsigmask(posix_spawnattr_t *, 5713 const sigset_t *); 5714 extern int posix_spawnp(pid_t *, const char *, 5715 const posix_spawn_file_actions_t *, 5716 const posix_spawnattr_t *, char *const, 5717 char *const); 5718 __________________________________________________________ 5719 5720 13.4.45. stddef.h 5721 5722 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 5723 #define NULL (0L) 5724 __________________________________________________________ 5725 5726 13.4.46. stdint.h 5727 5728 #define INT16_C(c) c 5729 #define INT32_C(c) c 5730 #define INT8_C(c) c 5731 #define UINT16_C(c) c 5732 #define UINT8_C(c) c 5733 #define UINT32_C(c) c ## U 5734 5735 #define INT8_MIN (-128) 5736 #define INT_FAST8_MIN (-128) 5737 #define INT_LEAST8_MIN (-128) 5738 #define INT32_MIN (-2147483647-1) 5739 #define INT_LEAST32_MIN (-2147483647-1) 5740 #define SIG_ATOMIC_MIN (-2147483647-1) 5741 #define INT16_MIN (-32767-1) 5742 #define INT_LEAST16_MIN (-32767-1) 5743 #define INT64_MIN (-__INT64_C(9223372036854775807)-1) 5744 #define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) 5745 #define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) 5746 #define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) 5747 #define WINT_MIN (0u) 5748 #define INT8_MAX (127) 5749 #define INT_FAST8_MAX (127) 5750 #define INT_LEAST8_MAX (127) 5751 #define INT32_MAX (2147483647) 5752 #define INT_LEAST32_MAX (2147483647) 5753 #define SIG_ATOMIC_MAX (2147483647) 5754 #define UINT8_MAX (255) 5755 #define UINT_FAST8_MAX (255) 5756 #define UINT_LEAST8_MAX (255) 5757 #define INT16_MAX (32767) 5758 #define INT_LEAST16_MAX (32767) 5759 #define UINT32_MAX (4294967295U) 5760 #define UINT_LEAST32_MAX (4294967295U) 5761 #define WINT_MAX (4294967295u) 5762 #define UINT16_MAX (65535) 5763 #define UINT_LEAST16_MAX (65535) 5764 #define INT64_MAX (__INT64_C(9223372036854775807)) 5765 #define INTMAX_MAX (__INT64_C(9223372036854775807)) 5766 #define INT_FAST64_MAX (__INT64_C(9223372036854775807)) 5767 #define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) 5768 #define UINT64_MAX (__UINT64_C(18446744073709551615)) 5769 #define UINTMAX_MAX (__UINT64_C(18446744073709551615)) 5770 #define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) 5771 #define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) 5772 5773 typedef signed char int8_t; 5774 typedef short int16_t; 5775 typedef int int32_t; 5776 typedef unsigned char uint8_t; 5777 typedef unsigned short uint16_t; 5778 typedef unsigned int uint32_t; 5779 typedef signed char int_least8_t; 5780 typedef short int int_least16_t; 5781 typedef int int_least32_t; 5782 typedef unsigned char uint_least8_t; 5783 typedef unsigned short uint_least16_t; 5784 typedef unsigned int uint_least32_t; 5785 typedef signed char int_fast8_t; 5786 typedef unsigned char uint_fast8_t; 5787 __________________________________________________________ 5788 5789 13.4.47. stdio.h 5790 5791 #define EOF (-1) 5792 #define P_tmpdir "/tmp" 5793 #define FOPEN_MAX 16 5794 #define L_tmpnam 20 5795 #define FILENAME_MAX 4096 5796 #define BUFSIZ 8192 5797 #define L_ctermid 9 5798 #define L_cuserid 9 5799 5800 typedef struct { 5801 off_t __pos; 5802 mbstate_t __state; 5803 } fpos_t; 5804 typedef struct { 5805 off64_t __pos; 5806 mbstate_t __state; 5807 } fpos64_t; 5808 5809 typedef struct _IO_FILE FILE; 5810 5811 #define _IOFBF 0 5812 #define _IOLBF 1 5813 #define _IONBF 2 5814 5815 extern char *const _sys_errlist[]; 5816 extern void clearerr(FILE *); 5817 extern int fclose(FILE *); 5818 extern FILE *fdopen(int, const char *); 5819 extern int fflush_unlocked(FILE *); 5820 extern int fileno(FILE *); 5821 extern FILE *fopen(const char *, const char *); 5822 extern int fprintf(FILE *, const char *, ...); 5823 extern int fputc(int, FILE *); 5824 extern FILE *freopen(const char *, const char *, FILE *); 5825 extern FILE *freopen64(const char *, const char *, FILE *); 5826 extern int fscanf(FILE *, const char *, ...); 5827 extern int fseek(FILE *, long int, int); 5828 extern int fseeko(FILE *, off_t, int); 5829 extern int fseeko64(FILE *, loff_t, int); 5830 extern off_t ftello(FILE *); 5831 extern loff_t ftello64(FILE *); 5832 extern int getchar(void); 5833 extern int getchar_unlocked(void); 5834 extern int getw(FILE *); 5835 extern int pclose(FILE *); 5836 extern void perror(const char *); 5837 extern FILE *popen(const char *, const char *); 5838 extern int printf(const char *, ...); 5839 extern int putc_unlocked(int, FILE *); 5840 extern int putchar(int); 5841 extern int putchar_unlocked(int); 5842 extern int putw(int, FILE *); 5843 extern int remove(const char *); 5844 extern void rewind(FILE *); 5845 extern int scanf(const char *, ...); 5846 extern void setbuf(FILE *, char *); 5847 extern int sprintf(char *, const char *, ...); 5848 extern int sscanf(const char *, const char *, ...); 5849 extern FILE *stderr; 5850 extern FILE *stdin; 5851 extern FILE *stdout; 5852 extern char *tempnam(const char *, const char *); 5853 extern FILE *tmpfile64(void); 5854 extern FILE *tmpfile(void); 5855 extern char *tmpnam(char *); 5856 extern int vfprintf(FILE *, const char *, va_list); 5857 extern int vprintf(const char *, va_list); 5858 extern int feof(FILE *); 5859 extern int ferror(FILE *); 5860 extern int fflush(FILE *); 5861 extern int fgetc(FILE *); 5862 extern int fgetpos(FILE *, fpos_t *); 5863 extern char *fgets(char *, int, FILE *); 5864 extern int fputs(const char *, FILE *); 5865 extern size_t fread(void *, size_t, size_t, FILE *); 5866 extern int fsetpos(FILE *, const fpos_t *); 5867 extern long int ftell(FILE *); 5868 extern size_t fwrite(const void *, size_t, size_t, FILE *); 5869 extern int getc(FILE *); 5870 extern int putc(int, FILE *); 5871 extern int puts(const char *); 5872 extern int setvbuf(FILE *, char *, int, size_t); 5873 extern int snprintf(char *, size_t, const char *, ...); 5874 extern int ungetc(int, FILE *); 5875 extern int vsnprintf(char *, size_t, const char *, va_list); 5876 extern int vsprintf(char *, const char *, va_list); 5877 extern void flockfile(FILE *); 5878 extern int asprintf(char **, const char *, ...); 5879 extern int fgetpos64(FILE *, fpos64_t *); 5880 extern FILE *fopen64(const char *, const char *); 5881 extern int fsetpos64(FILE *, const fpos64_t *); 5882 extern int ftrylockfile(FILE *); 5883 extern void funlockfile(FILE *); 5884 extern int getc_unlocked(FILE *); 5885 extern void setbuffer(FILE *, char *, size_t); 5886 extern int vasprintf(char **, const char *, va_list); 5887 extern int vdprintf(int, const char *, va_list); 5888 extern int vfscanf(FILE *, const char *, va_list); 5889 extern int vscanf(const char *, va_list); 5890 extern int vsscanf(const char *, const char *, va_list); 5891 extern size_t __fpending(FILE *); 5892 __________________________________________________________ 5893 5894 13.4.48. stdlib.h 5895 5896 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 5897 #define EXIT_SUCCESS 0 5898 #define EXIT_FAILURE 1 5899 #define RAND_MAX 2147483647 5900 5901 typedef int (*__compar_fn_t) (const void *, const void *); 5902 struct random_data { 5903 int32_t *fptr; 5904 int32_t *rptr; 5905 int32_t *state; 5906 int rand_type; 5907 int rand_deg; 5908 int rand_sep; 5909 int32_t *end_ptr; 5910 }; 5911 5912 typedef struct { 5913 int quot; 5914 int rem; 5915 } div_t; 5916 5917 typedef struct { 5918 long int quot; 5919 long int rem; 5920 } ldiv_t; 5921 5922 typedef struct { 5923 long long int quot; 5924 long long int rem; 5925 } lldiv_t; 5926 extern double __strtod_internal(const char *, char **, int); 5927 extern float __strtof_internal(const char *, char **, int); 5928 extern long int __strtol_internal(const char *, char **, int, int); 5929 extern long double __strtold_internal(const char *, char **, int); 5930 extern long long int __strtoll_internal(const char *, char **, int, int); 5931 extern unsigned long int __strtoul_internal(const char *, char **, int, 5932 int); 5933 extern unsigned long long int __strtoull_internal(const char *, char **, 5934 int, int); 5935 extern long int a64l(const char *); 5936 extern void abort(void); 5937 extern int abs(int); 5938 extern double atof(const char *); 5939 extern int atoi(const char *); 5940 extern long int atol(const char *); 5941 extern long long int atoll(const char *); 5942 extern void *bsearch(const void *, const void *, size_t, size_t, 5943 __compar_fn_t); 5944 extern div_t div(int, int); 5945 extern double drand48(void); 5946 extern char *ecvt(double, int, int *, int *); 5947 extern double erand48(unsigned short); 5948 extern void exit(int); 5949 extern char *fcvt(double, int, int *, int *); 5950 extern char *gcvt(double, int, char *); 5951 extern char *getenv(const char *); 5952 extern int getsubopt(char **, char *const *, char **); 5953 extern int grantpt(int); 5954 extern long int jrand48(unsigned short); 5955 extern char *l64a(long int); 5956 extern long int labs(long int); 5957 extern void lcong48(unsigned short); 5958 extern ldiv_t ldiv(long int, long int); 5959 extern long long int llabs(long long int); 5960 extern lldiv_t lldiv(long long int, long long int); 5961 extern long int lrand48(void); 5962 extern int mblen(const char *, size_t); 5963 extern size_t mbstowcs(wchar_t *, const char *, size_t); 5964 extern int mbtowc(wchar_t *, const char *, size_t); 5965 extern char *mktemp(char *); 5966 extern long int mrand48(void); 5967 extern long int nrand48(unsigned short); 5968 extern char *ptsname(int); 5969 extern int putenv(char *); 5970 extern void qsort(void *, size_t, size_t, const __compar_fn_t); 5971 extern int rand(void); 5972 extern int rand_r(unsigned int *); 5973 extern unsigned short *seed48(unsigned short); 5974 extern void srand48(long int); 5975 extern int unlockpt(int); 5976 extern size_t wcstombs(char *, const wchar_t *, size_t); 5977 extern int wctomb(char *, wchar_t); 5978 extern int system(const char *); 5979 extern void *calloc(size_t, size_t); 5980 extern void free(void *); 5981 extern char *initstate(unsigned int, char *, size_t); 5982 extern void *malloc(size_t); 5983 extern long int random(void); 5984 extern void *realloc(void *, size_t); 5985 extern char *setstate(char *); 5986 extern void srand(unsigned int); 5987 extern void srandom(unsigned int); 5988 extern double strtod(const char *, char **); 5989 extern float strtof(const char *, char **); 5990 extern long int strtol(const char *, char **, int); 5991 extern long double strtold(const char *, char **); 5992 extern long long int strtoll(const char *, char **, int); 5993 extern long long int strtoq(const char *, char **, int); 5994 extern unsigned long int strtoul(const char *, char **, int); 5995 extern unsigned long long int strtoull(const char *, char **, int); 5996 extern unsigned long long int strtouq(const char *, char **, int); 5997 extern void _Exit(int); 5998 extern size_t __ctype_get_mb_cur_max(void); 5999 extern char **environ; 6000 extern char *realpath(const char *, char *); 6001 extern int setenv(const char *, const char *, int); 6002 extern int unsetenv(const char *); 6003 extern int getloadavg(double, int); 6004 extern int mkstemp64(char *); 6005 extern int posix_memalign(void **, size_t, size_t); 6006 extern int posix_openpt(int); 6007 __________________________________________________________ 6008 6009 13.4.49. string.h 6010 6011 #define strerror_r __xpg_strerror_r 6012 6013 extern void *__mempcpy(void *, const void *, size_t); 6014 extern char *__stpcpy(char *, const char *); 6015 extern char *__strdup(const char *); 6016 extern char *__strtok_r(char *, const char *, char **); 6017 extern void *memchr(const void *, int, size_t); 6018 extern int memcmp(const void *, const void *, size_t); 6019 extern void *memcpy(void *, const void *, size_t); 6020 extern void *memmem(const void *, size_t, const void *, size_t); 6021 extern void *memmove(void *, const void *, size_t); 6022 extern void *memset(void *, int, size_t); 6023 extern char *strcat(char *, const char *); 6024 extern char *strchr(const char *, int); 6025 extern int strcmp(const char *, const char *); 6026 extern int strcoll(const char *, const char *); 6027 extern char *strcpy(char *, const char *); 6028 extern size_t strcspn(const char *, const char *); 6029 extern char *strerror(int); 6030 extern size_t strlen(const char *); 6031 extern char *strncat(char *, const char *, size_t); 6032 extern int strncmp(const char *, const char *, size_t); 6033 extern char *strncpy(char *, const char *, size_t); 6034 extern char *strpbrk(const char *, const char *); 6035 extern char *strrchr(const char *, int); 6036 extern char *strsignal(int); 6037 extern size_t strspn(const char *, const char *); 6038 extern char *strstr(const char *, const char *); 6039 extern char *strtok(char *, const char *); 6040 extern size_t strxfrm(char *, const char *, size_t); 6041 extern void *memccpy(void *, const void *, int, size_t); 6042 extern char *strdup(const char *); 6043 extern char *strndup(const char *, size_t); 6044 extern size_t strnlen(const char *, size_t); 6045 extern char *strsep(char **, const char *); 6046 extern char *strtok_r(char *, const char *, char **); 6047 extern char *strcasestr(const char *, const char *); 6048 extern char *stpcpy(char *, const char *); 6049 extern char *stpncpy(char *, const char *, size_t); 6050 extern void *memrchr(const void *, int, size_t); 6051 extern char *__xpg_strerror_r(int, char *, size_t); 6052 __________________________________________________________ 6053 6054 13.4.50. strings.h 6055 6056 extern void bcopy(const void *, void *, size_t); 6057 extern int bcmp(const void *, const void *, size_t); 6058 extern void bzero(void *, size_t); 6059 extern int ffs(int); 6060 extern char *index(const char *, int); 6061 extern char *rindex(const char *, int); 6062 extern int strcasecmp(const char *, const char *); 6063 extern int strncasecmp(const char *, const char *, size_t); 6064 __________________________________________________________ 6065 6066 13.4.51. sys/file.h 6067 6068 #define LOCK_SH 1 6069 #define LOCK_EX 2 6070 #define LOCK_NB 4 6071 #define LOCK_UN 8 6072 6073 extern int flock(int, int); 6074 __________________________________________________________ 6075 6076 13.4.52. sys/ioctl.h 6077 6078 struct winsize { 6079 unsigned short ws_row; 6080 unsigned short ws_col; 6081 unsigned short ws_xpixel; 6082 unsigned short ws_ypixel; 6083 }; 6084 extern int ioctl(int, unsigned long int, ...); 6085 __________________________________________________________ 6086 6087 13.4.53. sys/ipc.h 6088 6089 #define IPC_PRIVATE ((key_t)0) 6090 #define IPC_RMID 0 6091 #define IPC_CREAT 00001000 6092 #define IPC_EXCL 00002000 6093 #define IPC_NOWAIT 00004000 6094 #define IPC_SET 1 6095 #define IPC_STAT 2 6096 6097 extern key_t ftok(const char *, int); 6098 __________________________________________________________ 6099 6100 13.4.54. sys/mman.h 6101 6102 #define MAP_FAILED ((void*)-1) 6103 #define PROT_NONE 0x0 6104 #define MAP_SHARED 0x01 6105 #define MAP_PRIVATE 0x02 6106 #define PROT_READ 0x1 6107 #define MAP_FIXED 0x10 6108 #define PROT_WRITE 0x2 6109 #define MAP_ANONYMOUS 0x20 6110 #define PROT_EXEC 0x4 6111 #define MREMAP_MAYMOVE 1 6112 #define MS_ASYNC 1 6113 #define MREMAP_FIXED 2 6114 #define MS_INVALIDATE 2 6115 #define MS_SYNC 4 6116 #define MAP_ANON MAP_ANONYMOUS 6117 6118 extern void *mremap(void *, size_t, size_t, int); 6119 extern int posix_madvise(void *, size_t, int); 6120 extern int msync(void *, size_t, int); 6121 extern int mlock(const void *, size_t); 6122 extern int mlockall(int); 6123 extern void *mmap(void *, size_t, int, int, int, off_t); 6124 extern int mprotect(void *, size_t, int); 6125 extern int munlock(const void *, size_t); 6126 extern int munlockall(void); 6127 extern int munmap(void *, size_t); 6128 extern void *mmap64(void *, size_t, int, int, int, off64_t); 6129 extern int shm_open(const char *, int, mode_t); 6130 extern int shm_unlink(const char *); 6131 __________________________________________________________ 6132 6133 13.4.55. sys/msg.h 6134 6135 #define MSG_NOERROR 010000 6136 6137 extern int msgctl(int, int, struct msqid_ds *); 6138 extern int msgget(key_t, int); 6139 extern ssize_t msgrcv(int, void *, size_t, long int, int); 6140 extern int msgsnd(int, const void *, size_t, int); 6141 __________________________________________________________ 6142 6143 13.4.56. sys/param.h 6144 6145 #define NOFILE 256 6146 #define MAXPATHLEN 4096 6147 __________________________________________________________ 6148 6149 13.4.57. sys/poll.h 6150 6151 #define POLLIN 0x0001 6152 #define POLLPRI 0x0002 6153 #define POLLOUT 0x0004 6154 #define POLLERR 0x0008 6155 #define POLLHUP 0x0010 6156 #define POLLNVAL 0x0020 6157 6158 struct pollfd { 6159 int fd; 6160 short events; 6161 short revents; 6162 }; 6163 typedef unsigned long int nfds_t; 6164 __________________________________________________________ 6165 6166 13.4.58. sys/resource.h 6167 6168 #define RUSAGE_CHILDREN (-1) 6169 #define RLIM_INFINITY (~0UL) 6170 #define RLIM_SAVED_CUR -1 6171 #define RLIM_SAVED_MAX -1 6172 #define RLIMIT_CPU 0 6173 #define RUSAGE_SELF 0 6174 #define RLIMIT_FSIZE 1 6175 #define RLIMIT_DATA 2 6176 #define RLIMIT_STACK 3 6177 #define RLIMIT_CORE 4 6178 #define RLIMIT_NOFILE 7 6179 #define RLIMIT_AS 9 6180 6181 typedef unsigned long int rlim_t; 6182 typedef unsigned long long int rlim64_t; 6183 typedef int __rlimit_resource_t; 6184 6185 struct rlimit { 6186 rlim_t rlim_cur; 6187 rlim_t rlim_max; 6188 }; 6189 struct rlimit64 { 6190 rlim64_t rlim_cur; 6191 rlim64_t rlim_max; 6192 }; 6193 6194 struct rusage { 6195 struct timeval ru_utime; 6196 struct timeval ru_stime; 6197 long int ru_maxrss; 6198 long int ru_ixrss; 6199 long int ru_idrss; 6200 long int ru_isrss; 6201 long int ru_minflt; 6202 long int ru_majflt; 6203 long int ru_nswap; 6204 long int ru_inblock; 6205 long int ru_oublock; 6206 long int ru_msgsnd; 6207 long int ru_msgrcv; 6208 long int ru_nsignals; 6209 long int ru_nvcsw; 6210 long int ru_nivcsw; 6211 }; 6212 6213 enum __priority_which { 6214 PRIO_PROCESS = 0, 6215 PRIO_PGRP = 1, 6216 PRIO_USER = 2 6217 }; 6218 6219 #define PRIO_PGRP PRIO_PGRP 6220 #define PRIO_PROCESS PRIO_PROCESS 6221 #define PRIO_USER PRIO_USER 6222 6223 typedef enum __priority_which __priority_which_t; 6224 extern int getpriority(__priority_which_t, id_t); 6225 extern int getrlimit64(id_t, struct rlimit64 *); 6226 extern int setpriority(__priority_which_t, id_t, int); 6227 extern int setrlimit(__rlimit_resource_t, const struct rlimit *); 6228 extern int setrlimit64(__rlimit_resource_t, const struct rlimit64 *); 6229 extern int getrlimit(__rlimit_resource_t, struct rlimit *); 6230 extern int getrusage(int, struct rusage *); 6231 __________________________________________________________ 6232 6233 13.4.59. sys/select.h 6234 6235 extern int pselect(int, fd_set *, fd_set *, fd_set *, 6236 const struct timespec *, const sigset_t *); 6237 __________________________________________________________ 6238 6239 13.4.60. sys/sem.h 6240 6241 #define SEM_UNDO 0x1000 6242 #define GETPID 11 6243 #define GETVAL 12 6244 #define GETALL 13 6245 #define GETNCNT 14 6246 #define GETZCNT 15 6247 #define SETVAL 16 6248 #define SETALL 17 6249 6250 struct sembuf { 6251 short sem_num; 6252 short sem_op; 6253 short sem_flg; 6254 }; 6255 extern int semctl(int, int, int, ...); 6256 extern int semget(key_t, int, int); 6257 extern int semop(int, struct sembuf *, size_t); 6258 __________________________________________________________ 6259 6260 13.4.61. sys/shm.h 6261 6262 #define SHM_RDONLY 010000 6263 #define SHM_W 0200 6264 #define SHM_RND 020000 6265 #define SHM_R 0400 6266 #define SHM_REMAP 040000 6267 #define SHM_LOCK 11 6268 #define SHM_UNLOCK 12 6269 6270 extern int __getpagesize(void); 6271 extern void *shmat(int, const void *, int); 6272 extern int shmctl(int, int, struct shmid_ds *); 6273 extern int shmdt(const void *); 6274 extern int shmget(key_t, size_t, int); 6275 __________________________________________________________ 6276 6277 13.4.62. sys/socket.h 6278 6279 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 6280 #define SCM_RIGHTS 0x01 6281 #define SOL_SOCKET 1 6282 #define SOMAXCONN 128 6283 #define SOL_RAW 255 6284 #define CMSG_ALIGN(len) \ 6285 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 6286 #define CMSG_DATA(cmsg) \ 6287 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 6288 #define CMSG_SPACE(len) \ 6289 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 6290 #define CMSG_FIRSTHDR(msg) \ 6291 ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ 6292 (struct cmsghdr *)(msg)->msg_control : \ 6293 (struct cmsghdr *)NULL) 6294 #define CMSG_NXTHDR(mhdr,cmsg) \ 6295 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 6296 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 6297 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 6298 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \ 6299 (struct cmsghdr *)NULL : \ 6300 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 6301 6302 struct linger { 6303 int l_onoff; 6304 int l_linger; 6305 }; 6306 struct cmsghdr { 6307 size_t cmsg_len; 6308 int cmsg_level; 6309 int cmsg_type; 6310 }; 6311 struct iovec { 6312 void *iov_base; 6313 size_t iov_len; 6314 }; 6315 6316 typedef unsigned short sa_family_t; 6317 typedef unsigned int socklen_t; 6318 6319 struct sockaddr { 6320 sa_family_t sa_family; 6321 char sa_data[14]; 6322 }; 6323 struct sockaddr_storage { 6324 sa_family_t ss_family; 6325 __ss_aligntype __ss_align; 6326 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 6327 }; 6328 6329 struct msghdr { 6330 void *msg_name; 6331 int msg_namelen; 6332 struct iovec *msg_iov; 6333 size_t msg_iovlen; 6334 void *msg_control; 6335 size_t msg_controllen; 6336 unsigned int msg_flags; 6337 }; 6338 6339 #define AF_UNSPEC 0 6340 #define AF_UNIX 1 6341 #define AF_INET6 10 6342 #define AF_INET 2 6343 6344 #define PF_INET AF_INET 6345 #define PF_INET6 AF_INET6 6346 #define PF_UNIX AF_UNIX 6347 #define PF_UNSPEC AF_UNSPEC 6348 6349 #define SOCK_STREAM 1 6350 #define SOCK_PACKET 10 6351 #define SOCK_DGRAM 2 6352 #define SOCK_RAW 3 6353 #define SOCK_RDM 4 6354 #define SOCK_SEQPACKET 5 6355 6356 #define SO_DEBUG 1 6357 #define SO_OOBINLINE 10 6358 #define SO_NO_CHECK 11 6359 #define SO_PRIORITY 12 6360 #define SO_LINGER 13 6361 #define SO_REUSEADDR 2 6362 #define SO_TYPE 3 6363 #define SO_ACCEPTCONN 30 6364 #define SO_ERROR 4 6365 #define SO_DONTROUTE 5 6366 #define SO_BROADCAST 6 6367 #define SO_SNDBUF 7 6368 #define SO_RCVBUF 8 6369 #define SO_KEEPALIVE 9 6370 6371 #define SIOCGIFNAME 0x8910 6372 #define SIOCGIFCONF 0x8912 6373 #define SIOCGIFFLAGS 0x8913 6374 #define SIOCGIFADDR 0x8915 6375 #define SIOCGIFDSTADDR 0x8917 6376 #define SIOCGIFBRDADDR 0x8919 6377 #define SIOCGIFNETMASK 0x891b 6378 #define SIOCGIFMTU 0x8921 6379 #define SIOCGIFHWADDR 0x8927 6380 6381 #define SHUT_RD 0 6382 #define SHUT_WR 1 6383 #define SHUT_RDWR 2 6384 6385 #define MSG_WAITALL 0x100 6386 #define MSG_TRUNC 0x20 6387 #define MSG_EOR 0x80 6388 #define MSG_OOB 1 6389 #define MSG_PEEK 2 6390 #define MSG_DONTROUTE 4 6391 #define MSG_CTRUNC 8 6392 6393 extern int bind(int, const struct sockaddr *, socklen_t); 6394 extern int getnameinfo(const struct sockaddr *, socklen_t, char *, 6395 socklen_t, char *, socklen_t, unsigned int); 6396 extern int getsockname(int, struct sockaddr *, socklen_t *); 6397 extern int listen(int, int); 6398 extern int setsockopt(int, int, int, const void *, socklen_t); 6399 extern int accept(int, struct sockaddr *, socklen_t *); 6400 extern int connect(int, const struct sockaddr *, socklen_t); 6401 extern ssize_t recv(int, void *, size_t, int); 6402 extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, 6403 socklen_t *); 6404 extern ssize_t recvmsg(int, struct msghdr *, int); 6405 extern ssize_t send(int, const void *, size_t, int); 6406 extern ssize_t sendmsg(int, const struct msghdr *, int); 6407 extern ssize_t sendto(int, const void *, size_t, int, 6408 const struct sockaddr *, socklen_t); 6409 extern int getpeername(int, struct sockaddr *, socklen_t *); 6410 extern int getsockopt(int, int, int, void *, socklen_t *); 6411 extern int shutdown(int, int); 6412 extern int socket(int, int, int); 6413 extern int socketpair(int, int, int, int); 6414 extern int sockatmark(int); 6415 __________________________________________________________ 6416 6417 13.4.63. sys/stat.h 6418 6419 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 6420 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 6421 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 6422 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 6423 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 6424 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 6425 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 6426 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 6427 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 6428 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 6429 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 6430 #define S_IROTH (S_IRGRP>>3) 6431 #define S_IRGRP (S_IRUSR>>3) 6432 #define S_IRWXO (S_IRWXG>>3) 6433 #define S_IRWXG (S_IRWXU>>3) 6434 #define S_IWOTH (S_IWGRP>>3) 6435 #define S_IWGRP (S_IWUSR>>3) 6436 #define S_IXOTH (S_IXGRP>>3) 6437 #define S_IXGRP (S_IXUSR>>3) 6438 #define S_ISVTX 01000 6439 #define S_IXUSR 0x0040 6440 #define S_IWUSR 0x0080 6441 #define S_IRUSR 0x0100 6442 #define S_ISGID 0x0400 6443 #define S_ISUID 0x0800 6444 #define S_IFIFO 0x1000 6445 #define S_IFCHR 0x2000 6446 #define S_IFDIR 0x4000 6447 #define S_IFBLK 0x6000 6448 #define S_IFREG 0x8000 6449 #define S_IFLNK 0xa000 6450 #define S_IFSOCK 0xc000 6451 #define S_IFMT 0xf000 6452 #define st_atime st_atim.tv_sec 6453 #define st_ctime st_ctim.tv_sec 6454 #define st_mtime st_mtim.tv_sec 6455 #define S_IREAD S_IRUSR 6456 #define S_IWRITE S_IWUSR 6457 #define S_IEXEC S_IXUSR 6458 6459 extern int __fxstat(int, int, struct stat *); 6460 extern int __fxstat64(int, int, struct stat64 *); 6461 extern int __lxstat(int, const char *, struct stat *); 6462 extern int __lxstat64(int, const char *, struct stat64 *); 6463 extern int __xmknod(int, const char *, mode_t, dev_t *); 6464 extern int __xstat(int, const char *, struct stat *); 6465 extern int __xstat64(int, const char *, struct stat64 *); 6466 extern int mkfifo(const char *, mode_t); 6467 extern int chmod(const char *, mode_t); 6468 extern int fchmod(int, mode_t); 6469 extern mode_t umask(mode_t); 6470 __________________________________________________________ 6471 6472 13.4.64. sys/statfs.h 6473 6474 #define NFS_SUPER_MAGIC 0x6969 6475 6476 extern int fstatfs64(int, struct statfs64 *); 6477 extern int statfs64(const char *, struct statfs64 *); 6478 extern int fstatfs(int, struct statfs *); 6479 extern int statfs(const char *, struct statfs *); 6480 __________________________________________________________ 6481 6482 13.4.65. sys/statvfs.h 6483 6484 extern int fstatvfs(int, struct statvfs *); 6485 extern int fstatvfs64(int, struct statvfs64 *); 6486 extern int statvfs(const char *, struct statvfs *); 6487 extern int statvfs64(const char *, struct statvfs64 *); 6488 __________________________________________________________ 6489 6490 13.4.66. sys/time.h 6491 6492 #define ITIMER_REAL 0 6493 #define ITIMER_VIRTUAL 1 6494 #define ITIMER_PROF 2 6495 6496 struct timezone { 6497 int tz_minuteswest; 6498 int tz_dsttime; 6499 }; 6500 6501 typedef int __itimer_which_t; 6502 6503 struct timespec { 6504 time_t tv_sec; 6505 long int tv_nsec; 6506 }; 6507 6508 struct timeval { 6509 time_t tv_sec; 6510 suseconds_t tv_usec; 6511 }; 6512 6513 struct itimerval { 6514 struct timeval it_interval; 6515 struct timeval it_value; 6516 }; 6517 extern int getitimer(__itimer_which_t, struct itimerval *); 6518 extern int setitimer(__itimer_which_t, const struct itimerval *, 6519 struct itimerval *); 6520 extern int adjtime(const struct timeval *, struct timeval *); 6521 extern int gettimeofday(struct timeval *, struct timezone *); 6522 extern int utimes(const char *, const struct timeval *); 6523 __________________________________________________________ 6524 6525 13.4.67. sys/timeb.h 6526 6527 struct timeb { 6528 time_t time; 6529 unsigned short millitm; 6530 short timezone; 6531 short dstflag; 6532 }; 6533 extern int ftime(struct timeb *); 6534 __________________________________________________________ 6535 6536 13.4.68. sys/times.h 6537 6538 struct tms { 6539 clock_t tms_utime; 6540 clock_t tms_stime; 6541 clock_t tms_cutime; 6542 clock_t tms_cstime; 6543 }; 6544 extern clock_t times(struct tms *); 6545 __________________________________________________________ 6546 6547 13.4.69. sys/types.h 6548 6549 #ifndef FALSE 6550 #define FALSE 0 6551 #endif 6552 #ifndef TRUE 6553 #define TRUE 1 6554 #endif 6555 #define FD_SETSIZE 1024 6556 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 6557 #define FD_ISSET(d,set) \ 6558 ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) 6559 #define FD_CLR(d,set) \ 6560 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) 6561 #define FD_SET(d,set) \ 6562 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 6563 6564 typedef unsigned char u_int8_t; 6565 typedef unsigned short u_int16_t; 6566 typedef unsigned int u_int32_t; 6567 typedef unsigned long long int u_int64_t; 6568 typedef unsigned int uid_t; 6569 typedef int pid_t; 6570 typedef long int off_t; 6571 typedef int key_t; 6572 typedef long int suseconds_t; 6573 typedef unsigned int u_int; 6574 typedef struct { 6575 int __val[2]; 6576 } fsid_t; 6577 typedef unsigned int useconds_t; 6578 typedef long int blksize_t; 6579 typedef long int fd_mask; 6580 typedef void *timer_t; 6581 typedef int clockid_t; 6582 6583 typedef unsigned int id_t; 6584 6585 typedef unsigned long long int ino64_t; 6586 typedef long long int loff_t; 6587 typedef long int blkcnt_t; 6588 typedef unsigned long int fsblkcnt_t; 6589 typedef unsigned long int fsfilcnt_t; 6590 typedef long long int blkcnt64_t; 6591 typedef unsigned long long int fsblkcnt64_t; 6592 typedef unsigned long long int fsfilcnt64_t; 6593 typedef unsigned char u_char; 6594 typedef unsigned short u_short; 6595 typedef unsigned long int u_long; 6596 6597 typedef unsigned long int ino_t; 6598 typedef unsigned int gid_t; 6599 typedef unsigned long long int dev_t; 6600 typedef unsigned int mode_t; 6601 typedef unsigned long int nlink_t; 6602 typedef char *caddr_t; 6603 6604 typedef struct { 6605 unsigned long int fds_bits[__FDSET_LONGS]; 6606 } fd_set; 6607 6608 typedef long int clock_t; 6609 typedef long int time_t; 6610 __________________________________________________________ 6611 6612 13.4.70. sys/uio.h 6613 6614 extern ssize_t readv(int, const struct iovec *, int); 6615 extern ssize_t writev(int, const struct iovec *, int); 6616 __________________________________________________________ 6617 6618 13.4.71. sys/un.h 6619 6620 #define UNIX_PATH_MAX 108 6621 6622 struct sockaddr_un { 6623 sa_family_t sun_family; 6624 char sun_path[UNIX_PATH_MAX]; 6625 }; 6626 __________________________________________________________ 6627 6628 13.4.72. sys/utsname.h 6629 6630 #define SYS_NMLN 65 6631 6632 struct utsname { 6633 char sysname[65]; 6634 char nodename[65]; 6635 char release[65]; 6636 char version[65]; 6637 char machine[65]; 6638 char domainname[65]; 6639 }; 6640 extern int uname(struct utsname *); 6641 __________________________________________________________ 6642 6643 13.4.73. sys/wait.h 6644 6645 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 6646 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 6647 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 6648 #define WTERMSIG(status) ((status) & 0x7f) 6649 #define WCOREDUMP(status) ((status) & 0x80) 6650 #define WIFEXITED(status) (WTERMSIG(status) == 0) 6651 #define WNOHANG 0x00000001 6652 #define WUNTRACED 0x00000002 6653 #define WCOREFLAG 0x80 6654 #define WSTOPSIG(status) WEXITSTATUS(status) 6655 6656 typedef enum { 6657 P_ALL, 6658 P_PID, 6659 P_PGID 6660 } idtype_t; 6661 extern int waitid(idtype_t, id_t, siginfo_t *, int); 6662 extern pid_t wait(int *); 6663 extern pid_t waitpid(pid_t, int *, int); 6664 extern pid_t wait4(pid_t, int *, int, struct rusage *); 6665 __________________________________________________________ 6666 6667 13.4.74. syslog.h 6668 6669 #define LOG_EMERG 0 6670 #define LOG_PRIMASK 0x07 6671 #define LOG_ALERT 1 6672 #define LOG_CRIT 2 6673 #define LOG_ERR 3 6674 #define LOG_WARNING 4 6675 #define LOG_NOTICE 5 6676 #define LOG_INFO 6 6677 #define LOG_DEBUG 7 6678 6679 #define LOG_KERN (0<<3) 6680 #define LOG_AUTHPRIV (10<<3) 6681 #define LOG_FTP (11<<3) 6682 #define LOG_USER (1<<3) 6683 #define LOG_MAIL (2<<3) 6684 #define LOG_DAEMON (3<<3) 6685 #define LOG_AUTH (4<<3) 6686 #define LOG_SYSLOG (5<<3) 6687 #define LOG_LPR (6<<3) 6688 #define LOG_NEWS (7<<3) 6689 #define LOG_UUCP (8<<3) 6690 #define LOG_CRON (9<<3) 6691 #define LOG_FACMASK 0x03f8 6692 6693 #define LOG_LOCAL0 (16<<3) 6694 #define LOG_LOCAL1 (17<<3) 6695 #define LOG_LOCAL2 (18<<3) 6696 #define LOG_LOCAL3 (19<<3) 6697 #define LOG_LOCAL4 (20<<3) 6698 #define LOG_LOCAL5 (21<<3) 6699 #define LOG_LOCAL6 (22<<3) 6700 #define LOG_LOCAL7 (23<<3) 6701 6702 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 6703 #define LOG_MASK(pri) (1 << (pri)) 6704 6705 #define LOG_PID 0x01 6706 #define LOG_CONS 0x02 6707 #define LOG_ODELAY 0x04 6708 #define LOG_NDELAY 0x08 6709 #define LOG_NOWAIT 0x10 6710 #define LOG_PERROR 0x20 6711 6712 extern void closelog(void); 6713 extern void openlog(const char *, int, int); 6714 extern int setlogmask(int); 6715 extern void syslog(int, const char *, ...); 6716 extern void vsyslog(int, const char *, va_list); 6717 __________________________________________________________ 6718 6719 13.4.75. termios.h 6720 6721 #define TCIFLUSH 0 6722 #define TCOOFF 0 6723 #define TCSANOW 0 6724 #define BS0 0000000 6725 #define CR0 0000000 6726 #define FF0 0000000 6727 #define NL0 0000000 6728 #define TAB0 0000000 6729 #define VT0 0000000 6730 #define OPOST 0000001 6731 #define OCRNL 0000010 6732 #define ONOCR 0000020 6733 #define ONLRET 0000040 6734 #define OFILL 0000100 6735 #define OFDEL 0000200 6736 #define NL1 0000400 6737 #define TCOFLUSH 1 6738 #define TCOON 1 6739 #define TCSADRAIN 1 6740 #define TCIOFF 2 6741 #define TCIOFLUSH 2 6742 #define TCSAFLUSH 2 6743 #define TCION 3 6744 6745 typedef unsigned int speed_t; 6746 typedef unsigned char cc_t; 6747 typedef unsigned int tcflag_t; 6748 6749 #define NCCS 32 6750 6751 struct termios { 6752 tcflag_t c_iflag; 6753 tcflag_t c_oflag; 6754 tcflag_t c_cflag; 6755 tcflag_t c_lflag; 6756 cc_t c_line; 6757 cc_t c_cc[NCCS]; 6758 speed_t c_ispeed; 6759 speed_t c_ospeed; 6760 }; 6761 6762 #define VINTR 0 6763 #define VQUIT 1 6764 #define VLNEXT 15 6765 #define VERASE 2 6766 #define VKILL 3 6767 #define VEOF 4 6768 6769 #define IGNBRK 0000001 6770 #define BRKINT 0000002 6771 #define IGNPAR 0000004 6772 #define PARMRK 0000010 6773 #define INPCK 0000020 6774 #define ISTRIP 0000040 6775 #define INLCR 0000100 6776 #define IGNCR 0000200 6777 #define ICRNL 0000400 6778 #define IXANY 0004000 6779 #define IMAXBEL 0020000 6780 6781 #define CS5 0000000 6782 6783 #define ECHO 0000010 6784 6785 #define B0 0000000 6786 #define B50 0000001 6787 #define B75 0000002 6788 #define B110 0000003 6789 #define B134 0000004 6790 #define B150 0000005 6791 #define B200 0000006 6792 #define B300 0000007 6793 #define B600 0000010 6794 #define B1200 0000011 6795 #define B1800 0000012 6796 #define B2400 0000013 6797 #define B4800 0000014 6798 #define B9600 0000015 6799 #define B19200 0000016 6800 #define B38400 0000017 6801 6802 extern speed_t cfgetispeed(const struct termios *); 6803 extern speed_t cfgetospeed(const struct termios *); 6804 extern void cfmakeraw(struct termios *); 6805 extern int cfsetispeed(struct termios *, speed_t); 6806 extern int cfsetospeed(struct termios *, speed_t); 6807 extern int cfsetspeed(struct termios *, speed_t); 6808 extern int tcflow(int, int); 6809 extern int tcflush(int, int); 6810 extern pid_t tcgetsid(int); 6811 extern int tcsendbreak(int, int); 6812 extern int tcsetattr(int, int, const struct termios *); 6813 extern int tcdrain(int); 6814 extern int tcgetattr(int, struct termios *); 6815 __________________________________________________________ 6816 6817 13.4.76. time.h 6818 6819 #define CLK_TCK ((clock_t)__sysconf(2)) 6820 #define CLOCK_REALTIME 0 6821 #define TIMER_ABSTIME 1 6822 #define CLOCKS_PER_SEC 1000000l 6823 6824 struct tm { 6825 int tm_sec; 6826 int tm_min; 6827 int tm_hour; 6828 int tm_mday; 6829 int tm_mon; 6830 int tm_year; 6831 int tm_wday; 6832 int tm_yday; 6833 int tm_isdst; 6834 long int tm_gmtoff; 6835 char *tm_zone; 6836 }; 6837 struct itimerspec { 6838 struct timespec it_interval; 6839 struct timespec it_value; 6840 }; 6841 6842 extern int __daylight; 6843 extern long int __timezone; 6844 extern char *__tzname[]; 6845 extern char *asctime(const struct tm *); 6846 extern clock_t clock(void); 6847 extern char *ctime(const time_t *); 6848 extern char *ctime_r(const time_t *, char *); 6849 extern double difftime(time_t, time_t); 6850 extern struct tm *getdate(const char *); 6851 extern int getdate_err; 6852 extern struct tm *gmtime(const time_t *); 6853 extern struct tm *localtime(const time_t *); 6854 extern time_t mktime(struct tm *); 6855 extern int stime(const time_t *); 6856 extern size_t strftime(char *, size_t, const char *, const struct tm *); 6857 extern char *strptime(const char *, const char *, struct tm *); 6858 extern time_t time(time_t *); 6859 extern int nanosleep(const struct timespec *, struct timespec *); 6860 extern int daylight; 6861 extern long int timezone; 6862 extern char *tzname[]; 6863 extern void tzset(void); 6864 extern char *asctime_r(const struct tm *, char *); 6865 extern struct tm *gmtime_r(const time_t *, struct tm *); 6866 extern struct tm *localtime_r(const time_t *, struct tm *); 6867 extern int clock_getcpuclockid(pid_t, clockid_t *); 6868 extern int clock_getres(clockid_t, struct timespec *); 6869 extern int clock_gettime(clockid_t, struct timespec *); 6870 extern int clock_nanosleep(clockid_t, int, const struct timespec *, 6871 struct timespec *); 6872 extern int clock_settime(clockid_t, const struct timespec *); 6873 extern int timer_create(clockid_t, struct sigevent *, timer_t *); 6874 extern int timer_delete(timer_t); 6875 extern int timer_getoverrun(timer_t); 6876 extern int timer_gettime(timer_t, struct itimerspec *); 6877 extern int timer_settime(timer_t, int, const struct itimerspec *, 6878 struct itimerspec *); 6879 __________________________________________________________ 6880 6881 13.4.77. ucontext.h 6882 6883 extern int getcontext(ucontext_t *); 6884 extern void makecontext(ucontext_t *, void (*)(void) 6885 , int, ...); 6886 extern int setcontext(const struct ucontext *); 6887 extern int swapcontext(ucontext_t *, const struct ucontext *); 6888 __________________________________________________________ 6889 6890 13.4.78. ulimit.h 6891 6892 #define UL_GETFSIZE 1 6893 #define UL_SETFSIZE 2 6894 6895 extern long int ulimit(int, ...); 6896 __________________________________________________________ 6897 6898 13.4.79. unistd.h 6899 6900 #define SEEK_SET 0 6901 #define STDIN_FILENO 0 6902 #define SEEK_CUR 1 6903 #define STDOUT_FILENO 1 6904 #define SEEK_END 2 6905 #define STDERR_FILENO 2 6906 6907 typedef long long int off64_t; 6908 6909 #define F_OK 0 6910 #define X_OK 1 6911 #define W_OK 2 6912 #define R_OK 4 6913 6914 #define _POSIX_VDISABLE '\0' 6915 #define _POSIX_CHOWN_RESTRICTED 1 6916 #define _POSIX_JOB_CONTROL 1 6917 #define _POSIX_NO_TRUNC 1 6918 #define _POSIX_SHELL 1 6919 #define _POSIX_FSYNC 200112 6920 #define _POSIX_MAPPED_FILES 200112 6921 #define _POSIX_MEMLOCK 200112 6922 #define _POSIX_MEMLOCK_RANGE 200112 6923 #define _POSIX_MEMORY_PROTECTION 200112 6924 #define _POSIX_SEMAPHORES 200112 6925 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 6926 #define _POSIX_TIMERS 200112 6927 #define _POSIX2_C_BIND 200112L 6928 #define _POSIX_THREADS 200112L 6929 6930 #define _PC_LINK_MAX 0 6931 #define _PC_MAX_CANON 1 6932 #define _PC_ASYNC_IO 10 6933 #define _PC_PRIO_IO 11 6934 #define _PC_FILESIZEBITS 13 6935 #define _PC_REC_INCR_XFER_SIZE 14 6936 #define _PC_REC_MIN_XFER_SIZE 16 6937 #define _PC_REC_XFER_ALIGN 17 6938 #define _PC_ALLOC_SIZE_MIN 18 6939 #define _PC_MAX_INPUT 2 6940 #define _PC_2_SYMLINKS 20 6941 #define _PC_NAME_MAX 3 6942 #define _PC_PATH_MAX 4 6943 #define _PC_PIPE_BUF 5 6944 #define _PC_CHOWN_RESTRICTED 6 6945 #define _PC_NO_TRUNC 7 6946 #define _PC_VDISABLE 8 6947 #define _PC_SYNC_IO 9 6948 6949 #define _SC_ARG_MAX 0 6950 #define _SC_CHILD_MAX 1 6951 #define _SC_PRIORITY_SCHEDULING 10 6952 #define _SC_XOPEN_XPG4 100 6953 #define _SC_CHAR_BIT 101 6954 #define _SC_CHAR_MAX 102 6955 #define _SC_CHAR_MIN 103 6956 #define _SC_INT_MAX 104 6957 #define _SC_INT_MIN 105 6958 #define _SC_LONG_BIT 106 6959 #define _SC_WORD_BIT 107 6960 #define _SC_MB_LEN_MAX 108 6961 #define _SC_NZERO 109 6962 #define _SC_TIMERS 11 6963 #define _SC_SSIZE_MAX 110 6964 #define _SC_SCHAR_MAX 111 6965 #define _SC_SCHAR_MIN 112 6966 #define _SC_SHRT_MAX 113 6967 #define _SC_SHRT_MIN 114 6968 #define _SC_UCHAR_MAX 115 6969 #define _SC_UINT_MAX 116 6970 #define _SC_ULONG_MAX 117 6971 #define _SC_USHRT_MAX 118 6972 #define _SC_NL_ARGMAX 119 6973 #define _SC_ASYNCHRONOUS_IO 12 6974 #define _SC_NL_LANGMAX 120 6975 #define _SC_NL_MSGMAX 121 6976 #define _SC_NL_NMAX 122 6977 #define _SC_NL_SETMAX 123 6978 #define _SC_NL_TEXTMAX 124 6979 #define _SC_XBS5_ILP32_OFF32 125 6980 #define _SC_XBS5_ILP32_OFFBIG 126 6981 #define _SC_XBS5_LP64_OFF64 127 6982 #define _SC_XBS5_LPBIG_OFFBIG 128 6983 #define _SC_XOPEN_LEGACY 129 6984 #define _SC_PRIORITIZED_IO 13 6985 #define _SC_XOPEN_REALTIME 130 6986 #define _SC_XOPEN_REALTIME_THREADS 131 6987 #define _SC_ADVISORY_INFO 132 6988 #define _SC_BARRIERS 133 6989 #define _SC_BASE 134 6990 #define _SC_C_LANG_SUPPORT 135 6991 #define _SC_C_LANG_SUPPORT_R 136 6992 #define _SC_CLOCK_SELECTION 137 6993 #define _SC_CPUTIME 138 6994 #define _SC_THREAD_CPUTIME 139 6995 #define _SC_SYNCHRONIZED_IO 14 6996 #define _SC_DEVICE_IO 140 6997 #define _SC_DEVICE_SPECIFIC 141 6998 #define _SC_DEVICE_SPECIFIC_R 142 6999 #define _SC_FD_MGMT 143 7000 #define _SC_FIFO 144 7001 #define _SC_PIPE 145 7002 #define _SC_FILE_ATTRIBUTES 146 7003 #define _SC_FILE_LOCKING 147 7004 #define _SC_FILE_SYSTEM 148 7005 #define _SC_MONOTONIC_CLOCK 149 7006 #define _SC_FSYNC 15 7007 #define _SC_MULTI_PROCESS 150 7008 #define _SC_SINGLE_PROCESS 151 7009 #define _SC_NETWORKING 152 7010 #define _SC_READER_WRITER_LOCKS 153 7011 #define _SC_SPIN_LOCKS 154 7012 #define _SC_REGEXP 155 7013 #define _SC_REGEX_VERSION 156 7014 #define _SC_SHELL 157 7015 #define _SC_SIGNALS 158 7016 #define _SC_SPAWN 159 7017 #define _SC_MAPPED_FILES 16 7018 #define _SC_SPORADIC_SERVER 160 7019 #define _SC_THREAD_SPORADIC_SERVER 161 7020 #define _SC_SYSTEM_DATABASE 162 7021 #define _SC_SYSTEM_DATABASE_R 163 7022 #define _SC_TIMEOUTS 164 7023 #define _SC_TYPED_MEMORY_OBJECTS 165 7024 #define _SC_USER_GROUPS 166 7025 #define _SC_USER_GROUPS_R 167 7026 #define _SC_2_PBS 168 7027 #define _SC_2_PBS_ACCOUNTING 169 7028 #define _SC_MEMLOCK 17 7029 #define _SC_2_PBS_LOCATE 170 7030 #define _SC_2_PBS_MESSAGE 171 7031 #define _SC_2_PBS_TRACK 172 7032 #define _SC_SYMLOOP_MAX 173 7033 #define _SC_STREAMS 174 7034 #define _SC_2_PBS_CHECKPOINT 175 7035 #define _SC_V6_ILP32_OFF32 176 7036 #define _SC_V6_ILP32_OFFBIG 177 7037 #define _SC_V6_LP64_OFF64 178 7038 #define _SC_V6_LPBIG_OFFBIG 179 7039 #define _SC_MEMLOCK_RANGE 18 7040 #define _SC_HOST_NAME_MAX 180 7041 #define _SC_TRACE 181 7042 #define _SC_TRACE_EVENT_FILTER 182 7043 #define _SC_TRACE_INHERIT 183 7044 #define _SC_TRACE_LOG 184 7045 #define _SC_LEVEL1_ICACHE_SIZE 185 7046 #define _SC_LEVEL1_ICACHE_ASSOC 186 7047 #define _SC_LEVEL1_ICACHE_LINESIZE 187 7048 #define _SC_LEVEL1_DCACHE_SIZE 188 7049 #define _SC_LEVEL1_DCACHE_ASSOC 189 7050 #define _SC_MEMORY_PROTECTION 19 7051 #define _SC_LEVEL1_DCACHE_LINESIZE 190 7052 #define _SC_LEVEL2_CACHE_SIZE 191 7053 #define _SC_LEVEL2_CACHE_ASSOC 192 7054 #define _SC_LEVEL2_CACHE_LINESIZE 193 7055 #define _SC_LEVEL3_CACHE_SIZE 194 7056 #define _SC_LEVEL3_CACHE_ASSOC 195 7057 #define _SC_LEVEL3_CACHE_LINESIZE 196 7058 #define _SC_LEVEL4_CACHE_SIZE 197 7059 #define _SC_LEVEL4_CACHE_ASSOC 198 7060 #define _SC_LEVEL4_CACHE_LINESIZE 199 7061 #define _SC_CLK_TCK 2 7062 #define _SC_MESSAGE_PASSING 20 7063 #define _SC_SEMAPHORES 21 7064 #define _SC_SHARED_MEMORY_OBJECTS 22 7065 #define _SC_AIO_LISTIO_MAX 23 7066 #define _SC_IPV6 235 7067 #define _SC_RAW_SOCKETS 236 7068 #define _SC_AIO_MAX 24 7069 #define _SC_AIO_PRIO_DELTA_MAX 25 7070 #define _SC_DELAYTIMER_MAX 26 7071 #define _SC_MQ_OPEN_MAX 27 7072 #define _SC_MQ_PRIO_MAX 28 7073 #define _SC_VERSION 29 7074 #define _SC_NGROUPS_MAX 3 7075 #define _SC_PAGESIZE 30 7076 #define _SC_PAGE_SIZE 30 7077 #define _SC_RTSIG_MAX 31 7078 #define _SC_SEM_NSEMS_MAX 32 7079 #define _SC_SEM_VALUE_MAX 33 7080 #define _SC_SIGQUEUE_MAX 34 7081 #define _SC_TIMER_MAX 35 7082 #define _SC_BC_BASE_MAX 36 7083 #define _SC_BC_DIM_MAX 37 7084 #define _SC_BC_SCALE_MAX 38 7085 #define _SC_BC_STRING_MAX 39 7086 #define _SC_OPEN_MAX 4 7087 #define _SC_COLL_WEIGHTS_MAX 40 7088 #define _SC_EQUIV_CLASS_MAX 41 7089 #define _SC_EXPR_NEST_MAX 42 7090 #define _SC_LINE_MAX 43 7091 #define _SC_RE_DUP_MAX 44 7092 #define _SC_CHARCLASS_NAME_MAX 45 7093 #define _SC_2_VERSION 46 7094 #define _SC_2_C_BIND 47 7095 #define _SC_2_C_DEV 48 7096 #define _SC_2_FORT_DEV 49 7097 #define _SC_STREAM_MAX 5 7098 #define _SC_2_FORT_RUN 50 7099 #define _SC_2_SW_DEV 51 7100 #define _SC_2_LOCALEDEF 52 7101 #define _SC_PII 53 7102 #define _SC_PII_XTI 54 7103 #define _SC_PII_SOCKET 55 7104 #define _SC_PII_INTERNET 56 7105 #define _SC_PII_OSI 57 7106 #define _SC_POLL 58 7107 #define _SC_SELECT 59 7108 #define _SC_TZNAME_MAX 6 7109 #define _SC_IOV_MAX 60 7110 #define _SC_UIO_MAXIOV 60 7111 #define _SC_PII_INTERNET_STREAM 61 7112 #define _SC_PII_INTERNET_DGRAM 62 7113 #define _SC_PII_OSI_COTS 63 7114 #define _SC_PII_OSI_CLTS 64 7115 #define _SC_PII_OSI_M 65 7116 #define _SC_T_IOV_MAX 66 7117 #define _SC_THREADS 67 7118 #define _SC_THREAD_SAFE_FUNCTIONS 68 7119 #define _SC_GETGR_R_SIZE_MAX 69 7120 #define _SC_JOB_CONTROL 7 7121 #define _SC_GETPW_R_SIZE_MAX 70 7122 #define _SC_LOGIN_NAME_MAX 71 7123 #define _SC_TTY_NAME_MAX 72 7124 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 7125 #define _SC_THREAD_KEYS_MAX 74 7126 #define _SC_THREAD_STACK_MIN 75 7127 #define _SC_THREAD_THREADS_MAX 76 7128 #define _SC_THREAD_ATTR_STACKADDR 77 7129 #define _SC_THREAD_ATTR_STACKSIZE 78 7130 #define _SC_THREAD_PRIORITY_SCHEDULING 79 7131 #define _SC_SAVED_IDS 8 7132 #define _SC_THREAD_PRIO_INHERIT 80 7133 #define _SC_THREAD_PRIO_PROTECT 81 7134 #define _SC_THREAD_PROCESS_SHARED 82 7135 #define _SC_NPROCESSORS_CONF 83 7136 #define _SC_NPROCESSORS_ONLN 84 7137 #define _SC_PHYS_PAGES 85 7138 #define _SC_AVPHYS_PAGES 86 7139 #define _SC_ATEXIT_MAX 87 7140 #define _SC_PASS_MAX 88 7141 #define _SC_XOPEN_VERSION 89 7142 #define _SC_REALTIME_SIGNALS 9 7143 #define _SC_XOPEN_XCU_VERSION 90 7144 #define _SC_XOPEN_UNIX 91 7145 #define _SC_XOPEN_CRYPT 92 7146 #define _SC_XOPEN_ENH_I18N 93 7147 #define _SC_XOPEN_SHM 94 7148 #define _SC_2_CHAR_TERM 95 7149 #define _SC_2_C_VERSION 96 7150 #define _SC_2_UPE 97 7151 #define _SC_XOPEN_XPG2 98 7152 #define _SC_XOPEN_XPG3 99 7153 7154 #define _CS_PATH 0 7155 #define _POSIX_REGEXP 1 7156 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 7157 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 7158 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 7159 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 7160 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 7161 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 7162 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 7163 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 7164 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 7165 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 7166 #define _CS_XBS5_LP64_OFF64_LIBS 1110 7167 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 7168 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 7169 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 7170 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 7171 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 7172 7173 #define _XOPEN_XPG4 1 7174 7175 #define F_ULOCK 0 7176 #define F_LOCK 1 7177 #define F_TLOCK 2 7178 #define F_TEST 3 7179 7180 extern int getdtablesize(void); 7181 extern char **__environ; 7182 extern pid_t __getpgid(pid_t); 7183 extern void _exit(int); 7184 extern int acct(const char *); 7185 extern unsigned int alarm(unsigned int); 7186 extern int chown(const char *, uid_t, gid_t); 7187 extern int chroot(const char *); 7188 extern size_t confstr(int, char *, size_t); 7189 extern char *ctermid(char *); 7190 extern char *cuserid(char *); 7191 extern int daemon(int, int); 7192 extern int execl(const char *, const char *, ...); 7193 extern int execle(const char *, const char *, ...); 7194 extern int execlp(const char *, const char *, ...); 7195 extern int execv(const char *, char *const); 7196 extern int execvp(const char *, char *const); 7197 extern int fdatasync(int); 7198 extern int ftruncate64(int, off64_t); 7199 extern int getdomainname(char *, size_t); 7200 extern long int gethostid(void); 7201 extern char *getlogin(void); 7202 extern int getlogin_r(char *, size_t); 7203 extern int getopt(int, char *const, const char *); 7204 extern pid_t getpgrp(void); 7205 extern pid_t getsid(pid_t); 7206 extern char *getwd(char *); 7207 extern int lockf(int, int, off_t); 7208 extern int lockf64(int, int, off64_t); 7209 extern int mkstemp(char *); 7210 extern int nice(int); 7211 extern char *optarg; 7212 extern int opterr; 7213 extern int optind; 7214 extern int optopt; 7215 extern int rename(const char *, const char *); 7216 extern int setegid(gid_t); 7217 extern int seteuid(uid_t); 7218 extern int sethostname(const char *, size_t); 7219 extern int setpgrp(void); 7220 extern void swab(const void *, void *, ssize_t); 7221 extern void sync(void); 7222 extern pid_t tcgetpgrp(int); 7223 extern int tcsetpgrp(int, pid_t); 7224 extern int truncate(const char *, off_t); 7225 extern int truncate64(const char *, off64_t); 7226 extern char *ttyname(int); 7227 extern unsigned int ualarm(useconds_t, useconds_t); 7228 extern int usleep(useconds_t); 7229 extern int close(int); 7230 extern int fsync(int); 7231 extern off_t lseek(int, off_t, int); 7232 extern int pause(void); 7233 extern ssize_t read(int, void *, size_t); 7234 extern ssize_t write(int, const void *, size_t); 7235 extern char *crypt(const char *, const char *); 7236 extern void encrypt(char *, int); 7237 extern void setkey(const char *); 7238 extern int access(const char *, int); 7239 extern int brk(void *); 7240 extern int chdir(const char *); 7241 extern int dup(int); 7242 extern int dup2(int, int); 7243 extern int execve(const char *, char *const, char *const); 7244 extern int fchdir(int); 7245 extern int fchown(int, uid_t, gid_t); 7246 extern pid_t fork(void); 7247 extern gid_t getegid(void); 7248 extern uid_t geteuid(void); 7249 extern gid_t getgid(void); 7250 extern int getgroups(int, gid_t); 7251 extern int gethostname(char *, size_t); 7252 extern pid_t getpgid(pid_t); 7253 extern pid_t getpid(void); 7254 extern uid_t getuid(void); 7255 extern int lchown(const char *, uid_t, gid_t); 7256 extern int link(const char *, const char *); 7257 extern int mkdir(const char *, mode_t); 7258 extern long int pathconf(const char *, int); 7259 extern int pipe(int); 7260 extern ssize_t readlink(const char *, char *, size_t); 7261 extern int rmdir(const char *); 7262 extern void *sbrk(intptr_t); 7263 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 7264 extern int setgid(gid_t); 7265 extern int setpgid(pid_t, pid_t); 7266 extern int setregid(gid_t, gid_t); 7267 extern int setreuid(uid_t, uid_t); 7268 extern pid_t setsid(void); 7269 extern int setuid(uid_t); 7270 extern unsigned int sleep(unsigned int); 7271 extern int symlink(const char *, const char *); 7272 extern long int sysconf(int); 7273 extern int unlink(const char *); 7274 extern pid_t vfork(void); 7275 extern ssize_t pread(int, void *, size_t, off_t); 7276 extern ssize_t pwrite(int, const void *, size_t, off_t); 7277 extern char **_environ; 7278 extern long int fpathconf(int, int); 7279 extern int ftruncate(int, off_t); 7280 extern char *getcwd(char *, size_t); 7281 extern int getpagesize(void); 7282 extern pid_t getppid(void); 7283 extern int isatty(int); 7284 extern loff_t lseek64(int, loff_t, int); 7285 extern ssize_t pread64(int, void *, size_t, off64_t); 7286 extern ssize_t pwrite64(int, const void *, size_t, off64_t); 7287 extern int ttyname_r(int, char *, size_t); 7288 __________________________________________________________ 7289 7290 13.4.80. utime.h 7291 7292 struct utimbuf { 7293 time_t actime; 7294 time_t modtime; 7295 }; 7296 extern int utime(const char *, const struct utimbuf *); 7297 __________________________________________________________ 7298 7299 13.4.81. utmp.h 7300 7301 #define UT_HOSTSIZE 256 7302 #define UT_LINESIZE 32 7303 #define UT_NAMESIZE 32 7304 7305 struct exit_status { 7306 short e_termination; 7307 short e_exit; 7308 }; 7309 7310 #define EMPTY 0 7311 #define RUN_LVL 1 7312 #define BOOT_TIME 2 7313 #define NEW_TIME 3 7314 #define OLD_TIME 4 7315 #define INIT_PROCESS 5 7316 #define LOGIN_PROCESS 6 7317 #define USER_PROCESS 7 7318 #define DEAD_PROCESS 8 7319 #define ACCOUNTING 9 7320 7321 extern void endutent(void); 7322 extern struct utmp *getutent(void); 7323 extern void setutent(void); 7324 extern int getutent_r(struct utmp *, struct utmp **); 7325 extern int utmpname(const char *); 7326 extern int login_tty(int); 7327 extern void login(const struct utmp *); 7328 extern int logout(const char *); 7329 extern void logwtmp(const char *, const char *, const char *); 7330 __________________________________________________________ 7331 7332 13.4.82. utmpx.h 7333 7334 extern void endutxent(void); 7335 extern struct utmpx *getutxent(void); 7336 extern struct utmpx *getutxid(const struct utmpx *); 7337 extern struct utmpx *getutxline(const struct utmpx *); 7338 extern struct utmpx *pututxline(const struct utmpx *); 7339 extern void setutxent(void); 7340 __________________________________________________________ 7341 7342 13.4.83. wchar.h 7343 7344 #define WEOF (0xffffffffu) 7345 #define WCHAR_MAX 0x7FFFFFFF 7346 #define WCHAR_MIN 0x80000000 7347 7348 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 7349 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 7350 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 7351 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 7352 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t * *, 7353 int, int); 7354 extern wchar_t *wcscat(wchar_t *, const wchar_t *); 7355 extern wchar_t *wcschr(const wchar_t *, wchar_t); 7356 extern int wcscmp(const wchar_t *, const wchar_t *); 7357 extern int wcscoll(const wchar_t *, const wchar_t *); 7358 extern wchar_t *wcscpy(wchar_t *, const wchar_t *); 7359 extern size_t wcscspn(const wchar_t *, const wchar_t *); 7360 extern wchar_t *wcsdup(const wchar_t *); 7361 extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); 7362 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); 7363 extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); 7364 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *); 7365 extern wchar_t *wcsrchr(const wchar_t *, wchar_t); 7366 extern size_t wcsspn(const wchar_t *, const wchar_t *); 7367 extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); 7368 extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t * *); 7369 extern int wcswidth(const wchar_t *, size_t); 7370 extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); 7371 extern int wctob(wint_t); 7372 extern int wcwidth(wchar_t); 7373 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); 7374 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t); 7375 extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); 7376 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 7377 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); 7378 extern size_t mbrlen(const char *, size_t, mbstate_t *); 7379 extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); 7380 extern int mbsinit(const mbstate_t *); 7381 extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, 7382 mbstate_t *); 7383 extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); 7384 extern wchar_t *wcpcpy(wchar_t *, const wchar_t *); 7385 extern wchar_t *wcpncpy(wchar_t *, const wchar_t *, size_t); 7386 extern size_t wcrtomb(char *, wchar_t, mbstate_t *); 7387 extern size_t wcslen(const wchar_t *); 7388 extern size_t wcsnrtombs(char *, const wchar_t * *, size_t, size_t, 7389 mbstate_t *); 7390 extern size_t wcsrtombs(char *, const wchar_t * *, size_t, mbstate_t *); 7391 extern double wcstod(const wchar_t *, wchar_t * *); 7392 extern float wcstof(const wchar_t *, wchar_t * *); 7393 extern long int wcstol(const wchar_t *, wchar_t * *, int); 7394 extern long double wcstold(const wchar_t *, wchar_t * *); 7395 extern long long int wcstoq(const wchar_t *, wchar_t * *, int); 7396 extern unsigned long int wcstoul(const wchar_t *, wchar_t * *, int); 7397 extern unsigned long long int wcstouq(const wchar_t *, wchar_t * *, int); 7398 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); 7399 extern int wcscasecmp(const wchar_t *, const wchar_t *); 7400 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 7401 extern size_t wcsnlen(const wchar_t *, size_t); 7402 extern long long int wcstoll(const wchar_t *, wchar_t * *, int); 7403 extern unsigned long long int wcstoull(const wchar_t *, wchar_t * *, int); 7404 extern wint_t btowc(int); 7405 extern wint_t fgetwc(FILE *); 7406 extern wint_t fgetwc_unlocked(FILE *); 7407 extern wchar_t *fgetws(wchar_t *, int, FILE *); 7408 extern wint_t fputwc(wchar_t, FILE *); 7409 extern int fputws(const wchar_t *, FILE *); 7410 extern int fwide(FILE *, int); 7411 extern int fwprintf(FILE *, const wchar_t *, ...); 7412 extern int fwscanf(FILE *, const wchar_t *, ...); 7413 extern wint_t getwc(FILE *); 7414 extern wint_t getwchar(void); 7415 extern wint_t putwc(wchar_t, FILE *); 7416 extern wint_t putwchar(wchar_t); 7417 extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); 7418 extern int swscanf(const wchar_t *, const wchar_t *, ...); 7419 extern wint_t ungetwc(wint_t, FILE *); 7420 extern int vfwprintf(FILE *, const wchar_t *, va_list); 7421 extern int vfwscanf(FILE *, const wchar_t *, va_list); 7422 extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); 7423 extern int vswscanf(const wchar_t *, const wchar_t *, va_list); 7424 extern int vwprintf(const wchar_t *, va_list); 7425 extern int vwscanf(const wchar_t *, va_list); 7426 extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, 7427 const struct tm *); 7428 extern int wprintf(const wchar_t *, ...); 7429 extern int wscanf(const wchar_t *, ...); 7430 __________________________________________________________ 7431 7432 13.4.84. wctype.h 7433 7434 typedef unsigned long int wctype_t; 7435 typedef unsigned int wint_t; 7436 typedef const int32_t *wctrans_t; 7437 typedef struct { 7438 int count; 7439 wint_t value; 7440 } __mbstate_t; 7441 7442 typedef __mbstate_t mbstate_t; 7443 extern int iswblank(wint_t); 7444 extern wint_t towlower(wint_t); 7445 extern wint_t towupper(wint_t); 7446 extern wctrans_t wctrans(const char *); 7447 extern int iswalnum(wint_t); 7448 extern int iswalpha(wint_t); 7449 extern int iswcntrl(wint_t); 7450 extern int iswctype(wint_t, wctype_t); 7451 extern int iswdigit(wint_t); 7452 extern int iswgraph(wint_t); 7453 extern int iswlower(wint_t); 7454 extern int iswprint(wint_t); 7455 extern int iswpunct(wint_t); 7456 extern int iswspace(wint_t); 7457 extern int iswupper(wint_t); 7458 extern int iswxdigit(wint_t); 7459 extern wctype_t wctype(const char *); 7460 extern wint_t towctrans(wint_t, wctrans_t); 7461 __________________________________________________________ 7462 7463 13.4.85. wordexp.h 7464 7465 enum { 7466 WRDE_DOOFFS = 1, 7467 WRDE_APPEND = 2, 7468 WRDE_NOCMD = 4, 7469 WRDE_REUSE = 8, 7470 WRDE_SHOWERR = 16, 7471 WRDE_UNDEF = 32 7472 }; 7473 7474 typedef struct { 7475 size_t we_wordc; 7476 char **we_wordv; 7477 size_t we_offs; 7478 } wordexp_t; 7479 7480 enum { 7481 WRDE_NOSYS = -1, 7482 WRDE_NOSPACE = 1, 7483 WRDE_BADCHAR = 2, 7484 WRDE_BADVAL = 3, 7485 WRDE_CMDSUB = 4, 7486 WRDE_SYNTAX = 5 7487 }; 7488 extern int wordexp(const char *, wordexp_t *, int); 7489 extern void wordfree(wordexp_t *); 7490 __________________________________________________________ 7491 7492 13.5. Interface Definitions for libc 7493 7494 Table of Contents 7495 _IO_feof -- alias for feof 7496 _IO_getc -- alias for getc 7497 _IO_putc -- alias for putc 7498 _IO_puts -- alias for puts 7499 __assert_fail -- abort the program after false assertion 7500 __ctype_b_loc -- accessor function for __ctype_b array for 7501 ctype functions 7502 7503 __ctype_get_mb_cur_max -- maximum length of a multibyte 7504 character in the current locale 7505 7506 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 7507 array for ctype tolower() function 7508 7509 __ctype_toupper_loc -- accessor function for 7510 __ctype_b_toupper() array for ctype toupper() function 7511 7512 __cxa_atexit -- register a function to be called by exit or 7513 when a shared library is unloaded 7514 7515 __cxa_finalize -- call destructors of global (or local static) 7516 C++ objects and exit functions registered with atexit 7517 7518 __daylight -- daylight savings time flag 7519 __environ -- alias for environ - user environment 7520 __errno_location -- address of errno variable 7521 __fpending -- returns in bytes the amount of output pending on 7522 a stream 7523 7524 __getpagesize -- alias for getpagesize - get current page size 7525 __getpgid -- get the process group id 7526 __h_errno_location -- address of h_errno variable 7527 __isinf -- test for infinity 7528 __isinff -- test for infinity 7529 __isinfl -- test for infinity 7530 __isnan -- test for infinity 7531 __isnanf -- test for infinity 7532 __isnanl -- test for infinity 7533 __libc_current_sigrtmax -- return number of available real-time 7534 signal with lowest priority 7535 7536 __libc_current_sigrtmin -- return number of available real-time 7537 signal with highest priority 7538 7539 __libc_start_main -- initialization routine 7540 __lxstat -- inline wrapper around call to lxstat 7541 __mempcpy -- copy given number of bytes of source to 7542 destination 7543 7544 __rawmemchr -- scan memory 7545 __register_atfork -- alias for register_atfork 7546 __sigsetjmp -- save stack context for non-local goto 7547 __stpcpy -- alias for stpcpy 7548 __strdup -- alias for strdup 7549 __strtod_internal -- underlying function for strtod 7550 __strtof_internal -- underlying function for strtof 7551 __strtok_r -- alias for strtok_r 7552 __strtol_internal -- alias for strtol 7553 __strtold_internal -- underlying function for strtold 7554 __strtoll_internal -- underlying function for strtoll 7555 __strtoul_internal -- underlying function for strtoul 7556 __strtoull_internal -- underlying function for strtoull 7557 __sysconf -- get configuration information at runtime 7558 __sysv_signal -- signal handling 7559 __timezone -- global variable containing timezone 7560 __tzname -- global variable containing the timezone 7561 __wcstod_internal -- underlying function for wcstod 7562 __wcstof_internal -- underlying function for wcstof 7563 __wcstol_internal -- underlying function for wcstol 7564 __wcstold_internal -- underlying function for wcstold 7565 __wcstoul_internal -- underlying function for wcstoul 7566 __xmknod -- make block or character special file 7567 __xpg_basename -- return the last component of a file name 7568 __xpg_sigpause -- remove a signal from the signal mask and 7569 suspend the thread 7570 7571 __xpg_strerror_r -- return string describing error number 7572 __xstat -- get File Status 7573 __xstat64 -- get File Status 7574 _environ -- alias for environ - user environment 7575 _nl_msg_cat_cntr -- new catalog load counter 7576 _sys_errlist -- array containing the "C" locale strings used by 7577 strerror() 7578 7579 _sys_siglist -- array containing the names of the signal names 7580 acct -- switch process accounting on or off 7581 adjtime -- correct the time to allow synchronization of the 7582 system clock 7583 7584 asprintf -- write formatted output to a dynamically allocated 7585 string 7586 7587 basename -- return the last component of a file name 7588 bind_textdomain_codeset -- specify encoding for message 7589 retrieval 7590 7591 bindresvport -- bind socket to privileged IP port 7592 bindtextdomain -- specify the location of a message catalog 7593 cfmakeraw -- get and set terminal attributes 7594 cfsetspeed -- set terminal input and output data rate 7595 daemon -- run in the background 7596 dcgettext -- perform domain and category specific lookup in 7597 message catalog 7598 7599 dcngettext -- perform domain and category specific lookup in 7600 message catalog with plural 7601 7602 dgettext -- perform lookup in message catalog for the current 7603 LC_MESSAGES locale 7604 7605 dngettext -- perform lookup in message catalog for the current 7606 locale 7607 7608 duplocale -- provide new handle for selection of locale 7609 endutent -- access utmp file entries 7610 err -- display formatted error messages 7611 error -- print error message 7612 errx -- display formatted error message and exit 7613 fcntl -- file control 7614 fflush_unlocked -- non thread safe fflush 7615 fgetwc_unlocked -- non thread safe fgetwc 7616 flock -- apply or remove an advisory lock on an open file 7617 freelocale -- free a locale object 7618 fscanf -- convert formatted input 7619 fstatfs -- (deprecated) 7620 fstatfs64 -- (deprecated) 7621 fwscanf -- convert formatted input 7622 getdomainname -- get NIS domain name (DEPRECATED). 7623 getdtablesize -- get file descriptor table size (DEPRECATED) 7624 getgrouplist -- get groups a user belongs to 7625 gethostbyaddr_r -- find network host database entry matching 7626 host name (DEPRECATED) 7627 7628 gethostbyname2 -- find network host database entry matching 7629 host name (DEPRECATED) 7630 7631 gethostbyname2_r -- find network host database entry matching 7632 host name (DEPRECATED) 7633 7634 gethostbyname_r -- find network host database entry matching 7635 host name (DEPRECATED) 7636 7637 getloadavg -- get system load averages 7638 getopt -- parse command line options 7639 getopt_long -- parse command line options 7640 getopt_long_only -- parse command line options 7641 getpagesize -- get memory page size (DEPRECATED) 7642 getsockopt -- get socket options 7643 gettext -- search message catalogs for a string 7644 getutent -- access user accounting database entries 7645 getutent_r -- access user accounting database entries 7646 glob64 -- find pathnames matching a pattern (Large File 7647 Support) 7648 7649 globfree64 -- free memory from glob64() (Large File Support) 7650 inet_aton -- Internet address manipulation routine 7651 initgroups -- initialize the supplementary group access list 7652 ioctl -- control device 7653 sockio -- socket ioctl commands 7654 ttyio -- tty ioctl commands 7655 kill -- send a signal 7656 link -- create a link to a file 7657 mbsnrtowcs -- convert a multibyte string to a wide character 7658 string 7659 7660 memmem -- locate bytes 7661 memrchr -- scan memory for a character 7662 mremap -- remap a virtual memory address 7663 newlocale -- allocate a locale object 7664 ngettext -- search message catalogs for plural string 7665 pmap_getport -- find the port number assigned to a service 7666 registered with a portmapper. 7667 7668 pmap_set -- establishes mapping to machine's RPC Bind service. 7669 pmap_unset -- destroys RPC Binding 7670 posix_fadvise64 -- File advisory information (Large File 7671 Support) 7672 7673 posix_fallocate64 -- file space control (Large File Support) 7674 psignal -- print signal message 7675 readdir64_r -- read a directory (Large File Support) 7676 regexec -- regular expression matching 7677 scanf -- convert formatted input 7678 sched_setscheduler -- set scheduling policy and parameters 7679 setbuffer -- stream buffering operation 7680 setgroups -- set list of supplementary group IDs 7681 sethostname -- set host name 7682 setsockopt -- set socket options 7683 setutent -- access user accounting database entries 7684 sigandset -- build a new signal set by combining the two input 7685 sets using logical AND 7686 7687 sigisemptyset -- check for empty signal set 7688 sigorset -- build a new signal set by combining the two input 7689 sets using logical OR 7690 7691 sigpause -- remove a signal from the signal mask and suspend 7692 the thread (deprecated) 7693 7694 sigreturn -- return from signal handler and cleanup stack frame 7695 sscanf -- convert formatted input 7696 statfs -- (deprecated) 7697 statfs64 -- (deprecated) 7698 stime -- set time 7699 stpcpy -- copy a string returning a pointer to its end 7700 stpncpy -- copy a fixed-size string, returning a pointer to its 7701 end 7702 7703 strcasestr -- locate a substring ignoring case 7704 strerror_r -- return string describing error number 7705 strndup -- return a malloc'd copy of at most the specified 7706 number of bytes of a string 7707 7708 strnlen -- determine the length of a fixed-size string 7709 strptime -- parse a time string 7710 strsep -- extract token from string 7711 strsignal -- return string describing signal 7712 strtoq -- convert string value to a long or quad_t integer 7713 strtouq -- convert a string to an unsigned long long 7714 svc_register -- register Remote Procedure Call interface 7715 svc_run -- waits for RPC requests to arrive and calls service 7716 procedure 7717 7718 svc_sendreply -- called by RPC service's dispatch routine 7719 svctcp_create -- create a TCP/IP-based RPC service transport 7720 svcudp_create -- create a UDP-based RPC service transport 7721 swscanf -- convert formatted input 7722 sysconf -- Get configuration information at runtime 7723 system -- execute a shell command 7724 textdomain -- set the current default message domain 7725 unlink -- remove a directory entry 7726 uselocale -- set locale for thread 7727 utmpname -- set user accounting database 7728 vasprintf -- write formatted output to a dynamically allocated 7729 string 7730 7731 vdprintf -- write formatted output to a file descriptor 7732 verrx -- display formatted error message and exit 7733 vfscanf -- convert formatted input 7734 vfwscanf -- convert formatted input 7735 vscanf -- convert formatted input 7736 vsscanf -- convert formatted input 7737 vswscanf -- convert formatted input 7738 vsyslog -- log to system log 7739 vwscanf -- convert formatted input 7740 wait4 -- wait for process termination, BSD style 7741 waitpid -- wait for child process 7742 warn -- formatted error messages 7743 warnx -- formatted error messages 7744 wcpcpy -- copy a wide character string, returning a pointer to 7745 its end 7746 7747 wcpncpy -- copy a fixed-size string of wide characters, 7748 returning a pointer to its end 7749 7750 wcscasecmp -- compare two wide-character strings, ignoring case 7751 wcsdup -- duplicate a wide-character string 7752 wcsncasecmp -- compare two fixed-size wide-character strings, 7753 ignoring case 7754 7755 wcsnlen -- determine the length of a fixed-size wide-character 7756 string 7757 7758 wcsnrtombs -- convert a wide character string to a multi-byte 7759 string 7760 7761 wcstoq -- convert wide string to long long int representation 7762 wcstouq -- convert wide string to unsigned long long int 7763 representation 7764 7765 wscanf -- convert formatted input 7766 xdr_u_int -- library routines for external data representation 7767 xdrstdio_create -- library routines for external data 7768 representation 7769 7770 The interfaces defined on the following pages are included in 7771 libc and are defined by this specification. Unless otherwise 7772 noted, these interfaces shall be included in the source 7773 standard. 7774 7775 Other interfaces listed in Section 13.3 shall behave as 7776 described in the referenced base document. 7777 7778 _IO_feof 7779 7780 Name 7781 7782 _IO_feof -- alias for feof 7783 7784 Synopsis 7785 7786 int _IO_feof(_IO_FILE * __fp); 7787 7788 Description 7789 7790 _IO_feof() tests the end-of-file indicator for the stream 7791 pointed to by __fp, returning a non-zero value if it is set. 7792 7793 _IO_feof() is not in the source standard; it is only in the 7794 binary standard. 7795 7796 _IO_getc 7797 7798 Name 7799 7800 _IO_getc -- alias for getc 7801 7802 Synopsis 7803 7804 int _IO_getc(_IO_FILE * __fp); 7805 7806 Description 7807 7808 _IO_getc() reads the next character from __fp and returns it as 7809 an unsigned char cast to an int, or EOF on end-of-file or 7810 error. 7811 7812 _IO_getc() is not in the source standard; it is only in the 7813 binary standard. 7814 7815 _IO_putc 7816 7817 Name 7818 7819 _IO_putc -- alias for putc 7820 7821 Synopsis 7822 7823 int _IO_putc(int __c, _IO_FILE * __fp); 7824 7825 Description 7826 7827 _IO_putc() writes the character __c, cast to an unsigned char, 7828 to __fp. 7829 7830 _IO_putc() is not in the source standard; it is only in the 7831 binary standard. 7832 7833 _IO_puts 7834 7835 Name 7836 7837 _IO_puts -- alias for puts 7838 7839 Synopsis 7840 7841 int _IO_puts(const char * __c); 7842 7843 Description 7844 7845 _IO_puts() writes the string __s and a trailing newline to 7846 stdout. 7847 7848 _IO_puts() is not in the source standard; it is only in the 7849 binary standard. 7850 7851 __assert_fail 7852 7853 Name 7854 7855 __assert_fail -- abort the program after false assertion 7856 7857 Synopsis 7858 7859 void __assert_fail(const char * assertion, const char * file, 7860 unsigned int line, const char * function); 7861 7862 Description 7863 7864 The __assert_fail() function is used to implement the assert() 7865 interface of ISO POSIX (2003). The __assert_fail() function 7866 shall print the given file filename, line line number, function 7867 function name and a message on the standard error stream in an 7868 unspecified format, and abort program execution via the abort() 7869 function. For example: 7870 7871 a.c:10: foobar: Assertion a == b failed. 7872 7873 If function is NULL, __assert_fail() shall omit information 7874 about the function. 7875 7876 assertion, file, and line shall be non-NULL. 7877 7878 The __assert_fail() function is not in the source standard; it 7879 is only in the binary standard. The assert() interface is not 7880 in the binary standard; it is only in the source standard. The 7881 assert() may be implemented as a macro. 7882 7883 __ctype_b_loc 7884 7885 Name 7886 7887 __ctype_b_loc -- accessor function for __ctype_b array for 7888 ctype functions 7889 7890 Synopsis 7891 7892 #include 7893 7894 const unsigned short * * __ctype_b_loc (void); 7895 7896 Description 7897 7898 The __ctype_b_loc() function shall return a pointer into an 7899 array of characters in the current locale that contains 7900 characteristics for each character in the current character 7901 set. The array shall contain a total of 384 characters, and can 7902 be indexed with any signed or unsigned char (i.e. with an index 7903 value between -128 and 255). If the application is 7904 multithreaded, the array shall be local to the current thread. 7905 7906 This interface is not in the source standard; it is only in the 7907 binary standard. 7908 7909 Return Value 7910 7911 The __ctype_b_loc() function shall return a pointer to the 7912 array of characters to be used for the ctype() family of 7913 functions (see ). 7914 7915 __ctype_get_mb_cur_max 7916 7917 Name 7918 7919 __ctype_get_mb_cur_max -- maximum length of a multibyte 7920 character in the current locale 7921 7922 Synopsis 7923 7924 size_t __ctype_get_mb_cur_max(void); 7925 7926 Description 7927 7928 __ctype_get_mb_cur_max() returns the maximum length of a 7929 multibyte character in the current locale. 7930 7931 __ctype_get_mb_cur_max() is not in the source standard; it is 7932 only in the binary standard. 7933 7934 __ctype_tolower_loc 7935 7936 Name 7937 7938 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 7939 array for ctype tolower() function 7940 7941 Synopsis 7942 7943 #include 7944 7945 int32_t * * __ctype_tolower_loc(void); 7946 7947 Description 7948 7949 The __ctype_tolower_loc() function shall return a pointer into 7950 an array of characters in the current locale that contains 7951 lower case equivalents for each character in the current 7952 character set. The array shall contain a total of 384 7953 characters, and can be indexed with any signed or unsigned char 7954 (i.e. with an index value between -128 and 255). If the 7955 application is multithreaded, the array shall be local to the 7956 current thread. 7957 7958 This interface is not in the source standard; it is only in the 7959 binary standard. 7960 7961 Return Value 7962 7963 The __ctype_tolower_loc() function shall return a pointer to 7964 the array of characters to be used for the ctype() family of 7965 functions (see ). 7966 7967 __ctype_toupper_loc 7968 7969 Name 7970 7971 __ctype_toupper_loc -- accessor function for 7972 __ctype_b_toupper() array for ctype toupper() function 7973 7974 Synopsis 7975 7976 #include 7977 7978 int32_t * * __ctype_toupper_loc(void); 7979 7980 Description 7981 7982 The __ctype_toupper_loc() function shall return a pointer into 7983 an array of characters in the current locale that contains 7984 upper case equivalents for each character in the current 7985 character set. The array shall contain a total of 384 7986 characters, and can be indexed with any signed or unsigned char 7987 (i.e. with an index value between -128 and 255). If the 7988 application is multithreaded, the array shall be local to the 7989 current thread. 7990 7991 This interface is not in the source standard; it is only in the 7992 binary standard. 7993 7994 Return Value 7995 7996 The __ctype_toupper_loc() function shall return a pointer to 7997 the array of characters to be used for the ctype() family of 7998 functions (see ). 7999 8000 __cxa_atexit 8001 8002 Name 8003 8004 __cxa_atexit -- register a function to be called by exit or 8005 when a shared library is unloaded 8006 8007 Synopsis 8008 8009 int __cxa_atexit(void (*func) (void *), void * arg, void * 8010 dso_handle); 8011 8012 Description 8013 8014 As described in the Itanium(TM) C++ ABI, __cxa_atexit() 8015 registers a destructor function to be called by exit() or when 8016 a shared library is unloaded. When a shared library is 8017 unloaded, any destructor function associated with that shared 8018 library, identified by dso_handle, shall be called with the 8019 single argument arg, and then that function shall be removed, 8020 or marked as complete, from the list of functions to run at 8021 exit(). On a call to exit(), any remaining functions registered 8022 shall be called with the single argument arg. Destructor 8023 functions shall always be called in the reverse order to their 8024 registration (i.e. the most recently registered function shall 8025 be called first), 8026 8027 The __cxa_atexit() function is used to implement atexit(), as 8028 described in ISO POSIX (2003). Calling atexit(func) from the 8029 statically linked part of an application shall be equivalent to 8030 __cxa_atexit(func, NULL, NULL). 8031 8032 __cxa_atexit() is not in the source standard; it is only in the 8033 binary standard. 8034 8035 Note: atexit() is not in the binary standard; it is only in 8036 the source standard. 8037 8038 __cxa_finalize 8039 8040 Name 8041 8042 __cxa_finalize -- call destructors of global (or local static) 8043 C++ objects and exit functions registered with atexit 8044 8045 Synopsis 8046 8047 void __cxa_finalize(void * d); 8048 8049 Description 8050 8051 As described in the Itanium® C++ ABI, the C runtime library 8052 shall maintain a list of termination function entries 8053 containing the following information: 8054 8055 * A pointer to a termination function. 8056 * An operand to be passed to the function. 8057 * A handle identifying the home shared library of the entry. 8058 8059 The list is populated by entries of two kinds: 8060 8061 * Destructors of global (or local static) C++ objects that 8062 require destruction on exit. 8063 * Functions registered by the user with atexit(). 8064 8065 In the former case an entry consists of a pointer to the 8066 destructor, a pointer to the corresponding object and a handle 8067 for the home shared library of the object. In the latter case 8068 the pointer to the function is the pointer passed to atexit(), 8069 while the other pointers are NULL. 8070 8071 When __cxa_finalize(d) is called, it shall walk the termination 8072 function list, calling each in turn if d matches the handle of 8073 the termination function entry. If d is NULL, it shall call all 8074 the termination funtions. Multiple calls to __cxa_finalize 8075 shall not result in calling termination function entries 8076 multiple times; the implementation may either remove entries or 8077 mark them finished. The termination functions shall always be 8078 called in the reverse order of their registration (i.e. the 8079 most recently registered function shall be called first). 8080 8081 An application shall not call __cxa_finalize() directly. The 8082 implementation shall arrange for__cxa_finalize() to be called 8083 during early shared library unload (e.g. dlclose()) with a 8084 handle to the shared library. When the main program calls exit, 8085 the implementation shall cause any remaining 8086 __cxa_atexit-registered functions to be called, either by 8087 calling __cxa_finalize(NULL), or by walking the registration 8088 list itself. 8089 8090 __cxa_finalize() is not in the source standard; it is only in 8091 the binary standard. 8092 8093 __daylight 8094 8095 Name 8096 8097 __daylight -- daylight savings time flag 8098 8099 Synopsis 8100 8101 int __daylight; 8102 8103 Description 8104 8105 The integer variable __daylight shall implement the daylight 8106 savings time flag daylight as specified in the ISO POSIX (2003) 8107 header file . 8108 8109 __daylight is not in the source standard; it is only in the 8110 binary standard. daylight is not in the binary standard; it is 8111 only in the source standard. 8112 8113 __environ 8114 8115 Name 8116 8117 __environ -- alias for environ - user environment 8118 8119 Synopsis 8120 8121 extern char * *__environ; 8122 8123 Description 8124 8125 __environ is an alias for environ - user environment. 8126 8127 __environ has the same specification as environ. 8128 8129 __environ is not in the source standard; it is only in the 8130 binary standard. 8131 8132 __errno_location 8133 8134 Name 8135 8136 __errno_location -- address of errno variable 8137 8138 Synopsis 8139 8140 int * __errno_location(void); 8141 8142 Description 8143 8144 The __errno_location() function shall return the address of the 8145 errno variable for the current thread. 8146 8147 __errno_location() is not in the source standard; it is only in 8148 the binary standard. 8149 8150 __fpending 8151 8152 Name 8153 8154 __fpending -- returns in bytes the amount of output pending on 8155 a stream 8156 8157 Synopsis 8158 8159 size_t __fpending(FILE * stream); 8160 8161 Description 8162 8163 __fpending() returns the amount of output in bytes pending on a 8164 stream. 8165 8166 __fpending() is not in the source standard; it is only in the 8167 binary standard. 8168 8169 __getpagesize 8170 8171 Name 8172 8173 __getpagesize -- alias for getpagesize - get current page size 8174 8175 Synopsis 8176 8177 int __getpagesize(void); 8178 8179 Description 8180 8181 __getpagesize() is an alias for getpagesize() - get current 8182 page size. 8183 8184 __getpagesize() has the same specification as getpagesize(). 8185 8186 __getpagesize() is not in the source standard; it is only in 8187 the binary standard. 8188 8189 __getpgid 8190 8191 Name 8192 8193 __getpgid -- get the process group id 8194 8195 Synopsis 8196 8197 pid_t __getpgid(pid_t pid); 8198 8199 Description 8200 8201 __getpgid() has the same specification as getpgid(). 8202 8203 __getpgid() is not in the source standard; it is only in the 8204 binary standard. 8205 8206 __h_errno_location 8207 8208 Name 8209 8210 __h_errno_location -- address of h_errno variable 8211 8212 Synopsis 8213 8214 int * __h_errno_location(void); 8215 8216 Description 8217 8218 __h_errno_location() returns the address of the h_errno 8219 variable, where h_errno is as specified in ISO POSIX (2003). 8220 8221 __h_errno_location() is not in the source standard; it is only 8222 in the binary standard. Note that h_errno itself is only in the 8223 source standard; it is not in the binary standard. 8224 8225 __isinf 8226 8227 Name 8228 8229 __isinf -- test for infinity 8230 8231 Synopsis 8232 8233 int __isinf(double arg); 8234 8235 Description 8236 8237 __isinf() has the same specification as isinf() in ISO POSIX 8238 (2003), except that the argument type for __isinf() is known to 8239 be double. 8240 8241 __isinf() is not in the source standard; it is only in the 8242 binary standard. 8243 8244 __isinff 8245 8246 Name 8247 8248 __isinff -- test for infinity 8249 8250 Synopsis 8251 8252 int __isinff(float arg); 8253 8254 Description 8255 8256 __isinff() has the same specification as isinf() in ISO POSIX 8257 (2003) except that the argument type for __isinff() is known to 8258 be float. 8259 8260 __isinff() is not in the source standard; it is only in the 8261 binary standard. 8262 8263 __isinfl 8264 8265 Name 8266 8267 __isinfl -- test for infinity 8268 8269 Synopsis 8270 8271 int __isinfl(long double arg); 8272 8273 Description 8274 8275 __isinfl() has the same specification as isinf() in the ISO 8276 POSIX (2003), except that the argument type for __isinfl() is 8277 known to be long double. 8278 8279 __isinfl() is not in the source standard; it is only in the 8280 binary standard. 8281 8282 __isnan 8283 8284 Name 8285 8286 __isnan -- test for infinity 8287 8288 Synopsis 8289 8290 int __isnan(double arg); 8291 8292 Description 8293 8294 __isnan() has the same specification as isnan() in ISO POSIX 8295 (2003), except that the argument type for __isnan() is known to 8296 be double. 8297 8298 __isnan() is not in the source standard; it is only in the 8299 binary standard. 8300 8301 __isnanf 8302 8303 Name 8304 8305 __isnanf -- test for infinity 8306 8307 Synopsis 8308 8309 int __isnanf(float arg); 8310 8311 Description 8312 8313 __isnanf() has the same specification as isnan() in ISO POSIX 8314 (2003), except that the argument type for __isnanf() is known 8315 to be float. 8316 8317 __isnanf() is not in the source standard; it is only in the 8318 binary standard. 8319 8320 __isnanl 8321 8322 Name 8323 8324 __isnanl -- test for infinity 8325 8326 Synopsis 8327 8328 int __isnanl(long double arg); 8329 8330 Description 8331 8332 __isnanl() has the same specification as isnan() in ISO POSIX 8333 (2003), except that the argument type for __isnanl() is known 8334 to be long double. 8335 8336 __isnanl() is not in the source standard; it is only in the 8337 binary standard. 8338 8339 __libc_current_sigrtmax 8340 8341 Name 8342 8343 __libc_current_sigrtmax -- return number of available real-time 8344 signal with lowest priority 8345 8346 Synopsis 8347 8348 int __libc_current_sigrtmax(void); 8349 8350 Description 8351 8352 __libc_current_sigrtmax() returns the number of an available 8353 real-time signal with the lowest priority. 8354 8355 __libc_current_sigrtmax() is not in the source standard; it is 8356 only in the binary standard. 8357 8358 __libc_current_sigrtmin 8359 8360 Name 8361 8362 __libc_current_sigrtmin -- return number of available real-time 8363 signal with highest priority 8364 8365 Synopsis 8366 8367 int __libc_current_sigrtmin(void); 8368 8369 Description 8370 8371 __libc_current_sigrtmin() returns the number of an available 8372 real-time signal with the highest priority. 8373 8374 __libc_current_sigrtmin() is not in the source standard; it is 8375 only in the binary standard. 8376 8377 __libc_start_main 8378 8379 Name 8380 8381 __libc_start_main -- initialization routine 8382 8383 Synopsis 8384 8385 int __libc_start_main(int (*main) (int, char * *, char * *), 8386 int argc, char * * ubp_av, void (*init) (void), void (*fini) 8387 (void), void (*rtld_fini) (void), void (* stack_end)); 8388 8389 Description 8390 8391 The __libc_start_main() function shall perform any necessary 8392 initialization of the execution environment, call the main 8393 function with appropriate arguments, and handle the return from 8394 main(). If the main() function returns, the return value shall 8395 be passed to the exit() function. 8396 8397 Note: While this specification is intended to be 8398 implementation independent, process and library 8399 initialization may include: 8400 8401 * performing any necessary security checks if the effective 8402 user ID is not the same as the real user ID. 8403 * initialize the threading subsystem. 8404 * registering the rtld_fini to release resources when this 8405 dynamic shared object exits (or is unloaded). 8406 * registering the fini handler to run at program exit. 8407 * calling the initializer function (*init)(). 8408 * calling main() with appropriate arguments. 8409 * calling exit() with the return value from main(). 8410 8411 This list is an example only. 8412 8413 __libc_start_main() is not in the source standard; it is only 8414 in the binary standard. 8415 8416 See Also 8417 8418 The section on Process Initialization in each of the 8419 architecture specific parts of ISO/IEC 23360. 8420 8421 __lxstat 8422 8423 Name 8424 8425 __lxstat -- inline wrapper around call to lxstat 8426 8427 Synopsis 8428 8429 #include 8430 8431 int __lxstat(int version, char * __path, struct stat 8432 __statbuf); 8433 8434 Description 8435 8436 __lxstat() is an inline wrapper around call to lxstat(). 8437 8438 __lxstat() is not in the source standard; it is only in the 8439 binary standard. 8440 8441 __mempcpy 8442 8443 Name 8444 8445 __mempcpy -- copy given number of bytes of source to 8446 destination 8447 8448 Synopsis 8449 8450 #include 8451 8452 void * __mempcpy(void * restrict dest, const void * restrict 8453 src, size_t n); 8454 8455 Description 8456 8457 __mempcpy() copies n bytes of src to dest, returning a pointer 8458 to the byte after the last written byte. 8459 8460 __mempcpy() is not in the source standard; it is only in the 8461 binary standard. 8462 8463 __rawmemchr 8464 8465 Name 8466 8467 __rawmemchr -- scan memory 8468 8469 Synopsis 8470 8471 #include 8472 8473 void * __rawmemchr(const void * s, int c); 8474 8475 Description 8476 8477 __rawmemchr() searches in s for c. 8478 8479 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 8480 memchr(), but it has no length limit. 8481 8482 __rawmemchr() is not in the source standard; it is only in the 8483 binary standard. 8484 8485 __register_atfork 8486 8487 Name 8488 8489 __register_atfork -- alias for register_atfork 8490 8491 Synopsis 8492 8493 int __register_atfork(void (*prepare) (void), void (*parent) 8494 (void), void (*child) (void), void * __dso_handle); 8495 8496 Description 8497 8498 __register_atfork() implements pthread_atfork() as specified in 8499 ISO POSIX (2003). The additional parameter __dso_handle allows 8500 a shared object to pass in it's handle so that functions 8501 registered by __register_atfork() can be unregistered by the 8502 runtime when the shared object is unloaded. 8503 8504 __sigsetjmp 8505 8506 Name 8507 8508 __sigsetjmp -- save stack context for non-local goto 8509 8510 Synopsis 8511 8512 int __sigsetjmp(jmp_buf env, int savemask); 8513 8514 Description 8515 8516 __sigsetjmp() has the same behavior as sigsetjmp() as specified 8517 by ISO POSIX (2003). 8518 8519 __sigsetjmp() is not in the source standard; it is only in the 8520 binary standard. 8521 8522 __stpcpy 8523 8524 Name 8525 8526 __stpcpy -- alias for stpcpy 8527 8528 Synopsis 8529 8530 #include 8531 8532 char * __stpcpy(char * dest, const char * src); 8533 8534 Description 8535 8536 The __stpcpy() function has the same specification as the 8537 stpcpy(). 8538 8539 __stpcpy() is not in the source standard; it is only in the 8540 binary standard. 8541 8542 __strdup 8543 8544 Name 8545 8546 __strdup -- alias for strdup 8547 8548 Synopsis 8549 8550 char * __strdup(const char * string); 8551 8552 Description 8553 8554 __strdup() has the same specification as strdup(). 8555 8556 __strdup() is not in the source standard; it is only in the 8557 binary standard. 8558 8559 __strtod_internal 8560 8561 Name 8562 8563 __strtod_internal -- underlying function for strtod 8564 8565 Synopsis 8566 8567 double __strtod_internal(const char * __nptr, char * * 8568 __endptr, int __group); 8569 8570 Description 8571 8572 __group shall be 0 or the behavior of __strtod_internal() is 8573 undefined. 8574 8575 __strtod_internal(__nptr, __endptr, 0)() has the same 8576 specification as strtod(__nptr, __endptr)(). 8577 8578 __strtod_internal() is not in the source standard; it is only 8579 in the binary standard. 8580 8581 __strtof_internal 8582 8583 Name 8584 8585 __strtof_internal -- underlying function for strtof 8586 8587 Synopsis 8588 8589 float __strtof_internal(const char * __nptr, char * * __endptr, 8590 int __group); 8591 8592 Description 8593 8594 __group shall be 0 or the behavior of __strtof_internal() is 8595 undefined. 8596 8597 __strtof_internal(__nptr, __endptr, 0)() has the same 8598 specification as strtof(__nptr, __endptr)(). 8599 8600 __strtof_internal() is not in the source standard; it is only 8601 in the binary standard. 8602 8603 __strtok_r 8604 8605 Name 8606 8607 __strtok_r -- alias for strtok_r 8608 8609 Synopsis 8610 8611 char * __strtok_r(char * restrict s, const char * restrict 8612 delim, char * * restrict save_ptr); 8613 8614 Description 8615 8616 __strtok_r() has the same specification as strtok_r(). 8617 8618 __strtok_r() is not in the source standard; it is only in the 8619 binary standard. 8620 8621 __strtol_internal 8622 8623 Name 8624 8625 __strtol_internal -- alias for strtol 8626 8627 Synopsis 8628 8629 long int __strtol_internal(const char * __nptr, char * * 8630 __endptr, int __base, int __group); 8631 8632 Description 8633 8634 __group shall be 0 or the behavior of __strtol_internal() is 8635 undefined. 8636 8637 __strtol_internal(__nptr, __endptr, __base, 0) has the same 8638 specification as strtol(__nptr, __endptr, __base). 8639 8640 __strtol_internal() is not in the source standard; it is only 8641 in the binary standard. 8642 8643 __strtold_internal 8644 8645 Name 8646 8647 __strtold_internal -- underlying function for strtold 8648 8649 Synopsis 8650 8651 long double __strtold_internal(const char * __nptr, char * * 8652 __endptr, int __group); 8653 8654 Description 8655 8656 __group shall be 0 or the behavior of __strtold_internal() is 8657 undefined. 8658 8659 __strtold_internal(__nptr, __endptr, 0) has the same 8660 specification as strtold(__nptr, __endptr). 8661 8662 __strtold_internal() is not in the source standard; it is only 8663 in the binary standard. 8664 8665 __strtoll_internal 8666 8667 Name 8668 8669 __strtoll_internal -- underlying function for strtoll 8670 8671 Synopsis 8672 8673 long long __strtoll_internal(const char * __nptr, char * * 8674 __endptr, int __base, int __group); 8675 8676 Description 8677 8678 __group shall be 0 or the behavior of __strtoll_internal() is 8679 undefined. 8680 8681 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 8682 specification as strtoll(__nptr, __endptr, __base). 8683 8684 __strtoll_internal() is not in the source standard; it is only 8685 in the binary standard. 8686 8687 __strtoul_internal 8688 8689 Name 8690 8691 __strtoul_internal -- underlying function for strtoul 8692 8693 Synopsis 8694 8695 unsigned long int __strtoul_internal(const char * __nptr, char 8696 * * __endptr, int __base, int __group); 8697 8698 Description 8699 8700 __group shall be 0 or the behavior of __strtoul_internal() is 8701 undefined. 8702 8703 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 8704 specification as strtoul(__nptr, __endptr, __base). 8705 8706 __strtoul_internal() is not in the source standard; it is only 8707 in the binary standard. 8708 8709 __strtoull_internal 8710 8711 Name 8712 8713 __strtoull_internal -- underlying function for strtoull 8714 8715 Synopsis 8716 8717 unsigned long long __strtoull_internal(const char * __nptr, 8718 char * * __endptr, int __base, int __group); 8719 8720 Description 8721 8722 __group shall be 0 or the behavior of __strtoull_internal() is 8723 undefined. 8724 8725 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 8726 specification as strtoull(__nptr, __endptr, __base). 8727 8728 __strtoull_internal() is not in the source standard; it is only 8729 in the binary standard. 8730 8731 __sysconf 8732 8733 Name 8734 8735 __sysconf -- get configuration information at runtime 8736 8737 Synopsis 8738 8739 #include 8740 8741 long __sysconf(int name); 8742 8743 Description 8744 8745 __sysconf() gets configuration information at runtime. 8746 8747 __sysconf() is weak alias to sysconf(). 8748 8749 __sysconf() has the same specification as sysconf(). 8750 8751 __sysconf() is not in the source standard; it is only in the 8752 binary standard. 8753 8754 __sysv_signal 8755 8756 Name 8757 8758 __sysv_signal -- signal handling 8759 8760 Synopsis 8761 8762 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 8763 8764 Description 8765 8766 __sysv_signal() has the same behavior as signal() as specified 8767 by ISO POSIX (2003). 8768 8769 __sysv_signal() is not in the source standard; it is only in 8770 the binary standard. 8771 8772 __timezone 8773 8774 Name 8775 8776 -- global variable containing timezone 8777 8778 Synopsis 8779 8780 long int __timezone; 8781 8782 Description 8783 8784 __timezone() has the same specification as timezone() in the 8785 ISO POSIX (2003) 8786 8787 __tzname 8788 8789 Name 8790 8791 -- global variable containing the timezone 8792 8793 Synopsis 8794 8795 char * __tzname[2]; 8796 8797 Description 8798 8799 __tzname has the same specification as tzname in the ISO POSIX 8800 (2003). 8801 8802 Note that the array size of 2 is explicit in the ISO POSIX 8803 (2003), but not in the SUSv2. 8804 8805 __wcstod_internal 8806 8807 Name 8808 8809 __wcstod_internal -- underlying function for wcstod 8810 8811 Synopsis 8812 8813 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 8814 endptr, int group); 8815 8816 Description 8817 8818 group shall be 0 or the behavior of __wcstod_internal() is 8819 undefined. 8820 8821 __wcstod_internal(nptr, endptr, 0) shall behave as wcstod(nptr, 8822 endptr) as specified by ISO POSIX (2003). 8823 8824 __wcstod_internal() is not in the source standard; it is only 8825 in the binary standard. 8826 8827 __wcstof_internal 8828 8829 Name 8830 8831 __wcstof_internal -- underlying function for wcstof 8832 8833 Synopsis 8834 8835 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 8836 endptr, int group); 8837 8838 Description 8839 8840 group shall be 0 or the behavior of __wcstof_internal() is 8841 undefined. 8842 8843 __wcstof_internal(nptr, endptr, 0) shall behave as wcstof(nptr, 8844 endptr) as specified in ISO POSIX (2003). 8845 8846 __wcstof_internal() is not in the source standard; it is only 8847 in the binary standard. 8848 8849 __wcstol_internal 8850 8851 Name 8852 8853 __wcstol_internal -- underlying function for wcstol 8854 8855 Synopsis 8856 8857 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 8858 endptr, int base, int group); 8859 8860 Description 8861 8862 group shall be 0 or the behavior of __wcstol_internal() is 8863 undefined. 8864 8865 __wcstol_internal(nptr, endptr, base, 0) shall behave as 8866 wcstol(nptr, endptr, base) as specified by ISO POSIX (2003). 8867 8868 __wcstol_internal() is not in the source standard; it is only 8869 in the binary standard. 8870 8871 __wcstold_internal 8872 8873 Name 8874 8875 __wcstold_internal -- underlying function for wcstold 8876 8877 Synopsis 8878 8879 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 8880 * endptr, int group); 8881 8882 Description 8883 8884 group shall be 0 or the behavior of __wcstold_internal() is 8885 undefined. 8886 8887 __wcstold_internal(nptr, endptr, 0) shall behave as 8888 wcstold(nptr, endptr) as specified by ISO POSIX (2003). 8889 8890 __wcstold_internal() is not in the source standard; it is only 8891 in the binary standard. 8892 8893 __wcstoul_internal 8894 8895 Name 8896 8897 __wcstoul_internal -- underlying function for wcstoul 8898 8899 Synopsis 8900 8901 unsigned long __wcstoul_internal(const wchar_t * restrict nptr, 8902 wchar_t * * restrict endptr, int base, int group); 8903 8904 Description 8905 8906 group shall be 0 or the behavior of __wcstoul_internal() is 8907 undefined. 8908 8909 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 8910 wcstoul(nptr, endptr, base)() as specified by ISO POSIX (2003). 8911 8912 __wcstoul_internal() is not in the source standard; it is only 8913 in the binary standard. 8914 8915 __xmknod 8916 8917 Name 8918 8919 __xmknod -- make block or character special file 8920 8921 Synopsis 8922 8923 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 8924 dev); 8925 8926 Description 8927 8928 The __xmknod() function shall implement the mknod() interface 8929 from ISO POSIX (2003). 8930 8931 The value of ver shall be 1 or the behavior of __xmknod() is 8932 undefined. 8933 8934 __xmknod(1, path, mode, dev) shall behave as mknod(path, mode, 8935 dev) as specified by ISO POSIX (2003). 8936 8937 The __xmknod() function is not in the source standard; it is 8938 only in the binary standard. 8939 8940 Note: The mknod() function is not in the binary standard; it 8941 is only in the source standard. 8942 8943 __xpg_basename 8944 8945 Name 8946 8947 __xpg_basename -- return the last component of a file name 8948 8949 Synopsis 8950 8951 #include 8952 8953 char * __xpg_basename(const char * path); 8954 8955 Description 8956 8957 The __xpg_basename() function shall return a pointer to the 8958 final component of the pathname named by path, as described in 8959 ISO POSIX (2003) basename(). 8960 8961 This function is not in the source standard, it is only in the 8962 binary standard. 8963 8964 Return Value 8965 8966 See ISO POSIX (2003). 8967 8968 __xpg_sigpause 8969 8970 Name 8971 8972 __xpg_sigpause -- remove a signal from the signal mask and 8973 suspend the thread 8974 8975 Synopsis 8976 8977 #include 8978 8979 int __xpg_sigpause(int sig); 8980 8981 Description 8982 8983 The __xpg_sigpause() function shall implement the sigpause() 8984 described in ISO POSIX (2003). 8985 8986 This function is not in the source standard, it is only in the 8987 binary standard. 8988 8989 Return Value 8990 8991 See ISO POSIX (2003). 8992 8993 __xpg_strerror_r 8994 8995 Name 8996 8997 __xpg_strerror_r -- return string describing error number 8998 8999 Synopsis 9000 9001 #include 9002 9003 char * __xpg_strerror_r(int errnum, char * buf, size_t buflen); 9004 9005 Description 9006 9007 The __xpg_strerror_r() function shall map the error number in 9008 errnum to a locale-dependent error message string and shall 9009 return the string in the buffer pointed to by strerrbuf, with 9010 length buflen, as described in ISO POSIX (2003) strerror_r(). 9011 9012 This function is not in the source standard, it is only in the 9013 binary standard. 9014 9015 Return Value 9016 9017 See ISO POSIX (2003). 9018 9019 __xstat 9020 9021 Name 9022 9023 __xstat -- get File Status 9024 9025 Synopsis 9026 9027 #include 9028 #include 9029 9030 int __xstat(int ver, const char * path, struct stat * 9031 stat_buf); 9032 9033 int __lxstat(int ver, const char * path, struct stat * 9034 stat_buf); 9035 9036 int __fxstat(int ver, int fildes, struct stat * stat_buf); 9037 9038 Description 9039 9040 The functions __xstat(), __lxstat(), and __fxstat() shall 9041 implement the ISO POSIX (2003) functions stat(), lstat(), and 9042 fstat() respectively. 9043 9044 ver shall be 3 or the behavior of these functions is undefined. 9045 9046 __xstat(3, path, stat_buf) shall implement stat(path, stat_buf) 9047 as specified by ISO POSIX (2003). 9048 9049 __lxstat(3, path, stat_buf) shall implement lstat(path, 9050 stat_buf) as specified by ISO POSIX (2003). 9051 9052 __fxstat(3, fildes, stat_buf) shall implement fstat(fildes, 9053 stat_buf) as specified by ISO POSIX (2003). 9054 9055 __xstat(), __lxstat(), and __fxstat() are not in the source 9056 standard; they are only in the binary standard. 9057 9058 stat(), lstat(), and fstat() are not in the binary standard; 9059 they are only in the source standard. 9060 9061 __xstat64 9062 9063 Name 9064 9065 __xstat64 -- get File Status 9066 9067 Synopsis 9068 9069 #define _LARGEFILE_SOURCE 1 9070 #include 9071 #include 9072 9073 int __xstat64(int ver, const char * path, struct stat64 * 9074 stat_buf); 9075 9076 int __lxstat64(int ver, const char * path, struct stat64 * 9077 stat_buf); 9078 9079 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 9080 9081 Description 9082 9083 The functions __xstat64(), __lxstat64(), and __fxstat64() shall 9084 implement the Large File Support functions stat64(), lstat64(), 9085 and fstat64() respectively. 9086 9087 ver shall be 3 or the behavior of these functions is undefined. 9088 9089 __xstat64(3, path, stat_buf) shall behave as stat(path, 9090 stat_buf) as specified by Large File Support. 9091 9092 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 9093 stat_buf) as specified by Large File Support. 9094 9095 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 9096 stat_buf) as specified by Large File Support. 9097 9098 __xstat64(), __lxstat64(), and __fxstat64() are not in the 9099 source standard; they are only in the binary standard. 9100 9101 stat64(), lstat64(), and fstat64() are not in the binary 9102 standard; they are only in the source standard. 9103 9104 _environ 9105 9106 Name 9107 9108 _environ -- alias for environ - user environment 9109 9110 Synopsis 9111 9112 extern char * *_environ; 9113 9114 Description 9115 9116 _environ is an alias for environ - user environment. 9117 9118 _nl_msg_cat_cntr 9119 9120 Name 9121 9122 _nl_msg_cat_cntr -- new catalog load counter 9123 9124 Synopsis 9125 9126 #include 9127 9128 extern int _nl_msg_cat_cntr; 9129 9130 Description 9131 9132 The global variable _nl_msg_cat_cntr is incremented each time a 9133 new catalog is loaded. This variable is only in the binary 9134 standard; it is not in the source standard. 9135 9136 _sys_errlist 9137 9138 Name 9139 9140 _sys_errlist -- array containing the "C" locale strings used by 9141 strerror() 9142 9143 Synopsis 9144 9145 #include 9146 9147 extern const char *const _sys_errlist[]; 9148 9149 Description 9150 9151 _sys_errlist is an array containing the "C" locale strings used 9152 by strerror(). This normally should not be used directly. 9153 strerror() provides all of the needed functionality. 9154 9155 _sys_siglist 9156 9157 Name 9158 9159 _sys_siglist -- array containing the names of the signal names 9160 9161 Synopsis 9162 9163 #include 9164 9165 extern const char *const _sys_siglist[NSIG]; 9166 9167 Description 9168 9169 _sys_siglist is an array containing the names of the signal 9170 names. 9171 9172 The _sys_siglist array is only in the binary standard; it is 9173 not in the source standard. Applications wishing to access the 9174 names of signals should use the strsignal() function. 9175 9176 acct 9177 9178 Name 9179 9180 acct -- switch process accounting on or off 9181 9182 Synopsis 9183 9184 #include 9185 9186 int acct(const char * filename); 9187 9188 Description 9189 9190 When filename is the name of an existing file, acct() turns 9191 accounting on and appends a record to filename for each 9192 terminating process. When filename is NULL, acct() turns 9193 accounting off. 9194 9195 Return Value 9196 9197 On success, 0 is returned. On error, -1 is returned and the 9198 global variable errno is set appropriately. 9199 9200 Errors 9201 9202 ENOSYS 9203 9204 BSD process accounting has not been enabled when the operating 9205 system kernel was compiled. The kernel configuration parameter 9206 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 9207 ENOMEM 9208 9209 Out of memory. 9210 EPERM 9211 9212 The calling process has no permission to enable process 9213 accounting. 9214 EACCES 9215 9216 filename is not a regular file. 9217 EIO 9218 9219 Error writing to the filename. 9220 EUSERS 9221 9222 There are no more free file structures or we run out of memory. 9223 9224 adjtime 9225 9226 Name 9227 9228 adjtime -- correct the time to allow synchronization of the 9229 system clock 9230 9231 Synopsis 9232 9233 #include 9234 9235 int adjtime(const struct timeval * delta, struct timeval * 9236 olddelta); 9237 9238 Description 9239 9240 adjtime() makes small adjustments to the system time as 9241 returned by gettimeofday()(2), advancing or retarding it by the 9242 time specified by the timeval delta. If delta is negative, the 9243 clock is slowed down by incrementing it more slowly than normal 9244 until the correction is complete. If delta is positive, a 9245 larger increment than normal is used. The skew used to perform 9246 the correction is generally a fraction of one percent. Thus, 9247 the time is always a monotonically increasing function. A time 9248 correction from an earlier call to adjtime() may not be 9249 finished when adjtime() is called again. If olddelta is 9250 non-NULL, the structure pointed to will contain, upon return, 9251 the number of microseconds still to be corrected from the 9252 earlier call. 9253 9254 adjtime() may be used by time servers that synchronize the 9255 clocks of computers in a local area network. Such time servers 9256 would slow down the clocks of some machines and speed up the 9257 clocks of others to bring them to the average network time. 9258 9259 Appropriate privilege is required to adjust the system time. 9260 9261 Return Value 9262 9263 On success, 0 is returned. On error, -1 is returned and the 9264 global variable errno is set appropriately. 9265 9266 Errors 9267 9268 EFAULT 9269 9270 An argument points outside the process's allocated address 9271 space. 9272 EPERM 9273 9274 The process does not have appropriate privilege. 9275 9276 asprintf 9277 9278 Name 9279 9280 asprintf -- write formatted output to a dynamically allocated 9281 string 9282 9283 Synopsis 9284 9285 #include 9286 9287 int asprintf(char ** restrict ptr, const char * restrict 9288 format, ...); 9289 9290 Description 9291 9292 The asprintf() function shall behave as sprintf(), except that 9293 the output string shall be dynamically allocated space of 9294 sufficient length to hold the resulting string. The address of 9295 this dynamically allocated string shall be stored in the 9296 location referenced by ptr. 9297 9298 Return Value 9299 9300 Refer to fprintf(). 9301 9302 Errors 9303 9304 Refer to fprintf(). 9305 9306 basename 9307 9308 Name 9309 9310 basename -- return the last component of a file name 9311 9312 Synopsis 9313 9314 #include 9315 9316 char * basename(const char * path); 9317 9318 Description 9319 9320 In the source standard, basename() is implemented as a macro 9321 causing it to behave as described in ISO POSIX (2003), and is 9322 equivalent to the function __xpg_basename(). If the macro is 9323 undefined, basename() from the binary standard is used, with 9324 differences as described here: 9325 9326 The string identified by path shall not be modified. 9327 9328 If path is "/", or ends with a trailing '/' character, the 9329 basename() function shall return a pointer to an empty string. 9330 9331 Return Value 9332 9333 On success, the basename() function shall return a pointer to 9334 the final component of path. Otherwise, it shall return a null 9335 pointer. 9336 9337 See Also 9338 9339 __xpg_basename() 9340 9341 bind_textdomain_codeset 9342 9343 Name 9344 9345 bind_textdomain_codeset -- specify encoding for message 9346 retrieval 9347 9348 Synopsis 9349 9350 #include 9351 9352 char * bind_textdomain_codeset (const char * domainname , const 9353 char * codeset ); 9354 9355 Description 9356 9357 The bind_textdomain_codeset() function can be used to specify 9358 the output codeset for message catalogs for domain domainname. 9359 The codeset argument shall be a valid codeset name which can be 9360 used tor the iconv_open function, or a null pointer. If the 9361 codeset argument is the null pointer, then function returns the 9362 currently selected codeset for the domain with the name 9363 domainname. It shall return a null pointer if no codeset has 9364 yet been selected. 9365 9366 Each successive call to bind_textdomain_codeset() function 9367 overrrides the settings made by the preceding call with the 9368 same domainname. 9369 9370 The bind_textdomain_codeset() function shall return a pointer 9371 to a string containing the name of the selected codeset. The 9372 string shall be allocated internally in the function and shall 9373 not be changed or freed by the user. 9374 9375 Parameters 9376 9377 domainname 9378 9379 The domainname argument is applied to the currently active 9380 LC_MESSAGE locale. It is equivalent in syntax and meaning to 9381 the domainname argument to textdomain, except that the 9382 selection of the domain is valid only for the duration of the 9383 call. 9384 codeset 9385 9386 The name of the output codeset for the selected domain, or NULL 9387 to select the current codeset. 9388 9389 If domainname is the null pointer, or is an empty string, 9390 bind_textdomain_codeset() shall fail, but need not set errno. 9391 9392 Return Value 9393 9394 Returns the currently selected codeset name. It returns a null 9395 pointer if no codeset has yet been selected. 9396 9397 Errors 9398 9399 ENOMEM 9400 9401 Insufficient memory available to allocate return value. 9402 9403 See Also 9404 9405 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 9406 textdomain, bindtextdomain 9407 9408 bindresvport 9409 9410 Name 9411 9412 bindresvport -- bind socket to privileged IP port 9413 9414 Synopsis 9415 9416 #include 9417 #include 9418 9419 int bindresvport(int sd, struct sockaddr_in * sin); 9420 9421 Description 9422 9423 If the process has appropriate privilege, the bindresvport() 9424 function shall bind a socket to a privileged IP port. 9425 9426 Return Value 9427 9428 On success, 0 is returned. On error, -1 is returned and the 9429 global variable errno is set appropriately. 9430 9431 Errors 9432 9433 EPERM 9434 9435 The process did not have appropriate privilege. 9436 EPFNOSUPPORT 9437 9438 Address of sin did not match address family of sd. 9439 9440 bindtextdomain 9441 9442 Name 9443 9444 bindtextdomain -- specify the location of a message catalog 9445 9446 Synopsis 9447 9448 #include 9449 9450 char * bindtextdomain(const char * domainname, const char * 9451 dirname); 9452 9453 Description 9454 9455 The bindtextdomain() shall set the the base directory of the 9456 hierarchy containing message catalogs for a given message 9457 domain. 9458 9459 The bindtextdomain() function specifies that the domainname 9460 message catalog can be found in the dirname directory 9461 hierarchy, rather than in the system default locale data base. 9462 9463 If dirname is not NULL, the base directory for message catalogs 9464 belonging to domain domainname shall be set to dirname. If 9465 dirname is NULL, the base directory for message catalogs shall 9466 not be altered. 9467 9468 The function shall make copies of the argument strings as 9469 needed. 9470 9471 dirname can be an absolute or relative pathname. 9472 9473 Note: Applications that wish to use chdir() should always 9474 use absolute pathnames to avoid misadvertently selecting the 9475 wrong or non-existant directory. 9476 9477 If domainname is the null pointer, or is an empty string, 9478 bindtextdomain() shall fail, but need not set errno. 9479 9480 The bindtextdomain() function shall return a pointer to a 9481 string containing the name of the selected directory. The 9482 string shall be allocated internally in the function and shall 9483 not be changed or freed by the user. 9484 9485 Return Value 9486 9487 On success, bindtextdomain() shall return a pointer to a string 9488 containing the directory pathname currently bound to the 9489 domain. On failure, a NULL pointer is returned, and the global 9490 variable errno may be set to indicate the error. 9491 9492 Errors 9493 9494 ENOMEM 9495 9496 Insufficient memory was available. 9497 9498 See Also 9499 9500 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 9501 textdomain, bind_textdomain_codeset 9502 9503 cfmakeraw 9504 9505 Name 9506 9507 cfmakeraw -- get and set terminal attributes 9508 9509 Synopsis 9510 9511 #include 9512 9513 void cfmakeraw(struct termios * termios_p); 9514 9515 Description 9516 9517 The cfmakeraw() function shall set the attributes of the 9518 termios structure referenced by termios_p as follows: 9519 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 9520 |INLCR|IGNCR|ICRNL|IXON); 9521 9522 termios_p->c_oflag &= ~OPOST; 9523 9524 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 9525 9526 termios_p->c_cflag &= ~(CSIZE|PARENB); 9527 9528 termios_p->c_cflag |= CS8; 9529 9530 termios_p shall point to a termios structure that contains the 9531 following members: 9532 tcflag_t c_iflag; /* input modes */ 9533 tcflag_t c_oflag; /* output modes */ 9534 tcflag_t c_cflag; /* control modes */ 9535 tcflag_t c_lflag; /* local modes */ 9536 cc_t c_cc[NCCS]; /* control chars */ 9537 9538 cfsetspeed 9539 9540 Name 9541 9542 cfsetspeed -- set terminal input and output data rate 9543 9544 Synopsis 9545 9546 #include 9547 9548 int cfsetspeed(struct termios *t, speed_t speed); 9549 9550 Description 9551 9552 The cfsetspeed() function shall set the input and output speeds 9553 in t to the value specified by speed. The effects of the 9554 function on the terminal as described below do not become 9555 effective, nor are all errors detected, until the tcsetattr() 9556 function is called. Certain values for baud rates set in 9557 termios and passed to tcsetattr() have special meanings. 9558 9559 Return Value 9560 9561 On success, 0 is returned. On error, -1 is returned and the 9562 global variable errno is set appropriately. 9563 9564 Errors 9565 9566 EINVAL 9567 9568 Invalid speed argument 9569 9570 daemon 9571 9572 Name 9573 9574 daemon -- run in the background 9575 9576 Synopsis 9577 9578 #include 9579 9580 int daemon(int nochdir, int noclose); 9581 9582 Description 9583 9584 The daemon() function shall create a new process, detached from 9585 the controlling terminal. If successful, the calling process 9586 shall exit and the new process shall continue to execute the 9587 application in the background. If nochdir evaluates to true, 9588 the current directory shall not be changed. Otherwise, daemon() 9589 shall change the current working directory to the root (`/'). 9590 If noclose evaluates to true the standard input, standard 9591 output, and standard error file descriptors shall not be 9592 altered. Otherwise, daemon() shall close the standard input, 9593 standard output and standard error file descriptors and reopen 9594 them attached to /dev/null. 9595 9596 Return Value 9597 9598 On error, -1 is returned, and the global variable errno is set 9599 to any of the errors specified for the library functions fork() 9600 and setsid(). 9601 9602 dcgettext 9603 9604 Name 9605 9606 dcgettext -- perform domain and category specific lookup in 9607 message catalog 9608 9609 Synopsis 9610 9611 #include 9612 #include 9613 9614 char * dcgettext(const char * domainname, const char * msgid, 9615 int category); 9616 9617 Description 9618 9619 The dcgettext() function is a domain specified version of 9620 gettext(). 9621 9622 The dcgettext() function shall lookup the translation in the 9623 current locale of the message identified by msgid in the domain 9624 specified by domainname and in the locale category specified by 9625 category. If domainname is NULL, the current default domain 9626 shall be used. The msgid argument shall be a NULL-terminated 9627 string to be matched in the catalogue. category shall specify 9628 the locale category to be used for retrieving message strings. 9629 The category parameter shall be one of LC_CTYPE, LC_COLLATE, 9630 LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The default 9631 domain shall not be changed by a call to dcgettext(). 9632 9633 Return Value 9634 9635 If a translation was found in one of the specified catalogs, it 9636 shall be converted to the current locale's codeset and 9637 returned. The resulting NULL-terminated string shall be 9638 allocated by the dcgettext function, and must not be modified 9639 or freed. If no translation was found, or category was invalid, 9640 msgid shall be returned. 9641 9642 Errors 9643 9644 dcgettext() shall not modify the errno global variable. 9645 9646 See Also 9647 9648 gettext, dgettext, ngettext, dngettext, dcngettext, textdomain, 9649 bindtextdomain, bind_textdomain_codeset 9650 9651 dcngettext 9652 9653 Name 9654 9655 dcngettext -- perform domain and category specific lookup in 9656 message catalog with plural 9657 9658 Synopsis 9659 9660 #include 9661 #include 9662 9663 char * dcngettext(const char * domainname, const char * msgid1, 9664 const char * msgid2, unsigned long int n, int category); 9665 9666 Description 9667 9668 The dcngettext() function is a domain specific version of 9669 gettext, capable of returning either a singular or plural form 9670 of the message. The dcngettext() function shall lookup the 9671 translation in the current locale of the message identified by 9672 msgid1 in the domain specified by domainname and in the locale 9673 category specified by category. If domainname is NULL, the 9674 current default domain shall be used. The msgid1 argument shall 9675 be a NULL-terminated string to be matched in the catalogue. 9676 category shall specify the locale category to be used for 9677 retrieving message strings. The category parameter shall be one 9678 of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, 9679 or LC_TIME. The default domain shall not be changed by a call 9680 to dcngettext(). If n is 1 then the singular version of the 9681 message is returned, otherwise one of the plural forms is 9682 returned, depending on the value of n and the current locale 9683 settings. 9684 9685 Return Value 9686 9687 If a translation corresponding to the value of n was found in 9688 one of the specified catalogs for msgid1, it shall be converted 9689 to the current locale's codeset and returned. The resulting 9690 NULL-terminated string shall be allocated by the dcngettext() 9691 function, and must not be modified or freed. If no translation 9692 was found, or category was invalid, msgid1 shall be returned if 9693 n has the value 1, otherwise msgid2 shall be returned. 9694 9695 Errors 9696 9697 dcngettext() shall not modify the errno global variable. 9698 9699 See Also 9700 9701 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 9702 bindtextdomain, bind_textdomain_codeset 9703 9704 dgettext 9705 9706 Name 9707 9708 dgettext -- perform lookup in message catalog for the current 9709 LC_MESSAGES locale 9710 9711 Synopsis 9712 9713 #include 9714 9715 char * dgettext(const char * domainname, const char * msgid); 9716 9717 Description 9718 9719 dgettext() is a domain specified version of gettext(). 9720 9721 The dgettext() function shall search the currently selected 9722 message catalogs in the domain domainname for a string 9723 identified by the string msgid. If a string is located, that 9724 string shall be returned. The domain specified by domainname 9725 applies to the currently active LC_MESSAGE locale. The default 9726 domain shall not be changed by a call to dgettext(). 9727 9728 Note: The usage of domainanme is equivalent in syntax and 9729 meaning to the textdomain() function's application of 9730 domainname, except that the selection of the domain in 9731 dgettext() is valid only for the duration of the call. 9732 9733 The dgettext() function is equivalent to dcgettext(domainname, 9734 msgid, LC_MESSAGES). 9735 9736 Return Value 9737 9738 On success of a msgid query, the translated NULL-terminated 9739 string is returned. On error, the original msgid is returned. 9740 The length of the string returned is undetermined until 9741 dgettext() is called. 9742 9743 Errors 9744 9745 dgettext() shall not modify the errno global variable. 9746 9747 See Also 9748 9749 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 9750 textdomain, bindtextdomain, bind_textdomain_codeset 9751 9752 dngettext 9753 9754 Name 9755 9756 dngettext -- perform lookup in message catalog for the current 9757 locale 9758 9759 Synopsis 9760 9761 #include 9762 9763 char * dngettext(const char * domainname, const char * msgid1, 9764 const char * msgid2, unsigned long int n); 9765 9766 Description 9767 9768 dngettext() shall be equivalent to a call to 9769 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 9770 9771 See dcngettext() for more information. 9772 9773 See Also 9774 9775 gettext, dgettext, ngettext, dcgettext, dcngettext, textdomain, 9776 bindtextdomain, bind_textdomain_codeset 9777 9778 duplocale 9779 9780 Name 9781 9782 duplocale -- provide new handle for selection of locale 9783 9784 Synopsis 9785 9786 #include 9787 9788 locale_t duplocale(locale_t locale); 9789 9790 Description 9791 9792 The duplocale() function shall provide a new locale object 9793 based on the locale object provided in locale, suitable for use 9794 in the newlocale() or uselocale() functions. The new object may 9795 be released by calling freelocale(). 9796 9797 Return Value 9798 9799 On success, the duplocale() function shall return a locale 9800 object. Otherwise, it shall return NULL, and set errno to 9801 indicate the error. 9802 9803 Errors 9804 9805 The duplocale() function shall fail if: 9806 9807 ENOMEM 9808 9809 Insufficient memory. 9810 9811 See Also 9812 9813 setlocale(), freelocale(), newlocale(), uselocale() 9814 9815 endutent 9816 9817 Name 9818 9819 endutent -- access utmp file entries 9820 9821 Synopsis 9822 9823 #include 9824 9825 void endutent(void); 9826 9827 Description 9828 9829 endutent() closes the utmp file. It should be called when the 9830 user code is done accessing the file with the other functions. 9831 9832 err 9833 9834 Name 9835 9836 err -- display formatted error messages 9837 9838 Synopsis 9839 9840 #include 9841 9842 void err(int eval, const char * fmt, ...); 9843 9844 Description 9845 9846 The err() function shall display a formatted error message on 9847 the standard error stream. First, err() shall write the last 9848 component of the program name, a colon character, and a space 9849 character. If fmt is non-NULL, it shall be used as a format 9850 string for the printf() family of functions, and err() shall 9851 write the formatted message, a colon character, and a space. 9852 Finally, the error message string affiliated with the current 9853 value of the global variable errno shall be written, followed 9854 by a newline character. 9855 9856 The err() function shall not return, the program shall 9857 terminate with the exit value of eval. 9858 9859 See Also 9860 9861 error(), errx() 9862 9863 Return Value 9864 9865 None. 9866 9867 Errors 9868 9869 None. 9870 9871 error 9872 9873 Name 9874 9875 error -- print error message 9876 9877 Synopsis 9878 9879 #include 9880 9881 void error(int exitstatus, int errnum, const char * format, 9882 ...); 9883 9884 Description 9885 9886 error() shall print a message to standard error. 9887 9888 error() shall build the message from the following elements in 9889 their specified order: 9890 9891 1. the program name. If the application has provided a 9892 function named error_print_progname(), error() shall call 9893 this to supply the program name; otherwise, error() uses 9894 the content of the global variable program_name. 9895 2. the colon and space characters, then the result of using 9896 the printf-style format and the optional arguments. 9897 3. if errnum is nonzero, error() shall add the colon and space 9898 characters, then the result of strerror(errnum). 9899 4. a newline. 9900 9901 If exitstatus is nonzero, error() shall call exit(exitstatus). 9902 9903 See Also 9904 9905 err(), errx() 9906 9907 errx 9908 9909 Name 9910 9911 errx -- display formatted error message and exit 9912 9913 Synopsis 9914 9915 #include 9916 9917 void errx(int eval, const char * fmt, ...); 9918 9919 Description 9920 9921 The errx() function shall display a formatted error message on 9922 the standard error stream. The last component of the program 9923 name, a colon character, and a space shall be output. If fmt is 9924 non-NULL, it shall be used as the format string for the 9925 printf() family of functions, and the formatted error message, 9926 a colon character, and a space shall be output. The output 9927 shall be followed by a newline character. 9928 9929 errx() does not return, but shall exit with the value of eval. 9930 9931 Return Value 9932 9933 None. 9934 9935 Errors 9936 9937 None. 9938 9939 See Also 9940 9941 error(), err() 9942 9943 fcntl 9944 9945 Name 9946 9947 fcntl -- file control 9948 9949 Description 9950 9951 fcntl() is as specified in ISO POSIX (2003), but with 9952 differences as listed below. 9953 9954 Implementation may set O_LARGEFILE 9955 9956 According to ISO POSIX (2003), only an application sets fcntl() 9957 flags, for example O_LARGEFILE. However, this specification 9958 also allows an implementation to set the O_LARGEFILE flag in 9959 the case where the programming environment is one of 9960 _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 9961 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX (2003) 9962 for a description of these environments. Thus, calling fcntl() 9963 with the F_GETFL command may return O_LARGEFILE as well as 9964 flags explicitly set by the application in the case that both 9965 the implementation and the application support an off_t of at 9966 least 64 bits. 9967 9968 fflush_unlocked 9969 9970 Name 9971 9972 fflush_unlocked -- non thread safe fflush 9973 9974 Description 9975 9976 fflush_unlocked() is the same as fflush() except that it need 9977 not be thread safe. That is, it may only be invoked in the ways 9978 which are legal for getc_unlocked(). 9979 9980 fgetwc_unlocked 9981 9982 Name 9983 9984 fgetwc_unlocked -- non thread safe fgetwc 9985 9986 Description 9987 9988 fgetwc_unlocked() is the same as fgetwc() except that it need 9989 not be thread safe. That is, it may only be invoked in the ways 9990 which are legal for getc_unlocked(). 9991 9992 flock 9993 9994 Name 9995 9996 flock -- apply or remove an advisory lock on an open file 9997 9998 Synopsis 9999 10000 int flock(int fd, int operation); 10001 10002 Description 10003 10004 flock() applies or removes an advisory lock on the open file 10005 fd. Valid operation types are: 10006 10007 LOCK_SH 10008 10009 Shared lock. More than one process may hold a shared lock for a 10010 given file at a given time. 10011 LOCK_EX 10012 10013 Exclusive lock. Only one process may hold an exclusive lock for 10014 a given file at a given time. 10015 LOCK_UN 10016 10017 Unlock. 10018 LOCK_NB 10019 10020 Don't block when locking. May be specified (by oring) along 10021 with one of the other operations. 10022 10023 A single file may not simultaneously have both shared and 10024 exclusive locks. 10025 10026 Return Value 10027 10028 On success, 0 is returned. On error, -1 is returned and the 10029 global variable errno is set appropriately. 10030 10031 Errors 10032 10033 EWOULDBLOCK 10034 10035 The file is locked and the LOCK_NB flag was selected. 10036 EBADF 10037 10038 fd is not a not an open file descriptor. 10039 EINTR 10040 10041 While waiting to acquire a lock, the call was interrupted by 10042 delivery of a signal caught by a handler. 10043 EINVAL 10044 10045 The operation is invalid. 10046 EWOULDBLOCK 10047 10048 The implementation ran out of memory for allocating lock 10049 records. 10050 10051 freelocale 10052 10053 Name 10054 10055 freelocale -- free a locale object 10056 10057 Synopsis 10058 10059 #include 10060 10061 void freelocale(locale_t locale); 10062 10063 Description 10064 10065 The freelocale() function shall free the locale object locale, 10066 and release any resources associated with it. 10067 10068 Return Value 10069 10070 None. 10071 10072 Errors 10073 10074 None defined. 10075 10076 See Also 10077 10078 setlocale(), newlocale(), duplocale(), uselocale() 10079 10080 fscanf 10081 10082 Name 10083 10084 fscanf -- convert formatted input 10085 10086 Description 10087 10088 The scanf() family of functions shall behave as described in 10089 ISO POSIX (2003), except as noted below. 10090 10091 Differences 10092 10093 The %s, %S and %[ conversion specifiers shall accept an option 10094 length modifier a, which shall cause a memory buffer to be 10095 allocated to hold the string converted. In such a case, the 10096 argument corresponding to the conversion specifier should be a 10097 reference to a pointer value that will receive a pointer to the 10098 allocated buffer. If there is insufficient memory to allocate a 10099 buffer, the function may set errno to ENOMEM and a conversion 10100 error results. 10101 10102 Note: This directly conflicts with the ISO C (1999) usage of 10103 %a as a conversion specifier for hexadecimal float values. 10104 While this conversion specifier should be supported, a 10105 format specifier such as "%aseconds" will have a different 10106 meaning on an LSB conforming system. 10107 10108 fstatfs 10109 10110 Name 10111 10112 fstatfs -- (deprecated) 10113 10114 Synopsis 10115 10116 #include 10117 10118 int fstatfs(int fd, struct statfs * buf); 10119 10120 Description 10121 10122 The fstatfs() function returns information about a mounted file 10123 system. The file system is identified by fd, a file descriptor 10124 of an open file within the mounted filesystem. The results are 10125 placed in the structure pointed to by buf. 10126 10127 Fields that are undefined for a particular file system shall be 10128 set to 0. 10129 10130 Note: Application developers should use the fstatvfs() 10131 function to obtain general file system information. 10132 Applications should only use the fstatfs() function if they 10133 must determine the file system type, which need not be 10134 provided by fstatvfs(). 10135 10136 Return Value 10137 10138 On success, the fstatfs() function shall return 0 and set the 10139 fields of the structure idenfitied by buf accordingly. On 10140 error, the fstatfs() function shall return -1 and set errno 10141 accordingly. 10142 10143 Errors 10144 10145 EBADF 10146 10147 fd is not a valid open file descriptor. 10148 EFAULT 10149 10150 buf points to an invalid address. 10151 EIO 10152 10153 An I/O error occurred while reading from or writing to the file 10154 system. 10155 ENOSYS 10156 10157 The filesystem fd is open on does not support statfs(). 10158 10159 fstatfs64 10160 10161 Name 10162 10163 fstatfs64 -- (deprecated) 10164 10165 Synopsis 10166 10167 #include 10168 10169 int fstatfs64(int fd, struct statfs64 * buf); 10170 10171 Description 10172 10173 The fstatfs64() function returns information about a mounted 10174 file system. The file system is identified by fd, a file 10175 descriptor of an open file within the mounted filesystem. The 10176 results are placed in the structure pointed to by buf. 10177 10178 Fields that are undefined for a particular file system shall be 10179 set to 0. 10180 10181 fstatfs64() is the 64-bit version of fstatfs(). 10182 10183 Note: Application developers should use the fstatvfs64() 10184 function to obtain general file system information. 10185 Applications should only use the fstatfs64() function if 10186 they must determine the file system type, which need not be 10187 provided by fstatvfs64(). 10188 10189 Return Value 10190 10191 On success, the fstatfs64() function shall return 0 and set the 10192 fields of the structure idenfitied by buf accordingly. On 10193 error, the fstatfs64() function shall return -1 and set errno 10194 accordingly. 10195 10196 Errors 10197 10198 See fstatfs(). 10199 10200 fwscanf 10201 10202 Name 10203 10204 fwscanf -- convert formatted input 10205 10206 Description 10207 10208 The scanf() family of functions shall behave as described in 10209 ISO POSIX (2003), except as noted below. 10210 10211 Differences 10212 10213 The %s, %S and %[ conversion specifiers shall accept an option 10214 length modifier a, which shall cause a memory buffer to be 10215 allocated to hold the string converted. In such a case, the 10216 argument corresponding to the conversion specifier should be a 10217 reference to a pointer value that will receive a pointer to the 10218 allocated buffer. If there is insufficient memory to allocate a 10219 buffer, the function may set errno to ENOMEM and a conversion 10220 error results. 10221 10222 Note: This directly conflicts with the ISO C (1999) usage of 10223 %a as a conversion specifier for hexadecimal float values. 10224 While this conversion specifier should be supported, a 10225 format specifier such as "%aseconds" will have a different 10226 meaning on an LSB conforming system. 10227 10228 getdomainname 10229 10230 Name 10231 10232 getdomainname -- get NIS domain name (DEPRECATED). 10233 10234 Synopsis 10235 10236 #include 10237 10238 int getdomainname (char * name , size_t namelen ); 10239 10240 Description 10241 10242 If the Network Information System (NIS) is in use, 10243 getdomainname() shall copy the NIS domain name to the supplied 10244 buffer identified by name, with maximum length namelen. If the 10245 NIS domain name is not currently set, getdomainname() shall 10246 copy the string "(none)" to the name. If namelen is less than 10247 the length of the string to be copied, getdomainname() shall 10248 either truncate the string to namelen characters and place it 10249 in name (without a terminating null character), or shall fail 10250 with EINVAL. 10251 10252 Note: The NIS domain name is not the same as the domain 10253 portion of a fully qualified domain name (for example, in 10254 DNS). 10255 10256 The LSB does not include other NIS functions, nor does it 10257 specify how NIS may affect other database functions. No 10258 conforming application can make use of this information 10259 beyond noting whether or not the domain name has been set. 10260 If the name is set to a value other than the string 10261 "(none)", the application should not imply that NIS is in 10262 use. Similarly, if it is set to "(none)", the application 10263 should not assume that NIS is not in use, although NIS 10264 functionality may be restricted in this case. 10265 10266 Return Value 10267 10268 On success, getdomainname() shall return 0. Otherwise, it shall 10269 return -1 and set errno to indicate the error. 10270 10271 Errors 10272 10273 EINVAL 10274 10275 name is a null pointer. 10276 EINVAL 10277 10278 The buffer identified by name and namelen is of insufficient 10279 size to store the NIS domain name string, and the 10280 implementation considers this an error. 10281 10282 Future Directions 10283 10284 The LSB does not include other NIS interfaces, and a future 10285 version of this specification may remove this interface. 10286 Application developers should avoid using this interface where 10287 possible. 10288 10289 getdtablesize 10290 10291 Name 10292 10293 getdtablesize -- get file descriptor table size (DEPRECATED) 10294 10295 Synopsis 10296 10297 #include 10298 10299 int getdtablesize (void ); 10300 10301 Description 10302 10303 The function getdtablesize() returns the number of files a 10304 process can have open. 10305 10306 Note: The getdtablesize() function is deprecated. Portable 10307 applications should call getrlimit() with the RLIMIT_NOFILE 10308 option instead. 10309 10310 Return Value 10311 10312 The getdtablesize() function returns the current soft limit as 10313 if obtained by a call to getrlimit() with the RLIMIT_NOFILE 10314 option. 10315 10316 Errors 10317 10318 No errors are defined. 10319 10320 getgrouplist 10321 10322 Name 10323 10324 getgrouplist -- get groups a user belongs to 10325 10326 Synopsis 10327 10328 #include 10329 10330 int getgrouplist(const char * user, gid_t group, gid_t * 10331 groups, int * ngroups); 10332 10333 Description 10334 10335 The getgrouplist() function shall fill in the array groups with 10336 the supplementary groups for the user specified by user. On 10337 entry, ngroups shall refer to an integer containing the maximum 10338 number of gid_t members in the groups array. The group group 10339 shall also be included. 10340 10341 Return Value 10342 10343 If on entry the value referenced by ngroups was greater than or 10344 equal to the number of supplementary group identifiers to be 10345 copied to the array identified by groups, getgrouplist() shall 10346 return the number of group identifiers actually copied, and 10347 shall set the value referenced by ngroups to this value. 10348 10349 If on entry the value referenced by ngroups was less than to 10350 the number of supplementary group identifiers, getgrouplist() 10351 shall return -1. The initial *ngroups entries in groups may be 10352 overwritten. 10353 10354 If user does not refer to a valid user on the system, 10355 getgrouplist() shall return 1, and set the value referenced by 10356 ngroups to 1, reflecting the group supplied as group. 10357 10358 Errors 10359 10360 None defined. 10361 10362 See Also 10363 10364 getgroups() 10365 10366 gethostbyaddr_r 10367 10368 Name 10369 10370 gethostbyaddr_r -- find network host database entry matching 10371 host name (DEPRECATED) 10372 10373 Synopsis 10374 10375 #include 10376 10377 int gethostbyaddr_r(const void * restrict addr, socklen_t len, 10378 int type, struct hostent * restrict result_buf, char * restrict 10379 buf, size_t buflen, struct hostent * * restrict result, int * 10380 h_errnop); 10381 10382 Description 10383 10384 Note: The gethostbyaddr_r() function is deprecated; 10385 applications should use getaddrinfo() instead. 10386 10387 gethostbyaddr_r() is a reentrant version of gethostbyaddr() 10388 that searches the network host database for a host address 10389 match. 10390 10391 The gethostbyaddr_r() function shall search the network host 10392 database for an entry of address family type with the host with 10393 address addr. The len argument contains the length of the 10394 address referenced by addr. 10395 10396 If type is AF_INET, the addr argument shall be an in_addr 10397 structure. If type is AF_INET6, the addr argument shall be an 10398 in6_addr structure. If type is any other value, the behavior is 10399 unspecified. 10400 10401 The application must provide a buffer for the gethostbyaddr_r() 10402 to use during the lookup process. The buffer is referenced by 10403 buf, and is of size buflen. If the buffer is not of sufficient 10404 size, gethostbyaddr_r() may fail and return ERANGE. If a 10405 matching entry is found in the database, gethostbyaddr_r() 10406 shall copy the relevant information to the application supplied 10407 hostent structure referenced by result_buf, and return a 10408 pointer to this structure in *result. If no matching entry is 10409 found, *result shall be set to a null pointer. Additional error 10410 information shall be set in the variable referenced by 10411 h_errnop. 10412 10413 Return Value 10414 10415 On success, the gethostbyaddr_r() function shall return zero. 10416 If the return value was ERANGE, the size of the buffer buf, 10417 indicated by buflen, was too small. If the gethostbyaddr_r() 10418 function returns returns any other value, then the variable 10419 referenced by h_errnop shall be set to indicate the cause as 10420 for gethostbyaddr(). 10421 10422 gethostbyname2 10423 10424 Name 10425 10426 gethostbyname2 -- find network host database entry matching 10427 host name (DEPRECATED) 10428 10429 Synopsis 10430 10431 int gethostbyname2(const char * restrict name, int af); 10432 10433 Description 10434 10435 Note: The gethostbyname2() function is deprecated; 10436 applications should use getaddrinfo() instead. 10437 10438 The gethostbyname2() function shall search the network host 10439 database for an entry with name name. This function is similar 10440 to the gethostbyname() function but additionally allows the 10441 search to be restricted to a particular address family 10442 specified by af. 10443 10444 Return Value 10445 10446 On success, the gethostbyname_r() function shall return zero. 10447 If the return value was ERANGE, the size of the buffer buf, 10448 indicated by buflen, was too small. If the gethostbyname_r() 10449 function returns returns any other value, then the variable 10450 referenced by h_errnop shall be set to indicate the cause as 10451 for gethostbyname(). 10452 10453 gethostbyname2_r 10454 10455 Name 10456 10457 gethostbyname2_r -- find network host database entry matching 10458 host name (DEPRECATED) 10459 10460 Synopsis 10461 10462 int gethostbyname2_r(const char * restrict name, int af, struct 10463 hostent * restrict result_buf, char * restrict buf, size_t 10464 buflen, struct hostent ** restrict result, int * restrict 10465 h_errnop); 10466 10467 Description 10468 10469 Note: The gethostbyname2_r() function is deprecated; 10470 applications should use getaddrinfo() instead. 10471 10472 The gethostbyname2_r() function shall search the network host 10473 database for an entry with name name. gethostbyname2_r() is a 10474 reentrant version of gethostbyname2(). These functions are 10475 similar to the gethostbyname() and gethostbyname_r() functions 10476 but additionally allow the search to be restricted to a 10477 particular address family specified by af. 10478 10479 The application must provide a buffer for the 10480 gethostbyname2_r() function to use during the lookup process. 10481 The buffer is referenced by buf, and is of size buflen. If the 10482 buffer is not of sufficient size, gethostbyname_r() may fail 10483 and return ERANGE. If a matching entry is found in the 10484 database, gethostbyname_r() shall copy the relevant information 10485 to the application-supplied hostent structure referenced by 10486 result_buf, and return a pointer to this structure in *result. 10487 If no matching entry is found, *result shall be set to a null 10488 pointer. Additional error information shall be set in the 10489 variable referenced by h_errnop. 10490 10491 Return Value 10492 10493 On success, the gethostbyname2_r() function shall return zero. 10494 If the return value was ERANGE, the size of the buffer buf, 10495 indicated by buflen, was too small. If the gethostbyname2_r() 10496 function returns returns any other value, then the variable 10497 referenced by h_errnop shall be set to indicate the cause as 10498 for gethostbyname_r(). 10499 10500 gethostbyname_r 10501 10502 Name 10503 10504 gethostbyname_r -- find network host database entry matching 10505 host name (DEPRECATED) 10506 10507 Synopsis 10508 10509 int gethostbyname_r(const char * restrict name, struct hostent 10510 * restrict result_buf, char * restrict buf, size_t buflen, 10511 struct hostent ** restrict result, int * restrict h_errnop); 10512 10513 Description 10514 10515 Note: The gethostbyname_r() function is deprecated; 10516 applications should use getaddrinfo() instead. 10517 10518 gethostbyname_r() is a reentrant version of gethostbyname() 10519 that searches the network host database for a host name match. 10520 10521 The gethostbyname_r() function shall search the network host 10522 database for an entry with name name. 10523 10524 The application must provide a buffer for the gethostbyname_r() 10525 to use during the lookup process. The buffer is referenced by 10526 buf, and is of size buflen. If the buffer is not of sufficient 10527 size, gethostbyname_r() may fail and return ERANGE. If a 10528 matching entry is found in the database, gethostbyname_r() 10529 shall copy the relevant information to the application supplied 10530 hostent structure referenced by result_buf, and return a 10531 pointer to this structure in *result. If no matching entry is 10532 found, *result shall be set to a null pointer. Additional error 10533 information shall be set in the variable referenced by 10534 h_errnop. 10535 10536 Return Value 10537 10538 On success, the gethostbyname_r() function shall return zero. 10539 If the return value was ERANGE, the size of the buffer buf, 10540 indicated by buflen, was too small. If the gethostbyname_r() 10541 function returns returns any other value, then the variable 10542 referenced by h_errnop shall be set to indicate the cause as 10543 for gethostbyname(). 10544 10545 getloadavg 10546 10547 Name 10548 10549 getloadavg -- get system load averages 10550 10551 Synopsis 10552 10553 #include 10554 10555 int getloadavg(double loadavg[], int nelem); 10556 10557 Description 10558 10559 getloadavg() returns the number of processes in the system run 10560 queue averaged over various periods of time. Up to nelem 10561 samples are retrieved and assigned to successive elements of 10562 loadavg[]. The system imposes a maximum of 3 samples, 10563 representing averages over the last 1, 5, and 15 minutes, 10564 respectively. 10565 10566 getopt 10567 10568 Name 10569 10570 getopt -- parse command line options 10571 10572 Synopsis 10573 10574 #include 10575 10576 int getopt(int argc, char * const argv[], const char * 10577 optstring); 10578 10579 extern char *optarg; 10580 extern int optind, opterr, optopt; 10581 10582 Description 10583 10584 The getopt() function shall parse command line arguments as 10585 described in ISO POSIX (2003), with the following exceptions, 10586 where LSB and POSIX specifications vary. LSB systems shall 10587 implement the modified behaviors described below. 10588 10589 Argument Ordering 10590 10591 The getopt() function can process command line arguments 10592 referenced by argv in one of three ways: 10593 10594 PERMUTE 10595 10596 the order of arguments in argv is altered so that all options 10597 (and their arguments) are moved in front of all of the 10598 operands. This is the default behavior. 10599 10600 Note: This behavior has undefined results if argv is not 10601 modifiable. This is to support historic behavior predating 10602 the use of const and ISO C (1999). The function prototype 10603 was aligned with ISO POSIX (2003) despite the fact that it 10604 modifies argv, and the library maintainers are unwilling to 10605 change this. 10606 10607 REQUIRE_ORDER 10608 10609 The arguments in argv are processed in exactly the order given, 10610 and option processing stops when the first non-option argument 10611 is reached, or when the element of argv is "--". This ordering 10612 can be enforced either by setting the environment variable 10613 POSIXLY_CORRECT, or by setting the first character of optstring 10614 to '+'. 10615 RETURN_IN_ORDER 10616 10617 The order of arguments is not altered, and all arguments are 10618 processed. Non-option arguments (operands) are handled as if 10619 they were the argument to an option with the value 1 ('\001'). 10620 This ordering is selected by setting the first character of 10621 optstring to '-'; 10622 10623 Option Characteristics 10624 10625 LSB specifies that: 10626 10627 * an element of argv that starts with "-" (and is not exactly 10628 "-" or "--") is an option element. 10629 * characters of an option element, aside from the initial 10630 "-", are option characters. 10631 10632 POSIX specifies that: 10633 10634 * applications using getopt() shall obey the following syntax 10635 guidelines: 10636 + option name is a single alphanumeric character from 10637 the portable character set 10638 + option is preceded by the '-' delimiter character 10639 + options without option-arguments should be accepted 10640 when grouped behind one '-' delimiter 10641 + each option and option-argument is a separate argument 10642 + option-arguments are not optional 10643 + all options should precede operands on the command 10644 line 10645 + the argument "--" is accepted as a delimiter 10646 indicating the end of options and the consideration of 10647 subsequent arguments, if any, as operands 10648 * historical implementations of getopt() support other 10649 characters as options as an allowed extension, but 10650 applications that use extensions are not maximally 10651 portable. 10652 * support for multi-byte option characters is only possible 10653 when such characters can be represented as type int. 10654 * applications that call any utility with a first operand 10655 starting with '-' should usually specify "--" to mark the 10656 end of the options. Standard utilities that do not support 10657 this guideline indicate that fact in the OPTIONS section of 10658 the utility description. 10659 10660 Extensions 10661 10662 LSB specifies that: 10663 10664 * if a character is followed by two colons, the option takes 10665 an optional argument; if there is text in the current argv 10666 element, it is returned in optarg, otherwise optarg is set 10667 to 0. 10668 * if optstring contains W followed by a semi-colon (;), then 10669 -W foo is treated as the long option --foo. 10670 10671 Note: See getopt_long() for a description of long options. 10672 * The first character of optstring shall modify the behavior 10673 of getopt() as follows: 10674 + if the first character is '+', then REQUIRE_ORDER 10675 processing shall be in effect (see above) 10676 + if the first character is '-', then RETURN_IN_ORDER 10677 processing shall be in effect (see above) 10678 + if the first character is ':', then getopt() shall 10679 return ':' instead of '?' to indicate a missing option 10680 argument, and shall not print any diagnostic message 10681 to stderr. 10682 10683 POSIX specifies that: 10684 10685 * the -W option is reserved for implementation extensions. 10686 10687 Return Values 10688 10689 LSB specifies the following additional getopt() return values: 10690 10691 * '\001' is returned if RETURN_IN_ORDER argument ordering is 10692 in effect, and the next argument is an operand, not an 10693 option. The argument is available in optarg. 10694 10695 Any other return value has the same meaning as for POSIX. 10696 10697 POSIX specifies the following getopt() return values: 10698 10699 * the next option character is returned, if found 10700 successfully. 10701 * ':' is returned if a parameter is missing for one of the 10702 options and the first character of optstring is ':'. 10703 * '?' is returned if an unknown option character not in 10704 optstring is encountered, or if getopt() detects a missing 10705 argument and the first character of optstring is not ':'. 10706 * -1 is returned for the end of the option list. 10707 10708 Environment Variables 10709 10710 LSB specifies that: 10711 10712 * if the variable POSIXLY_CORRECT is set, option processing 10713 stops as soon as a non-option argument is encountered. 10714 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 10715 is the process ID for the current process), contains a 10716 space separated list of arguments that should not be 10717 treated as arguments even though they appear to be so. 10718 10719 Rationale: This was used by bash 2.0 to communicate to GNU 10720 libc which arguments resulted from wildcard expansion and so 10721 should not be considered as options. This behavior was 10722 removed in bash version 2.01, but the support remains in GNU 10723 libc. 10724 This behavior is DEPRECATED in this version of the LSB; 10725 future revisions of this specification may not include this 10726 requirement. 10727 10728 getopt_long 10729 10730 Name 10731 10732 getopt_long -- parse command line options 10733 10734 Synopsis 10735 10736 #define _GNU_SOURCE 10737 #include 10738 10739 int getopt_long(int argc, char * const argv[], const char * 10740 opstring, const struct option * longopts, int * longindex); 10741 10742 Description 10743 10744 getopt_long() works like getopt() except that it also accepts 10745 long options, started out by two dashes. Long option names may 10746 be abbreviated if the abbreviation is unique or is an exact 10747 match for some defined option. A long option may take a 10748 parameter, of the form --arg=param or --arg param. 10749 10750 longopts is a pointer to the first element of an array of 10751 struct option declared in getopt.h as: 10752 struct option { 10753 const char *name; 10754 int has_arg; 10755 int *flag; 10756 int val; 10757 }; 10758 10759 The fields in this structure have the following meaning: 10760 10761 name 10762 10763 The name of the long option. 10764 has_arg 10765 10766 One of: 10767 10768 no_argument (or 0) if the option does not take an argument, 10769 required_argument (or 1) if the option requires an argument, or 10770 optional_argument (or 2) if the option takes an optional 10771 argument. 10772 10773 flag 10774 10775 specifies how results are returned for a long option. If flag 10776 is NULL, then getopt_long() shall return val. (For example, the 10777 calling program may set val to the equivalent short option 10778 character.) Otherwise, getopt_long() returns 0, and flag shall 10779 point to a variable which shall be set to val if the option is 10780 found, but left unchanged if the option is not found. 10781 val 10782 10783 The value to return, or to load into the variable pointed to by 10784 flag. 10785 10786 If longindex is not NULL, it points to a variable which is set 10787 to the index of the long option relative to longopts. 10788 10789 Return Value 10790 10791 getopt_long() returns the option character if a short option 10792 was found successfully, or ":" if there was a missing parameter 10793 for one of the options, or "?" for an unknown option character, 10794 or -1 for the end of the option list. 10795 10796 For a long option, getopt_long() returns val if flag is NULL, 10797 and 0 otherwise. Error and -1 returns are the same as for 10798 getopt(), plus "?" for an ambiguous match or an extraneous 10799 parameter. 10800 10801 getopt_long_only 10802 10803 Name 10804 10805 getopt_long_only -- parse command line options 10806 10807 Synopsis 10808 10809 #define _GNU_SOURCE 10810 #include 10811 10812 int getopt_long_only(int argc, char * const argv[], const char 10813 * optstring, const struct option * longopts, int * longindex); 10814 10815 Description 10816 10817 getopt_long_only() is like getopt_long(), but "-" as well as 10818 "--" can indicate a long option. If an option that starts with 10819 "-" (not "--") doesn't match a long option, but does match a 10820 short option, it is parsed as a short option instead. 10821 10822 Note: The getopt_long_only() function is intended only for 10823 supporting certain programs whose command line syntax was 10824 designed before the Utility Syntax Guidelines of ISO POSIX 10825 (2003) were developed. New programs should generally call 10826 getopt_long() instead, which provides the --option syntax 10827 for long options, which is preferred by GNU and consistent 10828 with ISO POSIX (2003). 10829 10830 Return Value 10831 10832 getopt_long_only() returns the option character if the option 10833 was found successfully, or ":" if there was a missing parameter 10834 for one of the options, or "?" for an unknown option character, 10835 or -1 for the end of the option list. 10836 10837 getopt_long_only() also returns the option character when a 10838 short option is recognized. For a long option, they return val 10839 if flag is NULL, and 0 otherwise. Error and -1 returns are the 10840 same as for getopt(), plus "?" for an ambiguous match or an 10841 extraneous parameter. 10842 10843 getpagesize 10844 10845 Name 10846 10847 getpagesize -- get memory page size (DEPRECATED) 10848 10849 Synopsis 10850 10851 #include 10852 10853 int getpagesize (void ); 10854 10855 Description 10856 10857 The function getpagesize() returns the number of bytes in a 10858 meory page. 10859 10860 Note: The getpagesize() function is deprecated. Portable 10861 applications should use sysconf(_SC_PAGE_SIZE) instead. 10862 10863 Return Value 10864 10865 The getpagesize() function returns the current page size. 10866 10867 Errors 10868 10869 No errors are defined. 10870 10871 getsockopt 10872 10873 Name 10874 10875 getsockopt -- get socket options 10876 10877 Synopsis 10878 10879 #include 10880 #include 10881 10882 int getsockopt(int socket, int level, int option_name, void * 10883 restrict option_value, socklen_t * restrict option_len); 10884 10885 Description 10886 10887 The getsockopt() function shall behave as specified in ISO 10888 POSIX (2003), with the following extensions. 10889 10890 IP Protocol Level Options 10891 10892 If the level parameter is IPPROTO_IP, the following values 10893 shall be supported for option_name (see RFC 791:Internet 10894 Protocol for further details): 10895 10896 IP_OPTIONS 10897 10898 Get the Internet Protocol options sent with every packet from 10899 this socket. The option_value shall point to a memory buffer in 10900 which the options shall be placed; on entry option_len shall 10901 point to an integer value indicating the maximum size of the 10902 memory buffer, in bytes. On successful return, the value 10903 referenced by option_len shall be updated to the size of data 10904 copied to the buffer. For IPv4, the maximum length of options 10905 is 40 bytes. 10906 IP_TTL 10907 10908 Get the current unicast Internet Protocol Time To Live value 10909 used when sending packets with this socket. The option_value 10910 shall point to a buffer large enough to hold the time to live 10911 value (at least 1 byte), and option_len shall point to an 10912 integer value holding the maximum size of that buffer. On 10913 successful return, the value referenced by option_len shall be 10914 updated to contain the number of bytes copied into the buffer, 10915 which shall be no larger than the initial value, and 10916 option_value shall point to an integer containing the time to 10917 live value. 10918 IP_TOS 10919 10920 Get the Internet Protocol type of service indicator used when 10921 sending packets with this socket. The option_value shall point 10922 to a buffer large enough to hold the type of service indicator 10923 (at least 1 byte), and option_len shall point to an integer 10924 value holding the maximum size of that buffer. On successful 10925 return, the value referenced by option_len shall be updated to 10926 contain the number of bytes copied into the buffer, which shall 10927 be no larger than the initial value, and option_value shall 10928 point to an integer containing the time to live value. 10929 10930 gettext 10931 10932 Name 10933 10934 gettext -- search message catalogs for a string 10935 10936 Synopsis 10937 10938 #include 10939 10940 char * gettext(const char * msgid); 10941 10942 Description 10943 10944 The gettext() function shall search the currently selected 10945 message catalogs for a string identified by the string msgid. 10946 If a string is located, that string shall be returned. 10947 10948 The gettext() function is equivalent to dcgettext(NULL, msgid, 10949 LC_MESSAGES). 10950 10951 Return Value 10952 10953 If a string is found in the currently selected message catalogs 10954 for msgid, then a pointer to that string shall be returned. 10955 Otherwise, a pointer to msgid shall be returned. 10956 10957 Applications shall not modify the string returned by gettext(). 10958 10959 Errors 10960 10961 None. 10962 10963 The gettext() function shall not modify errno. 10964 10965 See Also 10966 10967 dgettext, ngettext, dngettext, dcgettext, dcngettext, 10968 textdomain, bindtextdomain, bind_textdomain_codeset 10969 10970 getutent 10971 10972 Name 10973 10974 getutent -- access user accounting database entries 10975 10976 Synopsis 10977 10978 #include 10979 10980 struct utmp *getutent(void); 10981 10982 Description 10983 10984 The getutent() function shall read the next entry from the user 10985 accounting database. 10986 10987 Return Value 10988 10989 Upon successful completion, getutent() shall return a pointer 10990 to a utmp structure containing a copy of the requested entry in 10991 the user accounting database. Otherwise, a null pointer shall 10992 be returned. The return value may point to a static area which 10993 is overwritten by a subsequent call to getutent(). 10994 10995 Errors 10996 10997 None defined. 10998 10999 getutent_r 11000 11001 Name 11002 11003 getutent_r -- access user accounting database entries 11004 11005 Synopsis 11006 11007 int getutent_r(struct utmp * buffer, struct utmp ** result); 11008 11009 Description 11010 11011 The getutent_r() function is a reentrant version of the 11012 getutent() function. On entry, buffer should point to a user 11013 supplied buffer to which the next entry in the database will be 11014 copied, and result should point to a location where the result 11015 will be stored. 11016 11017 Return Value 11018 11019 On success, getutent_r() shall return 0 and set the location 11020 referenced by result to a pointer to buffer. Otherwise, 11021 getutent_r() shall return -1 and set the location referenced by 11022 result to NULL. 11023 11024 glob64 11025 11026 Name 11027 11028 glob64 -- find pathnames matching a pattern (Large File 11029 Support) 11030 11031 Synopsis 11032 11033 #include 11034 11035 int glob64(const char * pattern, int flags, int (*errfunc) 11036 (const char *, int), glob64_t * pglob); 11037 11038 Description 11039 11040 The glob64() function is a large-file version of the glob() 11041 function defined in ISO POSIX (2003). It shall search for 11042 pathnames matching pattern according to the rules used by the 11043 shell, /bin/sh. No tilde expansion or parameter substitution is 11044 done; see wordexp(). 11045 11046 The results of a glob64() call are stored in the structure 11047 pointed to by pglob, which is a glob64_t declared in glob.h 11048 with the following members: 11049 typedef struct 11050 { 11051 size_t gl_pathc; 11052 char **gl_pathv; 11053 size_t gl_offs; 11054 int gl_flags; 11055 void (*gl_closedir) (void *); 11056 struct dirent64 *(*gl_readdir64) (void *); 11057 void *(*gl_opendir) (const char *); 11058 int (*gl_lstat) (const char *, struct stat *); 11059 int (*gl_stat) (const char *, struct stat *); 11060 } 11061 glob64_t; 11062 11063 Structure members with the same name as corresponding members 11064 of a glob_t as defined in ISO POSIX (2003) shall have the same 11065 purpose. 11066 11067 Other members are defined as follows: 11068 11069 gl_flags 11070 11071 reserved for internal use 11072 gl_closedir 11073 11074 pointer to a function capable of closing a directory opened by 11075 gl_opendir 11076 gl_readdir64 11077 11078 pointer to a function capable of reading entries in a large 11079 directory 11080 gl_opendir 11081 11082 pointer to a function capable of opening a large directory 11083 gl_stat 11084 11085 pointer to a function capable of returning file status for a 11086 large file 11087 gl_lstat 11088 11089 pointer to a function capable of returning file status 11090 information for a large file or symbolic link 11091 11092 A large file or large directory is one with a size which cannot 11093 be represented by a variable of type off_t. 11094 11095 Return Value 11096 11097 On success, 0 is returned. Other possible returns are: 11098 11099 GLOB_NOSPACE 11100 11101 out of memory 11102 GLOB_ABORTED 11103 11104 read error 11105 GLOB_NOMATCH 11106 11107 no match found 11108 11109 globfree64 11110 11111 Name 11112 11113 globfree64 -- free memory from glob64() (Large File Support) 11114 11115 Synopsis 11116 11117 #include 11118 11119 void globfree64(glob64_t * pglob); 11120 11121 Description 11122 11123 globfree64() frees the dynamically allocated storage from an 11124 earlier call to glob64(). 11125 11126 globfree64() is a 64-bit version of globfree(). 11127 11128 inet_aton 11129 11130 Name 11131 11132 inet_aton -- Internet address manipulation routine 11133 11134 Synopsis 11135 11136 #include 11137 #include 11138 #include 11139 11140 int anet_iton(const char * cp, struct in_addr * inp); 11141 11142 Description 11143 11144 inet_aton() converts the Internet host address cp from the 11145 standard IPv4 numbers-and-dots notation into binary data and 11146 stores it in the structure that inp points to. 11147 11148 inet_aton() returns a nonzero value if the address is valid, 0 11149 if not. 11150 11151 Note: Note that on some LSB architectures, the host byte 11152 order is Least Significant Byte first, whereas the network 11153 byte order, as used on the Internet, is Most Significant 11154 Byte first. 11155 11156 initgroups 11157 11158 Name 11159 11160 initgroups -- initialize the supplementary group access list 11161 11162 Synopsis 11163 11164 #include 11165 #include 11166 11167 int initgroups(const char * user, gid_t group); 11168 11169 Description 11170 11171 If the process has appropriate privilege, the initgroups() 11172 function shall initialize the Supplementary Group IDs for the 11173 current process by reading the group database and using all 11174 groups of which user is a member. The additional group group is 11175 also added to the list. 11176 11177 Return Value 11178 11179 On success, 0 is returned. On error, -1 is returned and the 11180 global variable errno is set appropriately. 11181 11182 Errors 11183 11184 EPERM 11185 11186 The calling process does not have sufficient privileges. 11187 ENOMEM 11188 11189 Insufficient memory to allocate group information structure. 11190 11191 See Also 11192 11193 setgroups() 11194 11195 ioctl 11196 11197 Name 11198 11199 ioctl -- control device 11200 11201 Synopsis 11202 11203 #include 11204 11205 int ioctl (int fildes , int request , ...); 11206 11207 Description 11208 11209 The ioctl() function shall manipulate the underlying device 11210 parameters of special files. fildes shall be an open file 11211 descriptor referring to a special file. The ioctl() function 11212 shall take three parameters; the type and value of the third 11213 parameter is dependent on the device and request. 11214 11215 Conforming LSB applications shall not call ioctl() except in 11216 situations explicitly stated in this specification. 11217 11218 Return Value 11219 11220 On success, 0 is returned. An ioctl() may use the return value 11221 as an output parameter and return a non-negative value on 11222 success. On error, -1 is returned and the global variable errno 11223 is set appropriately. 11224 11225 Errors 11226 11227 EBADF 11228 11229 fildes is not a valid descriptor. 11230 EFAULT 11231 11232 The third parameter references an inaccessible memory area. 11233 ENOTTY 11234 11235 fildes is not associated with a character special device. 11236 ENOTTY 11237 11238 The specified request does not apply to the kind of object that 11239 fildes references. 11240 EINVAL 11241 11242 request or the third parameter is not valid. 11243 11244 Relationship to POSIX (Informative) 11245 11246 It should be noted that ISO POSIX (2003) contains an interface 11247 named ioctl(). The LSB only defines behavior when fildes refers 11248 to a socket (see sockio) or terminal device (see ttyio), while 11249 ISO POSIX (2003) only defines behavior when fildes refers to a 11250 STREAMS device. An implementation may support both behaviors; 11251 the LSB does not require any STREAMS support. 11252 11253 sockio 11254 11255 Name 11256 11257 sockio -- socket ioctl commands 11258 11259 Synopsis 11260 11261 #include 11262 #include 11263 #include 11264 #include 11265 11266 int ioctl(int sockfd, int request, void * argp); 11267 11268 Description 11269 11270 Socket ioctl() commands are a subset of the ioctl() calls, 11271 which can perform a variety of functions on sockets. sockfd 11272 shall be an open file descriptor referring to a socket (see the 11273 socket() or accept() functions). 11274 11275 Socket ioctl() commands apply to the underlying network 11276 interfaces, and affect the entire system, not just the file 11277 descriptor used to issue the ioctl(). 11278 11279 The following values for request are accepted: 11280 11281 SIOCGIFCONF (Deprecated) 11282 Get the interface configuration list for the system. 11283 11284 Note: The SIOCGIFCONF interface is superceded by the 11285 if_nameindex() family of functions (see ISO POSIX (2003)). A 11286 future version of this specification may withdraw this value 11287 for request. 11288 11289 argp shall point to a ifconf structure, as described in 11290 . Before calling, the caller shall set the 11291 ifc_ifcu.ifcu_req field to point to an array of ifreq 11292 structures, and set ifc_len to the size in bytes of this 11293 allocated array. Upon return, ifc_len will contain the 11294 size in bytes of the array which was actually used. If 11295 it is the same as the length upon calling, the caller 11296 should assume that the array was too small and try again 11297 with a larger array. 11298 11299 On success, SIOCGIFCONF shall return a nonnegative 11300 value. 11301 11302 Rationale: Historical UNIX systems disagree on the meaning 11303 of the return value. 11304 11305 SIOCGIFFLAGS 11306 Get the interface flags for the indicated interface. 11307 argp shall point to a ifreq structure. Before calling, 11308 the caller should fill in the ifr_name field with the 11309 interface name, and upon return, the ifr_ifru.ifru_flags 11310 field is set with the interface flags. 11311 11312 SIOCGIFADDR 11313 Get the interface address for the given interface. argp 11314 shall point to a ifreq structure. Before calling, the 11315 caller should fill in the ifr_name field with the 11316 interface name, and upon return, the ifr_ifru.ifru_addr 11317 field is set with the interface address. 11318 11319 SIOCGIFBRDADDR 11320 Get the interface broadcast address for the given 11321 interface. argp shall point to a ifreq structure. Before 11322 calling, the caller should fill in the ifr_name field 11323 with the interface name, and upon return, the 11324 ifr_ifru.ifru_broadcast field is set with the interface 11325 broadcast address. 11326 11327 SIOCGIFDSTADDR 11328 Get the point-to-point address for the given interface. 11329 argp shall point to a ifreq structure. Before calling, 11330 the caller should fill in the ifr_name field with the 11331 interface name, and upon return, the ifr_dstaddr field 11332 is set with the point-to-point address. 11333 11334 SIOCGIFNAME 11335 Get the name of an interface. argp shall point to a 11336 ifreq structure. Before calling, the caller should fill 11337 in the ifr_ifindex field with the number (index) of the 11338 interface, and upon return, the ifr_name field is set 11339 with the interface name. 11340 11341 SIOCGIFNETMASK 11342 Get the network mask for the given interface. argp shall 11343 point to a ifreq structure. Before calling, the caller 11344 should fill in the ifr_name field with the interface 11345 name, and upon return, the ifr_ifru.ifru_netmask field 11346 is set with the network mask. 11347 11348 SIOCGIFMTU 11349 Get the Maximum Transmission Unit (MTU) size for the 11350 given interface. argp shall point to a ifreq structure. 11351 Before calling, the caller should fill in the ifr_name 11352 field with the interface name, and upon return, the 11353 ifr_ifru.ifru_mtu field is set with the MTU. Note: The 11354 range of valid values for MTU varies for an interface 11355 depending on the interface type. 11356 11357 FIONREAD 11358 Get the amount of queued unread data in the receive 11359 buffer. argp shall point to an integer where the result 11360 is to be placed. 11361 11362 Note: Some implementations may also support the use of 11363 FIONREAD on other types of file descriptor. However, the LSB 11364 only specifies its behavior for a socket related file 11365 descriptor. 11366 11367 Return Value 11368 11369 On success, if request is SIOCGIFCONF, a non-negative integer 11370 shall be returned. If request is not SIOCGIFCONF, on success 0 11371 is returned. On error, -1 is returned and the global variable 11372 errno is set appropriately. 11373 11374 Errors 11375 11376 EBADF 11377 11378 sockfd is not a valid descriptor. 11379 EFAULT 11380 11381 argp references an inaccessible memory area. 11382 ENOTTY 11383 11384 The specified request does not apply to the kind of object that 11385 the descriptor sockfd references. 11386 EINVAL 11387 11388 Either request or argp is invalid. 11389 ENOTCONN 11390 11391 The operation is only defined on a connected socket, but the 11392 socket wasn't connected. 11393 11394 ttyio 11395 11396 Name 11397 11398 ttyio -- tty ioctl commands 11399 11400 Synopsis 11401 11402 #include 11403 #include 11404 11405 int ioctl(int fd, unsigned long request, int * argp); 11406 11407 Description 11408 11409 Tty ioctl commands are a subset of the ioctl() calls, which can 11410 perform a variety of functions on tty devices. fd shall be an 11411 open file descriptor referring to a terminal device. 11412 11413 The following ioctl()s are provided: 11414 11415 TIOCGWINSZ 11416 11417 Get the size attributes of the terminal or pseudo-terminal 11418 identified by fd. On entry, argp shall reference a winsize 11419 structure. On return, the structure will have ws_row set to the 11420 number of rows of text (i.e. lines of text) that can be viewed 11421 on the device, and ws_col set to the number of columns (i.e. 11422 text width). 11423 11424 Note: The number of columns stored in ws_col assumes that 11425 the terminal device is using a mono-spaced font. 11426 11427 Return Value 11428 11429 On success, 0 is returned. On error, -1 is returned and the 11430 global variable errno is set appropriately. 11431 11432 Errors 11433 11434 EBADF 11435 11436 fd is not a valid descriptor. 11437 EFAULT 11438 11439 argp references an inaccessible memory area. 11440 EINVAL 11441 11442 request and argp are not valid. 11443 11444 kill 11445 11446 Name 11447 11448 kill -- send a signal 11449 11450 Synopsis 11451 11452 #include 11453 11454 int kill(pid_t pid, int sig); 11455 11456 Description 11457 11458 kill() is as specified in the ISO POSIX (2003), but with 11459 differences as listed below. 11460 11461 Process ID -1 doesn't affect calling process 11462 11463 If pid is specified as -1, sig shall not be sent to the calling 11464 process. Other than this, the rules in the ISO POSIX (2003) 11465 apply. 11466 11467 Rationale: This was a deliberate Linus decision after an 11468 unpopular experiment in including the calling process in the 11469 2.5.1 kernel. See "What does it mean to signal everybody?", 11470 Linux Weekly News, 20 December 2001, 11471 http://lwn.net/2001/1220/kernel.php3 11472 11473 link 11474 11475 Name 11476 11477 link -- create a link to a file 11478 11479 Synopsis 11480 11481 #include 11482 11483 int link(const char * path1, const char * path2); 11484 11485 Description 11486 11487 The link() function shall behave as specified in ISO POSIX 11488 (2003), except with differences as listed below. 11489 11490 Need Not Follow Symlinks 11491 11492 ISO POSIX (2003) specifies that pathname resolution shall 11493 follow symbolic links during pathname resolution unless the 11494 function is required to act on the symbolic link itself, or 11495 certain arguments direct that the function act on the symbolic 11496 link itself. The link() function in ISO POSIX (2003) contains 11497 no such requirement to operate on a symbolic link. However, a 11498 conforming LSB implementation need not follow a symbolic link 11499 for the path1 argument. 11500 11501 mbsnrtowcs 11502 11503 Name 11504 11505 mbsnrtowcs -- convert a multibyte string to a wide character 11506 string 11507 11508 Synopsis 11509 11510 #include 11511 11512 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 11513 nms, size_t len, mbstate_t * ps); 11514 11515 Description 11516 11517 mbsnrtowcs() is like mbsrtowcs(), except that the number of 11518 bytes to be converted, starting at src, is limited to nms. 11519 11520 If dest is not a NULL pointer, mbsnrtowcs() converts at most 11521 nms bytes from the multibyte string src to a wide-character 11522 string starting at dest. At most, len wide characters are 11523 written to dest. The shift state ps is updated. 11524 11525 The conversion is effectively performed by repeatedly calling: 11526 11527 mbrtowc(dest, *src, n, ps) 11528 11529 where n is some positive number, as long as this call succeeds, 11530 and then incrementing dest by one and src by the number of 11531 bytes consumed. 11532 11533 The conversion can stop for three reasons: 11534 11535 * An invalid multibyte sequence has been encountered. In this 11536 case src is left pointing to the invalid multibyte 11537 sequence, (size_t)(-1) is returned, and errno is set to 11538 EILSEQ. 11539 * The nms limit forces a stop, or len non-L'\0' wide 11540 characters have been stored at dest. In this case, src is 11541 left pointing to the next multibyte sequence to be 11542 converted, and the number of wide characters written to 11543 dest is returned. 11544 * The multibyte string has been completely converted, 11545 including the terminating '\0' (which has the side effect 11546 of bringing back ps to the initial state). In this case, 11547 src is set to NULL, and the number of wide characters 11548 written to dest, excluding the terminating L'\0' character, 11549 is returned. 11550 11551 If dest is NULL, len is ignored, and the conversion proceeds as 11552 above, except that the converted wide characters are not 11553 written out to memory, and that no destination length limit 11554 exists. 11555 11556 In both of the above cases, if ps is a NULL pointer, a static 11557 anonymous state only known to mbsnrtowcs() is used instead. 11558 11559 The programmer shall ensure that there is room for at least len 11560 wide characters at dest. 11561 11562 Return Value 11563 11564 mbsnrtowcs() returns the number of wide characters that make up 11565 the converted part of the wide character string, not including 11566 the terminating null wide character. If an invalid multibyte 11567 sequence was encountered, (size_t)(-1) is returned, and the 11568 global variable errno is set to EILSEQ. 11569 11570 Notes 11571 11572 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 11573 of the current locale. 11574 11575 Passing NULL as ps is not multi-thread safe. 11576 11577 memmem 11578 11579 Name 11580 11581 memmem -- locate bytes 11582 11583 Synopsis 11584 11585 #define _GNU_SOURCE 11586 #include 11587 11588 void * memmem(const void * haystack, size_t haystacklen, const 11589 void * needle, size_t needlelen); 11590 11591 Description 11592 11593 memmem() finds the start of the first occurrence of the byte 11594 array referenced by needle of length needlelen in the memory 11595 area haystack of length haystacklen. 11596 11597 Return Value 11598 11599 memmem() returns a pointer to the beginning of the byte array, 11600 or NULL if the byte array is not found. 11601 11602 Notes 11603 11604 Earlier versions of the C library (prior to glibc 2.1) 11605 contained a memmem() with various problems, and application 11606 developers should treat this function with care. 11607 11608 memrchr 11609 11610 Name 11611 11612 memrchr -- scan memory for a character 11613 11614 Synopsis 11615 11616 #include 11617 11618 void * memrchr(const void * s, int c, size_t n); 11619 11620 Description 11621 11622 The memrchr() function shall locate the last occurence of c 11623 (converted to an unsigned char) in the initial n bytes (each 11624 interpreted as an unsigned char) of the object pointed to by s. 11625 11626 Return Value 11627 11628 The memrchr() shall return a pointer to the located byte, or a 11629 null pointer if the byte does not occur in the object. 11630 11631 Errors 11632 11633 No errors are defined. 11634 11635 See Also 11636 11637 memchr() 11638 11639 mremap 11640 11641 Name 11642 11643 mremap -- remap a virtual memory address 11644 11645 Synopsis 11646 11647 #include 11648 11649 void * mremap(void * old_address, size_t old_size, size_t 11650 new_size, int flags); 11651 11652 Description 11653 11654 The mremap() function expands (or shrinks) an existing memory 11655 mapping, potentially moving it at the same time, depending on 11656 the flags argument and the available virtual address space. 11657 11658 old_address is the old address of the virtual memory block to 11659 be resized. Note that old_address must be page aligned. 11660 old_size is the old size of the virtual memory block. new_size 11661 is the requested size of the virtual memory block after the 11662 resize. 11663 11664 In Linux the memory is divided into pages. A user process has 11665 (one or) several linear virtual memory segments. Each virtual 11666 memory segment has one or more mappings to real memory pages 11667 (in the page table). Each virtual memory segment has its own 11668 protection (access rights), which may cause a segmentation 11669 violation if the memory is accessed incorrectly (e.g., writing 11670 to a read-only segment). Accessing virtual memory outside of 11671 the segments will also cause a segmentation violation. 11672 11673 mremap() uses the Linux page table scheme. mremap() changes the 11674 mapping between virtual addresses and memory pages. This can be 11675 used to implement a very efficient form of realloc(). 11676 11677 The flags bit-mask argument may be 0, or include the following 11678 flag: 11679 11680 MREMAP_MAYMOVE 11681 11682 By default, if there is not sufficient space to expand a 11683 mapping at its current location, then mremap() fails. If this 11684 flag is specified, then the kernel is permitted to relocate the 11685 mapping to a new virtual address, if necessary. If the mapping 11686 is relocated, then absolute pointers into the old mapping 11687 location become invalid (offsets relative to the starting 11688 address of the mapping should be employed). 11689 MREMAP_FIXED 11690 11691 This flag serves a similar purpose to the MAP_FIXED flag of 11692 mmap(). If this flag is specified, then mremap()accepts a fifth 11693 argument, void *new_address, which specifies a pagealigned 11694 address to which the mapping must be moved. Any previous 11695 mapping at the address range specified by new_address and 11696 new_size is unmapped. If MREMAP_FIXED is specified, then 11697 MREMAP_MAYMOVE must also be specified. 11698 11699 If the memory segment specified by old_address and old_size is 11700 locked (using mlock() or similar), then this lock is maintained 11701 when the segment is resized and/or relocated. As a consequence, 11702 the amount of memory locked by the process may change. 11703 11704 Return Value 11705 11706 The mremap() function returns a pointer to the new virtual 11707 memory area on success. On error, the value MAP_FAILED is 11708 returned, and errno is set appropriately. 11709 11710 Errors 11711 11712 EAGAIN 11713 11714 The caller tried to expand a memory segment that is locked, but 11715 this was not possible without exceeding the RLIMIT_MEMLOCK 11716 resource limit. 11717 EFAULT 11718 11719 "Segmentation fault." Some address in the range old_address to 11720 old_address+old_size is an invalid virtual memory address for 11721 this process. You can also get EFAULT even if there exist 11722 mappings that cover the whole address space requested, but 11723 those mappings are of different types. 11724 EINVAL 11725 11726 An invalid argument was given. Possible causes are: old_address 11727 was not page aligned; a value other than MREMAP_MAYMOVE or 11728 MREMAP_FIXED was specified in flags; new_size was zero; 11729 new_size or new_address was invalid; or the new address range 11730 specified by new_address and new_size overlapped the old 11731 address range specified by old_address and old_size; or 11732 MREMAP_FIXED was specified without also specifying 11733 MREMAP_MAYMOVE. 11734 ENOMEM 11735 11736 The memory area cannot be expanded at the current virtual 11737 address, and the MREMAP_MAYMOVE flag is not set in flags, or, 11738 there is not enough (virtual) memory available. 11739 11740 newlocale 11741 11742 Name 11743 11744 newlocale -- allocate a locale object 11745 11746 Synopsis 11747 11748 #include 11749 11750 locale_t newlocale(int category_mask, const char * locale, 11751 locale_t base); 11752 11753 Description 11754 11755 The newlocale() function shall initialize a locale object. If 11756 base is NULL, then newlocale() shall first allocate the object; 11757 otherwise it shall use the locale object referenced by base. 11758 11759 The object shall be initialized for the locale named by locale, 11760 and for the categories selected in category_mask. The 11761 category_mask value is a bitwise inclusive OR of the required 11762 LC_name_MASK values, or the value LC_ALL_MASK. 11763 11764 Return Value 11765 11766 On success, the newlocale() function shall return the 11767 initialized locale object. Otherwise, it shall return NULL, and 11768 set errno to indicate the error. 11769 11770 Errors 11771 11772 The newlocale() function shall fail if: 11773 11774 ENOMEM 11775 11776 Insufficient memory. 11777 EINVAL 11778 11779 An invalid category_mask was provided, or the locale was NULL. 11780 ENOENT 11781 11782 For any of the categories in category_mask, the locale data is 11783 not available. 11784 11785 Application Usage (Informative) 11786 11787 The only portable way to allocate a locale object is to call 11788 newlocale() with a NULL base. The allocated object may be 11789 reinitialized to a new locale by passing it back to 11790 newlocale(). The new object may be released by calling 11791 freelocale(). 11792 11793 See Also 11794 11795 setlocale(), freelocale(), duplocale(), uselocale() 11796 11797 ngettext 11798 11799 Name 11800 11801 ngettext -- search message catalogs for plural string 11802 11803 Synopsis 11804 11805 #include 11806 11807 char * ngettext(const char * msgid1, const char * msgid2, 11808 unsigned long int n); 11809 11810 Description 11811 11812 The ngettext() function shall search the currently selected 11813 message catalogs for a string matching the singular string 11814 msgid1. If a string is located, and if n is 1, that string 11815 shall be returned. If n is not 1, a pluralized version 11816 (dependent on n) of the string shall be returned. 11817 11818 The ngettext() function is equivalent to dcngettext(NULL, 11819 msgid1, msgid2, n, LC_MESSAGES)(). 11820 11821 Return Value 11822 11823 If a string is found in the currently selected message catalogs 11824 for msgid1, then if n is 1 a pointer to the located string 11825 shall be returned. If n is not 1, a pointer to an appropriately 11826 pluralized version of the string shall be returned. If no 11827 message could be found in the currently selected mesage 11828 catalogs, then if n is 1, a pointer to msgid1 shall be 11829 returned, otherwise a pointer to msgid2 shall be returned. 11830 11831 Applications shall not modify the string returned by 11832 ngettext(). 11833 11834 Errors 11835 11836 None. 11837 11838 The ngettext() function shall not modify errno. 11839 11840 See Also 11841 11842 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 11843 textdomain, bindtextdomain, bind_textdomain_codeset 11844 11845 pmap_getport 11846 11847 Name 11848 11849 pmap_getport -- find the port number assigned to a service 11850 registered with a portmapper. 11851 11852 Synopsis 11853 11854 #include 11855 11856 u_short * pmap_getport(struct sockaddr_in * address, const 11857 u_long program, const u_long * version, u_int protocol); 11858 11859 Description 11860 11861 The pmap_getport() function shall return the port number 11862 assigned to a service registered with a RPC Binding service 11863 running on a given target system, using the protocol described 11864 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 11865 pmap_getport() function shall be called given the RPC program 11866 number program, the program version version, and transport 11867 protocol protocol. Conforming implementations shall support 11868 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 11869 shall specify the address of the system on which the portmapper 11870 to be contacted resides. The value of address->sin_port shall 11871 be ignored, and the standard value for the portmapper port 11872 shall always be used. 11873 11874 Note: Security and network restrictions may prevent a 11875 conforming application from contacting a remote RPC Binding 11876 Service. 11877 11878 Return Value 11879 11880 On success, the pmap_getport() function shall return the port 11881 number in host byte order of the RPC application registered 11882 with the remote portmapper. On failure, if either the program 11883 was not registered or the remote portmapper service could not 11884 be reached, the pmap_getport() function shall return 0. If the 11885 remote portmap service could not be reached, the status is left 11886 in the global variable rpc_createerr. 11887 11888 pmap_set 11889 11890 Name 11891 11892 pmap_set -- establishes mapping to machine's RPC Bind service. 11893 11894 Synopsis 11895 11896 #include 11897 11898 bool_t pmap_set(const u_long program, const u_long version, int 11899 protocol, u_short port); 11900 11901 Description 11902 11903 pmap_set() establishes a mapping between the triple 11904 [program,version,protocol] and port on the machine's RPC Bind 11905 service. The value of protocol is most likely IPPROTO_UDP or 11906 IPPROTO_TCP. Automatically done by svc_register(). 11907 11908 Return Value 11909 11910 pmap_set() returns non-zero if it suceeds, 0 otherwise. 11911 11912 pmap_unset 11913 11914 Name 11915 11916 pmap_unset -- destroys RPC Binding 11917 11918 Synopsis 11919 11920 #include 11921 11922 bool_t pmap_unset(u_long prognum, u_long versnum); 11923 11924 Description 11925 11926 As a user interface to the RPC Bind service, pmap_unset() 11927 destroys all mapping between the triple [prognum,versnum, *] 11928 and ports on the machine's RPC Bind service. 11929 11930 Return Value 11931 11932 pmap_unset() returns non-zero if it succeeds, zero otherwise. 11933 11934 posix_fadvise64 11935 11936 Name 11937 11938 posix_fadvise64 -- File advisory information (Large File 11939 Support) 11940 11941 Synopsis 11942 11943 #include 11944 11945 int posix_fadvise64(int fd, off64_t offset, off64_t len, int 11946 advice); 11947 11948 Description 11949 11950 The posix_fadvise64() function is a large-file version of the 11951 posix_fadvise() function defined in ISO POSIX (2003). It shall 11952 advise the implementation on the expected behavior of the 11953 application with respect to the data in the file associated 11954 with the open file descriptor, fd, starting at offset and 11955 continuing for len bytes. The specified range need not 11956 currently exist in the file. If len is zero, all data following 11957 offset is specified. The implementation may use this 11958 information to optimize handling of the specified data. The 11959 posix_fadvise() function shall have no effect on the semantics 11960 of other operations on the specified data, although it may 11961 affect the performance of other operations. 11962 11963 The advice to be applied to the data is specified by the advice 11964 parameter, as specified in posix_fadvise(). 11965 11966 Return Value 11967 11968 On success, posix_fadvise64() shall return 0. Otherwise an 11969 error number shall be returned to indicate the error. See 11970 posix_fadvise() for possible error values. 11971 11972 posix_fallocate64 11973 11974 Name 11975 11976 posix_fallocate64 -- file space control (Large File Support) 11977 11978 Synopsis 11979 11980 #include 11981 11982 int posix_fallocate64(int fd, off64_t offset, off64_t len); 11983 11984 Description 11985 11986 The posix_fallocate64() function is a large file version of 11987 posix_fallocate(). It shall behave as posix_fallocate() in ISO 11988 POSIX (2003), except that the offset and len arguments are 11989 off64_t objects rather than off_t. 11990 11991 Return Value 11992 11993 See posix_fallocate(). 11994 11995 Errors 11996 11997 See posix_fallocate(). 11998 11999 psignal 12000 12001 Name 12002 12003 psignal -- print signal message 12004 12005 Synopsis 12006 12007 #include 12008 12009 void psignal(int sig, const char * s); 12010 12011 extern const char *const sys_siglist[] 12012 12013 Description 12014 12015 The psignal() function shall display a message on the stderr 12016 stream. If s is not the null pointer, and does not point to an 12017 empty string (e.g. "\0"), the message shall consist of the 12018 string s, a colon, a space, and a string describing the signal 12019 number sig; otherwise psignal() shall display only a message 12020 describing the signal number sig. If sig is invalid, the 12021 message displayed shall indicate an unknown signal. 12022 12023 The array sys_siglist holds the signal description strings 12024 indexed by signal number. 12025 12026 Return Value 12027 12028 psignal() returns no value. 12029 12030 readdir64_r 12031 12032 Name 12033 12034 readdir64_r -- read a directory (Large File Support) 12035 12036 Synopsis 12037 12038 #include 12039 12040 int readdir64_r(DIR * dirp, struct dirent64 * entry, struct 12041 dirent64 * * result); 12042 12043 Description 12044 12045 The readdir64_r() function is a large file version of 12046 readdir_r(). It shall behave as readdir_r() in ISO POSIX 12047 (2003), except that the entry and result arguments are dirent64 12048 structures rather than dirent. 12049 12050 Return Value 12051 12052 See readdir_r(). 12053 12054 Errors 12055 12056 See readdir_r(). 12057 12058 regexec 12059 12060 Name 12061 12062 regexec -- regular expression matching 12063 12064 Description 12065 12066 The regexec() function shall behave as specified in ISO POSIX 12067 (2003), except with differences as listed below. 12068 12069 Differences 12070 12071 Certain aspects of regular expression matching are optional; 12072 see Regular Expressions. 12073 12074 scanf 12075 12076 Name 12077 12078 scanf -- convert formatted input 12079 12080 Description 12081 12082 The scanf() family of functions shall behave as described in 12083 ISO POSIX (2003), except as noted below. 12084 12085 Differences 12086 12087 The %s, %S and %[ conversion specifiers shall accept an option 12088 length modifier a, which shall cause a memory buffer to be 12089 allocated to hold the string converted. In such a case, the 12090 argument corresponding to the conversion specifier should be a 12091 reference to a pointer value that will receive a pointer to the 12092 allocated buffer. If there is insufficient memory to allocate a 12093 buffer, the function may set errno to ENOMEM and a conversion 12094 error results. 12095 12096 Note: This directly conflicts with the ISO C (1999) usage of 12097 %a as a conversion specifier for hexadecimal float values. 12098 While this conversion specifier should be supported, a 12099 format specifier such as "%aseconds" will have a different 12100 meaning on an LSB conforming system. 12101 12102 sched_setscheduler 12103 12104 Name 12105 12106 sched_setscheduler -- set scheduling policy and parameters 12107 12108 Synopsis 12109 12110 #include 12111 12112 int sched_setscheduler(pid_t pid, int policy, const struct 12113 sched_param * param); 12114 12115 Description 12116 12117 The sched_setscheduler() shall behave as described in ISO POSIX 12118 (2003), except as noted below. 12119 12120 Return Value 12121 12122 On success, 0 is returned instead of the former scheduling 12123 policy. 12124 12125 setbuffer 12126 12127 Name 12128 12129 setbuffer -- stream buffering operation 12130 12131 Synopsis 12132 12133 #include 12134 12135 void setbuffer(FILE * stream, char * buf, size_t size); 12136 12137 Description 12138 12139 setbuffer() is an alias for the call to setvbuf(). It works the 12140 same, except that the size of the buffer in setbuffer() is up 12141 to the caller, rather than being determined by the default 12142 BUFSIZ. 12143 12144 setgroups 12145 12146 Name 12147 12148 setgroups -- set list of supplementary group IDs 12149 12150 Synopsis 12151 12152 #include 12153 12154 int setgroups(size_t size, const gid_t * list); 12155 12156 Description 12157 12158 If the process has appropriate privilege, the setgroups() 12159 function shall set the supplementary group IDs for the current 12160 process. list shall reference an array of size group IDs. A 12161 process may have at most NGROUPS_MAX supplementary group IDs. 12162 12163 Return Value 12164 12165 On successful completion, 0 is returned. On error, -1 is 12166 returned and the errno is set to indicate the error. 12167 12168 Errors 12169 12170 EFAULT 12171 12172 list has an invalid address. 12173 EPERM 12174 12175 The process does not have appropriate privileges. 12176 EINVAL 12177 12178 size is greater than NGROUPS_MAX. 12179 12180 sethostname 12181 12182 Name 12183 12184 sethostname -- set host name 12185 12186 Synopsis 12187 12188 #include 12189 #include 12190 #include 12191 12192 int sethostname(const char * name, size_t len); 12193 12194 Description 12195 12196 If the process has appropriate privileges, the sethostname() 12197 function shall change the host name for the current machine. 12198 The name shall point to a null-terminated string of at most len 12199 bytes that holds the new hostname. 12200 12201 If the symbol HOST_NAME_MAX is defined, or if 12202 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 12203 this value shall represent the maximum length of the new 12204 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 12205 value shall represent the maximum length for the new hostname. 12206 If none of these values are defined, the maximum length shall 12207 be the size of the nodename field of the utsname structure. 12208 12209 Return Value 12210 12211 On success, 0 is returned. On error, -1 is returned and the 12212 global variable errno is set appropriately. 12213 12214 Errors 12215 12216 EINVAL 12217 12218 len is negative or larger than the maximum allowed size. 12219 EPERM 12220 12221 the process did not have appropriate privilege. 12222 EFAULT 12223 12224 name is an invalid address. 12225 12226 Rationale 12227 12228 ISO POSIX (2003) guarantees that: 12229 12230 Maximum length of a host name (not including the terminating 12231 null) as returned from the gethostname() function shall be 12232 at least 255 bytes. 12233 12234 The glibc C library does not currently define HOST_NAME_MAX, 12235 and although it provides the name _SC_HOST_NAME_MAX a call to 12236 sysconf() returns -1 and does not alter errno in this case 12237 (indicating that there is no restriction on the hostname 12238 length). However, the glibc manual idicates that some 12239 implementations may have MAXHOSTNAMELEN as a means of detecting 12240 the maximum length, while the Linux kernel at release 2.4 and 12241 2.6 stores this hostname in the utsname structure. While the 12242 glibc manual suggests simply shortening the name until 12243 sethostname() succeeds, the LSB requires that one of the first 12244 four mechanisms works. Future versions of glibc may provide a 12245 more reasonable result from sysconf(_SC_HOST_NAME_MAX). 12246 12247 setsockopt 12248 12249 Name 12250 12251 setsockopt -- set socket options 12252 12253 Synopsis 12254 12255 #include 12256 #include 12257 12258 int setsockopt(int socket, int level, int option_name, const 12259 void * option_value, socklen_t option_len); 12260 12261 Description 12262 12263 The setsockopt() function shall behave as specified in ISO 12264 POSIX (2003), with the following extensions. 12265 12266 IP Protocol Level Options 12267 12268 If the level parameter is IPPROTO_IP, the following values 12269 shall be supported for option_name (see RFC 791:Internet 12270 Protocol for further details): 12271 12272 IP_OPTIONS 12273 12274 Set the Internet Protocol options sent with every packet from 12275 this socket. The option_value shall point to a memory buffer 12276 containing the options and option_len shall contain the size in 12277 bytes of that buffer. For IPv4, the maximum length of options 12278 is 40 bytes. 12279 IP_TOS 12280 12281 Set the Type of Service flags to use when sending packets with 12282 this socket. The option_value shall point to a value containing 12283 the type of service value. The least significant two bits of 12284 the value shall contain the new Type of Service indicator. Use 12285 of other bits in the value is unspecified. The option_len 12286 parameter shall hold the size, in bytes, of the buffer referred 12287 to by option_value. 12288 IP_TTL 12289 12290 Set the current unicast Internet Protocol Time To Live value 12291 used when sending packets with this socket. The option_value 12292 shall point to a value containing the time to live value, which 12293 shall be between 1 and 255. The option_len parameter shall hold 12294 the size, in bytes, of the buffer referred to by option_value. 12295 IP_MULTICAST_TTL 12296 12297 Sets the Time To Live value of outgoing multicast packets for 12298 this socket. optval shall point to an integer which contains 12299 the new TTL value. If the new TTL value is -1, the 12300 implementation should use an unspecified default TTL value. If 12301 the new TTL value is out of the range of acceptable values 12302 (0-255), setsockopt() shall return -1 and set errno to indicate 12303 the error. 12304 IP_MULTICAST_LOOP 12305 12306 Sets a boolean flag indicating whether multicast packets 12307 originating locally should be looped back to the local sockets. 12308 optval shall point to an integer which contains the new flag 12309 value. 12310 IP_ADD_MEMBERSHIP 12311 12312 Join a multicast group. optval shall point to a ip_mreq 12313 structure. Before calling, the caller should fill in the 12314 imr_multiaddr field with the multicast group address and the 12315 imr_address field with the address of the local interface. If 12316 imr_address is set to INADDR_ANY, then an appropriate interface 12317 is chosen by the system. 12318 IP_DROP_MEMBERSHIP 12319 12320 Leave a multicast group. optval shall point to a ip_mreq 12321 structure containing the same values as were used with 12322 IP_ADD_MEMBERSHIP. 12323 IP_MULTICAST_IF 12324 12325 Set the local device for a multicast socket. optval shall point 12326 to a ip_mreq structure initialized in the same manner as with 12327 IP_ADD_MEMBERSHIP. 12328 12329 The ip_mreq structure contains two struct in_addr fields: 12330 imr_multiaddr and imr_address. 12331 12332 Return Value 12333 12334 On success, 0 is returned. On error, -1 is returned and the 12335 global variable errno is set appropriately. 12336 12337 Errors 12338 12339 As defined in ISO POSIX (2003). 12340 12341 setutent 12342 12343 Name 12344 12345 setutent -- access user accounting database entries 12346 12347 Synopsis 12348 12349 #include 12350 12351 void setutent(void); 12352 12353 Description 12354 12355 The setutent() function shall reset the user accounting 12356 database such that the next call to getutent() shall return the 12357 first record in the database. It is recommended to call it 12358 before any of the other functions that operate on the user 12359 accounting databases (e.g. getutent()) 12360 12361 Return Value 12362 12363 None. 12364 12365 sigandset 12366 12367 Name 12368 12369 sigandset -- build a new signal set by combining the two input 12370 sets using logical AND 12371 12372 Synopsis 12373 12374 #include 12375 12376 int sigandset(sigset_t * set, const sigset_t * left, const 12377 sigset_t * right); 12378 12379 Description 12380 12381 The sigandset() function shall combine the two signal sets 12382 referenced by left and right, using a logical AND operation, 12383 and shall place the result in the location referenced by set, 12384 The resulting signal set shall contain only signals that are in 12385 both the set referenced by left and the set referenced by 12386 right. 12387 12388 Applications shall call sigemptyset() or sigfillset() at least 12389 once for each object of type sigset_t to initialize it. If an 12390 uninitialized or NULL object is passed to sigandset(), the 12391 results are undefined. 12392 12393 Return Value 12394 12395 sigandset() returns 0. There are no defined error returns. 12396 12397 See Also 12398 12399 sigorset() 12400 12401 sigisemptyset 12402 12403 Name 12404 12405 sigisemptyset -- check for empty signal set 12406 12407 Synopsis 12408 12409 #include 12410 12411 int sigisemptyset(const sigset_t * set); 12412 12413 Description 12414 12415 The sigisemptyset() function shall check for empty signal set 12416 referenced by set. 12417 12418 Applications shall call sigemptyset() or sigfillset() at least 12419 once for each object of type sigset_t to initialize it. If an 12420 uninitialized or NULL object is passed to sigisemptyset(), the 12421 results are undefined. 12422 12423 Return Value 12424 12425 The sigisemptyset() function shall return a positive non-zero 12426 value if the signal set referenced by set is empty, or zero if 12427 this set is empty. There are no defined error returns. 12428 12429 sigorset 12430 12431 Name 12432 12433 sigorset -- build a new signal set by combining the two input 12434 sets using logical OR 12435 12436 Synopsis 12437 12438 #include 12439 12440 int sigorset(sigset_t * set, const sigset_t * left, const 12441 sigset_t * right); 12442 12443 Description 12444 12445 The sigorset() function shall combine the two signal sets 12446 referenced by left and right, using a logical OR operation, and 12447 shall place the result in the location referenced by set, The 12448 resulting signal set shall contain only signals that are in 12449 either the set referenced by left or the set referenced by 12450 right. 12451 12452 Applications shall call sigemptyset() or sigfillset() at least 12453 once for each object of type sigset_t to initialize it. If an 12454 uninitialized or NULL object is passed to sigorset(), the 12455 results are undefined. 12456 12457 Return Value 12458 12459 sigorset() returns 0. There are no defined error returns. 12460 12461 See Also 12462 12463 sigandset() 12464 12465 sigpause 12466 12467 Name 12468 12469 sigpause -- remove a signal from the signal mask and suspend 12470 the thread (deprecated) 12471 12472 Synopsis 12473 12474 #include 12475 12476 int sigpause(int sig); 12477 12478 Description 12479 12480 The sigpause() function is deprecated from the LSB and is 12481 expected to disappear from a future version of the LSB. 12482 Conforming applications should use sigsuspend() instead. 12483 12484 In the source standard, sigpause() is implemented as a macro 12485 causing it to behave as described in ISO POSIX (2003), and is 12486 equivalent to the function __xpg_sigpause(). If the macro is 12487 undefined, sigpause() from the binary standard is used, with 12488 differences as described here: 12489 12490 The sigpause() function shall block those signals indicated by 12491 sig and suspend execution of the thread until a signal is 12492 delivered. When a signal is delivered, the original signal mask 12493 shall be restored. 12494 12495 See Also 12496 12497 __xpg_sigpause() 12498 12499 sigreturn 12500 12501 Name 12502 12503 sigreturn -- return from signal handler and cleanup stack frame 12504 12505 Synopsis 12506 12507 int sigreturn(struct sigcontext * scp); 12508 12509 Description 12510 12511 The sigreturn() function is used by the system to cleanup after 12512 a signal handler has returned. This function is not in the 12513 source standard; it is only in the binary standard. 12514 12515 Return Value 12516 12517 sigreturn() never returns. 12518 12519 sscanf 12520 12521 Name 12522 12523 sscanf -- convert formatted input 12524 12525 Description 12526 12527 The scanf() family of functions shall behave as described in 12528 ISO POSIX (2003), except as noted below. 12529 12530 Differences 12531 12532 The %s, %S and %[ conversion specifiers shall accept an option 12533 length modifier a, which shall cause a memory buffer to be 12534 allocated to hold the string converted. In such a case, the 12535 argument corresponding to the conversion specifier should be a 12536 reference to a pointer value that will receive a pointer to the 12537 allocated buffer. If there is insufficient memory to allocate a 12538 buffer, the function may set errno to ENOMEM and a conversion 12539 error results. 12540 12541 Note: This directly conflicts with the ISO C (1999) usage of 12542 %a as a conversion specifier for hexadecimal float values. 12543 While this conversion specifier should be supported, a 12544 format specifier such as "%aseconds" will have a different 12545 meaning on an LSB conforming system. 12546 12547 statfs 12548 12549 Name 12550 12551 statfs -- (deprecated) 12552 12553 Synopsis 12554 12555 #include 12556 12557 int statfs(const char *path, (struct statfs * buf)); 12558 12559 Description 12560 12561 The statfs() function returns information about a mounted file 12562 system. The file system is identified by path, a path name of a 12563 file within the mounted filesystem. The results are placed in 12564 the structure pointed to by 12565 12566 Fields that are undefined for a particular file system shall be 12567 set to 0. 12568 12569 Note: Application developers should use the statvfs() 12570 function to obtain general file system information. 12571 Applications should only use the statfs() function if they 12572 must determine the file system type, which need not be 12573 provided by statvfs(). 12574 12575 Return Value 12576 12577 On success, the statfs() function shall return 0 and set the 12578 fields of the structure idenfitied by buf accordingly. On 12579 error, the statfs() function shall return -1 and set errno 12580 accordingly. 12581 12582 Errors 12583 12584 ENOTDIR 12585 12586 A component of the path prefix of path is not a directory. 12587 ENAMETOOLONG 12588 12589 path is too long. 12590 ENOENT 12591 12592 The file referred to by path does not exist. 12593 EACCES 12594 12595 Search permission is denied for a component of the path prefix 12596 of path. 12597 ELOOP 12598 12599 Too many symbolic links were encountered in translating path. 12600 EFAULT 12601 12602 buf or path points to an invalid address. 12603 EIO 12604 12605 An I/O error occurred while reading from or writing to the file 12606 system. 12607 ENOMEM 12608 12609 Insufficient kernel memory was available. 12610 ENOSYS 12611 12612 The filesystem path is on does not support statfs(). 12613 12614 statfs64 12615 12616 Name 12617 12618 statfs64 -- (deprecated) 12619 12620 Synopsis 12621 12622 #include 12623 12624 int statfs64(const char * path, (struct statfs64 * buf)); 12625 12626 Description 12627 12628 The statfs64() function returns information about a mounted 12629 file system. The file system is identified by path, a path name 12630 of a file within the mounted filesystem. The results are placed 12631 in the structure pointed to by buf. 12632 12633 statfs64() is the 64-bit version of statfs(). 12634 12635 Fields that are undefined for a particular file system shall be 12636 set to 0. 12637 12638 Note: Application developers should use the statvfs64() 12639 function to obtain general file system information. 12640 Applications should only use the statfs64() function if they 12641 must determine the file system type, which need not be 12642 provided by statvfs64(). 12643 12644 Return Value 12645 12646 On success, the statfs64() function shall return 0 and set the 12647 fields of the structure idenfitied by buf accordingly. On 12648 error, the statfs64() function shall return -1 and set errno 12649 accordingly. 12650 12651 Errors 12652 12653 See fstatfs(). 12654 12655 stime 12656 12657 Name 12658 12659 stime -- set time 12660 12661 Synopsis 12662 12663 #define _SVID_SOURCE 12664 #include 12665 12666 int stime(const time_t * t); 12667 12668 Description 12669 12670 If the process has appropriate privilege, the stime() function 12671 shall set the system's idea of the time and date. Time, 12672 referenced by t, is measured in seconds from the epoch (defined 12673 in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 12674 12675 Return Value 12676 12677 On success, stime() shall return 0. Otherwise, stime() shall 12678 return -1 and errno shall be set to indicate the error. 12679 12680 Errors 12681 12682 EPERM 12683 12684 The process does not have appropriate privilege. 12685 EINVAL 12686 12687 t is a null pointer. 12688 12689 stpcpy 12690 12691 Name 12692 12693 stpcpy -- copy a string returning a pointer to its end 12694 12695 Synopsis 12696 12697 #include 12698 12699 char * stpcpy(char * restrict dest, const char * restrict src); 12700 12701 Description 12702 12703 The stpcpy() function shall copy the string pointed to by src 12704 (including the terminating null character) to the array pointed 12705 to by dest. The strings may not overlap, and the destination 12706 string dest shall be large enough to receive the copy. 12707 12708 Return Value 12709 12710 stpcpy() returns a pointer to the end of the string dest (that 12711 is, the address of the terminating null character) rather than 12712 the beginning. 12713 12714 Example 12715 12716 This program uses stpcpy() to concatenate foo and bar to 12717 produce foobar, which it then prints. 12718 #include 12719 12720 int 12721 main (void) 12722 { 12723 char buffer[256]; 12724 char *to = buffer; 12725 to = stpcpy (to, "foo"); 12726 to = stpcpy (to, "bar"); 12727 printf ("%s\n", buffer); 12728 } 12729 12730 stpncpy 12731 12732 Name 12733 12734 stpncpy -- copy a fixed-size string, returning a pointer to its 12735 end 12736 12737 Synopsis 12738 12739 #include 12740 12741 char * stpncpy(char * restrict dest, const char * restrict src, 12742 size_t n); 12743 12744 Description 12745 12746 The stpncpy() function shall copy at most n characters from the 12747 string pointed to by src, including the terminating null 12748 character, to the array pointed to by dest. Exactly n 12749 characters are written at dest. If the length strlen()(src) is 12750 smaller than n, the remaining characters in dest are filled 12751 with '\0' characters. If the length strlen(src) is greater than 12752 or equal to n, dest will not be null terminated. 12753 12754 The strings may not overlap. 12755 12756 The programmer shall ensure that there is room for at least n 12757 characters at dest. 12758 12759 Return Value 12760 12761 The stpncpy() function shall return a pointer to the 12762 terminating NULL in dest, or, if dest is not NULL-terminated, 12763 dest + n. 12764 12765 strcasestr 12766 12767 Name 12768 12769 strcasestr -- locate a substring ignoring case 12770 12771 Synopsis 12772 12773 #include 12774 12775 char * strcasestr(const char * s1, const char * s2); 12776 12777 Description 12778 12779 The strcasestr() shall behave as strstr(), except that it shall 12780 ignore the case of both strings. The strcasestr() function 12781 shall be locale aware; that is strcasestr() shall behave as if 12782 both strings had been converted to lower case in the current 12783 locale before the comparison is performed. 12784 12785 Return Value 12786 12787 Upon successful completion, strcasestr() shall return a pointer 12788 to the located string or a null pointer if the string is not 12789 found. If s2 points to a string with zero length, the function 12790 shall return s1. 12791 12792 strerror_r 12793 12794 Name 12795 12796 strerror_r -- return string describing error number 12797 12798 Synopsis 12799 12800 #include 12801 12802 char * strerror_r(int errnum, char * buf, size_t buflen); 12803 12804 Description 12805 12806 In the source standard, strerror_r() is implemented as a macro 12807 causing it to behave as described in ISO POSIX (2003), and is 12808 equivalent to the function __xpg_strerror_r(). If the macro is 12809 undefined, strerror_r() from the binary standard is used, with 12810 differences as described here. 12811 12812 The strerror_r() function shall return a pointer to the string 12813 corresponding to errno. The returned pointer may point within 12814 the buffer buf (at most buflen bytes). 12815 12816 Return Value 12817 12818 On success, strerror_r() shall return a pointer to the 12819 generated message string (determined by the setting of the 12820 LC_MESSAGES category in the current locale). Otherwise, 12821 strerror_r() shall return the string corresponding to "Unknown 12822 error". 12823 12824 See Also 12825 12826 __xpg_strerror_r() 12827 12828 strndup 12829 12830 Name 12831 12832 strndup -- return a malloc'd copy of at most the specified 12833 number of bytes of a string 12834 12835 Synopsis 12836 12837 #include 12838 12839 char * strndup(const char * string, size_t n); 12840 12841 Description 12842 12843 The strndup() function shall return a malloc()'d copy of at 12844 most n bytes of string. The resultant string shall be 12845 terminated even if no NULL terminator appears before string+n. 12846 12847 Return Value 12848 12849 On success, strndup() shall return a pointer to a newly 12850 allocated block of memory containing a copy of at most n bytes 12851 of string. Otherwise, strndup() shall return NULL and set errno 12852 to indicate the error. 12853 12854 Errors 12855 12856 ENOMEM 12857 12858 Insufficient memory available. 12859 12860 strnlen 12861 12862 Name 12863 12864 strnlen -- determine the length of a fixed-size string 12865 12866 Synopsis 12867 12868 #include 12869 12870 size_t strnlen(const char * s, size_t maxlen); 12871 12872 Description 12873 12874 The strnlen() function shall compute the number of bytes in the 12875 array to which s points, stopping at maxlen bytes. A null byte 12876 and any bytes following it are not counted. 12877 12878 Return Value 12879 12880 The strnlen() function shall return the length of s if that is 12881 less than maxlen, or maxlen if there is no null byte in the 12882 first maxlen bytes. 12883 12884 Errors 12885 12886 No errors are defined. 12887 12888 strptime 12889 12890 Name 12891 12892 strptime -- parse a time string 12893 12894 Description 12895 12896 The strptime() shall behave as specified in the ISO POSIX 12897 (2003) with differences as listed below. 12898 12899 Number of leading zeroes may be limited 12900 12901 The ISO POSIX (2003) specifies fields for which "leading zeros 12902 are permitted but not required"; however, applications shall 12903 not expect to be able to supply more leading zeroes for these 12904 fields than would be implied by the range of the field. 12905 Implementations may choose to either match an input with excess 12906 leading zeroes, or treat this as a non-matching input. For 12907 example, %j has a range of 001 to 366, so 0, 00, 000, 001, and 12908 045 are acceptable inputs, but inputs such as 0000, 0366 and 12909 the like are not. 12910 12911 Rationale 12912 12913 glibc developers consider it appropriate behavior to forbid 12914 excess leading zeroes. When trying to parse a given input 12915 against several format strings, forbidding excess leading 12916 zeroes could be helpful. For example, if one matches 0011-12-26 12917 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for 12918 the first match to fail, as it would be perverse to parse that 12919 date as November 12, year 26. The second pattern parses it as 12920 December 26, year 11. 12921 12922 The ISO POSIX (2003) is not explicit that an unlimited number 12923 of leading zeroes are required, although it may imply this. The 12924 LSB explicitly allows implementations to have either behavior. 12925 Future versions of this standard may require implementations to 12926 forbid excess leading zeroes. 12927 12928 An Interpretation Request is currently pending against ISO 12929 POSIX (2003) for this matter. 12930 12931 strsep 12932 12933 Name 12934 12935 strsep -- extract token from string 12936 12937 Synopsis 12938 12939 #include 12940 12941 char * strsep(char * * stringp, const char * delim); 12942 12943 Description 12944 12945 The strsep() function shall find the first token in the string 12946 referenced by the pointer stringp, using the characters in 12947 delim as delimiters. 12948 12949 If stringp is NULL, strsep() shall return NULL and do nothing 12950 else. 12951 12952 If stringp is non-NULL, strsep() shall find the first token in 12953 the string referenced by stringp, where tokens are delimited by 12954 characters in the string delim. This token shall be terminated 12955 with a \0 character by overwriting the delimiter, and stringp 12956 shall be updated to point past the token. In case no delimiter 12957 was found, the token is taken to be the entire string 12958 referenced by stringp, and the location referenced by stringp 12959 is made NULL. 12960 12961 Return Value 12962 12963 strsep() shall return a pointer to the beginning of the token. 12964 12965 Notes 12966 12967 The strsep() function was introduced as a replacement for 12968 strtok(), since the latter cannot handle empty fields. However, 12969 strtok() conforms to ISO C (1999) and to ISO POSIX (2003) and 12970 hence is more portable. 12971 12972 See Also 12973 12974 strtok(), strtok_r(). 12975 12976 strsignal 12977 12978 Name 12979 12980 strsignal -- return string describing signal 12981 12982 Synopsis 12983 12984 #define _GNU_SOURCE 12985 #include 12986 12987 char * strsignal(int sig); 12988 12989 extern const char * const sys_siglist[]; 12990 12991 Description 12992 12993 The strsignal() function shall return a pointer to a string 12994 describing the signal number sig. The string can only be used 12995 until the next call to strsignal(). 12996 12997 The array sys_siglist holds the signal description strings 12998 indexed by signal number. This array should not be accessed 12999 directly by applications. 13000 13001 Return Value 13002 13003 If sig is a valid signal number, strsignal() shall return a 13004 pointer to the appropriate description string. Otherwise, 13005 strsignal() shall return either a pointer to the string 13006 "unknown signal", or a null pointer. 13007 13008 Although the function is not declared as returning a pointer to 13009 a constant character string, applications shall not modify the 13010 returned string. 13011 13012 strtoq 13013 13014 Name 13015 13016 strtoq -- convert string value to a long or quad_t integer 13017 13018 Synopsis 13019 13020 #include 13021 #include 13022 #include 13023 13024 long long strtoq(const char * nptr, char * * endptr, int base); 13025 13026 Description 13027 13028 strtoq() converts the string nptr to a quadt value. The 13029 conversion is done according to the given base, which shall be 13030 between 2 and 36 inclusive, or be the special value 0. 13031 13032 nptr may begin with an arbitrary amount of white space (as 13033 determined by isspace()), followed by a single optional + or - 13034 sign character. If base is 0 or 16, the string may then include 13035 a 0x prefix, and the number will be read in base 16; otherwise, 13036 a 0 base is taken as 10 (decimal), unless the next character is 13037 0, in which case it is taken as 8 (octal). 13038 13039 The remainder of the string is converted to a long value in the 13040 obvious manner, stopping at the first character which is not a 13041 valid digit in the given base. (In bases above 10, the letter A 13042 in either upper or lower case represents 10, B represents 11, 13043 and so forth, with Z representing 35.) 13044 13045 Return Value 13046 13047 strtoq() returns the result of the conversion, unless the value 13048 would underflow or overflow. If an underflow occurs, strtoq() 13049 returns QUAD_MIN. If an overflow occurs, strtoq() returns 13050 QUAD_MAX. In both cases, the global variable errno is set to 13051 ERANGE. 13052 13053 Errors 13054 13055 ERANGE 13056 13057 The given string was out of range; the value converted has been 13058 clamped. 13059 13060 strtouq 13061 13062 Name 13063 13064 strtouq -- convert a string to an unsigned long long 13065 13066 Synopsis 13067 13068 #include 13069 #include 13070 #include 13071 13072 unsigned long long strtouq(const char * nptr, char * * endptr, 13073 int base); 13074 13075 Description 13076 13077 strtouq() converts the string nptr to an unsigned long long 13078 value. The conversion is done according to the given base, 13079 which shall be between 2 and 36 inclusive, or be the special 13080 value 0. 13081 13082 nptr may begin with an arbitrary amount of white space (as 13083 determined by isspace()), followed by a single optional + or - 13084 sign character. If base is 0 or 16, the string may then include 13085 a 0x prefix, and the number will be read in base 16; otherwise, 13086 a 0 base is taken as 10 (decimal), unless the next character is 13087 0, in which case it is taken as 8 (octal). 13088 13089 The remainder of the string is converted to an unsigned long 13090 value in the obvious manner, stopping at the end of the string 13091 or at the first character that does not produce a valid digit 13092 in the given base. (In bases above 10, the letter A in either 13093 upper or lower case represents 10, B represents 11, and so 13094 forth, with Z representing 35.) 13095 13096 Return Value 13097 13098 On success, strtouq() returns either the result of the 13099 conversion or, if there was a leading minus sign, the negation 13100 of the result of the conversion, unless the original 13101 (non-negated) value would overflow. In the case of an overflow 13102 the function returns UQUAD_MAX and the global variable errno is 13103 set to ERANGE. 13104 13105 Errors 13106 13107 ERANGE 13108 13109 The given string was out of range; the value converted has been 13110 clamped. 13111 13112 svc_register 13113 13114 Name 13115 13116 svc_register -- register Remote Procedure Call interface 13117 13118 Synopsis 13119 13120 #include 13121 13122 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 13123 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 13124 protocol); 13125 13126 Description 13127 13128 The svc_register() function shall associate the program 13129 identified by prognum at version versnum with the service 13130 dispatch procedure, dispatch. If protocol is zero, the service 13131 is not registered with the portmap service. If protocol is 13132 non-zero, then a mapping of the triple [prognum, versnum, 13133 protocol] to xprt->xp_port is established with the local 13134 portmap service. The procedure dispatch has the following form: 13135 13136 int dispatch(struct svc_req * request, SVCXPRT * xprt); 13137 13138 Return Value 13139 13140 svc_register() returns 1 if it succeeds, and zero otherwise. 13141 13142 svc_run 13143 13144 Name 13145 13146 svc_run -- waits for RPC requests to arrive and calls service 13147 procedure 13148 13149 Synopsis 13150 13151 #include 13152 13153 void svc_run(void); 13154 13155 Description 13156 13157 The svc_run() function shall wait for RPC requests to arrive, 13158 read and unpack each request, and dispatch it to the 13159 appropriate registered handler. Under normal conditions, 13160 svc_run() shall not return; it shall only return if serious 13161 errors occur that prevent further processing. 13162 13163 svc_sendreply 13164 13165 Name 13166 13167 svc_sendreply -- called by RPC service's dispatch routine 13168 13169 Synopsis 13170 13171 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 13172 out); 13173 13174 Description 13175 13176 Called by an RPC service's dispatch routine to send the results 13177 of a remote procedure call. The parameter xprt is the request's 13178 associated transport handle; outproc is the XDR routine which 13179 is used to encode the results; and out is the address of the 13180 results. This routine returns one if it succeeds, zero 13181 otherwise. 13182 13183 svctcp_create 13184 13185 Name 13186 13187 svctcp_create -- create a TCP/IP-based RPC service transport 13188 13189 Synopsis 13190 13191 #include 13192 13193 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 13194 recv_buf_size); 13195 13196 Description 13197 13198 svctcp_create() creates a TCP/IP-based RPC service transport, 13199 to which it returns a pointer. The transport is associated with 13200 the socket sock, which may be RPC_ANYSOCK, in which case a new 13201 socket is created. If the socket is not bound to a local TCP 13202 port, then this routine binds it to an arbitrary port. Upon 13203 completion, xprt->xp_sock is the transport's socket descriptor, 13204 and xprt->xp_port is the transport's port number. Since 13205 TCP-based RPC uses buffered I/O, users may specify the size of 13206 buffers; values of zero choose suitable defaults. 13207 13208 Return Value 13209 13210 svctcp_create() returns NULL if it fails, or a pointer to the 13211 RPC service transport otherwise. 13212 13213 svcudp_create 13214 13215 Name 13216 13217 svcudp_create -- create a UDP-based RPC service transport 13218 13219 Synopsis 13220 13221 SVCXPRT * 13222 13223 svcudp_create(int sock); 13224 13225 Description 13226 13227 The svcudp_create() function shall create a UDP/IP-based RPC 13228 service transport, and return a pointer to its descriptor. The 13229 transport is associated with the socket sock, which may be 13230 RPC_ANYSOCK, in which case a new socket shall be created. If 13231 the socket is not bound to a local UDP port, then 13232 svcudp_create() shall bind it to an arbitrary port. 13233 13234 If svcudp_create() returns successfully, then the xp_sock field 13235 in the result shall be the transport's socket descriptor, and 13236 the xp_port field shall be the transport's port number. 13237 13238 Return Value 13239 13240 Upon successful completion, svcudp_create() shall return a 13241 pointer to a RPC service transport; otherwise, a null pointer 13242 shall be returned. 13243 13244 swscanf 13245 13246 Name 13247 13248 swscanf -- convert formatted input 13249 13250 Description 13251 13252 The scanf() family of functions shall behave as described in 13253 ISO POSIX (2003), except as noted below. 13254 13255 Differences 13256 13257 The %s, %S and %[ conversion specifiers shall accept an option 13258 length modifier a, which shall cause a memory buffer to be 13259 allocated to hold the string converted. In such a case, the 13260 argument corresponding to the conversion specifier should be a 13261 reference to a pointer value that will receive a pointer to the 13262 allocated buffer. If there is insufficient memory to allocate a 13263 buffer, the function may set errno to ENOMEM and a conversion 13264 error results. 13265 13266 Note: This directly conflicts with the ISO C (1999) usage of 13267 %a as a conversion specifier for hexadecimal float values. 13268 While this conversion specifier should be supported, a 13269 format specifier such as "%aseconds" will have a different 13270 meaning on an LSB conforming system. 13271 13272 sysconf 13273 13274 Name 13275 13276 sysconf -- Get configuration information at runtime 13277 13278 Synopsis 13279 13280 #include 13281 13282 long sysconf(int name); 13283 13284 DESCRIPTION 13285 13286 sysconf() is as specified in ISO POSIX (2003), but with 13287 differences as listed below. 13288 13289 Extra Variables 13290 13291 These additional values extend the list in ISO POSIX (2003). 13292 13293 - _SC_PHYS_PAGES 13294 The number of pages of physical memory. 13295 13296 - _SC_AVPHYS_PAGES 13297 The number of currently available pages of physical 13298 memory. 13299 13300 - _SC_NPROCESSORS_CONF 13301 The number of processors configured. 13302 13303 - _SC_NPROCESSORS_ONLN 13304 The number of processors currently online (available). 13305 13306 system 13307 13308 Name 13309 13310 system -- execute a shell command 13311 13312 Synopsis 13313 13314 #include 13315 13316 int system(const char * string); 13317 13318 Description 13319 13320 The system() function shall behave as described in ISO POSIX 13321 (2003). 13322 13323 Notes 13324 13325 The fact that system() ignores interrupts is often not what a 13326 program wants. ISO POSIX (2003) describes some of the 13327 consequences; an additional consequence is that a program 13328 calling system() from a loop cannot be reliably interrupted. 13329 Many programs will want to use the exec() family of functions 13330 instead. 13331 13332 Do not use system() from a program with suid or sgid 13333 privileges, because unexpected values for some environment 13334 variables might be used to subvert system integrity. Use the 13335 exec() family of functions instead, but not execlp() or 13336 execvp(). system() will not, in fact, work properly from 13337 programs with suid or sgid privileges on systems on which 13338 /bin/sh is bash version 2, since bash 2 drops privileges on 13339 startup. (Debian uses a modified bash which does not do this 13340 when invoked as sh.) 13341 13342 The check for the availability of /bin/sh is not actually 13343 performed; it is always assumed to be available. ISO C (1999) 13344 specifies the check, but ISO POSIX (2003) specifies that the 13345 return shall always be nonzero, since a system without the 13346 shell is not conforming, and it is this that is implemented. 13347 13348 It is possible for the shell command to return 127, so that 13349 code is not a sure indication that the execve() call failed; 13350 check the global variable errno to make sure. 13351 13352 textdomain 13353 13354 Name 13355 13356 textdomain -- set the current default message domain 13357 13358 Synopsis 13359 13360 #include 13361 13362 char * textdomain(const char * domainname); 13363 13364 Description 13365 13366 The textdomain() function shall set the current default message 13367 domain to domainname. Subsequent calls to gettext() and 13368 ngettext() use the default message domain. 13369 13370 If domainname is NULL, the default message domain shall not be 13371 altered. 13372 13373 If domainname is "", textdomain() shall reset the default 13374 domain to the system default of "messages". 13375 13376 Return 13377 13378 On success, textdomain() shall return the currently selected 13379 domain. Otherwise, a null pointer shall be returned, and errno 13380 is set to indicate the error. 13381 13382 Errors 13383 13384 ENOMEM 13385 13386 Insufficent memory available. 13387 13388 unlink 13389 13390 Name 13391 13392 unlink -- remove a directory entry 13393 13394 Synopsis 13395 13396 int unlink(const char * path); 13397 13398 Description 13399 13400 unlink() is as specified in ISO POSIX (2003), but with 13401 differences as listed below. 13402 13403 See also Section 18.1, Additional behaviors: unlink/link on 13404 directory. 13405 13406 May return EISDIR on directories 13407 13408 If path specifies a directory, the implementation may return 13409 EISDIR instead of EPERM as specified by ISO POSIX (2003). 13410 13411 Rationale: The Linux kernel has deliberately chosen EISDIR 13412 for this case and does not expect to change. 13413 13414 uselocale 13415 13416 Name 13417 13418 uselocale -- set locale for thread 13419 13420 Synopsis 13421 13422 #include 13423 13424 locale_t uselocale(locale_t newloc); 13425 13426 Description 13427 13428 The uselocale() function shall set the locale for the calling 13429 thread to the locale specified by newloc. 13430 13431 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 13432 shall be set to the process current global locale, as set by 13433 setlocale(). If newloc is NULL, the thread's locale is not 13434 altered. 13435 13436 Return Value 13437 13438 The uselocale() function shall return the previous locale, or 13439 LC_GLOBAL_LOCALE if the thread local locale has not been 13440 previously set. 13441 13442 Errors 13443 13444 None defined. 13445 13446 See Also 13447 13448 setlocale(), freelocale(), duplocale(), newlocale() 13449 13450 utmpname 13451 13452 Name 13453 13454 utmpname -- set user accounting database 13455 13456 Synopsis 13457 13458 #include 13459 13460 int utmpname(const char * dbname); 13461 13462 Description 13463 13464 The utmpname() function shall cause the user accounting 13465 database used by the getutent(), getutent_r(), getutxent(), 13466 getutxid(), getutxline(), and pututxline() functions to be that 13467 named by dbname, instead of the system default database. See 13468 Section 16.3 for further information. 13469 13470 Note: The LSB does not specify the format of the user 13471 accounting database, nor the names of the file or files that 13472 may contain it. 13473 13474 Return Value 13475 13476 None. 13477 13478 Errors 13479 13480 None defined. 13481 13482 vasprintf 13483 13484 Name 13485 13486 vasprintf -- write formatted output to a dynamically allocated 13487 string 13488 13489 Synopsis 13490 13491 #include 13492 #include 13493 13494 int vasprintf(char * * restrict ptr, const char * restrict 13495 format, va_list arg); 13496 13497 Description 13498 13499 The vasprintf() function shall write formatted output to a 13500 dynamically allocated string, and store the address of that 13501 string in the location referenced by ptr. It shall behave as 13502 asprintf(), except that instead of being called with a variable 13503 number of arguments, it is called with an argument list as 13504 defined by . 13505 13506 Return Value 13507 13508 Refer to fprintf(). 13509 13510 Errors 13511 13512 Refer to fprintf(). 13513 13514 vdprintf 13515 13516 Name 13517 13518 vdprintf -- write formatted output to a file descriptor 13519 13520 Synopsis 13521 13522 #include 13523 13524 int vdprintf(int fd, const char * restrict format, va_list 13525 arg); 13526 13527 Description 13528 13529 The vdprintf() function shall behave as vfprintf(), except that 13530 vdprintf() shall write output to the file associated with the 13531 file descriptor specified by the fd argument, rather than place 13532 output on a stream (as defined by ISO POSIX (2003)). 13533 13534 Return Value 13535 13536 Refer to fprintf(). 13537 13538 Errors 13539 13540 Refer to fprintf(). 13541 13542 verrx 13543 13544 Name 13545 13546 verrx -- display formatted error message and exit 13547 13548 Synopsis 13549 13550 #include 13551 #include 13552 13553 void verrx(int eval, const char * fmt, va_list args); 13554 13555 Description 13556 13557 The verrx() shall behave as errx() except that instead of being 13558 called with a variable number of arguments, it is called with 13559 an argument list as defined by . 13560 13561 verrx() does not return, but exits with the value of eval. 13562 13563 Return Value 13564 13565 None. 13566 13567 Errors 13568 13569 None. 13570 13571 vfscanf 13572 13573 Name 13574 13575 vfscanf -- convert formatted input 13576 13577 Description 13578 13579 The scanf() family of functions shall behave as described in 13580 ISO POSIX (2003), except as noted below. 13581 13582 Differences 13583 13584 The %s, %S and %[ conversion specifiers shall accept an option 13585 length modifier a, which shall cause a memory buffer to be 13586 allocated to hold the string converted. In such a case, the 13587 argument corresponding to the conversion specifier should be a 13588 reference to a pointer value that will receive a pointer to the 13589 allocated buffer. If there is insufficient memory to allocate a 13590 buffer, the function may set errno to ENOMEM and a conversion 13591 error results. 13592 13593 Note: This directly conflicts with the ISO C (1999) usage of 13594 %a as a conversion specifier for hexadecimal float values. 13595 While this conversion specifier should be supported, a 13596 format specifier such as "%aseconds" will have a different 13597 meaning on an LSB conforming system. 13598 13599 vfwscanf 13600 13601 Name 13602 13603 vfwscanf -- convert formatted input 13604 13605 Description 13606 13607 The scanf() family of functions shall behave as described in 13608 ISO POSIX (2003), except as noted below. 13609 13610 Differences 13611 13612 The %s, %S and %[ conversion specifiers shall accept an option 13613 length modifier a, which shall cause a memory buffer to be 13614 allocated to hold the string converted. In such a case, the 13615 argument corresponding to the conversion specifier should be a 13616 reference to a pointer value that will receive a pointer to the 13617 allocated buffer. If there is insufficient memory to allocate a 13618 buffer, the function may set errno to ENOMEM and a conversion 13619 error results. 13620 13621 Note: This directly conflicts with the ISO C (1999) usage of 13622 %a as a conversion specifier for hexadecimal float values. 13623 While this conversion specifier should be supported, a 13624 format specifier such as "%aseconds" will have a different 13625 meaning on an LSB conforming system. 13626 13627 vscanf 13628 13629 Name 13630 13631 vscanf -- convert formatted input 13632 13633 Description 13634 13635 The scanf() family of functions shall behave as described in 13636 ISO POSIX (2003), except as noted below. 13637 13638 Differences 13639 13640 The %s, %S and %[ conversion specifiers shall accept an option 13641 length modifier a, which shall cause a memory buffer to be 13642 allocated to hold the string converted. In such a case, the 13643 argument corresponding to the conversion specifier should be a 13644 reference to a pointer value that will receive a pointer to the 13645 allocated buffer. If there is insufficient memory to allocate a 13646 buffer, the function may set errno to ENOMEM and a conversion 13647 error results. 13648 13649 Note: This directly conflicts with the ISO C (1999) usage of 13650 %a as a conversion specifier for hexadecimal float values. 13651 While this conversion specifier should be supported, a 13652 format specifier such as "%aseconds" will have a different 13653 meaning on an LSB conforming system. 13654 13655 vsscanf 13656 13657 Name 13658 13659 vsscanf -- convert formatted input 13660 13661 Description 13662 13663 The scanf() family of functions shall behave as described in 13664 ISO POSIX (2003), except as noted below. 13665 13666 Differences 13667 13668 The %s, %S and %[ conversion specifiers shall accept an option 13669 length modifier a, which shall cause a memory buffer to be 13670 allocated to hold the string converted. In such a case, the 13671 argument corresponding to the conversion specifier should be a 13672 reference to a pointer value that will receive a pointer to the 13673 allocated buffer. If there is insufficient memory to allocate a 13674 buffer, the function may set errno to ENOMEM and a conversion 13675 error results. 13676 13677 Note: This directly conflicts with the ISO C (1999) usage of 13678 %a as a conversion specifier for hexadecimal float values. 13679 While this conversion specifier should be supported, a 13680 format specifier such as "%aseconds" will have a different 13681 meaning on an LSB conforming system. 13682 13683 vswscanf 13684 13685 Name 13686 13687 vswscanf -- convert formatted input 13688 13689 Description 13690 13691 The scanf() family of functions shall behave as described in 13692 ISO POSIX (2003), except as noted below. 13693 13694 Differences 13695 13696 The %s, %S and %[ conversion specifiers shall accept an option 13697 length modifier a, which shall cause a memory buffer to be 13698 allocated to hold the string converted. In such a case, the 13699 argument corresponding to the conversion specifier should be a 13700 reference to a pointer value that will receive a pointer to the 13701 allocated buffer. If there is insufficient memory to allocate a 13702 buffer, the function may set errno to ENOMEM and a conversion 13703 error results. 13704 13705 Note: This directly conflicts with the ISO C (1999) usage of 13706 %a as a conversion specifier for hexadecimal float values. 13707 While this conversion specifier should be supported, a 13708 format specifier such as "%aseconds" will have a different 13709 meaning on an LSB conforming system. 13710 13711 vsyslog 13712 13713 Name 13714 13715 vsyslog -- log to system log 13716 13717 Synopsis 13718 13719 #include 13720 #include 13721 13722 void vsyslog(int priority, char * message, va_list arglist); 13723 13724 Description 13725 13726 The vsyslog() function is identical to syslog() as specified in 13727 ISO POSIX (2003), except that arglist (as defined by stdarg.h) 13728 replaces the variable number of arguments. 13729 13730 vwscanf 13731 13732 Name 13733 13734 vwscanf -- convert formatted input 13735 13736 Description 13737 13738 The scanf() family of functions shall behave as described in 13739 ISO POSIX (2003), except as noted below. 13740 13741 Differences 13742 13743 The %s, %S and %[ conversion specifiers shall accept an option 13744 length modifier a, which shall cause a memory buffer to be 13745 allocated to hold the string converted. In such a case, the 13746 argument corresponding to the conversion specifier should be a 13747 reference to a pointer value that will receive a pointer to the 13748 allocated buffer. If there is insufficient memory to allocate a 13749 buffer, the function may set errno to ENOMEM and a conversion 13750 error results. 13751 13752 Note: This directly conflicts with the ISO C (1999) usage of 13753 %a as a conversion specifier for hexadecimal float values. 13754 While this conversion specifier should be supported, a 13755 format specifier such as "%aseconds" will have a different 13756 meaning on an LSB conforming system. 13757 13758 wait4 13759 13760 Name 13761 13762 wait4 -- wait for process termination, BSD style 13763 13764 Synopsis 13765 13766 #include 13767 #include 13768 #include 13769 13770 pid_t wait4(pid_t pid, int * status, int options, struct rusage 13771 * rusage); 13772 13773 Description 13774 13775 wait4() suspends execution of the current process until a child 13776 (as specified by pid) has exited, or until a signal is 13777 delivered whose action is to terminate the current process or 13778 to call a signal handling function. If a child (as requested by 13779 pid) has already exited by the time of the call (a so-called 13780 "zombie" process), the function returns immediately. Any system 13781 resources used by the child are freed. 13782 13783 The value of pid can be one of: 13784 13785 < -1 13786 13787 wait for any child process whose process group ID is equal to 13788 the absolute value of pid. 13789 -1 13790 13791 wait for any child process; this is equivalent to calling 13792 wait3(). 13793 0 13794 13795 wait for any child process whose process group ID is equal to 13796 that of the calling process. 13797 > 0 13798 13799 wait for the child whose process ID is equal to the value of 13800 pid. 13801 13802 The value of options is a bitwise or of zero or more of the 13803 following constants: 13804 13805 WNOHANG 13806 13807 return immediately if no child is there to be waited for. 13808 WUNTRACED 13809 13810 return for children that are stopped, and whose status has not 13811 been reported. 13812 13813 If status is not NULL, wait4() stores status information in the 13814 location status. This status can be evaluated with the 13815 following macros: 13816 13817 Note: These macros take the status value (an int) as an 13818 argument -- not a pointer to the value! 13819 13820 WIFEXITED(status) 13821 13822 is nonzero if the child exited normally. 13823 WEXITSTATUS(status) 13824 13825 evaluates to the least significant eight bits of the return 13826 code of the child that terminated, which may have been set as 13827 the argument to a call to exit() or as the argument for a 13828 return statement in the main program. This macro can only be 13829 evaluated if WIFEXITED() returned nonzero. 13830 WIFSIGNALED(status) 13831 13832 returns true if the child process exited because of a signal 13833 that was not caught. 13834 WTERMSIG(status) 13835 13836 returns the number of the signal that caused the child process 13837 to terminate. This macro can only be evaluated if WIFSIGNALED() 13838 returned nonzero. 13839 WIFSTOPPED(status) 13840 13841 returns true if the child process that caused the return is 13842 currently stopped; this is only possible if the call was done 13843 using WUNTRACED(). 13844 WSTOPSIG(status) 13845 13846 returns the number of the signal that caused the child to stop. 13847 This macro can only be evaluated if WIFSTOPPED() returned 13848 nonzero. 13849 13850 If rusage is not NULL, the struct rusage (as defined in 13851 sys/resource.h) that it points to will be filled with 13852 accounting information. See getrusage() for details. 13853 13854 Return Value 13855 13856 On success, the process ID of the child that exited is 13857 returned. On error, -1 is returned (in particular, when no 13858 unwaited-for child processes of the specified kind exist), or 0 13859 if WNOHANG() was used and no child was available yet. In the 13860 latter two cases, the global variable errno is set 13861 appropriately. 13862 13863 Errors 13864 13865 ECHILD 13866 13867 No unwaited-for child process as specified does exist. 13868 ERESTARTSYS 13869 13870 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 13871 was caught. This error is returned by the system call. The 13872 library interface is not allowed to return ERESTARTSYS, but 13873 will return EINTR. 13874 13875 waitpid 13876 13877 Name 13878 13879 waitpid -- wait for child process 13880 13881 Description 13882 13883 waitpid() is as specified in ISO POSIX (2003), but with 13884 differences as listed below. 13885 13886 Need not support WCONTINUED or WIFCONTINUED 13887 13888 Implementations need not support the XSI optional functionality 13889 of WCONTINUED() or WIFCONTINUED(). 13890 13891 warn 13892 13893 Name 13894 13895 warn -- formatted error messages 13896 13897 Synopsis 13898 13899 #include 13900 13901 void warn(const char * fmt, ...); 13902 13903 Description 13904 13905 The warn() function shall display a formatted error message on 13906 the standard error stream. The output shall consist of the last 13907 component of the program name, a colon character, and a space 13908 character. If fmt is non-NULL, it shall be used as a format 13909 string for the printf() family of functions, and the formatted 13910 message, a colon character, and a space are written to stderr. 13911 Finally, the error message string affiliated with the current 13912 value of the global variable errno shall be written to stderr, 13913 followed by a newline character. 13914 13915 Return Value 13916 13917 None. 13918 13919 Errors 13920 13921 None. 13922 13923 warnx 13924 13925 Name 13926 13927 warnx -- formatted error messages 13928 13929 Synopsis 13930 13931 #include 13932 13933 void warnx(const char * fmt, ...); 13934 13935 Description 13936 13937 The warnx() function shall display a formatted error message on 13938 the standard error stream. The last component of the program 13939 name, a colon character, and a space shall be output. If fmt is 13940 non-NULL, it shall be used as the format string for the 13941 printf() family of functions, and the formatted error message, 13942 a colon character, and a space shall be output. The output 13943 shall be followed by a newline character. 13944 13945 Return Value 13946 13947 None. 13948 13949 Errors 13950 13951 None. 13952 13953 wcpcpy 13954 13955 Name 13956 13957 wcpcpy -- copy a wide character string, returning a pointer to 13958 its end 13959 13960 Synopsis 13961 13962 #include 13963 13964 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 13965 13966 Description 13967 13968 wcpcpy() is the wide-character equivalent of stpcpy(). It 13969 copies the wide character string src, including the terminating 13970 null wide character code, to the array dest. 13971 13972 The strings may not overlap. 13973 13974 The programmer shall ensure that there is room for at least 13975 wcslen()(src)+1 wide characters at dest. 13976 13977 Return Value 13978 13979 wcpcpy() returns a pointer to the end of the wide-character 13980 string dest, that is, a pointer to the terminating null wide 13981 character code. 13982 13983 wcpncpy 13984 13985 Name 13986 13987 wcpncpy -- copy a fixed-size string of wide characters, 13988 returning a pointer to its end 13989 13990 Synopsis 13991 13992 #include 13993 13994 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 13995 n); 13996 13997 Description 13998 13999 wcpncpy() is the wide-character equivalent of stpncpy(). It 14000 copies at most n wide characters from the wide-character string 14001 src, including the terminating null wide character code, to the 14002 array dest. Exactly n wide characters are written at dest. If 14003 the length wcslen()(src) is smaller than n, the remaining wide 14004 characters in the array dest are filled with null wide 14005 character codes. If the length wcslen()(src) is greater than or 14006 equal to n, the string dest will not be terminated with a null 14007 wide character code. 14008 14009 The strings may not overlap. 14010 14011 The programmer shall ensure that there is room for at least n 14012 wide characters at dest. 14013 14014 Return Value 14015 14016 wcpncpy() returns a pointer to the wide character one past the 14017 last non-null wide character written. 14018 14019 wcscasecmp 14020 14021 Name 14022 14023 wcscasecmp -- compare two wide-character strings, ignoring case 14024 14025 Synopsis 14026 14027 #include 14028 14029 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 14030 14031 Description 14032 14033 wcscasecmp() is the wide-character equivalent of strcasecmp(). 14034 It compares the wide-character string s1 and the wide-character 14035 string s2, ignoring case differences (towupper, towlower). 14036 14037 Return Value 14038 14039 The wcscasecmp() function shall return 0 if the wide-character 14040 strings s1 and s2 are equal except for case distinctions. It 14041 shall return a positive integer if s1 is greater than s2, 14042 ignoring case. It shall return a negative integer if s1 is less 14043 than s2, ignoring case. 14044 14045 Notes 14046 14047 The behavior of wcscasecmp() depends upon the LC_CTYPE category 14048 of the current locale. 14049 14050 wcsdup 14051 14052 Name 14053 14054 wcsdup -- duplicate a wide-character string 14055 14056 Synopsis 14057 14058 #include 14059 14060 wchar_t * wcsdup(const wchar_t * s); 14061 14062 Description 14063 14064 The wcsdup() function is the wide-character equivalent of 14065 strdup(). The wcsdup() function shall return a pointer to a new 14066 wide character string, which is a duplicate of the wide 14067 character string pointed to by s. The returned pointer can be 14068 passed to free(). A null pointer is returned if the new string 14069 cannot be created. 14070 14071 Return Value 14072 14073 The wcsdup() function returns a pointer to a new wide-character 14074 string on success. Otherwise, it shall return NULL and set 14075 errno to indicate the error. 14076 14077 Errors 14078 14079 ENOMEM 14080 14081 Insufficient memory available. 14082 14083 wcsncasecmp 14084 14085 Name 14086 14087 wcsncasecmp -- compare two fixed-size wide-character strings, 14088 ignoring case 14089 14090 Synopsis 14091 14092 #include 14093 14094 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 14095 n); 14096 14097 Description 14098 14099 wcsncasecmp() is the wide-character equivalent of 14100 strncasecmp(). It compares the wide-character string s1 and the 14101 wide-character string s2, but at most n wide characters from 14102 each string, ignoring case differences (towupper, towlower). 14103 14104 Return Value 14105 14106 wcscasecmp() returns 0 if the wide-character strings s1 and s2, 14107 truncated to at most length n, are equal except for case 14108 distinctions. It returns a positive integer if truncated s1 is 14109 greater than truncated s2, ignoring case. It returns a negative 14110 integer if truncated s1 is smaller than truncated s2, ignoring 14111 case. 14112 14113 Notes 14114 14115 The behavior of wcsncasecmp() depends upon the LC_CTYPE 14116 category of the current locale. 14117 14118 wcsnlen 14119 14120 Name 14121 14122 wcsnlen -- determine the length of a fixed-size wide-character 14123 string 14124 14125 Synopsis 14126 14127 #include 14128 14129 size_t wcsnlen(const wchar_t * s, size_t maxlen); 14130 14131 Description 14132 14133 wcsnlen() is the wide-character equivalent of strnlen(). It 14134 returns the number of wide-characters in the string s, not 14135 including the terminating null wide character code, but at most 14136 maxlen. In doing this, wcsnlen() looks only at the first maxlen 14137 wide-characters at s and never beyond s + maxlen. 14138 14139 Return Value 14140 14141 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 14142 maxlen if there is no null wide character code among the first 14143 maxlen wide characters pointed to by s. 14144 14145 wcsnrtombs 14146 14147 Name 14148 14149 wcsnrtombs -- convert a wide character string to a multi-byte 14150 string 14151 14152 Synopsis 14153 14154 #include 14155 14156 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 14157 nwc, size_t len, mbstate_t * ps); 14158 14159 Description 14160 14161 wcsnrtombs() is like wcsrtombs(), except that the number of 14162 wide characters to be converted, starting at src, is limited to 14163 nwc. 14164 14165 If dest is not a NULL pointer, wcsnrtombs() converts at most 14166 nwc wide characters from the wide-character string src to a 14167 multibyte string starting at dest. At most len bytes are 14168 written to dest. The shift state ps is updated. 14169 14170 The conversion is effectively performed by repeatedly calling: 14171 wcrtomb(dest, *src, ps) 14172 14173 as long as this call succeeds, and then incrementing dest by 14174 the number of bytes written and src by 1. 14175 14176 The conversion can stop for three reasons: 14177 14178 * A wide character has been encountered that cannot be 14179 represented as a multibyte sequence (according to the 14180 current locale). In this case src is left pointing to the 14181 invalid wide character, (size_t)(-1) is returned, and errno 14182 is set to EILSEQ. 14183 * nws wide characters have been converted without 14184 encountering a null wide character code, or the length 14185 limit forces a stop. In this case, src is left pointing to 14186 the next wide character to be converted, and the number 14187 bytes written to dest is returned. 14188 * The wide-character string has been completely converted, 14189 including the terminating null wide character code (which 14190 has the side effect of bringing back ps to the initial 14191 state). In this case, src is set to NULL, and the number of 14192 bytes written to dest, excluding the terminating null wide 14193 character code, is returned. 14194 14195 If dest is NULL, len is ignored, and the conversion proceeds as 14196 above, except that the converted bytes are not written out to 14197 memory, and that no destination length limit exists. 14198 14199 In both of the above cases, if ps is a NULL pointer, a static 14200 anonymous state only known to wcsnrtombs() is used instead. 14201 14202 The programmer shall ensure that there is room for at least len 14203 bytes at dest. 14204 14205 Return Value 14206 14207 wcsnrtombs() returns the number of bytes that make up the 14208 converted part of multibyte sequence, not including the 14209 terminating null wide character code. If a wide character was 14210 encountered which could not be converted, (size_t)(-1) is 14211 returned, and the global variable errno set to EILSEQ. 14212 14213 Notes 14214 14215 The behavior of wcsnrtombs() depends on the LC_CTYPE category 14216 of the current locale. 14217 14218 Passing NULL as ps is not multi-thread safe. 14219 14220 wcstoq 14221 14222 Name 14223 14224 wcstoq -- convert wide string to long long int representation 14225 14226 Synopsis 14227 14228 #include 14229 14230 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 14231 restrict endptr, int base); 14232 14233 Description 14234 14235 The wcstoq() function shall convert the initial portion of the 14236 wide string nptr to long long int representation. It is 14237 identical to wcstoll(). 14238 14239 Return Value 14240 14241 Refer to wcstoll(). 14242 14243 Errors 14244 14245 Refer to wcstoll(). 14246 14247 wcstouq 14248 14249 Name 14250 14251 wcstouq -- convert wide string to unsigned long long int 14252 representation 14253 14254 Synopsis 14255 14256 #include 14257 14258 unsigned long long wcstouq(const wchar_t * restrict nptr, 14259 wchar_t ** restrict endptr, int base); 14260 14261 Description 14262 14263 The wcstouq() function shall convert the initial portion of the 14264 wide string nptr to unsigned long long int representation. It 14265 is identical to wcstoull(). 14266 14267 Return Value 14268 14269 Refer to wcstoull(). 14270 14271 Errors 14272 14273 Refer to wcstoull(). 14274 14275 wscanf 14276 14277 Name 14278 14279 wscanf -- convert formatted input 14280 14281 Description 14282 14283 The scanf() family of functions shall behave as described in 14284 ISO POSIX (2003), except as noted below. 14285 14286 Differences 14287 14288 The %s, %S and %[ conversion specifiers shall accept an option 14289 length modifier a, which shall cause a memory buffer to be 14290 allocated to hold the string converted. In such a case, the 14291 argument corresponding to the conversion specifier should be a 14292 reference to a pointer value that will receive a pointer to the 14293 allocated buffer. If there is insufficient memory to allocate a 14294 buffer, the function may set errno to ENOMEM and a conversion 14295 error results. 14296 14297 Note: This directly conflicts with the ISO C (1999) usage of 14298 %a as a conversion specifier for hexadecimal float values. 14299 While this conversion specifier should be supported, a 14300 format specifier such as "%aseconds" will have a different 14301 meaning on an LSB conforming system. 14302 14303 xdr_u_int 14304 14305 Name 14306 14307 xdr_u_int -- library routines for external data representation 14308 14309 Synopsis 14310 14311 int xdr_u_int(XDR * xdrs, unsigned int * up); 14312 14313 Description 14314 14315 xdr_u_int() is a filter primitive that translates between C 14316 unsigned integers and their external representations. 14317 14318 Return Value 14319 14320 On success, 1 is returned. On error, 0 is returned. 14321 14322 xdrstdio_create 14323 14324 Name 14325 14326 xdrstdio_create -- library routines for external data 14327 representation 14328 14329 Synopsis 14330 14331 #include 14332 14333 void xdrstdio_create(XDR * xdrs, FILE * file, enum xdr_op op); 14334 14335 Description 14336 14337 The xdrstdio_create() function shall initialize the XDR stream 14338 object referred to by xdrs. The XDR stream data shall be 14339 written to, or read from, the standard I/O stream associated 14340 with file. If the operation op is XDR_ENCODE, encoded data 14341 shall be written to file. If op is XDR_DECODE, encoded data 14342 shall be read from file. If op is XDR_FREE, the XDR stream 14343 object may be used to deallocate storage allocated by a 14344 previous XDR_DECODE. 14345 14346 The associated destroy function shall flush the file I/O 14347 stream, but not close it. 14348 14349 Return Value 14350 14351 None. 14352 __________________________________________________________ 14353 14354 13.6. Interfaces for libm 14355 14356 Table 13-33 defines the library name and shared object name for 14357 the libm library 14358 14359 Table 13-33. libm Definition 14360 Library: libm 14361 SONAME: See archLSB. 14362 14363 The behavior of the interfaces in this library is specified by 14364 the following specifications: 14365 14366 [ISOC99] ISO C (1999) 14367 [LSB] This Specification 14368 [SUSv3] ISO POSIX (2003) 14369 [SVID.3] SVID Issue 3 14370 __________________________________________________________ 14371 14372 13.6.1. Math 14373 __________________________________________________________ 14374 14375 13.6.1.1. Interfaces for Math 14376 14377 An LSB conforming implementation shall provide the generic 14378 functions for Math specified in Table 13-34, with the full 14379 mandatory functionality as described in the referenced 14380 underlying specification. 14381 14382 Table 13-34. libm - Math Function Interfaces 14383 __finite [LSB] __finitef [LSB] __finitel [LSB] __fpclassify 14384 [LSB] 14385 __fpclassifyf [LSB] __signbit [LSB] __signbitf [LSB] acos 14386 [SUSv3] 14387 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 14388 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 14389 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 14390 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 14391 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 14392 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 14393 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 14394 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 14395 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 14396 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 14397 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 14398 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 14399 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 14400 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 14401 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 14402 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [LSB] 14403 clog10f [LSB] clog10l [LSB] clogf [SUSv3] clogl [SUSv3] 14404 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 14405 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 14406 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 14407 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 14408 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 14409 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 14410 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 14411 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 14412 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 14413 drem [LSB] dremf [LSB] dreml [LSB] erf [SUSv3] 14414 erfc [SUSv3] erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] 14415 erfl [SUSv3] exp [SUSv3] exp10 [LSB] exp10f [LSB] 14416 exp10l [LSB] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 14417 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 14418 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 14419 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] 14420 fedisableexcept [LSB] 14421 feenableexcept [LSB] fegetenv [SUSv3] fegetexcept [LSB] 14422 fegetexceptflag [SUSv3] 14423 fegetround [SUSv3] feholdexcept [SUSv3] feraiseexcept [SUSv3] 14424 fesetenv [SUSv3] 14425 fesetexceptflag [SUSv3] fesetround [SUSv3] fetestexcept [SUSv3] 14426 feupdateenv [SUSv3] 14427 finite [LSB] finitef [LSB] finitel [LSB] floor [SUSv3] 14428 floorf [SUSv3] floorl [SUSv3] fma [SUSv3] fmaf [SUSv3] 14429 fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] fmaxl [SUSv3] 14430 fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] fmod [SUSv3] 14431 fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] frexpf [SUSv3] 14432 frexpl [SUSv3] gamma [LSB] gammaf [LSB] gammal [LSB] 14433 hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] ilogb [SUSv3] 14434 ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] j0f [LSB] 14435 j0l [LSB] j1 [SUSv3] j1f [LSB] j1l [LSB] 14436 jn [SUSv3] jnf [LSB] jnl [LSB] ldexp [SUSv3] 14437 ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] lgamma_r [LSB] 14438 lgammaf [SUSv3] lgammaf_r [LSB] lgammal [SUSv3] lgammal_r [LSB] 14439 llrint [SUSv3] llrintf [SUSv3] llrintl [SUSv3] llround [SUSv3] 14440 llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] log10 [SUSv3] 14441 log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] log1pf [SUSv3] 14442 log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] log2l [SUSv3] 14443 logb [SUSv3] logbf [SUSv3] logbl [SUSv3] logf [SUSv3] 14444 logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] lrintl [SUSv3] 14445 lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] matherr [SVID.3] 14446 modf [SUSv3] modff [SUSv3] modfl [SUSv3] nan [SUSv3] 14447 nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] nearbyintf [SUSv3] 14448 nearbyintl [SUSv3] nextafter [SUSv3] nextafterf [SUSv3] 14449 nextafterl [SUSv3] 14450 nexttoward [SUSv3] nexttowardf [SUSv3] nexttowardl [SUSv3] pow 14451 [SUSv3] 14452 pow10 [LSB] pow10f [LSB] pow10l [LSB] powf [SUSv3] 14453 powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] remainderl 14454 [SUSv3] 14455 remquo [SUSv3] remquof [SUSv3] remquol [SUSv3] rint [SUSv3] 14456 rintf [SUSv3] rintl [SUSv3] round [SUSv3] roundf [SUSv3] 14457 roundl [SUSv3] scalb [SUSv3] scalbf [ISOC99] scalbl [ISOC99] 14458 scalbln [SUSv3] scalblnf [SUSv3] scalblnl [SUSv3] scalbn 14459 [SUSv3] 14460 scalbnf [SUSv3] scalbnl [SUSv3] significand [LSB] significandf 14461 [LSB] 14462 significandl [LSB] sin [SUSv3] sincos [LSB] sincosf [LSB] 14463 sincosl [LSB] sinf [SUSv3] sinh [SUSv3] sinhf [SUSv3] 14464 sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] sqrtf [SUSv3] 14465 sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] tanh [SUSv3] 14466 tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] tgamma [SUSv3] 14467 tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] truncf [SUSv3] 14468 truncl [SUSv3] y0 [SUSv3] y0f [LSB] y0l [LSB] 14469 y1 [SUSv3] y1f [LSB] y1l [LSB] yn [SUSv3] 14470 ynf [LSB] ynl [LSB] 14471 14472 An LSB conforming implementation shall provide the generic 14473 deprecated functions for Math specified in Table 13-35, with 14474 the full mandatory functionality as described in the referenced 14475 underlying specification. 14476 14477 Note: These interfaces are deprecated, and applications 14478 should avoid using them. These interfaces may be withdrawn 14479 in future releases of this specification. 14480 14481 Table 13-35. libm - Math Deprecated Function Interfaces 14482 drem [LSB] dremf [LSB] dreml [LSB] finite [LSB] 14483 finitef [LSB] finitel [LSB] gamma [LSB] gammaf [LSB] 14484 gammal [LSB] matherr [SVID.3] 14485 14486 An LSB conforming implementation shall provide the generic data 14487 interfaces for Math specified in Table 13-36, with the full 14488 mandatory functionality as described in the referenced 14489 underlying specification. 14490 14491 Table 13-36. libm - Math Data Interfaces 14492 signgam [SUSv3] 14493 __________________________________________________________ 14494 14495 13.7. Data Definitions for libm 14496 14497 This section defines global identifiers and their values that 14498 are associated with interfaces contained in libm. These 14499 definitions are organized into groups that correspond to system 14500 headers. This convention is used as a convenience for the 14501 reader, and does not imply the existence of these headers, or 14502 their content. Where an interface is defined as requiring a 14503 particular system header file all of the data definitions for 14504 that system header file presented here shall be in effect. 14505 14506 This section gives data definitions to promote binary 14507 application portability, not to repeat source interface 14508 definitions available elsewhere. System providers and 14509 application developers should use this ABI to supplement - not 14510 to replace - source interface definition specifications. 14511 14512 This specification uses the ISO C (1999) C Language as the 14513 reference programming language, and data definitions are 14514 specified in ISO C format. The C language is used here as a 14515 convenient notation. Using a C language description of these 14516 data objects does not preclude their use by other programming 14517 languages. 14518 __________________________________________________________ 14519 14520 13.7.1. complex.h 14521 14522 #define complex _Complex 14523 14524 extern double cabs(double complex); 14525 extern float cabsf(float complex); 14526 extern long double cabsl(long double complex); 14527 extern double complex cacos(double complex); 14528 extern float complex cacosf(float complex); 14529 extern double complex cacosh(double complex); 14530 extern float complex cacoshf(float complex); 14531 extern long double complex cacoshl(long double complex); 14532 extern long double complex cacosl(long double complex); 14533 extern double carg(double complex); 14534 extern float cargf(float complex); 14535 extern long double cargl(long double complex); 14536 extern double complex casin(double complex); 14537 extern float complex casinf(float complex); 14538 extern double complex casinh(double complex); 14539 extern float complex casinhf(float complex); 14540 extern long double complex casinhl(long double complex); 14541 extern long double complex casinl(long double complex); 14542 extern double complex catan(double complex); 14543 extern float complex catanf(float complex); 14544 extern double complex catanh(double complex); 14545 extern float complex catanhf(float complex); 14546 extern long double complex catanhl(long double complex); 14547 extern long double complex catanl(long double complex); 14548 extern double complex ccos(double complex); 14549 extern float complex ccosf(float complex); 14550 extern double complex ccosh(double complex); 14551 extern float complex ccoshf(float complex); 14552 extern long double complex ccoshl(long double complex); 14553 extern long double complex ccosl(long double complex); 14554 extern double complex cexp(double complex); 14555 extern float complex cexpf(float complex); 14556 extern long double complex cexpl(long double complex); 14557 extern double cimag(double complex); 14558 extern float cimagf(float complex); 14559 extern long double cimagl(long double complex); 14560 extern double complex clog(double complex); 14561 extern double complex clog10(double complex); 14562 extern float complex clog10f(float complex); 14563 extern long double complex clog10l(long double complex); 14564 extern float complex clogf(float complex); 14565 extern long double complex clogl(long double complex); 14566 extern double complex conj(double complex); 14567 extern float complex conjf(float complex); 14568 extern long double complex conjl(long double complex); 14569 extern double complex cpow(double complex, double complex); 14570 extern float complex cpowf(float complex, float complex); 14571 extern long double complex cpowl(long double complex, long double complex); 14572 extern double complex cproj(double complex); 14573 extern float complex cprojf(float complex); 14574 extern long double complex cprojl(long double complex); 14575 extern double creal(double complex); 14576 extern float crealf(float complex); 14577 extern long double creall(long double complex); 14578 extern double complex csin(double complex); 14579 extern float complex csinf(float complex); 14580 extern double complex csinh(double complex); 14581 extern float complex csinhf(float complex); 14582 extern long double complex csinhl(long double complex); 14583 extern long double complex csinl(long double complex); 14584 extern double complex csqrt(double complex); 14585 extern float complex csqrtf(float complex); 14586 extern long double complex csqrtl(long double complex); 14587 extern double complex ctan(double complex); 14588 extern float complex ctanf(float complex); 14589 extern double complex ctanh(double complex); 14590 extern float complex ctanhf(float complex); 14591 extern long double complex ctanhl(long double complex); 14592 extern long double complex ctanl(long double complex); 14593 __________________________________________________________ 14594 14595 13.7.2. fenv.h 14596 14597 extern int fedisableexcept(int); 14598 extern int feenableexcept(int); 14599 extern int fegetexcept(void); 14600 extern int feclearexcept(int); 14601 extern int fegetenv(fenv_t *); 14602 extern int fegetexceptflag(fexcept_t *, int); 14603 extern int fegetround(void); 14604 extern int feholdexcept(fenv_t *); 14605 extern int feraiseexcept(int); 14606 extern int fesetenv(const fenv_t *); 14607 extern int fesetexceptflag(const fexcept_t *, int); 14608 extern int fesetround(int); 14609 extern int fetestexcept(int); 14610 extern int feupdateenv(const fenv_t *); 14611 __________________________________________________________ 14612 14613 13.7.3. math.h 14614 14615 #define DOMAIN 1 14616 #define SING 2 14617 14618 struct exception { 14619 int type; 14620 char *name; 14621 double arg1; 14622 double arg2; 14623 double retval; 14624 }; 14625 14626 #define FP_NAN 0 14627 #define FP_INFINITE 1 14628 #define FP_ZERO 2 14629 #define FP_SUBNORMAL 3 14630 #define FP_NORMAL 4 14631 14632 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 14633 14634 #define HUGE_VAL 0x1.0p2047 14635 #define HUGE_VALF 0x1.0p255f 14636 14637 #define NAN ((float)0x7fc00000UL) 14638 #define M_1_PI 0.31830988618379067154 14639 #define M_LOG10E 0.43429448190325182765 14640 #define M_2_PI 0.63661977236758134308 14641 #define M_LN2 0.69314718055994530942 14642 #define M_SQRT1_2 0.70710678118654752440 14643 #define M_PI_4 0.78539816339744830962 14644 #define M_2_SQRTPI 1.12837916709551257390 14645 #define M_SQRT2 1.41421356237309504880 14646 #define M_LOG2E 1.4426950408889634074 14647 #define M_PI_2 1.57079632679489661923 14648 #define M_LN10 2.30258509299404568402 14649 #define M_E 2.7182818284590452354 14650 #define M_PI 3.14159265358979323846 14651 #define INFINITY HUGE_VALF 14652 14653 #define MATH_ERRNO 1 14654 #define MATH_ERREXCEPT 2 14655 14656 #define isunordered(u, v) \ 14657 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) 14658 #define islessgreater(x, y) \ 14659 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) 14660 #define isless(x,y) \ 14661 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) 14662 #define islessequal(x, y) \ 14663 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) 14664 #define isgreater(x,y) \ 14665 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) 14666 #define isgreaterequal(x,y) \ 14667 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) 14668 14669 extern int __finite(double); 14670 extern int __finitef(float); 14671 extern int __finitel(long double); 14672 extern int __isinf(double); 14673 extern int __isinff(float); 14674 extern int __isinfl(long double); 14675 extern int __isnan(double); 14676 extern int __isnanf(float); 14677 extern int __isnanl(long double); 14678 extern int __signbit(double); 14679 extern int __signbitf(float); 14680 extern int __fpclassify(double); 14681 extern int __fpclassifyf(float); 14682 extern int signgam; 14683 extern double copysign(double, double); 14684 extern int finite(double); 14685 extern double frexp(double, int *); 14686 extern double ldexp(double, int); 14687 extern double modf(double, double *); 14688 extern double acos(double); 14689 extern double acosh(double); 14690 extern double asinh(double); 14691 extern double atanh(double); 14692 extern double asin(double); 14693 extern double atan(double); 14694 extern double atan2(double, double); 14695 extern double cbrt(double); 14696 extern double ceil(double); 14697 extern double cos(double); 14698 extern double cosh(double); 14699 extern double erf(double); 14700 extern double erfc(double); 14701 extern double exp(double); 14702 extern double expm1(double); 14703 extern double fabs(double); 14704 extern double floor(double); 14705 extern double fmod(double, double); 14706 extern double gamma(double); 14707 extern double hypot(double, double); 14708 extern int ilogb(double); 14709 extern double j0(double); 14710 extern double j1(double); 14711 extern double jn(int, double); 14712 extern double lgamma(double); 14713 extern double log(double); 14714 extern double log10(double); 14715 extern double log1p(double); 14716 extern double logb(double); 14717 extern double nextafter(double, double); 14718 extern double pow(double, double); 14719 extern double remainder(double, double); 14720 extern double rint(double); 14721 extern double scalb(double, double); 14722 extern double sin(double); 14723 extern double sinh(double); 14724 extern double sqrt(double); 14725 extern double tan(double); 14726 extern double tanh(double); 14727 extern double y0(double); 14728 extern double y1(double); 14729 extern double yn(int, double); 14730 extern double drem(double, double); 14731 extern float copysignf(float, float); 14732 extern long double copysignl(long double, long double); 14733 extern int finitef(float); 14734 extern int finitel(long double); 14735 extern float frexpf(float, int *); 14736 extern long double frexpl(long double, int *); 14737 extern float ldexpf(float, int); 14738 extern long double ldexpl(long double, int); 14739 extern float modff(float, float *); 14740 extern long double modfl(long double, long double *); 14741 extern double scalbln(double, long int); 14742 extern float scalblnf(float, long int); 14743 extern long double scalblnl(long double, long int); 14744 extern double scalbn(double, int); 14745 extern float scalbnf(float, int); 14746 extern long double scalbnl(long double, int); 14747 extern float acosf(float); 14748 extern float acoshf(float); 14749 extern long double acoshl(long double); 14750 extern long double acosl(long double); 14751 extern float asinf(float); 14752 extern float asinhf(float); 14753 extern long double asinhl(long double); 14754 extern long double asinl(long double); 14755 extern float atan2f(float, float); 14756 extern long double atan2l(long double, long double); 14757 extern float atanf(float); 14758 extern float atanhf(float); 14759 extern long double atanhl(long double); 14760 extern long double atanl(long double); 14761 extern float cbrtf(float); 14762 extern long double cbrtl(long double); 14763 extern float ceilf(float); 14764 extern long double ceill(long double); 14765 extern float cosf(float); 14766 extern float coshf(float); 14767 extern long double coshl(long double); 14768 extern long double cosl(long double); 14769 extern float dremf(float, float); 14770 extern long double dreml(long double, long double); 14771 extern float erfcf(float); 14772 extern long double erfcl(long double); 14773 extern float erff(float); 14774 extern long double erfl(long double); 14775 extern double exp10(double); 14776 extern float exp10f(float); 14777 extern long double exp10l(long double); 14778 extern double exp2(double); 14779 extern float exp2f(float); 14780 extern float expf(float); 14781 extern long double expl(long double); 14782 extern float expm1f(float); 14783 extern long double expm1l(long double); 14784 extern float fabsf(float); 14785 extern long double fabsl(long double); 14786 extern double fdim(double, double); 14787 extern float fdimf(float, float); 14788 extern long double fdiml(long double, long double); 14789 extern float floorf(float); 14790 extern long double floorl(long double); 14791 extern double fma(double, double, double); 14792 extern float fmaf(float, float, float); 14793 extern long double fmal(long double, long double, long double); 14794 extern double fmax(double, double); 14795 extern float fmaxf(float, float); 14796 extern long double fmaxl(long double, long double); 14797 extern double fmin(double, double); 14798 extern float fminf(float, float); 14799 extern long double fminl(long double, long double); 14800 extern float fmodf(float, float); 14801 extern long double fmodl(long double, long double); 14802 extern float gammaf(float); 14803 extern long double gammal(long double); 14804 extern float hypotf(float, float); 14805 extern long double hypotl(long double, long double); 14806 extern int ilogbf(float); 14807 extern int ilogbl(long double); 14808 extern float j0f(float); 14809 extern long double j0l(long double); 14810 extern float j1f(float); 14811 extern long double j1l(long double); 14812 extern float jnf(int, float); 14813 extern long double jnl(int, long double); 14814 extern double lgamma_r(double, int *); 14815 extern float lgammaf(float); 14816 extern float lgammaf_r(float, int *); 14817 extern long double lgammal(long double); 14818 extern long double lgammal_r(long double, int *); 14819 extern long long int llrint(double); 14820 extern long long int llrintf(float); 14821 extern long long int llrintl(long double); 14822 extern long long int llround(double); 14823 extern long long int llroundf(float); 14824 extern long long int llroundl(long double); 14825 extern float log10f(float); 14826 extern long double log10l(long double); 14827 extern float log1pf(float); 14828 extern long double log1pl(long double); 14829 extern double log2(double); 14830 extern float log2f(float); 14831 extern long double log2l(long double); 14832 extern float logbf(float); 14833 extern long double logbl(long double); 14834 extern float logf(float); 14835 extern long double logl(long double); 14836 extern long int lrint(double); 14837 extern long int lrintf(float); 14838 extern long int lrintl(long double); 14839 extern long int lround(double); 14840 extern long int lroundf(float); 14841 extern long int lroundl(long double); 14842 extern double nan(const char *); 14843 extern float nanf(const char *); 14844 extern long double nanl(const char *); 14845 extern double nearbyint(double); 14846 extern float nearbyintf(float); 14847 extern long double nearbyintl(long double); 14848 extern float nextafterf(float, float); 14849 extern long double nextafterl(long double, long double); 14850 extern double nexttoward(double, long double); 14851 extern float nexttowardf(float, long double); 14852 extern long double nexttowardl(long double, long double); 14853 extern double pow10(double); 14854 extern float pow10f(float); 14855 extern long double pow10l(long double); 14856 extern float powf(float, float); 14857 extern long double powl(long double, long double); 14858 extern float remainderf(float, float); 14859 extern long double remainderl(long double, long double); 14860 extern double remquo(double, double, int *); 14861 extern float remquof(float, float, int *); 14862 extern long double remquol(long double, long double, int *); 14863 extern float rintf(float); 14864 extern long double rintl(long double); 14865 extern double round(double); 14866 extern float roundf(float); 14867 extern long double roundl(long double); 14868 extern float scalbf(float, float); 14869 extern long double scalbl(long double, long double); 14870 extern double significand(double); 14871 extern float significandf(float); 14872 extern long double significandl(long double); 14873 extern void sincos(double, double *, double *); 14874 extern void sincosf(float, float *, float *); 14875 extern void sincosl(long double, long double *, long double *); 14876 extern float sinf(float); 14877 extern float sinhf(float); 14878 extern long double sinhl(long double); 14879 extern long double sinl(long double); 14880 extern float sqrtf(float); 14881 extern long double sqrtl(long double); 14882 extern float tanf(float); 14883 extern float tanhf(float); 14884 extern long double tanhl(long double); 14885 extern long double tanl(long double); 14886 extern double tgamma(double); 14887 extern float tgammaf(float); 14888 extern long double tgammal(long double); 14889 extern double trunc(double); 14890 extern float truncf(float); 14891 extern long double truncl(long double); 14892 extern float y0f(float); 14893 extern long double y0l(long double); 14894 extern float y1f(float); 14895 extern long double y1l(long double); 14896 extern float ynf(int, float); 14897 extern long double ynl(int, long double); 14898 __________________________________________________________ 14899 14900 13.8. Interface Definitions for libm 14901 14902 Table of Contents 14903 __finite -- test for infinity 14904 __finitef -- test for infinity 14905 __finitel -- test for infinity 14906 __fpclassify -- Classify real floating type 14907 __fpclassifyf -- Classify real floating type 14908 __signbit -- test sign of floating point value 14909 __signbitf -- test sign of floating point value 14910 clog10 -- Logarithm of a Complex Number 14911 clog10f -- Logarithm of a Complex Number 14912 clog10l -- Logarithm of a Complex Number 14913 drem -- Floating Point Remainder (DEPRECATED) 14914 dremf -- Floating Point Remainder (DEPRECATED) 14915 dreml -- Floating Point Remainder (DEPRECATED) 14916 exp10 -- Base-10 power function 14917 exp10f -- Base-10 power function 14918 exp10l -- Base-10 power function 14919 fedisableexcept -- disable floating point exceptions 14920 feenableexcept -- enable floating point exceptions 14921 fegetexcept -- query floating point exception handling state 14922 finite -- test for infinity (DEPRECATED) 14923 finitef -- test for infinity (DEPRECATED) 14924 finitel -- test for infinity (DEPRECATED) 14925 gamma -- log gamma function (DEPRECATED) 14926 gammaf -- log gamma function (DEPRECATED) 14927 gammal -- log gamma function (DEPRECATED) 14928 j0f -- Bessel functions 14929 j0l -- Bessel functions 14930 j1f -- Bessel functions 14931 j1l -- Bessel functions 14932 jnf -- Bessel functions 14933 jnl -- Bessel functions 14934 lgamma_r -- log gamma functions 14935 lgammaf_r -- log gamma functions 14936 lgammal_r -- log gamma functions 14937 pow10 -- Base-10 power function 14938 pow10f -- Base-10 power function 14939 pow10l -- Base-10 power function 14940 significand -- floating point mantissa 14941 significandf -- floating point mantissa 14942 significandl -- floating point mantissa 14943 sincos -- trigonometric functions 14944 sincosf -- trigonometric functions 14945 sincosl -- trigonometric functions 14946 y0f -- Bessel functions 14947 y0l -- Bessel functions 14948 y1f -- Bessel functions 14949 y1l -- Bessel functions 14950 ynf -- Bessel functions 14951 ynl -- Bessel functions 14952 14953 The interfaces defined on the following pages are included in 14954 libm and are defined by this specification. Unless otherwise 14955 noted, these interfaces shall be included in the source 14956 standard. 14957 14958 Other interfaces listed in Section 13.6 shall behave as 14959 described in the referenced base document. 14960 14961 __finite 14962 14963 Name 14964 14965 __finite -- test for infinity 14966 14967 Synopsis 14968 14969 #include 14970 14971 int __finite(double arg); 14972 14973 Description 14974 14975 __finite() has the same specification as isfinite() in ISO 14976 POSIX (2003), except that the argument type for __finite() is 14977 known to be double. 14978 14979 __finite() is not in the source standard; it is only in the 14980 binary standard. 14981 14982 __finitef 14983 14984 Name 14985 14986 __finitef -- test for infinity 14987 14988 Synopsis 14989 14990 #include 14991 14992 int __finitef(float arg); 14993 14994 Description 14995 14996 __finitef() has the same specification as isfinite() in ISO 14997 POSIX (2003) except that the argument type for __finitef() is 14998 known to be float. 14999 15000 __finitef() is not in the source standard; it is only in the 15001 binary standard. 15002 15003 __finitel 15004 15005 Name 15006 15007 __finitel -- test for infinity 15008 15009 Synopsis 15010 15011 #include 15012 15013 int __finitel(long double arg); 15014 15015 Description 15016 15017 __finitel() has the same specification as isfinite() in the ISO 15018 POSIX (2003), except that the argument type for __finitel() is 15019 known to be long double. 15020 15021 __finitel() is not in the source standard; it is only in the 15022 binary standard. 15023 15024 __fpclassify 15025 15026 Name 15027 15028 __fpclassify -- Classify real floating type 15029 15030 Synopsis 15031 15032 int __fpclassify(double arg); 15033 15034 Description 15035 15036 __fpclassify() has the same specification as fpclassify() in 15037 ISO POSIX (2003), except that the argument type for 15038 __fpclassify() is known to be double. 15039 15040 __fpclassify() is not in the source standard; it is only in the 15041 binary standard. 15042 15043 __fpclassifyf 15044 15045 Name 15046 15047 __fpclassifyf -- Classify real floating type 15048 15049 Synopsis 15050 15051 int __fpclassifyf(float arg); 15052 15053 Description 15054 15055 __fpclassifyf() has the same specification as fpclassify() in 15056 ISO POSIX (2003), except that the argument type for 15057 __fpclassifyf() is known to be float. 15058 15059 __fpclassifyf() is not in the source standard; it is only in 15060 the binary standard. 15061 15062 __signbit 15063 15064 Name 15065 15066 __signbit -- test sign of floating point value 15067 15068 Synopsis 15069 15070 #include 15071 15072 int __signbit(double arg); 15073 15074 Description 15075 15076 __signbit() has the same specification as signbit() in ISO 15077 POSIX (2003), except that the argument type for __signbit() is 15078 known to be double. 15079 15080 __signbit() is not in the source standard; it is only in the 15081 binary standard. 15082 15083 __signbitf 15084 15085 Name 15086 15087 __signbitf -- test sign of floating point value 15088 15089 Synopsis 15090 15091 #include 15092 15093 int __signbitf(float arg); 15094 15095 Description 15096 15097 __signbitf() has the same specification as signbit() in ISO 15098 POSIX (2003), except that the argument type for __signbitf() is 15099 known to be float. 15100 15101 __signbitf() is not in the source standard; it is only in the 15102 binary standard. 15103 15104 clog10 15105 15106 Name 15107 15108 clog10 -- Logarithm of a Complex Number 15109 15110 Synopsis 15111 15112 #include 15113 15114 double complex clog10(double complex z); 15115 15116 Description 15117 15118 The clog10() function shall compute the base 10 logarithm of 15119 the complex number z. 15120 15121 Return Value 15122 15123 The clog10() function shall return the base 10 logarithm. 15124 15125 clog10f 15126 15127 Name 15128 15129 clog10f -- Logarithm of a Complex Number 15130 15131 Synopsis 15132 15133 #include 15134 15135 float complex clog10f(float complex z); 15136 15137 Description 15138 15139 The clog10f() function shall compute the base 10 logarithm of 15140 the complex number z. 15141 15142 Return Value 15143 15144 The clog10f() function shall return the base 10 logarithm. 15145 15146 clog10l 15147 15148 Name 15149 15150 clog10l -- Logarithm of a Complex Number 15151 15152 Synopsis 15153 15154 #include 15155 15156 long double complex clog10l(long double complex z); 15157 15158 Description 15159 15160 The clog10l() function shall compute the base 10 logarithm of 15161 the complex number z. 15162 15163 Return Value 15164 15165 The clog10l() function shall return the base 10 logarithm. 15166 15167 drem 15168 15169 Name 15170 15171 drem -- Floating Point Remainder (DEPRECATED) 15172 15173 Synopsis 15174 15175 #include 15176 15177 double drem(double x, double y); 15178 15179 Description 15180 15181 The drem() function shall return the floating point remainder, 15182 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 15183 same way as remainder(). 15184 15185 Note: This function is included only for backwards 15186 compatibility; applications should use remainder() instead. 15187 15188 Returns 15189 15190 See remainder(). 15191 15192 See Also 15193 15194 remainder(), dremf(), dreml() 15195 15196 dremf 15197 15198 Name 15199 15200 dremf -- Floating Point Remainder (DEPRECATED) 15201 15202 Synopsis 15203 15204 #include 15205 15206 double dremf(double x, double y); 15207 15208 Description 15209 15210 The dremf() function shall return the floating point remainder, 15211 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 15212 same way as remainderf(). 15213 15214 Note: This function is included only for backwards 15215 compatibility; applications should use remainderf() instead. 15216 15217 Returns 15218 15219 See remainderf(). 15220 15221 See Also 15222 15223 remainderf(), drem(), dreml() 15224 15225 dreml 15226 15227 Name 15228 15229 dreml -- Floating Point Remainder (DEPRECATED) 15230 15231 Synopsis 15232 15233 #include 15234 15235 double dreml(double x, double y); 15236 15237 Description 15238 15239 The dreml() function shall return the floating point remainder, 15240 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 15241 same way as remainderl(). 15242 15243 Note: This function is included only for backwards 15244 compatibility; applications should use remainderl() instead. 15245 15246 Returns 15247 15248 See remainderl(). 15249 15250 See Also 15251 15252 remainderl(), drem(), dremf() 15253 15254 exp10 15255 15256 Name 15257 15258 exp10 -- Base-10 power function 15259 15260 Synopsis 15261 15262 #include 15263 15264 double exp10(double x); 15265 15266 Description 15267 15268 The exp10() function shall return 10^x. 15269 15270 Note: This function is identical to pow10(). 15271 15272 Returns 15273 15274 Upon successful completion, exp10() shall return 10 rised to 15275 the power of x. 15276 15277 If the correct value would cause overflow, a range error shall 15278 occur and exp10() shall return ±HUGE_VAL, with the same sign as 15279 the correct value of the function. 15280 15281 See Also 15282 15283 pow10(), exp10f(), exp10l() 15284 15285 exp10f 15286 15287 Name 15288 15289 exp10f -- Base-10 power function 15290 15291 Synopsis 15292 15293 #include 15294 15295 float exp10f(float x); 15296 15297 Description 15298 15299 The exp10f() function shall return 10^x. 15300 15301 Note: This function is identical to pow10f(). 15302 15303 Returns 15304 15305 Upon successful completion, exp10f() shall return 10 rised to 15306 the power of x. 15307 15308 If the correct value would cause overflow, a range error shall 15309 occur and exp10f() shall return ±HUGE_VALF, with the same sign 15310 as the correct value of the function. 15311 15312 See Also 15313 15314 pow10f(), exp10(), exp10l() 15315 15316 exp10l 15317 15318 Name 15319 15320 exp10l -- Base-10 power function 15321 15322 Synopsis 15323 15324 #include 15325 15326 long double exp10l(long double x); 15327 15328 Description 15329 15330 The exp10l() function shall return 10^x. 15331 15332 Note: This function is identical to pow10l(). 15333 15334 Returns 15335 15336 Upon successful completion, exp10l() shall return 10 rised to 15337 the power of x. 15338 15339 If the correct value would cause overflow, a range error shall 15340 occur and exp10l() shall return ±HUGE_VALL, with the same sign 15341 as the correct value of the function. 15342 15343 See Also 15344 15345 pow10l(), exp10(), exp10f() 15346 15347 fedisableexcept 15348 15349 Name 15350 15351 fedisableexcept -- disable floating point exceptions 15352 15353 Synopsis 15354 15355 #include 15356 15357 int fedisableexcept(int excepts); 15358 15359 Description 15360 15361 The fedisableexcept() function disables traps for each of the 15362 exceptions represented by the mask excepts. 15363 15364 Return Value 15365 15366 The fedisableexcept() function returns the previous set of 15367 enabled exceptions on success. On error, -1 is returned. 15368 15369 Errors 15370 15371 No errors are defined, but the function will fail if not 15372 supported on the architecture. 15373 15374 feenableexcept 15375 15376 Name 15377 15378 feenableexcept -- enable floating point exceptions 15379 15380 Synopsis 15381 15382 #include 15383 15384 int feenableexcept(int excepts); 15385 15386 Description 15387 15388 The feenableexcept() function enables traps for each of the 15389 exceptions represented by the mask excepts. 15390 15391 Return Value 15392 15393 The feenableexcept() function returns the previous set of 15394 enabled exceptions on success. On error, -1 is returned. 15395 15396 Errors 15397 15398 No errors are defined, but the function will fail if not 15399 supported on the architecture. 15400 15401 fegetexcept 15402 15403 Name 15404 15405 fegetexcept -- query floating point exception handling state 15406 15407 Synopsis 15408 15409 #include 15410 15411 int fegetexcept 15412 15413 Description 15414 15415 The fegetexcept() function returns the set of all currently 15416 enabled exceptions. 15417 15418 Return Value 15419 15420 The mremap() function returns the set of all currently enabled 15421 exceptions on success. On error, -1 is returned. 15422 15423 Errors 15424 15425 No errors are defined, but the function will fail if not 15426 supported on the architecture. 15427 15428 finite 15429 15430 Name 15431 15432 finite -- test for infinity (DEPRECATED) 15433 15434 Synopsis 15435 15436 #define _SVID_SOURCE 15437 #include 15438 15439 int finite(double arg); 15440 15441 Description 15442 15443 The finite() function shall test whether its argument is 15444 neither INFINITY nor not a number (NaN). 15445 15446 Returns 15447 15448 On success, finite() shall return 1. Otherwise the function 15449 shall return 0. 15450 15451 Note: The ISO C (1999) standard defines the function 15452 isfinite(), which is more general purpose. The finite() 15453 function is deprecated, and applications should use 15454 isfinite() instead. A future revision of this standard may 15455 remove this function. 15456 15457 See Also 15458 15459 isfinite(), finitef(), finitel() 15460 15461 finitef 15462 15463 Name 15464 15465 finitef -- test for infinity (DEPRECATED) 15466 15467 Synopsis 15468 15469 #define _SVID_SOURCE 15470 #include 15471 15472 int finitef(float arg); 15473 15474 Description 15475 15476 The finitef() function shall test whether its argument is 15477 neither INFINITY nor not a number (NaN). 15478 15479 Returns 15480 15481 On success, finitef() shall return 1. Otherwise the function 15482 shall return 0. 15483 15484 Note: The ISO C (1999) standard defines the function 15485 isfinite(), which is more general purpose. The finitef() 15486 function is deprecated, and applications should use 15487 isfinite() instead. A future revision of this standard may 15488 remove this function. 15489 15490 See Also 15491 15492 isfinite(), finite(), finitel() 15493 15494 finitel 15495 15496 Name 15497 15498 finitel -- test for infinity (DEPRECATED) 15499 15500 Synopsis 15501 15502 #define _SVID_SOURCE 15503 #include 15504 15505 int finitel(long double arg); 15506 15507 Description 15508 15509 The finitel() function shall test whether its argument is 15510 neither INFINITY nor not a number (NaN). 15511 15512 Returns 15513 15514 On success, finitel() shall return 1. Otherwise the function 15515 shall return 0. 15516 15517 Note: The ISO C (1999) standard defines the function 15518 isfinite(), which is more general purpose. The finitel() 15519 function is deprecated, and applications should use 15520 isfinite() instead. A future revision of this standard may 15521 remove this function. 15522 15523 See Also 15524 15525 isfinite(), finite(), finitef() 15526 15527 gamma 15528 15529 Name 15530 15531 gamma -- log gamma function (DEPRECATED) 15532 15533 Synopsis 15534 15535 #include 15536 15537 double gammaf(double x); 15538 15539 Description 15540 15541 The gamma() function is identical to lgamma() in ISO POSIX 15542 (2003). 15543 15544 Note: The name gamma() for this function is deprecated and 15545 should not be used. 15546 15547 Returns 15548 15549 See lgamma(). 15550 15551 See Also 15552 15553 lgamma(), lgammaf(), lgammal(), gammaf(), gammal() 15554 15555 gammaf 15556 15557 Name 15558 15559 gammaf -- log gamma function (DEPRECATED) 15560 15561 Synopsis 15562 15563 #include 15564 15565 float gammaf(float x); 15566 15567 Description 15568 15569 The gammaf() function is identical to lgammaf() in ISO POSIX 15570 (2003). 15571 15572 Note: The name gammaf() for this function is deprecated and 15573 should not be used. 15574 15575 Returns 15576 15577 See lgammaf(). 15578 15579 See Also 15580 15581 lgamma(), lgammaf(), lgammal(), gamma(), gammal() 15582 15583 gammal 15584 15585 Name 15586 15587 gammal -- log gamma function (DEPRECATED) 15588 15589 Synopsis 15590 15591 #include 15592 15593 long double gammal(long double x); 15594 15595 Description 15596 15597 The gammal() function is identical to lgammal() in ISO POSIX 15598 (2003). 15599 15600 Note: The name gammal() for this function is deprecated and 15601 should not be used. 15602 15603 Returns 15604 15605 See lgammal(). 15606 15607 See Also 15608 15609 lgamma(), lgammaf(), lgammal(), gamma(), gammaf() 15610 15611 j0f 15612 15613 Name 15614 15615 j0f -- Bessel functions 15616 15617 Synopsis 15618 15619 #include 15620 15621 float j0f(float x); 15622 15623 Description 15624 15625 The j0f() function is identical to j0(), except that the 15626 argument x and the return value is a float. 15627 15628 Returns 15629 15630 See j0(). 15631 15632 See Also 15633 15634 j0(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 15635 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15636 15637 j0l 15638 15639 Name 15640 15641 j0l -- Bessel functions 15642 15643 Synopsis 15644 15645 #include 15646 15647 long double j0l(long double x); 15648 15649 Description 15650 15651 The j0l() function is identical to j0(), except that the 15652 argument x and the return value is a long double. 15653 15654 Returns 15655 15656 See j0(). 15657 15658 See Also 15659 15660 j0(), j0f(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 15661 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15662 15663 j1f 15664 15665 Name 15666 15667 j1f -- Bessel functions 15668 15669 Synopsis 15670 15671 #include 15672 15673 float j1f(float x); 15674 15675 Description 15676 15677 The j1f() function is identical to j1(), except that the 15678 argument x and the return value is a float. 15679 15680 Returns 15681 15682 See j1(). 15683 15684 See Also 15685 15686 j0(), j0f(), j0l(), j1(), j1l(), jn(), jnf(), jnl(), y0(), 15687 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15688 15689 j1l 15690 15691 Name 15692 15693 j1l -- Bessel functions 15694 15695 Synopsis 15696 15697 #include 15698 15699 long double j1l(long double x); 15700 15701 Description 15702 15703 The j1l() function is identical to j1(), except that the 15704 argument x and the return value is a long double. 15705 15706 Returns 15707 15708 See j0(). 15709 15710 See Also 15711 15712 j0(), j0f(), j0l(), j1(), j1f(), jn(), jnf(), jnl(), y0(), 15713 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15714 15715 jnf 15716 15717 Name 15718 15719 jnf -- Bessel functions 15720 15721 Synopsis 15722 15723 #include 15724 15725 float jnf(float x); 15726 15727 Description 15728 15729 The jnf() function is identical to jn(), except that the 15730 argument x and the return value is a float. 15731 15732 Returns 15733 15734 See jn(). 15735 15736 See Also 15737 15738 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnl(), y0(), 15739 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15740 15741 jnl 15742 15743 Name 15744 15745 jnl -- Bessel functions 15746 15747 Synopsis 15748 15749 #include 15750 15751 long double jnl(long double x); 15752 15753 Description 15754 15755 The jnl() function is identical to jn(), except that the 15756 argument x and the return value is a long double. 15757 15758 Returns 15759 15760 See jn(). 15761 15762 See Also 15763 15764 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), y0(), 15765 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 15766 15767 lgamma_r 15768 15769 Name 15770 15771 lgamma_r -- log gamma functions 15772 15773 Synopsis 15774 15775 #include 15776 15777 double lgamma_r(double x, int * signp); 15778 15779 Description 15780 15781 The lgamma_r() function shall compute the natural logarithm of 15782 the absolute value of the Gamma function, as lgamma(). However, 15783 instead of setting the external integer signgam to the sign of 15784 the Gamma function, lgamma_r() shall set the integer referenced 15785 by signp to the sign. 15786 15787 Returns 15788 15789 See lgamma() and signgam. 15790 15791 See Also 15792 15793 lgamma(), lgammaf_r(), lgammal_r(), signgam 15794 15795 lgammaf_r 15796 15797 Name 15798 15799 lgammaf_r -- log gamma functions 15800 15801 Synopsis 15802 15803 #include 15804 15805 float lgammaf_r(float x, int * signp); 15806 15807 Description 15808 15809 The lgammaf_r() function shall compute the natural logarithm of 15810 the absolute value of the Gamma function, as lgammaf(). 15811 However, instead of setting the external integer signgam to the 15812 sign of the Gamma function, lgammaf_r() shall set the integer 15813 referenced by signp to the sign. 15814 15815 Returns 15816 15817 See lgammaf() and signgam. 15818 15819 See Also 15820 15821 lgamma(), lgamma_r(), lgammal_r(), signgam 15822 15823 lgammal_r 15824 15825 Name 15826 15827 lgammal_r -- log gamma functions 15828 15829 Synopsis 15830 15831 #include 15832 15833 double lgammal_r(double x, int * signp); 15834 15835 Description 15836 15837 The lgammal_r() function shall compute the natural logarithm of 15838 the absolute value of the Gamma function, as lgammal(). 15839 However, instead of setting the external integer signgam to the 15840 sign of the Gamma function, lgammal_r() shall set the integer 15841 referenced by signp to the sign. 15842 15843 Returns 15844 15845 See lgammal() and signgam. 15846 15847 See Also 15848 15849 lgamma(), lgamma_r(), lgammaf_r(), signgam 15850 15851 pow10 15852 15853 Name 15854 15855 pow10 -- Base-10 power function 15856 15857 Synopsis 15858 15859 #include 15860 15861 double pow10(double x); 15862 15863 Description 15864 15865 The pow10() function shall return 10^x. 15866 15867 Note: This function is identical to exp10(). 15868 15869 Returns 15870 15871 Upon successful completion, pow10() shall return 10 rised to 15872 the power of x. 15873 15874 If the correct value would cause overflow, a range error shall 15875 occur and pow10() shall return ±HUGE_VAL, with the same sign as 15876 the correct value of the function. 15877 15878 See Also 15879 15880 exp10(), pow10f(), pow10l() 15881 15882 pow10f 15883 15884 Name 15885 15886 pow10f -- Base-10 power function 15887 15888 Synopsis 15889 15890 #include 15891 15892 float pow10f(float x); 15893 15894 Description 15895 15896 The pow10f() function shall return 10^x. 15897 15898 Note: This function is identical to exp10f(). 15899 15900 Returns 15901 15902 Upon successful completion, pow10f() shall return 10 rised to 15903 the power of x. 15904 15905 If the correct value would cause overflow, a range error shall 15906 occur and pow10f() shall return ±HUGE_VALF, with the same sign 15907 as the correct value of the function. 15908 15909 See Also 15910 15911 exp10f(), pow10(), pow10l() 15912 15913 pow10l 15914 15915 Name 15916 15917 pow10l -- Base-10 power function 15918 15919 Synopsis 15920 15921 #include 15922 15923 long double pow10l(long double x); 15924 15925 Description 15926 15927 The pow10l() function shall return 10^x. 15928 15929 Note: This function is identical to exp10l(). 15930 15931 Returns 15932 15933 Upon successful completion, pow10l() shall return 10 rised to 15934 the power of x. 15935 15936 If the correct value would cause overflow, a range error shall 15937 occur and pow10l() shall return ±HUGE_VALL, with the same sign 15938 as the correct value of the function. 15939 15940 See Also 15941 15942 exp10l(), pow10(), pow10f() 15943 15944 significand 15945 15946 Name 15947 15948 significand -- floating point mantissa 15949 15950 Synopsis 15951 15952 #include 15953 15954 double significand(double x); 15955 15956 Description 15957 15958 The significand() function shall return the mantissa of x, sig 15959 such that x =3 sig × 2^n scaled such that 1 <= sig < 2. 15960 15961 Note: This function is intended for testing confomance to 15962 IEC 60559/IEEE 754 Floating Point, and its use is not 15963 otherwise recommended. 15964 15965 This function is equivalent to scalb(x, (double)-ilogb(x)). 15966 15967 Returns 15968 15969 Upon successful completion, significand() shall return the 15970 mantissa of x in the range 1 <= sig < 2. 15971 15972 If x is 0, ±HUGE_VAL, or NaN, the result is undefined. 15973 15974 See Also 15975 15976 significandf(), significandl() 15977 15978 significandf 15979 15980 Name 15981 15982 significandf -- floating point mantissa 15983 15984 Synopsis 15985 15986 #include 15987 15988 float significandf(float x); 15989 15990 Description 15991 15992 The significandf() function shall return the mantissa of x, sig 15993 such that x =3 sig × 2^n scaled such that 1 <= sig < 2. 15994 15995 Note: This function is intended for testing confomance to 15996 IEC 60559/IEEE 754 Floating Point, and its use is not 15997 otherwise recommended. 15998 15999 This function is equivalent to scalb(x, (double)-ilogb(x)). 16000 16001 Returns 16002 16003 Upon successful completion, significandf() shall return the 16004 mantissa of x in the range 1 <= sig < 2. 16005 16006 If x is 0, ±HUGE_VALF, or NaN, the result is undefined. 16007 16008 See Also 16009 16010 significand(), significandl() 16011 16012 significandl 16013 16014 Name 16015 16016 significandl -- floating point mantissa 16017 16018 Synopsis 16019 16020 #include 16021 16022 long double significandl(long double x); 16023 16024 Description 16025 16026 The significandl() function shall return the mantissa of x, sig 16027 such that x =3 sig × 2^n scaled such that 1 <= sig < 2. 16028 16029 Note: This function is intended for testing confomance to 16030 IEC 60559/IEEE 754 Floating Point, and its use is not 16031 otherwise recommended. 16032 16033 This function is equivalent to scalb(x, (double)-ilogb(x)). 16034 16035 Returns 16036 16037 Upon successful completion, significandl() shall return the 16038 mantissa of x in the range 1 <= sig < 2. 16039 16040 If x is 0, ±HUGE_VALL, or NaN, the result is undefined. 16041 16042 See Also 16043 16044 significand(), significandf() 16045 16046 sincos 16047 16048 Name 16049 16050 sincos -- trigonometric functions 16051 16052 Synopsis 16053 16054 #define _GNU_SOURCE 16055 #include 16056 16057 void sincos(double x, double * sin, double * cos); 16058 16059 Description 16060 16061 The sincos() function shall calculate both the sine and cosine 16062 of x. The sine shall be stored in the location referenced by 16063 sin, and the cosine in the location referenced by cosine. 16064 16065 Returns 16066 16067 None. See sin() and cos() for possible error conditions. 16068 16069 See Also 16070 16071 cos(), sin(), sincosf(), sincosl() 16072 16073 sincosf 16074 16075 Name 16076 16077 sincosf -- trigonometric functions 16078 16079 Synopsis 16080 16081 #define _GNU_SOURCE 16082 #include 16083 16084 void sincosf(float x, float * sin, float * cos); 16085 16086 Description 16087 16088 The sincosf() function shall calculate both the sine and cosine 16089 of x. The sine shall be stored in the location referenced by 16090 sin, and the cosine in the location referenced by cosine. 16091 16092 Returns 16093 16094 None. See sin() and cos() for possible error conditions. 16095 16096 See Also 16097 16098 cos(), sin(), sincos(), sincosl() 16099 16100 sincosl 16101 16102 Name 16103 16104 sincosl -- trigonometric functions 16105 16106 Synopsis 16107 16108 #define _GNU_SOURCE 16109 #include 16110 16111 void sincosl(long double x, long double * sin, long double * 16112 cos); 16113 16114 Description 16115 16116 The sincosl() function shall calculate both the sine and cosine 16117 of x. The sine shall be stored in the location referenced by 16118 sin, and the cosine in the location referenced by cosine. 16119 16120 Returns 16121 16122 None. See sin() and cos() for possible error conditions. 16123 16124 See Also 16125 16126 cos(), sin(), sincos(), sincosl() 16127 16128 y0f 16129 16130 Name 16131 16132 y0f -- Bessel functions 16133 16134 Synopsis 16135 16136 #include 16137 16138 float y0f(float x); 16139 16140 Description 16141 16142 The y0f() function is identical to y0(), except that the 16143 argument x and the return value is a float. 16144 16145 Returns 16146 16147 See y0(). 16148 16149 See Also 16150 16151 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16152 y0(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 16153 16154 y0l 16155 16156 Name 16157 16158 y0l -- Bessel functions 16159 16160 Synopsis 16161 16162 #include 16163 16164 long double y0l(long double x); 16165 16166 Description 16167 16168 The y0l() function is identical to y0(), except that the 16169 argument x and the return value is a long double. 16170 16171 Returns 16172 16173 See y0(). 16174 16175 See Also 16176 16177 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16178 y0(), y0f(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 16179 16180 y1f 16181 16182 Name 16183 16184 y1f -- Bessel functions 16185 16186 Synopsis 16187 16188 #include 16189 16190 float y1f(float x); 16191 16192 Description 16193 16194 The y1f() function is identical to y1(), except that the 16195 argument x and the return value is a float. 16196 16197 Returns 16198 16199 See y1(). 16200 16201 See Also 16202 16203 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16204 y0(), y0f(), y0l(), y1(), y1l(), yn(), ynf(), ynl() 16205 16206 y1l 16207 16208 Name 16209 16210 y1l -- Bessel functions 16211 16212 Synopsis 16213 16214 #include 16215 16216 long double y1l(long double x); 16217 16218 Description 16219 16220 The y1l() function is identical to y1(), except that the 16221 argument x and the return value is a long double. 16222 16223 Returns 16224 16225 See j0(). 16226 16227 See Also 16228 16229 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16230 y0(), y0f(), y0l(), y1(), y1f(), yn(), ynf(), ynl() 16231 16232 ynf 16233 16234 Name 16235 16236 ynf -- Bessel functions 16237 16238 Synopsis 16239 16240 #include 16241 16242 float ynf(float x); 16243 16244 Description 16245 16246 The ynf() function is identical to yn(), except that the 16247 argument x and the return value is a float. 16248 16249 Returns 16250 16251 See yn(). 16252 16253 See Also 16254 16255 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16256 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynl() 16257 16258 ynl 16259 16260 Name 16261 16262 ynl -- Bessel functions 16263 16264 Synopsis 16265 16266 #include 16267 16268 long double ynl(long double x); 16269 16270 Description 16271 16272 The ynl() function is identical to yn(), except that the 16273 argument x and the return value is a long double. 16274 16275 Returns 16276 16277 See yn(). 16278 16279 See Also 16280 16281 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 16282 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf() 16283 __________________________________________________________ 16284 16285 13.9. Interfaces for libpthread 16286 16287 Table 13-37 defines the library name and shared object name for 16288 the libpthread library 16289 16290 Table 13-37. libpthread Definition 16291 Library: libpthread 16292 SONAME: libpthread.so.0 16293 16294 The behavior of the interfaces in this library is specified by 16295 the following specifications: 16296 16297 [LFS] Large File Support 16298 [LSB] This Specification 16299 [SUSv3] ISO POSIX (2003) 16300 __________________________________________________________ 16301 16302 13.9.1. Realtime Threads 16303 __________________________________________________________ 16304 16305 13.9.1.1. Interfaces for Realtime Threads 16306 16307 An LSB conforming implementation shall provide the generic 16308 functions for Realtime Threads specified in Table 13-38, with 16309 the full mandatory functionality as described in the referenced 16310 underlying specification. 16311 16312 Table 13-38. libpthread - Realtime Threads Function Interfaces 16313 pthread_attr_getinheritsched [SUSv3] 16314 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 16315 [SUSv3] pthread_attr_setinheritsched [SUSv3] 16316 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 16317 [SUSv3] pthread_getschedparam [SUSv3] pthread_setschedparam 16318 [SUSv3] 16319 pthread_setschedprio(GLIBC_2.3.4) [SUSv3] 16320 __________________________________________________________ 16321 16322 13.9.2. Advanced Realtime Threads 16323 __________________________________________________________ 16324 16325 13.9.2.1. Interfaces for Advanced Realtime Threads 16326 16327 An LSB conforming implementation shall provide the generic 16328 functions for Advanced Realtime Threads specified in Table 16329 13-39, with the full mandatory functionality as described in 16330 the referenced underlying specification. 16331 16332 Table 13-39. libpthread - Advanced Realtime Threads Function 16333 Interfaces 16334 pthread_barrier_destroy [SUSv3] pthread_barrier_init [SUSv3] 16335 pthread_barrier_wait [SUSv3] pthread_barrierattr_destroy 16336 [SUSv3] 16337 pthread_barrierattr_getpshared(GLIBC_2.3.3) [SUSv3] 16338 pthread_barrierattr_init [SUSv3] pthread_barrierattr_setpshared 16339 [SUSv3] pthread_getcpuclockid [SUSv3] 16340 pthread_spin_destroy [SUSv3] pthread_spin_init [SUSv3] 16341 pthread_spin_lock [SUSv3] pthread_spin_trylock [SUSv3] 16342 pthread_spin_unlock [SUSv3] 16343 __________________________________________________________ 16344 16345 13.9.3. Posix Threads 16346 __________________________________________________________ 16347 16348 13.9.3.1. Interfaces for Posix Threads 16349 16350 An LSB conforming implementation shall provide the generic 16351 functions for Posix Threads specified in Table 13-40, with the 16352 full mandatory functionality as described in the referenced 16353 underlying specification. 16354 16355 Table 13-40. libpthread - Posix Threads Function Interfaces 16356 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 16357 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 16358 [SUSv3] 16359 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 16360 [SUSv3] pthread_attr_getstack [SUSv3] pthread_attr_getstackaddr 16361 [SUSv3] 16362 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 16363 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 16364 [SUSv3] 16365 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 16366 [SUSv3] pthread_attr_setstackaddr [SUSv3] 16367 pthread_attr_setstacksize [SUSv3] 16368 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 16369 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 16370 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 16371 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 16372 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 16373 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 16374 [SUSv3] 16375 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 16376 [SUSv3] pthread_getconcurrency [SUSv3] 16377 pthread_getspecific [SUSv3] pthread_join [SUSv3] 16378 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 16379 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 16380 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 16381 pthread_mutex_timedlock [SUSv3] pthread_mutex_trylock [SUSv3] 16382 pthread_mutex_unlock [SUSv3] pthread_mutexattr_destroy [SUSv3] 16383 pthread_mutexattr_getpshared [SUSv3] pthread_mutexattr_gettype 16384 [SUSv3] pthread_mutexattr_init [SUSv3] 16385 pthread_mutexattr_setpshared [SUSv3] 16386 pthread_mutexattr_settype [SUSv3] pthread_once [SUSv3] 16387 pthread_rwlock_destroy [SUSv3] pthread_rwlock_init [SUSv3] 16388 pthread_rwlock_rdlock [SUSv3] pthread_rwlock_timedrdlock 16389 [SUSv3] pthread_rwlock_timedwrlock [SUSv3] 16390 pthread_rwlock_tryrdlock [SUSv3] 16391 pthread_rwlock_trywrlock [SUSv3] pthread_rwlock_unlock [SUSv3] 16392 pthread_rwlock_wrlock [SUSv3] pthread_rwlockattr_destroy 16393 [SUSv3] 16394 pthread_rwlockattr_getpshared [SUSv3] pthread_rwlockattr_init 16395 [SUSv3] pthread_rwlockattr_setpshared [SUSv3] pthread_self 16396 [SUSv3] 16397 pthread_setcancelstate [SUSv3] pthread_setcanceltype [SUSv3] 16398 pthread_setconcurrency [SUSv3] pthread_setspecific [SUSv3] 16399 pthread_sigmask [SUSv3] pthread_testcancel [SUSv3] sem_close 16400 [SUSv3] sem_destroy [SUSv3] 16401 sem_getvalue [SUSv3] sem_init [SUSv3] sem_open [SUSv3] sem_post 16402 [SUSv3] 16403 sem_timedwait [SUSv3] sem_trywait [SUSv3] sem_unlink [SUSv3] 16404 sem_wait [SUSv3] 16405 16406 An LSB conforming implementation shall provide the generic 16407 deprecated functions for Posix Threads specified in Table 16408 13-41, with the full mandatory functionality as described in 16409 the referenced underlying specification. 16410 16411 Note: These interfaces are deprecated, and applications 16412 should avoid using them. These interfaces may be withdrawn 16413 in future releases of this specification. 16414 16415 Table 13-41. libpthread - Posix Threads Deprecated Function 16416 Interfaces 16417 pthread_attr_getstackaddr [SUSv3] pthread_attr_setstackaddr 16418 [SUSv3] 16419 __________________________________________________________ 16420 16421 13.9.4. Thread aware versions of libc interfaces 16422 __________________________________________________________ 16423 16424 13.9.4.1. Interfaces for Thread aware versions of libc interfaces 16425 16426 An LSB conforming implementation shall provide the generic 16427 functions for Thread aware versions of libc interfaces 16428 specified in Table 13-42, with the full mandatory functionality 16429 as described in the referenced underlying specification. 16430 16431 Table 13-42. libpthread - Thread aware versions of libc 16432 interfaces Function Interfaces 16433 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LFS] 16434 pwrite [SUSv3] pwrite64 [LFS] 16435 __________________________________________________________ 16436 16437 13.10. Data Definitions for libpthread 16438 16439 This section defines global identifiers and their values that 16440 are associated with interfaces contained in libpthread. These 16441 definitions are organized into groups that correspond to system 16442 headers. This convention is used as a convenience for the 16443 reader, and does not imply the existence of these headers, or 16444 their content. Where an interface is defined as requiring a 16445 particular system header file all of the data definitions for 16446 that system header file presented here shall be in effect. 16447 16448 This section gives data definitions to promote binary 16449 application portability, not to repeat source interface 16450 definitions available elsewhere. System providers and 16451 application developers should use this ABI to supplement - not 16452 to replace - source interface definition specifications. 16453 16454 This specification uses the ISO C (1999) C Language as the 16455 reference programming language, and data definitions are 16456 specified in ISO C format. The C language is used here as a 16457 convenient notation. Using a C language description of these 16458 data objects does not preclude their use by other programming 16459 languages. 16460 __________________________________________________________ 16461 16462 13.10.1. pthread.h 16463 16464 #define PTHREAD_MUTEX_DEFAULT 0 16465 #define PTHREAD_MUTEX_NORMAL 0 16466 #define PTHREAD_SCOPE_SYSTEM 0 16467 #define PTHREAD_MUTEX_RECURSIVE 1 16468 #define PTHREAD_SCOPE_PROCESS 1 16469 #define PTHREAD_MUTEX_ERRORCHECK 2 16470 #define PTHREAD_RWLOCK_DEFAULT_NP 2 16471 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 16472 #define PTHREAD_MUTEX_INITIALIZER \ 16473 {0,0,0,PTHREAD_MUTEX_NORMAL,__LOCK_INITIALIZER} 16474 #define PTHREAD_RWLOCK_INITIALIZER \ 16475 { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP,\ 16476 PTHREAD_PROCESS_PRIVATE } 16477 #define pthread_cleanup_push(routine,arg) \ 16478 {struct _pthread_cleanup_buffer _buffer;\ 16479 _pthread_cleanup_push(&_buffer,(routine),(arg)); 16480 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 16481 #define __LOCK_INITIALIZER { 0, 0 } 16482 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 16483 16484 struct _pthread_cleanup_buffer { 16485 void (*__routine) (void *); 16486 void *__arg; 16487 int __canceltype; 16488 struct _pthread_cleanup_buffer *__prev; 16489 }; 16490 typedef unsigned int pthread_key_t; 16491 typedef int pthread_once_t; 16492 typedef long long int __pthread_cond_align_t; 16493 typedef volatile int pthread_spinlock_t; 16494 typedef union { 16495 char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; 16496 int __align; 16497 } pthread_barrierattr_t; 16498 16499 typedef unsigned long int pthread_t; 16500 struct _pthread_fastlock { 16501 long int __status; 16502 int __spinlock; 16503 }; 16504 16505 typedef struct _pthread_descr_struct *_pthread_descr; 16506 16507 typedef struct { 16508 int __m_reserved; 16509 int __m_count; 16510 _pthread_descr __m_owner; 16511 int __m_kind; 16512 struct _pthread_fastlock __m_lock; 16513 } pthread_mutex_t; 16514 typedef struct { 16515 int __mutexkind; 16516 } pthread_mutexattr_t; 16517 16518 typedef struct { 16519 int __detachstate; 16520 int __schedpolicy; 16521 struct sched_param __schedparam; 16522 int __inheritsched; 16523 int __scope; 16524 size_t __guardsize; 16525 int __stackaddr_set; 16526 void *__stackaddr; 16527 unsigned long int __stacksize; 16528 } pthread_attr_t; 16529 16530 typedef struct { 16531 struct _pthread_fastlock __c_lock; 16532 _pthread_descr __c_waiting; 16533 char __padding[48 - sizeof(struct _pthread_fastlock) - 16534 sizeof(_pthread_descr) - 16535 sizeof(__pthread_cond_align_t)]; 16536 __pthread_cond_align_t __align; 16537 } pthread_cond_t; 16538 typedef struct { 16539 int __dummy; 16540 } pthread_condattr_t; 16541 16542 typedef struct _pthread_rwlock_t { 16543 struct _pthread_fastlock __rw_lock; 16544 int __rw_readers; 16545 _pthread_descr __rw_writer; 16546 _pthread_descr __rw_read_waiting; 16547 _pthread_descr __rw_write_waiting; 16548 int __rw_kind; 16549 int __rw_pshared; 16550 } pthread_rwlock_t; 16551 typedef struct { 16552 int __lockkind; 16553 int __pshared; 16554 } pthread_rwlockattr_t; 16555 16556 #define PTHREAD_CREATE_JOINABLE 0 16557 #define PTHREAD_INHERIT_SCHED 0 16558 #define PTHREAD_ONCE_INIT 0 16559 #define PTHREAD_PROCESS_PRIVATE 0 16560 #define PTHREAD_CREATE_DETACHED 1 16561 #define PTHREAD_EXPLICIT_SCHED 1 16562 #define PTHREAD_PROCESS_SHARED 1 16563 16564 #define PTHREAD_CANCELED ((void*)-1) 16565 #define PTHREAD_CANCEL_DEFERRED 0 16566 #define PTHREAD_CANCEL_ENABLE 0 16567 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 16568 #define PTHREAD_CANCEL_DISABLE 1 16569 16570 extern int pthread_barrier_destroy(pthread_barrier_t *); 16571 extern int pthread_barrier_init(pthread_barrier_t *, 16572 const pthread_barrierattr_t *, 16573 unsigned int); 16574 extern int pthread_barrier_wait(pthread_barrier_t *); 16575 extern int pthread_barrierattr_destroy(pthread_barrierattr_t *); 16576 extern int pthread_barrierattr_init(pthread_barrierattr_t *); 16577 extern int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); 16578 extern int pthread_getcpuclockid(pthread_t, clockid_t *); 16579 extern int pthread_spin_destroy(pthread_spinlock_t *); 16580 extern int pthread_spin_init(pthread_spinlock_t *, int); 16581 extern int pthread_spin_lock(pthread_spinlock_t *); 16582 extern int pthread_spin_trylock(pthread_spinlock_t *); 16583 extern int pthread_spin_unlock(pthread_spinlock_t *); 16584 extern int pthread_mutex_timedlock(pthread_mutex_t *, 16585 const struct timespec *); 16586 extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, 16587 int *); 16588 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 16589 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 16590 void (*__pshared) (void *) 16591 , void *); 16592 extern int pthread_attr_destroy(pthread_attr_t *); 16593 extern int pthread_attr_getdetachstate(const pthread_attr_t *, int *); 16594 extern int pthread_attr_getinheritsched(const pthread_attr_t *, int *); 16595 extern int pthread_attr_getschedparam(const pthread_attr_t *, 16596 struct sched_param *); 16597 extern int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); 16598 extern int pthread_attr_getscope(const pthread_attr_t *, int *); 16599 extern int pthread_attr_init(pthread_attr_t *); 16600 extern int pthread_attr_setdetachstate(pthread_attr_t *, int); 16601 extern int pthread_attr_setinheritsched(pthread_attr_t *, int); 16602 extern int pthread_attr_setschedparam(pthread_attr_t *, 16603 const struct sched_param *); 16604 extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); 16605 extern int pthread_attr_setscope(pthread_attr_t *, int); 16606 extern int pthread_cancel(pthread_t); 16607 extern int pthread_cond_broadcast(pthread_cond_t *); 16608 extern int pthread_cond_destroy(pthread_cond_t *); 16609 extern int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t*); 16610 extern int pthread_cond_signal(pthread_cond_t *); 16611 extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, 16612 const struct timespec *); 16613 extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); 16614 extern int pthread_condattr_destroy(pthread_condattr_t *); 16615 extern int pthread_condattr_init(pthread_condattr_t *); 16616 extern int pthread_create(pthread_t *, const pthread_attr_t *, 16617 void *(*__pshared) (void *p1) 16618 , void *); 16619 extern int pthread_detach(pthread_t); 16620 extern int pthread_equal(pthread_t, pthread_t); 16621 extern void pthread_exit(void *); 16622 extern int pthread_getschedparam(pthread_t, int *, struct sched_param *); 16623 extern void *pthread_getspecific(pthread_key_t); 16624 extern int pthread_join(pthread_t, void **); 16625 extern int pthread_key_create(pthread_key_t *, void (*__pshared) (void *) 16626 ); 16627 extern int pthread_key_delete(pthread_key_t); 16628 extern int pthread_mutex_destroy(pthread_mutex_t *); 16629 extern int pthread_mutex_init(pthread_mutex_t *, 16630 const pthread_mutexattr_t *); 16631 extern int pthread_mutex_lock(pthread_mutex_t *); 16632 extern int pthread_mutex_trylock(pthread_mutex_t *); 16633 extern int pthread_mutex_unlock(pthread_mutex_t *); 16634 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); 16635 extern int pthread_mutexattr_init(pthread_mutexattr_t *); 16636 extern int pthread_once(pthread_once_t *, void (*__pshared) (void) 16637 ); 16638 extern int pthread_rwlock_destroy(pthread_rwlock_t *); 16639 extern int pthread_rwlock_init(pthread_rwlock_t *, 16640 const pthread_rwlockattr_t *); 16641 extern int pthread_rwlock_rdlock(pthread_rwlock_t *); 16642 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); 16643 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); 16644 extern int pthread_rwlock_unlock(pthread_rwlock_t *); 16645 extern int pthread_rwlock_wrlock(pthread_rwlock_t *); 16646 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); 16647 extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, 16648 int *); 16649 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); 16650 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); 16651 extern pthread_t pthread_self(void); 16652 extern int pthread_setcancelstate(int, int *); 16653 extern int pthread_setcanceltype(int, int *); 16654 extern int pthread_setschedparam(pthread_t, int, 16655 const struct sched_param *); 16656 extern int pthread_setspecific(pthread_key_t, const void *); 16657 extern void pthread_testcancel(void); 16658 extern int pthread_attr_getguardsize(const pthread_attr_t *, size_t *); 16659 extern int pthread_attr_setguardsize(pthread_attr_t *, size_t); 16660 extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); 16661 extern int pthread_attr_getstackaddr(const pthread_attr_t *, void **); 16662 extern int pthread_attr_setstacksize(pthread_attr_t *, size_t); 16663 extern int pthread_attr_getstacksize(const pthread_attr_t *, size_t *); 16664 extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *, int *); 16665 extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); 16666 extern int pthread_getconcurrency(void); 16667 extern int pthread_setconcurrency(int); 16668 extern int pthread_attr_getstack(const pthread_attr_t *, void **, 16669 size_t *); 16670 extern int pthread_attr_setstack(pthread_attr_t *, void *, size_t); 16671 extern int pthread_condattr_getpshared(const pthread_condattr_t *, int *); 16672 extern int pthread_condattr_setpshared(pthread_condattr_t *, int); 16673 extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, 16674 int *); 16675 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); 16676 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *, 16677 const struct timespec *); 16678 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *, 16679 const struct timespec *); 16680 extern int __register_atfork(void (*__pshared) (void) 16681 , void (*__pshared) (void) 16682 , void (*__pshared) (void) 16683 , void *); 16684 extern int pthread_setschedprio(pthread_t, int); 16685 __________________________________________________________ 16686 16687 13.10.2. semaphore.h 16688 16689 typedef struct { 16690 struct _pthread_fastlock __sem_lock; 16691 int __sem_value; 16692 _pthread_descr __sem_waiting; 16693 } sem_t; 16694 16695 #define SEM_FAILED ((sem_t*)0) 16696 16697 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 16698 16699 extern int sem_close(sem_t *); 16700 extern int sem_destroy(sem_t *); 16701 extern int sem_getvalue(sem_t *, int *); 16702 extern int sem_init(sem_t *, int, unsigned int); 16703 extern sem_t *sem_open(const char *, int, ...); 16704 extern int sem_post(sem_t *); 16705 extern int sem_trywait(sem_t *); 16706 extern int sem_unlink(const char *); 16707 extern int sem_wait(sem_t *); 16708 extern int sem_timedwait(sem_t *, const struct timespec *); 16709 __________________________________________________________ 16710 16711 13.11. Interface Definitions for libpthread 16712 16713 Table of Contents 16714 _pthread_cleanup_pop -- establish cancellation handlers 16715 _pthread_cleanup_push -- establish cancellation handlers 16716 16717 The interfaces defined on the following pages are included in 16718 libpthread and are defined by this specification. Unless 16719 otherwise noted, these interfaces shall be included in the 16720 source standard. 16721 16722 Other interfaces listed in Section 13.9 shall behave as 16723 described in the referenced base document. 16724 16725 _pthread_cleanup_pop 16726 16727 Name 16728 16729 _pthread_cleanup_pop -- establish cancellation handlers 16730 16731 Synopsis 16732 16733 #include 16734 16735 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 16736 int); 16737 16738 Description 16739 16740 The _pthread_cleanup_pop() function provides an implementation 16741 of the pthread_cleanup_pop() macro described in ISO POSIX 16742 (2003). 16743 16744 The _pthread_cleanup_pop() function is not in the source 16745 standard; it is only in the binary standard. 16746 16747 _pthread_cleanup_push 16748 16749 Name 16750 16751 _pthread_cleanup_push -- establish cancellation handlers 16752 16753 Synopsis 16754 16755 #include 16756 16757 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 16758 void (*) (void *), void *); 16759 16760 Description 16761 16762 The _pthread_cleanup_push() function provides an implementation 16763 of the pthread_cleanup_push() macro described in ISO POSIX 16764 (2003). 16765 16766 The _pthread_cleanup_push() function is not in the source 16767 standard; it is only in the binary standard. 16768 __________________________________________________________ 16769 16770 13.12. Interfaces for libgcc_s 16771 16772 Table 13-43 defines the library name and shared object name for 16773 the libgcc_s library 16774 16775 Table 13-43. libgcc_s Definition 16776 Library: libgcc_s 16777 SONAME: libgcc_s.so.1 16778 __________________________________________________________ 16779 16780 13.12.1. Unwind Library 16781 __________________________________________________________ 16782 16783 13.12.1.1. Interfaces for Unwind Library 16784 16785 No external functions are defined for libgcc_s - Unwind Library 16786 in this part of the specification. See also the relevant 16787 architecture specific part of this specification. 16788 __________________________________________________________ 16789 16790 13.13. Data Definitions for libgcc_s 16791 16792 This section defines global identifiers and their values that 16793 are associated with interfaces contained in libgcc_s. These 16794 definitions are organized into groups that correspond to system 16795 headers. This convention is used as a convenience for the 16796 reader, and does not imply the existence of these headers, or 16797 their content. Where an interface is defined as requiring a 16798 particular system header file all of the data definitions for 16799 that system header file presented here shall be in effect. 16800 16801 This section gives data definitions to promote binary 16802 application portability, not to repeat source interface 16803 definitions available elsewhere. System providers and 16804 application developers should use this ABI to supplement - not 16805 to replace - source interface definition specifications. 16806 16807 This specification uses the ISO C (1999) C Language as the 16808 reference programming language, and data definitions are 16809 specified in ISO C format. The C language is used here as a 16810 convenient notation. Using a C language description of these 16811 data objects does not preclude their use by other programming 16812 languages. 16813 __________________________________________________________ 16814 16815 13.13.1. unwind.h 16816 16817 struct _Unwind_Context; 16818 16819 typedef void *_Unwind_Ptr; 16820 typedef unsigned int _Unwind_Word; 16821 typedef u_int64_t _Unwind_Exception_Class; 16822 16823 typedef enum { 16824 _URC_NO_REASON = 0, 16825 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, 16826 _URC_FATAL_PHASE2_ERROR = 2, 16827 _URC_FATAL_PHASE1_ERROR = 3, 16828 _URC_NORMAL_STOP = 4, 16829 _URC_END_OF_STACK = 5, 16830 _URC_HANDLER_FOUND = 6, 16831 _URC_INSTALL_CONTEXT = 7, 16832 _URC_CONTINUE_UNWIND = 8 16833 } _Unwind_Reason_Code; 16834 16835 typedef void (*_Unwind_Exception_Cleanup_Fn) (enum, 16836 struct _Unwind_Exception *); 16837 16838 struct _Unwind_Exception { 16839 u_int64_t exception_class; 16840 _Unwind_Exception_Cleanup_Fn exception_cleanup; 16841 u_int64_t private_1; 16842 u_int64_t private_2; 16843 }; 16844 16845 #define _UA_SEARCH_PHASE 1 16846 #define _UA_END_OF_STACK 16 16847 #define _UA_CLEANUP_PHASE 2 16848 #define _UA_HANDLER_FRAME 4 16849 #define _UA_FORCE_UNWIND 8 16850 16851 typedef int _Unwind_Action; 16852 __________________________________________________________ 16853 16854 13.14. Interfaces for libdl 16855 16856 Table 13-44 defines the library name and shared object name for 16857 the libdl library 16858 16859 Table 13-44. libdl Definition 16860 Library: libdl 16861 SONAME: libdl.so.2 16862 16863 The behavior of the interfaces in this library is specified by 16864 the following specifications: 16865 16866 [LSB] This Specification 16867 [SUSv3] ISO POSIX (2003) 16868 __________________________________________________________ 16869 16870 13.14.1. Dynamic Loader 16871 __________________________________________________________ 16872 16873 13.14.1.1. Interfaces for Dynamic Loader 16874 16875 An LSB conforming implementation shall provide the generic 16876 functions for Dynamic Loader specified in Table 13-45, with the 16877 full mandatory functionality as described in the referenced 16878 underlying specification. 16879 16880 Table 13-45. libdl - Dynamic Loader Function Interfaces 16881 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 16882 dlsym [LSB] 16883 __________________________________________________________ 16884 16885 13.15. Data Definitions for libdl 16886 16887 This section defines global identifiers and their values that 16888 are associated with interfaces contained in libdl. These 16889 definitions are organized into groups that correspond to system 16890 headers. This convention is used as a convenience for the 16891 reader, and does not imply the existence of these headers, or 16892 their content. Where an interface is defined as requiring a 16893 particular system header file all of the data definitions for 16894 that system header file presented here shall be in effect. 16895 16896 This section gives data definitions to promote binary 16897 application portability, not to repeat source interface 16898 definitions available elsewhere. System providers and 16899 application developers should use this ABI to supplement - not 16900 to replace - source interface definition specifications. 16901 16902 This specification uses the ISO C (1999) C Language as the 16903 reference programming language, and data definitions are 16904 specified in ISO C format. The C language is used here as a 16905 convenient notation. Using a C language description of these 16906 data objects does not preclude their use by other programming 16907 languages. 16908 __________________________________________________________ 16909 16910 13.15.1. dlfcn.h 16911 16912 #define RTLD_NEXT ((void *) -1l) 16913 #define RTLD_LOCAL 0 16914 #define RTLD_LAZY 0x00001 16915 #define RTLD_NOW 0x00002 16916 #define RTLD_GLOBAL 0x00100 16917 16918 typedef struct { 16919 char *dli_fname; 16920 void *dli_fbase; 16921 char *dli_sname; 16922 void *dli_saddr; 16923 } Dl_info; 16924 extern int dladdr(const void *, Dl_info *); 16925 extern int dlclose(void *); 16926 extern char *dlerror(void); 16927 extern void *dlopen(const char *, int); 16928 extern void *dlsym(void *, const char *); 16929 __________________________________________________________ 16930 16931 13.16. Interface Definitions for libdl 16932 16933 Table of Contents 16934 dladdr -- find the shared object containing a given address 16935 dlopen -- open dynamic object 16936 dlsym -- obtain the address of a symbol from a dlopen object 16937 16938 The interfaces defined on the following pages are included in 16939 libdl and are defined by this specification. Unless otherwise 16940 noted, these interfaces shall be included in the source 16941 standard. 16942 16943 Other interfaces listed in Section 13.14 shall behave as 16944 described in the referenced base document. 16945 16946 dladdr 16947 16948 Name 16949 16950 dladdr -- find the shared object containing a given address 16951 16952 Synopsis 16953 16954 #include 16955 16956 typedef struct { 16957 const char *dli_fname; 16958 void *dli_fbase; 16959 const char *dli_sname; 16960 void *dli_saddr; 16961 } Dl_info; 16962 16963 int dladdr(const void * addr, Dl_info * dlip); 16964 16965 Description 16966 16967 The dladdr() function shall query the dynamic linker for 16968 information about the shared object containing the address 16969 addr. The information shall be returned in the user supplied 16970 data structure referenced by dlip. 16971 16972 The structure shall contain at least the following members: 16973 16974 dli_fname 16975 16976 The pathname of the shared object containing the address 16977 dli_fbase 16978 16979 The base address at which the shared object is mapped into the 16980 address space of the calling process. 16981 dli_sname 16982 16983 The name of the nearest runtime symbol with value less than or 16984 equal to addr. Where possible, the symbol name shall be 16985 returned as it would appear in C source code. 16986 16987 If no symbol with a suitable value is found, both this field 16988 and dli_saddr shall be set to NULL. 16989 dli_saddr 16990 16991 The address of the symbol returned in dli_sname. This address 16992 has type "pointer to type", where type is the type of the 16993 symbol dli_sname. 16994 16995 Example: If the symbol in dli_sname is a function, then the 16996 type of dli_saddr is of type "pointer to function". 16997 16998 The behavior of dladdr() is only specified in dynamically 16999 linked programs. 17000 17001 Return Value 17002 17003 On success, dladdr() shall return non-zero, and the structure 17004 referenced by dlip shall be filled in as described. Otherwise, 17005 dladdr() shall return zero, and the cause of the error can be 17006 fetched with dlerror(). 17007 17008 Errors 17009 17010 See dlerror(). 17011 17012 Environment 17013 17014 LD_LIBRARY_PATH 17015 17016 directory search-path for object files 17017 17018 dlopen 17019 17020 Name 17021 17022 dlopen -- open dynamic object 17023 17024 Synopsis 17025 17026 #include 17027 17028 void * dlopen(const char * filename, int flag); 17029 17030 Description 17031 17032 The dlopen() function shall behave as specified in ISO POSIX 17033 (2003), but with additional behaviors listed below. 17034 17035 If the file argument does not contain a slash character, then 17036 the system shall look for a library of that name in at least 17037 the following directories, and use the first one which is 17038 found: 17039 17040 * The directories specified by the DT_RPATH dynamic entry. 17041 * The directories specified in the LD_LIBRARY_PATH 17042 environment variable (which is a colon separated list of 17043 pathnames). This step shall be skipped for setuid and 17044 setgid executables. 17045 * A set of directories sufficient to contain the libraries 17046 specified in this standard. 17047 17048 Note: Traditionally, /lib and /usr/lib. This case would also 17049 cover cases in which the system used the mechanism of 17050 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 17051 Example: An application which is not linked against libm may 17052 choose to dlopen libm. 17053 17054 dlsym 17055 17056 Name 17057 17058 dlsym -- obtain the address of a symbol from a dlopen object 17059 17060 Description 17061 17062 dlsym() is as specified in the ISO POSIX (2003), but with 17063 differences as listed below. 17064 17065 The special purpose value for handle RTLD_NEXT 17066 17067 The value RTLD_NEXT, which is reserved for future use shall be 17068 available, with the behavior as described in ISO POSIX (2003). 17069 __________________________________________________________ 17070 17071 13.17. Interfaces for librt 17072 17073 Table 13-46 defines the library name and shared object name for 17074 the librt library 17075 17076 Table 13-46. librt Definition 17077 Library: librt 17078 SONAME: librt.so.1 17079 17080 The behavior of the interfaces in this library is specified by 17081 the following specifications: 17082 17083 [SUSv3] ISO POSIX (2003) 17084 __________________________________________________________ 17085 17086 13.17.1. Shared Memory Objects 17087 __________________________________________________________ 17088 17089 13.17.1.1. Interfaces for Shared Memory Objects 17090 17091 An LSB conforming implementation shall provide the generic 17092 functions for Shared Memory Objects specified in Table 13-47, 17093 with the full mandatory functionality as described in the 17094 referenced underlying specification. 17095 17096 Table 13-47. librt - Shared Memory Objects Function Interfaces 17097 shm_open [SUSv3] shm_unlink [SUSv3] 17098 __________________________________________________________ 17099 17100 13.17.2. Clock 17101 __________________________________________________________ 17102 17103 13.17.2.1. Interfaces for Clock 17104 17105 An LSB conforming implementation shall provide the generic 17106 functions for Clock specified in Table 13-48, with the full 17107 mandatory functionality as described in the referenced 17108 underlying specification. 17109 17110 Table 13-48. librt - Clock Function Interfaces 17111 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 17112 [SUSv3] clock_nanosleep [SUSv3] 17113 clock_settime [SUSv3] 17114 __________________________________________________________ 17115 17116 13.17.3. Timers 17117 __________________________________________________________ 17118 17119 13.17.3.1. Interfaces for Timers 17120 17121 An LSB conforming implementation shall provide the generic 17122 functions for Timers specified in Table 13-49, with the full 17123 mandatory functionality as described in the referenced 17124 underlying specification. 17125 17126 Table 13-49. librt - Timers Function Interfaces 17127 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 17128 [SUSv3] timer_gettime [SUSv3] 17129 timer_settime [SUSv3] 17130 __________________________________________________________ 17131 17132 13.17.4. Message Queues 17133 __________________________________________________________ 17134 17135 13.17.4.1. Interfaces for Message Queues 17136 17137 An LSB conforming implementation shall provide the generic 17138 functions for Message Queues specified in Table 13-50, with the 17139 full mandatory functionality as described in the referenced 17140 underlying specification. 17141 17142 Table 13-50. librt - Message Queues Function Interfaces 17143 mq_close(GLIBC_2.3.4) [SUSv3] mq_getattr(GLIBC_2.3.4) [SUSv3] 17144 mq_notify(GLIBC_2.3.4) [SUSv3] mq_open(GLIBC_2.3.4) [SUSv3] 17145 mq_receive(GLIBC_2.3.4) [SUSv3] mq_send(GLIBC_2.3.4) [SUSv3] 17146 mq_setattr(GLIBC_2.3.4) [SUSv3] mq_timedreceive(GLIBC_2.3.4) 17147 [SUSv3] 17148 mq_timedsend(GLIBC_2.3.4) [SUSv3] mq_unlink(GLIBC_2.3.4) 17149 [SUSv3] 17150 __________________________________________________________ 17151 17152 13.18. Data Definitions for librt 17153 17154 This section defines global identifiers and their values that 17155 are associated with interfaces contained in librt. These 17156 definitions are organized into groups that correspond to system 17157 headers. This convention is used as a convenience for the 17158 reader, and does not imply the existence of these headers, or 17159 their content. Where an interface is defined as requiring a 17160 particular system header file all of the data definitions for 17161 that system header file presented here shall be in effect. 17162 17163 This section gives data definitions to promote binary 17164 application portability, not to repeat source interface 17165 definitions available elsewhere. System providers and 17166 application developers should use this ABI to supplement - not 17167 to replace - source interface definition specifications. 17168 17169 This specification uses the ISO C (1999) C Language as the 17170 reference programming language, and data definitions are 17171 specified in ISO C format. The C language is used here as a 17172 convenient notation. Using a C language description of these 17173 data objects does not preclude their use by other programming 17174 languages. 17175 __________________________________________________________ 17176 17177 13.18.1. mqueue.h 17178 17179 typedef int mqd_t; 17180 struct mq_attr { 17181 long int mq_flags; 17182 long int mq_maxmsg; 17183 long int mq_msgsize; 17184 long int mq_curmsgs; 17185 long int __pad[4]; 17186 }; 17187 extern int mq_close(mqd_t); 17188 extern int mq_getattr(mqd_t, struct mq_attr *); 17189 extern int mq_notify(mqd_t, const struct sigevent *); 17190 extern mqd_t mq_open(const char *, int, ...); 17191 extern ssize_t mq_receive(mqd_t, char *, size_t, unsigned int *); 17192 extern int mq_send(mqd_t, const char *, size_t, unsigned int); 17193 extern int mq_setattr(mqd_t, const struct mq_attr *, struct mq_attr *); 17194 extern ssize_t mq_timedreceive(mqd_t, char *, size_t, unsigned int *, 17195 const struct timespec *); 17196 extern int mq_timedsend(mqd_t, const char *, size_t, unsigned int, 17197 const struct timespec *); 17198 extern int mq_unlink(const char *); 17199 __________________________________________________________ 17200 17201 13.19. Interfaces for libcrypt 17202 17203 Table 13-51 defines the library name and shared object name for 17204 the libcrypt library 17205 17206 Table 13-51. libcrypt Definition 17207 Library: libcrypt 17208 SONAME: libcrypt.so.1 17209 17210 The behavior of the interfaces in this library is specified by 17211 the following specifications: 17212 17213 [SUSv3] ISO POSIX (2003) 17214 __________________________________________________________ 17215 17216 13.19.1. Encryption 17217 __________________________________________________________ 17218 17219 13.19.1.1. Interfaces for Encryption 17220 17221 An LSB conforming implementation shall provide the generic 17222 functions for Encryption specified in Table 13-52, with the 17223 full mandatory functionality as described in the referenced 17224 underlying specification. 17225 17226 Table 13-52. libcrypt - Encryption Function Interfaces 17227 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 17228 __________________________________________________________ 17229 17230 13.20. Interfaces for libpam 17231 17232 Table 13-53 defines the library name and shared object name for 17233 the libpam library 17234 17235 Table 13-53. libpam Definition 17236 Library: libpam 17237 SONAME: libpam.so.0 17238 17239 The Pluggable Authentication Module (PAM) interfaces allow 17240 applications to request authentication via a system 17241 administrator defined mechanism, known as a service. 17242 17243 A single service name, other, shall always be present. The 17244 behavior of this service shall be determined by the system 17245 administrator. Additional service names may also exist. 17246 17247 Note: Future versions of this specification might define 17248 additional service names. 17249 17250 The behavior of the interfaces in this library is specified by 17251 the following specifications: 17252 17253 [LSB] This Specification 17254 __________________________________________________________ 17255 17256 13.20.1. Pluggable Authentication API 17257 __________________________________________________________ 17258 17259 13.20.1.1. Interfaces for Pluggable Authentication API 17260 17261 An LSB conforming implementation shall provide the generic 17262 functions for Pluggable Authentication API specified in Table 17263 13-54, with the full mandatory functionality as described in 17264 the referenced underlying specification. 17265 17266 Table 13-54. libpam - Pluggable Authentication API Function 17267 Interfaces 17268 pam_acct_mgmt [LSB] pam_authenticate [LSB] pam_chauthtok [LSB] 17269 pam_close_session [LSB] 17270 pam_end [LSB] pam_fail_delay [LSB] pam_get_item [LSB] 17271 pam_getenv [LSB] 17272 pam_getenvlist [LSB] pam_open_session [LSB] pam_putenv [LSB] 17273 pam_set_item [LSB] 17274 pam_setcred [LSB] pam_start [LSB] pam_strerror [LSB] 17275 __________________________________________________________ 17276 17277 13.21. Data Definitions for libpam 17278 17279 This section defines global identifiers and their values that 17280 are associated with interfaces contained in libpam. These 17281 definitions are organized into groups that correspond to system 17282 headers. This convention is used as a convenience for the 17283 reader, and does not imply the existence of these headers, or 17284 their content. Where an interface is defined as requiring a 17285 particular system header file all of the data definitions for 17286 that system header file presented here shall be in effect. 17287 17288 This section gives data definitions to promote binary 17289 application portability, not to repeat source interface 17290 definitions available elsewhere. System providers and 17291 application developers should use this ABI to supplement - not 17292 to replace - source interface definition specifications. 17293 17294 This specification uses the ISO C (1999) C Language as the 17295 reference programming language, and data definitions are 17296 specified in ISO C format. The C language is used here as a 17297 convenient notation. Using a C language description of these 17298 data objects does not preclude their use by other programming 17299 languages. 17300 __________________________________________________________ 17301 17302 13.21.1. security/pam_appl.h 17303 17304 typedef struct pam_handle pam_handle_t; 17305 struct pam_message { 17306 int msg_style; 17307 const char *msg; 17308 }; 17309 struct pam_response { 17310 char *resp; 17311 int resp_retcode; 17312 }; 17313 17314 struct pam_conv { 17315 int (*conv) (int num_msg, const struct pam_message * *msg, 17316 struct pam_response * *resp, void *appdata_ptr); 17317 void *appdata_ptr; 17318 }; 17319 17320 #define PAM_PROMPT_ECHO_OFF 1 17321 #define PAM_PROMPT_ECHO_ON 2 17322 #define PAM_ERROR_MSG 3 17323 #define PAM_TEXT_INFO 4 17324 17325 #define PAM_SERVICE 1 17326 #define PAM_USER 2 17327 #define PAM_TTY 3 17328 #define PAM_RHOST 4 17329 #define PAM_CONV 5 17330 #define PAM_RUSER 8 17331 #define PAM_USER_PROMPT 9 17332 17333 #define PAM_SUCCESS 0 17334 #define PAM_OPEN_ERR 1 17335 #define PAM_USER_UNKNOWN 10 17336 #define PAM_MAXTRIES 11 17337 #define PAM_NEW_AUTHTOK_REQD 12 17338 #define PAM_ACCT_EXPIRED 13 17339 #define PAM_SESSION_ERR 14 17340 #define PAM_CRED_UNAVAIL 15 17341 #define PAM_CRED_EXPIRED 16 17342 #define PAM_CRED_ERR 17 17343 #define PAM_CONV_ERR 19 17344 #define PAM_SYMBOL_ERR 2 17345 #define PAM_AUTHTOK_ERR 20 17346 #define PAM_AUTHTOK_RECOVER_ERR 21 17347 #define PAM_AUTHTOK_LOCK_BUSY 22 17348 #define PAM_AUTHTOK_DISABLE_AGING 23 17349 #define PAM_TRY_AGAIN 24 17350 #define PAM_ABORT 26 17351 #define PAM_AUTHTOK_EXPIRED 27 17352 #define PAM_BAD_ITEM 29 17353 #define PAM_SERVICE_ERR 3 17354 #define PAM_SYSTEM_ERR 4 17355 #define PAM_BUF_ERR 5 17356 #define PAM_PERM_DENIED 6 17357 #define PAM_AUTH_ERR 7 17358 #define PAM_CRED_INSUFFICIENT 8 17359 #define PAM_AUTHINFO_UNAVAIL 9 17360 17361 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 17362 #define PAM_ESTABLISH_CRED 0x0002U 17363 #define PAM_DELETE_CRED 0x0004U 17364 #define PAM_REINITIALIZE_CRED 0x0008U 17365 #define PAM_REFRESH_CRED 0x0010U 17366 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 17367 #define PAM_SILENT 0x8000U 17368 17369 extern int pam_set_item(pam_handle_t *, int, const void *); 17370 extern int pam_get_item(const pam_handle_t *, int, const void **); 17371 extern const char *pam_strerror(pam_handle_t *, int); 17372 extern char **pam_getenvlist(pam_handle_t *); 17373 extern int pam_fail_delay(pam_handle_t *, unsigned int); 17374 extern int pam_start(const char *, const char *, const struct pam_conv *, 17375 pam_handle_t * *); 17376 extern int pam_end(pam_handle_t *, int); 17377 extern int pam_authenticate(pam_handle_t *, int); 17378 extern int pam_setcred(pam_handle_t *, int); 17379 extern int pam_acct_mgmt(pam_handle_t *, int); 17380 extern int pam_open_session(pam_handle_t *, int); 17381 extern int pam_close_session(pam_handle_t *, int); 17382 extern int pam_chauthtok(pam_handle_t *, int); 17383 extern const char *pam_getenv(const pam_handle_t *, const char *); 17384 extern int pam_putenv(const pam_handle_t *, const char *); 17385 __________________________________________________________ 17386 17387 13.22. Interface Definitions for libpam 17388 17389 Table of Contents 17390 pam_acct_mgmt -- establish the status of a user's account 17391 pam_authenticate -- authenticate the user 17392 pam_chauthtok -- change the authentication token for a given 17393 user 17394 17395 pam_close_session -- indicate that an authenticated session has 17396 ended 17397 17398 pam_end -- terminate the use of the PAM library 17399 pam_fail_delay -- specify delay time to use on authentication 17400 error 17401 17402 pam_get_item -- obtain the value of the indicated item. 17403 pam_getenv -- get a PAM environment variable 17404 pam_getenvlist -- returns a pointer to the complete PAM 17405 environment. 17406 17407 pam_open_session -- indicate session has started 17408 pam_putenv -- Add, replace or delete a PAM environment variable 17409 pam_set_item -- (re)set the value of an item. 17410 pam_setcred -- set the module-specific credentials of the user 17411 pam_start -- initialize the PAM library 17412 pam_strerror -- returns a string describing the PAM error 17413 17414 The interfaces defined on the following pages are included in 17415 libpam and are defined by this specification. Unless otherwise 17416 noted, these interfaces shall be included in the source 17417 standard. 17418 17419 Other interfaces listed in Section 13.20 shall behave as 17420 described in the referenced base document. 17421 17422 pam_acct_mgmt 17423 17424 Name 17425 17426 pam_acct_mgmt -- establish the status of a user's account 17427 17428 Synopsis 17429 17430 #include 17431 17432 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 17433 17434 Description 17435 17436 pam_acct_mgmt() establishes the account's usability and the 17437 user's accessibility to the system. It is typically called 17438 after the user has been authenticated. 17439 17440 flags may be specified as any valid flag (namely, one of those 17441 applicable to the flags argument of pam_authenticate()). 17442 Additionally, the value of flags may be logically or'd with 17443 PAM_SILENT. 17444 17445 Return Value 17446 17447 PAM_SUCCESS 17448 17449 Success. 17450 PAM_NEW_AUTHTOK_REQD 17451 17452 User is valid, but user's authentication token has expired. The 17453 correct response to this return-value is to require that the 17454 user satisfy the pam_chauthtok() function before obtaining 17455 service. It may not be possible for an application to do this. 17456 In such a case, the user should be denied access until the 17457 account password is updated. 17458 PAM_ACCT_EXPIRED 17459 17460 User is no longer permitted access to the system. 17461 PAM_AUTH_ERR 17462 17463 Authentication error. 17464 PAM_PERM_DENIED 17465 17466 User is not permitted to gain access at this time. 17467 PAM_USER_UNKNOWN 17468 17469 User is not known to a module's account management component. 17470 17471 Note: Errors may be translated to text with pam_strerror(). 17472 17473 pam_authenticate 17474 17475 Name 17476 17477 pam_authenticate -- authenticate the user 17478 17479 Synopsis 17480 17481 #include 17482 17483 int pam_authenticate(pam_handle_t * pamh, int flags); 17484 17485 Description 17486 17487 pam_authenticate() serves as an interface to the authentication 17488 mechanisms of the loaded modules. 17489 17490 flags is an optional parameter that may be specified by the 17491 following value: 17492 17493 PAM_DISALLOW_NULL_AUTHTOK 17494 Instruct the authentication modules to return 17495 PAM_AUTH_ERR if the user does not have a registered 17496 authorization token. 17497 17498 Additionally, the value of flags may be logically or'd with 17499 PAM_SILENT. 17500 17501 The process may need to be privileged in order to successfully 17502 call this function. 17503 17504 Return Value 17505 17506 PAM_SUCCESS 17507 Success. 17508 17509 PAM_AUTH_ERR 17510 User was not authenticated or process did not have 17511 sufficient privileges to perform authentication. 17512 17513 PAM_CRED_INSUFFICIENT 17514 Application does not have sufficient credentials to 17515 authenticate the user. 17516 17517 PAM_AUTHINFO_UNAVAIL 17518 Modules were not able to access the authentication 17519 information. This might be due to a network or hardware 17520 failure, etc. 17521 17522 PAM_USER_UNKNOWN 17523 Supplied username is not known to the authentication 17524 service. 17525 17526 PAM_MAXTRIES 17527 One or more authentication modules has reached its limit 17528 of tries authenticating the user. Do not try again. 17529 17530 PAM_ABORT 17531 One or more authentication modules failed to load. 17532 17533 Note: Errors may be translated to text with pam_strerror(). 17534 17535 pam_chauthtok 17536 17537 Name 17538 17539 pam_chauthtok -- change the authentication token for a given 17540 user 17541 17542 Synopsis 17543 17544 #include 17545 17546 int pam_chauthtok(pam_handle_t * pamh, const int flags); 17547 17548 Description 17549 17550 pam_chauthtok() is used to change the authentication token for 17551 a given user as indicated by the state associated with the 17552 handle pamh. 17553 17554 flags is an optional parameter that may be specified by the 17555 following value: 17556 17557 PAM_CHANGE_EXPIRED_AUTHTOK 17558 User's authentication token should only be changed if it 17559 has expired. 17560 17561 Additionally, the value of flags may be logically or'd with 17562 PAM_SILENT. 17563 17564 RETURN VALUE 17565 17566 PAM_SUCCESS 17567 Success. 17568 17569 PAM_AUTHTOK_ERR 17570 A module was unable to obtain the new authentication 17571 token. 17572 17573 PAM_AUTHTOK_RECOVER_ERR 17574 A module was unable to obtain the old authentication 17575 token. 17576 17577 PAM_AUTHTOK_LOCK_BUSY 17578 One or more modules were unable to change the 17579 authentication token since it is currently locked. 17580 17581 PAM_AUTHTOK_DISABLE_AGING 17582 Authentication token aging has been disabled for at 17583 least one of the modules. 17584 17585 PAM_PERM_DENIED 17586 Permission denied. 17587 17588 PAM_TRY_AGAIN 17589 Not all modules were in a position to update the 17590 authentication token(s). In such a case, none of the 17591 user's authentication tokens are updated. 17592 17593 PAM_USER_UNKNOWN 17594 User is not known to the authentication token changing 17595 service. 17596 17597 Note: Errors may be translated to text with pam_strerror(). 17598 17599 pam_close_session 17600 17601 Name 17602 17603 pam_close_session -- indicate that an authenticated session has 17604 ended 17605 17606 Synopsis 17607 17608 #include 17609 17610 int pam_close_session(pam_handle_t * pamh, int flags); 17611 17612 Description 17613 17614 pam_close_session() is used to indicate that an authenticated 17615 session has ended. It is used to inform the module that the 17616 user is exiting a session. It should be possible for the PAM 17617 library to open a session and close the same session from 17618 different applications. 17619 17620 flags may have the value PAM_SILENT to indicate that no output 17621 should be generated as a result of this function call. 17622 17623 Return Value 17624 17625 PAM_SUCCESS 17626 17627 Success. 17628 PAM_SESSION_ERR 17629 17630 One of the required loaded modules was unable to close a 17631 session for the user. 17632 17633 Note: Errors may be translated to text with pam_strerror(). 17634 17635 pam_end 17636 17637 Name 17638 17639 pam_end -- terminate the use of the PAM library 17640 17641 Synopsis 17642 17643 #include 17644 17645 int pam_end(pam_handle_t * pamh, int pam_status); 17646 17647 Description 17648 17649 pam_end() terminates use of the PAM library. On success, the 17650 contents of *pamh are no longer valid, and all memory 17651 associated with it is invalid. 17652 17653 Normally, pam_status is passed the value PAM_SUCCESS, but in 17654 the event of an unsuccessful service application, the 17655 appropriate PAM error return value should be used. 17656 17657 Return Value 17658 17659 PAM_SUCCESS 17660 17661 Success. 17662 17663 Note: Errors may be translated to text with pam_strerror(). 17664 17665 pam_fail_delay 17666 17667 Name 17668 17669 pam_fail_delay -- specify delay time to use on authentication 17670 error 17671 17672 Synopsis 17673 17674 #include 17675 17676 int pam_fail_delay(pam_handle_t * pamh, unsigned int 17677 micro_sec); 17678 17679 Description 17680 17681 pam_fail_delay() specifies the minimum delay for the PAM 17682 library to use when an authentication error occurs. The actual 17683 delay can vary by as much at 25%. If this function is called 17684 multiple times, the longest time specified by any of the call 17685 will be used. 17686 17687 The delay is invoked if an authentication error occurs during 17688 the pam_authenticate() or pam_chauthtok() function calls. 17689 17690 Independent of the success of pam_authenticate() or 17691 pam_chauthtok(), the delay time is reset to its default value 17692 of 0 when the PAM library returns control to the application 17693 from these two functions. 17694 17695 Return Value 17696 17697 PAM_SUCCESS 17698 17699 Success. 17700 17701 Note: Errors may be translated to text with pam_strerror(). 17702 17703 pam_get_item 17704 17705 Name 17706 17707 pam_get_item -- obtain the value of the indicated item. 17708 17709 Synopsis 17710 17711 #include 17712 17713 int pam_get_item(const pam_handle_t * pamh, int item_type, 17714 const void * * item); 17715 17716 Description 17717 17718 pam_get_item() obtains the value of the indicated item_type. 17719 The possible values of item_type are the same as listed for 17720 pam_set_item(). 17721 17722 On success, item contains a pointer to the value of the 17723 corresponding item. Note that this is a pointer to the actual 17724 data and should not be free()'d or over-written. 17725 17726 Return Value 17727 17728 PAM_SUCCESS 17729 17730 Success. 17731 PAM_PERM_DENIED 17732 17733 Application passed a NULL pointer for item. 17734 PAM_BAD_ITEM 17735 17736 Application attempted to get an undefined item. 17737 17738 Note: Errors may be translated to text with pam_strerror(). 17739 17740 pam_getenv 17741 17742 Name 17743 17744 pam_getenv -- get a PAM environment variable 17745 17746 Synopsis 17747 17748 #include 17749 17750 const char * pam_getenv(const pam_handle_t * pamh, const char * 17751 name); 17752 17753 Description 17754 17755 The pam_getenv() function shall search the environment 17756 associated with the PAM handle pamh for the environment 17757 variable name. If the specified environment variable cannot be 17758 found, a null pointer shall be returned. The application shall 17759 ensure that it does not modify the string pointed to by the 17760 pam_getenv() function. 17761 17762 Return Value 17763 17764 On success, pam_getenv() returns a pointer to a string of the 17765 form name=value. 17766 17767 pam_getenvlist 17768 17769 Name 17770 17771 pam_getenvlist -- returns a pointer to the complete PAM 17772 environment. 17773 17774 Synopsis 17775 17776 #include 17777 17778 char * const * pam_getenvlist(pam_handle_t * pamh); 17779 17780 Description 17781 17782 pam_getenvlist() returns a pointer to the complete PAM 17783 environment. This pointer points to an array of pointers to 17784 NUL-terminated strings and must be terminated by a NULL 17785 pointer. Each string has the form "name=value". 17786 17787 The PAM library module allocates memory for the returned value 17788 and the associated strings. The calling application is 17789 responsible for freeing this memory. 17790 17791 Return Value 17792 17793 pam_getenvlist() returns an array of string pointers containing 17794 the PAM environment. On error, NULL is returned. 17795 17796 pam_open_session 17797 17798 Name 17799 17800 pam_open_session -- indicate session has started 17801 17802 Synopsis 17803 17804 #include 17805 17806 int pam_open_session(pam_handle_t * pamh, int flags); 17807 17808 Description 17809 17810 The pam_open_session() function is used to indicate that an 17811 authenticated session has begun, after the user has been 17812 identified (see pam_authenticate()) and, if necessary, granted 17813 credentials (see pam_setcred()). It is used to inform the 17814 module that the user is currently in a session. It should be 17815 possible for the PAM library to open a session and close the 17816 same session from different applications. 17817 17818 flags may have the value PAM_SILENT to indicate that no output 17819 be generated as a result of this function call. 17820 17821 Return Value 17822 17823 PAM_SUCCESS 17824 17825 Success. 17826 PAM_SESSION_ERR 17827 17828 One of the loaded modules was unable to open a session for the 17829 user. 17830 17831 Note: Errors may be translated to text with pam_strerror(). 17832 17833 pam_putenv 17834 17835 Name 17836 17837 pam_putenv -- Add, replace or delete a PAM environment variable 17838 17839 Synopsis 17840 17841 #include 17842 17843 int pam_putenv(const pam_handle_t * pamh, const char * 17844 name_value); 17845 17846 Description 17847 17848 The pam_putenv() function shall modify the environment list 17849 associated with pamh. If name_value contains an '=' character, 17850 the characters to the left of the first '=' character represent 17851 the name, and the remaining characters after the '=' represent 17852 the value. 17853 17854 If the name environment variable exists in the environment 17855 associated with pamh, it shall be modified to have the value 17856 value. Otherwise, the name shall be added to the environment 17857 associated with pamh with the value value. 17858 17859 If there is no '=' character in name_value, the variable in the 17860 environment associated with pamh named name_value shall be 17861 deleted. 17862 17863 Return Value 17864 17865 On success, the pam_putenv() function shall return PAM_SUCCESS. 17866 Otherwise the return value indicates the error: 17867 17868 PAM_PERM_DENIED 17869 17870 The name_value argument is a null pointer. 17871 PAM_BAD_ITEM 17872 17873 The PAM environment varable named name_value does not exist and 17874 therefore cannot be deleted. 17875 PAM_ABORT 17876 17877 The PAM handle identifed by pamh is corrupt. 17878 PAM_BUF_ERR 17879 17880 Memory buffer error. 17881 17882 pam_set_item 17883 17884 Name 17885 17886 pam_set_item -- (re)set the value of an item. 17887 17888 Synopsis 17889 17890 #include 17891 17892 int pam_set_item(pam_handle_t * pamh, int item_type, const void 17893 * item); 17894 17895 Description 17896 17897 pam_set_item() (re)sets the value of one of the following 17898 item_types: 17899 17900 PAM_SERVICE 17901 17902 service name 17903 PAM_USER 17904 17905 user name 17906 PAM_TTY 17907 17908 terminal name 17909 17910 The value for a device file should include the /dev/ prefix. 17911 The value for graphical, X-based, applications should be the 17912 $DISPLAY variable. 17913 PAM_RHOST 17914 17915 remote host name 17916 PAM_CONV 17917 17918 conversation structure 17919 PAM_RUSER 17920 17921 remote user name 17922 PAM_USER_PROMPT 17923 17924 string to be used when prompting for a user's name 17925 17926 The default value for this string is Please enter username: . 17927 17928 For all item_types other than PAM_CONV, item is a pointer to a 17929 NULL-terminated character string. In the case of PAM_CONV, item 17930 points to an initialized pam_conv structure. 17931 17932 Return Value 17933 17934 PAM_SUCCESS 17935 17936 Success. 17937 PAM_PERM_DENIED 17938 17939 An attempt was made to replace the conversation structure with 17940 a NULL value. 17941 PAM_BUF_ERR 17942 17943 Function ran out of memory making a copy of the item. 17944 PAM_BAD_ITEM 17945 17946 Application attempted to set an undefined item. 17947 17948 Note: Errors may be translated to text with pam_strerror(). 17949 17950 pam_setcred 17951 17952 Name 17953 17954 pam_setcred -- set the module-specific credentials of the user 17955 17956 Synopsis 17957 17958 #include 17959 17960 extern int pam_setcred(pam_handle_t * pamh, int flags); 17961 17962 Description 17963 17964 pam_setcred() sets the module-specific credentials of the user. 17965 It is usually called after the user has been authenticated, 17966 after the account management function has been called and after 17967 a session has been opened for the user. 17968 17969 flags maybe specified from among the following values: 17970 17971 PAM_ESTABLISH_CRED 17972 set credentials for the authentication service 17973 17974 PAM_DELETE_CRED 17975 delete credentials associated with the authentication 17976 service 17977 17978 PAM_REINITIALIZE_CRED 17979 reinitialize the user credentials 17980 17981 PAM_REFRESH_CRED 17982 extend lifetime of the user credentials 17983 17984 Additionally, the value of flags may be logically or'd with 17985 PAM_SILENT. 17986 17987 Return Value 17988 17989 PAM_SUCCESS 17990 17991 Success. 17992 PAM_CRED_UNAVAIL 17993 17994 Module cannot retrieve the user's credentials. 17995 PAM_CRED_EXPIRED 17996 17997 User's credentials have expired. 17998 PAM_USER_UNKNOWN 17999 18000 User is not known to an authentication module. 18001 PAM_CRED_ERR 18002 18003 Module was unable to set the credentials of the user. 18004 18005 Note: Errors may be translated to text with pam_strerror(). 18006 18007 pam_start 18008 18009 Name 18010 18011 pam_start -- initialize the PAM library 18012 18013 Synopsis 18014 18015 #include 18016 18017 int pam_start(const char * service_name, const char * user, 18018 const struct pam_conv * pam_conversation, pam_handle_t * * 18019 pamh); 18020 18021 Description 18022 18023 pam_start() is used to initialize the PAM library. It must be 18024 called prior to any other usage of the PAM library. On success, 18025 *pamh becomes a handle that provides continuity for successive 18026 calls to the PAM library. pam_start() expects arguments as 18027 follows: the service_name of the program, the username of the 18028 individual to be authenticated, a pointer to an 18029 application-supplied pam_conv structure, and a pointer to a 18030 pam_handle_t pointer. 18031 18032 An application must provide the conversation function used for 18033 direct communication between a loaded module and the 18034 application. The application also typically provides a means 18035 for the module to prompt the user for a password, etc. 18036 18037 The structure, pam_conv, is defined to be, 18038 struct pam_conv { 18039 int (*conv) (int num_msg, 18040 const struct pam_message * *msg, 18041 struct pam_response * *resp, 18042 void *appdata_ptr); 18043 void *appdata_ptr; 18044 }; 18045 18046 It is initialized by the application before it is passed to the 18047 library. The contents of this structure are attached to the 18048 *pamh handle. The point of this argument is to provide a 18049 mechanism for any loaded module to interact directly with the 18050 application program; this is why it is called a conversation 18051 structure. 18052 18053 When a module calls the referenced conv() function, appdata_ptr 18054 is set to the second element of this structure. 18055 18056 The other arguments of a call to conv() concern the information 18057 exchanged by module and application. num_msg holds the length 18058 of the array of pointers passed via msg. On success, the 18059 pointer resp points to an array of num_msg pam_response 18060 structures, holding the application-supplied text. Note that 18061 resp is a struct pam_response array and not an array of 18062 pointers. 18063 18064 Return Value 18065 18066 PAM_SUCCESS 18067 18068 Success. 18069 PAM_BUF_ERR 18070 18071 Memory allocation error. 18072 PAM_ABORT 18073 18074 Internal failure. 18075 18076 ERRORS 18077 18078 May be translated to text with pam_strerror(). 18079 18080 pam_strerror 18081 18082 Name 18083 18084 pam_strerror -- returns a string describing the PAM error 18085 18086 Synopsis 18087 18088 #include 18089 18090 const char * pam_strerror(pam_handle_t * pamh, int errnum); 18091 18092 Description 18093 18094 pam_strerror() returns a string describing the PAM error 18095 associated with errnum. 18096 18097 Return Value 18098 18099 On success, this function returns a description of the 18100 indicated error. The application should not free or modify this 18101 string. Otherwise, a string indicating that the error is 18102 unknown shall be returned. It is unspecified whether or not the 18103 string returned is translated according to the setting of 18104 LC_MESSAGES. 18105 18106 IV. Utility Libraries 18107 18108 Table of Contents 18109 14. Utility Libraries 18110 18111 14.1. Introduction 18112 14.2. Interfaces for libz 18113 18114 14.2.1. Compression Library 18115 18116 14.3. Data Definitions for libz 18117 18118 14.3.1. zlib.h 18119 18120 14.4. Interface Definitions for libz 18121 18122 adler32 -- compute Adler 32 Checksum 18123 compress -- compress data 18124 compress2 -- compress data at a specified level 18125 compressBound -- compute compressed data size 18126 crc32 -- compute CRC-32 Checksum 18127 deflate -- compress data 18128 deflateBound -- compute compressed data size 18129 deflateCopy -- copy compression stream 18130 deflateEnd -- free compression stream state 18131 deflateInit2_ -- initialize compression system 18132 deflateInit_ -- initialize compression system 18133 deflateParams -- set compression parameters 18134 deflateReset -- reset compression stream state 18135 deflateSetDictionary -- initialize compression 18136 dictionary 18137 18138 get_crc_table -- generate a table for crc 18139 calculations 18140 18141 gzclose -- close a compressed file stream 18142 gzdopen -- open a compressed file 18143 gzeof -- check for end-of-file on a compressed file 18144 stream 18145 18146 gzerror -- decode an error on a compressed file 18147 stream 18148 18149 gzflush -- flush a compressed file stream 18150 gzgetc -- read a character from a compressed file 18151 gzgets -- read a string from a compressed file 18152 gzopen -- open a compressed file 18153 gzprintf -- format data and compress 18154 gzputc -- write character to a compressed file 18155 gzputs -- string write to a compressed file 18156 gzread -- read from a compressed file 18157 gzrewind -- reset the file-position indicator on a 18158 compressed file stream 18159 18160 gzseek -- reposition a file-position indicator in a 18161 compressed file stream 18162 18163 gzsetparams -- dynamically set compression 18164 parameters 18165 18166 gztell -- find position on a compressed file stream 18167 gzwrite -- write to a compressed file 18168 inflate -- decompress data 18169 inflateEnd -- free decompression stream state 18170 inflateInit2_ -- initialize decompression system 18171 inflateInit_ -- initialize decompression system 18172 inflateReset -- reset decompression stream state 18173 inflateSetDictionary -- initialize decompression 18174 dictionary 18175 18176 inflateSync -- advance compression stream to next 18177 sync point 18178 18179 inflateSyncPoint -- test for synchronization point 18180 uncompress -- uncompress data 18181 zError -- translate error number to string 18182 zlibVersion -- discover library version at run time 18183 18184 14.5. Interfaces for libncurses 18185 18186 14.5.1. Curses 18187 18188 14.6. Data Definitions for libncurses 18189 18190 14.6.1. curses.h 18191 14.6.2. term.h 18192 18193 14.7. Interfaces for libutil 18194 18195 14.7.1. Utility Functions 18196 18197 14.8. Interface Definitions for libutil 18198 18199 forkpty -- Create a new process attached to an 18200 available pseudo-terminal 18201 18202 login -- login utility function 18203 login_tty -- Prepare a terminal for login 18204 logout -- logout utility function 18205 logwtmp -- append an entry to the wtmp file 18206 openpty -- find and open an available 18207 pseudo-terminal 18208 __________________________________________________________ 18209 18210 Chapter 14. Utility Libraries 18211 18212 14.1. Introduction 18213 18214 An LSB-conforming implementation shall also support the 18215 following utility libraries which are built on top of the 18216 interfaces provided by the base libraries. These libraries 18217 implement common functionality, and hide additional system 18218 dependent information such as file formats and device names. 18219 18220 * libz 18221 * libcurses 18222 * libutil 18223 18224 The structure of the definitions for these libraries follows 18225 the same model as used for Base Libraries. 18226 __________________________________________________________ 18227 18228 14.2. Interfaces for libz 18229 18230 Table 14-1 defines the library name and shared object name for 18231 the libz library 18232 18233 Table 14-1. libz Definition 18234 Library: libz 18235 SONAME: libz.so.1 18236 18237 The behavior of the interfaces in this library is specified by 18238 the following specifications: 18239 18240 [LSB] This Specification 18241 __________________________________________________________ 18242 18243 14.2.1. Compression Library 18244 __________________________________________________________ 18245 18246 14.2.1.1. Interfaces for Compression Library 18247 18248 An LSB conforming implementation shall provide the generic 18249 functions for Compression Library specified in Table 14-2, with 18250 the full mandatory functionality as described in the referenced 18251 underlying specification. 18252 18253 Table 14-2. libz - Compression Library Function Interfaces 18254 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 18255 [LSB] 18256 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 18257 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 18258 deflateParams [LSB] 18259 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 18260 [LSB] gzclose [LSB] 18261 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 18262 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 18263 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 18264 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 18265 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] inflateInit_ 18266 [LSB] 18267 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync [LSB] 18268 inflateSyncPoint [LSB] 18269 uncompress [LSB] zError [LSB] zlibVersion [LSB] 18270 __________________________________________________________ 18271 18272 14.3. Data Definitions for libz 18273 18274 This section defines global identifiers and their values that 18275 are associated with interfaces contained in libz. These 18276 definitions are organized into groups that correspond to system 18277 headers. This convention is used as a convenience for the 18278 reader, and does not imply the existence of these headers, or 18279 their content. Where an interface is defined as requiring a 18280 particular system header file all of the data definitions for 18281 that system header file presented here shall be in effect. 18282 18283 This section gives data definitions to promote binary 18284 application portability, not to repeat source interface 18285 definitions available elsewhere. System providers and 18286 application developers should use this ABI to supplement - not 18287 to replace - source interface definition specifications. 18288 18289 This specification uses the ISO C (1999) C Language as the 18290 reference programming language, and data definitions are 18291 specified in ISO C format. The C language is used here as a 18292 convenient notation. Using a C language description of these 18293 data objects does not preclude their use by other programming 18294 languages. 18295 __________________________________________________________ 18296 18297 14.3.1. zlib.h 18298 18299 In addition to the values below, the zlib.h header shall define 18300 the ZLIB_VERSION macro. This macro may be used to check that 18301 the version of the library at run time matches that at compile 18302 time. 18303 18304 See also the zlibVersion() function, which returns the library 18305 version at run time. The first character of the version at 18306 compile time should always match the first character at run 18307 time. 18308 #define Z_NULL 0 18309 #define MAX_WBITS 15 18310 #define MAX_MEM_LEVEL 9 18311 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy)\ 18312 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 18313 #define deflateInit(strm,level) \ 18314 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 18315 #define inflateInit2(strm,windowBits) \ 18316 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 18317 #define inflateInit(strm) \ 18318 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 18319 18320 typedef char charf; 18321 typedef int intf; 18322 18323 typedef void *voidpf; 18324 typedef unsigned int uInt; 18325 typedef unsigned long int uLong; 18326 typedef uLong uLongf; 18327 typedef void *voidp; 18328 typedef unsigned char Byte; 18329 typedef off_t z_off_t; 18330 typedef void *const voidpc; 18331 18332 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 18333 typedef void (*free_func) (voidpf opaque, voidpf address); 18334 struct internal_state { 18335 int dummy; 18336 }; 18337 typedef Byte Bytef; 18338 typedef uInt uIntf; 18339 18340 typedef struct z_stream_s { 18341 Bytef *next_in; 18342 uInt avail_in; 18343 uLong total_in; 18344 Bytef *next_out; 18345 uInt avail_out; 18346 uLong total_out; 18347 char *msg; 18348 struct internal_state *state; 18349 alloc_func zalloc; 18350 free_func zfree; 18351 voidpf opaque; 18352 int data_type; 18353 uLong adler; 18354 uLong reserved; 18355 } z_stream; 18356 18357 typedef z_stream *z_streamp; 18358 typedef voidp gzFile; 18359 18360 #define Z_NO_FLUSH 0 18361 #define Z_PARTIAL_FLUSH 1 18362 #define Z_SYNC_FLUSH 2 18363 #define Z_FULL_FLUSH 3 18364 #define Z_FINISH 4 18365 #define Z_BLOCK 5 18366 18367 #define Z_ERRNO (-1) 18368 #define Z_STREAM_ERROR (-2) 18369 #define Z_DATA_ERROR (-3) 18370 #define Z_MEM_ERROR (-4) 18371 #define Z_BUF_ERROR (-5) 18372 #define Z_VERSION_ERROR (-6) 18373 #define Z_OK 0 18374 #define Z_STREAM_END 1 18375 #define Z_NEED_DICT 2 18376 18377 #define Z_DEFAULT_COMPRESSION (-1) 18378 #define Z_NO_COMPRESSION 0 18379 #define Z_BEST_SPEED 1 18380 #define Z_BEST_COMPRESSION 9 18381 18382 #define Z_DEFAULT_STRATEGY 0 18383 #define Z_FILTERED 1 18384 #define Z_HUFFMAN_ONLY 2 18385 18386 #define Z_BINARY 0 18387 #define Z_ASCII 1 18388 #define Z_UNKNOWN 2 18389 18390 #define Z_DEFLATED 8 18391 18392 extern int gzread(gzFile, voidp, unsigned int); 18393 extern int gzclose(gzFile); 18394 extern gzFile gzopen(const char *, const char *); 18395 extern gzFile gzdopen(int, const char *); 18396 extern int gzwrite(gzFile, voidpc, unsigned int); 18397 extern int gzflush(gzFile, int); 18398 extern const char *gzerror(gzFile, int *); 18399 extern uLong adler32(uLong, const Bytef *, uInt); 18400 extern int compress(Bytef *, uLongf *, const Bytef *, uLong); 18401 extern int compress2(Bytef *, uLongf *, const Bytef *, uLong, int); 18402 extern uLong crc32(uLong, const Bytef *, uInt); 18403 extern int deflate(z_streamp, int); 18404 extern int deflateCopy(z_streamp, z_streamp); 18405 extern int deflateEnd(z_streamp); 18406 extern int deflateInit2_(z_streamp, int, int, int, int, int, const char*, 18407 int); 18408 extern int deflateInit_(z_streamp, int, const char *, int); 18409 extern int deflateParams(z_streamp, int, int); 18410 extern int deflateReset(z_streamp); 18411 extern int deflateSetDictionary(z_streamp, const Bytef *, uInt); 18412 extern const uLongf *get_crc_table(void); 18413 extern int gzeof(gzFile); 18414 extern int gzgetc(gzFile); 18415 extern char *gzgets(gzFile, char *, int); 18416 extern int gzprintf(gzFile, const char *, ...); 18417 extern int gzputc(gzFile, int); 18418 extern int gzputs(gzFile, const char *); 18419 extern int gzrewind(gzFile); 18420 extern z_off_t gzseek(gzFile, z_off_t, int); 18421 extern int gzsetparams(gzFile, int, int); 18422 extern z_off_t gztell(gzFile); 18423 extern int inflate(z_streamp, int); 18424 extern int inflateEnd(z_streamp); 18425 extern int inflateInit2_(z_streamp, int, const char *, int); 18426 extern int inflateInit_(z_streamp, const char *, int); 18427 extern int inflateReset(z_streamp); 18428 extern int inflateSetDictionary(z_streamp, const Bytef *, uInt); 18429 extern int inflateSync(z_streamp); 18430 extern int inflateSyncPoint(z_streamp); 18431 extern int uncompress(Bytef *, uLongf *, const Bytef *, uLong); 18432 extern const char *zError(int); 18433 extern const char *zlibVersion(void); 18434 extern uLong deflateBound(z_streamp, uLong); 18435 extern uLong compressBound(uLong); 18436 __________________________________________________________ 18437 18438 14.4. Interface Definitions for libz 18439 18440 Table of Contents 18441 adler32 -- compute Adler 32 Checksum 18442 compress -- compress data 18443 compress2 -- compress data at a specified level 18444 compressBound -- compute compressed data size 18445 crc32 -- compute CRC-32 Checksum 18446 deflate -- compress data 18447 deflateBound -- compute compressed data size 18448 deflateCopy -- copy compression stream 18449 deflateEnd -- free compression stream state 18450 deflateInit2_ -- initialize compression system 18451 deflateInit_ -- initialize compression system 18452 deflateParams -- set compression parameters 18453 deflateReset -- reset compression stream state 18454 deflateSetDictionary -- initialize compression dictionary 18455 get_crc_table -- generate a table for crc calculations 18456 gzclose -- close a compressed file stream 18457 gzdopen -- open a compressed file 18458 gzeof -- check for end-of-file on a compressed file stream 18459 gzerror -- decode an error on a compressed file stream 18460 gzflush -- flush a compressed file stream 18461 gzgetc -- read a character from a compressed file 18462 gzgets -- read a string from a compressed file 18463 gzopen -- open a compressed file 18464 gzprintf -- format data and compress 18465 gzputc -- write character to a compressed file 18466 gzputs -- string write to a compressed file 18467 gzread -- read from a compressed file 18468 gzrewind -- reset the file-position indicator on a compressed 18469 file stream 18470 18471 gzseek -- reposition a file-position indicator in a compressed 18472 file stream 18473 18474 gzsetparams -- dynamically set compression parameters 18475 gztell -- find position on a compressed file stream 18476 gzwrite -- write to a compressed file 18477 inflate -- decompress data 18478 inflateEnd -- free decompression stream state 18479 inflateInit2_ -- initialize decompression system 18480 inflateInit_ -- initialize decompression system 18481 inflateReset -- reset decompression stream state 18482 inflateSetDictionary -- initialize decompression dictionary 18483 inflateSync -- advance compression stream to next sync point 18484 inflateSyncPoint -- test for synchronization point 18485 uncompress -- uncompress data 18486 zError -- translate error number to string 18487 zlibVersion -- discover library version at run time 18488 18489 The interfaces defined on the following pages are included in 18490 libz and are defined by this specification. Unless otherwise 18491 noted, these interfaces shall be included in the source 18492 standard. 18493 18494 Other interfaces listed in Section 14.2 shall behave as 18495 described in the referenced base document. 18496 18497 adler32 18498 18499 Name 18500 18501 adler32 -- compute Adler 32 Checksum 18502 18503 Synopsis 18504 18505 #include 18506 18507 uLong adler32(uLong adler, const Bytef * buf, uInt len); 18508 18509 Description 18510 18511 The adler32() function shall compute a running Adler-32 18512 checksum (as described in RFC 1950: ZLIB Compressed Data Format 18513 Specication). On entry, adler is the previous value for the 18514 checksum, and buf shall point to an array of len bytes of data 18515 to be added to this checksum. The adler32() function shall 18516 return the new checksum. 18517 18518 If buf is NULL (or Z_NULL), adler32() shall return the initial 18519 checksum. 18520 18521 Return Value 18522 18523 The adler32() function shall return the new checksum value. 18524 18525 Errors 18526 18527 None defined. 18528 18529 Application Usage (informative) 18530 18531 The following code fragment demonstrates typical usage of the 18532 adler32() function: 18533 uLong adler = adler32(0L, Z_NULL, 0); 18534 18535 while (read_buffer(buffer, length) != EOF) { 18536 adler = adler32(adler, buffer, length); 18537 } 18538 if (adler != original_adler) error(); 18539 18540 compress 18541 18542 Name 18543 18544 compress -- compress data 18545 18546 Synopsis 18547 18548 #include 18549 18550 int compress(Bytef * dest, uLongf * destLen, const Bytef * 18551 source, uLong sourceLen); 18552 18553 Description 18554 18555 The compress() function shall attempt to compress sourceLen 18556 bytes of data in the buffer source, placing the result in the 18557 buffer dest. 18558 18559 On entry, destLen should point to a value describing the size 18560 of the dest buffer. The application should ensure that this 18561 value be at least (sourceLen × 1.001) + 12. On successful exit, 18562 the variable referenced by destLen shall be updated to hold the 18563 length of compressed data in dest. 18564 18565 The compress() function is equivalent to compress2() with a 18566 level of Z_DEFAULT_COMPRESSION. 18567 18568 Return Value 18569 18570 On success, compress() shall return Z_OK. Otherwise, compress() 18571 shall return a value to indicate the error. 18572 18573 Errors 18574 18575 On error, compress() shall return a value as described below: 18576 18577 Z_BUF_ERROR 18578 18579 The buffer dest was not large enough to hold the compressed 18580 data. 18581 Z_MEM_ERROR 18582 18583 Insufficient memory. 18584 18585 compress2 18586 18587 Name 18588 18589 compress2 -- compress data at a specified level 18590 18591 Synopsis 18592 18593 #include 18594 18595 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 18596 source, uLong sourceLen, int level); 18597 18598 Description 18599 18600 The compress2() function shall attempt to compress sourceLen 18601 bytes of data in the buffer source, placing the result in the 18602 buffer dest, at the level described by level. The level 18603 supplied shall be a value between 0 and 9, or the value 18604 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest speed, 18605 while a level of 9 requests the highest compression. A level of 18606 0 indicates that no compression should be used, and the output 18607 shall be the same as the input. 18608 18609 On entry, destLen should point to a value describing the size 18610 of the dest buffer. The application should ensure that this 18611 value be at least (sourceLen × 1.001) + 12. On successful exit, 18612 the variable referenced by destLen shall be updated to hold the 18613 length of compressed data in dest. 18614 18615 The compress() function is equivalent to compress2() with a 18616 level of Z_DEFAULT_COMPRESSION. 18617 18618 Return Value 18619 18620 On success, compress2() shall return Z_OK. Otherwise, 18621 compress2() shall return a value to indicate the error. 18622 18623 Errors 18624 18625 On error, compress2() shall return a value as described below: 18626 18627 Z_BUF_ERROR 18628 18629 The buffer dest was not large enough to hold the compressed 18630 data. 18631 Z_MEM_ERROR 18632 18633 Insufficient memory. 18634 Z_STREAM_ERROR 18635 18636 The level was not Z_DEFAULT_COMPRESSION, or was not between 0 18637 and 9. 18638 18639 compressBound 18640 18641 Name 18642 18643 compressBound -- compute compressed data size 18644 18645 Synopsis 18646 18647 #include 18648 18649 int compressBound(uLong sourceLen); 18650 18651 Description 18652 18653 The compressBound() function shall estimate the size of buffer 18654 required to compress sourceLen bytes of data using the 18655 compress() or compress2() functions. If successful, the value 18656 returned shall be an upper bound for the size of buffer 18657 required to compress sourceLen bytes of data, using the 18658 parameters stored in stream, in a single call to compress() or 18659 compress2(). 18660 18661 Return Value 18662 18663 The compressBound() shall return a value representing the upper 18664 bound of an array to allocate to hold the compressed data in a 18665 single call to compress() or compress2(). This function may 18666 return a conservative value that may be larger than sourceLen. 18667 18668 Errors 18669 18670 None defined. 18671 18672 crc32 18673 18674 Name 18675 18676 crc32 -- compute CRC-32 Checksum 18677 18678 Synopsis 18679 18680 #include 18681 18682 uLong crc32(uLong crc, const Bytef * buf, uInt len); 18683 18684 Description 18685 18686 The crc32() function shall compute a running Cyclic Redundancy 18687 Check checksum, as defined in ITU-T V.42. On entry, crc is the 18688 previous value for the checksum, and buf shall point to an 18689 array of len bytes of data to be added to this checksum. The 18690 crc32() function shall return the new checksum. 18691 18692 If buf is NULL (or Z_NULL), crc32() shall return the initial 18693 checksum. 18694 18695 Return Value 18696 18697 The crc32() function shall return the new checksum value. 18698 18699 Errors 18700 18701 None defined. 18702 18703 Application Usage (informative) 18704 18705 The following code fragment demonstrates typical usage of the 18706 crc32() function: 18707 uLong crc = crc32(0L, Z_NULL, 0); 18708 18709 while (read_buffer(buffer, length) != EOF) { 18710 crc = crc32(crc, buffer, length); 18711 } 18712 if (crc != original_crc) error(); 18713 18714 deflate 18715 18716 Name 18717 18718 deflate -- compress data 18719 18720 Synopsis 18721 18722 #include 18723 18724 int deflate(z_streamp stream, int flush); 18725 18726 Description 18727 18728 The deflate() function shall attempt to compress data until 18729 either the input buffer is empty or the output buffer is full. 18730 The stream references a z_stream structure. Before the first 18731 call to deflate(), this structure should have been initialized 18732 by a call to deflateInit2_(). 18733 18734 Note: deflateInit2_() is only in the binary standard; source 18735 level applications should initialize stream via a call to 18736 deflateInit() or deflateInit2(). 18737 18738 In addition, the stream input and output buffers should have 18739 been initialized as follows: 18740 18741 next_in 18742 18743 should point to the data to be compressed. 18744 avail_in 18745 18746 should contain the number of bytes of data in the buffer 18747 referenced by next_in. 18748 next_out 18749 18750 should point to a buffer where compressed data may be placed. 18751 avail_out 18752 18753 should contain the size in bytes of the buffer referenced by 18754 next_out 18755 18756 The deflate() function shall perform one or both of the 18757 following actions: 18758 18759 1. Compress input data from next_in and update next_in, 18760 avail_in and total_in to reflect the data that has been 18761 compressed. 18762 2. Fill the output buffer referenced by next_out, and update 18763 next_out, avail_out and total_out to reflect the compressed 18764 data that has been placed there. If flush is not 18765 Z_NO_FLUSH, and avail_out indicates that there is still 18766 space in output buffer, this action shall always occur (see 18767 below for further details). 18768 18769 The deflate() function shall return when either avail_in 18770 reaches zero (indicating that all the input data has been 18771 compressed), or avail_out reaches zero (indicating that the 18772 output buffer is full). 18773 18774 On success, the deflate() function shall set the adler field of 18775 the stream to the adler32() checksum of all the input data 18776 compressed so far (represented by total_in). 18777 18778 If the deflate() function shall attempt to determine the type 18779 of input data, and set field data_type in stream to Z_ASCII if 18780 the majority of the data bytes fall within the ASCII (ISO 646) 18781 printable character range. Otherwise, it shall set data_type to 18782 Z_BINARY. This data type is informational only, and does not 18783 affect the compression algorithm. 18784 18785 Note: Future versions of the LSB may remove this 18786 requirement, since it is based on an outdated character set 18787 that does not support Internationalization, and does not 18788 affect the algorithm. It is included for information only at 18789 this release. Applications should not depend on this field. 18790 18791 Flush Operation 18792 18793 The parameter flush determines when compressed bits are added 18794 to the output buffer in next_out. If flush is Z_NO_FLUSH, 18795 deflate() may return with some data pending output, and not yet 18796 added to the output buffer. 18797 18798 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 18799 output to next_out and align the output to a byte boundary. A 18800 synchronization point is generated in the output. 18801 18802 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 18803 Z_SYNC_FLUSH, and the compression state shall be reset. A 18804 synchronization point is generated in the output. 18805 18806 Rationale: Z_SYNC_FLUSH is intended to ensure that the 18807 compressed data contains all the data compressed so far, and 18808 allows a decompressor to reconstruct all of the input data. 18809 Z_FULL_FLUSH allows decompression to restart from this point 18810 if the previous compressed data has been lost or damaged. 18811 Flushing is likely to degrade the performance of the 18812 compression system, and should only be used where necessary. 18813 18814 If flush is set to Z_FINISH, all pending input shall be 18815 processed and deflate() shall return with Z_STREAM_END if there 18816 is sufficient space in the output buffer at next_out, as 18817 indicated by avail_out. If deflate() is called with flush set 18818 to Z_FINISH and there is insufficient space to store the 18819 compressed data, and no other error has occurred during 18820 compression, deflate() shall return Z_OK, and the application 18821 should call deflate() again with flush unchanged, and having 18822 updated next_out and avail_out. 18823 18824 If all the compression is to be done in a single step, 18825 deflate() may be called with flush set to Z_FINISH immediately 18826 after the stream has been initialized if avail_out is set to at 18827 least the value returned by deflateBound(). 18828 18829 Return Value 18830 18831 On success, deflate() shall return Z_OK, unless flush was set 18832 to Z_FINISH and there was sufficient space in the output buffer 18833 to compress all of the input data. In this case, deflate() 18834 shall return Z_STREAM_END. On error, deflate() shall return a 18835 value to indicate the error. 18836 18837 Note: If deflate() returns Z_OK and has set avail_out to 18838 zero, the function should be called again with the same 18839 value for flush, and with updated next_out and avail_out 18840 until deflate() returns with Z_OK (or Z_STREAM_END if flush 18841 is set to Z_FINISH) and a non-zero avail_out. 18842 18843 Errors 18844 18845 On error, deflate() shall return a value as described below, 18846 and set the msg field of stream to point to a string describing 18847 the error: 18848 18849 Z_BUF_ERROR 18850 18851 No progress is possible; either avail_in or avail_out was zero. 18852 Z_MEM_ERROR 18853 18854 Insufficient memory. 18855 Z_STREAM_ERROR 18856 18857 The state (as represented in stream) is inconsistent, or stream 18858 was NULL. 18859 18860 deflateBound 18861 18862 Name 18863 18864 deflateBound -- compute compressed data size 18865 18866 Synopsis 18867 18868 #include 18869 18870 int deflateBound(z_streamp stream, uLong sourceLen); 18871 18872 Description 18873 18874 The deflateBound() function shall estimate the size of buffer 18875 required to compress sourceLen bytes of data. If successful, 18876 the value returned shall be an upper bound for the size of 18877 buffer required to compress sourceLen bytes of data, using the 18878 parameters stored in stream, in a single call to deflate() with 18879 flush set to Z_FINISH. 18880 18881 On entry, stream should have been initialized via a call to 18882 deflateInit_() or deflateInit2_(). 18883 18884 Return Value 18885 18886 The deflateBound() shall return a value representing the upper 18887 bound of an array to allocate to hold the compressed data in a 18888 single call to deflate(). If the stream is not correctly 18889 initialized, or is NULL, then deflateBound() may return a 18890 conservative value that may be larger than sourceLen. 18891 18892 Errors 18893 18894 None defined. 18895 18896 deflateCopy 18897 18898 Name 18899 18900 deflateCopy -- copy compression stream 18901 18902 Synopsis 18903 18904 #include 18905 18906 int deflateCopy(z_streamp dest, z_streamp source); 18907 18908 Description 18909 18910 The deflateCopy() function shall copy the compression state 18911 information in source to the uninitialized z_stream structure 18912 referenced by dest. 18913 18914 On successful return, dest will be an exact copy of the stream 18915 referenced by source. The input and output buffer pointers in 18916 next_in and next_out will reference the same data. 18917 18918 Return Value 18919 18920 On success, deflateCopy() shall return Z_OK. Otherwise it shall 18921 return a value less than zero to indicate the error. 18922 18923 Errors 18924 18925 On error, deflateCopy() shall return a value as described 18926 below: 18927 18928 Z_STREAM_ERROR 18929 18930 The state in source is inconsistent, or either source or dest 18931 was NULL. 18932 Z_MEM_ERROR 18933 18934 Insufficient memory available. 18935 18936 Application Usage (informative) 18937 18938 This function can be useful when several compression strategies 18939 will be tried, for example when there are several ways of 18940 pre-processing the input data with a filter. The streams that 18941 will be discarded should then be freed by calling deflateEnd(). 18942 Note that deflateCopy() duplicates the internal compression 18943 state which can be quite large, so this strategy may be slow 18944 and can consume lots of memory. 18945 18946 deflateEnd 18947 18948 Name 18949 18950 deflateEnd -- free compression stream state 18951 18952 Synopsis 18953 18954 #include 18955 18956 int deflateEnd(z_streamp stream); 18957 18958 Description 18959 18960 The deflateEnd() function shall free all allocated state 18961 information referenced by stream. All pending output is 18962 discarded, and unprocessed input is ignored. 18963 18964 Return Value 18965 18966 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 18967 there was pending output discarded or input unprocessed. 18968 Otherwise it shall return Z_STREAM_ERROR to indicate the error. 18969 18970 Errors 18971 18972 On error, deflateEnd() shall return Z_STREAM_ERROR. The 18973 following conditions shall be treated as an error: 18974 18975 * The state in stream is inconsistent or inappropriate. 18976 * stream is NULL. 18977 18978 deflateInit2_ 18979 18980 Name 18981 18982 deflateInit2_ -- initialize compression system 18983 18984 Synopsis 18985 18986 #include 18987 18988 int deflateInit2_ (z_streamp strm, int level, int method, int 18989 windowBits, int memLevel, int strategy, char * version, int 18990 stream_size); 18991 18992 Description 18993 18994 The deflateInit2_() function shall initialize the compression 18995 system. On entry, strm shall refer to a user supplied z_stream 18996 object (a z_stream_s structure). The following fields shall be 18997 set on entry: 18998 18999 zalloc 19000 19001 a pointer to an alloc_func function, used to allocate state 19002 information. If this is NULL, a default allocation function 19003 will be used. 19004 zfree 19005 19006 a pointer to a free_func function, used to free memory 19007 allocated by the zalloc function. If this is NULL a default 19008 free function will be used. 19009 opaque 19010 19011 If alloc_func is not NULL, opaque is a user supplied pointer to 19012 data that will be passed to the alloc_func and free_func 19013 functions. 19014 19015 If the version requested is not compatible with the version 19016 implemented, or if the size of the z_stream_s structure 19017 provided in stream_size does not match the size in the library 19018 implementation, deflateInit2_() shall fail, and return 19019 Z_VERSION_ERROR. 19020 19021 The level supplied shall be a value between 0 and 9, or the 19022 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 19023 speed, while a level of 9 requests the highest compression. A 19024 level of 0 indicates that no compression should be used, and 19025 the output shall be the same as the input. 19026 19027 The method selects the compression algorithm to use. LSB 19028 conforming implementation shall support the Z_DEFLATED method, 19029 and may support other implementation defined methods. 19030 19031 The windowBits parameter shall be a base 2 logarithm of the 19032 window size to use, and shall be a value between 8 and 15. A 19033 smaller value will use less memory, but will result in a poorer 19034 compression ratio, while a higher value will give better 19035 compression but utilize more memory. 19036 19037 The memLevel parameter specifies how much memory to use for the 19038 internal state. The value of memLevel shall be between 1 and 19039 MAX_MEM_LEVEL. Smaller values use less memory but are slower, 19040 while higher values use more memory to gain compression speed. 19041 19042 The strategy parameter selects the compression strategy to use: 19043 19044 Z_DEFAULT_STRATEGY 19045 19046 use the system default compression strategy. Z_DEFAULT_STRATEGY 19047 is particularly appropriate for text data. 19048 Z_FILTERED 19049 19050 use a compression strategy tuned for data consisting largely of 19051 small values with a fairly random distribution. Z_FILTERED uses 19052 more Huffman encoding and less string matching than 19053 Z_DEFAULT_STRATEGY. 19054 Z_HUFFMAN_ONLY 19055 19056 force Huffman encoding only, with no string match. 19057 19058 The deflateInit2_() function is not in the source standard; it 19059 is only in the binary standard. Source applications should use 19060 the deflateInit2() macro. 19061 19062 Return Value 19063 19064 On success, the deflateInit2_() function shall return Z_OK. 19065 Otherwise, deflateInit2_() shall return a value as described 19066 below to indicate the error. 19067 19068 Errors 19069 19070 On error, deflateInit2_() shall return one of the following 19071 error indicators: 19072 19073 Z_STREAM_ERROR 19074 19075 Invalid parameter. 19076 Z_MEM_ERROR 19077 19078 Insufficient memory available. 19079 Z_VERSION_ERROR 19080 19081 The version requested is not compatible with the library 19082 version, or the z_stream size differs from that used by the 19083 library. 19084 19085 In addition, the msg field of the strm may be set to an error 19086 message. 19087 19088 deflateInit_ 19089 19090 Name 19091 19092 deflateInit_ -- initialize compression system 19093 19094 Synopsis 19095 19096 #include 19097 19098 int deflateInit_(z_streamp stream, int level, const char * 19099 version, int stream_size); 19100 19101 Description 19102 19103 The deflateInit_() function shall initialize the compression 19104 system. On entry, stream shall refer to a user supplied 19105 z_stream object (a z_stream_s structure). The following fields 19106 shall be set on entry: 19107 19108 zalloc 19109 19110 a pointer to an alloc_func function, used to allocate state 19111 information. If this is NULL, a default allocation function 19112 will be used. 19113 zfree 19114 19115 a pointer to a free_func function, used to free memory 19116 allocated by the zalloc function. If this is NULL a default 19117 free function will be used. 19118 opaque 19119 19120 If alloc_func is not NULL, opaque is a user supplied pointer to 19121 data that will be passed to the alloc_func and free_func 19122 functions. 19123 19124 If the version requested is not compatible with the version 19125 implemented, or if the size of the z_stream_s structure 19126 provided in stream_size does not match the size in the library 19127 implementation, deflateInit_() shall fail, and return 19128 Z_VERSION_ERROR. 19129 19130 The level supplied shall be a value between 0 and 9, or the 19131 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 19132 speed, while a level of 9 requests the highest compression. A 19133 level of 0 indicates that no compression should be used, and 19134 the output shall be the same as the input. 19135 19136 The deflateInit_() function is not in the source standard; it 19137 is only in the binary standard. Source applications should use 19138 the deflateInit() macro. 19139 19140 The deflateInit_() function is equivalent to 19141 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, MAX_MEM_LEVEL, 19142 Z_DEFAULT_STRATEGY, version, stream_size); 19143 19144 Return Value 19145 19146 On success, the deflateInit_() function shall return Z_OK. 19147 Otherwise, deflateInit_() shall return a value as described 19148 below to indicate the error. 19149 19150 Errors 19151 19152 On error, deflateInit_() shall return one of the following 19153 error indicators: 19154 19155 Z_STREAM_ERROR 19156 19157 Invalid parameter. 19158 Z_MEM_ERROR 19159 19160 Insufficient memory available. 19161 Z_VERSION_ERROR 19162 19163 The version requested is not compatible with the library 19164 version, or the z_stream size differs from that used by the 19165 library. 19166 19167 In addition, the msg field of the stream may be set to an error 19168 message. 19169 19170 deflateParams 19171 19172 Name 19173 19174 deflateParams -- set compression parameters 19175 19176 Synopsis 19177 19178 #include 19179 19180 int deflateParams(z_streamp stream, int level, int strategy); 19181 19182 Description 19183 19184 The deflateParams() function shall dynamically alter the 19185 compression parameters for the compression stream object 19186 stream. On entry, stream shall refer to a user supplied 19187 z_stream object (a z_stream_s structure), already initialized 19188 via a call to deflateInit_() or deflateInit2_(). 19189 19190 The level supplied shall be a value between 0 and 9, or the 19191 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 19192 speed, while a level of 9 requests the highest compression. A 19193 level of 0 indicates that no compression should be used, and 19194 the output shall be the same as the input. If the compression 19195 level is altered by deflateParams(), and some data has already 19196 been compressed with this stream (i.e. total_in is not zero), 19197 and the new level requires a different underlying compression 19198 method, then stream shall be flushed by a call to deflate(). 19199 19200 The strategy parameter selects the compression strategy to use: 19201 19202 Z_DEFAULT_STRATEGY 19203 19204 use the system default compression strategy. Z_DEFAULT_STRATEGY 19205 is particularly appropriate for text data. 19206 Z_FILTERED 19207 19208 use a compression strategy tuned for data consisting largely of 19209 small values with a fairly random distribution. Z_FILTERED uses 19210 more Huffman encoding and less string matching than 19211 Z_DEFAULT_STRATEGY. 19212 Z_HUFFMAN_ONLY 19213 19214 force Huffman encoding only, with no string match. 19215 19216 Return Value 19217 19218 On success, the deflateParams() function shall return Z_OK. 19219 Otherwise, deflateParams() shall return a value as described 19220 below to indicate the error. 19221 19222 Errors 19223 19224 On error, deflateParams() shall return one of the following 19225 error indicators: 19226 19227 Z_STREAM_ERROR 19228 19229 Invalid parameter. 19230 Z_MEM_ERROR 19231 19232 Insufficient memory available. 19233 Z_BUF_ERROR 19234 19235 Insufficient space in stream to flush the current output. 19236 19237 In addition, the msg field of the strm may be set to an error 19238 message. 19239 19240 Application Usage (Informative) 19241 19242 Applications should ensure that the stream is flushed, e.g. by 19243 a call to deflate(stream, Z_SYNC_FLUSH) before calling 19244 deflateParams(), or ensure that there is sufficient space in 19245 next_out (as identified by avail_out) to ensure that all 19246 pending output and all uncompressed input can be flushed in a 19247 single call to deflate(). 19248 19249 Rationale: Although the deflateParams() function should 19250 flush pending output and compress all pending input, the 19251 result is unspecified if there is insufficient space in the 19252 output buffer. Applications should only call deflateParams() 19253 when the stream is effectively empty (flushed). 19254 19255 The deflateParams() can be used to switch between 19256 compression and straight copy of the input data, or to 19257 switch to a different kind of input data requiring a 19258 different strategy. 19259 19260 deflateReset 19261 19262 Name 19263 19264 deflateReset -- reset compression stream state 19265 19266 Synopsis 19267 19268 #include 19269 19270 int deflateReset(z_streamp stream); 19271 19272 Description 19273 19274 The deflateReset() function shall reset all state associated 19275 with stream. All pending output shall be discarded, and the 19276 counts of processed bytes (total_in and total_out) shall be 19277 reset to zero. 19278 19279 Return Value 19280 19281 On success, deflateReset() shall return Z_OK. Otherwise it 19282 shall return Z_STREAM_ERROR to indicate the error. 19283 19284 Errors 19285 19286 On error, deflateReset() shall return Z_STREAM_ERROR. The 19287 following conditions shall be treated as an error: 19288 19289 * The state in stream is inconsistent or inappropriate. 19290 * stream is NULL. 19291 19292 deflateSetDictionary 19293 19294 Name 19295 19296 deflateSetDictionary -- initialize compression dictionary 19297 19298 Synopsis 19299 19300 #include 19301 19302 int deflateSetDictionary(z_streamp stream, const Bytef * 19303 dictionary, uInt dictlen); 19304 19305 Description 19306 19307 The deflateSetDictionary() function shall initialize the 19308 compression dictionary associated with stream using the dictlen 19309 bytes referenced by dictionary. 19310 19311 The implementation may silently use a subset of the provided 19312 dictionary if the dictionary cannot fit in the current window 19313 associated with stream (see deflateInit2_()). The application 19314 should ensure that the dictionary is sorted such that the most 19315 commonly used strings occur at the end of the dictionary. 19316 19317 If the dictionary is successfully set, the Adler32 checksum of 19318 the entire provided dictionary shall be stored in the adler 19319 member of stream. This value may be used by the decompression 19320 system to select the correct dictionary. The compression and 19321 decompression systems must use the same dictionary. 19322 19323 stream shall reference an initialized compression stream, with 19324 total_in zero (i.e. no data has been compressed since the 19325 stream was initialized). 19326 19327 Return Value 19328 19329 On success, deflateSetDictionary() shall return Z_OK. Otherwise 19330 it shall return Z_STREAM_ERROR to indicate an error. 19331 19332 Errors 19333 19334 On error, deflateSetDictionary() shall return a value as 19335 described below: 19336 19337 Z_STREAM_ERROR 19338 19339 The state in stream is inconsistent, or stream was NULL. 19340 19341 Application Usage (informative) 19342 19343 The application should provide a dictionary consisting of 19344 strings {{{ed note: do we really mean "strings"? Null 19345 terminated?}}} that are likely to be encountered in the data to 19346 be compressed. The application should ensure that the 19347 dictionary is sorted such that the most commonly used strings 19348 occur at the end of the dictionary. 19349 19350 The use of a dictionary is optional; however if the data to be 19351 compressed is relatively short and has a predictable structure, 19352 the use of a dictionary can substantially improve the 19353 compression ratio. 19354 19355 get_crc_table 19356 19357 Name 19358 19359 get_crc_table -- generate a table for crc calculations 19360 19361 Synopsis 19362 19363 #include 19364 19365 const uLongf * get_crc_table(void); 19366 19367 Description 19368 19369 Generate tables for a byte-wise 32-bit CRC calculation based on 19370 the polynomial: 19371 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+1 19372 19373 In a multi-threaded application, get_crc_table() should be 19374 called by one thread to initialize the tables before any other 19375 thread calls any libz function. 19376 19377 Return Value 19378 19379 The get_crc_table() function shall return a pointer to the 19380 first of a set of tables used internally to calculate CRC-32 19381 values (see crc32()). 19382 19383 Errors 19384 19385 None defined. 19386 19387 gzclose 19388 19389 Name 19390 19391 gzclose -- close a compressed file stream 19392 19393 Synopsis 19394 19395 #include 19396 19397 int gzclose (gzFile file ); 19398 19399 Description 19400 19401 The gzclose() function shall close the compressed file stream 19402 file. If file was open for writing, gzclose() shall first flush 19403 any pending output. Any state information allocated shall be 19404 freed. 19405 19406 Return Value 19407 19408 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 19409 shall return an error value as described below. 19410 19411 Errors 19412 19413 On error, gzclose() may set the global variable errno to 19414 indicate the error. The gzclose() shall return a value other 19415 than Z_OK on error. 19416 19417 Z_STREAM_ERROR 19418 19419 file was NULL (or Z_NULL), or did not refer to an open 19420 compressed file stream. 19421 Z_ERRNO 19422 19423 An error occurred in the underlying base libraries, and the 19424 application should check errno for further information. 19425 Z_BUF_ERROR 19426 19427 no compression progress is possible during buffer flush (see 19428 deflate()). 19429 19430 gzdopen 19431 19432 Name 19433 19434 gzdopen -- open a compressed file 19435 19436 Synopsis 19437 19438 #include 19439 19440 gzFile gzdopen ( int fd, const char *mode ); 19441 19442 Description 19443 19444 The gzdopen() function shall attempt to associate the open file 19445 referenced by fd with a gzFile object. The mode argument is 19446 based on that of fopen(), but the mode parameter may also 19447 contain the following characters: 19448 19449 digit 19450 19451 set the compression level to digit. A low value (e.g. 1) means 19452 high speed, while a high value (e.g. 9) means high compression. 19453 A compression level of 0 (zero) means no compression. See 19454 deflateInit2_() for further details. 19455 [fhR] 19456 19457 set the compression strategy to [fhR]. The letter f corresponds 19458 to filtered data, the letter h corresponds to Huffman only 19459 compression, and the letter R corresponds to Run Length 19460 Encoding. See deflateInit2_() for further details. 19461 19462 If fd refers to an uncompressed file, and mode refers to a read 19463 mode, gzdopen() shall attempt to open the file and return a 19464 gzFile object suitable for reading directly from the file 19465 without any decompression. 19466 19467 If mode is NULL, or if mode does not contain one of r, w, or a, 19468 gzdopen() shall return Z_NULL, and need not set any other error 19469 condition. 19470 19471 Example 19472 19473 gzdopen(fileno(stdin), "r"); 19474 19475 Attempt to associate the standard input with a gzFile object. 19476 19477 Return Value 19478 19479 On success, gzdopen() shall return a gzFile object. On failure, 19480 gzdopen() shall return Z_NULL and may set errno accordingly. 19481 19482 Note: At version 1.2.2, zlib does not set errno for several 19483 error conditions. Applications may not be able to determine 19484 the cause of an error. 19485 19486 Errors 19487 19488 On error, gzdopen() may set the global variable errno to 19489 indicate the error. 19490 19491 gzeof 19492 19493 Name 19494 19495 gzeof -- check for end-of-file on a compressed file stream 19496 19497 Synopsis 19498 19499 #include 19500 19501 int gzeof (gzFile file ); 19502 19503 Description 19504 19505 The gzeof() function shall test the compressed file stream file 19506 for end of file. 19507 19508 Return Value 19509 19510 If file was open for reading and end of file has been reached, 19511 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 19512 19513 Errors 19514 19515 None defined. 19516 19517 gzerror 19518 19519 Name 19520 19521 gzerror -- decode an error on a compressed file stream 19522 19523 Synopsis 19524 19525 #include 19526 19527 const char * gzerror (gzFile file, int * errnum); 19528 19529 Description 19530 19531 The gzerror() function shall return a string describing the 19532 last error to have occurred associated with the open compressed 19533 file stream referred to by file. It shall also set the location 19534 referenced by errnum to an integer value that further 19535 identifies the error. 19536 19537 Return Value 19538 19539 The gzerror() function shall return a string that describes the 19540 last error associated with the given file compressed file 19541 stream. This string shall have the format "%s: %s", with the 19542 name of the file, followed by a colon, a space, and the 19543 description of the error. If the compressed file stream was 19544 opened by a call to gzdopen(), the format of the filename is 19545 unspecified. 19546 19547 Rationale: Although in all current implementations of libz 19548 file descriptors are named "", the code suggests that 19549 this is for debugging purposes only, and may change in a 19550 future release. 19551 19552 It is unspecified if the string returned is determined by the 19553 setting of the LC_MESSAGES category in the current locale. 19554 19555 Errors 19556 19557 None defined. 19558 19559 gzflush 19560 19561 Name 19562 19563 gzflush -- flush a compressed file stream 19564 19565 Synopsis 19566 19567 #include 19568 19569 int gzflush(gzFile file, int flush); 19570 19571 Description 19572 19573 The gzflush() function shall flush pending output to the 19574 compressed file stream identified by file, which must be open 19575 for writing. 19576 19577 Flush Operation 19578 19579 The parameter flush determines which compressed bits are added 19580 to the output file. If flush is Z_NO_FLUSH, gzflush() may 19581 return with some data pending output, and not yet written to 19582 the file. 19583 19584 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 19585 output to file and align the output to a byte boundary. There 19586 may still be data pending compression that is not flushed. 19587 19588 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 19589 Z_SYNC_FLUSH, and the compression state shall be reset. There 19590 may still be data pending compression that is not flushed. 19591 19592 Rationale: Z_SYNC_FLUSH is intended to ensure that the 19593 compressed data contains all the data compressed so far, and 19594 allows a decompressor to reconstruct all of the input data. 19595 Z_FULL_FLUSH allows decompression to restart from this point 19596 if the previous compressed data has been lost or damaged. 19597 Flushing is likely to degrade the performance of the 19598 compression system, and should only be used where necessary. 19599 19600 If flush is set to Z_FINISH, all pending uncompressed data 19601 shall be compressed and all output shall be flushed. 19602 19603 Return Value 19604 19605 On success, gzflush() shall return the value Z_OK. Otherwise 19606 gzflush() shall return a value to indicate the error, and may 19607 set the error number associated with the compressed file stream 19608 file. 19609 19610 Note: If flush is set to Z_FINISH and the flush operation is 19611 successful, gzflush() will return Z_OK, but the compressed 19612 file stream error value may be set to Z_STREAM_END. 19613 19614 Errors 19615 19616 On error, gzflush() shall return an error value, and may set 19617 the error number associated with the stream identified by file 19618 to indicate the error. Applications may use gzerror() to access 19619 this error value. 19620 19621 Z_ERRNO 19622 19623 An underlying base library function has indicated an error. The 19624 global variable errno may be examined for further information. 19625 Z_STREAM_ERROR 19626 19627 The stream is invalid, is not open for writing, or is in an 19628 invalid state. 19629 Z_BUF_ERROR 19630 19631 no compression progress is possible (see deflate()). 19632 Z_MEM_ERROR 19633 19634 Insufficient memory available to compress. 19635 19636 gzgetc 19637 19638 Name 19639 19640 gzgetc -- read a character from a compressed file 19641 19642 Synopsis 19643 19644 #include 19645 19646 int gzgetc (gzFile file); 19647 19648 Description 19649 19650 The gzgetc() function shall read the next single character from 19651 the compressed file stream referenced by file, which shall have 19652 been opened in a read mode (see gzopen() and gzdopen()). 19653 19654 Return Value 19655 19656 On success, gzgetc() shall return the uncompressed character 19657 read, otherwise, on end of file or error, gzgetc() shall return 19658 -1. 19659 19660 Errors 19661 19662 On end of file or error, gzgetc() shall return -1. Further 19663 information can be found by calling gzerror() with a pointer to 19664 the compressed file stream. 19665 19666 gzgets 19667 19668 Name 19669 19670 gzgets -- read a string from a compressed file 19671 19672 Synopsis 19673 19674 #include 19675 19676 char * gzgets (gzFile file, char * buf, int len); 19677 19678 Description 19679 19680 The gzgets() function shall attempt to read data from the 19681 compressed file stream file, uncompressing it into buf until 19682 either len-1 bytes have been inserted into buf, or until a 19683 newline character has been uncompressed into buf. A null byte 19684 shall be appended to the uncompressed data. The file shall have 19685 been opened in for reading (see gzopen() and gzdopen()). 19686 19687 Return Value 19688 19689 On success, gzgets() shall return a pointer to buf. Otherwise, 19690 gzgets() shall return Z_NULL. Applications may examine the 19691 cause using gzerror(). 19692 19693 Errors 19694 19695 On error, gzgets() shall return Z_NULL. The following 19696 conditions shall always be treated as an error: 19697 19698 file is NULL, or does not refer to a file open for reading; 19699 buf is NULL; 19700 len is less than or equal to zero. 19701 19702 gzopen 19703 19704 Name 19705 19706 gzopen -- open a compressed file 19707 19708 Synopsis 19709 19710 #include 19711 19712 gzFile gzopen (const char *path , const char *mode ); 19713 19714 Description 19715 19716 The gzopen() function shall open the compressed file named by 19717 path. The mode argument is based on that of fopen(), but the 19718 mode parameter may also contain the following characters: 19719 19720 digit 19721 19722 set the compression level to digit. A low value (e.g. 1) means 19723 high speed, while a high value (e.g. 9) means high compression. 19724 A compression level of 0 (zero) means no compression. See 19725 deflateInit2_() for further details. 19726 [fhR] 19727 19728 set the compression strategy to [fhR]. The letter f corresponds 19729 to filtered data, the letter h corresponds to Huffman only 19730 compression, and the letter R corresponds to Run Length 19731 Encoding. See deflateInit2_() for further details. 19732 19733 If path refers to an uncompressed file, and mode refers to a 19734 read mode, gzopen() shall attempt to open the file and return a 19735 gzFile object suitable for reading directly from the file 19736 without any decompression. 19737 19738 If path or mode is NULL, or if mode does not contain one of r, 19739 w, or a, gzopen() shall return Z_NULL, and need not set any 19740 other error condition. 19741 19742 The gzFile object is also referred to as a compressed file 19743 stream. 19744 19745 Example 19746 19747 gzopen("file.gz", "w6h"); 19748 19749 Attempt to create a new compressed file, file.gz, at 19750 compression level 6 using Huffman only compression. 19751 19752 Return Value 19753 19754 On success, gzopen() shall return a gzFile object (also known 19755 as a compressed file stream). On failure, gzopen() shall return 19756 Z_NULL and may set errno accordingly. 19757 19758 Note: At version 1.2.2, zlib does not set errno for several 19759 error conditions. Applications may not be able to determine 19760 the cause of an error. 19761 19762 Errors 19763 19764 On error, gzopen() may set the global variable errno to 19765 indicate the error. 19766 19767 gzprintf 19768 19769 Name 19770 19771 gzprintf -- format data and compress 19772 19773 Synopsis 19774 19775 #include 19776 19777 int gzprintf (gzFile file, const char * fmt, ...); 19778 19779 Description 19780 19781 The gzprintf() function shall format data as for fprintf(), and 19782 write the resulting string to the compressed file stream file. 19783 19784 Return Value 19785 19786 The gzprintf() function shall return the number of uncompressed 19787 bytes actually written, or a value less than or equal to 0 in 19788 the event of an error. 19789 19790 Errors 19791 19792 If file is NULL, or refers to a compressed file stream that has 19793 not been opened for writing, gzprintf() shall return 19794 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 19795 19796 gzputc 19797 19798 Name 19799 19800 gzputc -- write character to a compressed file 19801 19802 Synopsis 19803 19804 #include 19805 19806 int gzputc (gzFile file, int c); 19807 19808 Description 19809 19810 The gzputc() function shall write the single character c, 19811 converted from integer to unsigned character, to the compressed 19812 file referenced by file, which shall have been opened in a 19813 write mode (see gzopen() and gzdopen()). 19814 19815 Return Value 19816 19817 On success, gzputc() shall return the value written, otherwise 19818 gzputc() shall return -1. 19819 19820 Errors 19821 19822 On error, gzputc() shall return -1. 19823 19824 gzputs 19825 19826 Name 19827 19828 gzputs -- string write to a compressed file 19829 19830 Synopsis 19831 19832 #include 19833 19834 int gzputs (gzFile file, const char * s); 19835 19836 Description 19837 19838 The gzputs() function shall write the null terminated string s 19839 to the compressed file referenced by file, which shall have 19840 been opened in a write mode (see gzopen() and gzdopen()). The 19841 terminating null character shall not be written. The gzputs() 19842 function shall return the number of uncompressed bytes actually 19843 written. 19844 19845 Return Value 19846 19847 On success, gzputs() shall return the number of uncompressed 19848 bytes actually written to file. On error gzputs() shall return 19849 a value less than or equal to 0. Applications may examine the 19850 cause using gzerror(). 19851 19852 Errors 19853 19854 On error, gzputs() shall set the error number associated with 19855 the stream identified by file to indicate the error. 19856 Applications should use gzerror() to access this error value. 19857 If file is NULL, gzputs() shall return Z_STREAM_ERR. 19858 19859 Z_ERRNO 19860 19861 An underlying base library function has indicated an error. The 19862 global variable errno may be examined for further information. 19863 Z_STREAM_ERROR 19864 19865 The stream is invalid, is not open for writing, or is in an 19866 invalid state. 19867 Z_BUF_ERROR 19868 19869 no compression progress is possible (see deflate()). 19870 Z_MEM_ERROR 19871 19872 Insufficient memory available to compress. 19873 19874 gzread 19875 19876 Name 19877 19878 gzread -- read from a compressed file 19879 19880 Synopsis 19881 19882 #include 19883 19884 int gzread (gzFile file, voidp buf, unsigned int len); 19885 19886 Description 19887 19888 The gzread() function shall read data from the compressed file 19889 referenced by file, which shall have been opened in a read mode 19890 (see gzopen() and gzdopen()). The gzread() function shall read 19891 data from file, and uncompress it into buf. At most, len bytes 19892 of uncompressed data shall be copied to buf. If the file is not 19893 compressed, gzread() shall simply copy data from file to buf 19894 without alteration. 19895 19896 Return Value 19897 19898 On success, gzread() shall return the number of bytes 19899 decompressed into buf. If gzread() returns 0, either the 19900 end-of-file has been reached or an underlying read error has 19901 occurred. Applications should use gzerror() or gzeof() to 19902 determine which occurred. On other errors, gzread() shall 19903 return a value less than 0 and applications may examine the 19904 cause using gzerror(). 19905 19906 Errors 19907 19908 On error, gzread() shall set the error number associated with 19909 the stream identified by file to indicate the error. 19910 Applications should use gzerror() to access this error value. 19911 19912 Z_ERRNO 19913 19914 An underlying base library function has indicated an error. The 19915 global variable errno may be examined for further information. 19916 Z_STREAM_END 19917 19918 End of file has been reached on input. 19919 Z_DATA_ERROR 19920 19921 A CRC error occurred when reading data; the file is corrupt. 19922 Z_STREAM_ERROR 19923 19924 The stream is invalid, or is in an invalid state. 19925 Z_NEED_DICT 19926 19927 A dictionary is needed (see inflateSetDictionary()). 19928 Z_MEM_ERROR 19929 19930 Insufficient memory available to decompress. 19931 19932 gzrewind 19933 19934 Name 19935 19936 gzrewind -- reset the file-position indicator on a compressed 19937 file stream 19938 19939 Synopsis 19940 19941 #include 19942 19943 int gzrewind(gzFile file); 19944 19945 Description 19946 19947 The gzrewind() function shall set the starting position for the 19948 next read on compressed file stream file to the beginning of 19949 file. file must be open for reading. 19950 19951 gzrewind() is equivalent to 19952 (int)gzseek(file, 0L, SEEK_SET) 19953 19954 . 19955 19956 Return Value 19957 19958 On success, gzrewind() shall return 0. On error, gzrewind() 19959 shall return -1, and may set the error value for file 19960 accordingly. 19961 19962 Errors 19963 19964 On error, gzrewind() shall return -1, indicating that file is 19965 NULL, or does not represent an open compressed file stream, or 19966 represents a compressed file stream that is open for writing 19967 and is not currently at the beginning of file. 19968 19969 gzseek 19970 19971 Name 19972 19973 gzseek -- reposition a file-position indicator in a compressed 19974 file stream 19975 19976 Synopsis 19977 19978 #include 19979 19980 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 19981 19982 Description 19983 19984 The gzseek() function shall set the file-position indicator for 19985 the compressed file stream file. The file-position indicator 19986 controls where the next read or write operation on the 19987 compressed file stream shall take place. The offset indicates a 19988 byte offset in the uncompressed data. The whence parameter may 19989 be one of: 19990 19991 SEEK_SET 19992 19993 the offset is relative to the start of the uncompressed data. 19994 SEEK_CUR 19995 19996 the offset is relative to the current positition in the 19997 uncompressed data. 19998 19999 Note: The value SEEK_END need not be supported. 20000 20001 If the file is open for writing, the new offset must be greater 20002 than or equal to the current offset. In this case, gzseek() 20003 shall compress a sequence of null bytes to fill the gap from 20004 the previous offset to the new offset. 20005 20006 Return Value 20007 20008 On success, gzseek() shall return the resulting offset in the 20009 file expressed as a byte position in the uncompressed data 20010 stream. On error, gzseek() shall return -1, and may set the 20011 error value for file accordingly. 20012 20013 Errors 20014 20015 On error, gzseek() shall return -1. The following conditions 20016 shall always result in an error: 20017 20018 * file is NULL 20019 * file does not represent an open compressed file stream. 20020 * file refers to a compressed file stream that is open for 20021 writing, and the newly computed offset is less than the 20022 current offset. 20023 * The newly computed offset is less than zero. 20024 * whence is not one of the supported values. 20025 20026 Application Usage (informative) 20027 20028 If file is open for reading, the implementation may still need 20029 to uncompress all of the data up to the new offset. As a 20030 result, gzseek() may be extremely slow in some circumstances. 20031 20032 gzsetparams 20033 20034 Name 20035 20036 gzsetparams -- dynamically set compression parameters 20037 20038 Synopsis 20039 20040 #include 20041 20042 int gzsetparams (gzFile file, int level, int strategy); 20043 20044 Description 20045 20046 The gzsetparams() function shall set the compression level and 20047 compression strategy on the compressed file stream referenced 20048 by file. The compressed file stream shall have been opened in a 20049 write mode. The level and strategy are as defined in 20050 deflateInit2.. If there is any data pending writing, it shall 20051 be flushed before the parameters are updated. 20052 20053 Return Value 20054 20055 On success, the gzsetparams() function shall return Z_OK. 20056 20057 Errors 20058 20059 On error, gzsetparams() shall return one of the following error 20060 indications: 20061 20062 Z_STREAM_ERROR 20063 20064 Invalid parameter, or file not open for writing. 20065 Z_BUF_ERROR 20066 20067 An internal inconsistency was detected while flushing the 20068 previous buffer. 20069 20070 gztell 20071 20072 Name 20073 20074 gztell -- find position on a compressed file stream 20075 20076 Synopsis 20077 20078 #include 20079 20080 z_off_t gztell (gzFile file ); 20081 20082 Description 20083 20084 The gztell() function shall return the starting position for 20085 the next read or write operation on compressed file stream 20086 file. This position represents the number of bytes from the 20087 beginning of file in the uncompressed data. 20088 20089 gztell() is equivalent to 20090 gzseek(file, 0L, SEEK_CUR) 20091 20092 . 20093 20094 Return Value 20095 20096 gztell() shall return the current offset in the file expressed 20097 as a byte position in the uncompressed data stream. On error, 20098 gztell() shall return -1, and may set the error value for file 20099 accordingly. 20100 20101 Errors 20102 20103 On error, gztell() shall return -1, indicating that file is 20104 NULL, or does not represent an open compressed file stream. 20105 20106 gzwrite 20107 20108 Name 20109 20110 gzwrite -- write to a compressed file 20111 20112 Synopsis 20113 20114 #include 20115 20116 int gzwrite (gzFile file, voidpc buf, unsigned int len); 20117 20118 Description 20119 20120 The gzwrite() function shall write data to the compressed file 20121 referenced by file, which shall have been opened in a write 20122 mode (see gzopen() and gzdopen()). On entry, buf shall point to 20123 a buffer containing len bytes of uncompressed data. The 20124 gzwrite() function shall compress this data and write it to 20125 file. The gzwrite() function shall return the number of 20126 uncompressed bytes actually written. 20127 20128 Return Value 20129 20130 On success, gzwrite() shall return the number of uncompressed 20131 bytes actually written to file. On error gzwrite() shall return 20132 a value less than or equal to 0. Applications may examine the 20133 cause using gzerror(). 20134 20135 Errors 20136 20137 On error, gzwrite() shall set the error number associated with 20138 the stream identified by file to indicate the error. 20139 Applications should use gzerror() to access this error value. 20140 20141 Z_ERRNO 20142 20143 An underlying base library function has indicated an error. The 20144 global variable errno may be examined for further information. 20145 Z_STREAM_ERROR 20146 20147 The stream is invalid, is not open for writing, or is in an 20148 invalid state. 20149 Z_BUF_ERROR 20150 20151 no compression progress is possible (see deflate()). 20152 Z_MEM_ERROR 20153 20154 Insufficient memory available to compress. 20155 20156 inflate 20157 20158 Name 20159 20160 inflate -- decompress data 20161 20162 Synopsis 20163 20164 #include 20165 20166 int inflate(z_streamp stream, int flush); 20167 20168 Description 20169 20170 The inflate() function shall attempt to decompress data until 20171 either the input buffer is empty or the output buffer is full. 20172 The stream references a z_stream structure. Before the first 20173 call to inflate(), this structure should have been initialized 20174 by a call to inflateInit2_(). 20175 20176 Note: inflateInit2_() is only in the binary standard; source 20177 level applications should initialize stream via a call to 20178 inflateInit() or inflateInit2(). 20179 20180 In addition, the stream input and output buffers should have 20181 been initialized as follows: 20182 20183 next_in 20184 20185 should point to the data to be decompressed. 20186 avail_in 20187 20188 should contain the number of bytes of data in the buffer 20189 referenced by next_in. 20190 next_out 20191 20192 should point to a buffer where decompressed data may be placed. 20193 avail_out 20194 20195 should contain the size in bytes of the buffer referenced by 20196 next_out 20197 20198 The inflate() function shall perform one or both of the 20199 following actions: 20200 20201 1. Decompress input data from next_in and update next_in, 20202 avail_in and total_in to reflect the data that has been 20203 decompressed. 20204 2. Fill the output buffer referenced by next_out, and update 20205 next_out, avail_out, and total_out to reflect the 20206 decompressed data that has been placed there. If flush is 20207 not Z_NO_FLUSH, and avail_out indicates that there is still 20208 space in output buffer, this action shall always occur (see 20209 below for further details). 20210 20211 The inflate() function shall return when either avail_in 20212 reaches zero (indicating that all the input data has been 20213 compressed), or avail_out reaches zero (indicating that the 20214 output buffer is full). 20215 20216 Flush Operation 20217 20218 The parameter flush determines when uncompressed bytes are 20219 added to the output buffer in next_out. If flush is Z_NO_FLUSH, 20220 inflate() may return with some data pending output, and not yet 20221 added to the output buffer. 20222 20223 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 20224 output to next_out, and update next_out and avail_out 20225 accordingly. 20226 20227 If flush is set to Z_BLOCK, inflate() shall stop adding data to 20228 the output buffer if and when the next compressed block 20229 boundary is reached (see RFC 1951: DEFLATE Compressed Data 20230 Format Specification). 20231 20232 If flush is set to Z_FINISH, all of the compressed input shall 20233 be decompressed and added to the output. If there is 20234 insufficient output space (i.e. the compressed input data 20235 uncompresses to more than avail_out bytes), then inflate() 20236 shall fail and return Z_BUF_ERROR. 20237 20238 Return Value 20239 20240 On success, inflate() shall return Z_OK if decompression 20241 progress has been made, or Z_STREAM_END if all of the input 20242 data has been decompressed and there was sufficient space in 20243 the output buffer to store the uncompressed result. On error, 20244 inflate() shall return a value to indicate the error. 20245 20246 Note: If inflate() returns Z_OK and has set avail_out to 20247 zero, the function should be called again with the same 20248 value for flush, and with updated next_out and avail_out 20249 until inflate() returns with either Z_OK or Z_STREAM_END and 20250 a non-zero avail_out. 20251 20252 On success, inflate() shall set the adler to the Adler-32 20253 checksum of the output produced so far (i.e. total_out bytes). 20254 20255 Errors 20256 20257 On error, inflate() shall return a value as described below, 20258 and may set the msg field of stream to point to a string 20259 describing the error: 20260 20261 Z_BUF_ERROR 20262 20263 No progress is possible; either avail_in or avail_out was zero. 20264 Z_MEM_ERROR 20265 20266 Insufficient memory. 20267 Z_STREAM_ERROR 20268 20269 The state (as represented in stream) is inconsistent, or stream 20270 was NULL. 20271 Z_NEED_DICT 20272 20273 A preset dictionary is required. The adler field shall be set 20274 to the Adler-32 checksum of the dictionary chosen by the 20275 compressor. 20276 20277 inflateEnd 20278 20279 Name 20280 20281 inflateEnd -- free decompression stream state 20282 20283 Synopsis 20284 20285 #include 20286 20287 int inflateEnd(z_streamp stream); 20288 20289 Description 20290 20291 The inflateEnd() function shall free all allocated state 20292 information referenced by stream. All pending output is 20293 discarded, and unprocessed input is ignored. 20294 20295 Return Value 20296 20297 On success, inflateEnd() shall return Z_OK. Otherwise it shall 20298 return Z_STREAM_ERROR to indicate the error. 20299 20300 Errors 20301 20302 On error, inflateEnd() shall return Z_STREAM_ERROR. The 20303 following conditions shall be treated as an error: 20304 20305 * The state in stream is inconsistent. 20306 * stream is NULL. 20307 * The zfree function pointer is NULL. 20308 20309 inflateInit2_ 20310 20311 Name 20312 20313 inflateInit2_ -- initialize decompression system 20314 20315 Synopsis 20316 20317 #include 20318 20319 int inflateInit2_ (z_streamp strm, int windowBits, char * 20320 version, int stream_size); 20321 20322 Description 20323 20324 The inflateInit2_() function shall initialize the decompression 20325 system. On entry, strm shall refer to a user supplied z_stream 20326 object (a z_stream_s structure). The following fields shall be 20327 set on entry: 20328 20329 zalloc 20330 20331 a pointer to an alloc_func function, used to allocate state 20332 information. If this is NULL, a default allocation function 20333 will be used. 20334 zfree 20335 20336 a pointer to a free_func function, used to free memory 20337 allocated by the zalloc function. If this is NULL a default 20338 free function will be used. 20339 opaque 20340 20341 If alloc_func is not NULL, opaque is a user supplied pointer to 20342 data that will be passed to the alloc_func and free_func 20343 functions. 20344 20345 If the version requested is not compatible with the version 20346 implemented, or if the size of the z_stream_s structure 20347 provided in stream_size does not match the size in the library 20348 implementation, inflateInit2_() shall fail, and return 20349 Z_VERSION_ERROR. 20350 20351 The windowBits parameter shall be a base 2 logarithm of the 20352 maximum window size to use, and shall be a value between 8 and 20353 15. If the input data was compressed with a larger window size, 20354 subsequent attempts to decompress this data will fail with 20355 Z_DATA_ERROR, rather than try to allocate a larger window. 20356 20357 The inflateInit2_() function is not in the source standard; it 20358 is only in the binary standard. Source applications should use 20359 the inflateInit2() macro. 20360 20361 Return Value 20362 20363 On success, the inflateInit2_() function shall return Z_OK. 20364 Otherwise, inflateInit2_() shall return a value as described 20365 below to indicate the error. 20366 20367 Errors 20368 20369 On error, inflateInit2_() shall return one of the following 20370 error indicators: 20371 20372 Z_STREAM_ERROR 20373 20374 Invalid parameter. 20375 Z_MEM_ERROR 20376 20377 Insufficient memory available. 20378 Z_VERSION_ERROR 20379 20380 The version requested is not compatible with the library 20381 version, or the z_stream size differs from that used by the 20382 library. 20383 20384 In addition, the msg field of the strm may be set to an error 20385 message. 20386 20387 inflateInit_ 20388 20389 Name 20390 20391 inflateInit_ -- initialize decompression system 20392 20393 Synopsis 20394 20395 #include 20396 20397 int inflateInit_(z_streamp stream, const char * version, int 20398 stream_size); 20399 20400 Description 20401 20402 The inflateInit_() function shall initialize the decompression 20403 system. On entry, stream shall refer to a user supplied 20404 z_stream object (a z_stream_s structure). The following fields 20405 shall be set on entry: 20406 20407 zalloc 20408 20409 a pointer to an alloc_func function, used to allocate state 20410 information. If this is NULL, a default allocation function 20411 will be used. 20412 zfree 20413 20414 a pointer to a free_func function, used to free memory 20415 allocated by the zalloc function. If this is NULL a default 20416 free function will be used. 20417 opaque 20418 20419 If alloc_func is not NULL, opaque is a user supplied pointer to 20420 data that will be passed to the alloc_func and free_func 20421 functions. 20422 20423 If the version requested is not compatible with the version 20424 implemented, or if the size of the z_stream_s structure 20425 provided in stream_size does not match the size in the library 20426 implementation, inflateInit_() shall fail, and return 20427 Z_VERSION_ERROR. 20428 20429 The inflateInit_() function is not in the source standard; it 20430 is only in the binary standard. Source applications should use 20431 the inflateInit() macro. 20432 20433 The inflateInit_() shall be equivalent to 20434 inflateInit2_(strm, MAX_WBITS, version, stream_size); 20435 20436 Return Value 20437 20438 On success, the inflateInit_() function shall return Z_OK. 20439 Otherwise, inflateInit_() shall return a value as described 20440 below to indicate the error. 20441 20442 Errors 20443 20444 On error, inflateInit_() shall return one of the following 20445 error indicators: 20446 20447 Z_STREAM_ERROR 20448 20449 Invalid parameter. 20450 Z_MEM_ERROR 20451 20452 Insufficient memory available. 20453 Z_VERSION_ERROR 20454 20455 The version requested is not compatible with the library 20456 version, or the z_stream size differs from that used by the 20457 library. 20458 20459 In addition, the msg field of the strm may be set to an error 20460 message. 20461 20462 inflateReset 20463 20464 Name 20465 20466 inflateReset -- reset decompression stream state 20467 20468 Synopsis 20469 20470 #include 20471 20472 int inflateReset(z_streamp stream); 20473 20474 Description 20475 20476 The inflateReset() function shall reset all state associated 20477 with stream. All pending output shall be discarded, and the 20478 counts of processed bytes (total_in and total_out) shall be 20479 reset to zero. 20480 20481 Return Value 20482 20483 On success, inflateReset() shall return Z_OK. Otherwise it 20484 shall return Z_STREAM_ERROR to indicate the error. 20485 20486 Errors 20487 20488 On error, inflateReset() shall return Z_STREAM_ERROR. The 20489 following conditions shall be treated as an error: 20490 20491 * The state in stream is inconsistent or inappropriate. 20492 * stream is NULL. 20493 20494 inflateSetDictionary 20495 20496 Name 20497 20498 inflateSetDictionary -- initialize decompression dictionary 20499 20500 Synopsis 20501 20502 #include 20503 20504 int inflateSetDictionary(z_streamp stream, const Bytef * 20505 dictionary, uInt dictlen); 20506 20507 Description 20508 20509 The inflateSetDictionary() function shall initialize the 20510 decompression dictionary associated with stream using the 20511 dictlen bytes referenced by dictionary. 20512 20513 The inflateSetDictionary() function should be called 20514 immediately after a call to inflate() has failed with return 20515 value Z_NEED_DICT. The dictionary must have the same Adler-32 20516 checksum as the dictionary used for the compression (see 20517 deflateSetDictionary()). 20518 20519 stream shall reference an initialized decompression stream, 20520 with total_in zero (i.e. no data has been decompressed since 20521 the stream was initialized). 20522 20523 Return Value 20524 20525 On success, inflateSetDictionary() shall return Z_OK. Otherwise 20526 it shall return a value as indicated below. 20527 20528 Errors 20529 20530 On error, inflateSetDictionary() shall return a value as 20531 described below: 20532 20533 Z_STREAM_ERROR 20534 20535 The state in stream is inconsistent, or stream was NULL. 20536 Z_DATA_ERROR 20537 20538 The Adler-32 checksum of the supplied dictionary does not match 20539 that used for the compression. 20540 20541 Application Usage (informative) 20542 20543 The application should provide a dictionary consisting of 20544 strings {{{ed note: do we really mean "strings"? Null 20545 terminated?}}} that are likely to be encountered in the data to 20546 be compressed. The application should ensure that the 20547 dictionary is sorted such that the most commonly used strings 20548 occur at the end of the dictionary. 20549 20550 The use of a dictionary is optional; however if the data to be 20551 compressed is relatively short and has a predictable structure, 20552 the use of a dictionary can substantially improve the 20553 compression ratio. 20554 20555 inflateSync 20556 20557 Name 20558 20559 inflateSync -- advance compression stream to next sync point 20560 20561 Synopsis 20562 20563 #include 20564 20565 int inflateSync(z_streamp stream); 20566 20567 Description 20568 20569 The inflateSync() function shall advance through the compressed 20570 data in stream, skipping any invalid compressed data, until the 20571 next full flush point is reached, or all input is exhausted. 20572 See the description for deflate() with flush level 20573 Z_FULL_FLUSH. No output is placed in next_out. 20574 20575 Return Value 20576 20577 On success, inflateSync() shall return Z_OK, and update the 20578 next_in, avail_in, and total_in fields of stream to reflect the 20579 number of bytes of compressed data that have been skipped. 20580 Otherwise, inflateSync() shall return a value as described 20581 below to indicate the error. 20582 20583 Errors 20584 20585 On error, inflateSync() shall return a value as described 20586 below: 20587 20588 Z_STREAM_ERROR 20589 20590 The state (as represented in stream) is inconsistent, or stream 20591 was NULL. 20592 Z_BUF_ERROR 20593 20594 There is no data available to skip over. 20595 Z_DATA_ERROR 20596 20597 No sync point was found. 20598 20599 inflateSyncPoint 20600 20601 Name 20602 20603 inflateSyncPoint -- test for synchronization point 20604 20605 Synopsis 20606 20607 #include 20608 20609 int inflateSyncPoint(z_streamp stream); 20610 20611 Description 20612 20613 The inflateSyncPoint() function shall return a non-zero value 20614 if the compressed data stream referenced by stream is at a 20615 synchronization point. 20616 20617 Return Value 20618 20619 If the compressed data in stream is at a synchronization point 20620 (see deflate() with a flush level of Z_SYNC_FLUSH or 20621 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 20622 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 20623 valid, inflateSyncPoint() shall return 0. If stream is invalid, 20624 or in an invalid state, inflateSyncPoint() shall return 20625 Z_STREAM_ERROR to indicate the error. 20626 20627 Errors 20628 20629 On error, inflateSyncPoint() shall return a value as described 20630 below: 20631 20632 Z_STREAM_ERROR 20633 20634 The state (as represented in stream) is inconsistent, or stream 20635 was NULL. 20636 20637 uncompress 20638 20639 Name 20640 20641 uncompress -- uncompress data 20642 20643 Synopsis 20644 20645 #include 20646 20647 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 20648 source, uLong sourceLen); 20649 20650 Description 20651 20652 The uncompress() function shall attempt to uncompress sourceLen 20653 bytes of data in the buffer source, placing the result in the 20654 buffer dest. 20655 20656 On entry, destLen should point to a value describing the size 20657 of the dest buffer. The application should ensure that this 20658 value is large enough to hold the entire uncompressed data. 20659 20660 Note: The LSB does not describe any mechanism by which a 20661 compressor can communicate the size required to the 20662 uncompressor. 20663 20664 On successful exit, the variable referenced by destLen shall be 20665 updated to hold the length of uncompressed data in dest. 20666 20667 Return Value 20668 20669 On success, uncompress() shall return Z_OK. Otherwise, 20670 uncompress() shall return a value to indicate the error. 20671 20672 Errors 20673 20674 On error, uncompress() shall return a value as described below: 20675 20676 Z_BUF_ERROR 20677 20678 The buffer dest was not large enough to hold the uncompressed 20679 data. 20680 Z_MEM_ERROR 20681 20682 Insufficient memory. 20683 Z_DATA_ERROR 20684 20685 The compressed data (referenced by source) was corrupted. 20686 20687 zError 20688 20689 Name 20690 20691 zError -- translate error number to string 20692 20693 Synopsis 20694 20695 #include 20696 20697 const char * zError(int err); 20698 20699 Description 20700 20701 The zError() function shall return the string identifying the 20702 error associated with err. This allows for conversion from 20703 error code to string for functions such as compress() and 20704 uncompress(), that do not always set the string version of an 20705 error. 20706 20707 Return Value 20708 20709 The zError() function shall return a the string identifying the 20710 error associated with err, or NULL if err is not a valid error 20711 code. 20712 20713 It is unspecified if the string returned is determined by the 20714 setting of the LC_MESSAGES category in the current locale. 20715 20716 Errors 20717 20718 None defined. 20719 20720 zlibVersion 20721 20722 Name 20723 20724 zlibVersion -- discover library version at run time 20725 20726 Synopsis 20727 20728 #include 20729 20730 const char * zlibVersion (void); 20731 20732 Description 20733 20734 The zlibVersion() function shall return the string identifying 20735 the interface version at the time the library was built. 20736 20737 Applications should compare the value returned from 20738 zlibVersion() with the macro constant ZLIB_VERSION for 20739 compatibility. 20740 20741 Return Value 20742 20743 The zlibVersion() function shall return a the string 20744 identifying the version of the library currently implemented. 20745 20746 Errors 20747 20748 None defined. 20749 __________________________________________________________ 20750 20751 14.5. Interfaces for libncurses 20752 20753 Table 14-3 defines the library name and shared object name for 20754 the libncurses library 20755 20756 Table 14-3. libncurses Definition 20757 Library: libncurses 20758 SONAME: libncurses.so.5 20759 20760 The Parameters or return value of the following interface have 20761 had the const qualifier added as shown here. 20762 extern const char *keyname (int); 20763 extern int mvscanw (int, int, const char *, ...); 20764 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 20765 extern SCREEN *newterm (const char *, FILE *, FILE *); 20766 extern int scanw (const char *, ...); 20767 extern int vwscanw (WINDOW *, const char *, va_list); 20768 extern int vw_scanw (WINDOW *, const char *, va_list); 20769 extern int wscanw (WINDOW *, const char *, ...); 20770 20771 The behavior of the interfaces in this library is specified by 20772 the following specifications: 20773 20774 [SUS-CURSES] X/Open Curses 20775 __________________________________________________________ 20776 20777 14.5.1. Curses 20778 __________________________________________________________ 20779 20780 14.5.1.1. Interfaces for Curses 20781 20782 An LSB conforming implementation shall provide the generic 20783 functions for Curses specified in Table 14-4, with the full 20784 mandatory functionality as described in the referenced 20785 underlying specification. 20786 20787 Table 14-4. libncurses - Curses Function Interfaces 20788 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr [SUS-CURSES] 20789 addnstr [SUS-CURSES] 20790 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off [SUS-CURSES] 20791 attr_on [SUS-CURSES] 20792 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 20793 attrset [SUS-CURSES] 20794 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 20795 bkgdset [SUS-CURSES] 20796 border [SUS-CURSES] box [SUS-CURSES] can_change_color 20797 [SUS-CURSES] cbreak [SUS-CURSES] 20798 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 20799 clrtobot [SUS-CURSES] 20800 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 20801 [SUS-CURSES] copywin [SUS-CURSES] 20802 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] def_shell_mode 20803 [SUS-CURSES] del_curterm [SUS-CURSES] 20804 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 20805 [SUS-CURSES] delscreen [SUS-CURSES] 20806 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 20807 dupwin [SUS-CURSES] 20808 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 20809 erase [SUS-CURSES] 20810 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 20811 flushinp [SUS-CURSES] 20812 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 20813 getstr [SUS-CURSES] 20814 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 20815 [SUS-CURSES] has_ic [SUS-CURSES] 20816 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] idlok 20817 [SUS-CURSES] 20818 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [SUS-CURSES] 20819 inchstr [SUS-CURSES] 20820 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 20821 [SUS-CURSES] innstr [SUS-CURSES] 20822 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 20823 insnstr [SUS-CURSES] 20824 insstr [SUS-CURSES] instr [SUS-CURSES] intrflush [SUS-CURSES] 20825 is_linetouched [SUS-CURSES] 20826 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 20827 [SUS-CURSES] keypad [SUS-CURSES] 20828 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 20829 [SUS-CURSES] meta [SUS-CURSES] 20830 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr [SUS-CURSES] 20831 mvaddchstr [SUS-CURSES] 20832 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 20833 [SUS-CURSES] mvcur [SUS-CURSES] 20834 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch [SUS-CURSES] 20835 mvgetnstr [SUS-CURSES] 20836 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 20837 mvinchnstr [SUS-CURSES] 20838 mvinchstr [SUS-CURSES] mvinnstr [SUS-CURSES] mvinsch 20839 [SUS-CURSES] mvinsnstr [SUS-CURSES] 20840 mvinsstr [SUS-CURSES] mvinstr [SUS-CURSES] mvprintw 20841 [SUS-CURSES] mvscanw [SUS-CURSES] 20842 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 20843 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 20844 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 20845 [SUS-CURSES] mvwdelch [SUS-CURSES] 20846 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 20847 [SUS-CURSES] mvwhline [SUS-CURSES] 20848 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr 20849 [SUS-CURSES] mvwinchstr [SUS-CURSES] 20850 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 20851 [SUS-CURSES] mvwinsstr [SUS-CURSES] 20852 mvwinstr [SUS-CURSES] mvwprintw [SUS-CURSES] mvwscanw 20853 [SUS-CURSES] mvwvline [SUS-CURSES] 20854 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 20855 newwin [SUS-CURSES] 20856 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 20857 noecho [SUS-CURSES] 20858 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 20859 notimeout [SUS-CURSES] 20860 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 20861 [SUS-CURSES] pechochar [SUS-CURSES] 20862 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 20863 [SUS-CURSES] putp [SUS-CURSES] 20864 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 20865 redrawwin [SUS-CURSES] 20866 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 20867 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 20868 restartterm [SUS-CURSES] ripoffline [SUS-CURSES] savetty 20869 [SUS-CURSES] scanw [SUS-CURSES] 20870 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 20871 [SUS-CURSES] scr_set [SUS-CURSES] 20872 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 20873 set_curterm [SUS-CURSES] 20874 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 20875 [SUS-CURSES] slk_attr_set [SUS-CURSES] 20876 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 20877 [SUS-CURSES] slk_clear [SUS-CURSES] 20878 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 20879 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 20880 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 20881 [SUS-CURSES] slk_touch [SUS-CURSES] 20882 standend [SUS-CURSES] standout [SUS-CURSES] start_color 20883 [SUS-CURSES] subpad [SUS-CURSES] 20884 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 20885 termname [SUS-CURSES] 20886 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum [SUS-CURSES] 20887 tgetstr [SUS-CURSES] 20888 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum [SUS-CURSES] 20889 tigetstr [SUS-CURSES] 20890 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 20891 [SUS-CURSES] tparm [SUS-CURSES] 20892 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 20893 ungetch [SUS-CURSES] 20894 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 20895 [SUS-CURSES] vidputs [SUS-CURSES] 20896 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw [SUS-CURSES] 20897 vwprintw [SUS-CURSES] 20898 vwscanw [SUS-CURSES] waddch [SUS-CURSES] waddchnstr 20899 [SUS-CURSES] waddchstr [SUS-CURSES] 20900 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 20901 [SUS-CURSES] wattr_off [SUS-CURSES] 20902 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 20903 [SUS-CURSES] wattron [SUS-CURSES] 20904 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 20905 wborder [SUS-CURSES] 20906 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 20907 wclrtoeol [SUS-CURSES] 20908 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 20909 [SUS-CURSES] wdeleteln [SUS-CURSES] 20910 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 20911 wgetnstr [SUS-CURSES] 20912 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 20913 winchnstr [SUS-CURSES] 20914 winchstr [SUS-CURSES] winnstr [SUS-CURSES] winsch [SUS-CURSES] 20915 winsdelln [SUS-CURSES] 20916 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 20917 [SUS-CURSES] winstr [SUS-CURSES] 20918 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 20919 [SUS-CURSES] wredrawln [SUS-CURSES] 20920 wrefresh [SUS-CURSES] wscanw [SUS-CURSES] wscrl [SUS-CURSES] 20921 wsetscrreg [SUS-CURSES] 20922 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 20923 [SUS-CURSES] wsyncup [SUS-CURSES] 20924 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline [SUS-CURSES] 20925 20926 An LSB conforming implementation shall provide the generic data 20927 interfaces for Curses specified in Table 14-5, with the full 20928 mandatory functionality as described in the referenced 20929 underlying specification. 20930 20931 Table 14-5. libncurses - Curses Data Interfaces 20932 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 20933 LINES [SUS-CURSES] 20934 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 20935 stdscr [SUS-CURSES] 20936 __________________________________________________________ 20937 20938 14.6. Data Definitions for libncurses 20939 20940 This section defines global identifiers and their values that 20941 are associated with interfaces contained in libncurses. These 20942 definitions are organized into groups that correspond to system 20943 headers. This convention is used as a convenience for the 20944 reader, and does not imply the existence of these headers, or 20945 their content. Where an interface is defined as requiring a 20946 particular system header file all of the data definitions for 20947 that system header file presented here shall be in effect. 20948 20949 This section gives data definitions to promote binary 20950 application portability, not to repeat source interface 20951 definitions available elsewhere. System providers and 20952 application developers should use this ABI to supplement - not 20953 to replace - source interface definition specifications. 20954 20955 This specification uses the ISO C (1999) C Language as the 20956 reference programming language, and data definitions are 20957 specified in ISO C format. The C language is used here as a 20958 convenient notation. Using a C language description of these 20959 data objects does not preclude their use by other programming 20960 languages. 20961 __________________________________________________________ 20962 20963 14.6.1. curses.h 20964 20965 #define ERR (-1) 20966 #define OK (0) 20967 #define ACS_RARROW (acs_map['+']) 20968 #define ACS_LARROW (acs_map[',']) 20969 #define ACS_UARROW (acs_map['-']) 20970 #define ACS_DARROW (acs_map['.']) 20971 #define ACS_BLOCK (acs_map['0']) 20972 #define ACS_CKBOARD (acs_map['a']) 20973 #define ACS_DEGREE (acs_map['f']) 20974 #define ACS_PLMINUS (acs_map['g']) 20975 #define ACS_BOARD (acs_map['h']) 20976 #define ACS_LANTERN (acs_map['i']) 20977 #define ACS_LRCORNER (acs_map['j']) 20978 #define ACS_URCORNER (acs_map['k']) 20979 #define ACS_ULCORNER (acs_map['l']) 20980 #define ACS_LLCORNER (acs_map['m']) 20981 #define ACS_PLUS (acs_map['n']) 20982 #define ACS_S1 (acs_map['o']) 20983 #define ACS_HLINE (acs_map['q']) 20984 #define ACS_S9 (acs_map['s']) 20985 #define ACS_LTEE (acs_map['t']) 20986 #define ACS_RTEE (acs_map['u']) 20987 #define ACS_BTEE (acs_map['v']) 20988 #define ACS_TTEE (acs_map['w']) 20989 #define ACS_VLINE (acs_map['x']) 20990 #define ACS_DIAMOND (acs_map['`']) 20991 #define ACS_BULLET (acs_map['~']) 20992 #define getmaxyx(win,y,x) \ 20993 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 20994 #define getbegyx(win,y,x) \ 20995 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 20996 #define getyx(win,y,x) \ 20997 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 20998 #define getparyx(win,y,x) \ 20999 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 21000 21001 #define WA_ALTCHARSET A_ALTCHARSET 21002 #define WA_ATTRIBUTES A_ATTRIBUTES 21003 #define WA_BLINK A_BLINK 21004 #define WA_BOLD A_BOLD 21005 #define WA_DIM A_DIM 21006 #define WA_HORIZONTAL A_HORIZONTAL 21007 #define WA_INVIS A_INVIS 21008 #define WA_LEFT A_LEFT 21009 #define WA_LOW A_LOW 21010 #define WA_NORMAL A_NORMAL 21011 #define WA_PROTECT A_PROTECT 21012 #define WA_REVERSE A_REVERSE 21013 #define WA_RIGHT A_RIGHT 21014 #define WA_STANDOUT A_STANDOUT 21015 #define WA_TOP A_TOP 21016 #define WA_UNDERLINE A_UNDERLINE 21017 #define WA_VERTICAL A_VERTICAL 21018 #define A_REVERSE NCURSES_BITS(1UL,10) 21019 21020 #define COLOR_BLACK 0 21021 #define COLOR_RED 1 21022 #define COLOR_GREEN 2 21023 #define COLOR_YELLOW 3 21024 #define COLOR_BLUE 4 21025 #define COLOR_MAGENTA 5 21026 #define COLOR_CYAN 6 21027 #define COLOR_WHITE 7 21028 21029 #define _SUBWIN 0x01 21030 #define _ENDLINE 0x02 21031 #define _FULLWIN 0x04 21032 #define _SCROLLWIN 0x08 21033 #define _ISPAD 0x10 21034 #define _HASMOVED 0x20 21035 21036 typedef unsigned char bool; 21037 21038 typedef unsigned long int chtype; 21039 typedef struct screen SCREEN; 21040 typedef struct _win_st WINDOW; 21041 typedef chtype attr_t; 21042 typedef struct { 21043 attr_t attr; 21044 wchar_t chars[5]; 21045 } cchar_t; 21046 struct pdat { 21047 short _pad_y; 21048 short _pad_x; 21049 short _pad_top; 21050 short _pad_left; 21051 short _pad_bottom; 21052 short _pad_right; 21053 }; 21054 21055 struct _win_st { 21056 short _cury; 21057 short _curx; 21058 short _maxy; 21059 short _maxx; 21060 short _begy; 21061 short _begx; 21062 short _flags; 21063 attr_t _attrs; 21064 chtype _bkgd; 21065 bool _notimeout; 21066 bool _clear; 21067 bool _leaveok; 21068 bool _scroll; 21069 bool _idlok; 21070 bool _idcok; 21071 bool _immed; 21072 bool _sync; 21073 bool _use_keypad; 21074 int _delay; 21075 struct ldat *_line; 21076 short _regtop; 21077 short _regbottom; 21078 int _parx; 21079 int _pary; 21080 WINDOW *_parent; 21081 struct pdat _pad; 21082 short _yoffset; 21083 cchar_t _bkgrnd; 21084 }; 21085 21086 #define KEY_CODE_YES 0400 21087 #define KEY_BREAK 0401 21088 #define KEY_MIN 0401 21089 #define KEY_DOWN 0402 21090 #define KEY_UP 0403 21091 #define KEY_LEFT 0404 21092 #define KEY_RIGHT 0405 21093 #define KEY_HOME 0406 21094 #define KEY_BACKSPACE 0407 21095 #define KEY_F0 0410 21096 #define KEY_DL 0510 21097 #define KEY_IL 0511 21098 #define KEY_DC 0512 21099 #define KEY_IC 0513 21100 #define KEY_EIC 0514 21101 #define KEY_CLEAR 0515 21102 #define KEY_EOS 0516 21103 #define KEY_EOL 0517 21104 #define KEY_SF 0520 21105 #define KEY_SR 0521 21106 #define KEY_NPAGE 0522 21107 #define KEY_PPAGE 0523 21108 #define KEY_STAB 0524 21109 #define KEY_CTAB 0525 21110 #define KEY_CATAB 0526 21111 #define KEY_ENTER 0527 21112 #define KEY_SRESET 0530 21113 #define KEY_RESET 0531 21114 #define KEY_PRINT 0532 21115 #define KEY_LL 0533 21116 #define KEY_A1 0534 21117 #define KEY_A3 0535 21118 #define KEY_B2 0536 21119 #define KEY_C1 0537 21120 #define KEY_C3 0540 21121 #define KEY_BTAB 0541 21122 #define KEY_BEG 0542 21123 #define KEY_CANCEL 0543 21124 #define KEY_CLOSE 0544 21125 #define KEY_COMMAND 0545 21126 #define KEY_COPY 0546 21127 #define KEY_CREATE 0547 21128 #define KEY_END 0550 21129 #define KEY_EXIT 0551 21130 #define KEY_FIND 0552 21131 #define KEY_HELP 0553 21132 #define KEY_MARK 0554 21133 #define KEY_MESSAGE 0555 21134 #define KEY_MOVE 0556 21135 #define KEY_NEXT 0557 21136 #define KEY_OPEN 0560 21137 #define KEY_OPTIONS 0561 21138 #define KEY_PREVIOUS 0562 21139 #define KEY_REDO 0563 21140 #define KEY_REFERENCE 0564 21141 #define KEY_REFRESH 0565 21142 #define KEY_REPLACE 0566 21143 #define KEY_RESTART 0567 21144 #define KEY_RESUME 0570 21145 #define KEY_SAVE 0571 21146 #define KEY_SBEG 0572 21147 #define KEY_SCANCEL 0573 21148 #define KEY_SCOMMAND 0574 21149 #define KEY_SCOPY 0575 21150 #define KEY_SCREATE 0576 21151 #define KEY_SDC 0577 21152 #define KEY_SDL 0600 21153 #define KEY_SELECT 0601 21154 #define KEY_SEND 0602 21155 #define KEY_SEOL 0603 21156 #define KEY_SEXIT 0604 21157 #define KEY_SFIND 0605 21158 #define KEY_SHELP 0606 21159 #define KEY_SHOME 0607 21160 #define KEY_SIC 0610 21161 #define KEY_SLEFT 0611 21162 #define KEY_SMESSAGE 0612 21163 #define KEY_SMOVE 0613 21164 #define KEY_SNEXT 0614 21165 #define KEY_SOPTIONS 0615 21166 #define KEY_SPREVIOUS 0616 21167 #define KEY_SPRINT 0617 21168 #define KEY_SREDO 0620 21169 #define KEY_SREPLACE 0621 21170 #define KEY_SRIGHT 0622 21171 #define KEY_SRSUME 0623 21172 #define KEY_SSAVE 0624 21173 #define KEY_SSUSPEND 0625 21174 #define KEY_SUNDO 0626 21175 #define KEY_SUSPEND 0627 21176 #define KEY_UNDO 0630 21177 #define KEY_MOUSE 0631 21178 #define KEY_RESIZE 0632 21179 #define KEY_MAX 0777 21180 21181 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 21182 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 21183 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 21184 #define A_NORMAL 0L 21185 #define NCURSES_ATTR_SHIFT 8 21186 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 21187 #define A_BLINK NCURSES_BITS(1UL,11) 21188 #define A_DIM NCURSES_BITS(1UL,12) 21189 #define A_BOLD NCURSES_BITS(1UL,13) 21190 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 21191 #define A_INVIS NCURSES_BITS(1UL,15) 21192 #define A_PROTECT NCURSES_BITS(1UL,16) 21193 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 21194 #define A_LEFT NCURSES_BITS(1UL,18) 21195 #define A_LOW NCURSES_BITS(1UL,19) 21196 #define A_RIGHT NCURSES_BITS(1UL,20) 21197 #define A_TOP NCURSES_BITS(1UL,21) 21198 #define A_VERTICAL NCURSES_BITS(1UL,22) 21199 #define A_STANDOUT NCURSES_BITS(1UL,8) 21200 #define A_UNDERLINE NCURSES_BITS(1UL,9) 21201 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 21202 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 21203 21204 extern int addch(const chtype); 21205 extern int addchnstr(const chtype *, int); 21206 extern int addchstr(const chtype *); 21207 extern int addnstr(const char *, int); 21208 extern int addstr(const char *); 21209 extern int attroff(int); 21210 extern int attron(int); 21211 extern int attrset(int); 21212 extern int attr_get(attr_t *, short *, void *); 21213 extern int attr_off(attr_t, void *); 21214 extern int attr_on(attr_t, void *); 21215 extern int attr_set(attr_t, short, void *); 21216 extern int baudrate(void); 21217 extern int beep(void); 21218 extern int bkgd(chtype); 21219 extern void bkgdset(chtype); 21220 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 21221 chtype); 21222 extern int box(WINDOW *, chtype, chtype); 21223 extern bool can_change_color(void); 21224 extern int cbreak(void); 21225 extern int chgat(int, attr_t, short, const void *); 21226 extern int clear(void); 21227 extern int clearok(WINDOW *, bool); 21228 extern int clrtobot(void); 21229 extern int clrtoeol(void); 21230 extern int color_content(short, short *, short *, short *); 21231 extern int color_set(short, void *); 21232 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 21233 int); 21234 extern int curs_set(int); 21235 extern int def_prog_mode(void); 21236 extern int def_shell_mode(void); 21237 extern int delay_output(int); 21238 extern int delch(void); 21239 extern void delscreen(SCREEN *); 21240 extern int delwin(WINDOW *); 21241 extern int deleteln(void); 21242 extern WINDOW *derwin(WINDOW *, int, int, int, int); 21243 extern int doupdate(void); 21244 extern WINDOW *dupwin(WINDOW *); 21245 extern int echo(void); 21246 extern int echochar(const chtype); 21247 extern int erase(void); 21248 extern int endwin(void); 21249 extern char erasechar(void); 21250 extern void filter(void); 21251 extern int flash(void); 21252 extern int flushinp(void); 21253 extern chtype getbkgd(WINDOW *); 21254 extern int getch(void); 21255 extern int getnstr(char *, int); 21256 extern int getstr(char *); 21257 extern WINDOW *getwin(FILE *); 21258 extern int halfdelay(int); 21259 extern bool has_colors(void); 21260 extern bool has_ic(void); 21261 extern bool has_il(void); 21262 extern int hline(chtype, int); 21263 extern void idcok(WINDOW *, bool); 21264 extern int idlok(WINDOW *, bool); 21265 extern void immedok(WINDOW *, bool); 21266 extern chtype inch(void); 21267 extern int inchnstr(chtype *, int); 21268 extern int inchstr(chtype *); 21269 extern WINDOW *initscr(void); 21270 extern int init_color(short, short, short, short); 21271 extern int init_pair(short, short, short); 21272 extern int innstr(char *, int); 21273 extern int insch(chtype); 21274 extern int insdelln(int); 21275 extern int insertln(void); 21276 extern int insnstr(const char *, int); 21277 extern int insstr(const char *); 21278 extern int instr(char *); 21279 extern int intrflush(WINDOW *, bool); 21280 extern bool isendwin(void); 21281 extern bool is_linetouched(WINDOW *, int); 21282 extern bool is_wintouched(WINDOW *); 21283 extern const char *keyname(int); 21284 extern int keypad(WINDOW *, bool); 21285 extern char killchar(void); 21286 extern int leaveok(WINDOW *, bool); 21287 extern char *longname(void); 21288 extern int meta(WINDOW *, bool); 21289 extern int move(int, int); 21290 extern int mvaddch(int, int, const chtype); 21291 extern int mvaddchnstr(int, int, const chtype *, int); 21292 extern int mvaddchstr(int, int, const chtype *); 21293 extern int mvaddnstr(int, int, const char *, int); 21294 extern int mvaddstr(int, int, const char *); 21295 extern int mvchgat(int, int, int, attr_t, short, const void *); 21296 extern int mvcur(int, int, int, int); 21297 extern int mvdelch(int, int); 21298 extern int mvderwin(WINDOW *, int, int); 21299 extern int mvgetch(int, int); 21300 extern int mvgetnstr(int, int, char *, int); 21301 extern int mvgetstr(int, int, char *); 21302 extern int mvhline(int, int, chtype, int); 21303 extern chtype mvinch(int, int); 21304 extern int mvinchnstr(int, int, chtype *, int); 21305 extern int mvinchstr(int, int, chtype *); 21306 extern int mvinnstr(int, int, char *, int); 21307 extern int mvinsch(int, int, chtype); 21308 extern int mvinsnstr(int, int, const char *, int); 21309 extern int mvinsstr(int, int, const char *); 21310 extern int mvinstr(int, int, char *); 21311 extern int mvprintw(int, int, char *, ...); 21312 extern int mvscanw(int, int, const char *, ...); 21313 extern int mvvline(int, int, chtype, int); 21314 extern int mvwaddch(WINDOW *, int, int, const chtype); 21315 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 21316 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 21317 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 21318 extern int mvwaddstr(WINDOW *, int, int, const char *); 21319 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *); 21320 extern int mvwdelch(WINDOW *, int, int); 21321 extern int mvwgetch(WINDOW *, int, int); 21322 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 21323 extern int mvwgetstr(WINDOW *, int, int, char *); 21324 extern int mvwhline(WINDOW *, int, int, chtype, int); 21325 extern int mvwin(WINDOW *, int, int); 21326 extern chtype mvwinch(WINDOW *, int, int); 21327 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 21328 extern int mvwinchstr(WINDOW *, int, int, chtype *); 21329 extern int mvwinnstr(WINDOW *, int, int, char *, int); 21330 extern int mvwinsch(WINDOW *, int, int, chtype); 21331 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 21332 extern int mvwinsstr(WINDOW *, int, int, const char *); 21333 extern int mvwinstr(WINDOW *, int, int, char *); 21334 extern int mvwprintw(WINDOW *, int, int, char *, ...); 21335 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 21336 extern int mvwvline(WINDOW *, int, int, chtype, int); 21337 extern int napms(int); 21338 extern WINDOW *newpad(int, int); 21339 extern SCREEN *newterm(const char *, FILE *, FILE *); 21340 extern WINDOW *newwin(int, int, int, int); 21341 extern int nl(void); 21342 extern int nocbreak(void); 21343 extern int nodelay(WINDOW *, bool); 21344 extern int noecho(void); 21345 extern int nonl(void); 21346 extern void noqiflush(void); 21347 extern int noraw(void); 21348 extern int notimeout(WINDOW *, bool); 21349 extern int overlay(const WINDOW *, WINDOW *); 21350 extern int overwrite(const WINDOW *, WINDOW *); 21351 extern int pair_content(short, short *, short *); 21352 extern int pechochar(WINDOW *, chtype); 21353 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 21354 extern int prefresh(WINDOW *, int, int, int, int, int, int); 21355 extern int printw(char *, ...); 21356 extern int putwin(WINDOW *, FILE *); 21357 extern void qiflush(void); 21358 extern int raw(void); 21359 extern int redrawwin(WINDOW *); 21360 extern int refresh(void); 21361 extern int resetty(void); 21362 extern int reset_prog_mode(void); 21363 extern int reset_shell_mode(void); 21364 extern int ripoffline(int, int (*_bkgrnd) (WINDOW *, int) 21365 ); 21366 extern int savetty(void); 21367 extern int scanw(const char *, ...); 21368 extern int scr_dump(const char *); 21369 extern int scr_init(const char *); 21370 extern int scrl(int); 21371 extern int scroll(WINDOW *); 21372 extern int scrollok(WINDOW *, bool); 21373 extern int scr_restore(const char *); 21374 extern int scr_set(const char *); 21375 extern int setscrreg(int, int); 21376 extern SCREEN *set_term(SCREEN *); 21377 extern int slk_attroff(const chtype); 21378 extern int slk_attron(const chtype); 21379 extern int slk_attrset(const chtype); 21380 extern int slk_attr_set(const attr_t, short, void *); 21381 extern int slk_clear(void); 21382 extern int slk_color(short); 21383 extern int slk_init(int); 21384 extern char *slk_label(int); 21385 extern int slk_noutrefresh(void); 21386 extern int slk_refresh(void); 21387 extern int slk_restore(void); 21388 extern int slk_set(int, const char *, int); 21389 extern int slk_touch(void); 21390 extern int standout(void); 21391 extern int standend(void); 21392 extern int start_color(void); 21393 extern WINDOW *subpad(WINDOW *, int, int, int, int); 21394 extern WINDOW *subwin(WINDOW *, int, int, int, int); 21395 extern int syncok(WINDOW *, bool); 21396 extern chtype termattrs(void); 21397 extern char *termname(void); 21398 extern void timeout(int); 21399 extern int typeahead(int); 21400 extern int ungetch(int); 21401 extern int untouchwin(WINDOW *); 21402 extern void use_env(bool); 21403 extern int vidattr(chtype); 21404 extern int vidputs(chtype, int (*_bkgrnd) (int) 21405 ); 21406 extern int vline(chtype, int); 21407 extern int vwprintw(WINDOW *, char *, va_list); 21408 extern int vw_printw(WINDOW *, const char *, va_list); 21409 extern int vwscanw(WINDOW *, const char *, va_list); 21410 extern int vw_scanw(WINDOW *, const char *, va_list); 21411 extern int waddch(WINDOW *, const chtype); 21412 extern int waddchnstr(WINDOW *, const chtype *, int); 21413 extern int waddchstr(WINDOW *, const chtype *); 21414 extern int waddnstr(WINDOW *, const char *, int); 21415 extern int waddstr(WINDOW *, const char *); 21416 extern int wattron(WINDOW *, int); 21417 extern int wattroff(WINDOW *, int); 21418 extern int wattrset(WINDOW *, int); 21419 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 21420 extern int wattr_on(WINDOW *, attr_t, void *); 21421 extern int wattr_off(WINDOW *, attr_t, void *); 21422 extern int wattr_set(WINDOW *, attr_t, short, void *); 21423 extern int wbkgd(WINDOW *, chtype); 21424 extern void wbkgdset(WINDOW *, chtype); 21425 extern int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, 21426 chtype, chtype, chtype); 21427 extern int wchgat(WINDOW *, int, attr_t, short, const void *); 21428 extern int wclear(WINDOW *); 21429 extern int wclrtobot(WINDOW *); 21430 extern int wclrtoeol(WINDOW *); 21431 extern int wcolor_set(WINDOW *, short, void *); 21432 extern void wcursyncup(WINDOW *); 21433 extern int wdelch(WINDOW *); 21434 extern int wdeleteln(WINDOW *); 21435 extern int wechochar(WINDOW *, const chtype); 21436 extern int werase(WINDOW *); 21437 extern int wgetch(WINDOW *); 21438 extern int wgetnstr(WINDOW *, char *, int); 21439 extern int wgetstr(WINDOW *, char *); 21440 extern int whline(WINDOW *, chtype, int); 21441 extern chtype winch(WINDOW *); 21442 extern int winchnstr(WINDOW *, chtype *, int); 21443 extern int winchstr(WINDOW *, chtype *); 21444 extern int winnstr(WINDOW *, char *, int); 21445 extern int winsch(WINDOW *, chtype); 21446 extern int winsdelln(WINDOW *, int); 21447 extern int winsertln(WINDOW *); 21448 extern int winsnstr(WINDOW *, const char *, int); 21449 extern int winsstr(WINDOW *, const char *); 21450 extern int winstr(WINDOW *, char *); 21451 extern int wmove(WINDOW *, int, int); 21452 extern int wnoutrefresh(WINDOW *); 21453 extern int wprintw(WINDOW *, char *, ...); 21454 extern int wredrawln(WINDOW *, int, int); 21455 extern int wrefresh(WINDOW *); 21456 extern int wscanw(WINDOW *, const char *, ...); 21457 extern int wscrl(WINDOW *, int); 21458 extern int wsetscrreg(WINDOW *, int, int); 21459 extern int wstandout(WINDOW *); 21460 extern int wstandend(WINDOW *); 21461 extern void wsyncdown(WINDOW *); 21462 extern void wsyncup(WINDOW *); 21463 extern void wtimeout(WINDOW *, int); 21464 extern int wtouchln(WINDOW *, int, int, int); 21465 extern int wvline(WINDOW *, chtype, int); 21466 extern char *unctrl(chtype); 21467 extern int COLORS; 21468 extern int COLOR_PAIRS; 21469 extern chtype acs_map[]; 21470 extern WINDOW *curscr; 21471 extern WINDOW *stdscr; 21472 extern int COLS; 21473 extern int LINES; 21474 extern int touchline(WINDOW *, int, int); 21475 extern int touchwin(WINDOW *); 21476 __________________________________________________________ 21477 21478 14.6.2. term.h 21479 21480 extern int putp(const char *); 21481 extern int tigetflag(const char *); 21482 extern int tigetnum(const char *); 21483 extern char *tigetstr(const char *); 21484 extern char *tparm(const char *, ...); 21485 extern TERMINAL *set_curterm(TERMINAL *); 21486 extern int del_curterm(TERMINAL *); 21487 extern int restartterm(char *, int, int *); 21488 extern int setupterm(char *, int, int *); 21489 extern char *tgetstr(char *, char **); 21490 extern char *tgoto(const char *, int, int); 21491 extern int tgetent(char *, const char *); 21492 extern int tgetflag(char *); 21493 extern int tgetnum(char *); 21494 extern int tputs(const char *, int, int (*)(int) 21495 ); 21496 extern TERMINAL *cur_term; 21497 __________________________________________________________ 21498 21499 14.7. Interfaces for libutil 21500 21501 Table 14-6 defines the library name and shared object name for 21502 the libutil library 21503 21504 Table 14-6. libutil Definition 21505 Library: libutil 21506 SONAME: libutil.so.1 21507 21508 The behavior of the interfaces in this library is specified by 21509 the following specifications: 21510 21511 [LSB] This Specification 21512 __________________________________________________________ 21513 21514 14.7.1. Utility Functions 21515 __________________________________________________________ 21516 21517 14.7.1.1. Interfaces for Utility Functions 21518 21519 An LSB conforming implementation shall provide the generic 21520 functions for Utility Functions specified in Table 14-7, with 21521 the full mandatory functionality as described in the referenced 21522 underlying specification. 21523 21524 Table 14-7. libutil - Utility Functions Function Interfaces 21525 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 21526 logwtmp [LSB] openpty [LSB] 21527 __________________________________________________________ 21528 21529 14.8. Interface Definitions for libutil 21530 21531 Table of Contents 21532 forkpty -- Create a new process attached to an available 21533 pseudo-terminal 21534 21535 login -- login utility function 21536 login_tty -- Prepare a terminal for login 21537 logout -- logout utility function 21538 logwtmp -- append an entry to the wtmp file 21539 openpty -- find and open an available pseudo-terminal 21540 21541 The interfaces defined on the following pages are included in 21542 libutil and are defined by this specification. Unless otherwise 21543 noted, these interfaces shall be included in the source 21544 standard. 21545 21546 Other interfaces listed in Section 14.7 shall behave as 21547 described in the referenced base document. 21548 21549 forkpty 21550 21551 Name 21552 21553 forkpty -- Create a new process attached to an available 21554 pseudo-terminal 21555 21556 Synopsis 21557 21558 #include 21559 21560 int forkpty(int * amaster, char * name, struct termios * termp, 21561 struct winsize * winp); 21562 21563 Description 21564 21565 The forkpty() function shall find and open a pseudo-terminal 21566 device pair in the same manner as the openpty() function. If a 21567 pseudo-terminal is available, forkpty() shall create a new 21568 process in the same manner as the fork() function, and prepares 21569 the new process for login in the same manner as login_tty(). 21570 21571 If termp is not null, it shall refer to a termios structure 21572 that shall be used to initialize the characteristics of the 21573 slave device. If winp is not null, it shall refer to a winsize 21574 structure used to initialize the window size of the slave 21575 device. 21576 21577 Return Value 21578 21579 On success, the parent process shall return the process id of 21580 the child, and the child shall return 0. On error, no new 21581 process shall be created, -1 shall be returned, and errno shall 21582 be set appropriately. On success, the parent process shall 21583 receive the file descriptor of the master side of the 21584 pseudo-terminal in the location referenced by amaster, and, if 21585 name is not NULL, the filename of the slave device in name. 21586 21587 Errors 21588 21589 EAGAIN 21590 21591 Unable to create a new process. 21592 ENOENT 21593 21594 There are no available pseudo-terminals. 21595 ENOMEM 21596 21597 Insufficient memory was available. 21598 21599 login 21600 21601 Name 21602 21603 login -- login utility function 21604 21605 Synopsis 21606 21607 #include 21608 21609 void login (struct utmp * ut ); 21610 21611 Description 21612 21613 The login() function shall update the user accounting 21614 databases. The ut parameter shall reference a utmp structure 21615 for all fields except the following: 21616 21617 1. The ut_type field shall be set to USER_PROCESS. 21618 2. The ut_pid field shall be set to the process identifier for 21619 the current process. 21620 3. The ut_line field shall be set to the name of the 21621 controlling terminal device. The name shall be found by 21622 examining the device associated with the standard input, 21623 output and error streams in sequence, until one associated 21624 with a terminal device is found. If none of these streams 21625 refers to a terminal device, the ut_line field shall be set 21626 to "???". If the terminal device is in the /dev directory 21627 hierarchy, the ut_line field shall not contain the leading 21628 "/dev/", otherwise it shall be set to the final component 21629 of the pathname of the device. If the user accounting 21630 database imposes a limit on the size of the ut_line field, 21631 it shall truncate the name, but any such limit shall not be 21632 smaller than UT_LINESIZE (including a terminating null 21633 character). 21634 21635 Return Value 21636 21637 None 21638 21639 Errors 21640 21641 None 21642 21643 login_tty 21644 21645 Name 21646 21647 login_tty -- Prepare a terminal for login 21648 21649 Synopsis 21650 21651 #include 21652 21653 int login_tty (int fdr); 21654 21655 Description 21656 21657 The login_tty() function shall prepare the terminal device 21658 referenced by the file descriptor fdr. This function shall 21659 create a new session, make the terminal the controlling 21660 terminal for the current process, and set the standard input, 21661 output, and error streams of the current process to the 21662 terminal. If fdr is not the standard input, output or error 21663 stream, then login_tty() shall close fdr. 21664 21665 Return Value 21666 21667 On success, login_tty() shall return zero; otherwise -1 is 21668 returned, and errno shall be set appropriately. 21669 21670 Errors 21671 21672 ENOTTY 21673 21674 fdr does not refer to a terminal device. 21675 21676 logout 21677 21678 Name 21679 21680 logout -- logout utility function 21681 21682 Synopsis 21683 21684 #include 21685 21686 int logout (const char * line ); 21687 21688 Description 21689 21690 Given the device line, the logout() function shall search the 21691 user accounting database which is read by getutent() for an 21692 entry with the corresponding line, and with the type of 21693 USER_PROCESS. If a corresponding entry is located, it shall be 21694 updated as follows: 21695 21696 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 21697 bytes). 21698 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 21699 bytes). 21700 3. The ut_tv shall be set to the current time of day. 21701 4. The ut_type field shall be set to DEAD_PROCESS. 21702 21703 Return Value 21704 21705 On success, the logout() function shall return non-zero. Zero 21706 is returned if there was no entry to remove, or if the utmp 21707 file could not be opened or updated. 21708 21709 logwtmp 21710 21711 Name 21712 21713 logwtmp -- append an entry to the wtmp file 21714 21715 Synopsis 21716 21717 #include 21718 21719 void logwtmp (const char * line , const char * name , const 21720 char * host ); 21721 21722 Description 21723 21724 If the process has permission to update the user accounting 21725 databases, the logwtmp() function shall append a record to the 21726 user accounting database that records all logins and logouts. 21727 The record to be appended shall be constructed as follows: 21728 21729 1. The ut_line field shall be initialized from line. If the 21730 user accounting database imposes a limit on the size of the 21731 ut_line field, it shall truncate the value, but any such 21732 limit shall not be smaller than UT_LINESIZE (including a 21733 terminating null character). 21734 2. The ut_name field shall be initialized from name. If the 21735 user accounting database imposes a limit on the size of the 21736 ut_name field, it shall truncate the value, but any such 21737 limit shall not be smaller than UT_NAMESIZE (including a 21738 terminating null character). 21739 3. The ut_host field shall be initialized from host. If the 21740 user accounting database imposes a limit on the size of the 21741 ut_host field, it shall truncate the value, but any such 21742 limit shall not be smaller than UT_HOSTSIZE (including a 21743 terminating null character). 21744 4. If the name parameter does not refer to an empty string 21745 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 21746 otherwise the ut_type field shall be set to DEAD_PROCESS. 21747 5. The ut_id field shall be set to the process identifier for 21748 the current process. 21749 6. The ut_tv field shall be set to the current time of day. 21750 21751 Note: If a process does not have write access to the the 21752 user accounting database, the logwtmp() function will not 21753 update it. Since the function does not return any value, an 21754 application has no way of knowing whether it succeeded or 21755 failed. 21756 21757 Return Value 21758 21759 None. 21760 21761 openpty 21762 21763 Name 21764 21765 openpty -- find and open an available pseudo-terminal 21766 21767 Synopsis 21768 21769 #include 21770 21771 int openpty(int *amaster, int *aslave, char *name, struct 21772 termios *termp, struct winsize *winp); 21773 21774 Description 21775 21776 The openpty() function shall find an available pseudo-terminal 21777 and return file descriptors for the master and slave devices in 21778 the locations referenced by amaster and aslave respectively. If 21779 name is not NULL, the filename of the slave shall be placed in 21780 the user supplied buffer referenced by name. If termp is not 21781 NULL, it shall point to a termios structure used to initialize 21782 the terminal parameters of the slave pseudo-terminal device. If 21783 winp is not NULL, it shall point to a winsize structure used to 21784 initialize the window size parameters of the slave 21785 pseudo-terminal device. 21786 21787 Return Value 21788 21789 On success, zero is returned. On error, -1 is returned, and 21790 errno is set appropriately. 21791 21792 Errors 21793 21794 ENOENT 21795 21796 There are no available pseudo-terminals. 21797 21798 V. Commands and Utilities 21799 21800 Table of Contents 21801 15. Commands and Utilities 21802 21803 15.1. Commands and Utilities 21804 15.2. Command Behavior 21805 21806 ar -- create and maintain library archives 21807 (DEPRECATED) 21808 21809 at -- examine or delete jobs for later execution 21810 awk -- pattern scanning and processing language 21811 batch -- schedule commands to be executed in a batch 21812 queue 21813 21814 bc -- an arbitrary precision calculator language 21815 chfn -- change user name and information 21816 chsh -- change login shell 21817 col -- filter reverse line feeds from input 21818 cpio -- copy file archives in and out 21819 crontab -- maintain crontab files for individual 21820 users 21821 21822 cut -- split a file into sections determined by 21823 context lines 21824 21825 df -- report file system disk space usage 21826 dmesg -- print or control the system message buffer 21827 du -- estimate file space usage 21828 echo -- write arguments to standard output 21829 egrep -- search a file with an Extended Regular 21830 Expression pattern 21831 21832 fgrep -- search a file with a fixed pattern 21833 file -- determine file type 21834 find -- search for files in a directory hierarchy 21835 fuser -- identify processes using files or sockets 21836 gettext -- retrieve text string from message catalog 21837 grep -- print lines matching a pattern 21838 groupadd -- create a new group 21839 groupdel -- delete a group 21840 groupmod -- modify a group 21841 groups -- display a group 21842 gunzip -- uncompress files 21843 gzip -- compress or expand files 21844 hostname -- show or set the system's host name 21845 install -- copy files and set attributes 21846 install_initd -- activate an init script 21847 ipcrm -- remove IPC Resources 21848 ipcs -- provide information on ipc facilities 21849 killall -- kill processes by name 21850 lpr -- off line print 21851 ls -- list directory contents 21852 lsb_release -- print distribution specific 21853 information 21854 21855 m4 -- macro processor 21856 md5sum -- generate or check MD5 message digests 21857 mknod -- make special files 21858 mktemp -- make temporary file name (unique) 21859 more -- display files on a page-by-page basis 21860 mount -- mount a file system 21861 msgfmt -- create a message object from a message 21862 file 21863 21864 newgrp -- change group ID 21865 od -- dump files in octal and other formats 21866 passwd -- change user password 21867 patch -- apply a diff file to an original 21868 pidof -- find the process ID of a running program 21869 remove_initd -- clean up init script system 21870 modifications introduced by install_initd 21871 21872 renice -- alter priority of running processes 21873 sed -- stream editor 21874 sendmail -- an electronic mail transport agent 21875 sh -- shell, the standard command language 21876 interpreter 21877 21878 shutdown -- shut the system down 21879 su -- change user ID 21880 sync -- flush file system buffers 21881 tar -- file archiver 21882 umount -- unmount file systems 21883 useradd -- create a new user or update default new 21884 user information 21885 21886 userdel -- delete a user account and related files 21887 usermod -- modify a user account 21888 xargs -- build and execute command lines from 21889 standard input 21890 21891 zcat -- uncompress files to standard output 21892 __________________________________________________________ 21893 21894 Chapter 15. Commands and Utilities 21895 21896 15.1. Commands and Utilities 21897 21898 An LSB conforming implementation shall provide the commands and 21899 utilities as described in Table 15-1, with at least the 21900 behavior described as mandatory in the referenced underlying 21901 specification, with the following exceptions: 21902 21903 1. If any operand (except one which follows --) starts with a 21904 hyphen, the behavior is unspecified. 21905 21906 Rationale (Informative): Applications should place options 21907 before operands, or use --, as needed. This text is needed 21908 because, by default, GNU option parsing differs from POSIX, 21909 unless the environment variable POSIXLY_CORRECT is set. For 21910 example, ls . -a in GNU ls means to list the current 21911 directory, showing all files (that is, "." is an operand and 21912 -a is an option). In POSIX, "." and -a are both operands, 21913 and the command means to list the current directory, and 21914 also the file named -a. Suggesting that applications rely on 21915 the setting of the POSIXLY_CORRECT environment variable, or 21916 try to set it, seems worse than just asking the applications 21917 to invoke commands in ways which work with either the POSIX 21918 or GNU behaviors. 21919 21920 Table 15-1. Commands And Utilities 21921 [ [1] dmesg [2] id [1] mount [2] sort [1] 21922 ar [2] du [2] install [2] msgfmt [2] split [1] 21923 at [2] echo [2] install_initd [2] mv [1] strip [1] 21924 awk [2] ed [1] ipcrm [2] newgrp [2] stty [1] 21925 basename [1] egrep [2] ipcs [2] nice [1] su [2] 21926 batch [2] env [1] join [1] nl [1] sync [2] 21927 bc [2] expand [1] kill [1] nohup [1] tail [1] 21928 cat [1] expr [1] killall [2] od [2] tar [2] 21929 chfn [2] false [1] ln [1] passwd [2] tee [1] 21930 chgrp [1] fgrep [2] locale [1] paste [1] test [1] 21931 chmod [1] file [2] localedef [1] patch [2] time [1] 21932 chown [1] find [2] logger [1] pathchk [1] touch [1] 21933 chsh [2] fold [1] logname [1] pax [1] tr [1] 21934 cksum [1] fuser [2] lp [1] pidof [2] true [1] 21935 cmp [1] gencat [1] lpr [2] pr [1] tsort [1] 21936 col [2] getconf [1] ls [2] printf [1] tty [1] 21937 comm [1] gettext [2] lsb_release [2] ps [1] umount [2] 21938 cp [1] grep [2] m4 [2] pwd [1] uname [1] 21939 cpio [2] groupadd [2] mailx [1] remove_initd [2] unexpand [1] 21940 crontab [2] groupdel [2] make [1] renice [2] uniq [1] 21941 csplit [1] groupmod [2] man [1] rm [1] useradd [2] 21942 cut [2] groups [2] md5sum [2] rmdir [1] userdel [2] 21943 date [1] gunzip [2] mkdir [1] sed [2] usermod [2] 21944 dd [1] gzip [2] mkfifo [1] sendmail [2] wc [1] 21945 df [2] head [1] mknod [2] sh [2] xargs [2] 21946 diff [1] hostname [2] mktemp [2] shutdown [2] zcat [2] 21947 dirname [1] iconv [1] more [2] sleep [1] 21948 21949 Referenced Specification(s) 21950 21951 [1]. ISO POSIX (2003) 21952 21953 [2]. This Specification 21954 21955 An LSB conforming implementation shall provide the shell built 21956 in utilities as described in Table 15-2, with at least the 21957 behavior described as mandatory in the referenced underlying 21958 specification, with the following exceptions: 21959 21960 1. The built in commands and utilities shall be provided by 21961 the sh utility itself, and need not be implemented in a 21962 manner so that they can be accessed via the exec family of 21963 functions as defined in ISO POSIX (2003) and should not be 21964 invoked directly by those standard utilities that execute 21965 other utilities ( env, find, nice, nohup, time, xargs). 21966 21967 Rationale (Informative): Since the built in utilities must 21968 affect the environment of the calling process, they have no 21969 effect when executed as a file. 21970 21971 Table 15-2. Built In Utilities 21972 cd [1] getopts [1] read [1] umask [1] wait [1] 21973 21974 Referenced Specification(s) 21975 21976 [1]. ISO POSIX (2003) 21977 __________________________________________________________ 21978 21979 15.2. Command Behavior 21980 21981 Table of Contents 21982 ar -- create and maintain library archives (DEPRECATED) 21983 at -- examine or delete jobs for later execution 21984 awk -- pattern scanning and processing language 21985 batch -- schedule commands to be executed in a batch queue 21986 bc -- an arbitrary precision calculator language 21987 chfn -- change user name and information 21988 chsh -- change login shell 21989 col -- filter reverse line feeds from input 21990 cpio -- copy file archives in and out 21991 crontab -- maintain crontab files for individual users 21992 cut -- split a file into sections determined by context lines 21993 df -- report file system disk space usage 21994 dmesg -- print or control the system message buffer 21995 du -- estimate file space usage 21996 echo -- write arguments to standard output 21997 egrep -- search a file with an Extended Regular Expression 21998 pattern 21999 22000 fgrep -- search a file with a fixed pattern 22001 file -- determine file type 22002 find -- search for files in a directory hierarchy 22003 fuser -- identify processes using files or sockets 22004 gettext -- retrieve text string from message catalog 22005 grep -- print lines matching a pattern 22006 groupadd -- create a new group 22007 groupdel -- delete a group 22008 groupmod -- modify a group 22009 groups -- display a group 22010 gunzip -- uncompress files 22011 gzip -- compress or expand files 22012 hostname -- show or set the system's host name 22013 install -- copy files and set attributes 22014 install_initd -- activate an init script 22015 ipcrm -- remove IPC Resources 22016 ipcs -- provide information on ipc facilities 22017 killall -- kill processes by name 22018 lpr -- off line print 22019 ls -- list directory contents 22020 lsb_release -- print distribution specific information 22021 m4 -- macro processor 22022 md5sum -- generate or check MD5 message digests 22023 mknod -- make special files 22024 mktemp -- make temporary file name (unique) 22025 more -- display files on a page-by-page basis 22026 mount -- mount a file system 22027 msgfmt -- create a message object from a message file 22028 newgrp -- change group ID 22029 od -- dump files in octal and other formats 22030 passwd -- change user password 22031 patch -- apply a diff file to an original 22032 pidof -- find the process ID of a running program 22033 remove_initd -- clean up init script system modifications 22034 introduced by install_initd 22035 22036 renice -- alter priority of running processes 22037 sed -- stream editor 22038 sendmail -- an electronic mail transport agent 22039 sh -- shell, the standard command language interpreter 22040 shutdown -- shut the system down 22041 su -- change user ID 22042 sync -- flush file system buffers 22043 tar -- file archiver 22044 umount -- unmount file systems 22045 useradd -- create a new user or update default new user 22046 information 22047 22048 userdel -- delete a user account and related files 22049 usermod -- modify a user account 22050 xargs -- build and execute command lines from standard input 22051 zcat -- uncompress files to standard output 22052 22053 This section contains descriptions for commands and utilities 22054 whose specified behavior in the LSB contradicts or extends the 22055 standards referenced. It also contains commands and utilities 22056 only required by the LSB and not specified by other standards. 22057 22058 ar 22059 22060 Name 22061 22062 ar -- create and maintain library archives (DEPRECATED) 22063 22064 Description 22065 22066 ar is deprecated from the LSB and is expected to disappear from 22067 a future version of the LSB. 22068 22069 Rationale: The LSB generally does not include software 22070 development utilities nor does it specify .o and .a file 22071 formats. 22072 22073 ar is as specified in ISO POSIX (2003) but with differences as 22074 listed below. 22075 22076 Differences 22077 22078 -T, -C 22079 22080 need not be accepted. 22081 -l 22082 22083 has unspecified behavior. 22084 -q 22085 22086 has unspecified behavior; using -r is suggested. 22087 22088 at 22089 22090 Name 22091 22092 at -- examine or delete jobs for later execution 22093 22094 Description 22095 22096 at is as specified in ISO POSIX (2003) but with differences as 22097 listed below. 22098 22099 Differences 22100 22101 Options 22102 22103 -d 22104 22105 is functionally equivalent to the -r option specified in ISO 22106 POSIX (2003). 22107 -r 22108 22109 need not be supported, but the '-d' option is equivalent. 22110 -t time 22111 22112 need not be supported. 22113 22114 Optional Control Files 22115 22116 The implementation shall support the XSI optional behavior for 22117 access control; however the files at.allow and at.deny may 22118 reside in /etc rather than /usr/lib/cron. 22119 22120 awk 22121 22122 Name 22123 22124 awk -- pattern scanning and processing language 22125 22126 Description 22127 22128 awk is as specified in ISO POSIX (2003) but with differences as 22129 listed below. 22130 22131 Differences 22132 22133 Certain aspects of internationalized regular expressions are 22134 optional; see Regular Expressions. 22135 22136 batch 22137 22138 Name 22139 22140 batch -- schedule commands to be executed in a batch queue 22141 22142 Description 22143 22144 The specification for batch is as specified in ISO POSIX 22145 (2003), but with differences as listed below. 22146 22147 Optional Control Files 22148 22149 The implementation shall support the XSI optional behavior for 22150 access control; however the files at.allow and at.deny may 22151 reside in /etc rather than /usr/lib/cron. 22152 22153 bc 22154 22155 Name 22156 22157 bc -- an arbitrary precision calculator language 22158 22159 Description 22160 22161 bc is as specified in ISO POSIX (2003) but with extensions as 22162 listed below. 22163 22164 Extensions 22165 22166 The bc language may be extended in an implementation defined 22167 manner. If an implementation supports extensions, it shall also 22168 support the additional options: 22169 22170 -s|--standard 22171 22172 processes exactly the POSIX bc language. 22173 -w|--warn 22174 22175 gives warnings for extensions to POSIX bc. 22176 22177 chfn 22178 22179 Name 22180 22181 chfn -- change user name and information 22182 22183 Synopsis 22184 22185 chfn [-f full_name] [-h home_phone] [user] 22186 22187 Description 22188 22189 chfn shall update the user database. An unprivileged user may 22190 only change the fields for their own account, a user with 22191 appropriate privileges may change the fields for any account. 22192 22193 The fields full_name and home_phone may contain any character 22194 except: 22195 22196 any control character 22197 comma 22198 colon 22199 equal sign 22200 22201 If none of the options are selected, chfn operates in an 22202 interactive fashion. The prompts and expected input in 22203 interactive mode are unspecified and should not be relied upon. 22204 22205 As it is possible for the system to be configured to restrict 22206 which fields a non-privileged user is permitted to change, 22207 applications should be written to gracefully handle these 22208 situations. 22209 22210 Standard Options 22211 22212 -f full_name 22213 22214 sets the user's full name. 22215 -h home_phone 22216 22217 sets the user's home phone number. 22218 22219 Future Directions 22220 22221 The following two options are expected to be added in a future 22222 version of the LSB: 22223 22224 -o office 22225 22226 sets the user's office room number. 22227 -p office_phone 22228 22229 sets the user's office phone number. 22230 22231 Note that some implementations contain a "-o other" option 22232 which specifies an additional field called "other". 22233 Traditionally, this field is not subject to the constraints 22234 about legitimate characters in fields. Also, one traditionally 22235 shall have appropriate privileges to change the other field. At 22236 this point there is no consensus about whether it is desirable 22237 to specify the other field; applications may wish to avoid 22238 using it. 22239 22240 The "-w work_phone" field found in some implementations should 22241 be replaced by the "-p office_phone" field. The "-r 22242 room_number" field found in some implementations is the 22243 equivalent of the "-o office" option mentioned above; which one 22244 of these two options to specify will depend on implementation 22245 experience and the decision regarding the other field. 22246 22247 chsh 22248 22249 Name 22250 22251 chsh -- change login shell 22252 22253 Synopsis 22254 22255 chsh [-s login_shell] [user] 22256 22257 Description 22258 22259 chsh changes the user login shell. This determines the name of 22260 the user's initial login command. An unprivileged user may only 22261 change the login shell for their own account, a user with 22262 appropriate privilege may change the login shell for any 22263 account specified by user. 22264 22265 Unless the user has appropriate privilege, the initial login 22266 command name shall be one of those listed in /etc/shells. The 22267 login_shell shall be the absolute path (i.e. it must start with 22268 '/') to an executable file. Accounts which are restricted (in 22269 an implementation-defined manner) may not change their login 22270 shell. 22271 22272 If the -s option is not selected, chsh operates in an 22273 interactive mode. The prompts and expected input in this mode 22274 are unspecified. 22275 22276 Standard Options 22277 22278 -s login_shell 22279 22280 sets the login shell. 22281 22282 col 22283 22284 Name 22285 22286 col -- filter reverse line feeds from input 22287 22288 Description 22289 22290 col is as specified in SUSv2 but with differences as listed 22291 below. 22292 22293 Differences 22294 22295 The -p option has unspecified behavior. 22296 22297 Note: Although col is shown as legacy in SUSv2, it is not 22298 (yet) deprecated in the LSB. 22299 22300 cpio 22301 22302 Name 22303 22304 cpio -- copy file archives in and out 22305 22306 Description 22307 22308 cpio is as specified in SUSv2, but with differences as listed 22309 below. 22310 22311 Differences 22312 22313 Some elements of the Pattern Matching Notation are optional; 22314 see Pattern Matching Notation. 22315 22316 crontab 22317 22318 Name 22319 22320 crontab -- maintain crontab files for individual users 22321 22322 Synopsis 22323 22324 crontab [-u user] file 22325 crontab [-u user] {-l | -r | -e} 22326 22327 Description 22328 22329 crontab is as specified in ISO POSIX (2003), but with 22330 differences as listed below. 22331 22332 Optional Control Files 22333 22334 The implementation shall support the XSI optional behavior for 22335 access control; however the files cron.allow and cron.deny may 22336 reside in /etc rather than /usr/lib/cron. 22337 22338 cut 22339 22340 Name 22341 22342 cut -- split a file into sections determined by context lines 22343 22344 Description 22345 22346 cut is as specified in ISO POSIX (2003), but with differences 22347 as listed below. 22348 22349 Differences 22350 22351 -n 22352 22353 has unspecified behavior. 22354 22355 df 22356 22357 Name 22358 22359 df -- report file system disk space usage 22360 22361 Description 22362 22363 The df command shall behave as specified in ISO POSIX (2003), 22364 but with differences as listed below. 22365 22366 Differences 22367 22368 Options 22369 22370 If the -k option is not specified, disk space is shown in 22371 unspecified units. If the -P option is specified, the size of 22372 the unit shall be printed on the header line in the format 22373 "%4s-blocks". Applications should specify -k. 22374 22375 The XSI option -t has unspecified behavior. Applications should 22376 not specify -t. 22377 22378 Rationale: The most common implementation of df uses the -t 22379 option for a different purpose (restricting output to a 22380 particular file system type), and use of -t is therefore 22381 non-portable. 22382 22383 Operand May Identify Special File 22384 22385 If an argument is the absolute file name of a special file 22386 containing a mounted file system, df shall show the space 22387 available on that file system rather than on the file system 22388 containing the special file (which is typically the root file 22389 system). 22390 22391 Note: In ISO POSIX (2003) the XSI optional behavior permits 22392 an operand to name a special file, but appears to require 22393 the operation be performed on the file system containing the 22394 special file. A defect report has been submitted for this 22395 case. 22396 22397 dmesg 22398 22399 Name 22400 22401 dmesg -- print or control the system message buffer 22402 22403 Synopsis 22404 22405 dmesg [-c | -n level | -s bufsize] 22406 22407 Description 22408 22409 dmesg examines or controls the system message buffer. Only a 22410 user with appropriate privileges may modify the system message 22411 buffer parameters or contents. 22412 22413 Standard Options 22414 22415 -c 22416 22417 If the user has appropriate privilege, clears the system 22418 message buffer contents after printing. 22419 -n level 22420 22421 If the user has appropriate privilege, sets the level at which 22422 logging of messages is done to the console. 22423 -s bufsize 22424 22425 uses a buffer of bufsize to query the system message buffer. 22426 This is 16392 by default. 22427 22428 du 22429 22430 Name 22431 22432 du -- estimate file space usage 22433 22434 Description 22435 22436 du is as specified in ISO POSIX (2003), but with differences as 22437 listed below. 22438 22439 Differences 22440 22441 If the -k option is not specified, disk space is shown in 22442 unspecified units. Applications should specify -k. 22443 22444 echo 22445 22446 Name 22447 22448 echo -- write arguments to standard output 22449 22450 Synopsis 22451 22452 echo [string...] 22453 22454 Description 22455 22456 The echo command is as specified in ISO POSIX (2003), but with 22457 the following differences. 22458 22459 Implementations may support implementation-defined options to 22460 echo. The behavior of echo if any arguments contain backslashes 22461 is also implementation defined. 22462 22463 Application Usage 22464 22465 Conforming applications should not run echo with a first 22466 argument starting with a hyphen, or with any arguments 22467 containing backslashes; they should use printf in those cases. 22468 22469 Note: The behavior specified here is similar to that 22470 specified by ISO POSIX (2003) without the XSI option. 22471 However, the LSB strongly recommends conforming applications 22472 not use any options (even if the implementation provides 22473 them) while ISO POSIX (2003) specifies behavior if the first 22474 operand is the string -n. 22475 22476 egrep 22477 22478 Name 22479 22480 egrep -- search a file with an Extended Regular Expression 22481 pattern 22482 22483 Description 22484 22485 egrep is equivalent to grep -E. For further details, see the 22486 specification for grep. 22487 22488 fgrep 22489 22490 Name 22491 22492 fgrep -- search a file with a fixed pattern 22493 22494 Description 22495 22496 fgrep is equivalent to grep -F. For further details, see the 22497 specification for grep. 22498 22499 file 22500 22501 Name 22502 22503 file -- determine file type 22504 22505 Description 22506 22507 file is as specified in ISO POSIX (2003), but with differences 22508 as listed below. 22509 22510 Differences 22511 22512 The -M, -h, -d, and -i options need not be supported. 22513 22514 find 22515 22516 Name 22517 22518 find -- search for files in a directory hierarchy 22519 22520 Description 22521 22522 find shall behave as specified in ISO POSIX (2003), except as 22523 described below. 22524 22525 Differences 22526 22527 Pattern Matching 22528 22529 Some elements of the Pattern Matching Notation are optional; 22530 see Pattern Matching Notation. 22531 22532 Option and Operand Handling 22533 22534 Options and operands to find shall behave as described in ISO 22535 POSIX (2003), except as follows: 22536 22537 -H 22538 22539 need not be supported 22540 -L 22541 22542 need not be supported 22543 -exec ... + 22544 22545 argument aggregation need not be supported 22546 22547 Rationale: The -H and -L options are not yet widely 22548 available in implementations of the find command, nor is 22549 argument aggregation. A future version of this specification 22550 will require these features be supported. 22551 22552 fuser 22553 22554 Name 22555 22556 fuser -- identify processes using files or sockets 22557 22558 Description 22559 22560 fuser is as specified in ISO POSIX (2003), but with differences 22561 as listed below. 22562 22563 Differences 22564 22565 The fuser command is a system administration utility, see Path 22566 For System Administration Utilities. 22567 22568 Option Differences 22569 22570 -c 22571 22572 has unspecified behavior. 22573 -f 22574 22575 has unspecified behavior. 22576 22577 gettext 22578 22579 Name 22580 22581 gettext -- retrieve text string from message catalog 22582 22583 Synopsis 22584 22585 gettext [options] [textdomain] msgid 22586 gettext -s [options] msgid... 22587 22588 Description 22589 22590 The gettext utility retrieves a translated text string 22591 corresponding to string msgid from a message object generated 22592 with msgfmt utility. 22593 22594 The message object name is derived from the optional argument 22595 textdomain if present, otherwise from the TEXTDOMAIN 22596 environment variable. If no domain is specified, or if a 22597 corresponding string cannot be found, gettext prints msgid. 22598 22599 Ordinarily gettext looks for its message object in 22600 dirname/lang/LC_MESSAGES where dirname is the 22601 implementation-defined default directory and lang is the locale 22602 name. If present, the TEXTDOMAINDIR environment variable 22603 replaces the dirname. 22604 22605 This utility interprets C escape sequences such as \t for tab. 22606 Use \\ to print a backslash. To produce a message on a line of 22607 its own, either put a \n at the end of msgid, or use this 22608 command in conjunction with the printf utility. 22609 22610 When used with the -s option the gettext utility behaves like 22611 the echo utility, except that the message corresponding to 22612 msgid in the selected catalog provides the arguments. 22613 22614 Options 22615 22616 -d domainname, --domain=domainname 22617 22618 PARAMETER translated messages from domainname. 22619 -e 22620 22621 Enable expansion of some escape sequences. 22622 -n 22623 22624 Suppress trailing newline. 22625 22626 Operands 22627 22628 The following operands are supported: 22629 22630 textdomain 22631 22632 A domain name used to retrieve the messages. 22633 msgid 22634 22635 A key to retrieve the localized message. 22636 22637 Environment Variables 22638 22639 LANGUAGE 22640 22641 Specifies one or more locale names. 22642 LANG 22643 22644 Specifies locale name. 22645 LC_MESSAGES 22646 22647 Specifies messaging locale, and if present overrides LANG for 22648 messages. 22649 TEXTDOMAIN 22650 22651 Specifies the text domain name, which is identical to the 22652 message object filename without .mo suffix. 22653 TEXTDOMAINDIR 22654 22655 Specifies the pathname to the message catalog, and if present 22656 replaces the implementation-defined default directory. 22657 22658 Exit Status 22659 22660 The following exit values are returned: 22661 22662 0 22663 22664 Successful completion. 22665 >0 22666 22667 An error occurred. 22668 22669 grep 22670 22671 Name 22672 22673 grep -- print lines matching a pattern 22674 22675 Description 22676 22677 grep is as specified in ISO POSIX (2003), but with differences 22678 as listed below. 22679 22680 LSB Differences 22681 22682 Certain aspects of regular expression matching are optional; 22683 see Regular Expressions. 22684 22685 groupadd 22686 22687 Name 22688 22689 groupadd -- create a new group 22690 22691 Synopsis 22692 22693 groupadd [-g gid [-o]] group 22694 22695 Description 22696 22697 If the caller has appropriate privilege, the groupadd command 22698 shall create a new group named group. The group name shall be 22699 unique in the group database. If no gid is specified, groupadd 22700 shall create the new group with a unique group ID. 22701 22702 The groupadd command is a system administration utility, see 22703 Path For System Administration Utilities. 22704 22705 Options 22706 22707 -g gid [-o] 22708 22709 The new group shall have group ID gid. If the -o option is not 22710 used, no other group shall have this group ID. The value of gid 22711 shall be non-negative. 22712 22713 groupdel 22714 22715 Name 22716 22717 groupdel -- delete a group 22718 22719 Synopsis 22720 22721 groupdel group 22722 22723 Description 22724 22725 If the caller has sufficient privilege, the groupdel command 22726 shall modify the system group database, deleting the group 22727 named group. If the group named group does not exist, groupdel 22728 shall issue a diagnostic message and exit with a non-zero exit 22729 status. 22730 22731 The groupdel command is a system administration utility, see 22732 Path For System Administration Utilities. 22733 22734 groupmod 22735 22736 Name 22737 22738 groupmod -- modify a group 22739 22740 Synopsis 22741 22742 groupmod [-g gid [-o]] [-n group_name] group 22743 22744 Description 22745 22746 If the caller has appropriate privilege, the groupmod command 22747 shall modify the entry in the system group database 22748 corresponding to a group named group. 22749 22750 The groupmod command is a system administration utility, see 22751 Path For System Administration Utilities. 22752 22753 Options 22754 22755 -g gid [-o] 22756 22757 Modify the group's group ID, setting it to gid. If the -o 22758 option is not used, no other group shall have this group ID. 22759 The value of gidshall be non-negative. 22760 22761 Note: Only the group ID in the database is altered; any 22762 files with group ownership set to the original group ID are 22763 unchanged by this modification. 22764 22765 -n group_name 22766 22767 changes the name of the group from group to group_name. 22768 22769 groups 22770 22771 Name 22772 22773 groups -- display a group 22774 22775 Synopsis 22776 22777 groups [user] 22778 22779 Description 22780 22781 The groups command shall behave as id -Gn [user], as specified 22782 in ISO POSIX (2003). The optional user parameter will display 22783 the groups for the named user. 22784 22785 gunzip 22786 22787 Name 22788 22789 gunzip -- uncompress files 22790 22791 Description 22792 22793 gunzip is equivalent to gzip -d. See the specification for gzip 22794 for further details. 22795 22796 Filesystem Hierarchy Standard requires that if gunzip exists, 22797 it must be a symbolic or hard link to /bin/gzip. This 22798 specification additionally allows gunzip to be a wrapper script 22799 which calls gzip -d. 22800 22801 gzip 22802 22803 Name 22804 22805 gzip -- compress or expand files 22806 22807 Synopsis 22808 22809 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 22810 22811 Description 22812 22813 The gzip command shall attempt to reduce the size of the named 22814 files. Whenever possible, each file is replaced by one with the 22815 extension .gz, while keeping the same ownership, modes, access 22816 and modification times. If no files are specified, or if a file 22817 name is -, the standard input is compressed to the standard 22818 output. gzip shall only attempt to compress regular files. In 22819 particular, it will ignore symbolic links. 22820 22821 When compressing, gzip uses the deflate algorithm specified in 22822 RFC 1951: DEFLATE Compressed Data Format Specification and 22823 stores the result in a file using the gzip file format 22824 specified in RFC 1952: GZIP File Format Specification. 22825 22826 Options 22827 22828 -c, --stdout, --to-stdout 22829 writes output on standard output, leaving the original 22830 files unchanged. If there are several input files, the 22831 output consists of a sequence of independently 22832 compressed members. To obtain better compression, 22833 concatenate all input files before compressing them. 22834 22835 -d, --decompress, --uncompress 22836 the name operands are compressed files, and gzip shall 22837 decompress them. 22838 22839 -f, --force 22840 forces compression or decompression even if the file has 22841 multiple links or the corresponding file already exists, 22842 or if the compressed data is read from or written to a 22843 terminal. If the input data is not in a format 22844 recognized by gzip, and if the option --stdout is also 22845 given, copy the input data without change to the 22846 standard ouput: let gzip behave as cat. If -f is not 22847 given, and when not running in the background, gzip 22848 prompts to verify whether an existing file should be 22849 overwritten. 22850 22851 -l, --list 22852 lists the compressed size, uncompressed size, ratio and 22853 uncompressed name for each compressed file. For files 22854 that are not in gzip format, the uncompressed size shall 22855 be given as -1. If the --verbose or -v option is also 22856 specified, the crc and timestamp for the uncompressed 22857 file shall also be displayed. 22858 22859 For decompression, gzip shall support at least the 22860 following compression methods: 22861 22862 + deflate (RFC 1951: DEFLATE Compressed Data Format 22863 Specification) 22864 + compress (ISO POSIX (2003)) 22865 22866 The crc shall be given as ffffffff for a file not in 22867 gzip format. 22868 22869 If the --name or -N option is also specified, the 22870 uncompressed name, date and time are those stored within 22871 the compressed file, if present. 22872 22873 If the --quiet or -q option is also specified, the title 22874 and totals lines are not displayed. 22875 22876 -L, --license 22877 displays the gzip license and quit. 22878 22879 -n, --no-name 22880 does not save the original file name and time stamp by 22881 default when compressing. (The original name is always 22882 saved if the name had to be truncated.) When 22883 decompressing, do not restore the original file name if 22884 present (remove only the gzip suffix from the compressed 22885 file name) and do not restore the original time stamp if 22886 present (copy it from the compressed file). This option 22887 is the default when decompressing. 22888 22889 -N, --name 22890 always saves the original file name and time stamp when 22891 compressing; this is the default. When decompressing, 22892 restore the original file name and time stamp if 22893 present. This option is useful on systems which have a 22894 limit on file name length or when the time stamp has 22895 been lost after a file transfer. 22896 22897 -q, --quiet 22898 suppresses all warnings. 22899 22900 -r, --recursive 22901 travels the directory structure recursively. If any of 22902 the file names specified on the command line are 22903 directories, gzip will descend into the directory and 22904 compress all the files it finds there (or decompress 22905 them in the case of gunzip). 22906 22907 -S .suf, --sufix .suf 22908 uses suffix .suf instead of .gz. 22909 22910 -t, --test 22911 checks the compressed file integrity. 22912 22913 -v, --verbose 22914 displays the name and percentage reduction for each file 22915 compressed or decompressed. 22916 22917 -#, --fast, --best 22918 regulates the speed of compression using the specified 22919 digit #, where -1 or --fast indicates the fastest 22920 compression method (less compression) and -9 or --best 22921 indicates the slowest compression method (best 22922 compression). The default compression level is -6 (that 22923 is, biased towards high compression at expense of 22924 speed). 22925 22926 LSB Deprecated Options 22927 22928 The behaviors specified in this section are expected to 22929 disappear from a future version of the LSB; applications should 22930 only use the non-LSB-deprecated behaviors. 22931 22932 -V, --version 22933 22934 displays the version number and compilation options, then 22935 quits. 22936 22937 hostname 22938 22939 Name 22940 22941 hostname -- show or set the system's host name 22942 22943 Synopsis 22944 22945 hostname [name] 22946 22947 Description 22948 22949 hostname is used to either display or, with appropriate 22950 privileges, set the current host name of the system. The host 22951 name is used by many applications to identify the machine. 22952 22953 When called without any arguments, the program displays the 22954 name of the system as returned by the gethostname() function. 22955 22956 When called with a name argument, and the user has appropriate 22957 privilege, the command sets the host name. 22958 22959 Note: It is not specified if the hostname displayed will be 22960 a fully qualified domain name. Applications requiring a 22961 particular format of hostname should check the output and 22962 take appropriate action. 22963 22964 install 22965 22966 Name 22967 22968 install -- copy files and set attributes 22969 22970 Synopsis 22971 22972 install [option...] SOURCE DEST 22973 install [option...] SOURCE... DEST 22974 install [-d | --directory] [option...] DIRECTORY... 22975 22976 Description 22977 22978 In the first two formats, copy SOURCE to DEST or multiple 22979 SOURCE(s) to the existing DEST directory, optionally setting 22980 permission modes and file ownership. In the third format, each 22981 DIRECTORY and any missing parent directories shall be created. 22982 22983 Standard Options 22984 22985 --backup[=METHOD] 22986 makes a backup of each existing destination file. METHOD 22987 may be one of the following: 22988 22989 none or off 22990 22991 never make backups. 22992 numbered or t 22993 22994 make numbered backups. A numbered backup has the form 22995 "%s.~%d~", target_name, version_number. Each backup shall 22996 increment the version number by 1. 22997 existing or nil 22998 22999 behave as numbered if numbered backups exist, or simple 23000 otherwise. 23001 simple or never 23002 23003 append a suffix to the name. The default suffix is '~', but can 23004 be overriden by setting SIMPLE_BACKUP_SUFFIX in the 23005 environment, or via the -S or --suffix option. 23006 23007 If no METHOD is specified, the environment variable 23008 VERSION_CONTROL shall be examined for one of the above. 23009 Unambiguous abbreviations of METHOD shall be accepted. 23010 If no METHOD is specified, or if METHOD is empty, the 23011 backup method shall default to existing. 23012 23013 If METHOD is invalid or ambiguous, install shall fail 23014 and issue a diagnostic message. 23015 23016 -b 23017 is equivalent to --backup=existing. 23018 23019 -d, --directory 23020 treats all arguments as directory names; creates all 23021 components of the specified directories. 23022 23023 -D 23024 creates all leading components of DEST except the last, 23025 then copies SOURCE to DEST; useful in the 1st format. 23026 23027 -g GROUP, --group=GROUP 23028 if the user has appropriate privilege, sets group 23029 ownership, instead of process' current group. GROUP is 23030 either a name in the user group database, or a positive 23031 integer, which shall be used as a group-id. 23032 23033 -m MODE, --mode=MODE 23034 sets permission mode (specified as in chmod), instead of 23035 the default rwxr-xr-x. 23036 23037 -o OWNER, --owner=OWNER 23038 if the user has appropriate privilege, sets ownership. 23039 OWNER is either a name in the user login database, or a 23040 positive integer, which shall be used as a user-id. 23041 23042 -p, --preserve-timestamps 23043 copies the access and modification times of SOURCE files 23044 to corresponding destination files. 23045 23046 -s, --strip 23047 strips symbol tables, only for 1st and 2nd formats. 23048 23049 -S SUFFIX, --suffix=SUFFIX 23050 equivalent to --backup=existing, except if a simple 23051 suffix is required, use SUFFIX. 23052 23053 --verbose 23054 prints the name of each directory as it is created. 23055 23056 -v, --verbose 23057 print the name of each file before copying it to stdout. 23058 23059 install_initd 23060 23061 Name 23062 23063 install_initd -- activate an init script 23064 23065 Synopsis 23066 23067 /usr/lib/lsb/install_initd initd_file 23068 23069 Description 23070 23071 install_initd shall activate a system initialization file that 23072 has been copied to an implementation defined location such that 23073 this file shall be run at the appropriate point during system 23074 initialization. The install_initd command is typically called 23075 in the postinstall script of a package, after the script has 23076 been copied to /etc/init.d. See also Installation and Removal 23077 of Init Scripts. 23078 23079 ipcrm 23080 23081 Name 23082 23083 ipcrm -- remove IPC Resources 23084 23085 Synopsis 23086 23087 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | 23088 -M shmkey]... 23089 ipcrm [shm | msg | msg] id... 23090 23091 Description 23092 23093 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 23094 the ipcrm shall behave as described in ISO POSIX (2003). 23095 23096 Otherwise, ipcrm shall remove the resource of the specified 23097 type identified by id. 23098 23099 Future Directions 23100 23101 A future revision of this specification may deprecate the 23102 second synopsis form. 23103 23104 Rationale: In its first Linux implementation, ipcrm used the 23105 second syntax shown in the SYNOPSIS. Functionality present 23106 in other implementations of ipcrm has since been added, 23107 namely the ability to delete resources by key (not just 23108 identifier), and to respect the same command line syntax. 23109 The previous syntax is still supported for backwards 23110 compatibility only. 23111 23112 ipcs 23113 23114 Name 23115 23116 ipcs -- provide information on ipc facilities 23117 23118 Synopsis 23119 23120 ipcs [-smq] [-tcp] 23121 23122 Description 23123 23124 ipcs provides information on the ipc facilities for which the 23125 calling process has read access. 23126 23127 Note: Although this command has many similarities with the 23128 optional ipcs utility described in ISO POSIX (2003), it has 23129 substantial differences and is therefore described 23130 separately. The options specified here have similar meaning 23131 to those in ISO POSIX (2003); other options specified there 23132 have unspecified behavior on an LSB conforming 23133 implementation. See Application Usage below. The output 23134 format is not specified. 23135 23136 Resource display options 23137 23138 -m 23139 23140 shared memory segments. 23141 -q 23142 23143 message queues. 23144 -s 23145 23146 semaphore arrays. 23147 23148 Output format options 23149 23150 -t 23151 23152 time. 23153 -p 23154 23155 pid. 23156 -c 23157 23158 creator. 23159 23160 Application Usage 23161 23162 In some implementations of ipcs the -a option will print all 23163 information available. In other implementations the -a option 23164 will print all resource types. Therefore, applications shall 23165 not use the -a option. 23166 23167 Some implementations of ipcs provide more output formats than 23168 are specified here. These options are not consistent between 23169 differing implementations of ipcs. Therefore, only the -t, -c 23170 and -p option formatting flags may be used. At least one of the 23171 -t, -c and -p options and at least one of -m, -q and -s options 23172 shall be specified. If no options are specified, the output is 23173 unspecified. 23174 23175 killall 23176 23177 Name 23178 23179 killall -- kill processes by name 23180 23181 Synopsis 23182 23183 killall [-egiqvw] [-signal] name... 23184 killall -l 23185 killall -V 23186 23187 Description 23188 23189 killall sends a signal to all processes running any of the 23190 specified commands. If no signal name is specified, SIGTERM is 23191 sent. 23192 23193 Signals can be specified either by name (e.g. -HUP) or by 23194 number (e.g. -1). Signal 0 (check if a process exists) can only 23195 be specified by number. 23196 23197 If the command name contains a slash (/), processes executing 23198 that particular file will be selected for killing, independent 23199 of their name. 23200 23201 killall returns a non-zero return code if no process has been 23202 killed for any of the listed commands. If at least one process 23203 has been killed for each command, killall returns zero. 23204 23205 A killall process never kills itself (but may kill other 23206 killall processes). 23207 23208 Standard Options 23209 23210 -e 23211 23212 requires an exact match for very long names. If a command name 23213 is longer than 15 characters, the full name may be unavailable 23214 (i.e. it is swapped out). In this case, killall will kill 23215 everything that matches within the first 15 characters. With 23216 -e, such entries are skipped. killall prints a message for each 23217 skipped entry if -v is specified in addition to -e. 23218 -g 23219 23220 kills the process group to which the process belongs. The kill 23221 signal is only sent once per group, even if multiple processes 23222 belonging to the same process group were found. 23223 -i 23224 23225 asks interactively for confirmation before killing. 23226 -l 23227 23228 lists all known signal names. 23229 -q 23230 23231 does not complain if no processes were killed. 23232 -v 23233 23234 reports if the signal was successfully sent. 23235 23236 LSB Deprecated Options 23237 23238 The behaviors specified in this section are expected to 23239 disappear from a future version of the LSB; applications should 23240 only use the non-LSB-deprecated behaviors. 23241 23242 -V 23243 23244 displays version information. 23245 23246 lpr 23247 23248 Name 23249 23250 lpr -- off line print 23251 23252 Synopsis 23253 23254 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 23255 title] [name ......] 23256 23257 Description 23258 23259 lpr uses a spooling daemon to print the named files when 23260 facilities become available. If no names appear, the standard 23261 input is assumed. 23262 23263 Standard Options 23264 23265 -l 23266 23267 identifies binary data that is not to be filtered but sent as 23268 raw input to printer. 23269 -p 23270 23271 formats with "pr" before sending to printer. 23272 -Pprinter 23273 23274 sends output to the printer named printer instead of the 23275 default printer. 23276 -h 23277 23278 suppresses header page. 23279 -s 23280 23281 uses symbolic links. 23282 -#copies 23283 23284 specifies copies as the number of copies to print. 23285 -J name 23286 23287 specifies name as the job name for the header page. 23288 -T title 23289 23290 specifies title as the title used for "pr". 23291 23292 ls 23293 23294 Name 23295 23296 ls -- list directory contents 23297 23298 Description 23299 23300 ls shall behave as specified in ISO POSIX (2003), but with 23301 extensions listed below. 23302 23303 Extensions 23304 23305 -l 23306 23307 If the file is a character special or block special file, the 23308 size of the file shall be replaced with two unsigned numbers in 23309 the format "%u, %u", representing the major and minor device 23310 numbers associated with the special file. 23311 23312 Note: The LSB does not specify the meaning of the major and 23313 minor devices numbers. 23314 23315 -p 23316 23317 in addition to ISO POSIX (2003) XSI optional behavior of 23318 printing a slash for a directory, ls -p may display other 23319 characters for other file types. 23320 23321 lsb_release 23322 23323 Name 23324 23325 lsb_release -- print distribution specific information 23326 23327 Synopsis 23328 23329 lsb_release [OPTION...] 23330 23331 Description 23332 23333 The lsb_release command prints certain LSB (Linux Standard 23334 Base) and Distribution information. 23335 23336 If no options are given, the -v option is assumed. 23337 23338 Options 23339 23340 -v, --version 23341 23342 displays version of LSB against which distribution is 23343 compliant. The version is expressed as a colon separated list 23344 of LSB module descriptions. LSB module descriptions are dash 23345 separated tuples containing the module name, version, and 23346 architecture name. The output is a single line of text of the 23347 following format: 23348 23349 LSB Version:\tListAsDescribedAbove 23350 23351 Note: An implementation may support multiple releases of the 23352 same module. Version specific library interfaces, if any, 23353 will be selected by the program interpreter, which changes 23354 from release to release. Version specific commands and 23355 utilities, if any, will be described in the relevant 23356 specification. 23357 23358 -i, --id 23359 23360 displays string id of distributor. The output is a single line 23361 of text of the following format: 23362 23363 Distributor ID:\tDistributorID 23364 -d, --description 23365 23366 displays single line text description of distribution. The 23367 output is of the following format: 23368 23369 Description:\tDescription 23370 -r, --release 23371 23372 displays release number of distribution. The output is a single 23373 line of text of the following format: 23374 23375 Release:\tRelease 23376 -c, --codename 23377 23378 displays codename according to distribution release. The output 23379 is a single line of text of the following format. 23380 23381 Codename:\tCodename 23382 -a, --all 23383 23384 displays all of the above information. 23385 -s, --short 23386 23387 displays all of the above information in short output format. 23388 -h, --help 23389 23390 displays a human-readable help message. 23391 23392 Example 23393 23394 The following command will list the LSB Profiles which are 23395 currently supported on this platform. 23396 example% lsb_release -v 23397 LSB Version: core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch 23398 23399 m4 23400 23401 Name 23402 23403 m4 -- macro processor 23404 23405 Description 23406 23407 m4 is as specified in ISO POSIX (2003), but with extensions as 23408 listed below. 23409 23410 Extensions 23411 23412 -P 23413 23414 forces all builtins to be prefixed with m4_. For example, 23415 define becomes m4_define. 23416 -I directory 23417 23418 Add directory to the end of the search path for includes. 23419 23420 md5sum 23421 23422 Name 23423 23424 md5sum -- generate or check MD5 message digests 23425 23426 Synopsis 23427 23428 md5sum [-c [file] | file...] 23429 23430 Description 23431 23432 For each file, write to standard output a line containing the 23433 MD5 message digest of that file, followed by one or more blank 23434 characters, followed by the name of the file. The MD5 message 23435 digest shall be calculated according to RFC 1321: The MD5 23436 Message-Digest Algorithm and output as 32 hexadecimal digits. 23437 23438 If no file names are specified as operands, read from standard 23439 input and use "-" as the file name in the output. 23440 23441 Options 23442 23443 -c [file] 23444 23445 checks the MD5 message digest of all files named in file 23446 against the message digest listed in the same file. The actual 23447 format of file is the same as the output of md5sum. That is, 23448 each line in the file describes a file. If file is not 23449 specified, read message digests from stdin. 23450 23451 Exit Status 23452 23453 md5sum shall exit with status 0 if the sum was generated 23454 successfully, or, in check mode, if the check matched. 23455 Otherwise, md5sum shall exit with a non-zero status. 23456 23457 mknod 23458 23459 Name 23460 23461 mknod -- make special files 23462 23463 Synopsis 23464 23465 mknod [-m mode | --mode=mode] name type [major minor] 23466 mknod [--version] 23467 23468 Description 23469 23470 The mknod command shall create a special file named name of the 23471 given type. 23472 23473 The type shall be one of the following: 23474 23475 b 23476 23477 creates a block (buffered) special file with the specified 23478 major and minor device numbers. 23479 c, u 23480 23481 creates a character (unbuffered) special file with the 23482 specified major and minor device numbers. 23483 p 23484 23485 creates a FIFO. 23486 23487 Options 23488 23489 -m mode, --mode=mode 23490 23491 create the special file with file access permissions set as 23492 described in mode. The permissions may be any absolute value 23493 (i.e. one not containing '+' or '-') acceptable to the chmod 23494 command. 23495 --version 23496 23497 output version information and exit. 23498 23499 Note: This option may be deprecated in a future release of 23500 this specification. 23501 23502 If type is p, major and minor shall not be specified. 23503 Otherwise, these parameters are mandatory. 23504 23505 Future Directions 23506 23507 This command may be deprecated in a future version of this 23508 specification. The major and minor operands are insufficently 23509 portable to be specified usefully here. Only a FIFO can be 23510 portably created by this command, and the mkfifo command is a 23511 simpler interface for that purpose. 23512 23513 mktemp 23514 23515 Name 23516 23517 mktemp -- make temporary file name (unique) 23518 23519 Synopsis 23520 23521 mktemp [-q] [-u] template 23522 23523 Description 23524 23525 The mktemp command takes the given file name template and 23526 overwrites a portion of it to create a file name. This file 23527 name shall be unique and suitable for use by the application. 23528 23529 The template should have at least six trailing 'X' characters. 23530 These characters are replaced with characters from the portable 23531 filename character set in order to generate a unique name. 23532 23533 If mktemp can successfully generate a unique file name, and the 23534 -u option is not present, the file shall be created with read 23535 and write permission only for the current user. The mktemp 23536 command shall write the filename generated to the standard 23537 output. 23538 23539 Options 23540 23541 -q 23542 23543 fail silently if an error occurs. Diagnostic messages to stderr 23544 are suppressed, but the command shall still exit with a 23545 non-zero exit status if an error occurs. 23546 -u 23547 23548 operates in `unsafe' mode. A unique name is generated, but the 23549 temporary file shall be unlinked before mktemp exits. Use of 23550 this option is not encouraged. 23551 23552 more 23553 23554 Name 23555 23556 more -- display files on a page-by-page basis 23557 23558 Description 23559 23560 more is as specified in ISO POSIX (2003), but with differences 23561 as listed below. 23562 23563 Differences 23564 23565 The more command need not respect the LINES and COLUMNS 23566 environment variables. 23567 23568 The following additional options may be supported: 23569 23570 -num 23571 23572 specifies an integer which is the screen size (in lines). 23573 +num 23574 23575 starts at line number num. 23576 +/pattern 23577 23578 Start at the first line matching the pattern, equivalent to 23579 executing the search forward (/) command with the given pattern 23580 immediately after opening each file. 23581 23582 The following options from ISO POSIX (2003) may behave 23583 differently: 23584 23585 -e 23586 23587 has unspecified behavior. 23588 -i 23589 23590 has unspecified behavior. 23591 -n 23592 23593 has unspecified behavior. 23594 -p 23595 23596 Either clear the whole screen before displaying any text 23597 (instead of the usual scrolling behavior), or provide the 23598 behavior specified by ISO POSIX (2003). In the latter case, the 23599 syntax is "-p command". 23600 -t 23601 23602 has unspecified behavior. 23603 23604 The more command need not support the following interactive 23605 commands: 23606 23607 g 23608 G 23609 u 23610 control u 23611 control f 23612 newline 23613 j 23614 k 23615 r 23616 R 23617 m 23618 ' (return to mark) 23619 /! 23620 ? 23621 N 23622 :e 23623 :t 23624 control g 23625 ZZ 23626 23627 Rationale 23628 23629 The +num and +/string options are deprecated in SUSv2, and have 23630 been removed in ISO POSIX (2003); however this specification 23631 continues to specify them because the publicly available 23632 util-linux package does not support the replacement (-p 23633 command). The +command option as found in SUSv2 is more general 23634 than is specified here, but the util-linux package appears to 23635 only support the more specific +num and +/string forms. 23636 23637 mount 23638 23639 Name 23640 23641 mount -- mount a file system 23642 23643 Synopsis 23644 23645 mount [-hV] 23646 mount [-a] [-fFnrsvw] [-t vfstype] 23647 mount [-fnrsvw] [-o options [,...]] [device | dir] 23648 mount [-fnrsvw] [-t vfstype] [-o options] device dir 23649 23650 Description 23651 23652 As described in ISO POSIX (2003), all files in the system are 23653 organized in a directed graph, known as the file hierarchy, 23654 rooted at /. These files can be spread out over several 23655 underlying devices. The mount command shall attach the file 23656 system found on some underlying device to the file hierarchy. 23657 23658 Options 23659 23660 -v 23661 23662 invoke verbose mode. The mount command shall provide diagnostic 23663 messages on stdout. 23664 -a 23665 23666 mount all file systems (of the given types) mentioned in 23667 /etc/fstab. 23668 -F 23669 23670 If the -a option is also present, fork a new incarnation of 23671 mount for each device to be mounted. This will do the mounts on 23672 different devices or different NFS servers in parallel. 23673 -f 23674 23675 cause everything to be done except for the actual system call; 23676 if it's not obvious, this `fakes' mounting the file system. 23677 -n 23678 23679 mount without writing in /etc/mtab. This is necessary for 23680 example when /etc is on a read-only file system. 23681 -s 23682 23683 ignore mount options not supported by a file system type. Not 23684 all file systems support this option. 23685 -r 23686 23687 mount the file system read-only. A synonym is -o ro. 23688 -w 23689 23690 mount the file system read/write. (default) A synonym is -o rw. 23691 -L label 23692 23693 If the file /proc/partitions is supported, mount the partition 23694 that has the specified label. 23695 -U uuid 23696 23697 If the file /proc/partitions is supported, mount the partition 23698 that has the specified uuid. 23699 -t vfstype 23700 23701 indicate a file system type of vfstype. 23702 23703 More than one type may be specified in a comma separated list. 23704 The list of file system types can be prefixed with no to 23705 specify the file system types on which no action should be 23706 taken. 23707 -o 23708 23709 options are specified with a -o flag followed by a 23710 comma-separated string of options. Some of these options are 23711 only useful when they appear in the /etc/fstab file. The 23712 following options apply to any file system that is being 23713 mounted: 23714 23715 async 23716 23717 perform all I/O to the file system asynchronously. 23718 atime 23719 23720 update inode access time for each access. (default) 23721 auto 23722 23723 in /etc/fstab, indicate the device is mountable with -a. 23724 defaults 23725 23726 use default options: rw, suid, dev, exec, auto, nouser, async. 23727 dev 23728 23729 interpret character or block special devices on the file 23730 system. 23731 exec 23732 23733 permit execution of binaries. 23734 noatime 23735 23736 do not update file access times on this file system. 23737 noauto 23738 23739 in /etc/fstab, indicates the device is only explicitly 23740 mountable. 23741 nodev 23742 23743 do not interpret character or block special devices on the file 23744 system. 23745 noexec 23746 23747 do not allow execution of any binaries on the mounted file 23748 system. 23749 nosuid 23750 23751 do not allow set-user-identifier or set-group-identifier bits 23752 to take effect. 23753 nouser 23754 23755 forbid an unprivileged user to mount the file system. (default) 23756 remount 23757 23758 remount an already-mounted file system. This is commonly used 23759 to change the mount options for a file system, especially to 23760 make a read-only file system writable. 23761 ro 23762 23763 mount the file system read-only. 23764 rw 23765 23766 mount the file system read-write. 23767 suid 23768 23769 allow set-user-identifier or set-group-identifier bits to take 23770 effect. 23771 sync 23772 23773 do all I/O to the file system synchronously. 23774 user 23775 23776 allow an unprivilieged user to mount the file system. This 23777 option implies the options noexec, nosuid, nodev unless 23778 overridden by subsequent options. 23779 23780 LSB Deprecated Options 23781 23782 The behaviors specified in this section are expected to 23783 disappear from a future version of the LSB; applications should 23784 only use the non-LSB-deprecated behaviors. 23785 23786 -V 23787 23788 output version and exit. 23789 23790 msgfmt 23791 23792 Name 23793 23794 msgfmt -- create a message object from a message file 23795 23796 Synopsis 23797 23798 msgfmt [options...] filename... 23799 23800 Description 23801 23802 The msgfmt command generates a binary message catalog from a 23803 textual translation description. Message catalogs, or message 23804 object files, are stored in files with a .mo extension. 23805 23806 Note: The format of message object files is not guaranteed 23807 to be portable. Message catalogs should always be generated 23808 on the target architecture using the msgfmt command. 23809 23810 The source message files, otherwise known as portable object 23811 files, have a .po extension. 23812 23813 The filename operands shall be portable object files. The .po 23814 file contains messages to be displayed to users by system 23815 utilities or by application programs. The portable object files 23816 are text files, and the messages in them can be rewritten in 23817 any language supported by the system. 23818 23819 If any filename is -, a portable object file shall be read from 23820 the standard input. 23821 23822 The msgfmt command interprets data as characters according to 23823 the current setting of the LC_CTYPE locale category. 23824 23825 Options 23826 23827 -c, --check 23828 Detect and diagnose input file anomalies which might 23829 represent translation errors. The msgid and msgstr 23830 strings are studied and compared. It is considered 23831 abnormal that one string starts or ends with a newline 23832 while the other does not. 23833 23834 If the message is flagged as c-format (see Comment 23835 Handling), check that the msgid string and the msgstr 23836 translation have the same number of % format specifiers, 23837 with matching types. 23838 23839 -D directory, --directory=directory 23840 Add directory to list for input files search. If 23841 filename is not an absolute pathname and filename cannot 23842 be opened, search for it in directory. This option may 23843 be repeated. Directories shall be searched in order, 23844 with the leftmost directory searched first. 23845 23846 -f, --use-fuzzy 23847 Use entries marked as fuzzy in output. If this option is 23848 not specified, such entries are not included into the 23849 output. See Comment Handling below. 23850 23851 -o output-file, --output-file=output-file 23852 Specify the output file name as output-file. If multiple 23853 domains or duplicate msgids in the .po file are present, 23854 the behavior is unspecified. If output-file is -, output 23855 is written to standard output. 23856 23857 --strict 23858 Ensure that all output files have a .mo extension. 23859 Output files are named either by the -o (or 23860 --output-file) option, or by domains found in the input 23861 files. 23862 23863 -v, --verbose 23864 Print additional information to the standard error, 23865 including the number of translated strings processed. 23866 23867 Operands 23868 23869 The filename operands are treated as portable object files. The 23870 format of portable object files is defined in EXTENDED 23871 DESCRIPTION. 23872 23873 Standard Input 23874 23875 The standard input is not used unless a filename operand is 23876 specified as "-". 23877 23878 Environment Variables 23879 23880 LANGUAGE 23881 23882 Specifies one or more locale names. 23883 LANG 23884 23885 Specifies locale name. 23886 LC_ALL 23887 23888 Specifies locale name for all categories. If defined, overrides 23889 LANG, LC_CTYPE and LC_MESSAGES. 23890 LC_CTYPE 23891 23892 Determine the locale for the interpretation of sequences of 23893 bytes of text data as characters (for example, single-byte as 23894 opposed to multi-byte characters in arguments and input files). 23895 LC_MESSAGES 23896 23897 Specifies messaging locale, and if present overrides LANG for 23898 messages. 23899 23900 Standard Output 23901 23902 The standard output is not used unless the option-argument of 23903 the -o option is specified as -. 23904 23905 Extended Description 23906 23907 The format of portable object files (.po files) is defined as 23908 follows. Each .po file contains one or more lines, with each 23909 line containing either a comment or a statement. Comments start 23910 the line with a hash mark (#) and end with the newline 23911 character. Empty lines, or lines containing only white-space, 23912 shall be ignored. Comments can in certain circumstances alter 23913 the behavior of msgfmt. See Comment Handling below for details 23914 on comment processing. The format of a statement is: 23915 23916 directive value 23917 23918 Each directive starts at the beginning of the line and is 23919 separated from value by white space (such as one or more space 23920 or tab characters). The value consists of one or more quoted 23921 strings separated by white space. If two or more strings are 23922 specified as value, they are normalized into single string 23923 using the string normalization syntax specified in ISO C 23924 (1999). The following directives are supported: 23925 23926 domain domainname 23927 23928 msgid message_identifier 23929 23930 msgid_plural untranslated_string_plural 23931 23932 msgstr message_string 23933 23934 msgstr[n] message_string 23935 23936 The behavior of the domain directive is affected by the options 23937 used. See OPTIONS for the behavior when the -o option is 23938 specified. If the -o option is not specified, the behavior of 23939 the domain directive is as follows: 23940 23941 1. All msgids from the beginning of each .po file to the first 23942 domain directive are put into a default message object 23943 file, messages (or messages.mo if the --strict option is 23944 specified). 23945 2. When msgfmt encounters a domain domainname directive in the 23946 .po file, all following msgids until the next domain 23947 directive are put into the message object file domainname 23948 (or domainname.mo if --strict option is specified). 23949 3. Duplicate msgids are defined in the scope of each domain. 23950 That is, a msgid is considered a duplicate only if the 23951 identical msgid exists in the same domain. 23952 4. All duplicate msgids are ignored. 23953 23954 The msgid directive specifies the value of a message identifier 23955 associated with the directive that follows it. The msgid_plural 23956 directive specifies the plural form message specified to the 23957 plural message handling functions ngettext(), dngettext() or 23958 dcngettext(). The message_identifier string identifies a target 23959 string to be used at retrieval time. Each statement containing 23960 a msgid directive shall be followed by a statement containing a 23961 msgstr directive or msgstr[n] directives. 23962 23963 The msgstr directive specifies the target string associated 23964 with the message_identifier string declared in the immediately 23965 preceding msgid directive. 23966 23967 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 23968 target string to be used with plural form handling functions 23969 ngettext(), dngettext() and dcngettext(). 23970 23971 Message strings can contain the following escape sequences: 23972 23973 Table 15-1. Escape Sequences 23974 \n newline 23975 \t tab 23976 \v vertical tab 23977 \b backspace 23978 \r carriage return 23979 \f formfeed 23980 \\ backslash 23981 \" double quote 23982 \ddd octal bit pattern 23983 \xHH hexadecimal bit pattern 23984 23985 Comment Handling 23986 23987 Comments are introduced by a #, and continue to the end of the 23988 line. The second character (i.e. the character following the #) 23989 has special meaning. Regular comments should follow a space 23990 character. Other comment types include: 23991 23992 # normal-comments 23993 23994 #. automatic-comments 23995 23996 #: reference... 23997 23998 #, flag 23999 24000 Automatic and reference comments are typically generated by 24001 external utilities, and are not specified by the LSB. The 24002 msgfmt command shall ignore such comments. 24003 24004 Note: Portable object files may be produced by unspecified 24005 tools. Some of the comment types described here may arise 24006 from the use of such tools. It is beyond the scope of this 24007 specification to describe these tools. 24008 24009 The #, comments require one or more flags separated by the 24010 comma (,) character. The following flags can be specified: 24011 24012 fuzzy 24013 24014 This flag shows that the following msgstr string might not be a 24015 correct translation. Only the translator (i.e. the individual 24016 undertaking the translation) can judge if the translation 24017 requires further modification, or is acceptable as is. Once 24018 satisfied with the translation, the translator then removes 24019 this fuzzy flag. 24020 24021 If this flag is specified, the msgfmt utility will not generate 24022 the entry for the immediately following msgid in the output 24023 message catalog, unless the --use-fuzzy is specified. 24024 c-format, no-c-format 24025 24026 The c-format flag indicates that the msgid string is used as 24027 format string by printf()-like functions. If the c-format flag 24028 is given for a string the msgfmt utility may perform additional 24029 tests to check the validity of the translation. 24030 24031 Plurals 24032 24033 The msgid entry with empty string ("") is called the header 24034 entry and is treated specially. If the message string for the 24035 header entry contains nplurals=value, the value indicates the 24036 number of plural forms. For example, if nplurals=4, there are 4 24037 plural forms. If nplurals is defined, there should be a 24038 plural=expression on the same line, separated by a semicolon 24039 (;) character. The expression is a C language expression to 24040 determine which version of msgstr[n] to be used based on the 24041 value of n, the last argument of ngettext(), dngettext() or 24042 dcngettext(). For example: 24043 nplurals=2; plural=n == 1 ? 0 : 1 24044 24045 indicates that there are 2 plural forms in the language; 24046 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 24047 Another example: 24048 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 24049 24050 indicates that there are 3 plural forms in the language; 24051 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 24052 otherwise msgstr[2] is used. 24053 24054 If the header entry contains charset=codeset string, the 24055 codeset is used to indicate the codeset to be used to encode 24056 the message strings. If the output string's codeset is 24057 different from the message string's codeset, codeset conversion 24058 from the message strings's codeset to the output string's 24059 codeset will be performed upon the call of gettext(), 24060 dgettext(), dcgettext(), ngettext(), dngettext(), and 24061 dcngettext(). The output string's codeset is determined by the 24062 current locale's codeset (the return value of 24063 nl_langinfo(CODESET)) by default, and can be changed by the 24064 call of bind_textdomain_codeset(). 24065 24066 Exit Status 24067 24068 The following exit values are returned: 24069 24070 0 24071 24072 Successful completion. 24073 >0 24074 24075 An error occurred. 24076 24077 Application Usage 24078 24079 Neither msgfmt nor any gettext() function imposes a limit on 24080 the total length of a message. Installing message catalogs 24081 under the C locale is pointless, since they are ignored for the 24082 sake of efficiency. 24083 24084 Examples 24085 24086 Example 1: Examples of creating message objects from message 24087 files. 24088 24089 In this example module1.po, module2.po and module3.po are 24090 portable message object files. 24091 example% cat module1.po 24092 24093 # default domain "messages" 24094 24095 msgid "message one" 24096 24097 msgstr "mensaje número uno" 24098 24099 # 24100 24101 domain "help_domain" 24102 24103 msgid "help two" 24104 24105 msgstr "ayuda número dos" 24106 24107 # 24108 24109 domain "error_domain" 24110 24111 msgid "error three" 24112 24113 msgstr "error número tres" 24114 24115 example% cat module2.po 24116 24117 # default domain "messages" 24118 24119 msgid "message four" 24120 24121 msgstr "mensaje número cuatro" 24122 24123 # 24124 24125 domain "error_domain" 24126 24127 msgid "error five" 24128 24129 msgstr "error número cinco" 24130 24131 # 24132 24133 domain "window_domain" 24134 24135 msgid "window six" 24136 24137 msgstr "ventana número seises" 24138 24139 example% cat module3.po 24140 24141 # default domain "messages" 24142 24143 msgid "message seven" 24144 24145 msgstr "mensaje número siete" 24146 24147 The following command will produce the output files messages, 24148 help_domain, and error_domain. 24149 example% msgfmt module1.po 24150 24151 The following command will produce the output files 24152 messages.mo, help_domain.mo, error_domain.mo, and 24153 window_domain.mo. 24154 example% msgfmt module1.po module2.po 24155 24156 The following example will produce the output file hello.mo. 24157 example% msgfmt -o hello.mo module3.po 24158 24159 newgrp 24160 24161 Name 24162 24163 newgrp -- change group ID 24164 24165 Synopsis 24166 24167 newgrp [group] 24168 24169 Description 24170 24171 The newgrp command is as specified in ISO POSIX (2003), but 24172 with differences as listed below. 24173 24174 Differences 24175 24176 The -l option specified in ISO POSIX (2003) need not be 24177 supported. 24178 24179 od 24180 24181 Name 24182 24183 od -- dump files in octal and other formats 24184 24185 Synopsis 24186 24187 od [-abcdfilox] [-w width | --width-width] [-v] [-A 24188 address_base] [-j skip] [-n count] [-t type_string] [file...] 24189 od --traditional [options] [file] [[+]offset [.] [b]] [[+]label 24190 [.] [b]] 24191 24192 Description 24193 24194 The od command shall provide all of the madatory functionality 24195 specified in ISO POSIX (2003), but with extensions and 24196 differences to the XSI optional behavior as listed below. 24197 24198 Extensions and Differences 24199 24200 -s 24201 unspecified behavior. 24202 24203 Note: Applications wishing to achieve the ISO POSIX (2003) 24204 behavior for -s should instead use -t d2. 24205 24206 -wwidth, --width[=width] 24207 each output line is limited to width bytes from the 24208 input. 24209 24210 --traditional 24211 accepts arguments in traditional form, see Traditional 24212 Usage below. 24213 24214 Note: The XSI optional behavior for offset handling 24215 described in ISO POSIX (2003) is not supported unless the 24216 --traditional option is also specified. 24217 24218 Pre-POSIX and XSI Specifications 24219 24220 The LSB supports mixing options between the mandatory and XSI 24221 optional synopsis forms in ISO POSIX (2003). The LSB shall 24222 support the following options: 24223 24224 -a 24225 24226 is equivalent to -t a, selects named characters. 24227 -b 24228 24229 is equivalent to -t o1, selects octal bytes. 24230 -c 24231 24232 is equivalent to -t c, selects characters. 24233 -d 24234 24235 is equivalent to -t u2, selects unsigned decimal two byte 24236 units. 24237 -f 24238 24239 is equivalent to -t fF, selects floats. 24240 -i 24241 24242 is equivalent to -t d2, selects decimal two byte units. 24243 24244 Note: This usage may change in future releases; portable 24245 applications should use -t d2. 24246 24247 -l 24248 24249 is equivalent to -t d4, selects decimal longs. 24250 -o 24251 24252 is equivalent to -t o2, selects octal two byte units. 24253 -x 24254 24255 is equivalent to -t x2, selects hexadecimal two byte units. 24256 24257 Note that the XSI option -s need not be supported. 24258 24259 Traditional Usage 24260 24261 If the --traditional option is specified, there may be between 24262 zero and three operands specified. 24263 24264 If no operands are specified, then od shall read the standard 24265 input. 24266 24267 If there is exactly one operand, and it is an offset of the 24268 form [+]offset[.][b], then it shall be interpreted as specified 24269 in ISO POSIX (2003). The file to be dumped shall be the 24270 standard input. 24271 24272 If there are exactly two operands, and they are both of the 24273 form [+]offset[.][b], then the first shall be treated as an 24274 offset (as above), and the second shall be a label, in the same 24275 format as the offset. If a label is specified, then the first 24276 output line produced for each input block shall be preceded by 24277 the input offset, cumulative across input files, of the next 24278 byte to be written, followed by the label, in parentheses. The 24279 label shall increment in the same manner as the offset. 24280 24281 If there are three operands, then the first shall be the file 24282 to dump, the second the offset, and the third the label. 24283 24284 Note: Recent versions of coreutils contain an od utility 24285 that conforms to ISO POSIX (2003). However, in April 2005, 24286 this version was not in widespread use. A future version of 24287 this specification may remove the differences. 24288 24289 passwd 24290 24291 Name 24292 24293 passwd -- change user password 24294 24295 Synopsis 24296 24297 passwd [-x max] [-n min] [-w warn] [-i inact] name 24298 passwd {-l | -u} name 24299 24300 Description 24301 24302 passwd changes authentication information for user and group 24303 accounts, including passwords and password expiry details, and 24304 may be used to enable and disable accounts. Only a user with 24305 appropriate privilege may change the password for other users 24306 or modify the expiry information. 24307 24308 Options 24309 24310 -x max 24311 24312 sets the maximum number of days a password remains valid. 24313 -n min 24314 24315 sets the minimum number of days before a password may be 24316 changed. 24317 -w warn 24318 24319 sets the number of days warning the user will receive before 24320 their password will expire. 24321 -i inactive 24322 24323 disables an account after the password has been expired for the 24324 given number of days. 24325 -l 24326 24327 disables an account by changing the password to a value which 24328 matches no possible encrypted value. 24329 -u 24330 24331 re-enables an account by changing the password back to its 24332 previous value. 24333 24334 patch 24335 24336 Name 24337 24338 patch -- apply a diff file to an original 24339 24340 Description 24341 24342 patch is as specified in ISO POSIX (2003), but with extensions 24343 as listed below. 24344 24345 Extensions 24346 24347 --binary 24348 24349 reads and write all files in binary mode, except for standard 24350 output and /dev/tty. This option has no effect on 24351 POSIX-compliant systems. 24352 -u, --unified 24353 24354 interprets the patch file as a unified context diff. 24355 24356 pidof 24357 24358 Name 24359 24360 pidof -- find the process ID of a running program 24361 24362 Synopsis 24363 24364 pidof [-s] [-x] [-o omitpid...] program... 24365 24366 Description 24367 24368 Return the process ID of a process which is running the program 24369 named on the command line. 24370 24371 The pidof command is a system administration utility, see Path 24372 For System Administration Utilities. 24373 24374 Options 24375 24376 -s 24377 24378 instructs the program to only return one pid. 24379 -x 24380 24381 causes the program to also return process id's of shells 24382 running the named scripts. 24383 -o 24384 24385 omits processes with specified process id. 24386 24387 remove_initd 24388 24389 Name 24390 24391 remove_initd -- clean up init script system modifications 24392 introduced by install_initd 24393 24394 Synopsis 24395 24396 /usr/lib/lsb/remove_initd initd_file 24397 24398 Description 24399 24400 remove_initd processes the removal of the modifications made to 24401 a distribution's init script system by the install_initd 24402 program. This cleanup is performed in the preuninstall script 24403 of a package; however, the package manager is still responsible 24404 for removing the script from the repository. See also 24405 Installation and Removal of Init Scripts. 24406 24407 renice 24408 24409 Name 24410 24411 renice -- alter priority of running processes 24412 24413 Description 24414 24415 renice is as specified in ISO POSIX (2003), but with 24416 differences as listed below. 24417 24418 Differences 24419 24420 -n increment 24421 24422 has unspecified behavior. 24423 24424 sed 24425 24426 Name 24427 24428 sed -- stream editor 24429 24430 Description 24431 24432 sed is as specified in ISO POSIX (2003), but with differences 24433 as listed below. 24434 24435 LSB Differences 24436 24437 Certain aspects of internationalized regular expressions are 24438 optional; see Regular Expressions. 24439 24440 sendmail 24441 24442 Name 24443 24444 sendmail -- an electronic mail transport agent 24445 24446 Synopsis 24447 24448 /usr/sbin/sendmail [options] [address...] 24449 24450 Description 24451 24452 To deliver electronic mail (email), applications shall support 24453 the interface provided by sendmail (described here). This 24454 interface shall be the default delivery method for 24455 applications. 24456 24457 This program sends an email message to one or more recipients, 24458 routing the message as necessary. This program is not intended 24459 as a user interface routine. 24460 24461 With no options, sendmail reads its standard input up to an 24462 end-of-file or a line consisting only of a single dot and sends 24463 a copy of the message found there to all of the addresses 24464 listed. It determines the network(s) to use based on the syntax 24465 and contents of the addresses. 24466 24467 If an address is preceded by a backslash, '\', it is 24468 unspecified if the address is subject to local alias expansion. 24469 24470 The format of messages shall be as defined in RFC 2822:Internet 24471 Message Format. 24472 24473 Note: The name sendmail was chosen for historical reasons, 24474 but the sendmail command specified here is intended to 24475 reflect functionality provided by smail, exim and other 24476 implementations, not just the sendmail implementation. 24477 24478 Options 24479 24480 -bm 24481 24482 read mail from standard input and deliver it to the recipient 24483 addresses. This is the default mode of operation. 24484 -bp 24485 24486 If the user has sufficient privilege, list information about 24487 messages currently in the mail queue. 24488 -bs 24489 24490 use the SMTP protocol as described in RFC 2821:Simple Mail 24491 Transfer Protocol; read SMTP commands on standard input and 24492 write SMTP responses on standard output. 24493 24494 In this mode, sendmail shall accept \r\n (CR-LF), as required 24495 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 24496 terminators. 24497 -F fullname 24498 24499 explicitly set the full name of the sender for incoming mail 24500 unless the message already contains a From: message header. 24501 24502 If the user running sendmail is not sufficiently trusted, then 24503 the actual sender may be indicated in the message, depending on 24504 the configuration of the agent. 24505 -f name 24506 24507 explicitly set the envelope sender address for incoming mail. 24508 If there is no From: header, the address specified in the From: 24509 header will also be set. 24510 24511 If the user running sendmail is not sufficiently trusted, then 24512 the actual sender shall be indicated in the message. 24513 -i 24514 24515 ignore dots alone on lines by themselves in incoming messages. 24516 If this options is not specified, a line consisting of a single 24517 dot shall terminate the input. If -bs is also used, the 24518 behavior is unspecified. 24519 -odb 24520 24521 deliver any mail in background, if supported; otherwise 24522 ignored. 24523 -odf 24524 24525 deliver any mail in foreground, if supported; otherwise 24526 ignored. 24527 -oem or -em 24528 24529 mail errors back to the sender. (default) 24530 -oep or -ep 24531 24532 write errors to the standard error output. 24533 -oeq or -eq 24534 24535 do not send notification of errors to the sender. This only 24536 works for mail delivered locally. 24537 -oi 24538 24539 is equivalent to -i. 24540 -om 24541 24542 indicate that the sender of a message should receive a copy of 24543 the message if the sender appears in an alias expansion. 24544 Ignored if aliases are not supported. 24545 -t 24546 24547 read the message to obtain recipients from the To:, Cc:, and 24548 Bcc: headers in the message instead of from the command 24549 arguments. If a Bcc: header is present, it is removed from the 24550 message unless there is no To: or Cc: header, in which case a 24551 Bcc: header with no data is created, in accordance with RFC 24552 2822:Internet Message Format. 24553 24554 If there are any operands, the recipients list is unspecified. 24555 24556 This option may be ignored when not in -bm mode (the default). 24557 24558 Note: It is recommended that applications use as few options 24559 as necessary, none if possible. 24560 24561 Exit status 24562 24563 0 24564 24565 successful completion on all addresses. This does not indicate 24566 successful delivery. 24567 >0 24568 24569 there was an error. 24570 24571 sh 24572 24573 Name 24574 24575 sh -- shell, the standard command language interpreter 24576 24577 Description 24578 24579 The sh utility shall behave as specified in ISO POSIX (2003), 24580 but with extensions listed below. 24581 24582 Shell Invocation 24583 24584 The shell shall support an additional option, -l (the letter 24585 ell). If the -l option is specified, or if the first character 24586 of argument zero (the command name) is a '-', this invokation 24587 of the shell is a login shell. 24588 24589 An interactive shell, as specified in ISO POSIX (2003), that is 24590 also a login shell, or any shell if invoked with the -l option, 24591 shall, prior to reading from the input file, first read and 24592 execute commands from the file /etc/profile, if that file 24593 exists, and then from a file called ~/.profile, if such a file 24594 exists. 24595 24596 Note: This specification requires that the sh utility shall 24597 also read and execute commands in its current execution 24598 environment from all the shell scripts in the directory 24599 /etc/profile.d. Such scripts are read and executed as a part 24600 of reading and executing /etc/profile. 24601 24602 shutdown 24603 24604 Name 24605 24606 shutdown -- shut the system down 24607 24608 Synopsis 24609 24610 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 24611 [warning-message] 24612 /sbin/shutdown -c [warning-message] 24613 24614 Description 24615 24616 The shutdown command shall shut the system down in a secure way 24617 (first synopsis), or cancel a pending shutdown (second 24618 synopsis). When the shutdown is initiated, all logged-in users 24619 shall be notified immediately that the system is going down, 24620 and users shall be prevented from logging in to the system. The 24621 time specifies when the actual shutdown shall commence. See 24622 below for details. At the specified time all processes are 24623 first notified that the system is going down by the signal 24624 SIGTERM. After an interval (see -t) all processes shall be sent 24625 the signal SIGKILL. If neither the -h or the -r argument is 24626 specified, then the default behavior shall be to take the 24627 system to a runlevel where administrative tasks can be run. See 24628 also Run Levels. 24629 24630 Note: This is sometimes referred to as "single user mode". 24631 24632 The -h and -r options are mutually exclusive. If either the -h 24633 or -r options are specified, the system shall be halted or 24634 rebooted respectively. 24635 24636 Standard Options 24637 24638 -a 24639 24640 use access control. See below. 24641 -t sec 24642 24643 tell the system to wait sec seconds between sending processes 24644 the warning and the kill signal, before changing to another 24645 runlevel. The default period is unspecified. 24646 -k 24647 24648 do not really shutdown; only send the warning messages to 24649 everybody. 24650 -r 24651 24652 reboot after shutdown. 24653 -h 24654 24655 halt after shutdown. Actions after halting are unspecified 24656 (e.g. power off). 24657 -f 24658 24659 advise the system to skip file system consistency checks on 24660 reboot. 24661 -F 24662 24663 advise the system to force file system consistency checks on 24664 reboot. 24665 -c 24666 24667 cancel an already running shutdown. 24668 time 24669 24670 specify when to shut down. 24671 24672 The time argument shall have the following format: [now | 24673 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 24674 hour (1 or 2 digits) and mm is the minute of the hour (exactly 24675 two digits), and the shutdown shall commence at the next 24676 occurence of the specified time. If the format is mins (or 24677 +mins), where mins is a decimal number, shutdown shall commence 24678 in the specified number of minutes. The word now is an alias 24679 for +0. 24680 warning-message 24681 24682 specify a message to send to all users. 24683 24684 Access Control 24685 24686 If the shutdown utility is invoked with the -a option, it shall 24687 check that an authorized user is currently logged in on the 24688 system console. Authorized users are listed, one per line, in 24689 the file /etc/shutdown.allow. Lines in this file that begin 24690 with a '#' or are blank shall be ignored. 24691 24692 Note: The intent of this scheme is to allow a keyboard 24693 sequence entered on the system console (e.g. CTRL-ALT-DEL, 24694 or STOP-A) to automatically invoke shutdown -a, and can be 24695 used to prevent unauthorized users from shutting the system 24696 down in this fashion. 24697 24698 su 24699 24700 Name 24701 24702 su -- change user ID 24703 24704 Synopsis 24705 24706 su [options] [-] [username [ARGS]] 24707 24708 Description 24709 24710 The su command shall start a shell running with the real and 24711 effective user and group IDs of the user username. If username 24712 is not specified, su shall default to an unspecified user with 24713 all appropriate privileges. If the -s or --shell is not 24714 specified, the shell to be invoked shall be that specified for 24715 username in the user database (see getpwnam()), or /bin/sh if 24716 there is no shell specified in the user database. 24717 24718 If the - option is specified, or if the first operand is -, the 24719 environment for the shell shall be initialized as if the new 24720 shell was a login shell (see Shell Invocation). 24721 24722 If the invoking user does not have appropriate privileges, the 24723 su command shall prompt for a password and validate this before 24724 continuing. Invalid passwords shall produce an error message. 24725 The su command shall log in an unspecified manner all 24726 invokations, whether successful or unsuccessful. 24727 24728 Any operands specified after the username shall be passed to 24729 the invoked shell. 24730 24731 If the option - is not specified, and if the first operand is 24732 not -, the environemnt for the new shell shall be intialized 24733 from the current environment. If none of the -m, -p, or 24734 --preserve-environment options are specified, the environment 24735 may be modified in unspecified ways before invoking the shell. 24736 If any of the -m, -p, or --preserve-environment options are 24737 specified, the environment shall not be altered. 24738 24739 Note: Although the su command shall not alter the 24740 environment, the invoked shell may still alter it before it 24741 is ready to intepret any commands. 24742 24743 Standard Options 24744 24745 - 24746 the invoked shell shall be a login shell. 24747 24748 -c command, --command=command 24749 Invoke the shell with the option -c command. 24750 24751 -m, -p, --preserve-environment 24752 The current environment shall be passed to the invoked 24753 shell. If the environment variable SHELL is set, it 24754 shall specify the shell to invoke, if it matches an 24755 entry in /etc/shells. If there is no matching entry in 24756 /etc/shells, this option shall be ignored if the - 24757 option is also specified, or if the first operand is -. 24758 24759 -s shell, --shell=shell 24760 Invoke shell as the comamnd interpreter. The shell 24761 specified shall be present in /etc/shells. 24762 24763 sync 24764 24765 Name 24766 24767 sync -- flush file system buffers 24768 24769 Synopsis 24770 24771 sync 24772 24773 Description 24774 24775 Force changed blocks to disk, update the super block. 24776 24777 tar 24778 24779 Name 24780 24781 tar -- file archiver 24782 24783 Description 24784 24785 tar is as specified in SUSv2, but with differences as listed 24786 below. 24787 24788 Differences 24789 24790 Some elements of the Pattern Matching Notation are optional; 24791 see Pattern Matching Notation. 24792 24793 -h 24794 24795 doesn't dump symlinks; dumps the files they point to. 24796 -z 24797 24798 filters the archive through gzip. 24799 24800 umount 24801 24802 Name 24803 24804 umount -- unmount file systems 24805 24806 Synopsis 24807 24808 umount [-hV] 24809 umount -a [-nrv] [-t vfstype] 24810 umount [-nrv] device | dir... 24811 24812 Description 24813 24814 umount detaches the file system(s) mentioned from the file 24815 hierarchy. A file system is specified by giving the directory 24816 where it has been mounted. 24817 24818 Standard Options 24819 24820 -v 24821 24822 invokes verbose mode. 24823 -n 24824 24825 unmounts without writing in /etc/mtab. 24826 -r 24827 24828 tries to remount read-only if unmounting fails. 24829 -a 24830 24831 unmounts all of the file systems described in /etc/mtab except 24832 for the proc file system. 24833 -t vfstype 24834 24835 indicates that the actions should only be taken on file systems 24836 of the specified type. More than one type may be specified in a 24837 comma separated list. The list of file system types can be 24838 prefixed with no to specify the file system types on which no 24839 action should be taken. 24840 -f 24841 24842 forces unmount (in case of an unreachable NFS system). 24843 24844 LSB Deprecated Options 24845 24846 The behaviors specified in this section are expected to 24847 disappear from a future version of the LSB; applications should 24848 only use the non-LSB-deprecated behaviors. 24849 24850 -V 24851 24852 print version and exits. 24853 24854 useradd 24855 24856 Name 24857 24858 useradd -- create a new user or update default new user 24859 information 24860 24861 Synopsis 24862 24863 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 24864 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 24865 [-u uid [-o]] login 24866 useradd -D [-g default_group] [-b default_home] [-s 24867 default_shell] 24868 24869 Description 24870 24871 When invoked without the -D option, and with appropriate 24872 privilege, useradd creates a new user account using the values 24873 specified on the command line and the default values from the 24874 system. The new user account will be entered into the system 24875 files as needed, the home directory will be created, and 24876 initial files copied, depending on the command line options. 24877 24878 When invoked with the -D option, useradd will either display 24879 the current default values, or, with appropriate privilege, 24880 update the default values from the command line. If no options 24881 are specified, useradd displays the current default values. 24882 24883 The useradd command is a system administration utility, see 24884 Path For System Administration Utilities. 24885 24886 Standard Options 24887 24888 -c comment 24889 24890 specifies the new user's password file comment field value. 24891 -d home_dir 24892 24893 creates the new user using home_dir as the value for the user's 24894 login directory. The default is to append the login name to 24895 default_home and use that as the login directory name. 24896 -g initial_group 24897 24898 specifies the group name or number of the user's initial login 24899 group. The group name shall exist. A group number shall refer 24900 to an already existing group. If -g is not specified, the 24901 implementation will follow the normal user default for that 24902 system. This may create a new group or choose a default group 24903 that normal users are placed in. Applications which require 24904 control of the groups into which a user is placed should 24905 specify -g. 24906 -G group[,...] 24907 24908 specifies a list of supplementary groups which the user is also 24909 a member of. Each group is separated from the next by a comma, 24910 with no intervening whitespace. The groups are subject to the 24911 same restrictions as the group given with the -g option. The 24912 default is for the user to belong only to the initial group. 24913 -m [-k skeleton_dir] 24914 24915 specifies the user's home directory will be created if it does 24916 not exist. The files contained in skeleton_dir will be copied 24917 to the home directory if the -k option is used, otherwise the 24918 files contained in /etc/skel will be used instead. Any 24919 directories contained in skeleton_dir or /etc/skel will be 24920 created in the user's home directory as well. The -k option is 24921 only valid in conjunction with the -m option. The default is to 24922 not create the directory and to not copy any files. 24923 -p passwd 24924 24925 is the encrypted password, as returned by crypt(). The default 24926 is to disable the account. 24927 -r 24928 24929 creates a system account, that is, a user with a User ID in the 24930 range reserved for system account users. If there is not a User 24931 ID free in the reserved range the command will fail. 24932 -s shell 24933 24934 specifies the name of the user's login shell. The default is to 24935 leave this field blank, which causes the system to select the 24936 default login shell. 24937 -u uid [-o] 24938 24939 specifies the numerical value of the user's ID. This value 24940 shall be unique, unless the -o option is used. The value shall 24941 be non-negative. The default is the smallest ID value greater 24942 than 499 which is not yet used. 24943 24944 Change Default Options 24945 24946 -b default_home 24947 24948 specifies the initial path prefix for a new user's home 24949 directory. The user's name will be affixed to the end of 24950 default_home to create the new directory name if the -d option 24951 is not used when creating a new account. 24952 -g default_group 24953 24954 specifies the group name or ID for a new user's initial group. 24955 The named group shall exist, and a numerical group ID shall 24956 have an existing entry. 24957 -s default_shell 24958 24959 specifies the name of the new user's login shell. The named 24960 program will be used for all future new user accounts. 24961 -c comment 24962 24963 specifies the new user's password file comment field value. 24964 24965 Application Usage 24966 24967 The -D option will typically be used by system administration 24968 packages. Most applications should not change defaults which 24969 will affect other applications and users. 24970 24971 userdel 24972 24973 Name 24974 24975 userdel -- delete a user account and related files 24976 24977 Synopsis 24978 24979 userdel [-r] login 24980 24981 Description 24982 24983 Delete the user account named login. If there is also a group 24984 named login, this command may delete the group as well, or may 24985 leave it alone. 24986 24987 The userdel command is a system administration utility, see 24988 Path For System Administration Utilities. 24989 24990 Options 24991 24992 -r 24993 24994 removes files in the user's home directory along with the home 24995 directory itself. Files located in other file system will have 24996 to be searched for and deleted manually. 24997 24998 usermod 24999 25000 Name 25001 25002 usermod -- modify a user account 25003 25004 Synopsis 25005 25006 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] [-G 25007 group [,...]] [-l login_name] [-p passwd] [-s shell] [-u uid [ 25008 -o]] login 25009 25010 Description 25011 25012 The usermod command shall modify an entry in the user account 25013 database. 25014 25015 The usermod command is a system administration utility, see 25016 Path For System Administration Utilities. 25017 25018 Options 25019 25020 -c comment 25021 25022 specifies the new value of the user's password file comment 25023 field. 25024 -d home_dir 25025 25026 specifies the user's new login directory. If the -m option is 25027 given the contents of the current home directory will be moved 25028 to the new home directory, which is created if it does not 25029 already exist. 25030 -g initial_group 25031 25032 specifies the group name or number of the user's new initial 25033 login group. The group name shall exist. A group number shall 25034 refer to an already existing group. 25035 -G group,[...] 25036 25037 specifies a list of supplementary groups which the user is also 25038 a member of. Each group is separated from the next by a comma, 25039 with no intervening whitespace. The groups are subject to the 25040 same restrictions as the group given with the -g option. If the 25041 user is currently a member of a group which is not listed, the 25042 user will be removed from the group. 25043 -l login_name 25044 25045 changes the name of the user from login to login_name. Nothing 25046 else is changed. In particular, the user's home directory name 25047 should probably be changed to reflect the new login name. 25048 -p passwd 25049 25050 is the encrypted password, as returned by crypt(3). 25051 -s shell 25052 25053 specifies the name of the user's new login shell. Setting this 25054 field to blank causes the system to select the default login 25055 shell. 25056 -u uid [-o] 25057 25058 specifies the numerical value of the user's ID. This value 25059 shall be unique, unless the -o option is used. The value shall 25060 be non-negative. Any files which the user owns and which are 25061 located in the directory tree rooted at the user's home 25062 directory will have the file user ID changed automatically. 25063 Files outside of the user's home directory shall be altered 25064 manually. 25065 25066 xargs 25067 25068 Name 25069 25070 xargs -- build and execute command lines from standard input 25071 25072 Description 25073 25074 xargs is as specified in ISO POSIX (2003), but with differences 25075 as listed below. 25076 25077 Differences 25078 25079 -E 25080 25081 has unspecified behavior. 25082 -I 25083 25084 has unspecified behavior. 25085 -L 25086 25087 has unspecified behavior. 25088 25089 Note: These options have been implemented in 25090 findutils-4.2.9, but this version of the utilities is not in 25091 widespread use as of April 2005. However, future versions of 25092 this specification will require support for these arguments. 25093 25094 zcat 25095 25096 Name 25097 25098 zcat -- uncompress files to standard output 25099 25100 Description 25101 25102 The zcat utility shall behave as described in ISO POSIX (2003), 25103 with differences listed below. 25104 25105 The Filesystem Hierarchy Standard requires that if zcat exists, 25106 it must be a symbolic or hard link to /bin/gzip. This 25107 specification additionally allows zcat to be a wrapper script 25108 which calls gzip -c -d. 25109 25110 Differences 25111 25112 The zcat utility shall write to standard output the 25113 uncompressed form of files that have been compressed using any 25114 of the compression methods supported by the gzip utility. It is 25115 the equivalent of gzip -c -d. Input files are not affected. 25116 25117 VI. Execution Environment 25118 25119 Table of Contents 25120 16. File System Hierarchy 25121 25122 16.1. /dev: Device Files 25123 16.2. /etc: Host-specific system configuration 25124 25125 16.2.1. File Naming Conventions 25126 25127 16.3. User Accounting Databases 25128 16.4. Path For System Administration Utilities 25129 25130 17. Additional Recommendations 25131 25132 17.1. Recommendations for applications on ownership and 25133 permissions 25134 25135 17.1.1. Directory Write Permissions 25136 17.1.2. File Write Permissions 25137 17.1.3. File Read and execute Permissions 25138 17.1.4. SUID and SGID Permissions 25139 17.1.5. Privileged users 25140 17.1.6. Changing permissions 25141 17.1.7. Removable Media (Cdrom, Floppy, etc.) 25142 17.1.8. Installable applications 25143 25144 18. Additional Behaviors 25145 25146 18.1. Mandatory Optional Behaviors 25147 25148 18.1.1. Special Requirements 25149 25150 19. Localization 25151 25152 19.1. Introduction 25153 19.2. Regular Expressions 25154 19.3. Pattern Matching Notation 25155 __________________________________________________________ 25156 25157 Chapter 16. File System Hierarchy 25158 25159 An LSB conforming implementation shall provide the mandatory 25160 portions of the file system hierarchy specified in the 25161 Filesystem Hierarchy Standard (FHS), together with any 25162 additional requirements made in this specification. 25163 25164 An LSB conforming application shall conform to the Filesystem 25165 Hierarchy Standard. 25166 25167 The FHS allows many components or subsystems to be optional. An 25168 application shall check for the existence of an optional 25169 component before using it, and should behave in a reasonable 25170 manner if the optional component is not present. 25171 25172 The FHS requirement to locate the operating system kernel in 25173 either / or /boot does not apply if the operating system kernel 25174 does not exist as a file in the file system. 25175 25176 The FHS specifies certain behaviors for a variety of commands 25177 if they are present (for example, ping or python). However, LSB 25178 conforming applications shall not rely on any commands beyond 25179 those specified by the LSB. The mere existence of a command may 25180 not be used as an indication that the command behaves in any 25181 particular way. 25182 25183 The following directories or links need not be present: 25184 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 25185 __________________________________________________________ 25186 25187 16.1. /dev: Device Files 25188 25189 The devices described in Chapter 6. "Operating System Specific 25190 Annex", Section 6.1. "Linux", subsection 6.1.3. "/dev: Devices 25191 and special files" in the Filesystem Hierarchy Standard are 25192 required on an LSB conforming system. Other devices may also 25193 exist in /dev. Device names may exist as symbolic links to 25194 other device nodes located in /dev or subdirectories of /dev. 25195 There is no requirement concerning major/minor number values. 25196 __________________________________________________________ 25197 25198 16.2. /etc: Host-specific system configuration 25199 25200 In addition to the requirements for /etc in the Filesystem 25201 Hierarchy Standard, an LSB conforming system shall also provide 25202 the following directories or symbolic links to directories: 25203 25204 /etc/cron.d 25205 25206 A directory containing extended crontab files; see Cron Jobs. 25207 /etc/cron.daily 25208 25209 A directory containing shell scripts to be executed once a day; 25210 see Cron Jobs. 25211 /etc/cron.hourly 25212 25213 A directory containing shell scripts to be executed once per 25214 hour; see Cron Jobs. 25215 /etc/cron.monthly 25216 25217 A directory containing shell scripts to be executed once per 25218 month; see Cron Jobs. 25219 /etc/cron.weekly 25220 25221 A directory containing shell scripts to be executed once a 25222 week; see Cron Jobs. 25223 /etc/init.d 25224 25225 A directory containing system initialization scripts; see 25226 Installation and Removal of Init Scripts. 25227 /etc/profile.d 25228 25229 A directory containing shell scripts. Script names should 25230 follow the same conventions as specified for cron jobs (see 25231 Cron Jobs, but should have the suffix .sh. The behavior is 25232 unspecified if a script is installed in this directory that 25233 does not have the suffix .sh. 25234 25235 The sh utility shall read and execute commands in its current 25236 execution environment from all the shell scripts in this 25237 directory that have the suffix .sh when invoked as an 25238 interactive login shell, or if the -l (the letter ell) is 25239 specified (see Shell Invocation). 25240 25241 Future Directions: These directories are required at this 25242 version of the LSB since there is not yet an agreed method 25243 for abstracting the implementation so that applications need 25244 not be aware of these locations during installation. 25245 However, Future Directions describes a tool, lsbinstall, 25246 that will make these directories implementation specific and 25247 no longer required. 25248 __________________________________________________________ 25249 25250 16.2.1. File Naming Conventions 25251 25252 Conforming implemetnations and applications installing files 25253 into any of the above locations under /etc may only use 25254 filenames from the following managed namespaces: 25255 25256 * Assigned names. Such names must be chosen from the 25257 character set [a-z0-9]. In order to avoid conflicts these 25258 names shall be reserved through the Linux Assigned Names 25259 and Numbers Authority (LANANA). Information about the 25260 LANANA may be found at www.lanana.org. 25261 25262 Note: Commonly used names should be reserved in advance; 25263 developers for projects are encouraged to reserve names from 25264 LANANA, so that each distribution can use the same name, and 25265 to avoid conflicts with other projects. 25266 * Hierarchical names. Script names in this category take the 25267 form: --...-, where name is taken from 25268 the character set [a-z0-9], and where there may be one or 25269 more components. may either be an LSB 25270 provider name assigned by the LANANA, or it may be owners' 25271 DNS name in lower case, with at least one '.'. e.g. 25272 "debian.org", "staroffice.sun.com", etc. The LSB provider 25273 name assigned by LANANA shall only consist of the ASCII 25274 characters [a-z0-9]. 25275 * Reserved names. Names that begin with the character '_' are 25276 reserved for distribution use only. These names should be 25277 used for essential system packages only. 25278 25279 Note: A non-conforming application may still have polluted 25280 these managed namespaces with unregistered filenames; a 25281 conforming application should check for namespace collisions 25282 and take appropriate steps if they occur. 25283 25284 In general, if a package or some system function is likely 25285 to be used on multiple systems, the package developers or 25286 the distribution should get a registered name through 25287 LANANA, and distributions should strive to use the same name 25288 whenever possible. For applications which may not be 25289 essential or may not be commonly installed, the hierarchical 25290 namespace may be more appropriate. An advantage to the 25291 hierarchical namespace is that there is no need to consult 25292 with the LANANA before obtaining an assigned name. 25293 25294 Short names are highly desirable, since system 25295 administrators may need to manually start and stop services. 25296 Given this, they should be standardized on a per-package 25297 basis. This is the rationale behind having the LANANA 25298 organization assign these names. The LANANA may be called 25299 upon to handle other namespace issues, such as 25300 package/prerequisites naming. 25301 __________________________________________________________ 25302 25303 16.3. User Accounting Databases 25304 25305 The Filesystem Hierarchy Standard specifies two optional 25306 locations for user accounting databases used by the getutent(), 25307 getutent_r(), getutxent(), getutxid(), getutxline(), and 25308 pututxline() functions. These are /var/run/utmp and 25309 /var/run/wtmp. 25310 25311 The LSB does not specify the format or structure of these 25312 files, or even if they are files at all. They should be used 25313 only as "magic cookies" to the utmpname() function. 25314 __________________________________________________________ 25315 25316 16.4. Path For System Administration Utilities 25317 25318 Certain utilities used for system administration (and other 25319 privileged commands) may be stored in /sbin, /usr/sbin, and 25320 /usr/local/sbin. Applications requiring to use commands 25321 identified as system administration utilities should add these 25322 directories to their PATH. By default, as described in ISO 25323 POSIX (2003), standard utilities shall be found on the PATH 25324 returned by getconf PATH (or command -p getconf PATH to be 25325 guaranteed to invoke the correct version of getconf). 25326 __________________________________________________________ 25327 25328 Chapter 17. Additional Recommendations 25329 25330 17.1. Recommendations for applications on ownership and permissions 25331 25332 17.1.1. Directory Write Permissions 25333 25334 The application should not depend on having directory write 25335 permission in any directory except /tmp, /var/tmp, and the 25336 invoking user's home directory. 25337 25338 In addition, the application may store variable data in 25339 /var/opt/package, (where package is the name of the application 25340 package), if such a directory is created with appropriate 25341 permissions during the package installation. 25342 25343 For these directories the application should be able to work 25344 with directory write permissions restricted by the S_ISVTXT 25345 bit, implementing the restricted deletion mode as described for 25346 the XSI option for ISO POSIX (2003).. 25347 __________________________________________________________ 25348 25349 17.1.2. File Write Permissions 25350 25351 The application should not depend on file write permission to 25352 any file that it does not itself create. 25353 __________________________________________________________ 25354 25355 17.1.3. File Read and execute Permissions 25356 25357 The application should not depend on having read permission to 25358 every file and directory. 25359 __________________________________________________________ 25360 25361 17.1.4. SUID and SGID Permissions 25362 25363 The application should not depend on the set user ID or set 25364 group ID (the S_ISUID or S_ISGID permission bits) permissions 25365 of a file not packaged with the application. Instead, the 25366 distribution is responsible for assuming that all system 25367 commands have the required permissions and work correctly. 25368 25369 Rationale: In order to implement common security policies it 25370 is strongly advisable for applications to use the minimum 25371 set of security attributes necessary for correct operation. 25372 Applications that require substantial appropriate privilege 25373 are likely to cause problems with such security policies. 25374 __________________________________________________________ 25375 25376 17.1.5. Privileged users 25377 25378 In general, applications should not depend on running as a 25379 privileged user. This specification uses the term "appropriate 25380 privilege" throughout to identify operations that cannot be 25381 achieved without some special granting of additional privilege. 25382 25383 Applications that have a reason to run with appropriate 25384 privilege should outline this reason clearly in their 25385 documentation. Users of the application should be informed, 25386 that "this application demands security privileges, which could 25387 interfere with system security". 25388 25389 The application should not contain binary-only software that 25390 requires being run with appropriate privilege, as this makes 25391 security auditing harder or even impossible. 25392 __________________________________________________________ 25393 25394 17.1.6. Changing permissions 25395 25396 The application shall not change permissions of files and 25397 directories that do not belong to its own package. Should an 25398 application require that certain files and directories not 25399 directly belonging to the package have a particular ownership, 25400 the application shall document this requirement, and may fail 25401 during installation if the permissions on these files is 25402 inappropriate. 25403 __________________________________________________________ 25404 25405 17.1.7. Removable Media (Cdrom, Floppy, etc.) 25406 25407 Applications that expect to be runnable from removable media 25408 should not depend on logging in as a privileged user, and 25409 should be prepared to deal with a restrictive environment. 25410 Examples of such restrictions could be default mount options 25411 that disable set-user/group-ID attributes, disabling block or 25412 character-special files on the medium, or remapping the user 25413 and group IDs of files away from any privileged value. 25414 25415 Rationale: System vendors and local system administrators 25416 want to run applications from removable media, but want the 25417 possibility to control what the application can do. 25418 __________________________________________________________ 25419 25420 17.1.8. Installable applications 25421 25422 Where the installation of an application needs additional 25423 privileges, it must clearly document all files and system 25424 databases that are modified outside of those in /opt/pkg-name 25425 and /var/opt/pkg-name, other than those that may be updated by 25426 system logging or auditing activities. 25427 25428 Without this, the local system administrator would have to 25429 blindly trust a piece of software, particularly with respect to 25430 its security. 25431 __________________________________________________________ 25432 25433 Chapter 18. Additional Behaviors 25434 25435 18.1. Mandatory Optional Behaviors 25436 25437 This section specifies behaviors in which there is optional 25438 behavior in one of the standards on which the LSB relies, and 25439 where the LSB requires a specific behavior. 25440 25441 Note: The LSB does not require the kernel to be Linux; the 25442 set of mandated options reflects current existing practice, 25443 but may be modified in future releases. 25444 25445 LSB conforming implementations shall support the following 25446 options defined within the ISO POSIX (2003): 25447 25448 _POSIX_FSYNC 25449 _POSIX_MAPPED_FILES 25450 _POSIX_MEMLOCK 25451 _POSIX_MEMLOCK_RANGE 25452 _POSIX_MEMORY_PROTECTION 25453 _POSIX_PRIORITY_SCHEDULING 25454 _POSIX_REALTIME_SIGNALS 25455 _POSIX_THREAD_ATTR_STACKADDR 25456 _POSIX_THREAD_ATTR_STACKSIZE 25457 _POSIX_THREAD_PROCESS_SHARED 25458 _POSIX_THREAD_SAFE_FUNCTIONS 25459 _POSIX_THREADS 25460 25461 The opendir() function shall consume a file descriptor in the 25462 same fashion as open(), and therefore may fail with EMFILE or 25463 ENFILE. 25464 25465 The START and STOP termios characters shall be changeable, as 25466 described as optional behavior in the "General Terminal 25467 Interface" section of the ISO POSIX (2003). 25468 25469 The access() function function shall fail with errno set to 25470 EINVAL if the amode argument contains bits other than those set 25471 by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 25472 25473 The link() function shall require access to the existing file 25474 in order to succeed, as described as optional behavior in the 25475 ISO POSIX (2003). 25476 25477 Calling unlink() on a directory shall fail. Calling link() 25478 specifying a directory as the first argument shall fail. See 25479 also unlink. 25480 25481 Note: Linux allows rename() on a directory without having 25482 write access, but the LSB does not require this. 25483 __________________________________________________________ 25484 25485 18.1.1. Special Requirements 25486 25487 LSB conforming systems shall enforce certain special additional 25488 restrictions above and beyond those required by ISO POSIX 25489 (2003). 25490 25491 Note: These additional restrictions are required in order to 25492 support the testing and certification programs associated 25493 with the LSB. In each case, these are values that defined 25494 macros must not have; conforming applications that use these 25495 values shall trigger a failure in the interface that is 25496 otherwise described as a "may fail". 25497 25498 The fcntl() function shall treat the "cmd" value -1 as invalid. 25499 25500 The whence value -1 shall be an invalid value for the lseek(), 25501 fseek() and fcntl() functions. 25502 25503 The value -5 shall be an invalid signal number. 25504 25505 If the sigaddset() or sigdelset() functions are passed an 25506 invalid signal number, they shall return with EINVAL. 25507 Implementations are only required to enforce this requirement 25508 for signal numbers which are specified to be invalid by this 25509 specification (such as the -5 mentioned above). 25510 25511 The mode value -1 to the access() function shall be treated as 25512 invalid. 25513 25514 A value of -1 shall be an invalid "_PC_..." value for 25515 pathconf(). 25516 25517 A value of -1 shall be an invalid "_SC..." value for sysconf(). 25518 25519 The nl_item value -1 shall be invalid for nl_langinfo(). 25520 25521 The value -1 shall be an invalid "_CS_..." value for confstr(). 25522 25523 The value "a" shall be an invalid mode argument to popen(). 25524 25525 The fcntl() function shall fail and set errno to EDEADLK if the 25526 cmd argument is F_SETLKW, and the lock is blocked by a lock 25527 from another process already blocked by the current process. 25528 25529 The opendir() function shall consume a file descriptor; the 25530 readdir() function shall fail and set errno to EBADF if the 25531 underlying file descriptor is closed. 25532 25533 The link() function shall not work across file systems, and 25534 shall fail and set errno to EXDEV as described as optional 25535 behavior in ISO POSIX (2003). 25536 __________________________________________________________ 25537 25538 Chapter 19. Localization 25539 25540 19.1. Introduction 25541 25542 In order to install a message catalog, the installation 25543 procedure shall supply the message catalog in a format readable 25544 by the msgfmt utility, which shall be invoked to compile the 25545 message catalog into an appropriate binary format on the target 25546 system. 25547 25548 Rationale: The original intent was to allow an application 25549 to contain the binary GNU MO format files. However, the 25550 format of these files is not officially stable, hence it is 25551 necessary to compile these catalogs on the target system. 25552 These binary catalogs may differ from architecture to 25553 architecture as well. 25554 25555 The resulting binary message catalog shall be located in the 25556 package's private area under /opt, and the application may use 25557 bindtextdomain() to specify this location. 25558 25559 Implementations shall support the POSIX and C locales as 25560 specified in ISO POSIX (2003). Other locales may be supported. 25561 25562 Implementations may define additional locale categories not 25563 defined by that standard. 25564 25565 Note: Implementations choosing additional locale categories 25566 should be aware of ISO/IEC TR14652 and are advised not to 25567 choose names that conflict with that specification. If 25568 implementations provide locale categories whose names are 25569 part of the FDCC set of ISO/IEC TR14652, they should behave 25570 as defined by that specification. 25571 __________________________________________________________ 25572 25573 19.2. Regular Expressions 25574 25575 Utilities that process regular expressions shall support Basic 25576 Regular Expressions and Extended Regular Expressions as 25577 specified in ISO POSIX (2003), with the following exceptions: 25578 25579 Range expression (such as [a-z]) can be based on code point 25580 order instead of collating element order. 25581 25582 Equivalence class expression (such as [=a=]) and 25583 multi-character collating element expression (such as [.ch.]) 25584 are optional. 25585 25586 Handling of a multi-character collating element is optional. 25587 25588 This affects at least the following utilities: 25589 25590 * awk (see awk) 25591 * grep (see grep) (including egrep, see egrep) 25592 * sed (see sed) 25593 25594 It also affects the behavior of interfaces in the base 25595 libraries, including at least 25596 25597 * regexec() (see regexec) 25598 __________________________________________________________ 25599 25600 19.3. Pattern Matching Notation 25601 25602 Utilities that perform filename pattern matching (also known as 25603 Filename Globbing) shall do it as specified in ISO POSIX 25604 (2003), Pattern Matching Notation, with the following 25605 exceptions: 25606 25607 Pattern bracket expressions (such as [a-z]) can be based on 25608 code point order instead of collating element order. 25609 25610 Equivalence class expression (such as [=a=]) and 25611 multi-character collating element expression (such as [.ch.]) 25612 are optional. 25613 25614 Handling of a multi-character collating element is optional. 25615 25616 This affects at least the following utilities: cpio (cpio), 25617 find (find) and tar (tar). 25618 25619 VII. System Initialization 25620 25621 Table of Contents 25622 20. System Initialization 25623 25624 20.1. Cron Jobs 25625 20.2. Init Script Actions 25626 20.3. Comment Conventions for Init Scripts 25627 20.4. Installation and Removal of Init Scripts 25628 20.5. Run Levels 25629 20.6. Facility Names 25630 20.7. Script Names 25631 20.8. Init Script Functions 25632 __________________________________________________________ 25633 25634 Chapter 20. System Initialization 25635 25636 20.1. Cron Jobs 25637 25638 In addition to the individual user crontab files specified by 25639 ISO POSIX (2003), which are located in /var/spool/cron as 25640 specified by the Filesystem Hierarchy Standard (FHS), the 25641 process that executes scheduled commands shall also process the 25642 following additional crontab files, which are in a different 25643 format (see below). /etc/crontab, /etc/cron.d/*. The 25644 installation of a package shall not modify the crontab file 25645 /etc/crontab, and shall not directly modify the user crontab 25646 files in /var/spool/cron/crontabs. but may use the crontab 25647 command to modify the latter. 25648 25649 If a package wishes to install a job that has to be executed 25650 periodically, it shall place an executable cron script in one 25651 of the following directories: 25652 25653 /etc/cron.hourly 25654 /etc/cron.daily 25655 /etc/cron.weekly 25656 /etc/cron.monthly 25657 25658 As these directory names suggest, the files within them are 25659 executed on a hourly, daily, weekly, or monthly basis, 25660 respectively, under the control of an entry in one of the 25661 system crontab files, at an unspecified time of day. See below 25662 for the rules concerning the names of cron scripts. 25663 25664 Note: It is recommended that cron scripts installed in any 25665 of these directories be script files rather than compiled 25666 binaries so that they may be modified by the local system 25667 administrator. Conforming applications may only install cron 25668 scripts which use an interpreter required by this 25669 specification or provided by this or another conforming 25670 application. 25671 25672 This specification does not define the concept of a package 25673 upgrade. Implementations may do different things when 25674 packages are upgraded, including not replacing a cron script 25675 if it marked as a configuration file, particularly if the 25676 cron script appears to have been modified since 25677 installation. In some circumstances, the cron script may not 25678 be removed when the package is uninstalled. Applications 25679 should design their installation procedure and cron scripts 25680 to be robust in the face of such behavior. In particular, 25681 cron scripts should not fail obscurely if run in unexpected 25682 circumstances. Testing for the existence of application 25683 binaries before executing them is suggested. 25684 25685 Future versions of this specification may remove the need to 25686 install file directly into these directories, and instead 25687 abstract the interface to the cron utility in such a way as 25688 to hide the implementation. Please see Future Directions. 25689 25690 If a certain task has to be executed at other than the 25691 predefined frequencies, the package shall install a file 25692 /etc/cron.d/cron-name. The file shall have the same format as 25693 that described for the crontab command in ISO POSIX (2003), 25694 except that there shall be an additional field, username, 25695 before the name of the command to execute. For completeness, 25696 the seven fields shall be: 25697 25698 1. Minute [0,59] 25699 2. Hour [0,23] 25700 3. Day of the month [1,31] 25701 4. Month of the year [1,12] 25702 5. Day of the week [0,6] (with 0=Sunday) 25703 6. Username 25704 7. command [args ...] 25705 25706 This file shall be processed by the system automatically, with 25707 the named command being run at the specified time, as the 25708 specified username. 25709 25710 Applications installing files in these directories shall use 25711 the LSB naming conventions (see File Naming Conventions). 25712 __________________________________________________________ 25713 25714 20.2. Init Script Actions 25715 25716 Conforming applications which need to execute commands on 25717 changes to the system run level (including boot and shutdown), 25718 may install one or more init scripts. Init scripts provided by 25719 conforming applications shall accept a single argument which 25720 selects the action: 25721 25722 start start the service 25723 stop stop the service 25724 restart stop and restart the service if the service is already 25725 running, otherwise start the service 25726 try-restart restart the service if the service is already 25727 running 25728 reload cause the configuration of the service to be reloaded 25729 without actually stopping and restarting the service 25730 force-reload cause the configuration to be reloaded if the 25731 service supports this, otherwise restart the service if it is 25732 running 25733 status print the current status of the service 25734 25735 The start, stop, restart, force-reload, and status actions 25736 shall be supported by all init scripts; the reload and the 25737 try-restart actions are optional. Other init-script actions may 25738 be defined by the init script. 25739 25740 Init scripts shall ensure that they will behave sensibly if 25741 invoked with start when the service is already running, or with 25742 stop when not running, and that they do not kill 25743 similarly-named user processes. The best way to achieve this is 25744 to use the init-script functions provided by 25745 /lib/lsb/init-functions (see Init Script Functions) 25746 25747 If a service reloads its configuration automatically (as in the 25748 case of cron, for example), the reload action of the init 25749 script shall behave as if the configuration was reloaded 25750 successfully. The restart, try-restart, reload and force-reload 25751 actions may be atomic; that is if a service is known not to be 25752 operational after a restart or reload, the script may return an 25753 error without any further action. 25754 25755 Note: This specification does not define the concept of a 25756 package upgrade. Implementations may do different things 25757 when packages are upgraded, including not replacing an init 25758 script if it is marked as a configuration file, particularly 25759 if the file appears to have been modified since 25760 installation. In some circumstances, the init script may not 25761 be removed when the package is uninstalled. Applications 25762 should design their installation procedure and init scripts 25763 to be robust in the face of such behavior. In particular, 25764 init scripts should not fail obscurely if run in unexpected 25765 circumstances. Testing for the existence of application 25766 binaries before executing them is suggested. 25767 25768 If the status action is requested, the init script will return 25769 the following exit status codes. 25770 25771 0 program is running or service is OK 25772 1 program is dead and /var/run pid file exists 25773 2 program is dead and /var/lock lock file exists 25774 3 program is not running 25775 4 program or service status is unknown 25776 5-99 reserved for future LSB use 25777 100-149 reserved for distribution use 25778 150-199 reserved for application use 25779 200-254 reserved 25780 25781 For all other init-script actions, the init script shall return 25782 an exit status of zero if the action was successful. Otherwise, 25783 the exit status shall be non-zero, as defined below. In 25784 addition to straightforward success, the following situations 25785 are also to be considered successful: 25786 25787 * restarting a service (instead of reloading it) with the 25788 force-reload argument 25789 * running start on a service already running 25790 * running stop on a service already stopped or not running 25791 * running restart on a service already stopped or not running 25792 * running try-restart on a service already stopped or not 25793 running 25794 25795 In case of an error while processing any init-script action 25796 except for status, the init script shall print an error message 25797 and exit with a non-zero status code: 25798 25799 1 generic or unspecified error (current practice) 25800 2 invalid or excess argument(s) 25801 3 unimplemented feature (for example, "reload") 25802 4 user had insufficient privilege 25803 5 program is not installed 25804 6 program is not configured 25805 7 program is not running 25806 8-99 reserved for future LSB use 25807 100-149 reserved for distribution use 25808 150-199 reserved for application use 25809 200-254 reserved 25810 25811 Error and status messages should be printed with the logging 25812 functions (see Init Script Functions) log_success_msg(), 25813 log_failure_msg() and log_warning_msg(). Scripts may write to 25814 standard error or standard output, but implementations need not 25815 present text written to standard error/output to the user or do 25816 anything else with it. 25817 25818 Note: Since init scripts may be run manually by a system 25819 administrator with non-standard environment variable values 25820 for PATH, USER, LOGNAME, etc., init scripts should not 25821 depend on the values of these environment variables. They 25822 should set them to some known/default values if they are 25823 needed. 25824 __________________________________________________________ 25825 25826 20.3. Comment Conventions for Init Scripts 25827 25828 Conforming applications may install one or more init scripts. 25829 These init scripts must be activated by invoking the 25830 install_initd command. Prior to package removal, the changes 25831 applied by install_initd must be undone by invoking 25832 remove_initd. See Installation and Removal of Init Scripts for 25833 more details. 25834 25835 install_initd and remove_initd determine actions to take by 25836 decoding a specially formatted block of lines in the script. 25837 This block shall be delimited by the lines 25838 ### BEGIN INIT INFO 25839 ### END INIT INFO 25840 25841 The delimiter lines may contain trailing whitespace, which 25842 shall be ignored. All lines inside the block shall begin with a 25843 hash character '#' in the first column, so the shell interprets 25844 them as comment lines which do not affect operation of the 25845 script. The lines shall be of the form: 25846 # {keyword}: arg1 [arg2...] 25847 25848 with exactly one space character between the '#' and the 25849 keyword, with a single exception. In lines following a line 25850 containing the Description keyword, and until the next keyword 25851 or block ending delimiter is seen, a line where the '#' is 25852 followed by more than one space or a tab character shall be 25853 treated as a continuation of the previous line. 25854 25855 The information extracted from the block is used by the 25856 installation tool or the init-script system to assure that init 25857 scripts are run in the correct order. It is unspecified whether 25858 the information is evaluated only when install_initd runs, when 25859 the init scripts are executed, or both. The information 25860 extracted includes run levels, defined in Run Levels, and boot 25861 facilities, defined in Facility Names. 25862 25863 The following keywords, with their arguments, are defined: 25864 25865 Provides: boot_facility_1 [boot_facility_2...] 25866 boot facilities provided by this init script. When an 25867 init script is run with a start argument, the boot 25868 facility or facilities specified by the Provides keyword 25869 shall be deemed present and hence init scripts which 25870 require those boot facilities should be started later. 25871 When an init script is run with a stop argument, the 25872 boot facilities specified by the Provides keyword are 25873 deemed no longer present. 25874 25875 Required-Start: boot_facility_1 [boot_facility_2...] 25876 facilities which must be available during startup of 25877 this service. The init-script system should insure init 25878 scripts which provide the Required-Start facilities are 25879 started before starting this script. 25880 25881 Required-Stop: boot_facility_1 [boot_facility_2...] 25882 facilities which must be available during the shutdown 25883 of this service. The init-script system should avoid 25884 stopping init scripts which provide the Required-Stop 25885 facilities until this script is stopped. 25886 25887 Should-Start: boot_facility_1 [boot_facility_2...] 25888 facilities which, if present, should be available during 25889 startup of this service. This allows for weak 25890 dependencies which do not cause the service to fail if a 25891 facility is not available. The service may provide 25892 reduced functionality in this situation. Conforming 25893 applications should not rely on the existence of this 25894 feature. 25895 25896 Should-Stop: boot_facility_1 [boot_facility_2...] 25897 facilities which should be available during shutdown of 25898 this service. 25899 25900 Default-Start: run_level_1 [run_level_2...], Default-Stop: 25901 run_level_1 [run_level_2...] 25902 which run levels should by default run the init script 25903 with a start (stop) argument to start (stop) the 25904 services controlled by the init script. 25905 25906 For example, if a service should run in runlevels 3, 4, 25907 and 5 only, specify "Default-Start: 3 4 5" and 25908 "Default-Stop: 0 1 2 6". 25909 25910 Short-Description: short_description 25911 provide a brief description of the actions of the init 25912 script. Limited to a single line of text. 25913 25914 Description: multiline_description 25915 provide a more complete description of the actions of 25916 the init script. May span mulitple lines. In a multiline 25917 description, each continuation line shall begin with a 25918 '#' followed by tab character or a '#' followed by at 25919 least two space characters. The multiline description is 25920 terminated by the first line that does not match this 25921 criteria. 25922 25923 Additional keywords may be defined in future versions of this 25924 specification. Also, implementations may define local 25925 extensions by using the prefix X-implementor. For example, 25926 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 25927 25928 Example: 25929 25930 ### BEGIN INIT INFO 25931 # Provides: lsb-ourdb 25932 # Required-Start: $local_fs $network $remote_fs 25933 # Required-Stop: $local_fs $network $remote_fs 25934 # Default-Start: 2 3 4 5 25935 # Default-Stop: 0 1 6 25936 # Short-Description: start and stop OurDB 25937 # Description: OurDB is a very fast and reliable database 25938 # engine used for illustrating init scripts 25939 ### END INIT INFO 25940 25941 The comment conventions described in this section are only 25942 required for init scripts installed by conforming applications. 25943 Conforming runtime implementations are not required to use this 25944 scheme in their system provided init scripts. 25945 25946 Note: This specification does not require, but is designed 25947 to allow, the development of a system which runs init 25948 scripts in parallel. Hence, enforced-serialization of 25949 scripts is avoided unless it is explicitly necessary. 25950 __________________________________________________________ 25951 25952 20.4. Installation and Removal of Init Scripts 25953 25954 Conforming applications may install one or more initialization 25955 scripts (or init scripts). An init script shall be installed in 25956 /etc/init.d (which may be a symbolic link to another location), 25957 by the package installer. 25958 25959 Note: The requirement to install scripts in /etc/init.d may 25960 be removed in future versions of this specification. See 25961 Host-specific system configuration and Future Directions for 25962 further details. 25963 25964 During the installer's post-install processing phase the 25965 program /usr/lib/lsb/install_initd must be called to activate 25966 the init script. Activation consists of arranging for the init 25967 script to be called in the correct order on system run-level 25968 changes (including system boot and shutdown), based on 25969 dependencies supplied in the init script (see Comment 25970 Conventions for Init Scripts). The install_initd command should 25971 be thought of as a wrapper which hides the implementation 25972 details; how any given implementation arranges for the init 25973 script to be called at the appropriate time is not specified. 25974 25975 Example: if an init script specified "Default-Start: 3 4 5" 25976 and "Default-Stop: 0 1 2 6", install_initd might create 25977 "start" symbolic links with names starting with 'S' in 25978 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 25979 links with names starting with 'K' in /etc/rc0.d, 25980 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 25981 be similar to the System V Init mechanism, but is by no 25982 means the only way this specification could be implemented. 25983 25984 The install_initd command takes a single argument, the full 25985 pathname of the installed init script. The init script must 25986 already be installed in /etc/init.d. The install_initd command 25987 will not copy it there, only activate it once it has been 25988 installed. For example: 25989 25990 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 25991 25992 The install_initd command shall return an exit status of zero 25993 if the init-script activation was successful or if the init 25994 script was already activated. If the dependencies in the init 25995 script (see Comment Conventions for Init Scripts) cannot be 25996 met, an exit status of one shall be returned and the init 25997 script shall not be activated. 25998 25999 When a software package is removed, /usr/lib/lsb/remove_initd 26000 must be called to deactivate the init script. This must occur 26001 before the init script itself is removed, as the dependency 26002 information in the script may be required for successful 26003 completion. Thus the installer's pre-remove processing phase 26004 must call remove_initd, and pass the full pathname of the 26005 installed init script. The package installer is still 26006 responsible for removing the init script. For example: 26007 26008 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 26009 26010 The remove_initd program shall return an exit status of zero if 26011 the init script has been successfully deactivated or if the 26012 init script is not activated. If another init script which 26013 depends on a boot facility provided by this init script is 26014 activated, an exit status of one shall be returned and the init 26015 script shall remain activated. The installer must fail on such 26016 an exit code so it does not subsequently remove the init 26017 script. 26018 26019 Note: This specification does not describe a mechanism for 26020 the system administrator to manipulate the run levels at 26021 which an init script is started or stopped. There is no 26022 assurance that modifying the comment block for this purpose 26023 will have the desired effect. 26024 __________________________________________________________ 26025 26026 20.5. Run Levels 26027 26028 The following run levels are specified for use by the 26029 Default-Start and Default-Stop actions defined in Comment 26030 Conventions for Init Scripts as hints to the install_initd 26031 command. Conforming implementations are not required to provide 26032 these exact run levels or give them the meanings described 26033 here, and may map any level described here to a different level 26034 which provides the equivalent functionality. Applications may 26035 not depend on specific run-level numbers. 26036 26037 0 halt 26038 1 single user mode 26039 2 multiuser with no network services exported 26040 3 normal/full multiuser 26041 4 reserved for local use, default is normal/full multiuser 26042 5 multiuser with a display manager or equivalent 26043 6 reboot 26044 26045 Note: These run levels were chosen as reflecting the most 26046 frequent existing practice, and in the absence of other 26047 considerations, implementors are strongly encouraged to 26048 follow this convention to provide consistency for system 26049 administrators who need to work with multiple distributions. 26050 __________________________________________________________ 26051 26052 20.6. Facility Names 26053 26054 Boot facilities are used to indicate dependencies in 26055 initialization scripts, as defined in Comment Conventions for 26056 Init Scripts. Facility names are assigned to scripts by the 26057 Provides: keyword. Facility names that begin with a dollar sign 26058 ('$') are reserved system facility names. 26059 26060 Note: Facility names are only recognized in the context of 26061 the init script comment block and are not available in the 26062 body of the init script. In particular, the use of the 26063 leading '$' character does not imply system facility names 26064 are subject to shell variable expansion, since they appear 26065 inside comments. 26066 26067 Conforming applications shall not provide facilities that begin 26068 with a dollar sign. Implementations shall provide the following 26069 facility names: 26070 26071 $local_fs 26072 26073 all local file systems are mounted 26074 $network 26075 26076 basic networking support is available. Example: a server 26077 program could listen on a socket. 26078 $named 26079 26080 IP name-to-address translation, using the interfaces described 26081 in this specification, are available to the level the system 26082 normally provides them. Example: if a DNS query daemon normally 26083 provides this facility, then that daemon has been started. 26084 $portmap 26085 26086 daemons providing SunRPC/ONCRPC portmapping service as defined 26087 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 26088 present) are running. 26089 $remote_fs 26090 26091 all remote file systems are available. In some configurations, 26092 file systems such as /usr may be remote. Many applications that 26093 require $local_fs will probably also require $remote_fs. 26094 $syslog 26095 26096 system logger is operational. 26097 $time 26098 26099 the system time has been set, for example by using a 26100 network-based time program such as ntp or rdate, or via the 26101 hardware Real Time Clock. 26102 26103 Other (non-system) facilities may be defined by other 26104 conforming applications. These facilities shall be named using 26105 the same conventions defined for naming init scripts (see 26106 Script Names). Commonly, the facility provided by a conforming 26107 init script will have the same name as the name assigned to the 26108 init script. 26109 __________________________________________________________ 26110 26111 20.7. Script Names 26112 26113 Since init scripts live in a single directory, they must share 26114 a single namespace. To avoid conflicts, applications installing 26115 files in this directories shall use the LSB naming conventions 26116 (see File Naming Conventions). 26117 __________________________________________________________ 26118 26119 20.8. Init Script Functions 26120 26121 Each conforming init script shall execute the commands in the 26122 file /lib/lsb/init-functions in the current environment (see 26123 shell special built-in command dot). This file shall cause the 26124 following shell script commands to be defined in an unspecified 26125 manner. 26126 26127 Note: This can be done either by adding a directory to the 26128 PATH variable which defines these commands, or by defining 26129 shell aliases or functions. 26130 26131 Although the commands made available via this mechanism need 26132 not be conforming applications in their own right, 26133 applications that use them should only depend on features 26134 described in this specification. 26135 26136 Conforming scripts shall not specify the "exit on error" option 26137 (i.e. set -e) when sourcing this file, or calling any of the 26138 commands thus made available. 26139 26140 The start_daemon, killproc and pidofproc functions shall use 26141 the following algorithm for determining the status and the 26142 process identifiers of the specified program. 26143 26144 1. If the -p pidfile option is specified, and the named 26145 pidfile exists, a single line at the start of the pidfile 26146 shall be read. If this line contains one or more numeric 26147 values, separated by spaces, these values shall be used. If 26148 the -p pidfile option is specified and the named pidfile 26149 does not exist, the functions shall assume that the daemon 26150 is not running. 26151 2. Otherwise, /var/run/basename.pid shall be read in a similar 26152 fashion. If this contains one or more numeric values on the 26153 first line, these values shall be used. Optionally, 26154 implementations may use unspecified additional methods to 26155 locate the process identifiers required. 26156 26157 The method used to determine the status is implementation 26158 defined, but should allow for non-binary programs. 26159 26160 Note: Commonly used methods check either for the existence 26161 of the /proc/pid directory or use /proc/pid/exe and 26162 /proc/pid/cmdline. Relying only on /proc/pid/exe is 26163 discouraged since this specification does not specify the 26164 existence of, or semantics for, /proc. Additionally, using 26165 /proc/pid/exe may result in a not-running status for daemons 26166 that are written in a script language. 26167 26168 Conforming implementations may use other mechanisms besides 26169 those based on pidfiles, unless the -p pidfile option has been 26170 used. Conforming applications should not rely on such 26171 mechanisms and should always use a pidfile. When a program is 26172 stopped, it should delete its pidfile. Multiple process 26173 identifiers shall be separated by a single space in the pidfile 26174 and in the output of pidofproc. 26175 26176 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 26177 [args...] 26178 runs the specified program as a daemon. The start_daemon 26179 function shall check if the program is already running 26180 using the algorithm given above. If so, it shall not 26181 start another copy of the daemon unless the -f option is 26182 given. The -n option specifies a nice level. See nice. 26183 start_daemon shall return the LSB defined exit status 26184 codes. It shall return 0 if the program has been 26185 successfully started or is running and not 0 otherwise. 26186 26187 killproc [-p pidfile] pathname [signal] 26188 The killproc function shall stop the specified program. 26189 The program is found using the algorithm given above. If 26190 a signal is specified, using the -signal_name or 26191 -signal_number syntaxes as specified by the kill 26192 command, the program is sent that signal. Otherwise, a 26193 SIGTERM followed by a SIGKILL after an unspecified 26194 number of seconds shall be sent. If a program has been 26195 terminated, the pidfile should be removed if the 26196 terminated process has not already done so. The killproc 26197 function shall return the LSB defined exit status codes. 26198 If called without a signal, it shall return 0 if the 26199 program has been stopped or is not running and not 0 26200 otherwise. If a signal is given, it shall return 0 only 26201 if the program is running. 26202 26203 pidofproc [-p pidfile] pathname 26204 The pidofproc function shall return one or more process 26205 identifiers for a particular daemon using the algorithm 26206 given above. Only process identifiers of running 26207 processes should be returned. Multiple process 26208 identifiers shall be separated by a single space. 26209 26210 Note: A process may exit between pidofproc discovering its 26211 identity and the caller of pidofproc being able to act on 26212 that identity. As a result, no test assertion can be made 26213 that the process identifiers returned by pidofproc shall be 26214 running processes. 26215 26216 The pidofproc function shall return the LSB defined exit 26217 status codes for "status". It shall return 0 if the 26218 program is running and not 0 otherwise. 26219 26220 log_success_msg message 26221 The log_success_msg function shall cause the system to 26222 write a success message to an unspecified log file. The 26223 format of the message is unspecified. The 26224 log_success_msg function may also write a message to the 26225 standard output. 26226 26227 Note: The message should be relatively short; no more than 26228 60 characters is highly desirable. 26229 26230 log_failure_msg message 26231 The log_failure_msg function shall cause the system to 26232 write a failure message to an unspecified log file. The 26233 format of the message is unspecified. The 26234 log_failure_msg function may also write a message to the 26235 standard output. 26236 26237 Note: The message should be relatively short; no more than 26238 60 characters is highly desirable. 26239 26240 log_warning_msg message 26241 The log_warning_msg function shall cause the system to 26242 write a warning message to an unspecified log file. The 26243 format of the message is unspecified. The 26244 log_warning_msg function may also write a message to the 26245 standard output. 26246 26247 Note: The message should be relatively short; no more than 26248 60 characters is highly desirable. 26249 26250 VIII. Users & Groups 26251 26252 Table of Contents 26253 21. Users & Groups 26254 26255 21.1. User and Group Database 26256 21.2. User & Group Names 26257 21.3. User ID Ranges 26258 21.4. Rationale 26259 __________________________________________________________ 26260 26261 Chapter 21. Users & Groups 26262 26263 21.1. User and Group Database 26264 26265 The format of the User and Group databases is not specified. 26266 Programs may only read these databases using the provided API. 26267 Changes to these databases should be made using the provided 26268 commands. 26269 __________________________________________________________ 26270 26271 21.2. User & Group Names 26272 26273 Table 21-1 describes required mnemonic user and group names. 26274 This specification makes no attempt to numerically assign user 26275 or group identity numbers, with the exception that both the 26276 User ID and Group ID for the user root shall be equal to 0. 26277 26278 Table 21-1. Required User & Group Names 26279 User Group Comments 26280 root root Administrative user with all appropriate privileges 26281 bin bin Legacy User ID/Group ID[a] 26282 daemon daemon Legacy User ID/Group ID[b] 26283 Notes: 26284 a. The bin User ID/Group ID is included for compatibility with 26285 legacy applications. New applications should no longer use the 26286 bin User ID/Group ID. 26287 b. The daemon User ID/Group ID was used as an unprivileged User 26288 ID/Group ID for daemons to execute under in order to limit 26289 their access to the system. Generally daemons should now run 26290 under individual User ID/Group IDs in order to further 26291 partition daemons from one another. 26292 26293 Table 21-2 is a table of optional mnemonic user and group 26294 names. This specification makes no attempt to numerically 26295 assign uid or gid numbers. If the username exists on a system, 26296 then they should be in the suggested corresponding group. These 26297 user and group names are for use by distributions, not by 26298 applications. 26299 26300 Table 21-2. Optional User & Group Names 26301 User Group Comments 26302 adm adm Administrative special privileges 26303 lp lp Printer special privileges 26304 sync sync Login to sync the system 26305 shutdown shutdown Login to shutdown the system 26306 halt halt Login to halt the system 26307 mail mail Mail special privileges 26308 news news News special privileges 26309 uucp uucp UUCP special privileges 26310 operator root Operator special privileges 26311 man man Man special privileges 26312 nobody nobody Used by NFS 26313 26314 Only a minimum working set of "user names" and their 26315 corresponding "user groups" are required. Applications cannot 26316 assume non system user or group names will be defined. 26317 26318 Applications cannot assume any policy for the default file 26319 creation mask (umask) or the default directory permissions a 26320 user may have. Applications should enforce user only file 26321 permissions on private files such as mailboxes. The location of 26322 the users home directory is also not defined by policy other 26323 than the recommendations of the Filesystem Hierarchy Standard 26324 and should be obtained by the getpwnam(), getpwnam_r(), 26325 getpwent(), getpwuid(), and getpwuid_r() functions. 26326 __________________________________________________________ 26327 26328 21.3. User ID Ranges 26329 26330 The system User IDs from 0 to 99 should be statically allocated 26331 by the system, and shall not be created by applications. 26332 26333 The system User IDs from 100 to 499 should be reserved for 26334 dynamic allocation by system administrators and post install 26335 scripts using useradd. 26336 __________________________________________________________ 26337 26338 21.4. Rationale 26339 26340 The purpose of specifying optional users and groups is to 26341 reduce the potential for name conflicts between applications 26342 and distributions. 26343 26344 IX. Package Format and Installation 26345 26346 Table of Contents 26347 22. Software Installation 26348 26349 22.1. Introduction 26350 22.2. Package File Format 26351 26352 22.2.1. Lead Section 26353 22.2.2. Header Structure 26354 22.2.3. Signature Section 26355 22.2.4. Header Section 26356 22.2.5. Payload Section 26357 26358 22.3. Package Script Restrictions 26359 22.4. Package Tools 26360 22.5. Package Naming 26361 22.6. Package Dependencies 26362 22.7. Package Architecture Considerations 26363 __________________________________________________________ 26364 26365 Chapter 22. Software Installation 26366 26367 22.1. Introduction 26368 26369 Applications shall either be packaged in the RPM packaging 26370 format as defined in this specification, or supply an installer 26371 which is LSB conforming (for example, calls LSB commands and 26372 utilities). 26373 26374 Note: Supplying an RPM format package is encouraged because 26375 it makes systems easier to manage. This specification does 26376 not require the implementation to use RPM as the package 26377 manager; it only specifies the format of the package file. 26378 26379 Applications are also encouraged to uninstall cleanly. 26380 26381 A package in RPM format may include a dependency on the LSB 26382 Core and other LSB specifications, as described in Section 26383 22.6. Packages that are not in RPM format may test for the 26384 presence of a conforming implementation by means of the 26385 lsb_release utility. 26386 26387 Implementations shall provide a mechanism for installing 26388 applications in this packaging format with some restrictions 26389 listed below. 26390 26391 Note: The implementation itself may use a different 26392 packaging format for its own packages, and of course it may 26393 use any available mechanism for installing the 26394 LSB-conformant packages. 26395 __________________________________________________________ 26396 26397 22.2. Package File Format 26398 26399 An RPM format file consists of 4 sections, the Lead, Signature, 26400 Header, and the Payload. All values are stored in network byte 26401 order. 26402 26403 Table 22-1. RPM File Format 26404 Lead 26405 Signature 26406 Header 26407 Payload 26408 26409 These 4 sections shall exist in the order specified. 26410 26411 The lead section is used to identify the package file. 26412 26413 The signature section is used to verify the integrity, and 26414 optionally, the authenticity of the majority of the package 26415 file. 26416 26417 The header section contains all available information about the 26418 package. Entries such as the package's name, version, and file 26419 list, are contained in the header. 26420 26421 The payload section holds the files to be installed. 26422 __________________________________________________________ 26423 26424 22.2.1. Lead Section 26425 26426 struct rpmlead { 26427 unsigned char magic[4]; 26428 unsigned char major, minor; 26429 short type; 26430 short archnum; 26431 char name[66]; 26432 short osnum; 26433 short signature_type; 26434 char reserved[16]; 26435 } ; 26436 26437 magic 26438 26439 Value identifying this file as an RPM format file. This value 26440 shall be "\355\253\356\333". 26441 major 26442 26443 Value indicating the major version number of the file format 26444 version. This value shall be 3. 26445 minor 26446 26447 Value indicating the minor revision number of file format 26448 version. This value shall be 0. 26449 type 26450 26451 Value indicating whether this is a source or binary package. 26452 This value shall be 0 to indicate a binary package. 26453 archnum 26454 26455 Value indicating the architecture for which this package is 26456 valid. This value is specified in the relevant architecture 26457 specific part of ISO/IEC 23360. 26458 name 26459 26460 A NUL terminated string that provides the package name. This 26461 name shall conform with the Package Naming section of this 26462 specification. 26463 osnum 26464 26465 Value indicating the Operating System for which this package is 26466 valid. This value shall be 1. 26467 signature_type 26468 26469 Value indicating the type of the signature used in the 26470 Signature part of the file. This value shall be 5. 26471 reserved 26472 26473 Reserved space. The value is undefined. 26474 __________________________________________________________ 26475 26476 22.2.2. Header Structure 26477 26478 The Header structure is used for both the Signature and Header 26479 Sections. A Header Structure consists of 3 parts, a Header 26480 record, followed by 1 or more Index records, followed by 0 or 26481 more bytes of data associated with the Index records. A Header 26482 structure shall be aligned to an 8 byte boundary. 26483 26484 Table 22-2. Signature Format 26485 Header Record 26486 Array of Index Records 26487 Store of Index Values 26488 __________________________________________________________ 26489 26490 22.2.2.1. Header Record 26491 26492 struct rpmheader { 26493 unsigned char magic[4]; 26494 unsigned char reserved[4]; 26495 int nindex; 26496 int hsize; 26497 } ; 26498 26499 magic 26500 26501 Value identifying this record as an RPM header record. This 26502 value shall be "\216\255\350\001". 26503 reserved 26504 26505 Reserved space. This value shall be "\000\000\000\000". 26506 nindex 26507 26508 The number of Index Records that follow this Header Record. 26509 There should be at least 1 Index Record. 26510 hsize 26511 26512 The size in bytes of the storage area for the data pointed to 26513 by the Index Records. 26514 __________________________________________________________ 26515 26516 22.2.2.2. Index Record 26517 26518 struct rpmhdrindex { 26519 int tag; 26520 int type; 26521 int offset; 26522 int count; 26523 } ; 26524 26525 tag 26526 26527 Value identifying the purpose of the data associated with this 26528 Index Record. The value of this field is dependent on the 26529 context in which the Index Record is used, and is defined below 26530 and in later sections. 26531 type 26532 26533 Value identifying the type of the data associated with this 26534 Index Record. The possible type values are defined below. 26535 offset 26536 26537 Location in the Store of the data associated with this Index 26538 Record. This value should between 0 and the value contained in 26539 the hsize of the Header Structure. 26540 count 26541 26542 Size of the data associated with this Index Record. The count 26543 is the number of elements whose size is defined by the type of 26544 this Record. 26545 __________________________________________________________ 26546 26547 22.2.2.2.1. Index Type Values 26548 26549 The possible values for the type field are defined in this 26550 table. 26551 26552 Table 22-3. Index Type values 26553 Type Value Size (in bytes) Alignment 26554 RPM_NULL_TYPE 0 Not Implemented. 26555 RPM_CHAR_TYPE 1 1 1 26556 RPM_INT8_TYPE 2 1 1 26557 RPM_INT16_TYPE 3 2 2 26558 RPM_INT32_TYPE 4 4 4 26559 RPM_INT64_TYPE 5 Reserved. 26560 RPM_STRING_TYPE 6 variable, NUL terminated 1 26561 RPM_BIN_TYPE 7 1 1 26562 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 26563 strings 1 26564 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 26565 strings 1 26566 26567 The string arrays specified for entries of type 26568 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 26569 strings in a contiguous block of memory, each element separated 26570 from its neighbors by a NUL character. 26571 26572 Index records with type RPM_I18NSTRING_TYPE shall always have a 26573 count of 1. The array entries in an index of type 26574 RPM_I18NSTRING_TYPE correspond to the locale names contained in 26575 the RPMTAG_HDRI18NTABLE index. 26576 __________________________________________________________ 26577 26578 22.2.2.2.2. Index Tag Values 26579 26580 Some values are designated as header private, and may appear in 26581 any header structure. These are defined here. Additional values 26582 are defined in later sections. 26583 26584 Table 22-4. Header Private Tag Values 26585 Name Tag Value Type Count Status 26586 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 26587 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 26588 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Optional 26589 26590 RPMTAG_HEADERSIGNATURES 26591 The signature tag differentiates a signature header from 26592 a metadata header, and identifies the original contents 26593 of the signature header. 26594 26595 RPMTAG_HEADERIMMUTABLE 26596 This tag contains an index record which specifies the 26597 portion of the Header Record which was used for the 26598 calculation of a signature. This data shall be preserved 26599 or any header-only signature will be invalidated. 26600 26601 RPMTAG_HEADERI18NTABLE 26602 Contains a list of locales for which strings are 26603 provided in other parts of the package. 26604 26605 Not all Index records defined here will be present in all 26606 packages. Each tag value has a status which is defined here. 26607 26608 Required 26609 26610 This Index Record shall be present. 26611 Optional 26612 26613 This Index Record may be present. 26614 Informational 26615 26616 This Index Record may be present, but does not contribute to 26617 the processing of the package. 26618 Deprecated 26619 26620 This Index Record should not be present. 26621 Obsolete 26622 26623 This Index Record shall not be present. 26624 Reserved 26625 26626 This Index Record shall not be present. 26627 __________________________________________________________ 26628 26629 22.2.2.3. Header Store 26630 26631 The header store contains the values specified by the Index 26632 structures. These values are aligned according to their type 26633 and padding is used if needed. The store is located immediately 26634 following the Index structures. 26635 __________________________________________________________ 26636 26637 22.2.3. Signature Section 26638 26639 The Signature section is implemented using the Header 26640 structure. The signature section defines the following 26641 additional tag values which may be used in the Index 26642 structures. 26643 26644 These values exist to provide additional information about the 26645 rest of the package. 26646 26647 Table 22-5. Signature Tag Values 26648 Name Tag Value Type Count Status 26649 RPMSIGTAG_SIZE 1000 INT32 1 Required 26650 RPMSIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 26651 26652 RPMSIGTAG_SIZE 26653 This tag specifies the combined size of the Header and 26654 Payload sections. 26655 26656 RPMSIGTAG_PAYLOADSIZE 26657 This tag specifies the uncompressed size of the Payload 26658 archive, including the cpio headers. 26659 26660 These values exist to ensure the integrity of the rest of the 26661 package. 26662 26663 Table 22-6. Signature Digest Tag Values 26664 Name Tag Value Type Count Status 26665 RPMSIGTAG_SHA1 269 STRING 1 Optional 26666 RPMSIGTAG_MD5 1004 BIN 16 Required 26667 26668 RPMSIGTAG_SHA1 26669 26670 This index contains the SHA1 checksum of the entire Header 26671 Section, including the Header Record, Index Records and Header 26672 store. 26673 RPMSIGTAG_MD5 26674 26675 This tag specifies the 128-bit MD5 checksum of the combined 26676 Header and Archive sections. 26677 26678 These values exist to provide authentication of the package. 26679 26680 Table 22-7. Signature Signing Tag Values 26681 Name Tag Value Type Count Status 26682 RPMSIGTAG_DSA 267 BIN 65 Optional 26683 RPMSIGTAG_RSA 268 BIN 1 Optional 26684 RPMSIGTAG_PGP 1002 BIN 1 Optional 26685 RPMSIGTAG_GPG 1005 BIN 65 Optional 26686 26687 RPMSIGTAG_DSA 26688 26689 The tag contains the DSA signature of the Header section. The 26690 data is formatted as a Version 3 Signature Packet as specified 26691 in RFC 2440: OpenPGP Message Format. If this tag is present, 26692 then the SIGTAG_GPG tag shall also be present. 26693 RPMSIGTAG_RSA 26694 26695 The tag contains the RSA signature of the Header section.The 26696 data is formatted as a Version 3 Signature Packet as specified 26697 in RFC 2440: OpenPGP Message Format. If this tag is present, 26698 then the SIGTAG_PGP shall also be present. 26699 RPMSIGTAG_PGP 26700 26701 This tag specifies the RSA signature of the combined Header and 26702 Payload sections. The data is formatted as a Version 3 26703 Signature Packet as specified in RFC 2440: OpenPGP Message 26704 Format. 26705 RPMSIGTAG_GPG 26706 26707 The tag contains the DSA signature of the combined Header and 26708 Payload sections. The data is formatted as a Version 3 26709 Signature Packet as specified in RFC 2440: OpenPGP Message 26710 Format. 26711 __________________________________________________________ 26712 26713 22.2.4. Header Section 26714 26715 The Header section is implemented using the Header structure. 26716 The Header section defines the following additional tag values 26717 which may be used in the Index structures. 26718 __________________________________________________________ 26719 26720 22.2.4.1. Package Information 26721 26722 The following tag values are used to indicate information that 26723 describes the package as a whole. 26724 26725 Table 22-8. Package Info Tag Values 26726 Name Tag Value Type Count Status 26727 RPMTAG_NAME 1000 STRING 1 Required 26728 RPMTAG_VERSION 1001 STRING 1 Required 26729 RPMTAG_RELEASE 1002 STRING 1 Required 26730 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 26731 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 26732 RPMTAG_SIZE 1009 INT32 1 Required 26733 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 26734 RPMTAG_VENDOR 1011 STRING 1 Informational 26735 RPMTAG_LICENSE 1014 STRING 1 Required 26736 RPMTAG_PACKAGER 1015 STRING 1 Informational 26737 RPMTAG_GROUP 1016 I18NSTRING 1 Required 26738 RPMTAG_URL 1020 STRING 1 Informational 26739 RPMTAG_OS 1021 STRING 1 Required 26740 RPMTAG_ARCH 1022 STRING 1 Required 26741 RPMTAG_SOURCERPM 1044 STRING 1 Informational 26742 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 26743 RPMTAG_RPMVERSION 1064 STRING 1 Informational 26744 RPMTAG_COOKIE 1094 STRING 1 Optional 26745 RPMTAG_DISTURL 1123 STRING 1 Informational 26746 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 26747 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 26748 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 26749 26750 RPMTAG_NAME 26751 This tag specifies the name of the package. 26752 26753 RPMTAG_VERSION 26754 This tag specifies the version of the package. 26755 26756 RPMTAG_RELEASE 26757 This tag specifies the release of the package. 26758 26759 RPMTAG_SUMMARY 26760 This tag specifies the summary description of the 26761 package. The summary value pointed to by this index 26762 record contains a one line description of the package. 26763 26764 RPMTAG_DESCRIPTION 26765 This tag specifies the description of the package. The 26766 description value pointed to by this index record 26767 contains a full desription of the package. 26768 26769 RPMTAG_SIZE 26770 This tag specifies the sum of the sizes of the regular 26771 files in the archive. 26772 26773 RPMTAG_DISTRIBUTION 26774 A string containing the name of the distribution on 26775 which the package was built. 26776 26777 RPMTAG_VENDOR 26778 A string containing the name of the organization that 26779 produced the package. 26780 26781 RPMTAG_LICENSE 26782 This tag specifies the license which applies to this 26783 package. 26784 26785 RPMTAG_PACKAGER 26786 A string identifying the tool used to build the package. 26787 26788 RPMTAG_GROUP 26789 This tag specifies the administrative group to which 26790 this package belongs. 26791 26792 RPMTAG_URL 26793 Generic package information URL. 26794 26795 RPMTAG_OS 26796 This tag specifies the OS of the package. The OS value 26797 pointed to by this index record shall be "linux". 26798 26799 RPMTAG_ARCH 26800 This tag specifies the architecture of the package. The 26801 architecture value pointed to by this index record is 26802 defined in architecture specific LSB specification. 26803 26804 RPMTAG_SOURCERPM 26805 This tag specifies the name of the source RPM. 26806 26807 RPMTAG_ARCHIVESIZE 26808 This tag specifies the uncompressed size of the Payload 26809 archive, including the cpio headers. 26810 26811 RPMTAG_RPMVERSION 26812 This tag indicates the version of RPM tool used to build 26813 this package. The value is unused. 26814 26815 RPMTAG_COOKIE 26816 This tag contains an opaque string whose contents are 26817 undefined. 26818 26819 RPMTAG_DISTURL 26820 URL for package. 26821 26822 RPMTAG_PAYLOADFORMAT 26823 This tag specifies the format of the Archive section. 26824 The format value pointed to by this index record shall 26825 be 'cpio'. 26826 26827 RPMTAG_PAYLOADCOMPRESSOR 26828 This tag specifies the compression used on the Archive 26829 section. The compression value pointed to by this index 26830 record shall be 'gzip'. 26831 26832 RPMTAG_PAYLOADFLAGS 26833 This tag indicates the compression level used for the 26834 Payload. This value shall always be '9'. 26835 __________________________________________________________ 26836 26837 22.2.4.2. Installation Information 26838 26839 The following tag values are used to provide information needed 26840 during the installation of the package. 26841 26842 Table 22-9. Installation Tag Values 26843 Name Tag Value Type Count Status 26844 RPMTAG_PREIN 1023 STRING 1 Optional 26845 RPMTAG_POSTIN 1024 STRING 1 Optional 26846 RPMTAG_PREUN 1025 STRING 1 Optional 26847 RPMTAG_POSTUN 1026 STRING 1 Optional 26848 RPMTAG_PREINPROG 1085 STRING 1 Optional 26849 RPMTAG_POSTINPROG 1086 STRING 1 Optional 26850 RPMTAG_PREUNPROG 1087 STRING 1 Optional 26851 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 26852 26853 RPMTAG_PREIN 26854 26855 This tag specifies the preinstall scriptlet. If present, then 26856 RPMTAG_PREINPROG shall also be present. 26857 RPMTAG_POSTIN 26858 26859 This tag specifies the postinstall scriptlet. If present, then 26860 RPMTAG_POSTINPROG shall also be present. 26861 RPMTAG_PREUN 26862 26863 his tag specifies the preuninstall scriptlet. If present, then 26864 RPMTAG_PREUNPROG shall also be present. 26865 RPMTAG_POSTUN 26866 26867 This tag specified the postuninstall scriptlet. If present, 26868 then RPMTAG_POSTUNPROG shall also be present. 26869 RPMTAG_PREINPROG 26870 26871 This tag specifies the name of the intepreter to which the 26872 preinstall scriptlet will be passed. The intepreter pointed to 26873 by this index record shall be /bin/sh. 26874 RPMTAG_POSTINPROG 26875 26876 This tag specifies the name of the intepreter to which the 26877 postinstall scriptlet will be passed. The intepreter pointed to 26878 by this index record shall be /bin/sh. 26879 RPMTAG_PREUNPROG 26880 26881 This tag specifies the name of the intepreter to which the 26882 preuninstall scriptlet will be passed. The intepreter pointed 26883 to by this index record shall be /bin/sh. 26884 RPMTAG_POSTUNPROG 26885 26886 This program specifies the name of the intepreter to which the 26887 postuninstall scriptlet will be passed. The intepreter pointed 26888 to by this index record shall be /bin/sh. 26889 __________________________________________________________ 26890 26891 22.2.4.3. File Information 26892 26893 The following tag values are used to provide information about 26894 the files in the payload. This information is provided in the 26895 header to allow more efficient access of the information. 26896 26897 Table 22-10. File Info Tag Values 26898 Name Tag Value Type Count Status 26899 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 26900 RPMTAG_FILESIZES 1028 INT32 Required 26901 RPMTAG_FILEMODES 1030 INT16 Required 26902 RPMTAG_FILERDEVS 1033 INT16 Required 26903 RPMTAG_FILEMTIMES 1034 INT32 Required 26904 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 26905 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 26906 RPMTAG_FILEFLAGS 1037 INT32 Required 26907 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 26908 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 26909 RPMTAG_FILEDEVICES 1095 INT32 Required 26910 RPMTAG_FILEINODES 1096 INT32 Required 26911 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 26912 RPMTAG_DIRINDEXES 1116 INT32 Optional 26913 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 26914 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 26915 26916 RPMTAG_OLDFILENAMES 26917 26918 This tag specifies the filenames when not in a compressed 26919 format as determined by the absence of 26920 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME index. 26921 RPMTAG_FILESIZES 26922 26923 This tag specifies the size of each file in the archive. 26924 RPMTAG_FILEMODES 26925 26926 This tag specifies the mode of each file in the archive. 26927 RPMTAG_FILERDEVS 26928 26929 This tag specifies the device number from which the file was 26930 copied. 26931 RPMTAG_FILEMTIMES 26932 26933 This tag specifies the modification time in seconds since the 26934 epoch of each file in the archive. 26935 RPMTAG_FILEMD5S 26936 26937 This tag specifies the ASCII representation of the MD5 sum of 26938 the corresponding file contents. This value is empty if the 26939 corresponding archive entry is not a regular file. 26940 RPMTAG_FILELINKTOS 26941 26942 The target for a symlink, otherwise NULL. 26943 RPMTAG_FILEFLAGS 26944 26945 This tag specifies the bit(s) to classify and control how files 26946 are to be installed. See below. 26947 RPMTAG_FILEUSERNAME 26948 26949 This tag specifies the owner of the corresponding file. 26950 RPMTAG_FILEGROUPNAME 26951 26952 This tag specifies the group of the corresponding file. 26953 RPMTAG_FILEDEVICES 26954 26955 This tag specifies the 16 bit device number from which the file 26956 was copied. 26957 RPMTAG_FILEINODES 26958 26959 This tag specifies the inode value from the original file 26960 system on the the system on which it was built. 26961 RPMTAG_FILELANGS 26962 26963 This tag specifies a per-file locale marker used to install 26964 only locale specific subsets of files when the package is 26965 installed. 26966 RPMTAG_DIRINDEXES 26967 26968 This tag specifies the index into the array provided by the 26969 RPMTAG_DIRNAMES Index which contains the directory name for the 26970 corresponding filename. 26971 RPMTAG_BASENAMES 26972 26973 This tag specifies the base portion of the corresponding 26974 filename. 26975 RPMTAG_DIRNAMES 26976 26977 One of RPMTAG_OLDFILENAMES or the tuple 26978 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 26979 present, but not both. 26980 __________________________________________________________ 26981 26982 22.2.4.3.1. File Flags 26983 26984 The RPMTAG_FILEFLAGS tag value shall identify various 26985 characteristics of the file in the payload that it describes. 26986 It shall be an INT32 value consisting of either the value 26987 RPMFILE_NONE (0) or the bitwise inclusive or of one or more of 26988 the following values: 26989 26990 Table 22-11. File Flags 26991 Name Value 26992 RPMFILE_CONFIG (1 << 0) 26993 RPMFILE_DOC (1 << 1) 26994 RPMFILE_DONOTUSE (1 << 2) 26995 RPMFILE_MISSINGOK (1 << 3) 26996 RPMFILE_NOREPLACE (1 << 4) 26997 RPMFILE_SPECFILE (1 << 5) 26998 RPMFILE_GHOST (1 << 6) 26999 RPMFILE_LICENSE (1 << 7) 27000 RPMFILE_README (1 << 8) 27001 RPMFILE_EXCLUDE (1 << 9) 27002 27003 These bits have the following meaning: 27004 27005 RPMFILE_CONFIG 27006 27007 The file is a configuration file, and an existing file should 27008 be saved during a package upgrade operation and not removed 27009 during a pakage removal operation. 27010 RPMFILE_DOC 27011 27012 The file contains documentation. 27013 RPMFILE_DONOTUSE 27014 27015 This value is reserved for future use; conforming packages may 27016 not use this flag. 27017 RPMFILE_MISSINGOK 27018 27019 The file need not exist on the installed system. 27020 RPMFILE_NOREPLACE 27021 27022 Similar to the RPMFILE_CONFIG, this flag indicates that during 27023 an upgrade operation the original file on the system should not 27024 be altered. 27025 RPMFILE_SPECFILE 27026 27027 The file is a package specification. 27028 RPMFILE_GHOST 27029 27030 The file is not actually included in the payload, but should 27031 still be considered as a part of the package. For example, a 27032 log file generated by the application at run time. 27033 RPMFILE_LICENSE 27034 27035 The file contains the license conditions. 27036 RPMFILE_README 27037 27038 The file contains high level notes about the package. 27039 RPMFILE_EXCLUDE 27040 27041 The corresponding file is not a part of the package, and should 27042 not be installed. 27043 __________________________________________________________ 27044 27045 22.2.4.4. Dependency Information 27046 27047 The following tag values are used to provide information about 27048 interdependencies between packages. 27049 27050 Table 22-12. Package Dependency Tag Values 27051 Name Tag Value Type Count Status 27052 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 27053 RPMTAG_REQUIREFLAGS 1048 INT32 Required 27054 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 27055 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 27056 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 27057 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 27058 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 27059 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 27060 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 27061 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 27062 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 27063 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 27064 27065 RPMTAG_PROVIDENAME 27066 This tag indicates the name of the dependency provided 27067 by this package. 27068 27069 RPMTAG_REQUIREFLAGS 27070 Bits(s) to specify the dependency range and context. 27071 27072 RPMTAG_REQUIRENAME 27073 This tag indicates the dependencies for this package. 27074 27075 RPMTAG_REQUIREVERSION 27076 This tag indicates the versions associated with the 27077 values found in the RPMTAG_REQUIRENAME Index. 27078 27079 RPMTAG_CONFLICTFLAGS 27080 Bits(s) to specify the conflict range and context. 27081 27082 RPMTAG_CONFLICTNAME 27083 This tag indicates the conflicting dependencies for this 27084 package. 27085 27086 RPMTAG_CONFLICTVERSION 27087 This tag indicates the versions associated with the 27088 values found in the RPMTAG_CONFLICTNAME Index. 27089 27090 RPMTAG_OBSOLETENAME 27091 This tag indicates the obsoleted dependencies for this 27092 package. 27093 27094 RPMTAG_PROVIDEFLAGS 27095 Bits(s) to specify the conflict range and context. 27096 27097 RPMTAG_PROVIDEVERSION 27098 This tag indicates the versions associated with the 27099 values found in the RPMTAG_PROVIDENAME Index. 27100 27101 RPMTAG_OBSOLETEFLAGS 27102 Bits(s) to specify the conflict range and context. 27103 27104 RPMTAG_OBSOLETEVERSION 27105 This tag indicates the versions associated with the 27106 values found in the RPMTAG_OBSOLETENAME Index. 27107 __________________________________________________________ 27108 27109 22.2.4.4.1. Package Dependency Values 27110 27111 The package dependencies are stored in the RPMTAG_REQUIRENAME 27112 and RPMTAG_REQUIREVERSION index records. The following values 27113 may be used. 27114 27115 Table 22-13. Index Type values 27116 Name Version Meaning Status 27117 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 27118 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 27119 RPMTAG_PREREQ records that have a version associated with them. 27120 Optional 27121 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames in 27122 the Archive have had "." prepended to them. Optional 27123 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 27124 filenames in the Payload are represented in the 27125 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES indexes. 27126 Optional 27127 /bin/sh Interpreter usually required for installation 27128 scripts. Optional 27129 27130 Additional dependencies are specified in the Package 27131 Dependencies section of this specification, and in the relevant 27132 architecture specific part of ISO/IEC 23360. 27133 __________________________________________________________ 27134 27135 22.2.4.4.2. Package Dependencies Attributes 27136 27137 The package dependency attributes are stored in the 27138 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 27139 RPMTAG_OBSOLETEFLAGS index records. The following values may be 27140 used. 27141 27142 Table 22-14. Package Dependency Attributes 27143 Name Value Meaning 27144 RPMSENSE_LESS 0x02 27145 RPMSENSE_GREATER 0x04 27146 RPMSENSE_EQUAL 0x08 27147 RPMSENSE_PREREQ 0x40 27148 RPMSENSE_INTERP 0x100 27149 RPMSENSE_SCRIPT_PRE 0x200 27150 RPMSENSE_SCRIPT_POST 0x400 27151 RPMSENSE_SCRIPT_PREUN 0x800 27152 RPMSENSE_SCRIPT_POSTUN 0x1000 27153 RPMSENSE_RPMLIB 0x1000000 27154 __________________________________________________________ 27155 27156 22.2.4.5. Other Information 27157 27158 The following tag values are also found in the Header section. 27159 27160 Table 22-15. Other Tag Values 27161 Name Tag Value Type Count Status 27162 RPMTAG_BUILDTIME 1006 INT32 1 Informational 27163 RPMTAG_BUILDHOST 1007 STRING 1 Informational 27164 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 27165 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 27166 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 27167 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 27168 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 27169 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 27170 RPMTAG_PLATFORM 1132 STRING 1 Informational 27171 27172 RPMTAG_BUILDTIME 27173 This tag specifies the time as seconds since the epoch 27174 at which the package was built. 27175 27176 RPMTAG_BUILDHOST 27177 This tag specifies the hostname of the system on which 27178 which the package was built. 27179 27180 RPMTAG_FILEVERIFYFLAGS 27181 This tag specifies the bit(s) to control how files are 27182 to be verified after install, specifying which checks 27183 should be performed. 27184 27185 RPMTAG_CHANGELOGTIME 27186 This tag specifies the Unix time in seconds since the 27187 epoch associated with each entry in the Changelog file. 27188 27189 RPMTAG_CHANGELOGNAME 27190 This tag specifies the name of who made a change to this 27191 package. 27192 27193 RPMTAG_CHANGELOGTEXT 27194 This tag specifies the changes asssociated with a 27195 changelog entry. 27196 27197 RPMTAG_OPTFLAGS 27198 This tag indicates additional flags which may have been 27199 passed to the compiler when building this package. 27200 27201 RPMTAG_RHNPLATFORM 27202 This tag contains an opaque string whose contents are 27203 undefined. 27204 27205 RPMTAG_PLATFORM 27206 This tag contains an opaque string whose contents are 27207 undefined. 27208 __________________________________________________________ 27209 27210 22.2.5. Payload Section 27211 27212 The Payload section contains a compressed cpio archive. The 27213 format of this section is defined by RFC 1952: GZIP File Format 27214 Specification. 27215 27216 When uncompressed, the cpio archive contains a sequence of 27217 records for each file. Each record contains a CPIO Header, 27218 Filename, Padding, and File Data. 27219 27220 Table 22-16. CPIO File Format 27221 CPIO Header Header structure as defined below. 27222 Filename NUL terminated ASCII string containing the name of the 27223 file. 27224 Padding 0-3 bytes as needed to align the file stream to a 4 27225 byte boundary. 27226 File data The contents of the file. 27227 Padding 0-3 bytes as needed to align the file stream to a 4 27228 byte boundary. 27229 27230 The CPIO Header uses the following header structure (sometimes 27231 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 27232 stored as ASCII representations of their hexadecimal value with 27233 leading zeros as needed to fill the field. With the exception 27234 of c_namesize and the corresponding name string, and 27235 c_checksum, all information contained in the CPIO Header is 27236 also represented in the Header Section. The values in the CPIO 27237 Header shall match the values contained in the Header Section. 27238 struct { 27239 char c_magic[6]; 27240 char c_ino[8]; 27241 char c_mode[8]; 27242 char c_uid[8]; 27243 char c_gid[8]; 27244 char c_nlink[8]; 27245 char c_mtime[8]; 27246 char c_filesize[8]; 27247 char c_devmajor[8]; 27248 char c_devminor[8]; 27249 char c_rdevmajor[8]; 27250 char c_rdevminor[8]; 27251 char c_namesize[8]; 27252 char c_checksum[8]; 27253 }; 27254 27255 c_magic 27256 27257 Value identifying this cpio format. This value shall be 27258 "070701". 27259 c_ino 27260 27261 This field contains the inode number from the filesystem from 27262 which the file was read. This field is ignored when installing 27263 a package. This field shall match the corresponding value in 27264 the RPMTAG_FILEINODES index in the Header section. 27265 c_mode 27266 27267 Permission bits of the file. This is an ascii representation of 27268 the hexadecimal number representing the bit as defined for the 27269 st_mode field of the stat structure defined for the stat 27270 function. This field shall match the corresponding value in the 27271 RPMTAG_FILEMODES index in the Header section. 27272 c_uid 27273 27274 Value identifying this owner of this file. This value matches 27275 the uid value of the corresponding user in the 27276 RPMTAG_FILEUSERNAME as found on the system where this package 27277 was built. The username specified in RPMTAG_FILEUSERNAME should 27278 take precedence when installing the package. 27279 c_gid 27280 27281 Value identifying this group of this file. This value matches 27282 the gid value of the corresponding user in the 27283 RPMTAG_FILEGROUPNAME as found on the system where this package 27284 was built. The groupname specified in RPMTAG_FILEGROUPNAME 27285 should take precedence when installing the package. 27286 c_nlink 27287 27288 Value identifying the number of links associated with this 27289 file. If the value is greater than 1, then this filename will 27290 be linked to 1 or more files in this archive that has a 27291 matching value for the c_ino, c_devmajor and c_devminor fields. 27292 c_mtime 27293 27294 Value identifying the modification time of the file when it was 27295 read. This field shall match the corresponding value in the 27296 RPMTAG_FILEMTIMES index in the Header section. 27297 c_filesize 27298 27299 Value identifying the size of the file. This field shall match 27300 the corresponding value in the RPMTAG_FILESIZES index in the 27301 Header section. 27302 c_devmajor 27303 27304 The major number of the device containing the file system from 27305 which the file was read. With the exception of processing files 27306 with c_nlink >1, this field is ignored when installing a 27307 package. This field shall match the corresponding value in the 27308 RPMTAG_FILEDEVICES index in the Header section. 27309 c_devminor 27310 27311 The minor number of the device containing the file system from 27312 which the file was read. With the exception of processing files 27313 with c_nlink >1, this field is ignored when installing a 27314 package. This field shall match the corresponding value in the 27315 RPMTAG_FILEDEVICES index in the Header section. 27316 c_rdevmajor 27317 27318 The major number of the raw device containing the file system 27319 from which the file was read. This field is ignored when 27320 installing a package. This field shall match the corresponding 27321 value in the RPMTAG_RDEVS index in the Header section. 27322 c_rdevminor 27323 27324 The minor number of the raw device containing the file system 27325 from which the file was read. This field is ignored when 27326 installing a package. This field shall match the corresponding 27327 value in the RPMTAG_RDEVS index in the Header section. 27328 c_namesize 27329 27330 Value identifying the length of the filename, which is located 27331 immediately following the CPIO Header structure. 27332 c_checksum 27333 27334 Value containing the CRC checksum of the file data. This field 27335 is not used, and shall contain the value "00000000". This field 27336 is ignored when installing a package. 27337 27338 A record with the filename "TRAILER!!!" indicates the last 27339 record in the archive. 27340 __________________________________________________________ 27341 27342 22.3. Package Script Restrictions 27343 27344 Scripts used as part of the package install and uninstall shall 27345 only use commands and interfaces that are specified by the LSB. 27346 All other commands are not guaranteed to be present, or to 27347 behave in expected ways. 27348 27349 Packages shall not use RPM triggers. 27350 27351 Packages shall not depend on the order in which scripts are 27352 executed (pre-install, pre-uninstall, etc), when doing an 27353 upgrade. 27354 __________________________________________________________ 27355 27356 22.4. Package Tools 27357 27358 The LSB does not specify the interface to the tools used to 27359 manipulate LSB-conformant packages. Each conforming 27360 implementation shall provide documentation for installing LSB 27361 packages. 27362 __________________________________________________________ 27363 27364 22.5. Package Naming 27365 27366 Packages supplied by implementations and applications shall 27367 follow the following rules for the name field within the 27368 package. These rules are not required for the filename of the 27369 package file itself. 27370 27371 Note: There are discrepancies among implementations 27372 concerning whether the name might be 27373 frobnicator-1.7-21-ppc32.rpm or 27374 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 27375 recommended practice is for the filename of the package file 27376 to match the name within the package. 27377 27378 The following rules apply to the name field alone, not 27379 including any release or version. 27380 27381 Note: If the name with the release and version is 27382 frobnicator-1.7-21, the name part is frobnicator and falls 27383 under the rules for a name with no hyphens. 27384 27385 * If the name begins with lsb- and contains no other hyphens, 27386 the name shall be assigned by the Linux Assigned Names and 27387 Numbers Authority (LANANA), which shall maintain a registry 27388 of LSB names. The name may be registered by either an 27389 implementation or an application. 27390 * If the package name begins with lsb- and contains more than 27391 one hyphen (for example lsb-distro.example.com-database or 27392 lsb-gnome-gnumeric), then the portion of the package name 27393 between first and second hyphens shall either be an LSB 27394 provider name assigned by the LANANA, or it may be one of 27395 the owners' fully-qualified domain names in lower case 27396 (e.g., debian.org, staroffice.sun.com). The LSB provider 27397 name assigned by LANANA shall only consist of the ASCII 27398 characters [a-z0-9]. The provider name or domain name may 27399 be either that of an implementation or an application. 27400 * Package names containing no hyphens are reserved for use by 27401 implementations. Applications shall not use such names. 27402 * Package names which do not start with lsb- and which 27403 contain a hyphen are open to both implementations and 27404 applications. Implementations may name packages in any part 27405 of this namespace. They are encouraged to use names from 27406 one of the other namespaces available to them, but this is 27407 not required due to the large amount of current practice to 27408 the contrary. 27409 27410 Note: Widespread existing practice includes such names as 27411 ssh-common, ssh-client, kernel-pcmcia, and the like. 27412 Possible alternative names include sshcommon, 27413 foolinux-ssh-common (where foolinux is registered to the 27414 implementation), or lsb-foolinux-ssh-common. 27415 Applications may name their packages this way, but only if 27416 the portion of the name before the first hyphen is a 27417 provider name or registered domain name as described above. 27418 27419 Note: If an application vendor has domain name such as 27420 visicalc.example.com and has registered visicalc as a 27421 provider name, they might name packages visicalc-base, 27422 visicalc.example.com-charting, and the like. 27423 Package names in this namespace are available to both the 27424 implementation and an application. Implementations and 27425 applications will need to consider this potential for 27426 conflicts when deciding to use these names rather than the 27427 alternatives (such as names starting with lsb-). 27428 __________________________________________________________ 27429 27430 22.6. Package Dependencies 27431 27432 Packages shall have a dependency that indicates which LSB 27433 modules are required. LSB module descriptions are dash 27434 seperated tuples containing the name 'lsb', the module name, 27435 and the architecture name. The following dependencies may be 27436 used. 27437 27438 lsb-core-arch 27439 27440 This dependency is used to indicate that the application is 27441 dependent on features contained in the LSB-Core specification. 27442 lsb-core-noarch 27443 27444 This dependency is used to indicate that the application is 27445 dependent on features contained in the LSB-Core specification 27446 and that the package does not contain any architecture specific 27447 files. 27448 27449 These dependencies shall have a version of 3.0. 27450 27451 Packages shall not depend on other system-provided 27452 dependencies. They shall not depend on non-system-provided 27453 dependencies unless the package provider also makes available 27454 the LSB conforming packages needed to satisfy such 27455 dependencies. 27456 27457 Other modules in the LSB may supplement this list. The 27458 architecture specific dependencies are described in the 27459 relevant architecture specific LSB. 27460 __________________________________________________________ 27461 27462 22.7. Package Architecture Considerations 27463 27464 Packages which do not contain any architecture specific files 27465 should specify an architecture of noarch. An LSB runtime 27466 environment shall accept values noarch, or the value specified 27467 in the relevant architecture specific part of ISO/IEC 23360. 27468 27469 Additional specifications or restrictions may be found in the 27470 architecture specific LSB specification. 27471 __________________________________________________________ 27472 27473 Appendix A. Alphabetical Listing of Interfaces 27474 __________________________________________________________ 27475 27476 A.1. libc 27477 27478 The behavior of the interfaces in this library is specified by 27479 the following Standards. 27480 27481 Large File Support [LFS] 27482 This Specification [LSB] 27483 SUSv2 [SUSv2] 27484 ISO POSIX (2003) [SUSv3] 27485 SVID Issue 3 [SVID.3] 27486 SVID Issue 4 [SVID.4] 27487 27488 Table A-1. libc Function Interfaces 27489 _Exit[SUSv3] getrusage[SUSv3] setsockopt[LSB] 27490 _IO_feof[LSB] getservbyname[SUSv3] setstate[SUSv3] 27491 _IO_getc[LSB] getservbyport[SUSv3] setuid[SUSv3] 27492 _IO_putc[LSB] getservent[SUSv3] setutent[LSB] 27493 _IO_puts[LSB] getsid[SUSv3] setutxent[SUSv3] 27494 __assert_fail[LSB] getsockname[SUSv3] setvbuf[SUSv3] 27495 __ctype_b_loc(GLIBC_2.3)[LSB] getsockopt[LSB] shmat[SUSv3] 27496 __ctype_get_mb_cur_max[LSB] getsubopt[SUSv3] shmctl[SUSv3] 27497 __ctype_tolower_loc(GLIBC_2.3)[LSB] gettext[LSB] shmdt[SUSv3] 27498 __ctype_toupper_loc(GLIBC_2.3)[LSB] gettimeofday[SUSv3] 27499 shmget[SUSv3] 27500 __cxa_atexit[LSB] getuid[SUSv3] shutdown[SUSv3] 27501 __cxa_finalize[LSB] getutent[LSB] sigaction[SUSv3] 27502 __errno_location[LSB] getutent_r[LSB] sigaddset[SUSv3] 27503 __fpending[LSB] getutxent[SUSv3] sigaltstack[SUSv3] 27504 __fxstat[LSB] getutxid[SUSv3] sigandset[LSB] 27505 __fxstat64[LSB] getutxline[SUSv3] sigdelset[SUSv3] 27506 __getpagesize[LSB] getw[SUSv2] sigemptyset[SUSv3] 27507 __getpgid[LSB] getwc[SUSv3] sigfillset[SUSv3] 27508 __h_errno_location[LSB] getwchar[SUSv3] sighold[SUSv3] 27509 __isinf[LSB] getwd[SUSv3] sigignore[SUSv3] 27510 __isinff[LSB] glob[SUSv3] siginterrupt[SUSv3] 27511 __isinfl[LSB] glob64[LSB] sigisemptyset[LSB] 27512 __isnan[LSB] globfree[SUSv3] sigismember[SUSv3] 27513 __isnanf[LSB] globfree64[LSB] siglongjmp[SUSv3] 27514 __isnanl[LSB] gmtime[SUSv3] signal[SUSv3] 27515 __libc_current_sigrtmax[LSB] gmtime_r[SUSv3] sigorset[LSB] 27516 __libc_current_sigrtmin[LSB] grantpt[SUSv3] sigpause[LSB] 27517 __libc_start_main[LSB] hcreate[SUSv3] sigpending[SUSv3] 27518 __lxstat[LSB] hdestroy[SUSv3] sigprocmask[SUSv3] 27519 __lxstat64[LSB] hsearch[SUSv3] sigqueue[SUSv3] 27520 __mempcpy[LSB] htonl[SUSv3] sigrelse[SUSv3] 27521 __rawmemchr[LSB] htons[SUSv3] sigreturn[LSB] 27522 __register_atfork(GLIBC_2.3.2)[LSB] iconv[SUSv3] sigset[SUSv3] 27523 __sigsetjmp[LSB] iconv_close[SUSv3] sigsuspend[SUSv3] 27524 __stpcpy[LSB] iconv_open[SUSv3] sigtimedwait[SUSv3] 27525 __strdup[LSB] if_freenameindex[SUSv3] sigwait[SUSv3] 27526 __strtod_internal[LSB] if_indextoname[SUSv3] sigwaitinfo[SUSv3] 27527 __strtof_internal[LSB] if_nameindex[SUSv3] sleep[SUSv3] 27528 __strtok_r[LSB] if_nametoindex[SUSv3] snprintf[SUSv3] 27529 __strtol_internal[LSB] imaxabs[SUSv3] sockatmark[SUSv3] 27530 __strtold_internal[LSB] imaxdiv[SUSv3] socket[SUSv3] 27531 __strtoll_internal[LSB] index[SUSv3] socketpair[SUSv3] 27532 __strtoul_internal[LSB] inet_addr[SUSv3] sprintf[SUSv3] 27533 __strtoull_internal[LSB] inet_aton[LSB] srand[SUSv3] 27534 __sysconf[LSB] inet_ntoa[SUSv3] srand48[SUSv3] 27535 __sysv_signal[LSB] inet_ntop[SUSv3] srandom[SUSv3] 27536 __wcstod_internal[LSB] inet_pton[SUSv3] sscanf[LSB] 27537 __wcstof_internal[LSB] initgroups[LSB] statfs[LSB] 27538 __wcstol_internal[LSB] initstate[SUSv3] statfs64[LSB] 27539 __wcstold_internal[LSB] insque[SUSv3] statvfs[SUSv3] 27540 __wcstoul_internal[LSB] ioctl[LSB] statvfs64[LFS] 27541 __xmknod[LSB] isalnum[SUSv3] stime[LSB] 27542 __xpg_basename[LSB] isalpha[SUSv3] stpcpy[LSB] 27543 __xpg_sigpause[LSB] isascii[SUSv3] stpncpy[LSB] 27544 __xpg_strerror_r(GLIBC_2.3.4)[LSB] isatty[SUSv3] 27545 strcasecmp[SUSv3] 27546 __xstat[LSB] isblank[SUSv3] strcasestr[LSB] 27547 __xstat64[LSB] iscntrl[SUSv3] strcat[SUSv3] 27548 _exit[SUSv3] isdigit[SUSv3] strchr[SUSv3] 27549 _longjmp[SUSv3] isgraph[SUSv3] strcmp[SUSv3] 27550 _setjmp[SUSv3] islower[SUSv3] strcoll[SUSv3] 27551 _tolower[SUSv3] isprint[SUSv3] strcpy[SUSv3] 27552 _toupper[SUSv3] ispunct[SUSv3] strcspn[SUSv3] 27553 a64l[SUSv3] isspace[SUSv3] strdup[SUSv3] 27554 abort[SUSv3] isupper[SUSv3] strerror[SUSv3] 27555 abs[SUSv3] iswalnum[SUSv3] strerror_r[LSB] 27556 accept[SUSv3] iswalpha[SUSv3] strfmon[SUSv3] 27557 access[SUSv3] iswblank[SUSv3] strftime[SUSv3] 27558 acct[LSB] iswcntrl[SUSv3] strlen[SUSv3] 27559 adjtime[LSB] iswctype[SUSv3] strncasecmp[SUSv3] 27560 alarm[SUSv3] iswdigit[SUSv3] strncat[SUSv3] 27561 asctime[SUSv3] iswgraph[SUSv3] strncmp[SUSv3] 27562 asctime_r[SUSv3] iswlower[SUSv3] strncpy[SUSv3] 27563 asprintf[LSB] iswprint[SUSv3] strndup[LSB] 27564 atof[SUSv3] iswpunct[SUSv3] strnlen[LSB] 27565 atoi[SUSv3] iswspace[SUSv3] strpbrk[SUSv3] 27566 atol[SUSv3] iswupper[SUSv3] strptime[LSB] 27567 atoll[SUSv3] iswxdigit[SUSv3] strrchr[SUSv3] 27568 authnone_create[SVID.4] isxdigit[SUSv3] strsep[LSB] 27569 basename[LSB] jrand48[SUSv3] strsignal[LSB] 27570 bcmp[SUSv3] key_decryptsession[SVID.3] strspn[SUSv3] 27571 bcopy[SUSv3] kill[LSB] strstr[SUSv3] 27572 bind[SUSv3] killpg[SUSv3] strtod[SUSv3] 27573 bind_textdomain_codeset[LSB] l64a[SUSv3] strtof[SUSv3] 27574 bindresvport[LSB] labs[SUSv3] strtoimax[SUSv3] 27575 bindtextdomain[LSB] lchown[SUSv3] strtok[SUSv3] 27576 brk[SUSv2] lcong48[SUSv3] strtok_r[SUSv3] 27577 bsd_signal[SUSv3] ldiv[SUSv3] strtol[SUSv3] 27578 bsearch[SUSv3] lfind[SUSv3] strtold[SUSv3] 27579 btowc[SUSv3] link[LSB] strtoll[SUSv3] 27580 bzero[SUSv3] listen[SUSv3] strtoq[LSB] 27581 calloc[SUSv3] llabs[SUSv3] strtoul[SUSv3] 27582 catclose[SUSv3] lldiv[SUSv3] strtoull[SUSv3] 27583 catgets[SUSv3] localeconv[SUSv3] strtoumax[SUSv3] 27584 catopen[SUSv3] localtime[SUSv3] strtouq[LSB] 27585 cfgetispeed[SUSv3] localtime_r[SUSv3] strxfrm[SUSv3] 27586 cfgetospeed[SUSv3] lockf[SUSv3] svc_getreqset[SVID.3] 27587 cfmakeraw[LSB] lockf64[LFS] svc_register[LSB] 27588 cfsetispeed[SUSv3] longjmp[SUSv3] svc_run[LSB] 27589 cfsetospeed[SUSv3] lrand48[SUSv3] svc_sendreply[LSB] 27590 cfsetspeed[LSB] lsearch[SUSv3] svcerr_auth[SVID.3] 27591 chdir[SUSv3] lseek[SUSv3] svcerr_decode[SVID.3] 27592 chmod[SUSv3] makecontext[SUSv3] svcerr_noproc[SVID.3] 27593 chown[SUSv3] malloc[SUSv3] svcerr_noprog[SVID.3] 27594 chroot[SUSv2] mblen[SUSv3] svcerr_progvers[SVID.3] 27595 clearerr[SUSv3] mbrlen[SUSv3] svcerr_systemerr[SVID.3] 27596 clnt_create[SVID.4] mbrtowc[SUSv3] svcerr_weakauth[SVID.3] 27597 clnt_pcreateerror[SVID.4] mbsinit[SUSv3] svctcp_create[LSB] 27598 clnt_perrno[SVID.4] mbsnrtowcs[LSB] svcudp_create[LSB] 27599 clnt_perror[SVID.4] mbsrtowcs[SUSv3] swab[SUSv3] 27600 clnt_spcreateerror[SVID.4] mbstowcs[SUSv3] swapcontext[SUSv3] 27601 clnt_sperrno[SVID.4] mbtowc[SUSv3] swprintf[SUSv3] 27602 clnt_sperror[SVID.4] memccpy[SUSv3] swscanf[LSB] 27603 clock[SUSv3] memchr[SUSv3] symlink[SUSv3] 27604 close[SUSv3] memcmp[SUSv3] sync[SUSv3] 27605 closedir[SUSv3] memcpy[SUSv3] sysconf[LSB] 27606 closelog[SUSv3] memmem[LSB] syslog[SUSv3] 27607 confstr[SUSv3] memmove[SUSv3] system[LSB] 27608 connect[SUSv3] memrchr[LSB] tcdrain[SUSv3] 27609 creat[SUSv3] memset[SUSv3] tcflow[SUSv3] 27610 creat64[LFS] mkdir[SUSv3] tcflush[SUSv3] 27611 ctermid[SUSv3] mkfifo[SUSv3] tcgetattr[SUSv3] 27612 ctime[SUSv3] mkstemp[SUSv3] tcgetpgrp[SUSv3] 27613 ctime_r[SUSv3] mkstemp64[LFS] tcgetsid[SUSv3] 27614 cuserid[SUSv2] mktemp[SUSv3] tcsendbreak[SUSv3] 27615 daemon[LSB] mktime[SUSv3] tcsetattr[SUSv3] 27616 dcgettext[LSB] mlock[SUSv3] tcsetpgrp[SUSv3] 27617 dcngettext[LSB] mlockall[SUSv3] tdelete[SUSv3] 27618 dgettext[LSB] mmap[SUSv3] telldir[SUSv3] 27619 difftime[SUSv3] mmap64[LFS] tempnam[SUSv3] 27620 dirname[SUSv3] mprotect[SUSv3] textdomain[LSB] 27621 div[SUSv3] mrand48[SUSv3] tfind[SUSv3] 27622 dngettext[LSB] mremap[LSB] time[SUSv3] 27623 drand48[SUSv3] msgctl[SUSv3] times[SUSv3] 27624 dup[SUSv3] msgget[SUSv3] tmpfile[SUSv3] 27625 dup2[SUSv3] msgrcv[SUSv3] tmpfile64[LFS] 27626 duplocale(GLIBC_2.3)[LSB] msgsnd[SUSv3] tmpnam[SUSv3] 27627 ecvt[SUSv3] msync[SUSv3] toascii[SUSv3] 27628 endgrent[SUSv3] munlock[SUSv3] tolower[SUSv3] 27629 endprotoent[SUSv3] munlockall[SUSv3] toupper[SUSv3] 27630 endpwent[SUSv3] munmap[SUSv3] towctrans[SUSv3] 27631 endservent[SUSv3] nanosleep[SUSv3] towlower[SUSv3] 27632 endutent[LSB] newlocale(GLIBC_2.3)[LSB] towupper[SUSv3] 27633 endutxent[SUSv3] nftw[SUSv3] truncate[SUSv3] 27634 erand48[SUSv3] nftw64[LFS] truncate64[LFS] 27635 err[LSB] ngettext[LSB] tsearch[SUSv3] 27636 error[LSB] nice[SUSv3] ttyname[SUSv3] 27637 errx[LSB] nl_langinfo[SUSv3] ttyname_r[SUSv3] 27638 execl[SUSv3] nrand48[SUSv3] twalk[SUSv3] 27639 execle[SUSv3] ntohl[SUSv3] tzset[SUSv3] 27640 execlp[SUSv3] ntohs[SUSv3] ualarm[SUSv3] 27641 execv[SUSv3] open[SUSv3] ulimit[SUSv3] 27642 execve[SUSv3] opendir[SUSv3] umask[SUSv3] 27643 execvp[SUSv3] openlog[SUSv3] uname[SUSv3] 27644 exit[SUSv3] pathconf[SUSv3] ungetc[SUSv3] 27645 fchdir[SUSv3] pause[SUSv3] ungetwc[SUSv3] 27646 fchmod[SUSv3] pclose[SUSv3] unlink[LSB] 27647 fchown[SUSv3] perror[SUSv3] unlockpt[SUSv3] 27648 fclose[SUSv3] pipe[SUSv3] unsetenv[SUSv3] 27649 fcntl[LSB] pmap_getport[LSB] uselocale(GLIBC_2.3)[LSB] 27650 fcvt[SUSv3] pmap_set[LSB] usleep[SUSv3] 27651 fdatasync[SUSv3] pmap_unset[LSB] utime[SUSv3] 27652 fdopen[SUSv3] poll[SUSv3] utimes[SUSv3] 27653 feof[SUSv3] popen[SUSv3] utmpname[LSB] 27654 ferror[SUSv3] posix_fadvise[SUSv3] vasprintf[LSB] 27655 fflush[SUSv3] posix_fadvise64[LSB] vdprintf[LSB] 27656 fflush_unlocked[LSB] posix_fallocate[SUSv3] verrx[LSB] 27657 ffs[SUSv3] posix_fallocate64[LSB] vfork[SUSv3] 27658 fgetc[SUSv3] posix_madvise[SUSv3] vfprintf[SUSv3] 27659 fgetpos[SUSv3] posix_memalign[SUSv3] vfscanf[LSB] 27660 fgetpos64[LFS] posix_openpt[SUSv3] vfwprintf[SUSv3] 27661 fgets[SUSv3] posix_spawn[SUSv3] vfwscanf[LSB] 27662 fgetwc[SUSv3] posix_spawn_file_actions_addclose[SUSv3] 27663 vprintf[SUSv3] 27664 fgetwc_unlocked[LSB] posix_spawn_file_actions_adddup2[SUSv3] 27665 vscanf[LSB] 27666 fgetws[SUSv3] posix_spawn_file_actions_addopen[SUSv3] 27667 vsnprintf[SUSv3] 27668 fileno[SUSv3] posix_spawn_file_actions_destroy[SUSv3] 27669 vsprintf[SUSv3] 27670 flock[LSB] posix_spawn_file_actions_init[SUSv3] vsscanf[LSB] 27671 flockfile[SUSv3] posix_spawnattr_destroy[SUSv3] 27672 vswprintf[SUSv3] 27673 fmtmsg[SUSv3] posix_spawnattr_getflags[SUSv3] vswscanf[LSB] 27674 fnmatch[SUSv3] posix_spawnattr_getpgroup[SUSv3] vsyslog[LSB] 27675 fopen[SUSv3] posix_spawnattr_getschedparam[SUSv3] 27676 vwprintf[SUSv3] 27677 fopen64[LFS] posix_spawnattr_getschedpolicy[SUSv3] vwscanf[LSB] 27678 fork[SUSv3] posix_spawnattr_getsigdefault[SUSv3] wait[SUSv3] 27679 fpathconf[SUSv3] posix_spawnattr_getsigmask[SUSv3] wait4[LSB] 27680 fprintf[SUSv3] posix_spawnattr_init[SUSv3] waitid[SUSv3] 27681 fputc[SUSv3] posix_spawnattr_setflags[SUSv3] waitpid[LSB] 27682 fputs[SUSv3] posix_spawnattr_setpgroup[SUSv3] warn[LSB] 27683 fputwc[SUSv3] posix_spawnattr_setschedparam[SUSv3] warnx[LSB] 27684 fputws[SUSv3] posix_spawnattr_setschedpolicy[SUSv3] wcpcpy[LSB] 27685 fread[SUSv3] posix_spawnattr_setsigdefault[SUSv3] wcpncpy[LSB] 27686 free[SUSv3] posix_spawnattr_setsigmask[SUSv3] wcrtomb[SUSv3] 27687 freeaddrinfo[SUSv3] posix_spawnp[SUSv3] wcscasecmp[LSB] 27688 freelocale(GLIBC_2.3)[LSB] printf[SUSv3] wcscat[SUSv3] 27689 freopen[SUSv3] pselect[SUSv3] wcschr[SUSv3] 27690 freopen64[LFS] psignal[LSB] wcscmp[SUSv3] 27691 fscanf[LSB] ptsname[SUSv3] wcscoll[SUSv3] 27692 fseek[SUSv3] putc[SUSv3] wcscpy[SUSv3] 27693 fseeko[SUSv3] putc_unlocked[SUSv3] wcscspn[SUSv3] 27694 fseeko64[LFS] putchar[SUSv3] wcsdup[LSB] 27695 fsetpos[SUSv3] putchar_unlocked[SUSv3] wcsftime[SUSv3] 27696 fsetpos64[LFS] putenv[SUSv3] wcslen[SUSv3] 27697 fstatfs[LSB] puts[SUSv3] wcsncasecmp[LSB] 27698 fstatfs64[LSB] pututxline[SUSv3] wcsncat[SUSv3] 27699 fstatvfs[SUSv3] putw[SUSv2] wcsncmp[SUSv3] 27700 fstatvfs64[LFS] putwc[SUSv3] wcsncpy[SUSv3] 27701 fsync[SUSv3] putwchar[SUSv3] wcsnlen[LSB] 27702 ftell[SUSv3] qsort[SUSv3] wcsnrtombs[LSB] 27703 ftello[SUSv3] raise[SUSv3] wcspbrk[SUSv3] 27704 ftello64[LFS] rand[SUSv3] wcsrchr[SUSv3] 27705 ftime[SUSv3] rand_r[SUSv3] wcsrtombs[SUSv3] 27706 ftok[SUSv3] random[SUSv3] wcsspn[SUSv3] 27707 ftruncate[SUSv3] read[SUSv3] wcsstr[SUSv3] 27708 ftruncate64[LFS] readdir[SUSv3] wcstod[SUSv3] 27709 ftrylockfile[SUSv3] readdir64[LFS] wcstof[SUSv3] 27710 ftw[SUSv3] readdir64_r[LSB] wcstoimax[SUSv3] 27711 ftw64[LFS] readdir_r[SUSv3] wcstok[SUSv3] 27712 funlockfile[SUSv3] readlink[SUSv3] wcstol[SUSv3] 27713 fwide[SUSv3] readv[SUSv3] wcstold[SUSv3] 27714 fwprintf[SUSv3] realloc[SUSv3] wcstoll[SUSv3] 27715 fwrite[SUSv3] realpath[SUSv3] wcstombs[SUSv3] 27716 fwscanf[LSB] recv[SUSv3] wcstoq[LSB] 27717 gai_strerror[SUSv3] recvfrom[SUSv3] wcstoul[SUSv3] 27718 gcvt[SUSv3] recvmsg[SUSv3] wcstoull[SUSv3] 27719 getaddrinfo[SUSv3] regcomp[SUSv3] wcstoumax[SUSv3] 27720 getc[SUSv3] regerror[SUSv3] wcstouq[LSB] 27721 getc_unlocked[SUSv3] regexec[LSB] wcswcs[SUSv3] 27722 getchar[SUSv3] regfree[SUSv3] wcswidth[SUSv3] 27723 getchar_unlocked[SUSv3] remove[SUSv3] wcsxfrm[SUSv3] 27724 getcontext[SUSv3] remque[SUSv3] wctob[SUSv3] 27725 getcwd[SUSv3] rename[SUSv3] wctomb[SUSv3] 27726 getdate[SUSv3] rewind[SUSv3] wctrans[SUSv3] 27727 getdomainname[LSB] rewinddir[SUSv3] wctype[SUSv3] 27728 getdtablesize[LSB] rindex[SUSv3] wcwidth[SUSv3] 27729 getegid[SUSv3] rmdir[SUSv3] wmemchr[SUSv3] 27730 getenv[SUSv3] sbrk[SUSv2] wmemcmp[SUSv3] 27731 geteuid[SUSv3] scanf[LSB] wmemcpy[SUSv3] 27732 getgid[SUSv3] sched_get_priority_max[SUSv3] wmemmove[SUSv3] 27733 getgrent[SUSv3] sched_get_priority_min[SUSv3] wmemset[SUSv3] 27734 getgrgid[SUSv3] sched_getparam[SUSv3] wordexp[SUSv3] 27735 getgrgid_r[SUSv3] sched_getscheduler[SUSv3] wordfree[SUSv3] 27736 getgrnam[SUSv3] sched_rr_get_interval[SUSv3] wprintf[SUSv3] 27737 getgrnam_r[SUSv3] sched_setparam[SUSv3] write[SUSv3] 27738 getgrouplist[LSB] sched_setscheduler[LSB] writev[SUSv3] 27739 getgroups[SUSv3] sched_yield[SUSv3] wscanf[LSB] 27740 gethostbyaddr[SUSv3] seed48[SUSv3] xdr_accepted_reply[SVID.3] 27741 gethostbyaddr_r[LSB] seekdir[SUSv3] xdr_array[SVID.3] 27742 gethostbyname[SUSv3] select[SUSv3] xdr_bool[SVID.3] 27743 gethostbyname2[LSB] semctl[SUSv3] xdr_bytes[SVID.3] 27744 gethostbyname2_r[LSB] semget[SUSv3] xdr_callhdr[SVID.3] 27745 gethostbyname_r[LSB] semop[SUSv3] xdr_callmsg[SVID.3] 27746 gethostid[SUSv3] send[SUSv3] xdr_char[SVID.3] 27747 gethostname[SUSv3] sendmsg[SUSv3] xdr_double[SVID.3] 27748 getitimer[SUSv3] sendto[SUSv3] xdr_enum[SVID.3] 27749 getloadavg[LSB] setbuf[SUSv3] xdr_float[SVID.3] 27750 getlogin[SUSv3] setbuffer[LSB] xdr_free[SVID.3] 27751 getlogin_r[SUSv3] setcontext[SUSv3] xdr_int[SVID.3] 27752 getnameinfo[SUSv3] setegid[SUSv3] xdr_long[SVID.3] 27753 getopt[LSB] setenv[SUSv3] xdr_opaque[SVID.3] 27754 getopt_long[LSB] seteuid[SUSv3] xdr_opaque_auth[SVID.3] 27755 getopt_long_only[LSB] setgid[SUSv3] xdr_pointer[SVID.3] 27756 getpagesize[LSB] setgrent[SUSv3] xdr_reference[SVID.3] 27757 getpeername[SUSv3] setgroups[LSB] xdr_rejected_reply[SVID.3] 27758 getpgid[SUSv3] sethostname[LSB] xdr_replymsg[SVID.3] 27759 getpgrp[SUSv3] setitimer[SUSv3] xdr_short[SVID.3] 27760 getpid[SUSv3] setlocale[SUSv3] xdr_string[SVID.3] 27761 getppid[SUSv3] setlogmask[SUSv3] xdr_u_char[SVID.3] 27762 getpriority[SUSv3] setpgid[SUSv3] xdr_u_int[LSB] 27763 getprotobyname[SUSv3] setpgrp[SUSv3] xdr_u_long[SVID.3] 27764 getprotobynumber[SUSv3] setpriority[SUSv3] xdr_u_short[SVID.3] 27765 getprotoent[SUSv3] setprotoent[SUSv3] xdr_union[SVID.3] 27766 getpwent[SUSv3] setpwent[SUSv3] xdr_vector[SVID.3] 27767 getpwnam[SUSv3] setregid[SUSv3] xdr_void[SVID.3] 27768 getpwnam_r[SUSv3] setreuid[SUSv3] xdr_wrapstring[SVID.3] 27769 getpwuid[SUSv3] setrlimit[SUSv3] xdrmem_create[SVID.3] 27770 getpwuid_r[SUSv3] setrlimit64[LFS] xdrrec_create[SVID.3] 27771 getrlimit[SUSv3] setservent[SUSv3] xdrrec_eof[SVID.3] 27772 getrlimit64[LFS] setsid[SUSv3] xdrstdio_create[LSB] 27773 27774 Table A-2. libc Data Interfaces 27775 __daylight[LSB] __tzname[LSB] in6addr_loopback[SUSv3] 27776 __environ[LSB] _sys_errlist[LSB] 27777 __timezone[LSB] in6addr_any[SUSv3] 27778 __________________________________________________________ 27779 27780 A.2. libcrypt 27781 27782 The behavior of the interfaces in this library is specified by 27783 the following Standards. 27784 27785 ISO POSIX (2003) [SUSv3] 27786 27787 Table A-3. libcrypt Function Interfaces 27788 crypt[SUSv3] encrypt[SUSv3] setkey[SUSv3] 27789 __________________________________________________________ 27790 27791 A.3. libdl 27792 27793 The behavior of the interfaces in this library is specified by 27794 the following Standards. 27795 27796 This Specification [LSB] 27797 ISO POSIX (2003) [SUSv3] 27798 27799 Table A-4. libdl Function Interfaces 27800 dladdr[LSB] dlerror[SUSv3] dlsym[LSB] 27801 dlclose[SUSv3] dlopen[LSB] 27802 __________________________________________________________ 27803 27804 A.4. libm 27805 27806 The behavior of the interfaces in this library is specified by 27807 the following Standards. 27808 27809 ISO C (1999) [ISOC99] 27810 This Specification [LSB] 27811 ISO POSIX (2003) [SUSv3] 27812 SVID Issue 3 [SVID.3] 27813 27814 Table A-5. libm Function Interfaces 27815 __finite[LSB] csinl[SUSv3] llroundf[SUSv3] 27816 __finitef[LSB] csqrt[SUSv3] llroundl[SUSv3] 27817 __finitel[LSB] csqrtf[SUSv3] log[SUSv3] 27818 __fpclassify[LSB] csqrtl[SUSv3] log10[SUSv3] 27819 __fpclassifyf[LSB] ctan[SUSv3] log10f[SUSv3] 27820 __signbit[LSB] ctanf[SUSv3] log10l[SUSv3] 27821 __signbitf[LSB] ctanh[SUSv3] log1p[SUSv3] 27822 acos[SUSv3] ctanhf[SUSv3] log1pf[SUSv3] 27823 acosf[SUSv3] ctanhl[SUSv3] log1pl[SUSv3] 27824 acosh[SUSv3] ctanl[SUSv3] log2[SUSv3] 27825 acoshf[SUSv3] drem[LSB] log2f[SUSv3] 27826 acoshl[SUSv3] dremf[LSB] log2l[SUSv3] 27827 acosl[SUSv3] dreml[LSB] logb[SUSv3] 27828 asin[SUSv3] erf[SUSv3] logbf[SUSv3] 27829 asinf[SUSv3] erfc[SUSv3] logbl[SUSv3] 27830 asinh[SUSv3] erfcf[SUSv3] logf[SUSv3] 27831 asinhf[SUSv3] erfcl[SUSv3] logl[SUSv3] 27832 asinhl[SUSv3] erff[SUSv3] lrint[SUSv3] 27833 asinl[SUSv3] erfl[SUSv3] lrintf[SUSv3] 27834 atan[SUSv3] exp[SUSv3] lrintl[SUSv3] 27835 atan2[SUSv3] exp10[LSB] lround[SUSv3] 27836 atan2f[SUSv3] exp10f[LSB] lroundf[SUSv3] 27837 atan2l[SUSv3] exp10l[LSB] lroundl[SUSv3] 27838 atanf[SUSv3] exp2[SUSv3] matherr[SVID.3] 27839 atanh[SUSv3] exp2f[SUSv3] modf[SUSv3] 27840 atanhf[SUSv3] expf[SUSv3] modff[SUSv3] 27841 atanhl[SUSv3] expl[SUSv3] modfl[SUSv3] 27842 atanl[SUSv3] expm1[SUSv3] nan[SUSv3] 27843 cabs[SUSv3] expm1f[SUSv3] nanf[SUSv3] 27844 cabsf[SUSv3] expm1l[SUSv3] nanl[SUSv3] 27845 cabsl[SUSv3] fabs[SUSv3] nearbyint[SUSv3] 27846 cacos[SUSv3] fabsf[SUSv3] nearbyintf[SUSv3] 27847 cacosf[SUSv3] fabsl[SUSv3] nearbyintl[SUSv3] 27848 cacosh[SUSv3] fdim[SUSv3] nextafter[SUSv3] 27849 cacoshf[SUSv3] fdimf[SUSv3] nextafterf[SUSv3] 27850 cacoshl[SUSv3] fdiml[SUSv3] nextafterl[SUSv3] 27851 cacosl[SUSv3] feclearexcept[SUSv3] nexttoward[SUSv3] 27852 carg[SUSv3] fedisableexcept[LSB] nexttowardf[SUSv3] 27853 cargf[SUSv3] feenableexcept[LSB] nexttowardl[SUSv3] 27854 cargl[SUSv3] fegetenv[SUSv3] pow[SUSv3] 27855 casin[SUSv3] fegetexcept[LSB] pow10[LSB] 27856 casinf[SUSv3] fegetexceptflag[SUSv3] pow10f[LSB] 27857 casinh[SUSv3] fegetround[SUSv3] pow10l[LSB] 27858 casinhf[SUSv3] feholdexcept[SUSv3] powf[SUSv3] 27859 casinhl[SUSv3] feraiseexcept[SUSv3] powl[SUSv3] 27860 casinl[SUSv3] fesetenv[SUSv3] remainder[SUSv3] 27861 catan[SUSv3] fesetexceptflag[SUSv3] remainderf[SUSv3] 27862 catanf[SUSv3] fesetround[SUSv3] remainderl[SUSv3] 27863 catanh[SUSv3] fetestexcept[SUSv3] remquo[SUSv3] 27864 catanhf[SUSv3] feupdateenv[SUSv3] remquof[SUSv3] 27865 catanhl[SUSv3] finite[LSB] remquol[SUSv3] 27866 catanl[SUSv3] finitef[LSB] rint[SUSv3] 27867 cbrt[SUSv3] finitel[LSB] rintf[SUSv3] 27868 cbrtf[SUSv3] floor[SUSv3] rintl[SUSv3] 27869 cbrtl[SUSv3] floorf[SUSv3] round[SUSv3] 27870 ccos[SUSv3] floorl[SUSv3] roundf[SUSv3] 27871 ccosf[SUSv3] fma[SUSv3] roundl[SUSv3] 27872 ccosh[SUSv3] fmaf[SUSv3] scalb[SUSv3] 27873 ccoshf[SUSv3] fmal[SUSv3] scalbf[ISOC99] 27874 ccoshl[SUSv3] fmax[SUSv3] scalbl[ISOC99] 27875 ccosl[SUSv3] fmaxf[SUSv3] scalbln[SUSv3] 27876 ceil[SUSv3] fmaxl[SUSv3] scalblnf[SUSv3] 27877 ceilf[SUSv3] fmin[SUSv3] scalblnl[SUSv3] 27878 ceill[SUSv3] fminf[SUSv3] scalbn[SUSv3] 27879 cexp[SUSv3] fminl[SUSv3] scalbnf[SUSv3] 27880 cexpf[SUSv3] fmod[SUSv3] scalbnl[SUSv3] 27881 cexpl[SUSv3] fmodf[SUSv3] significand[LSB] 27882 cimag[SUSv3] fmodl[SUSv3] significandf[LSB] 27883 cimagf[SUSv3] frexp[SUSv3] significandl[LSB] 27884 cimagl[SUSv3] frexpf[SUSv3] sin[SUSv3] 27885 clog[SUSv3] frexpl[SUSv3] sincos[LSB] 27886 clog10[LSB] gamma[LSB] sincosf[LSB] 27887 clog10f[LSB] gammaf[LSB] sincosl[LSB] 27888 clog10l[LSB] gammal[LSB] sinf[SUSv3] 27889 clogf[SUSv3] hypot[SUSv3] sinh[SUSv3] 27890 clogl[SUSv3] hypotf[SUSv3] sinhf[SUSv3] 27891 conj[SUSv3] hypotl[SUSv3] sinhl[SUSv3] 27892 conjf[SUSv3] ilogb[SUSv3] sinl[SUSv3] 27893 conjl[SUSv3] ilogbf[SUSv3] sqrt[SUSv3] 27894 copysign[SUSv3] ilogbl[SUSv3] sqrtf[SUSv3] 27895 copysignf[SUSv3] j0[SUSv3] sqrtl[SUSv3] 27896 copysignl[SUSv3] j0f[LSB] tan[SUSv3] 27897 cos[SUSv3] j0l[LSB] tanf[SUSv3] 27898 cosf[SUSv3] j1[SUSv3] tanh[SUSv3] 27899 cosh[SUSv3] j1f[LSB] tanhf[SUSv3] 27900 coshf[SUSv3] j1l[LSB] tanhl[SUSv3] 27901 coshl[SUSv3] jn[SUSv3] tanl[SUSv3] 27902 cosl[SUSv3] jnf[LSB] tgamma[SUSv3] 27903 cpow[SUSv3] jnl[LSB] tgammaf[SUSv3] 27904 cpowf[SUSv3] ldexp[SUSv3] tgammal[SUSv3] 27905 cpowl[SUSv3] ldexpf[SUSv3] trunc[SUSv3] 27906 cproj[SUSv3] ldexpl[SUSv3] truncf[SUSv3] 27907 cprojf[SUSv3] lgamma[SUSv3] truncl[SUSv3] 27908 cprojl[SUSv3] lgamma_r[LSB] y0[SUSv3] 27909 creal[SUSv3] lgammaf[SUSv3] y0f[LSB] 27910 crealf[SUSv3] lgammaf_r[LSB] y0l[LSB] 27911 creall[SUSv3] lgammal[SUSv3] y1[SUSv3] 27912 csin[SUSv3] lgammal_r[LSB] y1f[LSB] 27913 csinf[SUSv3] llrint[SUSv3] y1l[LSB] 27914 csinh[SUSv3] llrintf[SUSv3] yn[SUSv3] 27915 csinhf[SUSv3] llrintl[SUSv3] ynf[LSB] 27916 csinhl[SUSv3] llround[SUSv3] ynl[LSB] 27917 27918 Table A-6. libm Data Interfaces 27919 signgam[SUSv3] 27920 __________________________________________________________ 27921 27922 A.5. libncurses 27923 27924 The behavior of the interfaces in this library is specified by 27925 the following Standards. 27926 27927 X/Open Curses [SUS-CURSES] 27928 27929 Table A-7. libncurses Function Interfaces 27930 addch[SUS-CURSES] mvdelch[SUS-CURSES] slk_refresh[SUS-CURSES] 27931 addchnstr[SUS-CURSES] mvderwin[SUS-CURSES] 27932 slk_restore[SUS-CURSES] 27933 addchstr[SUS-CURSES] mvgetch[SUS-CURSES] slk_set[SUS-CURSES] 27934 addnstr[SUS-CURSES] mvgetnstr[SUS-CURSES] slk_touch[SUS-CURSES] 27935 addstr[SUS-CURSES] mvgetstr[SUS-CURSES] standend[SUS-CURSES] 27936 attr_get[SUS-CURSES] mvhline[SUS-CURSES] standout[SUS-CURSES] 27937 attr_off[SUS-CURSES] mvinch[SUS-CURSES] start_color[SUS-CURSES] 27938 attr_on[SUS-CURSES] mvinchnstr[SUS-CURSES] subpad[SUS-CURSES] 27939 attr_set[SUS-CURSES] mvinchstr[SUS-CURSES] subwin[SUS-CURSES] 27940 attroff[SUS-CURSES] mvinnstr[SUS-CURSES] syncok[SUS-CURSES] 27941 attron[SUS-CURSES] mvinsch[SUS-CURSES] termattrs[SUS-CURSES] 27942 attrset[SUS-CURSES] mvinsnstr[SUS-CURSES] termname[SUS-CURSES] 27943 baudrate[SUS-CURSES] mvinsstr[SUS-CURSES] tgetent[SUS-CURSES] 27944 beep[SUS-CURSES] mvinstr[SUS-CURSES] tgetflag[SUS-CURSES] 27945 bkgd[SUS-CURSES] mvprintw[SUS-CURSES] tgetnum[SUS-CURSES] 27946 bkgdset[SUS-CURSES] mvscanw[SUS-CURSES] tgetstr[SUS-CURSES] 27947 border[SUS-CURSES] mvvline[SUS-CURSES] tgoto[SUS-CURSES] 27948 box[SUS-CURSES] mvwaddch[SUS-CURSES] tigetflag[SUS-CURSES] 27949 can_change_color[SUS-CURSES] mvwaddchnstr[SUS-CURSES] 27950 tigetnum[SUS-CURSES] 27951 cbreak[SUS-CURSES] mvwaddchstr[SUS-CURSES] tigetstr[SUS-CURSES] 27952 chgat[SUS-CURSES] mvwaddnstr[SUS-CURSES] timeout[SUS-CURSES] 27953 clear[SUS-CURSES] mvwaddstr[SUS-CURSES] touchline[SUS-CURSES] 27954 clearok[SUS-CURSES] mvwchgat[SUS-CURSES] touchwin[SUS-CURSES] 27955 clrtobot[SUS-CURSES] mvwdelch[SUS-CURSES] tparm[SUS-CURSES] 27956 clrtoeol[SUS-CURSES] mvwgetch[SUS-CURSES] tputs[SUS-CURSES] 27957 color_content[SUS-CURSES] mvwgetnstr[SUS-CURSES] 27958 typeahead[SUS-CURSES] 27959 color_set[SUS-CURSES] mvwgetstr[SUS-CURSES] unctrl[SUS-CURSES] 27960 copywin[SUS-CURSES] mvwhline[SUS-CURSES] ungetch[SUS-CURSES] 27961 curs_set[SUS-CURSES] mvwin[SUS-CURSES] untouchwin[SUS-CURSES] 27962 def_prog_mode[SUS-CURSES] mvwinch[SUS-CURSES] 27963 use_env[SUS-CURSES] 27964 def_shell_mode[SUS-CURSES] mvwinchnstr[SUS-CURSES] 27965 vidattr[SUS-CURSES] 27966 del_curterm[SUS-CURSES] mvwinchstr[SUS-CURSES] 27967 vidputs[SUS-CURSES] 27968 delay_output[SUS-CURSES] mvwinnstr[SUS-CURSES] 27969 vline[SUS-CURSES] 27970 delch[SUS-CURSES] mvwinsch[SUS-CURSES] vw_printw[SUS-CURSES] 27971 deleteln[SUS-CURSES] mvwinsnstr[SUS-CURSES] 27972 vw_scanw[SUS-CURSES] 27973 delscreen[SUS-CURSES] mvwinsstr[SUS-CURSES] 27974 vwprintw[SUS-CURSES] 27975 delwin[SUS-CURSES] mvwinstr[SUS-CURSES] vwscanw[SUS-CURSES] 27976 derwin[SUS-CURSES] mvwprintw[SUS-CURSES] waddch[SUS-CURSES] 27977 doupdate[SUS-CURSES] mvwscanw[SUS-CURSES] 27978 waddchnstr[SUS-CURSES] 27979 dupwin[SUS-CURSES] mvwvline[SUS-CURSES] waddchstr[SUS-CURSES] 27980 echo[SUS-CURSES] napms[SUS-CURSES] waddnstr[SUS-CURSES] 27981 echochar[SUS-CURSES] newpad[SUS-CURSES] waddstr[SUS-CURSES] 27982 endwin[SUS-CURSES] newterm[SUS-CURSES] wattr_get[SUS-CURSES] 27983 erase[SUS-CURSES] newwin[SUS-CURSES] wattr_off[SUS-CURSES] 27984 erasechar[SUS-CURSES] nl[SUS-CURSES] wattr_on[SUS-CURSES] 27985 filter[SUS-CURSES] nocbreak[SUS-CURSES] wattr_set[SUS-CURSES] 27986 flash[SUS-CURSES] nodelay[SUS-CURSES] wattroff[SUS-CURSES] 27987 flushinp[SUS-CURSES] noecho[SUS-CURSES] wattron[SUS-CURSES] 27988 getbkgd[SUS-CURSES] nonl[SUS-CURSES] wattrset[SUS-CURSES] 27989 getch[SUS-CURSES] noqiflush[SUS-CURSES] wbkgd[SUS-CURSES] 27990 getnstr[SUS-CURSES] noraw[SUS-CURSES] wbkgdset[SUS-CURSES] 27991 getstr[SUS-CURSES] notimeout[SUS-CURSES] wborder[SUS-CURSES] 27992 getwin[SUS-CURSES] overlay[SUS-CURSES] wchgat[SUS-CURSES] 27993 halfdelay[SUS-CURSES] overwrite[SUS-CURSES] wclear[SUS-CURSES] 27994 has_colors[SUS-CURSES] pair_content[SUS-CURSES] 27995 wclrtobot[SUS-CURSES] 27996 has_ic[SUS-CURSES] pechochar[SUS-CURSES] wclrtoeol[SUS-CURSES] 27997 has_il[SUS-CURSES] pnoutrefresh[SUS-CURSES] 27998 wcolor_set[SUS-CURSES] 27999 hline[SUS-CURSES] prefresh[SUS-CURSES] wcursyncup[SUS-CURSES] 28000 idcok[SUS-CURSES] printw[SUS-CURSES] wdelch[SUS-CURSES] 28001 idlok[SUS-CURSES] putp[SUS-CURSES] wdeleteln[SUS-CURSES] 28002 immedok[SUS-CURSES] putwin[SUS-CURSES] wechochar[SUS-CURSES] 28003 inch[SUS-CURSES] qiflush[SUS-CURSES] werase[SUS-CURSES] 28004 inchnstr[SUS-CURSES] raw[SUS-CURSES] wgetch[SUS-CURSES] 28005 inchstr[SUS-CURSES] redrawwin[SUS-CURSES] wgetnstr[SUS-CURSES] 28006 init_color[SUS-CURSES] refresh[SUS-CURSES] wgetstr[SUS-CURSES] 28007 init_pair[SUS-CURSES] reset_prog_mode[SUS-CURSES] 28008 whline[SUS-CURSES] 28009 initscr[SUS-CURSES] reset_shell_mode[SUS-CURSES] 28010 winch[SUS-CURSES] 28011 innstr[SUS-CURSES] resetty[SUS-CURSES] winchnstr[SUS-CURSES] 28012 insch[SUS-CURSES] restartterm[SUS-CURSES] winchstr[SUS-CURSES] 28013 insdelln[SUS-CURSES] ripoffline[SUS-CURSES] winnstr[SUS-CURSES] 28014 insertln[SUS-CURSES] savetty[SUS-CURSES] winsch[SUS-CURSES] 28015 insnstr[SUS-CURSES] scanw[SUS-CURSES] winsdelln[SUS-CURSES] 28016 insstr[SUS-CURSES] scr_dump[SUS-CURSES] winsertln[SUS-CURSES] 28017 instr[SUS-CURSES] scr_init[SUS-CURSES] winsnstr[SUS-CURSES] 28018 intrflush[SUS-CURSES] scr_restore[SUS-CURSES] 28019 winsstr[SUS-CURSES] 28020 is_linetouched[SUS-CURSES] scr_set[SUS-CURSES] 28021 winstr[SUS-CURSES] 28022 is_wintouched[SUS-CURSES] scrl[SUS-CURSES] wmove[SUS-CURSES] 28023 isendwin[SUS-CURSES] scroll[SUS-CURSES] 28024 wnoutrefresh[SUS-CURSES] 28025 keyname[SUS-CURSES] scrollok[SUS-CURSES] wprintw[SUS-CURSES] 28026 keypad[SUS-CURSES] set_curterm[SUS-CURSES] 28027 wredrawln[SUS-CURSES] 28028 killchar[SUS-CURSES] set_term[SUS-CURSES] wrefresh[SUS-CURSES] 28029 leaveok[SUS-CURSES] setscrreg[SUS-CURSES] wscanw[SUS-CURSES] 28030 longname[SUS-CURSES] setupterm[SUS-CURSES] wscrl[SUS-CURSES] 28031 meta[SUS-CURSES] slk_attr_set[SUS-CURSES] 28032 wsetscrreg[SUS-CURSES] 28033 move[SUS-CURSES] slk_attroff[SUS-CURSES] wstandend[SUS-CURSES] 28034 mvaddch[SUS-CURSES] slk_attron[SUS-CURSES] 28035 wstandout[SUS-CURSES] 28036 mvaddchnstr[SUS-CURSES] slk_attrset[SUS-CURSES] 28037 wsyncdown[SUS-CURSES] 28038 mvaddchstr[SUS-CURSES] slk_clear[SUS-CURSES] 28039 wsyncup[SUS-CURSES] 28040 mvaddnstr[SUS-CURSES] slk_color[SUS-CURSES] 28041 wtimeout[SUS-CURSES] 28042 mvaddstr[SUS-CURSES] slk_init[SUS-CURSES] wtouchln[SUS-CURSES] 28043 mvchgat[SUS-CURSES] slk_label[SUS-CURSES] wvline[SUS-CURSES] 28044 mvcur[SUS-CURSES] slk_noutrefresh[SUS-CURSES] 28045 28046 Table A-8. libncurses Data Interfaces 28047 COLORS[SUS-CURSES] LINES[SUS-CURSES] curscr[SUS-CURSES] 28048 COLOR_PAIRS[SUS-CURSES] acs_map[SUS-CURSES] stdscr[SUS-CURSES] 28049 COLS[SUS-CURSES] cur_term[SUS-CURSES] 28050 __________________________________________________________ 28051 28052 A.6. libpam 28053 28054 The behavior of the interfaces in this library is specified by 28055 the following Standards. 28056 28057 This Specification [LSB] 28058 28059 Table A-9. libpam Function Interfaces 28060 pam_acct_mgmt[LSB] pam_fail_delay[LSB] pam_putenv[LSB] 28061 pam_authenticate[LSB] pam_get_item[LSB] pam_set_item[LSB] 28062 pam_chauthtok[LSB] pam_getenv[LSB] pam_setcred[LSB] 28063 pam_close_session[LSB] pam_getenvlist[LSB] pam_start[LSB] 28064 pam_end[LSB] pam_open_session[LSB] pam_strerror[LSB] 28065 __________________________________________________________ 28066 28067 A.7. libpthread 28068 28069 The behavior of the interfaces in this library is specified by 28070 the following Standards. 28071 28072 Large File Support [LFS] 28073 This Specification [LSB] 28074 ISO POSIX (2003) [SUSv3] 28075 28076 Table A-10. libpthread Function Interfaces 28077 _pthread_cleanup_pop[LSB] pthread_cond_init[SUSv3] 28078 pthread_rwlock_timedrdlock[SUSv3] 28079 _pthread_cleanup_push[LSB] pthread_cond_signal[SUSv3] 28080 pthread_rwlock_timedwrlock[SUSv3] 28081 lseek64[LFS] pthread_cond_timedwait[SUSv3] 28082 pthread_rwlock_tryrdlock[SUSv3] 28083 open64[LFS] pthread_cond_wait[SUSv3] 28084 pthread_rwlock_trywrlock[SUSv3] 28085 pread[SUSv3] pthread_condattr_destroy[SUSv3] 28086 pthread_rwlock_unlock[SUSv3] 28087 pread64[LFS] pthread_condattr_getpshared[SUSv3] 28088 pthread_rwlock_wrlock[SUSv3] 28089 pthread_attr_destroy[SUSv3] pthread_condattr_init[SUSv3] 28090 pthread_rwlockattr_destroy[SUSv3] 28091 pthread_attr_getdetachstate[SUSv3] 28092 pthread_condattr_setpshared[SUSv3] 28093 pthread_rwlockattr_getpshared[SUSv3] 28094 pthread_attr_getguardsize[SUSv3] pthread_create[SUSv3] 28095 pthread_rwlockattr_init[SUSv3] 28096 pthread_attr_getinheritsched[SUSv3] pthread_detach[SUSv3] 28097 pthread_rwlockattr_setpshared[SUSv3] 28098 pthread_attr_getschedparam[SUSv3] pthread_equal[SUSv3] 28099 pthread_self[SUSv3] 28100 pthread_attr_getschedpolicy[SUSv3] pthread_exit[SUSv3] 28101 pthread_setcancelstate[SUSv3] 28102 pthread_attr_getscope[SUSv3] pthread_getconcurrency[SUSv3] 28103 pthread_setcanceltype[SUSv3] 28104 pthread_attr_getstack[SUSv3] pthread_getcpuclockid[SUSv3] 28105 pthread_setconcurrency[SUSv3] 28106 pthread_attr_getstackaddr[SUSv3] pthread_getschedparam[SUSv3] 28107 pthread_setschedparam[SUSv3] 28108 pthread_attr_getstacksize[SUSv3] pthread_getspecific[SUSv3] 28109 pthread_setschedprio(GLIBC_2.3.4)[SUSv3] 28110 pthread_attr_init[SUSv3] pthread_join[SUSv3] 28111 pthread_setspecific[SUSv3] 28112 pthread_attr_setdetachstate[SUSv3] pthread_key_create[SUSv3] 28113 pthread_sigmask[SUSv3] 28114 pthread_attr_setguardsize[SUSv3] pthread_key_delete[SUSv3] 28115 pthread_spin_destroy[SUSv3] 28116 pthread_attr_setinheritsched[SUSv3] pthread_kill[SUSv3] 28117 pthread_spin_init[SUSv3] 28118 pthread_attr_setschedparam[SUSv3] pthread_mutex_destroy[SUSv3] 28119 pthread_spin_lock[SUSv3] 28120 pthread_attr_setschedpolicy[SUSv3] pthread_mutex_init[SUSv3] 28121 pthread_spin_trylock[SUSv3] 28122 pthread_attr_setscope[SUSv3] pthread_mutex_lock[SUSv3] 28123 pthread_spin_unlock[SUSv3] 28124 pthread_attr_setstack[SUSv3] pthread_mutex_timedlock[SUSv3] 28125 pthread_testcancel[SUSv3] 28126 pthread_attr_setstackaddr[SUSv3] pthread_mutex_trylock[SUSv3] 28127 pwrite[SUSv3] 28128 pthread_attr_setstacksize[SUSv3] pthread_mutex_unlock[SUSv3] 28129 pwrite64[LFS] 28130 pthread_barrier_destroy[SUSv3] pthread_mutexattr_destroy[SUSv3] 28131 sem_close[SUSv3] 28132 pthread_barrier_init[SUSv3] pthread_mutexattr_getpshared[SUSv3] 28133 sem_destroy[SUSv3] 28134 pthread_barrier_wait[SUSv3] pthread_mutexattr_gettype[SUSv3] 28135 sem_getvalue[SUSv3] 28136 pthread_barrierattr_destroy[SUSv3] 28137 pthread_mutexattr_init[SUSv3] sem_init[SUSv3] 28138 pthread_barrierattr_getpshared(GLIBC_2.3.3)[SUSv3] 28139 pthread_mutexattr_setpshared[SUSv3] sem_open[SUSv3] 28140 pthread_barrierattr_init[SUSv3] 28141 pthread_mutexattr_settype[SUSv3] sem_post[SUSv3] 28142 pthread_barrierattr_setpshared[SUSv3] pthread_once[SUSv3] 28143 sem_timedwait[SUSv3] 28144 pthread_cancel[SUSv3] pthread_rwlock_destroy[SUSv3] 28145 sem_trywait[SUSv3] 28146 pthread_cond_broadcast[SUSv3] pthread_rwlock_init[SUSv3] 28147 sem_unlink[SUSv3] 28148 pthread_cond_destroy[SUSv3] pthread_rwlock_rdlock[SUSv3] 28149 sem_wait[SUSv3] 28150 __________________________________________________________ 28151 28152 A.8. librt 28153 28154 The behavior of the interfaces in this library is specified by 28155 the following Standards. 28156 28157 ISO POSIX (2003) [SUSv3] 28158 28159 Table A-11. librt Function Interfaces 28160 clock_getcpuclockid[SUSv3] mq_open(GLIBC_2.3.4)[SUSv3] 28161 shm_unlink[SUSv3] 28162 clock_getres[SUSv3] mq_receive(GLIBC_2.3.4)[SUSv3] 28163 timer_create[SUSv3] 28164 clock_gettime[SUSv3] mq_send(GLIBC_2.3.4)[SUSv3] 28165 timer_delete[SUSv3] 28166 clock_nanosleep[SUSv3] mq_setattr(GLIBC_2.3.4)[SUSv3] 28167 timer_getoverrun[SUSv3] 28168 clock_settime[SUSv3] mq_timedreceive(GLIBC_2.3.4)[SUSv3] 28169 timer_gettime[SUSv3] 28170 mq_close(GLIBC_2.3.4)[SUSv3] mq_timedsend(GLIBC_2.3.4)[SUSv3] 28171 timer_settime[SUSv3] 28172 mq_getattr(GLIBC_2.3.4)[SUSv3] mq_unlink(GLIBC_2.3.4)[SUSv3] 28173 mq_notify(GLIBC_2.3.4)[SUSv3] shm_open[SUSv3] 28174 __________________________________________________________ 28175 28176 A.9. libutil 28177 28178 The behavior of the interfaces in this library is specified by 28179 the following Standards. 28180 28181 This Specification [LSB] 28182 28183 Table A-12. libutil Function Interfaces 28184 forkpty[LSB] login_tty[LSB] logwtmp[LSB] 28185 login[LSB] logout[LSB] openpty[LSB] 28186 __________________________________________________________ 28187 28188 A.10. libz 28189 28190 The behavior of the interfaces in this library is specified by 28191 the following Standards. 28192 28193 This Specification [LSB] 28194 28195 Table A-13. libz Function Interfaces 28196 adler32[LSB] gzclose[LSB] gztell[LSB] 28197 compress[LSB] gzdopen[LSB] gzwrite[LSB] 28198 compress2[LSB] gzeof[LSB] inflate[LSB] 28199 compressBound[LSB] gzerror[LSB] inflateEnd[LSB] 28200 crc32[LSB] gzflush[LSB] inflateInit2_[LSB] 28201 deflate[LSB] gzgetc[LSB] inflateInit_[LSB] 28202 deflateBound[LSB] gzgets[LSB] inflateReset[LSB] 28203 deflateCopy[LSB] gzopen[LSB] inflateSetDictionary[LSB] 28204 deflateEnd[LSB] gzprintf[LSB] inflateSync[LSB] 28205 deflateInit2_[LSB] gzputc[LSB] inflateSyncPoint[LSB] 28206 deflateInit_[LSB] gzputs[LSB] uncompress[LSB] 28207 deflateParams[LSB] gzread[LSB] zError[LSB] 28208 deflateReset[LSB] gzrewind[LSB] zlibVersion[LSB] 28209 deflateSetDictionary[LSB] gzseek[LSB] 28210 get_crc_table[LSB] gzsetparams[LSB] 28211 __________________________________________________________ 28212 28213 Appendix B. Future Directions (Informative) 28214 28215 B.1. Introduction 28216 28217 This appendix describes interfaces that are under development 28218 and aimed at future releases of this specification. At this 28219 stage, such interfaces are at best recommended practice, and do 28220 not constitute normative requirements of this specification. 28221 Applications may not assume that any system provides these 28222 interfaces. 28223 28224 We encourage system implementors and ISVs to provide these 28225 interfaces, and to provide feedback on their specification to 28226 lsbspec@freestandards.org. These interfaces may well be further 28227 modified during the development process, and may be withdrawn 28228 if concensus cannot be reached. 28229 __________________________________________________________ 28230 28231 B.2. Commands And Utilities 28232 28233 Table of Contents 28234 lsbinstall -- installation tool for various types of data 28235 28236 lsbinstall 28237 28238 Name 28239 28240 lsbinstall -- installation tool for various types of data 28241 28242 Synopsis 28243 28244 /usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] { -t 28245 type | --type=type } [-p package | --package=package] 28246 operand... 28247 28248 Description 28249 28250 The lsbinstall utility may be used to install certain types of 28251 files into system specific locations, repositories, or 28252 databases. This command may be used during a package post 28253 installation script to add package specific data to system wide 28254 repositories. A user may need appropriate privilege to invoke 28255 lsbinstall. 28256 28257 The operand (or operands) name an object of type type (see 28258 below) that belongs to a package named package. The combination 28259 of package name, object type and object name should be unique 28260 amongst all objects installed by lsbinstall. The lsbinstall 28261 utility may rename an object if another package already owns an 28262 object of the same type with the same name. 28263 28264 Note: If a namespace collision is detected by lsbinstall, it 28265 is unspecified how the object is renamed, although typical 28266 implementations may prepend the package name to the object 28267 in some way (e.g. package.obj-name). The lsbinstall utility 28268 may maintain a database of the mappings it has performed 28269 during installation in order to ensure that the correct 28270 object is removed during a subsequent removal operation. 28271 28272 Scripts installed by lsbinstall should not make use of the 28273 script name in order to decide on their functionality. 28274 28275 Note: It is appropriate for such a script to use the script 28276 name in error messages, usage statements, etc. The only 28277 guarantee made by lsbinstall is the effect that an 28278 installation (or removal) should have, not where a script is 28279 installed, or how it is named. 28280 28281 The -p pkg or --package=pkg is required for all object types 28282 unless explicitly noted below. 28283 28284 If the -c or --check option is specified, lsbinstall should 28285 test to see if there is an existing object of the type 28286 specified already installed. If there is, lsbinstall should 28287 print a message to its standard output and immediately exit 28288 with a status of zero. If there is no object of the type and 28289 name specified already installed, lsbinstall should exit with a 28290 non-zero status and take no further action. 28291 28292 If the -r or --remove is specified, the named object of the 28293 specified type should be removed or disabled from the system, 28294 except as noted below. The behavior is unspecified if the named 28295 object was not previously installed by lsbinstall. 28296 28297 Note: lsbinstall may rename objects during installation in 28298 order to prevent name collisions where another package has 28299 already installed an object with the given name. Using 28300 lsbinstall --remove will remove only the object belonging to 28301 the named package, and not the object belonging to another 28302 package. 28303 28304 Also note that the intent of the --remove option is to 28305 prevent the effect of the installed object; it should be 28306 sufficient to disable or comment out the addition in some 28307 way, while leaving the content behind. It is not intended 28308 that --remove be required to be the exact reverse of 28309 installation. 28310 28311 Object Types 28312 28313 The -t type or --type=type option should support at least the 28314 following types: 28315 28316 profile 28317 28318 install a profile script into a system specific location. There 28319 should be one operand, that names a profile shell script. The 28320 behavior is unspecified if this name does not have the suffix 28321 .sh. 28322 28323 The sh utility should read and execute commands in its current 28324 execution environment from all such installed profile shell 28325 scripts when invoked as an interactive login shell, or if the 28326 -l (the letter ell) is specified (see Shell Invocation). 28327 service 28328 28329 ensure a service name and number pair is known to the system 28330 service database. When installing, there must be at least two 28331 operands. The first operand should have the format %d/%s with 28332 the port number and protocol values (e.g. 22/tcp), and the 28333 second operand should be the name of the service. Any 28334 subsequent operands provide aliases for this service. The -p 28335 pkg or --package=pkg option is not required for service 28336 objects, and is ignored if specified. If any of the -r, 28337 --remove, -c or --check options are specified, there should be 28338 a single operand identifying the port and protocol values (with 28339 the same format as above). 28340 28341 It should not be an error to attempt to add a service name to 28342 the system service database if that service name already exists 28343 for the same port and protocol combination. If the port and 28344 protocol combination was already present, but the name unknown, 28345 the name should be added as an alias to the existing entry. It 28346 should be an error to attempt to add a second entry for a given 28347 service name and protocol, but where the port number differs 28348 from an existing entry. 28349 28350 If the -r or --remove is specified, the system service database 28351 need not be updated to remove or disable the named service. 28352 inet 28353 28354 add an entry to the system's network super daemon 28355 configuration. If none of the -r, --remove, -c or --check 28356 options are specified, the first operand should have the 28357 format: 28358 "%s:%s:%s:%s:%s:%s" 28359 28360 Otherwise, the first operand should have the format 28361 "%s:%s" 28362 28363 The fields in the first operand have the following meaning, in 28364 order: 28365 28366 svc_name 28367 28368 The name of this service. If the name does not contain a /, 28369 this should match the name of an already installed service (see 28370 also getservbyname()). If the name contains a / character, the 28371 behavior is unspecified. 28372 28373 Rationale: This version of the LSB does not specify 28374 getrpcbyname() nor the existence or format of the /etc/rpc 28375 file. Therefore, installation of RPC based services is not 28376 specified at this point. A future version of this 28377 specification may require names containing a / character to 28378 be Remote Procedure Call based services. 28379 28380 protocol 28381 28382 The name of a protocol. The name should be one of those listed 28383 in /etc/protocols. If this attribute is not specified (i.e. a 28384 null value is passed), the system should use an implementation 28385 defined default protocol. 28386 socket_type 28387 28388 One of the following values: 28389 28390 stream 28391 28392 the service will use a stream type socket. 28393 dgram 28394 28395 the service will use a datagram type socket. 28396 seqpacket 28397 28398 the service will use a sequenced packet type socket. 28399 This field is not required for the -c, --check, -r, or --remove 28400 options. 28401 wait_flag 28402 28403 If the value of this attribute is wait, once the service is 28404 started, no further requests for that service will be handled 28405 until the service exits. If the value is nowait, the network 28406 super daemon should continue to handle further requests for the 28407 given service while that service is running. 28408 28409 Note: If the service has the socket_type attribute set to 28410 dgram, the wait_flag attribute should be set to wait, since 28411 such services do not have any distinction between the socket 28412 used for listening and that used for accepting. 28413 28414 This field is not required for the -c, --check, -r, or --remove 28415 options. 28416 user[.group] 28417 28418 The name of a user from the user login database, optionally 28419 followed by the name of a group from the group database. The 28420 service started to handle this request should run with the 28421 privileges of the specified user and group. This field is not 28422 required for the -c, --check, -r, or --remove options. 28423 server [arg ...] 28424 28425 The name of a program to run to handle the request, optionally 28426 followed by any arguments required. The server name and each of 28427 its arguments is separated by whitespace. This field is not 28428 required for the -c, --check, -r, or --remove options. 28429 If the implementation supports additional controls over 28430 services started through the inet super daemon, there may be 28431 additional, implementation-defined, operands. 28432 28433 Rationale: Systems that use the xinetd super daemon may 28434 support additional controls such as IP address restrictions, 28435 logging requirements, etc. The LSB does not require these 28436 additional controls. However, it was believed to be of 28437 sufficient benefit that implementations are granted 28438 permission to extend this interface as required. 28439 28440 Examples 28441 28442 lsbinstall --package=myapp --type=profile myco.com-prod.sh 28443 28444 Install the profile shell script for myco.com-prod.sh, part of 28445 the myapp package.. 28446 lsbinstall --package=myapp --check --type=profile myco.com-prod.sh 28447 28448 Test to see if the profile shell script for myco.com-prod.sh, 28449 as part of the myapp package, is installed correctly. 28450 28451 Exit Status 28452 28453 If the -c or --check option is specified, lsbinstall should 28454 exit with a zero status if an object of the specified type and 28455 name is already installed, or non-zero otherwise. Otherwise, 28456 lsbinstall should exit with a zero status if the object with 28457 the specified type and name was successfully installed (or 28458 removed if the -r or --remove option was specified), and 28459 non-zero if the installation (or removal) failed. On failure, a 28460 diagnostic message should be printed to the standard error file 28461 descriptor. 28462 __________________________________________________________ 28463 28464 Appendix C. GNU Free Documentation License (Informative) 28465 28466 This specification is published under the terms of the GNU Free 28467 Documentation License, Version 1.1, March 2000 28468 28469 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 28470 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 28471 permitted to copy and distribute verbatim copies of this 28472 license document, but changing it is not allowed. 28473 __________________________________________________________ 28474 28475 C.1. PREAMBLE 28476 28477 The purpose of this License is to make a manual, textbook, or 28478 other written document "free" in the sense of freedom: to 28479 assure everyone the effective freedom to copy and redistribute 28480 it, with or without modifying it, either commercially or 28481 noncommercially. Secondarily, this License preserves for the 28482 author and publisher a way to get credit for their work, while 28483 not being considered responsible for modifications made by 28484 others. 28485 28486 This License is a kind of "copyleft", which means that 28487 derivative works of the document must themselves be free in the 28488 same sense. It complements the GNU General Public License, 28489 which is a copyleft license designed for free software. 28490 28491 We have designed this License in order to use it for manuals 28492 for free software, because free software needs free 28493 documentation: a free program should come with manuals 28494 providing the same freedoms that the software does. But this 28495 License is not limited to software manuals; it can be used for 28496 any textual work, regardless of subject matter or whether it is 28497 published as a printed book. We recommend this License 28498 principally for works whose purpose is instruction or 28499 reference. 28500 __________________________________________________________ 28501 28502 C.2. APPLICABILITY AND DEFINITIONS 28503 28504 This License applies to any manual or other work that contains 28505 a notice placed by the copyright holder saying it can be 28506 distributed under the terms of this License. The "Document", 28507 below, refers to any such manual or work. Any member of the 28508 public is a licensee, and is addressed as "you". 28509 28510 A "Modified Version" of the Document means any work containing 28511 the Document or a portion of it, either copied verbatim, or 28512 with modifications and/or translated into another language. 28513 28514 A "Secondary Section" is a named appendix or a front-matter 28515 section of the Document that deals exclusively with the 28516 relationship of the publishers or authors of the Document to 28517 the Document's overall subject (or to related matters) and 28518 contains nothing that could fall directly within that overall 28519 subject. (For example, if the Document is in part a textbook of 28520 mathematics, a Secondary Section may not explain any 28521 mathematics.) The relationship could be a matter of historical 28522 connection with the subject or with related matters, or of 28523 legal, commercial, philosophical, ethical or political position 28524 regarding them. 28525 28526 The "Invariant Sections" are certain Secondary Sections whose 28527 titles are designated, as being those of Invariant Sections, in 28528 the notice that says that the Document is released under this 28529 License. 28530 28531 The "Cover Texts" are certain short passages of text that are 28532 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 28533 that says that the Document is released under this License. 28534 28535 A "Transparent" copy of the Document means a machine-readable 28536 copy, represented in a format whose specification is available 28537 to the general public, whose contents can be viewed and edited 28538 directly and straightforwardly with generic text editors or 28539 (for images composed of pixels) generic paint programs or (for 28540 drawings) some widely available drawing editor, and that is 28541 suitable for input to text formatters or for automatic 28542 translation to a variety of formats suitable for input to text 28543 formatters. A copy made in an otherwise Transparent file format 28544 whose markup has been designed to thwart or discourage 28545 subsequent modification by readers is not Transparent. A copy 28546 that is not "Transparent" is called "Opaque". 28547 28548 Examples of suitable formats for Transparent copies include 28549 plain ASCII without markup, Texinfo input format, LaTeX input 28550 format, SGML or XML using a publicly available DTD, and 28551 standard-conforming simple HTML designed for human 28552 modification. Opaque formats include PostScript, PDF, 28553 proprietary formats that can be read and edited only by 28554 proprietary word processors, SGML or XML for which the DTD 28555 and/or processing tools are not generally available, and the 28556 machine-generated HTML produced by some word processors for 28557 output purposes only. 28558 28559 The "Title Page" means, for a printed book, the title page 28560 itself, plus such following pages as are needed to hold, 28561 legibly, the material this License requires to appear in the 28562 title page. For works in formats which do not have any title 28563 page as such, "Title Page" means the text near the most 28564 prominent appearance of the work's title, preceding the 28565 beginning of the body of the text. 28566 __________________________________________________________ 28567 28568 C.3. VERBATIM COPYING 28569 28570 You may copy and distribute the Document in any medium, either 28571 commercially or noncommercially, provided that this License, 28572 the copyright notices, and the license notice saying this 28573 License applies to the Document are reproduced in all copies, 28574 and that you add no other conditions whatsoever to those of 28575 this License. You may not use technical measures to obstruct or 28576 control the reading or further copying of the copies you make 28577 or distribute. However, you may accept compensation in exchange 28578 for copies. If you distribute a large enough number of copies 28579 you must also follow the conditions in section 3. 28580 28581 You may also lend copies, under the same conditions stated 28582 above, and you may publicly display copies. 28583 __________________________________________________________ 28584 28585 C.4. COPYING IN QUANTITY 28586 28587 If you publish printed copies of the Document numbering more 28588 than 100, and the Document's license notice requires Cover 28589 Texts, you must enclose the copies in covers that carry, 28590 clearly and legibly, all these Cover Texts: Front-Cover Texts 28591 on the front cover, and Back-Cover Texts on the back cover. 28592 Both covers must also clearly and legibly identify you as the 28593 publisher of these copies. The front cover must present the 28594 full title with all words of the title equally prominent and 28595 visible. You may add other material on the covers in addition. 28596 Copying with changes limited to the covers, as long as they 28597 preserve the title of the Document and satisfy these 28598 conditions, can be treated as verbatim copying in other 28599 respects. 28600 28601 If the required texts for either cover are too voluminous to 28602 fit legibly, you should put the first ones listed (as many as 28603 fit reasonably) on the actual cover, and continue the rest onto 28604 adjacent pages. 28605 28606 If you publish or distribute Opaque copies of the Document 28607 numbering more than 100, you must either include a 28608 machine-readable Transparent copy along with each Opaque copy, 28609 or state in or with each Opaque copy a publicly-accessible 28610 computer-network location containing a complete Transparent 28611 copy of the Document, free of added material, which the general 28612 network-using public has access to download anonymously at no 28613 charge using public-standard network protocols. If you use the 28614 latter option, you must take reasonably prudent steps, when you 28615 begin distribution of Opaque copies in quantity, to ensure that 28616 this Transparent copy will remain thus accessible at the stated 28617 location until at least one year after the last time you 28618 distribute an Opaque copy (directly or through your agents or 28619 retailers) of that edition to the public. 28620 28621 It is requested, but not required, that you contact the authors 28622 of the Document well before redistributing any large number of 28623 copies, to give them a chance to provide you with an updated 28624 version of the Document. 28625 __________________________________________________________ 28626 28627 C.5. MODIFICATIONS 28628 28629 You may copy and distribute a Modified Version of the Document 28630 under the conditions of sections 2 and 3 above, provided that 28631 you release the Modified Version under precisely this License, 28632 with the Modified Version filling the role of the Document, 28633 thus licensing distribution and modification of the Modified 28634 Version to whoever possesses a copy of it. In addition, you 28635 must do these things in the Modified Version: 28636 28637 A. Use in the Title Page (and on the covers, if any) a title 28638 distinct from that of the Document, and from those of 28639 previous versions (which should, if there were any, be 28640 listed in the History section of the Document). You may use 28641 the same title as a previous version if the original 28642 publisher of that version gives permission. 28643 B. List on the Title Page, as authors, one or more persons or 28644 entities responsible for authorship of the modifications in 28645 the Modified Version, together with at least five of the 28646 principal authors of the Document (all of its principal 28647 authors, if it has less than five). 28648 C. State on the Title page the name of the publisher of the 28649 Modified Version, as the publisher. 28650 D. Preserve all the copyright notices of the Document. 28651 E. Add an appropriate copyright notice for your modifications 28652 adjacent to the other copyright notices. 28653 F. Include, immediately after the copyright notices, a license 28654 notice giving the public permission to use the Modified 28655 Version under the terms of this License, in the form shown 28656 in the Addendum below. 28657 G. Preserve in that license notice the full lists of Invariant 28658 Sections and required Cover Texts given in the Document's 28659 license notice. 28660 H. Include an unaltered copy of this License. 28661 I. Preserve the section entitled "History", and its title, and 28662 add to it an item stating at least the title, year, new 28663 authors, and publisher of the Modified Version as given on 28664 the Title Page. If there is no section entitled "History" 28665 in the Document, create one stating the title, year, 28666 authors, and publisher of the Document as given on its 28667 Title Page, then add an item describing the Modified 28668 Version as stated in the previous sentence. 28669 J. Preserve the network location, if any, given in the 28670 Document for public access to a Transparent copy of the 28671 Document, and likewise the network locations given in the 28672 Document for previous versions it was based on. These may 28673 be placed in the "History" section. You may omit a network 28674 location for a work that was published at least four years 28675 before the Document itself, or if the original publisher of 28676 the version it refers to gives permission. 28677 K. In any section entitled "Acknowledgements" or 28678 "Dedications", preserve the section's title, and preserve 28679 in the section all the substance and tone of each of the 28680 contributor acknowledgements and/or dedications given 28681 therein. 28682 L. Preserve all the Invariant Sections of the Document, 28683 unaltered in their text and in their titles. Section 28684 numbers or the equivalent are not considered part of the 28685 section titles. 28686 M. Delete any section entitled "Endorsements". Such a section 28687 may not be included in the Modified Version. 28688 N. Do not retitle any existing section as "Endorsements" or to 28689 conflict in title with any Invariant Section. 28690 28691 If the Modified Version includes new front-matter sections or 28692 appendices that qualify as Secondary Sections and contain no 28693 material copied from the Document, you may at your option 28694 designate some or all of these sections as invariant. To do 28695 this, add their titles to the list of Invariant Sections in the 28696 Modified Version's license notice. These titles must be 28697 distinct from any other section titles. 28698 28699 You may add a section entitled "Endorsements", provided it 28700 contains nothing but endorsements of your Modified Version by 28701 various parties--for example, statements of peer review or that 28702 the text has been approved by an organization as the 28703 authoritative definition of a standard. 28704 28705 You may add a passage of up to five words as a Front-Cover 28706 Text, and a passage of up to 25 words as a Back-Cover Text, to 28707 the end of the list of Cover Texts in the Modified Version. 28708 Only one passage of Front-Cover Text and one of Back-Cover Text 28709 may be added by (or through arrangements made by) any one 28710 entity. If the Document already includes a cover text for the 28711 same cover, previously added by you or by arrangement made by 28712 the same entity you are acting on behalf of, you may not add 28713 another; but you may replace the old one, on explicit 28714 permission from the previous publisher that added the old one. 28715 28716 The author(s) and publisher(s) of the Document do not by this 28717 License give permission to use their names for publicity for or 28718 to assert or imply endorsement of any Modified Version. 28719 __________________________________________________________ 28720 28721 C.6. COMBINING DOCUMENTS 28722 28723 You may combine the Document with other documents released 28724 under this License, under the terms defined in section 4 above 28725 for modified versions, provided that you include in the 28726 combination all of the Invariant Sections of all of the 28727 original documents, unmodified, and list them all as Invariant 28728 Sections of your combined work in its license notice. 28729 28730 The combined work need only contain one copy of this License, 28731 and multiple identical Invariant Sections may be replaced with 28732 a single copy. If there are multiple Invariant Sections with 28733 the same name but different contents, make the title of each 28734 such section unique by adding at the end of it, in parentheses, 28735 the name of the original author or publisher of that section if 28736 known, or else a unique number. Make the same adjustment to the 28737 section titles in the list of Invariant Sections in the license 28738 notice of the combined work. 28739 28740 In the combination, you must combine any sections entitled 28741 "History" in the various original documents, forming one 28742 section entitled "History"; likewise combine any sections 28743 entitled "Acknowledgements", and any sections entitled 28744 "Dedications". You must delete all sections entitled 28745 "Endorsements." 28746 __________________________________________________________ 28747 28748 C.7. COLLECTIONS OF DOCUMENTS 28749 28750 You may make a collection consisting of the Document and other 28751 documents released under this License, and replace the 28752 individual copies of this License in the various documents with 28753 a single copy that is included in the collection, provided that 28754 you follow the rules of this License for verbatim copying of 28755 each of the documents in all other respects. 28756 28757 You may extract a single document from such a collection, and 28758 distribute it individually under this License, provided you 28759 insert a copy of this License into the extracted document, and 28760 follow this License in all other respects regarding verbatim 28761 copying of that document. 28762 __________________________________________________________ 28763 28764 C.8. AGGREGATION WITH INDEPENDENT WORKS 28765 28766 A compilation of the Document or its derivatives with other 28767 separate and independent documents or works, in or on a volume 28768 of a storage or distribution medium, does not as a whole count 28769 as a Modified Version of the Document, provided no compilation 28770 copyright is claimed for the compilation. Such a compilation is 28771 called an "aggregate", and this License does not apply to the 28772 other self-contained works thus compiled with the Document, on 28773 account of their being thus compiled, if they are not 28774 themselves derivative works of the Document. 28775 28776 If the Cover Text requirement of section 3 is applicable to 28777 these copies of the Document, then if the Document is less than 28778 one quarter of the entire aggregate, the Document's Cover Texts 28779 may be placed on covers that surround only the Document within 28780 the aggregate. Otherwise they must appear on covers around the 28781 whole aggregate. 28782 __________________________________________________________ 28783 28784 C.9. TRANSLATION 28785 28786 Translation is considered a kind of modification, so you may 28787 distribute translations of the Document under the terms of 28788 section 4. Replacing Invariant Sections with translations 28789 requires special permission from their copyright holders, but 28790 you may include translations of some or all Invariant Sections 28791 in addition to the original versions of these Invariant 28792 Sections. You may include a translation of this License 28793 provided that you also include the original English version of 28794 this License. In case of a disagreement between the translation 28795 and the original English version of this License, the original 28796 English version will prevail. 28797 __________________________________________________________ 28798 28799 C.10. TERMINATION 28800 28801 You may not copy, modify, sublicense, or distribute the 28802 Document except as expressly provided for under this License. 28803 Any other attempt to copy, modify, sublicense or distribute the 28804 Document is void, and will automatically terminate your rights 28805 under this License. However, parties who have received copies, 28806 or rights, from you under this License will not have their 28807 licenses terminated so long as such parties remain in full 28808 compliance. 28809 __________________________________________________________ 28810 28811 C.11. FUTURE REVISIONS OF THIS LICENSE 28812 28813 The Free Software Foundation may publish new, revised versions 28814 of the GNU Free Documentation License from time to time. Such 28815 new versions will be similar in spirit to the present version, 28816 but may differ in detail to address new problems or concerns. 28817 See http://www.gnu.org/copyleft/. 28818 28819 Each version of the License is given a distinguishing version 28820 number. If the Document specifies that a particular numbered 28821 version of this License "or any later version" applies to it, 28822 you have the option of following the terms and conditions 28823 either of that specified version or of any later version that 28824 has been published (not as a draft) by the Free Software 28825 Foundation. If the Document does not specify a version number 28826 of this License, you may choose any version ever published (not 28827 as a draft) by the Free Software Foundation. 28828 __________________________________________________________ 28829 28830 C.12. How to use this License for your documents 28831 28832 To use this License in a document you have written, include a 28833 copy of the License in the document and put the following 28834 copyright and license notices just after the title page: 28835 28836 Copyright (c) YEAR YOUR NAME. Permission is granted to copy, 28837 distribute and/or modify this document under the terms of 28838 the GNU Free Documentation License, Version 1.1 or any later 28839 version published by the Free Software Foundation; with the 28840 Invariant Sections being LIST THEIR TITLES, with the 28841 Front-Cover Texts being LIST, and with the Back-Cover Texts 28842 being LIST. A copy of the license is included in the section 28843 entitled "GNU Free Documentation License". 28844 28845 If you have no Invariant Sections, write "with no Invariant 28846 Sections" instead of saying which ones are invariant. If you 28847 have no Front-Cover Texts, write "no Front-Cover Texts" instead 28848 of "Front-Cover Texts being LIST"; likewise for Back-Cover 28849 Texts. 28850 28851 If your document contains nontrivial examples of program code, 28852 we recommend releasing these examples in parallel under your 28853 choice of free software license, such as the GNU General Public 28854 License, to permit their use in free software.