1 Linux Standard Base Core Specification 4.0 2 3 Copyright © 2008 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. Interface Definitions for libncurses 144 14.8. Interfaces for libutil 145 14.9. Interface Definitions for libutil 146 147 V. Commands and Utilities 148 149 15. Commands and Utilities 150 151 15.1. Commands and Utilities 152 15.2. Command Behavior 153 154 VI. Execution Environment 155 156 16. File System Hierarchy 157 158 16.1. /dev: Device Files 159 16.2. /etc: Host-specific system configuration 160 16.3. User Accounting Databases 161 16.4. Path For System Administration Utilities 162 163 17. Additional Recommendations 164 165 17.1. Recommendations for applications on ownership 166 and permissions 167 168 18. Additional Behaviors 169 170 18.1. Mandatory Optional Behaviors 171 18.2. Optional Mandatory Behaviors 172 18.3. Executable Scripts 173 174 19. Localization 175 176 19.1. Introduction 177 19.2. Regular Expressions 178 19.3. Pattern Matching Notation 179 180 VII. System Initialization 181 182 20. System Initialization 183 184 20.1. Cron Jobs 185 20.2. Init Script Actions 186 20.3. Comment Conventions for Init Scripts 187 20.4. Installation and Removal of Init Scripts 188 20.5. Run Levels 189 20.6. Facility Names 190 20.7. Script Names 191 20.8. Init Script Functions 192 193 VIII. Users & Groups 194 195 21. Users & Groups 196 197 21.1. User and Group Database 198 21.2. User & Group Names 199 21.3. User ID Ranges 200 21.4. Rationale 201 202 IX. Package Format and Installation 203 204 22. Software Installation 205 206 22.1. Introduction 207 22.2. Package File Format 208 22.3. Package Script Restrictions 209 22.4. Package Tools 210 22.5. Package Naming 211 22.6. Package Dependencies 212 22.7. Package Architecture Considerations 213 214 A. Alphabetical Listing of Interfaces 215 216 A.1. libc 217 A.2. libcrypt 218 A.3. libdl 219 A.4. libm 220 A.5. libncurses 221 A.6. libpam 222 A.7. libpthread 223 A.8. librt 224 A.9. libutil 225 A.10. libz 226 227 B. Future Directions (Informative) 228 229 B.1. Introduction 230 B.2. Commands And Utilities 231 232 lsbinstall -- installation tool for various types of 233 data 234 235 C. GNU Free Documentation License (Informative) 236 237 C.1. PREAMBLE 238 C.2. APPLICABILITY AND DEFINITIONS 239 C.3. VERBATIM COPYING 240 C.4. COPYING IN QUANTITY 241 C.5. MODIFICATIONS 242 C.6. COMBINING DOCUMENTS 243 C.7. COLLECTIONS OF DOCUMENTS 244 C.8. AGGREGATION WITH INDEPENDENT WORKS 245 C.9. TRANSLATION 246 C.10. TERMINATION 247 C.11. FUTURE REVISIONS OF THIS LICENSE 248 C.12. How to use this License for your documents 249 250 List of Figures 251 11-1. Version Definition Entries 252 11-2. Version Definition Auxiliary Entries 253 11-3. Version Needed Entries 254 11-4. Version Needed Auxiliary Entries 255 12-1. Dynamic Structure 256 257 List of Tables 258 2-1. Normative References 259 2-2. Other References 260 3-1. Standard Library Names 261 3-2. Standard Library Names defined in the Architecture 262 Specific Parts of ISO/IEC 23360 263 264 10-1. Scalar Types 265 11-1. ELF Section Types 266 11-2. Additional Section Types 267 11-3. ELF Special Sections 268 11-4. Additional Special Sections 269 11-5. DWARF Exception Header value format 270 11-6. DWARF Exception Header application 271 11-7. Additional DWARF Call Frame Instructions 272 11-8. Call Frame Information Format 273 11-9. Common Information Entry Format 274 11-10. Frame Description Entry Format 275 11-11. .eh_frame_hdr Section Format 276 12-1. Linux Segment Types 277 13-1. libc Definition 278 13-2. libc - RPC Function Interfaces 279 13-3. libc - RPC Deprecated Function Interfaces 280 13-4. libc - Epoll Function Interfaces 281 13-5. libc - System Calls Function Interfaces 282 13-6. libc - System Calls Deprecated Function Interfaces 283 13-7. libc - Standard I/O Function Interfaces 284 13-8. libc - Standard I/O Deprecated Function Interfaces 285 13-9. libc - Standard I/O Data Interfaces 286 13-10. libc - Signal Handling Function Interfaces 287 13-11. libc - Signal Handling Deprecated Function Interfaces 288 13-12. libc - Signal Handling Data Interfaces 289 13-13. libc - Localization Functions Function Interfaces 290 13-14. libc - Localization Functions Data Interfaces 291 13-15. libc - Posix Spawn Option Function Interfaces 292 13-16. libc - Posix Advisory Option Function Interfaces 293 13-17. libc - Socket Interface Function Interfaces 294 13-18. libc - Socket Interface Data Interfaces 295 13-19. libc - Wide Characters Function Interfaces 296 13-20. libc - String Functions Function Interfaces 297 13-21. libc - String Functions Deprecated Function Interfaces 298 13-22. libc - IPC Functions Function Interfaces 299 13-23. libc - Regular Expressions Function Interfaces 300 13-24. libc - Character Type Functions Function Interfaces 301 13-25. libc - Time Manipulation Function Interfaces 302 13-26. libc - Time Manipulation Data Interfaces 303 13-27. libc - Terminal Interface Functions Function Interfaces 304 13-28. libc - System Database Interface Function Interfaces 305 13-29. libc - System Database Interface Deprecated Function 306 Interfaces 307 308 13-30. libc - Language Support Function Interfaces 309 13-31. libc - Large File Support Function Interfaces 310 13-32. libc - Large File Support Deprecated Function Interfaces 311 13-33. libc - Inotify Function Interfaces 312 13-34. libc - Standard Library Function Interfaces 313 13-35. libc - Standard Library Deprecated Function Interfaces 314 13-36. libc - Standard Library Data Interfaces 315 13-37. libm Definition 316 13-38. libm - Math Function Interfaces 317 13-39. libm - Math Deprecated Function Interfaces 318 13-40. libm - Math Data Interfaces 319 13-41. libpthread Definition 320 13-42. libpthread - Realtime Threads Function Interfaces 321 13-43. libpthread - Advanced Realtime Threads Function 322 Interfaces 323 324 13-44. libpthread - Posix Threads Function Interfaces 325 13-45. libpthread - Posix Threads Deprecated Function 326 Interfaces 327 328 13-46. libpthread - Thread aware versions of libc interfaces 329 Function Interfaces 330 331 13-47. libgcc_s Definition 332 13-48. libdl Definition 333 13-49. libdl - Dynamic Loader Function Interfaces 334 13-50. librt Definition 335 13-51. librt - Shared Memory Objects Function Interfaces 336 13-52. librt - Clock Function Interfaces 337 13-53. librt - Timers Function Interfaces 338 13-54. librt - Message Queues Function Interfaces 339 13-55. libcrypt Definition 340 13-56. libcrypt - Encryption Function Interfaces 341 13-57. libpam Definition 342 13-58. libpam - Pluggable Authentication API Function 343 Interfaces 344 345 14-1. libz Definition 346 14-2. libz - Compression Library Function Interfaces 347 14-3. libncurses Definition 348 14-4. libncurses - Curses Function Interfaces 349 14-5. libncurses - Curses Deprecated Function Interfaces 350 14-6. libncurses - Curses Data Interfaces 351 14-7. libutil Definition 352 14-8. libutil - Utility Functions Function Interfaces 353 15-1. Commands And Utilities 354 15-2. Built In Utilities 355 15-1. Escape Sequences 356 21-1. Required User & Group Names 357 21-2. Optional User & Group Names 358 22-1. RPM File Format 359 22-2. Signature Format 360 22-3. Index Type values 361 22-4. Header Private Tag Values 362 22-5. Signature Tag Values 363 22-6. Signature Digest Tag Values 364 22-7. Signature Signing Tag Values 365 22-8. Package Info Tag Values 366 22-9. Installation Tag Values 367 22-10. File Info Tag Values 368 22-11. File Flags 369 22-12. Package Dependency Tag Values 370 22-13. Index Type values 371 22-14. Package Dependency Attributes 372 22-15. Other Tag Values 373 22-16. CPIO File Format 374 A-1. libc Function Interfaces 375 A-2. libc Data Interfaces 376 A-3. libcrypt Function Interfaces 377 A-4. libdl Function Interfaces 378 A-5. libm Function Interfaces 379 A-6. libm Data Interfaces 380 A-7. libncurses Function Interfaces 381 A-8. libncurses Data Interfaces 382 A-9. libpam Function Interfaces 383 A-10. libpthread Function Interfaces 384 A-11. librt Function Interfaces 385 A-12. libutil Function Interfaces 386 A-13. libz Function Interfaces 387 __________________________________________________________ 388 389 Foreword 390 391 This is version 4.0 of the Linux Standard Base Core 392 Specification. This specification is part of a family of 393 specifications under the general title "Linux Standard Base". 394 Developers of applications or implementations interested in 395 using the LSB trademark should see the Linux Foundation 396 Certification Policy for details. 397 __________________________________________________________ 398 399 Introduction 400 401 The LSB defines a binary interface for application programs 402 that are compiled and packaged for LSB-conforming 403 implementations on many different hardware architectures. Since 404 a binary specification shall include information specific to 405 the computer processor architecture for which it is intended, 406 it is not possible for a single document to specify the 407 interface for all possible LSB-conforming implementations. 408 Therefore, the LSB is a family of specifications, rather than a 409 single one. 410 411 This document should be used in conjunction with the documents 412 it references. This document enumerates the system components 413 it includes, but descriptions of those components may be 414 included entirely or partly in this document, partly in other 415 documents, or entirely in other reference documents. For 416 example, the section that describes system service routines 417 includes a list of the system routines supported in this 418 interface, formal declarations of the data structures they use 419 that are visible to applications, and a pointer to the 420 underlying referenced specification for information about the 421 syntax and semantics of each call. Only those routines not 422 described in standards referenced by this document, or 423 extensions to those standards, are described in the detail. 424 Information referenced in this way is as much a part of this 425 document as is the information explicitly included here. 426 427 The specification carries a version number of either the form 428 x.y or x.y.z. This version number carries the following 429 meaning: 430 431 * The first number (x) is the major version number. All 432 versions with the same major version number should share 433 binary compatibility. Any addition or deletion of a new 434 library results in a new version number. Interfaces marked 435 as deprecated may be removed from the specification at a 436 major version change. 437 * The second number (y) is the minor version number. 438 Individual interfaces may be added if all certified 439 implementations already had that (previously undocumented) 440 interface. Interfaces may be marked as deprecated at a 441 minor version change. Other minor changes may be permitted 442 at the discretion of the LSB workgroup. 443 * The third number (z), if present, is the editorial level. 444 Only editorial changes should be included in such versions. 445 446 Since this specification is a descriptive Application Binary 447 Interface, and not a source level API specification, it is not 448 possible to make a guarantee of 100% backward compatibility 449 between major releases. However, it is the intent that those 450 parts of the binary interface that are visible in the source 451 level API will remain backward compatible from version to 452 version, except where a feature marked as "Deprecated" in one 453 release may be removed from a future release. 454 455 Implementors are strongly encouraged to make use of symbol 456 versioning to permit simultaneous support of applications 457 conforming to different releases of this specification. 458 459 I. Introductory Elements 460 461 Table of Contents 462 1. Scope 463 464 1.1. General 465 1.2. Module Specific Scope 466 467 2. References 468 469 2.1. Normative References 470 2.2. Informative References/Bibliography 471 472 3. Requirements 473 474 3.1. Relevant Libraries 475 3.2. LSB Implementation Conformance 476 3.3. LSB Application Conformance 477 478 4. Definitions 479 5. Terminology 480 6. Documentation Conventions 481 7. Relationship To ISO/IEC 9945 POSIX 482 8. Relationship To Other Linux Foundation Specifications 483 __________________________________________________________ 484 485 Chapter 1. Scope 486 487 1.1. General 488 489 The Linux Standard Base (LSB) defines a system interface for 490 compiled applications and a minimal environment for support of 491 installation scripts. Its purpose is to enable a uniform 492 industry standard environment for high-volume applications 493 conforming to the LSB. 494 495 These specifications are composed of two basic parts: A common 496 specification ("LSB-generic" or "generic LSB"), ISO/IEC 23360 497 Part 1, describing those parts of the interface that remain 498 constant across all implementations of the LSB, and an 499 architecture-specific part ("LSB-arch" or "archLSB") describing 500 the parts of the interface that vary by processor architecture. 501 Together, the LSB-generic and the relevant 502 architecture-specific part of ISO/IEC 23360 for a single 503 hardware architecture provide a complete interface 504 specification for compiled application programs on systems that 505 share a common hardware architecture. 506 507 ISO/IEC 23360 Part 1, the LSB-generic document, should be used 508 in conjunction with an architecture-specific part. Whenever a 509 section of the LSB-generic specification is supplemented by 510 architecture-specific information, the LSB-generic document 511 includes a reference to the architecture part. 512 Architecture-specific parts of ISO/IEC 23360 may also contain 513 additional information that is not referenced in the 514 LSB-generic document. 515 516 The LSB contains both a set of Application Program Interfaces 517 (APIs) and Application Binary Interfaces (ABIs). APIs may 518 appear in the source code of portable applications, while the 519 compiled binary of that application may use the larger set of 520 ABIs. A conforming implementation provides all of the ABIs 521 listed here. The compilation system may replace (e.g. by macro 522 definition) certain APIs with calls to one or more of the 523 underlying binary interfaces, and may insert calls to binary 524 interfaces as needed. 525 526 The LSB is primarily a binary interface definition. Not all of 527 the source level APIs available to applications may be 528 contained in this specification. 529 __________________________________________________________ 530 531 1.2. Module Specific Scope 532 533 This is the Core module of the Linux Standard Base (LSB), 534 ISO/IEC 23360 Part 1. This module provides the fundamental 535 system interfaces, libraries, and runtime environment upon 536 which all conforming applications and libraries depend. 537 538 Interfaces described in this part of ISO/IEC 23360 are 539 mandatory except where explicitly listed otherwise. Core 540 interfaces may be supplemented by other modules; all modules 541 are built upon the core. 542 __________________________________________________________ 543 544 Chapter 2. References 545 546 2.1. Normative References 547 548 The following referenced documents are indispensable for the 549 application of this document. For dated references, only the 550 edition cited applies. For undated references, the latest 551 edition of the referenced document (including any amendments) 552 applies. 553 554 Note: Where copies of a document are available on the World 555 Wide Web, a Uniform Resource Locator (URL) is given for 556 informative purposes only. This may point to a more recent 557 copy of the referenced specification, or may be out of date. 558 Reference copies of specifications at the revision level 559 indicated may be found at the Linux Foundation's Reference 560 Specifications site. 561 562 Table 2-1. Normative References 563 Name Title URL 564 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 565 (FHS) 2.3 http://www.pathname.com/fhs/ 566 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 567 ISO POSIX (2003) 568 569 ISO/IEC 9945-1:2003 Information technology -- Portable 570 Operating System Interface (POSIX) -- Part 1: Base Definitions 571 572 ISO/IEC 9945-2:2003 Information technology -- Portable 573 Operating System Interface (POSIX) -- Part 2: System Interfaces 574 575 ISO/IEC 9945-3:2003 Information technology -- Portable 576 Operating System Interface (POSIX) -- Part 3: Shell and 577 Utilities 578 579 ISO/IEC 9945-4:2003 Information technology -- Portable 580 Operating System Interface (POSIX) -- Part 4: Rationale 581 582 Including Technical Cor. 1: 2004 583 http://www.unix.org/version3/ 584 Itanium™ C++ ABI Itanium™ C++ ABI (Revision 1.83) 585 http://refspecs.linux-foundation.org/cxxabi-1.83.html 586 Large File Support Large File Support 587 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 588 POSIX 1003.1 2008 Portable Operating System Interface (POSIX®) 589 2008 Edition / The Open Group Technical Standard Base 590 Specifications, Issue 7 http://www.unix.org/version4/ 591 SUSv2 CAE Specification, January 1997, System Interfaces and 592 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 593 http://www.opengroup.org/publications/catalog/un.htm 594 SVID Issue 3 American Telephone and Telegraph Company, System V 595 Interface Definition, Issue 3; Morristown, NJ, UNIX Press, 596 1989. (ISBN 0201566524) 597 SVID Issue 4 System V Interface Definition, Fourth Edition 598 System V ABI System V Application Binary Interface, Edition 4.1 599 http://www.caldera.com/developers/devspecs/gabi41.pdf 600 System V ABI Update System V Application Binary Interface - 601 DRAFT - 17 December 2003 602 http://www.caldera.com/developers/gabi/2003-12-17/contents.html 603 X/Open Curses CAE Specification, May 1996, X/Open Curses, Issue 604 4, Version 2 (ISBN: 1-85912-171-3, C610), plus Corrigendum U018 605 http://www.opengroup.org/publications/catalog/un.htm 606 __________________________________________________________ 607 608 2.2. Informative References/Bibliography 609 610 In addition, the specifications listed below provide essential 611 background information to implementors of this specification. 612 These references are included for information only. 613 614 Table 2-2. Other References 615 Name Title URL 616 Cairo API Reference Cairo Vector Graphics API Specification for 617 1.0.2 http://cairographics.org/manual-1.0.2 618 DWARF Debugging Information Format, Revision 2.0.0 DWARF 619 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 620 http://refspecs.linux-foundation.org/dwarf/dwarf-2.0.0.pdf 621 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 622 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 623 http://refspecs.linux-foundation.org/dwarf 624 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 625 floating-point arithmetic for microprocessor systems 626 http://www.ieee.org/ 627 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 628 Specification method for cultural conventions 629 ITU-T V.42 International Telecommunication Union Recommendation 630 V.42 (2002): Error-correcting procedures for DCEs using 631 asynchronous-to-synchronous conversionITUV 632 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&p 633 arent=T-REC-V.42 634 Li18nux Globalization Specification LI18NUX 2000 Globalization 635 Specification, Version 1.0 with Amendment 4 636 http://www.openi18n.org/docs/html/LI18NUX-2000-amd4.htm 637 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 638 http://www.lanana.org/docs/device-list/devices.txt 639 Mozilla's NSS SSL Reference Mozilla's NSS SSL Reference 640 http://www.mozilla.org/projects/security/pki/nss/ref/ssl/ 641 NSPR Reference Mozilla's NSPR Reference 642 http://refspecs.linuxfoundation.org/NSPR_API_Reference/NSPR_API 643 .html 644 PAM Open Software Foundation, Request For Comments: 86.0 , 645 October 1995, V. Samar & R.Schemers (SunSoft) 646 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 647 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 648 MD5 Message-Digest Algorithm 649 http://www.ietf.org/rfc/rfc1321.txt 650 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 651 http://www.ietf.org/ 652 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 653 1833: Binding Protocols for ONC RPC Version 2 654 http://www.ietf.org/rfc/rfc1833.txt 655 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 656 1950: ZLIB Compressed Data Format Specification 657 http://www.ietf.org/rfc/rfc1950.txt 658 RFC 1951: DEFLATE Compressed Data Format Specification IETF RFC 659 1951: DEFLATE Compressed Data Format Specification version 1.3 660 http://www.ietf.org/rfc/rfc1951.txt 661 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 662 file format specification version 4.3 663 http://www.ietf.org/rfc/rfc1952.txt 664 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP Message 665 Format http://www.ietf.org/rfc/rfc2440.txt 666 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 667 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 668 RFC 2822:Internet Message Format IETF RFC 2822: Internet 669 Message Format http://www.ietf.org/rfc/rfc2822.txt 670 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 671 Specification http://www.ietf.org/rfc/rfc791.txt 672 RPM Package Format RPM Package Format V3.0 673 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.h 674 tml 675 SUSv2 Commands and Utilities The Single UNIX Specification(SUS) 676 Version 2, Commands and Utilities (XCU), Issue 5 (ISBN: 677 1-85912-191-8, C604) 678 http://www.opengroup.org/publications/catalog/un.htm 679 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 680 __________________________________________________________ 681 682 Chapter 3. Requirements 683 684 3.1. Relevant Libraries 685 686 The libraries listed in Table 3-1 shall be available on a Linux 687 Standard Base system, with the specified runtime names. The 688 libraries listed in Table 3-2 are architecture specific, but 689 shall be available on all LSB conforming systems. This list may 690 be supplemented or amended by the relevant architecture 691 specific part of ISO/IEC 23360. 692 693 Table 3-1. Standard Library Names 694 Library Runtime Name 695 libdl libdl.so.2 696 libcrypt libcrypt.so.1 697 libz libz.so.1 698 libncurses libncurses.so.5 699 libutil libutil.so.1 700 libpthread libpthread.so.0 701 librt librt.so.1 702 libpam libpam.so.0 703 libgcc_s libgcc_s.so.1 704 705 Table 3-2. Standard Library Names defined in the Architecture 706 Specific Parts of ISO/IEC 23360 707 Library Runtime Name 708 libm See archLSB 709 libc See archLSB 710 proginterp See archLSB 711 712 These libraries will be in an implementation-defined directory 713 which the dynamic linker shall search by default. 714 __________________________________________________________ 715 716 3.2. LSB Implementation Conformance 717 718 A conforming implementation is necessarily architecture 719 specific, and must provide the interfaces specified by both the 720 generic LSB Core specification (ISO/IEC 23360 Part 1) and the 721 relevant architecture specific part of ISO/IEC 23360. 722 723 Rationale: An implementation must provide at least the 724 interfaces specified in these specifications. It may also 725 provide additional interfaces. 726 727 A conforming implementation shall satisfy the following 728 requirements: 729 730 * A processor architecture represents a family of related 731 processors which may not have identical feature sets. The 732 architecture specific parts of ISO/IEC 23360 that 733 supplement this specification for a given target processor 734 architecture describe a minimum acceptable processor. The 735 implementation shall provide all features of this 736 processor, whether in hardware or through emulation 737 transparent to the application. 738 * The implementation shall be capable of executing compiled 739 applications having the format and using the system 740 interfaces described in this document. 741 * The implementation shall provide libraries containing the 742 interfaces specified by this document, and shall provide a 743 dynamic linking mechanism that allows these interfaces to 744 be attached to applications at runtime. All the interfaces 745 shall behave as specified in this document. 746 * The map of virtual memory provided by the implementation 747 shall conform to the requirements of this document. 748 * The implementation's low-level behavior with respect to 749 function call linkage, system traps, signals, and other 750 such activities shall conform to the formats described in 751 this document. 752 * The implementation shall provide all of the mandatory 753 interfaces in their entirety. 754 * The implementation may provide one or more of the optional 755 interfaces. Each optional interface that is provided shall 756 be provided in its entirety. The product documentation 757 shall state which optional interfaces are provided. 758 * The implementation shall provide all files and utilities 759 specified as part of this document in the format defined 760 here and in other referenced documents. All commands and 761 utilities shall behave as required by this document. The 762 implementation shall also provide all mandatory components 763 of an application's runtime environment that are included 764 or referenced in this document. 765 * The implementation, when provided with standard data 766 formats and values at a named interface, shall provide the 767 behavior defined for those values and data formats at that 768 interface. However, a conforming implementation may consist 769 of components which are separately packaged and/or sold. 770 For example, a vendor of a conforming implementation might 771 sell the hardware, operating system, and windowing system 772 as separately packaged items. 773 * The implementation may provide additional interfaces with 774 different names. It may also provide additional behavior 775 corresponding to data values outside the standard ranges, 776 for standard named interfaces. 777 __________________________________________________________ 778 779 3.3. LSB Application Conformance 780 781 A conforming application is necessarily architecture specific, 782 and must conform to both the generic LSB Core specification 783 (ISO/IEC 23360 Part 1)and the relevant architecture specific 784 part of ISO/IEC 23360. 785 786 A conforming application shall satisfy the following 787 requirements: 788 789 * Its executable files shall be either shell scripts or 790 object files in the format defined for the Object File 791 Format system interface. 792 * Its object files shall participate in dynamic linking as 793 defined in the Program Loading and Linking System 794 interface. 795 * It shall employ only the instructions, traps, and other 796 low-level facilities defined in the Low-Level System 797 interface as being for use by applications. 798 * If it requires any optional interface defined in this 799 document in order to be installed or to execute 800 successfully, the requirement for that optional interface 801 shall be stated in the application's documentation. 802 * It shall not use any interface or data format that is not 803 required to be provided by a conforming implementation, 804 unless: 805 + If such an interface or data format is supplied by 806 another application through direct invocation of that 807 application during execution, that application shall 808 be in turn an LSB conforming application. 809 + The use of that interface or data format, as well as 810 its source, shall be identified in the documentation 811 of the application. 812 * It shall not use any values for a named interface that are 813 reserved for vendor extensions. 814 815 A strictly conforming application shall not require or use any 816 interface, facility, or implementation-defined extension that 817 is not defined in this document in order to be installed or to 818 execute successfully. 819 __________________________________________________________ 820 821 Chapter 4. Definitions 822 823 For the purposes of this document, the following definitions, 824 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 825 Edition, apply: 826 827 can 828 829 be able to; there is a possibility of; it is possible to 830 cannot 831 832 be unable to; there is no possibility of; it is not possible to 833 may 834 835 is permitted; is allowed; is permissible 836 need not 837 838 it is not required that; no...is required 839 shall 840 841 is to; is required to; it is required that; has to; only...is 842 permitted; it is necessary 843 shall not 844 845 is not allowed [permitted] [acceptable] [permissible]; is 846 required to be not; is required that...be not; is not to be 847 should 848 849 it is recommended that; ought to 850 should not 851 852 it is not recommended that; ought not to 853 __________________________________________________________ 854 855 Chapter 5. Terminology 856 857 For the purposes of this document, the following terms apply: 858 859 archLSB 860 The architectural part of the LSB Specification which 861 describes the specific parts of the interface that are 862 platform specific. The archLSB is complementary to the 863 gLSB. 864 865 Binary Standard 866 The total set of interfaces that are available to be 867 used in the compiled binary code of a conforming 868 application. 869 870 gLSB 871 The common part of the LSB Specification that describes 872 those parts of the interface that remain constant across 873 all hardware implementations of the LSB. 874 875 implementation-defined 876 Describes a value or behavior that is not defined by 877 this document but is selected by an implementor. The 878 value or behavior may vary among implementations that 879 conform to this document. An application should not rely 880 on the existence of the value or behavior. An 881 application that relies on such a value or behavior 882 cannot be assured to be portable across conforming 883 implementations. The implementor shall document such a 884 value or behavior so that it can be used correctly by an 885 application. 886 887 Shell Script 888 A file that is read by an interpreter (e.g., awk). The 889 first line of the shell script includes a reference to 890 its interpreter binary. 891 892 Source Standard 893 The set of interfaces that are available to be used in 894 the source code of a conforming application. 895 896 undefined 897 Describes the nature of a value or behavior not defined 898 by this document which results from use of an invalid 899 program construct or invalid data input. The value or 900 behavior may vary among implementations that conform to 901 this document. An application should not rely on the 902 existence or validity of the value or behavior. An 903 application that relies on any particular value or 904 behavior cannot be assured to be portable across 905 conforming implementations. 906 907 unspecified 908 Describes the nature of a value or behavior not 909 specified by this document which results from use of a 910 valid program construct or valid data input. The value 911 or behavior may vary among implementations that conform 912 to this document. An application should not rely on the 913 existence or validity of the value or behavior. An 914 application that relies on any particular value or 915 behavior cannot be assured to be portable across 916 conforming implementations. 917 918 Other terms and definitions used in this document shall have 919 the same meaning as defined in Chapter 3 of the Base 920 Definitions volume of ISO POSIX (2003). 921 __________________________________________________________ 922 923 Chapter 6. Documentation Conventions 924 925 Throughout this document, the following typographic conventions 926 are used: 927 928 function() 929 930 the name of a function 931 command 932 933 the name of a command or utility 934 CONSTANT 935 936 a constant value 937 parameter 938 939 a parameter 940 variable 941 942 a variable 943 944 Throughout this specification, several tables of interfaces are 945 presented. Each entry in these tables has the following format: 946 947 name 948 949 the name of the interface 950 (symver) 951 952 An optional symbol version identifier, if required. 953 [refno] 954 955 A reference number indexing the table of referenced 956 specifications that follows this table. 957 958 For example, 959 960 forkpty(GLIBC_2.0) [SUSv3] 961 962 refers to the interface named forkpty() with symbol version 963 GLIBC_2.0 that is defined in the SUSv3 reference. 964 965 Note: For symbols with versions which differ between 966 architectures, the symbol versions are defined in the 967 architecture specific parts of ISO/IEC 23360 only. 968 __________________________________________________________ 969 970 Chapter 7. Relationship To ISO/IEC 9945 POSIX 971 972 This specification includes many interfaces described in ISO 973 POSIX (2003). Unless otherwise specified, such interfaces 974 should behave exactly as described in that specification. Any 975 conflict between the requirements described here and the ISO 976 POSIX (2003) standard is unintentional, except as explicitly 977 noted otherwise. 978 979 Note: In addition to the differences noted inline in this 980 specification, PDTR 24715 has extracted the differences 981 between this specification and ISO POSIX (2003) into a 982 single place. It is the long term plan of the Linux 983 Foundation to converge the LSB Core Specification with 984 ISO/IEC 9945 POSIX. 985 986 The LSB Specification Authority is responsible for deciding the 987 meaning of conformance to normative referenced standards in the 988 LSB context. Problem Reports regarding underlying or referenced 989 standards in any other context will be referred to the relevant 990 maintenance body for that standard. 991 __________________________________________________________ 992 993 Chapter 8. Relationship To Other Linux Foundation Specifications 994 995 The LSB is the base for several other specification projects 996 under the umbrella of the Linux Foundation (LF). This 997 specification is the foundation, and other specifications build 998 on the interfaces defined here. However, beyond those 999 specifications listed as Normative References, this 1000 specification has no dependencies on other LF projects. 1001 1002 II. Executable And Linking Format (ELF) 1003 1004 Table of Contents 1005 9. Introduction 1006 10. Low Level System Information 1007 1008 10.1. Operating System Interface 1009 10.2. Machine Interface 1010 1011 10.2.1. Data Representation 1012 1013 11. Object Format 1014 1015 11.1. Object Files 1016 11.2. Sections 1017 1018 11.2.1. Introduction 1019 11.2.2. Sections Types 1020 1021 11.3. Special Sections 1022 1023 11.3.1. Special Sections 1024 1025 11.4. Symbol Mapping 1026 1027 11.4.1. Introduction 1028 1029 11.5. DWARF Extensions 1030 1031 11.5.1. DWARF Exception Header Encoding 1032 11.5.2. DWARF CFI Extensions 1033 1034 11.6. Exception Frames 1035 1036 11.6.1. The .eh_frame section 1037 11.6.2. The .eh_frame_hdr section 1038 1039 11.7. Symbol Versioning 1040 1041 11.7.1. Introduction 1042 11.7.2. Symbol Version Table 1043 11.7.3. Version Definitions 1044 11.7.4. Version Requirements 1045 11.7.5. Startup Sequence 1046 11.7.6. Symbol Resolution 1047 1048 11.8. ABI note tag 1049 1050 12. Dynamic Linking 1051 1052 12.1. Program Loading and Dynamic Linking 1053 12.2. Program Header 1054 12.3. Dynamic Entries 1055 1056 12.3.1. Introduction 1057 12.3.2. Dynamic Entries 1058 __________________________________________________________ 1059 1060 Chapter 9. Introduction 1061 1062 Executable and Linking Format (ELF) defines the object format 1063 for compiled applications. This specification supplements the 1064 information found in System V ABI Update and is intended to 1065 document additions made since the publication of that document. 1066 __________________________________________________________ 1067 1068 Chapter 10. Low Level System Information 1069 1070 10.1. Operating System Interface 1071 1072 LSB-conforming applications shall assume that stack, heap and 1073 other allocated memory regions will be non-executable. The 1074 application must take steps to make them executable if needed. 1075 __________________________________________________________ 1076 1077 10.2. Machine Interface 1078 1079 10.2.1. Data Representation 1080 1081 LSB-conforming applications shall use the data representation 1082 as defined in the Arcitecture specific ELF documents. 1083 __________________________________________________________ 1084 1085 10.2.1.1. Fundamental Types 1086 1087 In addition to the fundamental types specified in the relevant 1088 architecture specific part of ISO/IEC 23360, a 1 byte data type 1089 is defined here. 1090 1091 Table 10-1. Scalar Types 1092 Type C C++ sizeof Alignment (bytes) Architecture Representation 1093 Integral _Bool bool 1 1 byte 1094 __________________________________________________________ 1095 1096 Chapter 11. Object Format 1097 1098 11.1. Object Files 1099 1100 LSB-conforming implementations shall support the object file 1101 Executable and Linking Format (ELF), which is defined by the 1102 following documents: 1103 1104 * System V ABI 1105 * System V ABI Update 1106 * this specification 1107 * the relevant architecture specific part of ISO/IEC 23360 1108 1109 Conforming implementations may also support other unspecified 1110 object file formats. 1111 __________________________________________________________ 1112 1113 11.2. Sections 1114 1115 11.2.1. Introduction 1116 1117 As described in System V ABI, an ELF object file contains a 1118 number of sections. 1119 __________________________________________________________ 1120 1121 11.2.2. Sections Types 1122 1123 The section header table is an array of Elf32_Shdr or 1124 Elf64_Shdr structures as described in System V ABI. The sh_type 1125 member shall be either a value from Table 11-1, drawn from the 1126 System V ABI, or one of the additional values specified in 1127 Table 11-2. 1128 1129 A section header's sh_type member specifies the sections's 1130 semantics. 1131 __________________________________________________________ 1132 1133 11.2.2.1. ELF Section Types 1134 1135 The following section types are defined in the System V ABI and 1136 the System V ABI Update. 1137 1138 Table 11-1. ELF Section Types 1139 Name Value Description 1140 SHT_DYNAMIC 0x6 The section holds information for dynamic 1141 linking. Currently, an object file shall have only one dynamic 1142 section, but this restriction may be relaxed in the future. See 1143 `Dynamic Section' in Chapter 5 of System V ABI Update for 1144 details. 1145 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1146 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1147 an object file may have either a section of SHT_SYMTAB type or 1148 a section of SHT_DYNSYM type, but not both. This restriction 1149 may be relaxed in the future. 1150 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1151 to termination functions, as described in `Initialization and 1152 Termination Functions' in Chapter 5 of System V ABI Update. 1153 Each pointer in the array is taken as a parameterless procedure 1154 with a void return. 1155 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1156 an object file shall have only one hash table, but this 1157 restriction may be relaxed in the future. See `Hash Table' in 1158 Chapter 5 of System V ABI Update for details. 1159 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1160 to initialization functions, as described in `Initialization 1161 and Termination Functions' in Chapter 5 of System V ABI Update. 1162 Each pointer in the array is taken as a parameterless procedure 1163 with a void return. 1164 SHT_NOBITS 0x8 A section of this type occupies no space in the 1165 file but otherwise resembles SHT_PROGBITS. Although this 1166 section contains no bytes, the sh_offset member contains the 1167 conceptual file offset. 1168 SHT_NOTE 0x7 The section holds information that marks the file 1169 in some way. See `Note Section' in Chapter 5 of System V ABI 1170 Update for details. 1171 SHT_NULL 0x0 This value marks the section header as inactive; 1172 it does not have an associated section. Other members of the 1173 section header have undefined values. 1174 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1175 pointers to functions that are invoked before all other 1176 initialization functions, as described in `Initialization and 1177 Termination Functions' in Chapter 5 of System V ABI Update. 1178 Each pointer in the array is taken as a parameterless proceure 1179 with a void return. 1180 SHT_PROGBITS 0x1 The section holds information defined by the 1181 program, whose format and meaning are determined solely by the 1182 program. 1183 SHT_REL 0x9 The section holds relocation entries without 1184 explicit addends, such as type Elf32_Rel for the 32-bit class 1185 of object files or type Elf64_Rel for the 64-bit class of 1186 object files. An object file may have multiple relocation 1187 sections. See `Relocation' in Chapter 4 of System V ABI Update 1188 for details. 1189 SHT_RELA 0x4 The section holds relocation entries with explicit 1190 addends, such as type Elf32_Rela for the 32-bit class of object 1191 files or type Elf64_Rela for the 64-bit class of object files. 1192 An object file may have multiple relocation sections. See 1193 `Relocation' in Chapter 4 of System V ABI Update for details. 1194 SHT_STRTAB 0x3 The section holds a string table. An object file 1195 may have multiple string table sections. See `String Table' in 1196 Chapter 4 of System V ABI Update for details. 1197 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, an 1198 object file may have either a section of SHT_SYMTAB type or a 1199 section of SHT_DYNSYM type, but not both. This restriction may 1200 be relaxed in the future. Typically, SHT_SYMTAB provides 1201 symbols for link editing, though it may also be used for 1202 dynamic linking. As a complete symbol table, it may contain 1203 many symbols unnecessary for dynamic linking. 1204 __________________________________________________________ 1205 1206 11.2.2.2. Additional Section Types 1207 1208 The following additional section types are defined here. 1209 1210 Table 11-2. Additional Section Types 1211 Name Value Description 1212 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1213 versions that are provided. 1214 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1215 versions that are required. 1216 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1217 Version Table. 1218 __________________________________________________________ 1219 1220 11.3. Special Sections 1221 1222 11.3.1. Special Sections 1223 1224 Various sections hold program and control information. Sections 1225 in the lists below are used by the system and have the 1226 indicated types and attributes. 1227 __________________________________________________________ 1228 1229 11.3.1.1. ELF Special Sections 1230 1231 The following sections are defined in the System V ABI and the 1232 System V ABI Update. 1233 1234 Table 11-3. ELF Special Sections 1235 Name Type Attributes 1236 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1237 .comment SHT_PROGBITS 0 1238 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1239 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1240 .debug SHT_PROGBITS 0 1241 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1242 .dynstr SHT_STRTAB SHF_ALLOC 1243 .dynsym SHT_DYNSYM SHF_ALLOC 1244 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1245 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1246 .hash SHT_HASH SHF_ALLOC 1247 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1248 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1249 .interp SHT_PROGBITS SHF_ALLOC 1250 .line SHT_PROGBITS 0 1251 .note SHT_NOTE 0 1252 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1253 .rodata SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1254 .rodata1 SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1255 .shstrtab SHT_STRTAB 0 1256 .strtab SHT_STRTAB SHF_ALLOC 1257 .symtab SHT_SYMTAB SHF_ALLOC 1258 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1259 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1260 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1261 1262 .bss 1263 1264 This section holds data that contributes to the program's 1265 memory image. The program may treat this data as uninitialized. 1266 However, the system shall initialize this data with zeroes when 1267 the program begins to run. The section occupies no file space, 1268 as indicated by the section type, SHT_NOBITS. 1269 .comment 1270 1271 This section holds version control information. 1272 .data 1273 1274 This section holds initialized data that contribute to the 1275 program's memory image. 1276 .data1 1277 1278 This section holds initialized data that contribute to the 1279 program's memory image. 1280 .debug 1281 1282 This section holds information for symbolic debugging. The 1283 contents are unspecified. All section names with the prefix 1284 .debug hold information for symbolic debugging. The contents of 1285 these sections are unspecified. 1286 .dynamic 1287 1288 This section holds dynamic linking information. The section's 1289 attributes will include the SHF_ALLOC bit. Whether the 1290 SHF_WRITE bit is set is processor specific. See Chapter 5 of 1291 System V ABI Update for more information. 1292 .dynstr 1293 1294 This section holds strings needed for dynamic linking, most 1295 commonly the strings that represent the names associated with 1296 symbol table entries. See Chapter 5 of System V ABI Update for 1297 more information. 1298 .dynsym 1299 1300 This section holds the dynamic linking symbol table, as 1301 described in `Symbol Table' of System V ABI Update. 1302 .fini 1303 1304 This section holds executable instructions that contribute to 1305 the process termination code. That is, when a program exits 1306 normally, the system arranges to execute the code in this 1307 section. 1308 .fini_array 1309 1310 This section holds an array of function pointers that 1311 contributes to a single termination array for the executable or 1312 shared object containing the section. 1313 .hash 1314 1315 This section holds a symbol hash table. See `Hash Table' in 1316 Chapter 5 of System V ABI Update for more information. 1317 .init 1318 1319 This section holds executable instructions that contribute to 1320 the process initialization code. When a program starts to run, 1321 the system arranges to execute the code in this section before 1322 calling the main program entry point (called main for C 1323 programs). 1324 .init_array 1325 1326 This section holds an array of function pointers that 1327 contributes to a single initialization array for the executable 1328 or shared object containing the section. 1329 .interp 1330 1331 This section holds the path name of a program interpreter. If 1332 the file has a loadable segment that includes relocation, the 1333 sections' attributes will include the SHF_ALLOC bit; otherwise, 1334 that bit will be off. See Chapter 5 of System V ABI Update for 1335 more information. 1336 .line 1337 1338 This section holds line number information for symbolic 1339 debugging, which describes the correspondence between the 1340 source program and the machine code. The contents are 1341 unspecified. 1342 .note 1343 1344 This section holds information in the format that `Note 1345 Section' in Chapter 5 of System V ABI Update describes. 1346 .preinit_array 1347 1348 This section holds an array of function pointers that 1349 contributes to a single pre-initialization array for the 1350 executable or shared object containing the section. 1351 .rodata 1352 1353 This section holds read-only data that typically contribute to 1354 a non-writable segment in the process image. See `Program 1355 Header' in Chapter 5 of System V ABI Update for more 1356 information. 1357 .rodata1 1358 1359 This section holds read-only data that typically contribute to 1360 a non-writable segment in the process image. See `Program 1361 Header' in Chapter 5 of System V ABI Update for more 1362 information. 1363 .shstrtab 1364 1365 This section holds section names. 1366 .strtab 1367 1368 This section holds strings, most commonly the strings that 1369 represent the names associated with symbol table entries. If 1370 the file has a loadable segment that includes the symbol string 1371 table, the section's attributes will include the SHF_ALLOC bit; 1372 otherwise, that bit will be off. 1373 .symtab 1374 1375 This section holds a symbol table, as `Symbol Table' in Chapter 1376 4 of System V ABI Update describes. If the file has a loadable 1377 segment that includes the symbol table, the section's 1378 attributes will include the SHF_ALLOC bit; otherwise, that bit 1379 will be off. 1380 .tbss 1381 1382 This section holds uninitialized thread-local data that 1383 contribute to the program's memory image. By definition, the 1384 system initializes the data with zeros when the data is 1385 instantiated for each new execution flow. The section occupies 1386 no file space, as indicated by the section type, SHT_NOBITS. 1387 Implementations need not support thread-local storage. 1388 .tdata 1389 1390 This section holds initialized thread-local data that 1391 contributes to the program's memory image. A copy of its 1392 contents is instantiated by the system for each new execution 1393 flow. Implementations need not support thread-local storage. 1394 .text 1395 1396 This section holds the `text', or executable instructions, of a 1397 program. 1398 __________________________________________________________ 1399 1400 11.3.1.2. Additional Special Sections 1401 1402 Object files in an LSB conforming application may also contain 1403 one or more of the additional special sections described below. 1404 1405 Table 11-4. Additional Special Sections 1406 Name Type Attributes 1407 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1408 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1409 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1410 .eh_frame SHT_PROGBITS SHF_ALLOC 1411 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1412 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1413 .gnu.version SHT_GNU_versym SHF_ALLOC 1414 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1415 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1416 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1417 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1418 .note.ABI-tag SHT_NOTE SHF_ALLOC 1419 .stab SHT_PROGBITS 0 1420 .stabstr SHT_STRTAB 0 1421 1422 .ctors 1423 1424 This section contains a list of global constructor function 1425 pointers. 1426 .data.rel.ro 1427 1428 This section holds initialized data that contribute to the 1429 program's memory image. This section may be made read-only 1430 after relocations have been applied. 1431 .dtors 1432 1433 This section contains a list of global destructor function 1434 pointers. 1435 .eh_frame 1436 1437 This section contains information necessary for frame unwinding 1438 during exception handling. See Section 11.6.1. 1439 .eh_frame_hdr 1440 1441 This section contains a pointer to the .eh_frame section which 1442 is accessible to the runtime support code of a C++ application. 1443 This section may also contain a binary search table which may 1444 be used by the runtime support code to more efficiently access 1445 records in the .eh_frame section. See Section 11.6.2. 1446 .gcc_except_table 1447 1448 This section holds Language Specific Data. 1449 .gnu.version 1450 1451 This section contains the Symbol Version Table. See Section 1452 11.7.2. 1453 .gnu.version_d 1454 1455 This section contains the Version Definitions. See Section 1456 11.7.3. 1457 .gnu.version_r 1458 1459 This section contains the Version Requirements. See Section 1460 11.7.4. 1461 .got.plt 1462 1463 This section holds the read-only portion of the GLobal Offset 1464 Table. This section may be made read-only after relocations 1465 have been applied. 1466 .jcr 1467 1468 This section contains information necessary for registering 1469 compiled Java classes. The contents are compiler-specific and 1470 used by compiler initialization functions. 1471 .note.ABI-tag 1472 1473 Specify ABI details. See Section 11.8. 1474 .stab 1475 1476 This section contains debugging information. The contents are 1477 not specified as part of the LSB. 1478 .stabstr 1479 1480 This section contains strings associated with the debugging 1481 infomation contained in the .stab section. 1482 __________________________________________________________ 1483 1484 11.4. Symbol Mapping 1485 1486 11.4.1. Introduction 1487 1488 Symbols in a source program are translated by the compilation 1489 system into symbols that exist in the object file. 1490 __________________________________________________________ 1491 1492 11.4.1.1. C Language 1493 1494 External C symbols shall be unchanged in an object file's 1495 symbol table. 1496 __________________________________________________________ 1497 1498 11.5. DWARF Extensions 1499 1500 The LSB does not specify debugging information, however, some 1501 additional sections contain information which is encoded using 1502 the the encoding as specified by DWARF Debugging Information 1503 Format, Revision 2.0.0 with extensions defined here. 1504 1505 Note: The extensions specified here also exist in DWARF 1506 Debugging Information Format, Revision 3.0.0 (Draft). It is 1507 expected that future versions of the LSB will reference the 1508 final version of that document, and that the definitions 1509 here will be taken from that document instead of being 1510 specified here. 1511 __________________________________________________________ 1512 1513 11.5.1. DWARF Exception Header Encoding 1514 1515 The DWARF Exception Header Encoding is used to describe the 1516 type of data used in the .eh_frame and .eh_frame_hdr section. 1517 The upper 4 bits indicate how the value is to be applied. The 1518 lower 4 bits indicate the format of the data. 1519 1520 Table 11-5. DWARF Exception Header value format 1521 Name Value Meaning 1522 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1523 is determined by the architecture. 1524 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1525 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1526 Information Format, Revision 2.0.0. 1527 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1528 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1529 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1530 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1531 Endian Base 128 (LEB128) as defined by DWARF Debugging 1532 Information Format, Revision 2.0.0. 1533 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1534 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1535 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1536 1537 Table 11-6. DWARF Exception Header application 1538 Name Value Meaning 1539 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1540 counter. 1541 DW_EH_PE_textrel 0x20 Value is relative to the beginning of the 1542 .text section. 1543 DW_EH_PE_datarel 0x30 Value is relative to the beginning of the 1544 .got or .eh_frame_hdr section. 1545 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of the 1546 function. 1547 DW_EH_PE_aligned 0x50 Value is aligned to an address unit sized 1548 boundary. 1549 1550 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1551 indicate that no value ispresent. 1552 __________________________________________________________ 1553 1554 11.5.2. DWARF CFI Extensions 1555 1556 In addition to the Call Frame Instructions defined in section 1557 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1558 the following additional Call Frame Instructions may also be 1559 used. 1560 1561 Table 11-7. Additional DWARF Call Frame Instructions 1562 Name Value Meaning 1563 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1564 two operands: an unsigned LEB128 value representing a register 1565 number, and a DW_FORM_block value representing a DWARF 1566 expression. The required action is to establish the DWARF 1567 expression as the means by which the address in which the given 1568 register contents are found may be computed. The value of the 1569 CFA is pushed on the DWARF evaluation stack prior to execution 1570 of the DWARF expression. The DW_OP_call2, DW_OP_call4, 1571 DW_OP_call_ref and DW_OP_push_object_address DWARF operators 1572 (see Section 2.4.1 of DWARF Debugging Information Format, 1573 Revision 2.0.0) cannot be used in such a DWARF expression. 1574 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1575 instruction takes two operands: an unsigned LEB128 value 1576 representing a register number and a signed LEB128 factored 1577 offset. This instruction is identical to DW_CFA_offset_extended 1578 except that the second operand is signed. 1579 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1580 two operands: an unsigned LEB128 value representing a register 1581 number and a signed LEB128 factored offset. This instruction is 1582 identical to DW_CFA_def_cfa except that the second operand is 1583 signed and factored. 1584 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1585 instruction takes a signed LEB128 operand representing a 1586 factored offset. This instruction is identical to 1587 DW_CFA_def_cfa_offset except that the operand is signed and 1588 factored. 1589 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1590 takes an unsigned LEB128 operand representing an argument size. 1591 This instruction specifies the total of the size of the 1592 arguments which have been pushed onto the stack. 1593 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1594 instruction takes two operands: an unsigned LEB128 value 1595 representing a register number and an unsigned LEB128 which 1596 represents the magnitude of the offset. This instruction is 1597 identical to DW_CFA_offset_extended_sf except that the operand 1598 is subtracted to produce the offset. This instructions is 1599 obsoleted by DW_CFA_offset_extended_sf. 1600 __________________________________________________________ 1601 1602 11.6. Exception Frames 1603 1604 When using languages that support exceptions, such as C++, 1605 additional information must be provided to the runtime 1606 environment that describes the call frames that must be unwound 1607 during the processing of an exception. This information is 1608 contained in the special sections .eh_frame and .eh_framehdr. 1609 1610 Note: The format of the .eh_frame section is similar in 1611 format and purpose to the .debug_frame section which is 1612 specified in DWARF Debugging Information Format, Revision 1613 3.0.0 (Draft). Readers are advised that there are some 1614 subtle difference, and care should be taken when comparing 1615 the two sections. 1616 __________________________________________________________ 1617 1618 11.6.1. The .eh_frame section 1619 1620 The .eh_frame section shall contain 1 or more Call Frame 1621 Information (CFI) records. The number of records present shall 1622 be determined by size of the section as contained in the 1623 section header. Each CFI record contains a Common Information 1624 Entry (CIE) record followed by 1 or more Frame Description 1625 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1626 addressing unit sized boundary. 1627 1628 Table 11-8. Call Frame Information Format 1629 Common Information Entry Record 1630 Frame Description Entry Record(s) 1631 __________________________________________________________ 1632 1633 11.6.1.1. The Common Information Entry Format 1634 1635 Table 11-9. Common Information Entry Format 1636 Length Required 1637 Extended Length Optional 1638 CIE ID Required 1639 Version Required 1640 Augmentation String Required 1641 Code Alignment Factor Required 1642 Data Alignment Factor Required 1643 Return Address Register Required 1644 Augmentation Data Length Optional 1645 Augmentation Data Optional 1646 Initial Instructions Required 1647 Padding 1648 1649 Length 1650 A 4 byte unsigned value indicating the length in bytes 1651 of the CIE structure, not including the Length field 1652 itself. If Length contains the value 0xffffffff, then 1653 the length is contained in the Extended Length field. If 1654 Length contains the value 0, then this CIE shall be 1655 considered a terminator and processing shall end. 1656 1657 Extended Length 1658 A 8 byte unsigned value indicating the length in bytes 1659 of the CIE structure, not including the Length and 1660 Extended Length fields. 1661 1662 CIE ID 1663 A 4 byte unsigned value that is used to distinguish CIE 1664 records from FDE records. This value shall always be 0, 1665 which indicates this record is a CIE. 1666 1667 Version 1668 A 1 byte value that identifies the version number of the 1669 frame information structure. This value shall be 1. 1670 1671 Augmentation String 1672 This value is a NUL terminated string that identifies 1673 the augmentation to the CIE or to the FDEs associated 1674 with this CIE. A zero length string indicates that no 1675 augmentation data is present. The augmentation string is 1676 case sensitive and shall be interpreted as described 1677 below. 1678 1679 Code Alignment Factor 1680 An unsigned LEB128 encoded value that is factored out of 1681 all advance location instructions that are associated 1682 with this CIE or its FDEs. This value shall be 1683 multiplied by the delta argument of an adavance location 1684 instruction to obtain the new location value. 1685 1686 Data Alignment Factor 1687 A signed LEB128 encoded value that is factored out of 1688 all offset instructions that are associated with this 1689 CIE or its FDEs. This value shall be multiplied by the 1690 register offset argument of an offset instruction to 1691 obtain the new offset value. 1692 1693 Augmentation Length 1694 An unsigned LEB128 encoded value indicating the length 1695 in bytes of the Augmentation Data. This field is only 1696 present if the Augmentation String contains the 1697 character 'z'. 1698 1699 Augmentation Data 1700 A block of data whose contents are defined by the 1701 contents of the Augmentation String as described below. 1702 This field is only present if the Augmentation String 1703 contains the character 'z'. The size of this data is 1704 given by the Augentation Length. 1705 1706 Initial Instructions 1707 Initial set of Call Frame Instructions. The number of 1708 instructions is determined by the remaining space in the 1709 CIE record. 1710 1711 Padding 1712 Extra bytes to align the CIE structure to an addressing 1713 unit size boundary. 1714 __________________________________________________________ 1715 1716 11.6.1.1.1. Augmentation String Format 1717 1718 The Agumentation String indicates the presence of some optional 1719 fields, and how those fields should be intepreted. This string 1720 is case sensitive. Each character in the augmentation string in 1721 the CIE can be interpreted as below: 1722 1723 'z' 1724 1725 A 'z' may be present as the first character of the string. If 1726 present, the Augmentation Data field shall be present. The 1727 contents of the Augmentation Data shall be intepreted according 1728 to other characters in the Augmentation String. 1729 'L' 1730 1731 A 'L' may be present at any position after the first character 1732 of the string. This character may only be present if 'z' is the 1733 first character of the string. If present, it indicates the 1734 presence of one argument in the Augmentation Data of the CIE, 1735 and a corresponding argument in the Augmentation Data of the 1736 FDE. The argument in the Augmentation Data of the CIE is 1-byte 1737 and represents the pointer encoding used for the argument in 1738 the Augmentation Data of the FDE, which is the address of a 1739 language-specific data area (LSDA). The size of the LSDA 1740 pointer is specified by the pointer encoding used. 1741 'P' 1742 1743 A 'P' may be present at any position after the first character 1744 of the string. This character may only be present if 'z' is the 1745 first character of the string. If present, it indicates the 1746 presence of two arguments in the Augmentation Data of the CIE. 1747 The first argument is 1-byte and represents the pointer 1748 encoding used for the second argument, which is the address of 1749 a personality routine handler. The personality routine is used 1750 to handle language and vendor-specific tasks. The system unwind 1751 library interface accesses the language-specific exception 1752 handling semantics via the pointer to the personality routine. 1753 The personality routine does not have an ABI-specific name. The 1754 size of the personality routine pointer is specified by the 1755 pointer encoding used. 1756 'R' 1757 1758 A 'R' may be present at any position after the first character 1759 of the string. This character may only be present if 'z' is the 1760 first character of the string. If present, The Augmentation 1761 Data shall include a 1 byte argument that represents the 1762 pointer encoding for the address pointers used in the FDE. 1763 __________________________________________________________ 1764 1765 11.6.1.2. The Frame Description Entry Format 1766 1767 Table 11-10. Frame Description Entry Format 1768 Length Required 1769 Extended Length Optional 1770 CIE Pointer Required 1771 PC Begin Required 1772 PC Range Required 1773 Augmentation Data Length Optional 1774 Augmentation Data Optional 1775 Call Frame Instructions Required 1776 Padding 1777 1778 Length 1779 A 4 byte unsigned value indicating the length in bytes 1780 of the CIE structure, not including the Length field 1781 itself. If Length contains the value 0xffffffff, then 1782 the length is contained the Extended Length field. If 1783 Length contains the value 0, then this CIE shall be 1784 considered a terminator and processing shall end. 1785 1786 Extended Length 1787 A 8 byte unsigned value indicating the length in bytes 1788 of the CIE structure, not including the Length field 1789 itself. 1790 1791 CIE Pointer 1792 A 4 byte unsigned value that when subtracted from the 1793 offset of the the CIE Pointer in the current FDE yields 1794 the offset of the start of the associated CIE. This 1795 value shall never be 0. 1796 1797 PC Begin 1798 An encoded value that indicates the address of the 1799 initial location associated with this FDE. The encoding 1800 format is specified in the Augmentation Data. 1801 1802 PC Range 1803 An absolute value that indicates the number of bytes of 1804 instructions associated with this FDE. 1805 1806 Augmentation Length 1807 An unsigned LEB128 encoded value indicating the length 1808 in bytes of the Augmentation Data. This field is only 1809 present if the Augmentation String in the associated CIE 1810 contains the character 'z'. 1811 1812 Augmentation Data 1813 A block of data whose contents are defined by the 1814 contents of the Augmentation String in the associated 1815 CIE as described above. This field is only present if 1816 the Augmentation String in the associated CIE contains 1817 the character 'z'. The size of this data is given by the 1818 Augentation Length. 1819 1820 Call Frame Instructions 1821 A set of Call Frame Instructions. 1822 1823 Padding 1824 Extra bytes to align the FDE structure to an addressing 1825 unit size boundary. 1826 __________________________________________________________ 1827 1828 11.6.2. The .eh_frame_hdr section 1829 1830 The .eh_frame_hdr section contains additional information about 1831 the .eh_frame section. A pointer to the start of the .eh_frame 1832 data, and optionally, a binary search table of pointers to the 1833 .eh_frame records are found in this section. 1834 1835 Data in this section is encoded according to Section 11.5.1. 1836 1837 Table 11-11. .eh_frame_hdr Section Format 1838 Encoding Field 1839 unsigned byte version 1840 unsigned byte eh_frame_ptr_enc 1841 unsigned byte fde_count_enc 1842 unsigned byte table_enc 1843 encoded eh_frame_ptr 1844 encoded fde_count 1845 binary search table 1846 1847 version 1848 1849 Version of the .eh_frame_hdr format. This value shall be 1. 1850 eh_frame_ptr_enc 1851 1852 The encoding format of the eh_frame_ptr field. 1853 fde_count_enc 1854 1855 The encoding format of the fde_count field. A value of 1856 DW_EH_PE_omit indicates the binary search table is not present. 1857 table_enc 1858 1859 The encoding format of the entries in the binary search table. 1860 A value of DW_EH_PE_omit indicates the binary search table is 1861 not present. 1862 eh_frame_ptr 1863 1864 The encoded value of the pointer to the start of the .eh_frame 1865 section. 1866 fde_count 1867 1868 The encoded value of the count of entries in the binary search 1869 table. 1870 binary search table 1871 1872 A binary search table containing fde_count entries. Each entry 1873 of the table consist of two encoded values, the initial 1874 location, and the address. The entries are sorted in an 1875 increasing order by the initial location value. 1876 __________________________________________________________ 1877 1878 11.7. Symbol Versioning 1879 1880 11.7.1. Introduction 1881 1882 This chapter describes the Symbol Versioning mechanism. All ELF 1883 objects may provide or depend on versioned symbols. Symbol 1884 Versioning is implemented by 3 section types: SHT_GNU_versym, 1885 SHT_GNU_verdef, and SHT_GNU_verneed. 1886 1887 The prefix Elfxx in the following descriptions and code 1888 fragments stands for either "Elf32" or "Elf64", depending on 1889 the architecture. 1890 1891 Versions are described by strings. The structures that are used 1892 for symbol versions also contain a member that holds the ELF 1893 hashing values of the strings. This allows for more efficient 1894 processing. 1895 __________________________________________________________ 1896 1897 11.7.2. Symbol Version Table 1898 1899 The special section .gnu.version which has a section type of 1900 SHT_GNU_versym shall contain the Symbol Version Table. This 1901 section shall have the same number of entries as the Dynamic 1902 Symbol Table in the .dynsym section. 1903 1904 The .gnu.version section shall contain an array of elements of 1905 type Elfxx_Half. Each entry specifies the version defined for 1906 or required by the corresponding symbol in the Dynamic Symbol 1907 Table. 1908 1909 The values in the Symbol Version Table are specific to the 1910 object in which they are located. These values are identifiers 1911 that are provided by the the vna_other member of the 1912 Elfxx_Vernaux structure or the vd_ndx member of the 1913 Elfxx_Verdef structure. 1914 1915 The values 0 and 1 are reserved. 1916 1917 0 1918 1919 The symbol is local, not available outside the object. 1920 1 1921 1922 The symbol is defined in this object and is globally available. 1923 1924 All other values are used to identify version strings located 1925 in one of the other Symbol Version sections. The value itself 1926 is not the version associated with the symbol. The string 1927 identified by the value defines the version of the symbol. 1928 __________________________________________________________ 1929 1930 11.7.3. Version Definitions 1931 1932 The special section .gnu.version_d which has a section type of 1933 SHT_GNU_verdef shall contain symbol version definitions. The 1934 number of entries in this section shall be contained in the 1935 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The sh_link 1936 member of the section header (see figure 4-8 in the System V 1937 ABI) shall point to the section that contains the strings 1938 referenced by this section. 1939 1940 The section shall contain an array of Elfxx_Verdef structures, 1941 as described in Figure 11-1, optionally followed by an array of 1942 Elfxx_Verdaux structures, as defined in Figure 11-2. 1943 typedef struct { 1944 Elfxx_Half vd_version; 1945 Elfxx_Half vd_flags; 1946 Elfxx_Half vd_ndx; 1947 Elfxx_Half vd_cnt; 1948 Elfxx_Word vd_hash; 1949 Elfxx_Word vd_aux; 1950 Elfxx_Word vd_next; 1951 } Elfxx_Verdef; 1952 1953 Figure 11-1. Version Definition Entries 1954 1955 vd_version 1956 1957 Version revision. This field shall be set to 1. 1958 vd_flags 1959 1960 Version information flag bitmask. 1961 vd_ndx 1962 1963 Version index numeric value referencing the SHT_GNU_versym 1964 section. 1965 vd_cnt 1966 1967 Number of associated verdaux array entries. 1968 vd_hash 1969 1970 Version name hash value (ELF hash function). 1971 vd_aux 1972 1973 Offset in bytes to a corresponding entry in an array of 1974 Elfxx_Verdaux structures as defined in Figure 11-2 1975 vd_next 1976 1977 Offset to the next verdef entry, in bytes. 1978 typedef struct { 1979 Elfxx_Word vda_name; 1980 Elfxx_Word vda_next; 1981 } Elfxx_Verdaux; 1982 1983 Figure 11-2. Version Definition Auxiliary Entries 1984 1985 vda_name 1986 1987 Offset to the version or dependency name string in the section 1988 header, in bytes. 1989 vda_next 1990 1991 Offset to the next verdaux entry, in bytes. 1992 __________________________________________________________ 1993 1994 11.7.4. Version Requirements 1995 1996 The special section .gnu.version_r which has a section type of 1997 SHT_GNU_verneed shall contain required symbol version 1998 definitions. The number of entries in this section shall be 1999 contained in the DT_VERNEEDNUM entry of the Dynamic Section 2000 .dynamic. The sh_link member of the section header (see figure 2001 4-8 in System V ABI) shall point to the section that contains 2002 the strings referenced by this section. 2003 2004 The section shall contain an array of Elfxx_Verneed structures, 2005 as described in Figure 11-3, optionally followed by an array of 2006 Elfxx_Vernaux structures, as defined in Figure 11-4. 2007 typedef struct { 2008 Elfxx_Half vn_version; 2009 Elfxx_Half vn_cnt; 2010 Elfxx_Word vn_file; 2011 Elfxx_Word vn_aux; 2012 Elfxx_Word vn_next; 2013 } Elfxx_Verneed; 2014 2015 Figure 11-3. Version Needed Entries 2016 2017 vn_version 2018 2019 Version of structure. This value is currently set to 1, and 2020 will be reset if the versioning implementation is incompatibly 2021 altered. 2022 vn_cnt 2023 2024 Number of associated verneed array entries. 2025 vn_file 2026 2027 Offset to the file name string in the section header, in bytes. 2028 vn_aux 2029 2030 Offset to a corresponding entry in the vernaux array, in bytes. 2031 vn_next 2032 2033 Offset to the next verneed entry, in bytes. 2034 typedef struct { 2035 Elfxx_Word vna_hash; 2036 Elfxx_Half vna_flags; 2037 Elfxx_Half vna_other; 2038 Elfxx_Word vna_name; 2039 Elfxx_Word vna_next; 2040 } Elfxx_Vernaux; 2041 2042 Figure 11-4. Version Needed Auxiliary Entries 2043 2044 vna_hash 2045 2046 Dependency name hash value (ELF hash function). 2047 vna_flags 2048 2049 Dependency information flag bitmask. 2050 vna_other 2051 2052 Object file version identifier used in the .gnu.version symbol 2053 version array. Bit number 15 controls whether or not the object 2054 is hidden; if this bit is set, the object cannot be used and 2055 the static linker will ignore the symbol's presence in the 2056 object. 2057 vna_name 2058 2059 Offset to the dependency name string in the section header, in 2060 bytes. 2061 vna_next 2062 2063 Offset to the next vernaux entry, in bytes. 2064 __________________________________________________________ 2065 2066 11.7.5. Startup Sequence 2067 2068 When loading a sharable object the system shall analyze version 2069 definition data from the loaded object to assure that it meets 2070 the version requirements of the calling object. This step is 2071 referred to as definition testing. The dynamic loader shall 2072 retrieve the entries in the caller's Elfxx_Verneed array and 2073 attempt to find matching definition information in the loaded 2074 Elfxx_Verdef table. 2075 2076 Each object and dependency shall be tested in turn. If a symbol 2077 definition is missing and the vna_flags bit for VER_FLG_WEAK is 2078 not set, the loader shall return an error and exit. If the 2079 vna_flags bit for VER_FLG_WEAK is set in the Elfxx_Vernaux 2080 entry, and the loader shall issue a warning and continue 2081 operation. 2082 2083 When the versions referenced by undefined symbols in the loaded 2084 object are found, version availability is certified. The test 2085 completes without error and the object shall be made available. 2086 __________________________________________________________ 2087 2088 11.7.6. Symbol Resolution 2089 2090 When symbol versioning is used in an object, relocations extend 2091 definition testing beyond the simple match of symbol name 2092 strings: the version of the reference shall also equal the name 2093 of the definition. 2094 2095 The same index that is used in the symbol table can be 2096 referenced in the SHT_GNU_versym section, and the value of this 2097 index is then used to acquire name data. The corresponding 2098 requirement string is retrieved from the Elfxx_Verneed array, 2099 and likewise, the corresponding definition string from the 2100 Elfxx_Verdef table. 2101 2102 If the high order bit (bit number 15) of the version symbolis 2103 set, the object cannot be used and the static linker shall 2104 ignore the symbol's presence in the object. 2105 2106 When an object with a reference and an object with the 2107 definition are being linked, the following rules shall govern 2108 the result: 2109 2110 * The object with the reference and the object with the 2111 definitions both use versioning. All described matching is 2112 processed in this case. A fatal error shall be triggered 2113 when no matching definition can be found in the object 2114 whose name is the one referenced by the vn_name element in 2115 the Elfxx_Verneed entry. 2116 * The object with the reference does not use versioning, 2117 while the object with the definitions does. In this 2118 instance, only the definitions with index numbers 1 and 2 2119 will be used in the reference match, the same identified by 2120 the static linker as the base definition. In cases where 2121 the static linker was not used, such as in calls to 2122 dlopen(), a version that does not have the base definition 2123 index shall be acceptable if it is the only version for 2124 which the symbol is defined. 2125 * The object with the reference uses versioning, but the 2126 object with the definitions specifies none. A matching 2127 symbol shall be accepted in this case. A fatal error shall 2128 be triggered if a corruption in the required symbols list 2129 obscures an outdated object file and causes a match on the 2130 object filename in the Elfxx_Verneed entry. 2131 * Neither the object with the reference nor the object with 2132 the definitions use versioning. The behavior in this 2133 instance shall default to pre-existing symbol rules. 2134 __________________________________________________________ 2135 2136 11.8. ABI note tag 2137 2138 Every executable shall contain a section named .note.ABI-tag of 2139 type SHT_NOTE. This section is structured as a note section as 2140 documented in the ELF spec. The section shall contain at least 2141 the following entry. The name field (namesz/name) contains the 2142 string "GNU". The type field shall be 1. The descsz field shall 2143 be at least 16, and the first 16 bytes of the desc field shall 2144 be as follows. 2145 2146 The first 32-bit word of the desc field shall be 0 (this 2147 signifies a Linux executable). The second, third, and fourth 2148 32-bit words of the desc field contain the earliest compatible 2149 kernel version. For example, if the 3 words are 2, 2, and 5, 2150 this signifies a 2.2.5 kernel. 2151 __________________________________________________________ 2152 2153 Chapter 12. Dynamic Linking 2154 2155 12.1. Program Loading and Dynamic Linking 2156 2157 LSB-conforming implementations shall support the object file 2158 information and system actions that create running programs as 2159 specified in the System V ABI and System V ABI Update and as 2160 further required by this specification and the relevant 2161 architecture specific part of ISO/IEC 23360. 2162 2163 Any shared object that is loaded shall contain sufficient 2164 DT_NEEDED records to satisfy the symbols on the shared library. 2165 __________________________________________________________ 2166 2167 12.2. Program Header 2168 2169 In addition to the Segment Types defined in the System V ABI 2170 and System V ABI Update the following Segment Types shall also 2171 be supported. 2172 2173 Table 12-1. Linux Segment Types 2174 Name Value 2175 PT_GNU_EH_FRAME 0x6474e550 2176 PT_GNU_STACK 0x6474e551 2177 PT_GNU_RELRO 0x6474e552 2178 2179 PT_GNU_EH_FRAME 2180 2181 The array element specifies the location and size of the 2182 exception handling information as defined by the .eh_frame_hdr 2183 section. 2184 PT_GNU_STACK 2185 2186 The p_flags member specifies the permissions on the segment 2187 containing the stack and is used to indicate wether the stack 2188 should be executable. The absense of this header indicates that 2189 the stack will be executable. 2190 PT_GNU_RELRO 2191 2192 the array element specifies the location and size of a segment 2193 which may be made read-only after relocations have been 2194 processed. 2195 __________________________________________________________ 2196 2197 12.3. Dynamic Entries 2198 2199 12.3.1. Introduction 2200 2201 As described in System V ABI, if an object file participates in 2202 dynamic linking, its program header table shall have an element 2203 of type PT_DYNAMIC. This `segment' contains the .dynamic 2204 section. A special symbol, _DYNAMIC, labels the section, which 2205 contains an array of the following structures. 2206 typedef struct { 2207 Elf32_Sword d_tag; 2208 union { 2209 Elf32_Word d_val; 2210 Elf32_Addr d_ptr; 2211 } d_un; 2212 } Elf32_Dyn; 2213 2214 extern Elf32_Dyn _DYNAMIC[]; 2215 2216 typedef struct { 2217 Elf64_Sxword d_tag; 2218 union { 2219 Elf64_Xword d_val; 2220 Elf64_Addr d_ptr; 2221 } d_un; 2222 } Elf64_Dyn; 2223 2224 extern Elf64_Dyn _DYNAMIC[]; 2225 2226 Figure 12-1. Dynamic Structure 2227 2228 For each object with this type, d_tag controls the 2229 interpretation of d_un. 2230 __________________________________________________________ 2231 2232 12.3.2. Dynamic Entries 2233 __________________________________________________________ 2234 2235 12.3.2.1. ELF Dynamic Entries 2236 2237 The following dynamic entries are defined in the System V ABI 2238 and System V ABI Update. 2239 2240 DT_BIND_NOW 2241 2242 Process relocations of object 2243 DT_DEBUG 2244 2245 For debugging; unspecified 2246 DT_FINI 2247 2248 Address of termination function 2249 DT_HASH 2250 2251 Address of symbol hash table 2252 DT_HIPROC 2253 2254 End of processor-specific 2255 DT_INIT 2256 2257 Address of init function 2258 DT_JMPREL 2259 2260 Address of PLT relocs 2261 DT_LOPROC 2262 2263 Start of processor-specific 2264 DT_NEEDED 2265 2266 Name of needed library 2267 DT_NULL 2268 2269 Marks end of dynamic section 2270 DT_PLTREL 2271 2272 Type of reloc in PLT 2273 DT_PLTRELSZ 2274 2275 Size in bytes of PLT relocs 2276 DT_REL 2277 2278 Address of Rel relocs 2279 DT_RELA 2280 2281 Address of Rela relocs 2282 DT_RELAENT 2283 2284 Size of one Rela reloc 2285 DT_RELASZ 2286 2287 Total size of Rela relocs 2288 DT_RELENT 2289 2290 Size of one Rel reloc 2291 DT_RELSZ 2292 2293 Total size of Rel relocs 2294 DT_RPATH 2295 2296 Library search path 2297 DT_SONAME 2298 2299 Name of shared object 2300 DT_STRSZ 2301 2302 Size of string table 2303 DT_STRTAB 2304 2305 Address of string table 2306 DT_SYMBOLIC 2307 2308 Start symbol search here 2309 DT_SYMENT 2310 2311 Size of one symbol table entry 2312 DT_SYMTAB 2313 2314 Address of symbol table 2315 DT_TEXTREL 2316 2317 Reloc might modify .text 2318 __________________________________________________________ 2319 2320 12.3.2.2. Additional Dynamic Entries 2321 2322 An LSB conforming object may also use the following additional 2323 Dynamic Entry types. 2324 2325 DT_ADDRRNGHI 2326 2327 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2328 definition by an archLSB. 2329 DT_ADDRRNGLO 2330 2331 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2332 definition by an archLSB. 2333 DT_AUXILIARY 2334 2335 Shared object to load before self 2336 DT_FILTER 2337 2338 Shared object to get values from 2339 DT_FINI_ARRAY 2340 2341 The address of an array of pointers to termination functions. 2342 DT_FINI_ARRAYSZ 2343 2344 Size in bytes of DT_FINI_ARRAY 2345 DT_HIOS 2346 2347 Values from DT_LOOS through DT_HIOS are reserved for definition 2348 by specific operating systems. 2349 DT_INIT_ARRAY 2350 2351 The address of an array of pointers to initialization 2352 functions. 2353 DT_INIT_ARRAYSZ 2354 2355 Size in bytes of DT_INIT_ARRAY 2356 DT_LOOS 2357 2358 Values from DT_LOOS through DT_HIOS are reserved for definition 2359 by specific operating systems. 2360 DT_NUM 2361 2362 Number of dynamic entry tags defined (excepting reserved 2363 ranges). 2364 DT_POSFLAG_1 2365 2366 Flags for DT_* entries, effecting the following DT_* entry 2367 DT_RELCOUNT 2368 2369 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2370 single block and this entry specifies the number of entries in 2371 that block. This permits ld.so.1 to streamline the processing 2372 of RELATIVE relocations. 2373 DT_RUNPATH 2374 2375 null-terminated library search path string 2376 DT_SYMINENT 2377 2378 Entry size of syminfo 2379 DT_SYMINFO 2380 2381 Address of the Syminfo table. 2382 DT_SYMINSZ 2383 2384 Size of syminfo table (in bytes) 2385 DT_VALRNGHI 2386 2387 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2388 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2389 DT_VALRNGLO 2390 2391 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2392 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2393 DT_VERDEF 2394 2395 Address of version definition table 2396 DT_VERDEFNUM 2397 2398 Number of version definitions 2399 DT_VERNEED 2400 2401 Address of table with needed versions 2402 DT_VERNEEDNUM 2403 2404 Number of needed versions 2405 DT_VERSYM 2406 2407 Address of the table provided by the .gnu.version section. 2408 2409 III. Base Libraries 2410 2411 Table of Contents 2412 13. Base Libraries 2413 2414 13.1. Introduction 2415 13.2. Program Interpreter 2416 13.3. Interfaces for libc 2417 2418 13.3.1. RPC 2419 13.3.2. Epoll 2420 13.3.3. System Calls 2421 13.3.4. Standard I/O 2422 13.3.5. Signal Handling 2423 13.3.6. Localization Functions 2424 13.3.7. Posix Spawn Option 2425 13.3.8. Posix Advisory Option 2426 13.3.9. Socket Interface 2427 13.3.10. Wide Characters 2428 13.3.11. String Functions 2429 13.3.12. IPC Functions 2430 13.3.13. Regular Expressions 2431 13.3.14. Character Type Functions 2432 13.3.15. Time Manipulation 2433 13.3.16. Terminal Interface Functions 2434 13.3.17. System Database Interface 2435 13.3.18. Language Support 2436 13.3.19. Large File Support 2437 13.3.20. Inotify 2438 13.3.21. Standard Library 2439 2440 13.4. Data Definitions for libc 2441 2442 13.4.1. arpa/inet.h 2443 13.4.2. assert.h 2444 13.4.3. cpio.h 2445 13.4.4. ctype.h 2446 13.4.5. dirent.h 2447 13.4.6. endian.h 2448 13.4.7. err.h 2449 13.4.8. errno.h 2450 13.4.9. fcntl.h 2451 13.4.10. fmtmsg.h 2452 13.4.11. fnmatch.h 2453 13.4.12. ftw.h 2454 13.4.13. getopt.h 2455 13.4.14. glob.h 2456 13.4.15. grp.h 2457 13.4.16. iconv.h 2458 13.4.17. inttypes.h 2459 13.4.18. langinfo.h 2460 13.4.19. libgen.h 2461 13.4.20. libintl.h 2462 13.4.21. limits.h 2463 13.4.22. locale.h 2464 13.4.23. monetary.h 2465 13.4.24. net/if.h 2466 13.4.25. netdb.h 2467 13.4.26. netinet/icmp6.h 2468 13.4.27. netinet/igmp.h 2469 13.4.28. netinet/in.h 2470 13.4.29. netinet/in_systm.h 2471 13.4.30. netinet/ip.h 2472 13.4.31. netinet/ip6.h 2473 13.4.32. netinet/ip_icmp.h 2474 13.4.33. netinet/tcp.h 2475 13.4.34. netinet/udp.h 2476 13.4.35. nl_types.h 2477 13.4.36. poll.h 2478 13.4.37. pty.h 2479 13.4.38. pwd.h 2480 13.4.39. regex.h 2481 13.4.40. rpc/auth.h 2482 13.4.41. rpc/clnt.h 2483 13.4.42. rpc/pmap_clnt.h 2484 13.4.43. rpc/rpc_msg.h 2485 13.4.44. rpc/svc.h 2486 13.4.45. rpc/types.h 2487 13.4.46. rpc/xdr.h 2488 13.4.47. sched.h 2489 13.4.48. search.h 2490 13.4.49. setjmp.h 2491 13.4.50. signal.h 2492 13.4.51. spawn.h 2493 13.4.52. stddef.h 2494 13.4.53. stdint.h 2495 13.4.54. stdio.h 2496 13.4.55. stdlib.h 2497 13.4.56. string.h 2498 13.4.57. strings.h 2499 13.4.58. sys/epoll.h 2500 13.4.59. sys/file.h 2501 13.4.60. sys/inotify.h 2502 13.4.61. sys/ioctl.h 2503 13.4.62. sys/ipc.h 2504 13.4.63. sys/mman.h 2505 13.4.64. sys/msg.h 2506 13.4.65. sys/param.h 2507 13.4.66. sys/poll.h 2508 13.4.67. sys/resource.h 2509 13.4.68. sys/select.h 2510 13.4.69. sys/sem.h 2511 13.4.70. sys/sendfile.h 2512 13.4.71. sys/shm.h 2513 13.4.72. sys/socket.h 2514 13.4.73. sys/stat.h 2515 13.4.74. sys/statfs.h 2516 13.4.75. sys/statvfs.h 2517 13.4.76. sys/time.h 2518 13.4.77. sys/timeb.h 2519 13.4.78. sys/times.h 2520 13.4.79. sys/types.h 2521 13.4.80. sys/uio.h 2522 13.4.81. sys/un.h 2523 13.4.82. sys/utsname.h 2524 13.4.83. sys/wait.h 2525 13.4.84. syslog.h 2526 13.4.85. tar.h 2527 13.4.86. termios.h 2528 13.4.87. time.h 2529 13.4.88. ucontext.h 2530 13.4.89. ulimit.h 2531 13.4.90. unistd.h 2532 13.4.91. utime.h 2533 13.4.92. utmp.h 2534 13.4.93. utmpx.h 2535 13.4.94. wchar.h 2536 13.4.95. wctype.h 2537 13.4.96. wordexp.h 2538 2539 13.5. Interface Definitions for libc 2540 2541 _IO_feof -- alias for feof 2542 _IO_getc -- alias for getc 2543 _IO_putc -- alias for putc 2544 _IO_puts -- alias for puts 2545 __assert_fail -- abort the program after false 2546 assertion 2547 2548 __chk_fail -- terminate a function in case of buffer 2549 overflow 2550 2551 __confstr_chk -- get configuration dependent string 2552 variables, with buffer overflow checking 2553 2554 __ctype_b_loc -- accessor function for __ctype_b 2555 array for ctype functions 2556 2557 __ctype_get_mb_cur_max -- maximum length of a 2558 multibyte character in the current locale 2559 2560 __ctype_tolower_loc -- accessor function for 2561 __ctype_b_tolower array for ctype tolower() 2562 function 2563 2564 __ctype_toupper_loc -- accessor function for 2565 __ctype_b_toupper() array for ctype 2566 toupper() function 2567 2568 __cxa_atexit -- register a function to be called by 2569 exit or when a shared library is unloaded 2570 2571 __cxa_finalize -- call destructors of global (or 2572 local static) C++ objects and exit functions 2573 registered with atexit 2574 2575 __daylight -- external daylight savings time flag 2576 __environ -- alias for environ - user environment 2577 __errno_location -- address of errno variable 2578 __fgets_chk -- string input, with buffer overflow 2579 checking 2580 2581 __fgets_unlocked_chk -- non-locking string input, 2582 with buffer overflow checking 2583 2584 __fgetws_chk -- read a wide-character string from a 2585 FILE stream, with buffer overflow checking 2586 2587 __fgetws_unlocked_chk -- read a wide-character 2588 string from a FILE stream in a non-locking 2589 manner, with stack checking 2590 2591 __fpending -- returns in bytes the amount of output 2592 pending on a stream 2593 2594 __fprintf_chk -- convert formatted output, with 2595 stack checking 2596 2597 __fwprintf_chk -- convert formatted wide-character 2598 output, with stack checking 2599 2600 __fxstatat -- get file status relative to directory 2601 file descriptor 2602 2603 __fxstatat64 -- get file status relative to 2604 directory file descriptor 2605 2606 __getcwd_chk -- get current working directory, with 2607 buffer overflow checking 2608 2609 __getgroups_chk -- get list of supplementary group 2610 IDs, with buffer overflow checking 2611 2612 __gethostname_chk -- get host name, with buffer 2613 overflow checking 2614 2615 __getlogin_r_chk -- get user name, with buffer 2616 overflow checking (reentrant) 2617 2618 __getpagesize -- alias for getpagesize - get current 2619 page size 2620 2621 __getpgid -- get the process group id 2622 __h_errno_location -- address of h_errno variable 2623 __isinf -- test for infinity 2624 __isinff -- test for infinity 2625 __isinfl -- test for infinity 2626 __isnan -- test for infinity 2627 __isnanf -- test for infinity 2628 __isnanl -- test for infinity 2629 __libc_current_sigrtmax -- return number of 2630 available real-time signal with lowest 2631 priority 2632 2633 __libc_current_sigrtmin -- return number of 2634 available real-time signal with highest 2635 priority 2636 2637 __libc_start_main -- initialization routine 2638 __mbsnrtowcs_chk -- convert a multibyte string to a 2639 wide-character string, with buffer overflow 2640 checking 2641 2642 __mbsrtowcs_chk -- convert a multibyte string to a 2643 wide-character string, with buffer overflow 2644 checking 2645 2646 __mbstowcs_chk -- convert a multibyte string to a 2647 wide-character string, with buffer overflow 2648 checking 2649 2650 __memcpy_chk -- copy memory area, with buffer 2651 overflow checking 2652 2653 __memmove_chk -- copy memory area, with buffer 2654 overflow checking 2655 2656 __mempcpy -- copy given number of bytes of source to 2657 destination 2658 2659 __mempcpy_chk -- copy memory area, with buffer 2660 overflow checking 2661 2662 __memset_chk -- fill memory with a constant byte, 2663 using buffer overflow checking 2664 2665 __pread64_chk -- read from a file descriptor at a 2666 given offset, with buffer overflow checking 2667 2668 __pread_chk -- read from a file descriptor at a 2669 given offset, with buffer overflow checking 2670 2671 __printf_chk -- format and print data, with stack 2672 checking 2673 2674 __rawmemchr -- scan memory 2675 __read_chk -- read from a file descriptor, with 2676 buffer overflow checking 2677 2678 __readlink_chk -- display value of a symbolic link, 2679 with buffer overflow checking 2680 2681 __realpath_chk -- return the canonicalized absolute 2682 pathname, with buffer overflow checking 2683 2684 __recv_chk -- receive a message from a socket, with 2685 buffer overflow checking 2686 2687 __recvfrom_chk -- receive a message from a socket, 2688 with buffer overflow checking 2689 2690 __register_atfork -- alias for register_atfork 2691 __sigsetjmp -- save stack context for non-local goto 2692 __snprintf_chk -- convert formatted output, with 2693 buffer overflow checking 2694 2695 __sprintf_chk -- convert formatted output, with 2696 stack checking 2697 2698 __stack_chk_fail -- terminate a function in case of 2699 stack overflow 2700 2701 __stpcpy -- alias for stpcpy 2702 __stpcpy_chk -- copy a string returning a pointer to 2703 its end, with buffer overflow checking 2704 2705 __stpncpy_chk -- copy a fixed-size string, returning 2706 a pointer to its end, with buffer overflow 2707 checking 2708 2709 __strcat_chk -- concatenate two strings, with buffer 2710 overflow checking 2711 2712 __strcpy_chk -- copy a string, with buffer overflow 2713 checking 2714 2715 __strdup -- alias for strdup 2716 __strncat_chk -- concatenate two strings, with 2717 buffer overflow checking 2718 2719 __strncpy_chk -- copy a string, with buffer overflow 2720 checking 2721 2722 __strtod_internal -- underlying function for strtod 2723 __strtof_internal -- underlying function for strtof 2724 __strtok_r -- alias for strtok_r 2725 __strtol_internal -- alias for strtol 2726 __strtold_internal -- underlying function for 2727 strtold 2728 2729 __strtoll_internal -- underlying function for 2730 strtoll 2731 2732 __strtoul_internal -- underlying function for 2733 strtoul 2734 2735 __strtoull_internal -- underlying function for 2736 strtoull 2737 2738 __swprintf_chk -- convert formatted wide-character 2739 output, with stack checking 2740 2741 __sysconf -- get configuration information at 2742 runtime 2743 2744 __syslog_chk -- send messages to the system logger, 2745 with stack checking 2746 2747 __sysv_signal -- signal handling 2748 __timezone -- external variable containing timezone 2749 __ttyname_r_chk -- return name of a terminal, with 2750 buffer overflow checking (reentrant) 2751 2752 __tzname -- external variable containing the 2753 timezone names 2754 2755 __vfprintf_chk -- convert formatted output, with 2756 stack checking 2757 2758 __vfwprintf_chk -- convert formatted wide-character 2759 output, with stack checking 2760 2761 __vprintf_chk -- convert formatted output, with 2762 stack checking 2763 2764 __vsnprintf_chk -- convert formatted output, with 2765 stack checking 2766 2767 __vsprintf_chk -- convert formatted output, with 2768 stack checking 2769 2770 __vswprintf_chk -- convert formatted wide-character 2771 output, with stack checking 2772 2773 __vsyslog_chk -- send messages to the system logger, 2774 with stack checking 2775 2776 __vwprintf_chk -- convert formatted wide-character 2777 output, with stack checking 2778 2779 __wcpcpy_chk -- copy a wide-character string, 2780 returning a pointer to its end, with buffer 2781 overflow checking 2782 2783 __wcpncpy_chk -- copy a fixed-size string of wide 2784 characters, returning a pointer to its end, 2785 with buffer overflow checking 2786 2787 __wcrtomb_chk -- convert a wide character to a 2788 multibyte sequence, with buffer overflow 2789 checking 2790 2791 __wcscat_chk -- concatenate two wide-character 2792 strings, with buffer overflow checking 2793 2794 __wcscpy_chk -- copy a wide-character string, with 2795 buffer overflow checking 2796 2797 __wcsncat_chk -- concatenate two wide-character 2798 strings, with buffer overflow checking 2799 2800 __wcsncpy_chk -- copy a fixed-size string of wide 2801 characters, with buffer overflow checking 2802 2803 __wcsnrtombs_chk -- convert a wide-character string 2804 to a multibyte string, with buffer overflow 2805 checking 2806 2807 __wcsrtombs_chk -- convert a wide-character string 2808 to a multibyte string, with buffer overflow 2809 checking 2810 2811 __wcstod_internal -- underlying function for wcstod 2812 __wcstof_internal -- underlying function for wcstof 2813 __wcstol_internal -- underlying function for wcstol 2814 __wcstold_internal -- underlying function for 2815 wcstold 2816 2817 __wcstombs_chk -- convert a wide-character string to 2818 a multibyte string, with buffer overflow 2819 checking 2820 2821 __wcstoul_internal -- underlying function for 2822 wcstoul 2823 2824 __wctomb_chk -- convert a wide character to a 2825 multibyte sequence, with buffer overflow 2826 checking 2827 2828 __wmemcpy_chk -- copy an array of wide-characters, 2829 with buffer overflow checking 2830 2831 __wmemmove_chk -- copy an array of wide-characters, 2832 with buffer overflow checking 2833 2834 __wmempcpy_chk -- copy memory area, with buffer 2835 overflow checking 2836 2837 __wmemset_chk -- fill an array of wide-characters 2838 with a constant wide character, with buffer 2839 overflow checking 2840 2841 __wprintf_chk -- convert formatted wide-character 2842 output, with stack checking 2843 2844 __xmknod -- make a special file 2845 __xmknodat -- make a special file relative to a 2846 directory file descriptor 2847 2848 __xpg_basename -- return the last component of a 2849 file name 2850 2851 __xpg_sigpause -- remove a signal from the signal 2852 mask and suspend the thread 2853 2854 __xpg_strerror_r -- return string describing error 2855 number 2856 2857 __xstat -- get File Status 2858 __xstat64 -- get File Status 2859 _environ -- alias for environ - user environment 2860 _nl_msg_cat_cntr -- new catalog load counter 2861 _sys_errlist -- array containing the "C" locale 2862 strings used by strerror() 2863 2864 _sys_siglist -- array containing the names of the 2865 signal names 2866 2867 acct -- switch process accounting on or off 2868 adjtime -- correct the time to allow synchronization 2869 of the system clock 2870 2871 alphasort64 -- Comparison function for directory 2872 scanning (Large File Support) 2873 2874 asprintf -- write formatted output to a dynamically 2875 allocated string 2876 2877 basename -- return the last component of a file name 2878 bind_textdomain_codeset -- specify encoding for 2879 message retrieval 2880 2881 bindresvport -- bind socket to privileged IP port 2882 bindtextdomain -- specify the location of a message 2883 catalog 2884 2885 cfmakeraw -- get and set terminal attributes 2886 cfsetspeed -- set terminal input and output data 2887 rate 2888 2889 clearerr_unlocked -- non-thread-safe clearerr 2890 daemon -- run in the background 2891 dcgettext -- perform domain and category specific 2892 lookup in message catalog 2893 2894 dcngettext -- perform domain and category specific 2895 lookup in message catalog with plural 2896 2897 dgettext -- perform lookup in message catalog for 2898 the current LC_MESSAGES locale 2899 2900 dngettext -- perform lookup in message catalog for 2901 the current locale 2902 2903 drand48_r -- reentrantly generate pseudorandom 2904 numbers in a uniform distribution 2905 2906 duplocale -- provide new handle for selection of 2907 locale 2908 2909 endutent -- access utmp file entries 2910 epoll_create -- open an epoll file descriptor 2911 epoll_ctl -- control an epoll file descriptor 2912 epoll_wait -- wait for I/O events on an epoll file 2913 descriptor 2914 2915 erand48_r -- reentrantly generate pseudorandom 2916 numbers in a uniform distribution 2917 2918 err -- display formatted error messages 2919 error -- print error message 2920 errx -- display formatted error message and exit 2921 fcntl -- file control 2922 feof_unlocked -- non-thread-safe feof 2923 ferror_unlocked -- non-thread-safe ferror 2924 fflush_unlocked -- non thread safe fflush 2925 fgetc_unlocked -- non-thread-safe fgetc 2926 fgets_unlocked -- non-thread-safe fgets 2927 fgetwc_unlocked -- non thread safe fgetwc 2928 fgetws_unlocked -- non-thread-safe fgetws 2929 fileno_unlocked -- non-thread-safe fileno 2930 flock -- apply or remove an advisory lock on an open 2931 file 2932 2933 fputc_unlocked -- non-thread-safe fputc 2934 fputs_unlocked -- non-thread-safe fputs 2935 fputwc_unlocked -- non-thread-safe fputwc 2936 fputws_unlocked -- non-thread-safe fputws 2937 fread_unlocked -- non-thread-safe fread 2938 freelocale -- free a locale object 2939 fscanf -- convert formatted input 2940 fstatfs -- (deprecated) 2941 fstatfs64 -- (deprecated) 2942 fwrite_unlocked -- non-thread-safe fwrite 2943 fwscanf -- convert formatted input 2944 getdomainname -- get NIS domain name (DEPRECATED). 2945 getdtablesize -- get file descriptor table size 2946 (DEPRECATED) 2947 2948 getgrent_r -- reentrantly get entry in group file 2949 getgrouplist -- get groups a user belongs to 2950 gethostbyaddr_r -- find network host database entry 2951 matching host name (DEPRECATED) 2952 2953 gethostbyname2 -- find network host database entry 2954 matching host name (DEPRECATED) 2955 2956 gethostbyname2_r -- find network host database entry 2957 matching host name (DEPRECATED) 2958 2959 gethostbyname_r -- find network host database entry 2960 matching host name (DEPRECATED) 2961 2962 getloadavg -- get system load averages 2963 getopt -- parse command line options 2964 getopt_long -- parse command line options 2965 getopt_long_only -- parse command line options 2966 getpagesize -- get memory page size (DEPRECATED) 2967 getprotobyname_r -- retrieve information from the 2968 network protocol database by protocol name, 2969 reentrantly 2970 2971 getprotobynumber_r -- retrieve information from the 2972 network protocol database by protocol 2973 number, reentrantly 2974 2975 getprotoent_r -- read the next entry of the protocol 2976 database, reentrantly 2977 2978 getpwent_r -- reentrantly get entry in passwd file 2979 getservbyname_r -- retrieve information from the 2980 network services database by service name, 2981 reentrantly 2982 2983 getservbyport_r -- retrieve information from the 2984 network services database by service port, 2985 reentrantly 2986 2987 getservent_r -- read the next entry of the network 2988 services database, reentrantly 2989 2990 getsockopt -- get socket options 2991 gettext -- search message catalogs for a string 2992 getutent -- access user accounting database entries 2993 getutent_r -- access user accounting database 2994 entries 2995 2996 getwc_unlocked -- non-thread-safe getwc 2997 getwchar_unlocked -- non-thread-safe getwchar 2998 glob64 -- find pathnames matching a pattern (Large 2999 File Support) 3000 3001 globfree64 -- free memory from glob64() (Large File 3002 Support) 3003 3004 hcreate_r -- allocate space for a hash search table, 3005 reentrantly 3006 3007 hdestroy_r -- dispose of a hash search table, 3008 reentrantly 3009 3010 hsearch_r -- search a hash table, reentrantly 3011 inet_aton -- Internet address manipulation routine 3012 initgroups -- initialize the supplementary group 3013 access list 3014 3015 initstate_r -- reentrantly initialize a state array 3016 for random number generator functions 3017 3018 inotify_add_watch -- add a watch to a watch list 3019 inotify_init -- instantiate inotify 3020 inotify_rm_watch -- remove a watch from an inotify 3021 watch list 3022 3023 ioctl -- control device 3024 sockio -- socket ioctl commands 3025 ttyio -- tty ioctl commands 3026 jrand48_r -- reentrantly generate pseudorandom 3027 numbers in a uniform distribution 3028 3029 kill -- send a signal 3030 lcong48_r -- reentrantly generate pseudorandom 3031 numbers in a uniform distribution 3032 3033 link -- create a link to a file 3034 lrand48_r -- reentrantly generate pseudorandom 3035 numbers in a uniform distribution 3036 3037 mbsnrtowcs -- convert a multibyte string to a wide 3038 character string 3039 3040 memmem -- locate bytes 3041 memrchr -- scan memory for a character 3042 mkstemp64 -- create a unique temporary file (Large 3043 File Support) 3044 3045 mrand48_r -- reentrantly generate pseudorandom 3046 numbers in a uniform distribution 3047 3048 mremap -- remap a virtual memory address 3049 newlocale -- allocate a locale object 3050 ngettext -- search message catalogs for plural 3051 string 3052 3053 nrand48_r -- reentrantly generate pseudorandom 3054 numbers in a uniform distribution 3055 3056 openat64 -- open a file relative to a directory file 3057 descriptor (Large File Support) 3058 3059 pmap_getport -- find the port number assigned to a 3060 service registered with a portmapper. 3061 3062 pmap_set -- establishes mapping to machine's RPC 3063 Bind service. 3064 3065 pmap_unset -- destroys RPC Binding 3066 posix_fadvise64 -- File advisory information (Large 3067 File Support) 3068 3069 posix_fallocate64 -- file space control (Large File 3070 Support) 3071 3072 psignal -- print signal message 3073 putwc_unlocked -- non-thread-safe putwc 3074 putwchar_unlocked -- non-thread-safe putwchar 3075 random_r -- reentrantly generate pseudorandom 3076 numbers in a uniform distribution 3077 3078 readdir64_r -- read a directory (Large File Support) 3079 regexec -- regular expression matching 3080 scandir64 -- scan a directory (Large File Support) 3081 scanf -- convert formatted input 3082 sched_getaffinity -- retrieve the affinity mask of a 3083 process 3084 3085 sched_setaffinity -- set the CPU affinity mask for a 3086 process 3087 3088 sched_setscheduler -- set scheduling policy and 3089 parameters 3090 3091 seed48_r -- reentrantly generate pseudorandom 3092 numbers in a uniform distribution 3093 3094 sendfile -- transfer data between two file 3095 descriptors 3096 3097 sendfile64 -- transfer data between two file 3098 descriptors (Large File Support) 3099 3100 setbuffer -- stream buffering operation 3101 setgroups -- set list of supplementary group IDs 3102 sethostname -- set host name 3103 setsockopt -- set socket options 3104 setstate_r -- reentrantly change the state array 3105 used by random number generator functions 3106 3107 setutent -- access user accounting database entries 3108 sigandset -- build a new signal set by combining the 3109 two input sets using logical AND 3110 3111 sigisemptyset -- check for empty signal set 3112 sigorset -- build a new signal set by combining the 3113 two input sets using logical OR 3114 3115 sigpause -- remove a signal from the signal mask and 3116 suspend the thread (deprecated) 3117 3118 sigreturn -- return from signal handler and cleanup 3119 stack frame 3120 3121 srand48_r -- reentrantly generate pseudorandom 3122 numbers in a uniform distribution 3123 3124 srandom_r -- reentrantly set the seed for a new 3125 sequence of pseudorandom numbers 3126 3127 sscanf -- convert formatted input 3128 statfs -- (deprecated) 3129 statfs64 -- (deprecated) 3130 stime -- set time 3131 stpcpy -- copy a string returning a pointer to its 3132 end 3133 3134 stpncpy -- copy a fixed-size string, returning a 3135 pointer to its end 3136 3137 strcasestr -- locate a substring ignoring case 3138 strerror_r -- return string describing error number 3139 strndup -- return a malloc'd copy of at most the 3140 specified number of bytes of a string 3141 3142 strnlen -- determine the length of a fixed-size 3143 string 3144 3145 strptime -- parse a time string 3146 strsep -- extract token from string 3147 strsignal -- return string describing signal 3148 strtoq -- convert string value to a long or quad_t 3149 integer 3150 3151 strtouq -- convert a string to an unsigned long long 3152 svc_register -- register Remote Procedure Call 3153 interface 3154 3155 svc_run -- waits for RPC requests to arrive and 3156 calls service procedure 3157 3158 svc_sendreply -- called by RPC service's dispatch 3159 routine 3160 3161 svctcp_create -- create a TCP/IP-based RPC service 3162 transport 3163 3164 svcudp_create -- create a UDP-based RPC service 3165 transport 3166 3167 swscanf -- convert formatted input 3168 sysconf -- Get configuration information at runtime 3169 system -- execute a shell command 3170 textdomain -- set the current default message domain 3171 unlink -- remove a directory entry 3172 uselocale -- set locale for thread 3173 utmpname -- set user accounting database 3174 vasprintf -- write formatted output to a dynamically 3175 allocated string 3176 3177 vdprintf -- write formatted output to a file 3178 descriptor 3179 3180 verrx -- display formatted error message and exit 3181 vfscanf -- convert formatted input 3182 vfwscanf -- convert formatted input 3183 vscanf -- convert formatted input 3184 vsscanf -- convert formatted input 3185 vswscanf -- convert formatted input 3186 vsyslog -- log to system log 3187 vwscanf -- convert formatted input 3188 wait4 -- wait for process termination, BSD style 3189 warn -- formatted error messages 3190 warnx -- formatted error messages 3191 wcpcpy -- copy a wide character string, returning a 3192 pointer to its end 3193 3194 wcpncpy -- copy a fixed-size string of wide 3195 characters, returning a pointer to its end 3196 3197 wcscasecmp -- compare two wide-character strings, 3198 ignoring case 3199 3200 wcsdup -- duplicate a wide-character string 3201 wcsncasecmp -- compare two fixed-size wide-character 3202 strings, ignoring case 3203 3204 wcsnlen -- determine the length of a fixed-size 3205 wide-character string 3206 3207 wcsnrtombs -- convert a wide character string to a 3208 multi-byte string 3209 3210 wcstoq -- convert wide string to long long int 3211 representation 3212 3213 wcstouq -- convert wide string to unsigned long long 3214 int representation 3215 3216 wscanf -- convert formatted input 3217 xdr_u_int -- library routines for external data 3218 representation 3219 3220 xdrstdio_create -- library routines for external 3221 data representation 3222 3223 13.6. Interfaces for libm 3224 3225 13.6.1. Math 3226 3227 13.7. Data Definitions for libm 3228 3229 13.7.1. complex.h 3230 13.7.2. fenv.h 3231 13.7.3. math.h 3232 3233 13.8. Interface Definitions for libm 3234 3235 __finite -- test for infinity 3236 __finitef -- test for infinity 3237 __finitel -- test for infinity 3238 __fpclassify -- Classify real floating type 3239 __fpclassifyf -- Classify real floating type 3240 __signbit -- test sign of floating point value 3241 __signbitf -- test sign of floating point value 3242 clog10 -- Logarithm of a Complex Number 3243 clog10f -- Logarithm of a Complex Number 3244 clog10l -- Logarithm of a Complex Number 3245 drem -- Floating Point Remainder (DEPRECATED) 3246 dremf -- Floating Point Remainder (DEPRECATED) 3247 dreml -- Floating Point Remainder (DEPRECATED) 3248 exp10 -- Base-10 power function 3249 exp10f -- Base-10 power function 3250 exp10l -- Base-10 power function 3251 fedisableexcept -- disable floating point exceptions 3252 feenableexcept -- enable floating point exceptions 3253 fegetexcept -- query floating point exception 3254 handling state 3255 3256 finite -- test for infinity (DEPRECATED) 3257 finitef -- test for infinity (DEPRECATED) 3258 finitel -- test for infinity (DEPRECATED) 3259 gamma -- log gamma function (DEPRECATED) 3260 gammaf -- log gamma function (DEPRECATED) 3261 gammal -- log gamma function (DEPRECATED) 3262 j0f -- Bessel functions 3263 j0l -- Bessel functions 3264 j1f -- Bessel functions 3265 j1l -- Bessel functions 3266 jnf -- Bessel functions 3267 jnl -- Bessel functions 3268 lgamma_r -- log gamma functions 3269 lgammaf_r -- log gamma functions 3270 lgammal_r -- log gamma functions 3271 pow10 -- Base-10 power function 3272 pow10f -- Base-10 power function 3273 pow10l -- Base-10 power function 3274 scalbf -- load exponent of radix-independent 3275 floating point number 3276 3277 scalbl -- load exponent of radix-independent 3278 floating point number 3279 3280 significand -- floating point mantissa 3281 significandf -- floating point mantissa 3282 significandl -- floating point mantissa 3283 sincos -- trigonometric functions 3284 sincosf -- trigonometric functions 3285 sincosl -- trigonometric functions 3286 y0f -- Bessel functions 3287 y0l -- Bessel functions 3288 y1f -- Bessel functions 3289 y1l -- Bessel functions 3290 ynf -- Bessel functions 3291 ynl -- Bessel functions 3292 3293 13.9. Interfaces for libpthread 3294 3295 13.9.1. Realtime Threads 3296 13.9.2. Advanced Realtime Threads 3297 13.9.3. Posix Threads 3298 13.9.4. Thread aware versions of libc interfaces 3299 3300 13.10. Data Definitions for libpthread 3301 3302 13.10.1. pthread.h 3303 13.10.2. semaphore.h 3304 3305 13.11. Interface Definitions for libpthread 3306 3307 _pthread_cleanup_pop -- establish cancellation 3308 handlers 3309 3310 _pthread_cleanup_push -- establish cancellation 3311 handlers 3312 3313 pread64 -- read from a file (Large File Support) 3314 pwrite64 -- write on a file (Large File Support) 3315 3316 13.12. Interfaces for libgcc_s 3317 3318 13.12.1. Unwind Library 3319 3320 13.13. Data Definitions for libgcc_s 3321 3322 13.13.1. unwind.h 3323 3324 13.14. Interfaces for libdl 3325 3326 13.14.1. Dynamic Loader 3327 3328 13.15. Data Definitions for libdl 3329 3330 13.15.1. dlfcn.h 3331 3332 13.16. Interface Definitions for libdl 3333 3334 dladdr -- find the shared object containing a given 3335 address 3336 3337 dlopen -- open dynamic object 3338 dlsym -- obtain the address of a symbol from a 3339 dlopen object 3340 3341 13.17. Interfaces for librt 3342 3343 13.17.1. Shared Memory Objects 3344 13.17.2. Clock 3345 13.17.3. Timers 3346 13.17.4. Message Queues 3347 3348 13.18. Data Definitions for librt 3349 3350 13.18.1. mqueue.h 3351 3352 13.19. Interfaces for libcrypt 3353 3354 13.19.1. Encryption 3355 3356 13.20. Interfaces for libpam 3357 3358 13.20.1. Pluggable Authentication API 3359 3360 13.21. Data Definitions for libpam 3361 3362 13.21.1. security/pam_appl.h 3363 3364 13.22. Interface Definitions for libpam 3365 3366 pam_acct_mgmt -- establish the status of a user's 3367 account 3368 3369 pam_authenticate -- authenticate the user 3370 pam_chauthtok -- change the authentication token for 3371 a given user 3372 3373 pam_close_session -- indicate that an authenticated 3374 session has ended 3375 3376 pam_end -- terminate the use of the PAM library 3377 pam_fail_delay -- specify delay time to use on 3378 authentication error 3379 3380 pam_get_item -- obtain the value of the indicated 3381 item. 3382 3383 pam_getenv -- get a PAM environment variable 3384 pam_getenvlist -- returns a pointer to the complete 3385 PAM environment. 3386 3387 pam_open_session -- indicate session has started 3388 pam_putenv -- Add, replace or delete a PAM 3389 environment variable 3390 3391 pam_set_item -- (re)set the value of an item. 3392 pam_setcred -- set the module-specific credentials 3393 of the user 3394 3395 pam_start -- initialize the PAM library 3396 pam_strerror -- returns a string describing the PAM 3397 error 3398 __________________________________________________________ 3399 3400 Chapter 13. Base Libraries 3401 3402 13.1. Introduction 3403 3404 An LSB-conforming implementation shall support the following 3405 base libraries which provide interfaces for accessing the 3406 operating system, processor and other hardware in the system. 3407 3408 * libc 3409 * libm 3410 * libgcc_s 3411 * libdl 3412 * librt 3413 * libcrypt 3414 * libpam 3415 3416 There are three main parts to the definition of each of these 3417 libraries. 3418 3419 The "Interfaces" section defines the required library name and 3420 version, and the required public symbols (interfaces and global 3421 data), as well as symbol versions, if any. 3422 3423 The "Interface Definitions" section provides complete or 3424 partial definitions of certain interfaces where either this 3425 specification is the source specification, or where there are 3426 variations from the source specification. If an interface 3427 definition requires one or more header files, one of those 3428 headers shall include the function prototype for the interface. 3429 3430 For source definitions of interfaces which include a reference 3431 to a header file, the contents of such header files form a part 3432 of the specification. The "Data Definitions" section provides 3433 the binary-level details for the header files from the source 3434 specifications, such as values for macros and enumerated types, 3435 as well as structure layouts, sizes and padding, etc. These 3436 data definitions, although presented in the form of header 3437 files for convenience, should not be taken a representing 3438 complete header files, as they are a supplement to the source 3439 specifications. Application developers should follow the 3440 guidelines of the source specifications when determining which 3441 header files need to be included to completely resolve all 3442 references. 3443 3444 Note: While the Data Definitions supplement the source 3445 specifications, this specification itself does not require 3446 conforming implementations to supply any header files. 3447 __________________________________________________________ 3448 3449 13.2. Program Interpreter 3450 3451 The Program Interpreter is specified in the appropriate 3452 architecture specific part of ISO/IEC 23360. 3453 __________________________________________________________ 3454 3455 13.3. Interfaces for libc 3456 3457 Table 13-1 defines the library name and shared object name for 3458 the libc library 3459 3460 Table 13-1. libc Definition 3461 Library: libc 3462 SONAME: See archLSB. 3463 3464 The behavior of the interfaces in this library is specified by 3465 the following specifications: 3466 3467 [LFS] Large File Support 3468 [LSB] This Specification 3469 [RPC & XDR] RFC 1831/1832 RPC & XDR 3470 [SUSv2] SUSv2 3471 [SUSv3] ISO POSIX (2003) 3472 [SUSv4] POSIX 1003.1 2008 3473 [SVID.3] SVID Issue 3 3474 [SVID.4] SVID Issue 4 3475 __________________________________________________________ 3476 3477 13.3.1. RPC 3478 __________________________________________________________ 3479 3480 13.3.1.1. Interfaces for RPC 3481 3482 An LSB conforming implementation shall provide the generic 3483 functions for RPC specified in Table 13-2, with the full 3484 mandatory functionality as described in the referenced 3485 underlying specification. 3486 3487 Table 13-2. libc - RPC Function Interfaces 3488 authnone_create [SVID.4] callrpc [RPC & XDR] clnt_create 3489 [SVID.4] clnt_pcreateerror [SVID.4] 3490 clnt_perrno [SVID.4] clnt_perror [SVID.4] clnt_spcreateerror 3491 [SVID.4] clnt_sperrno [SVID.4] 3492 clnt_sperror [SVID.4] clntraw_create [RPC & XDR] clnttcp_create 3493 [RPC & XDR] clntudp_bufcreate [RPC & XDR] 3494 clntudp_create [RPC & XDR] key_decryptsession [SVID.3] 3495 pmap_getport [LSB] pmap_set [LSB] 3496 pmap_unset [LSB] svc_getreqset [SVID.3] svc_register [LSB] 3497 svc_run [LSB] 3498 svc_sendreply [LSB] svcerr_auth [SVID.3] svcerr_decode [SVID.3] 3499 svcerr_noproc [SVID.3] 3500 svcerr_noprog [SVID.3] svcerr_progvers [SVID.3] 3501 svcerr_systemerr [SVID.3] svcerr_weakauth [SVID.3] 3502 svcfd_create [RPC & XDR] svcraw_create [RPC & XDR] 3503 svctcp_create [LSB] svcudp_create [LSB] 3504 xdr_accepted_reply [SVID.3] xdr_array [SVID.3] xdr_bool 3505 [SVID.3] xdr_bytes [SVID.3] 3506 xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] xdr_char [SVID.3] 3507 xdr_double [SVID.3] 3508 xdr_enum [SVID.3] xdr_float [SVID.3] xdr_free [SVID.3] xdr_int 3509 [SVID.3] 3510 xdr_long [SVID.3] xdr_opaque [SVID.3] xdr_opaque_auth [SVID.3] 3511 xdr_pointer [SVID.3] 3512 xdr_reference [SVID.3] xdr_rejected_reply [SVID.3] xdr_replymsg 3513 [SVID.3] xdr_short [SVID.3] 3514 xdr_string [SVID.3] xdr_u_char [SVID.3] xdr_u_int [LSB] 3515 xdr_u_long [SVID.3] 3516 xdr_u_short [SVID.3] xdr_union [SVID.3] xdr_vector [SVID.3] 3517 xdr_void [SVID.3] 3518 xdr_wrapstring [SVID.3] xdrmem_create [SVID.3] xdrrec_create 3519 [SVID.3] xdrrec_endofrecord [RPC & XDR] 3520 xdrrec_eof [SVID.3] xdrrec_skiprecord [RPC & XDR] 3521 xdrstdio_create [LSB] 3522 3523 An LSB conforming implementation shall provide the generic 3524 deprecated functions for RPC specified in Table 13-3, with the 3525 full mandatory functionality as described in the referenced 3526 underlying specification. 3527 3528 Note: These interfaces are deprecated, and applications 3529 should avoid using them. These interfaces may be withdrawn 3530 in future releases of this specification. 3531 3532 Table 13-3. libc - RPC Deprecated Function Interfaces 3533 key_decryptsession [SVID.3] 3534 __________________________________________________________ 3535 3536 13.3.2. Epoll 3537 __________________________________________________________ 3538 3539 13.3.2.1. Interfaces for Epoll 3540 3541 An LSB conforming implementation shall provide the generic 3542 functions for Epoll specified in Table 13-4, with the full 3543 mandatory functionality as described in the referenced 3544 underlying specification. 3545 3546 Table 13-4. libc - Epoll Function Interfaces 3547 epoll_create(GLIBC_2.3.2) [LSB] epoll_ctl(GLIBC_2.3.2) [LSB] 3548 epoll_wait(GLIBC_2.3.2) [LSB] 3549 __________________________________________________________ 3550 3551 13.3.3. System Calls 3552 __________________________________________________________ 3553 3554 13.3.3.1. Interfaces for System Calls 3555 3556 An LSB conforming implementation shall provide the generic 3557 functions for System Calls specified in Table 13-5, with the 3558 full mandatory functionality as described in the referenced 3559 underlying specification. 3560 3561 Table 13-5. libc - System Calls Function Interfaces 3562 __chk_fail(GLIBC_2.3.4) [LSB] __fxstat [LSB] 3563 __fxstatat(GLIBC_2.4) [LSB] __getgroups_chk(GLIBC_2.4) [LSB] 3564 __getpgid [LSB] __lxstat [LSB] __read_chk(GLIBC_2.4) [LSB] 3565 __readlink_chk(GLIBC_2.4) [LSB] 3566 __stack_chk_fail(GLIBC_2.4) [LSB] __xmknod [LSB] 3567 __xmknodat(GLIBC_2.4) [LSB] __xstat [LSB] 3568 access [SUSv3] acct [LSB] alarm [SUSv3] brk [SUSv2] 3569 chdir [SUSv3] chmod [SUSv3] chown [SUSv3] chroot [SUSv2] 3570 clock [SUSv3] close [SUSv3] closedir [SUSv3] creat [SUSv3] 3571 dup [SUSv3] dup2 [SUSv3] execl [SUSv3] execle [SUSv3] 3572 execlp [SUSv3] execv [SUSv3] execve [SUSv3] execvp [SUSv3] 3573 exit [SUSv3] faccessat(GLIBC_2.4) [SUSv4] fchdir [SUSv3] fchmod 3574 [SUSv3] 3575 fchmodat(GLIBC_2.4) [SUSv4] fchown [SUSv3] fchownat(GLIBC_2.4) 3576 [SUSv4] fcntl [LSB] 3577 fdatasync [SUSv3] fdopendir(GLIBC_2.4) [SUSv4] fexecve [SUSv4] 3578 flock [LSB] 3579 fork [SUSv3] fstatfs [LSB] fstatvfs [SUSv3] fsync [SUSv3] 3580 ftime [SUSv3] ftruncate [SUSv3] getcontext [SUSv3] 3581 getdtablesize [LSB] 3582 getegid [SUSv3] geteuid [SUSv3] getgid [SUSv3] getgroups 3583 [SUSv3] 3584 getitimer [SUSv3] getloadavg [LSB] getpagesize [LSB] getpgid 3585 [SUSv3] 3586 getpgrp [SUSv3] getpid [SUSv3] getppid [SUSv3] getpriority 3587 [SUSv3] 3588 getrlimit [SUSv3] getrusage [SUSv3] getsid [SUSv3] getuid 3589 [SUSv3] 3590 getwd [SUSv3] initgroups [LSB] ioctl [LSB] kill [LSB] 3591 killpg [SUSv3] lchown [SUSv3] link [LSB] linkat(GLIBC_2.4) 3592 [SUSv4] 3593 lockf [SUSv3] lseek [SUSv3] mkdir [SUSv3] mkdirat(GLIBC_2.4) 3594 [SUSv4] 3595 mkfifo [SUSv3] mkfifoat(GLIBC_2.4) [SUSv4] mlock [SUSv3] 3596 mlockall [SUSv3] 3597 mmap [SUSv3] mprotect [SUSv3] mremap [LSB] msync [SUSv3] 3598 munlock [SUSv3] munlockall [SUSv3] munmap [SUSv3] nanosleep 3599 [SUSv3] 3600 nice [SUSv3] open [SUSv3] openat(GLIBC_2.4) [SUSv4] opendir 3601 [SUSv3] 3602 pathconf [SUSv3] pause [SUSv3] pipe [SUSv3] poll [SUSv3] 3603 pselect [SUSv3] read [SUSv3] readdir [SUSv3] readdir_r [SUSv3] 3604 readlink [SUSv3] readlinkat(GLIBC_2.4) [SUSv4] readv [SUSv3] 3605 rename [SUSv3] 3606 renameat(GLIBC_2.4) [SUSv4] rmdir [SUSv3] sbrk [SUSv2] 3607 sched_get_priority_max [SUSv3] 3608 sched_get_priority_min [SUSv3] sched_getaffinity(GLIBC_2.3.4) 3609 [LSB] sched_getparam [SUSv3] sched_getscheduler [SUSv3] 3610 sched_rr_get_interval [SUSv3] sched_setaffinity(GLIBC_2.3.4) 3611 [LSB] sched_setparam [SUSv3] sched_setscheduler [LSB] 3612 sched_yield [SUSv3] select [SUSv3] setcontext [SUSv3] setegid 3613 [SUSv3] 3614 seteuid [SUSv3] setgid [SUSv3] setitimer [SUSv3] setpgid 3615 [SUSv3] 3616 setpgrp [SUSv3] setpriority [SUSv3] setregid [SUSv3] setreuid 3617 [SUSv3] 3618 setrlimit [SUSv3] setrlimit64 [LFS] setsid [SUSv3] setuid 3619 [SUSv3] 3620 sleep [SUSv3] statfs [LSB] statvfs [SUSv3] stime [LSB] 3621 symlink [SUSv3] symlinkat(GLIBC_2.4) [SUSv4] sync [SUSv3] 3622 sysconf [LSB] 3623 time [SUSv3] times [SUSv3] truncate [SUSv3] ulimit [SUSv3] 3624 umask [SUSv3] uname [SUSv3] unlink [LSB] unlinkat(GLIBC_2.4) 3625 [SUSv4] 3626 utime [SUSv3] utimes [SUSv3] vfork [SUSv3] wait [SUSv3] 3627 wait4 [LSB] waitid [SUSv3] waitpid [SUSv3] write [SUSv3] 3628 writev [SUSv3] 3629 3630 An LSB conforming implementation shall provide the generic 3631 deprecated functions for System Calls specified in Table 13-6, 3632 with the full mandatory functionality as described in the 3633 referenced underlying specification. 3634 3635 Note: These interfaces are deprecated, and applications 3636 should avoid using them. These interfaces may be withdrawn 3637 in future releases of this specification. 3638 3639 Table 13-6. libc - System Calls Deprecated Function Interfaces 3640 fstatfs [LSB] getdtablesize [LSB] getpagesize [LSB] getwd 3641 [SUSv3] 3642 statfs [LSB] 3643 __________________________________________________________ 3644 3645 13.3.4. Standard I/O 3646 __________________________________________________________ 3647 3648 13.3.4.1. Interfaces for Standard I/O 3649 3650 An LSB conforming implementation shall provide the generic 3651 functions for Standard I/O specified in Table 13-7, with the 3652 full mandatory functionality as described in the referenced 3653 underlying specification. 3654 3655 Table 13-7. libc - Standard I/O Function Interfaces 3656 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 3657 __fgets_chk(GLIBC_2.4) [LSB] __fgets_unlocked_chk(GLIBC_2.4) 3658 [LSB] __fgetws_unlocked_chk(GLIBC_2.4) [LSB] __fprintf_chk 3659 [LSB] 3660 __printf_chk [LSB] __snprintf_chk [LSB] __sprintf_chk [LSB] 3661 __vfprintf_chk [LSB] 3662 __vprintf_chk [LSB] __vsnprintf_chk [LSB] __vsprintf_chk [LSB] 3663 asprintf [LSB] 3664 clearerr [SUSv3] clearerr_unlocked [LSB] ctermid [SUSv3] 3665 dprintf [SUSv4] 3666 fclose [SUSv3] fdopen [SUSv3] feof [SUSv3] feof_unlocked [LSB] 3667 ferror [SUSv3] ferror_unlocked [LSB] fflush [SUSv3] 3668 fflush_unlocked [LSB] 3669 fgetc [SUSv3] fgetc_unlocked [LSB] fgetpos [SUSv3] fgets 3670 [SUSv3] 3671 fgets_unlocked [LSB] fgetwc_unlocked [LSB] fgetws_unlocked 3672 [LSB] fileno [SUSv3] 3673 fileno_unlocked [LSB] flockfile [SUSv3] fopen [SUSv3] fprintf 3674 [SUSv3] 3675 fputc [SUSv3] fputc_unlocked [LSB] fputs [SUSv3] fputs_unlocked 3676 [LSB] 3677 fputwc_unlocked [LSB] fputws_unlocked [LSB] fread [SUSv3] 3678 fread_unlocked [LSB] 3679 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 3680 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 3681 fwrite_unlocked [LSB] getc [SUSv3] getc_unlocked [SUSv3] 3682 getchar [SUSv3] 3683 getchar_unlocked [SUSv3] getdelim [SUSv4] getline [SUSv4] getw 3684 [SUSv2] 3685 getwc_unlocked [LSB] getwchar_unlocked [LSB] pclose [SUSv3] 3686 popen [SUSv3] 3687 printf [SUSv3] putc [SUSv3] putc_unlocked [SUSv3] putchar 3688 [SUSv3] 3689 putchar_unlocked [SUSv3] puts [SUSv3] putw [SUSv2] 3690 putwc_unlocked [LSB] 3691 putwchar_unlocked [LSB] remove [SUSv3] rewind [SUSv3] rewinddir 3692 [SUSv3] 3693 scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] setbuffer [LSB] 3694 setvbuf [SUSv3] snprintf [SUSv3] sprintf [SUSv3] sscanf [LSB] 3695 telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] vasprintf [LSB] 3696 vdprintf [LSB] vfprintf [SUSv3] vprintf [SUSv3] vsnprintf 3697 [SUSv3] 3698 vsprintf [SUSv3] 3699 3700 An LSB conforming implementation shall provide the generic 3701 deprecated functions for Standard I/O specified in Table 13-8, 3702 with the full mandatory functionality as described in the 3703 referenced underlying specification. 3704 3705 Note: These interfaces are deprecated, and applications 3706 should avoid using them. These interfaces may be withdrawn 3707 in future releases of this specification. 3708 3709 Table 13-8. libc - Standard I/O Deprecated Function Interfaces 3710 tempnam [SUSv3] 3711 3712 An LSB conforming implementation shall provide the generic data 3713 interfaces for Standard I/O specified in Table 13-9, with the 3714 full mandatory functionality as described in the referenced 3715 underlying specification. 3716 3717 Table 13-9. libc - Standard I/O Data Interfaces 3718 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 3719 __________________________________________________________ 3720 3721 13.3.5. Signal Handling 3722 __________________________________________________________ 3723 3724 13.3.5.1. Interfaces for Signal Handling 3725 3726 An LSB conforming implementation shall provide the generic 3727 functions for Signal Handling specified in Table 13-10, with 3728 the full mandatory functionality as described in the referenced 3729 underlying specification. 3730 3731 Table 13-10. libc - Signal Handling Function Interfaces 3732 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 3733 __sigsetjmp [LSB] __sysv_signal [LSB] 3734 __xpg_sigpause [LSB] bsd_signal [SUSv3] psignal [LSB] raise 3735 [SUSv3] 3736 sigaction [SUSv3] sigaddset [SUSv3] sigaltstack [SUSv3] 3737 sigandset [LSB] 3738 sigdelset [SUSv3] sigemptyset [SUSv3] sigfillset [SUSv3] 3739 sighold [SUSv3] 3740 sigignore [SUSv3] siginterrupt [SUSv3] sigisemptyset [LSB] 3741 sigismember [SUSv3] 3742 siglongjmp [SUSv3] signal [SUSv3] sigorset [LSB] sigpause [LSB] 3743 sigpending [SUSv3] sigprocmask [SUSv3] sigqueue [SUSv3] 3744 sigrelse [SUSv3] 3745 sigreturn [LSB] sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait 3746 [SUSv3] 3747 sigwait [SUSv3] sigwaitinfo [SUSv3] 3748 3749 An LSB conforming implementation shall provide the generic 3750 deprecated functions for Signal Handling specified in Table 3751 13-11, with the full mandatory functionality as described in 3752 the referenced underlying specification. 3753 3754 Note: These interfaces are deprecated, and applications 3755 should avoid using them. These interfaces may be withdrawn 3756 in future releases of this specification. 3757 3758 Table 13-11. libc - Signal Handling Deprecated Function 3759 Interfaces 3760 sigpause [LSB] 3761 3762 An LSB conforming implementation shall provide the generic data 3763 interfaces for Signal Handling specified in Table 13-12, with 3764 the full mandatory functionality as described in the referenced 3765 underlying specification. 3766 3767 Table 13-12. libc - Signal Handling Data Interfaces 3768 _sys_siglist [LSB] 3769 __________________________________________________________ 3770 3771 13.3.6. Localization Functions 3772 __________________________________________________________ 3773 3774 13.3.6.1. Interfaces for Localization Functions 3775 3776 An LSB conforming implementation shall provide the generic 3777 functions for Localization Functions specified in Table 13-13, 3778 with the full mandatory functionality as described in the 3779 referenced underlying specification. 3780 3781 Table 13-13. libc - Localization Functions Function Interfaces 3782 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 3783 [SUSv3] catgets [SUSv3] 3784 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext [LSB] 3785 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 3786 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 3787 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] localeconv 3788 [SUSv3] 3789 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 3790 setlocale [SUSv3] 3791 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 3792 3793 An LSB conforming implementation shall provide the generic data 3794 interfaces for Localization Functions specified in Table 13-14, 3795 with the full mandatory functionality as described in the 3796 referenced underlying specification. 3797 3798 Table 13-14. libc - Localization Functions Data Interfaces 3799 _nl_msg_cat_cntr [LSB] 3800 __________________________________________________________ 3801 3802 13.3.7. Posix Spawn Option 3803 __________________________________________________________ 3804 3805 13.3.7.1. Interfaces for Posix Spawn Option 3806 3807 An LSB conforming implementation shall provide the generic 3808 functions for Posix Spawn Option specified in Table 13-15, with 3809 the full mandatory functionality as described in the referenced 3810 underlying specification. 3811 3812 Table 13-15. libc - Posix Spawn Option Function Interfaces 3813 posix_spawn [SUSv3] posix_spawn_file_actions_addclose [SUSv3] 3814 posix_spawn_file_actions_adddup2 [SUSv3] 3815 posix_spawn_file_actions_addopen [SUSv3] 3816 posix_spawn_file_actions_destroy [SUSv3] 3817 posix_spawn_file_actions_init [SUSv3] posix_spawnattr_destroy 3818 [SUSv3] posix_spawnattr_getflags [SUSv3] 3819 posix_spawnattr_getpgroup [SUSv3] posix_spawnattr_getschedparam 3820 [SUSv3] posix_spawnattr_getschedpolicy [SUSv3] 3821 posix_spawnattr_getsigdefault [SUSv3] 3822 posix_spawnattr_getsigmask [SUSv3] posix_spawnattr_init [SUSv3] 3823 posix_spawnattr_setflags [SUSv3] posix_spawnattr_setpgroup 3824 [SUSv3] 3825 posix_spawnattr_setschedparam [SUSv3] 3826 posix_spawnattr_setschedpolicy [SUSv3] 3827 posix_spawnattr_setsigdefault [SUSv3] 3828 posix_spawnattr_setsigmask [SUSv3] 3829 posix_spawnp [SUSv3] 3830 __________________________________________________________ 3831 3832 13.3.8. Posix Advisory Option 3833 __________________________________________________________ 3834 3835 13.3.8.1. Interfaces for Posix Advisory Option 3836 3837 An LSB conforming implementation shall provide the generic 3838 functions for Posix Advisory Option specified in Table 13-16, 3839 with the full mandatory functionality as described in the 3840 referenced underlying specification. 3841 3842 Table 13-16. libc - Posix Advisory Option Function Interfaces 3843 posix_fadvise [SUSv3] posix_fallocate [SUSv3] posix_madvise 3844 [SUSv3] posix_memalign [SUSv3] 3845 __________________________________________________________ 3846 3847 13.3.9. Socket Interface 3848 __________________________________________________________ 3849 3850 13.3.9.1. Interfaces for Socket Interface 3851 3852 An LSB conforming implementation shall provide the generic 3853 functions for Socket Interface specified in Table 13-17, with 3854 the full mandatory functionality as described in the referenced 3855 underlying specification. 3856 3857 Table 13-17. libc - Socket Interface Function Interfaces 3858 __gethostname_chk(GLIBC_2.4) [LSB] __h_errno_location [LSB] 3859 __recv_chk(GLIBC_2.4) [LSB] __recvfrom_chk(GLIBC_2.4) [LSB] 3860 accept [SUSv3] bind [SUSv3] bindresvport [LSB] connect [SUSv3] 3861 gethostid [SUSv3] gethostname [SUSv3] getpeername [SUSv3] 3862 getsockname [SUSv3] 3863 getsockopt [LSB] if_freenameindex [SUSv3] if_indextoname 3864 [SUSv3] if_nameindex [SUSv3] 3865 if_nametoindex [SUSv3] listen [SUSv3] recv [SUSv3] recvfrom 3866 [SUSv3] 3867 recvmsg [SUSv3] send [SUSv4] sendmsg [SUSv4] sendto [SUSv4] 3868 setsockopt [LSB] shutdown [SUSv3] sockatmark [SUSv3] socket 3869 [SUSv3] 3870 socketpair [SUSv3] 3871 3872 An LSB conforming implementation shall provide the generic data 3873 interfaces for Socket Interface specified in Table 13-18, with 3874 the full mandatory functionality as described in the referenced 3875 underlying specification. 3876 3877 Table 13-18. libc - Socket Interface Data Interfaces 3878 in6addr_any [SUSv3] in6addr_loopback [SUSv3] 3879 __________________________________________________________ 3880 3881 13.3.10. Wide Characters 3882 __________________________________________________________ 3883 3884 13.3.10.1. Interfaces for Wide Characters 3885 3886 An LSB conforming implementation shall provide the generic 3887 functions for Wide Characters specified in Table 13-19, with 3888 the full mandatory functionality as described in the referenced 3889 underlying specification. 3890 3891 Table 13-19. libc - Wide Characters Function Interfaces 3892 __fgetws_chk(GLIBC_2.4) [LSB] __fwprintf_chk(GLIBC_2.4) [LSB] 3893 __mbsnrtowcs_chk(GLIBC_2.4) [LSB] __mbsrtowcs_chk(GLIBC_2.4) 3894 [LSB] 3895 __mbstowcs_chk(GLIBC_2.4) [LSB] __swprintf_chk(GLIBC_2.4) [LSB] 3896 __vfwprintf_chk(GLIBC_2.4) [LSB] __vswprintf_chk(GLIBC_2.4) 3897 [LSB] 3898 __vwprintf_chk(GLIBC_2.4) [LSB] __wcpcpy_chk(GLIBC_2.4) [LSB] 3899 __wcpncpy_chk(GLIBC_2.4) [LSB] __wcrtomb_chk(GLIBC_2.4) [LSB] 3900 __wcscat_chk(GLIBC_2.4) [LSB] __wcscpy_chk(GLIBC_2.4) [LSB] 3901 __wcsncat_chk(GLIBC_2.4) [LSB] __wcsncpy_chk(GLIBC_2.4) [LSB] 3902 __wcsnrtombs_chk(GLIBC_2.4) [LSB] __wcsrtombs_chk(GLIBC_2.4) 3903 [LSB] __wcstod_internal [LSB] __wcstof_internal [LSB] 3904 __wcstol_internal [LSB] __wcstold_internal [LSB] 3905 __wcstombs_chk(GLIBC_2.4) [LSB] __wcstoul_internal [LSB] 3906 __wctomb_chk(GLIBC_2.4) [LSB] __wmemcpy_chk(GLIBC_2.4) [LSB] 3907 __wmemmove_chk(GLIBC_2.4) [LSB] __wmempcpy_chk(GLIBC_2.4) [LSB] 3908 __wmemset_chk(GLIBC_2.4) [LSB] __wprintf_chk(GLIBC_2.4) [LSB] 3909 btowc [SUSv3] fgetwc [SUSv3] 3910 fgetws [SUSv3] fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] 3911 fwprintf [SUSv3] fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] 3912 mblen [SUSv3] mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] 3913 mbsnrtowcs [LSB] mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc 3914 [SUSv3] 3915 putwc [SUSv3] putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] 3916 towctrans [SUSv3] towlower [SUSv3] towupper [SUSv3] ungetwc 3917 [SUSv3] 3918 vfwprintf [SUSv3] vfwscanf [LSB] vswprintf [SUSv3] vswscanf 3919 [LSB] 3920 vwprintf [SUSv3] vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] 3921 wcrtomb [SUSv3] wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] 3922 wcscmp [SUSv3] wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] 3923 wcsdup [LSB] wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] 3924 wcsncat [SUSv3] wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] 3925 wcsnrtombs [LSB] wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs 3926 [SUSv3] 3927 wcsspn [SUSv3] wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] 3928 wcstoimax [SUSv3] wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] 3929 wcstoll [SUSv3] wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] 3930 wcstoull [SUSv3] wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] 3931 wcswidth [SUSv3] wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] 3932 wctrans [SUSv3] wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] 3933 wmemcmp [SUSv3] wmemcpy [SUSv3] wmemmove [SUSv3] wmemset 3934 [SUSv3] 3935 wprintf [SUSv3] wscanf [LSB] 3936 __________________________________________________________ 3937 3938 13.3.11. String Functions 3939 __________________________________________________________ 3940 3941 13.3.11.1. Interfaces for String Functions 3942 3943 An LSB conforming implementation shall provide the generic 3944 functions for String Functions specified in Table 13-20, with 3945 the full mandatory functionality as described in the referenced 3946 underlying specification. 3947 3948 Table 13-20. libc - String Functions Function Interfaces 3949 __memcpy_chk(GLIBC_2.3.4) [LSB] __memmove_chk(GLIBC_2.3.4) 3950 [LSB] __mempcpy [LSB] __mempcpy_chk(GLIBC_2.3.4) [LSB] 3951 __memset_chk(GLIBC_2.3.4) [LSB] __rawmemchr [LSB] __stpcpy 3952 [LSB] __stpcpy_chk(GLIBC_2.3.4) [LSB] 3953 __stpncpy_chk(GLIBC_2.4) [LSB] __strcat_chk(GLIBC_2.3.4) [LSB] 3954 __strcpy_chk(GLIBC_2.3.4) [LSB] __strdup [LSB] 3955 __strncat_chk(GLIBC_2.3.4) [LSB] __strncpy_chk(GLIBC_2.3.4) 3956 [LSB] __strtod_internal [LSB] __strtof_internal [LSB] 3957 __strtok_r [LSB] __strtol_internal [LSB] __strtold_internal 3958 [LSB] __strtoll_internal [LSB] 3959 __strtoul_internal [LSB] __strtoull_internal [LSB] 3960 __xpg_strerror_r(GLIBC_2.3.4) [LSB] bcmp [SUSv3] 3961 bcopy [SUSv3] bzero [SUSv3] ffs [SUSv3] index [SUSv3] 3962 memccpy [SUSv3] memchr [SUSv3] memcmp [SUSv3] memcpy [SUSv3] 3963 memmove [SUSv3] memrchr [LSB] memset [SUSv3] rindex [SUSv3] 3964 stpcpy [LSB] stpncpy [LSB] strcasecmp [SUSv3] strcasestr [LSB] 3965 strcat [SUSv3] strchr [SUSv3] strcmp [SUSv3] strcoll [SUSv3] 3966 strcpy [SUSv3] strcspn [SUSv3] strdup [SUSv3] strerror [SUSv3] 3967 strerror_r [LSB] strfmon [SUSv3] strftime [SUSv3] strlen 3968 [SUSv3] 3969 strncasecmp [SUSv3] strncat [SUSv3] strncmp [SUSv3] strncpy 3970 [SUSv3] 3971 strndup [LSB] strnlen [LSB] strpbrk [SUSv3] strptime [LSB] 3972 strrchr [SUSv3] strsep [LSB] strsignal [LSB] strspn [SUSv3] 3973 strstr [SUSv3] strtof [SUSv3] strtoimax [SUSv3] strtok [SUSv3] 3974 strtok_r [SUSv3] strtold [SUSv3] strtoll [SUSv3] strtoq [LSB] 3975 strtoull [SUSv3] strtoumax [SUSv3] strtouq [LSB] strxfrm 3976 [SUSv3] 3977 swab [SUSv3] 3978 3979 An LSB conforming implementation shall provide the generic 3980 deprecated functions for String Functions specified in Table 3981 13-21, with the full mandatory functionality as described in 3982 the referenced underlying specification. 3983 3984 Note: These interfaces are deprecated, and applications 3985 should avoid using them. These interfaces may be withdrawn 3986 in future releases of this specification. 3987 3988 Table 13-21. libc - String Functions Deprecated Function 3989 Interfaces 3990 strerror_r [LSB] 3991 __________________________________________________________ 3992 3993 13.3.12. IPC Functions 3994 __________________________________________________________ 3995 3996 13.3.12.1. Interfaces for IPC Functions 3997 3998 An LSB conforming implementation shall provide the generic 3999 functions for IPC Functions specified in Table 13-22, with the 4000 full mandatory functionality as described in the referenced 4001 underlying specification. 4002 4003 Table 13-22. libc - IPC Functions Function Interfaces 4004 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 4005 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 4006 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 4007 __________________________________________________________ 4008 4009 13.3.13. Regular Expressions 4010 __________________________________________________________ 4011 4012 13.3.13.1. Interfaces for Regular Expressions 4013 4014 An LSB conforming implementation shall provide the generic 4015 functions for Regular Expressions specified in Table 13-23, 4016 with the full mandatory functionality as described in the 4017 referenced underlying specification. 4018 4019 Table 13-23. libc - Regular Expressions Function Interfaces 4020 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 4021 __________________________________________________________ 4022 4023 13.3.14. Character Type Functions 4024 __________________________________________________________ 4025 4026 13.3.14.1. Interfaces for Character Type Functions 4027 4028 An LSB conforming implementation shall provide the generic 4029 functions for Character Type Functions specified in Table 4030 13-24, with the full mandatory functionality as described in 4031 the referenced underlying specification. 4032 4033 Table 13-24. libc - Character Type Functions Function 4034 Interfaces 4035 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 4036 __ctype_tolower_loc(GLIBC_2.3) [LSB] 4037 __ctype_toupper_loc(GLIBC_2.3) [LSB] 4038 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 4039 [SUSv3] 4040 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph [SUSv3] 4041 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace [SUSv3] 4042 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 4043 [SUSv3] 4044 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 4045 [SUSv3] 4046 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 4047 [SUSv3] 4048 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 4049 [SUSv3] 4050 tolower [SUSv3] toupper [SUSv3] 4051 __________________________________________________________ 4052 4053 13.3.15. Time Manipulation 4054 __________________________________________________________ 4055 4056 13.3.15.1. Interfaces for Time Manipulation 4057 4058 An LSB conforming implementation shall provide the generic 4059 functions for Time Manipulation specified in Table 13-25, with 4060 the full mandatory functionality as described in the referenced 4061 underlying specification. 4062 4063 Table 13-25. libc - Time Manipulation Function Interfaces 4064 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 4065 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 4066 [SUSv3] 4067 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 4068 [SUSv3] 4069 ualarm [SUSv3] 4070 4071 An LSB conforming implementation shall provide the generic data 4072 interfaces for Time Manipulation specified in Table 13-26, with 4073 the full mandatory functionality as described in the referenced 4074 underlying specification. 4075 4076 Table 13-26. libc - Time Manipulation Data Interfaces 4077 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 4078 [SUSv3] 4079 timezone [SUSv3] tzname [SUSv3] 4080 __________________________________________________________ 4081 4082 13.3.16. Terminal Interface Functions 4083 __________________________________________________________ 4084 4085 13.3.16.1. Interfaces for Terminal Interface Functions 4086 4087 An LSB conforming implementation shall provide the generic 4088 functions for Terminal Interface Functions specified in Table 4089 13-27, with the full mandatory functionality as described in 4090 the referenced underlying specification. 4091 4092 Table 13-27. libc - Terminal Interface Functions Function 4093 Interfaces 4094 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 4095 cfsetispeed [SUSv3] 4096 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 4097 [SUSv3] 4098 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 4099 [SUSv3] 4100 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 4101 __________________________________________________________ 4102 4103 13.3.17. System Database Interface 4104 __________________________________________________________ 4105 4106 13.3.17.1. Interfaces for System Database Interface 4107 4108 An LSB conforming implementation shall provide the generic 4109 functions for System Database Interface specified in Table 4110 13-28, with the full mandatory functionality as described in 4111 the referenced underlying specification. 4112 4113 Table 13-28. libc - System Database Interface Function 4114 Interfaces 4115 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 4116 endservent [SUSv3] 4117 endutent [LSB] endutxent [SUSv3] getgrent [SUSv3] getgrent_r 4118 [LSB] 4119 getgrgid [SUSv3] getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r 4120 [SUSv3] 4121 getgrouplist [LSB] gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] 4122 gethostbyname [SUSv3] 4123 gethostbyname2 [LSB] gethostbyname2_r [LSB] gethostbyname_r 4124 [LSB] getprotobyname [SUSv3] 4125 getprotobyname_r [LSB] getprotobynumber [SUSv3] 4126 getprotobynumber_r [LSB] getprotoent [SUSv3] 4127 getprotoent_r [LSB] getpwent [SUSv3] getpwent_r [LSB] getpwnam 4128 [SUSv3] 4129 getpwnam_r [SUSv3] getpwuid [SUSv3] getpwuid_r [SUSv3] 4130 getservbyname [SUSv3] 4131 getservbyname_r [LSB] getservbyport [SUSv3] getservbyport_r 4132 [LSB] getservent [SUSv3] 4133 getservent_r [LSB] getutent [LSB] getutent_r [LSB] getutxent 4134 [SUSv3] 4135 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] setgrent 4136 [SUSv3] 4137 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] setservent 4138 [SUSv3] 4139 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 4140 4141 An LSB conforming implementation shall provide the generic 4142 deprecated functions for System Database Interface specified in 4143 Table 13-29, with the full mandatory functionality as described 4144 in the referenced underlying specification. 4145 4146 Note: These interfaces are deprecated, and applications 4147 should avoid using them. These interfaces may be withdrawn 4148 in future releases of this specification. 4149 4150 Table 13-29. libc - System Database Interface Deprecated 4151 Function Interfaces 4152 gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] gethostbyname 4153 [SUSv3] gethostbyname2 [LSB] 4154 gethostbyname2_r [LSB] gethostbyname_r [LSB] 4155 __________________________________________________________ 4156 4157 13.3.18. Language Support 4158 __________________________________________________________ 4159 4160 13.3.18.1. Interfaces for Language Support 4161 4162 An LSB conforming implementation shall provide the generic 4163 functions for Language Support specified in Table 13-30, with 4164 the full mandatory functionality as described in the referenced 4165 underlying specification. 4166 4167 Table 13-30. libc - Language Support Function Interfaces 4168 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 4169 __________________________________________________________ 4170 4171 13.3.19. Large File Support 4172 __________________________________________________________ 4173 4174 13.3.19.1. Interfaces for Large File Support 4175 4176 An LSB conforming implementation shall provide the generic 4177 functions for Large File Support specified in Table 13-31, with 4178 the full mandatory functionality as described in the referenced 4179 underlying specification. 4180 4181 Table 13-31. libc - Large File Support Function Interfaces 4182 __fxstat64 [LSB] __fxstatat64(GLIBC_2.4) [LSB] __lxstat64 [LSB] 4183 __xstat64 [LSB] 4184 creat64 [LFS] fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] 4185 fseeko64 [LFS] fsetpos64 [LFS] fstatfs64 [LSB] fstatvfs64 [LFS] 4186 ftello64 [LFS] ftruncate64 [LFS] ftw64 [LFS] getrlimit64 [LFS] 4187 lockf64 [LFS] mkstemp64 [LSB] mmap64 [LFS] nftw64 [LFS] 4188 openat64(GLIBC_2.4) [LSB] posix_fadvise64 [LSB] 4189 posix_fallocate64 [LSB] readdir64 [LFS] 4190 readdir64_r [LSB] statfs64 [LSB] statvfs64 [LFS] tmpfile64 4191 [LFS] 4192 truncate64 [LFS] 4193 4194 An LSB conforming implementation shall provide the generic 4195 deprecated functions for Large File Support specified in Table 4196 13-32, with the full mandatory functionality as described in 4197 the referenced underlying specification. 4198 4199 Note: These interfaces are deprecated, and applications 4200 should avoid using them. These interfaces may be withdrawn 4201 in future releases of this specification. 4202 4203 Table 13-32. libc - Large File Support Deprecated Function 4204 Interfaces 4205 fstatfs64 [LSB] statfs64 [LSB] 4206 __________________________________________________________ 4207 4208 13.3.20. Inotify 4209 __________________________________________________________ 4210 4211 13.3.20.1. Interfaces for Inotify 4212 4213 An LSB conforming implementation shall provide the generic 4214 functions for Inotify specified in Table 13-33, with the full 4215 mandatory functionality as described in the referenced 4216 underlying specification. 4217 4218 Table 13-33. libc - Inotify Function Interfaces 4219 inotify_add_watch(GLIBC_2.4) [LSB] inotify_init(GLIBC_2.4) 4220 [LSB] inotify_rm_watch(GLIBC_2.4) [LSB] 4221 __________________________________________________________ 4222 4223 13.3.21. Standard Library 4224 __________________________________________________________ 4225 4226 13.3.21.1. Interfaces for Standard Library 4227 4228 An LSB conforming implementation shall provide the generic 4229 functions for Standard Library specified in Table 13-34, with 4230 the full mandatory functionality as described in the referenced 4231 underlying specification. 4232 4233 Table 13-34. libc - Standard Library Function Interfaces 4234 _Exit [SUSv3] __assert_fail [LSB] __confstr_chk(GLIBC_2.4) 4235 [LSB] __cxa_atexit [LSB] 4236 __cxa_finalize [LSB] __errno_location [LSB] __fpending [LSB] 4237 __getcwd_chk(GLIBC_2.4) [LSB] 4238 __getlogin_r_chk(GLIBC_2.4) [LSB] __getpagesize [LSB] __isinf 4239 [LSB] __isinff [LSB] 4240 __isinfl [LSB] __isnan [LSB] __isnanf [LSB] __isnanl [LSB] 4241 __pread64_chk(GLIBC_2.4) [LSB] __pread_chk(GLIBC_2.4) [LSB] 4242 __realpath_chk(GLIBC_2.4) [LSB] __sysconf [LSB] 4243 __syslog_chk(GLIBC_2.4) [LSB] __ttyname_r_chk(GLIBC_2.4) [LSB] 4244 __vsyslog_chk(GLIBC_2.4) [LSB] __xpg_basename [LSB] 4245 _exit [SUSv3] _longjmp [SUSv3] _setjmp [SUSv3] a64l [SUSv3] 4246 abort [SUSv3] abs [SUSv3] alphasort [SUSv4] alphasort64 [LSB] 4247 atof [SUSv3] atoi [SUSv3] atol [SUSv3] atoll [SUSv3] 4248 basename [LSB] bsearch [SUSv3] calloc [SUSv3] closelog [SUSv3] 4249 confstr [SUSv3] cuserid [SUSv2] daemon [LSB] dirfd [SUSv4] 4250 dirname [SUSv3] div [SUSv3] drand48 [SUSv3] drand48_r [LSB] 4251 ecvt [SUSv3] erand48 [SUSv3] erand48_r [LSB] err [LSB] 4252 error [LSB] errx [LSB] fcvt [SUSv3] fmemopen [SUSv4] 4253 fmtmsg [SUSv3] fnmatch [SUSv3] fpathconf [SUSv3] free [SUSv3] 4254 freeaddrinfo [SUSv3] ftrylockfile [SUSv3] ftw [SUSv3] 4255 funlockfile [SUSv3] 4256 gai_strerror [SUSv3] gcvt [SUSv3] getaddrinfo [SUSv3] getcwd 4257 [SUSv3] 4258 getdate [SUSv3] getdomainname [LSB] getenv [SUSv3] getlogin 4259 [SUSv3] 4260 getlogin_r [SUSv3] getnameinfo [SUSv3] getopt [LSB] getopt_long 4261 [LSB] 4262 getopt_long_only [LSB] getsubopt [SUSv3] gettimeofday [SUSv3] 4263 glob [SUSv3] 4264 glob64 [LSB] globfree [SUSv3] globfree64 [LSB] grantpt [SUSv3] 4265 hcreate [SUSv3] hcreate_r [LSB] hdestroy [SUSv3] hdestroy_r 4266 [LSB] 4267 hsearch [SUSv3] hsearch_r [LSB] htonl [SUSv3] htons [SUSv3] 4268 imaxabs [SUSv3] imaxdiv [SUSv3] inet_addr [SUSv3] inet_aton 4269 [LSB] 4270 inet_ntoa [SUSv3] inet_ntop [SUSv3] inet_pton [SUSv3] initstate 4271 [SUSv3] 4272 initstate_r [LSB] insque [SUSv3] isatty [SUSv3] isblank [SUSv3] 4273 jrand48 [SUSv3] jrand48_r [LSB] l64a [SUSv3] labs [SUSv3] 4274 lcong48 [SUSv3] lcong48_r [LSB] ldiv [SUSv3] lfind [SUSv3] 4275 llabs [SUSv3] lldiv [SUSv3] longjmp [SUSv3] lrand48 [SUSv3] 4276 lrand48_r [LSB] lsearch [SUSv3] makecontext [SUSv3] malloc 4277 [SUSv3] 4278 memmem [LSB] mkdtemp [SUSv4] mkstemp [SUSv3] mktemp [SUSv3] 4279 mrand48 [SUSv3] mrand48_r [LSB] nftw [SUSv3] nrand48 [SUSv3] 4280 nrand48_r [LSB] ntohl [SUSv3] ntohs [SUSv3] open_memstream 4281 [SUSv4] 4282 open_wmemstream(GLIBC_2.4) [SUSv4] openlog [SUSv3] perror 4283 [SUSv3] posix_openpt [SUSv3] 4284 ptsname [SUSv3] putenv [SUSv3] qsort [SUSv3] rand [SUSv3] 4285 rand_r [SUSv3] random [SUSv3] random_r [LSB] realloc [SUSv3] 4286 realpath [SUSv3] remque [SUSv3] scandir [SUSv4] scandir64 [LSB] 4287 seed48 [SUSv3] seed48_r [LSB] sendfile [LSB] 4288 sendfile64(GLIBC_2.3) [LSB] 4289 setenv [SUSv3] sethostname [LSB] setlogmask [SUSv3] setstate 4290 [SUSv3] 4291 setstate_r [LSB] srand [SUSv3] srand48 [SUSv3] srand48_r [LSB] 4292 srandom [SUSv3] srandom_r [LSB] strtod [SUSv3] strtol [SUSv3] 4293 strtoul [SUSv3] swapcontext [SUSv3] syslog [SUSv3] system [LSB] 4294 tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] tmpnam [SUSv3] 4295 tsearch [SUSv3] ttyname [SUSv3] ttyname_r [SUSv3] twalk [SUSv3] 4296 unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] verrx [LSB] 4297 vfscanf [LSB] vscanf [LSB] vsscanf [LSB] vsyslog [LSB] 4298 warn [LSB] warnx [LSB] wordexp [SUSv3] wordfree [SUSv3] 4299 4300 An LSB conforming implementation shall provide the generic 4301 deprecated functions for Standard Library specified in Table 4302 13-35, with the full mandatory functionality as described in 4303 the referenced underlying specification. 4304 4305 Note: These interfaces are deprecated, and applications 4306 should avoid using them. These interfaces may be withdrawn 4307 in future releases of this specification. 4308 4309 Table 13-35. libc - Standard Library Deprecated Function 4310 Interfaces 4311 basename [LSB] getdomainname [LSB] inet_aton [LSB] tmpnam 4312 [SUSv3] 4313 4314 An LSB conforming implementation shall provide the generic data 4315 interfaces for Standard Library specified in Table 13-36, with 4316 the full mandatory functionality as described in the referenced 4317 underlying specification. 4318 4319 Table 13-36. libc - Standard Library Data Interfaces 4320 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 4321 [SUSv3] 4322 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 4323 [SUSv3] 4324 optopt [SUSv3] 4325 __________________________________________________________ 4326 4327 13.4. Data Definitions for libc 4328 4329 This section defines global identifiers and their values that 4330 are associated with interfaces contained in libc. These 4331 definitions are organized into groups that correspond to system 4332 headers. This convention is used as a convenience for the 4333 reader, and does not imply the existence of these headers, or 4334 their content. Where an interface is defined as requiring a 4335 particular system header file all of the data definitions for 4336 that system header file presented here shall be in effect. 4337 4338 This section gives data definitions to promote binary 4339 application portability, not to repeat source interface 4340 definitions available elsewhere. System providers and 4341 application developers should use this ABI to supplement - not 4342 to replace - source interface definition specifications. 4343 4344 This specification uses the ISO C (1999) C Language as the 4345 reference programming language, and data definitions are 4346 specified in ISO C format. The C language is used here as a 4347 convenient notation. Using a C language description of these 4348 data objects does not preclude their use by other programming 4349 languages. 4350 __________________________________________________________ 4351 4352 13.4.1. arpa/inet.h 4353 4354 extern uint32_t htonl(uint32_t); 4355 extern uint16_t htons(uint16_t); 4356 extern in_addr_t inet_addr(const char *__cp); 4357 extern int inet_aton(const char *__cp, struct in_addr *__inp); 4358 extern char *inet_ntoa(struct in_addr __in); 4359 extern const char *inet_ntop(int __af, const void *__cp, char *__buf, 4360 socklen_t __len); 4361 extern int inet_pton(int __af, const char *__cp, void *__buf); 4362 extern uint32_t ntohl(uint32_t); 4363 extern uint16_t ntohs(uint16_t); 4364 __________________________________________________________ 4365 4366 13.4.2. assert.h 4367 4368 #ifdef NDEBUG 4369 #define assert(expr) ((void)0) 4370 #else 4371 #define assert(expr) ((void) ((expr) ? 0 : (__assert_fail (#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__), 0))) 4372 #endif 4373 4374 extern void __assert_fail(const char *__assertion, const char *__file, 4375 unsigned int __line, const char *__function); 4376 __________________________________________________________ 4377 4378 13.4.3. cpio.h 4379 4380 #define C_IXOTH 000001 4381 #define C_IWOTH 000002 4382 #define C_IROTH 000004 4383 #define C_IXGRP 000010 4384 #define C_IWGRP 000020 4385 #define C_IRGRP 000040 4386 #define C_IXUSR 000100 4387 #define C_IWUSR 000200 4388 #define C_IRUSR 000400 4389 #define C_ISVTX 001000 4390 #define C_ISGID 002000 4391 #define C_ISUID 004000 4392 #define C_ISFIFO 010000 4393 #define C_ISREG 0100000 4394 #define C_ISCTG 0110000 4395 #define C_ISLNK 0120000 4396 #define C_ISSOCK 0140000 4397 #define C_ISCHR 020000 4398 #define C_ISDIR 040000 4399 #define C_ISBLK 060000 4400 #define MAGIC "070707" 4401 __________________________________________________________ 4402 4403 13.4.4. ctype.h 4404 4405 extern const unsigned short **__ctype_b_loc(void); 4406 extern const int32_t **__ctype_tolower_loc(void); 4407 extern const int32_t **__ctype_toupper_loc(void); 4408 extern int _tolower(int); 4409 extern int _toupper(int); 4410 extern int isalnum(int); 4411 extern int isalpha(int); 4412 extern int isascii(int __c); 4413 extern int isblank(int); 4414 extern int iscntrl(int); 4415 extern int isdigit(int); 4416 extern int isgraph(int); 4417 extern int islower(int); 4418 extern int isprint(int); 4419 extern int ispunct(int); 4420 extern int isspace(int); 4421 extern int isupper(int); 4422 extern int isxdigit(int); 4423 extern int toascii(int __c); 4424 extern int tolower(int __c); 4425 extern int toupper(int __c); 4426 __________________________________________________________ 4427 4428 13.4.5. dirent.h 4429 4430 typedef struct __dirstream DIR; 4431 4432 struct dirent { 4433 long int d_ino; 4434 off_t d_off; 4435 unsigned short d_reclen; 4436 unsigned char d_type; 4437 char d_name[256]; 4438 }; 4439 struct dirent64 { 4440 uint64_t d_ino; 4441 int64_t d_off; 4442 unsigned short d_reclen; 4443 unsigned char d_type; 4444 char d_name[256]; 4445 }; 4446 extern int alphasort(const struct dirent **__e1, 4447 const struct dirent **__e2); 4448 extern int alphasort64(const struct dirent64 **__e1, 4449 const struct dirent64 **__e2); 4450 extern int closedir(DIR * __dirp); 4451 extern int dirfd(DIR * __dirp); 4452 extern DIR *fdopendir(int __fd); 4453 extern DIR *opendir(const char *__name); 4454 extern struct dirent *readdir(DIR * __dirp); 4455 extern struct dirent64 *readdir64(DIR * __dirp); 4456 extern int readdir64_r(DIR * __dirp, struct dirent64 *__entry, 4457 struct dirent64 **__result); 4458 extern int readdir_r(DIR * __dirp, struct dirent *__entry, 4459 struct dirent **__result); 4460 extern void rewinddir(DIR * __dirp); 4461 extern int scandir(const char *__dir, struct dirent ***__namelist, 4462 int (*__selector) (const struct dirent *), 4463 int (*__cmp) (const struct dirent *, 4464 const struct dirent *)); 4465 extern int scandir64(const char *__dir, struct dirent64 ***__namelist, 4466 int (*__selector) (const struct dirent64 *), 4467 int (*__cmp) (const struct dirent64 *, 4468 const struct dirent64 *)); 4469 extern void seekdir(DIR * __dirp, long int __pos); 4470 extern long int telldir(DIR * __dirp); 4471 __________________________________________________________ 4472 4473 13.4.6. endian.h 4474 4475 #define __LITTLE_ENDIAN 1234 4476 #define __BIG_ENDIAN 4321 4477 #define BIG_ENDIAN __BIG_ENDIAN 4478 #define BYTE_ORDER __BYTE_ORDER 4479 #define LITTLE_ENDIAN __LITTLE_ENDIAN 4480 __________________________________________________________ 4481 4482 13.4.7. err.h 4483 4484 extern void err(int __status, const char *__format, ...); 4485 extern void error(int, int, const char *, ...); 4486 extern void errx(int __status, const char *__format, ...); 4487 extern void warn(const char *__format, ...); 4488 extern void warnx(const char *__format, ...); 4489 __________________________________________________________ 4490 4491 13.4.8. errno.h 4492 4493 #define errno (*__errno_location()) 4494 4495 #define EPERM 1 /* Operation not permitted */ 4496 #define ECHILD 10 /* No child processes */ 4497 #define ENETDOWN 100 /* Network is down */ 4498 #define ENETUNREACH 101 /* Network is unreachable */ 4499 #define ENETRESET 102 /* Network dropped connection because of reset */ 4500 #define ECONNABORTED 103 /* Software caused connection abort */ 4501 #define ECONNRESET 104 /* Connection reset by peer */ 4502 #define ENOBUFS 105 /* No buffer space available */ 4503 #define EISCONN 106 /* Transport endpoint is already connected */ 4504 #define ENOTCONN 107 /* Transport endpoint is not connected */ 4505 #define ESHUTDOWN 108 /* Cannot send after transport endpointshutdown */ 4506 #define ETOOMANYREFS 109 /* Too many references: cannot splice */ 4507 #define EAGAIN 11 /* Try again */ 4508 #define ETIMEDOUT 110 /* Connection timed out */ 4509 #define ECONNREFUSED 111 /* Connection refused */ 4510 #define EHOSTDOWN 112 /* Host is down */ 4511 #define EHOSTUNREACH 113 /* No route to host */ 4512 #define EALREADY 114 /* Operation already in progress */ 4513 #define EINPROGRESS 115 /* Operation now in progress */ 4514 #define ESTALE 116 /* Stale NFS file handle */ 4515 #define EUCLEAN 117 /* Structure needs cleaning */ 4516 #define ENOTNAM 118 /* Not a XENIX named type file */ 4517 #define ENAVAIL 119 /* No XENIX semaphores available */ 4518 #define ENOMEM 12 /* Out of memory */ 4519 #define EISNAM 120 /* Is a named type file */ 4520 #define EREMOTEIO 121 /* Remote I/O error */ 4521 #define EDQUOT 122 /* Quota exceeded */ 4522 #define ENOMEDIUM 123 /* No medium found */ 4523 #define EMEDIUMTYPE 124 /* Wrong medium type */ 4524 #define ECANCELED 125 /* Operation Canceled */ 4525 #define EACCES 13 /* Permission denied */ 4526 #define EFAULT 14 /* Bad address */ 4527 #define ENOTBLK 15 /* Block device required */ 4528 #define EBUSY 16 /* Device or resource busy */ 4529 #define EEXIST 17 /* File exists */ 4530 #define EXDEV 18 /* Cross-device link */ 4531 #define ENODEV 19 /* No such device */ 4532 #define ENOENT 2 /* No such file or directory */ 4533 #define ENOTDIR 20 /* Not a directory */ 4534 #define EISDIR 21 /* Is a directory */ 4535 #define EINVAL 22 /* Invalid argument */ 4536 #define ENFILE 23 /* File table overflow */ 4537 #define EMFILE 24 /* Too many open files */ 4538 #define ENOTTY 25 /* Not a typewriter */ 4539 #define ETXTBSY 26 /* Text file busy */ 4540 #define EFBIG 27 /* File too large */ 4541 #define ENOSPC 28 /* No space left on device */ 4542 #define ESPIPE 29 /* Illegal seek */ 4543 #define ESRCH 3 /* No such process */ 4544 #define EROFS 30 /* Read-only file system */ 4545 #define EMLINK 31 /* Too many links */ 4546 #define EPIPE 32 /* Broken pipe */ 4547 #define EDOM 33 /* Math argument out of domain of func */ 4548 #define ERANGE 34 /* Math result not representable */ 4549 #define EDEADLK 35 /* Resource deadlock would occur */ 4550 #define ENAMETOOLONG 36 /* File name too long */ 4551 #define ENOLCK 37 /* No record locks available */ 4552 #define ENOSYS 38 /* Function not implemented */ 4553 #define ENOTEMPTY 39 /* Directory not empty */ 4554 #define EINTR 4 /* Interrupted system call */ 4555 #define ELOOP 40 /* Too many symbolic links encountered */ 4556 #define ENOMSG 42 /* No message of desired type */ 4557 #define EIDRM 43 /* Identifier removed */ 4558 #define ECHRNG 44 /* Channel number out of range */ 4559 #define EL2NSYNC 45 /* Level 2 not synchronized */ 4560 #define EL3HLT 46 /* Level 3 halted */ 4561 #define EL3RST 47 /* Level 3 reset */ 4562 #define ELNRNG 48 /* Link number out of range */ 4563 #define EUNATCH 49 /* Protocol driver not attached */ 4564 #define EIO 5 /* I/O error */ 4565 #define ENOANO 55 /* No anode */ 4566 #define EBADRQC 56 /* Invalid request code */ 4567 #define EBADSLT 57 /* Invalid slot */ 4568 #define EBFONT 59 /* Bad font file format */ 4569 #define ENXIO 6 /* No such device or address */ 4570 #define ENOSTR 60 /* Device not a stream */ 4571 #define ENODATA 61 /* No data available */ 4572 #define ETIME 62 /* Timer expired */ 4573 #define ENOSR 63 /* Out of streams resources */ 4574 #define ENONET 64 /* Machine is not on the network */ 4575 #define ENOPKG 65 /* Package not installed */ 4576 #define EREMOTE 66 /* Object is remote */ 4577 #define ENOLINK 67 /* Link has been severed */ 4578 #define EADV 68 /* Advertise error */ 4579 #define ESRMNT 69 /* Srmount error */ 4580 #define E2BIG 7 /* Argument list too long */ 4581 #define ECOMM 70 /* Communication error on send */ 4582 #define EPROTO 71 /* Protocol error */ 4583 #define EMULTIHOP 72 /* Multihop attempted */ 4584 #define EDOTDOT 73 /* RFS specific error */ 4585 #define EBADMSG 74 /* Not a data message */ 4586 #define EOVERFLOW 75 /* Value too large for defined data type */ 4587 #define ENOTUNIQ 76 /* Name not unique on network */ 4588 #define EBADFD 77 /* File descriptor in bad state */ 4589 #define EREMCHG 78 /* Remote address changed */ 4590 #define ELIBACC 79 /* Can not access a needed shared library */ 4591 #define ENOEXEC 8 /* Exec format error */ 4592 #define ELIBBAD 80 /* Accessing a corrupted shared library*/ 4593 #define ELIBSCN 81 /* .lib section in a.out corrupted */ 4594 #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ 4595 #define ELIBEXEC 83 /* Cannot exec a shared library directly */ 4596 #define EILSEQ 84 /* Illegal byte sequence */ 4597 #define ERESTART 85 /* Interrupted system call should be restarted */ 4598 #define ESTRPIPE 86 /* Streams pipe error */ 4599 #define EUSERS 87 /* Too many users */ 4600 #define ENOTSOCK 88 /* Socket operation on non-socket */ 4601 #define EDESTADDRREQ 89 /* Destination address required */ 4602 #define EBADF 9 /* Bad file number */ 4603 #define EMSGSIZE 90 /* Message too long */ 4604 #define EPROTOTYPE 91 /* Protocol wrong type for socket */ 4605 #define ENOPROTOOPT 92 /* Protocol not available */ 4606 #define EPROTONOSUPPORT 93 /* Protocol not supported */ 4607 #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ 4608 #define EOPNOTSUPP 95 /* Operation not supported on transportendpoint */ 4609 #define EPFNOSUPPORT 96 /* Protocol family not supported */ 4610 #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ 4611 #define EADDRINUSE 98 /* Address already in use */ 4612 #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ 4613 #define EWOULDBLOCK EAGAIN /* Operation would block */ 4614 #define ENOTSUP EOPNOTSUPP 4615 4616 extern int *__errno_location(void); 4617 __________________________________________________________ 4618 4619 13.4.9. fcntl.h 4620 4621 #define POSIX_FADV_NORMAL 0 4622 #define O_RDONLY 00 4623 #define O_ACCMODE 0003 4624 #define O_WRONLY 01 4625 #define O_CREAT 0100 4626 #define O_TRUNC 01000 4627 #define O_DSYNC 010000 4628 #define O_RSYNC 010000 4629 #define O_SYNC 010000 4630 #define O_RDWR 02 4631 #define O_EXCL 0200 4632 #define O_APPEND 02000 4633 #define O_ASYNC 020000 4634 #define O_NOCTTY 0400 4635 #define O_NDELAY 04000 4636 #define O_NONBLOCK 04000 4637 #define FD_CLOEXEC 1 4638 #define POSIX_FADV_RANDOM 1 4639 #define POSIX_FADV_SEQUENTIAL 2 4640 #define POSIX_FADV_WILLNEED 3 4641 4642 struct flock { 4643 short l_type; 4644 short l_whence; 4645 off_t l_start; 4646 off_t l_len; 4647 pid_t l_pid; 4648 }; 4649 struct flock64 { 4650 short l_type; 4651 short l_whence; 4652 loff_t l_start; 4653 loff_t l_len; 4654 pid_t l_pid; 4655 }; 4656 4657 #define AT_FDCWD -100 4658 #define AT_SYMLINK_NOFOLLOW 0x100 4659 #define AT_EACCESS 0x200 4660 #define AT_REMOVEDIR 0x200 4661 #define AT_SYMLINK_FOLLOW 0x400 4662 4663 #define F_DUPFD 0 4664 #define F_RDLCK 0 4665 #define F_GETFD 1 4666 #define F_WRLCK 1 4667 #define F_SETSIG 10 4668 #define F_GETSIG 11 4669 #define F_SETFD 2 4670 #define F_UNLCK 2 4671 #define F_GETFL 3 4672 #define F_SETFL 4 4673 #define F_GETLK 5 4674 #define F_SETLK 6 4675 #define F_SETLKW 7 4676 #define F_SETOWN 8 4677 #define F_GETOWN 9 4678 4679 extern int creat(const char *__file, mode_t __mode); 4680 extern int creat64(const char *__file, mode_t __mode); 4681 extern int fcntl(int __fd, int __cmd, ...); 4682 extern int open(const char *__file, int __oflag, ...); 4683 extern int open64(const char *__file, int __oflag, ...); 4684 extern int openat(int __fd, const char *__file, int __oflag, ...); 4685 extern int openat64(int __fd, const char *__file, int __oflag, ...); 4686 extern int posix_fadvise(int __fd, off_t __offset, off_t __len, 4687 int __advise); 4688 extern int posix_fadvise64(int __fd, off64_t __offset, off64_t __len, 4689 int __advise); 4690 extern int posix_fallocate(int __fd, off_t __offset, off_t __len); 4691 extern int posix_fallocate64(int __fd, off64_t __offset, off64_t __len); 4692 __________________________________________________________ 4693 4694 13.4.10. fmtmsg.h 4695 4696 #define MM_HARD 1 /* Source of the condition is hardware.*/ 4697 #define MM_NRECOV 128 /* Non-recoverable error. */ 4698 #define MM_UTIL 16 /* Condition detected by utility. */ 4699 #define MM_SOFT 2 /* Source of the condition is software.*/ 4700 #define MM_PRINT 256 /* Display message in standard error. */ 4701 #define MM_OPSYS 32 /* Condition detected by operating system. */ 4702 #define MM_FIRM 4 /* Source of the condition is firmware.*/ 4703 #define MM_CONSOLE 512 /* Display message on system console. */ 4704 #define MM_RECOVER 64 /* Recoverable error. */ 4705 #define MM_APPL 8 /* Condition detected by application. */ 4706 4707 #define MM_NOSEV 0 /* No severity level provided for the message. */ 4708 #define MM_HALT 1 /* Error causing application to halt. */ 4709 #define MM_ERROR 2 /* Application has encountered a non-fatal fault. */ 4710 #define MM_WARNING 3 /* Application has detected unusual non-error condition. */ 4711 #define MM_INFO 4 /* Informative message. */ 4712 4713 #define MM_NULLACT ((char *) 0) 4714 #define MM_NULLLBL ((char *) 0) 4715 #define MM_NULLTAG ((char *) 0) 4716 #define MM_NULLTXT ((char *) 0) 4717 #define MM_NULLMC ((long int) 0) 4718 #define MM_NULLSEV 0 4719 4720 #define MM_NOTOK -1 /* The function failed completely. */ 4721 #define MM_OK 0 /* The function succeeded. */ 4722 #define MM_NOMSG 1 /* The function was unable to generate a message on standard error, but otherwise succeeded. */ 4723 #define MM_NOCON 4 /* The function was unable to generate a console message, but otherwise succeeded. */ 4724 4725 extern int fmtmsg(long int __classification, const char *__label, 4726 int __severity, const char *__text, const char *__action, 4727 const char *__tag); 4728 __________________________________________________________ 4729 4730 13.4.11. fnmatch.h 4731 4732 #define FNM_PATHNAME (1<<0) 4733 #define FNM_NOESCAPE (1<<1) 4734 #define FNM_PERIOD (1<<2) 4735 #define FNM_NOMATCH 1 4736 4737 extern int fnmatch(const char *__pattern, const char *__name, int __flags); 4738 __________________________________________________________ 4739 4740 13.4.12. ftw.h 4741 4742 #define FTW_D FTW_D 4743 #define FTW_DNR FTW_DNR 4744 #define FTW_DP FTW_DP 4745 #define FTW_F FTW_F 4746 #define FTW_NS FTW_NS 4747 #define FTW_SL FTW_SL 4748 #define FTW_SLN FTW_SLN 4749 4750 enum { 4751 FTW_F, 4752 FTW_D, 4753 FTW_DNR, 4754 FTW_NS, 4755 FTW_SL, 4756 FTW_DP, 4757 FTW_SLN 4758 }; 4759 4760 enum { 4761 FTW_PHYS = 1, 4762 FTW_MOUNT = 2, 4763 FTW_CHDIR = 4, 4764 FTW_DEPTH = 8 4765 }; 4766 4767 struct FTW { 4768 int base; 4769 int level; 4770 }; 4771 4772 typedef int (*__ftw_func_t) (const char *__filename, 4773 const struct stat * __status, int __flag); 4774 typedef int (*__ftw64_func_t) (const char *__filename, 4775 const struct stat64 * __status, int __flag); 4776 typedef int (*__nftw_func_t) (const char *__filename, 4777 const struct stat * __status, int __flag, 4778 struct FTW * __info); 4779 typedef int (*__nftw64_func_t) (const char *__filename, 4780 const struct stat64 * __status, int __flag, 4781 struct FTW * __info); 4782 extern int ftw(const char *__dir, __ftw_func_t __func, int __descriptors); 4783 extern int ftw64(const char *__dir, __ftw64_func_t __func, 4784 int __descriptors); 4785 extern int nftw(const char *__dir, __nftw_func_t __func, int __descriptors, 4786 int __flag); 4787 extern int nftw64(const char *__dir, __nftw64_func_t __func, 4788 int __descriptors, int __flag); 4789 __________________________________________________________ 4790 4791 13.4.13. getopt.h 4792 4793 #define no_argument 0 4794 #define required_argument 1 4795 #define optional_argument 2 4796 4797 struct option { 4798 const char *name; 4799 int has_arg; 4800 int *flag; 4801 int val; 4802 }; 4803 extern int getopt_long(int ___argc, char *const ___argv[], 4804 const char *__shortopts, 4805 const struct option *__longopts, int *__longind); 4806 extern int getopt_long_only(int ___argc, char *const ___argv[], 4807 const char *__shortopts, 4808 const struct option *__longopts, 4809 int *__longind); 4810 __________________________________________________________ 4811 4812 13.4.14. glob.h 4813 4814 #define GLOB_ERR (1<<0) 4815 #define GLOB_MARK (1<<1) 4816 #define GLOB_BRACE (1<<10) 4817 #define GLOB_NOMAGIC (1<<11) 4818 #define GLOB_TILDE (1<<12) 4819 #define GLOB_ONLYDIR (1<<13) 4820 #define GLOB_TILDE_CHECK (1<<14) 4821 #define GLOB_NOSORT (1<<2) 4822 #define GLOB_DOOFFS (1<<3) 4823 #define GLOB_NOCHECK (1<<4) 4824 #define GLOB_APPEND (1<<5) 4825 #define GLOB_NOESCAPE (1<<6) 4826 #define GLOB_PERIOD (1<<7) 4827 #define GLOB_MAGCHAR (1<<8) 4828 #define GLOB_ALTDIRFUNC (1<<9) 4829 4830 #define GLOB_NOSPACE 1 4831 #define GLOB_ABORTED 2 4832 #define GLOB_NOMATCH 3 4833 #define GLOB_NOSYS 4 4834 4835 typedef struct { 4836 size_t gl_pathc; 4837 char **gl_pathv; 4838 size_t gl_offs; 4839 int gl_flags; 4840 void (*gl_closedir) (void *); 4841 struct dirent *(*gl_readdir) (void *); 4842 void *(*gl_opendir) (const char *); 4843 int (*gl_lstat) (const char *, struct stat *); 4844 int (*gl_stat) (const char *, struct stat *); 4845 } glob_t; 4846 4847 typedef struct { 4848 size_t gl_pathc; 4849 char **gl_pathv; 4850 size_t gl_offs; 4851 int gl_flags; 4852 void (*gl_closedir) (void *); 4853 struct dirent64 *(*gl_readdir) (void *); 4854 void *(*gl_opendir) (const char *); 4855 int (*gl_lstat) (const char *, struct stat *); 4856 int (*gl_stat) (const char *, struct stat *); 4857 } glob64_t; 4858 extern int glob(const char *__pattern, int __flags, 4859 int (*__errfunc) (const char *, int), glob_t * __pglob); 4860 extern int glob64(const char *__pattern, int __flags, 4861 int (*__errfunc) (const char *, int), 4862 glob64_t * __pglob); 4863 extern void globfree(glob_t * __pglob); 4864 extern void globfree64(glob64_t * __pglob); 4865 __________________________________________________________ 4866 4867 13.4.15. grp.h 4868 4869 struct group { 4870 char *gr_name; 4871 char *gr_passwd; 4872 gid_t gr_gid; 4873 char **gr_mem; 4874 }; 4875 4876 extern void endgrent(void); 4877 extern struct group *getgrent(void); 4878 extern int getgrent_r(struct group *__resultbuf, char *__buffer, 4879 size_t __buflen, struct group **__result); 4880 extern struct group *getgrgid(gid_t __gid); 4881 extern int getgrgid_r(gid_t __gid, struct group *__resultbuf, 4882 char *__buffer, size_t __buflen, 4883 struct group **__result); 4884 extern struct group *getgrnam(const char *__name); 4885 extern int getgrnam_r(const char *__name, struct group *__resultbuf, 4886 char *__buffer, size_t __buflen, 4887 struct group **__result); 4888 extern int getgrouplist(const char *__user, gid_t __group, 4889 gid_t * __groups, int *__ngroups); 4890 extern int initgroups(const char *__user, gid_t __group); 4891 extern void setgrent(void); 4892 extern int setgroups(size_t __n, const gid_t * __groups); 4893 __________________________________________________________ 4894 4895 13.4.16. iconv.h 4896 4897 typedef void *iconv_t; 4898 extern size_t iconv(iconv_t __cd, char **__inbuf, size_t * __inbytesleft, 4899 char **__outbuf, size_t * __outbytesleft); 4900 extern int iconv_close(iconv_t __cd); 4901 extern iconv_t iconv_open(const char *__tocode, const char *__fromcode); 4902 __________________________________________________________ 4903 4904 13.4.17. inttypes.h 4905 4906 typedef lldiv_t imaxdiv_t; 4907 4908 #define __PDP_ENDIAN 3412 4909 #define PDP_ENDIAN __PDP_ENDIAN 4910 4911 extern intmax_t imaxabs(intmax_t __n); 4912 extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom); 4913 extern intmax_t strtoimax(const char *__nptr, char **__endptr, int __base); 4914 extern uintmax_t strtoumax(const char *__nptr, char **__endptr, 4915 int __base); 4916 extern intmax_t wcstoimax(const wchar_t * __nptr, wchar_t * *__endptr, 4917 int __base); 4918 extern uintmax_t wcstoumax(const wchar_t * __nptr, wchar_t * *__endptr, 4919 int __base); 4920 __________________________________________________________ 4921 4922 13.4.18. langinfo.h 4923 4924 #define ABDAY_1 0x20000 /* Sun. */ 4925 #define ABDAY_2 0x20001 4926 #define ABDAY_3 0x20002 4927 #define ABDAY_4 0x20003 4928 #define ABDAY_5 0x20004 4929 #define ABDAY_6 0x20005 4930 #define ABDAY_7 0x20006 4931 4932 #define DAY_1 0x20007 4933 #define DAY_2 0x20008 4934 #define DAY_3 0x20009 4935 #define DAY_4 0x2000A 4936 #define DAY_5 0x2000B 4937 #define DAY_6 0x2000C 4938 #define DAY_7 0x2000D 4939 4940 #define ABMON_1 0x2000E 4941 #define ABMON_2 0x2000F 4942 #define ABMON_3 0x20010 4943 #define ABMON_4 0x20011 4944 #define ABMON_5 0x20012 4945 #define ABMON_6 0x20013 4946 #define ABMON_7 0x20014 4947 #define ABMON_8 0x20015 4948 #define ABMON_9 0x20016 4949 #define ABMON_10 0x20017 4950 #define ABMON_11 0x20018 4951 #define ABMON_12 0x20019 4952 4953 #define MON_1 0x2001A 4954 #define MON_2 0x2001B 4955 #define MON_3 0x2001C 4956 #define MON_4 0x2001D 4957 #define MON_5 0x2001E 4958 #define MON_6 0x2001F 4959 #define MON_7 0x20020 4960 #define MON_8 0x20021 4961 #define MON_9 0x20022 4962 #define MON_10 0x20023 4963 #define MON_11 0x20024 4964 #define MON_12 0x20025 4965 4966 #define AM_STR 0x20026 4967 #define PM_STR 0x20027 4968 4969 #define D_T_FMT 0x20028 4970 #define D_FMT 0x20029 4971 #define T_FMT 0x2002A 4972 #define T_FMT_AMPM 0x2002B 4973 4974 #define ERA 0x2002C 4975 #define ERA_D_FMT 0x2002E 4976 #define ALT_DIGITS 0x2002F 4977 #define ERA_D_T_FMT 0x20030 4978 #define ERA_T_FMT 0x20031 4979 4980 #define CODESET 14 4981 4982 #define CRNCYSTR 0x4000F 4983 4984 #define RADIXCHAR 0x10000 4985 #define THOUSEP 0x10001 4986 #define YESEXPR 0x50000 4987 #define NOEXPR 0x50001 4988 #define YESSTR 0x50002 4989 #define NOSTR 0x50003 4990 4991 extern char *nl_langinfo(nl_item __item); 4992 __________________________________________________________ 4993 4994 13.4.19. libgen.h 4995 4996 #define basename __xpg_basename 4997 4998 extern char *__xpg_basename(char *__path); 4999 extern char *dirname(char *__path); 5000 __________________________________________________________ 5001 5002 13.4.20. libintl.h 5003 5004 extern char *bind_textdomain_codeset(const char *__domainname, 5005 const char *__codeset); 5006 extern char *bindtextdomain(const char *__domainname, 5007 const char *__dirname); 5008 extern char *dcgettext(const char *__domainname, const char *__msgid, 5009 int __category); 5010 extern char *dcngettext(const char *__domainname, const char *__msgid1, 5011 const char *__msgid2, unsigned long int __n, 5012 int __category); 5013 extern char *dgettext(const char *__domainname, const char *__msgid); 5014 extern char *dngettext(const char *__domainname, const char *__msgid1, 5015 const char *__msgid2, unsigned long int __n); 5016 extern char *gettext(const char *__msgid); 5017 extern char *ngettext(const char *__msgid1, const char *__msgid2, 5018 unsigned long int __n); 5019 extern char *textdomain(const char *__domainname); 5020 __________________________________________________________ 5021 5022 13.4.21. limits.h 5023 5024 #define LLONG_MIN (-LLONG_MAX-1LL) 5025 #define _POSIX_AIO_MAX 1 5026 #define _POSIX_QLIMIT 1 5027 #define _POSIX2_BC_STRING_MAX 1000 5028 #define _POSIX2_CHARCLASS_NAME_MAX 14 5029 #define _POSIX_NAME_MAX 14 5030 #define _POSIX_UIO_MAXIOV 16 5031 #define ULLONG_MAX 18446744073709551615ULL 5032 #define _POSIX2_COLL_WEIGHTS_MAX 2 5033 #define _POSIX_AIO_LISTIO_MAX 2 5034 #define _POSIX_OPEN_MAX 20 5035 #define _POSIX_CLOCKRES_MIN 20000000 5036 #define CHARCLASS_NAME_MAX 2048 5037 #define LINE_MAX 2048 5038 #define _POSIX2_BC_DIM_MAX 2048 5039 #define _POSIX2_LINE_MAX 2048 5040 #define _POSIX_CHILD_MAX 25 5041 #define COLL_WEIGHTS_MAX 255 5042 #define _POSIX2_RE_DUP_MAX 255 5043 #define _POSIX_HOST_NAME_MAX 255 5044 #define _POSIX_MAX_CANON 255 5045 #define _POSIX_MAX_INPUT 255 5046 #define _POSIX_RE_DUP_MAX 255 5047 #define _POSIX_SYMLINK_MAX 255 5048 #define _POSIX_PATH_MAX 256 5049 #define _POSIX_SEM_NSEMS_MAX 256 5050 #define NGROUPS_MAX 32 5051 #define _POSIX2_EXPR_NEST_MAX 32 5052 #define _POSIX_DELAYTIMER_MAX 32 5053 #define _POSIX_MQ_PRIO_MAX 32 5054 #define _POSIX_SIGQUEUE_MAX 32 5055 #define _POSIX_TIMER_MAX 32 5056 #define _POSIX_SEM_VALUE_MAX 32767 5057 #define _POSIX_SSIZE_MAX 32767 5058 #define PATH_MAX 4096 5059 #define _POSIX_ARG_MAX 4096 5060 #define _POSIX_PIPE_BUF 512 5061 #define _POSIX_TZNAME_MAX 6 5062 #define _POSIX_LINK_MAX 8 5063 #define _POSIX_MQ_OPEN_MAX 8 5064 #define _POSIX_NGROUPS_MAX 8 5065 #define _POSIX_RTSIG_MAX 8 5066 #define _POSIX_STREAM_MAX 8 5067 #define _POSIX_SYMLOOP_MAX 8 5068 #define _POSIX_LOGIN_NAME_MAX 9 5069 #define _POSIX_TTY_NAME_MAX 9 5070 #define LLONG_MAX 9223372036854775807LL 5071 #define _POSIX2_BC_BASE_MAX 99 5072 #define _POSIX2_BC_SCALE_MAX 99 5073 #define SSIZE_MAX LONG_MAX /* Maximum value of an object of type ssize_t */ 5074 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX 5075 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX 5076 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX 5077 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX 5078 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX 5079 #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX 5080 #define _POSIX_HIWAT _POSIX_PIPE_BUF 5081 5082 #define MB_LEN_MAX 16 5083 5084 #define SCHAR_MIN (-128) 5085 #define SCHAR_MAX 127 5086 #define UCHAR_MAX 255 5087 #define CHAR_BIT 8 5088 5089 #define SHRT_MIN (-32768) 5090 #define SHRT_MAX 32767 5091 #define USHRT_MAX 65535 5092 5093 #define INT_MIN (-INT_MAX-1) 5094 #define INT_MAX 2147483647 5095 #define UINT_MAX 4294967295U 5096 5097 #define LONG_MIN (-LONG_MAX-1L) 5098 5099 #define PTHREAD_KEYS_MAX 1024 5100 #define PTHREAD_THREADS_MAX 16384 5101 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 5102 __________________________________________________________ 5103 5104 13.4.22. locale.h 5105 5106 struct lconv { 5107 char *decimal_point; 5108 char *thousands_sep; 5109 char *grouping; 5110 char *int_curr_symbol; 5111 char *currency_symbol; 5112 char *mon_decimal_point; 5113 char *mon_thousands_sep; 5114 char *mon_grouping; 5115 char *positive_sign; 5116 char *negative_sign; 5117 char int_frac_digits; 5118 char frac_digits; 5119 char p_cs_precedes; 5120 char p_sep_by_space; 5121 char n_cs_precedes; 5122 char n_sep_by_space; 5123 char p_sign_posn; 5124 char n_sign_posn; 5125 char int_p_cs_precedes; 5126 char int_p_sep_by_space; 5127 char int_n_cs_precedes; 5128 char int_n_sep_by_space; 5129 char int_p_sign_posn; 5130 char int_n_sign_posn; 5131 }; 5132 5133 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 5134 #define LC_CTYPE 0 5135 #define LC_NUMERIC 1 5136 #define LC_TELEPHONE 10 5137 #define LC_MEASUREMENT 11 5138 #define LC_IDENTIFICATION 12 5139 #define LC_TIME 2 5140 #define LC_COLLATE 3 5141 #define LC_MONETARY 4 5142 #define LC_MESSAGES 5 5143 #define LC_ALL 6 5144 #define LC_PAPER 7 5145 #define LC_NAME 8 5146 #define LC_ADDRESS 9 5147 5148 struct __locale_struct { 5149 struct locale_data *__locales[13]; 5150 const unsigned short *__ctype_b; 5151 const int *__ctype_tolower; 5152 const int *__ctype_toupper; 5153 const char *__names[13]; 5154 }; 5155 typedef struct __locale_struct *__locale_t; 5156 5157 typedef struct __locale_struct *locale_t; 5158 5159 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 5160 #define LC_COLLATE_MASK (1 << LC_COLLATE) 5161 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 5162 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 5163 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 5164 #define LC_MONETARY_MASK (1 << LC_MONETARY) 5165 #define LC_NAME_MASK (1 << LC_NAME) 5166 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 5167 #define LC_PAPER_MASK (1 << LC_PAPER) 5168 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 5169 #define LC_TIME_MASK (1 << LC_TIME) 5170 #define LC_CTYPE_MASK (1<icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) 5404 #define ICMP6_FILTER_WILLPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) 5405 #define ICMP6_FILTER_SETPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))) 5406 #define ICMP6_FILTER_SETBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))) 5407 #define ICMP6_DST_UNREACH_NOROUTE 0 5408 #define ICMP6_PARAMPROB_HEADER 0 5409 #define ICMP6_TIME_EXCEED_TRANSIT 0 5410 #define ICMP6_RR_FLAGS_PREVDONE 0x08 5411 #define ICMP6_RR_FLAGS_SPECSITE 0x10 5412 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10 5413 #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 5414 #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20 5415 #define ND_OPT_PI_FLAG_RADDR 0x20 5416 #define ND_RA_FLAG_HOME_AGENT 0x20 5417 #define ICMP6_RR_FLAGS_REQRESULT 0x40 5418 #define ND_OPT_PI_FLAG_AUTO 0x40 5419 #define ND_RA_FLAG_OTHER 0x40 5420 #define ICMP6_INFOMSG_MASK 0x80 5421 #define ICMP6_RR_FLAGS_TEST 0x80 5422 #define ND_OPT_PI_FLAG_ONLINK 0x80 5423 #define ND_RA_FLAG_MANAGED 0x80 5424 #define ICMP6_DST_UNREACH 1 5425 #define ICMP6_DST_UNREACH_ADMIN 1 5426 #define ICMP6_FILTER 1 5427 #define ICMP6_FILTER_BLOCK 1 5428 #define ICMP6_PARAMPROB_NEXTHEADER 1 5429 #define ICMP6_TIME_EXCEED_REASSEMBLY 1 5430 #define ND_OPT_SOURCE_LINKADDR 1 5431 #define RPM_PCO_ADD 1 5432 #define ICMP6_ECHO_REQUEST 128 5433 #define ICMP6_ECHO_REPLY 129 5434 #define MLD_LISTENER_QUERY 130 5435 #define MLD_LISTENER_REPORT 131 5436 #define MLD_LISTENER_REDUCTION 132 5437 #define ND_ROUTER_SOLICIT 133 5438 #define ND_ROUTER_ADVERT 134 5439 #define ND_NEIGHBOR_SOLICIT 135 5440 #define ND_NEIGHBOR_ADVERT 136 5441 #define ND_REDIRECT 137 5442 #define ICMP6_ROUTER_RENUMBERING 138 5443 #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 5444 #define ICMP6_FILTER_PASS 2 5445 #define ICMP6_PACKET_TOO_BIG 2 5446 #define ICMP6_PARAMPROB_OPTION 2 5447 #define ND_OPT_TARGET_LINKADDR 2 5448 #define RPM_PCO_CHANGE 2 5449 #define ICMP6_DST_UNREACH_ADDR 3 5450 #define ICMP6_FILTER_BLOCKOTHERS 3 5451 #define ICMP6_TIME_EXCEEDED 3 5452 #define ND_OPT_PREFIX_INFORMATION 3 5453 #define RPM_PCO_SETGLOBAL 3 5454 #define ICMP6_DST_UNREACH_NOPORT 4 5455 #define ICMP6_FILTER_PASSONLY 4 5456 #define ICMP6_PARAM_PROB 4 5457 #define ND_OPT_REDIRECTED_HEADER 4 5458 #define ND_OPT_MTU 5 5459 #define ND_OPT_RTR_ADV_INTERVAL 7 5460 #define ND_OPT_HOME_AGENT_INFO 8 5461 #define icmp6_id icmp6_data16[0] 5462 #define icmp6_maxdelay icmp6_data16[0] 5463 #define icmp6_seq icmp6_data16[1] 5464 #define icmp6_mtu icmp6_data32[0] 5465 #define icmp6_pptr icmp6_data32[0] 5466 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 5467 #define icmp6_data32 icmp6_dataun.icmp6_un_data32 5468 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 5469 #define ICMP6_FILTER_SETPASSALL(filterp) memset (filterp, 0, sizeof (struct icmp6_filter)); 5470 #define ICMP6_FILTER_SETBLOCKALL(filterp) memset (filterp, 0xFF, sizeof (struct icmp6_filter)); 5471 #define mld_cksum mld_icmp6_hdr.icmp6_cksum 5472 #define mld_code mld_icmp6_hdr.icmp6_code 5473 #define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0] 5474 #define mld_reserved mld_icmp6_hdr.icmp6_data16[1] 5475 #define mld_type mld_icmp6_hdr.icmp6_type 5476 #define nd_na_cksum nd_na_hdr.icmp6_cksum 5477 #define nd_na_code nd_na_hdr.icmp6_code 5478 #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] 5479 #define nd_na_type nd_na_hdr.icmp6_type 5480 #define nd_ns_cksum nd_ns_hdr.icmp6_cksum 5481 #define nd_ns_code nd_ns_hdr.icmp6_code 5482 #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] 5483 #define nd_ns_type nd_ns_hdr.icmp6_type 5484 #define nd_ra_cksum nd_ra_hdr.icmp6_cksum 5485 #define nd_ra_code nd_ra_hdr.icmp6_code 5486 #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] 5487 #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] 5488 #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] 5489 #define nd_ra_type nd_ra_hdr.icmp6_type 5490 #define nd_rd_cksum nd_rd_hdr.icmp6_cksum 5491 #define nd_rd_code nd_rd_hdr.icmp6_code 5492 #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] 5493 #define nd_rd_type nd_rd_hdr.icmp6_type 5494 #define nd_rs_cksum nd_rs_hdr.icmp6_cksum 5495 #define nd_rs_code nd_rs_hdr.icmp6_code 5496 #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] 5497 #define nd_rs_type nd_rs_hdr.icmp6_type 5498 #define rr_cksum rr_hdr.icmp6_cksum 5499 #define rr_code rr_hdr.icmp6_code 5500 #define rr_seqnum rr_hdr.icmp6_data32[0] 5501 #define rr_type rr_hdr.icmp6_type 5502 5503 struct icmp6_filter { 5504 uint32_t icmp6_filt[8]; 5505 }; 5506 struct icmp6_hdr { 5507 uint8_t icmp6_type; 5508 uint8_t icmp6_code; 5509 uint16_t icmp6_cksum; 5510 union { 5511 uint32_t icmp6_un_data32[1]; 5512 uint16_t icmp6_un_data16[2]; 5513 uint8_t icmp6_un_data8[4]; 5514 } icmp6_dataun; 5515 }; 5516 struct nd_router_solicit { 5517 struct icmp6_hdr nd_rs_hdr; 5518 }; 5519 struct nd_router_advert { 5520 struct icmp6_hdr nd_ra_hdr; 5521 uint32_t nd_ra_reachable; 5522 uint32_t nd_ra_retransmit; 5523 }; 5524 struct nd_neighbor_solicit { 5525 struct icmp6_hdr nd_ns_hdr; 5526 struct in6_addr nd_ns_target; 5527 }; 5528 struct nd_neighbor_advert { 5529 struct icmp6_hdr nd_na_hdr; 5530 struct in6_addr nd_na_target; 5531 }; 5532 struct nd_redirect { 5533 struct icmp6_hdr nd_rd_hdr; 5534 struct in6_addr nd_rd_target; 5535 struct in6_addr nd_rd_dst; 5536 }; 5537 struct nd_opt_hdr { 5538 uint8_t nd_opt_type; 5539 uint8_t nd_opt_len; 5540 }; 5541 struct nd_opt_prefix_info { 5542 uint8_t nd_opt_pi_type; 5543 uint8_t nd_opt_pi_len; 5544 uint8_t nd_opt_pi_prefix_len; 5545 uint8_t nd_opt_pi_flags_reserved; 5546 uint32_t nd_opt_pi_valid_time; 5547 uint32_t nd_opt_pi_preferred_time; 5548 uint32_t nd_opt_pi_reserved2; 5549 struct in6_addr nd_opt_pi_prefix; 5550 }; 5551 struct nd_opt_rd_hdr { 5552 uint8_t nd_opt_rh_type; 5553 uint8_t nd_opt_rh_len; 5554 uint16_t nd_opt_rh_reserved1; 5555 uint32_t nd_opt_rh_reserved2; 5556 }; 5557 struct nd_opt_mtu { 5558 uint8_t nd_opt_mtu_type; 5559 uint8_t nd_opt_mtu_len; 5560 uint16_t nd_opt_mtu_reserved; 5561 uint32_t nd_opt_mtu_mtu; 5562 }; 5563 struct mld_hdr { 5564 struct icmp6_hdr mld_icmp6_hdr; 5565 struct in6_addr mld_addr; 5566 }; 5567 struct icmp6_router_renum { 5568 struct icmp6_hdr rr_hdr; 5569 uint8_t rr_segnum; 5570 uint8_t rr_flags; 5571 uint16_t rr_maxdelay; 5572 uint32_t rr_reserved; 5573 }; 5574 struct rr_pco_match { 5575 uint8_t rpm_code; 5576 uint8_t rpm_len; 5577 uint8_t rpm_ordinal; 5578 uint8_t rpm_matchlen; 5579 uint8_t rpm_minlen; 5580 uint8_t rpm_maxlen; 5581 uint16_t rpm_reserved; 5582 struct in6_addr rpm_prefix; 5583 }; 5584 struct rr_pco_use { 5585 uint8_t rpu_uselen; 5586 uint8_t rpu_keeplen; 5587 uint8_t rpu_ramask; 5588 uint8_t rpu_raflags; 5589 uint32_t rpu_vltime; 5590 uint32_t rpu_pltime; 5591 uint32_t rpu_flags; 5592 struct in6_addr rpu_prefix; 5593 }; 5594 struct rr_result { 5595 uint16_t rrr_flags; 5596 uint8_t rrr_ordinal; 5597 uint8_t rrr_matchedlen; 5598 uint32_t rrr_ifid; 5599 struct in6_addr rrr_prefix; 5600 }; 5601 struct nd_opt_adv_interval { 5602 uint8_t nd_opt_adv_interval_type; 5603 uint8_t nd_opt_adv_interval_len; 5604 uint16_t nd_opt_adv_interval_reserved; 5605 uint32_t nd_opt_adv_interval_ival; 5606 }; 5607 struct nd_opt_home_agent_info { 5608 uint8_t nd_opt_home_agent_info_type; 5609 uint8_t nd_opt_home_agent_info_len; 5610 uint16_t nd_opt_home_agent_info_reserved; 5611 int16_t nd_opt_home_agent_info_preference; 5612 uint16_t nd_opt_home_agent_info_lifetime; 5613 }; 5614 __________________________________________________________ 5615 5616 13.4.27. netinet/igmp.h 5617 5618 #define IGMP_MEMBERSHIP_QUERY 0x11 5619 #define IGMP_V1_MEMBERSHIP_REPORT 0x12 5620 #define IGMP_DVMRP 0x13 5621 #define IGMP_PIM 0x14 5622 #define IGMP_TRACE 0x15 5623 #define IGMP_V2_MEMBERSHIP_REPORT 0x16 5624 #define IGMP_V2_LEAVE_GROUP 0x17 5625 #define IGMP_MTRACE_RESP 0x1e 5626 #define IGMP_MTRACE 0x1f 5627 #define IGMP_DELAYING_MEMBER 1 5628 #define IGMP_v1_ROUTER 1 5629 #define IGMP_MAX_HOST_REPORT_DELAY 10 5630 #define IGMP_TIMER_SCALE 10 5631 #define IGMP_IDLE_MEMBER 2 5632 #define IGMP_v2_ROUTER 2 5633 #define IGMP_LAZY_MEMBER 3 5634 #define IGMP_SLEEPING_MEMBER 4 5635 #define IGMP_AWAKENING_MEMBER 5 5636 #define IGMP_MINLEN 8 5637 #define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY 5638 #define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT 5639 #define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP 5640 #define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT 5641 5642 struct igmp { 5643 u_int8_t igmp_type; 5644 u_int8_t igmp_code; 5645 u_int16_t igmp_cksum; 5646 struct in_addr igmp_group; 5647 }; 5648 __________________________________________________________ 5649 5650 13.4.28. netinet/in.h 5651 5652 #define IPPROTO_IP 0 5653 #define IPPROTO_ICMP 1 5654 #define IPPROTO_UDP 17 5655 #define IPPROTO_IGMP 2 5656 #define IPPROTO_RAW 255 5657 #define IPPROTO_IPV6 41 5658 #define IPPROTO_ICMPV6 58 5659 #define IPPROTO_TCP 6 5660 5661 typedef uint16_t in_port_t; 5662 5663 struct in_addr { 5664 uint32_t s_addr; 5665 }; 5666 typedef uint32_t in_addr_t; 5667 5668 #define INADDR_NONE ((in_addr_t) 0xffffffff) 5669 #define INADDR_BROADCAST (0xffffffff) 5670 #define INADDR_ANY 0 5671 #define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */ 5672 5673 #define s6_addr16 in6_u.u6_addr16 5674 #define s6_addr32 in6_u.u6_addr32 5675 #define s6_addr in6_u.u6_addr8 5676 5677 struct in6_addr { 5678 union { 5679 uint8_t u6_addr8[16]; 5680 uint16_t u6_addr16[8]; 5681 uint32_t u6_addr32[4]; 5682 } in6_u; 5683 }; 5684 5685 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }} } 5686 #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }} } 5687 5688 #define IN_MULTICAST(a) ((((in_addr_t)(a))&0xf0000000)==0xe0000000) 5689 #define INET_ADDRSTRLEN 16 5690 5691 struct sockaddr_in { 5692 sa_family_t sin_family; 5693 unsigned short sin_port; 5694 struct in_addr sin_addr; 5695 unsigned char sin_zero[8]; 5696 }; 5697 5698 #define IN6_IS_ADDR_LINKLOCAL(a) ((((const uint32_t *) (a))[0] &htonl (0xffc00000)) == htonl (0xfe800000)) 5699 #define IN6_IS_ADDR_SITELOCAL(a) ((((const uint32_t *) (a))[0] &htonl (0xffc00000)) == htonl (0xfec00000)) 5700 #define IN6_ARE_ADDR_EQUAL(a,b) ((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3])) 5701 #define IN6_IS_ADDR_V4COMPAT(a) ((((const uint32_t *) (a))[0] == 0) && (((const uint32_t *) (a))[1] == 0) && (((const uint32_t *) (a))[2] == 0) && (ntohl (((const uint32_t *) (a))[3]) > 1)) 5702 #define IN6_IS_ADDR_V4MAPPED(a) ((((const uint32_t *) (a))[0] == 0) && (((const uint32_t *) (a))[1] == 0) && (((const uint32_t *) (a))[2] == htonl (0xffff))) 5703 #define IN6_IS_ADDR_UNSPECIFIED(a) (((const uint32_t *) (a))[0] ==0 && ((const uint32_t *) (a))[1] == 0 && ((const uint32_t *) (a))[2] == 0 && ((const uint32_t *) (a))[3] == 0) 5704 #define IN6_IS_ADDR_LOOPBACK(a) (((const uint32_t *) (a))[0] == 0 && ((const uint32_t *) (a))[1] == 0 && ((const uint32_t *) (a))[2] == 0 && ((const uint32_t *) (a))[3] == htonl (1)) 5705 #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) 5706 #define IN6_IS_ADDR_MC_NODELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x1)) 5707 #define IN6_IS_ADDR_MC_LINKLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x2)) 5708 #define IN6_IS_ADDR_MC_SITELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x5)) 5709 #define IN6_IS_ADDR_MC_ORGLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x8)) 5710 #define IN6_IS_ADDR_MC_GLOBAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0xe)) 5711 #define INET6_ADDRSTRLEN 46 5712 5713 struct sockaddr_in6 { 5714 unsigned short sin6_family; /* AF_INET6 */ 5715 uint16_t sin6_port; /* Transport layer port # */ 5716 uint32_t sin6_flowinfo; /* IPv6 flow information */ 5717 struct in6_addr sin6_addr; /* IPv6 address */ 5718 uint32_t sin6_scope_id; /* scope id (new in RFC2553) */ 5719 }; 5720 5721 #define SOL_IP 0 5722 #define IP_TOS 1 /* IP type of service and precedence */ 5723 #define IPV6_UNICAST_HOPS 16 5724 #define IPV6_MULTICAST_IF 17 5725 #define IPV6_MULTICAST_HOPS 18 5726 #define IPV6_MULTICAST_LOOP 19 5727 #define IP_TTL 2 /* IP time to live */ 5728 #define IPV6_JOIN_GROUP 20 5729 #define IPV6_LEAVE_GROUP 21 5730 #define IPV6_V6ONLY 26 5731 #define IP_MULTICAST_IF 32 /* set/get IP multicast i/f */ 5732 #define IP_MULTICAST_TTL 33 /* set/get IP multicast ttl */ 5733 #define IP_MULTICAST_LOOP 34 /* set/get IP multicast loopback */ 5734 #define IP_ADD_MEMBERSHIP 35 /* add an IP group membership */ 5735 #define IP_DROP_MEMBERSHIP 36 /* drop an IP group membership */ 5736 #define IP_OPTIONS 4 /* IP per-packet options */ 5737 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP 5738 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP 5739 5740 struct ipv6_mreq { 5741 struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address of group */ 5742 int ipv6mr_interface; /* local IPv6 address of interface */ 5743 }; 5744 struct ip_mreq { 5745 struct in_addr imr_multiaddr; /* IP multicast address of group */ 5746 struct in_addr imr_interface; /* local IP address of interface */ 5747 }; 5748 extern int bindresvport(int, struct sockaddr_in *); 5749 extern const struct in6_addr in6addr_any; 5750 extern const struct in6_addr in6addr_loopback; 5751 __________________________________________________________ 5752 5753 13.4.29. netinet/in_systm.h 5754 5755 typedef u_int16_t n_short; 5756 typedef u_int32_t n_long; 5757 typedef u_int32_t n_time; 5758 __________________________________________________________ 5759 5760 13.4.30. netinet/ip.h 5761 5762 #define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) 5763 #define IPOPT_COPIED(o) ((o) & IPOPT_COPY) 5764 #define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) 5765 #define IPOPT_EOL 0 5766 #define IPOPT_OPTVAL 0 5767 #define IPOPT_TS_TSONLY 0 5768 #define IPOPT_CONTROL 0x00 5769 #define IPOPT_SECUR_UNCLASS 0x0000 5770 #define IPOPT_NUMBER_MASK 0x1f 5771 #define IP_OFFMASK 0x1fff 5772 #define IPOPT_RESERVED1 0x20 5773 #define IP_MF 0x2000 5774 #define IPOPT_DEBMEAS 0x40 5775 #define IP_DF 0x4000 5776 #define IPOPT_CLASS_MASK 0x60 5777 #define IPOPT_RESERVED2 0x60 5778 #define IPOPT_SECUR_TOPSECRET 0x6bc5 5779 #define IPOPT_SECUR_EFTO 0x789a 5780 #define IPOPT_COPY 0x80 5781 #define IP_RF 0x8000 5782 #define IPOPT_SECUR_RESTR 0xaf13 5783 #define IPOPT_SECUR_MMMM 0xbc4d 5784 #define IPOPT_SECUR_SECRET 0xd788 5785 #define IPOPT_SECUR_CONFID 0xf135 5786 #define IPOPT_NOP 1 5787 #define IPOPT_OLEN 1 5788 #define IPOPT_TS_TSANDADDR 1 5789 #define IPTTLDEC 1 5790 #define IPOPT_SECURITY 130 5791 #define IPOPT_LSRR 131 5792 #define IPOPT_SATID 136 5793 #define IPOPT_SSRR 137 5794 #define IPOPT_RA 148 5795 #define IPOPT_OFFSET 2 5796 #define MAXTTL 255 5797 #define IPOPT_TS_PRESPEC 3 5798 #define IPOPT_MINOFF 4 5799 #define IPVERSION 4 5800 #define MAX_IPOPTLEN 40 5801 #define IP_MSS 576 5802 #define IPFRAGTTL 60 5803 #define IPDEFTTL 64 5804 #define IP_MAXPACKET 65535 5805 #define IPOPT_TS 68 5806 #define IPOPT_RR 7 5807 #define IPOPT_MEASUREMENT IPOPT_DEBMEAS 5808 #define IPOPT_END IPOPT_EOL 5809 #define IPOPT_NOOP IPOPT_NOP 5810 #define IPOPT_SID IPOPT_SATID 5811 #define IPOPT_SEC IPOPT_SECURITY 5812 #define IPOPT_TIMESTAMP IPOPT_TS 5813 5814 #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) 5815 #define IPTOS_LOWCOST 0x02 5816 #define IPTOS_RELIABILITY 0x04 5817 #define IPTOS_THROUGHPUT 0x08 5818 #define IPTOS_LOWDELAY 0x10 5819 #define IPTOS_TOS_MASK 0x1e 5820 #define IPTOS_MINCOST IPTOS_LOWCOST 5821 5822 #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) 5823 #define IPTOS_PREC_MASK 0xe0 5824 __________________________________________________________ 5825 5826 13.4.31. netinet/ip6.h 5827 5828 #define IP6OPT_TYPE(o) ((o) & 0xc0) 5829 #define IP6OPT_PAD1 0 5830 #define IP6OPT_TYPE_SKIP 0x00 5831 #define IP6OPT_TUNNEL_LIMIT 0x04 5832 #define IP6OPT_ROUTER_ALERT 0x05 5833 #define IP6OPT_TYPE_MUTABLE 0x20 5834 #define IP6OPT_TYPE_DISCARD 0x40 5835 #define IP6OPT_TYPE_FORCEICMP 0x80 5836 #define IP6OPT_TYPE_ICMP 0xc0 5837 #define IP6OPT_JUMBO 0xc2 5838 #define IP6OPT_NSAP_ADDR 0xc3 5839 #define IP6OPT_PADN 1 5840 #define IP6OPT_JUMBO_LEN 6 5841 #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow 5842 #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim 5843 #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim 5844 #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt 5845 #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen 5846 #define ip6_vfc ip6_ctlun.ip6_un2_vfc 5847 5848 struct ip6_hdrctl { 5849 uint32_t ip6_un1_flow; 5850 uint16_t ip6_un1_plen; 5851 uint8_t ip6_un1_nxt; 5852 uint8_t ip6_un1_hlim; 5853 }; 5854 struct ip6_hdr { 5855 struct in6_addr ip6_src; 5856 struct in6_addr ip6_dst; 5857 }; 5858 struct ip6_ext { 5859 uint8_t ip6e_nxt; 5860 uint8_t ip6e_len; 5861 }; 5862 struct ip6_hbh { 5863 uint8_t ip6h_nxt; 5864 uint8_t ip6h_len; 5865 }; 5866 struct ip6_dest { 5867 uint8_t ip6d_nxt; 5868 uint8_t ip6d_len; 5869 }; 5870 struct ip6_rthdr { 5871 uint8_t ip6r_nxt; 5872 uint8_t ip6r_len; 5873 uint8_t ip6r_type; 5874 uint8_t ip6r_segleft; 5875 }; 5876 struct ip6_frag { 5877 uint8_t ip6f_nxt; 5878 uint8_t ip6f_reserved; 5879 uint16_t ip6f_offlg; 5880 uint32_t ip6f_ident; 5881 }; 5882 struct ip6_opt { 5883 uint8_t ip6o_type; 5884 uint8_t ip6o_len; 5885 }; 5886 struct ip6_opt_jumbo { 5887 uint8_t ip6oj_type; 5888 uint8_t ip6oj_len; 5889 uint8_t ip6oj_jumbo_len[4]; 5890 }; 5891 struct ip6_opt_nsap { 5892 uint8_t ip6on_type; 5893 uint8_t ip6on_len; 5894 uint8_t ip6on_src_nsap_len; 5895 uint8_t ip6on_dst_nsap_len; 5896 }; 5897 struct ip6_opt_tunnel { 5898 uint8_t ip6ot_type; 5899 uint8_t ip6ot_len; 5900 uint8_t ip6ot_encap_limit; 5901 }; 5902 struct ip6_opt_router { 5903 uint8_t ip6or_type; 5904 uint8_t ip6or_len; 5905 uint8_t ip6or_value[2]; 5906 }; 5907 __________________________________________________________ 5908 5909 13.4.32. netinet/ip_icmp.h 5910 5911 #define ICMP_INFOTYPE(type) ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) 5912 #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) 5913 #define ICMP_TSLEN (8 + 3 * sizeof (n_time)) 5914 #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) 5915 #define ICMP_ECHOREPLY 0 5916 #define ICMP_EXC_TTL 0 5917 #define ICMP_NET_UNREACH 0 5918 #define ICMP_REDIRECT_NET 0 5919 #define ICMP_REDIR_NET 0 5920 #define ICMP_TIMXCEED_INTRANS 0 5921 #define ICMP_UNREACH_NET 0 5922 #define ICMP_EXC_FRAGTIME 1 5923 #define ICMP_HOST_UNREACH 1 5924 #define ICMP_PARAMPROB_OPTABSENT 1 5925 #define ICMP_REDIRECT_HOST 1 5926 #define ICMP_REDIR_HOST 1 5927 #define ICMP_TIMXCEED_REASS 1 5928 #define ICMP_UNREACH_HOST 1 5929 #define ICMP_HOST_ANO 10 5930 #define ICMP_ROUTERSOLICIT 10 5931 #define ICMP_UNREACH_HOST_PROHIB 10 5932 #define ICMP_NET_UNR_TOS 11 5933 #define ICMP_TIME_EXCEEDED 11 5934 #define ICMP_TIMXCEED 11 5935 #define ICMP_UNREACH_TOSNET 11 5936 #define ICMP_HOST_UNR_TOS 12 5937 #define ICMP_MASKLEN 12 5938 #define ICMP_PARAMETERPROB 12 5939 #define ICMP_PARAMPROB 12 5940 #define ICMP_UNREACH_TOSHOST 12 5941 #define ICMP_PKT_FILTERED 13 5942 #define ICMP_TIMESTAMP 13 5943 #define ICMP_TSTAMP 13 5944 #define ICMP_UNREACH_FILTER_PROHIB 13 5945 #define ICMP_PREC_VIOLATION 14 5946 #define ICMP_TIMESTAMPREPLY 14 5947 #define ICMP_TSTAMPREPLY 14 5948 #define ICMP_UNREACH_HOST_PRECEDENCE 14 5949 #define ICMP_INFO_REQUEST 15 5950 #define ICMP_IREQ 15 5951 #define ICMP_PREC_CUTOFF 15 5952 #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 5953 #define NR_ICMP_UNREACH 15 5954 #define ICMP_INFO_REPLY 16 5955 #define ICMP_IREQREPLY 16 5956 #define ICMP_ADDRESS 17 5957 #define ICMP_MASKREQ 17 5958 #define ICMP_ADDRESSREPLY 18 5959 #define ICMP_MASKREPLY 18 5960 #define ICMP_MAXTYPE 18 5961 #define NR_ICMP_TYPES 18 5962 #define ICMP_PROT_UNREACH 2 5963 #define ICMP_REDIRECT_TOSNET 2 5964 #define ICMP_REDIR_NETTOS 2 5965 #define ICMP_UNREACH_PROTOCOL 2 5966 #define ICMP_DEST_UNREACH 3 5967 #define ICMP_PORT_UNREACH 3 5968 #define ICMP_REDIRECT_TOSHOST 3 5969 #define ICMP_REDIR_HOSTTOS 3 5970 #define ICMP_UNREACH 3 5971 #define ICMP_UNREACH_PORT 3 5972 #define ICMP_FRAG_NEEDED 4 5973 #define ICMP_SOURCEQUENCH 4 5974 #define ICMP_SOURCE_QUENCH 4 5975 #define ICMP_UNREACH_NEEDFRAG 4 5976 #define ICMP_REDIRECT 5 5977 #define ICMP_SR_FAILED 5 5978 #define ICMP_UNREACH_SRCFAIL 5 5979 #define ICMP_NET_UNKNOWN 6 5980 #define ICMP_UNREACH_NET_UNKNOWN 6 5981 #define ICMP_HOST_UNKNOWN 7 5982 #define ICMP_UNREACH_HOST_UNKNOWN 7 5983 #define ICMP_ECHO 8 5984 #define ICMP_HOST_ISOLATED 8 5985 #define ICMP_MINLEN 8 5986 #define ICMP_UNREACH_ISOLATED 8 5987 #define ICMP_NET_ANO 9 5988 #define ICMP_ROUTERADVERT 9 5989 #define ICMP_UNREACH_NET_PROHIB 9 5990 #define icmp_data icmp_dun.id_data 5991 #define icmp_ip icmp_dun.id_ip.idi_ip 5992 #define icmp_mask icmp_dun.id_mask 5993 #define icmp_radv icmp_dun.id_radv 5994 #define icmp_otime icmp_dun.id_ts.its_otime 5995 #define icmp_rtime icmp_dun.id_ts.its_rtime 5996 #define icmp_ttime icmp_dun.id_ts.its_ttime 5997 #define icmp_gwaddr icmp_hun.ih_gwaddr 5998 #define icmp_id icmp_hun.ih_idseq.icd_id 5999 #define icmp_seq icmp_hun.ih_idseq.icd_seq 6000 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu 6001 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void 6002 #define icmp_pptr icmp_hun.ih_pptr 6003 #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime 6004 #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs 6005 #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa 6006 #define icmp_void icmp_hun.ih_void 6007 6008 struct icmphdr { 6009 u_int8_t type; 6010 u_int8_t code; 6011 u_int16_t checksum; 6012 union { 6013 struct { 6014 u_int16_t id; 6015 u_int16_t sequence; 6016 } echo; 6017 u_int32_t gateway; 6018 struct { 6019 u_int16_t __unused; 6020 u_int16_t mtu; 6021 } frag; 6022 } un; 6023 }; 6024 struct icmp_ra_addr { 6025 u_int32_t ira_addr; 6026 u_int32_t ira_preference; 6027 }; 6028 struct ih_idseq { 6029 u_int16_t icd_id; 6030 u_int16_t icd_seq; 6031 }; 6032 struct ih_pmtu { 6033 u_int16_t ipm_void; 6034 u_int16_t ipm_nextmtu; 6035 }; 6036 struct ih_rtradv { 6037 u_int8_t irt_num_addrs; 6038 u_int8_t irt_wpa; 6039 u_int16_t irt_lifetime; 6040 }; 6041 struct icmp { 6042 u_int8_t icmp_type; 6043 u_int8_t icmp_code; 6044 u_int16_t icmp_cksum; 6045 union { 6046 u_int16_t ih_pptr; 6047 struct in_addr ih_gwaddr; 6048 struct ih_idseq ih_idseq; 6049 u_int32_t ih_void; 6050 struct ih_pmtu ih_pmtu; 6051 struct ih_rtradv ih_rtradv; 6052 } icmp_hun; 6053 union { 6054 struct { 6055 u_int32_t its_otime; 6056 u_int32_t its_rtime; 6057 u_int32_t its_ttime; 6058 } id_ts; 6059 struct { 6060 struct ip idi_ip; 6061 } id_ip; 6062 struct icmp_ra_addr id_radv; 6063 u_int32_t id_mask; 6064 u_int8_t id_data[1]; 6065 } icmp_dun; 6066 }; 6067 __________________________________________________________ 6068 6069 13.4.33. netinet/tcp.h 6070 6071 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) 6072 #define TCPOPT_TSTAMP_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) 6073 #define TCPOPT_EOL 0 6074 #define TCPI_OPT_TIMESTAMPS 1 6075 #define TCPOPT_NOP 1 6076 #define TCP_NODELAY 1 6077 #define TCPOLEN_TIMESTAMP 10 6078 #define TCP_WINDOW_CLAMP 10 6079 #define TCP_INFO 11 6080 #define TCP_QUICKACK 12 6081 #define TCP_CONGESTION 13 6082 #define TCP_MAX_WINSHIFT 14 6083 #define TCPI_OPT_SACK 2 6084 #define TCPOLEN_SACK_PERMITTED 2 6085 #define TCPOPT_MAXSEG 2 6086 #define TCP_MAXSEG 2 6087 #define TCPOLEN_WINDOW 3 6088 #define TCPOPT_WINDOW 3 6089 #define TCP_CORK 3 6090 #define TCPI_OPT_WSCALE 4 6091 #define TCPOLEN_MAXSEG 4 6092 #define TCPOPT_SACK_PERMITTED 4 6093 #define TCP_KEEPIDLE 4 6094 #define TCPOPT_SACK 5 6095 #define TCP_KEEPINTVL 5 6096 #define TCP_MSS 512 6097 #define SOL_TCP 6 6098 #define TCP_KEEPCNT 6 6099 #define TCP_MAXWIN 65535 6100 #define TCP_SYNCNT 7 6101 #define TCPI_OPT_ECN 8 6102 #define TCPOPT_TIMESTAMP 8 6103 #define TCP_LINGER2 8 6104 #define TCP_DEFER_ACCEPT 9 6105 6106 enum tcp_ca_state { 6107 TCP_CA_Open, 6108 TCP_CA_Disorder, 6109 TCP_CA_CWR, 6110 TCP_CA_Recovery, 6111 TCP_CA_Loss 6112 }; 6113 struct tcp_info { 6114 uint8_t tcpi_state; 6115 uint8_t tcpi_ca_state; 6116 uint8_t tcpi_retransmits; 6117 uint8_t tcpi_probes; 6118 uint8_t tcpi_backoff; 6119 uint8_t tcpi_options; 6120 uint8_t tcpi_snd_wscale:4; 6121 uint8_t tcpi_rcv_wscale:4; 6122 uint32_t tcpi_rto; 6123 uint32_t tcpi_ato; 6124 uint32_t tcpi_snd_mss; 6125 uint32_t tcpi_rcv_mss; 6126 uint32_t tcpi_unacked; 6127 uint32_t tcpi_sacked; 6128 uint32_t tcpi_lost; 6129 uint32_t tcpi_retrans; 6130 uint32_t tcpi_fackets; 6131 uint32_t tcpi_last_data_sent; 6132 uint32_t tcpi_last_ack_sent; 6133 uint32_t tcpi_last_data_recv; 6134 uint32_t tcpi_last_ack_recv; 6135 uint32_t tcpi_pmtu; 6136 uint32_t tcpi_rcv_ssthresh; 6137 uint32_t tcpi_rtt; 6138 uint32_t tcpi_rttvar; 6139 uint32_t tcpi_snd_ssthresh; 6140 uint32_t tcpi_snd_cwnd; 6141 uint32_t tcpi_advmss; 6142 uint32_t tcpi_reordering; 6143 }; 6144 enum { 6145 TCP_ESTABLISHED = 1, 6146 TCP_SYN_SENT = 2, 6147 TCP_SYN_RECV = 3, 6148 TCP_FIN_WAIT1 = 4, 6149 TCP_FIN_WAIT2 = 5, 6150 TCP_TIME_WAIT = 6, 6151 TCP_CLOSE = 7, 6152 TCP_CLOSE_WAIT = 8, 6153 TCP_LAST_ACK = 9, 6154 TCP_LISTEN = 10, 6155 TCP_CLOSING = 11 6156 }; 6157 __________________________________________________________ 6158 6159 13.4.34. netinet/udp.h 6160 6161 #define SOL_UDP 17 6162 6163 struct udphdr { 6164 u_int16_t source; 6165 u_int16_t dest; 6166 u_int16_t len; 6167 u_int16_t check; 6168 }; 6169 __________________________________________________________ 6170 6171 13.4.35. nl_types.h 6172 6173 #define NL_CAT_LOCALE 1 6174 #define NL_SETD 1 6175 6176 typedef void *nl_catd; 6177 6178 typedef int nl_item; 6179 extern int catclose(nl_catd __catalog); 6180 extern char *catgets(nl_catd __catalog, int __set, int __number, 6181 const char *__string); 6182 extern nl_catd catopen(const char *__cat_name, int __flag); 6183 __________________________________________________________ 6184 6185 13.4.36. poll.h 6186 6187 extern int poll(struct pollfd *__fds, nfds_t __nfds, int __timeout); 6188 __________________________________________________________ 6189 6190 13.4.37. pty.h 6191 6192 extern int forkpty(int *__amaster, char *__name, struct termios *__termp, 6193 struct winsize *__winp); 6194 extern int openpty(int *__amaster, int *__aslave, char *__name, 6195 struct termios *__termp, struct winsize *__winp); 6196 __________________________________________________________ 6197 6198 13.4.38. pwd.h 6199 6200 struct passwd { 6201 char *pw_name; 6202 char *pw_passwd; 6203 uid_t pw_uid; 6204 gid_t pw_gid; 6205 char *pw_gecos; 6206 char *pw_dir; 6207 char *pw_shell; 6208 }; 6209 extern void endpwent(void); 6210 extern struct passwd *getpwent(void); 6211 extern int getpwent_r(struct passwd *__resultbuf, char *__buffer, 6212 size_t __buflen, struct passwd **__result); 6213 extern struct passwd *getpwnam(const char *__name); 6214 extern int getpwnam_r(const char *__name, struct passwd *__resultbuf, 6215 char *__buffer, size_t __buflen, 6216 struct passwd **__result); 6217 extern struct passwd *getpwuid(uid_t __uid); 6218 extern int getpwuid_r(uid_t __uid, struct passwd *__resultbuf, 6219 char *__buffer, size_t __buflen, 6220 struct passwd **__result); 6221 extern void setpwent(void); 6222 __________________________________________________________ 6223 6224 13.4.39. regex.h 6225 6226 #define RE_DUP_MAX (0x7fff) 6227 6228 typedef unsigned long int reg_syntax_t; 6229 6230 typedef struct re_pattern_buffer { 6231 unsigned char *buffer; 6232 unsigned long int allocated; 6233 unsigned long int used; 6234 reg_syntax_t syntax; 6235 char *fastmap; 6236 char *translate; 6237 size_t re_nsub; 6238 unsigned int can_be_null:1; 6239 unsigned int regs_allocated:2; 6240 unsigned int fastmap_accurate:1; 6241 unsigned int no_sub:1; 6242 unsigned int not_bol:1; 6243 unsigned int not_eol:1; 6244 unsigned int newline_anchor:1; 6245 } regex_t; 6246 typedef int regoff_t; 6247 typedef struct { 6248 regoff_t rm_so; 6249 regoff_t rm_eo; 6250 } regmatch_t; 6251 6252 #define REG_ICASE (REG_EXTENDED<<1) 6253 #define REG_NEWLINE (REG_ICASE<<1) 6254 #define REG_NOSUB (REG_NEWLINE<<1) 6255 #define REG_EXTENDED 1 6256 6257 #define REG_NOTEOL (1<<1) 6258 #define REG_NOTBOL 1 6259 6260 typedef enum { 6261 REG_ENOSYS = -1, 6262 REG_NOERROR = 0, 6263 REG_NOMATCH = 1, 6264 REG_BADPAT = 2, 6265 REG_ECOLLATE = 3, 6266 REG_ECTYPE = 4, 6267 REG_EESCAPE = 5, 6268 REG_ESUBREG = 6, 6269 REG_EBRACK = 7, 6270 REG_EPAREN = 8, 6271 REG_EBRACE = 9, 6272 REG_BADBR = 10, 6273 REG_ERANGE = 11, 6274 REG_ESPACE = 12, 6275 REG_BADRPT = 13, 6276 REG_EEND = 14, 6277 REG_ESIZE = 15, 6278 REG_ERPAREN = 16 6279 } reg_errcode_t; 6280 extern int regcomp(regex_t * __preg, const char *__pattern, int __cflags); 6281 extern size_t regerror(int __errcode, const regex_t * __preg, 6282 char *__errbuf, size_t __errbuf_size); 6283 extern int regexec(const regex_t * __preg, const char *__string, 6284 size_t __nmatch, regmatch_t __pmatch[], int __eflags); 6285 extern void regfree(regex_t * __preg); 6286 __________________________________________________________ 6287 6288 13.4.40. rpc/auth.h 6289 6290 #define auth_destroy(auth) ((*((auth)->ah_ops->ah_destroy))(auth)) 6291 6292 enum auth_stat { 6293 AUTH_OK = 0, 6294 AUTH_BADCRED = 1, /* bogus credentials (seal broken) */ 6295 AUTH_REJECTEDCRED = 2, /* client should begin new session */ 6296 AUTH_BADVERF = 3, /* bogus verifier (seal broken) */ 6297 AUTH_REJECTEDVERF = 4, /* verifier expired or was replayed */ 6298 AUTH_TOOWEAK = 5, /* Rpc calls return an enum clnt_stat. */ 6299 AUTH_INVALIDRESP = 6, /* bogus response verifier */ 6300 AUTH_FAILED = 7 /* some unknown reason */ 6301 }; 6302 6303 union des_block { 6304 struct { 6305 u_int32_t high; 6306 u_int32_t low; 6307 } key; 6308 char c[8]; 6309 }; 6310 6311 struct opaque_auth { 6312 enum_t oa_flavor; /* flavor of auth */ 6313 caddr_t oa_base; /* address of more auth stuff */ 6314 u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ 6315 }; 6316 6317 typedef struct AUTH { 6318 struct opaque_auth ah_cred; 6319 struct opaque_auth ah_verf; 6320 union des_block ah_key; 6321 struct auth_ops *ah_ops; 6322 caddr_t ah_private; 6323 } AUTH; 6324 6325 struct auth_ops { 6326 void (*ah_nextverf) (struct AUTH *); 6327 int (*ah_marshal) (struct AUTH *, XDR *); /* nextverf & serialize*/ 6328 int (*ah_validate) (struct AUTH *, struct opaque_auth *); /* validate verifier */ 6329 int (*ah_refresh) (struct AUTH *); /* refresh credentials */ 6330 void (*ah_destroy) (struct AUTH *); /* Rpc calls return an enum clnt_stat. */ 6331 }; 6332 extern struct AUTH *authnone_create(void); 6333 extern int key_decryptsession(char *, union des_block *); 6334 extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); 6335 __________________________________________________________ 6336 6337 13.4.41. rpc/clnt.h 6338 6339 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 6340 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 6341 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 6342 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 6343 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 6344 #define NULLPROC ((u_long)0) /* By convention, procedure 0 takes null arguments and returns */ 6345 #define CLSET_TIMEOUT 1 /* set timeout (timeval) */ 6346 #define CLGET_XID 10 /* Get xid */ 6347 #define CLSET_XID 11 /* Set xid */ 6348 #define CLGET_VERS 12 /* Get version number */ 6349 #define CLSET_VERS 13 /* Set version number */ 6350 #define CLGET_PROG 14 /* Get program number */ 6351 #define CLSET_PROG 15 /* Set program number */ 6352 #define CLGET_TIMEOUT 2 /* get timeout (timeval) */ 6353 #define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ 6354 #define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ 6355 #define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ 6356 #define CLGET_FD 6 /* get connections file descriptor */ 6357 #define CLGET_SVC_ADDR 7 /* get server's address (netbuf) */ 6358 #define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */ 6359 #define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy */ 6360 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 6361 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 6362 6363 enum clnt_stat { 6364 RPC_SUCCESS = 0, /* call succeeded */ 6365 RPC_CANTENCODEARGS = 1, /* can't encode arguments */ 6366 RPC_CANTDECODERES = 2, /* can't decode results */ 6367 RPC_CANTSEND = 3, /* failure in sending call */ 6368 RPC_CANTRECV = 4, /* failure in receiving result */ 6369 RPC_TIMEDOUT = 5, /* call timed out */ 6370 RPC_VERSMISMATCH = 6, /* rpc versions not compatible */ 6371 RPC_AUTHERROR = 7, /* authentication error */ 6372 RPC_PROGUNAVAIL = 8, /* program not available */ 6373 RPC_PROGVERSMISMATCH = 9, /* program version mismatched */ 6374 RPC_PROCUNAVAIL = 10, /* procedure unavailable */ 6375 RPC_CANTDECODEARGS = 11, /* decode arguments error */ 6376 RPC_SYSTEMERROR = 12, /* generic "other problem" */ 6377 RPC_NOBROADCAST = 21, /* Broadcasting not supported */ 6378 RPC_UNKNOWNHOST = 13, /* unknown host name */ 6379 RPC_UNKNOWNPROTO = 17, /* unknown protocol */ 6380 RPC_UNKNOWNADDR = 19, /* Remote address unknown */ 6381 RPC_RPCBFAILURE = 14, /* portmapper failed in its call */ 6382 RPC_PROGNOTREGISTERED = 15, /* remote program is not registered */ 6383 RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */ 6384 RPC_FAILED = 16, 6385 RPC_INTR = 18, 6386 RPC_TLIERROR = 20, 6387 RPC_UDERROR = 23, 6388 RPC_INPROGRESS = 24, 6389 RPC_STALERACHANDLE = 25 6390 }; 6391 struct rpc_err { 6392 enum clnt_stat re_status; 6393 union { 6394 int RE_errno; 6395 enum auth_stat RE_why; 6396 struct { 6397 u_long low; 6398 u_long high; 6399 } RE_vers; 6400 struct { 6401 long int s1; 6402 long int s2; 6403 } RE_lb; 6404 } ru; 6405 }; 6406 6407 typedef struct CLIENT { 6408 struct AUTH *cl_auth; 6409 struct clnt_ops *cl_ops; 6410 caddr_t cl_private; 6411 } CLIENT; 6412 6413 struct clnt_ops { 6414 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 6415 xdrproc_t, caddr_t, struct timeval); 6416 void (*cl_abort) (void); 6417 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 6418 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 6419 void (*cl_destroy) (struct CLIENT *); 6420 bool_t(*cl_control) (struct CLIENT *, int, char *); 6421 }; 6422 extern int callrpc(const char *__host, const u_long __prognum, 6423 const u_long __versnum, const u_long __procnum, 6424 const xdrproc_t __inproc, const char *__in, 6425 const xdrproc_t __outproc, char *__out); 6426 extern struct CLIENT *clnt_create(const char *__host, const u_long __prog, 6427 const u_long __vers, const char *__prot); 6428 extern void clnt_pcreateerror(const char *__msg); 6429 extern void clnt_perrno(enum clnt_stat __num); 6430 extern void clnt_perror(struct CLIENT *__clnt, const char *__msg); 6431 extern char *clnt_spcreateerror(const char *__msg); 6432 extern char *clnt_sperrno(enum clnt_stat __num); 6433 extern char *clnt_sperror(struct CLIENT *__clnt, const char *__msg); 6434 extern struct CLIENT *clntraw_create(u_long __prog, u_long __vers); 6435 extern struct CLIENT *clnttcp_create(struct sockaddr_in *__raddr, 6436 u_long __prog, u_long __version, 6437 int *__sockp, u_int __sendsz, 6438 u_int __recvsz); 6439 extern struct CLIENT *clntudp_bufcreate(struct sockaddr_in *__raddr, 6440 u_long __program, u_long __version, 6441 struct timeval __wait_resend, 6442 int *__sockp, u_int __sendsz, 6443 u_int __recvsz); 6444 extern struct CLIENT *clntudp_create(struct sockaddr_in *__raddr, 6445 u_long __program, u_long __version, 6446 struct timeval __wait_resend, 6447 int *__sockp); 6448 __________________________________________________________ 6449 6450 13.4.42. rpc/pmap_clnt.h 6451 6452 extern u_short pmap_getport(struct sockaddr_in *__address, 6453 const u_long __program, const u_long __version, 6454 u_int __protocol); 6455 extern bool_t pmap_set(const u_long __program, const u_long __vers, 6456 int __protocol, u_short __port); 6457 extern bool_t pmap_unset(u_long __program, u_long __vers); 6458 __________________________________________________________ 6459 6460 13.4.43. rpc/rpc_msg.h 6461 6462 enum msg_type { 6463 CALL = 0, 6464 REPLY = 1 6465 }; 6466 enum reply_stat { 6467 MSG_ACCEPTED = 0, 6468 MSG_DENIED = 1 6469 }; 6470 enum accept_stat { 6471 SUCCESS = 0, 6472 PROG_UNAVAIL = 1, 6473 PROG_MISMATCH = 2, 6474 PROC_UNAVAIL = 3, 6475 GARBAGE_ARGS = 4, 6476 SYSTEM_ERR = 5 6477 }; 6478 enum reject_stat { 6479 RPC_MISMATCH = 0, 6480 AUTH_ERROR = 1 6481 }; 6482 6483 #define ar_results ru.AR_results 6484 #define ar_vers ru.AR_versions 6485 6486 struct accepted_reply { 6487 struct opaque_auth ar_verf; 6488 enum accept_stat ar_stat; 6489 union { 6490 struct { 6491 unsigned long int low; 6492 unsigned long int high; 6493 } AR_versions; 6494 struct { 6495 caddr_t where; 6496 xdrproc_t proc; 6497 } AR_results; 6498 } ru; 6499 }; 6500 6501 #define rj_vers ru.RJ_versions 6502 #define rj_why ru.RJ_why 6503 6504 struct rejected_reply { 6505 enum reject_stat rj_stat; 6506 union { 6507 struct { 6508 unsigned long int low; 6509 unsigned long int high; 6510 } RJ_versions; 6511 enum auth_stat RJ_why; /* why authentication did not work */ 6512 } ru; 6513 }; 6514 6515 #define rp_acpt ru.RP_ar 6516 #define rp_rjct ru.RP_dr 6517 6518 struct reply_body { 6519 enum reply_stat rp_stat; 6520 union { 6521 struct accepted_reply RP_ar; 6522 struct rejected_reply RP_dr; 6523 } ru; 6524 }; 6525 6526 struct call_body { 6527 unsigned long int cb_rpcvers; /* must be equal to two */ 6528 unsigned long int cb_prog; 6529 unsigned long int cb_vers; 6530 unsigned long int cb_proc; 6531 struct opaque_auth cb_cred; 6532 struct opaque_auth cb_verf; /* protocol specific - provided by client */ 6533 }; 6534 6535 #define rm_call ru.RM_cmb 6536 #define rm_reply ru.RM_rmb 6537 #define acpted_rply ru.RM_rmb.ru.RP_ar 6538 #define rjcted_rply ru.RM_rmb.ru.RP_dr 6539 6540 struct rpc_msg { 6541 unsigned long int rm_xid; 6542 enum msg_type rm_direction; 6543 union { 6544 struct call_body RM_cmb; 6545 struct reply_body RM_rmb; 6546 } ru; 6547 }; 6548 extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); 6549 extern bool_t xdr_callhdr(XDR * __xdrs, struct rpc_msg *__cmsg); 6550 extern bool_t xdr_callmsg(XDR * __xdrs, struct rpc_msg *__cmsg); 6551 extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); 6552 extern bool_t xdr_replymsg(XDR * __xdrs, struct rpc_msg *__rmsg); 6553 __________________________________________________________ 6554 6555 13.4.44. rpc/svc.h 6556 6557 #define svc_getcaller(x) (&(x)->xp_raddr) 6558 #define svc_destroy(xprt) (*(xprt)->xp_ops->xp_destroy)(xprt) 6559 #define svc_recv(xprt,msg) (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) 6560 #define svc_reply(xprt,msg) (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) 6561 #define svc_stat(xprt) (*(xprt)->xp_ops->xp_stat)(xprt) 6562 #define RPC_ANYSOCK -1 6563 #define svc_freeargs(xprt,xargs, argsp) \ 6564 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 6565 #define svc_getargs(xprt,xargs, argsp) \ 6566 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 6567 6568 enum xprt_stat { 6569 XPRT_DIED, 6570 XPRT_MOREREQS, 6571 XPRT_IDLE 6572 }; 6573 6574 typedef struct SVCXPRT { 6575 int xp_sock; 6576 u_short xp_port; 6577 struct xp_ops *xp_ops; 6578 int xp_addrlen; 6579 struct sockaddr_in xp_raddr; 6580 struct opaque_auth xp_verf; 6581 caddr_t xp_p1; 6582 caddr_t xp_p2; 6583 char xp_pad[256]; 6584 } SVCXPRT; 6585 6586 struct svc_req { 6587 rpcprog_t rq_prog; 6588 rpcvers_t rq_vers; 6589 rpcproc_t rq_proc; 6590 struct opaque_auth rq_cred; 6591 caddr_t rq_clntcred; 6592 SVCXPRT *rq_xprt; 6593 }; 6594 6595 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 6596 6597 struct xp_ops { 6598 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 6599 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 6600 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 6601 caddr_t args_ptr); 6602 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 6603 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 6604 caddr_t args_ptr); 6605 void (*xp_destroy) (SVCXPRT * __xprt); 6606 }; 6607 extern void svc_getreqset(fd_set * __readfds); 6608 extern bool_t svc_register(SVCXPRT * __xprt, rpcprog_t __prog, 6609 rpcvers_t __vers, __dispatch_fn_t __dispatch, 6610 rpcprot_t __protocol); 6611 extern void svc_run(void); 6612 extern bool_t svc_sendreply(SVCXPRT * xprt, xdrproc_t __xdr_results, 6613 caddr_t __xdr_location); 6614 extern void svcerr_auth(SVCXPRT * __xprt, enum auth_stat __why); 6615 extern void svcerr_decode(SVCXPRT * __xprt); 6616 extern void svcerr_noproc(SVCXPRT * __xprt); 6617 extern void svcerr_noprog(SVCXPRT * __xprt); 6618 extern void svcerr_progvers(SVCXPRT * __xprt, rpcvers_t __low_vers, 6619 rpcvers_t __high_vers); 6620 extern void svcerr_systemerr(SVCXPRT * __xprt); 6621 extern void svcerr_weakauth(SVCXPRT * __xprt); 6622 extern SVCXPRT *svcraw_create(void); 6623 extern SVCXPRT *svctcp_create(int __sock, u_int __sendsize, 6624 u_int __recvsize); 6625 extern SVCXPRT *svcudp_create(int __sock); 6626 __________________________________________________________ 6627 6628 13.4.45. rpc/types.h 6629 6630 typedef int bool_t; 6631 typedef int enum_t; 6632 typedef unsigned long int rpcprog_t; 6633 typedef unsigned long int rpcvers_t; 6634 typedef unsigned long int rpcproc_t; 6635 typedef unsigned long int rpcprot_t; 6636 __________________________________________________________ 6637 6638 13.4.46. rpc/xdr.h 6639 6640 #define XDR_DESTROY(xdrs) \ 6641 do { if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ 6642 } while (0) 6643 #define xdr_destroy(xdrs) \ 6644 do { if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ 6645 } while (0) 6646 #define XDR_GETBYTES(xdrs,addr,len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) 6647 #define xdr_getbytes(xdrs,addr,len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) 6648 #define XDR_GETINT32(xdrs,int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) 6649 #define xdr_getint32(xdrs,int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) 6650 #define XDR_GETLONG(xdrs,longp) (*(xdrs)->x_ops->x_getlong)(xdrs, longp) 6651 #define xdr_getlong(xdrs,longp) (*(xdrs)->x_ops->x_getlong)(xdrs, longp) 6652 #define XDR_GETPOS(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) 6653 #define xdr_getpos(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) 6654 #define XDR_INLINE(xdrs,len) (*(xdrs)->x_ops->x_inline)(xdrs, len) 6655 #define xdr_inline(xdrs,len) (*(xdrs)->x_ops->x_inline)(xdrs, len) 6656 #define XDR_PUTBYTES(xdrs,addr,len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) 6657 #define xdr_putbytes(xdrs,addr,len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) 6658 #define XDR_PUTINT32(xdrs,int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) 6659 #define xdr_putint32(xdrs,int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) 6660 #define XDR_PUTLONG(xdrs,longp) (*(xdrs)->x_ops->x_putlong)(xdrs, longp) 6661 #define xdr_putlong(xdrs,longp) (*(xdrs)->x_ops->x_putlong)(xdrs, longp) 6662 #define XDR_SETPOS(xdrs,pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) 6663 #define xdr_setpos(xdrs,pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) 6664 6665 enum xdr_op { 6666 XDR_ENCODE, 6667 XDR_DECODE, 6668 XDR_FREE 6669 }; 6670 typedef struct XDR { 6671 enum xdr_op x_op; 6672 struct xdr_ops *x_ops; 6673 caddr_t x_public; 6674 caddr_t x_private; 6675 caddr_t x_base; 6676 int x_handy; 6677 } XDR; 6678 6679 struct xdr_ops { 6680 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 6681 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 6682 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 6683 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 6684 u_int(*x_getpostn) (XDR * __xdrs); 6685 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 6686 int32_t *(*x_inline) (XDR * __xdrs, int __len); 6687 void (*x_destroy) (XDR * __xdrs); 6688 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 6689 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 6690 }; 6691 6692 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 6693 6694 struct xdr_discrim { 6695 int value; 6696 xdrproc_t proc; 6697 }; 6698 extern bool_t xdr_array(XDR * _xdrs, caddr_t * __addrp, u_int * __sizep, 6699 u_int __maxsize, u_int __elsize, 6700 xdrproc_t __elproc); 6701 extern bool_t xdr_bool(XDR * __xdrs, bool_t * __bp); 6702 extern bool_t xdr_bytes(XDR * __xdrs, char **__cpp, u_int * __sizep, 6703 u_int __maxsize); 6704 extern bool_t xdr_char(XDR * __xdrs, char *__cp); 6705 extern bool_t xdr_double(XDR * __xdrs, double *__dp); 6706 extern bool_t xdr_enum(XDR * __xdrs, enum_t * __ep); 6707 extern bool_t xdr_float(XDR * __xdrs, float *__fp); 6708 extern void xdr_free(xdrproc_t __proc, char *__objp); 6709 extern bool_t xdr_int(XDR * __xdrs, int *__ip); 6710 extern bool_t xdr_long(XDR * __xdrs, long int *__lp); 6711 extern bool_t xdr_opaque(XDR * __xdrs, caddr_t __cp, u_int __cnt); 6712 extern bool_t xdr_pointer(XDR * __xdrs, char **__objpp, u_int __obj_size, 6713 xdrproc_t __xdr_obj); 6714 extern bool_t xdr_reference(XDR * __xdrs, caddr_t * __xpp, u_int __size, 6715 xdrproc_t __proc); 6716 extern bool_t xdr_short(XDR * __xdrs, short *__sp); 6717 extern bool_t xdr_string(XDR * __xdrs, char **__cpp, u_int __maxsize); 6718 extern bool_t xdr_u_char(XDR * __xdrs, u_char * __cp); 6719 extern bool_t xdr_u_int(XDR * __xdrs, u_int * __up); 6720 extern bool_t xdr_u_long(XDR * __xdrs, u_long * __ulp); 6721 extern bool_t xdr_u_short(XDR * __xdrs, u_short * __usp); 6722 extern bool_t xdr_union(XDR * __xdrs, enum_t * __dscmp, char *__unp, 6723 const struct xdr_discrim *__choices, 6724 xdrproc_t dfault); 6725 extern bool_t xdr_vector(XDR * __xdrs, char *__basep, u_int __nelem, 6726 u_int __elemsize, xdrproc_t __xdr_elem); 6727 extern bool_t xdr_void(void); 6728 extern bool_t xdr_wrapstring(XDR * __xdrs, char **__cpp); 6729 extern void xdrmem_create(XDR * __xdrs, caddr_t __addr, u_int __size, 6730 enum xdr_op __xop); 6731 extern void xdrrec_create(XDR * __xdrs, u_int __sendsize, u_int __recvsize, 6732 caddr_t __tcp_handle, int (*__readit) (char *, 6733 char *, 6734 int), 6735 int (*__writeit) (char *, char *, int)); 6736 extern bool_t xdrrec_endofrecord(XDR * __xdrs, bool_t __sendnow); 6737 extern bool_t xdrrec_eof(XDR * __xdrs); 6738 extern bool_t xdrrec_skiprecord(XDR * __xdrs); 6739 extern void xdrstdio_create(XDR * __xdrs, FILE * __file, 6740 enum xdr_op __xop); 6741 __________________________________________________________ 6742 6743 13.4.47. sched.h 6744 6745 #define __CPUELT(cpu) ((cpu) / __NCPUBITS) 6746 #define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) 6747 #define __NCPUBITS (8 * sizeof (__cpu_mask)) 6748 #define SCHED_OTHER 0 6749 #define SCHED_FIFO 1 6750 #define __CPU_SETSIZE 1024 6751 #define SCHED_RR 2 6752 #define CPU_ALLOC(count) __CPU_ALLOC (count) 6753 #define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) 6754 #define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) 6755 #define CPU_FREE(cpuset) __CPU_FREE (cpuset) 6756 #define CPU_SETSIZE __CPU_SETSIZE 6757 #define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) 6758 6759 struct sched_param { 6760 int sched_priority; 6761 }; 6762 typedef unsigned long int __cpu_mask; 6763 typedef struct { 6764 __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; 6765 } cpu_set_t; 6766 extern int sched_get_priority_max(int __algorithm); 6767 extern int sched_get_priority_min(int __algorithm); 6768 extern int sched_getaffinity(pid_t __pid, size_t __cpusetsize, 6769 cpu_set_t * __cpuset); 6770 extern int sched_getparam(pid_t __pid, struct sched_param *__param); 6771 extern int sched_getscheduler(pid_t __pid); 6772 extern int sched_rr_get_interval(pid_t __pid, struct timespec *__t); 6773 extern int sched_setaffinity(pid_t __pid, size_t __cpusetsize, 6774 const cpu_set_t * __cpuset); 6775 extern int sched_setparam(pid_t __pid, const struct sched_param *__param); 6776 extern int sched_setscheduler(pid_t __pid, int __policy, 6777 const struct sched_param *__param); 6778 extern int sched_yield(void); 6779 __________________________________________________________ 6780 6781 13.4.48. search.h 6782 6783 typedef struct entry { 6784 char *key; 6785 void *data; 6786 } ENTRY; 6787 typedef enum { 6788 FIND, 6789 ENTER 6790 } ACTION; 6791 struct _ENTRY; 6792 typedef enum { 6793 preorder, 6794 postorder, 6795 endorder, 6796 leaf 6797 } VISIT; 6798 struct hsearch_data { 6799 struct _ENTRY *table; 6800 unsigned int size; 6801 unsigned int filled; 6802 }; 6803 6804 typedef void (*__action_fn_t) (const void *__nodep, VISIT __value, 6805 int __level); 6806 extern int hcreate(size_t __nel); 6807 extern int hcreate_r(size_t __nel, struct hsearch_data *__htab); 6808 extern void hdestroy(void); 6809 extern void hdestroy_r(struct hsearch_data *__htab); 6810 extern ENTRY *hsearch(ENTRY __item, ACTION __action); 6811 extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY * *__retval, 6812 struct hsearch_data *__htab); 6813 extern void insque(void *__elem, void *__prev); 6814 extern void *lfind(const void *__key, const void *__base, size_t * __nmemb, 6815 size_t __size, __compar_fn_t __compar); 6816 extern void *lsearch(const void *__key, void *__base, size_t * __nmemb, 6817 size_t __size, __compar_fn_t __compar); 6818 extern void remque(void *__elem); 6819 extern void *tdelete(const void *__key, void **__rootp, 6820 __compar_fn_t __compar); 6821 extern void *tfind(const void *__key, void *const *__rootp, 6822 __compar_fn_t __compar); 6823 extern void *tsearch(const void *__key, void **__rootp, 6824 __compar_fn_t __compar); 6825 extern void twalk(const void *__root, __action_fn_t __action); 6826 __________________________________________________________ 6827 6828 13.4.49. setjmp.h 6829 6830 #define setjmp(env) _setjmp(env) 6831 #define sigsetjmp(a,b) __sigsetjmp(a,b) 6832 6833 struct __jmp_buf_tag { 6834 __jmp_buf __jmpbuf; 6835 int __mask_was_saved; 6836 sigset_t __saved_mask; 6837 }; 6838 6839 typedef struct __jmp_buf_tag jmp_buf[1]; 6840 typedef jmp_buf sigjmp_buf; 6841 extern int __sigsetjmp(jmp_buf __env, int __savemask); 6842 extern void _longjmp(jmp_buf __env, int __val); 6843 extern int _setjmp(jmp_buf __env); 6844 extern void longjmp(jmp_buf __env, int __val); 6845 extern void siglongjmp(sigjmp_buf __env, int __val); 6846 __________________________________________________________ 6847 6848 13.4.50. signal.h 6849 6850 #define sigpause __xpg_sigpause 6851 6852 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 6853 #define SIGRTMAX (__libc_current_sigrtmax ()) 6854 #define SIGRTMIN (__libc_current_sigrtmin ()) 6855 #define NSIG 65 6856 #define SIG_BLOCK 0 /* Block signals. */ 6857 #define SIG_UNBLOCK 1 /* Unblock signals. */ 6858 #define SIG_SETMASK 2 /* Set the set of blocked signals. */ 6859 6860 typedef int sig_atomic_t; 6861 6862 typedef void (*sighandler_t) (int); 6863 6864 #define SIG_HOLD ((sighandler_t) 2) /* Request that signal be held. */ 6865 #define SIG_DFL ((sighandler_t)0) /* Request for default signal handling. */ 6866 #define SIG_IGN ((sighandler_t)1) /* Request that signal be ignored. */ 6867 #define SIG_ERR ((sighandler_t)-1) /* Return value from signal() in case of error. */ 6868 6869 #define SIGHUP 1 /* Hangup. */ 6870 #define SIGINT 2 /* Terminal interrupt signal. */ 6871 #define SIGQUIT 3 /* Terminal quit signal. */ 6872 #define SIGILL 4 /* Illegal instruction. */ 6873 #define SIGTRAP 5 /* Trace/breakpoint trap. */ 6874 #define SIGABRT 6 /* Process abort signal. */ 6875 #define SIGIOT 6 /* IOT trap */ 6876 #define SIGBUS 7 /* Access to an undefined portion of a memory object. */ 6877 #define SIGFPE 8 /* Erroneous arithmetic operation. */ 6878 #define SIGKILL 9 /* Kill (cannot be caught or ignored). */ 6879 #define SIGUSR1 10 /* User-defined signal 1. */ 6880 #define SIGSEGV 11 /* Invalid memory reference. */ 6881 #define SIGUSR2 12 /* User-defined signal 2. */ 6882 #define SIGPIPE 13 /* Write on a pipe with no one to readit. */ 6883 #define SIGALRM 14 /* Alarm clock. */ 6884 #define SIGTERM 15 /* Termination signal. */ 6885 #define SIGSTKFLT 16 /* Stack fault. */ 6886 #define SIGCHLD 17 /* Child process terminated, stopped, or continued. */ 6887 #define SIGCLD SIGCHLD /* Same as SIGCHLD */ 6888 #define SIGCONT 18 /* Continue executing, if stopped. */ 6889 #define SIGSTOP 19 /* Stop executing (cannot be caught or ignored). */ 6890 #define SIGTSTP 20 /* Terminal stop signal. */ 6891 #define SIGTTIN 21 /* Background process attempting read. */ 6892 #define SIGTTOU 22 /* Background process attempting write.*/ 6893 #define SIGURG 23 /* High bandwidth data is available at a socket. */ 6894 #define SIGXCPU 24 /* CPU time limit exceeded. */ 6895 #define SIGXFSZ 25 /* File size limit exceeded. */ 6896 #define SIGVTALRM 26 /* Virtual timer expired. */ 6897 #define SIGPROF 27 /* Profiling timer expired. */ 6898 #define SIGWINCH 28 /* Window size change. */ 6899 #define SIGIO 29 /* I/O now possible. */ 6900 #define SIGPOLL SIGIO /* Pollable event. */ 6901 #define SIGPWR 30 /* Power failure restart */ 6902 #define SIGSYS 31 /* Bad system call. */ 6903 #define SIGUNUSED 31 6904 6905 #define SV_ONSTACK (1<<0) /* Take the signal on the signal stack.*/ 6906 #define SV_INTERRUPT (1<<1) /* Do not restart system calls. */ 6907 #define SV_RESETHAND (1<<2) /* Reset handler to SIG_DFL on receipt.*/ 6908 6909 typedef union sigval { 6910 int sival_int; 6911 void *sival_ptr; 6912 } sigval_t; 6913 6914 #define SIGEV_SIGNAL 0 /* Notify via signal. */ 6915 #define SIGEV_NONE 1 /* Other notification: meaningless. */ 6916 #define SIGEV_THREAD 2 /* Deliver via thread creation. */ 6917 #define SIGEV_MAX_SIZE 64 6918 6919 typedef struct sigevent { 6920 sigval_t sigev_value; 6921 int sigev_signo; 6922 int sigev_notify; 6923 union { 6924 int _pad[SIGEV_PAD_SIZE]; 6925 struct { 6926 void (*_function) (sigval_t); 6927 void *_attribute; 6928 } _sigev_thread; 6929 } _sigev_un; 6930 } sigevent_t; 6931 6932 #define SI_MAX_SIZE 128 6933 #define si_pid _sifields._kill._pid 6934 #define si_uid _sifields._kill._uid 6935 #define si_value _sifields._rt._sigval 6936 #define si_int _sifields._rt._sigval.sival_int 6937 #define si_ptr _sifields._rt._sigval.sival_ptr 6938 #define si_status _sifields._sigchld._status 6939 #define si_stime _sifields._sigchld._stime 6940 #define si_utime _sifields._sigchld._utime 6941 #define si_addr _sifields._sigfault._addr 6942 #define si_band _sifields._sigpoll._band 6943 #define si_fd _sifields._sigpoll._fd 6944 #define si_timer1 _sifields._timer._timer1 6945 #define si_timer2 _sifields._timer._timer2 6946 6947 typedef struct siginfo { 6948 int si_signo; /* Signal number. */ 6949 int si_errno; 6950 int si_code; /* Signal code. */ 6951 union { 6952 int _pad[SI_PAD_SIZE]; 6953 struct { 6954 pid_t _pid; 6955 uid_t _uid; 6956 } _kill; 6957 struct { 6958 unsigned int _timer1; 6959 unsigned int _timer2; 6960 } _timer; 6961 struct { 6962 pid_t _pid; 6963 uid_t _uid; 6964 sigval_t _sigval; 6965 } _rt; 6966 struct { 6967 pid_t _pid; 6968 uid_t _uid; 6969 int _status; 6970 clock_t _utime; 6971 clock_t _stime; 6972 } _sigchld; 6973 struct { 6974 void *_addr; 6975 } _sigfault; 6976 struct { 6977 int _band; 6978 int _fd; 6979 } _sigpoll; 6980 } _sifields; 6981 } siginfo_t; 6982 6983 #define SI_QUEUE -1 /* Sent by sigqueue. */ 6984 #define SI_TIMER -2 /* Sent by timer expiration. */ 6985 #define SI_MESGQ -3 /* Sent by real time mesq state change.*/ 6986 #define SI_ASYNCIO -4 /* Sent by AIO completion. */ 6987 #define SI_SIGIO -5 /* Sent by queued SIGIO. */ 6988 #define SI_TKILL -6 /* Sent by tkill. */ 6989 #define SI_ASYNCNL -60 /* Sent by asynch name lookup completion. */ 6990 #define SI_USER 0 /* Sent by kill, sigsend, raise. */ 6991 #define SI_KERNEL 0x80 /* Sent by kernel. */ 6992 6993 #define ILL_ILLOPC 1 /* Illegal opcode. */ 6994 #define ILL_ILLOPN 2 /* Illegal operand. */ 6995 #define ILL_ILLADR 3 /* Illegal addressing mode. */ 6996 #define ILL_ILLTRP 4 /* Illegal trap. */ 6997 #define ILL_PRVOPC 5 /* Privileged opcode. */ 6998 #define ILL_PRVREG 6 /* Privileged register. */ 6999 #define ILL_COPROC 7 /* Coprocessor error. */ 7000 #define ILL_BADSTK 8 /* Internal stack error. */ 7001 7002 #define FPE_INTDIV 1 /* Integer divide by zero. */ 7003 #define FPE_INTOVF 2 /* Integer overflow. */ 7004 #define FPE_FLTDIV 3 /* Floating-point divide by zero. */ 7005 #define FPE_FLTOVF 4 /* Floating-point overflow. */ 7006 #define FPE_FLTUND 5 /* Floating-point underflow. */ 7007 #define FPE_FLTRES 6 /* Floating-point inexact result. */ 7008 #define FPE_FLTINV 7 /* Invalid floating-point operation. */ 7009 #define FPE_FLTSUB 8 /* Subscript out of range. */ 7010 7011 #define SEGV_MAPERR 1 /* Address not mapped to object. */ 7012 #define SEGV_ACCERR 2 /* Invalid permissions for mapped object. */ 7013 7014 #define BUS_ADRALN 1 /* Invalid address alignment. */ 7015 #define BUS_ADRERR 2 /* Nonexistent physical address. */ 7016 #define BUS_OBJERR 3 /* Object-specific hardware error. */ 7017 7018 #define TRAP_BRKPT 1 /* Process breakpoint. */ 7019 #define TRAP_TRACE 2 /* Process trace trap. */ 7020 7021 #define CLD_EXITED 1 /* Child has exited. */ 7022 #define CLD_KILLED 2 /* Child has terminated abnormally and did not create a core fi */ 7023 #define CLD_DUMPED 3 /* Child has terminated abnormally and created a core file. */ 7024 #define CLD_TRAPPED 4 /* Traced child has trapped. */ 7025 #define CLD_STOPPED 5 /* Child has stopped. */ 7026 #define CLD_CONTINUED 6 /* Stopped child has continued. */ 7027 7028 #define POLL_IN 1 /* Data input available. */ 7029 #define POLL_OUT 2 /* Output buffers available. */ 7030 #define POLL_MSG 3 /* Input message available. */ 7031 #define POLL_ERR 4 /* I/O error. */ 7032 #define POLL_PRI 5 /* High priority input available. */ 7033 #define POLL_HUP 6 /* Device disconnected. */ 7034 7035 typedef struct { 7036 unsigned long int sig[_SIGSET_NWORDS]; 7037 } sigset_t; 7038 7039 #define SA_INTERRUPT 0x20000000 7040 #define sa_handler __sigaction_handler._sa_handler 7041 #define sa_sigaction __sigaction_handler._sa_sigaction 7042 #define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer`. */ 7043 #define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry tohandler. */ 7044 #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ 7045 #define SA_SIGINFO 0x00000004 /* Invoke signal-catching function with three arguments instead of one. */ 7046 #define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ 7047 #define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ 7048 #define SA_NOCLDWAIT 0x00000002 /* Don't create zombie on childdeath. */ 7049 #define SA_NOMASK SA_NODEFER 7050 #define SA_ONESHOT SA_RESETHAND 7051 7052 typedef struct sigaltstack { 7053 void *ss_sp; 7054 int ss_flags; 7055 size_t ss_size; 7056 } stack_t; 7057 7058 #define SS_ONSTACK 1 7059 #define SS_DISABLE 2 7060 7061 extern int __libc_current_sigrtmax(void); 7062 extern int __libc_current_sigrtmin(void); 7063 extern sighandler_t __sysv_signal(int __sig, sighandler_t __handler); 7064 extern int __xpg_sigpause(int); 7065 extern char *const _sys_siglist[]; 7066 extern sighandler_t bsd_signal(int __sig, sighandler_t __handler); 7067 extern int kill(pid_t __pid, int __sig); 7068 extern int killpg(pid_t __pgrp, int __sig); 7069 extern void psignal(int __sig, const char *__s); 7070 extern int pthread_kill(pthread_t, int); 7071 extern int pthread_sigmask(int, const sigset_t *, sigset_t *); 7072 extern int raise(int __sig); 7073 extern int sigaction(int __sig, const struct sigaction *__act, 7074 struct sigaction *__oact); 7075 extern int sigaddset(sigset_t * __set, int __signo); 7076 extern int sigaltstack(const struct sigaltstack *__ss, 7077 struct sigaltstack *__oss); 7078 extern int sigandset(sigset_t * __set, const sigset_t * __left, 7079 const sigset_t * __right); 7080 extern int sigdelset(sigset_t * __set, int __signo); 7081 extern int sigemptyset(sigset_t * __set); 7082 extern int sigfillset(sigset_t * __set); 7083 extern int sighold(int __sig); 7084 extern int sigignore(int __sig); 7085 extern int siginterrupt(int __sig, int __interrupt); 7086 extern int sigisemptyset(const sigset_t * __set); 7087 extern int sigismember(const sigset_t * __set, int __signo); 7088 extern sighandler_t signal(int __sig, sighandler_t __handler); 7089 extern int sigorset(sigset_t * __set, const sigset_t * __left, 7090 const sigset_t * __right); 7091 extern int sigpending(sigset_t * __set); 7092 extern int sigprocmask(int __how, const sigset_t * __set, 7093 sigset_t * __oset); 7094 extern int sigqueue(pid_t __pid, int __sig, const union sigval __val); 7095 extern int sigrelse(int __sig); 7096 extern int sigreturn(struct sigcontext *__scp); 7097 extern sighandler_t sigset(int __sig, sighandler_t __disp); 7098 extern int sigsuspend(const sigset_t * __set); 7099 extern int sigtimedwait(const sigset_t * __set, siginfo_t * __info, 7100 const struct timespec *__timeout); 7101 extern int sigwait(const sigset_t * __set, int *__sig); 7102 extern int sigwaitinfo(const sigset_t * __set, siginfo_t * __info); 7103 __________________________________________________________ 7104 7105 13.4.51. spawn.h 7106 7107 #define POSIX_SPAWN_RESETIDS 0x01 7108 #define POSIX_SPAWN_SETPGROUP 0x02 7109 #define POSIX_SPAWN_SETSIGDEF 0x04 7110 #define POSIX_SPAWN_SETSIGMASK 0x08 7111 #define POSIX_SPAWN_SETSCHEDPARAM 0x10 7112 #define POSIX_SPAWN_SETSCHEDULER 0x20 7113 7114 typedef struct { 7115 int __allocated; 7116 int __used; 7117 struct __spawn_action *__actions; 7118 int __pad[16]; 7119 } posix_spawn_file_actions_t; 7120 typedef struct { 7121 short __flags; 7122 pid_t __pgrp; 7123 sigset_t __sd; 7124 sigset_t __ss; 7125 struct sched_param __sp; 7126 int __policy; 7127 int __pad[16]; 7128 } posix_spawnattr_t; 7129 extern int posix_spawn(pid_t * __pid, const char *__path, 7130 const posix_spawn_file_actions_t * __file_actions, 7131 const posix_spawnattr_t * __attrp, 7132 char *const argv[], char *const envp[]); 7133 extern int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* 7134 __file_actions, int __fd); 7135 extern int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t * 7136 __file_actions, int __fd, 7137 int __newfd); 7138 extern int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t * 7139 __file_actions, int __fd, 7140 const char *__path, 7141 int __oflag, mode_t __mode); 7142 extern int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t * 7143 __file_actions); 7144 extern int posix_spawn_file_actions_init(posix_spawn_file_actions_t * 7145 __file_actions); 7146 extern int posix_spawnattr_destroy(posix_spawnattr_t * __attr); 7147 extern int posix_spawnattr_getflags(const posix_spawnattr_t * __attr, 7148 short int *__flags); 7149 extern int posix_spawnattr_getpgroup(const posix_spawnattr_t * __attr, 7150 pid_t * __pgroup); 7151 extern int posix_spawnattr_getschedparam(const posix_spawnattr_t * __attr, 7152 struct sched_param *__schedparam); 7153 extern int posix_spawnattr_getschedpolicy(const posix_spawnattr_t * __attr, 7154 int *__schedpolicy); 7155 extern int posix_spawnattr_getsigdefault(const posix_spawnattr_t * __attr, 7156 sigset_t * __sigdefault); 7157 extern int posix_spawnattr_getsigmask(const posix_spawnattr_t * __attr, 7158 sigset_t * __sigmask); 7159 extern int posix_spawnattr_init(posix_spawnattr_t * __attr); 7160 extern int posix_spawnattr_setflags(posix_spawnattr_t * _attr, 7161 short int __flags); 7162 extern int posix_spawnattr_setpgroup(posix_spawnattr_t * __attr, 7163 pid_t __pgroup); 7164 extern int posix_spawnattr_setschedparam(posix_spawnattr_t * __attr, 7165 const struct sched_param 7166 *__schedparam); 7167 extern int posix_spawnattr_setschedpolicy(posix_spawnattr_t * __attr, 7168 int __schedpolicy); 7169 extern int posix_spawnattr_setsigdefault(posix_spawnattr_t * __attr, 7170 const sigset_t * __sigdefault); 7171 extern int posix_spawnattr_setsigmask(posix_spawnattr_t * __attr, 7172 const sigset_t * __sigmask); 7173 extern int posix_spawnp(pid_t * __pid, const char *__file, 7174 const posix_spawn_file_actions_t * __file_actions, 7175 const posix_spawnattr_t * __attrp, 7176 char *const argv[], char *const envp[]); 7177 __________________________________________________________ 7178 7179 13.4.52. stddef.h 7180 7181 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 7182 #ifndef NULL 7183 # ifdef __cplusplus 7184 # define NULL (0L) 7185 # else 7186 # define NULL ((void*) 0) 7187 # endif 7188 #endif 7189 __________________________________________________________ 7190 7191 13.4.53. stdint.h 7192 7193 #define INT16_C(c) c 7194 #define INT32_C(c) c 7195 #define INT8_C(c) c 7196 #define UINT16_C(c) c 7197 #define UINT8_C(c) c 7198 #define UINT32_C(c) c ## U 7199 7200 #define INT8_MIN (-128) 7201 #define INT_FAST8_MIN (-128) 7202 #define INT_LEAST8_MIN (-128) 7203 #define INT32_MIN (-2147483647-1) 7204 #define INT_LEAST32_MIN (-2147483647-1) 7205 #define SIG_ATOMIC_MIN (-2147483647-1) 7206 #define INT16_MIN (-32767-1) 7207 #define INT_LEAST16_MIN (-32767-1) 7208 #define INT64_MIN (-__INT64_C(9223372036854775807)-1) 7209 #define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) 7210 #define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) 7211 #define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) 7212 #define WINT_MIN (0u) 7213 #define INT8_MAX (127) 7214 #define INT_FAST8_MAX (127) 7215 #define INT_LEAST8_MAX (127) 7216 #define INT32_MAX (2147483647) 7217 #define INT_LEAST32_MAX (2147483647) 7218 #define SIG_ATOMIC_MAX (2147483647) 7219 #define UINT8_MAX (255) 7220 #define UINT_FAST8_MAX (255) 7221 #define UINT_LEAST8_MAX (255) 7222 #define INT16_MAX (32767) 7223 #define INT_LEAST16_MAX (32767) 7224 #define UINT32_MAX (4294967295U) 7225 #define UINT_LEAST32_MAX (4294967295U) 7226 #define WINT_MAX (4294967295u) 7227 #define UINT16_MAX (65535) 7228 #define UINT_LEAST16_MAX (65535) 7229 #define INT64_MAX (__INT64_C(9223372036854775807)) 7230 #define INTMAX_MAX (__INT64_C(9223372036854775807)) 7231 #define INT_FAST64_MAX (__INT64_C(9223372036854775807)) 7232 #define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) 7233 #define UINT64_MAX (__UINT64_C(18446744073709551615)) 7234 #define UINTMAX_MAX (__UINT64_C(18446744073709551615)) 7235 #define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) 7236 #define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) 7237 7238 typedef signed char int8_t; 7239 typedef short int16_t; 7240 typedef int int32_t; 7241 typedef unsigned char uint8_t; 7242 typedef unsigned short uint16_t; 7243 typedef unsigned int uint32_t; 7244 typedef signed char int_least8_t; 7245 typedef short int int_least16_t; 7246 typedef int int_least32_t; 7247 typedef unsigned char uint_least8_t; 7248 typedef unsigned short uint_least16_t; 7249 typedef unsigned int uint_least32_t; 7250 typedef signed char int_fast8_t; 7251 typedef unsigned char uint_fast8_t; 7252 __________________________________________________________ 7253 7254 13.4.54. stdio.h 7255 7256 #define EOF (-1) 7257 #define P_tmpdir "/tmp" 7258 #define FOPEN_MAX 16 7259 #define L_tmpnam 20 7260 #define FILENAME_MAX 4096 7261 #define BUFSIZ 8192 7262 #define L_ctermid 9 7263 #define L_cuserid 9 7264 7265 typedef struct { 7266 off_t __pos; 7267 mbstate_t __state; 7268 } fpos_t; 7269 typedef struct { 7270 off64_t __pos; 7271 mbstate_t __state; 7272 } fpos64_t; 7273 7274 typedef struct _IO_FILE FILE; 7275 7276 #define _IOFBF 0 7277 #define _IOLBF 1 7278 #define _IONBF 2 7279 7280 extern char *__fgets_chk(char *, size_t, int, FILE *); 7281 extern char *__fgets_unlocked_chk(char *, size_t, int, FILE *); 7282 extern size_t __fpending(FILE *); 7283 extern int __printf_chk(int, const char *, ...); 7284 extern int __snprintf_chk(char *, size_t, int, size_t, const char *, ...); 7285 extern int __sprintf_chk(char *, int, size_t, const char *, ...); 7286 extern int __vprintf_chk(int, const char *, va_list); 7287 extern int __vsnprintf_chk(char *, size_t, int, size_t, const char *, 7288 va_list); 7289 extern int __vsprintf_chk(char *, int, size_t, const char *, va_list); 7290 extern char *const _sys_errlist[]; 7291 extern int asprintf(char **__ptr, const char *__fmt, ...); 7292 extern void clearerr(FILE * __stream); 7293 extern void clearerr_unlocked(FILE * __stream); 7294 extern int dprintf(int __fd, const char *__fmt, ...); 7295 extern int fclose(FILE * __stream); 7296 extern FILE *fdopen(int __fd, const char *__modes); 7297 extern int feof(FILE * __stream); 7298 extern int feof_unlocked(FILE * __stream); 7299 extern int ferror(FILE * __stream); 7300 extern int ferror_unlocked(FILE * __stream); 7301 extern int fflush(FILE * __stream); 7302 extern int fflush_unlocked(FILE * __stream); 7303 extern int fgetc(FILE * __stream); 7304 extern int fgetc_unlocked(FILE * __stream); 7305 extern int fgetpos(FILE * __stream, fpos_t * __pos); 7306 extern int fgetpos64(FILE * __stream, fpos64_t * __pos); 7307 extern char *fgets(char *__s, int __n, FILE * __stream); 7308 extern char *fgets_unlocked(char *__s, int __n, FILE * __stream); 7309 extern int fileno(FILE * __stream); 7310 extern int fileno_unlocked(FILE * __stream); 7311 extern void flockfile(FILE * __stream); 7312 extern FILE *fmemopen(void *__s, size_t __len, const char *__modes); 7313 extern FILE *fopen(const char *__filename, const char *__modes); 7314 extern FILE *fopen64(const char *__filename, const char *__modes); 7315 extern int fprintf(FILE * __stream, const char *__format, ...); 7316 extern int fputc(int __c, FILE * __stream); 7317 extern int fputc_unlocked(int __c, FILE * __stream); 7318 extern int fputs(const char *__s, FILE * __stream); 7319 extern int fputs_unlocked(const char *__s, FILE * __stream); 7320 extern size_t fread(void *__ptr, size_t __size, size_t __n, 7321 FILE * __stream); 7322 extern size_t fread_unlocked(void *__ptr, size_t __size, size_t __n, 7323 FILE * __stream); 7324 extern FILE *freopen(const char *__filename, const char *__modes, 7325 FILE * __stream); 7326 extern FILE *freopen64(const char *__filename, const char *__modes, 7327 FILE * __stream); 7328 extern int fscanf(FILE * __stream, const char *__format, ...); 7329 extern int fseek(FILE * __stream, long int __off, int __whence); 7330 extern int fseeko(FILE * __stream, off_t __off, int __whence); 7331 extern int fseeko64(FILE * __stream, loff_t __off, int __whence); 7332 extern int fsetpos(FILE * __stream, const fpos_t * __pos); 7333 extern int fsetpos64(FILE * __stream, const fpos64_t * __pos); 7334 extern long int ftell(FILE * __stream); 7335 extern off_t ftello(FILE * __stream); 7336 extern loff_t ftello64(FILE * __stream); 7337 extern int ftrylockfile(FILE * __stream); 7338 extern void funlockfile(FILE * __stream); 7339 extern size_t fwrite(const void *__ptr, size_t __size, size_t __n, 7340 FILE * __s); 7341 extern size_t fwrite_unlocked(const void *__ptr, size_t __size, size_t __n, 7342 FILE * __stream); 7343 extern int getc(FILE * __stream); 7344 extern int getc_unlocked(FILE * __stream); 7345 extern int getchar(void); 7346 extern int getchar_unlocked(void); 7347 extern ssize_t getdelim(char **__lineptr, size_t * __n, int __delimiter, 7348 FILE * __stream); 7349 extern ssize_t getline(char **__lineptr, size_t * __n, FILE * __stream); 7350 extern int getw(FILE * __stream); 7351 extern FILE *open_memstream(char **__bufloc, size_t * __sizeloc); 7352 extern int pclose(FILE * __stream); 7353 extern void perror(const char *__s); 7354 extern FILE *popen(const char *__command, const char *__modes); 7355 extern int printf(const char *__format, ...); 7356 extern int putc(int __c, FILE * __stream); 7357 extern int putc_unlocked(int __c, FILE * __stream); 7358 extern int putchar(int __c); 7359 extern int putchar_unlocked(int __c); 7360 extern int puts(const char *__s); 7361 extern int putw(int __w, FILE * __stream); 7362 extern int remove(const char *__filename); 7363 extern int renameat(int __oldfd, const char *__old, int __newfd, 7364 const char *__new); 7365 extern void rewind(FILE * __stream); 7366 extern int scanf(const char *__format, ...); 7367 extern void setbuf(FILE * __stream, char *__buf); 7368 extern void setbuffer(FILE * __stream, char *__buf, size_t __size); 7369 extern int setvbuf(FILE * __stream, char *__buf, int __modes, size_t __n); 7370 extern int snprintf(char *__s, size_t __maxlen, const char *__format, ...); 7371 extern int sprintf(char *__s, const char *__format, ...); 7372 extern int sscanf(const char *__s, const char *__format, ...); 7373 extern FILE *stderr; 7374 extern FILE *stdin; 7375 extern FILE *stdout; 7376 extern char *tempnam(const char *__dir, const char *__pfx); 7377 extern FILE *tmpfile(void); 7378 extern FILE *tmpfile64(void); 7379 extern char *tmpnam(char *__s); 7380 extern int ungetc(int __c, FILE * __stream); 7381 extern int vasprintf(char **__ptr, const char *__f, va_list __arg); 7382 extern int vdprintf(int __fd, const char *__fmt, va_list __arg); 7383 extern int vfprintf(FILE * __s, const char *__format, va_list __arg); 7384 extern int vfscanf(FILE * __s, const char *__format, va_list __arg); 7385 extern int vprintf(const char *__format, va_list __arg); 7386 extern int vscanf(const char *__format, va_list __arg); 7387 extern int vsnprintf(char *__s, size_t __maxlen, const char *__format, 7388 va_list __arg); 7389 extern int vsprintf(char *__s, const char *__format, va_list __arg); 7390 extern int vsscanf(const char *__s, const char *__format, va_list __arg); 7391 __________________________________________________________ 7392 7393 13.4.55. stdlib.h 7394 7395 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 7396 #define EXIT_SUCCESS 0 7397 #define EXIT_FAILURE 1 7398 #define RAND_MAX 2147483647 7399 7400 struct drand48_data { 7401 unsigned short __x[3]; 7402 unsigned short __old_x[3]; 7403 unsigned short __c; 7404 unsigned short __init; 7405 unsigned long long int __a; 7406 }; 7407 typedef int (*__compar_fn_t) (const void *, const void *); 7408 struct random_data { 7409 int32_t *fptr; /* Front pointer. */ 7410 int32_t *rptr; /* Rear pointer. */ 7411 int32_t *state; /* Array of state values. */ 7412 int rand_type; /* Type of random number generator. */ 7413 int rand_deg; /* Degree of random number generator. */ 7414 int rand_sep; /* Distance between front and rear. */ 7415 int32_t *end_ptr; /* Pointer behind state table. */ 7416 }; 7417 7418 typedef struct { 7419 int quot; 7420 int rem; 7421 } div_t; 7422 7423 typedef struct { 7424 long int quot; 7425 long int rem; 7426 } ldiv_t; 7427 7428 typedef struct { 7429 long long int quot; 7430 long long int rem; 7431 } lldiv_t; 7432 extern void _Exit(int __status); 7433 extern size_t __ctype_get_mb_cur_max(void); 7434 extern size_t __mbstowcs_chk(wchar_t *, const char *, size_t, size_t); 7435 extern char *__realpath_chk(const char *, char *, size_t); 7436 extern double __strtod_internal(const char *, char **, int); 7437 extern float __strtof_internal(const char *, char **, int); 7438 extern long int __strtol_internal(const char *, char **, int, int); 7439 extern long double __strtold_internal(const char *, char **, int); 7440 extern long long int __strtoll_internal(const char *, char **, int, int); 7441 extern unsigned long int __strtoul_internal(const char *, char **, int, 7442 int); 7443 extern unsigned long long int __strtoull_internal(const char *, char **, 7444 int, int); 7445 extern size_t __wcstombs_chk(char *, const wchar_t *, size_t, size_t); 7446 extern int __wctomb_chk(char *, wchar_t, size_t); 7447 extern long int a64l(const char *__s); 7448 extern void abort(void); 7449 extern int abs(int __x); 7450 extern double atof(const char *__nptr); 7451 extern int atoi(const char *__nptr); 7452 extern long int atol(const char *__nptr); 7453 extern long long int atoll(const char *__nptr); 7454 extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, 7455 size_t __size, __compar_fn_t __compar); 7456 extern void *calloc(size_t __nmemb, size_t __size); 7457 extern div_t div(int __numer, int __denom); 7458 extern double drand48(void); 7459 extern int drand48_r(struct drand48_data *__buffer, double *__result); 7460 extern char *ecvt(double __value, int __ndigit, int *__decpt, int *__sign); 7461 extern char **environ; 7462 extern double erand48(unsigned short __xsubi[3]); 7463 extern int erand48_r(unsigned short __xsubi[3], 7464 struct drand48_data *__buffer, double *__result); 7465 extern void exit(int __status); 7466 extern char *fcvt(double __value, int __ndigit, int *__decpt, int *__sign); 7467 extern void free(void *__ptr); 7468 extern char *gcvt(double __value, int __ndigit, char *__buf); 7469 extern char *getenv(const char *__name); 7470 extern int getloadavg(double __loadavg[], int __nelem); 7471 extern int getsubopt(char **__optionp, char *const *__tokens, 7472 char **__valuep); 7473 extern int grantpt(int __fd); 7474 extern char *initstate(unsigned int __seed, char *__statebuf, 7475 size_t __statelen); 7476 extern int initstate_r(unsigned int __seed, char *__statebuf, 7477 size_t __statelen, struct random_data *__buf); 7478 extern long int jrand48(unsigned short __xsubi[3]); 7479 extern int jrand48_r(unsigned short __xsubi[3], 7480 struct drand48_data *__buffer, long int *__result); 7481 extern char *l64a(long int __n); 7482 extern long int labs(long int __x); 7483 extern void lcong48(unsigned short __param[7]); 7484 extern int lcong48_r(unsigned short __param[7], 7485 struct drand48_data *__buffer); 7486 extern ldiv_t ldiv(long int __numer, long int __denom); 7487 extern long long int llabs(long long int __x); 7488 extern lldiv_t lldiv(long long int __numer, long long int __denom); 7489 extern long int lrand48(void); 7490 extern int lrand48_r(struct drand48_data *__buffer, long int *__result); 7491 extern void *malloc(size_t __size); 7492 extern int mblen(const char *__s, size_t __n); 7493 extern size_t mbstowcs(wchar_t * __pwcs, const char *__s, size_t __n); 7494 extern int mbtowc(wchar_t * __pwc, const char *__s, size_t __n); 7495 extern char *mkdtemp(char *__template); 7496 extern int mkstemp64(char *__template); 7497 extern char *mktemp(char *__template); 7498 extern long int mrand48(void); 7499 extern int mrand48_r(struct drand48_data *__buffer, long int *__result); 7500 extern long int nrand48(unsigned short __xsubi[3]); 7501 extern int nrand48_r(unsigned short __xsubi[3], 7502 struct drand48_data *__buffer, long int *__result); 7503 extern int posix_memalign(void **__memptr, size_t __alignment, 7504 size_t __size); 7505 extern int posix_openpt(int __oflag); 7506 extern char *ptsname(int __fd); 7507 extern int putenv(char *__string); 7508 extern void qsort(void *__base, size_t __nmemb, size_t __size, 7509 const __compar_fn_t __compar); 7510 extern int rand(void); 7511 extern int rand_r(unsigned int *__seed); 7512 extern long int random(void); 7513 extern int random_r(struct random_data *__buf, int32_t * __result); 7514 extern void *realloc(void *__ptr, size_t __size); 7515 extern char *realpath(const char *__name, char *__resolved); 7516 extern unsigned short *seed48(unsigned short __seed16v[3]); 7517 extern int seed48_r(unsigned short __seed16v[3], 7518 struct drand48_data *__buffer); 7519 extern int setenv(const char *__name, const char *__value, int __replace); 7520 extern char *setstate(char *__statebuf); 7521 extern int setstate_r(char *__statebuf, struct random_data *__buf); 7522 extern void srand(unsigned int __seed); 7523 extern void srand48(long int __seedval); 7524 extern int srand48_r(long int __seedval, struct drand48_data *__buffer); 7525 extern void srandom(unsigned int __seed); 7526 extern int srandom_r(unsigned int __seed, struct random_data *__buf); 7527 extern double strtod(const char *__nptr, char **__endptr); 7528 extern float strtof(const char *__nptr, char **__endptr); 7529 extern long int strtol(const char *__nptr, char **__endptr, int __base); 7530 extern long double strtold(const char *__nptr, char **__endptr); 7531 extern long long int strtoll(const char *__nptr, char **__endptr, 7532 int __base); 7533 extern long long int strtoq(const char *__nptr, char **__endptr, 7534 int __base); 7535 extern unsigned long int strtoul(const char *__nptr, char **__endptr, 7536 int __base); 7537 extern unsigned long long int strtoull(const char *__nptr, char **__endptr, 7538 int __base); 7539 extern unsigned long long int strtouq(const char *__nptr, char **__endptr, 7540 int __base); 7541 extern int system(const char *__command); 7542 extern int unlockpt(int __fd); 7543 extern int unsetenv(const char *__name); 7544 extern size_t wcstombs(char *__s, const wchar_t * __pwcs, size_t __n); 7545 extern int wctomb(char *__s, wchar_t __wchar); 7546 __________________________________________________________ 7547 7548 13.4.56. string.h 7549 7550 #define strerror_r __xpg_strerror_r 7551 7552 extern void *__memcpy_chk(void *, const void *, size_t, size_t); 7553 extern void *__memmove_chk(void *, const void *, size_t, size_t); 7554 extern void *__mempcpy(void *__dest, const void *__src, size_t __n); 7555 extern void *__mempcpy_chk(void *, const void *, size_t, size_t); 7556 extern void *__memset_chk(void *, int, size_t, size_t); 7557 extern char *__stpcpy(char *__dest, const char *__src); 7558 extern char *__stpcpy_chk(char *, const char *, size_t); 7559 extern char *__strcat_chk(char *, const char *, size_t); 7560 extern char *__strcpy_chk(char *, const char *, size_t); 7561 extern char *__strncat_chk(char *, const char *, size_t, size_t); 7562 extern char *__strncpy_chk(char *, const char *, size_t, size_t); 7563 extern char *__strtok_r(char *__s, const char *__delim, char **__save_ptr); 7564 extern int __xpg_strerror_r(int, char *, size_t); 7565 extern void *memccpy(void *__dest, const void *__src, int __c, size_t __n); 7566 extern void *memchr(const void *__s, int __c, size_t __n); 7567 extern int memcmp(const void *__s1, const void *__s2, size_t __n); 7568 extern void *memcpy(void *__dest, const void *__src, size_t __n); 7569 extern void *memmem(const void *__haystack, size_t __haystacklen, 7570 const void *__needle, size_t __needlelen); 7571 extern void *memmove(void *__dest, const void *__src, size_t __n); 7572 extern void *memrchr(const void *__s, int __c, size_t __n); 7573 extern void *memset(void *__s, int __c, size_t __n); 7574 extern char *stpcpy(char *__dest, const char *__src); 7575 extern char *stpncpy(char *__dest, const char *__src, size_t __n); 7576 extern char *strcasestr(const char *__haystack, const char *__needle); 7577 extern char *strcat(char *__dest, const char *__src); 7578 extern char *strchr(const char *__s, int __c); 7579 extern int strcmp(const char *__s1, const char *__s2); 7580 extern int strcoll(const char *__s1, const char *__s2); 7581 extern char *strcpy(char *__dest, const char *__src); 7582 extern size_t strcspn(const char *__s, const char *__reject); 7583 extern char *strdup(const char *__s); 7584 extern char *strerror(int __errnum); 7585 extern size_t strlen(const char *__s); 7586 extern char *strncat(char *__dest, const char *__src, size_t __n); 7587 extern int strncmp(const char *__s1, const char *__s2, size_t __n); 7588 extern char *strncpy(char *__dest, const char *__src, size_t __n); 7589 extern char *strndup(const char *__string, size_t __n); 7590 extern size_t strnlen(const char *__string, size_t __maxlen); 7591 extern char *strpbrk(const char *__s, const char *__accept); 7592 extern char *strrchr(const char *__s, int __c); 7593 extern char *strsep(char **__stringp, const char *__delim); 7594 extern char *strsignal(int __sig); 7595 extern size_t strspn(const char *__s, const char *__accept); 7596 extern char *strstr(const char *__haystack, const char *__needle); 7597 extern char *strtok(char *__s, const char *__delim); 7598 extern char *strtok_r(char *__s, const char *__delim, char **__save_ptr); 7599 extern size_t strxfrm(char *__dest, const char *__src, size_t __n); 7600 __________________________________________________________ 7601 7602 13.4.57. strings.h 7603 7604 extern int bcmp(const void *__s1, const void *__s2, size_t __n); 7605 extern void bcopy(const void *__src, void *__dest, size_t __n); 7606 extern void bzero(void *__s, size_t __n); 7607 extern int ffs(int __i); 7608 extern char *index(const char *__s, int __c); 7609 extern char *rindex(const char *__s, int __c); 7610 extern int strcasecmp(const char *__s1, const char *__s2); 7611 extern int strncasecmp(const char *__s1, const char *__s2, size_t __n); 7612 __________________________________________________________ 7613 7614 13.4.58. sys/epoll.h 7615 7616 #define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */ 7617 #define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */ 7618 #define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */ 7619 #define EPOLLIN 1 7620 #define EPOLLPRI 2 7621 #define EPOLLOUT 4 7622 #define EPOLLERR 8 7623 #define EPOLLHUP 16 7624 #define EPOLLRDHUP 32 7625 #define EPOLLONESHOT (1 << 30) 7626 #define EPOLLET (1 << 31) 7627 7628 typedef union epoll_data { 7629 void *ptr; 7630 int fd; 7631 uint32_t u32; 7632 uint64_t u64; 7633 } epoll_data_t; 7634 7635 struct epoll_event { 7636 uint32_t events; 7637 epoll_data_t data; 7638 }; 7639 extern int epoll_create(int __size); 7640 extern int epoll_ctl(int __epfd, int __op, int __fd, 7641 struct epoll_event *__event); 7642 extern int epoll_wait(int __epfd, struct epoll_event *__events, 7643 int __maxevents, int __timeout); 7644 __________________________________________________________ 7645 7646 13.4.59. sys/file.h 7647 7648 #define LOCK_SH 1 7649 #define LOCK_EX 2 7650 #define LOCK_NB 4 7651 #define LOCK_UN 8 7652 7653 extern int flock(int __fd, int __operation); 7654 __________________________________________________________ 7655 7656 13.4.60. sys/inotify.h 7657 7658 #define IN_ACCESS 0x00000001 7659 #define IN_MODIFY 0x00000002 7660 #define IN_ATTRIB 0x00000004 7661 #define IN_CLOSE_WRITE 0x00000008 7662 #define IN_CLOSE_NOWRITE 0x00000010 7663 #define IN_OPEN 0x00000020 7664 #define IN_MOVED_FROM 0x00000040 7665 #define IN_MOVED_TO 0x00000080 7666 #define IN_CREATE 0x00000100 7667 #define IN_DELETE 0x00000200 7668 #define IN_DELETE_SELF 0x00000400 7669 #define IN_MOVE_SELF 0x00000800 7670 #define IN_UNMOUNT 0x00002000 7671 #define IN_Q_OVERFLOW 0x00004000 7672 #define IN_IGNORED 0x00008000 7673 #define IN_ISDIR 0x40000000 7674 #define IN_ONESHOT 0x80000000 7675 #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) 7676 #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) 7677 #define IN_ALL_EVENTS \ 7678 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ 7679 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | IN_MOVED_TO | IN_CREATE | \ 7680 IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF) 7681 7682 struct inotify_event { 7683 int wd; 7684 uint32_t mask; 7685 uint32_t cookie; 7686 uint32_t len; 7687 char name[]; 7688 }; 7689 extern int inotify_add_watch(int __fd, const char *__name, 7690 uint32_t __mask); 7691 extern int inotify_init(void); 7692 extern int inotify_rm_watch(int __fd, uint32_t __wd); 7693 __________________________________________________________ 7694 7695 13.4.61. sys/ioctl.h 7696 7697 struct winsize { 7698 unsigned short ws_row; /* Rows, in characters. */ 7699 unsigned short ws_col; /* Columns, in characters. */ 7700 unsigned short ws_xpixel; /* Horizontal pixels. */ 7701 unsigned short ws_ypixel; /* Vertical pixels. */ 7702 }; 7703 extern int ioctl(int __fd, unsigned long int __request, ...); 7704 __________________________________________________________ 7705 7706 13.4.62. sys/ipc.h 7707 7708 #define IPC_PRIVATE ((key_t)0) 7709 #define IPC_RMID 0 7710 #define IPC_CREAT 00001000 7711 #define IPC_EXCL 00002000 7712 #define IPC_NOWAIT 00004000 7713 #define IPC_SET 1 7714 #define IPC_STAT 2 7715 7716 extern key_t ftok(const char *__pathname, int __proj_id); 7717 __________________________________________________________ 7718 7719 13.4.63. sys/mman.h 7720 7721 #define MAP_FAILED ((void*)-1) 7722 #define POSIX_MADV_NORMAL 0 7723 #define PROT_NONE 0x0 7724 #define MAP_SHARED 0x01 7725 #define MAP_PRIVATE 0x02 7726 #define PROT_READ 0x1 7727 #define MAP_FIXED 0x10 7728 #define PROT_WRITE 0x2 7729 #define MAP_ANONYMOUS 0x20 7730 #define PROT_EXEC 0x4 7731 #define MREMAP_MAYMOVE 1 7732 #define MS_ASYNC 1 7733 #define POSIX_MADV_RANDOM 1 7734 #define MREMAP_FIXED 2 7735 #define MS_INVALIDATE 2 7736 #define POSIX_MADV_SEQUENTIAL 2 7737 #define POSIX_MADV_WILLNEED 3 7738 #define MS_SYNC 4 7739 #define POSIX_MADV_DONTNEED 4 7740 #define MAP_ANON MAP_ANONYMOUS 7741 7742 extern int mlock(const void *__addr, size_t __len); 7743 extern int mlockall(int __flags); 7744 extern void *mmap(void *__addr, size_t __len, int __prot, int __flags, 7745 int __fd, off_t __offset); 7746 extern void *mmap64(void *__addr, size_t __len, int __prot, int __flags, 7747 int __fd, off64_t __offset); 7748 extern int mprotect(void *__addr, size_t __len, int __prot); 7749 extern void *mremap(void *__addr, size_t __old_len, size_t __new_len, 7750 int __flags, ...); 7751 extern int msync(void *__addr, size_t __len, int __flags); 7752 extern int munlock(const void *__addr, size_t __len); 7753 extern int munlockall(void); 7754 extern int munmap(void *__addr, size_t __len); 7755 extern int posix_madvise(void *__addr, size_t __len, int __advice); 7756 extern int shm_open(const char *__name, int __oflag, mode_t __mode); 7757 extern int shm_unlink(const char *__name); 7758 __________________________________________________________ 7759 7760 13.4.64. sys/msg.h 7761 7762 #define MSG_NOERROR 010000 7763 7764 extern int msgctl(int __msqid, int __cmd, struct msqid_ds *__buf); 7765 extern int msgget(key_t __key, int __msgflg); 7766 extern ssize_t msgrcv(int __msqid, void *__msgp, size_t __msgsz, 7767 long int __msgtyp, int __msgflg); 7768 extern int msgsnd(int __msqid, const void *__msgp, size_t __msgsz, 7769 int __msgflg); 7770 __________________________________________________________ 7771 7772 13.4.65. sys/param.h 7773 7774 #define NOFILE 256 7775 #define MAXPATHLEN 4096 7776 __________________________________________________________ 7777 7778 13.4.66. sys/poll.h 7779 7780 #define POLLIN 0x0001 /* There is data to read */ 7781 #define POLLPRI 0x0002 /* There is urgent data to read */ 7782 #define POLLOUT 0x0004 /* Writing now will not block */ 7783 #define POLLERR 0x0008 /* Error condition */ 7784 #define POLLHUP 0x0010 /* Hung up */ 7785 #define POLLNVAL 0x0020 /* Invalid request: fd not open */ 7786 #define POLLRDNORM 0x0040 /* Normal data may be read */ 7787 #define POLLRDBAND 0x0080 /* Priority data may be read */ 7788 #define POLLWRNORM 0x0100 /* Writing now will not block */ 7789 #define POLLWRBAND 0x0200 /* Priority data may be written */ 7790 7791 struct pollfd { 7792 int fd; /* File descriptor to poll. */ 7793 short events; /* Types of events poller cares about. */ 7794 short revents; /* Types of events that actually occurred. */ 7795 }; 7796 typedef unsigned long int nfds_t; 7797 __________________________________________________________ 7798 7799 13.4.67. sys/resource.h 7800 7801 #define RUSAGE_CHILDREN (-1) 7802 #define RLIM_INFINITY (~0UL) 7803 #define RLIM_SAVED_CUR -1 7804 #define RLIM_SAVED_MAX -1 7805 #define RLIMIT_CPU 0 7806 #define RUSAGE_SELF 0 7807 #define RLIMIT_FSIZE 1 7808 #define RLIMIT_LOCKS 10 7809 #define RLIM_NLIMITS 11 7810 #define RLIMIT_DATA 2 7811 #define RLIMIT_STACK 3 7812 #define RLIMIT_CORE 4 7813 #define RLIMIT_RSS 5 7814 #define RLIMIT_NPROC 6 7815 #define RLIMIT_NOFILE 7 7816 #define RLIMIT_MEMLOCK 8 7817 #define RLIMIT_AS 9 7818 7819 typedef unsigned long int rlim_t; 7820 typedef unsigned long long int rlim64_t; 7821 typedef int __rlimit_resource_t; 7822 7823 struct rlimit { 7824 rlim_t rlim_cur; /* The current (soft) limit. */ 7825 rlim_t rlim_max; /* The hard limit. */ 7826 }; 7827 struct rlimit64 { 7828 rlim64_t rlim_cur; /* The current (soft) limit. */ 7829 rlim64_t rlim_max; /* The hard limit. */ 7830 }; 7831 7832 struct rusage { 7833 struct timeval ru_utime; /* Total amount of user time used. */ 7834 struct timeval ru_stime; /* Total amount of system time used. */ 7835 long int ru_maxrss; /* Maximum resident set size (in kilobytes). */ 7836 long int ru_ixrss; /* Amount of sharing of text segment memory with other p */ 7837 long int ru_idrss; /* Amount of data segment memory used (kilobyte-seconds). */ 7838 long int ru_isrss; /* Amount of stack memory used (kilobyte-seconds). */ 7839 long int ru_minflt; /* Number of soft page faults (i.e. those serviced by reclaimin */ 7840 long int ru_majflt; /* Number of hard page faults (i.e. those that required I/O). */ 7841 long int ru_nswap; /* Number of times a process was swapped out of physical memory */ 7842 long int ru_inblock; /* Number of input operations via the file system. Note: This */ 7843 long int ru_oublock; /* Number of output operations via the file system. */ 7844 long int ru_msgsnd; /* Number of IPC messages sent. */ 7845 long int ru_msgrcv; /* Number of IPC messages received. */ 7846 long int ru_nsignals; /* Number of signals delivered. */ 7847 long int ru_nvcsw; /* Number of voluntary context switches, i.e. because the proce */ 7848 long int ru_nivcsw; /* Number of involuntary context switches, i.e. a higher priori */ 7849 }; 7850 7851 enum __priority_which { 7852 PRIO_PROCESS = 0, /* WHO is a process ID. */ 7853 PRIO_PGRP = 1, /* WHO is a process group ID. */ 7854 PRIO_USER = 2 /* WHO is a user ID. */ 7855 }; 7856 7857 #define PRIO_PGRP PRIO_PGRP 7858 #define PRIO_PROCESS PRIO_PROCESS 7859 #define PRIO_USER PRIO_USER 7860 7861 typedef enum __priority_which __priority_which_t; 7862 extern int getpriority(__priority_which_t __which, id_t __who); 7863 extern int getrlimit(__rlimit_resource_t __resource, 7864 struct rlimit *__rlimits); 7865 extern int getrlimit64(id_t __resource, struct rlimit64 *__rlimits); 7866 extern int getrusage(int __who, struct rusage *__usage); 7867 extern int setpriority(__priority_which_t __which, id_t __who, int __prio); 7868 extern int setrlimit(__rlimit_resource_t __resource, 7869 const struct rlimit *__rlimits); 7870 extern int setrlimit64(__rlimit_resource_t __resource, 7871 const struct rlimit64 *__rlimits); 7872 __________________________________________________________ 7873 7874 13.4.68. sys/select.h 7875 7876 #define NFDBITS (8 * sizeof (long)) 7877 7878 extern int pselect(int __nfds, fd_set * __readfds, fd_set * __writefds, 7879 fd_set * __exceptfds, const struct timespec *__timeout, 7880 const sigset_t * __sigmask); 7881 __________________________________________________________ 7882 7883 13.4.69. sys/sem.h 7884 7885 #define SEM_UNDO 0x1000 7886 #define GETPID 11 7887 #define GETVAL 12 7888 #define GETALL 13 7889 #define GETNCNT 14 7890 #define GETZCNT 15 7891 #define SETVAL 16 7892 #define SETALL 17 7893 7894 struct sembuf { 7895 short sem_num; 7896 short sem_op; 7897 short sem_flg; 7898 }; 7899 extern int semctl(int __semid, int __semnum, int __cmd, ...); 7900 extern int semget(key_t __key, int __nsems, int __semflg); 7901 extern int semop(int __semid, struct sembuf *__sops, size_t __nsops); 7902 __________________________________________________________ 7903 7904 13.4.70. sys/sendfile.h 7905 7906 extern ssize_t sendfile(int __out_fd, int __in_fd, off_t * __offset, 7907 size_t __count); 7908 extern ssize_t sendfile64(int __out_fd, int __in_fd, off64_t * __offset, 7909 size_t __count); 7910 __________________________________________________________ 7911 7912 13.4.71. sys/shm.h 7913 7914 #define SHM_RDONLY 010000 7915 #define SHM_W 0200 7916 #define SHM_RND 020000 7917 #define SHM_R 0400 7918 #define SHM_REMAP 040000 7919 #define SHM_LOCK 11 7920 #define SHM_UNLOCK 12 7921 7922 extern int __getpagesize(void); 7923 extern void *shmat(int __shmid, const void *__shmaddr, int __shmflg); 7924 extern int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf); 7925 extern int shmdt(const void *__shmaddr); 7926 extern int shmget(key_t __key, size_t __size, int __shmflg); 7927 __________________________________________________________ 7928 7929 13.4.72. sys/socket.h 7930 7931 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 7932 #define SCM_RIGHTS 0x01 7933 #define SOL_SOCKET 1 7934 #define SOMAXCONN 128 7935 #define SOL_RAW 255 7936 #define CMSG_ALIGN(len) \ 7937 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 7938 #define CMSG_DATA(cmsg) \ 7939 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 7940 #define CMSG_SPACE(len) \ 7941 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 7942 #define CMSG_FIRSTHDR(msg) \ 7943 ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ 7944 (struct cmsghdr *)(msg)->msg_control : \ 7945 (struct cmsghdr *)NULL) 7946 #define CMSG_NXTHDR(mhdr,cmsg) \ 7947 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 7948 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 7949 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 7950 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \ 7951 (struct cmsghdr *)NULL : \ 7952 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 7953 7954 struct linger { 7955 int l_onoff; 7956 int l_linger; 7957 }; 7958 struct cmsghdr { 7959 size_t cmsg_len; 7960 int cmsg_level; 7961 int cmsg_type; 7962 }; 7963 struct iovec { 7964 void *iov_base; 7965 size_t iov_len; 7966 }; 7967 7968 typedef unsigned short sa_family_t; 7969 typedef unsigned int socklen_t; 7970 7971 struct sockaddr { 7972 sa_family_t sa_family; 7973 char sa_data[14]; 7974 }; 7975 struct sockaddr_storage { 7976 sa_family_t ss_family; 7977 __ss_aligntype __ss_align; 7978 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 7979 }; 7980 7981 struct msghdr { 7982 void *msg_name; 7983 int msg_namelen; 7984 struct iovec *msg_iov; 7985 size_t msg_iovlen; 7986 void *msg_control; 7987 size_t msg_controllen; 7988 unsigned int msg_flags; 7989 }; 7990 7991 #define AF_UNSPEC 0 7992 #define AF_UNIX 1 7993 #define AF_INET6 10 7994 #define AF_INET 2 7995 7996 #define PF_INET AF_INET 7997 #define PF_INET6 AF_INET6 7998 #define PF_UNIX AF_UNIX 7999 #define PF_UNSPEC AF_UNSPEC 8000 8001 #define SOCK_STREAM 1 8002 #define SOCK_PACKET 10 8003 #define SOCK_DGRAM 2 8004 #define SOCK_RAW 3 8005 #define SOCK_RDM 4 8006 #define SOCK_SEQPACKET 5 8007 8008 #define SO_DEBUG 1 8009 #define SO_OOBINLINE 10 8010 #define SO_NO_CHECK 11 8011 #define SO_PRIORITY 12 8012 #define SO_LINGER 13 8013 #define SO_BSDCOMPAT 14 8014 #define SO_REUSEADDR 2 8015 #define SO_TYPE 3 8016 #define SO_ACCEPTCONN 30 8017 #define SO_ERROR 4 8018 #define SO_DONTROUTE 5 8019 #define SO_BROADCAST 6 8020 #define SO_SNDBUF 7 8021 #define SO_RCVBUF 8 8022 #define SO_KEEPALIVE 9 8023 8024 #define SIOCGIFNAME 0x8910 8025 #define SIOCGIFCONF 0x8912 8026 #define SIOCGIFFLAGS 0x8913 8027 #define SIOCGIFADDR 0x8915 8028 #define SIOCGIFDSTADDR 0x8917 8029 #define SIOCGIFBRDADDR 0x8919 8030 #define SIOCGIFNETMASK 0x891b 8031 #define SIOCGIFMTU 0x8921 8032 #define SIOCGIFHWADDR 0x8927 8033 8034 #define SHUT_RD 0 8035 #define SHUT_WR 1 8036 #define SHUT_RDWR 2 8037 8038 #define MSG_WAITALL 0x100 8039 #define MSG_TRUNC 0x20 8040 #define MSG_NOSIGNAL 0x4000 8041 #define MSG_EOR 0x80 8042 #define MSG_OOB 1 8043 #define MSG_PEEK 2 8044 #define MSG_DONTROUTE 4 8045 #define MSG_CTRUNC 8 8046 8047 extern ssize_t __recv_chk(int, void *, size_t, size_t, int); 8048 extern ssize_t __recvfrom_chk(int, void *, size_t, size_t, int, 8049 struct sockaddr *, socklen_t *); 8050 extern int accept(int __fd, struct sockaddr *__addr, 8051 socklen_t * __addr_len); 8052 extern int bind(int __fd, const struct sockaddr *__addr, socklen_t __len); 8053 extern int connect(int __fd, const struct sockaddr *__addr, 8054 socklen_t __len); 8055 extern int getnameinfo(const struct sockaddr *__sa, socklen_t __salen, 8056 char *__host, socklen_t __hostlen, char *__serv, 8057 socklen_t __servlen, unsigned int __flags); 8058 extern int getpeername(int __fd, struct sockaddr *__addr, 8059 socklen_t * __len); 8060 extern int getsockname(int __fd, struct sockaddr *__addr, 8061 socklen_t * __len); 8062 extern int getsockopt(int __fd, int __level, int __optname, void *__optval, 8063 socklen_t * __optlen); 8064 extern int listen(int __fd, int __n); 8065 extern ssize_t recv(int __fd, void *__buf, size_t __n, int __flags); 8066 extern ssize_t recvfrom(int __fd, void *__buf, size_t __n, int __flags, 8067 struct sockaddr *__addr, socklen_t * __addr_len); 8068 extern ssize_t recvmsg(int __fd, struct msghdr *__message, int __flags); 8069 extern ssize_t send(int __fd, const void *__buf, size_t __n, int __flags); 8070 extern ssize_t sendmsg(int __fd, const struct msghdr *__message, 8071 int __flags); 8072 extern ssize_t sendto(int __fd, const void *__buf, size_t __n, int __flags, 8073 const struct sockaddr *__addr, socklen_t __addr_len); 8074 extern int setsockopt(int __fd, int __level, int __optname, 8075 const void *__optval, socklen_t __optlen); 8076 extern int shutdown(int __fd, int __how); 8077 extern int sockatmark(int __fd); 8078 extern int socket(int __domain, int __type, int __protocol); 8079 extern int socketpair(int __domain, int __type, int __protocol, 8080 int __fds[2]); 8081 __________________________________________________________ 8082 8083 13.4.73. sys/stat.h 8084 8085 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 8086 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 8087 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 8088 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 8089 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 8090 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 8091 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 8092 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 8093 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 8094 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 8095 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 8096 #define S_IROTH (S_IRGRP>>3) 8097 #define S_IRGRP (S_IRUSR>>3) 8098 #define S_IRWXO (S_IRWXG>>3) 8099 #define S_IRWXG (S_IRWXU>>3) 8100 #define S_IWOTH (S_IWGRP>>3) 8101 #define S_IWGRP (S_IWUSR>>3) 8102 #define S_IXOTH (S_IXGRP>>3) 8103 #define S_IXGRP (S_IXUSR>>3) 8104 #define S_ISVTX 01000 8105 #define S_IXUSR 0x0040 8106 #define S_IWUSR 0x0080 8107 #define S_IRUSR 0x0100 8108 #define S_ISGID 0x0400 8109 #define S_ISUID 0x0800 8110 #define S_IFIFO 0x1000 8111 #define S_IFCHR 0x2000 8112 #define S_IFDIR 0x4000 8113 #define S_IFBLK 0x6000 8114 #define S_IFREG 0x8000 8115 #define S_IFLNK 0xa000 8116 #define S_IFSOCK 0xc000 8117 #define S_IFMT 0xf000 8118 #define st_atime st_atim.tv_sec 8119 #define st_ctime st_ctim.tv_sec 8120 #define st_mtime st_mtim.tv_sec 8121 #define S_IREAD S_IRUSR 8122 #define S_IWRITE S_IWUSR 8123 #define S_IEXEC S_IXUSR 8124 8125 extern int __fxstat(int __ver, int __fildes, struct stat *__stat_buf); 8126 extern int __fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf); 8127 extern int __fxstatat(int __ver, int __fildes, const char *__filename, 8128 struct stat *__stat_buf, int __flag); 8129 extern int __fxstatat64(int __ver, int __fildes, const char *__filename, 8130 struct stat64 *__stat_buf, int __flag); 8131 extern int __lxstat(int __ver, const char *__filename, 8132 struct stat *__stat_buf); 8133 extern int __lxstat64(int __ver, const char *__filename, 8134 struct stat64 *__stat_buf); 8135 extern int __xmknod(int __ver, const char *__path, mode_t __mode, 8136 dev_t * __dev); 8137 extern int __xmknodat(int __ver, int __fd, const char *__path, 8138 mode_t __mode, dev_t * __dev); 8139 extern int __xstat(int __ver, const char *__filename, 8140 struct stat *__stat_buf); 8141 extern int __xstat64(int __ver, const char *__filename, 8142 struct stat64 *__stat_buf); 8143 extern int chmod(const char *__file, mode_t __mode); 8144 extern int fchmod(int __fd, mode_t __mode); 8145 extern int fchmodat(int __fd, const char *__file, mode_t mode, int __flag); 8146 extern int mkdirat(int __fd, const char *__path, mode_t __mode); 8147 extern int mkfifo(const char *__path, mode_t __mode); 8148 extern int mkfifoat(int __fd, const char *__path, mode_t __mode); 8149 extern mode_t umask(mode_t __mask); 8150 __________________________________________________________ 8151 8152 13.4.74. sys/statfs.h 8153 8154 #define NFS_SUPER_MAGIC 0x6969 8155 8156 extern int fstatfs(int __fildes, struct statfs *__buf); 8157 extern int fstatfs64(int __fildes, struct statfs64 *__buf); 8158 extern int statfs(const char *__file, struct statfs *__buf); 8159 extern int statfs64(const char *__file, struct statfs64 *__buf); 8160 __________________________________________________________ 8161 8162 13.4.75. sys/statvfs.h 8163 8164 extern int fstatvfs(int __fildes, struct statvfs *__buf); 8165 extern int fstatvfs64(int __fildes, struct statvfs64 *__buf); 8166 extern int statvfs(const char *__file, struct statvfs *__buf); 8167 extern int statvfs64(const char *__file, struct statvfs64 *__buf); 8168 __________________________________________________________ 8169 8170 13.4.76. sys/time.h 8171 8172 #define ITIMER_REAL 0 8173 #define ITIMER_VIRTUAL 1 8174 #define ITIMER_PROF 2 8175 8176 struct timezone { 8177 int tz_minuteswest; 8178 int tz_dsttime; 8179 }; 8180 8181 typedef int __itimer_which_t; 8182 8183 struct timespec { 8184 time_t tv_sec; 8185 long int tv_nsec; 8186 }; 8187 8188 struct timeval { 8189 time_t tv_sec; 8190 suseconds_t tv_usec; 8191 }; 8192 8193 struct itimerval { 8194 struct timeval it_interval; 8195 struct timeval it_value; 8196 }; 8197 extern int adjtime(const struct timeval *__delta, 8198 struct timeval *__olddelta); 8199 extern int getitimer(__itimer_which_t __which, struct itimerval *__value); 8200 extern int gettimeofday(struct timeval *__tv, struct timezone *__tz); 8201 extern int setitimer(__itimer_which_t __which, 8202 const struct itimerval *__new, 8203 struct itimerval *__old); 8204 extern int utimes(const char *__file, const struct timeval *__tvp); 8205 __________________________________________________________ 8206 8207 13.4.77. sys/timeb.h 8208 8209 struct timeb { 8210 time_t time; /* Seconds since epoch, as from time. */ 8211 unsigned short millitm; /* Additional milliseconds. */ 8212 short timezone; /* Minutes west of GMT. */ 8213 short dstflag; /* Nonzero if Daylight Savings Time used. */ 8214 }; 8215 extern int ftime(struct timeb *__timebuf); 8216 __________________________________________________________ 8217 8218 13.4.78. sys/times.h 8219 8220 struct tms { 8221 clock_t tms_utime; 8222 clock_t tms_stime; 8223 clock_t tms_cutime; 8224 clock_t tms_cstime; 8225 }; 8226 extern clock_t times(struct tms *__buffer); 8227 __________________________________________________________ 8228 8229 13.4.79. sys/types.h 8230 8231 #ifndef FALSE 8232 #define FALSE 0 8233 #endif 8234 #ifndef TRUE 8235 #define TRUE 1 8236 #endif 8237 #define FD_SETSIZE 1024 8238 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 8239 #define FD_ISSET(d,set) \ 8240 ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) 8241 #define FD_CLR(d,set) \ 8242 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) 8243 #define FD_SET(d,set) \ 8244 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 8245 8246 typedef unsigned char u_int8_t; 8247 typedef unsigned short u_int16_t; 8248 typedef unsigned int u_int32_t; 8249 typedef unsigned long long int u_int64_t; 8250 typedef unsigned int uid_t; 8251 typedef int pid_t; 8252 typedef long int off_t; 8253 typedef int key_t; 8254 typedef long int suseconds_t; 8255 typedef unsigned int u_int; 8256 typedef struct { 8257 int __val[2]; 8258 } fsid_t; 8259 typedef unsigned int useconds_t; 8260 typedef long int blksize_t; 8261 typedef long int fd_mask; 8262 typedef void *timer_t; 8263 typedef int clockid_t; 8264 8265 typedef unsigned int id_t; 8266 8267 typedef unsigned long long int ino64_t; 8268 typedef long long int loff_t; 8269 typedef long int blkcnt_t; 8270 typedef unsigned long int fsblkcnt_t; 8271 typedef unsigned long int fsfilcnt_t; 8272 typedef long long int blkcnt64_t; 8273 typedef unsigned long long int fsblkcnt64_t; 8274 typedef unsigned long long int fsfilcnt64_t; 8275 typedef unsigned char u_char; 8276 typedef unsigned short u_short; 8277 typedef unsigned long int u_long; 8278 8279 typedef unsigned long int ino_t; 8280 typedef unsigned int gid_t; 8281 typedef unsigned long long int dev_t; 8282 typedef unsigned int mode_t; 8283 typedef unsigned long int nlink_t; 8284 typedef char *caddr_t; 8285 8286 typedef struct { 8287 unsigned long int fds_bits[__FDSET_LONGS]; 8288 } fd_set; 8289 8290 typedef long int clock_t; 8291 typedef long int time_t; 8292 __________________________________________________________ 8293 8294 13.4.80. sys/uio.h 8295 8296 extern ssize_t readv(int __fd, const struct iovec *__iovec, int __count); 8297 extern ssize_t writev(int __fd, const struct iovec *__iovec, int __count); 8298 __________________________________________________________ 8299 8300 13.4.81. sys/un.h 8301 8302 #define UNIX_PATH_MAX 108 8303 8304 struct sockaddr_un { 8305 sa_family_t sun_family; /* AF_UNIX */ 8306 char sun_path[UNIX_PATH_MAX]; 8307 }; 8308 __________________________________________________________ 8309 8310 13.4.82. sys/utsname.h 8311 8312 #define SYS_NMLN 65 8313 8314 struct utsname { 8315 char sysname[65]; 8316 char nodename[65]; 8317 char release[65]; 8318 char version[65]; 8319 char machine[65]; 8320 char domainname[65]; 8321 }; 8322 extern int uname(struct utsname *__name); 8323 __________________________________________________________ 8324 8325 13.4.83. sys/wait.h 8326 8327 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 8328 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 8329 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 8330 #define WTERMSIG(status) ((status) & 0x7f) 8331 #define WCOREDUMP(status) ((status) & 0x80) 8332 #define WIFEXITED(status) (WTERMSIG(status) == 0) 8333 #define WNOHANG 0x00000001 8334 #define WUNTRACED 0x00000002 8335 #define WCOREFLAG 0x80 8336 #define WSTOPSIG(status) WEXITSTATUS(status) 8337 8338 typedef enum { 8339 P_ALL, 8340 P_PID, 8341 P_PGID 8342 } idtype_t; 8343 extern pid_t wait(int *__stat_loc); 8344 extern pid_t wait4(pid_t __pid, int *__stat_loc, int __options, 8345 struct rusage *__usage); 8346 extern int waitid(idtype_t __idtype, id_t __id, siginfo_t * __infop, 8347 int __options); 8348 extern pid_t waitpid(pid_t __pid, int *__stat_loc, int __options); 8349 __________________________________________________________ 8350 8351 13.4.84. syslog.h 8352 8353 #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) 8354 #define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */ 8355 #define LOG_EMERG 0 /* system is unusable */ 8356 #define LOG_PRIMASK 0x07 /* mask to extract priority part */ 8357 #define LOG_ALERT 1 /* action must be taken immediately */ 8358 #define LOG_CRIT 2 /* critical conditions */ 8359 #define LOG_ERR 3 /* error conditions */ 8360 #define LOG_WARNING 4 /* warning conditions */ 8361 #define LOG_NOTICE 5 /* normal but significant condition */ 8362 #define LOG_INFO 6 /* informational */ 8363 #define LOG_DEBUG 7 /* debug-level messages */ 8364 8365 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */ 8366 #define LOG_KERN (0<<3) /* kernel messages */ 8367 #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ 8368 #define LOG_FTP (11<<3) /* ftp daemon */ 8369 #define LOG_USER (1<<3) /* random user-level messages */ 8370 #define LOG_MAIL (2<<3) /* mail system */ 8371 #define LOG_DAEMON (3<<3) /* system daemons */ 8372 #define LOG_AUTH (4<<3) /* security/authorization messages */ 8373 #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ 8374 #define LOG_LPR (6<<3) /* line printer subsystem */ 8375 #define LOG_NEWS (7<<3) /* network news subsystem */ 8376 #define LOG_UUCP (8<<3) /* UUCP subsystem */ 8377 #define LOG_CRON (9<<3) /* clock daemon */ 8378 #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ 8379 8380 #define LOG_LOCAL0 (16<<3) /* reserved for local use */ 8381 #define LOG_LOCAL1 (17<<3) /* reserved for local use */ 8382 #define LOG_LOCAL2 (18<<3) /* reserved for local use */ 8383 #define LOG_LOCAL3 (19<<3) /* reserved for local use */ 8384 #define LOG_LOCAL4 (20<<3) /* reserved for local use */ 8385 #define LOG_LOCAL5 (21<<3) /* reserved for local use */ 8386 #define LOG_LOCAL6 (22<<3) /* reserved for local use */ 8387 #define LOG_LOCAL7 (23<<3) /* reserved for local use */ 8388 8389 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ 8390 #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ 8391 8392 #define LOG_PID 0x01 /* log the pid with each message */ 8393 #define LOG_CONS 0x02 /* log on the console if errors in sending */ 8394 #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ 8395 #define LOG_NDELAY 0x08 /* don't delay open */ 8396 #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ 8397 #define LOG_PERROR 0x20 /* log to stderr as well */ 8398 8399 extern void __syslog_chk(int, int, const char *, ...); 8400 extern void __vsyslog_chk(int, int, const char *, va_list); 8401 extern void closelog(void); 8402 extern void openlog(const char *__ident, int __option, int __facility); 8403 extern int setlogmask(int __mask); 8404 extern void syslog(int __pri, const char *__fmt, ...); 8405 extern void vsyslog(int __pri, const char *__fmt, va_list __ap); 8406 __________________________________________________________ 8407 8408 13.4.85. tar.h 8409 8410 #define REGTYPE '0' 8411 #define LNKTYPE '1' 8412 #define SYMTYPE '2' 8413 #define CHRTYPE '3' 8414 #define BLKTYPE '4' 8415 #define DIRTYPE '5' 8416 #define FIFOTYPE '6' 8417 #define CONTTYPE '7' 8418 #define AREGTYPE '\0' 8419 #define TVERSION "00" 8420 #define TOEXEC 00001 8421 #define TOWRITE 00002 8422 #define TOREAD 00004 8423 #define TGEXEC 00010 8424 #define TGWRITE 00020 8425 #define TGREAD 00040 8426 #define TUEXEC 00100 8427 #define TUWRITE 00200 8428 #define TUREAD 00400 8429 #define TSVTX 01000 8430 #define TSGID 02000 8431 #define TSUID 04000 8432 #define TVERSLEN 2 8433 #define TMAGLEN 6 8434 #define TMAGIC "ustar" 8435 __________________________________________________________ 8436 8437 13.4.86. termios.h 8438 8439 #define TCIFLUSH 0 8440 #define TCOOFF 0 8441 #define TCSANOW 0 8442 #define BS0 0000000 8443 #define CR0 0000000 8444 #define FF0 0000000 8445 #define NL0 0000000 8446 #define TAB0 0000000 8447 #define VT0 0000000 8448 #define OPOST 0000001 8449 #define OCRNL 0000010 8450 #define ONOCR 0000020 8451 #define ONLRET 0000040 8452 #define OFILL 0000100 8453 #define OFDEL 0000200 8454 #define NL1 0000400 8455 #define TCOFLUSH 1 8456 #define TCOON 1 8457 #define TCSADRAIN 1 8458 #define TCIOFF 2 8459 #define TCIOFLUSH 2 8460 #define TCSAFLUSH 2 8461 #define TCION 3 8462 8463 typedef unsigned int speed_t; 8464 typedef unsigned char cc_t; 8465 typedef unsigned int tcflag_t; 8466 8467 #define NCCS 32 8468 8469 struct termios { 8470 tcflag_t c_iflag; /* input mode flags */ 8471 tcflag_t c_oflag; /* output mode flags */ 8472 tcflag_t c_cflag; /* control mode flags */ 8473 tcflag_t c_lflag; /* local mode flags */ 8474 cc_t c_line; /* line discipline */ 8475 cc_t c_cc[NCCS]; /* control characters */ 8476 speed_t c_ispeed; /* input speed */ 8477 speed_t c_ospeed; /* output speed */ 8478 }; 8479 8480 #define VINTR 0 8481 #define VQUIT 1 8482 #define VLNEXT 15 8483 #define VERASE 2 8484 #define VKILL 3 8485 #define VEOF 4 8486 8487 #define IGNBRK 0000001 8488 #define BRKINT 0000002 8489 #define IGNPAR 0000004 8490 #define PARMRK 0000010 8491 #define INPCK 0000020 8492 #define ISTRIP 0000040 8493 #define INLCR 0000100 8494 #define IGNCR 0000200 8495 #define ICRNL 0000400 8496 #define IXANY 0004000 8497 #define IMAXBEL 0020000 8498 8499 #define CS5 0000000 8500 8501 #define ECHO 0000010 8502 8503 #define B0 0000000 8504 #define B50 0000001 8505 #define B75 0000002 8506 #define B110 0000003 8507 #define B134 0000004 8508 #define B150 0000005 8509 #define B200 0000006 8510 #define B300 0000007 8511 #define B600 0000010 8512 #define B1200 0000011 8513 #define B1800 0000012 8514 #define B2400 0000013 8515 #define B4800 0000014 8516 #define B9600 0000015 8517 #define B19200 0000016 8518 #define B38400 0000017 8519 8520 extern speed_t cfgetispeed(const struct termios *__termios_p); 8521 extern speed_t cfgetospeed(const struct termios *__termios_p); 8522 extern void cfmakeraw(struct termios *__termios_p); 8523 extern int cfsetispeed(struct termios *__termios_p, speed_t __speed); 8524 extern int cfsetospeed(struct termios *__termios_p, speed_t __speed); 8525 extern int cfsetspeed(struct termios *__termios_p, speed_t __speed); 8526 extern int tcdrain(int __fd); 8527 extern int tcflow(int __fd, int __action); 8528 extern int tcflush(int __fd, int __queue_selector); 8529 extern int tcgetattr(int __fd, struct termios *__termios_p); 8530 extern pid_t tcgetsid(int __fd); 8531 extern int tcsendbreak(int __fd, int __duration); 8532 extern int tcsetattr(int __fd, int __optional_actions, 8533 const struct termios *__termios_p); 8534 __________________________________________________________ 8535 8536 13.4.87. time.h 8537 8538 #define CLK_TCK ((clock_t)sysconf(2)) 8539 #define CLOCK_REALTIME 0 8540 #define TIMER_ABSTIME 1 8541 #define CLOCKS_PER_SEC 1000000l 8542 8543 struct tm { 8544 int tm_sec; 8545 int tm_min; 8546 int tm_hour; 8547 int tm_mday; 8548 int tm_mon; 8549 int tm_year; 8550 int tm_wday; 8551 int tm_yday; 8552 int tm_isdst; 8553 long int tm_gmtoff; 8554 char *tm_zone; 8555 }; 8556 struct itimerspec { 8557 struct timespec it_interval; 8558 struct timespec it_value; 8559 }; 8560 8561 extern int __daylight; 8562 extern long int __timezone; 8563 extern char *__tzname[]; 8564 extern char *asctime(const struct tm *__tp); 8565 extern char *asctime_r(const struct tm *__tp, char *__buf); 8566 extern clock_t clock(void); 8567 extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id); 8568 extern int clock_getres(clockid_t __clock_id, struct timespec *__res); 8569 extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp); 8570 extern int clock_nanosleep(clockid_t __clock_id, int __flags, 8571 const struct timespec *__req, 8572 struct timespec *__rem); 8573 extern int clock_settime(clockid_t __clock_id, 8574 const struct timespec *__tp); 8575 extern char *ctime(const time_t * __timer); 8576 extern char *ctime_r(const time_t * __timer, char *__buf); 8577 extern int daylight; 8578 extern double difftime(time_t __time1, time_t __time0); 8579 extern struct tm *getdate(const char *__string); 8580 extern int getdate_err; 8581 extern struct tm *gmtime(const time_t * __timer); 8582 extern struct tm *gmtime_r(const time_t * __timer, struct tm *__tp); 8583 extern struct tm *localtime(const time_t * __timer); 8584 extern struct tm *localtime_r(const time_t * __timer, struct tm *__tp); 8585 extern time_t mktime(struct tm *__tp); 8586 extern int nanosleep(const struct timespec *__requested_time, 8587 struct timespec *__remaining); 8588 extern int stime(const time_t * __when); 8589 extern size_t strftime(char *__s, size_t __maxsize, const char *__format, 8590 const struct tm *__tp); 8591 extern char *strptime(const char *__s, const char *__fmt, struct tm *__tp); 8592 extern time_t time(time_t * __timer); 8593 extern int timer_create(clockid_t __clock_id, struct sigevent *__evp, 8594 timer_t * __timerid); 8595 extern int timer_delete(timer_t __timerid); 8596 extern int timer_getoverrun(timer_t __timerid); 8597 extern int timer_gettime(timer_t __timerid, struct itimerspec *__value); 8598 extern int timer_settime(timer_t __timerid, int __flags, 8599 const struct itimerspec *__value, 8600 struct itimerspec *__ovalue); 8601 extern long int timezone; 8602 extern char *tzname[]; 8603 extern void tzset(void); 8604 __________________________________________________________ 8605 8606 13.4.88. ucontext.h 8607 8608 extern int getcontext(ucontext_t * __ucp); 8609 extern void makecontext(ucontext_t * __ucp, void (*__func) (void), 8610 int __argc, ...); 8611 extern int setcontext(const struct ucontext *__ucp); 8612 extern int swapcontext(ucontext_t * __oucp, const struct ucontext *__ucp); 8613 __________________________________________________________ 8614 8615 13.4.89. ulimit.h 8616 8617 #define UL_GETFSIZE 1 8618 #define UL_SETFSIZE 2 8619 8620 extern long int ulimit(int __cmd, ...); 8621 __________________________________________________________ 8622 8623 13.4.90. unistd.h 8624 8625 #define SEEK_SET 0 8626 #define STDIN_FILENO 0 8627 #define SEEK_CUR 1 8628 #define STDOUT_FILENO 1 8629 #define SEEK_END 2 8630 #define STDERR_FILENO 2 8631 8632 typedef long long int off64_t; 8633 8634 #define F_OK 0 8635 #define X_OK 1 8636 #define W_OK 2 8637 #define R_OK 4 8638 8639 #define _POSIX_VDISABLE '\0' 8640 #define _POSIX_CHOWN_RESTRICTED 1 8641 #define _POSIX_JOB_CONTROL 1 8642 #define _POSIX_NO_TRUNC 1 8643 #define _POSIX_SHELL 1 8644 #define _POSIX_FSYNC 200112 8645 #define _POSIX_MAPPED_FILES 200112 8646 #define _POSIX_MEMLOCK 200112 8647 #define _POSIX_MEMLOCK_RANGE 200112 8648 #define _POSIX_MEMORY_PROTECTION 200112 8649 #define _POSIX_SEMAPHORES 200112 8650 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 8651 #define _POSIX_TIMERS 200112 8652 #define _POSIX2_C_BIND 200112L 8653 #define _POSIX2_VERSION 200112L 8654 #define _POSIX_THREADS 200112L 8655 #define _POSIX_VERSION 200112L 8656 8657 #define _PC_LINK_MAX 0 8658 #define _PC_MAX_CANON 1 8659 #define _PC_ASYNC_IO 10 8660 #define _PC_PRIO_IO 11 8661 #define _PC_FILESIZEBITS 13 8662 #define _PC_REC_INCR_XFER_SIZE 14 8663 #define _PC_REC_MIN_XFER_SIZE 16 8664 #define _PC_REC_XFER_ALIGN 17 8665 #define _PC_ALLOC_SIZE_MIN 18 8666 #define _PC_MAX_INPUT 2 8667 #define _PC_2_SYMLINKS 20 8668 #define _PC_NAME_MAX 3 8669 #define _PC_PATH_MAX 4 8670 #define _PC_PIPE_BUF 5 8671 #define _PC_CHOWN_RESTRICTED 6 8672 #define _PC_NO_TRUNC 7 8673 #define _PC_VDISABLE 8 8674 #define _PC_SYNC_IO 9 8675 8676 #define _SC_ARG_MAX 0 8677 #define _SC_CHILD_MAX 1 8678 #define _SC_PRIORITY_SCHEDULING 10 8679 #define _SC_XOPEN_XPG4 100 8680 #define _SC_CHAR_BIT 101 8681 #define _SC_CHAR_MAX 102 8682 #define _SC_CHAR_MIN 103 8683 #define _SC_INT_MAX 104 8684 #define _SC_INT_MIN 105 8685 #define _SC_LONG_BIT 106 8686 #define _SC_WORD_BIT 107 8687 #define _SC_MB_LEN_MAX 108 8688 #define _SC_NZERO 109 8689 #define _SC_TIMERS 11 8690 #define _SC_SSIZE_MAX 110 8691 #define _SC_SCHAR_MAX 111 8692 #define _SC_SCHAR_MIN 112 8693 #define _SC_SHRT_MAX 113 8694 #define _SC_SHRT_MIN 114 8695 #define _SC_UCHAR_MAX 115 8696 #define _SC_UINT_MAX 116 8697 #define _SC_ULONG_MAX 117 8698 #define _SC_USHRT_MAX 118 8699 #define _SC_NL_ARGMAX 119 8700 #define _SC_ASYNCHRONOUS_IO 12 8701 #define _SC_NL_LANGMAX 120 8702 #define _SC_NL_MSGMAX 121 8703 #define _SC_NL_NMAX 122 8704 #define _SC_NL_SETMAX 123 8705 #define _SC_NL_TEXTMAX 124 8706 #define _SC_XBS5_ILP32_OFF32 125 8707 #define _SC_XBS5_ILP32_OFFBIG 126 8708 #define _SC_XBS5_LP64_OFF64 127 8709 #define _SC_XBS5_LPBIG_OFFBIG 128 8710 #define _SC_XOPEN_LEGACY 129 8711 #define _SC_PRIORITIZED_IO 13 8712 #define _SC_XOPEN_REALTIME 130 8713 #define _SC_XOPEN_REALTIME_THREADS 131 8714 #define _SC_ADVISORY_INFO 132 8715 #define _SC_BARRIERS 133 8716 #define _SC_BASE 134 8717 #define _SC_C_LANG_SUPPORT 135 8718 #define _SC_C_LANG_SUPPORT_R 136 8719 #define _SC_CLOCK_SELECTION 137 8720 #define _SC_CPUTIME 138 8721 #define _SC_THREAD_CPUTIME 139 8722 #define _SC_SYNCHRONIZED_IO 14 8723 #define _SC_DEVICE_IO 140 8724 #define _SC_DEVICE_SPECIFIC 141 8725 #define _SC_DEVICE_SPECIFIC_R 142 8726 #define _SC_FD_MGMT 143 8727 #define _SC_FIFO 144 8728 #define _SC_PIPE 145 8729 #define _SC_FILE_ATTRIBUTES 146 8730 #define _SC_FILE_LOCKING 147 8731 #define _SC_FILE_SYSTEM 148 8732 #define _SC_MONOTONIC_CLOCK 149 8733 #define _SC_FSYNC 15 8734 #define _SC_MULTI_PROCESS 150 8735 #define _SC_SINGLE_PROCESS 151 8736 #define _SC_NETWORKING 152 8737 #define _SC_READER_WRITER_LOCKS 153 8738 #define _SC_SPIN_LOCKS 154 8739 #define _SC_REGEXP 155 8740 #define _SC_REGEX_VERSION 156 8741 #define _SC_SHELL 157 8742 #define _SC_SIGNALS 158 8743 #define _SC_SPAWN 159 8744 #define _SC_MAPPED_FILES 16 8745 #define _SC_SPORADIC_SERVER 160 8746 #define _SC_THREAD_SPORADIC_SERVER 161 8747 #define _SC_SYSTEM_DATABASE 162 8748 #define _SC_SYSTEM_DATABASE_R 163 8749 #define _SC_TIMEOUTS 164 8750 #define _SC_TYPED_MEMORY_OBJECTS 165 8751 #define _SC_USER_GROUPS 166 8752 #define _SC_USER_GROUPS_R 167 8753 #define _SC_2_PBS 168 8754 #define _SC_2_PBS_ACCOUNTING 169 8755 #define _SC_MEMLOCK 17 8756 #define _SC_2_PBS_LOCATE 170 8757 #define _SC_2_PBS_MESSAGE 171 8758 #define _SC_2_PBS_TRACK 172 8759 #define _SC_SYMLOOP_MAX 173 8760 #define _SC_STREAMS 174 8761 #define _SC_2_PBS_CHECKPOINT 175 8762 #define _SC_V6_ILP32_OFF32 176 8763 #define _SC_V6_ILP32_OFFBIG 177 8764 #define _SC_V6_LP64_OFF64 178 8765 #define _SC_V6_LPBIG_OFFBIG 179 8766 #define _SC_MEMLOCK_RANGE 18 8767 #define _SC_HOST_NAME_MAX 180 8768 #define _SC_TRACE 181 8769 #define _SC_TRACE_EVENT_FILTER 182 8770 #define _SC_TRACE_INHERIT 183 8771 #define _SC_TRACE_LOG 184 8772 #define _SC_LEVEL1_ICACHE_SIZE 185 8773 #define _SC_LEVEL1_ICACHE_ASSOC 186 8774 #define _SC_LEVEL1_ICACHE_LINESIZE 187 8775 #define _SC_LEVEL1_DCACHE_SIZE 188 8776 #define _SC_LEVEL1_DCACHE_ASSOC 189 8777 #define _SC_MEMORY_PROTECTION 19 8778 #define _SC_LEVEL1_DCACHE_LINESIZE 190 8779 #define _SC_LEVEL2_CACHE_SIZE 191 8780 #define _SC_LEVEL2_CACHE_ASSOC 192 8781 #define _SC_LEVEL2_CACHE_LINESIZE 193 8782 #define _SC_LEVEL3_CACHE_SIZE 194 8783 #define _SC_LEVEL3_CACHE_ASSOC 195 8784 #define _SC_LEVEL3_CACHE_LINESIZE 196 8785 #define _SC_LEVEL4_CACHE_SIZE 197 8786 #define _SC_LEVEL4_CACHE_ASSOC 198 8787 #define _SC_LEVEL4_CACHE_LINESIZE 199 8788 #define _SC_CLK_TCK 2 8789 #define _SC_MESSAGE_PASSING 20 8790 #define _SC_SEMAPHORES 21 8791 #define _SC_SHARED_MEMORY_OBJECTS 22 8792 #define _SC_AIO_LISTIO_MAX 23 8793 #define _SC_IPV6 235 8794 #define _SC_RAW_SOCKETS 236 8795 #define _SC_AIO_MAX 24 8796 #define _SC_AIO_PRIO_DELTA_MAX 25 8797 #define _SC_DELAYTIMER_MAX 26 8798 #define _SC_MQ_OPEN_MAX 27 8799 #define _SC_MQ_PRIO_MAX 28 8800 #define _SC_VERSION 29 8801 #define _SC_NGROUPS_MAX 3 8802 #define _SC_PAGESIZE 30 8803 #define _SC_PAGE_SIZE 30 8804 #define _SC_RTSIG_MAX 31 8805 #define _SC_SEM_NSEMS_MAX 32 8806 #define _SC_SEM_VALUE_MAX 33 8807 #define _SC_SIGQUEUE_MAX 34 8808 #define _SC_TIMER_MAX 35 8809 #define _SC_BC_BASE_MAX 36 8810 #define _SC_BC_DIM_MAX 37 8811 #define _SC_BC_SCALE_MAX 38 8812 #define _SC_BC_STRING_MAX 39 8813 #define _SC_OPEN_MAX 4 8814 #define _SC_COLL_WEIGHTS_MAX 40 8815 #define _SC_EQUIV_CLASS_MAX 41 8816 #define _SC_EXPR_NEST_MAX 42 8817 #define _SC_LINE_MAX 43 8818 #define _SC_RE_DUP_MAX 44 8819 #define _SC_CHARCLASS_NAME_MAX 45 8820 #define _SC_2_VERSION 46 8821 #define _SC_2_C_BIND 47 8822 #define _SC_2_C_DEV 48 8823 #define _SC_2_FORT_DEV 49 8824 #define _SC_STREAM_MAX 5 8825 #define _SC_2_FORT_RUN 50 8826 #define _SC_2_SW_DEV 51 8827 #define _SC_2_LOCALEDEF 52 8828 #define _SC_PII 53 8829 #define _SC_PII_XTI 54 8830 #define _SC_PII_SOCKET 55 8831 #define _SC_PII_INTERNET 56 8832 #define _SC_PII_OSI 57 8833 #define _SC_POLL 58 8834 #define _SC_SELECT 59 8835 #define _SC_TZNAME_MAX 6 8836 #define _SC_IOV_MAX 60 8837 #define _SC_UIO_MAXIOV 60 8838 #define _SC_PII_INTERNET_STREAM 61 8839 #define _SC_PII_INTERNET_DGRAM 62 8840 #define _SC_PII_OSI_COTS 63 8841 #define _SC_PII_OSI_CLTS 64 8842 #define _SC_PII_OSI_M 65 8843 #define _SC_T_IOV_MAX 66 8844 #define _SC_THREADS 67 8845 #define _SC_THREAD_SAFE_FUNCTIONS 68 8846 #define _SC_GETGR_R_SIZE_MAX 69 8847 #define _SC_JOB_CONTROL 7 8848 #define _SC_GETPW_R_SIZE_MAX 70 8849 #define _SC_LOGIN_NAME_MAX 71 8850 #define _SC_TTY_NAME_MAX 72 8851 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 8852 #define _SC_THREAD_KEYS_MAX 74 8853 #define _SC_THREAD_STACK_MIN 75 8854 #define _SC_THREAD_THREADS_MAX 76 8855 #define _SC_THREAD_ATTR_STACKADDR 77 8856 #define _SC_THREAD_ATTR_STACKSIZE 78 8857 #define _SC_THREAD_PRIORITY_SCHEDULING 79 8858 #define _SC_SAVED_IDS 8 8859 #define _SC_THREAD_PRIO_INHERIT 80 8860 #define _SC_THREAD_PRIO_PROTECT 81 8861 #define _SC_THREAD_PROCESS_SHARED 82 8862 #define _SC_NPROCESSORS_CONF 83 8863 #define _SC_NPROCESSORS_ONLN 84 8864 #define _SC_PHYS_PAGES 85 8865 #define _SC_AVPHYS_PAGES 86 8866 #define _SC_ATEXIT_MAX 87 8867 #define _SC_PASS_MAX 88 8868 #define _SC_XOPEN_VERSION 89 8869 #define _SC_REALTIME_SIGNALS 9 8870 #define _SC_XOPEN_XCU_VERSION 90 8871 #define _SC_XOPEN_UNIX 91 8872 #define _SC_XOPEN_CRYPT 92 8873 #define _SC_XOPEN_ENH_I18N 93 8874 #define _SC_XOPEN_SHM 94 8875 #define _SC_2_CHAR_TERM 95 8876 #define _SC_2_C_VERSION 96 8877 #define _SC_2_UPE 97 8878 #define _SC_XOPEN_XPG2 98 8879 #define _SC_XOPEN_XPG3 99 8880 8881 #define _CS_PATH 0 8882 #define _POSIX_REGEXP 1 8883 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 8884 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 8885 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 8886 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 8887 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 8888 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 8889 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 8890 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 8891 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 8892 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 8893 #define _CS_XBS5_LP64_OFF64_LIBS 1110 8894 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 8895 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 8896 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 8897 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 8898 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 8899 8900 #define _XOPEN_XPG4 1 8901 #define _XOPEN_VERSION 500 8902 8903 #define F_ULOCK 0 8904 #define F_LOCK 1 8905 #define F_TLOCK 2 8906 #define F_TEST 3 8907 8908 extern size_t __confstr_chk(int, char *, size_t, size_t); 8909 extern char **__environ; 8910 extern char *__getcwd_chk(char *, size_t, size_t); 8911 extern int __getgroups_chk(int, gid_t *, size_t); 8912 extern int __gethostname_chk(char *, size_t, size_t); 8913 extern int __getlogin_r_chk(char *, size_t, size_t); 8914 extern pid_t __getpgid(pid_t __pid); 8915 extern ssize_t __pread64_chk(int, void *, size_t, off64_t, size_t); 8916 extern ssize_t __pread_chk(int, void *, size_t, off_t, size_t); 8917 extern ssize_t __read_chk(int, void *, size_t, size_t); 8918 extern ssize_t __readlink_chk(const char *, char *, size_t, size_t); 8919 extern int __ttyname_r_chk(int, char *, size_t, size_t); 8920 extern char **_environ; 8921 extern void _exit(int __status); 8922 extern int access(const char *__name, int __type); 8923 extern int acct(const char *__name); 8924 extern unsigned int alarm(unsigned int __seconds); 8925 extern int brk(void *__addr); 8926 extern int chdir(const char *__path); 8927 extern int chown(const char *__file, uid_t __owner, gid_t __group); 8928 extern int chroot(const char *__path); 8929 extern int close(int __fd); 8930 extern size_t confstr(int __name, char *__buf, size_t __len); 8931 extern char *crypt(const char *__key, const char *__salt); 8932 extern char *ctermid(char *__s); 8933 extern char *cuserid(char *__s); 8934 extern int daemon(int __nochdir, int __noclose); 8935 extern int dup(int __fd); 8936 extern int dup2(int __fd, int __fd2); 8937 extern void encrypt(char *__block, int __edflag); 8938 extern int execl(const char *__path, const char *__arg, ...); 8939 extern int execle(const char *__path, const char *__arg, ...); 8940 extern int execlp(const char *__file, const char *__arg, ...); 8941 extern int execv(const char *__path, char *const __argv[]); 8942 extern int execve(const char *__path, char *const __argv[], 8943 char *const __envp[]); 8944 extern int execvp(const char *__file, char *const __argv[]); 8945 extern int faccessat(int __fd, const char *__file, int __type, int __flag); 8946 extern int fchdir(int __fd); 8947 extern int fchown(int __fd, uid_t __owner, gid_t __group); 8948 extern int fchownat(int __fd, const char *__file, uid_t __owner, 8949 gid_t __group, int __flag); 8950 extern int fdatasync(int __fildes); 8951 extern int fexecve(int __fd, char *const __argv[], char *const __envp[]); 8952 extern pid_t fork(void); 8953 extern long int fpathconf(int __fd, int __name); 8954 extern int fsync(int __fd); 8955 extern int ftruncate(int __fd, off_t __length); 8956 extern int ftruncate64(int __fd, off64_t __length); 8957 extern char *getcwd(char *__buf, size_t __size); 8958 extern int getdomainname(char *__name, size_t __len); 8959 extern int getdtablesize(void); 8960 extern gid_t getegid(void); 8961 extern uid_t geteuid(void); 8962 extern gid_t getgid(void); 8963 extern int getgroups(int __size, gid_t __list[]); 8964 extern long int gethostid(void); 8965 extern int gethostname(char *__name, size_t __len); 8966 extern char *getlogin(void); 8967 extern int getlogin_r(char *__name, size_t __name_len); 8968 extern int getopt(int ___argc, char *const ___argv[], 8969 const char *__shortopts); 8970 extern int getpagesize(void); 8971 extern pid_t getpgid(pid_t __pid); 8972 extern pid_t getpgrp(void); 8973 extern pid_t getpid(void); 8974 extern pid_t getppid(void); 8975 extern pid_t getsid(pid_t __pid); 8976 extern uid_t getuid(void); 8977 extern char *getwd(char *__buf); 8978 extern int isatty(int __fd); 8979 extern int lchown(const char *__file, uid_t __owner, gid_t __group); 8980 extern int link(const char *__from, const char *__to); 8981 extern int linkat(int __fromfd, const char *__from, int __tofd, 8982 const char *__to, int __flags); 8983 extern int lockf(int __fd, int __cmd, off_t __len); 8984 extern int lockf64(int __fd, int __cmd, off64_t __len); 8985 extern off_t lseek(int __fd, off_t __offset, int __whence); 8986 extern loff_t lseek64(int __fd, loff_t __offset, int __whence); 8987 extern int mkdir(const char *__path, mode_t __mode); 8988 extern int mkstemp(char *__template); 8989 extern int nice(int __inc); 8990 extern char *optarg; 8991 extern int opterr; 8992 extern int optind; 8993 extern int optopt; 8994 extern long int pathconf(const char *__path, int __name); 8995 extern int pause(void); 8996 extern int pipe(int __pipedes[2]); 8997 extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, 8998 off_t __offset); 8999 extern ssize_t pread64(int __fd, void *__buf, size_t __nbytes, 9000 off64_t __offset); 9001 extern ssize_t pwrite(int __fd, const void *__buf, size_t __n, 9002 off_t __offset); 9003 extern ssize_t pwrite64(int __fd, const void *__buf, size_t __n, 9004 off64_t __offset); 9005 extern ssize_t read(int __fd, void *__buf, size_t __nbytes); 9006 extern ssize_t readlink(const char *__path, char *__buf, size_t __len); 9007 extern ssize_t readlinkat(int __fd, const char *__path, char *__buf, 9008 size_t __len); 9009 extern int rename(const char *__old, const char *__new); 9010 extern int rmdir(const char *__path); 9011 extern void *sbrk(intptr_t __delta); 9012 extern int select(int __nfds, fd_set * __readfds, fd_set * __writefds, 9013 fd_set * __exceptfds, struct timeval *__timeout); 9014 extern int setegid(gid_t __gid); 9015 extern int seteuid(uid_t __uid); 9016 extern int setgid(gid_t __gid); 9017 extern int sethostname(const char *__name, size_t __len); 9018 extern void setkey(const char *__key); 9019 extern int setpgid(pid_t __pid, pid_t __pgid); 9020 extern int setpgrp(void); 9021 extern int setregid(gid_t __rgid, gid_t __egid); 9022 extern int setreuid(uid_t __ruid, uid_t __euid); 9023 extern pid_t setsid(void); 9024 extern int setuid(uid_t __uid); 9025 extern unsigned int sleep(unsigned int __seconds); 9026 extern void swab(const void *__from, void *__to, ssize_t __n); 9027 extern int symlink(const char *__from, const char *__to); 9028 extern int symlinkat(const char *__from, int __tofd, const char *__to); 9029 extern void sync(void); 9030 extern long int sysconf(int __name); 9031 extern pid_t tcgetpgrp(int __fd); 9032 extern int tcsetpgrp(int __fd, pid_t __pgrp_id); 9033 extern int truncate(const char *__file, off_t __length); 9034 extern int truncate64(const char *__file, off64_t __length); 9035 extern char *ttyname(int __fd); 9036 extern int ttyname_r(int __fd, char *__buf, size_t __buflen); 9037 extern unsigned int ualarm(useconds_t __value, useconds_t __interval); 9038 extern int unlink(const char *__name); 9039 extern int unlinkat(int __fd, const char *__name, int __flag); 9040 extern int usleep(useconds_t __useconds); 9041 extern pid_t vfork(void); 9042 extern ssize_t write(int __fd, const void *__buf, size_t __n); 9043 __________________________________________________________ 9044 9045 13.4.91. utime.h 9046 9047 struct utimbuf { 9048 time_t actime; 9049 time_t modtime; 9050 }; 9051 extern int utime(const char *__file, const struct utimbuf *__file_times); 9052 __________________________________________________________ 9053 9054 13.4.92. utmp.h 9055 9056 #define UT_HOSTSIZE 256 9057 #define UT_LINESIZE 32 9058 #define UT_NAMESIZE 32 9059 #define ut_addr ut_addr_v6[0] 9060 #define ut_time ut_tv.tv_sec 9061 #define ut_name ut_user /* Backwards compatability */ 9062 9063 struct exit_status { 9064 short e_termination; /* Process termination status. */ 9065 short e_exit; /* Process exit status. */ 9066 }; 9067 9068 #define EMPTY 0 /* No valid user accounting information. */ 9069 #define RUN_LVL 1 /* The system's runlevel. */ 9070 #define BOOT_TIME 2 /* Time of system boot. */ 9071 #define NEW_TIME 3 /* Time after system clock changed. */ 9072 #define OLD_TIME 4 /* Time when system clock changed. */ 9073 #define INIT_PROCESS 5 /* Process spawned by the init process.*/ 9074 #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ 9075 #define USER_PROCESS 7 /* Normal process. */ 9076 #define DEAD_PROCESS 8 /* Terminated process. */ 9077 #define ACCOUNTING 9 9078 9079 extern void endutent(void); 9080 extern struct utmp *getutent(void); 9081 extern int getutent_r(struct utmp *__buffer, struct utmp **__result); 9082 extern void login(const struct utmp *__entry); 9083 extern int login_tty(int __fd); 9084 extern int logout(const char *__ut_line); 9085 extern void logwtmp(const char *__ut_line, const char *__ut_name, 9086 const char *__ut_host); 9087 extern void setutent(void); 9088 extern int utmpname(const char *__file); 9089 __________________________________________________________ 9090 9091 13.4.93. utmpx.h 9092 9093 extern void endutxent(void); 9094 extern struct utmpx *getutxent(void); 9095 extern struct utmpx *getutxid(const struct utmpx *__id); 9096 extern struct utmpx *getutxline(const struct utmpx *__line); 9097 extern struct utmpx *pututxline(const struct utmpx *__utmpx); 9098 extern void setutxent(void); 9099 __________________________________________________________ 9100 9101 13.4.94. wchar.h 9102 9103 #define WEOF (0xffffffffu) 9104 #define WCHAR_MAX 0x7FFFFFFF 9105 #define WCHAR_MIN 0x80000000 9106 9107 extern wchar_t *__fgetws_chk(wchar_t *, size_t, int, FILE *); 9108 extern wchar_t *__fgetws_unlocked_chk(wchar_t *, size_t, int, FILE *); 9109 extern int __fwprintf_chk(FILE *, int, const wchar_t *, ...); 9110 extern size_t __mbsnrtowcs_chk(wchar_t *, const char **, size_t, size_t, 9111 mbstate_t *, size_t); 9112 extern size_t __mbsrtowcs_chk(wchar_t *, const char **, size_t, 9113 mbstate_t *, size_t); 9114 extern int __swprintf_chk(wchar_t *, size_t, int, size_t, const wchar_t*, 9115 ...); 9116 extern int __vfwprintf_chk(FILE *, int, const wchar_t *, va_list); 9117 extern int __vswprintf_chk(wchar_t *, size_t, int, size_t, const wchar_t *, 9118 va_list); 9119 extern int __vwprintf_chk(int, const wchar_t *, va_list); 9120 extern wchar_t *__wcpcpy_chk(wchar_t *, const wchar_t *, size_t); 9121 extern wchar_t *__wcpncpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9122 extern size_t __wcrtomb_chk(char *, wchar_t, mbstate_t *, size_t); 9123 extern wchar_t *__wcscat_chk(wchar_t *, const wchar_t *, size_t); 9124 extern wchar_t *__wcscpy_chk(wchar_t *, const wchar_t *, size_t); 9125 extern wchar_t *__wcsncat_chk(wchar_t *, const wchar_t *, size_t, size_t); 9126 extern wchar_t *__wcsncpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9127 extern size_t __wcsnrtombs_chk(char *, const wchar_t * *, size_t, size_t, 9128 mbstate_t *, size_t); 9129 extern size_t __wcsrtombs_chk(char *, const wchar_t * *, size_t, 9130 mbstate_t *, size_t); 9131 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 9132 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 9133 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 9134 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 9135 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t * *, 9136 int, int); 9137 extern wchar_t *__wmemcpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9138 extern wchar_t *__wmemmove_chk(wchar_t *, const wchar_t *, size_t, size_t); 9139 extern wchar_t *__wmempcpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9140 extern wchar_t *__wmemset_chk(wchar_t *, wchar_t, size_t, size_t); 9141 extern int __wprintf_chk(int, const wchar_t *, ...); 9142 extern wint_t btowc(int __c); 9143 extern wint_t fgetwc(FILE * __stream); 9144 extern wint_t fgetwc_unlocked(FILE * __stream); 9145 extern wchar_t *fgetws(wchar_t * __ws, int __n, FILE * __stream); 9146 extern wchar_t *fgetws_unlocked(wchar_t * __ws, int __n, FILE * __stream); 9147 extern wint_t fputwc(wchar_t __wc, FILE * __stream); 9148 extern wint_t fputwc_unlocked(wchar_t __wc, FILE * __stream); 9149 extern int fputws(const wchar_t * __ws, FILE * __stream); 9150 extern int fputws_unlocked(const wchar_t * __ws, FILE * __stream); 9151 extern int fwide(FILE * __fp, int __mode); 9152 extern int fwprintf(FILE * __stream, const wchar_t * __format, ...); 9153 extern int fwscanf(FILE * __stream, const wchar_t * __format, ...); 9154 extern wint_t getwc(FILE * __stream); 9155 extern wint_t getwc_unlocked(FILE * __stream); 9156 extern wint_t getwchar(void); 9157 extern wint_t getwchar_unlocked(void); 9158 extern size_t mbrlen(const char *__s, size_t __n, mbstate_t * __ps); 9159 extern size_t mbrtowc(wchar_t * __pwc, const char *__s, size_t __n, 9160 mbstate_t * __p); 9161 extern int mbsinit(const mbstate_t * __ps); 9162 extern size_t mbsnrtowcs(wchar_t * __dst, const char **__src, size_t __nmc, 9163 size_t __len, mbstate_t * __ps); 9164 extern size_t mbsrtowcs(wchar_t * __dst, const char **__src, size_t __len, 9165 mbstate_t * __ps); 9166 extern FILE *open_wmemstream(wchar_t * *__bufloc, size_t * __sizeloc); 9167 extern wint_t putwc(wchar_t __wc, FILE * __stream); 9168 extern wint_t putwc_unlocked(wchar_t __wc, FILE * __stream); 9169 extern wint_t putwchar(wchar_t __wc); 9170 extern wint_t putwchar_unlocked(wchar_t __wc); 9171 extern int swprintf(wchar_t * __s, size_t __n, const wchar_t * __format, 9172 ...); 9173 extern int swscanf(const wchar_t * __s, const wchar_t * __format, ...); 9174 extern wint_t ungetwc(wint_t __wc, FILE * __stream); 9175 extern int vfwprintf(FILE * __s, const wchar_t * __format, va_list __arg); 9176 extern int vfwscanf(FILE * __s, const wchar_t * __format, va_list __arg); 9177 extern int vswprintf(wchar_t * __s, size_t __n, const wchar_t * __format, 9178 va_list __arg); 9179 extern int vswscanf(const wchar_t * __s, const wchar_t * __format, 9180 va_list __arg); 9181 extern int vwprintf(const wchar_t * __format, va_list __arg); 9182 extern int vwscanf(const wchar_t * __format, va_list __arg); 9183 extern wchar_t *wcpcpy(wchar_t * __dest, const wchar_t * __src); 9184 extern wchar_t *wcpncpy(wchar_t * __dest, const wchar_t * __src, 9185 size_t __n); 9186 extern size_t wcrtomb(char *__s, wchar_t __wc, mbstate_t * __ps); 9187 extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2); 9188 extern wchar_t *wcscat(wchar_t * __dest, const wchar_t * __src); 9189 extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc); 9190 extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2); 9191 extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2); 9192 extern wchar_t *wcscpy(wchar_t * __dest, const wchar_t * __src); 9193 extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject); 9194 extern wchar_t *wcsdup(const wchar_t * __s); 9195 extern size_t wcsftime(wchar_t * __s, size_t __maxsize, 9196 const wchar_t * __format, const struct tm *__tp); 9197 extern size_t wcslen(const wchar_t * __s); 9198 extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, 9199 size_t __n); 9200 extern wchar_t *wcsncat(wchar_t * __dest, const wchar_t * __src, 9201 size_t __n); 9202 extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); 9203 extern wchar_t *wcsncpy(wchar_t * __dest, const wchar_t * __src, 9204 size_t __n); 9205 extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen); 9206 extern size_t wcsnrtombs(char *__dst, const wchar_t * *__src, size_t __nwc, 9207 size_t __len, mbstate_t * __ps); 9208 extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept); 9209 extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc); 9210 extern size_t wcsrtombs(char *__dst, const wchar_t * *__src, size_t __len, 9211 mbstate_t * __ps); 9212 extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept); 9213 extern wchar_t *wcsstr(const wchar_t * __haystack, 9214 const wchar_t * __needle); 9215 extern double wcstod(const wchar_t * __nptr, wchar_t * *__endptr); 9216 extern float wcstof(const wchar_t * __nptr, wchar_t * *__endptr); 9217 extern wchar_t *wcstok(wchar_t * __s, const wchar_t * __delim, 9218 wchar_t * *__ptr); 9219 extern long int wcstol(const wchar_t * __nptr, wchar_t * *__endptr, 9220 int __base); 9221 extern long double wcstold(const wchar_t * __nptr, wchar_t * *__endptr); 9222 extern long long int wcstoll(const wchar_t * __nptr, wchar_t * *__endptr, 9223 int __base); 9224 extern long long int wcstoq(const wchar_t * __nptr, wchar_t * *__endptr, 9225 int __base); 9226 extern unsigned long int wcstoul(const wchar_t * __nptr, 9227 wchar_t * *__endptr, int __base); 9228 extern unsigned long long int wcstoull(const wchar_t * __nptr, 9229 wchar_t * *__endptr, int __base); 9230 extern unsigned long long int wcstouq(const wchar_t * __nptr, 9231 wchar_t * *__endptr, int __base); 9232 extern wchar_t *wcswcs(const wchar_t * __haystack, 9233 const wchar_t * __needle); 9234 extern int wcswidth(const wchar_t * __s, size_t __n); 9235 extern size_t wcsxfrm(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9236 extern int wctob(wint_t __c); 9237 extern int wcwidth(wchar_t __c); 9238 extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n); 9239 extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); 9240 extern wchar_t *wmemcpy(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9241 extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9242 extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n); 9243 extern int wprintf(const wchar_t * __format, ...); 9244 extern int wscanf(const wchar_t * __format, ...); 9245 __________________________________________________________ 9246 9247 13.4.95. wctype.h 9248 9249 typedef unsigned long int wctype_t; 9250 typedef unsigned int wint_t; 9251 typedef const int32_t *wctrans_t; 9252 typedef struct { 9253 int count; 9254 wint_t value; 9255 } __mbstate_t; 9256 9257 typedef __mbstate_t mbstate_t; 9258 extern int iswalnum(wint_t __wc); 9259 extern int iswalpha(wint_t __wc); 9260 extern int iswblank(wint_t __wc); 9261 extern int iswcntrl(wint_t __wc); 9262 extern int iswctype(wint_t __wc, wctype_t __desc); 9263 extern int iswdigit(wint_t __wc); 9264 extern int iswgraph(wint_t __wc); 9265 extern int iswlower(wint_t __wc); 9266 extern int iswprint(wint_t __wc); 9267 extern int iswpunct(wint_t __wc); 9268 extern int iswspace(wint_t __wc); 9269 extern int iswupper(wint_t __wc); 9270 extern int iswxdigit(wint_t __wc); 9271 extern wint_t towctrans(wint_t __wc, wctrans_t __desc); 9272 extern wint_t towlower(wint_t __wc); 9273 extern wint_t towupper(wint_t __wc); 9274 extern wctrans_t wctrans(const char *__property); 9275 extern wctype_t wctype(const char *__property); 9276 __________________________________________________________ 9277 9278 13.4.96. wordexp.h 9279 9280 enum { 9281 WRDE_DOOFFS = 1, 9282 WRDE_APPEND = 2, 9283 WRDE_NOCMD = 4, 9284 WRDE_REUSE = 8, 9285 WRDE_SHOWERR = 16, 9286 WRDE_UNDEF = 32 9287 }; 9288 9289 typedef struct { 9290 size_t we_wordc; 9291 char **we_wordv; 9292 size_t we_offs; 9293 } wordexp_t; 9294 9295 enum { 9296 WRDE_NOSYS = -1, 9297 WRDE_NOSPACE = 1, 9298 WRDE_BADCHAR = 2, 9299 WRDE_BADVAL = 3, 9300 WRDE_CMDSUB = 4, 9301 WRDE_SYNTAX = 5 9302 }; 9303 extern int wordexp(const char *__words, wordexp_t * __pwordexp, 9304 int __flags); 9305 extern void wordfree(wordexp_t * __wordexp); 9306 __________________________________________________________ 9307 9308 13.5. Interface Definitions for libc 9309 9310 Table of Contents 9311 _IO_feof -- alias for feof 9312 _IO_getc -- alias for getc 9313 _IO_putc -- alias for putc 9314 _IO_puts -- alias for puts 9315 __assert_fail -- abort the program after false assertion 9316 __chk_fail -- terminate a function in case of buffer overflow 9317 __confstr_chk -- get configuration dependent string variables, 9318 with buffer overflow checking 9319 9320 __ctype_b_loc -- accessor function for __ctype_b array for 9321 ctype functions 9322 9323 __ctype_get_mb_cur_max -- maximum length of a multibyte 9324 character in the current locale 9325 9326 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 9327 array for ctype tolower() function 9328 9329 __ctype_toupper_loc -- accessor function for 9330 __ctype_b_toupper() array for ctype toupper() function 9331 9332 __cxa_atexit -- register a function to be called by exit or 9333 when a shared library is unloaded 9334 9335 __cxa_finalize -- call destructors of global (or local static) 9336 C++ objects and exit functions registered with atexit 9337 9338 __daylight -- external daylight savings time flag 9339 __environ -- alias for environ - user environment 9340 __errno_location -- address of errno variable 9341 __fgets_chk -- string input, with buffer overflow checking 9342 __fgets_unlocked_chk -- non-locking string input, with buffer 9343 overflow checking 9344 9345 __fgetws_chk -- read a wide-character string from a FILE 9346 stream, with buffer overflow checking 9347 9348 __fgetws_unlocked_chk -- read a wide-character string from a 9349 FILE stream in a non-locking manner, with stack checking 9350 9351 __fpending -- returns in bytes the amount of output pending on 9352 a stream 9353 9354 __fprintf_chk -- convert formatted output, with stack checking 9355 __fwprintf_chk -- convert formatted wide-character output, with 9356 stack checking 9357 9358 __fxstatat -- get file status relative to directory file 9359 descriptor 9360 9361 __fxstatat64 -- get file status relative to directory file 9362 descriptor 9363 9364 __getcwd_chk -- get current working directory, with buffer 9365 overflow checking 9366 9367 __getgroups_chk -- get list of supplementary group IDs, with 9368 buffer overflow checking 9369 9370 __gethostname_chk -- get host name, with buffer overflow 9371 checking 9372 9373 __getlogin_r_chk -- get user name, with buffer overflow 9374 checking (reentrant) 9375 9376 __getpagesize -- alias for getpagesize - get current page size 9377 __getpgid -- get the process group id 9378 __h_errno_location -- address of h_errno variable 9379 __isinf -- test for infinity 9380 __isinff -- test for infinity 9381 __isinfl -- test for infinity 9382 __isnan -- test for infinity 9383 __isnanf -- test for infinity 9384 __isnanl -- test for infinity 9385 __libc_current_sigrtmax -- return number of available real-time 9386 signal with lowest priority 9387 9388 __libc_current_sigrtmin -- return number of available real-time 9389 signal with highest priority 9390 9391 __libc_start_main -- initialization routine 9392 __mbsnrtowcs_chk -- convert a multibyte string to a 9393 wide-character string, with buffer overflow checking 9394 9395 __mbsrtowcs_chk -- convert a multibyte string to a 9396 wide-character string, with buffer overflow checking 9397 9398 __mbstowcs_chk -- convert a multibyte string to a 9399 wide-character string, with buffer overflow checking 9400 9401 __memcpy_chk -- copy memory area, with buffer overflow checking 9402 __memmove_chk -- copy memory area, with buffer overflow 9403 checking 9404 9405 __mempcpy -- copy given number of bytes of source to 9406 destination 9407 9408 __mempcpy_chk -- copy memory area, with buffer overflow 9409 checking 9410 9411 __memset_chk -- fill memory with a constant byte, using buffer 9412 overflow checking 9413 9414 __pread64_chk -- read from a file descriptor at a given offset, 9415 with buffer overflow checking 9416 9417 __pread_chk -- read from a file descriptor at a given offset, 9418 with buffer overflow checking 9419 9420 __printf_chk -- format and print data, with stack checking 9421 __rawmemchr -- scan memory 9422 __read_chk -- read from a file descriptor, with buffer overflow 9423 checking 9424 9425 __readlink_chk -- display value of a symbolic link, with buffer 9426 overflow checking 9427 9428 __realpath_chk -- return the canonicalized absolute pathname, 9429 with buffer overflow checking 9430 9431 __recv_chk -- receive a message from a socket, with buffer 9432 overflow checking 9433 9434 __recvfrom_chk -- receive a message from a socket, with buffer 9435 overflow checking 9436 9437 __register_atfork -- alias for register_atfork 9438 __sigsetjmp -- save stack context for non-local goto 9439 __snprintf_chk -- convert formatted output, with buffer 9440 overflow checking 9441 9442 __sprintf_chk -- convert formatted output, with stack checking 9443 __stack_chk_fail -- terminate a function in case of stack 9444 overflow 9445 9446 __stpcpy -- alias for stpcpy 9447 __stpcpy_chk -- copy a string returning a pointer to its end, 9448 with buffer overflow checking 9449 9450 __stpncpy_chk -- copy a fixed-size string, returning a pointer 9451 to its end, with buffer overflow checking 9452 9453 __strcat_chk -- concatenate two strings, with buffer overflow 9454 checking 9455 9456 __strcpy_chk -- copy a string, with buffer overflow checking 9457 __strdup -- alias for strdup 9458 __strncat_chk -- concatenate two strings, with buffer overflow 9459 checking 9460 9461 __strncpy_chk -- copy a string, with buffer overflow checking 9462 __strtod_internal -- underlying function for strtod 9463 __strtof_internal -- underlying function for strtof 9464 __strtok_r -- alias for strtok_r 9465 __strtol_internal -- alias for strtol 9466 __strtold_internal -- underlying function for strtold 9467 __strtoll_internal -- underlying function for strtoll 9468 __strtoul_internal -- underlying function for strtoul 9469 __strtoull_internal -- underlying function for strtoull 9470 __swprintf_chk -- convert formatted wide-character output, with 9471 stack checking 9472 9473 __sysconf -- get configuration information at runtime 9474 __syslog_chk -- send messages to the system logger, with stack 9475 checking 9476 9477 __sysv_signal -- signal handling 9478 __timezone -- external variable containing timezone 9479 __ttyname_r_chk -- return name of a terminal, with buffer 9480 overflow checking (reentrant) 9481 9482 __tzname -- external variable containing the timezone names 9483 __vfprintf_chk -- convert formatted output, with stack checking 9484 __vfwprintf_chk -- convert formatted wide-character output, 9485 with stack checking 9486 9487 __vprintf_chk -- convert formatted output, with stack checking 9488 __vsnprintf_chk -- convert formatted output, with stack 9489 checking 9490 9491 __vsprintf_chk -- convert formatted output, with stack checking 9492 __vswprintf_chk -- convert formatted wide-character output, 9493 with stack checking 9494 9495 __vsyslog_chk -- send messages to the system logger, with stack 9496 checking 9497 9498 __vwprintf_chk -- convert formatted wide-character output, with 9499 stack checking 9500 9501 __wcpcpy_chk -- copy a wide-character string, returning a 9502 pointer to its end, with buffer overflow checking 9503 9504 __wcpncpy_chk -- copy a fixed-size string of wide characters, 9505 returning a pointer to its end, with buffer overflow 9506 checking 9507 9508 __wcrtomb_chk -- convert a wide character to a multibyte 9509 sequence, with buffer overflow checking 9510 9511 __wcscat_chk -- concatenate two wide-character strings, with 9512 buffer overflow checking 9513 9514 __wcscpy_chk -- copy a wide-character string, with buffer 9515 overflow checking 9516 9517 __wcsncat_chk -- concatenate two wide-character strings, with 9518 buffer overflow checking 9519 9520 __wcsncpy_chk -- copy a fixed-size string of wide characters, 9521 with buffer overflow checking 9522 9523 __wcsnrtombs_chk -- convert a wide-character string to a 9524 multibyte string, with buffer overflow checking 9525 9526 __wcsrtombs_chk -- convert a wide-character string to a 9527 multibyte string, with buffer overflow checking 9528 9529 __wcstod_internal -- underlying function for wcstod 9530 __wcstof_internal -- underlying function for wcstof 9531 __wcstol_internal -- underlying function for wcstol 9532 __wcstold_internal -- underlying function for wcstold 9533 __wcstombs_chk -- convert a wide-character string to a 9534 multibyte string, with buffer overflow checking 9535 9536 __wcstoul_internal -- underlying function for wcstoul 9537 __wctomb_chk -- convert a wide character to a multibyte 9538 sequence, with buffer overflow checking 9539 9540 __wmemcpy_chk -- copy an array of wide-characters, with buffer 9541 overflow checking 9542 9543 __wmemmove_chk -- copy an array of wide-characters, with buffer 9544 overflow checking 9545 9546 __wmempcpy_chk -- copy memory area, with buffer overflow 9547 checking 9548 9549 __wmemset_chk -- fill an array of wide-characters with a 9550 constant wide character, with buffer overflow checking 9551 9552 __wprintf_chk -- convert formatted wide-character output, with 9553 stack checking 9554 9555 __xmknod -- make a special file 9556 __xmknodat -- make a special file relative to a directory file 9557 descriptor 9558 9559 __xpg_basename -- return the last component of a file name 9560 __xpg_sigpause -- remove a signal from the signal mask and 9561 suspend the thread 9562 9563 __xpg_strerror_r -- return string describing error number 9564 __xstat -- get File Status 9565 __xstat64 -- get File Status 9566 _environ -- alias for environ - user environment 9567 _nl_msg_cat_cntr -- new catalog load counter 9568 _sys_errlist -- array containing the "C" locale strings used by 9569 strerror() 9570 9571 _sys_siglist -- array containing the names of the signal names 9572 acct -- switch process accounting on or off 9573 adjtime -- correct the time to allow synchronization of the 9574 system clock 9575 9576 alphasort64 -- Comparison function for directory scanning 9577 (Large File Support) 9578 9579 asprintf -- write formatted output to a dynamically allocated 9580 string 9581 9582 basename -- return the last component of a file name 9583 bind_textdomain_codeset -- specify encoding for message 9584 retrieval 9585 9586 bindresvport -- bind socket to privileged IP port 9587 bindtextdomain -- specify the location of a message catalog 9588 cfmakeraw -- get and set terminal attributes 9589 cfsetspeed -- set terminal input and output data rate 9590 clearerr_unlocked -- non-thread-safe clearerr 9591 daemon -- run in the background 9592 dcgettext -- perform domain and category specific lookup in 9593 message catalog 9594 9595 dcngettext -- perform domain and category specific lookup in 9596 message catalog with plural 9597 9598 dgettext -- perform lookup in message catalog for the current 9599 LC_MESSAGES locale 9600 9601 dngettext -- perform lookup in message catalog for the current 9602 locale 9603 9604 drand48_r -- reentrantly generate pseudorandom numbers in a 9605 uniform distribution 9606 9607 duplocale -- provide new handle for selection of locale 9608 endutent -- access utmp file entries 9609 epoll_create -- open an epoll file descriptor 9610 epoll_ctl -- control an epoll file descriptor 9611 epoll_wait -- wait for I/O events on an epoll file descriptor 9612 erand48_r -- reentrantly generate pseudorandom numbers in a 9613 uniform distribution 9614 9615 err -- display formatted error messages 9616 error -- print error message 9617 errx -- display formatted error message and exit 9618 fcntl -- file control 9619 feof_unlocked -- non-thread-safe feof 9620 ferror_unlocked -- non-thread-safe ferror 9621 fflush_unlocked -- non thread safe fflush 9622 fgetc_unlocked -- non-thread-safe fgetc 9623 fgets_unlocked -- non-thread-safe fgets 9624 fgetwc_unlocked -- non thread safe fgetwc 9625 fgetws_unlocked -- non-thread-safe fgetws 9626 fileno_unlocked -- non-thread-safe fileno 9627 flock -- apply or remove an advisory lock on an open file 9628 fputc_unlocked -- non-thread-safe fputc 9629 fputs_unlocked -- non-thread-safe fputs 9630 fputwc_unlocked -- non-thread-safe fputwc 9631 fputws_unlocked -- non-thread-safe fputws 9632 fread_unlocked -- non-thread-safe fread 9633 freelocale -- free a locale object 9634 fscanf -- convert formatted input 9635 fstatfs -- (deprecated) 9636 fstatfs64 -- (deprecated) 9637 fwrite_unlocked -- non-thread-safe fwrite 9638 fwscanf -- convert formatted input 9639 getdomainname -- get NIS domain name (DEPRECATED). 9640 getdtablesize -- get file descriptor table size (DEPRECATED) 9641 getgrent_r -- reentrantly get entry in group file 9642 getgrouplist -- get groups a user belongs to 9643 gethostbyaddr_r -- find network host database entry matching 9644 host name (DEPRECATED) 9645 9646 gethostbyname2 -- find network host database entry matching 9647 host name (DEPRECATED) 9648 9649 gethostbyname2_r -- find network host database entry matching 9650 host name (DEPRECATED) 9651 9652 gethostbyname_r -- find network host database entry matching 9653 host name (DEPRECATED) 9654 9655 getloadavg -- get system load averages 9656 getopt -- parse command line options 9657 getopt_long -- parse command line options 9658 getopt_long_only -- parse command line options 9659 getpagesize -- get memory page size (DEPRECATED) 9660 getprotobyname_r -- retrieve information from the network 9661 protocol database by protocol name, reentrantly 9662 9663 getprotobynumber_r -- retrieve information from the network 9664 protocol database by protocol number, reentrantly 9665 9666 getprotoent_r -- read the next entry of the protocol database, 9667 reentrantly 9668 9669 getpwent_r -- reentrantly get entry in passwd file 9670 getservbyname_r -- retrieve information from the network 9671 services database by service name, reentrantly 9672 9673 getservbyport_r -- retrieve information from the network 9674 services database by service port, reentrantly 9675 9676 getservent_r -- read the next entry of the network services 9677 database, reentrantly 9678 9679 getsockopt -- get socket options 9680 gettext -- search message catalogs for a string 9681 getutent -- access user accounting database entries 9682 getutent_r -- access user accounting database entries 9683 getwc_unlocked -- non-thread-safe getwc 9684 getwchar_unlocked -- non-thread-safe getwchar 9685 glob64 -- find pathnames matching a pattern (Large File 9686 Support) 9687 9688 globfree64 -- free memory from glob64() (Large File Support) 9689 hcreate_r -- allocate space for a hash search table, 9690 reentrantly 9691 9692 hdestroy_r -- dispose of a hash search table, reentrantly 9693 hsearch_r -- search a hash table, reentrantly 9694 inet_aton -- Internet address manipulation routine 9695 initgroups -- initialize the supplementary group access list 9696 initstate_r -- reentrantly initialize a state array for random 9697 number generator functions 9698 9699 inotify_add_watch -- add a watch to a watch list 9700 inotify_init -- instantiate inotify 9701 inotify_rm_watch -- remove a watch from an inotify watch list 9702 ioctl -- control device 9703 sockio -- socket ioctl commands 9704 ttyio -- tty ioctl commands 9705 jrand48_r -- reentrantly generate pseudorandom numbers in a 9706 uniform distribution 9707 9708 kill -- send a signal 9709 lcong48_r -- reentrantly generate pseudorandom numbers in a 9710 uniform distribution 9711 9712 link -- create a link to a file 9713 lrand48_r -- reentrantly generate pseudorandom numbers in a 9714 uniform distribution 9715 9716 mbsnrtowcs -- convert a multibyte string to a wide character 9717 string 9718 9719 memmem -- locate bytes 9720 memrchr -- scan memory for a character 9721 mkstemp64 -- create a unique temporary file (Large File 9722 Support) 9723 9724 mrand48_r -- reentrantly generate pseudorandom numbers in a 9725 uniform distribution 9726 9727 mremap -- remap a virtual memory address 9728 newlocale -- allocate a locale object 9729 ngettext -- search message catalogs for plural string 9730 nrand48_r -- reentrantly generate pseudorandom numbers in a 9731 uniform distribution 9732 9733 openat64 -- open a file relative to a directory file descriptor 9734 (Large File Support) 9735 9736 pmap_getport -- find the port number assigned to a service 9737 registered with a portmapper. 9738 9739 pmap_set -- establishes mapping to machine's RPC Bind service. 9740 pmap_unset -- destroys RPC Binding 9741 posix_fadvise64 -- File advisory information (Large File 9742 Support) 9743 9744 posix_fallocate64 -- file space control (Large File Support) 9745 psignal -- print signal message 9746 putwc_unlocked -- non-thread-safe putwc 9747 putwchar_unlocked -- non-thread-safe putwchar 9748 random_r -- reentrantly generate pseudorandom numbers in a 9749 uniform distribution 9750 9751 readdir64_r -- read a directory (Large File Support) 9752 regexec -- regular expression matching 9753 scandir64 -- scan a directory (Large File Support) 9754 scanf -- convert formatted input 9755 sched_getaffinity -- retrieve the affinity mask of a process 9756 sched_setaffinity -- set the CPU affinity mask for a process 9757 sched_setscheduler -- set scheduling policy and parameters 9758 seed48_r -- reentrantly generate pseudorandom numbers in a 9759 uniform distribution 9760 9761 sendfile -- transfer data between two file descriptors 9762 sendfile64 -- transfer data between two file descriptors (Large 9763 File Support) 9764 9765 setbuffer -- stream buffering operation 9766 setgroups -- set list of supplementary group IDs 9767 sethostname -- set host name 9768 setsockopt -- set socket options 9769 setstate_r -- reentrantly change the state array used by random 9770 number generator functions 9771 9772 setutent -- access user accounting database entries 9773 sigandset -- build a new signal set by combining the two input 9774 sets using logical AND 9775 9776 sigisemptyset -- check for empty signal set 9777 sigorset -- build a new signal set by combining the two input 9778 sets using logical OR 9779 9780 sigpause -- remove a signal from the signal mask and suspend 9781 the thread (deprecated) 9782 9783 sigreturn -- return from signal handler and cleanup stack frame 9784 srand48_r -- reentrantly generate pseudorandom numbers in a 9785 uniform distribution 9786 9787 srandom_r -- reentrantly set the seed for a new sequence of 9788 pseudorandom numbers 9789 9790 sscanf -- convert formatted input 9791 statfs -- (deprecated) 9792 statfs64 -- (deprecated) 9793 stime -- set time 9794 stpcpy -- copy a string returning a pointer to its end 9795 stpncpy -- copy a fixed-size string, returning a pointer to its 9796 end 9797 9798 strcasestr -- locate a substring ignoring case 9799 strerror_r -- return string describing error number 9800 strndup -- return a malloc'd copy of at most the specified 9801 number of bytes of a string 9802 9803 strnlen -- determine the length of a fixed-size string 9804 strptime -- parse a time string 9805 strsep -- extract token from string 9806 strsignal -- return string describing signal 9807 strtoq -- convert string value to a long or quad_t integer 9808 strtouq -- convert a string to an unsigned long long 9809 svc_register -- register Remote Procedure Call interface 9810 svc_run -- waits for RPC requests to arrive and calls service 9811 procedure 9812 9813 svc_sendreply -- called by RPC service's dispatch routine 9814 svctcp_create -- create a TCP/IP-based RPC service transport 9815 svcudp_create -- create a UDP-based RPC service transport 9816 swscanf -- convert formatted input 9817 sysconf -- Get configuration information at runtime 9818 system -- execute a shell command 9819 textdomain -- set the current default message domain 9820 unlink -- remove a directory entry 9821 uselocale -- set locale for thread 9822 utmpname -- set user accounting database 9823 vasprintf -- write formatted output to a dynamically allocated 9824 string 9825 9826 vdprintf -- write formatted output to a file descriptor 9827 verrx -- display formatted error message and exit 9828 vfscanf -- convert formatted input 9829 vfwscanf -- convert formatted input 9830 vscanf -- convert formatted input 9831 vsscanf -- convert formatted input 9832 vswscanf -- convert formatted input 9833 vsyslog -- log to system log 9834 vwscanf -- convert formatted input 9835 wait4 -- wait for process termination, BSD style 9836 warn -- formatted error messages 9837 warnx -- formatted error messages 9838 wcpcpy -- copy a wide character string, returning a pointer to 9839 its end 9840 9841 wcpncpy -- copy a fixed-size string of wide characters, 9842 returning a pointer to its end 9843 9844 wcscasecmp -- compare two wide-character strings, ignoring case 9845 wcsdup -- duplicate a wide-character string 9846 wcsncasecmp -- compare two fixed-size wide-character strings, 9847 ignoring case 9848 9849 wcsnlen -- determine the length of a fixed-size wide-character 9850 string 9851 9852 wcsnrtombs -- convert a wide character string to a multi-byte 9853 string 9854 9855 wcstoq -- convert wide string to long long int representation 9856 wcstouq -- convert wide string to unsigned long long int 9857 representation 9858 9859 wscanf -- convert formatted input 9860 xdr_u_int -- library routines for external data representation 9861 xdrstdio_create -- library routines for external data 9862 representation 9863 9864 The interfaces defined on the following pages are included in 9865 libc and are defined by this specification. Unless otherwise 9866 noted, these interfaces shall be included in the source 9867 standard. 9868 9869 Other interfaces listed in Section 13.3 shall behave as 9870 described in the referenced base document. 9871 9872 _IO_feof 9873 9874 Name 9875 9876 _IO_feof -- alias for feof 9877 9878 Synopsis 9879 9880 int _IO_feof(_IO_FILE * __fp); 9881 9882 Description 9883 9884 _IO_feof() tests the end-of-file indicator for the stream 9885 pointed to by __fp, returning a non-zero value if it is set. 9886 9887 _IO_feof() is not in the source standard; it is only in the 9888 binary standard. 9889 9890 _IO_getc 9891 9892 Name 9893 9894 _IO_getc -- alias for getc 9895 9896 Synopsis 9897 9898 int _IO_getc(_IO_FILE * __fp); 9899 9900 Description 9901 9902 _IO_getc() reads the next character from __fp and returns it as 9903 an unsigned char cast to an int, or EOF on end-of-file or 9904 error. 9905 9906 _IO_getc() is not in the source standard; it is only in the 9907 binary standard. 9908 9909 _IO_putc 9910 9911 Name 9912 9913 _IO_putc -- alias for putc 9914 9915 Synopsis 9916 9917 int _IO_putc(int __c, _IO_FILE * __fp); 9918 9919 Description 9920 9921 _IO_putc() writes the character __c, cast to an unsigned char, 9922 to __fp. 9923 9924 _IO_putc() is not in the source standard; it is only in the 9925 binary standard. 9926 9927 _IO_puts 9928 9929 Name 9930 9931 _IO_puts -- alias for puts 9932 9933 Synopsis 9934 9935 int _IO_puts(const char * __c); 9936 9937 Description 9938 9939 _IO_puts() writes the string __s and a trailing newline to 9940 stdout. 9941 9942 _IO_puts() is not in the source standard; it is only in the 9943 binary standard. 9944 9945 __assert_fail 9946 9947 Name 9948 9949 __assert_fail -- abort the program after false assertion 9950 9951 Synopsis 9952 9953 void __assert_fail(const char * assertion, const char * file, 9954 unsigned int line, const char * function); 9955 9956 Description 9957 9958 The __assert_fail() function is used to implement the assert() 9959 interface of ISO POSIX (2003). The __assert_fail() function 9960 shall print the given file filename, line line number, function 9961 function name and a message on the standard error stream in an 9962 unspecified format, and abort program execution via the abort() 9963 function. For example: 9964 9965 a.c:10: foobar: Assertion a == b failed. 9966 9967 If function is NULL, __assert_fail() shall omit information 9968 about the function. 9969 9970 assertion, file, and line shall be non-NULL. 9971 9972 The __assert_fail() function is not in the source standard; it 9973 is only in the binary standard. The assert() interface is not 9974 in the binary standard; it is only in the source standard. The 9975 assert() may be implemented as a macro. 9976 9977 __chk_fail 9978 9979 Name 9980 9981 __chk_fail -- terminate a function in case of buffer overflow 9982 9983 Synopsis 9984 9985 #include 9986 9987 void __chk_fail(void); 9988 9989 Description 9990 9991 The interface __chk_fail() shall abort the function that called 9992 it with a message that a buffer overflow has been detected. The 9993 program that called the function shall then exit. 9994 9995 Application Usage (informative) 9996 9997 The interface __chk_fail() does not check for a buffer overflow 9998 itself. It merely reports one when invoked. 9999 10000 __confstr_chk 10001 10002 Name 10003 10004 __confstr_chk -- get configuration dependent string variables, 10005 with buffer overflow checking 10006 10007 Synopsis 10008 10009 #include 10010 10011 size_t __confstr_chk(int name, char * buf, size_t len, size_t 10012 buflen); 10013 10014 Description 10015 10016 The interface __confstr_chk() shall function in the same way as 10017 the interface confstr(), except that __confstr_chk() shall 10018 check for buffer overflow before computing a result. If an 10019 overflow is anticipated, the function shall abort and the 10020 program calling it shall exit. 10021 10022 The parameter buflen specifies the size of the buffer buf. If 10023 len exceeds buflen, the function shall abort, and the program 10024 calling it shall exit. 10025 10026 The __confstr_chk() function is not in the source standard; it 10027 is only in the binary standard. 10028 10029 __ctype_b_loc 10030 10031 Name 10032 10033 __ctype_b_loc -- accessor function for __ctype_b array for 10034 ctype functions 10035 10036 Synopsis 10037 10038 #include 10039 10040 const unsigned short * * __ctype_b_loc (void); 10041 10042 Description 10043 10044 The __ctype_b_loc() function shall return a pointer into an 10045 array of characters in the current locale that contains 10046 characteristics for each character in the current character 10047 set. The array shall contain a total of 384 characters, and can 10048 be indexed with any signed or unsigned char (i.e. with an index 10049 value between -128 and 255). If the application is 10050 multithreaded, the array shall be local to the current thread. 10051 10052 This interface is not in the source standard; it is only in the 10053 binary standard. 10054 10055 Return Value 10056 10057 The __ctype_b_loc() function shall return a pointer to the 10058 array of characters to be used for the ctype() family of 10059 functions (see ). 10060 10061 __ctype_get_mb_cur_max 10062 10063 Name 10064 10065 __ctype_get_mb_cur_max -- maximum length of a multibyte 10066 character in the current locale 10067 10068 Synopsis 10069 10070 size_t __ctype_get_mb_cur_max(void); 10071 10072 Description 10073 10074 __ctype_get_mb_cur_max() returns the maximum length of a 10075 multibyte character in the current locale. 10076 10077 __ctype_get_mb_cur_max() is not in the source standard; it is 10078 only in the binary standard. 10079 10080 __ctype_tolower_loc 10081 10082 Name 10083 10084 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 10085 array for ctype tolower() function 10086 10087 Synopsis 10088 10089 #include 10090 10091 int32_t * * __ctype_tolower_loc(void); 10092 10093 Description 10094 10095 The __ctype_tolower_loc() function shall return a pointer into 10096 an array of characters in the current locale that contains 10097 lower case equivalents for each character in the current 10098 character set. The array shall contain a total of 384 10099 characters, and can be indexed with any signed or unsigned char 10100 (i.e. with an index value between -128 and 255). If the 10101 application is multithreaded, the array shall be local to the 10102 current thread. 10103 10104 This interface is not in the source standard; it is only in the 10105 binary standard. 10106 10107 Return Value 10108 10109 The __ctype_tolower_loc() function shall return a pointer to 10110 the array of characters to be used for the ctype() family of 10111 functions (see ). 10112 10113 __ctype_toupper_loc 10114 10115 Name 10116 10117 __ctype_toupper_loc -- accessor function for 10118 __ctype_b_toupper() array for ctype toupper() function 10119 10120 Synopsis 10121 10122 #include 10123 10124 int32_t * * __ctype_toupper_loc(void); 10125 10126 Description 10127 10128 The __ctype_toupper_loc() function shall return a pointer into 10129 an array of characters in the current locale that contains 10130 upper case equivalents for each character in the current 10131 character set. The array shall contain a total of 384 10132 characters, and can be indexed with any signed or unsigned char 10133 (i.e. with an index value between -128 and 255). If the 10134 application is multithreaded, the array shall be local to the 10135 current thread. 10136 10137 This interface is not in the source standard; it is only in the 10138 binary standard. 10139 10140 Return Value 10141 10142 The __ctype_toupper_loc() function shall return a pointer to 10143 the array of characters to be used for the ctype() family of 10144 functions (see ). 10145 10146 __cxa_atexit 10147 10148 Name 10149 10150 __cxa_atexit -- register a function to be called by exit or 10151 when a shared library is unloaded 10152 10153 Synopsis 10154 10155 int __cxa_atexit(void (*func) (void *), void * arg, void * 10156 dso_handle); 10157 10158 Description 10159 10160 As described in the Itanium™ C++ ABI, __cxa_atexit() registers 10161 a destructor function to be called by exit() or when a shared 10162 library is unloaded. When a shared library is unloaded, any 10163 destructor function associated with that shared library, 10164 identified by dso_handle, shall be called with the single 10165 argument arg, and then that function shall be removed, or 10166 marked as complete, from the list of functions to run at 10167 exit(). On a call to exit(), any remaining functions registered 10168 shall be called with the single argument arg. Destructor 10169 functions shall always be called in the reverse order to their 10170 registration (i.e. the most recently registered function shall 10171 be called first), 10172 10173 The __cxa_atexit() function is used to implement atexit(), as 10174 described in ISO POSIX (2003). Calling atexit(func) from the 10175 statically linked part of an application shall be equivalent to 10176 __cxa_atexit(func, NULL, NULL). 10177 10178 __cxa_atexit() is not in the source standard; it is only in the 10179 binary standard. 10180 10181 Note: atexit() is not in the binary standard; it is only in 10182 the source standard. 10183 10184 __cxa_finalize 10185 10186 Name 10187 10188 __cxa_finalize -- call destructors of global (or local static) 10189 C++ objects and exit functions registered with atexit 10190 10191 Synopsis 10192 10193 void __cxa_finalize(void * d); 10194 10195 Description 10196 10197 As described in the Itanium® C++ ABI, the C runtime library 10198 shall maintain a list of termination function entries 10199 containing the following information: 10200 10201 * A pointer to a termination function. 10202 * An operand to be passed to the function. 10203 * A handle identifying the home shared library of the entry. 10204 10205 The list is populated by entries of two kinds: 10206 10207 * Destructors of global (or local static) C++ objects that 10208 require destruction on exit. 10209 * Functions registered by the user with atexit(). 10210 10211 In the former case an entry consists of a pointer to the 10212 destructor, a pointer to the corresponding object and a handle 10213 for the home shared library of the object. In the latter case 10214 the pointer to the function is the pointer passed to atexit(), 10215 while the other pointers are NULL. 10216 10217 When __cxa_finalize(d) is called, it shall walk the termination 10218 function list, calling each in turn if d matches the handle of 10219 the termination function entry. If d is NULL, it shall call all 10220 the termination funtions. Multiple calls to __cxa_finalize 10221 shall not result in calling termination function entries 10222 multiple times; the implementation may either remove entries or 10223 mark them finished. The termination functions shall always be 10224 called in the reverse order of their registration (i.e. the 10225 most recently registered function shall be called first). 10226 10227 An application shall not call __cxa_finalize() directly. The 10228 implementation shall arrange for__cxa_finalize() to be called 10229 during early shared library unload (e.g. dlclose()) with a 10230 handle to the shared library. When the main program calls exit, 10231 the implementation shall cause any remaining 10232 __cxa_atexit-registered functions to be called, either by 10233 calling __cxa_finalize(NULL), or by walking the registration 10234 list itself. 10235 10236 __cxa_finalize() is not in the source standard; it is only in 10237 the binary standard. 10238 10239 __daylight 10240 10241 Name 10242 10243 __daylight -- external daylight savings time flag 10244 10245 Synopsis 10246 10247 int __daylight; 10248 10249 Description 10250 10251 The external variable __daylight shall implement the daylight 10252 savings time flag daylight as specified in ISO POSIX (2003). 10253 __daylight has the same specification as daylight. 10254 10255 __environ 10256 10257 Name 10258 10259 __environ -- alias for environ - user environment 10260 10261 Synopsis 10262 10263 extern char **__environ; 10264 10265 Description 10266 10267 The external variable __environ shall implement the environment 10268 variable environ as specified in ISO POSIX (2003). __environ 10269 has the same specification as environ. 10270 10271 __errno_location 10272 10273 Name 10274 10275 __errno_location -- address of errno variable 10276 10277 Synopsis 10278 10279 int * __errno_location(void); 10280 10281 Description 10282 10283 The __errno_location() function shall return the address of the 10284 errno variable for the current thread. 10285 10286 __errno_location() is not in the source standard; it is only in 10287 the binary standard. 10288 10289 __fgets_chk 10290 10291 Name 10292 10293 __fgets_chk -- string input, with buffer overflow checking 10294 10295 Synopsis 10296 10297 #include 10298 10299 char * __fgets_chk(char * s, size_t size, int strsize, FILE * 10300 stream); 10301 10302 Description 10303 10304 The interface __fgets_chk() shall function in the same way as 10305 the interface fgets(), except that __fgets_chk() shall check 10306 for buffer overflow before computing a result. If an overflow 10307 is anticipated, the function shall abort and the program 10308 calling it shall exit. 10309 10310 The parameter strsize specifies the size of the object pointed 10311 to by stream. 10312 10313 The __fgets_chk() function is not in the source standard; it is 10314 only in the binary standard. 10315 10316 __fgets_unlocked_chk 10317 10318 Name 10319 10320 __fgets_unlocked_chk -- non-locking string input, with buffer 10321 overflow checking 10322 10323 Synopsis 10324 10325 #include 10326 10327 char * __fgets_unlocked_chk(char * s, size_t size, int strsize, 10328 FILE * stream); 10329 10330 Description 10331 10332 The interface __fgets_unlocked_chk() shall function in the same 10333 way as the interface fgets_unlocked(), except that 10334 __fgets_unlocked_chk() shall check for buffer overflow before 10335 computing a result. If an overflow is anticipated, the function 10336 shall abort and the program calling it shall exit. 10337 10338 The parameter strsize specifies the size of the object pointed 10339 to by stream. 10340 10341 The __fgets_unlocked_chk() function is not in the source 10342 standard; it is only in the binary standard. 10343 10344 __fgetws_chk 10345 10346 Name 10347 10348 __fgetws_chk -- read a wide-character string from a FILE 10349 stream, with buffer overflow checking 10350 10351 Synopsis 10352 10353 #include 10354 10355 wchar_t * __fgetws_chk(wchar_t * ws, size_t size, int strsize, 10356 FILE * stream); 10357 10358 Description 10359 10360 The interface __fgetws_chk() shall function in the same way as 10361 the interface fgetws(), except that __fgetws_chk() shall check 10362 for buffer overflow before computing a result. If an overflow 10363 is anticipated, the function shall abort and the program 10364 calling it shall exit. 10365 10366 The parameter strsize specifies the size of the object pointed 10367 to by stream. 10368 10369 The __fgetws_chk() function is not in the source standard; it 10370 is only in the binary standard. 10371 10372 __fgetws_unlocked_chk 10373 10374 Name 10375 10376 __fgetws_unlocked_chk -- read a wide-character string from a 10377 FILE stream in a non-locking manner, with stack checking 10378 10379 Synopsis 10380 10381 #include 10382 10383 wchar_t * __fgetws_unlocked_chk(wchar_t * ws, size_t strsize, 10384 int n, FILE * stream); 10385 10386 Description 10387 10388 The interface __fgetws_unlocked_chk() shall function in the 10389 same way as the interface fgetws_unlocked(), except that 10390 __fgetws_unlocked_chk() shall check for stack overflow before 10391 computing a result. If an overflow is anticipated, the function 10392 shall abort and the program calling it shall exit. 10393 10394 The parameter strsize specifies the size of the object pointed 10395 to by stream. 10396 10397 The __fgetws_unlocked_chk() function is not in the source 10398 standard; it is only in the binary standard. 10399 10400 __fpending 10401 10402 Name 10403 10404 __fpending -- returns in bytes the amount of output pending on 10405 a stream 10406 10407 Synopsis 10408 10409 size_t __fpending(FILE * stream); 10410 10411 Description 10412 10413 __fpending() returns the amount of output in bytes pending on a 10414 stream. 10415 10416 __fpending() is not in the source standard; it is only in the 10417 binary standard. 10418 10419 __fprintf_chk 10420 10421 Name 10422 10423 __fprintf_chk -- convert formatted output, with stack checking 10424 10425 Synopsis 10426 10427 #include 10428 10429 int __fprintf_chk(FILE * stream, int flag, const char * 10430 format); 10431 10432 Description 10433 10434 The interface __fprintf_chk() shall function in the same way as 10435 the interface fprintf(), except that __fprintf_chk() shall 10436 check for stack overflow before computing a result, depending 10437 on the value of the flag parameter. If an overflow is 10438 anticipated, the function shall abort and the program calling 10439 it shall exit. 10440 10441 In general, the higher the value of flag, the more security 10442 measures this interface shall take in the form of checking the 10443 stack, parameter values, and so on. 10444 10445 The __fprintf_chk() function is not in the source standard; it 10446 is only in the binary standard. 10447 10448 __fwprintf_chk 10449 10450 Name 10451 10452 __fwprintf_chk -- convert formatted wide-character output, with 10453 stack checking 10454 10455 Synopsis 10456 10457 #include 10458 10459 int __fwprintf_chk(FILE * stream, int flag, const wchar_t * 10460 format); 10461 10462 Description 10463 10464 The interface __fwprintf_chk() shall function in the same way 10465 as the interface fwprintf(), except that __fwprintf_chk() shall 10466 check for stack overflow before computing a result, depending 10467 on the value of the flag parameter. If an overflow is 10468 anticipated, the function shall abort and the program calling 10469 it shall exit. 10470 10471 In general, the higher the value of flag, the more security 10472 measures this interface shall take in the form of checking the 10473 stack, parameter values, and so on. 10474 10475 The __fwprintf_chk() function is not in the source standard; it 10476 is only in the binary standard. 10477 10478 __fxstatat 10479 10480 Name 10481 10482 __fxstatat -- get file status relative to directory file 10483 descriptor 10484 10485 Synopsis 10486 10487 #include 10488 #include 10489 10490 int __fxstatat(int ver, int dirfd, const char * path, struct 10491 stat * stat_buf, int flags); 10492 10493 Description 10494 10495 The __fxstatat() function shall implement the fstatat() 10496 function. The behavior of __fxstatat() for values of ver other 10497 than _STAT_VER is undefined. See Data Definitions in the 10498 architecture specific part of this specification for the 10499 correct value of _STAT_VER. 10500 10501 __fxstatat(_STAT_VER, dirfd, stat_buf, flags) shall behave as 10502 fstatat(dirfd, stat_buf, flags) as specified by POSIX 1003.1 10503 2008. 10504 10505 __fxstatat() is not in the source standard; it is only in the 10506 binary standard. 10507 10508 Note: The fstatat() function is not in the binary standard; 10509 it is only in the source standard. 10510 10511 __fxstatat64 10512 10513 Name 10514 10515 __fxstatat64 -- get file status relative to directory file 10516 descriptor 10517 10518 Synopsis 10519 10520 #define __LARGEFILE_SOURCE 1 10521 #include 10522 #include 10523 10524 int __fxstatat64(int ver, int dirfd, const char * path, struct 10525 stat64 * stat_buf, int flags); 10526 10527 Description 10528 10529 The __fxstatat64() function shall implement the fstatat64() 10530 function. The behavior of __fxstatat64() for values of ver 10531 other than _STAT_VER is undefined. See Data Definitions in the 10532 architecture specific part of this specification for the 10533 correct value of _STAT_VER. 10534 10535 __fxstatat64(_STAT_VER, dirfd, stat_buf, flags) shall behave as 10536 fstatat64(dirfd, stat_buf, flags) as specified by this 10537 specification. 10538 10539 __fxstatat64() is not in the source standard; it is only in the 10540 binary standard. 10541 10542 Note: The fstatat64() function is not in the binary 10543 standard; it is only in the source standard. 10544 10545 __getcwd_chk 10546 10547 Name 10548 10549 __getcwd_chk -- get current working directory, with buffer 10550 overflow checking 10551 10552 Synopsis 10553 10554 #include 10555 10556 char * __getcwd_chk(char * buf, size_t len, size_t buflen); 10557 10558 Description 10559 10560 The interface __getcwd_chk() shall function in the same way as 10561 the interface getcwd(), except that __getcwd_chk() shall check 10562 for buffer overflow before computing a result. If an overflow 10563 is anticipated, the function shall abort and the program 10564 calling it shall exit. 10565 10566 The parameter buflen specifies the size of the buffer buf. If 10567 len exceeds buflen, the function shall abort, and the program 10568 calling it shall exit. 10569 10570 The __getcwd_chk() function is not in the source standard; it 10571 is only in the binary standard. 10572 10573 __getgroups_chk 10574 10575 Name 10576 10577 __getgroups_chk -- get list of supplementary group IDs, with 10578 buffer overflow checking 10579 10580 Synopsis 10581 10582 #include 10583 10584 int __getgroups_chk(int size, gid_t * list, size_t listlen); 10585 10586 Description 10587 10588 The interface __getgroups_chk() shall function in the same way 10589 as the interface getgroups(), except that __getgroups_chk() 10590 shall check for buffer overflow before computing a result. If 10591 an overflow is anticipated, the function shall abort and the 10592 program calling it shall exit. 10593 10594 The parameter listlen specifies the size in bytes of the object 10595 list. 10596 10597 The __getgroups_chk() function is not in the source standard; 10598 it is only in the binary standard. 10599 10600 __gethostname_chk 10601 10602 Name 10603 10604 __gethostname_chk -- get host name, with buffer overflow 10605 checking 10606 10607 Synopsis 10608 10609 #include 10610 10611 int __gethostname_chk(char * buf, size_t buflen, size_t 10612 maxlen); 10613 10614 Description 10615 10616 The interface __gethostname_chk() shall function in the same 10617 way as the interface gethostname(), except that 10618 __gethostname_chk() shall check for buffer overflow before 10619 computing a result. If an overflow is anticipated, the function 10620 shall abort and the program calling it shall exit. 10621 10622 The parameter buflen specifies the size of the buffer buf. If 10623 buflen exceeds maxlen, the function shall abort, and the 10624 program calling it shall exit. 10625 10626 The __gethostname_chk() function is not in the source standard; 10627 it is only in the binary standard. 10628 10629 __getlogin_r_chk 10630 10631 Name 10632 10633 __getlogin_r_chk -- get user name, with buffer overflow 10634 checking (reentrant) 10635 10636 Synopsis 10637 10638 #include 10639 10640 int __getlogin_r_chk(char * buf, size_t buflen, size_t maxlen); 10641 10642 Description 10643 10644 The interface __getlogin_r_chk() shall function in the same way 10645 as the interface getlogin_r(), except that __getlogin_r_chk() 10646 shall check for buffer overflow before computing a result. If 10647 an overflow is anticipated, the function shall abort and the 10648 program calling it shall exit. 10649 10650 The parameter buflen specifies the size of the buffer buf. If 10651 buflen exceeds maxlen, the function shall abort, and the 10652 program calling it shall exit. 10653 10654 The __getlogin_r_chk() function is not in the source standard; 10655 it is only in the binary standard. 10656 10657 __getpagesize 10658 10659 Name 10660 10661 __getpagesize -- alias for getpagesize - get current page size 10662 10663 Synopsis 10664 10665 int __getpagesize(void); 10666 10667 Description 10668 10669 __getpagesize() is an alias for getpagesize() - get current 10670 page size. 10671 10672 __getpagesize() has the same specification as getpagesize(). 10673 10674 __getpagesize() is not in the source standard; it is only in 10675 the binary standard. 10676 10677 __getpgid 10678 10679 Name 10680 10681 __getpgid -- get the process group id 10682 10683 Synopsis 10684 10685 pid_t __getpgid(pid_t pid); 10686 10687 Description 10688 10689 __getpgid() has the same specification as getpgid(). 10690 10691 __getpgid() is not in the source standard; it is only in the 10692 binary standard. 10693 10694 __h_errno_location 10695 10696 Name 10697 10698 __h_errno_location -- address of h_errno variable 10699 10700 Synopsis 10701 10702 int * __h_errno_location(void); 10703 10704 Description 10705 10706 __h_errno_location() returns the address of the h_errno 10707 variable, where h_errno is as specified in ISO POSIX (2003). 10708 10709 __h_errno_location() is not in the source standard; it is only 10710 in the binary standard. Note that h_errno itself is only in the 10711 source standard; it is not in the binary standard. 10712 10713 __isinf 10714 10715 Name 10716 10717 __isinf -- test for infinity 10718 10719 Synopsis 10720 10721 int __isinf(double arg); 10722 10723 Description 10724 10725 __isinf() has the same specification as isinf() in ISO POSIX 10726 (2003), except that the argument type for __isinf() is known to 10727 be double. 10728 10729 __isinf() is not in the source standard; it is only in the 10730 binary standard. 10731 10732 __isinff 10733 10734 Name 10735 10736 __isinff -- test for infinity 10737 10738 Synopsis 10739 10740 int __isinff(float arg); 10741 10742 Description 10743 10744 __isinff() has the same specification as isinf() in ISO POSIX 10745 (2003) except that the argument type for __isinff() is known to 10746 be float. 10747 10748 __isinff() is not in the source standard; it is only in the 10749 binary standard. 10750 10751 __isinfl 10752 10753 Name 10754 10755 __isinfl -- test for infinity 10756 10757 Synopsis 10758 10759 int __isinfl(long double arg); 10760 10761 Description 10762 10763 __isinfl() has the same specification as isinf() in the ISO 10764 POSIX (2003), except that the argument type for __isinfl() is 10765 known to be long double. 10766 10767 __isinfl() is not in the source standard; it is only in the 10768 binary standard. 10769 10770 __isnan 10771 10772 Name 10773 10774 __isnan -- test for infinity 10775 10776 Synopsis 10777 10778 int __isnan(double arg); 10779 10780 Description 10781 10782 __isnan() has the same specification as isnan() in ISO POSIX 10783 (2003), except that the argument type for __isnan() is known to 10784 be double. 10785 10786 __isnan() is not in the source standard; it is only in the 10787 binary standard. 10788 10789 __isnanf 10790 10791 Name 10792 10793 __isnanf -- test for infinity 10794 10795 Synopsis 10796 10797 int __isnanf(float arg); 10798 10799 Description 10800 10801 __isnanf() has the same specification as isnan() in ISO POSIX 10802 (2003), except that the argument type for __isnanf() is known 10803 to be float. 10804 10805 __isnanf() is not in the source standard; it is only in the 10806 binary standard. 10807 10808 __isnanl 10809 10810 Name 10811 10812 __isnanl -- test for infinity 10813 10814 Synopsis 10815 10816 int __isnanl(long double arg); 10817 10818 Description 10819 10820 __isnanl() has the same specification as isnan() in ISO POSIX 10821 (2003), except that the argument type for __isnanl() is known 10822 to be long double. 10823 10824 __isnanl() is not in the source standard; it is only in the 10825 binary standard. 10826 10827 __libc_current_sigrtmax 10828 10829 Name 10830 10831 __libc_current_sigrtmax -- return number of available real-time 10832 signal with lowest priority 10833 10834 Synopsis 10835 10836 int __libc_current_sigrtmax(void); 10837 10838 Description 10839 10840 __libc_current_sigrtmax() returns the number of an available 10841 real-time signal with the lowest priority. 10842 10843 __libc_current_sigrtmax() is not in the source standard; it is 10844 only in the binary standard. 10845 10846 __libc_current_sigrtmin 10847 10848 Name 10849 10850 __libc_current_sigrtmin -- return number of available real-time 10851 signal with highest priority 10852 10853 Synopsis 10854 10855 int __libc_current_sigrtmin(void); 10856 10857 Description 10858 10859 __libc_current_sigrtmin() returns the number of an available 10860 real-time signal with the highest priority. 10861 10862 __libc_current_sigrtmin() is not in the source standard; it is 10863 only in the binary standard. 10864 10865 __libc_start_main 10866 10867 Name 10868 10869 __libc_start_main -- initialization routine 10870 10871 Synopsis 10872 10873 int __libc_start_main(int (*main) (int, char **, char **), int 10874 argc, char ** ubp_av, void (*init) (void), void (*fini) (void), 10875 void (*rtld_fini) (void), void (*stack_end)); 10876 10877 Description 10878 10879 The __libc_start_main() function shall perform any necessary 10880 initialization of the execution environment, call the main 10881 function with appropriate arguments, and handle the return from 10882 main(). If the main() function returns, the return value shall 10883 be passed to the exit() function. 10884 10885 Note: While this specification is intended to be 10886 implementation independent, process and library 10887 initialization may include: 10888 10889 * performing any necessary security checks if the effective 10890 user ID is not the same as the real user ID. 10891 * initialize the threading subsystem. 10892 * registering the rtld_fini to release resources when this 10893 dynamic shared object exits (or is unloaded). 10894 * registering the fini handler to run at program exit. 10895 * calling the initializer function (*init)(). 10896 * calling main() with appropriate arguments. 10897 * calling exit() with the return value from main(). 10898 10899 This list is an example only. 10900 10901 __libc_start_main() is not in the source standard; it is only 10902 in the binary standard. 10903 10904 See Also 10905 10906 The section on Process Initialization in each of the 10907 architecture specific parts of ISO/IEC 23360. 10908 10909 __mbsnrtowcs_chk 10910 10911 Name 10912 10913 __mbsnrtowcs_chk -- convert a multibyte string to a 10914 wide-character string, with buffer overflow checking 10915 10916 Synopsis 10917 10918 #include 10919 10920 size_t __mbsnrtowcs_chk(wchar_t * dest, const char * * src, 10921 size_t nmc, size_t len, mbstate_t * ps, size_t destlen); 10922 10923 Description 10924 10925 The interface __mbsnrtowcs_chk() shall function in the same way 10926 as the interface mbsnrtowcs(), except that __mbsnrtowcs_chk() 10927 shall check for buffer overflow before computing a result. If 10928 an overflow is anticipated, the function shall abort and the 10929 program calling it shall exit. 10930 10931 The parameter destlen specifies the size of the object dest. If 10932 len exceeds destlen, the function shall abort, and the program 10933 calling it shall exit. 10934 10935 The __mbsnrtowcs_chk() function is not in the source standard; 10936 it is only in the binary standard. 10937 10938 __mbsrtowcs_chk 10939 10940 Name 10941 10942 __mbsrtowcs_chk -- convert a multibyte string to a 10943 wide-character string, with buffer overflow checking 10944 10945 Synopsis 10946 10947 #include 10948 10949 size_t __mbsrtowcs_chk(wchar_t * dest, const char * * src, 10950 size_t len, mbstate_t * ps, size_t destlen); 10951 10952 Description 10953 10954 The interface __mbsrtowcs_chk() shall function in the same way 10955 as the interface mbsrtowcs(), except that __mbsrtowcs_chk() 10956 shall check for buffer overflow before computing a result. If 10957 an overflow is anticipated, the function shall abort and the 10958 program calling it shall exit. 10959 10960 The parameter destlen specifies the size of the object dest. If 10961 len exceeds destlen, the function shall abort, and the program 10962 calling it shall exit. 10963 10964 The __mbsrtowcs_chk() function is not in the source standard; 10965 it is only in the binary standard. 10966 10967 __mbstowcs_chk 10968 10969 Name 10970 10971 __mbstowcs_chk -- convert a multibyte string to a 10972 wide-character string, with buffer overflow checking 10973 10974 Synopsis 10975 10976 #include 10977 10978 size_t __mbstowcs_chk(wchar_t * dest, const char * src, size_t 10979 len, size_t destlen); 10980 10981 Description 10982 10983 The interface __mbstowcs_chk() shall function in the same way 10984 as the interface mbstowcs(), except that __mbstowcs_chk() shall 10985 check for buffer overflow before computing a result. If an 10986 overflow is anticipated, the function shall abort and the 10987 program calling it shall exit. 10988 10989 The parameter destlen specifies the size of the object dest. If 10990 len exceeds destlen, the function shall abort, and the program 10991 calling it shall exit. 10992 10993 The __mbstowcs_chk() function is not in the source standard; it 10994 is only in the binary standard. 10995 10996 __memcpy_chk 10997 10998 Name 10999 11000 __memcpy_chk -- copy memory area, with buffer overflow checking 11001 11002 Synopsis 11003 11004 #include 11005 11006 void * __memcpy_chk(void * dest, const void * src, size_t len, 11007 size_t destlen); 11008 11009 Description 11010 11011 The interface __memcpy_chk() shall function in the same way as 11012 the interface memcpy(), except that __memcpy_chk() shall check 11013 for buffer overflow before computing a result. If an overflow 11014 is anticipated, the function shall abort and the program 11015 calling it shall exit. 11016 11017 The parameter destlen specifies the size of the object dest. If 11018 len exceeds destlen, the function shall abort, and the program 11019 calling it shall exit. 11020 11021 The __memcpy_chk() function is not in the source standard; it 11022 is only in the binary standard. 11023 11024 __memmove_chk 11025 11026 Name 11027 11028 __memmove_chk -- copy memory area, with buffer overflow 11029 checking 11030 11031 Synopsis 11032 11033 #include 11034 11035 void * __memmove_chk(void * dest, const void * src, size_t len, 11036 size_t destlen); 11037 11038 Description 11039 11040 The interface __memmove_chk() shall function in the same way as 11041 the interface memmove(), except that __memmove_chk() shall 11042 check for buffer overflow before computing a result. If an 11043 overflow is anticipated, the function shall abort and the 11044 program calling it shall exit. 11045 11046 The parameter destlen specifies the size of the object dest. If 11047 len exceeds destlen, the function shall abort, and the program 11048 calling it shall exit. 11049 11050 The __memmove_chk() function is not in the source standard; it 11051 is only in the binary standard. 11052 11053 __mempcpy 11054 11055 Name 11056 11057 __mempcpy -- copy given number of bytes of source to 11058 destination 11059 11060 Synopsis 11061 11062 #include 11063 11064 void * __mempcpy(void * restrict dest, const void * restrict 11065 src, size_t n); 11066 11067 Description 11068 11069 __mempcpy() copies n bytes of src to dest, returning a pointer 11070 to the byte after the last written byte. 11071 11072 If copying takes place between objects that overlap, the 11073 behavior is undefined. 11074 11075 If either dest or src is a null pointer, the behavior is 11076 undefined. 11077 11078 If n is 0 and the other parameters are valid, the return value 11079 is dest. 11080 11081 __mempcpy() is not in the source standard; it is only in the 11082 binary standard. 11083 11084 __mempcpy_chk 11085 11086 Name 11087 11088 __mempcpy_chk -- copy memory area, with buffer overflow 11089 checking 11090 11091 Synopsis 11092 11093 #include 11094 11095 void * __mempcpy_chk(void * dest, const void * src, size_t len, 11096 size_t destlen); 11097 11098 Description 11099 11100 The interface __mempcpy_chk() shall function in the same way as 11101 the interface mempcpy(), except that __mempcpy_chk() shall 11102 check for buffer overflow before computing a result. If an 11103 overflow is anticipated, the function shall abort and the 11104 program calling it shall exit. 11105 11106 The parameter destlen specifies the size of the object dest. If 11107 len exceeds destlen, the function shall abort, and the program 11108 calling it shall exit. 11109 11110 The __mempcpy_chk() function is not in the source standard; it 11111 is only in the binary standard. 11112 11113 __memset_chk 11114 11115 Name 11116 11117 __memset_chk -- fill memory with a constant byte, using buffer 11118 overflow checking 11119 11120 Synopsis 11121 11122 #include 11123 11124 void * __memset_chk(void * dest, int c, size_t len, size_t 11125 destlen); 11126 11127 Description 11128 11129 The interface __memset_chk() shall function in the same way as 11130 the interface memset(), except that __memset_chk() shall check 11131 for buffer overflow before computing a result. If an overflow 11132 is anticipated, the function shall abort and the program 11133 calling it shall exit. 11134 11135 The parameter destlen specifies the size of the object dest. If 11136 len exceeds destlen, the function shall abort, and the program 11137 calling it shall exit. 11138 11139 The __memset_chk() function is not in the source standard; it 11140 is only in the binary standard. 11141 11142 __pread64_chk 11143 11144 Name 11145 11146 __pread64_chk -- read from a file descriptor at a given offset, 11147 with buffer overflow checking 11148 11149 Synopsis 11150 11151 #include 11152 11153 ssize_t __pread64_chk(int fd, void * buf, size_t nbytes, 11154 off64_t offset, size_t buflen); 11155 11156 Description 11157 11158 The interface __pread64_chk() shall function in the same way as 11159 the interface pread64(), except that __pread64_chk() shall 11160 check for buffer overflow before computing a result. If an 11161 overflow is anticipated, the function shall abort and the 11162 program calling it shall exit. 11163 11164 The parameter buflen specifies the size of the buffer buf. If 11165 nbytes exceeds buflen, the function shall abort, and the 11166 program calling it shall exit. 11167 11168 The __pread64_chk() function is not in the source standard; it 11169 is only in the binary standard. 11170 11171 __pread_chk 11172 11173 Name 11174 11175 __pread_chk -- read from a file descriptor at a given offset, 11176 with buffer overflow checking 11177 11178 Synopsis 11179 11180 #include 11181 11182 ssize_t __pread_chk(int fd, void * buf, size_t nbytes, off_t 11183 offset, size_t buflen); 11184 11185 Description 11186 11187 The interface __pread_chk() shall function in the same way as 11188 the interface pread(), except that __pread_chk() shall check 11189 for buffer overflow before computing a result. If an overflow 11190 is anticipated, the function shall abort and the program 11191 calling it shall exit. 11192 11193 The parameter buflen specifies the size of the buffer buf. If 11194 nbytes exceeds buflen, the function shall abort, and the 11195 program calling it shall exit. 11196 11197 The __pread_chk() function is not in the source standard; it is 11198 only in the binary standard. 11199 11200 __printf_chk 11201 11202 Name 11203 11204 __printf_chk -- format and print data, with stack checking 11205 11206 Synopsis 11207 11208 #include 11209 11210 int __printf_chk(int flag, const char * format); 11211 11212 Description 11213 11214 The interface __printf_chk() shall function in the same way as 11215 the interface printf(), except that __printf_chk() shall check 11216 for stack overflow before computing a result, depending on the 11217 value of the flag parameter. If an overflow is anticipated, the 11218 function shall abort and the program calling it shall exit. 11219 11220 In general, the higher the value of flag, the more security 11221 measures this interface shall take in the form of checking the 11222 stack, parameter values, and so on. 11223 11224 The __printf_chk() function is not in the source standard; it 11225 is only in the binary standard. 11226 11227 __rawmemchr 11228 11229 Name 11230 11231 __rawmemchr -- scan memory 11232 11233 Synopsis 11234 11235 #include 11236 11237 void * __rawmemchr(const void * s, int c); 11238 11239 Description 11240 11241 The __rawmemchr() function shall locate the first occurrence of 11242 c (converted to an unsigned char) in the object pointed to by 11243 s. If the byte does not occur in the object, then the behavior 11244 is undefined. 11245 11246 __rawmemchr() is a weak alias for rawmemchr(). It is similar to 11247 memchr(), but it has no length limit. 11248 11249 __rawmemchr() is not in the source standard; it is only in the 11250 binary standard. 11251 11252 Return Value 11253 11254 The __rawmemchr() function shall return a pointer to the 11255 located byte. 11256 11257 __read_chk 11258 11259 Name 11260 11261 __read_chk -- read from a file descriptor, with buffer overflow 11262 checking 11263 11264 Synopsis 11265 11266 #include 11267 11268 ssize_t __read_chk(int fd, void * buf, size_t nbytes, size_t 11269 buflen); 11270 11271 Description 11272 11273 The interface __read_chk() shall function in the same way as 11274 the interface read(), except that __read_chk() shall check for 11275 buffer overflow before computing a result. If an overflow is 11276 anticipated, the function shall abort and the program calling 11277 it shall exit. 11278 11279 The parameter buflen specifies the size of the buffer buf. If 11280 nbytes exceeds buflen, the function shall abort, and the 11281 program calling it shall exit. 11282 11283 The __read_chk() function is not in the source standard; it is 11284 only in the binary standard. 11285 11286 __readlink_chk 11287 11288 Name 11289 11290 __readlink_chk -- display value of a symbolic link, with buffer 11291 overflow checking 11292 11293 Synopsis 11294 11295 #include 11296 11297 ssize_t __readlink_chk(const char * path, char * buf, size_t 11298 len, size_t buflen); 11299 11300 Description 11301 11302 The interface __readlink_chk() shall function in the same way 11303 as the interface readlink(), except that __readlink_chk() shall 11304 check for buffer overflow before computing a result. If an 11305 overflow is anticipated, the function shall abort and the 11306 program calling it shall exit. 11307 11308 The parameter buflen specifies the size of the buffer buf. If 11309 len exceeds buflen, the function shall abort, and the program 11310 calling it shall exit. 11311 11312 The __readlink_chk() function is not in the source standard; it 11313 is only in the binary standard. 11314 11315 __realpath_chk 11316 11317 Name 11318 11319 __realpath_chk -- return the canonicalized absolute pathname, 11320 with buffer overflow checking 11321 11322 Synopsis 11323 11324 #include 11325 11326 char * __realpath_chk(const char * path, char * resolved_path, 11327 size_t resolved_len); 11328 11329 Description 11330 11331 The interface __realpath_chk() shall function in the same way 11332 as the interface realpath(), except that __realpath_chk() shall 11333 check for buffer overflow before computing a result. If an 11334 overflow is anticipated, the function shall abort and the 11335 program calling it shall exit. 11336 11337 The parameter resolved_len specifies the size of the string 11338 resolved_path. If resolved_len is less than PATH_MAX, then the 11339 function shall abort, and the program calling it shall exit. 11340 11341 The __realpath_chk() function is not in the source standard; it 11342 is only in the binary standard. 11343 11344 __recv_chk 11345 11346 Name 11347 11348 __recv_chk -- receive a message from a socket, with buffer 11349 overflow checking 11350 11351 Synopsis 11352 11353 #include 11354 11355 ssize_t __recv_chk(int fd, void * buf, size_t len, size_t 11356 buflen, int flag); 11357 11358 Description 11359 11360 The interface __recv_chk() shall function in the same way as 11361 the interface recv(), except that __recv_chk() shall check for 11362 buffer overflow before computing a result, depending on the 11363 value of the flag parameter. If an overflow is anticipated, the 11364 function shall abort and the program calling it shall exit. 11365 11366 In general, the higher the value of flag, the more security 11367 measures this interface shall take in the form of checking the 11368 buffer, parameter values, and so on. 11369 11370 The parameter buflen specifies the size of the buffer buf. If 11371 len exceeds buflen, the function shall abort, and the program 11372 calling it shall exit. 11373 11374 The __recv_chk() function is not in the source standard; it is 11375 only in the binary standard. 11376 11377 __recvfrom_chk 11378 11379 Name 11380 11381 __recvfrom_chk -- receive a message from a socket, with buffer 11382 overflow checking 11383 11384 Synopsis 11385 11386 #include 11387 11388 ssize_t __recvfrom_chk(int fd, void * buf, size_t len, size_t 11389 buflen, int flag, struct sockaddr * from, socklen_t * fromlen); 11390 11391 Description 11392 11393 The interface __recvfrom_chk() shall function in the same way 11394 as the interface recvfrom(), except that __recvfrom_chk() shall 11395 check for buffer overflow before computing a result, depending 11396 on the value of the flag parameter. If an overflow is 11397 anticipated, the function shall abort and the program calling 11398 it shall exit. 11399 11400 In general, the higher the value of flag, the more security 11401 measures this interface shall take in the form of checking the 11402 buffer, parameter values, and so on. 11403 11404 The parameter buflen specifies the size of the buffer buf. If 11405 len exceeds buflen, the function shall abort, and the program 11406 calling it shall exit. 11407 11408 The __recvfrom_chk() function is not in the source standard; it 11409 is only in the binary standard. 11410 11411 __register_atfork 11412 11413 Name 11414 11415 __register_atfork -- alias for register_atfork 11416 11417 Synopsis 11418 11419 int __register_atfork(void (*prepare) (void), void (*parent) 11420 (void), void (*child) (void), void *__dso_handle); 11421 11422 Description 11423 11424 __register_atfork() implements pthread_atfork() as specified in 11425 ISO POSIX (2003). The additional parameter __dso_handle allows 11426 a shared object to pass in it's handle so that functions 11427 registered by __register_atfork() can be unregistered by the 11428 runtime when the shared object is unloaded. 11429 11430 __sigsetjmp 11431 11432 Name 11433 11434 __sigsetjmp -- save stack context for non-local goto 11435 11436 Synopsis 11437 11438 int __sigsetjmp(jmp_buf env, int savemask); 11439 11440 Description 11441 11442 __sigsetjmp() has the same behavior as sigsetjmp() as specified 11443 by ISO POSIX (2003). 11444 11445 __sigsetjmp() is not in the source standard; it is only in the 11446 binary standard. 11447 11448 __snprintf_chk 11449 11450 Name 11451 11452 __snprintf_chk -- convert formatted output, with buffer 11453 overflow checking 11454 11455 Synopsis 11456 11457 #include 11458 11459 int __snprintf_chk(char * str, size_t maxlen, int flag, size_t 11460 strlen, const char * format); 11461 11462 Description 11463 11464 The interface __snprintf_chk() shall function in the same way 11465 as the interface snprintf(), except that __snprintf_chk() shall 11466 check for buffer overflow before computing a result, depending 11467 on the value of the flag parameter. If an overflow is 11468 anticipated, the function shall abort and the program calling 11469 it shall exit. 11470 11471 In general, the higher the value of flag, the more security 11472 measures this interface shall take in the form of checking the 11473 buffer, parameter values, and so on. 11474 11475 The parameter strlen specifies the size of the buffer str. If 11476 strlen is less than maxlen, the function shall abort, and the 11477 program calling it shall exit. 11478 11479 The __snprintf_chk() function is not in the source standard; it 11480 is only in the binary standard. 11481 11482 __sprintf_chk 11483 11484 Name 11485 11486 __sprintf_chk -- convert formatted output, with stack checking 11487 11488 Synopsis 11489 11490 #include 11491 11492 int __sprintf_chk(char * str, int flag, size_t strlen, const 11493 char * format); 11494 11495 Description 11496 11497 The interface __sprintf_chk() shall function in the same way as 11498 the interface sprintf(), except that __sprintf_chk() shall 11499 check for stack overflow before computing a result, depending 11500 on the value of the flag parameter. If an overflow is 11501 anticipated, the function shall abort and the program calling 11502 it shall exit. 11503 11504 In general, the higher the value of flag, the more security 11505 measures this interface shall take in the form of checking the 11506 stack, parameter values, and so on. 11507 11508 The parameter strlen specifies the size of the string str. If 11509 strlen is zero, the function shall abort, and the program 11510 calling it shall exit. 11511 11512 The __sprintf_chk() function is not in the source standard; it 11513 is only in the binary standard. 11514 11515 __stack_chk_fail 11516 11517 Name 11518 11519 __stack_chk_fail -- terminate a function in case of stack 11520 overflow 11521 11522 Synopsis 11523 11524 #include 11525 11526 void __stack_chk_fail(void); 11527 11528 Description 11529 11530 The interface __stack_chk_fail() shall abort the function that 11531 called it with a message that a stack overflow has been 11532 detected. The program that called the function shall then exit. 11533 11534 Application Usage (informative) 11535 11536 The interface __stack_chk_fail() does not check for a stack 11537 overflow itself. It merely reports one when invoked. 11538 11539 __stpcpy 11540 11541 Name 11542 11543 __stpcpy -- alias for stpcpy 11544 11545 Synopsis 11546 11547 #include 11548 11549 char * __stpcpy(char * dest, const char * src); 11550 11551 Description 11552 11553 The __stpcpy() function has the same specification as the 11554 stpcpy(). 11555 11556 __stpcpy() is not in the source standard; it is only in the 11557 binary standard. 11558 11559 __stpcpy_chk 11560 11561 Name 11562 11563 __stpcpy_chk -- copy a string returning a pointer to its end, 11564 with buffer overflow checking 11565 11566 Synopsis 11567 11568 #include 11569 11570 char * __stpcpy_chk(char * dest, const char * src, size_t 11571 destlen); 11572 11573 Description 11574 11575 The interface __stpcpy_chk() shall function in the same way as 11576 the interface stpcpy(), except that __stpcpy_chk() shall check 11577 for buffer overflow before computing a result. If an overflow 11578 is anticipated, the function shall abort and the program 11579 calling it shall exit. 11580 11581 The parameter destlen specifies the size of the object pointed 11582 to by dest. 11583 11584 The __stpcpy_chk() function is not in the source standard; it 11585 is only in the binary standard. 11586 11587 __stpncpy_chk 11588 11589 Name 11590 11591 __stpncpy_chk -- copy a fixed-size string, returning a pointer 11592 to its end, with buffer overflow checking 11593 11594 Synopsis 11595 11596 #include 11597 11598 char * __stpncpy_chk(char * dest, const char * src, size_t n, 11599 size_t destlen); 11600 11601 Description 11602 11603 The interface __stpncpy_chk() shall function in the same way as 11604 the interface stpncpy(), except that __stpncpy_chk() shall 11605 check for buffer overflow before computing a result. If an 11606 overflow is anticipated, the function shall abort and the 11607 program calling it shall exit. 11608 11609 The parameter destlen specifies the size of the object pointed 11610 to by dest. If n exceeds destlen, the function shall abort, and 11611 the program calling it shall exit. 11612 11613 The __stpncpy_chk() function is not in the source standard; it 11614 is only in the binary standard. 11615 11616 __strcat_chk 11617 11618 Name 11619 11620 __strcat_chk -- concatenate two strings, with buffer overflow 11621 checking 11622 11623 Synopsis 11624 11625 #include 11626 11627 char * __strcat_chk(char * dest, const char * src, size_t 11628 destlen); 11629 11630 Description 11631 11632 The interface __strcat_chk() shall function in the same way as 11633 the interface strcat(), except that __strcat_chk() shall check 11634 for buffer overflow before computing a result. If an overflow 11635 is anticipated, the function shall abort and the program 11636 calling it shall exit. 11637 11638 The parameter destlen specifies the size of the object pointed 11639 to by dest. 11640 11641 The __strcat_chk() function is not in the source standard; it 11642 is only in the binary standard. 11643 11644 __strcpy_chk 11645 11646 Name 11647 11648 __strcpy_chk -- copy a string, with buffer overflow checking 11649 11650 Synopsis 11651 11652 #include 11653 11654 char * __strcpy_chk(char * dest, const char * src, size_t 11655 destlen); 11656 11657 Description 11658 11659 The interface __strcpy_chk() shall function in the same way as 11660 the interface strcpy(), except that __strcpy_chk() shall check 11661 for buffer overflow before computing a result. If an overflow 11662 is anticipated, the function shall abort and the program 11663 calling it shall exit. 11664 11665 The parameter destlen specifies the size of the object pointed 11666 to by dest. 11667 11668 The __strcpy_chk() function is not in the source standard; it 11669 is only in the binary standard. 11670 11671 __strdup 11672 11673 Name 11674 11675 __strdup -- alias for strdup 11676 11677 Synopsis 11678 11679 char * __strdup(const char * string); 11680 11681 Description 11682 11683 __strdup() has the same specification as strdup(). 11684 11685 __strdup() is not in the source standard; it is only in the 11686 binary standard. 11687 11688 __strncat_chk 11689 11690 Name 11691 11692 __strncat_chk -- concatenate two strings, with buffer overflow 11693 checking 11694 11695 Synopsis 11696 11697 #include 11698 11699 char * __strncat_chk(char * s1, const char * s2, size_t n, 11700 size_t s1len); 11701 11702 Description 11703 11704 The interface __strncat_chk() shall function in the same way as 11705 the interface strncat(), except that __strncat_chk() shall 11706 check for buffer overflow before computing a result. If an 11707 overflow is anticipated, the function shall abort and the 11708 program calling it shall exit. 11709 11710 The parameter s1len specifies the size of the object pointed to 11711 by s1. 11712 11713 The __strncat_chk() function is not in the source standard; it 11714 is only in the binary standard. 11715 11716 __strncpy_chk 11717 11718 Name 11719 11720 __strncpy_chk -- copy a string, with buffer overflow checking 11721 11722 Synopsis 11723 11724 #include 11725 11726 char * __strncpy_chk(char * s1, const char * s2, size_t n, 11727 size_t s1len); 11728 11729 Description 11730 11731 The interface __strncpy_chk() shall function in the same way as 11732 the interface strncpy(), except that __strncpy_chk() shall 11733 check for buffer overflow before computing a result. If an 11734 overflow is anticipated, the function shall abort and the 11735 program calling it shall exit. 11736 11737 The parameter s1len specifies the size of the object pointed to 11738 by s1. 11739 11740 The __strncpy_chk() function is not in the source standard; it 11741 is only in the binary standard. 11742 11743 __strtod_internal 11744 11745 Name 11746 11747 __strtod_internal -- underlying function for strtod 11748 11749 Synopsis 11750 11751 double __strtod_internal(const char * __nptr, char * * 11752 __endptr, int __group); 11753 11754 Description 11755 11756 __group shall be 0 or the behavior of __strtod_internal() is 11757 undefined. 11758 11759 __strtod_internal(__nptr, __endptr, 0)() has the same 11760 specification as strtod(__nptr, __endptr)(). 11761 11762 __strtod_internal() is not in the source standard; it is only 11763 in the binary standard. 11764 11765 __strtof_internal 11766 11767 Name 11768 11769 __strtof_internal -- underlying function for strtof 11770 11771 Synopsis 11772 11773 float __strtof_internal(const char * __nptr, char * * __endptr, 11774 int __group); 11775 11776 Description 11777 11778 __group shall be 0 or the behavior of __strtof_internal() is 11779 undefined. 11780 11781 __strtof_internal(__nptr, __endptr, 0)() has the same 11782 specification as strtof(__nptr, __endptr)(). 11783 11784 __strtof_internal() is not in the source standard; it is only 11785 in the binary standard. 11786 11787 __strtok_r 11788 11789 Name 11790 11791 __strtok_r -- alias for strtok_r 11792 11793 Synopsis 11794 11795 char * __strtok_r(char * restrict s, const char * restrict 11796 delim, char * * restrict save_ptr); 11797 11798 Description 11799 11800 __strtok_r() has the same specification as strtok_r(). 11801 11802 __strtok_r() is not in the source standard; it is only in the 11803 binary standard. 11804 11805 __strtol_internal 11806 11807 Name 11808 11809 __strtol_internal -- alias for strtol 11810 11811 Synopsis 11812 11813 long int __strtol_internal(const char * __nptr, char * * 11814 __endptr, int __base, int __group); 11815 11816 Description 11817 11818 __group shall be 0 or the behavior of __strtol_internal() is 11819 undefined. 11820 11821 __strtol_internal(__nptr, __endptr, __base, 0) has the same 11822 specification as strtol(__nptr, __endptr, __base). 11823 11824 __strtol_internal() is not in the source standard; it is only 11825 in the binary standard. 11826 11827 __strtold_internal 11828 11829 Name 11830 11831 __strtold_internal -- underlying function for strtold 11832 11833 Synopsis 11834 11835 long double __strtold_internal(const char * __nptr, char * * 11836 __endptr, int __group); 11837 11838 Description 11839 11840 __group shall be 0 or the behavior of __strtold_internal() is 11841 undefined. 11842 11843 __strtold_internal(__nptr, __endptr, 0) has the same 11844 specification as strtold(__nptr, __endptr). 11845 11846 __strtold_internal() is not in the source standard; it is only 11847 in the binary standard. 11848 11849 __strtoll_internal 11850 11851 Name 11852 11853 __strtoll_internal -- underlying function for strtoll 11854 11855 Synopsis 11856 11857 long long __strtoll_internal(const char * __nptr, char * * 11858 __endptr, int __base, int __group); 11859 11860 Description 11861 11862 __group shall be 0 or the behavior of __strtoll_internal() is 11863 undefined. 11864 11865 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 11866 specification as strtoll(__nptr, __endptr, __base). 11867 11868 __strtoll_internal() is not in the source standard; it is only 11869 in the binary standard. 11870 11871 __strtoul_internal 11872 11873 Name 11874 11875 __strtoul_internal -- underlying function for strtoul 11876 11877 Synopsis 11878 11879 unsigned long int __strtoul_internal(const char * __nptr, char 11880 * * __endptr, int __base, int __group); 11881 11882 Description 11883 11884 __group shall be 0 or the behavior of __strtoul_internal() is 11885 undefined. 11886 11887 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 11888 specification as strtoul(__nptr, __endptr, __base). 11889 11890 __strtoul_internal() is not in the source standard; it is only 11891 in the binary standard. 11892 11893 __strtoull_internal 11894 11895 Name 11896 11897 __strtoull_internal -- underlying function for strtoull 11898 11899 Synopsis 11900 11901 unsigned long long __strtoull_internal(const char * __nptr, 11902 char * * __endptr, int __base, int __group); 11903 11904 Description 11905 11906 __group shall be 0 or the behavior of __strtoull_internal() is 11907 undefined. 11908 11909 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 11910 specification as strtoull(__nptr, __endptr, __base). 11911 11912 __strtoull_internal() is not in the source standard; it is only 11913 in the binary standard. 11914 11915 __swprintf_chk 11916 11917 Name 11918 11919 __swprintf_chk -- convert formatted wide-character output, with 11920 stack checking 11921 11922 Synopsis 11923 11924 #include 11925 11926 int __swprintf_chk(wchar_t * s, size_t n, int flag, size_t 11927 slen, const wchar_t * format); 11928 11929 Description 11930 11931 The interface __swprintf_chk() shall function in the same way 11932 as the interface swprintf(), except that __swprintf_chk() shall 11933 check for stack overflow before computing a result, depending 11934 on the value of the flag parameter. If an overflow is 11935 anticipated, the function shall abort and the program calling 11936 it shall exit. 11937 11938 In general, the higher the value of flag, the more security 11939 measures this interface shall take in the form of checking the 11940 stack, parameter values, and so on. 11941 11942 The parameter slen specifies the size of the object pointed to 11943 by s. If slen is less than maxlen, the function shall abort and 11944 the program calling it shall exit. 11945 11946 In general, the higher the value of flag, the more security 11947 measures this interface shall take in the form of checking the 11948 stack, parameter values, and so on. 11949 11950 The __swprintf_chk() function is not in the source standard; it 11951 is only in the binary standard. 11952 11953 __sysconf 11954 11955 Name 11956 11957 __sysconf -- get configuration information at runtime 11958 11959 Synopsis 11960 11961 #include 11962 11963 long __sysconf(int name); 11964 11965 Description 11966 11967 __sysconf() gets configuration information at runtime. 11968 11969 __sysconf() is weak alias to sysconf(). 11970 11971 __sysconf() has the same specification as sysconf(). 11972 11973 __sysconf() is not in the source standard; it is only in the 11974 binary standard. 11975 11976 __syslog_chk 11977 11978 Name 11979 11980 __syslog_chk -- send messages to the system logger, with stack 11981 checking 11982 11983 Synopsis 11984 11985 #include 11986 11987 void __syslog_chk(int priority, int flag, const char * format); 11988 11989 Description 11990 11991 The interface __syslog_chk() shall function in the same way as 11992 the interface syslog(), except that __syslog_chk() shall check 11993 for stack overflow before computing a result, depending on the 11994 value of the flag parameter. If an overflow is anticipated, the 11995 function shall abort and the program calling it shall exit. 11996 11997 In general, the higher the value of flag, the more security 11998 measures this interface shall take in the form of checking the 11999 stack, parameter values, and so on. 12000 12001 The __syslog_chk() function is not in the source standard; it 12002 is only in the binary standard. 12003 12004 __sysv_signal 12005 12006 Name 12007 12008 __sysv_signal -- signal handling 12009 12010 Synopsis 12011 12012 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 12013 12014 Description 12015 12016 __sysv_signal() has the same behavior as signal() as specified 12017 by ISO POSIX (2003). 12018 12019 __sysv_signal() is not in the source standard; it is only in 12020 the binary standard. 12021 12022 __timezone 12023 12024 Name 12025 12026 -- external variable containing timezone 12027 12028 Synopsis 12029 12030 long int __timezone; 12031 12032 Description 12033 12034 The external variable __timezone shall implement the timezone 12035 variable timezone as specified in ISO POSIX (2003). __timezone 12036 has the same specification as timezone. 12037 12038 __ttyname_r_chk 12039 12040 Name 12041 12042 __ttyname_r_chk -- return name of a terminal, with buffer 12043 overflow checking (reentrant) 12044 12045 Synopsis 12046 12047 #include 12048 12049 int __ttyname_r_chk(int fd, char * buf, size_t buflen, size_t 12050 nreal); 12051 12052 Description 12053 12054 The interface __ttyname_r_chk() shall function in the same way 12055 as the interface ttyname_r(), except that __ttyname_r_chk() 12056 shall check for buffer overflow before computing a result. If 12057 an overflow is anticipated, the function shall abort and the 12058 program calling it shall exit. 12059 12060 The parameter buflen specifies the size of the object pointed 12061 to by buf. If buflen exceeds nreal, the function shall abort 12062 and the program calling it shall exit. 12063 12064 The __ttyname_r_chk() function is not in the source standard; 12065 it is only in the binary standard. 12066 12067 __tzname 12068 12069 Name 12070 12071 -- external variable containing the timezone names 12072 12073 Synopsis 12074 12075 char * __tzname[2]; 12076 12077 Description 12078 12079 The external variable __tzname shall implement the timezone 12080 name variable tzname as specified in ISO POSIX (2003) function 12081 tzset(). __tzname has the same specification as tzname. 12082 12083 __vfprintf_chk 12084 12085 Name 12086 12087 __vfprintf_chk -- convert formatted output, with stack checking 12088 12089 Synopsis 12090 12091 #include 12092 12093 int __vfprintf_chk(FILE * fp, int flag, const char * format, 12094 va_list ap); 12095 12096 Description 12097 12098 The interface __vfprintf_chk() shall function in the same way 12099 as the interface vfprintf(), except that __vfprintf_chk() shall 12100 check for stack overflow before computing a result, depending 12101 on the value of the flag parameter. If an overflow is 12102 anticipated, the function shall abort and the program calling 12103 it shall exit. 12104 12105 In general, the higher the value of flag, the more security 12106 measures this interface shall take in the form of checking the 12107 stack, parameter values, and so on. 12108 12109 The __vfprintf_chk() function is not in the source standard; it 12110 is only in the binary standard. 12111 12112 __vfwprintf_chk 12113 12114 Name 12115 12116 __vfwprintf_chk -- convert formatted wide-character output, 12117 with stack checking 12118 12119 Synopsis 12120 12121 #include 12122 12123 int __vfwprintf_chk(FILE * fp, int flag, const wchar_t * 12124 format, va_list ap); 12125 12126 Description 12127 12128 The interface __vfwprintf_chk() shall function in the same way 12129 as the interface vfwprintf(), except that __vfwprintf_chk() 12130 shall check for stack overflow before computing a result, 12131 depending on the value of the flag parameter. If an overflow is 12132 anticipated, the function shall abort and the program calling 12133 it shall exit. 12134 12135 In general, the higher the value of flag, the more security 12136 measures this interface shall take in the form of checking the 12137 stack, parameter values, and so on. 12138 12139 The __vfwprintf_chk() function is not in the source standard; 12140 it is only in the binary standard. 12141 12142 __vprintf_chk 12143 12144 Name 12145 12146 __vprintf_chk -- convert formatted output, with stack checking 12147 12148 Synopsis 12149 12150 #include 12151 12152 int __vprintf_chk(int flag, const char * format, va_list ap); 12153 12154 Description 12155 12156 The interface __vprintf_chk() shall function in the same way as 12157 the interface vprintf(), except that __vprintf_chk() shall 12158 check for stack overflow before computing a result, depending 12159 on the value of the flag parameter. If an overflow is 12160 anticipated, the function shall abort and the program calling 12161 it shall exit. 12162 12163 In general, the higher the value of flag, the more security 12164 measures this interface shall take in the form of checking the 12165 stack, parameter values, and so on. 12166 12167 The __vprintf_chk() function is not in the source standard; it 12168 is only in the binary standard. 12169 12170 __vsnprintf_chk 12171 12172 Name 12173 12174 __vsnprintf_chk -- convert formatted output, with stack 12175 checking 12176 12177 Synopsis 12178 12179 #include 12180 12181 int __vsnprintf_chk(char * s, size_t maxlen, int flag, size_t 12182 slen, const char * format, va_list args); 12183 12184 Description 12185 12186 The interface __vsnprintf_chk() shall function in the same way 12187 as the interface vsnprintf(), except that __vsnprintf_chk() 12188 shall check for stack overflow before computing a result, 12189 depending on the value of the flag parameter. If an overflow is 12190 anticipated, the function shall abort and the program calling 12191 it shall exit. 12192 12193 In general, the higher the value of flag, the more security 12194 measures this interface shall take in the form of checking the 12195 stack, parameter values, and so on. 12196 12197 The parameter slen specifies the size of the object pointed to 12198 by s. If slen is less than maxlen, the function shall abort and 12199 the program calling it shall exit. 12200 12201 In general, the higher the value of flag, the more security 12202 measures this interface shall take in the form of checking the 12203 stack, parameter values, and so on. 12204 12205 The __vsnprintf_chk() function is not in the source standard; 12206 it is only in the binary standard. 12207 12208 __vsprintf_chk 12209 12210 Name 12211 12212 __vsprintf_chk -- convert formatted output, with stack checking 12213 12214 Synopsis 12215 12216 #include 12217 12218 int __vsprintf_chk(char * s, int flag, size_t slen, const char 12219 * format, va_list args); 12220 12221 Description 12222 12223 The interface __vsprintf_chk() shall function in the same way 12224 as the interface vsprintf(), except that __vsprintf_chk() shall 12225 check for stack overflow before computing a result, depending 12226 on the value of the flag parameter. If an overflow is 12227 anticipated, the function shall abort and the program calling 12228 it shall exit. 12229 12230 In general, the higher the value of flag, the more security 12231 measures this interface shall take in the form of checking the 12232 stack, parameter values, and so on. 12233 12234 The parameter slen specifies the size of the object pointed to 12235 by s. If its value is zero, the function shall abort and the 12236 program calling it shall exit. 12237 12238 The __vsprintf_chk() function is not in the source standard; it 12239 is only in the binary standard. 12240 12241 __vswprintf_chk 12242 12243 Name 12244 12245 __vswprintf_chk -- convert formatted wide-character output, 12246 with stack checking 12247 12248 Synopsis 12249 12250 #include 12251 12252 int __vswprintf_chk(wchar_t * s, size_t maxlen, int flag, 12253 size_t slen, const wchar_t * format, va_list args); 12254 12255 Description 12256 12257 The interface __vswprintf_chk() shall function in the same way 12258 as the interface vswprintf(), except that __vswprintf_chk() 12259 shall check for stack overflow before computing a result, 12260 depending on the value of the flag parameter. If an overflow is 12261 anticipated, the function shall abort and the program calling 12262 it shall exit. 12263 12264 In general, the higher the value of flag, the more security 12265 measures this interface shall take in the form of checking the 12266 stack, parameter values, and so on. 12267 12268 The parameter slen specifies the size of the object pointed to 12269 by s. If slen is less than maxlen, the function shall abort and 12270 the program calling it shall exit. 12271 12272 The __vswprintf_chk() function is not in the source standard; 12273 it is only in the binary standard. 12274 12275 __vsyslog_chk 12276 12277 Name 12278 12279 __vsyslog_chk -- send messages to the system logger, with stack 12280 checking 12281 12282 Synopsis 12283 12284 #include 12285 12286 void __vsyslog_chk(int priority, int flag, const char * format, 12287 va_list ap); 12288 12289 Description 12290 12291 The interface __vsyslog_chk() shall function in the same way as 12292 the interface vsyslog(), except that __vsyslog_chk() shall 12293 check for stack overflow before computing a result, depending 12294 on the value of the flag parameter. If an overflow is 12295 anticipated, the function shall abort and the program calling 12296 it shall exit. 12297 12298 In general, the higher the value of flag, the more security 12299 measures this interface shall take in the form of checking the 12300 stack, parameter values, and so on. 12301 12302 The __vsyslog_chk() function is not in the source standard; it 12303 is only in the binary standard. 12304 12305 __vwprintf_chk 12306 12307 Name 12308 12309 __vwprintf_chk -- convert formatted wide-character output, with 12310 stack checking 12311 12312 Synopsis 12313 12314 #include 12315 12316 int __vwprintf_chk(int flag, const wchar_t * format, va_list 12317 ap); 12318 12319 Description 12320 12321 The interface __vwprintf_chk() shall function in the same way 12322 as the interface vwprintf(), except that __vwprintf_chk() shall 12323 check for stack overflow before computing a result, depending 12324 on the value of the flag parameter. If an overflow is 12325 anticipated, the function shall abort and the program calling 12326 it shall exit. 12327 12328 In general, the higher the value of flag, the more security 12329 measures this interface shall take in the form of checking the 12330 stack, parameter values, and so on. 12331 12332 The __vwprintf_chk() function is not in the source standard; it 12333 is only in the binary standard. 12334 12335 __wcpcpy_chk 12336 12337 Name 12338 12339 __wcpcpy_chk -- copy a wide-character string, returning a 12340 pointer to its end, with buffer overflow checking 12341 12342 Synopsis 12343 12344 #include 12345 12346 wchar_t * __wcpcpy_chk(wchar_t * dest, const wchar_t * src, 12347 size_t destlen); 12348 12349 Description 12350 12351 The interface __wcpcpy_chk() shall function in the same way as 12352 the interface wcpcpy(), except that __wcpcpy_chk() shall check 12353 for buffer overflow before computing a result. If an overflow 12354 is anticipated, the function shall abort and the program 12355 calling it shall exit. 12356 12357 The parameter destlen specifies the size of the object pointed 12358 to by dest. 12359 12360 The __wcpcpy_chk() function is not in the source standard; it 12361 is only in the binary standard. 12362 12363 __wcpncpy_chk 12364 12365 Name 12366 12367 __wcpncpy_chk -- copy a fixed-size string of wide characters, 12368 returning a pointer to its end, with buffer overflow checking 12369 12370 Synopsis 12371 12372 #include 12373 12374 wchar_t * __wcpncpy_chk(wchar_t * dest, const wchar_t * src, 12375 size_t n, size_t destlen); 12376 12377 Description 12378 12379 The interface __wcpncpy_chk() shall function in the same way as 12380 the interface wcpncpy(), except that __wcpncpy_chk() shall 12381 check for buffer overflow before computing a result. If an 12382 overflow is anticipated, the function shall abort and the 12383 program calling it shall exit. 12384 12385 The parameter destlen specifies the size of the object pointed 12386 to by dest. If n exceeds destlen, the function shall abort and 12387 the program calling it shall exit. 12388 12389 The __wcpncpy_chk() function is not in the source standard; it 12390 is only in the binary standard. 12391 12392 __wcrtomb_chk 12393 12394 Name 12395 12396 __wcrtomb_chk -- convert a wide character to a multibyte 12397 sequence, with buffer overflow checking 12398 12399 Synopsis 12400 12401 #include 12402 12403 size_t __wcrtomb_chk(char * s, wchar_t wchar, mbstate_t * ps, 12404 size_t buflen); 12405 12406 Description 12407 12408 The interface __wcrtomb_chk() shall function in the same way as 12409 the interface wcrtomb(), except that __wcrtomb_chk() shall 12410 check for buffer overflow before computing a result. If an 12411 overflow is anticipated, the function shall abort and the 12412 program calling it shall exit. 12413 12414 The parameter buflen specifies the size of the object pointed 12415 to by s. If it is less than MB_CUR_MAX, then the function shall 12416 abort and the program calling it shall exit. 12417 12418 The __wcrtomb_chk() function is not in the source standard; it 12419 is only in the binary standard. 12420 12421 __wcscat_chk 12422 12423 Name 12424 12425 __wcscat_chk -- concatenate two wide-character strings, with 12426 buffer overflow checking 12427 12428 Synopsis 12429 12430 #include 12431 12432 wchar_t * __wcscat_chk(wchar_t * dest, const wchar_t * src, 12433 size_t destlen); 12434 12435 Description 12436 12437 The interface __wcscat_chk() shall function in the same way as 12438 the interface wcscat(), except that __wcscat_chk() shall check 12439 for buffer overflow before computing a result. If an overflow 12440 is anticipated, the function shall abort and the program 12441 calling it shall exit. 12442 12443 The parameter destlen specifies the size of the object pointed 12444 to by dest. 12445 12446 The __wcscat_chk() function is not in the source standard; it 12447 is only in the binary standard. 12448 12449 __wcscpy_chk 12450 12451 Name 12452 12453 __wcscpy_chk -- copy a wide-character string, with buffer 12454 overflow checking 12455 12456 Synopsis 12457 12458 #include 12459 12460 wchar_t * __wcscpy_chk(wchar_t * dest, const wchar_t * src, 12461 size_t n); 12462 12463 Description 12464 12465 The interface __wcscpy_chk() shall function in the same way as 12466 the interface wcscpy(), except that __wcscpy_chk() shall check 12467 for buffer overflow before computing a result. If an overflow 12468 is anticipated, the function shall abort and the program 12469 calling it shall exit. 12470 12471 The __wcscpy_chk() function is not in the source standard; it 12472 is only in the binary standard. 12473 12474 __wcsncat_chk 12475 12476 Name 12477 12478 __wcsncat_chk -- concatenate two wide-character strings, with 12479 buffer overflow checking 12480 12481 Synopsis 12482 12483 #include 12484 12485 wchar_t * __wcsncat_chk(wchar_t * dest, const wchar_t * src, 12486 size_t n, size_t destlen); 12487 12488 Description 12489 12490 The interface __wcsncat_chk() shall function in the same way as 12491 the interface wcsncat(), except that __wcsncat_chk() shall 12492 check for buffer overflow before computing a result. If an 12493 overflow is anticipated, the function shall abort and the 12494 program calling it shall exit. 12495 12496 The parameter destlen specifies the size of the object pointed 12497 to by dest. 12498 12499 The __wcsncat_chk() function is not in the source standard; it 12500 is only in the binary standard. 12501 12502 __wcsncpy_chk 12503 12504 Name 12505 12506 __wcsncpy_chk -- copy a fixed-size string of wide characters, 12507 with buffer overflow checking 12508 12509 Synopsis 12510 12511 #include 12512 12513 wchar_t * __wcsncpy_chk(wchar_t * dest, const wchar_t * src, 12514 size_t n, size_t destlen); 12515 12516 Description 12517 12518 The interface __wcsncpy_chk() shall function in the same way as 12519 the interface wcsncpy(), except that __wcsncpy_chk() shall 12520 check for buffer overflow before computing a result. If an 12521 overflow is anticipated, the function shall abort and the 12522 program calling it shall exit. 12523 12524 The parameter destlen specifies the size of the object pointed 12525 to by dest. If len exceeds destlen, the function shall abort 12526 and the program calling it shall exit. 12527 12528 The __wcsncpy_chk() function is not in the source standard; it 12529 is only in the binary standard. 12530 12531 __wcsnrtombs_chk 12532 12533 Name 12534 12535 __wcsnrtombs_chk -- convert a wide-character string to a 12536 multibyte string, with buffer overflow checking 12537 12538 Synopsis 12539 12540 #include 12541 12542 size_t __wcsnrtombs_chk(char * dest, const wchar_t * * src, 12543 size_t nwc, size_t len, mbstate_t * ps, size_t destlen); 12544 12545 Description 12546 12547 The interface __wcsnrtombs_chk() shall function in the same way 12548 as the interface wcsnrtombs(), except that __wcsnrtombs_chk() 12549 shall check for buffer overflow before computing a result. If 12550 an overflow is anticipated, the function shall abort and the 12551 program calling it shall exit. 12552 12553 The parameter destlen specifies the size of the object pointed 12554 to by dest. If len exceeds destlen, the function shall abort 12555 and the program calling it shall exit. 12556 12557 The __wcsnrtombs_chk() function is not in the source standard; 12558 it is only in the binary standard. 12559 12560 __wcsrtombs_chk 12561 12562 Name 12563 12564 __wcsrtombs_chk -- convert a wide-character string to a 12565 multibyte string, with buffer overflow checking 12566 12567 Synopsis 12568 12569 #include 12570 12571 size_t __wcsrtombs_chk(char * dest, const wchar_t * * src, 12572 size_t len, mbstate_t * ps, size_t destlen); 12573 12574 Description 12575 12576 The interface __wcsrtombs_chk() shall function in the same way 12577 as the interface wcsrtombs(), except that __wcsrtombs_chk() 12578 shall check for buffer overflow before computing a result. If 12579 an overflow is anticipated, the function shall abort and the 12580 program calling it shall exit. 12581 12582 The parameter destlen specifies the size of the object pointed 12583 to by dest. If len exceeds destlen, the function shall abort 12584 and the program calling it shall exit. 12585 12586 The __wcsrtombs_chk() function is not in the source standard; 12587 it is only in the binary standard. 12588 12589 __wcstod_internal 12590 12591 Name 12592 12593 __wcstod_internal -- underlying function for wcstod 12594 12595 Synopsis 12596 12597 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 12598 endptr, int group); 12599 12600 Description 12601 12602 group shall be 0 or the behavior of __wcstod_internal() is 12603 undefined. 12604 12605 __wcstod_internal(nptr, endptr, 0) shall behave as wcstod(nptr, 12606 endptr) as specified by ISO POSIX (2003). 12607 12608 __wcstod_internal() is not in the source standard; it is only 12609 in the binary standard. 12610 12611 __wcstof_internal 12612 12613 Name 12614 12615 __wcstof_internal -- underlying function for wcstof 12616 12617 Synopsis 12618 12619 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 12620 endptr, int group); 12621 12622 Description 12623 12624 group shall be 0 or the behavior of __wcstof_internal() is 12625 undefined. 12626 12627 __wcstof_internal(nptr, endptr, 0) shall behave as wcstof(nptr, 12628 endptr) as specified in ISO POSIX (2003). 12629 12630 __wcstof_internal() is not in the source standard; it is only 12631 in the binary standard. 12632 12633 __wcstol_internal 12634 12635 Name 12636 12637 __wcstol_internal -- underlying function for wcstol 12638 12639 Synopsis 12640 12641 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 12642 endptr, int base, int group); 12643 12644 Description 12645 12646 group shall be 0 or the behavior of __wcstol_internal() is 12647 undefined. 12648 12649 __wcstol_internal(nptr, endptr, base, 0) shall behave as 12650 wcstol(nptr, endptr, base) as specified by ISO POSIX (2003). 12651 12652 __wcstol_internal() is not in the source standard; it is only 12653 in the binary standard. 12654 12655 __wcstold_internal 12656 12657 Name 12658 12659 __wcstold_internal -- underlying function for wcstold 12660 12661 Synopsis 12662 12663 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 12664 * endptr, int group); 12665 12666 Description 12667 12668 group shall be 0 or the behavior of __wcstold_internal() is 12669 undefined. 12670 12671 __wcstold_internal(nptr, endptr, 0) shall behave as 12672 wcstold(nptr, endptr) as specified by ISO POSIX (2003). 12673 12674 __wcstold_internal() is not in the source standard; it is only 12675 in the binary standard. 12676 12677 __wcstombs_chk 12678 12679 Name 12680 12681 __wcstombs_chk -- convert a wide-character string to a 12682 multibyte string, with buffer overflow checking 12683 12684 Synopsis 12685 12686 #include 12687 12688 size_t __wcstombs_chk(char * dest, const wchar_t * src, size_t 12689 len, size_t destlen); 12690 12691 Description 12692 12693 The interface __wcstombs_chk() shall function in the same way 12694 as the interface wcstombs(), except that __wcstombs_chk() shall 12695 check for buffer overflow before computing a result. If an 12696 overflow is anticipated, the function shall abort and the 12697 program calling it shall exit. 12698 12699 The parameter destlen specifies the size of the object pointed 12700 to by dest. If len exceeds destlen, the function shall abort 12701 and the program calling it shall exit. 12702 12703 The __wcstombs_chk() function is not in the source standard; it 12704 is only in the binary standard. 12705 12706 __wcstoul_internal 12707 12708 Name 12709 12710 __wcstoul_internal -- underlying function for wcstoul 12711 12712 Synopsis 12713 12714 unsigned long __wcstoul_internal(const wchar_t * restrict nptr, 12715 wchar_t * * restrict endptr, int base, int group); 12716 12717 Description 12718 12719 group shall be 0 or the behavior of __wcstoul_internal() is 12720 undefined. 12721 12722 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 12723 wcstoul(nptr, endptr, base)() as specified by ISO POSIX (2003). 12724 12725 __wcstoul_internal() is not in the source standard; it is only 12726 in the binary standard. 12727 12728 __wctomb_chk 12729 12730 Name 12731 12732 __wctomb_chk -- convert a wide character to a multibyte 12733 sequence, with buffer overflow checking 12734 12735 Synopsis 12736 12737 #include 12738 12739 int __wctomb_chk(char * s, wchar_t wchar, size_t buflen); 12740 12741 Description 12742 12743 The interface __wctomb_chk() shall function in the same way as 12744 the interface wctomb(), except that __wctomb_chk() shall check 12745 for buffer overflow before computing a result. If an overflow 12746 is anticipated, the function shall abort and the program 12747 calling it shall exit. 12748 12749 The parameter buflen specifies the size of the object pointed 12750 to by s. If it is less than MB_CUR_MAX, then the function shall 12751 abort and the program calling it shall exit. 12752 12753 The __wctomb_chk() function is not in the source standard; it 12754 is only in the binary standard. 12755 12756 __wmemcpy_chk 12757 12758 Name 12759 12760 __wmemcpy_chk -- copy an array of wide-characters, with buffer 12761 overflow checking 12762 12763 Synopsis 12764 12765 #include 12766 12767 wchar_t * __wmemcpy_chk(wchar_t * s1, const wchar_t * s2, 12768 size_t n, size_t ns1); 12769 12770 Description 12771 12772 The interface __wmemcpy_chk() shall function in the same way as 12773 the interface wmemcpy(), except that __wmemcpy_chk() shall 12774 check for buffer overflow before computing a result. If an 12775 overflow is anticipated, the function shall abort and the 12776 program calling it shall exit. 12777 12778 The parameter ns1 specifies the size of the object pointed to 12779 by s1. If n exceeds ns1, the function shall abort and the 12780 program calling it shall exit. 12781 12782 The __wmemcpy_chk() function is not in the source standard; it 12783 is only in the binary standard. 12784 12785 __wmemmove_chk 12786 12787 Name 12788 12789 __wmemmove_chk -- copy an array of wide-characters, with buffer 12790 overflow checking 12791 12792 Synopsis 12793 12794 #include 12795 12796 wchar_t * __wmemmove_chk(wchar_t * s1, const wchar_t * s2, 12797 size_t n, size_t ns1); 12798 12799 Description 12800 12801 The interface __wmemmove_chk() shall function in the same way 12802 as the interface wmemmove(), except that __wmemmove_chk() shall 12803 check for buffer overflow before computing a result. If an 12804 overflow is anticipated, the function shall abort and the 12805 program calling it shall exit. 12806 12807 The parameter ns1 specifies the size of the object pointed to 12808 by s1. If n exceeds ns1, the function shall abort and the 12809 program calling it shall exit. 12810 12811 The __wmemmove_chk() function is not in the source standard; it 12812 is only in the binary standard. 12813 12814 __wmempcpy_chk 12815 12816 Name 12817 12818 __wmempcpy_chk -- copy memory area, with buffer overflow 12819 checking 12820 12821 Synopsis 12822 12823 #include 12824 12825 wchar_t * __wmempcpy_chk(wchar_t * s1, const wchar_t * s2, 12826 size_t n, size_t ns1); 12827 12828 Description 12829 12830 The interface __wmempcpy_chk() shall function in the same way 12831 as the interface wmempcpy(), except that __wmempcpy_chk() shall 12832 check for buffer overflow before computing a result. If an 12833 overflow is anticipated, the function shall abort and the 12834 program calling it shall exit. 12835 12836 The parameter ns1 specifies the size of the object pointed to 12837 by s1. If n exceeds ns1, the function shall abort and the 12838 program calling it shall exit. 12839 12840 The __wmempcpy_chk() function is not in the source standard; it 12841 is only in the binary standard. 12842 12843 __wmemset_chk 12844 12845 Name 12846 12847 __wmemset_chk -- fill an array of wide-characters with a 12848 constant wide character, with buffer overflow checking 12849 12850 Synopsis 12851 12852 #include 12853 12854 wchar_t * __wmemset_chk(wchar_t * s, wchar_t c, size_t n, 12855 size_t destlen); 12856 12857 Description 12858 12859 The interface __wmemset_chk() shall function in the same way as 12860 the interface wmemset(), except that __wmemset_chk() shall 12861 check for buffer overflow before computing a result. If an 12862 overflow is anticipated, the function shall abort and the 12863 program calling it shall exit. 12864 12865 The parameter destlen specifies the size of the object pointed 12866 to by s. If n exceeds destlen, the function shall abort and the 12867 program calling it shall exit. 12868 12869 The __wmemset_chk() function is not in the source standard; it 12870 is only in the binary standard. 12871 12872 __wprintf_chk 12873 12874 Name 12875 12876 __wprintf_chk -- convert formatted wide-character output, with 12877 stack checking 12878 12879 Synopsis 12880 12881 #include 12882 12883 int __wprintf_chk(int flag, const wchar_t * format); 12884 12885 Description 12886 12887 The interface __wprintf_chk() shall function in the same way as 12888 the interface wprintf(), except that __wprintf_chk() shall 12889 check for stack overflow before computing a result, depending 12890 on the value of the flag parameter. If an overflow is 12891 anticipated, the function shall abort and the program calling 12892 it shall exit. 12893 12894 In general, the higher the value of flag, the more security 12895 measures this interface shall take in the form of checking the 12896 stack, parameter values, and so on. 12897 12898 The __wprintf_chk() function is not in the source standard; it 12899 is only in the binary standard. 12900 12901 __xmknod 12902 12903 Name 12904 12905 __xmknod -- make a special file 12906 12907 Synopsis 12908 12909 #include 12910 12911 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 12912 dev); 12913 12914 Description 12915 12916 The __xmknod() function shall implement the mknod() interface. 12917 The behavior of __xmknod() for values of ver other than 12918 _MKNOD_VER is undefined. See Data Definitions in the 12919 architecture specific part of this specification for the 12920 correct value of _MKNOD_VER. 12921 12922 __xmknod(_MKNOD_VER, path, mode, dev) shall behave as 12923 mknod(path, mode, dev) as specified by ISO POSIX (2003). 12924 12925 The __xmknod() function is not in the source standard; it is 12926 only in the binary standard. 12927 12928 Note: The mknod() function is not in the binary standard; it 12929 is only in the source standard. 12930 12931 __xmknodat 12932 12933 Name 12934 12935 __xmknodat -- make a special file relative to a directory file 12936 descriptor 12937 12938 Synopsis 12939 12940 #include 12941 12942 int __xmknodat(int ver, int dirfd, const char * path, mode_t 12943 path, dev_t * dev); 12944 12945 Description 12946 12947 The __xmknodat() function shall implement the mknodat() 12948 function. The behavior of __xmknodat() for values of ver other 12949 than _MKNOD_VER is undefined. See Data Definitions in the 12950 architecture specific part of this specification for the 12951 correct value of _MKNOD_VER. 12952 12953 __xmknodat(_MKNOD_VER, dirfd, path, mode, dev) shall behave as 12954 mknodat(dirfd, path, mode, dev) as specified by POSIX 1003.1 12955 2008. 12956 12957 The __xmknodat() function is not in the source standard; it is 12958 only in the binary standard. 12959 12960 Note: The mknodat() function is not in the binary standard; 12961 it is only in the source standard. 12962 12963 __xpg_basename 12964 12965 Name 12966 12967 __xpg_basename -- return the last component of a file name 12968 12969 Synopsis 12970 12971 #include 12972 12973 char * __xpg_basename(const char * path); 12974 12975 Description 12976 12977 The __xpg_basename() function shall return a pointer to the 12978 final component of the pathname named by path, as described in 12979 ISO POSIX (2003) basename(). 12980 12981 This function is not in the source standard, it is only in the 12982 binary standard. 12983 12984 Return Value 12985 12986 See ISO POSIX (2003). 12987 12988 __xpg_sigpause 12989 12990 Name 12991 12992 __xpg_sigpause -- remove a signal from the signal mask and 12993 suspend the thread 12994 12995 Synopsis 12996 12997 #include 12998 12999 int __xpg_sigpause(int sig); 13000 13001 Description 13002 13003 The __xpg_sigpause() function shall implement the sigpause() 13004 described in ISO POSIX (2003). 13005 13006 This function is not in the source standard, it is only in the 13007 binary standard. 13008 13009 Return Value 13010 13011 See ISO POSIX (2003). 13012 13013 __xpg_strerror_r 13014 13015 Name 13016 13017 __xpg_strerror_r -- return string describing error number 13018 13019 Synopsis 13020 13021 #include 13022 13023 int __xpg_strerror_r(int errnum, char * buf, size_t buflen); 13024 13025 Description 13026 13027 The __xpg_strerror_r() function shall map the error number in 13028 errnum to a locale-dependent error message string and shall 13029 return the string in the buffer pointed to by strerrbuf, with 13030 length buflen, as described in ISO POSIX (2003) strerror_r(). 13031 13032 This function is not in the source standard, it is only in the 13033 binary standard. 13034 13035 Return Value 13036 13037 See ISO POSIX (2003). 13038 13039 __xstat 13040 13041 Name 13042 13043 __xstat -- get File Status 13044 13045 Synopsis 13046 13047 #include 13048 #include 13049 13050 int __xstat(int ver, const char * path, struct stat * 13051 stat_buf); 13052 13053 int __lxstat(int ver, const char * path, struct stat * 13054 stat_buf); 13055 13056 int __fxstat(int ver, int fildes, struct stat * stat_buf); 13057 13058 Description 13059 13060 The functions __xstat(), __lxstat(), and __fxstat() shall 13061 implement the functions stat(), lstat(), and fstat() 13062 respectively. 13063 13064 The behavior of these functions for values of ver other than 13065 _STAT_VER is undefined. See Data Definitions in the 13066 architecture specific part of this specification for the 13067 correct value of _STAT_VER. 13068 13069 __xstat(_STAT_VER, path, stat_buf) shall implement stat(path, 13070 stat_buf) as specified by ISO POSIX (2003). 13071 13072 __lxstat(_STAT_VER, path, stat_buf) shall implement lstat(path, 13073 stat_buf) as specified by ISO POSIX (2003). 13074 13075 __fxstat(_STAT_VER, fildes, stat_buf) shall implement 13076 fstat(fildes, stat_buf) as specified by ISO POSIX (2003). 13077 13078 __xstat(), __lxstat(), and __fxstat() are not in the source 13079 standard; they are only in the binary standard. 13080 13081 stat(), lstat(), and fstat() are not in the binary standard; 13082 they are only in the source standard. 13083 13084 __xstat64 13085 13086 Name 13087 13088 __xstat64 -- get File Status 13089 13090 Synopsis 13091 13092 #define _LARGEFILE_SOURCE 1 13093 #include 13094 #include 13095 13096 int __xstat64(int ver, const char * path, struct stat64 * 13097 stat_buf); 13098 13099 int __lxstat64(int ver, const char * path, struct stat64 * 13100 stat_buf); 13101 13102 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 13103 13104 Description 13105 13106 The functions __xstat64(), __lxstat64(), and __fxstat64() shall 13107 implement the functions stat64(), lstat64(), and fstat64() 13108 respectively. 13109 13110 The behavior of these functions for values of ver other than 13111 _STAT_VER is undefined. See Data Definitions in the 13112 architecture specific part of this specification for the 13113 correct value of _STAT_VER. 13114 13115 __xstat64(_STAT_VER, path, stat_buf) shall behave as 13116 stat64(path, stat_buf) as specified by Large File Support. 13117 13118 __lxstat64(_STAT_VER, path, stat_buf) shall behave as 13119 lstat64(path, stat_buf) as specified by Large File Support. 13120 13121 __fxstat64(_STAT_VER, fildes, stat_buf) shall behave as 13122 fstat64(fildes, stat_buf) as specified by Large File Support. 13123 13124 __xstat64(), __lxstat64(), and __fxstat64() are not in the 13125 source standard; they are only in the binary standard. 13126 13127 stat64(), lstat64(), and fstat64() are not in the binary 13128 standard; they are only in the source standard. 13129 13130 _environ 13131 13132 Name 13133 13134 _environ -- alias for environ - user environment 13135 13136 Synopsis 13137 13138 extern char * *_environ; 13139 13140 Description 13141 13142 _environ is an alias for environ - user environment. 13143 13144 _nl_msg_cat_cntr 13145 13146 Name 13147 13148 _nl_msg_cat_cntr -- new catalog load counter 13149 13150 Synopsis 13151 13152 #include 13153 13154 extern int _nl_msg_cat_cntr; 13155 13156 Description 13157 13158 The global variable _nl_msg_cat_cntr is incremented each time a 13159 new catalog is loaded. This variable is only in the binary 13160 standard; it is not in the source standard. 13161 13162 _sys_errlist 13163 13164 Name 13165 13166 _sys_errlist -- array containing the "C" locale strings used by 13167 strerror() 13168 13169 Synopsis 13170 13171 #include 13172 13173 extern const char *const _sys_errlist[]; 13174 13175 Description 13176 13177 _sys_errlist is an array containing the "C" locale strings used 13178 by strerror(). This normally should not be used directly. 13179 strerror() provides all of the needed functionality. 13180 13181 _sys_siglist 13182 13183 Name 13184 13185 _sys_siglist -- array containing the names of the signal names 13186 13187 Synopsis 13188 13189 #include 13190 13191 extern const char *const _sys_siglist[NSIG]; 13192 13193 Description 13194 13195 _sys_siglist is an array containing the names of the signal 13196 names. 13197 13198 The _sys_siglist array is only in the binary standard; it is 13199 not in the source standard. Applications wishing to access the 13200 names of signals should use the strsignal() function. 13201 13202 acct 13203 13204 Name 13205 13206 acct -- switch process accounting on or off 13207 13208 Synopsis 13209 13210 #include 13211 13212 int acct(const char * filename); 13213 13214 Description 13215 13216 When filename is the name of an existing file, acct() turns 13217 accounting on and appends a record to filename for each 13218 terminating process. When filename is NULL, acct() turns 13219 accounting off. 13220 13221 Return Value 13222 13223 On success, 0 is returned. On error, -1 is returned and the 13224 global variable errno is set appropriately. 13225 13226 Errors 13227 13228 ENOSYS 13229 13230 BSD process accounting has not been enabled when the operating 13231 system kernel was compiled. The kernel configuration parameter 13232 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 13233 ENOMEM 13234 13235 Out of memory. 13236 EPERM 13237 13238 The calling process has no permission to enable process 13239 accounting. 13240 EACCES 13241 13242 filename is not a regular file. 13243 EIO 13244 13245 Error writing to the filename. 13246 EUSERS 13247 13248 There are no more free file structures or we run out of memory. 13249 13250 adjtime 13251 13252 Name 13253 13254 adjtime -- correct the time to allow synchronization of the 13255 system clock 13256 13257 Synopsis 13258 13259 #include 13260 13261 int adjtime(const struct timeval * delta, struct timeval * 13262 olddelta); 13263 13264 Description 13265 13266 adjtime() makes small adjustments to the system time as 13267 returned by gettimeofday()(2), advancing or retarding it by the 13268 time specified by the timeval delta. If delta is negative, the 13269 clock is slowed down by incrementing it more slowly than normal 13270 until the correction is complete. If delta is positive, a 13271 larger increment than normal is used. The skew used to perform 13272 the correction is generally a fraction of one percent. Thus, 13273 the time is always a monotonically increasing function. A time 13274 correction from an earlier call to adjtime() may not be 13275 finished when adjtime() is called again. If olddelta is 13276 non-NULL, the structure pointed to will contain, upon return, 13277 the number of microseconds still to be corrected from the 13278 earlier call. 13279 13280 adjtime() may be used by time servers that synchronize the 13281 clocks of computers in a local area network. Such time servers 13282 would slow down the clocks of some machines and speed up the 13283 clocks of others to bring them to the average network time. 13284 13285 Appropriate privilege is required to adjust the system time. 13286 13287 Return Value 13288 13289 On success, 0 is returned. On error, -1 is returned and the 13290 global variable errno is set appropriately. 13291 13292 Errors 13293 13294 EFAULT 13295 13296 An argument points outside the process's allocated address 13297 space. 13298 EPERM 13299 13300 The process does not have appropriate privilege. 13301 13302 alphasort64 13303 13304 Name 13305 13306 alphasort64 -- Comparison function for directory scanning 13307 (Large File Support) 13308 13309 Synopsis 13310 13311 #include 13312 13313 int alphasort64(const struct dirent64 ** d1, const struct 13314 dirent64 ** d2); 13315 13316 Description 13317 13318 alpahsort64() is a large-file version of the alphasort() 13319 function as defined in POSIX 1003.1 2008. If differs only in 13320 that the d1 and d2 parameters are of type dirent64 instead of 13321 type dirent. 13322 13323 asprintf 13324 13325 Name 13326 13327 asprintf -- write formatted output to a dynamically allocated 13328 string 13329 13330 Synopsis 13331 13332 #include 13333 13334 int asprintf(char ** restrict ptr, const char * restrict 13335 format, ...); 13336 13337 Description 13338 13339 The asprintf() function shall behave as sprintf(), except that 13340 the output string shall be dynamically allocated space of 13341 sufficient length to hold the resulting string. The address of 13342 this dynamically allocated string shall be stored in the 13343 location referenced by ptr. 13344 13345 Return Value 13346 13347 Refer to fprintf(). 13348 13349 Errors 13350 13351 Refer to fprintf(). 13352 13353 basename 13354 13355 Name 13356 13357 basename -- return the last component of a file name 13358 13359 Synopsis 13360 13361 #include 13362 13363 char * basename(const char * path); 13364 13365 Description 13366 13367 In the source standard, basename() is implemented as a macro 13368 causing it to behave as described in ISO POSIX (2003), and is 13369 equivalent to the function __xpg_basename(). If the macro is 13370 undefined, basename() from the binary standard is used, with 13371 differences as described here: 13372 13373 The string identified by path shall not be modified. 13374 13375 If path is "/", or ends with a trailing '/' character, the 13376 basename() function shall return a pointer to an empty string. 13377 13378 Return Value 13379 13380 On success, the basename() function shall return a pointer to 13381 the final component of path. Otherwise, it shall return a null 13382 pointer. 13383 13384 See Also 13385 13386 __xpg_basename() 13387 13388 bind_textdomain_codeset 13389 13390 Name 13391 13392 bind_textdomain_codeset -- specify encoding for message 13393 retrieval 13394 13395 Synopsis 13396 13397 #include 13398 13399 char * bind_textdomain_codeset (const char * domainname , const 13400 char * codeset ); 13401 13402 Description 13403 13404 The bind_textdomain_codeset() function can be used to specify 13405 the output codeset for message catalogs for domain domainname. 13406 The codeset argument shall be a valid codeset name which can be 13407 used tor the iconv_open function, or a null pointer. If the 13408 codeset argument is the null pointer, then function returns the 13409 currently selected codeset for the domain with the name 13410 domainname. It shall return a null pointer if no codeset has 13411 yet been selected. 13412 13413 Each successive call to bind_textdomain_codeset() function 13414 overrrides the settings made by the preceding call with the 13415 same domainname. 13416 13417 The bind_textdomain_codeset() function shall return a pointer 13418 to a string containing the name of the selected codeset. The 13419 string shall be allocated internally in the function and shall 13420 not be changed or freed by the user. 13421 13422 Parameters 13423 13424 domainname 13425 13426 The domainname argument is applied to the currently active 13427 LC_MESSAGE locale. It is equivalent in syntax and meaning to 13428 the domainname argument to textdomain, except that the 13429 selection of the domain is valid only for the duration of the 13430 call. 13431 codeset 13432 13433 The name of the output codeset for the selected domain, or NULL 13434 to select the current codeset. 13435 13436 If domainname is the null pointer, or is an empty string, 13437 bind_textdomain_codeset() shall fail, but need not set errno. 13438 13439 Return Value 13440 13441 Returns the currently selected codeset name. It returns a null 13442 pointer if no codeset has yet been selected. 13443 13444 Errors 13445 13446 ENOMEM 13447 13448 Insufficient memory available to allocate return value. 13449 13450 See Also 13451 13452 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 13453 textdomain, bindtextdomain 13454 13455 bindresvport 13456 13457 Name 13458 13459 bindresvport -- bind socket to privileged IP port 13460 13461 Synopsis 13462 13463 #include 13464 #include 13465 13466 int bindresvport(int sd, struct sockaddr_in * sin); 13467 13468 Description 13469 13470 If the process has appropriate privilege, the bindresvport() 13471 function shall bind a socket to an anonymous privileged IP 13472 port, that is, arbitrarily selected from the range 512 through 13473 1023. 13474 13475 If the bind is successful and sin is not NULL, and the port 13476 number bound to is returned in the sin_port member of sin. Any 13477 caller-supplied value of sin_port is ignored. 13478 13479 If sin is NULL, the address family is taken to be AF_INET and 13480 an available privileged port is bound to. Since there is no 13481 sockaddr_in structure, the port number chosen cannot be 13482 returned. The getsockname() may be used to query for this 13483 information. 13484 13485 Return Value 13486 13487 On success, 0 is returned. On error, -1 is returned and errno 13488 is set to indicate the error. 13489 13490 Errors 13491 13492 bindresvport() may fail in the same way as bind() in ISO POSIX 13493 (2003). The following additional or differing failures may 13494 occur: 13495 13496 EADDRINUSE 13497 13498 All privileged ports are in use. 13499 EAFNOSUPPORT 13500 13501 The specified address is not a valid address for the address 13502 family of the specified socket, or the address family is not 13503 supported. 13504 EPFNOSUPPORT 13505 13506 The same meaning as EAFNOSUPPORT. Some older implementations 13507 may return this error instead. 13508 13509 Note: At this time, only AF_INET is supported. Applications 13510 should be prepared for either the EAFNOSUPPORT or 13511 EPFNOSUPPORT error to be indicated. 13512 13513 bindtextdomain 13514 13515 Name 13516 13517 bindtextdomain -- specify the location of a message catalog 13518 13519 Synopsis 13520 13521 #include 13522 13523 char * bindtextdomain(const char * domainname, const char * 13524 dirname); 13525 13526 Description 13527 13528 The bindtextdomain() shall set the the base directory of the 13529 hierarchy containing message catalogs for a given message 13530 domain. 13531 13532 The bindtextdomain() function specifies that the domainname 13533 message catalog can be found in the dirname directory 13534 hierarchy, rather than in the system default locale data base. 13535 13536 If dirname is not NULL, the base directory for message catalogs 13537 belonging to domain domainname shall be set to dirname. If 13538 dirname is NULL, the base directory for message catalogs shall 13539 not be altered. 13540 13541 The function shall make copies of the argument strings as 13542 needed. 13543 13544 dirname can be an absolute or relative pathname. 13545 13546 Note: Applications that wish to use chdir() should always 13547 use absolute pathnames to avoid misadvertently selecting the 13548 wrong or non-existant directory. 13549 13550 If domainname is the null pointer, or is an empty string, 13551 bindtextdomain() shall fail, but need not set errno. 13552 13553 The bindtextdomain() function shall return a pointer to a 13554 string containing the name of the selected directory. The 13555 string shall be allocated internally in the function and shall 13556 not be changed or freed by the user. 13557 13558 Return Value 13559 13560 On success, bindtextdomain() shall return a pointer to a string 13561 containing the directory pathname currently bound to the 13562 domain. On failure, a NULL pointer is returned, and the global 13563 variable errno may be set to indicate the error. 13564 13565 Errors 13566 13567 ENOMEM 13568 13569 Insufficient memory was available. 13570 13571 See Also 13572 13573 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 13574 textdomain, bind_textdomain_codeset 13575 13576 cfmakeraw 13577 13578 Name 13579 13580 cfmakeraw -- get and set terminal attributes 13581 13582 Synopsis 13583 13584 #include 13585 13586 void cfmakeraw(struct termios * termios_p); 13587 13588 Description 13589 13590 The cfmakeraw() function shall set the attributes of the 13591 termios structure referenced by termios_p as follows: 13592 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 13593 |INLCR|IGNCR|ICRNL|IXON); 13594 13595 termios_p->c_oflag &= ~OPOST; 13596 13597 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 13598 13599 termios_p->c_cflag &= ~(CSIZE|PARENB); 13600 13601 termios_p->c_cflag |= CS8; 13602 13603 termios_p shall point to a termios structure that contains the 13604 following members: 13605 tcflag_t c_iflag; /* input modes */ 13606 tcflag_t c_oflag; /* output modes */ 13607 tcflag_t c_cflag; /* control modes */ 13608 tcflag_t c_lflag; /* local modes */ 13609 cc_t c_cc[NCCS]; /* control chars */ 13610 13611 cfsetspeed 13612 13613 Name 13614 13615 cfsetspeed -- set terminal input and output data rate 13616 13617 Synopsis 13618 13619 #include 13620 13621 int cfsetspeed(struct termios *t, speed_t speed); 13622 13623 Description 13624 13625 The cfsetspeed() function shall set the input and output speeds 13626 in t to the value specified by speed. The effects of the 13627 function on the terminal as described below do not become 13628 effective, nor are all errors detected, until the tcsetattr() 13629 function is called. Certain values for baud rates set in 13630 termios and passed to tcsetattr() have special meanings. 13631 13632 Return Value 13633 13634 On success, 0 is returned. On error, -1 is returned and the 13635 global variable errno is set appropriately. 13636 13637 Errors 13638 13639 EINVAL 13640 13641 Invalid speed argument 13642 13643 clearerr_unlocked 13644 13645 Name 13646 13647 clearerr_unlocked -- non-thread-safe clearerr 13648 13649 Description 13650 13651 clearerr_unlocked() is the same as clearerr(), except that it 13652 need not be thread-safe. That is, it may only be invoked in the 13653 ways which are legal for getc_unlocked(). 13654 13655 daemon 13656 13657 Name 13658 13659 daemon -- run in the background 13660 13661 Synopsis 13662 13663 #include 13664 13665 int daemon(int nochdir, int noclose); 13666 13667 Description 13668 13669 The daemon() function shall create a new process, detached from 13670 the controlling terminal. If successful, the calling process 13671 shall exit and the new process shall continue to execute the 13672 application in the background. If nochdir evaluates to true, 13673 the current directory shall not be changed. Otherwise, daemon() 13674 shall change the current working directory to the root (`/'). 13675 If noclose evaluates to true the standard input, standard 13676 output, and standard error file descriptors shall not be 13677 altered. Otherwise, daemon() shall close the standard input, 13678 standard output and standard error file descriptors and reopen 13679 them attached to /dev/null. 13680 13681 Return Value 13682 13683 On error, -1 is returned, and the global variable errno is set 13684 to any of the errors specified for the library functions fork() 13685 and setsid(). 13686 13687 dcgettext 13688 13689 Name 13690 13691 dcgettext -- perform domain and category specific lookup in 13692 message catalog 13693 13694 Synopsis 13695 13696 #include 13697 #include 13698 13699 char * dcgettext(const char * domainname, const char * msgid, 13700 int category); 13701 13702 Description 13703 13704 The dcgettext() function is a domain specified version of 13705 gettext(). 13706 13707 The dcgettext() function shall lookup the translation in the 13708 current locale of the message identified by msgid in the domain 13709 specified by domainname and in the locale category specified by 13710 category. If domainname is NULL, the current default domain 13711 shall be used. The msgid argument shall be a NULL-terminated 13712 string to be matched in the catalogue. category shall specify 13713 the locale category to be used for retrieving message strings. 13714 The category parameter shall be one of LC_CTYPE, LC_COLLATE, 13715 LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The default 13716 domain shall not be changed by a call to dcgettext(). 13717 13718 Return Value 13719 13720 If a translation was found in one of the specified catalogs, it 13721 shall be converted to the current locale's codeset and 13722 returned. The resulting NULL-terminated string shall be 13723 allocated by the dcgettext function, and must not be modified 13724 or freed. If no translation was found, or category was invalid, 13725 msgid shall be returned. 13726 13727 Errors 13728 13729 dcgettext() shall not modify the errno global variable. 13730 13731 See Also 13732 13733 gettext, dgettext, ngettext, dngettext, dcngettext, textdomain, 13734 bindtextdomain, bind_textdomain_codeset 13735 13736 dcngettext 13737 13738 Name 13739 13740 dcngettext -- perform domain and category specific lookup in 13741 message catalog with plural 13742 13743 Synopsis 13744 13745 #include 13746 #include 13747 13748 char * dcngettext(const char * domainname, const char * msgid1, 13749 const char * msgid2, unsigned long int n, int category); 13750 13751 Description 13752 13753 The dcngettext() function is a domain specific version of 13754 gettext, capable of returning either a singular or plural form 13755 of the message. The dcngettext() function shall lookup the 13756 translation in the current locale of the message identified by 13757 msgid1 in the domain specified by domainname and in the locale 13758 category specified by category. If domainname is NULL, the 13759 current default domain shall be used. The msgid1 argument shall 13760 be a NULL-terminated string to be matched in the catalogue. 13761 category shall specify the locale category to be used for 13762 retrieving message strings. The category parameter shall be one 13763 of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, 13764 or LC_TIME. The default domain shall not be changed by a call 13765 to dcngettext(). If n is 1 then the singular version of the 13766 message is returned, otherwise one of the plural forms is 13767 returned, depending on the value of n and the current locale 13768 settings. 13769 13770 Return Value 13771 13772 If a translation corresponding to the value of n was found in 13773 one of the specified catalogs for msgid1, it shall be converted 13774 to the current locale's codeset and returned. The resulting 13775 NULL-terminated string shall be allocated by the dcngettext() 13776 function, and must not be modified or freed. If no translation 13777 was found, or category was invalid, msgid1 shall be returned if 13778 n has the value 1, otherwise msgid2 shall be returned. 13779 13780 Errors 13781 13782 dcngettext() shall not modify the errno global variable. 13783 13784 See Also 13785 13786 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 13787 bindtextdomain, bind_textdomain_codeset 13788 13789 dgettext 13790 13791 Name 13792 13793 dgettext -- perform lookup in message catalog for the current 13794 LC_MESSAGES locale 13795 13796 Synopsis 13797 13798 #include 13799 13800 char * dgettext(const char * domainname, const char * msgid); 13801 13802 Description 13803 13804 dgettext() is a domain specified version of gettext(). 13805 13806 The dgettext() function shall search the currently selected 13807 message catalogs in the domain domainname for a string 13808 identified by the string msgid. If a string is located, that 13809 string shall be returned. The domain specified by domainname 13810 applies to the currently active LC_MESSAGE locale. The default 13811 domain shall not be changed by a call to dgettext(). 13812 13813 Note: The usage of domainanme is equivalent in syntax and 13814 meaning to the textdomain() function's application of 13815 domainname, except that the selection of the domain in 13816 dgettext() is valid only for the duration of the call. 13817 13818 The dgettext() function is equivalent to dcgettext(domainname, 13819 msgid, LC_MESSAGES). 13820 13821 Return Value 13822 13823 On success of a msgid query, the translated NULL-terminated 13824 string is returned. On error, the original msgid is returned. 13825 The length of the string returned is undetermined until 13826 dgettext() is called. 13827 13828 Errors 13829 13830 dgettext() shall not modify the errno global variable. 13831 13832 See Also 13833 13834 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 13835 textdomain, bindtextdomain, bind_textdomain_codeset 13836 13837 dngettext 13838 13839 Name 13840 13841 dngettext -- perform lookup in message catalog for the current 13842 locale 13843 13844 Synopsis 13845 13846 #include 13847 13848 char * dngettext(const char * domainname, const char * msgid1, 13849 const char * msgid2, unsigned long int n); 13850 13851 Description 13852 13853 dngettext() shall be equivalent to a call to 13854 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 13855 13856 See dcngettext() for more information. 13857 13858 See Also 13859 13860 gettext, dgettext, ngettext, dcgettext, dcngettext, textdomain, 13861 bindtextdomain, bind_textdomain_codeset 13862 13863 drand48_r 13864 13865 Name 13866 13867 drand48_r -- reentrantly generate pseudorandom numbers in a 13868 uniform distribution 13869 13870 Synopsis 13871 13872 #include 13873 13874 int drand48_r(struct drand48_data * buffer, double * result); 13875 13876 Description 13877 13878 The interface drand48_r() shall function in the same way as the 13879 interface drand48(), except that drand48_r() shall use the data 13880 in buffer instead of the global random number generator state. 13881 13882 Before it is used, buffer must be initialized, for example, by 13883 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 13884 it with zeroes. 13885 13886 duplocale 13887 13888 Name 13889 13890 duplocale -- provide new handle for selection of locale 13891 13892 Synopsis 13893 13894 #include 13895 13896 locale_t duplocale(locale_t locale); 13897 13898 Description 13899 13900 The duplocale() function shall provide a new locale object 13901 based on the locale object provided in locale, suitable for use 13902 in the newlocale() or uselocale() functions. The new object may 13903 be released by calling freelocale(). 13904 13905 Return Value 13906 13907 On success, the duplocale() function shall return a locale 13908 object. Otherwise, it shall return NULL, and set errno to 13909 indicate the error. 13910 13911 Errors 13912 13913 The duplocale() function shall fail if: 13914 13915 ENOMEM 13916 13917 Insufficient memory. 13918 13919 See Also 13920 13921 setlocale(), freelocale(), newlocale(), uselocale() 13922 13923 endutent 13924 13925 Name 13926 13927 endutent -- access utmp file entries 13928 13929 Synopsis 13930 13931 #include 13932 13933 void endutent(void); 13934 13935 Description 13936 13937 endutent() closes the utmp file. It should be called when the 13938 user code is done accessing the file with the other functions. 13939 13940 epoll_create 13941 13942 Name 13943 13944 epoll_create -- open an epoll file descriptor 13945 13946 Synopsis 13947 13948 #include 13949 13950 int epoll_create(int size); 13951 13952 Description 13953 13954 The epoll API, which consists of the interfaces epoll_create(), 13955 epoll_ctl(), and epoll_wait(), shall support all file 13956 descriptors compatible with poll(). These interfaces shall be 13957 usable in either level-triggered or edge-triggered mode. In 13958 level-triggered mode, epoll has similar semantics to poll(), 13959 and can be used as a faster replacement for it. In 13960 edge-triggered mode, epoll shall only report events for a file 13961 descriptor when changes occur on it. 13962 13963 The epoll_create() interface shall open an epoll file 13964 descriptor by allocating an event backing store of 13965 approximately size size. The size parameter is a hint to the 13966 kernel about how large the event storage should be, not a 13967 rigidly-defined maximum size. 13968 13969 Return Value 13970 13971 On success, epoll_create() shall return the file descriptor, a 13972 non-negative integer that shall be used for subsequent epoll 13973 calls. It should be closed with the close() function. 13974 13975 On failure, epoll_create() shall return -1 and set errno as 13976 follows. 13977 13978 Errors 13979 13980 EINVAL 13981 13982 The size parameter is not positive. 13983 ENFILE 13984 13985 The maximum number of open files has been reached by the 13986 system. 13987 ENOMEM 13988 13989 Not enough memory to create the kernel object. 13990 13991 See Also 13992 13993 close(), epoll_ctl(), epoll_wait(), poll(). 13994 13995 epoll_ctl 13996 13997 Name 13998 13999 epoll_ctl -- control an epoll file descriptor 14000 14001 Synopsis 14002 14003 #include 14004 14005 int epoll_ctl(int epfd, int op, int fd, struct epoll_event * 14006 event); 14007 14008 Description 14009 14010 The interface epoll_ctl() shall control an epoll file 14011 descriptor. 14012 14013 The parameter epfd shall specify the epoll file descriptor to 14014 control. 14015 14016 The parameter op shall specify the operation to perform on the 14017 specified target file descriptor. 14018 14019 The parameter fd shall specify the target file descriptor on 14020 which to perform the specified operation. 14021 14022 The parameter event shall specify the object associated with 14023 the target file descriptor. The events member of the event 14024 parameter is a bit set composed of the event types listed 14025 below. 14026 14027 Event types 14028 14029 EPOLLERR 14030 14031 An error condition occurred on the target file descriptor. It 14032 shall not be necessary to set this event in events; this 14033 interface shall always wait for it. 14034 EPOLLET 14035 14036 This event shall set edge-triggered behavior for the target 14037 file descriptor. The default epoll behavior shall be 14038 level-triggered. 14039 EPOLLHUP 14040 14041 A hang up occurred on the target file descriptor. It shall not 14042 be necessary to set this event in events; this interface shall 14043 always wait for it. 14044 EPOLLIN 14045 14046 The file is accessible to read() operations. 14047 EPOLLONESHOT 14048 14049 This event shall set one-shot behavior for the target file 14050 descriptor. After epoll_wait() retrieves an event, the file 14051 descriptor shall be disabled and epoll shall not report any 14052 other events. To reenable the file descriptor with a new event 14053 mask, the user should invoke epoll_ctl() with EPOLL_CTL_MOD in 14054 the op parameter. 14055 EPOLLOUT 14056 14057 The file is accessible to write() operations. 14058 EPOLLPRI 14059 14060 Urgent data exists for read() operations. 14061 EPOLLRDHUP 14062 14063 A stream socket peer closed the connection, or else the peer 14064 shut down the writing half of the connection. 14065 14066 Values of the op parameter 14067 14068 EPOLL_CTL_ADD 14069 14070 Associate event with the file described by fd, and add fd to 14071 the epoll descriptor epfd. 14072 EPOLL_CTL_DEL 14073 14074 Remove fd from epfd, and ignore event, which can be NULL. 14075 EPOLL_CTL_MOD 14076 14077 Change the event event associated with fd. 14078 14079 Return Value 14080 14081 On success, epoll_ctl() shall return 0. 14082 14083 On failure, epoll_ctl() shall return -1 and set errno as 14084 follows. 14085 14086 Errors 14087 14088 EBADF 14089 14090 The parameter epfd or the parameter fd is an invalid file 14091 descriptor. 14092 EEXIST 14093 14094 The parameter op was EPOLL_CTL_ADD, but the file descriptor fd 14095 is already in epfd. 14096 EINVAL 14097 14098 The parameter epfd is invalid, or it is the same as fd, or the 14099 operation specified by the parameter op is unsupported. 14100 ENOENT 14101 14102 The parameter op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, but the 14103 file descriptor fd is not in epfd. 14104 ENOMEM 14105 14106 Not enough memory for the operation specified by the parameter 14107 op. 14108 EPERM 14109 14110 The file specified by fd does not support epoll. 14111 14112 See Also 14113 14114 close(), epoll_create(), epoll_wait(), poll(). 14115 14116 epoll_wait 14117 14118 Name 14119 14120 epoll_wait -- wait for I/O events on an epoll file descriptor 14121 14122 Synopsis 14123 14124 #include 14125 14126 int epoll_wait(int epfd, struct epoll_event * events, int 14127 maxevents, int timeout); 14128 14129 Description 14130 14131 The interface epoll_wait() shall wait for events on the epoll 14132 file descriptor specified by the parameter epfd. 14133 14134 Upon success, the output parameter events shall refer to an 14135 area of memory containing epoll_event structures available to 14136 the caller. The data members of these structures shall contain 14137 the data set by the user with the interface epoll_ctl(). The 14138 events members shall contain the event bit field that was 14139 returned. 14140 14141 The parameter maxevents shall specify the maximum number of 14142 events that epoll_wait() may return in the output parameter 14143 events. The value of this parameter should be greater than 0. 14144 14145 The parameter timeout shall specify the maximum number of 14146 milliseconds that epoll_wait() shall wait for events. If the 14147 value of this parameter is 0, then epoll_wait() shall return 14148 immediately, even if no events are available, in which case the 14149 return code shall be 0. If the value of timeout is -1, then 14150 epoll_wait() shall block until either a requested event occurs 14151 or the call is interrupted. 14152 14153 Return Value 14154 14155 On success, epoll_wait() shall return the number of file 14156 descriptors that are ready for the I/O that was requested, or 14157 else 0 if no descriptors became ready during timeout. 14158 14159 On failure, epoll_wait() shall return -1 and set errno as 14160 follows. 14161 14162 Errors 14163 14164 EBADF 14165 14166 The parameter epfd is not a valid file descriptor. 14167 EFAULT 14168 14169 The area of memory referenced by the parameter events cannot be 14170 accessed with write permissions. 14171 EINTR 14172 14173 The call was interrupted by a signal handler before the timeout 14174 expired or any requested event took place. 14175 EINVAL 14176 14177 The parameter epfd is not a valid epoll file descriptor, or 14178 else the parameter maxevents is less than or equal to 0. 14179 14180 See Also 14181 14182 close(), epoll_ctl(), epoll_create(), poll(). 14183 14184 erand48_r 14185 14186 Name 14187 14188 erand48_r -- reentrantly generate pseudorandom numbers in a 14189 uniform distribution 14190 14191 Synopsis 14192 14193 #include 14194 14195 int erand48_r(unsigned short[3] xsubi, struct drand48_data * 14196 buffer, double * result); 14197 14198 Description 14199 14200 The interface erand48_r() shall function in the same way as the 14201 interface erand48(), except that erand48_r() shall use the data 14202 in buffer instead of the global random number generator state. 14203 14204 Before it is used, buffer must be initialized, for example, by 14205 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 14206 it with zeroes. 14207 14208 err 14209 14210 Name 14211 14212 err -- display formatted error messages 14213 14214 Synopsis 14215 14216 #include 14217 14218 void err(int eval, const char * fmt, ...); 14219 14220 Description 14221 14222 The err() function shall display a formatted error message on 14223 the standard error stream. First, err() shall write the last 14224 component of the program name, a colon character, and a space 14225 character. If fmt is non-NULL, it shall be used as a format 14226 string for the printf() family of functions, and err() shall 14227 write the formatted message, a colon character, and a space. 14228 Finally, the error message string affiliated with the current 14229 value of the global variable errno shall be written, followed 14230 by a newline character. 14231 14232 The err() function shall not return, the program shall 14233 terminate with the exit value of eval. 14234 14235 See Also 14236 14237 error(), errx() 14238 14239 Return Value 14240 14241 None. 14242 14243 Errors 14244 14245 None. 14246 14247 error 14248 14249 Name 14250 14251 error -- print error message 14252 14253 Synopsis 14254 14255 #include 14256 14257 void error(int exitstatus, int errnum, const char * format, 14258 ...); 14259 14260 Description 14261 14262 error() shall print a message to standard error. 14263 14264 error() shall build the message from the following elements in 14265 their specified order: 14266 14267 1. the program name. If the application has provided a 14268 function named error_print_progname(), error() shall call 14269 this to supply the program name; otherwise, error() uses 14270 the content of the global variable program_name. 14271 2. the colon and space characters, then the result of using 14272 the printf-style format and the optional arguments. 14273 3. if errnum is nonzero, error() shall add the colon and space 14274 characters, then the result of strerror(errnum). 14275 4. a newline. 14276 14277 If exitstatus is nonzero, error() shall call exit(exitstatus). 14278 14279 See Also 14280 14281 err(), errx() 14282 14283 errx 14284 14285 Name 14286 14287 errx -- display formatted error message and exit 14288 14289 Synopsis 14290 14291 #include 14292 14293 void errx(int eval, const char * fmt, ...); 14294 14295 Description 14296 14297 The errx() function shall display a formatted error message on 14298 the standard error stream. The last component of the program 14299 name, a colon character, and a space shall be output. If fmt is 14300 non-NULL, it shall be used as the format string for the 14301 printf() family of functions, and the formatted error message, 14302 a colon character, and a space shall be output. The output 14303 shall be followed by a newline character. 14304 14305 errx() does not return, but shall exit with the value of eval. 14306 14307 Return Value 14308 14309 None. 14310 14311 Errors 14312 14313 None. 14314 14315 See Also 14316 14317 error(), err() 14318 14319 fcntl 14320 14321 Name 14322 14323 fcntl -- file control 14324 14325 Description 14326 14327 fcntl() is as specified in ISO POSIX (2003), but with 14328 differences as listed below. 14329 14330 Implementation may set O_LARGEFILE 14331 14332 According to ISO POSIX (2003), only an application sets fcntl() 14333 flags, for example O_LARGEFILE. However, this specification 14334 also allows an implementation to set the O_LARGEFILE flag in 14335 the case where the programming environment is one of 14336 _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 14337 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX (2003) 14338 for a description of these environments. Thus, calling fcntl() 14339 with the F_GETFL command may return O_LARGEFILE as well as 14340 flags explicitly set by the application in the case that both 14341 the implementation and the application support an off_t of at 14342 least 64 bits. 14343 14344 Additional flags 14345 14346 In addition to the available values for cmd, as documented in 14347 ISO POSIX (2003), this specification permits the following 14348 constants. 14349 14350 F_GETSIG shall get the number of the signal to be sent when 14351 input or output can occur. If the value is 0, then SIGIO shall 14352 be sent. Otherwise, the value retrieved shall be the signal 14353 sent, and the signal handler can discover more information when 14354 installed with the SA_SIGINFO flag. 14355 14356 F_SETSIG shall set the number of the signal to be sent when 14357 input or output can occur. If the value is 0, then SIGIO shall 14358 be sent. Otherwise, the value set shall be the signal to be 14359 sent, and the signal handler can discover more information when 14360 installed with the SA_SIGINFO flag. 14361 14362 F_GETLK64 is analogous to the F_GETLK constant in ISO POSIX 14363 (2003), but shall provide a 64-bit interface on non-64-bit 14364 architectures. It is identical to F_GETLK on a 64-bit machine, 14365 but is provided in 64-bit environments for source code 14366 consistency among architectures. 14367 14368 F_SETLK64 is analogous to the F_SETLK constant in ISO POSIX 14369 (2003), but shall provide a 64-bit interface on non-64-bit 14370 architectures. It is identical to F_SETLK on a 64-bit machine, 14371 but is provided in 64-bit environments for source code 14372 consistency among architectures. 14373 14374 F_SETLKW64 is analogous to the F_SETLKW constant in ISO POSIX 14375 (2003), but provides a 64-bit interface on non-64-bit 14376 architectures. It is identical to F_SETLKW on a 64-bit machine, 14377 but is provided in 64-bit environments for source code 14378 consistency among architectures. 14379 14380 feof_unlocked 14381 14382 Name 14383 14384 feof_unlocked -- non-thread-safe feof 14385 14386 Description 14387 14388 feof_unlocked() is the same as feof(), except that it need not 14389 be thread-safe. That is, it may only be invoked in the ways 14390 which are legal for getc_unlocked(). 14391 14392 ferror_unlocked 14393 14394 Name 14395 14396 ferror_unlocked -- non-thread-safe ferror 14397 14398 Description 14399 14400 ferror_unlocked() is the same as ferror(), except that it need 14401 not be thread-safe. That is, it may only be invoked in the ways 14402 which are legal for getc_unlocked(). 14403 14404 fflush_unlocked 14405 14406 Name 14407 14408 fflush_unlocked -- non thread safe fflush 14409 14410 Description 14411 14412 fflush_unlocked() is the same as fflush() except that it need 14413 not be thread safe. That is, it may only be invoked in the ways 14414 which are legal for getc_unlocked(). 14415 14416 fgetc_unlocked 14417 14418 Name 14419 14420 fgetc_unlocked -- non-thread-safe fgetc 14421 14422 Description 14423 14424 fgetc_unlocked() is the same as fgetc(), except that it need 14425 not be thread-safe. That is, it may only be invoked in the ways 14426 which are legal for getc_unlocked(). 14427 14428 fgets_unlocked 14429 14430 Name 14431 14432 fgets_unlocked -- non-thread-safe fgets 14433 14434 Description 14435 14436 fgets_unlocked() is the same as fgets(), except that it need 14437 not be thread-safe. That is, it may only be invoked in the ways 14438 which are legal for getc_unlocked(). 14439 14440 fgetwc_unlocked 14441 14442 Name 14443 14444 fgetwc_unlocked -- non thread safe fgetwc 14445 14446 Description 14447 14448 fgetwc_unlocked() is the same as fgetwc() except that it need 14449 not be thread safe. That is, it may only be invoked in the ways 14450 which are legal for getc_unlocked(). 14451 14452 fgetws_unlocked 14453 14454 Name 14455 14456 fgetws_unlocked -- non-thread-safe fgetws 14457 14458 Description 14459 14460 fgetws_unlocked() is the same as fgetws(), except that it need 14461 not be thread-safe. That is, it may only be invoked in the ways 14462 which are legal for getc_unlocked(). 14463 14464 fileno_unlocked 14465 14466 Name 14467 14468 fileno_unlocked -- non-thread-safe fileno 14469 14470 Description 14471 14472 fileno_unlocked() is the same as fileno(), except that it need 14473 not be thread-safe. That is, it may only be invoked in the ways 14474 which are legal for getc_unlocked(). 14475 14476 flock 14477 14478 Name 14479 14480 flock -- apply or remove an advisory lock on an open file 14481 14482 Synopsis 14483 14484 int flock(int fd, int operation); 14485 14486 Description 14487 14488 flock() applies or removes an advisory lock on the open file 14489 fd. Valid operation types are: 14490 14491 LOCK_SH 14492 14493 Shared lock. More than one process may hold a shared lock for a 14494 given file at a given time. 14495 LOCK_EX 14496 14497 Exclusive lock. Only one process may hold an exclusive lock for 14498 a given file at a given time. 14499 LOCK_UN 14500 14501 Unlock. 14502 LOCK_NB 14503 14504 Don't block when locking. May be specified (by oring) along 14505 with one of the other operations. 14506 14507 A single file may not simultaneously have both shared and 14508 exclusive locks. 14509 14510 Return Value 14511 14512 On success, 0 is returned. On error, -1 is returned and the 14513 global variable errno is set appropriately. 14514 14515 Errors 14516 14517 EWOULDBLOCK 14518 14519 The file is locked and the LOCK_NB flag was selected. 14520 EBADF 14521 14522 fd is not a not an open file descriptor. 14523 EINTR 14524 14525 While waiting to acquire a lock, the call was interrupted by 14526 delivery of a signal caught by a handler. 14527 EINVAL 14528 14529 The operation is invalid. 14530 ENOLCK 14531 14532 The implementation ran out of memory for allocating lock 14533 records. 14534 14535 fputc_unlocked 14536 14537 Name 14538 14539 fputc_unlocked -- non-thread-safe fputc 14540 14541 Description 14542 14543 fputc_unlocked() is the same as fputc(), except that it need 14544 not be thread-safe. That is, it may only be invoked in the ways 14545 which are legal for getc_unlocked(). 14546 14547 fputs_unlocked 14548 14549 Name 14550 14551 fputs_unlocked -- non-thread-safe fputs 14552 14553 Description 14554 14555 fputs_unlocked() is the same as fputs(), except that it need 14556 not be thread-safe. That is, it may only be invoked in the ways 14557 which are legal for getc_unlocked(). 14558 14559 fputwc_unlocked 14560 14561 Name 14562 14563 fputwc_unlocked -- non-thread-safe fputwc 14564 14565 Description 14566 14567 fputwc_unlocked() is the same as fputwc(), except that it need 14568 not be thread-safe. That is, it may only be invoked in the ways 14569 which are legal for getc_unlocked(). 14570 14571 fputws_unlocked 14572 14573 Name 14574 14575 fputws_unlocked -- non-thread-safe fputws 14576 14577 Description 14578 14579 fputws_unlocked() is the same as fputws(), except that it need 14580 not be thread-safe. That is, it may only be invoked in the ways 14581 which are legal for getc_unlocked(). 14582 14583 fread_unlocked 14584 14585 Name 14586 14587 fread_unlocked -- non-thread-safe fread 14588 14589 Description 14590 14591 fread_unlocked() is the same as fread(), except that it need 14592 not be thread-safe. That is, it may only be invoked in the ways 14593 which are legal for getc_unlocked(). 14594 14595 freelocale 14596 14597 Name 14598 14599 freelocale -- free a locale object 14600 14601 Synopsis 14602 14603 #include 14604 14605 void freelocale(locale_t locale); 14606 14607 Description 14608 14609 The freelocale() function shall free the locale object locale, 14610 and release any resources associated with it. 14611 14612 Return Value 14613 14614 None. 14615 14616 Errors 14617 14618 None defined. 14619 14620 See Also 14621 14622 setlocale(), newlocale(), duplocale(), uselocale() 14623 14624 fscanf 14625 14626 Name 14627 14628 fscanf -- convert formatted input 14629 14630 Description 14631 14632 The scanf() family of functions shall behave as described in 14633 ISO POSIX (2003), except as noted below. 14634 14635 Differences 14636 14637 The %s, %S and %[ conversion specifiers shall accept an option 14638 length modifier a, which shall cause a memory buffer to be 14639 allocated to hold the string converted. In such a case, the 14640 argument corresponding to the conversion specifier should be a 14641 reference to a pointer value that will receive a pointer to the 14642 allocated buffer. If there is insufficient memory to allocate a 14643 buffer, the function may set errno to ENOMEM and a conversion 14644 error results. 14645 14646 Note: This directly conflicts with the ISO C (1999) usage of 14647 %a as a conversion specifier for hexadecimal float values. 14648 While this conversion specifier should be supported, a 14649 format specifier such as "%aseconds" will have a different 14650 meaning on an LSB conforming system. 14651 14652 fstatfs 14653 14654 Name 14655 14656 fstatfs -- (deprecated) 14657 14658 Synopsis 14659 14660 #include 14661 14662 int fstatfs(int fd, struct statfs * buf); 14663 14664 Description 14665 14666 The fstatfs() function returns information about a mounted file 14667 system. The file system is identified by fd, a file descriptor 14668 of an open file within the mounted filesystem. The results are 14669 placed in the structure pointed to by buf. 14670 14671 Fields that are undefined for a particular file system shall be 14672 set to 0. 14673 14674 Note: Application developers should use the fstatvfs() 14675 function to obtain general file system information. 14676 Applications should only use the fstatfs() function if they 14677 must determine the file system type, which need not be 14678 provided by fstatvfs(). 14679 14680 Return Value 14681 14682 On success, the fstatfs() function shall return 0 and set the 14683 fields of the structure idenfitied by buf accordingly. On 14684 error, the fstatfs() function shall return -1 and set errno 14685 accordingly. 14686 14687 Errors 14688 14689 EBADF 14690 14691 fd is not a valid open file descriptor. 14692 EFAULT 14693 14694 buf points to an invalid address. 14695 EIO 14696 14697 An I/O error occurred while reading from or writing to the file 14698 system. 14699 ENOSYS 14700 14701 The filesystem fd is open on does not support statfs(). 14702 14703 fstatfs64 14704 14705 Name 14706 14707 fstatfs64 -- (deprecated) 14708 14709 Synopsis 14710 14711 #include 14712 14713 int fstatfs64(int fd, struct statfs64 * buf); 14714 14715 Description 14716 14717 The fstatfs64() function returns information about a mounted 14718 file system. The file system is identified by fd, a file 14719 descriptor of an open file within the mounted filesystem. The 14720 results are placed in the structure pointed to by buf. 14721 14722 Fields that are undefined for a particular file system shall be 14723 set to 0. 14724 14725 fstatfs64() is a large-file version of the fstatfs() function. 14726 14727 Note: Application developers should use the fstatvfs64() 14728 function to obtain general file system information. 14729 Applications should only use the fstatfs64() function if 14730 they must determine the file system type, which need not be 14731 provided by fstatvfs64(). 14732 14733 Return Value 14734 14735 On success, the fstatfs64() function shall return 0 and set the 14736 fields of the structure idenfitied by buf accordingly. On 14737 error, the fstatfs64() function shall return -1 and set errno 14738 accordingly. 14739 14740 Errors 14741 14742 See fstatfs(). 14743 14744 fwrite_unlocked 14745 14746 Name 14747 14748 fwrite_unlocked -- non-thread-safe fwrite 14749 14750 Description 14751 14752 fwrite_unlocked() is the same as fwrite(), except that it need 14753 not be thread-safe. That is, it may only be invoked in the ways 14754 which are legal for getc_unlocked(). 14755 14756 fwscanf 14757 14758 Name 14759 14760 fwscanf -- convert formatted input 14761 14762 Description 14763 14764 The scanf() family of functions shall behave as described in 14765 ISO POSIX (2003), except as noted below. 14766 14767 Differences 14768 14769 The %s, %S and %[ conversion specifiers shall accept an option 14770 length modifier a, which shall cause a memory buffer to be 14771 allocated to hold the string converted. In such a case, the 14772 argument corresponding to the conversion specifier should be a 14773 reference to a pointer value that will receive a pointer to the 14774 allocated buffer. If there is insufficient memory to allocate a 14775 buffer, the function may set errno to ENOMEM and a conversion 14776 error results. 14777 14778 Note: This directly conflicts with the ISO C (1999) usage of 14779 %a as a conversion specifier for hexadecimal float values. 14780 While this conversion specifier should be supported, a 14781 format specifier such as "%aseconds" will have a different 14782 meaning on an LSB conforming system. 14783 14784 getdomainname 14785 14786 Name 14787 14788 getdomainname -- get NIS domain name (DEPRECATED). 14789 14790 Synopsis 14791 14792 #include 14793 14794 int getdomainname (char * name , size_t namelen ); 14795 14796 Description 14797 14798 If the Network Information System (NIS) is in use, 14799 getdomainname() shall copy the NIS domain name to the supplied 14800 buffer identified by name, with maximum length namelen. If the 14801 NIS domain name is not currently set, getdomainname() shall 14802 copy the string "(none)" to the name. If namelen is less than 14803 the length of the string to be copied, getdomainname() shall 14804 either truncate the string to namelen characters and place it 14805 in name (without a terminating null character), or shall fail 14806 with EINVAL. 14807 14808 Note: The NIS domain name is not the same as the domain 14809 portion of a fully qualified domain name (for example, in 14810 DNS). 14811 14812 The LSB does not include other NIS functions, nor does it 14813 specify how NIS may affect other database functions. No 14814 conforming application can make use of this information 14815 beyond noting whether or not the domain name has been set. 14816 If the name is set to a value other than the string 14817 "(none)", the application should not imply that NIS is in 14818 use. Similarly, if it is set to "(none)", the application 14819 should not assume that NIS is not in use, although NIS 14820 functionality may be restricted in this case. 14821 14822 Return Value 14823 14824 On success, getdomainname() shall return 0. Otherwise, it shall 14825 return -1 and set errno to indicate the error. 14826 14827 Errors 14828 14829 EINVAL 14830 14831 name is a null pointer. 14832 EINVAL 14833 14834 The buffer identified by name and namelen is of insufficient 14835 size to store the NIS domain name string, and the 14836 implementation considers this an error. 14837 14838 Future Directions 14839 14840 The LSB does not include other NIS interfaces, and a future 14841 version of this specification may remove this interface. 14842 Application developers should avoid using this interface where 14843 possible. 14844 14845 getdtablesize 14846 14847 Name 14848 14849 getdtablesize -- get file descriptor table size (DEPRECATED) 14850 14851 Synopsis 14852 14853 #include 14854 14855 int getdtablesize (void ); 14856 14857 Description 14858 14859 The function getdtablesize() returns the number of files a 14860 process can have open. 14861 14862 Note: The getdtablesize() function is deprecated. Portable 14863 applications should call sysconf() with the _SC_OPEN_MAX 14864 option instead. 14865 14866 Return Value 14867 14868 The getdtablesize() function returns the current soft limit as 14869 if obtained by a call to sysconf() with the _SC_OPEN_MAX 14870 option. 14871 14872 Errors 14873 14874 No errors are defined. 14875 14876 getgrent_r 14877 14878 Name 14879 14880 getgrent_r -- reentrantly get entry in group file 14881 14882 Synopsis 14883 14884 #include 14885 14886 int getgrent_r(struct group * gbuf, char * buf, size_t buflen, 14887 struct group * * gbufp); 14888 14889 Description 14890 14891 The reentrant interface getgrent_r() shall function in the same 14892 way as the interface getgrent(), except that getgrent_r() shall 14893 return the group name, group password, and group members in 14894 buffers provided by the caller, rather than as a pointer to 14895 static storage. 14896 14897 The parameter gbuf contains the struct group that was read from 14898 the stream, if any. 14899 14900 The parameter buf contains additional strings, if any. 14901 14902 The parameter buflen specifies the size of buf. 14903 14904 The parameter *gbufp returns a pointer to the struct group in 14905 *gbuf. 14906 14907 Return Value 14908 14909 On success, getgrent_r() shall return 0, and *gbufp shall 14910 contain a pointer to the result. 14911 14912 On failure, *gbufp shall contain NULL, and getgrent_r() shall 14913 return an error as follows. 14914 14915 Errors 14916 14917 ENOENT 14918 14919 No more group entries. 14920 ERANGE 14921 14922 Not enough buffer space. Specify a larger buffer and try again. 14923 14924 getgrouplist 14925 14926 Name 14927 14928 getgrouplist -- get groups a user belongs to 14929 14930 Synopsis 14931 14932 #include 14933 14934 int getgrouplist(const char * user, gid_t group, gid_t * 14935 groups, int * ngroups); 14936 14937 Description 14938 14939 The getgrouplist() function shall fill in the array groups with 14940 the supplementary groups for the user specified by user. On 14941 entry, ngroups shall refer to an integer containing the maximum 14942 number of elements in the groups array. The group group shall 14943 also be included in the values returned in groups. It is 14944 expected that group would be specified as the user's primary 14945 group from the password file (obtainable via getpwnam() or a 14946 similar function). 14947 14948 Return Value 14949 14950 If on entry the value referenced by ngroups was greater than or 14951 equal to the number of supplementary group identifiers to be 14952 copied to the array identified by groups, getgrouplist() shall 14953 return the number of group identifiers actually copied, and 14954 shall set the value referenced by ngroups to this value. 14955 14956 If on entry the value referenced by ngroups was less than the 14957 number of supplementary group identifiers, getgrouplist() shall 14958 return -1. The initial ngroups entries in groups shall be 14959 overwritten. 14960 14961 If the number of groups exceeds the input ngroups value, then 14962 as well as returning -1, ngroups shall be set to the number of 14963 groups that would have been placed in groups if it had been 14964 large enough. 14965 14966 Note: In such a case, the caller can use the information 14967 returned to make a further getgrouplist() call with a 14968 correctly sized groups array. 14969 14970 If user does not refer to a valid user on the system, then the 14971 behavior of this function is undefined. 14972 14973 Errors 14974 14975 None defined. 14976 14977 See Also 14978 14979 getgroups() 14980 14981 gethostbyaddr_r 14982 14983 Name 14984 14985 gethostbyaddr_r -- find network host database entry matching 14986 host name (DEPRECATED) 14987 14988 Synopsis 14989 14990 #include 14991 14992 int gethostbyaddr_r(const void * restrict addr, socklen_t len, 14993 int type, struct hostent * restrict result_buf, char * restrict 14994 buf, size_t buflen, struct hostent * * restrict result, int * 14995 h_errnop); 14996 14997 Description 14998 14999 Note: The gethostbyaddr_r() function is deprecated; 15000 applications should use getaddrinfo() instead. 15001 15002 gethostbyaddr_r() is a reentrant version of gethostbyaddr() 15003 that searches the network host database for a host address 15004 match. 15005 15006 The gethostbyaddr_r() function shall search the network host 15007 database for an entry of address family type with the host with 15008 address addr. The len argument contains the length of the 15009 address referenced by addr. 15010 15011 If type is AF_INET, the addr argument shall be an in_addr 15012 structure. If type is AF_INET6, the addr argument shall be an 15013 in6_addr structure. If type is any other value, the behavior is 15014 unspecified. 15015 15016 The application must provide a buffer for the gethostbyaddr_r() 15017 to use during the lookup process. The buffer is referenced by 15018 buf, and is of size buflen. If the buffer is not of sufficient 15019 size, gethostbyaddr_r() may fail and return ERANGE. If a 15020 matching entry is found in the database, gethostbyaddr_r() 15021 shall copy the relevant information to the application supplied 15022 hostent structure referenced by result_buf, and return a 15023 pointer to this structure in *result. If no matching entry is 15024 found, *result shall be set to a null pointer. Additional error 15025 information shall be set in the variable referenced by 15026 h_errnop. 15027 15028 Return Value 15029 15030 On success, the gethostbyaddr_r() function shall return zero. 15031 If the return value was ERANGE, the size of the buffer buf, 15032 indicated by buflen, was too small. If the gethostbyaddr_r() 15033 function returns returns any other value, then the variable 15034 referenced by h_errnop shall be set to indicate the cause as 15035 for gethostbyaddr(). 15036 15037 gethostbyname2 15038 15039 Name 15040 15041 gethostbyname2 -- find network host database entry matching 15042 host name (DEPRECATED) 15043 15044 Synopsis 15045 15046 int gethostbyname2(const char * restrict name, int af); 15047 15048 Description 15049 15050 Note: The gethostbyname2() function is deprecated; 15051 applications should use getaddrinfo() instead. 15052 15053 The gethostbyname2() function shall search the network host 15054 database for an entry with name name. This function is similar 15055 to the gethostbyname() function but additionally allows the 15056 search to be restricted to a particular address family 15057 specified by af. 15058 15059 Return Value 15060 15061 On success, the gethostbyname2() function shall return a 15062 pointer to a hostent structure if the requested entry was 15063 found, and a null pointer otherwise. 15064 15065 On unsuccessful completion, gethostbyname2() shall set h_errno 15066 as for gethostbyname() in ISO POSIX (2003). 15067 15068 Errors 15069 15070 The gethostbyname2() shall set h_errno as for gethostbyname() 15071 in ISO POSIX (2003). 15072 15073 gethostbyname2_r 15074 15075 Name 15076 15077 gethostbyname2_r -- find network host database entry matching 15078 host name (DEPRECATED) 15079 15080 Synopsis 15081 15082 int gethostbyname2_r(const char * restrict name, int af, struct 15083 hostent * restrict result_buf, char * restrict buf, size_t 15084 buflen, struct hostent ** restrict result, int * restrict 15085 h_errnop); 15086 15087 Description 15088 15089 Note: The gethostbyname2_r() function is deprecated; 15090 applications should use getaddrinfo() instead. 15091 15092 The gethostbyname2_r() function shall search the network host 15093 database for an entry with name name. gethostbyname2_r() is a 15094 reentrant version of gethostbyname2(). These functions are 15095 similar to the gethostbyname() and gethostbyname_r() functions 15096 but additionally allow the search to be restricted to a 15097 particular address family specified by af. 15098 15099 The application must provide a buffer for the 15100 gethostbyname2_r() function to use during the lookup process. 15101 The buffer is referenced by buf, and is of size buflen. If the 15102 buffer is not of sufficient size, gethostbyname_r() may fail 15103 and return ERANGE. If a matching entry is found in the 15104 database, gethostbyname_r() shall copy the relevant information 15105 to the application-supplied hostent structure referenced by 15106 result_buf, and return a pointer to this structure in *result. 15107 If no matching entry is found, *result shall be set to a null 15108 pointer. Additional error information shall be set in the 15109 variable referenced by h_errnop. 15110 15111 Return Value 15112 15113 On success, the gethostbyname2_r() function shall return zero. 15114 If the return value was ERANGE, the size of the buffer buf, 15115 indicated by buflen, was too small. If the gethostbyname2_r() 15116 function returns returns any other value, then the variable 15117 referenced by h_errnop shall be set to indicate the cause as 15118 for gethostbyname_r(). 15119 15120 gethostbyname_r 15121 15122 Name 15123 15124 gethostbyname_r -- find network host database entry matching 15125 host name (DEPRECATED) 15126 15127 Synopsis 15128 15129 int gethostbyname_r(const char * restrict name, struct hostent 15130 * restrict result_buf, char * restrict buf, size_t buflen, 15131 struct hostent ** restrict result, int * restrict h_errnop); 15132 15133 Description 15134 15135 Note: The gethostbyname_r() function is deprecated; 15136 applications should use getaddrinfo() instead. 15137 15138 gethostbyname_r() is a reentrant version of gethostbyname() 15139 that searches the network host database for a host name match. 15140 15141 The gethostbyname_r() function shall search the network host 15142 database for an entry with name name. 15143 15144 The application must provide a buffer for the gethostbyname_r() 15145 to use during the lookup process. The buffer is referenced by 15146 buf, and is of size buflen. If the buffer is not of sufficient 15147 size, gethostbyname_r() may fail and return ERANGE. If a 15148 matching entry is found in the database, gethostbyname_r() 15149 shall copy the relevant information to the application supplied 15150 hostent structure referenced by result_buf, and return a 15151 pointer to this structure in *result. If no matching entry is 15152 found, *result shall be set to a null pointer. Additional error 15153 information shall be set in the variable referenced by 15154 h_errnop. 15155 15156 Return Value 15157 15158 On success, the gethostbyname_r() function shall return zero. 15159 If the return value was ERANGE, the size of the buffer buf, 15160 indicated by buflen, was too small. If the gethostbyname_r() 15161 function returns returns any other value, then the variable 15162 referenced by h_errnop shall be set to indicate the cause as 15163 for gethostbyname(). 15164 15165 getloadavg 15166 15167 Name 15168 15169 getloadavg -- get system load averages 15170 15171 Synopsis 15172 15173 #include 15174 15175 int getloadavg(double loadavg[], int nelem); 15176 15177 Description 15178 15179 getloadavg() returns the number of processes in the system run 15180 queue averaged over various periods of time. Up to nelem 15181 samples are retrieved and assigned to successive elements of 15182 loadavg[]. The system imposes a maximum of 3 samples, 15183 representing averages over the last 1, 5, and 15 minutes, 15184 respectively. 15185 15186 Return Value 15187 15188 If the load average could not be obtained, -1 is returned. 15189 Otherwise, the number of samples actually retrieved is 15190 returned. 15191 15192 getopt 15193 15194 Name 15195 15196 getopt -- parse command line options 15197 15198 Synopsis 15199 15200 #include 15201 15202 int getopt(int argc, char * const argv[], const char * 15203 optstring); 15204 15205 extern char *optarg; 15206 extern int optind, opterr, optopt; 15207 15208 Description 15209 15210 The getopt() function shall parse command line arguments as 15211 described in ISO POSIX (2003), with the following exceptions, 15212 where LSB and POSIX specifications vary. LSB systems shall 15213 implement the modified behaviors described below. 15214 15215 Argument Ordering 15216 15217 The getopt() function can process command line arguments 15218 referenced by argv in one of three ways: 15219 15220 PERMUTE 15221 15222 the order of arguments in argv is altered so that all options 15223 (and their arguments) are moved in front of all of the 15224 operands. This is the default behavior. 15225 15226 Note: This behavior has undefined results if argv is not 15227 modifiable. This is to support historic behavior predating 15228 the use of const and ISO C (1999). The function prototype 15229 was aligned with ISO POSIX (2003) despite the fact that it 15230 modifies argv, and the library maintainers are unwilling to 15231 change this. 15232 15233 REQUIRE_ORDER 15234 15235 The arguments in argv are processed in exactly the order given, 15236 and option processing stops when the first non-option argument 15237 is reached, or when the element of argv is "--". This ordering 15238 can be enforced either by setting the environment variable 15239 POSIXLY_CORRECT, or by setting the first character of optstring 15240 to '+'. 15241 RETURN_IN_ORDER 15242 15243 The order of arguments is not altered, and all arguments are 15244 processed. Non-option arguments (operands) are handled as if 15245 they were the argument to an option with the value 1 ('\001'). 15246 This ordering is selected by setting the first character of 15247 optstring to '-'; 15248 15249 Option Characteristics 15250 15251 LSB specifies that: 15252 15253 * an element of argv that starts with "-" (and is not exactly 15254 "-" or "--") is an option element. 15255 * characters of an option element, aside from the initial 15256 "-", are option characters. 15257 15258 POSIX specifies that: 15259 15260 * applications using getopt() shall obey the following syntax 15261 guidelines: 15262 + option name is a single alphanumeric character from 15263 the portable character set 15264 + option is preceded by the '-' delimiter character 15265 + options without option-arguments should be accepted 15266 when grouped behind one '-' delimiter 15267 + each option and option-argument is a separate argument 15268 + option-arguments are not optional 15269 + all options should precede operands on the command 15270 line 15271 + the argument "--" is accepted as a delimiter 15272 indicating the end of options and the consideration of 15273 subsequent arguments, if any, as operands 15274 * historical implementations of getopt() support other 15275 characters as options as an allowed extension, but 15276 applications that use extensions are not maximally 15277 portable. 15278 * support for multi-byte option characters is only possible 15279 when such characters can be represented as type int. 15280 * applications that call any utility with a first operand 15281 starting with '-' should usually specify "--" to mark the 15282 end of the options. Standard utilities that do not support 15283 this guideline indicate that fact in the OPTIONS section of 15284 the utility description. 15285 15286 Extensions 15287 15288 LSB specifies that: 15289 15290 * if a character is followed by two colons, the option takes 15291 an optional argument; if there is text in the current argv 15292 element, it is returned in optarg, otherwise optarg is set 15293 to 0. 15294 * if optstring contains W followed by a semi-colon (;), then 15295 -W foo is treated as the long option --foo. 15296 15297 Note: See getopt_long() for a description of long options. 15298 * The first character of optstring shall modify the behavior 15299 of getopt() as follows: 15300 + if the first character is '+', then REQUIRE_ORDER 15301 processing shall be in effect (see above) 15302 + if the first character is '-', then RETURN_IN_ORDER 15303 processing shall be in effect (see above) 15304 + if the first character is ':', then getopt() shall 15305 return ':' instead of '?' to indicate a missing option 15306 argument, and shall not print any diagnostic message 15307 to stderr. 15308 15309 POSIX specifies that: 15310 15311 * the -W option is reserved for implementation extensions. 15312 15313 Return Values 15314 15315 LSB specifies the following additional getopt() return values: 15316 15317 * '\001' is returned if RETURN_IN_ORDER argument ordering is 15318 in effect, and the next argument is an operand, not an 15319 option. The argument is available in optarg. 15320 15321 Any other return value has the same meaning as for POSIX. 15322 15323 POSIX specifies the following getopt() return values: 15324 15325 * the next option character is returned, if found 15326 successfully. 15327 * ':' is returned if a parameter is missing for one of the 15328 options and the first character of optstring is ':'. 15329 * '?' is returned if an unknown option character not in 15330 optstring is encountered, or if getopt() detects a missing 15331 argument and the first character of optstring is not ':'. 15332 * -1 is returned for the end of the option list. 15333 15334 Environment Variables 15335 15336 LSB specifies that: 15337 15338 * if the variable POSIXLY_CORRECT is set, option processing 15339 stops as soon as a non-option argument is encountered. 15340 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 15341 is the process ID for the current process), contains a 15342 space separated list of arguments that should not be 15343 treated as arguments even though they appear to be so. 15344 15345 Rationale: This was used by bash 2.0 to communicate to GNU 15346 libc which arguments resulted from wildcard expansion and so 15347 should not be considered as options. This behavior was 15348 removed in bash version 2.01, but the support remains in GNU 15349 libc. 15350 This behavior is DEPRECATED in this version of the LSB; 15351 future revisions of this specification may not include this 15352 requirement. 15353 15354 getopt_long 15355 15356 Name 15357 15358 getopt_long -- parse command line options 15359 15360 Synopsis 15361 15362 #define _GNU_SOURCE 15363 #include 15364 15365 int getopt_long(int argc, char * const argv[], const char * 15366 opstring, const struct option * longopts, int * longindex); 15367 15368 Description 15369 15370 getopt_long() works like getopt() except that it also accepts 15371 long options, started out by two dashes. Long option names may 15372 be abbreviated if the abbreviation is unique or is an exact 15373 match for some defined option. A long option may take a 15374 parameter, of the form --arg=param or --arg param. 15375 15376 longopts is a pointer to the first element of an array of 15377 struct option declared in getopt.h as: 15378 struct option { 15379 const char *name; 15380 int has_arg; 15381 int *flag; 15382 int val; 15383 }; 15384 15385 The fields in this structure have the following meaning: 15386 15387 name 15388 15389 The name of the long option. 15390 has_arg 15391 15392 One of: 15393 15394 no_argument (or 0) if the option does not take an argument, 15395 required_argument (or 1) if the option requires an argument, or 15396 optional_argument (or 2) if the option takes an optional 15397 argument. 15398 15399 flag 15400 15401 specifies how results are returned for a long option. If flag 15402 is NULL, then getopt_long() shall return val. (For example, the 15403 calling program may set val to the equivalent short option 15404 character.) Otherwise, getopt_long() returns 0, and flag shall 15405 point to a variable which shall be set to val if the option is 15406 found, but left unchanged if the option is not found. 15407 val 15408 15409 The value to return, or to load into the variable pointed to by 15410 flag. 15411 15412 If longindex is not NULL, it points to a variable which is set 15413 to the index of the long option relative to longopts. 15414 15415 Return Value 15416 15417 getopt_long() returns the option character if a short option 15418 was found successfully, or ":" if there was a missing parameter 15419 for one of the options, or "?" for an unknown option character, 15420 or -1 for the end of the option list. 15421 15422 For a long option, getopt_long() returns val if flag is NULL, 15423 and 0 otherwise. Error and -1 returns are the same as for 15424 getopt(), plus "?" for an ambiguous match or an extraneous 15425 parameter. 15426 15427 getopt_long_only 15428 15429 Name 15430 15431 getopt_long_only -- parse command line options 15432 15433 Synopsis 15434 15435 #define _GNU_SOURCE 15436 #include 15437 15438 int getopt_long_only(int argc, char * const argv[], const char 15439 * optstring, const struct option * longopts, int * longindex); 15440 15441 Description 15442 15443 getopt_long_only() is like getopt_long(), but "-" as well as 15444 "--" can indicate a long option. If an option that starts with 15445 "-" (not "--") doesn't match a long option, but does match a 15446 short option, it is parsed as a short option instead. 15447 15448 Note: The getopt_long_only() function is intended only for 15449 supporting certain programs whose command line syntax was 15450 designed before the Utility Syntax Guidelines of ISO POSIX 15451 (2003) were developed. New programs should generally call 15452 getopt_long() instead, which provides the --option syntax 15453 for long options, which is preferred by GNU and consistent 15454 with ISO POSIX (2003). 15455 15456 Return Value 15457 15458 getopt_long_only() returns the option character if the option 15459 was found successfully, or ":" if there was a missing parameter 15460 for one of the options, or "?" for an unknown option character, 15461 or -1 for the end of the option list. 15462 15463 getopt_long_only() also returns the option character when a 15464 short option is recognized. For a long option, they return val 15465 if flag is NULL, and 0 otherwise. Error and -1 returns are the 15466 same as for getopt(), plus "?" for an ambiguous match or an 15467 extraneous parameter. 15468 15469 getpagesize 15470 15471 Name 15472 15473 getpagesize -- get memory page size (DEPRECATED) 15474 15475 Synopsis 15476 15477 #include 15478 15479 int getpagesize (void ); 15480 15481 Description 15482 15483 The function getpagesize() returns the number of bytes in a 15484 meory page. 15485 15486 Note: The getpagesize() function is deprecated. Portable 15487 applications should use sysconf(_SC_PAGE_SIZE) instead. 15488 15489 Return Value 15490 15491 The getpagesize() function returns the current page size. 15492 15493 Errors 15494 15495 No errors are defined. 15496 15497 getprotobyname_r 15498 15499 Name 15500 15501 getprotobyname_r -- retrieve information from the network 15502 protocol database by protocol name, reentrantly 15503 15504 Synopsis 15505 15506 #include 15507 15508 int getprotobyname_r(const char * name, struct protoent * 15509 result_buf, char * buf, size_t buflen, struct protoent * * 15510 result); 15511 15512 Description 15513 15514 The getprotobyname_r() function is a reentrant version of the 15515 getprotobyname() function. 15516 15517 The getprotobyname_r() function shall search the network 15518 protocol database for an entry with the name name. 15519 15520 If a matching entry is found in the database, this function 15521 shall copy the relevant information to the application-supplied 15522 protoent structure referenced by result_buf, and return a 15523 pointer to this structure in *result. If no matching entry is 15524 found, *result shall be set to a null pointer. 15525 15526 The array buf shall contain the string fields referenced by the 15527 protoent structure that was returned. The parameter buflen 15528 shall specify the array's size. 1024 bytes should be enough for 15529 most uses. 15530 15531 Return Value 15532 15533 On success, the getprotobyname_r() function shall return 0. If 15534 the return value was ERANGE, the size of the buffer buf, 15535 indicated by buflen, was too small. 15536 15537 getprotobynumber_r 15538 15539 Name 15540 15541 getprotobynumber_r -- retrieve information from the network 15542 protocol database by protocol number, reentrantly 15543 15544 Synopsis 15545 15546 #include 15547 15548 int getprotobynumber_r(int proto, struct protoent * result_buf, 15549 char * buf, size_t buflen, struct protoent * * result); 15550 15551 Description 15552 15553 The getprotobynumber_r() function is a reentrant version of the 15554 getprotobynumber() function. 15555 15556 The getprotobynumber_r() function shall search the network 15557 protocol database for an entry with protocol number proto. 15558 15559 If a matching entry is found in the database, this function 15560 shall copy the relevant information to the application-supplied 15561 protoent structure referenced by result_buf, and return a 15562 pointer to this structure in *result. If no matching entry is 15563 found, *result shall be set to a null pointer. 15564 15565 The array buf shall contain the string fields referenced by the 15566 protoent structure that was returned. The parameter buflen 15567 shall specify the array's size. 1024 bytes should be enough for 15568 most uses. 15569 15570 Return Value 15571 15572 On success, the getprotobynumber_r() function shall return 0. 15573 If the return value was ERANGE, the size of the buffer buf, 15574 indicated by buflen, was too small. 15575 15576 getprotoent_r 15577 15578 Name 15579 15580 getprotoent_r -- read the next entry of the protocol database, 15581 reentrantly 15582 15583 Synopsis 15584 15585 #include 15586 15587 int getprotoent_r(struct protoent * result_buf, char * buf, 15588 size_t buflen, struct protoent * * result); 15589 15590 Description 15591 15592 The getprotoent_r() function is a reentrant version of the 15593 getprotoent() function. 15594 15595 The getprotoent_r() function shall search the network protocol 15596 database for the next entry. 15597 15598 If the next entry is found in the database, this function shall 15599 copy the relevant information to the application-supplied 15600 protoent structure referenced by result_buf, and return a 15601 pointer to this structure in *result. If no next entry is 15602 found, *result shall be set to a null pointer. 15603 15604 The array buf shall contain the string fields referenced by the 15605 protoent structure that was returned. The parameter buflen 15606 shall specify the array's size. 1024 bytes should be enough for 15607 most uses. 15608 15609 Return Value 15610 15611 On success, the getprotoent_r() function shall return zero. 15612 15613 If the return value was ENOENT, there were no more entries in 15614 the database. 15615 15616 If the return value was ERANGE, the size of the buffer buf, 15617 indicated by buflen, was too small. 15618 15619 getpwent_r 15620 15621 Name 15622 15623 getpwent_r -- reentrantly get entry in passwd file 15624 15625 Synopsis 15626 15627 #include 15628 15629 int getpwent_r(struct passwd * pwbuf, char * buf, size_t 15630 buflen, struct passwd * * pwbufp); 15631 15632 Description 15633 15634 The reentrant interface getpwent_r() shall function in the same 15635 way as the interface getpwent(), except that getpwent_r() shall 15636 return the user name, user password, GECOS field, home 15637 directory, and shell program in buffers provided by the caller, 15638 rather than as a pointer to static storage. 15639 15640 The parameter pwbuf contains the struct passwd that was read 15641 from the stream, if any. 15642 15643 The parameter buf contains additional strings, if any. 15644 15645 The parameter buflen specifies the size of buf. 15646 15647 The parameter *pwbufp returns a pointer to the struct passwd in 15648 *pwbuf. 15649 15650 Return Value 15651 15652 On success, getpwent_r() shall return 0, and *pwbufp shall 15653 contain a pointer to the result. 15654 15655 On failure, *pwbufp shall contain NULL, and getpwent_r() shall 15656 return an error as follows. 15657 15658 Errors 15659 15660 ENOENT 15661 15662 No more password entries. 15663 ERANGE 15664 15665 Not enough buffer space. Specify a larger buffer and try again. 15666 15667 getservbyname_r 15668 15669 Name 15670 15671 getservbyname_r -- retrieve information from the network 15672 services database by service name, reentrantly 15673 15674 Synopsis 15675 15676 #include 15677 15678 int getservbyname_r(const char * name, const char * proto, 15679 struct servent * result_buf, char * buf, size_t buflen, struct 15680 servent * * result); 15681 15682 Description 15683 15684 The getservbyname_r() function is a reentrant version of the 15685 getservbyname() function. 15686 15687 The getservbyname_r() function shall search the network 15688 services database for an entry with the name name. The proto 15689 parameter shall restrict the search to entries with the 15690 specified protocol. If proto is NULL, getservbyname_r() may 15691 return entries with any protocol. 15692 15693 If a matching entry is found in the database, this function 15694 shall copy the relevant information to the application-supplied 15695 servent structure referenced by result_buf, and return a 15696 pointer to this structure in *result. If no matching entry is 15697 found, *result shall be set to a null pointer. 15698 15699 The array buf shall contain the string fields referenced by the 15700 servent structure that was returned. The parameter buflen shall 15701 specify the array's size. 1024 bytes should be enough for most 15702 uses. 15703 15704 Return Value 15705 15706 On success, the getservbyname_r() function shall return zero. 15707 If the return value was ERANGE, the size of the buffer buf, 15708 indicated by buflen, was too small. 15709 15710 getservbyport_r 15711 15712 Name 15713 15714 getservbyport_r -- retrieve information from the network 15715 services database by service port, reentrantly 15716 15717 Synopsis 15718 15719 #include 15720 15721 int getservbyport_r(int port, const char * proto, struct 15722 servent * result_buf, char * buf, size_t buflen, struct servent 15723 * * result); 15724 15725 Description 15726 15727 The getservbyport_r() function is a reentrant version of the 15728 getservbyport() function. 15729 15730 The getservbyport_r() function shall search the network 15731 services database for an entry with the port port. The proto 15732 parameter shall restrict the search to entries with the 15733 specified protocol. If proto is NULL, getservbyport_r() may 15734 return entries with any protocol. 15735 15736 If a matching entry is found in the database, this function 15737 shall copy the relevant information to the application-supplied 15738 servent structure referenced by result_buf, and return a 15739 pointer to this structure in *result. If no matching entry is 15740 found, *result shall be set to a null pointer. 15741 15742 The array buf shall contain the string fields referenced by the 15743 servent structure that was returned. The parameter buflen shall 15744 specify the array's size. 1024 bytes should be enough for most 15745 uses. 15746 15747 Return Value 15748 15749 On success, the getservbyport_r() function shall return zero. 15750 If the return value was ERANGE, the size of the buffer buf, 15751 indicated by buflen, was too small. 15752 15753 getservent_r 15754 15755 Name 15756 15757 getservent_r -- read the next entry of the network services 15758 database, reentrantly 15759 15760 Synopsis 15761 15762 #include 15763 15764 int getservent_r(struct servent * result_buf, char * buf, 15765 size_t buflen, struct servent * * result); 15766 15767 Description 15768 15769 The getservent_r() function is a reentrant version of the 15770 getservent() function. 15771 15772 The getservent_r() function shall search the network services 15773 database for the next entry. 15774 15775 If the next entry is found in the database, this function shall 15776 copy the relevant information to the application-supplied 15777 servent structure referenced by result_buf, and return a 15778 pointer to this structure in *result. If no next entry is 15779 found, *result shall be set to a null pointer. 15780 15781 The array buf shall contain the string fields referenced by the 15782 servent structure that was returned. The parameter buflen shall 15783 specify the array's size. 1024 bytes should be enough for most 15784 uses. 15785 15786 Return Value 15787 15788 On success, the getservent_r() function shall return 0. 15789 15790 If the return value was ENOENT, there were no more entries in 15791 the database. 15792 15793 If the return value was ERANGE, the size of the buffer buf, 15794 indicated by buflen, was too small. 15795 15796 getsockopt 15797 15798 Name 15799 15800 getsockopt -- get socket options 15801 15802 Synopsis 15803 15804 #include 15805 #include 15806 15807 int getsockopt(int socket, int level, int option_name, void * 15808 restrict option_value, socklen_t * restrict option_len); 15809 15810 Description 15811 15812 The getsockopt() function shall behave as specified in ISO 15813 POSIX (2003), with the following extensions. 15814 15815 IP Protocol Level Options 15816 15817 If the level parameter is IPPROTO_IP, the following values 15818 shall be supported for option_name (see RFC 791:Internet 15819 Protocol for further details): 15820 15821 IP_OPTIONS 15822 15823 Get the Internet Protocol options sent with every packet from 15824 this socket. The option_value shall point to a memory buffer in 15825 which the options shall be placed; on entry option_len shall 15826 point to an integer value indicating the maximum size of the 15827 memory buffer, in bytes. On successful return, the value 15828 referenced by option_len shall be updated to the size of data 15829 copied to the buffer. For IPv4, the maximum length of options 15830 is 40 bytes. 15831 IP_TTL 15832 15833 Get the current unicast Internet Protocol Time To Live value 15834 used when sending packets with this socket. The option_value 15835 shall point to a buffer large enough to hold the time to live 15836 value (at least 1 byte), and option_len shall point to an 15837 integer value holding the maximum size of that buffer. On 15838 successful return, the value referenced by option_len shall be 15839 updated to contain the number of bytes copied into the buffer, 15840 which shall be no larger than the initial value, and 15841 option_value shall point to an integer containing the time to 15842 live value. 15843 IP_TOS 15844 15845 Get the Internet Protocol type of service indicator used when 15846 sending packets with this socket. The option_value shall point 15847 to a buffer large enough to hold the type of service indicator 15848 (at least 1 byte), and option_len shall point to an integer 15849 value holding the maximum size of that buffer. On successful 15850 return, the value referenced by option_len shall be updated to 15851 contain the number of bytes copied into the buffer, which shall 15852 be no larger than the initial value, and option_value shall 15853 point to an integer containing the time to live value. 15854 15855 gettext 15856 15857 Name 15858 15859 gettext -- search message catalogs for a string 15860 15861 Synopsis 15862 15863 #include 15864 15865 char * gettext(const char * msgid); 15866 15867 Description 15868 15869 The gettext() function shall search the currently selected 15870 message catalogs for a string identified by the string msgid. 15871 If a string is located, that string shall be returned. 15872 15873 The gettext() function is equivalent to dcgettext(NULL, msgid, 15874 LC_MESSAGES). 15875 15876 Return Value 15877 15878 If a string is found in the currently selected message catalogs 15879 for msgid, then a pointer to that string shall be returned. 15880 Otherwise, a pointer to msgid shall be returned. 15881 15882 Applications shall not modify the string returned by gettext(). 15883 15884 Errors 15885 15886 None. 15887 15888 The gettext() function shall not modify errno. 15889 15890 See Also 15891 15892 dgettext, ngettext, dngettext, dcgettext, dcngettext, 15893 textdomain, bindtextdomain, bind_textdomain_codeset 15894 15895 getutent 15896 15897 Name 15898 15899 getutent -- access user accounting database entries 15900 15901 Synopsis 15902 15903 #include 15904 15905 struct utmp *getutent(void); 15906 15907 Description 15908 15909 The getutent() function shall read the next entry from the user 15910 accounting database. 15911 15912 Return Value 15913 15914 Upon successful completion, getutent() shall return a pointer 15915 to a utmp structure containing a copy of the requested entry in 15916 the user accounting database. Otherwise, a null pointer shall 15917 be returned. The return value may point to a static area which 15918 is overwritten by a subsequent call to getutent(). 15919 15920 Errors 15921 15922 None defined. 15923 15924 getutent_r 15925 15926 Name 15927 15928 getutent_r -- access user accounting database entries 15929 15930 Synopsis 15931 15932 int getutent_r(struct utmp * buffer, struct utmp ** result); 15933 15934 Description 15935 15936 The getutent_r() function is a reentrant version of the 15937 getutent() function. On entry, buffer should point to a user 15938 supplied buffer to which the next entry in the database will be 15939 copied, and result should point to a location where the result 15940 will be stored. 15941 15942 Return Value 15943 15944 On success, getutent_r() shall return 0 and set the location 15945 referenced by result to a pointer to buffer. Otherwise, 15946 getutent_r() shall return -1 and set the location referenced by 15947 result to NULL. 15948 15949 getwc_unlocked 15950 15951 Name 15952 15953 getwc_unlocked -- non-thread-safe getwc 15954 15955 Description 15956 15957 getwc_unlocked() is the same as getwc(), except that it need 15958 not be thread-safe. That is, it may only be invoked in the ways 15959 which are legal for getc_unlocked(). 15960 15961 getwchar_unlocked 15962 15963 Name 15964 15965 getwchar_unlocked -- non-thread-safe getwchar 15966 15967 Description 15968 15969 getwchar_unlocked() is the same as getwchar(), except that it 15970 need not be thread-safe. That is, it may only be invoked in the 15971 ways which are legal for getc_unlocked(). 15972 15973 glob64 15974 15975 Name 15976 15977 glob64 -- find pathnames matching a pattern (Large File 15978 Support) 15979 15980 Synopsis 15981 15982 #include 15983 15984 int glob64(const char * pattern, int flags, int (*errfunc) 15985 (const char *, int), glob64_t * pglob); 15986 15987 Description 15988 15989 glob64() is a large-file version of the glob() function defined 15990 in ISO POSIX (2003). It shall search for pathnames matching 15991 pattern according to the rules used by the shell, /bin/sh. No 15992 tilde expansion or parameter substitution is done; see 15993 wordexp(). 15994 15995 The results of a glob64() call are stored in the structure 15996 pointed to by pglob, which is a glob64_t declared in glob.h 15997 with the following members: 15998 typedef struct 15999 { 16000 size_t gl_pathc; 16001 char **gl_pathv; 16002 size_t gl_offs; 16003 int gl_flags; 16004 void (*gl_closedir) (void *); 16005 struct dirent64 *(*gl_readdir64) (void *); 16006 void *(*gl_opendir) (const char *); 16007 int (*gl_lstat) (const char *, struct stat *); 16008 int (*gl_stat) (const char *, struct stat *); 16009 } 16010 glob64_t; 16011 16012 Structure members with the same name as corresponding members 16013 of a glob_t as defined in ISO POSIX (2003) shall have the same 16014 purpose. 16015 16016 Other members are defined as follows: 16017 16018 gl_flags 16019 16020 reserved for internal use 16021 gl_closedir 16022 16023 pointer to a function capable of closing a directory opened by 16024 gl_opendir 16025 gl_readdir64 16026 16027 pointer to a function capable of reading entries in a large 16028 directory 16029 gl_opendir 16030 16031 pointer to a function capable of opening a large directory 16032 gl_stat 16033 16034 pointer to a function capable of returning file status for a 16035 large file 16036 gl_lstat 16037 16038 pointer to a function capable of returning file status 16039 information for a large file or symbolic link 16040 16041 A large file or large directory is one with a size which cannot 16042 be represented by a variable of type off_t. 16043 16044 Return Value 16045 16046 On success, 0 is returned. Other possible returns are: 16047 16048 GLOB_NOSPACE 16049 16050 out of memory 16051 GLOB_ABORTED 16052 16053 read error 16054 GLOB_NOMATCH 16055 16056 no match found 16057 16058 globfree64 16059 16060 Name 16061 16062 globfree64 -- free memory from glob64() (Large File Support) 16063 16064 Synopsis 16065 16066 #include 16067 16068 void globfree64(glob64_t * pglob); 16069 16070 Description 16071 16072 globfree64() frees the dynamically allocated storage from an 16073 earlier call to glob64(). 16074 16075 globfree64() is a large-file version of the globfree() function 16076 defined in ISO POSIX (2003). 16077 16078 hcreate_r 16079 16080 Name 16081 16082 hcreate_r -- allocate space for a hash search table, 16083 reentrantly 16084 16085 Synopsis 16086 16087 #include 16088 16089 int hcreate_r(size_t nel, struct hsearch_data * htab); 16090 16091 Description 16092 16093 The hcreate_r() function is a reentrant version of the 16094 hcreate() function. 16095 16096 hcreate_r() shall initialize the object referenced by htab with 16097 a hash table containing at least nel elements. Unlike its 16098 non-reentrant equivalent, hcreate(), the hcreate_r() function 16099 may work with more than one hash table. 16100 16101 The memory for the htab object may be dynamically allocated. It 16102 must be initialized with 0 before hcreate_r() is called. 16103 16104 Return Value 16105 16106 On success, hcreate_r() shall return a non-zero value. 16107 16108 On failure, hcreate_r() shall return 0. This usually happens 16109 because not enough memory was available. 16110 16111 hdestroy_r 16112 16113 Name 16114 16115 hdestroy_r -- dispose of a hash search table, reentrantly 16116 16117 Synopsis 16118 16119 #include 16120 16121 void hdestroy_r(struct hsearch_data * htab); 16122 16123 Description 16124 16125 The hdestroy_r() function is a reentrant version of the 16126 hdestroy() function. 16127 16128 hdestroy_r() frees the resources allocated by hcreate_r() for 16129 the object htab. 16130 16131 hsearch_r 16132 16133 Name 16134 16135 hsearch_r -- search a hash table, reentrantly 16136 16137 Synopsis 16138 16139 #include 16140 16141 int hsearch_r(ENTRY item, ACTION action, ENTRY * * retval, 16142 struct hsearch_data * htab); 16143 16144 Description 16145 16146 The hsearch_r() is a reentrant version of the hsearch() 16147 function, but instead of operating on a single global hash 16148 table, hsearch_r() operates on the table described by the 16149 object that htab references. This object can be initialized 16150 with the function hcreate_r(). 16151 16152 Unlike the hsearch() function, hsearch_r() returns a pointer to 16153 the found entry in the variable referred to by retval, rather 16154 than directly. 16155 16156 Return Value 16157 16158 On success, hsearch_r() shall return a non-zero value. 16159 16160 On failure, hsearch_r() shall return 0 and set errno to an 16161 appropriate value. 16162 16163 Errors 16164 16165 ENOMEM 16166 16167 action was set to ENTER, but the table was full. 16168 ESRCH 16169 16170 action was set to FIND, but no matching element was found in 16171 the table. 16172 16173 inet_aton 16174 16175 Name 16176 16177 inet_aton -- Internet address manipulation routine 16178 16179 Synopsis 16180 16181 #include 16182 #include 16183 #include 16184 16185 int anet_iton(const char * cp, struct in_addr * inp); 16186 16187 Description 16188 16189 inet_aton() converts the Internet host address cp from the 16190 standard IPv4 numbers-and-dots notation into binary data and 16191 stores it in the structure that inp points to. 16192 16193 inet_aton() returns a nonzero value if the address is valid, 0 16194 if not. 16195 16196 Note: Note that on some LSB architectures, the host byte 16197 order is Least Significant Byte first, whereas the network 16198 byte order, as used on the Internet, is Most Significant 16199 Byte first. 16200 16201 initgroups 16202 16203 Name 16204 16205 initgroups -- initialize the supplementary group access list 16206 16207 Synopsis 16208 16209 #include 16210 #include 16211 16212 int initgroups(const char * user, gid_t group); 16213 16214 Description 16215 16216 If the process has appropriate privilege, the initgroups() 16217 function shall initialize the Supplementary Group IDs for the 16218 current process by reading the group database and using all 16219 groups of which user is a member. The additional group group is 16220 also added to the list. 16221 16222 Return Value 16223 16224 On success, 0 is returned. On error, -1 is returned and the 16225 global variable errno is set appropriately. 16226 16227 Errors 16228 16229 EPERM 16230 16231 The calling process does not have sufficient privileges. 16232 ENOMEM 16233 16234 Insufficient memory to allocate group information structure. 16235 16236 See Also 16237 16238 setgroups() 16239 16240 initstate_r 16241 16242 Name 16243 16244 initstate_r -- reentrantly initialize a state array for random 16245 number generator functions 16246 16247 Synopsis 16248 16249 #include 16250 16251 int initstate_r(unsigned int seed, char * statebuf, size_t 16252 statelen, struct random_data * buffer); 16253 16254 Description 16255 16256 The interface initstate_r() shall function in the same way as 16257 the interface initstate(), except that initstate_r() shall use 16258 the data in buffer instead of the global random number 16259 generator state. 16260 16261 inotify_add_watch 16262 16263 Name 16264 16265 inotify_add_watch -- add a watch to a watch list 16266 16267 Synopsis 16268 16269 #include 16270 16271 int inotify_add_watch(int fd, const char * path, uint32_t 16272 mask); 16273 16274 Description 16275 16276 inotify_add_watch() shall add a watch to, or modify an existing 16277 watch on, the watch list of the inotify instance specified by 16278 the file descriptor fd, for the file specified by path, to 16279 monitor the events specified by the bitmask mask. The caller 16280 must have read access to the file. 16281 16282 Return Value 16283 16284 On success, inotify_add_watch() shall return the unique, 16285 non-negative watch descriptor associated with the file path and 16286 the inotify instance specified by the file descriptor fd. 16287 16288 If path was already on the watch list, then inotify_add_watch() 16289 shall return the existing watch descriptor. 16290 16291 If path was not already on the watch list, then 16292 inotify_add_watch() shall allocate a new watch descriptor. 16293 16294 inotify_add_watch() shall not work recursively. Monitoring 16295 subdirectories of path shall require adding watches to them. 16296 16297 On failure, inotify_add_watch() shall return -1 and set errno 16298 to an appropriate value. 16299 16300 Errors 16301 16302 EACCESS 16303 16304 The caller does not have read access to path. 16305 EBADF 16306 16307 The file descriptor fd is invalid. 16308 EFAULT 16309 16310 path is outside of the address space accessible by the process. 16311 EINVAL 16312 16313 mask contains no legal events, or fd is not a valid inotify 16314 file descriptor. 16315 ENOMEM 16316 16317 There is not enough kernel memory available. 16318 ENOSPC 16319 16320 The maximum number of watches has been created for this user, 16321 or the kernel cannot allocate a resource. 16322 16323 Application Usage 16324 16325 Reading 16326 16327 The function read() can be used to determine which inotify 16328 events have occurred. A blocking file descriptor will make 16329 read() block until at least one event has occurred. 16330 16331 If successful, read() will return at least one of the following 16332 inotify_event structures in a buffer: 16333 16334 struct inotify_event { 16335 int wd; 16336 uint32_t mask; 16337 uint32_t cookie; 16338 uint32_t len; 16339 char path[]; 16340 }; 16341 16342 wd is a watch descriptor that specifies the watch associated 16343 with the event. It is obtained from a previous invocation of 16344 inotify_add_watch(). 16345 16346 mask is a bit mask describing inotify events. See the section 16347 on masks below. 16348 16349 cookie is an integer associating related inotify events. The 16350 integer value is unique, and currently only enables the 16351 application to associate IN_MOVE_FROM and IN_MOVE_TO rename 16352 events. 16353 16354 len is a count of the bytes in path, including null bytes. This 16355 means that the total length of an inotify_event structure is 16356 16357 sizeof(inotify_event)+len 16358 16359 path is only returned when an event occurs for a file within a 16360 watched directory. This string is null-terminated, and it may 16361 contain more null bytes so that future reads will be aligned 16362 properly on an address boundary. 16363 16364 In kernels before 2.6.21, read() returns 0 when the buffer 16365 given to it is too small to return data about the next event. 16366 In subsequent kernels, it fails with the error EINVAL. 16367 16368 For a given file descriptor, the inotify events are returned in 16369 an ordered queue. Events on a file descriptor will always be 16370 returned in the correct order of occurrence. If two or more 16371 inotify events for a given file descriptor have identical 16372 values for all fields, then only one inotify_event will be 16373 returned to represent all of them. 16374 16375 The number of bytes that can be read from an inotify file 16376 descriptor can be determined by making a FIONREAD ioctl() call. 16377 16378 Masks 16379 16380 The mask argument of inotify_add_watch() and the mask field of 16381 the inotify_event structure are bit masks that specify inotify 16382 events. The bits in the list below can be set in the mask 16383 argument of inotify_add_watch() and returned in the mask field 16384 of inotify_event. 16385 16386 IN_ACCESS 16387 16388 File was read. 16389 IN_ALL_EVENTS 16390 16391 Bit mask of all events in this list. 16392 IN_ATTRIB 16393 16394 File's metadata changed (including timestamps and permissions). 16395 IN_CLOSE 16396 16397 Same as 16398 16399 IN_CLOSE_WRITE | IN_CLOSE_NOWRITE 16400 16401 IN_CLOSE_WRITE 16402 16403 File that was opened for writing was closed. 16404 IN_CLOSE_NOWRITE 16405 16406 File that was not opened for writing was closed. 16407 IN_CREATE 16408 16409 File or directory was created in a watched directory. 16410 IN_DELETE 16411 16412 File or directory was deleted in a watched directory. 16413 IN_DELETE_SELF 16414 16415 Watched file or directory was deleted. 16416 IN_MODIFY 16417 16418 File was changed. 16419 IN_MOVE 16420 16421 Same as 16422 16423 IN_MOVED_FROM | IN_MOVED_TO 16424 16425 IN_MOVE_SELF 16426 16427 Watched file or directory was moved 16428 IN_MOVED_FROM 16429 16430 File was moved out of watched directory. 16431 IN_MOVED_TO 16432 16433 File was moved into watched directory. 16434 IN_OPEN 16435 16436 File was opened. 16437 16438 All of the events above, except for IN_DELETE_SELF and 16439 IN_MOVE_SELF, cause the name field of the inotify_event 16440 structure to contain the name of the file or directory being 16441 monitored. 16442 16443 The following bit is valid for inotify_add_watch() only. 16444 16445 IN_ONESHOT 16446 16447 Monitor path for an event, and then remove it from the watch 16448 list. 16449 16450 The following bits are valid for the inotify_event structure 16451 only. 16452 16453 IN_IGNORED 16454 16455 Watch was removed, either explicitly (via inotify_rm_watch()) 16456 or implicitly (file deletion or file system unmounting). 16457 IN_ISDIR 16458 16459 Object being watched is a directory. 16460 IN_Q_OVERFLOW 16461 16462 The event queue overflowed (wd is set to -1). 16463 IN_UNMOUNT 16464 16465 File system of object being watched was unmounted. 16466 16467 Notes 16468 16469 It is possible to monitor file descriptors with the functions 16470 epoll(), poll(), and select(). 16471 16472 When all of the file descriptors that point to an inotify 16473 instance have been closed, the instance and its associated 16474 resources and watches are freed by the kernel. 16475 16476 See Also 16477 16478 inotify_init(), inotify_rm_watch() 16479 16480 inotify_init 16481 16482 Name 16483 16484 inotify_init -- instantiate inotify 16485 16486 Synopsis 16487 16488 #include 16489 16490 int inotify_init(void); 16491 16492 Description 16493 16494 inotify_init() shall create one instance of inotify. 16495 16496 Return Value 16497 16498 On success, inotify_init() shall return a file descriptor 16499 pointing to the new inotify instance. 16500 16501 On failure, inotify_init() shall return -1 and set errno to an 16502 appropriate value. 16503 16504 Errors 16505 16506 EMFILE 16507 16508 The maximum number of inotify instances has been created for 16509 this user. 16510 ENFILE 16511 16512 The maximum number of file descriptors has been created on the 16513 system. 16514 ENOMEM 16515 16516 There is not enough kernel memory available. 16517 16518 See Also 16519 16520 inotify_add_watch(), inotify_rm_watch() 16521 16522 inotify_rm_watch 16523 16524 Name 16525 16526 inotify_rm_watch -- remove a watch from an inotify watch list 16527 16528 Synopsis 16529 16530 #include 16531 16532 int inotify_rm_watch(int fd, uint32_t wd); 16533 16534 Description 16535 16536 inotify_rm_watch() shall remove the watch associated with the 16537 watch descriptor wd from the watch list of the inotify instance 16538 associated with the file descriptor fd. 16539 16540 If a watch is removed, its watch descriptor shall generate the 16541 IN_IGNORED event. 16542 16543 Return Value 16544 16545 On success, inotify_rm_watch() shall return 0. 16546 16547 On failure, inotify_rm_watch() shall return -1 and set errno to 16548 an appropriate value. 16549 16550 Errors 16551 16552 EBADF 16553 16554 The file descriptor fd is invalid. 16555 EINVAL 16556 16557 wd is invalid, or fd is not a valid inotify file descriptor. 16558 16559 See Also 16560 16561 inotify_add_watch(), inotify_init() 16562 16563 ioctl 16564 16565 Name 16566 16567 ioctl -- control device 16568 16569 Synopsis 16570 16571 #include 16572 16573 int ioctl (int fildes , int request , ...); 16574 16575 Description 16576 16577 The ioctl() function shall manipulate the underlying device 16578 parameters of special files. fildes shall be an open file 16579 descriptor referring to a special file. The ioctl() function 16580 shall take three parameters; the type and value of the third 16581 parameter is dependent on the device and request. 16582 16583 Conforming LSB applications shall not call ioctl() except in 16584 situations explicitly stated in this specification. 16585 16586 Return Value 16587 16588 On success, 0 is returned. An ioctl() may use the return value 16589 as an output parameter and return a non-negative value on 16590 success. On error, -1 is returned and the global variable errno 16591 is set appropriately. 16592 16593 Errors 16594 16595 EBADF 16596 16597 fildes is not a valid descriptor. 16598 EFAULT 16599 16600 The third parameter references an inaccessible memory area. 16601 ENOTTY 16602 16603 fildes is not associated with a character special device. 16604 ENOTTY 16605 16606 The specified request does not apply to the kind of object that 16607 fildes references. 16608 EINVAL 16609 16610 request or the third parameter is not valid. 16611 16612 Relationship to POSIX (Informative) 16613 16614 It should be noted that ISO POSIX (2003) contains an interface 16615 named ioctl(). The LSB only defines behavior when fildes refers 16616 to a socket (see sockio) or terminal device (see ttyio), while 16617 ISO POSIX (2003) only defines behavior when fildes refers to a 16618 STREAMS device. An implementation may support both behaviors; 16619 the LSB does not require any STREAMS support. 16620 16621 sockio 16622 16623 Name 16624 16625 sockio -- socket ioctl commands 16626 16627 Synopsis 16628 16629 #include 16630 #include 16631 #include 16632 #include 16633 16634 int ioctl(int sockfd, int request, void * argp); 16635 16636 Description 16637 16638 Socket ioctl() commands are a subset of the ioctl() calls, 16639 which can perform a variety of functions on sockets. sockfd 16640 shall be an open file descriptor referring to a socket (see the 16641 socket() or accept() functions). 16642 16643 Socket ioctl() commands apply to the underlying network 16644 interfaces, and affect the entire system, not just the file 16645 descriptor used to issue the ioctl(). 16646 16647 The following values for request are accepted: 16648 16649 SIOCGIFCONF (Deprecated) 16650 Get the interface configuration list for the system. 16651 16652 Note: The SIOCGIFCONF interface is superceded by the 16653 if_nameindex() family of functions (see ISO POSIX (2003)). A 16654 future version of this specification may withdraw this value 16655 for request. 16656 16657 argp shall point to a ifconf structure, as described in 16658 . Before calling, the caller shall set the 16659 ifc_ifcu.ifcu_req field to point to an array of ifreq 16660 structures, and set ifc_len to the size in bytes of this 16661 allocated array. Upon return, ifc_len will contain the 16662 size in bytes of the array which was actually used. If 16663 it is the same as the length upon calling, the caller 16664 should assume that the array was too small and try again 16665 with a larger array. 16666 16667 On success, SIOCGIFCONF shall return a nonnegative 16668 value. 16669 16670 Rationale: Historical UNIX systems disagree on the meaning 16671 of the return value. 16672 16673 SIOCGIFFLAGS 16674 Get the interface flags for the indicated interface. 16675 argp shall point to a ifreq structure. Before calling, 16676 the caller should fill in the ifr_name field with the 16677 interface name, and upon return, the ifr_ifru.ifru_flags 16678 field is set with the interface flags. 16679 16680 SIOCGIFADDR 16681 Get the interface address for the given interface. argp 16682 shall point to a ifreq structure. Before calling, the 16683 caller should fill in the ifr_name field with the 16684 interface name, and upon return, the ifr_ifru.ifru_addr 16685 field is set with the interface address. 16686 16687 SIOCGIFBRDADDR 16688 Get the interface broadcast address for the given 16689 interface. argp shall point to a ifreq structure. Before 16690 calling, the caller should fill in the ifr_name field 16691 with the interface name, and upon return, the 16692 ifr_ifru.ifru_broadcast field is set with the interface 16693 broadcast address. 16694 16695 SIOCGIFDSTADDR 16696 Get the point-to-point address for the given interface. 16697 argp shall point to a ifreq structure. Before calling, 16698 the caller should fill in the ifr_name field with the 16699 interface name, and upon return, the ifr_dstaddr field 16700 is set with the point-to-point address. 16701 16702 SIOCGIFNAME 16703 Get the name of an interface. argp shall point to a 16704 ifreq structure. Before calling, the caller should fill 16705 in the ifr_ifindex field with the number (index) of the 16706 interface, and upon return, the ifr_name field is set 16707 with the interface name. 16708 16709 SIOCGIFNETMASK 16710 Get the network mask for the given interface. argp shall 16711 point to a ifreq structure. Before calling, the caller 16712 should fill in the ifr_name field with the interface 16713 name, and upon return, the ifr_ifru.ifru_netmask field 16714 is set with the network mask. 16715 16716 SIOCGIFMTU 16717 Get the Maximum Transmission Unit (MTU) size for the 16718 given interface. argp shall point to a ifreq structure. 16719 Before calling, the caller should fill in the ifr_name 16720 field with the interface name, and upon return, the 16721 ifr_ifru.ifru_mtu field is set with the MTU. Note: The 16722 range of valid values for MTU varies for an interface 16723 depending on the interface type. 16724 16725 FIONREAD 16726 Get the amount of queued unread data in the receive 16727 buffer. argp shall point to an integer where the result 16728 is to be placed. 16729 16730 Note: Some implementations may also support the use of 16731 FIONREAD on other types of file descriptor. However, the LSB 16732 only specifies its behavior for a socket related file 16733 descriptor. 16734 16735 Return Value 16736 16737 On success, if request is SIOCGIFCONF, a non-negative integer 16738 shall be returned. If request is not SIOCGIFCONF, on success 0 16739 is returned. On error, -1 is returned and the global variable 16740 errno is set appropriately. 16741 16742 Errors 16743 16744 EBADF 16745 16746 sockfd is not a valid descriptor. 16747 EFAULT 16748 16749 argp references an inaccessible memory area. 16750 ENOTTY 16751 16752 The specified request does not apply to the kind of object that 16753 the descriptor sockfd references. 16754 EINVAL 16755 16756 Either request or argp is invalid. 16757 ENOTCONN 16758 16759 The operation is only defined on a connected socket, but the 16760 socket wasn't connected. 16761 16762 ttyio 16763 16764 Name 16765 16766 ttyio -- tty ioctl commands 16767 16768 Synopsis 16769 16770 #include 16771 #include 16772 16773 int ioctl(int fd, unsigned long request, int * argp); 16774 16775 Description 16776 16777 Tty ioctl commands are a subset of the ioctl() calls, which can 16778 perform a variety of functions on tty devices. fd shall be an 16779 open file descriptor referring to a terminal device. 16780 16781 The following ioctl()s are provided: 16782 16783 TIOCGWINSZ 16784 16785 Get the size attributes of the terminal or pseudo-terminal 16786 identified by fd. On entry, argp shall reference a winsize 16787 structure. On return, the structure will have ws_row set to the 16788 number of rows of text (i.e. lines of text) that can be viewed 16789 on the device, and ws_col set to the number of columns (i.e. 16790 text width). 16791 16792 Note: The number of columns stored in ws_col assumes that 16793 the terminal device is using a mono-spaced font. 16794 16795 Return Value 16796 16797 On success, 0 is returned. On error, -1 is returned and the 16798 global variable errno is set appropriately. 16799 16800 Errors 16801 16802 EBADF 16803 16804 fd is not a valid descriptor. 16805 EFAULT 16806 16807 argp references an inaccessible memory area. 16808 EINVAL 16809 16810 request and argp are not valid. 16811 16812 jrand48_r 16813 16814 Name 16815 16816 jrand48_r -- reentrantly generate pseudorandom numbers in a 16817 uniform distribution 16818 16819 Synopsis 16820 16821 #include 16822 16823 int jrand48_r(unsigned short[3] xsubi, struct drand48_data * 16824 buffer, long int * result); 16825 16826 Description 16827 16828 The interface jrand48_r() shall function in the same way as the 16829 interface jrand48(), except that jrand48_r() shall use the data 16830 in buffer instead of the global random number generator state. 16831 16832 Before it is used, buffer must be initialized, for example, by 16833 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 16834 it with zeroes. 16835 16836 kill 16837 16838 Name 16839 16840 kill -- send a signal 16841 16842 Synopsis 16843 16844 #include 16845 16846 int kill(pid_t pid, int sig); 16847 16848 Description 16849 16850 kill() is as specified in the ISO POSIX (2003), but with 16851 differences as listed below. 16852 16853 Process ID -1 doesn't affect calling process 16854 16855 If pid is specified as -1, sig shall not be sent to the calling 16856 process. Other than this, the rules in the ISO POSIX (2003) 16857 apply. 16858 16859 Rationale: This was a deliberate Linus decision after an 16860 unpopular experiment in including the calling process in the 16861 2.5.1 kernel. See "What does it mean to signal everybody?", 16862 Linux Weekly News, 20 December 2001, 16863 http://lwn.net/2001/1220/kernel.php3 16864 16865 lcong48_r 16866 16867 Name 16868 16869 lcong48_r -- reentrantly generate pseudorandom numbers in a 16870 uniform distribution 16871 16872 Synopsis 16873 16874 #include 16875 16876 int lcong48_r(unsigned short[7] param, struct drand48_data * 16877 buffer); 16878 16879 Description 16880 16881 The interface lcong48_r() shall function in the same way as the 16882 interface lcong48(), except that lcong48_r() shall use the data 16883 in buffer instead of the global random number generator state. 16884 16885 link 16886 16887 Name 16888 16889 link -- create a link to a file 16890 16891 Synopsis 16892 16893 #include 16894 16895 int link(const char * path1, const char * path2); 16896 16897 Description 16898 16899 The link() function shall behave as specified in ISO POSIX 16900 (2003), except with differences as listed below. 16901 16902 Need Not Follow Symlinks 16903 16904 ISO POSIX (2003) specifies that pathname resolution shall 16905 follow symbolic links during pathname resolution unless the 16906 function is required to act on the symbolic link itself, or 16907 certain arguments direct that the function act on the symbolic 16908 link itself. The link() function in ISO POSIX (2003) contains 16909 no such requirement to operate on a symbolic link. However, a 16910 conforming LSB implementation need not follow a symbolic link 16911 for the path1 argument. 16912 16913 lrand48_r 16914 16915 Name 16916 16917 lrand48_r -- reentrantly generate pseudorandom numbers in a 16918 uniform distribution 16919 16920 Synopsis 16921 16922 #include 16923 16924 int lrand48_r(struct drand48_data * buffer, long int * result); 16925 16926 Description 16927 16928 The interface lrand48_r() shall function in the same way as the 16929 interface lrand48(), except that lrand48_r() shall use the data 16930 in buffer instead of the global random number generator state. 16931 16932 Before it is used, buffer must be initialized, for example, by 16933 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 16934 it with zeroes. 16935 16936 mbsnrtowcs 16937 16938 Name 16939 16940 mbsnrtowcs -- convert a multibyte string to a wide character 16941 string 16942 16943 Synopsis 16944 16945 #include 16946 16947 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 16948 nms, size_t len, mbstate_t * ps); 16949 16950 Description 16951 16952 mbsnrtowcs() is like mbsrtowcs(), except that the number of 16953 bytes to be converted, starting at src, is limited to nms. 16954 16955 If dest is not a NULL pointer, mbsnrtowcs() converts at most 16956 nms bytes from the multibyte string src to a wide-character 16957 string starting at dest. At most, len wide characters are 16958 written to dest. The shift state ps is updated. 16959 16960 The conversion is effectively performed by repeatedly calling: 16961 16962 mbrtowc(dest, *src, n, ps) 16963 16964 where n is some positive number, as long as this call succeeds, 16965 and then incrementing dest by one and src by the number of 16966 bytes consumed. 16967 16968 The conversion can stop for three reasons: 16969 16970 * An invalid multibyte sequence has been encountered. In this 16971 case src is left pointing to the invalid multibyte 16972 sequence, (size_t)(-1) is returned, and errno is set to 16973 EILSEQ. 16974 * The nms limit forces a stop, or len non-L'\0' wide 16975 characters have been stored at dest. In this case, src is 16976 left pointing to the next multibyte sequence to be 16977 converted, and the number of wide characters written to 16978 dest is returned. 16979 * The multibyte string has been completely converted, 16980 including the terminating '\0' (which has the side effect 16981 of bringing back ps to the initial state). In this case, 16982 src is set to NULL, and the number of wide characters 16983 written to dest, excluding the terminating L'\0' character, 16984 is returned. 16985 16986 If dest is NULL, len is ignored, and the conversion proceeds as 16987 above, except that the converted wide characters are not 16988 written out to memory, and that no destination length limit 16989 exists. 16990 16991 In both of the above cases, if ps is a NULL pointer, a static 16992 anonymous state only known to mbsnrtowcs() is used instead. 16993 16994 The programmer shall ensure that there is room for at least len 16995 wide characters at dest. 16996 16997 Return Value 16998 16999 mbsnrtowcs() returns the number of wide characters that make up 17000 the converted part of the wide character string, not including 17001 the terminating null wide character. If an invalid multibyte 17002 sequence was encountered, (size_t)(-1) is returned, and the 17003 global variable errno is set to EILSEQ. 17004 17005 Notes 17006 17007 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 17008 of the current locale. 17009 17010 Passing NULL as ps is not multi-thread safe. 17011 17012 memmem 17013 17014 Name 17015 17016 memmem -- locate bytes 17017 17018 Synopsis 17019 17020 #define _GNU_SOURCE 17021 #include 17022 17023 void * memmem(const void * haystack, size_t haystacklen, const 17024 void * needle, size_t needlelen); 17025 17026 Description 17027 17028 memmem() finds the start of the first occurrence of the byte 17029 array referenced by needle of length needlelen in the memory 17030 area haystack of length haystacklen. 17031 17032 Return Value 17033 17034 If needle is found, memmem() returns a pointer to it. If 17035 needlelen is 0, memmem returns haystack. If needle is not found 17036 in haystack, memmem() returns NULL. 17037 17038 Notes 17039 17040 Earlier versions of the C library (prior to glibc 2.1) 17041 contained a memmem() with various problems, and application 17042 developers should treat this function with care. 17043 17044 memrchr 17045 17046 Name 17047 17048 memrchr -- scan memory for a character 17049 17050 Synopsis 17051 17052 #include 17053 17054 void * memrchr(const void * s, int c, size_t n); 17055 17056 Description 17057 17058 The memrchr() function shall locate the last occurence of c 17059 (converted to an unsigned char) in the initial n bytes (each 17060 interpreted as an unsigned char) of the object pointed to by s. 17061 17062 Return Value 17063 17064 The memrchr() shall return a pointer to the located byte, or a 17065 null pointer if the byte does not occur in the object. 17066 17067 Errors 17068 17069 No errors are defined. 17070 17071 See Also 17072 17073 memchr() 17074 17075 mkstemp64 17076 17077 Name 17078 17079 mkstemp64 -- create a unique temporary file (Large File 17080 Support) 17081 17082 Synopsis 17083 17084 #include 17085 #include 17086 17087 int mkstemp64(char * template); 17088 17089 Description 17090 17091 mkstemp64() shall generates a unique temporary file name from 17092 template. The last six characters of template shall be XXXXXX 17093 and these are replaced with a string that makes the file name 17094 unique; the file is then created and an open file descriptor 17095 returned as described for mkstemp(). 17096 17097 mkstemp64() is a large-file version of the mkstemp() function 17098 as defined in ISO POSIX (2003). The only difference is that the 17099 temporary file is opened with open64() instead of with open(). 17100 17101 Return Value 17102 17103 On success, mkstemp64() returns the file descriptor of the 17104 temporary file. Otherwise mkstemp64() shall return -1 and set 17105 errno to indicate the error. 17106 17107 Errors 17108 17109 See mkstemp() for possible error values. 17110 17111 mrand48_r 17112 17113 Name 17114 17115 mrand48_r -- reentrantly generate pseudorandom numbers in a 17116 uniform distribution 17117 17118 Synopsis 17119 17120 #include 17121 17122 int mrand48_r(struct drand48_data * buffer, long int * result); 17123 17124 Description 17125 17126 The interface mrand48_r() shall function in the same way as the 17127 interface mrand48(), except that mrand48_r() shall use the data 17128 in buffer instead of the global random number generator state. 17129 17130 Before it is used, buffer must be initialized, for example, by 17131 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 17132 it with zeroes. 17133 17134 mremap 17135 17136 Name 17137 17138 mremap -- remap a virtual memory address 17139 17140 Synopsis 17141 17142 #include 17143 17144 void * mremap(void * old_address, size_t old_size, size_t 17145 new_size, int flags); 17146 17147 Description 17148 17149 The mremap() function expands (or shrinks) an existing memory 17150 mapping, potentially moving it at the same time, depending on 17151 the flags argument and the available virtual address space. 17152 17153 old_address is the old address of the virtual memory block to 17154 be resized. Note that old_address must be page aligned. 17155 old_size is the old size of the virtual memory block. new_size 17156 is the requested size of the virtual memory block after the 17157 resize. 17158 17159 In Linux the memory is divided into pages. A user process has 17160 (one or) several linear virtual memory segments. Each virtual 17161 memory segment has one or more mappings to real memory pages 17162 (in the page table). Each virtual memory segment has its own 17163 protection (access rights), which may cause a segmentation 17164 violation if the memory is accessed incorrectly (e.g., writing 17165 to a read-only segment). Accessing virtual memory outside of 17166 the segments will also cause a segmentation violation. 17167 17168 mremap() uses the Linux page table scheme. mremap() changes the 17169 mapping between virtual addresses and memory pages. This can be 17170 used to implement a very efficient form of realloc(). 17171 17172 The flags bit-mask argument may be 0, or include the following 17173 flag: 17174 17175 MREMAP_MAYMOVE 17176 17177 By default, if there is not sufficient space to expand a 17178 mapping at its current location, then mremap() fails. If this 17179 flag is specified, then the kernel is permitted to relocate the 17180 mapping to a new virtual address, if necessary. If the mapping 17181 is relocated, then absolute pointers into the old mapping 17182 location become invalid (offsets relative to the starting 17183 address of the mapping should be employed). 17184 MREMAP_FIXED 17185 17186 This flag serves a similar purpose to the MAP_FIXED flag of 17187 mmap(). If this flag is specified, then mremap()accepts a fifth 17188 argument, void *new_address, which specifies a pagealigned 17189 address to which the mapping must be moved. Any previous 17190 mapping at the address range specified by new_address and 17191 new_size is unmapped. If MREMAP_FIXED is specified, then 17192 MREMAP_MAYMOVE must also be specified. 17193 17194 If the memory segment specified by old_address and old_size is 17195 locked (using mlock() or similar), then this lock is maintained 17196 when the segment is resized and/or relocated. As a consequence, 17197 the amount of memory locked by the process may change. 17198 17199 Return Value 17200 17201 The mremap() function returns a pointer to the new virtual 17202 memory area on success. On error, the value MAP_FAILED is 17203 returned, and errno is set appropriately. 17204 17205 Errors 17206 17207 EAGAIN 17208 17209 The caller tried to expand a memory segment that is locked, but 17210 this was not possible without exceeding the RLIMIT_MEMLOCK 17211 resource limit. 17212 EFAULT 17213 17214 "Segmentation fault." Some address in the range old_address to 17215 old_address+old_size is an invalid virtual memory address for 17216 this process. You can also get EFAULT even if there exist 17217 mappings that cover the whole address space requested, but 17218 those mappings are of different types. 17219 EINVAL 17220 17221 An invalid argument was given. Possible causes are: old_address 17222 was not page aligned; a value other than MREMAP_MAYMOVE or 17223 MREMAP_FIXED was specified in flags; new_size was zero; 17224 new_size or new_address was invalid; or the new address range 17225 specified by new_address and new_size overlapped the old 17226 address range specified by old_address and old_size; or 17227 MREMAP_FIXED was specified without also specifying 17228 MREMAP_MAYMOVE. 17229 ENOMEM 17230 17231 The memory area cannot be expanded at the current virtual 17232 address, and the MREMAP_MAYMOVE flag is not set in flags, or, 17233 there is not enough (virtual) memory available. 17234 17235 newlocale 17236 17237 Name 17238 17239 newlocale -- allocate a locale object 17240 17241 Synopsis 17242 17243 #include 17244 17245 locale_t newlocale(int category_mask, const char * locale, 17246 locale_t base); 17247 17248 Description 17249 17250 The newlocale() function shall initialize a locale object. If 17251 base is NULL, then newlocale() shall first allocate the object; 17252 otherwise it shall use the locale object referenced by base. 17253 17254 The object shall be initialized for the locale named by locale, 17255 and for the categories selected in category_mask. The 17256 category_mask value is a bitwise inclusive OR of the required 17257 LC_name_MASK values, or the value LC_ALL_MASK. 17258 17259 Return Value 17260 17261 On success, the newlocale() function shall return the 17262 initialized locale object. Otherwise, it shall return NULL, and 17263 set errno to indicate the error. 17264 17265 Errors 17266 17267 The newlocale() function shall fail if: 17268 17269 ENOMEM 17270 17271 Insufficient memory. 17272 EINVAL 17273 17274 An invalid category_mask was provided, or the locale was NULL. 17275 ENOENT 17276 17277 For any of the categories in category_mask, the locale data is 17278 not available. 17279 17280 Application Usage (Informative) 17281 17282 The only portable way to allocate a locale object is to call 17283 newlocale() with a NULL base. The allocated object may be 17284 reinitialized to a new locale by passing it back to 17285 newlocale(). The new object may be released by calling 17286 freelocale(). 17287 17288 See Also 17289 17290 setlocale(), freelocale(), duplocale(), uselocale() 17291 17292 ngettext 17293 17294 Name 17295 17296 ngettext -- search message catalogs for plural string 17297 17298 Synopsis 17299 17300 #include 17301 17302 char * ngettext(const char * msgid1, const char * msgid2, 17303 unsigned long int n); 17304 17305 Description 17306 17307 The ngettext() function shall search the currently selected 17308 message catalogs for a string matching the singular string 17309 msgid1. If a string is located, and if n is 1, that string 17310 shall be returned. If n is not 1, a pluralized version 17311 (dependent on n) of the string shall be returned. 17312 17313 The ngettext() function is equivalent to dcngettext(NULL, 17314 msgid1, msgid2, n, LC_MESSAGES)(). 17315 17316 Return Value 17317 17318 If a string is found in the currently selected message catalogs 17319 for msgid1, then if n is 1 a pointer to the located string 17320 shall be returned. If n is not 1, a pointer to an appropriately 17321 pluralized version of the string shall be returned. If no 17322 message could be found in the currently selected mesage 17323 catalogs, then if n is 1, a pointer to msgid1 shall be 17324 returned, otherwise a pointer to msgid2 shall be returned. 17325 17326 Applications shall not modify the string returned by 17327 ngettext(). 17328 17329 Errors 17330 17331 None. 17332 17333 The ngettext() function shall not modify errno. 17334 17335 See Also 17336 17337 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 17338 textdomain, bindtextdomain, bind_textdomain_codeset 17339 17340 nrand48_r 17341 17342 Name 17343 17344 nrand48_r -- reentrantly generate pseudorandom numbers in a 17345 uniform distribution 17346 17347 Synopsis 17348 17349 #include 17350 17351 int nrand48_r(unsigned short[3] xsubi, struct drand48_data * 17352 buffer, long int * result); 17353 17354 Description 17355 17356 The interface nrand48_r() shall function in the same way as the 17357 interface nrand48(), except that nrand48_r() shall use the data 17358 in buffer instead of the global random number generator state. 17359 17360 Before it is used, buffer must be initialized, for example, by 17361 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 17362 it with zeroes. 17363 17364 openat64 17365 17366 Name 17367 17368 openat64 -- open a file relative to a directory file descriptor 17369 (Large File Support) 17370 17371 Synopsis 17372 17373 #include 17374 17375 int openat64(int fd, const char * path, int oflag, ...); 17376 17377 Description 17378 17379 openat64() shall establish a connection between a file and a 17380 file descriptor. It shall be identical open64() except in the 17381 case where path specifies a relative path. In this case, the 17382 file to be opened shall be determined relative to the directory 17383 associated with the file descriptor fd instead of the current 17384 working directory. 17385 17386 openat64() is a large-file version of the openat() function as 17387 defined in POSIX 1003.1 2008. It differs from openat() in the 17388 same way that open64() differs from open(), that the open is 17389 done in large-file mode. 17390 17391 Return Value 17392 17393 On success, openat64() returns a new file descriptor. Otherwise 17394 openat64() shall return -1 and set errno to indicate the error. 17395 17396 Errors 17397 17398 See openat() for possible error values. 17399 17400 pmap_getport 17401 17402 Name 17403 17404 pmap_getport -- find the port number assigned to a service 17405 registered with a portmapper. 17406 17407 Synopsis 17408 17409 #include 17410 17411 u_short * pmap_getport(struct sockaddr_in * address, const 17412 u_long program, const u_long * version, u_int protocol); 17413 17414 Description 17415 17416 The pmap_getport() function shall return the port number 17417 assigned to a service registered with a RPC Binding service 17418 running on a given target system, using the protocol described 17419 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 17420 pmap_getport() function shall be called given the RPC program 17421 number program, the program version version, and transport 17422 protocol protocol. Conforming implementations shall support 17423 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 17424 shall specify the address of the system on which the portmapper 17425 to be contacted resides. The value of address->sin_port shall 17426 be ignored, and the standard value for the portmapper port 17427 shall always be used. 17428 17429 Note: Security and network restrictions may prevent a 17430 conforming application from contacting a remote RPC Binding 17431 Service. 17432 17433 Return Value 17434 17435 On success, the pmap_getport() function shall return the port 17436 number in host byte order of the RPC application registered 17437 with the remote portmapper. On failure, if either the program 17438 was not registered or the remote portmapper service could not 17439 be reached, the pmap_getport() function shall return 0. If the 17440 remote portmap service could not be reached, the status is left 17441 in the global variable rpc_createerr. 17442 17443 pmap_set 17444 17445 Name 17446 17447 pmap_set -- establishes mapping to machine's RPC Bind service. 17448 17449 Synopsis 17450 17451 #include 17452 17453 bool_t pmap_set(const u_long program, const u_long version, int 17454 protocol, u_short port); 17455 17456 Description 17457 17458 pmap_set() establishes a mapping between the triple 17459 [program,version,protocol] and port on the machine's RPC Bind 17460 service. The value of protocol is most likely IPPROTO_UDP or 17461 IPPROTO_TCP. Automatically done by svc_register(). 17462 17463 Return Value 17464 17465 pmap_set() returns non-zero if it suceeds, 0 otherwise. 17466 17467 pmap_unset 17468 17469 Name 17470 17471 pmap_unset -- destroys RPC Binding 17472 17473 Synopsis 17474 17475 #include 17476 17477 bool_t pmap_unset(u_long prognum, u_long versnum); 17478 17479 Description 17480 17481 As a user interface to the RPC Bind service, pmap_unset() 17482 destroys all mapping between the triple [prognum,versnum, *] 17483 and ports on the machine's RPC Bind service. 17484 17485 Return Value 17486 17487 pmap_unset() returns non-zero if it succeeds, zero otherwise. 17488 17489 posix_fadvise64 17490 17491 Name 17492 17493 posix_fadvise64 -- File advisory information (Large File 17494 Support) 17495 17496 Synopsis 17497 17498 #include 17499 17500 int posix_fadvise64(int fd, off64_t offset, off64_t len, int 17501 advice); 17502 17503 Description 17504 17505 The posix_fadvise64() function is a large-file version of the 17506 posix_fadvise() function defined in ISO POSIX (2003). It shall 17507 advise the implementation on the expected behavior of the 17508 application with respect to the data in the file associated 17509 with the open file descriptor, fd, starting at offset and 17510 continuing for len bytes. The specified range need not 17511 currently exist in the file. If len is zero, all data following 17512 offset is specified. The implementation may use this 17513 information to optimize handling of the specified data. The 17514 posix_fadvise() function shall have no effect on the semantics 17515 of other operations on the specified data, although it may 17516 affect the performance of other operations. 17517 17518 The advice to be applied to the data is specified by the advice 17519 parameter, as specified in posix_fadvise(). 17520 17521 Return Value 17522 17523 On success, posix_fadvise64() shall return 0. Otherwise an 17524 error number shall be returned to indicate the error. See 17525 posix_fadvise() for possible error values. 17526 17527 posix_fallocate64 17528 17529 Name 17530 17531 posix_fallocate64 -- file space control (Large File Support) 17532 17533 Synopsis 17534 17535 #include 17536 17537 int posix_fallocate64(int fd, off64_t offset, off64_t len); 17538 17539 Description 17540 17541 The posix_fallocate64() function is a large file version of 17542 posix_fallocate(). It shall behave as posix_fallocate() in ISO 17543 POSIX (2003), except that the offset and len arguments are 17544 off64_t objects rather than off_t. 17545 17546 Return Value 17547 17548 See posix_fallocate(). 17549 17550 Errors 17551 17552 See posix_fallocate(). 17553 17554 psignal 17555 17556 Name 17557 17558 psignal -- print signal message 17559 17560 Synopsis 17561 17562 #include 17563 17564 void psignal(int sig, const char * s); 17565 17566 extern const char *const sys_siglist[] 17567 17568 Description 17569 17570 The psignal() function shall display a message on the stderr 17571 stream. If s is not the null pointer, and does not point to an 17572 empty string (e.g. "\0"), the message shall consist of the 17573 string s, a colon, a space, and a string describing the signal 17574 number sig; otherwise psignal() shall display only a message 17575 describing the signal number sig. If sig is invalid, the 17576 message displayed shall indicate an unknown signal. 17577 17578 The array sys_siglist holds the signal description strings 17579 indexed by signal number. 17580 17581 Return Value 17582 17583 psignal() returns no value. 17584 17585 putwc_unlocked 17586 17587 Name 17588 17589 putwc_unlocked -- non-thread-safe putwc 17590 17591 Description 17592 17593 putwc_unlocked() is the same as putwc(), except that it need 17594 not be thread-safe. That is, it may only be invoked in the ways 17595 which are legal for getc_unlocked(). 17596 17597 putwchar_unlocked 17598 17599 Name 17600 17601 putwchar_unlocked -- non-thread-safe putwchar 17602 17603 Description 17604 17605 putwchar_unlocked() is the same as putwchar(), except that it 17606 need not be thread-safe. That is, it may only be invoked in the 17607 ways which are legal for getc_unlocked(). 17608 17609 random_r 17610 17611 Name 17612 17613 random_r -- reentrantly generate pseudorandom numbers in a 17614 uniform distribution 17615 17616 Synopsis 17617 17618 #include 17619 17620 int random_r(struct random_data * buffer, int32_t * result); 17621 17622 Description 17623 17624 The interface random_r() shall function in the same way as the 17625 interface random(), except that random_r() shall use the data 17626 in buffer instead of the global random number generator state. 17627 17628 Before it is used, buffer must be initialized, for example, by 17629 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 17630 it with zeroes. 17631 17632 readdir64_r 17633 17634 Name 17635 17636 readdir64_r -- read a directory (Large File Support) 17637 17638 Synopsis 17639 17640 #include 17641 17642 int readdir64_r(DIR * dirp, struct dirent64 * entry, struct 17643 dirent64 * * result); 17644 17645 Description 17646 17647 The readdir64_r() function is a large file version of 17648 readdir_r(). It shall behave as readdir_r() in ISO POSIX 17649 (2003), except that the entry and result arguments are dirent64 17650 structures rather than dirent. 17651 17652 Return Value 17653 17654 See readdir_r(). 17655 17656 Errors 17657 17658 See readdir_r(). 17659 17660 regexec 17661 17662 Name 17663 17664 regexec -- regular expression matching 17665 17666 Description 17667 17668 The regexec() function shall behave as specified in ISO POSIX 17669 (2003), except with differences as listed below. 17670 17671 Differences 17672 17673 Certain aspects of regular expression matching are optional; 17674 see Regular Expressions. 17675 17676 scandir64 17677 17678 Name 17679 17680 scandir64 -- scan a directory (Large File Support) 17681 17682 Synopsis 17683 17684 #include 17685 17686 int scandir64(const char * dir, const struct dirent64 ** 17687 namelist, int (*sel) (const struct dirent64 *), int (*compar) 17688 (const struct dirent64 **, const struct dirent64 **)); 17689 17690 Description 17691 17692 scandir64() is a large-file version of the scandir() function 17693 as defined in POSIX 1003.1 2008. If differs only in that the 17694 namelist and the paramters to the selection function sel and 17695 comparison function compar are of type dirent64 instead of type 17696 dirent. 17697 17698 scanf 17699 17700 Name 17701 17702 scanf -- convert formatted input 17703 17704 Description 17705 17706 The scanf() family of functions shall behave as described in 17707 ISO POSIX (2003), except as noted below. 17708 17709 Differences 17710 17711 The %s, %S and %[ conversion specifiers shall accept an option 17712 length modifier a, which shall cause a memory buffer to be 17713 allocated to hold the string converted. In such a case, the 17714 argument corresponding to the conversion specifier should be a 17715 reference to a pointer value that will receive a pointer to the 17716 allocated buffer. If there is insufficient memory to allocate a 17717 buffer, the function may set errno to ENOMEM and a conversion 17718 error results. 17719 17720 Note: This directly conflicts with the ISO C (1999) usage of 17721 %a as a conversion specifier for hexadecimal float values. 17722 While this conversion specifier should be supported, a 17723 format specifier such as "%aseconds" will have a different 17724 meaning on an LSB conforming system. 17725 17726 sched_getaffinity 17727 17728 Name 17729 17730 sched_getaffinity -- retrieve the affinity mask of a process 17731 17732 Synopsis 17733 17734 #include 17735 17736 int sched_getaffinity(pid_t pid, unsigned int cpusetsize, 17737 cpu_set_t * mask); 17738 17739 Description 17740 17741 sched_getaffinity() shall retrieve the affinity mask of a 17742 process. 17743 17744 The parameter pid specifies the ID for the process. If pid is 17745 0, then the calling process is specified instead. 17746 17747 The parameter cpusetsize specifies the length of the data 17748 pointed to by mask, in bytes. Normally, this parameter is 17749 specified as sizeof(cpu_set_t). 17750 17751 Return Value 17752 17753 On success, sched_getaffinity() shall return 0, and the 17754 structure pointed to by mask shall contain the affinity mask of 17755 the specified process. 17756 17757 On failure, sched_getaffinity() shall return -1 and set errno 17758 as follows. 17759 17760 Errors 17761 17762 EFAULT 17763 17764 Bad address. 17765 EINVAL 17766 17767 mask does not specify any processors that exist in the system, 17768 or cpusetsize is smaller than the kernel's affinity mask. 17769 ESRCH 17770 17771 The specified process could not be found. 17772 17773 See Also 17774 17775 sched_setscheduler(), sched_setaffinity(). 17776 17777 sched_setaffinity 17778 17779 Name 17780 17781 sched_setaffinity -- set the CPU affinity mask for a process 17782 17783 Synopsis 17784 17785 #include 17786 17787 int sched_setaffinity(pid_t pid, unsigned int cpusetsize, 17788 cpu_set_t * mask); 17789 17790 Description 17791 17792 sched_setaffinity() shall set the CPU affinity mask for a 17793 process. 17794 17795 The parameter pid specifies the ID for the process. If pid is 17796 0, then the calling process is specified instead. 17797 17798 The parameter cpusetsize specifies the length of the data 17799 pointed to by mask, in bytes. Normally, this parameter is 17800 specified as sizeof(cpu_set_t). 17801 17802 The parameter mask specifies the new value for the CPU affinity 17803 mask. The structure pointed to by mask represents the set of 17804 CPUs on which the process may run. If mask does not specify one 17805 of the CPUs on which the specified process is currently 17806 running, then sched_setaffinity() shall migrate the process to 17807 one of those CPUs. 17808 17809 Setting the mask on a multiprocessor system can improve 17810 performance. For example, setting the mask for one process to 17811 specify a particular CPU, and then setting the mask of all 17812 other processes to exclude the CPU, dedicates the CPU to the 17813 process so that the process runs as fast as possible. This 17814 technique also prevents loss of performance in case the process 17815 terminates on one CPU and starts again on another, invalidating 17816 cache. 17817 17818 Return Value 17819 17820 On success, sched_setaffinity() shall return 0. 17821 17822 On failure, sched_setaffinity() shall return -1 and set errno 17823 as follows. 17824 17825 Errors 17826 17827 EFAULT 17828 17829 Bad address. 17830 EINVAL 17831 17832 mask does not specify any processors that exist in the system, 17833 or cpusetsize is smaller than the kernel's affinity mask. 17834 EPERM 17835 17836 Insufficient privileges. The effective user ID of the process 17837 calling sched_setaffinity() is not equal to the user ID or 17838 effective user ID of the specified process, and the calling 17839 process does not have appropriate privileges. 17840 ESRCH 17841 17842 The specified process could not be found. 17843 17844 See Also 17845 17846 sched_setscheduler(), sched_getaffinity(). 17847 17848 sched_setscheduler 17849 17850 Name 17851 17852 sched_setscheduler -- set scheduling policy and parameters 17853 17854 Synopsis 17855 17856 #include 17857 17858 int sched_setscheduler(pid_t pid, int policy, const struct 17859 sched_param * param); 17860 17861 Description 17862 17863 The sched_setscheduler() shall behave as described in ISO POSIX 17864 (2003), except as noted below. 17865 17866 Return Value 17867 17868 On success, 0 is returned instead of the former scheduling 17869 policy. 17870 17871 seed48_r 17872 17873 Name 17874 17875 seed48_r -- reentrantly generate pseudorandom numbers in a 17876 uniform distribution 17877 17878 Synopsis 17879 17880 #include 17881 17882 int seed48_r(unsigned short[3] seed16v, struct drand48_data * 17883 buffer); 17884 17885 Description 17886 17887 The interface seed48_r() shall function in the same way as the 17888 interface seed48(), except that seed48_r() shall use the data 17889 in buffer instead of the global random number generator state. 17890 17891 sendfile 17892 17893 Name 17894 17895 sendfile -- transfer data between two file descriptors 17896 17897 Synopsis 17898 17899 #include 17900 17901 ssize_t sendfile(int out_fd, int in_fd, off_t * offset, size_t 17902 count); 17903 17904 Description 17905 17906 The sendfile() function shall copy data between the file 17907 descriptor in_fd, which must not be a socket, and the file 17908 descriptor out_fd, which must be a socket. in_fd should be 17909 opened for reading, and out_fd should be opened for writing. 17910 17911 The offset parameter points to a variable set to the file 17912 offset at which sendfile() shall start reading from in_fd, 17913 unless it is NULL. On exit, this variable shall contain the 17914 offset of the byte immediately after the last byte read. 17915 sendfile() shall not change the current file offset of in_fd, 17916 unless it is NULL. In that case, sendfile() shall adjust the 17917 current file offset to show how many bytes were read. 17918 17919 The count parameter specifies how many bytes to copy. 17920 17921 Return Value 17922 17923 On success, sendfile() shall return the number of bytes written 17924 to out_fd. 17925 17926 On failure, sendfile() shall return -1 and set errno 17927 appropriately, as follows. 17928 17929 Errors 17930 17931 EAGAIN 17932 17933 Non-blocking I/O with O_NONBLOCK has been chosen, but the write 17934 would block. 17935 EBADF 17936 17937 The input file is not open for reading, or the output file is 17938 not open for writing. 17939 EFAULT 17940 17941 Bad address. 17942 EINVAL 17943 17944 An mmap()-like operation is unavailable for in_fd, or file 17945 descriptor is locked or invalid. 17946 EIO 17947 17948 There was an unspecified error while reading. 17949 ENOMEM 17950 17951 There is not enough memory to read from in_fd. 17952 17953 Notes 17954 17955 sendfile() is usually faster than combining read() and write() 17956 calls, because it is part of the kernel. However, if it fails 17957 with EINVAL, falling back to read() and write() may be 17958 advisable. 17959 17960 It is advisable for performance reasons to use the TCP_CORK 17961 option of the tcp() function when sending header data with file 17962 contents to a TCP socket. This minimizes the number of packets. 17963 17964 See Also 17965 17966 mmap(), open(), socket(), splice(). 17967 17968 sendfile64 17969 17970 Name 17971 17972 sendfile64 -- transfer data between two file descriptors (Large 17973 File Support) 17974 17975 Synopsis 17976 17977 #include 17978 17979 ssize_t sendfile64(int out_fd, int in_fd, off64_t * offset, 17980 size_t count); 17981 17982 Description 17983 17984 The sendfile64() function is a large-file version of the 17985 sendfile() function. 17986 17987 setbuffer 17988 17989 Name 17990 17991 setbuffer -- stream buffering operation 17992 17993 Synopsis 17994 17995 #include 17996 17997 void setbuffer(FILE * stream, char * buf, size_t size); 17998 17999 Description 18000 18001 setbuffer() is an alias for the call to setvbuf(). It works the 18002 same, except that the size of the buffer in setbuffer() is up 18003 to the caller, rather than being determined by the default 18004 BUFSIZ. 18005 18006 setgroups 18007 18008 Name 18009 18010 setgroups -- set list of supplementary group IDs 18011 18012 Synopsis 18013 18014 #include 18015 18016 int setgroups(size_t size, const gid_t * list); 18017 18018 Description 18019 18020 If the process has appropriate privilege, the setgroups() 18021 function shall set the supplementary group IDs for the current 18022 process. list shall reference an array of size group IDs. A 18023 process may have at most NGROUPS_MAX supplementary group IDs. 18024 18025 Return Value 18026 18027 On successful completion, 0 is returned. On error, -1 is 18028 returned and the errno is set to indicate the error. 18029 18030 Errors 18031 18032 EFAULT 18033 18034 list has an invalid address. 18035 EPERM 18036 18037 The process does not have appropriate privileges. 18038 EINVAL 18039 18040 size is greater than NGROUPS_MAX. 18041 18042 sethostname 18043 18044 Name 18045 18046 sethostname -- set host name 18047 18048 Synopsis 18049 18050 #include 18051 #include 18052 #include 18053 18054 int sethostname(const char * name, size_t len); 18055 18056 Description 18057 18058 If the process has appropriate privileges, the sethostname() 18059 function shall change the host name for the current machine. 18060 The name shall point to a null-terminated string of at most len 18061 bytes that holds the new hostname. 18062 18063 If the symbol HOST_NAME_MAX is defined, or if 18064 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 18065 this value shall represent the maximum length of the new 18066 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 18067 value shall represent the maximum length for the new hostname. 18068 If none of these values are defined, the maximum length shall 18069 be the size of the nodename field of the utsname structure. 18070 18071 Return Value 18072 18073 On success, 0 is returned. On error, -1 is returned and the 18074 global variable errno is set appropriately. 18075 18076 Errors 18077 18078 EINVAL 18079 18080 len is negative or larger than the maximum allowed size. 18081 EPERM 18082 18083 the process did not have appropriate privilege. 18084 EFAULT 18085 18086 name is an invalid address. 18087 18088 Rationale 18089 18090 ISO POSIX (2003) guarantees that: 18091 18092 Maximum length of a host name (not including the terminating 18093 null) as returned from the gethostname() function shall be 18094 at least 255 bytes. 18095 18096 The glibc C library does not currently define HOST_NAME_MAX, 18097 and although it provides the name _SC_HOST_NAME_MAX a call to 18098 sysconf() returns -1 and does not alter errno in this case 18099 (indicating that there is no restriction on the hostname 18100 length). However, the glibc manual idicates that some 18101 implementations may have MAXHOSTNAMELEN as a means of detecting 18102 the maximum length, while the Linux kernel at release 2.4 and 18103 2.6 stores this hostname in the utsname structure. While the 18104 glibc manual suggests simply shortening the name until 18105 sethostname() succeeds, the LSB requires that one of the first 18106 four mechanisms works. Future versions of glibc may provide a 18107 more reasonable result from sysconf(_SC_HOST_NAME_MAX). 18108 18109 setsockopt 18110 18111 Name 18112 18113 setsockopt -- set socket options 18114 18115 Synopsis 18116 18117 #include 18118 #include 18119 18120 int setsockopt(int socket, int level, int option_name, const 18121 void * option_value, socklen_t option_len); 18122 18123 Description 18124 18125 The setsockopt() function shall behave as specified in ISO 18126 POSIX (2003), with the following extensions. 18127 18128 IP Protocol Level Options 18129 18130 If the level parameter is IPPROTO_IP, the following values 18131 shall be supported for option_name (see RFC 791:Internet 18132 Protocol for further details): 18133 18134 IP_OPTIONS 18135 18136 Set the Internet Protocol options sent with every packet from 18137 this socket. The option_value shall point to a memory buffer 18138 containing the options and option_len shall contain the size in 18139 bytes of that buffer. For IPv4, the maximum length of options 18140 is 40 bytes. 18141 IP_TOS 18142 18143 Set the Type of Service flags to use when sending packets with 18144 this socket. The option_value shall point to a value containing 18145 the type of service value. The least significant two bits of 18146 the value shall contain the new Type of Service indicator. Use 18147 of other bits in the value is unspecified. The option_len 18148 parameter shall hold the size, in bytes, of the buffer referred 18149 to by option_value. 18150 IP_TTL 18151 18152 Set the current unicast Internet Protocol Time To Live value 18153 used when sending packets with this socket. The option_value 18154 shall point to a value containing the time to live value, which 18155 shall be between 1 and 255. The option_len parameter shall hold 18156 the size, in bytes, of the buffer referred to by option_value. 18157 IP_MULTICAST_TTL 18158 18159 Sets the Time To Live value of outgoing multicast packets for 18160 this socket. optval shall point to an integer which contains 18161 the new TTL value. If the new TTL value is -1, the 18162 implementation should use an unspecified default TTL value. If 18163 the new TTL value is out of the range of acceptable values 18164 (0-255), setsockopt() shall return -1 and set errno to indicate 18165 the error. 18166 IP_MULTICAST_LOOP 18167 18168 Sets a boolean flag indicating whether multicast packets 18169 originating locally should be looped back to the local sockets. 18170 optval shall point to an integer which contains the new flag 18171 value. 18172 IP_ADD_MEMBERSHIP 18173 18174 Join a multicast group. optval shall point to a ip_mreq 18175 structure. Before calling, the caller should fill in the 18176 imr_multiaddr field with the multicast group address and the 18177 imr_address field with the address of the local interface. If 18178 imr_address is set to INADDR_ANY, then an appropriate interface 18179 is chosen by the system. 18180 IP_DROP_MEMBERSHIP 18181 18182 Leave a multicast group. optval shall point to a ip_mreq 18183 structure containing the same values as were used with 18184 IP_ADD_MEMBERSHIP. 18185 IP_MULTICAST_IF 18186 18187 Set the local device for a multicast socket. optval shall point 18188 to a ip_mreq structure initialized in the same manner as with 18189 IP_ADD_MEMBERSHIP. 18190 18191 The ip_mreq structure contains two struct in_addr fields: 18192 imr_multiaddr and imr_address. 18193 18194 Return Value 18195 18196 On success, 0 is returned. On error, -1 is returned and the 18197 global variable errno is set appropriately. 18198 18199 Errors 18200 18201 As defined in ISO POSIX (2003). 18202 18203 setstate_r 18204 18205 Name 18206 18207 setstate_r -- reentrantly change the state array used by random 18208 number generator functions 18209 18210 Synopsis 18211 18212 #include 18213 18214 int setstate_r(char * statebuf, struct random_data * buf); 18215 18216 Description 18217 18218 The interface setstate_r() shall function in the same way as 18219 the interface setstate(), except that setstate_r() shall use 18220 the data in statebuf instead of the global random number 18221 generator state. 18222 18223 setutent 18224 18225 Name 18226 18227 setutent -- access user accounting database entries 18228 18229 Synopsis 18230 18231 #include 18232 18233 void setutent(void); 18234 18235 Description 18236 18237 The setutent() function shall reset the user accounting 18238 database such that the next call to getutent() shall return the 18239 first record in the database. It is recommended to call it 18240 before any of the other functions that operate on the user 18241 accounting databases (e.g. getutent()) 18242 18243 Return Value 18244 18245 None. 18246 18247 sigandset 18248 18249 Name 18250 18251 sigandset -- build a new signal set by combining the two input 18252 sets using logical AND 18253 18254 Synopsis 18255 18256 #include 18257 18258 int sigandset(sigset_t * set, const sigset_t * left, const 18259 sigset_t * right); 18260 18261 Description 18262 18263 The sigandset() function shall combine the two signal sets 18264 referenced by left and right, using a logical AND operation, 18265 and shall place the result in the location referenced by set, 18266 The resulting signal set shall contain only signals that are in 18267 both the set referenced by left and the set referenced by 18268 right. 18269 18270 Applications shall call sigemptyset() or sigfillset() at least 18271 once for each object of type sigset_t to initialize it. If an 18272 uninitialized or NULL object is passed to sigandset(), the 18273 results are undefined. 18274 18275 Return Value 18276 18277 sigandset() returns 0. There are no defined error returns. 18278 18279 See Also 18280 18281 sigorset() 18282 18283 sigisemptyset 18284 18285 Name 18286 18287 sigisemptyset -- check for empty signal set 18288 18289 Synopsis 18290 18291 #include 18292 18293 int sigisemptyset(const sigset_t * set); 18294 18295 Description 18296 18297 The sigisemptyset() function shall check for empty signal set 18298 referenced by set. 18299 18300 Applications shall call sigemptyset() or sigfillset() at least 18301 once for each object of type sigset_t to initialize it. If an 18302 uninitialized or NULL object is passed to sigisemptyset(), the 18303 results are undefined. 18304 18305 Return Value 18306 18307 The sigisemptyset() function shall return a positive non-zero 18308 value if the signal set referenced by set is empty, or zero if 18309 this set is empty. There are no defined error returns. 18310 18311 sigorset 18312 18313 Name 18314 18315 sigorset -- build a new signal set by combining the two input 18316 sets using logical OR 18317 18318 Synopsis 18319 18320 #include 18321 18322 int sigorset(sigset_t * set, const sigset_t * left, const 18323 sigset_t * right); 18324 18325 Description 18326 18327 The sigorset() function shall combine the two signal sets 18328 referenced by left and right, using a logical OR operation, and 18329 shall place the result in the location referenced by set, The 18330 resulting signal set shall contain only signals that are in 18331 either the set referenced by left or the set referenced by 18332 right. 18333 18334 Applications shall call sigemptyset() or sigfillset() at least 18335 once for each object of type sigset_t to initialize it. If an 18336 uninitialized or NULL object is passed to sigorset(), the 18337 results are undefined. 18338 18339 Return Value 18340 18341 sigorset() returns 0. There are no defined error returns. 18342 18343 See Also 18344 18345 sigandset() 18346 18347 sigpause 18348 18349 Name 18350 18351 sigpause -- remove a signal from the signal mask and suspend 18352 the thread (deprecated) 18353 18354 Synopsis 18355 18356 #include 18357 18358 int sigpause(int sig); 18359 18360 Description 18361 18362 The sigpause() function is deprecated from the LSB and is 18363 expected to disappear from a future version of the LSB. 18364 Conforming applications should use sigsuspend() instead. 18365 18366 In the source standard, sigpause() is implemented as a macro 18367 causing it to behave as described in ISO POSIX (2003), and is 18368 equivalent to the function __xpg_sigpause(). If the macro is 18369 undefined, sigpause() from the binary standard is used, with 18370 differences as described here: 18371 18372 The sigpause() function shall block those signals indicated by 18373 sig and suspend execution of the thread until a signal is 18374 delivered. When a signal is delivered, the original signal mask 18375 shall be restored. 18376 18377 See Also 18378 18379 __xpg_sigpause() 18380 18381 sigreturn 18382 18383 Name 18384 18385 sigreturn -- return from signal handler and cleanup stack frame 18386 18387 Synopsis 18388 18389 int sigreturn(struct sigcontext * scp); 18390 18391 Description 18392 18393 The sigreturn() function is used by the system to cleanup after 18394 a signal handler has returned. This function is not in the 18395 source standard; it is only in the binary standard. 18396 18397 Return Value 18398 18399 sigreturn() never returns. 18400 18401 srand48_r 18402 18403 Name 18404 18405 srand48_r -- reentrantly generate pseudorandom numbers in a 18406 uniform distribution 18407 18408 Synopsis 18409 18410 #include 18411 18412 int srand48_r(long int seedval, struct drand48_data * buffer); 18413 18414 Description 18415 18416 The interface srand48_r() shall function in the same way as the 18417 interface srand48(), except that srand48_r() shall use the data 18418 in buffer instead of the global random number generator state. 18419 18420 srandom_r 18421 18422 Name 18423 18424 srandom_r -- reentrantly set the seed for a new sequence of 18425 pseudorandom numbers 18426 18427 Synopsis 18428 18429 #include 18430 18431 int srandom_r(unsigned int seed, struct random_data * buffer); 18432 18433 Description 18434 18435 The interface srandom_r() shall function in the same way as the 18436 interface srandom(), except that srandom_r() shall use the data 18437 in buffer instead of the global random number generator state. 18438 18439 sscanf 18440 18441 Name 18442 18443 sscanf -- convert formatted input 18444 18445 Description 18446 18447 The scanf() family of functions shall behave as described in 18448 ISO POSIX (2003), except as noted below. 18449 18450 Differences 18451 18452 The %s, %S and %[ conversion specifiers shall accept an option 18453 length modifier a, which shall cause a memory buffer to be 18454 allocated to hold the string converted. In such a case, the 18455 argument corresponding to the conversion specifier should be a 18456 reference to a pointer value that will receive a pointer to the 18457 allocated buffer. If there is insufficient memory to allocate a 18458 buffer, the function may set errno to ENOMEM and a conversion 18459 error results. 18460 18461 Note: This directly conflicts with the ISO C (1999) usage of 18462 %a as a conversion specifier for hexadecimal float values. 18463 While this conversion specifier should be supported, a 18464 format specifier such as "%aseconds" will have a different 18465 meaning on an LSB conforming system. 18466 18467 statfs 18468 18469 Name 18470 18471 statfs -- (deprecated) 18472 18473 Synopsis 18474 18475 #include 18476 18477 int statfs(const char *path, struct statfs *buf); 18478 18479 Description 18480 18481 The statfs() function returns information about a mounted file 18482 system. The file system is identified by path, a path name of a 18483 file within the mounted filesystem. The results are placed in 18484 the structure pointed to by 18485 18486 Fields that are undefined for a particular file system shall be 18487 set to 0. 18488 18489 Note: Application developers should use the statvfs() 18490 function to obtain general file system information. 18491 Applications should only use the statfs() function if they 18492 must determine the file system type, which need not be 18493 provided by statvfs(). 18494 18495 Return Value 18496 18497 On success, the statfs() function shall return 0 and set the 18498 fields of the structure idenfitied by buf accordingly. On 18499 error, the statfs() function shall return -1 and set errno 18500 accordingly. 18501 18502 Errors 18503 18504 ENOTDIR 18505 18506 A component of the path prefix of path is not a directory. 18507 ENAMETOOLONG 18508 18509 path is too long. 18510 ENOENT 18511 18512 The file referred to by path does not exist. 18513 EACCES 18514 18515 Search permission is denied for a component of the path prefix 18516 of path. 18517 ELOOP 18518 18519 Too many symbolic links were encountered in translating path. 18520 EFAULT 18521 18522 buf or path points to an invalid address. 18523 EIO 18524 18525 An I/O error occurred while reading from or writing to the file 18526 system. 18527 ENOMEM 18528 18529 Insufficient kernel memory was available. 18530 ENOSYS 18531 18532 The filesystem path is on does not support statfs(). 18533 18534 statfs64 18535 18536 Name 18537 18538 statfs64 -- (deprecated) 18539 18540 Synopsis 18541 18542 #include 18543 18544 int statfs64(const char * path, struct statfs64 *buf); 18545 18546 Description 18547 18548 The statfs64() function returns information about a mounted 18549 file system. The file system is identified by path, a path name 18550 of a file within the mounted filesystem. The results are placed 18551 in the structure pointed to by buf. 18552 18553 statfs64() is a large-file version of the statfs() function. 18554 18555 Fields that are undefined for a particular file system shall be 18556 set to 0. 18557 18558 Note: Application developers should use the statvfs64() 18559 function to obtain general file system information. 18560 Applications should only use the statfs64() function if they 18561 must determine the file system type, which need not be 18562 provided by statvfs64(). 18563 18564 Return Value 18565 18566 On success, the statfs64() function shall return 0 and set the 18567 fields of the structure idenfitied by buf accordingly. On 18568 error, the statfs64() function shall return -1 and set errno 18569 accordingly. 18570 18571 Errors 18572 18573 See fstatfs(). 18574 18575 stime 18576 18577 Name 18578 18579 stime -- set time 18580 18581 Synopsis 18582 18583 #define _SVID_SOURCE 18584 #include 18585 18586 int stime(const time_t * t); 18587 18588 Description 18589 18590 If the process has appropriate privilege, the stime() function 18591 shall set the system's idea of the time and date. Time, 18592 referenced by t, is measured in seconds from the epoch (defined 18593 in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 18594 18595 Return Value 18596 18597 On success, stime() shall return 0. Otherwise, stime() shall 18598 return -1 and errno shall be set to indicate the error. 18599 18600 Errors 18601 18602 EPERM 18603 18604 The process does not have appropriate privilege. 18605 EINVAL 18606 18607 t is a null pointer. 18608 18609 stpcpy 18610 18611 Name 18612 18613 stpcpy -- copy a string returning a pointer to its end 18614 18615 Synopsis 18616 18617 #include 18618 18619 char * stpcpy(char * restrict dest, const char * restrict src); 18620 18621 Description 18622 18623 The stpcpy() function shall copy the string pointed to by src 18624 (including the terminating null character) to the array pointed 18625 to by dest. The strings may not overlap, and the destination 18626 string dest shall be large enough to receive the copy. 18627 18628 Return Value 18629 18630 stpcpy() returns a pointer to the end of the string dest (that 18631 is, the address of the terminating null character) rather than 18632 the beginning. 18633 18634 Example 18635 18636 This program uses stpcpy() to concatenate foo and bar to 18637 produce foobar, which it then prints. 18638 #include 18639 18640 int 18641 main (void) 18642 { 18643 char buffer[256]; 18644 char *to = buffer; 18645 to = stpcpy (to, "foo"); 18646 to = stpcpy (to, "bar"); 18647 printf ("%s\n", buffer); 18648 } 18649 18650 stpncpy 18651 18652 Name 18653 18654 stpncpy -- copy a fixed-size string, returning a pointer to its 18655 end 18656 18657 Synopsis 18658 18659 #include 18660 18661 char * stpncpy(char * restrict dest, const char * restrict src, 18662 size_t n); 18663 18664 Description 18665 18666 The stpncpy() function shall copy at most n characters from the 18667 string pointed to by src, including the terminating null 18668 character, to the array pointed to by dest. Exactly n 18669 characters are written at dest. If the length strlen()(src) is 18670 smaller than n, the remaining characters in dest are filled 18671 with '\0' characters. If the length strlen(src) is greater than 18672 or equal to n, dest will not be null terminated. 18673 18674 The strings may not overlap. 18675 18676 The programmer shall ensure that there is room for at least n 18677 characters at dest. 18678 18679 Return Value 18680 18681 The stpncpy() function shall return a pointer to the 18682 terminating NULL in dest, or, if dest is not NULL-terminated, 18683 dest + n. 18684 18685 strcasestr 18686 18687 Name 18688 18689 strcasestr -- locate a substring ignoring case 18690 18691 Synopsis 18692 18693 #include 18694 18695 char * strcasestr(const char * s1, const char * s2); 18696 18697 Description 18698 18699 The strcasestr() shall behave as strstr(), except that it shall 18700 ignore the case of both strings. The strcasestr() function 18701 shall be locale aware; that is strcasestr() shall behave as if 18702 both strings had been converted to lower case in the current 18703 locale before the comparison is performed. 18704 18705 Return Value 18706 18707 Upon successful completion, strcasestr() shall return a pointer 18708 to the located string or a null pointer if the string is not 18709 found. If s2 points to a string with zero length, the function 18710 shall return s1. 18711 18712 strerror_r 18713 18714 Name 18715 18716 strerror_r -- return string describing error number 18717 18718 Synopsis 18719 18720 #include 18721 18722 char * strerror_r(int errnum, char * buf, size_t buflen); 18723 18724 Description 18725 18726 In the source standard, strerror_r() is implemented as a macro 18727 causing it to behave as described in ISO POSIX (2003), and is 18728 equivalent to the function __xpg_strerror_r(). If the macro is 18729 undefined, strerror_r() from the binary standard is used, with 18730 differences as described here. 18731 18732 The strerror_r() function shall return a pointer to the string 18733 corresponding to the error number errnum. The returned pointer 18734 may point within the buffer buf (at most buflen bytes). 18735 18736 Return Value 18737 18738 On success, strerror_r() shall return a pointer to the 18739 generated message string (determined by the setting of the 18740 LC_MESSAGES category in the current locale). Otherwise, 18741 strerror_r() shall return the string corresponding to "Unknown 18742 error". 18743 18744 See Also 18745 18746 __xpg_strerror_r() 18747 18748 strndup 18749 18750 Name 18751 18752 strndup -- return a malloc'd copy of at most the specified 18753 number of bytes of a string 18754 18755 Synopsis 18756 18757 #include 18758 18759 char * strndup(const char * string, size_t n); 18760 18761 Description 18762 18763 The strndup() function shall return a malloc()'d copy of at 18764 most n bytes of string. The resultant string shall be 18765 terminated even if no NULL terminator appears before string+n. 18766 18767 Return Value 18768 18769 On success, strndup() shall return a pointer to a newly 18770 allocated block of memory containing a copy of at most n bytes 18771 of string. Otherwise, strndup() shall return NULL and set errno 18772 to indicate the error. 18773 18774 Errors 18775 18776 ENOMEM 18777 18778 Insufficient memory available. 18779 18780 strnlen 18781 18782 Name 18783 18784 strnlen -- determine the length of a fixed-size string 18785 18786 Synopsis 18787 18788 #include 18789 18790 size_t strnlen(const char * s, size_t maxlen); 18791 18792 Description 18793 18794 The strnlen() function shall compute the number of bytes in the 18795 array to which s points, stopping at maxlen bytes. A null byte 18796 and any bytes following it are not counted. 18797 18798 Return Value 18799 18800 The strnlen() function shall return the length of s if that is 18801 less than maxlen, or maxlen if there is no null byte in the 18802 first maxlen bytes. 18803 18804 Errors 18805 18806 No errors are defined. 18807 18808 strptime 18809 18810 Name 18811 18812 strptime -- parse a time string 18813 18814 Description 18815 18816 The strptime() shall behave as specified in the ISO POSIX 18817 (2003) with differences as listed below. 18818 18819 Number of leading zeroes may be limited 18820 18821 The ISO POSIX (2003) specifies fields for which "leading zeros 18822 are permitted but not required"; however, applications shall 18823 not expect to be able to supply more leading zeroes for these 18824 fields than would be implied by the range of the field. 18825 Implementations may choose to either match an input with excess 18826 leading zeroes, or treat this as a non-matching input. For 18827 example, %j has a range of 001 to 366, so 0, 00, 000, 001, and 18828 045 are acceptable inputs, but inputs such as 0000, 0366 and 18829 the like are not. 18830 18831 Rationale 18832 18833 glibc developers consider it appropriate behavior to forbid 18834 excess leading zeroes. When trying to parse a given input 18835 against several format strings, forbidding excess leading 18836 zeroes could be helpful. For example, if one matches 0011-12-26 18837 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for 18838 the first match to fail, as it would be perverse to parse that 18839 date as November 12, year 26. The second pattern parses it as 18840 December 26, year 11. 18841 18842 The ISO POSIX (2003) is not explicit that an unlimited number 18843 of leading zeroes are required, although it may imply this. The 18844 LSB explicitly allows implementations to have either behavior. 18845 Future versions of this standard may require implementations to 18846 forbid excess leading zeroes. 18847 18848 An Interpretation Request is currently pending against ISO 18849 POSIX (2003) for this matter. 18850 18851 strsep 18852 18853 Name 18854 18855 strsep -- extract token from string 18856 18857 Synopsis 18858 18859 #include 18860 18861 char * strsep(char * * stringp, const char * delim); 18862 18863 Description 18864 18865 The strsep() function shall find the first token in the string 18866 referenced by the pointer stringp, using the characters in 18867 delim as delimiters. 18868 18869 If stringp is NULL, strsep() shall return NULL and do nothing 18870 else. 18871 18872 If stringp is non-NULL, strsep() shall find the first token in 18873 the string referenced by stringp, where tokens are delimited by 18874 characters in the string delim. This token shall be terminated 18875 with a \0 character by overwriting the delimiter, and stringp 18876 shall be updated to point past the token. In case no delimiter 18877 was found, the token is taken to be the entire string 18878 referenced by stringp, and the location referenced by stringp 18879 is made NULL. 18880 18881 Return Value 18882 18883 strsep() shall return a pointer to the beginning of the token. 18884 18885 Notes 18886 18887 The strsep() function was introduced as a replacement for 18888 strtok(), since the latter cannot handle empty fields. However, 18889 strtok() conforms to ISO C (1999) and to ISO POSIX (2003) and 18890 hence is more portable. 18891 18892 See Also 18893 18894 strtok(), strtok_r(). 18895 18896 strsignal 18897 18898 Name 18899 18900 strsignal -- return string describing signal 18901 18902 Synopsis 18903 18904 #define _GNU_SOURCE 18905 #include 18906 18907 char * strsignal(int sig); 18908 18909 extern const char * const sys_siglist[]; 18910 18911 Description 18912 18913 The strsignal() function shall return a pointer to a string 18914 describing the signal number sig. The string can only be used 18915 until the next call to strsignal(). 18916 18917 The array sys_siglist holds the signal description strings 18918 indexed by signal number. This array should not be accessed 18919 directly by applications. 18920 18921 Return Value 18922 18923 If sig is a valid signal number, strsignal() shall return a 18924 pointer to the appropriate description string. Otherwise, 18925 strsignal() shall return either a pointer to the string 18926 "unknown signal", or a null pointer. 18927 18928 Although the function is not declared as returning a pointer to 18929 a constant character string, applications shall not modify the 18930 returned string. 18931 18932 strtoq 18933 18934 Name 18935 18936 strtoq -- convert string value to a long or quad_t integer 18937 18938 Synopsis 18939 18940 #include 18941 #include 18942 #include 18943 18944 long long strtoq(const char * nptr, char * * endptr, int base); 18945 18946 Description 18947 18948 strtoq() converts the string nptr to a quadt value. The 18949 conversion is done according to the given base, which shall be 18950 between 2 and 36 inclusive, or be the special value 0. 18951 18952 nptr may begin with an arbitrary amount of white space (as 18953 determined by isspace()), followed by a single optional + or - 18954 sign character. If base is 0 or 16, the string may then include 18955 a 0x prefix, and the number will be read in base 16; otherwise, 18956 a 0 base is taken as 10 (decimal), unless the next character is 18957 0, in which case it is taken as 8 (octal). 18958 18959 The remainder of the string is converted to a long value in the 18960 obvious manner, stopping at the first character which is not a 18961 valid digit in the given base. (In bases above 10, the letter A 18962 in either upper or lower case represents 10, B represents 11, 18963 and so forth, with Z representing 35.) 18964 18965 Return Value 18966 18967 strtoq() returns the result of the conversion, unless the value 18968 would underflow or overflow. If an underflow occurs, strtoq() 18969 returns QUAD_MIN. If an overflow occurs, strtoq() returns 18970 QUAD_MAX. In both cases, the global variable errno is set to 18971 ERANGE. 18972 18973 Errors 18974 18975 ERANGE 18976 18977 The given string was out of range; the value converted has been 18978 clamped. 18979 18980 strtouq 18981 18982 Name 18983 18984 strtouq -- convert a string to an unsigned long long 18985 18986 Synopsis 18987 18988 #include 18989 #include 18990 #include 18991 18992 unsigned long long strtouq(const char * nptr, char * * endptr, 18993 int base); 18994 18995 Description 18996 18997 strtouq() converts the string nptr to an unsigned long long 18998 value. The conversion is done according to the given base, 18999 which shall be between 2 and 36 inclusive, or be the special 19000 value 0. 19001 19002 nptr may begin with an arbitrary amount of white space (as 19003 determined by isspace()), followed by a single optional + or - 19004 sign character. If base is 0 or 16, the string may then include 19005 a 0x prefix, and the number will be read in base 16; otherwise, 19006 a 0 base is taken as 10 (decimal), unless the next character is 19007 0, in which case it is taken as 8 (octal). 19008 19009 The remainder of the string is converted to an unsigned long 19010 value in the obvious manner, stopping at the end of the string 19011 or at the first character that does not produce a valid digit 19012 in the given base. (In bases above 10, the letter A in either 19013 upper or lower case represents 10, B represents 11, and so 19014 forth, with Z representing 35.) 19015 19016 Return Value 19017 19018 On success, strtouq() returns either the result of the 19019 conversion or, if there was a leading minus sign, the negation 19020 of the result of the conversion, unless the original 19021 (non-negated) value would overflow. In the case of an overflow 19022 the function returns UQUAD_MAX and the global variable errno is 19023 set to ERANGE. 19024 19025 Errors 19026 19027 ERANGE 19028 19029 The given string was out of range; the value converted has been 19030 clamped. 19031 19032 svc_register 19033 19034 Name 19035 19036 svc_register -- register Remote Procedure Call interface 19037 19038 Synopsis 19039 19040 #include 19041 19042 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 19043 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 19044 protocol); 19045 19046 Description 19047 19048 The svc_register() function shall associate the program 19049 identified by prognum at version versnum with the service 19050 dispatch procedure, dispatch. If protocol is zero, the service 19051 is not registered with the portmap service. If protocol is 19052 non-zero, then a mapping of the triple [prognum, versnum, 19053 protocol] to xprt->xp_port is established with the local 19054 portmap service. The procedure dispatch has the following form: 19055 19056 int dispatch(struct svc_req * request, SVCXPRT * xprt); 19057 19058 Return Value 19059 19060 svc_register() returns 1 if it succeeds, and zero otherwise. 19061 19062 svc_run 19063 19064 Name 19065 19066 svc_run -- waits for RPC requests to arrive and calls service 19067 procedure 19068 19069 Synopsis 19070 19071 #include 19072 19073 void svc_run(void); 19074 19075 Description 19076 19077 The svc_run() function shall wait for RPC requests to arrive, 19078 read and unpack each request, and dispatch it to the 19079 appropriate registered handler. Under normal conditions, 19080 svc_run() shall not return; it shall only return if serious 19081 errors occur that prevent further processing. 19082 19083 svc_sendreply 19084 19085 Name 19086 19087 svc_sendreply -- called by RPC service's dispatch routine 19088 19089 Synopsis 19090 19091 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 19092 out); 19093 19094 Description 19095 19096 Called by an RPC service's dispatch routine to send the results 19097 of a remote procedure call. The parameter xprt is the request's 19098 associated transport handle; outproc is the XDR routine which 19099 is used to encode the results; and out is the address of the 19100 results. This routine returns one if it succeeds, zero 19101 otherwise. 19102 19103 svctcp_create 19104 19105 Name 19106 19107 svctcp_create -- create a TCP/IP-based RPC service transport 19108 19109 Synopsis 19110 19111 #include 19112 19113 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 19114 recv_buf_size); 19115 19116 Description 19117 19118 svctcp_create() creates a TCP/IP-based RPC service transport, 19119 to which it returns a pointer. The transport is associated with 19120 the socket sock, which may be RPC_ANYSOCK, in which case a new 19121 socket is created. If the socket is not bound to a local TCP 19122 port, then this routine binds it to an arbitrary port. Upon 19123 completion, xprt->xp_sock is the transport's socket descriptor, 19124 and xprt->xp_port is the transport's port number. Since 19125 TCP-based RPC uses buffered I/O, users may specify the size of 19126 buffers; values of zero choose suitable defaults. 19127 19128 Return Value 19129 19130 svctcp_create() returns NULL if it fails, or a pointer to the 19131 RPC service transport otherwise. 19132 19133 svcudp_create 19134 19135 Name 19136 19137 svcudp_create -- create a UDP-based RPC service transport 19138 19139 Synopsis 19140 19141 SVCXPRT * 19142 19143 svcudp_create(int sock); 19144 19145 Description 19146 19147 The svcudp_create() function shall create a UDP/IP-based RPC 19148 service transport, and return a pointer to its descriptor. The 19149 transport is associated with the socket sock, which may be 19150 RPC_ANYSOCK, in which case a new socket shall be created. If 19151 the socket is not bound to a local UDP port, then 19152 svcudp_create() shall bind it to an arbitrary port. 19153 19154 If svcudp_create() returns successfully, then the xp_sock field 19155 in the result shall be the transport's socket descriptor, and 19156 the xp_port field shall be the transport's port number. 19157 19158 Return Value 19159 19160 Upon successful completion, svcudp_create() shall return a 19161 pointer to a RPC service transport; otherwise, a null pointer 19162 shall be returned. 19163 19164 swscanf 19165 19166 Name 19167 19168 swscanf -- convert formatted input 19169 19170 Description 19171 19172 The scanf() family of functions shall behave as described in 19173 ISO POSIX (2003), except as noted below. 19174 19175 Differences 19176 19177 The %s, %S and %[ conversion specifiers shall accept an option 19178 length modifier a, which shall cause a memory buffer to be 19179 allocated to hold the string converted. In such a case, the 19180 argument corresponding to the conversion specifier should be a 19181 reference to a pointer value that will receive a pointer to the 19182 allocated buffer. If there is insufficient memory to allocate a 19183 buffer, the function may set errno to ENOMEM and a conversion 19184 error results. 19185 19186 Note: This directly conflicts with the ISO C (1999) usage of 19187 %a as a conversion specifier for hexadecimal float values. 19188 While this conversion specifier should be supported, a 19189 format specifier such as "%aseconds" will have a different 19190 meaning on an LSB conforming system. 19191 19192 sysconf 19193 19194 Name 19195 19196 sysconf -- Get configuration information at runtime 19197 19198 Synopsis 19199 19200 #include 19201 19202 long sysconf(int name); 19203 19204 DESCRIPTION 19205 19206 sysconf() is as specified in ISO POSIX (2003), but with 19207 differences as listed below. 19208 19209 Extra Variables 19210 19211 These additional values extend the list in ISO POSIX (2003). 19212 19213 - _SC_PHYS_PAGES 19214 The number of pages of physical memory. 19215 19216 - _SC_AVPHYS_PAGES 19217 The number of currently available pages of physical 19218 memory. 19219 19220 - _SC_NPROCESSORS_CONF 19221 The number of processors configured. 19222 19223 - _SC_NPROCESSORS_ONLN 19224 The number of processors currently online (available). 19225 19226 system 19227 19228 Name 19229 19230 system -- execute a shell command 19231 19232 Synopsis 19233 19234 #include 19235 19236 int system(const char * string); 19237 19238 Description 19239 19240 The system() function shall behave as described in ISO POSIX 19241 (2003). 19242 19243 Notes 19244 19245 The fact that system() ignores interrupts is often not what a 19246 program wants. ISO POSIX (2003) describes some of the 19247 consequences; an additional consequence is that a program 19248 calling system() from a loop cannot be reliably interrupted. 19249 Many programs will want to use the exec() family of functions 19250 instead. 19251 19252 Do not use system() from a program with suid or sgid 19253 privileges, because unexpected values for some environment 19254 variables might be used to subvert system integrity. Use the 19255 exec() family of functions instead, but not execlp() or 19256 execvp(). system() will not, in fact, work properly from 19257 programs with suid or sgid privileges on systems on which 19258 /bin/sh is bash version 2, since bash 2 drops privileges on 19259 startup. (Debian uses a modified bash which does not do this 19260 when invoked as sh.) 19261 19262 The check for the availability of /bin/sh is not actually 19263 performed; it is always assumed to be available. ISO C (1999) 19264 specifies the check, but ISO POSIX (2003) specifies that the 19265 return shall always be nonzero, since a system without the 19266 shell is not conforming, and it is this that is implemented. 19267 19268 It is possible for the shell command to return 127, so that 19269 code is not a sure indication that the execve() call failed; 19270 check the global variable errno to make sure. 19271 19272 textdomain 19273 19274 Name 19275 19276 textdomain -- set the current default message domain 19277 19278 Synopsis 19279 19280 #include 19281 19282 char * textdomain(const char * domainname); 19283 19284 Description 19285 19286 The textdomain() function shall set the current default message 19287 domain to domainname. Subsequent calls to gettext() and 19288 ngettext() use the default message domain. 19289 19290 If domainname is NULL, the default message domain shall not be 19291 altered. 19292 19293 If domainname is "", textdomain() shall reset the default 19294 domain to the system default of "messages". 19295 19296 Return 19297 19298 On success, textdomain() shall return the currently selected 19299 domain. Otherwise, a null pointer shall be returned, and errno 19300 is set to indicate the error. 19301 19302 Errors 19303 19304 ENOMEM 19305 19306 Insufficent memory available. 19307 19308 unlink 19309 19310 Name 19311 19312 unlink -- remove a directory entry 19313 19314 Synopsis 19315 19316 int unlink(const char * path); 19317 19318 Description 19319 19320 unlink() is as specified in ISO POSIX (2003), but with 19321 differences as listed below. 19322 19323 See also Section 18.1, Additional behaviors: unlink/link on 19324 directory. 19325 19326 May return EISDIR on directories 19327 19328 If path specifies a directory, the implementation may return 19329 EISDIR instead of EPERM as specified by ISO POSIX (2003). 19330 19331 Rationale: The Linux kernel has deliberately chosen EISDIR 19332 for this case and does not expect to change. 19333 19334 uselocale 19335 19336 Name 19337 19338 uselocale -- set locale for thread 19339 19340 Synopsis 19341 19342 #include 19343 19344 locale_t uselocale(locale_t newloc); 19345 19346 Description 19347 19348 The uselocale() function shall set the locale for the calling 19349 thread to the locale specified by newloc. 19350 19351 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 19352 shall be set to the process current global locale, as set by 19353 setlocale(). If newloc is NULL, the thread's locale is not 19354 altered. 19355 19356 Return Value 19357 19358 The uselocale() function shall return the previous locale, or 19359 LC_GLOBAL_LOCALE if the thread local locale has not been 19360 previously set. 19361 19362 Errors 19363 19364 None defined. 19365 19366 See Also 19367 19368 setlocale(), freelocale(), duplocale(), newlocale() 19369 19370 utmpname 19371 19372 Name 19373 19374 utmpname -- set user accounting database 19375 19376 Synopsis 19377 19378 #include 19379 19380 int utmpname(const char * dbname); 19381 19382 Description 19383 19384 The utmpname() function shall cause the user accounting 19385 database used by the getutent(), getutent_r(), getutxent(), 19386 getutxid(), getutxline(), and pututxline() functions to be that 19387 named by dbname, instead of the system default database. See 19388 Section 16.3 for further information. 19389 19390 Note: The LSB does not specify the format of the user 19391 accounting database, nor the names of the file or files that 19392 may contain it. 19393 19394 Return Value 19395 19396 None. 19397 19398 Errors 19399 19400 None defined. 19401 19402 vasprintf 19403 19404 Name 19405 19406 vasprintf -- write formatted output to a dynamically allocated 19407 string 19408 19409 Synopsis 19410 19411 #include 19412 #include 19413 19414 int vasprintf(char * * restrict ptr, const char * restrict 19415 format, va_list arg); 19416 19417 Description 19418 19419 The vasprintf() function shall write formatted output to a 19420 dynamically allocated string, and store the address of that 19421 string in the location referenced by ptr. It shall behave as 19422 asprintf(), except that instead of being called with a variable 19423 number of arguments, it is called with an argument list as 19424 defined by . 19425 19426 Return Value 19427 19428 Refer to fprintf(). 19429 19430 Errors 19431 19432 Refer to fprintf(). 19433 19434 vdprintf 19435 19436 Name 19437 19438 vdprintf -- write formatted output to a file descriptor 19439 19440 Synopsis 19441 19442 #include 19443 19444 int vdprintf(int fd, const char * restrict format, va_list 19445 arg); 19446 19447 Description 19448 19449 The vdprintf() function shall behave as vfprintf(), except that 19450 vdprintf() shall write output to the file associated with the 19451 file descriptor specified by the fd argument, rather than place 19452 output on a stream (as defined by ISO POSIX (2003)). 19453 19454 Return Value 19455 19456 Refer to fprintf(). 19457 19458 Errors 19459 19460 Refer to fprintf(). 19461 19462 verrx 19463 19464 Name 19465 19466 verrx -- display formatted error message and exit 19467 19468 Synopsis 19469 19470 #include 19471 #include 19472 19473 void verrx(int eval, const char * fmt, va_list args); 19474 19475 Description 19476 19477 The verrx() shall behave as errx() except that instead of being 19478 called with a variable number of arguments, it is called with 19479 an argument list as defined by . 19480 19481 verrx() does not return, but exits with the value of eval. 19482 19483 Return Value 19484 19485 None. 19486 19487 Errors 19488 19489 None. 19490 19491 vfscanf 19492 19493 Name 19494 19495 vfscanf -- convert formatted input 19496 19497 Description 19498 19499 The scanf() family of functions shall behave as described in 19500 ISO POSIX (2003), except as noted below. 19501 19502 Differences 19503 19504 The %s, %S and %[ conversion specifiers shall accept an option 19505 length modifier a, which shall cause a memory buffer to be 19506 allocated to hold the string converted. In such a case, the 19507 argument corresponding to the conversion specifier should be a 19508 reference to a pointer value that will receive a pointer to the 19509 allocated buffer. If there is insufficient memory to allocate a 19510 buffer, the function may set errno to ENOMEM and a conversion 19511 error results. 19512 19513 Note: This directly conflicts with the ISO C (1999) usage of 19514 %a as a conversion specifier for hexadecimal float values. 19515 While this conversion specifier should be supported, a 19516 format specifier such as "%aseconds" will have a different 19517 meaning on an LSB conforming system. 19518 19519 vfwscanf 19520 19521 Name 19522 19523 vfwscanf -- convert formatted input 19524 19525 Description 19526 19527 The scanf() family of functions shall behave as described in 19528 ISO POSIX (2003), except as noted below. 19529 19530 Differences 19531 19532 The %s, %S and %[ conversion specifiers shall accept an option 19533 length modifier a, which shall cause a memory buffer to be 19534 allocated to hold the string converted. In such a case, the 19535 argument corresponding to the conversion specifier should be a 19536 reference to a pointer value that will receive a pointer to the 19537 allocated buffer. If there is insufficient memory to allocate a 19538 buffer, the function may set errno to ENOMEM and a conversion 19539 error results. 19540 19541 Note: This directly conflicts with the ISO C (1999) usage of 19542 %a as a conversion specifier for hexadecimal float values. 19543 While this conversion specifier should be supported, a 19544 format specifier such as "%aseconds" will have a different 19545 meaning on an LSB conforming system. 19546 19547 vscanf 19548 19549 Name 19550 19551 vscanf -- convert formatted input 19552 19553 Description 19554 19555 The scanf() family of functions shall behave as described in 19556 ISO POSIX (2003), except as noted below. 19557 19558 Differences 19559 19560 The %s, %S and %[ conversion specifiers shall accept an option 19561 length modifier a, which shall cause a memory buffer to be 19562 allocated to hold the string converted. In such a case, the 19563 argument corresponding to the conversion specifier should be a 19564 reference to a pointer value that will receive a pointer to the 19565 allocated buffer. If there is insufficient memory to allocate a 19566 buffer, the function may set errno to ENOMEM and a conversion 19567 error results. 19568 19569 Note: This directly conflicts with the ISO C (1999) usage of 19570 %a as a conversion specifier for hexadecimal float values. 19571 While this conversion specifier should be supported, a 19572 format specifier such as "%aseconds" will have a different 19573 meaning on an LSB conforming system. 19574 19575 vsscanf 19576 19577 Name 19578 19579 vsscanf -- convert formatted input 19580 19581 Description 19582 19583 The scanf() family of functions shall behave as described in 19584 ISO POSIX (2003), except as noted below. 19585 19586 Differences 19587 19588 The %s, %S and %[ conversion specifiers shall accept an option 19589 length modifier a, which shall cause a memory buffer to be 19590 allocated to hold the string converted. In such a case, the 19591 argument corresponding to the conversion specifier should be a 19592 reference to a pointer value that will receive a pointer to the 19593 allocated buffer. If there is insufficient memory to allocate a 19594 buffer, the function may set errno to ENOMEM and a conversion 19595 error results. 19596 19597 Note: This directly conflicts with the ISO C (1999) usage of 19598 %a as a conversion specifier for hexadecimal float values. 19599 While this conversion specifier should be supported, a 19600 format specifier such as "%aseconds" will have a different 19601 meaning on an LSB conforming system. 19602 19603 vswscanf 19604 19605 Name 19606 19607 vswscanf -- convert formatted input 19608 19609 Description 19610 19611 The scanf() family of functions shall behave as described in 19612 ISO POSIX (2003), except as noted below. 19613 19614 Differences 19615 19616 The %s, %S and %[ conversion specifiers shall accept an option 19617 length modifier a, which shall cause a memory buffer to be 19618 allocated to hold the string converted. In such a case, the 19619 argument corresponding to the conversion specifier should be a 19620 reference to a pointer value that will receive a pointer to the 19621 allocated buffer. If there is insufficient memory to allocate a 19622 buffer, the function may set errno to ENOMEM and a conversion 19623 error results. 19624 19625 Note: This directly conflicts with the ISO C (1999) usage of 19626 %a as a conversion specifier for hexadecimal float values. 19627 While this conversion specifier should be supported, a 19628 format specifier such as "%aseconds" will have a different 19629 meaning on an LSB conforming system. 19630 19631 vsyslog 19632 19633 Name 19634 19635 vsyslog -- log to system log 19636 19637 Synopsis 19638 19639 #include 19640 #include 19641 19642 void vsyslog(int priority, char * message, va_list arglist); 19643 19644 Description 19645 19646 The vsyslog() function is identical to syslog() as specified in 19647 ISO POSIX (2003), except that arglist (as defined by stdarg.h) 19648 replaces the variable number of arguments. 19649 19650 vwscanf 19651 19652 Name 19653 19654 vwscanf -- convert formatted input 19655 19656 Description 19657 19658 The scanf() family of functions shall behave as described in 19659 ISO POSIX (2003), except as noted below. 19660 19661 Differences 19662 19663 The %s, %S and %[ conversion specifiers shall accept an option 19664 length modifier a, which shall cause a memory buffer to be 19665 allocated to hold the string converted. In such a case, the 19666 argument corresponding to the conversion specifier should be a 19667 reference to a pointer value that will receive a pointer to the 19668 allocated buffer. If there is insufficient memory to allocate a 19669 buffer, the function may set errno to ENOMEM and a conversion 19670 error results. 19671 19672 Note: This directly conflicts with the ISO C (1999) usage of 19673 %a as a conversion specifier for hexadecimal float values. 19674 While this conversion specifier should be supported, a 19675 format specifier such as "%aseconds" will have a different 19676 meaning on an LSB conforming system. 19677 19678 wait4 19679 19680 Name 19681 19682 wait4 -- wait for process termination, BSD style 19683 19684 Synopsis 19685 19686 #include 19687 #include 19688 #include 19689 19690 pid_t wait4(pid_t pid, int * status, int options, struct rusage 19691 * rusage); 19692 19693 Description 19694 19695 wait4() suspends execution of the current process until a child 19696 (as specified by pid) has exited, or until a signal is 19697 delivered whose action is to terminate the current process or 19698 to call a signal handling function. If a child (as requested by 19699 pid) has already exited by the time of the call (a so-called 19700 "zombie" process), the function returns immediately. Any system 19701 resources used by the child are freed. 19702 19703 The value of pid can be one of: 19704 19705 < -1 19706 19707 wait for any child process whose process group ID is equal to 19708 the absolute value of pid. 19709 -1 19710 19711 wait for any child process; this is equivalent to calling 19712 wait3(). 19713 0 19714 19715 wait for any child process whose process group ID is equal to 19716 that of the calling process. 19717 > 0 19718 19719 wait for the child whose process ID is equal to the value of 19720 pid. 19721 19722 The value of options is a bitwise or of zero or more of the 19723 following constants: 19724 19725 WNOHANG 19726 19727 return immediately if no child is there to be waited for. 19728 WUNTRACED 19729 19730 return for children that are stopped, and whose status has not 19731 been reported. 19732 19733 If status is not NULL, wait4() stores status information in the 19734 location status. This status can be evaluated with the 19735 following macros: 19736 19737 Note: These macros take the status value (an int) as an 19738 argument -- not a pointer to the value! 19739 19740 WIFEXITED(status) 19741 19742 is nonzero if the child exited normally. 19743 WEXITSTATUS(status) 19744 19745 evaluates to the least significant eight bits of the return 19746 code of the child that terminated, which may have been set as 19747 the argument to a call to exit() or as the argument for a 19748 return statement in the main program. This macro can only be 19749 evaluated if WIFEXITED() returned nonzero. 19750 WIFSIGNALED(status) 19751 19752 returns true if the child process exited because of a signal 19753 that was not caught. 19754 WTERMSIG(status) 19755 19756 returns the number of the signal that caused the child process 19757 to terminate. This macro can only be evaluated if WIFSIGNALED() 19758 returned nonzero. 19759 WIFSTOPPED(status) 19760 19761 returns true if the child process that caused the return is 19762 currently stopped; this is only possible if the call was done 19763 using WUNTRACED(). 19764 WSTOPSIG(status) 19765 19766 returns the number of the signal that caused the child to stop. 19767 This macro can only be evaluated if WIFSTOPPED() returned 19768 nonzero. 19769 19770 If rusage is not NULL, the struct rusage (as defined in 19771 sys/resource.h) that it points to will be filled with 19772 accounting information. See getrusage() for details. 19773 19774 Return Value 19775 19776 On success, the process ID of the child that exited is 19777 returned. On error, -1 is returned (in particular, when no 19778 unwaited-for child processes of the specified kind exist), or 0 19779 if WNOHANG() was used and no child was available yet. In the 19780 latter two cases, the global variable errno is set 19781 appropriately. 19782 19783 Errors 19784 19785 ECHILD 19786 19787 No unwaited-for child process as specified does exist. 19788 ERESTARTSYS 19789 19790 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 19791 was caught. This error is returned by the system call. The 19792 library interface is not allowed to return ERESTARTSYS, but 19793 will return EINTR. 19794 19795 warn 19796 19797 Name 19798 19799 warn -- formatted error messages 19800 19801 Synopsis 19802 19803 #include 19804 19805 void warn(const char * fmt, ...); 19806 19807 Description 19808 19809 The warn() function shall display a formatted error message on 19810 the standard error stream. The output shall consist of the last 19811 component of the program name, a colon character, and a space 19812 character. If fmt is non-NULL, it shall be used as a format 19813 string for the printf() family of functions, and the formatted 19814 message, a colon character, and a space are written to stderr. 19815 Finally, the error message string affiliated with the current 19816 value of the global variable errno shall be written to stderr, 19817 followed by a newline character. 19818 19819 Return Value 19820 19821 None. 19822 19823 Errors 19824 19825 None. 19826 19827 warnx 19828 19829 Name 19830 19831 warnx -- formatted error messages 19832 19833 Synopsis 19834 19835 #include 19836 19837 void warnx(const char * fmt, ...); 19838 19839 Description 19840 19841 The warnx() function shall display a formatted error message on 19842 the standard error stream. The last component of the program 19843 name, a colon character, and a space shall be output. If fmt is 19844 non-NULL, it shall be used as the format string for the 19845 printf() family of functions, and the formatted error message, 19846 a colon character, and a space shall be output. The output 19847 shall be followed by a newline character. 19848 19849 Return Value 19850 19851 None. 19852 19853 Errors 19854 19855 None. 19856 19857 wcpcpy 19858 19859 Name 19860 19861 wcpcpy -- copy a wide character string, returning a pointer to 19862 its end 19863 19864 Synopsis 19865 19866 #include 19867 19868 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 19869 19870 Description 19871 19872 wcpcpy() is the wide-character equivalent of stpcpy(). It 19873 copies the wide character string src, including the terminating 19874 null wide character code, to the array dest. 19875 19876 The strings may not overlap. 19877 19878 The programmer shall ensure that there is room for at least 19879 wcslen()(src)+1 wide characters at dest. 19880 19881 Return Value 19882 19883 wcpcpy() returns a pointer to the end of the wide-character 19884 string dest, that is, a pointer to the terminating null wide 19885 character code. 19886 19887 wcpncpy 19888 19889 Name 19890 19891 wcpncpy -- copy a fixed-size string of wide characters, 19892 returning a pointer to its end 19893 19894 Synopsis 19895 19896 #include 19897 19898 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 19899 n); 19900 19901 Description 19902 19903 wcpncpy() is the wide-character equivalent of stpncpy(). It 19904 copies at most n wide characters from the wide-character string 19905 src, including the terminating null wide character code, to the 19906 array dest. Exactly n wide characters are written at dest. If 19907 the length wcslen()(src) is smaller than n, the remaining wide 19908 characters in the array dest are filled with null wide 19909 character codes. If the length wcslen()(src) is greater than or 19910 equal to n, the string dest will not be terminated with a null 19911 wide character code. 19912 19913 The strings may not overlap. 19914 19915 The programmer shall ensure that there is room for at least n 19916 wide characters at dest. 19917 19918 Return Value 19919 19920 wcpncpy() returns a pointer to the wide character one past the 19921 last non-null wide character written. 19922 19923 wcscasecmp 19924 19925 Name 19926 19927 wcscasecmp -- compare two wide-character strings, ignoring case 19928 19929 Synopsis 19930 19931 #include 19932 19933 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 19934 19935 Description 19936 19937 wcscasecmp() is the wide-character equivalent of strcasecmp(). 19938 It compares the wide-character string s1 and the wide-character 19939 string s2, ignoring case differences (towupper, towlower). 19940 19941 Return Value 19942 19943 The wcscasecmp() function shall return 0 if the wide-character 19944 strings s1 and s2 are equal except for case distinctions. It 19945 shall return a positive integer if s1 is greater than s2, 19946 ignoring case. It shall return a negative integer if s1 is less 19947 than s2, ignoring case. 19948 19949 Notes 19950 19951 The behavior of wcscasecmp() depends upon the LC_CTYPE category 19952 of the current locale. 19953 19954 wcsdup 19955 19956 Name 19957 19958 wcsdup -- duplicate a wide-character string 19959 19960 Synopsis 19961 19962 #include 19963 19964 wchar_t * wcsdup(const wchar_t * s); 19965 19966 Description 19967 19968 The wcsdup() function is the wide-character equivalent of 19969 strdup(). The wcsdup() function shall return a pointer to a new 19970 wide character string, which is a duplicate of the wide 19971 character string pointed to by s. The returned pointer can be 19972 passed to free(). A null pointer is returned if the new string 19973 cannot be created. 19974 19975 Return Value 19976 19977 The wcsdup() function returns a pointer to a new wide-character 19978 string on success. Otherwise, it shall return NULL and set 19979 errno to indicate the error. 19980 19981 Errors 19982 19983 ENOMEM 19984 19985 Insufficient memory available. 19986 19987 wcsncasecmp 19988 19989 Name 19990 19991 wcsncasecmp -- compare two fixed-size wide-character strings, 19992 ignoring case 19993 19994 Synopsis 19995 19996 #include 19997 19998 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 19999 n); 20000 20001 Description 20002 20003 wcsncasecmp() is the wide-character equivalent of 20004 strncasecmp(). It compares the wide-character string s1 and the 20005 wide-character string s2, but at most n wide characters from 20006 each string, ignoring case differences (towupper, towlower). 20007 20008 Return Value 20009 20010 wcscasecmp() returns 0 if the wide-character strings s1 and s2, 20011 truncated to at most length n, are equal except for case 20012 distinctions. It returns a positive integer if truncated s1 is 20013 greater than truncated s2, ignoring case. It returns a negative 20014 integer if truncated s1 is smaller than truncated s2, ignoring 20015 case. 20016 20017 Notes 20018 20019 The behavior of wcsncasecmp() depends upon the LC_CTYPE 20020 category of the current locale. 20021 20022 wcsnlen 20023 20024 Name 20025 20026 wcsnlen -- determine the length of a fixed-size wide-character 20027 string 20028 20029 Synopsis 20030 20031 #include 20032 20033 size_t wcsnlen(const wchar_t * s, size_t maxlen); 20034 20035 Description 20036 20037 wcsnlen() is the wide-character equivalent of strnlen(). It 20038 returns the number of wide-characters in the string s, not 20039 including the terminating null wide character code, but at most 20040 maxlen. In doing this, wcsnlen() looks only at the first maxlen 20041 wide-characters at s and never beyond s + maxlen. 20042 20043 Return Value 20044 20045 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 20046 maxlen if there is no null wide character code among the first 20047 maxlen wide characters pointed to by s. 20048 20049 wcsnrtombs 20050 20051 Name 20052 20053 wcsnrtombs -- convert a wide character string to a multi-byte 20054 string 20055 20056 Synopsis 20057 20058 #include 20059 20060 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 20061 nwc, size_t len, mbstate_t * ps); 20062 20063 Description 20064 20065 wcsnrtombs() is like wcsrtombs(), except that the number of 20066 wide characters to be converted, starting at src, is limited to 20067 nwc. 20068 20069 If dest is not a NULL pointer, wcsnrtombs() converts at most 20070 nwc wide characters from the wide-character string src to a 20071 multibyte string starting at dest. At most len bytes are 20072 written to dest. The shift state ps is updated. 20073 20074 The conversion is effectively performed by repeatedly calling: 20075 wcrtomb(dest, *src, ps) 20076 20077 as long as this call succeeds, and then incrementing dest by 20078 the number of bytes written and src by 1. 20079 20080 The conversion can stop for three reasons: 20081 20082 * A wide character has been encountered that cannot be 20083 represented as a multibyte sequence (according to the 20084 current locale). In this case src is left pointing to the 20085 invalid wide character, (size_t)(-1) is returned, and errno 20086 is set to EILSEQ. 20087 * nws wide characters have been converted without 20088 encountering a null wide character code, or the length 20089 limit forces a stop. In this case, src is left pointing to 20090 the next wide character to be converted, and the number 20091 bytes written to dest is returned. 20092 * The wide-character string has been completely converted, 20093 including the terminating null wide character code (which 20094 has the side effect of bringing back ps to the initial 20095 state). In this case, src is set to NULL, and the number of 20096 bytes written to dest, excluding the terminating null wide 20097 character code, is returned. 20098 20099 If dest is NULL, len is ignored, and the conversion proceeds as 20100 above, except that the converted bytes are not written out to 20101 memory, and that no destination length limit exists. 20102 20103 In both of the above cases, if ps is a NULL pointer, a static 20104 anonymous state only known to wcsnrtombs() is used instead. 20105 20106 The programmer shall ensure that there is room for at least len 20107 bytes at dest. 20108 20109 Return Value 20110 20111 wcsnrtombs() returns the number of bytes that make up the 20112 converted part of multibyte sequence, not including the 20113 terminating null wide character code. If a wide character was 20114 encountered which could not be converted, (size_t)(-1) is 20115 returned, and the global variable errno set to EILSEQ. 20116 20117 Notes 20118 20119 The behavior of wcsnrtombs() depends on the LC_CTYPE category 20120 of the current locale. 20121 20122 Passing NULL as ps is not multi-thread safe. 20123 20124 wcstoq 20125 20126 Name 20127 20128 wcstoq -- convert wide string to long long int representation 20129 20130 Synopsis 20131 20132 #include 20133 20134 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 20135 restrict endptr, int base); 20136 20137 Description 20138 20139 The wcstoq() function shall convert the initial portion of the 20140 wide string nptr to long long int representation. It is 20141 identical to wcstoll(). 20142 20143 Return Value 20144 20145 Refer to wcstoll(). 20146 20147 Errors 20148 20149 Refer to wcstoll(). 20150 20151 wcstouq 20152 20153 Name 20154 20155 wcstouq -- convert wide string to unsigned long long int 20156 representation 20157 20158 Synopsis 20159 20160 #include 20161 20162 unsigned long long wcstouq(const wchar_t * restrict nptr, 20163 wchar_t ** restrict endptr, int base); 20164 20165 Description 20166 20167 The wcstouq() function shall convert the initial portion of the 20168 wide string nptr to unsigned long long int representation. It 20169 is identical to wcstoull(). 20170 20171 Return Value 20172 20173 Refer to wcstoull(). 20174 20175 Errors 20176 20177 Refer to wcstoull(). 20178 20179 wscanf 20180 20181 Name 20182 20183 wscanf -- convert formatted input 20184 20185 Description 20186 20187 The scanf() family of functions shall behave as described in 20188 ISO POSIX (2003), except as noted below. 20189 20190 Differences 20191 20192 The %s, %S and %[ conversion specifiers shall accept an option 20193 length modifier a, which shall cause a memory buffer to be 20194 allocated to hold the string converted. In such a case, the 20195 argument corresponding to the conversion specifier should be a 20196 reference to a pointer value that will receive a pointer to the 20197 allocated buffer. If there is insufficient memory to allocate a 20198 buffer, the function may set errno to ENOMEM and a conversion 20199 error results. 20200 20201 Note: This directly conflicts with the ISO C (1999) usage of 20202 %a as a conversion specifier for hexadecimal float values. 20203 While this conversion specifier should be supported, a 20204 format specifier such as "%aseconds" will have a different 20205 meaning on an LSB conforming system. 20206 20207 xdr_u_int 20208 20209 Name 20210 20211 xdr_u_int -- library routines for external data representation 20212 20213 Synopsis 20214 20215 int xdr_u_int(XDR * xdrs, unsigned int * up); 20216 20217 Description 20218 20219 xdr_u_int() is a filter primitive that translates between C 20220 unsigned integers and their external representations. 20221 20222 Return Value 20223 20224 On success, 1 is returned. On error, 0 is returned. 20225 20226 xdrstdio_create 20227 20228 Name 20229 20230 xdrstdio_create -- library routines for external data 20231 representation 20232 20233 Synopsis 20234 20235 #include 20236 20237 void xdrstdio_create(XDR * xdrs, FILE * file, enum xdr_op op); 20238 20239 Description 20240 20241 The xdrstdio_create() function shall initialize the XDR stream 20242 object referred to by xdrs. The XDR stream data shall be 20243 written to, or read from, the standard I/O stream associated 20244 with file. If the operation op is XDR_ENCODE, encoded data 20245 shall be written to file. If op is XDR_DECODE, encoded data 20246 shall be read from file. If op is XDR_FREE, the XDR stream 20247 object may be used to deallocate storage allocated by a 20248 previous XDR_DECODE. 20249 20250 The associated destroy function shall flush the file I/O 20251 stream, but not close it. 20252 20253 Return Value 20254 20255 None. 20256 __________________________________________________________ 20257 20258 13.6. Interfaces for libm 20259 20260 Table 13-37 defines the library name and shared object name for 20261 the libm library 20262 20263 Table 13-37. libm Definition 20264 Library: libm 20265 SONAME: See archLSB. 20266 20267 The behavior of the interfaces in this library is specified by 20268 the following specifications: 20269 20270 [LSB] This Specification 20271 [SUSv3] ISO POSIX (2003) 20272 [SVID.3] SVID Issue 3 20273 __________________________________________________________ 20274 20275 13.6.1. Math 20276 __________________________________________________________ 20277 20278 13.6.1.1. Interfaces for Math 20279 20280 An LSB conforming implementation shall provide the generic 20281 functions for Math specified in Table 13-38, with the full 20282 mandatory functionality as described in the referenced 20283 underlying specification. 20284 20285 Table 13-38. libm - Math Function Interfaces 20286 __finite [LSB] __finitef [LSB] __finitel [LSB] __fpclassify 20287 [LSB] 20288 __fpclassifyf [LSB] __signbit [LSB] __signbitf [LSB] acos 20289 [SUSv3] 20290 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 20291 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 20292 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 20293 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 20294 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 20295 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 20296 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 20297 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 20298 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 20299 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 20300 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 20301 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 20302 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 20303 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 20304 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 20305 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [LSB] 20306 clog10f [LSB] clog10l [LSB] clogf [SUSv3] clogl [SUSv3] 20307 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 20308 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 20309 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 20310 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 20311 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 20312 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 20313 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 20314 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 20315 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 20316 drem [LSB] dremf [LSB] dreml [LSB] erf [SUSv3] 20317 erfc [SUSv3] erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] 20318 erfl [SUSv3] exp [SUSv3] exp10 [LSB] exp10f [LSB] 20319 exp10l [LSB] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 20320 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 20321 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 20322 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] 20323 fedisableexcept [LSB] 20324 feenableexcept [LSB] fegetenv [SUSv3] fegetexcept [LSB] 20325 fegetexceptflag [SUSv3] 20326 fegetround [SUSv3] feholdexcept [SUSv3] feraiseexcept [SUSv3] 20327 fesetenv [SUSv3] 20328 fesetexceptflag [SUSv3] fesetround [SUSv3] fetestexcept [SUSv3] 20329 feupdateenv [SUSv3] 20330 finite [LSB] finitef [LSB] finitel [LSB] floor [SUSv3] 20331 floorf [SUSv3] floorl [SUSv3] fma [SUSv3] fmaf [SUSv3] 20332 fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] fmaxl [SUSv3] 20333 fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] fmod [SUSv3] 20334 fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] frexpf [SUSv3] 20335 frexpl [SUSv3] gamma [LSB] gammaf [LSB] gammal [LSB] 20336 hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] ilogb [SUSv3] 20337 ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] j0f [LSB] 20338 j0l [LSB] j1 [SUSv3] j1f [LSB] j1l [LSB] 20339 jn [SUSv3] jnf [LSB] jnl [LSB] ldexp [SUSv3] 20340 ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] lgamma_r [LSB] 20341 lgammaf [SUSv3] lgammaf_r [LSB] lgammal [SUSv3] lgammal_r [LSB] 20342 llrint [SUSv3] llrintf [SUSv3] llrintl [SUSv3] llround [SUSv3] 20343 llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] log10 [SUSv3] 20344 log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] log1pf [SUSv3] 20345 log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] log2l [SUSv3] 20346 logb [SUSv3] logbf [SUSv3] logbl [SUSv3] logf [SUSv3] 20347 logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] lrintl [SUSv3] 20348 lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] matherr [SVID.3] 20349 modf [SUSv3] modff [SUSv3] modfl [SUSv3] nan [SUSv3] 20350 nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] nearbyintf [SUSv3] 20351 nearbyintl [SUSv3] nextafter [SUSv3] nextafterf [SUSv3] 20352 nextafterl [SUSv3] 20353 nexttoward [SUSv3] nexttowardf [SUSv3] nexttowardl [SUSv3] pow 20354 [SUSv3] 20355 pow10 [LSB] pow10f [LSB] pow10l [LSB] powf [SUSv3] 20356 powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] remainderl 20357 [SUSv3] 20358 remquo [SUSv3] remquof [SUSv3] remquol [SUSv3] rint [SUSv3] 20359 rintf [SUSv3] rintl [SUSv3] round [SUSv3] roundf [SUSv3] 20360 roundl [SUSv3] scalb [SUSv3] scalbf [LSB] scalbl [LSB] 20361 scalbln [SUSv3] scalblnf [SUSv3] scalblnl [SUSv3] scalbn 20362 [SUSv3] 20363 scalbnf [SUSv3] scalbnl [SUSv3] significand [LSB] significandf 20364 [LSB] 20365 significandl [LSB] sin [SUSv3] sincos [LSB] sincosf [LSB] 20366 sincosl [LSB] sinf [SUSv3] sinh [SUSv3] sinhf [SUSv3] 20367 sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] sqrtf [SUSv3] 20368 sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] tanh [SUSv3] 20369 tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] tgamma [SUSv3] 20370 tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] truncf [SUSv3] 20371 truncl [SUSv3] y0 [SUSv3] y0f [LSB] y0l [LSB] 20372 y1 [SUSv3] y1f [LSB] y1l [LSB] yn [SUSv3] 20373 ynf [LSB] ynl [LSB] 20374 20375 An LSB conforming implementation shall provide the generic 20376 deprecated functions for Math specified in Table 13-39, with 20377 the full mandatory functionality as described in the referenced 20378 underlying specification. 20379 20380 Note: These interfaces are deprecated, and applications 20381 should avoid using them. These interfaces may be withdrawn 20382 in future releases of this specification. 20383 20384 Table 13-39. libm - Math Deprecated Function Interfaces 20385 drem [LSB] dremf [LSB] dreml [LSB] finite [LSB] 20386 finitef [LSB] finitel [LSB] gamma [LSB] gammaf [LSB] 20387 gammal [LSB] matherr [SVID.3] 20388 20389 An LSB conforming implementation shall provide the generic data 20390 interfaces for Math specified in Table 13-40, with the full 20391 mandatory functionality as described in the referenced 20392 underlying specification. 20393 20394 Table 13-40. libm - Math Data Interfaces 20395 signgam [SUSv3] 20396 __________________________________________________________ 20397 20398 13.7. Data Definitions for libm 20399 20400 This section defines global identifiers and their values that 20401 are associated with interfaces contained in libm. These 20402 definitions are organized into groups that correspond to system 20403 headers. This convention is used as a convenience for the 20404 reader, and does not imply the existence of these headers, or 20405 their content. Where an interface is defined as requiring a 20406 particular system header file all of the data definitions for 20407 that system header file presented here shall be in effect. 20408 20409 This section gives data definitions to promote binary 20410 application portability, not to repeat source interface 20411 definitions available elsewhere. System providers and 20412 application developers should use this ABI to supplement - not 20413 to replace - source interface definition specifications. 20414 20415 This specification uses the ISO C (1999) C Language as the 20416 reference programming language, and data definitions are 20417 specified in ISO C format. The C language is used here as a 20418 convenient notation. Using a C language description of these 20419 data objects does not preclude their use by other programming 20420 languages. 20421 __________________________________________________________ 20422 20423 13.7.1. complex.h 20424 20425 #define complex _Complex 20426 20427 extern double cabs(double complex); 20428 extern float cabsf(float complex); 20429 extern long double cabsl(long double complex); 20430 extern double complex cacos(double complex); 20431 extern float complex cacosf(float complex); 20432 extern double complex cacosh(double complex); 20433 extern float complex cacoshf(float complex); 20434 extern long double complex cacoshl(long double complex); 20435 extern long double complex cacosl(long double complex); 20436 extern double carg(double complex); 20437 extern float cargf(float complex); 20438 extern long double cargl(long double complex); 20439 extern double complex casin(double complex); 20440 extern float complex casinf(float complex); 20441 extern double complex casinh(double complex); 20442 extern float complex casinhf(float complex); 20443 extern long double complex casinhl(long double complex); 20444 extern long double complex casinl(long double complex); 20445 extern double complex catan(double complex); 20446 extern float complex catanf(float complex); 20447 extern double complex catanh(double complex); 20448 extern float complex catanhf(float complex); 20449 extern long double complex catanhl(long double complex); 20450 extern long double complex catanl(long double complex); 20451 extern double complex ccos(double complex); 20452 extern float complex ccosf(float complex); 20453 extern double complex ccosh(double complex); 20454 extern float complex ccoshf(float complex); 20455 extern long double complex ccoshl(long double complex); 20456 extern long double complex ccosl(long double complex); 20457 extern double complex cexp(double complex); 20458 extern float complex cexpf(float complex); 20459 extern long double complex cexpl(long double complex); 20460 extern double cimag(double complex); 20461 extern float cimagf(float complex); 20462 extern long double cimagl(long double complex); 20463 extern double complex clog(double complex); 20464 extern double complex clog10(double complex); 20465 extern float complex clog10f(float complex); 20466 extern long double complex clog10l(long double complex); 20467 extern float complex clogf(float complex); 20468 extern long double complex clogl(long double complex); 20469 extern double complex conj(double complex); 20470 extern float complex conjf(float complex); 20471 extern long double complex conjl(long double complex); 20472 extern double complex cpow(double complex, double complex); 20473 extern float complex cpowf(float complex, float complex); 20474 extern long double complex cpowl(long double complex, long double complex); 20475 extern double complex cproj(double complex); 20476 extern float complex cprojf(float complex); 20477 extern long double complex cprojl(long double complex); 20478 extern double creal(double complex); 20479 extern float crealf(float complex); 20480 extern long double creall(long double complex); 20481 extern double complex csin(double complex); 20482 extern float complex csinf(float complex); 20483 extern double complex csinh(double complex); 20484 extern float complex csinhf(float complex); 20485 extern long double complex csinhl(long double complex); 20486 extern long double complex csinl(long double complex); 20487 extern double complex csqrt(double complex); 20488 extern float complex csqrtf(float complex); 20489 extern long double complex csqrtl(long double complex); 20490 extern double complex ctan(double complex); 20491 extern float complex ctanf(float complex); 20492 extern double complex ctanh(double complex); 20493 extern float complex ctanhf(float complex); 20494 extern long double complex ctanhl(long double complex); 20495 extern long double complex ctanl(long double complex); 20496 __________________________________________________________ 20497 20498 13.7.2. fenv.h 20499 20500 extern int feclearexcept(int __excepts); 20501 extern int fedisableexcept(int __excepts); 20502 extern int feenableexcept(int __excepts); 20503 extern int fegetenv(fenv_t * __envp); 20504 extern int fegetexcept(void); 20505 extern int fegetexceptflag(fexcept_t * __flagp, int __excepts); 20506 extern int fegetround(void); 20507 extern int feholdexcept(fenv_t * __envp); 20508 extern int feraiseexcept(int __excepts); 20509 extern int fesetenv(const fenv_t * __envp); 20510 extern int fesetexceptflag(const fexcept_t * __flagp, int __excepts); 20511 extern int fesetround(int __rounding_direction); 20512 extern int fetestexcept(int __excepts); 20513 extern int feupdateenv(const fenv_t * __envp); 20514 __________________________________________________________ 20515 20516 13.7.3. math.h 20517 20518 #define DOMAIN 1 20519 #define SING 2 20520 20521 #define FP_NAN 0 20522 #define FP_INFINITE 1 20523 #define FP_ZERO 2 20524 #define FP_SUBNORMAL 3 20525 #define FP_NORMAL 4 20526 20527 #define isnormal(x) (fpclassify (x) == FP_NORMAL) /* Return nonzero value if X is neither zero, subnormal, Inf, n */ 20528 20529 #define HUGE_VAL 0x1.0p2047 20530 #define HUGE_VALF 0x1.0p255f 20531 20532 #define NAN ((float)0x7fc00000UL) 20533 #define M_1_PI 0.31830988618379067154 20534 #define M_LOG10E 0.43429448190325182765 20535 #define M_2_PI 0.63661977236758134308 20536 #define M_LN2 0.69314718055994530942 20537 #define M_SQRT1_2 0.70710678118654752440 20538 #define M_PI_4 0.78539816339744830962 20539 #define M_2_SQRTPI 1.12837916709551257390 20540 #define M_SQRT2 1.41421356237309504880 20541 #define M_LOG2E 1.4426950408889634074 20542 #define M_PI_2 1.57079632679489661923 20543 #define M_LN10 2.30258509299404568402 20544 #define M_E 2.7182818284590452354 20545 #define M_PI 3.14159265358979323846 20546 #define INFINITY HUGE_VALF 20547 20548 #define MATH_ERRNO 1 /* errno set by math functions. */ 20549 #define MATH_ERREXCEPT 2 /* Exceptions raised by math functions.*/ 20550 20551 #define isunordered(u, v) \ 20552 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))/* Return nonzero value if arguments are unordered. */ 20553 #define islessgreater(x, y) \ 20554 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) /* Return nonzero value if either X is less than Y or Y is less */ 20555 #define isless(x,y) \ 20556 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) /* Return nonzero valueif X is less than Y. */ 20557 #define islessequal(x, y) \ 20558 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) /* Return nonzero valueif X is less than or equal to Y. */ 20559 #define isgreater(x,y) \ 20560 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) /* Return nonzero valueif X is greater than Y. */ 20561 #define isgreaterequal(x,y) \ 20562 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) /* Return nonzero valueif X is greater than or equal to Y. */ 20563 20564 extern int __finite(double); 20565 extern int __finitef(float); 20566 extern int __finitel(long double); 20567 extern int __fpclassify(double); 20568 extern int __fpclassifyf(float); 20569 extern int __isinf(double); 20570 extern int __isinff(float); 20571 extern int __isinfl(long double); 20572 extern int __isnan(double); 20573 extern int __isnanf(float); 20574 extern int __isnanl(long double); 20575 extern int __signbit(double); 20576 extern int __signbitf(float); 20577 extern double acos(double); 20578 extern float acosf(float); 20579 extern double acosh(double); 20580 extern float acoshf(float); 20581 extern long double acoshl(long double); 20582 extern long double acosl(long double); 20583 extern double asin(double); 20584 extern float asinf(float); 20585 extern double asinh(double); 20586 extern float asinhf(float); 20587 extern long double asinhl(long double); 20588 extern long double asinl(long double); 20589 extern double atan(double); 20590 extern double atan2(double, double); 20591 extern float atan2f(float, float); 20592 extern long double atan2l(long double, long double); 20593 extern float atanf(float); 20594 extern double atanh(double); 20595 extern float atanhf(float); 20596 extern long double atanhl(long double); 20597 extern long double atanl(long double); 20598 extern double cbrt(double); 20599 extern float cbrtf(float); 20600 extern long double cbrtl(long double); 20601 extern double ceil(double); 20602 extern float ceilf(float); 20603 extern long double ceill(long double); 20604 extern double copysign(double, double); 20605 extern float copysignf(float, float); 20606 extern long double copysignl(long double, long double); 20607 extern double cos(double); 20608 extern float cosf(float); 20609 extern double cosh(double); 20610 extern float coshf(float); 20611 extern long double coshl(long double); 20612 extern long double cosl(long double); 20613 extern double drem(double, double); 20614 extern float dremf(float, float); 20615 extern long double dreml(long double, long double); 20616 extern double erf(double); 20617 extern double erfc(double); 20618 extern float erfcf(float); 20619 extern long double erfcl(long double); 20620 extern float erff(float); 20621 extern long double erfl(long double); 20622 extern double exp(double); 20623 extern double exp10(double); 20624 extern float exp10f(float); 20625 extern long double exp10l(long double); 20626 extern double exp2(double); 20627 extern float exp2f(float); 20628 extern float expf(float); 20629 extern long double expl(long double); 20630 extern double expm1(double); 20631 extern float expm1f(float); 20632 extern long double expm1l(long double); 20633 extern double fabs(double); 20634 extern float fabsf(float); 20635 extern long double fabsl(long double); 20636 extern double fdim(double, double); 20637 extern float fdimf(float, float); 20638 extern long double fdiml(long double, long double); 20639 extern int finite(double); 20640 extern int finitef(float); 20641 extern int finitel(long double); 20642 extern double floor(double); 20643 extern float floorf(float); 20644 extern long double floorl(long double); 20645 extern double fma(double, double, double); 20646 extern float fmaf(float, float, float); 20647 extern long double fmal(long double, long double, long double); 20648 extern double fmax(double, double); 20649 extern float fmaxf(float, float); 20650 extern long double fmaxl(long double, long double); 20651 extern double fmin(double, double); 20652 extern float fminf(float, float); 20653 extern long double fminl(long double, long double); 20654 extern double fmod(double, double); 20655 extern float fmodf(float, float); 20656 extern long double fmodl(long double, long double); 20657 extern double frexp(double, int *); 20658 extern float frexpf(float, int *); 20659 extern long double frexpl(long double, int *); 20660 extern double gamma(double); 20661 extern float gammaf(float); 20662 extern long double gammal(long double); 20663 extern double hypot(double, double); 20664 extern float hypotf(float, float); 20665 extern long double hypotl(long double, long double); 20666 extern int ilogb(double); 20667 extern int ilogbf(float); 20668 extern int ilogbl(long double); 20669 extern double j0(double); 20670 extern float j0f(float); 20671 extern long double j0l(long double); 20672 extern double j1(double); 20673 extern float j1f(float); 20674 extern long double j1l(long double); 20675 extern double jn(int, double); 20676 extern float jnf(int, float); 20677 extern long double jnl(int, long double); 20678 extern double ldexp(double, int); 20679 extern float ldexpf(float, int); 20680 extern long double ldexpl(long double, int); 20681 extern double lgamma(double); 20682 extern double lgamma_r(double, int *); 20683 extern float lgammaf(float); 20684 extern float lgammaf_r(float, int *); 20685 extern long double lgammal(long double); 20686 extern long double lgammal_r(long double, int *); 20687 extern long long int llrint(double); 20688 extern long long int llrintf(float); 20689 extern long long int llrintl(long double); 20690 extern long long int llround(double); 20691 extern long long int llroundf(float); 20692 extern long long int llroundl(long double); 20693 extern double log(double); 20694 extern double log10(double); 20695 extern float log10f(float); 20696 extern long double log10l(long double); 20697 extern double log1p(double); 20698 extern float log1pf(float); 20699 extern long double log1pl(long double); 20700 extern double log2(double); 20701 extern float log2f(float); 20702 extern long double log2l(long double); 20703 extern double logb(double); 20704 extern float logbf(float); 20705 extern long double logbl(long double); 20706 extern float logf(float); 20707 extern long double logl(long double); 20708 extern long int lrint(double); 20709 extern long int lrintf(float); 20710 extern long int lrintl(long double); 20711 extern long int lround(double); 20712 extern long int lroundf(float); 20713 extern long int lroundl(long double); 20714 extern double modf(double, double *); 20715 extern float modff(float, float *); 20716 extern long double modfl(long double, long double *); 20717 extern double nan(const char *); 20718 extern float nanf(const char *); 20719 extern long double nanl(const char *); 20720 extern double nearbyint(double); 20721 extern float nearbyintf(float); 20722 extern long double nearbyintl(long double); 20723 extern double nextafter(double, double); 20724 extern float nextafterf(float, float); 20725 extern long double nextafterl(long double, long double); 20726 extern double nexttoward(double, long double); 20727 extern float nexttowardf(float, long double); 20728 extern long double nexttowardl(long double, long double); 20729 extern double pow(double, double); 20730 extern double pow10(double); 20731 extern float pow10f(float); 20732 extern long double pow10l(long double); 20733 extern float powf(float, float); 20734 extern long double powl(long double, long double); 20735 extern double remainder(double, double); 20736 extern float remainderf(float, float); 20737 extern long double remainderl(long double, long double); 20738 extern double remquo(double, double, int *); 20739 extern float remquof(float, float, int *); 20740 extern long double remquol(long double, long double, int *); 20741 extern double rint(double); 20742 extern float rintf(float); 20743 extern long double rintl(long double); 20744 extern double round(double); 20745 extern float roundf(float); 20746 extern long double roundl(long double); 20747 extern double scalb(double, double); 20748 extern float scalbf(float, float); 20749 extern long double scalbl(long double, long double); 20750 extern double scalbln(double, long int); 20751 extern float scalblnf(float, long int); 20752 extern long double scalblnl(long double, long int); 20753 extern double scalbn(double, int); 20754 extern float scalbnf(float, int); 20755 extern long double scalbnl(long double, int); 20756 extern int signgam; 20757 extern double significand(double); 20758 extern float significandf(float); 20759 extern long double significandl(long double); 20760 extern double sin(double); 20761 extern void sincos(double, double *, double *); 20762 extern void sincosf(float, float *, float *); 20763 extern void sincosl(long double, long double *, long double *); 20764 extern float sinf(float); 20765 extern double sinh(double); 20766 extern float sinhf(float); 20767 extern long double sinhl(long double); 20768 extern long double sinl(long double); 20769 extern double sqrt(double); 20770 extern float sqrtf(float); 20771 extern long double sqrtl(long double); 20772 extern double tan(double); 20773 extern float tanf(float); 20774 extern double tanh(double); 20775 extern float tanhf(float); 20776 extern long double tanhl(long double); 20777 extern long double tanl(long double); 20778 extern double tgamma(double); 20779 extern float tgammaf(float); 20780 extern long double tgammal(long double); 20781 extern double trunc(double); 20782 extern float truncf(float); 20783 extern long double truncl(long double); 20784 extern double y0(double); 20785 extern float y0f(float); 20786 extern long double y0l(long double); 20787 extern double y1(double); 20788 extern float y1f(float); 20789 extern long double y1l(long double); 20790 extern double yn(int, double); 20791 extern float ynf(int, float); 20792 extern long double ynl(int, long double); 20793 __________________________________________________________ 20794 20795 13.8. Interface Definitions for libm 20796 20797 Table of Contents 20798 __finite -- test for infinity 20799 __finitef -- test for infinity 20800 __finitel -- test for infinity 20801 __fpclassify -- Classify real floating type 20802 __fpclassifyf -- Classify real floating type 20803 __signbit -- test sign of floating point value 20804 __signbitf -- test sign of floating point value 20805 clog10 -- Logarithm of a Complex Number 20806 clog10f -- Logarithm of a Complex Number 20807 clog10l -- Logarithm of a Complex Number 20808 drem -- Floating Point Remainder (DEPRECATED) 20809 dremf -- Floating Point Remainder (DEPRECATED) 20810 dreml -- Floating Point Remainder (DEPRECATED) 20811 exp10 -- Base-10 power function 20812 exp10f -- Base-10 power function 20813 exp10l -- Base-10 power function 20814 fedisableexcept -- disable floating point exceptions 20815 feenableexcept -- enable floating point exceptions 20816 fegetexcept -- query floating point exception handling state 20817 finite -- test for infinity (DEPRECATED) 20818 finitef -- test for infinity (DEPRECATED) 20819 finitel -- test for infinity (DEPRECATED) 20820 gamma -- log gamma function (DEPRECATED) 20821 gammaf -- log gamma function (DEPRECATED) 20822 gammal -- log gamma function (DEPRECATED) 20823 j0f -- Bessel functions 20824 j0l -- Bessel functions 20825 j1f -- Bessel functions 20826 j1l -- Bessel functions 20827 jnf -- Bessel functions 20828 jnl -- Bessel functions 20829 lgamma_r -- log gamma functions 20830 lgammaf_r -- log gamma functions 20831 lgammal_r -- log gamma functions 20832 pow10 -- Base-10 power function 20833 pow10f -- Base-10 power function 20834 pow10l -- Base-10 power function 20835 scalbf -- load exponent of radix-independent floating point 20836 number 20837 20838 scalbl -- load exponent of radix-independent floating point 20839 number 20840 20841 significand -- floating point mantissa 20842 significandf -- floating point mantissa 20843 significandl -- floating point mantissa 20844 sincos -- trigonometric functions 20845 sincosf -- trigonometric functions 20846 sincosl -- trigonometric functions 20847 y0f -- Bessel functions 20848 y0l -- Bessel functions 20849 y1f -- Bessel functions 20850 y1l -- Bessel functions 20851 ynf -- Bessel functions 20852 ynl -- Bessel functions 20853 20854 The interfaces defined on the following pages are included in 20855 libm and are defined by this specification. Unless otherwise 20856 noted, these interfaces shall be included in the source 20857 standard. 20858 20859 Other interfaces listed in Section 13.6 shall behave as 20860 described in the referenced base document. 20861 20862 __finite 20863 20864 Name 20865 20866 __finite -- test for infinity 20867 20868 Synopsis 20869 20870 #include 20871 20872 int __finite(double arg); 20873 20874 Description 20875 20876 __finite() has the same specification as isfinite() in ISO 20877 POSIX (2003), except that the argument type for __finite() is 20878 known to be double. 20879 20880 __finite() is not in the source standard; it is only in the 20881 binary standard. 20882 20883 __finitef 20884 20885 Name 20886 20887 __finitef -- test for infinity 20888 20889 Synopsis 20890 20891 #include 20892 20893 int __finitef(float arg); 20894 20895 Description 20896 20897 __finitef() has the same specification as isfinite() in ISO 20898 POSIX (2003) except that the argument type for __finitef() is 20899 known to be float. 20900 20901 __finitef() is not in the source standard; it is only in the 20902 binary standard. 20903 20904 __finitel 20905 20906 Name 20907 20908 __finitel -- test for infinity 20909 20910 Synopsis 20911 20912 #include 20913 20914 int __finitel(long double arg); 20915 20916 Description 20917 20918 __finitel() has the same specification as isfinite() in the ISO 20919 POSIX (2003), except that the argument type for __finitel() is 20920 known to be long double. 20921 20922 __finitel() is not in the source standard; it is only in the 20923 binary standard. 20924 20925 __fpclassify 20926 20927 Name 20928 20929 __fpclassify -- Classify real floating type 20930 20931 Synopsis 20932 20933 int __fpclassify(double arg); 20934 20935 Description 20936 20937 __fpclassify() has the same specification as fpclassify() in 20938 ISO POSIX (2003), except that the argument type for 20939 __fpclassify() is known to be double. 20940 20941 __fpclassify() is not in the source standard; it is only in the 20942 binary standard. 20943 20944 __fpclassifyf 20945 20946 Name 20947 20948 __fpclassifyf -- Classify real floating type 20949 20950 Synopsis 20951 20952 int __fpclassifyf(float arg); 20953 20954 Description 20955 20956 __fpclassifyf() has the same specification as fpclassify() in 20957 ISO POSIX (2003), except that the argument type for 20958 __fpclassifyf() is known to be float. 20959 20960 __fpclassifyf() is not in the source standard; it is only in 20961 the binary standard. 20962 20963 __signbit 20964 20965 Name 20966 20967 __signbit -- test sign of floating point value 20968 20969 Synopsis 20970 20971 #include 20972 20973 int __signbit(double arg); 20974 20975 Description 20976 20977 __signbit() has the same specification as signbit() in ISO 20978 POSIX (2003), except that the argument type for __signbit() is 20979 known to be double. 20980 20981 __signbit() is not in the source standard; it is only in the 20982 binary standard. 20983 20984 __signbitf 20985 20986 Name 20987 20988 __signbitf -- test sign of floating point value 20989 20990 Synopsis 20991 20992 #include 20993 20994 int __signbitf(float arg); 20995 20996 Description 20997 20998 __signbitf() has the same specification as signbit() in ISO 20999 POSIX (2003), except that the argument type for __signbitf() is 21000 known to be float. 21001 21002 __signbitf() is not in the source standard; it is only in the 21003 binary standard. 21004 21005 clog10 21006 21007 Name 21008 21009 clog10 -- Logarithm of a Complex Number 21010 21011 Synopsis 21012 21013 #include 21014 21015 double complex clog10(double complex z); 21016 21017 Description 21018 21019 The clog10() function shall compute the base 10 logarithm of 21020 the complex number z. 21021 21022 Return Value 21023 21024 The clog10() function shall return the base 10 logarithm. 21025 21026 clog10f 21027 21028 Name 21029 21030 clog10f -- Logarithm of a Complex Number 21031 21032 Synopsis 21033 21034 #include 21035 21036 float complex clog10f(float complex z); 21037 21038 Description 21039 21040 The clog10f() function shall compute the base 10 logarithm of 21041 the complex number z. 21042 21043 Return Value 21044 21045 The clog10f() function shall return the base 10 logarithm. 21046 21047 clog10l 21048 21049 Name 21050 21051 clog10l -- Logarithm of a Complex Number 21052 21053 Synopsis 21054 21055 #include 21056 21057 long double complex clog10l(long double complex z); 21058 21059 Description 21060 21061 The clog10l() function shall compute the base 10 logarithm of 21062 the complex number z. 21063 21064 Return Value 21065 21066 The clog10l() function shall return the base 10 logarithm. 21067 21068 drem 21069 21070 Name 21071 21072 drem -- Floating Point Remainder (DEPRECATED) 21073 21074 Synopsis 21075 21076 #include 21077 21078 double drem(double x, double y); 21079 21080 Description 21081 21082 The drem() function shall return the floating point remainder, 21083 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 21084 same way as remainder(). 21085 21086 Note: This function is included only for backwards 21087 compatibility; applications should use remainder() instead. 21088 21089 Returns 21090 21091 See remainder(). 21092 21093 See Also 21094 21095 remainder(), dremf(), dreml() 21096 21097 dremf 21098 21099 Name 21100 21101 dremf -- Floating Point Remainder (DEPRECATED) 21102 21103 Synopsis 21104 21105 #include 21106 21107 double dremf(double x, double y); 21108 21109 Description 21110 21111 The dremf() function shall return the floating point remainder, 21112 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 21113 same way as remainderf(). 21114 21115 Note: This function is included only for backwards 21116 compatibility; applications should use remainderf() instead. 21117 21118 Returns 21119 21120 See remainderf(). 21121 21122 See Also 21123 21124 remainderf(), drem(), dreml() 21125 21126 dreml 21127 21128 Name 21129 21130 dreml -- Floating Point Remainder (DEPRECATED) 21131 21132 Synopsis 21133 21134 #include 21135 21136 double dreml(double x, double y); 21137 21138 Description 21139 21140 The dreml() function shall return the floating point remainder, 21141 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 21142 same way as remainderl(). 21143 21144 Note: This function is included only for backwards 21145 compatibility; applications should use remainderl() instead. 21146 21147 Returns 21148 21149 See remainderl(). 21150 21151 See Also 21152 21153 remainderl(), drem(), dremf() 21154 21155 exp10 21156 21157 Name 21158 21159 exp10 -- Base-10 power function 21160 21161 Synopsis 21162 21163 #include 21164 21165 double exp10(double x); 21166 21167 Description 21168 21169 The exp10() function shall return 10^x. 21170 21171 Note: This function is identical to pow10(). 21172 21173 Returns 21174 21175 Upon successful completion, exp10() shall return 10 rised to 21176 the power of x. 21177 21178 If the correct value would cause overflow, a range error shall 21179 occur and exp10() shall return ±HUGE_VAL, with the same sign as 21180 the correct value of the function. 21181 21182 See Also 21183 21184 pow10(), exp10f(), exp10l() 21185 21186 exp10f 21187 21188 Name 21189 21190 exp10f -- Base-10 power function 21191 21192 Synopsis 21193 21194 #include 21195 21196 float exp10f(float x); 21197 21198 Description 21199 21200 The exp10f() function shall return 10^x. 21201 21202 Note: This function is identical to pow10f(). 21203 21204 Returns 21205 21206 Upon successful completion, exp10f() shall return 10 rised to 21207 the power of x. 21208 21209 If the correct value would cause overflow, a range error shall 21210 occur and exp10f() shall return ±HUGE_VALF, with the same sign 21211 as the correct value of the function. 21212 21213 See Also 21214 21215 pow10f(), exp10(), exp10l() 21216 21217 exp10l 21218 21219 Name 21220 21221 exp10l -- Base-10 power function 21222 21223 Synopsis 21224 21225 #include 21226 21227 long double exp10l(long double x); 21228 21229 Description 21230 21231 The exp10l() function shall return 10^x. 21232 21233 Note: This function is identical to pow10l(). 21234 21235 Returns 21236 21237 Upon successful completion, exp10l() shall return 10 rised to 21238 the power of x. 21239 21240 If the correct value would cause overflow, a range error shall 21241 occur and exp10l() shall return ±HUGE_VALL, with the same sign 21242 as the correct value of the function. 21243 21244 See Also 21245 21246 pow10l(), exp10(), exp10f() 21247 21248 fedisableexcept 21249 21250 Name 21251 21252 fedisableexcept -- disable floating point exceptions 21253 21254 Synopsis 21255 21256 #include 21257 21258 int fedisableexcept(int excepts); 21259 21260 Description 21261 21262 The fedisableexcept() function disables traps for each of the 21263 exceptions represented by the mask excepts. 21264 21265 Return Value 21266 21267 The fedisableexcept() function returns the previous set of 21268 enabled exceptions on success. On error, -1 is returned. 21269 21270 Errors 21271 21272 No errors are defined, but the function will fail if not 21273 supported on the architecture. 21274 21275 feenableexcept 21276 21277 Name 21278 21279 feenableexcept -- enable floating point exceptions 21280 21281 Synopsis 21282 21283 #include 21284 21285 int feenableexcept(int excepts); 21286 21287 Description 21288 21289 The feenableexcept() function enables traps for each of the 21290 exceptions represented by the mask excepts. 21291 21292 Return Value 21293 21294 The feenableexcept() function returns the previous set of 21295 enabled exceptions on success. On error, -1 is returned. 21296 21297 Errors 21298 21299 No errors are defined, but the function will fail if not 21300 supported on the architecture. 21301 21302 fegetexcept 21303 21304 Name 21305 21306 fegetexcept -- query floating point exception handling state 21307 21308 Synopsis 21309 21310 #include 21311 21312 int fegetexcept 21313 21314 Description 21315 21316 The fegetexcept() function returns the set of all currently 21317 enabled exceptions. 21318 21319 Return Value 21320 21321 The fegetexcept() function returns the set of all currently 21322 enabled exceptions. 21323 21324 Errors 21325 21326 No errors are defined, but the function will fail if not 21327 supported on the architecture. 21328 21329 finite 21330 21331 Name 21332 21333 finite -- test for infinity (DEPRECATED) 21334 21335 Synopsis 21336 21337 #define _SVID_SOURCE 21338 #include 21339 21340 int finite(double arg); 21341 21342 Description 21343 21344 The finite() function shall test whether its argument is 21345 neither INFINITY nor not a number (NaN). 21346 21347 Returns 21348 21349 On success, finite() shall return 1. Otherwise the function 21350 shall return 0. 21351 21352 Note: The ISO C (1999) standard defines the function 21353 isfinite(), which is more general purpose. The finite() 21354 function is deprecated, and applications should use 21355 isfinite() instead. A future revision of this standard may 21356 remove this function. 21357 21358 See Also 21359 21360 isfinite(), finitef(), finitel() 21361 21362 finitef 21363 21364 Name 21365 21366 finitef -- test for infinity (DEPRECATED) 21367 21368 Synopsis 21369 21370 #define _SVID_SOURCE 21371 #include 21372 21373 int finitef(float arg); 21374 21375 Description 21376 21377 The finitef() function shall test whether its argument is 21378 neither INFINITY nor not a number (NaN). 21379 21380 Returns 21381 21382 On success, finitef() shall return 1. Otherwise the function 21383 shall return 0. 21384 21385 Note: The ISO C (1999) standard defines the function 21386 isfinite(), which is more general purpose. The finitef() 21387 function is deprecated, and applications should use 21388 isfinite() instead. A future revision of this standard may 21389 remove this function. 21390 21391 See Also 21392 21393 isfinite(), finite(), finitel() 21394 21395 finitel 21396 21397 Name 21398 21399 finitel -- test for infinity (DEPRECATED) 21400 21401 Synopsis 21402 21403 #define _SVID_SOURCE 21404 #include 21405 21406 int finitel(long double arg); 21407 21408 Description 21409 21410 The finitel() function shall test whether its argument is 21411 neither INFINITY nor not a number (NaN). 21412 21413 Returns 21414 21415 On success, finitel() shall return 1. Otherwise the function 21416 shall return 0. 21417 21418 Note: The ISO C (1999) standard defines the function 21419 isfinite(), which is more general purpose. The finitel() 21420 function is deprecated, and applications should use 21421 isfinite() instead. A future revision of this standard may 21422 remove this function. 21423 21424 See Also 21425 21426 isfinite(), finite(), finitef() 21427 21428 gamma 21429 21430 Name 21431 21432 gamma -- log gamma function (DEPRECATED) 21433 21434 Synopsis 21435 21436 #include 21437 21438 double gammaf(double x); 21439 21440 Description 21441 21442 The gamma() function is identical to lgamma() in ISO POSIX 21443 (2003). 21444 21445 Note: The name gamma() for this function is deprecated and 21446 should not be used. 21447 21448 Returns 21449 21450 See lgamma(). 21451 21452 See Also 21453 21454 lgamma(), lgammaf(), lgammal(), gammaf(), gammal() 21455 21456 gammaf 21457 21458 Name 21459 21460 gammaf -- log gamma function (DEPRECATED) 21461 21462 Synopsis 21463 21464 #include 21465 21466 float gammaf(float x); 21467 21468 Description 21469 21470 The gammaf() function is identical to lgammaf() in ISO POSIX 21471 (2003). 21472 21473 Note: The name gammaf() for this function is deprecated and 21474 should not be used. 21475 21476 Returns 21477 21478 See lgammaf(). 21479 21480 See Also 21481 21482 lgamma(), lgammaf(), lgammal(), gamma(), gammal() 21483 21484 gammal 21485 21486 Name 21487 21488 gammal -- log gamma function (DEPRECATED) 21489 21490 Synopsis 21491 21492 #include 21493 21494 long double gammal(long double x); 21495 21496 Description 21497 21498 The gammal() function is identical to lgammal() in ISO POSIX 21499 (2003). 21500 21501 Note: The name gammal() for this function is deprecated and 21502 should not be used. 21503 21504 Returns 21505 21506 See lgammal(). 21507 21508 See Also 21509 21510 lgamma(), lgammaf(), lgammal(), gamma(), gammaf() 21511 21512 j0f 21513 21514 Name 21515 21516 j0f -- Bessel functions 21517 21518 Synopsis 21519 21520 #include 21521 21522 float j0f(float x); 21523 21524 Description 21525 21526 The j0f() function is identical to j0(), except that the 21527 argument x and the return value is a float. 21528 21529 Returns 21530 21531 See j0(). 21532 21533 See Also 21534 21535 j0(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 21536 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21537 21538 j0l 21539 21540 Name 21541 21542 j0l -- Bessel functions 21543 21544 Synopsis 21545 21546 #include 21547 21548 long double j0l(long double x); 21549 21550 Description 21551 21552 The j0l() function is identical to j0(), except that the 21553 argument x and the return value is a long double. 21554 21555 Returns 21556 21557 See j0(). 21558 21559 See Also 21560 21561 j0(), j0f(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 21562 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21563 21564 j1f 21565 21566 Name 21567 21568 j1f -- Bessel functions 21569 21570 Synopsis 21571 21572 #include 21573 21574 float j1f(float x); 21575 21576 Description 21577 21578 The j1f() function is identical to j1(), except that the 21579 argument x and the return value is a float. 21580 21581 Returns 21582 21583 See j1(). 21584 21585 See Also 21586 21587 j0(), j0f(), j0l(), j1(), j1l(), jn(), jnf(), jnl(), y0(), 21588 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21589 21590 j1l 21591 21592 Name 21593 21594 j1l -- Bessel functions 21595 21596 Synopsis 21597 21598 #include 21599 21600 long double j1l(long double x); 21601 21602 Description 21603 21604 The j1l() function is identical to j1(), except that the 21605 argument x and the return value is a long double. 21606 21607 Returns 21608 21609 See j0(). 21610 21611 See Also 21612 21613 j0(), j0f(), j0l(), j1(), j1f(), jn(), jnf(), jnl(), y0(), 21614 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21615 21616 jnf 21617 21618 Name 21619 21620 jnf -- Bessel functions 21621 21622 Synopsis 21623 21624 #include 21625 21626 float jnf(float x); 21627 21628 Description 21629 21630 The jnf() function is identical to jn(), except that the 21631 argument x and the return value is a float. 21632 21633 Returns 21634 21635 See jn(). 21636 21637 See Also 21638 21639 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnl(), y0(), 21640 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21641 21642 jnl 21643 21644 Name 21645 21646 jnl -- Bessel functions 21647 21648 Synopsis 21649 21650 #include 21651 21652 long double jnl(long double x); 21653 21654 Description 21655 21656 The jnl() function is identical to jn(), except that the 21657 argument x and the return value is a long double. 21658 21659 Returns 21660 21661 See jn(). 21662 21663 See Also 21664 21665 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), y0(), 21666 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 21667 21668 lgamma_r 21669 21670 Name 21671 21672 lgamma_r -- log gamma functions 21673 21674 Synopsis 21675 21676 #include 21677 21678 double lgamma_r(double x, int * signp); 21679 21680 Description 21681 21682 The lgamma_r() function shall compute the natural logarithm of 21683 the absolute value of the Gamma function, as lgamma(). However, 21684 instead of setting the external integer signgam to the sign of 21685 the Gamma function, lgamma_r() shall set the integer referenced 21686 by signp to the sign. 21687 21688 Returns 21689 21690 See lgamma() and signgam. 21691 21692 See Also 21693 21694 lgamma(), lgammaf_r(), lgammal_r(), signgam 21695 21696 lgammaf_r 21697 21698 Name 21699 21700 lgammaf_r -- log gamma functions 21701 21702 Synopsis 21703 21704 #include 21705 21706 float lgammaf_r(float x, int * signp); 21707 21708 Description 21709 21710 The lgammaf_r() function shall compute the natural logarithm of 21711 the absolute value of the Gamma function, as lgammaf(). 21712 However, instead of setting the external integer signgam to the 21713 sign of the Gamma function, lgammaf_r() shall set the integer 21714 referenced by signp to the sign. 21715 21716 Returns 21717 21718 See lgammaf() and signgam. 21719 21720 See Also 21721 21722 lgamma(), lgamma_r(), lgammal_r(), signgam 21723 21724 lgammal_r 21725 21726 Name 21727 21728 lgammal_r -- log gamma functions 21729 21730 Synopsis 21731 21732 #include 21733 21734 double lgammal_r(double x, int * signp); 21735 21736 Description 21737 21738 The lgammal_r() function shall compute the natural logarithm of 21739 the absolute value of the Gamma function, as lgammal(). 21740 However, instead of setting the external integer signgam to the 21741 sign of the Gamma function, lgammal_r() shall set the integer 21742 referenced by signp to the sign. 21743 21744 Returns 21745 21746 See lgammal() and signgam. 21747 21748 See Also 21749 21750 lgamma(), lgamma_r(), lgammaf_r(), signgam 21751 21752 pow10 21753 21754 Name 21755 21756 pow10 -- Base-10 power function 21757 21758 Synopsis 21759 21760 #include 21761 21762 double pow10(double x); 21763 21764 Description 21765 21766 The pow10() function shall return 10^x. 21767 21768 Note: This function is identical to exp10(). 21769 21770 Returns 21771 21772 Upon successful completion, pow10() shall return 10 rised to 21773 the power of x. 21774 21775 If the correct value would cause overflow, a range error shall 21776 occur and pow10() shall return ±HUGE_VAL, with the same sign as 21777 the correct value of the function. 21778 21779 See Also 21780 21781 exp10(), pow10f(), pow10l() 21782 21783 pow10f 21784 21785 Name 21786 21787 pow10f -- Base-10 power function 21788 21789 Synopsis 21790 21791 #include 21792 21793 float pow10f(float x); 21794 21795 Description 21796 21797 The pow10f() function shall return 10^x. 21798 21799 Note: This function is identical to exp10f(). 21800 21801 Returns 21802 21803 Upon successful completion, pow10f() shall return 10 rised to 21804 the power of x. 21805 21806 If the correct value would cause overflow, a range error shall 21807 occur and pow10f() shall return ±HUGE_VALF, with the same sign 21808 as the correct value of the function. 21809 21810 See Also 21811 21812 exp10f(), pow10(), pow10l() 21813 21814 pow10l 21815 21816 Name 21817 21818 pow10l -- Base-10 power function 21819 21820 Synopsis 21821 21822 #include 21823 21824 long double pow10l(long double x); 21825 21826 Description 21827 21828 The pow10l() function shall return 10^x. 21829 21830 Note: This function is identical to exp10l(). 21831 21832 Returns 21833 21834 Upon successful completion, pow10l() shall return 10 rised to 21835 the power of x. 21836 21837 If the correct value would cause overflow, a range error shall 21838 occur and pow10l() shall return ±HUGE_VALL, with the same sign 21839 as the correct value of the function. 21840 21841 See Also 21842 21843 exp10l(), pow10(), pow10f() 21844 21845 scalbf 21846 21847 Name 21848 21849 scalbf -- load exponent of radix-independent floating point 21850 number 21851 21852 Synopsis 21853 21854 #include 21855 21856 float scalbf(float x, double exp); 21857 21858 Description 21859 21860 The scalbf() function is identical to scalb(), except that the 21861 argument x and the return value is of type float. 21862 21863 Returns 21864 21865 See scalb(). 21866 21867 scalbl 21868 21869 Name 21870 21871 scalbl -- load exponent of radix-independent floating point 21872 number 21873 21874 Synopsis 21875 21876 #include 21877 21878 long double scalbl(long double x, double exp); 21879 21880 Description 21881 21882 The scalbl() function is identical to scalb(), except that the 21883 argument x and the return value is of type long double. 21884 21885 Returns 21886 21887 See scalb(). 21888 21889 significand 21890 21891 Name 21892 21893 significand -- floating point mantissa 21894 21895 Synopsis 21896 21897 #include 21898 21899 double significand(double x); 21900 21901 Description 21902 21903 The significand() function shall return the mantissa of x, sig 21904 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 21905 21906 Note: This function is intended for testing conformance to 21907 IEC 60559/IEEE 754 Floating Point, and its use is not 21908 otherwise recommended. 21909 21910 This function is equivalent to scalb(x, (double)-ilogb(x)). 21911 21912 Returns 21913 21914 Upon successful completion, significand() shall return the 21915 mantissa of x in the range 1 ≤ sig < 2. 21916 21917 If x is 0, ±HUGE_VAL, or NaN, the result is undefined. 21918 21919 See Also 21920 21921 significandf(), significandl() 21922 21923 significandf 21924 21925 Name 21926 21927 significandf -- floating point mantissa 21928 21929 Synopsis 21930 21931 #include 21932 21933 float significandf(float x); 21934 21935 Description 21936 21937 The significandf() function shall return the mantissa of x, sig 21938 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 21939 21940 Note: This function is intended for testing conformance to 21941 IEC 60559/IEEE 754 Floating Point, and its use is not 21942 otherwise recommended. 21943 21944 This function is equivalent to scalb(x, (double)-ilogb(x)). 21945 21946 Returns 21947 21948 Upon successful completion, significandf() shall return the 21949 mantissa of x in the range 1 ≤ sig < 2. 21950 21951 If x is 0, ±HUGE_VALF, or NaN, the result is undefined. 21952 21953 See Also 21954 21955 significand(), significandl() 21956 21957 significandl 21958 21959 Name 21960 21961 significandl -- floating point mantissa 21962 21963 Synopsis 21964 21965 #include 21966 21967 long double significandl(long double x); 21968 21969 Description 21970 21971 The significandl() function shall return the mantissa of x, sig 21972 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 21973 21974 Note: This function is intended for testing conformance to 21975 IEC 60559/IEEE 754 Floating Point, and its use is not 21976 otherwise recommended. 21977 21978 This function is equivalent to scalb(x, (double)-ilogb(x)). 21979 21980 Returns 21981 21982 Upon successful completion, significandl() shall return the 21983 mantissa of x in the range 1 ≤ sig < 2. 21984 21985 If x is 0, ±HUGE_VALL, or NaN, the result is undefined. 21986 21987 See Also 21988 21989 significand(), significandf() 21990 21991 sincos 21992 21993 Name 21994 21995 sincos -- trigonometric functions 21996 21997 Synopsis 21998 21999 #define _GNU_SOURCE 22000 #include 22001 22002 void sincos(double x, double * sin, double * cos); 22003 22004 Description 22005 22006 The sincos() function shall calculate both the sine and cosine 22007 of x. The sine shall be stored in the location referenced by 22008 sin, and the cosine in the location referenced by cosine. 22009 22010 Returns 22011 22012 None. See sin() and cos() for possible error conditions. 22013 22014 See Also 22015 22016 cos(), sin(), sincosf(), sincosl() 22017 22018 sincosf 22019 22020 Name 22021 22022 sincosf -- trigonometric functions 22023 22024 Synopsis 22025 22026 #define _GNU_SOURCE 22027 #include 22028 22029 void sincosf(float x, float * sin, float * cos); 22030 22031 Description 22032 22033 The sincosf() function shall calculate both the sine and cosine 22034 of x. The sine shall be stored in the location referenced by 22035 sin, and the cosine in the location referenced by cosine. 22036 22037 Returns 22038 22039 None. See sin() and cos() for possible error conditions. 22040 22041 See Also 22042 22043 cos(), sin(), sincos(), sincosl() 22044 22045 sincosl 22046 22047 Name 22048 22049 sincosl -- trigonometric functions 22050 22051 Synopsis 22052 22053 #define _GNU_SOURCE 22054 #include 22055 22056 void sincosl(long double x, long double * sin, long double * 22057 cos); 22058 22059 Description 22060 22061 The sincosl() function shall calculate both the sine and cosine 22062 of x. The sine shall be stored in the location referenced by 22063 sin, and the cosine in the location referenced by cosine. 22064 22065 Returns 22066 22067 None. See sin() and cos() for possible error conditions. 22068 22069 See Also 22070 22071 cos(), sin(), sincos(), sincosl() 22072 22073 y0f 22074 22075 Name 22076 22077 y0f -- Bessel functions 22078 22079 Synopsis 22080 22081 #include 22082 22083 float y0f(float x); 22084 22085 Description 22086 22087 The y0f() function is identical to y0(), except that the 22088 argument x and the return value is a float. 22089 22090 Returns 22091 22092 See y0(). 22093 22094 See Also 22095 22096 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22097 y0(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22098 22099 y0l 22100 22101 Name 22102 22103 y0l -- Bessel functions 22104 22105 Synopsis 22106 22107 #include 22108 22109 long double y0l(long double x); 22110 22111 Description 22112 22113 The y0l() function is identical to y0(), except that the 22114 argument x and the return value is a long double. 22115 22116 Returns 22117 22118 See y0(). 22119 22120 See Also 22121 22122 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22123 y0(), y0f(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22124 22125 y1f 22126 22127 Name 22128 22129 y1f -- Bessel functions 22130 22131 Synopsis 22132 22133 #include 22134 22135 float y1f(float x); 22136 22137 Description 22138 22139 The y1f() function is identical to y1(), except that the 22140 argument x and the return value is a float. 22141 22142 Returns 22143 22144 See y1(). 22145 22146 See Also 22147 22148 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22149 y0(), y0f(), y0l(), y1(), y1l(), yn(), ynf(), ynl() 22150 22151 y1l 22152 22153 Name 22154 22155 y1l -- Bessel functions 22156 22157 Synopsis 22158 22159 #include 22160 22161 long double y1l(long double x); 22162 22163 Description 22164 22165 The y1l() function is identical to y1(), except that the 22166 argument x and the return value is a long double. 22167 22168 Returns 22169 22170 See j0(). 22171 22172 See Also 22173 22174 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22175 y0(), y0f(), y0l(), y1(), y1f(), yn(), ynf(), ynl() 22176 22177 ynf 22178 22179 Name 22180 22181 ynf -- Bessel functions 22182 22183 Synopsis 22184 22185 #include 22186 22187 float ynf(float x); 22188 22189 Description 22190 22191 The ynf() function is identical to yn(), except that the 22192 argument x and the return value is a float. 22193 22194 Returns 22195 22196 See yn(). 22197 22198 See Also 22199 22200 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22201 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynl() 22202 22203 ynl 22204 22205 Name 22206 22207 ynl -- Bessel functions 22208 22209 Synopsis 22210 22211 #include 22212 22213 long double ynl(long double x); 22214 22215 Description 22216 22217 The ynl() function is identical to yn(), except that the 22218 argument x and the return value is a long double. 22219 22220 Returns 22221 22222 See yn(). 22223 22224 See Also 22225 22226 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 22227 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf() 22228 __________________________________________________________ 22229 22230 13.9. Interfaces for libpthread 22231 22232 Table 13-41 defines the library name and shared object name for 22233 the libpthread library 22234 22235 Table 13-41. libpthread Definition 22236 Library: libpthread 22237 SONAME: libpthread.so.0 22238 22239 The behavior of the interfaces in this library is specified by 22240 the following specifications: 22241 22242 [LFS] Large File Support 22243 [LSB] This Specification 22244 [SUSv3] ISO POSIX (2003) 22245 [SUSv4] POSIX 1003.1 2008 22246 __________________________________________________________ 22247 22248 13.9.1. Realtime Threads 22249 __________________________________________________________ 22250 22251 13.9.1.1. Interfaces for Realtime Threads 22252 22253 An LSB conforming implementation shall provide the generic 22254 functions for Realtime Threads specified in Table 13-42, with 22255 the full mandatory functionality as described in the referenced 22256 underlying specification. 22257 22258 Table 13-42. libpthread - Realtime Threads Function Interfaces 22259 pthread_attr_getinheritsched [SUSv3] 22260 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 22261 [SUSv3] pthread_attr_setinheritsched [SUSv3] 22262 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 22263 [SUSv3] pthread_getschedparam [SUSv3] 22264 pthread_mutex_getprioceiling(GLIBC_2.4) [SUSv4] 22265 pthread_mutex_setprioceiling(GLIBC_2.4) [SUSv4] 22266 pthread_mutexattr_getprioceiling(GLIBC_2.4) [SUSv4] 22267 pthread_mutexattr_getprotocol(GLIBC_2.4) [SUSv4] 22268 pthread_mutexattr_setprioceiling(GLIBC_2.4) [SUSv4] 22269 pthread_mutexattr_setprotocol(GLIBC_2.4) [SUSv4] 22270 pthread_setschedparam [SUSv3] pthread_setschedprio(GLIBC_2.3.4) 22271 [SUSv3] 22272 __________________________________________________________ 22273 22274 13.9.2. Advanced Realtime Threads 22275 __________________________________________________________ 22276 22277 13.9.2.1. Interfaces for Advanced Realtime Threads 22278 22279 An LSB conforming implementation shall provide the generic 22280 functions for Advanced Realtime Threads specified in Table 22281 13-43, with the full mandatory functionality as described in 22282 the referenced underlying specification. 22283 22284 Table 13-43. libpthread - Advanced Realtime Threads Function 22285 Interfaces 22286 pthread_barrier_destroy [SUSv3] pthread_barrier_init [SUSv3] 22287 pthread_barrier_wait [SUSv3] pthread_barrierattr_destroy 22288 [SUSv3] 22289 pthread_barrierattr_getpshared(GLIBC_2.3.3) [SUSv3] 22290 pthread_barrierattr_init [SUSv3] pthread_barrierattr_setpshared 22291 [SUSv3] pthread_getcpuclockid [SUSv3] 22292 pthread_spin_destroy [SUSv3] pthread_spin_init [SUSv3] 22293 pthread_spin_lock [SUSv3] pthread_spin_trylock [SUSv3] 22294 pthread_spin_unlock [SUSv3] 22295 __________________________________________________________ 22296 22297 13.9.3. Posix Threads 22298 __________________________________________________________ 22299 22300 13.9.3.1. Interfaces for Posix Threads 22301 22302 An LSB conforming implementation shall provide the generic 22303 functions for Posix Threads specified in Table 13-44, with the 22304 full mandatory functionality as described in the referenced 22305 underlying specification. 22306 22307 Table 13-44. libpthread - Posix Threads Function Interfaces 22308 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 22309 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 22310 [SUSv3] 22311 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 22312 [SUSv3] pthread_attr_getstack [SUSv3] pthread_attr_getstackaddr 22313 [SUSv3] 22314 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 22315 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 22316 [SUSv3] 22317 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 22318 [SUSv3] pthread_attr_setstackaddr [SUSv3] 22319 pthread_attr_setstacksize [SUSv3] 22320 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 22321 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 22322 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 22323 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 22324 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 22325 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 22326 [SUSv3] 22327 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 22328 [SUSv3] pthread_getconcurrency [SUSv3] 22329 pthread_getspecific [SUSv3] pthread_join [SUSv3] 22330 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 22331 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 22332 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 22333 pthread_mutex_timedlock [SUSv3] pthread_mutex_trylock [SUSv3] 22334 pthread_mutex_unlock [SUSv3] pthread_mutexattr_destroy [SUSv3] 22335 pthread_mutexattr_getpshared [SUSv3] pthread_mutexattr_gettype 22336 [SUSv3] pthread_mutexattr_init [SUSv3] 22337 pthread_mutexattr_setpshared [SUSv3] 22338 pthread_mutexattr_settype [SUSv3] pthread_once [SUSv3] 22339 pthread_rwlock_destroy [SUSv3] pthread_rwlock_init [SUSv3] 22340 pthread_rwlock_rdlock [SUSv3] pthread_rwlock_timedrdlock 22341 [SUSv3] pthread_rwlock_timedwrlock [SUSv3] 22342 pthread_rwlock_tryrdlock [SUSv3] 22343 pthread_rwlock_trywrlock [SUSv3] pthread_rwlock_unlock [SUSv3] 22344 pthread_rwlock_wrlock [SUSv3] pthread_rwlockattr_destroy 22345 [SUSv3] 22346 pthread_rwlockattr_getpshared [SUSv3] pthread_rwlockattr_init 22347 [SUSv3] pthread_rwlockattr_setpshared [SUSv3] pthread_self 22348 [SUSv3] 22349 pthread_setcancelstate [SUSv3] pthread_setcanceltype [SUSv3] 22350 pthread_setconcurrency [SUSv3] pthread_setspecific [SUSv3] 22351 pthread_sigmask [SUSv3] pthread_testcancel [SUSv3] sem_close 22352 [SUSv3] sem_destroy [SUSv3] 22353 sem_getvalue [SUSv3] sem_init [SUSv3] sem_open [SUSv3] sem_post 22354 [SUSv3] 22355 sem_timedwait [SUSv3] sem_trywait [SUSv3] sem_unlink [SUSv3] 22356 sem_wait [SUSv3] 22357 22358 An LSB conforming implementation shall provide the generic 22359 deprecated functions for Posix Threads specified in Table 22360 13-45, with the full mandatory functionality as described in 22361 the referenced underlying specification. 22362 22363 Note: These interfaces are deprecated, and applications 22364 should avoid using them. These interfaces may be withdrawn 22365 in future releases of this specification. 22366 22367 Table 13-45. libpthread - Posix Threads Deprecated Function 22368 Interfaces 22369 pthread_attr_getstackaddr [SUSv3] pthread_attr_setstackaddr 22370 [SUSv3] 22371 __________________________________________________________ 22372 22373 13.9.4. Thread aware versions of libc interfaces 22374 __________________________________________________________ 22375 22376 13.9.4.1. Interfaces for Thread aware versions of libc interfaces 22377 22378 An LSB conforming implementation shall provide the generic 22379 functions for Thread aware versions of libc interfaces 22380 specified in Table 13-46, with the full mandatory functionality 22381 as described in the referenced underlying specification. 22382 22383 Table 13-46. libpthread - Thread aware versions of libc 22384 interfaces Function Interfaces 22385 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LSB] 22386 pwrite [SUSv3] pwrite64 [LSB] 22387 __________________________________________________________ 22388 22389 13.10. Data Definitions for libpthread 22390 22391 This section defines global identifiers and their values that 22392 are associated with interfaces contained in libpthread. These 22393 definitions are organized into groups that correspond to system 22394 headers. This convention is used as a convenience for the 22395 reader, and does not imply the existence of these headers, or 22396 their content. Where an interface is defined as requiring a 22397 particular system header file all of the data definitions for 22398 that system header file presented here shall be in effect. 22399 22400 This section gives data definitions to promote binary 22401 application portability, not to repeat source interface 22402 definitions available elsewhere. System providers and 22403 application developers should use this ABI to supplement - not 22404 to replace - source interface definition specifications. 22405 22406 This specification uses the ISO C (1999) C Language as the 22407 reference programming language, and data definitions are 22408 specified in ISO C format. The C language is used here as a 22409 convenient notation. Using a C language description of these 22410 data objects does not preclude their use by other programming 22411 languages. 22412 __________________________________________________________ 22413 22414 13.10.1. pthread.h 22415 22416 #define PTHREAD_MUTEX_DEFAULT 0 22417 #define PTHREAD_MUTEX_NORMAL 0 22418 #define PTHREAD_SCOPE_SYSTEM 0 22419 #define PTHREAD_MUTEX_RECURSIVE 1 22420 #define PTHREAD_SCOPE_PROCESS 1 22421 #define PTHREAD_MUTEX_ERRORCHECK 2 22422 #define PTHREAD_RWLOCK_DEFAULT_NP 2 22423 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 22424 #define __SIZEOF_PTHREAD_CONDATTR_T 4 22425 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 22426 #define __SIZEOF_PTHREAD_COND_T 48 22427 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 22428 #define pthread_cleanup_push(routine,arg) \ 22429 {struct _pthread_cleanup_buffer _buffer;\ 22430 _pthread_cleanup_push(&_buffer,(routine),(arg)); 22431 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 22432 #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } 22433 22434 struct _pthread_cleanup_buffer { 22435 void (*__routine) (void *); 22436 void *__arg; 22437 int __canceltype; 22438 struct _pthread_cleanup_buffer *__prev; 22439 }; 22440 typedef unsigned int pthread_key_t; 22441 typedef int pthread_once_t; 22442 typedef volatile int pthread_spinlock_t; 22443 typedef union { 22444 char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; 22445 int __align; 22446 } pthread_barrierattr_t; 22447 22448 typedef unsigned long int pthread_t; 22449 22450 typedef union { 22451 struct __pthread_mutex_s __data; 22452 char __size[__SIZEOF_PTHREAD_MUTEX_T]; 22453 long int __align; 22454 } pthread_mutex_t; 22455 typedef union { 22456 char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; 22457 int __align; 22458 } pthread_mutexattr_t; 22459 22460 typedef union { 22461 char __size[__SIZEOF_PTHREAD_ATTR_T]; 22462 long int __align; 22463 } pthread_attr_t; 22464 22465 typedef union { 22466 struct { 22467 int __lock; 22468 unsigned int __futex; 22469 unsigned long long int __total_seq; 22470 unsigned long long int __wakeup_seq; 22471 unsigned long long int __woken_seq; 22472 void *__mutex; 22473 unsigned int __nwaiters; 22474 unsigned int __broadcast_seq; 22475 } __data; 22476 char __size[__SIZEOF_PTHREAD_COND_T]; 22477 long long int __align; 22478 } pthread_cond_t; 22479 typedef union { 22480 char __size[__SIZEOF_PTHREAD_CONDATTR_T]; 22481 int __align; 22482 } pthread_condattr_t; 22483 22484 typedef union { 22485 char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; 22486 long int __align; 22487 } pthread_rwlockattr_t; 22488 22489 #define PTHREAD_CREATE_JOINABLE 0 22490 #define PTHREAD_INHERIT_SCHED 0 22491 #define PTHREAD_ONCE_INIT 0 22492 #define PTHREAD_PROCESS_PRIVATE 0 22493 #define PTHREAD_CREATE_DETACHED 1 22494 #define PTHREAD_EXPLICIT_SCHED 1 22495 #define PTHREAD_PROCESS_SHARED 1 22496 22497 #define PTHREAD_CANCELED ((void*)-1) 22498 #define PTHREAD_CANCEL_DEFERRED 0 22499 #define PTHREAD_CANCEL_ENABLE 0 22500 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 22501 #define PTHREAD_CANCEL_DISABLE 1 22502 22503 extern int __register_atfork(void (*)(void), void (*)(void), 22504 void (*)(void), void *); 22505 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 22506 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 22507 void (*)(void *), void *); 22508 extern int pthread_attr_destroy(pthread_attr_t * __attr); 22509 extern int pthread_attr_getdetachstate(const pthread_attr_t * __attr, 22510 int *__detachstate); 22511 extern int pthread_attr_getguardsize(const pthread_attr_t * __attr, 22512 size_t * __guardsize); 22513 extern int pthread_attr_getinheritsched(const pthread_attr_t * __attr, 22514 int *__inherit); 22515 extern int pthread_attr_getschedparam(const pthread_attr_t * __attr, 22516 struct sched_param *__param); 22517 extern int pthread_attr_getschedpolicy(const pthread_attr_t * __attr, 22518 int *__policy); 22519 extern int pthread_attr_getscope(const pthread_attr_t * __attr, 22520 int *__scope); 22521 extern int pthread_attr_getstack(const pthread_attr_t * __attr, 22522 void **__stackaddr, size_t * __stacksize); 22523 extern int pthread_attr_getstackaddr(const pthread_attr_t * __attr, 22524 void **__stackaddr); 22525 extern int pthread_attr_getstacksize(const pthread_attr_t * __attr, 22526 size_t * __stacksize); 22527 extern int pthread_attr_init(pthread_attr_t * __attr); 22528 extern int pthread_attr_setdetachstate(pthread_attr_t * __attr, 22529 int __detachstate); 22530 extern int pthread_attr_setguardsize(pthread_attr_t * __attr, 22531 size_t __guardsize); 22532 extern int pthread_attr_setinheritsched(pthread_attr_t * __attr, 22533 int __inherit); 22534 extern int pthread_attr_setschedparam(pthread_attr_t * __attr, 22535 const struct sched_param *__param); 22536 extern int pthread_attr_setschedpolicy(pthread_attr_t * __attr, 22537 int __policy); 22538 extern int pthread_attr_setscope(pthread_attr_t * __attr, int __scope); 22539 extern int pthread_attr_setstack(pthread_attr_t * __attr, 22540 void *__stackaddr, size_t __stacksize); 22541 extern int pthread_attr_setstackaddr(pthread_attr_t * __attr, 22542 void *__stackaddr); 22543 extern int pthread_attr_setstacksize(pthread_attr_t * __attr, 22544 size_t __stacksize); 22545 extern int pthread_barrier_destroy(pthread_barrier_t * __barrier); 22546 extern int pthread_barrier_init(pthread_barrier_t * __barrier, 22547 const pthread_barrierattr_t * __attr, 22548 unsigned int __count); 22549 extern int pthread_barrier_wait(pthread_barrier_t * __barrier); 22550 extern int pthread_barrierattr_destroy(pthread_barrierattr_t * __attr); 22551 extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t * 22552 __attr, int *__pshared); 22553 extern int pthread_barrierattr_init(pthread_barrierattr_t * __attr); 22554 extern int pthread_barrierattr_setpshared(pthread_barrierattr_t * __attr, 22555 int __pshared); 22556 extern int pthread_cancel(pthread_t __th); 22557 extern int pthread_cond_broadcast(pthread_cond_t * __cond); 22558 extern int pthread_cond_destroy(pthread_cond_t * __cond); 22559 extern int pthread_cond_init(pthread_cond_t * __cond, 22560 const pthread_condattr_t * __cond_attr); 22561 extern int pthread_cond_signal(pthread_cond_t * __cond); 22562 extern int pthread_cond_timedwait(pthread_cond_t * __cond, 22563 pthread_mutex_t * __mutex, 22564 const struct timespec *__abstime); 22565 extern int pthread_cond_wait(pthread_cond_t * __cond, 22566 pthread_mutex_t * __mutex); 22567 extern int pthread_condattr_destroy(pthread_condattr_t * __attr); 22568 extern int pthread_condattr_getpshared(const pthread_condattr_t * __attr, 22569 int *__pshared); 22570 extern int pthread_condattr_init(pthread_condattr_t * __attr); 22571 extern int pthread_condattr_setpshared(pthread_condattr_t * __attr, 22572 int __pshared); 22573 extern int pthread_create(pthread_t * __newthread, 22574 const pthread_attr_t * __attr, 22575 void *(*__start_routine) (void *), void *__arg); 22576 extern int pthread_detach(pthread_t __th); 22577 extern int pthread_equal(pthread_t __thread1, pthread_t __thread2); 22578 extern void pthread_exit(void *__retval); 22579 extern int pthread_getconcurrency(void); 22580 extern int pthread_getcpuclockid(pthread_t __thread_id, 22581 clockid_t * __clock_id); 22582 extern int pthread_getschedparam(pthread_t __target_thread, int *__policy, 22583 struct sched_param *__param); 22584 extern void *pthread_getspecific(pthread_key_t __key); 22585 extern int pthread_join(pthread_t __th, void **__thread_return); 22586 extern int pthread_key_create(pthread_key_t * __key, 22587 void (*__destr_function) (void *)); 22588 extern int pthread_key_delete(pthread_key_t __key); 22589 extern int pthread_mutex_destroy(pthread_mutex_t * __mutex); 22590 extern int pthread_mutex_getprioceiling(const pthread_mutex_t * __mutex, 22591 int *__prioceiling); 22592 extern int pthread_mutex_init(pthread_mutex_t * __mutex, 22593 const pthread_mutexattr_t * __mutexattr); 22594 extern int pthread_mutex_lock(pthread_mutex_t * __mutex); 22595 extern int pthread_mutex_setprioceiling(pthread_mutex_t * __mutex, 22596 int __prioceiling, 22597 int *__old_ceiling); 22598 extern int pthread_mutex_timedlock(pthread_mutex_t * __mutex, 22599 const struct timespec *__abstime); 22600 extern int pthread_mutex_trylock(pthread_mutex_t * __mutex); 22601 extern int pthread_mutex_unlock(pthread_mutex_t * __mutex); 22602 extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr); 22603 extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * 22604 __attr, int *__prioceiling); 22605 extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * 22606 __attr, int *__protocol); 22607 extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __attr, 22608 int *__pshared); 22609 extern int pthread_mutexattr_gettype(const pthread_mutexattr_t * __attr, 22610 int *__kind); 22611 extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr); 22612 extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t * __attr, 22613 int __prioceiling); 22614 extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t * __attr, 22615 int __protocol); 22616 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * __attr, 22617 int __pshared); 22618 extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, 22619 int __kind); 22620 extern int pthread_once(pthread_once_t * __once_control, 22621 void (*__init_routine) (void)); 22622 extern int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock); 22623 extern int pthread_rwlock_init(pthread_rwlock_t * __rwlock, 22624 const pthread_rwlockattr_t * __attr); 22625 extern int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock); 22626 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, 22627 const struct timespec *__abstime); 22628 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, 22629 const struct timespec *__abstime); 22630 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock); 22631 extern int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock); 22632 extern int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock); 22633 extern int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock); 22634 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * __attr); 22635 extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * 22636 __attr, int *__pshared); 22637 extern int pthread_rwlockattr_init(pthread_rwlockattr_t * __attr); 22638 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * __attr, 22639 int __pshared); 22640 extern pthread_t pthread_self(void); 22641 extern int pthread_setcancelstate(int __state, int *__oldstate); 22642 extern int pthread_setcanceltype(int __type, int *__oldtype); 22643 extern int pthread_setconcurrency(int __level); 22644 extern int pthread_setschedparam(pthread_t __target_thread, int __policy, 22645 const struct sched_param *__param); 22646 extern int pthread_setschedprio(pthread_t __target_thread, int __prio); 22647 extern int pthread_setspecific(pthread_key_t __key, const void *__pointer); 22648 extern int pthread_spin_destroy(pthread_spinlock_t * __lock); 22649 extern int pthread_spin_init(pthread_spinlock_t * __lock, int __pshared); 22650 extern int pthread_spin_lock(pthread_spinlock_t * __lock); 22651 extern int pthread_spin_trylock(pthread_spinlock_t * __lock); 22652 extern int pthread_spin_unlock(pthread_spinlock_t * __lock); 22653 extern void pthread_testcancel(void); 22654 __________________________________________________________ 22655 22656 13.10.2. semaphore.h 22657 22658 typedef union { 22659 char __size[__SIZEOF_SEM_T]; 22660 long int __align; 22661 } sem_t; 22662 22663 #define SEM_FAILED ((sem_t*)0) 22664 22665 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 22666 22667 extern int sem_close(sem_t * __sem); 22668 extern int sem_destroy(sem_t * __sem); 22669 extern int sem_getvalue(sem_t * __sem, int *__sval); 22670 extern int sem_init(sem_t * __sem, int __pshared, unsigned int __value); 22671 extern sem_t *sem_open(const char *__name, int __oflag, ...); 22672 extern int sem_post(sem_t * __sem); 22673 extern int sem_timedwait(sem_t * __sem, const struct timespec *__abstime); 22674 extern int sem_trywait(sem_t * __sem); 22675 extern int sem_unlink(const char *__name); 22676 extern int sem_wait(sem_t * __sem); 22677 __________________________________________________________ 22678 22679 13.11. Interface Definitions for libpthread 22680 22681 Table of Contents 22682 _pthread_cleanup_pop -- establish cancellation handlers 22683 _pthread_cleanup_push -- establish cancellation handlers 22684 pread64 -- read from a file (Large File Support) 22685 pwrite64 -- write on a file (Large File Support) 22686 22687 The interfaces defined on the following pages are included in 22688 libpthread and are defined by this specification. Unless 22689 otherwise noted, these interfaces shall be included in the 22690 source standard. 22691 22692 Other interfaces listed in Section 13.9 shall behave as 22693 described in the referenced base document. 22694 22695 _pthread_cleanup_pop 22696 22697 Name 22698 22699 _pthread_cleanup_pop -- establish cancellation handlers 22700 22701 Synopsis 22702 22703 #include 22704 22705 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 22706 int); 22707 22708 Description 22709 22710 The _pthread_cleanup_pop() function provides an implementation 22711 of the pthread_cleanup_pop() macro described in ISO POSIX 22712 (2003). 22713 22714 The _pthread_cleanup_pop() function is not in the source 22715 standard; it is only in the binary standard. 22716 22717 _pthread_cleanup_push 22718 22719 Name 22720 22721 _pthread_cleanup_push -- establish cancellation handlers 22722 22723 Synopsis 22724 22725 #include 22726 22727 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 22728 void (*) (void *), void *); 22729 22730 Description 22731 22732 The _pthread_cleanup_push() function provides an implementation 22733 of the pthread_cleanup_push() macro described in ISO POSIX 22734 (2003). 22735 22736 The _pthread_cleanup_push() function is not in the source 22737 standard; it is only in the binary standard. 22738 22739 pread64 22740 22741 Name 22742 22743 pread64 -- read from a file (Large File Support) 22744 22745 Synopsis 22746 22747 #include 22748 22749 ssize_t pread64(int fd, void * buf, size_t count, off64_t 22750 offset); 22751 22752 Description 22753 22754 pread64() shall read count bytes into buf from the file 22755 associated with the open file descriptor fd, at the position 22756 specified by offset, without changing the file position. 22757 22758 pread64() is a large-file version of the pread() function as 22759 defined in ISO POSIX (2003). It differs from pread() in that 22760 the offset parameter is an off64_t instead of an off_t 22761 22762 Return Value 22763 22764 On success, pread64() shall return the number of bytes actually 22765 read. Otherwise pread64() shall return -1 and set errno to 22766 indicate the error. 22767 22768 Errors 22769 22770 See pread() for possible error values. 22771 22772 pwrite64 22773 22774 Name 22775 22776 pwrite64 -- write on a file (Large File Support) 22777 22778 Synopsis 22779 22780 #include 22781 22782 ssize_t pwrite64(int fd, const void * buf, size_t count, 22783 off64_t offset); 22784 22785 Description 22786 22787 pwrite64() shall write count bytes from buf to the file 22788 associated with the open file descriptor fd, at the position 22789 specified by offset, without changing the file position. 22790 22791 pwrite64() is a large-file version of the pwrite() function as 22792 defined in ISO POSIX (2003). It differs from pwrite() in that 22793 the offset parameter is an off64_t instead of an off_t 22794 22795 Return Value 22796 22797 On success, pwrite64() shall return the number of bytes 22798 actually written. Otherwise pwrite() shall return -1 and set 22799 errno to indicate the error. 22800 22801 Errors 22802 22803 See pwrite() for possible error values. 22804 __________________________________________________________ 22805 22806 13.12. Interfaces for libgcc_s 22807 22808 Table 13-47 defines the library name and shared object name for 22809 the libgcc_s library 22810 22811 Table 13-47. libgcc_s Definition 22812 Library: libgcc_s 22813 SONAME: libgcc_s.so.1 22814 __________________________________________________________ 22815 22816 13.12.1. Unwind Library 22817 __________________________________________________________ 22818 22819 13.12.1.1. Interfaces for Unwind Library 22820 22821 No external functions are defined for libgcc_s - Unwind Library 22822 in this part of the specification. See also the relevant 22823 architecture specific part of this specification. 22824 __________________________________________________________ 22825 22826 13.13. Data Definitions for libgcc_s 22827 22828 This section defines global identifiers and their values that 22829 are associated with interfaces contained in libgcc_s. These 22830 definitions are organized into groups that correspond to system 22831 headers. This convention is used as a convenience for the 22832 reader, and does not imply the existence of these headers, or 22833 their content. Where an interface is defined as requiring a 22834 particular system header file all of the data definitions for 22835 that system header file presented here shall be in effect. 22836 22837 This section gives data definitions to promote binary 22838 application portability, not to repeat source interface 22839 definitions available elsewhere. System providers and 22840 application developers should use this ABI to supplement - not 22841 to replace - source interface definition specifications. 22842 22843 This specification uses the ISO C (1999) C Language as the 22844 reference programming language, and data definitions are 22845 specified in ISO C format. The C language is used here as a 22846 convenient notation. Using a C language description of these 22847 data objects does not preclude their use by other programming 22848 languages. 22849 __________________________________________________________ 22850 22851 13.13.1. unwind.h 22852 22853 typedef unsigned int _Unwind_Ptr __attribute__ ((__mode__(__pointer__))); 22854 typedef unsigned int _Unwind_Word __attribute__ ((__mode__(__word__))); 22855 typedef unsigned int _Unwind_Exception_Class 22856 __attribute__ ((__mode__(__DI__))); 22857 22858 typedef enum { 22859 _URC_NO_REASON = 0, 22860 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, 22861 _URC_FATAL_PHASE2_ERROR = 2, 22862 _URC_FATAL_PHASE1_ERROR = 3, 22863 _URC_NORMAL_STOP = 4, 22864 _URC_END_OF_STACK = 5, 22865 _URC_HANDLER_FOUND = 6, 22866 _URC_INSTALL_CONTEXT = 7, 22867 _URC_CONTINUE_UNWIND = 8 22868 } _Unwind_Reason_Code; 22869 22870 typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, 22871 struct _Unwind_Exception *); 22872 22873 struct _Unwind_Exception { 22874 _Unwind_Exception_Class exception_class; 22875 _Unwind_Exception_Cleanup_Fn exception_cleanup; 22876 _Unwind_Word private_1; 22877 _Unwind_Word private_2; 22878 } __attribute__ ((__aligned__)); 22879 22880 #define _UA_SEARCH_PHASE 1 22881 #define _UA_END_OF_STACK 16 22882 #define _UA_CLEANUP_PHASE 2 22883 #define _UA_HANDLER_FRAME 4 22884 #define _UA_FORCE_UNWIND 8 22885 22886 typedef int _Unwind_Action; 22887 __________________________________________________________ 22888 22889 13.14. Interfaces for libdl 22890 22891 Table 13-48 defines the library name and shared object name for 22892 the libdl library 22893 22894 Table 13-48. libdl Definition 22895 Library: libdl 22896 SONAME: libdl.so.2 22897 22898 The behavior of the interfaces in this library is specified by 22899 the following specifications: 22900 22901 [LSB] This Specification 22902 [SUSv3] ISO POSIX (2003) 22903 __________________________________________________________ 22904 22905 13.14.1. Dynamic Loader 22906 __________________________________________________________ 22907 22908 13.14.1.1. Interfaces for Dynamic Loader 22909 22910 An LSB conforming implementation shall provide the generic 22911 functions for Dynamic Loader specified in Table 13-49, with the 22912 full mandatory functionality as described in the referenced 22913 underlying specification. 22914 22915 Table 13-49. libdl - Dynamic Loader Function Interfaces 22916 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 22917 dlsym [LSB] 22918 __________________________________________________________ 22919 22920 13.15. Data Definitions for libdl 22921 22922 This section defines global identifiers and their values that 22923 are associated with interfaces contained in libdl. These 22924 definitions are organized into groups that correspond to system 22925 headers. This convention is used as a convenience for the 22926 reader, and does not imply the existence of these headers, or 22927 their content. Where an interface is defined as requiring a 22928 particular system header file all of the data definitions for 22929 that system header file presented here shall be in effect. 22930 22931 This section gives data definitions to promote binary 22932 application portability, not to repeat source interface 22933 definitions available elsewhere. System providers and 22934 application developers should use this ABI to supplement - not 22935 to replace - source interface definition specifications. 22936 22937 This specification uses the ISO C (1999) C Language as the 22938 reference programming language, and data definitions are 22939 specified in ISO C format. The C language is used here as a 22940 convenient notation. Using a C language description of these 22941 data objects does not preclude their use by other programming 22942 languages. 22943 __________________________________________________________ 22944 22945 13.15.1. dlfcn.h 22946 22947 #define RTLD_NEXT ((void *) -1l) 22948 #define RTLD_DEFAULT ((void *) 0) 22949 #define RTLD_LOCAL 0 22950 #define RTLD_LAZY 0x00001 22951 #define RTLD_NOW 0x00002 22952 #define RTLD_GLOBAL 0x00100 22953 22954 typedef struct { 22955 char *dli_fname; 22956 void *dli_fbase; 22957 char *dli_sname; 22958 void *dli_saddr; 22959 } Dl_info; 22960 extern int dladdr(const void *__address, Dl_info * __info); 22961 extern int dlclose(void *__handle); 22962 extern char *dlerror(void); 22963 extern void *dlopen(const char *__file, int __mode); 22964 extern void *dlsym(void *__handle, const char *__name); 22965 __________________________________________________________ 22966 22967 13.16. Interface Definitions for libdl 22968 22969 Table of Contents 22970 dladdr -- find the shared object containing a given address 22971 dlopen -- open dynamic object 22972 dlsym -- obtain the address of a symbol from a dlopen object 22973 22974 The interfaces defined on the following pages are included in 22975 libdl and are defined by this specification. Unless otherwise 22976 noted, these interfaces shall be included in the source 22977 standard. 22978 22979 Other interfaces listed in Section 13.14 shall behave as 22980 described in the referenced base document. 22981 22982 dladdr 22983 22984 Name 22985 22986 dladdr -- find the shared object containing a given address 22987 22988 Synopsis 22989 22990 #include 22991 22992 typedef struct { 22993 const char *dli_fname; 22994 void *dli_fbase; 22995 const char *dli_sname; 22996 void *dli_saddr; 22997 } Dl_info; 22998 22999 int dladdr(const void * addr, Dl_info * dlip); 23000 23001 Description 23002 23003 The dladdr() function shall query the dynamic linker for 23004 information about the shared object containing the address 23005 addr. The information shall be returned in the user supplied 23006 data structure referenced by dlip. 23007 23008 The structure shall contain at least the following members: 23009 23010 dli_fname 23011 23012 The pathname of the shared object containing the address 23013 dli_fbase 23014 23015 The base address at which the shared object is mapped into the 23016 address space of the calling process. 23017 dli_sname 23018 23019 The name of the nearest runtime symbol with value less than or 23020 equal to addr. Where possible, the symbol name shall be 23021 returned as it would appear in C source code. 23022 23023 If no symbol with a suitable value is found, both this field 23024 and dli_saddr shall be set to NULL. 23025 dli_saddr 23026 23027 The address of the symbol returned in dli_sname. This address 23028 has type "pointer to type", where type is the type of the 23029 symbol dli_sname. 23030 23031 Example: If the symbol in dli_sname is a function, then the 23032 type of dli_saddr is of type "pointer to function". 23033 23034 The behavior of dladdr() is only specified in dynamically 23035 linked programs. 23036 23037 Return Value 23038 23039 On success, dladdr() shall return non-zero, and the structure 23040 referenced by dlip shall be filled in as described. Otherwise, 23041 dladdr() shall return zero, and the cause of the error can be 23042 fetched with dlerror(). 23043 23044 Errors 23045 23046 See dlerror(). 23047 23048 Environment 23049 23050 LD_LIBRARY_PATH 23051 23052 directory search-path for object files 23053 23054 dlopen 23055 23056 Name 23057 23058 dlopen -- open dynamic object 23059 23060 Synopsis 23061 23062 #include 23063 23064 void * dlopen(const char * filename, int flag); 23065 23066 Description 23067 23068 The dlopen() function shall behave as specified in ISO POSIX 23069 (2003), but with additional behaviors listed below. 23070 23071 If the file argument does not contain a slash character, then 23072 the system shall look for a library of that name in at least 23073 the following directories, and use the first one which is 23074 found: 23075 23076 * The directories specified by the DT_RPATH dynamic entry. 23077 * The directories specified in the LD_LIBRARY_PATH 23078 environment variable (which is a colon separated list of 23079 pathnames). This step shall be skipped for setuid and 23080 setgid executables. 23081 * A set of directories sufficient to contain the libraries 23082 specified in this standard. 23083 23084 Note: Traditionally, /lib and /usr/lib. This case would also 23085 cover cases in which the system used the mechanism of 23086 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 23087 Example: An application which is not linked against libm may 23088 choose to dlopen libm. 23089 23090 dlsym 23091 23092 Name 23093 23094 dlsym -- obtain the address of a symbol from a dlopen object 23095 23096 Description 23097 23098 dlsym() is as specified in the ISO POSIX (2003), but with 23099 differences as listed below. 23100 23101 RTLD_NEXT, RTLD_DEFAULT Required 23102 23103 The values RTLD_NEXT and RTLD_DEFAULT, described as reserved 23104 for future use in ISO POSIX (2003), are required, with behavior 23105 as described in ISO POSIX (2003). 23106 __________________________________________________________ 23107 23108 13.17. Interfaces for librt 23109 23110 Table 13-50 defines the library name and shared object name for 23111 the librt library 23112 23113 Table 13-50. librt Definition 23114 Library: librt 23115 SONAME: librt.so.1 23116 23117 The behavior of the interfaces in this library is specified by 23118 the following specifications: 23119 23120 [SUSv3] ISO POSIX (2003) 23121 __________________________________________________________ 23122 23123 13.17.1. Shared Memory Objects 23124 __________________________________________________________ 23125 23126 13.17.1.1. Interfaces for Shared Memory Objects 23127 23128 An LSB conforming implementation shall provide the generic 23129 functions for Shared Memory Objects specified in Table 13-51, 23130 with the full mandatory functionality as described in the 23131 referenced underlying specification. 23132 23133 Table 13-51. librt - Shared Memory Objects Function Interfaces 23134 shm_open [SUSv3] shm_unlink [SUSv3] 23135 __________________________________________________________ 23136 23137 13.17.2. Clock 23138 __________________________________________________________ 23139 23140 13.17.2.1. Interfaces for Clock 23141 23142 An LSB conforming implementation shall provide the generic 23143 functions for Clock specified in Table 13-52, with the full 23144 mandatory functionality as described in the referenced 23145 underlying specification. 23146 23147 Table 13-52. librt - Clock Function Interfaces 23148 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 23149 [SUSv3] clock_nanosleep [SUSv3] 23150 clock_settime [SUSv3] 23151 __________________________________________________________ 23152 23153 13.17.3. Timers 23154 __________________________________________________________ 23155 23156 13.17.3.1. Interfaces for Timers 23157 23158 An LSB conforming implementation shall provide the generic 23159 functions for Timers specified in Table 13-53, with the full 23160 mandatory functionality as described in the referenced 23161 underlying specification. 23162 23163 Table 13-53. librt - Timers Function Interfaces 23164 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 23165 [SUSv3] timer_gettime [SUSv3] 23166 timer_settime [SUSv3] 23167 __________________________________________________________ 23168 23169 13.17.4. Message Queues 23170 __________________________________________________________ 23171 23172 13.17.4.1. Interfaces for Message Queues 23173 23174 An LSB conforming implementation shall provide the generic 23175 functions for Message Queues specified in Table 13-54, with the 23176 full mandatory functionality as described in the referenced 23177 underlying specification. 23178 23179 Table 13-54. librt - Message Queues Function Interfaces 23180 mq_close(GLIBC_2.3.4) [SUSv3] mq_getattr(GLIBC_2.3.4) [SUSv3] 23181 mq_notify(GLIBC_2.3.4) [SUSv3] mq_open(GLIBC_2.3.4) [SUSv3] 23182 mq_receive(GLIBC_2.3.4) [SUSv3] mq_send(GLIBC_2.3.4) [SUSv3] 23183 mq_setattr(GLIBC_2.3.4) [SUSv3] mq_timedreceive(GLIBC_2.3.4) 23184 [SUSv3] 23185 mq_timedsend(GLIBC_2.3.4) [SUSv3] mq_unlink(GLIBC_2.3.4) 23186 [SUSv3] 23187 __________________________________________________________ 23188 23189 13.18. Data Definitions for librt 23190 23191 This section defines global identifiers and their values that 23192 are associated with interfaces contained in librt. These 23193 definitions are organized into groups that correspond to system 23194 headers. This convention is used as a convenience for the 23195 reader, and does not imply the existence of these headers, or 23196 their content. Where an interface is defined as requiring a 23197 particular system header file all of the data definitions for 23198 that system header file presented here shall be in effect. 23199 23200 This section gives data definitions to promote binary 23201 application portability, not to repeat source interface 23202 definitions available elsewhere. System providers and 23203 application developers should use this ABI to supplement - not 23204 to replace - source interface definition specifications. 23205 23206 This specification uses the ISO C (1999) C Language as the 23207 reference programming language, and data definitions are 23208 specified in ISO C format. The C language is used here as a 23209 convenient notation. Using a C language description of these 23210 data objects does not preclude their use by other programming 23211 languages. 23212 __________________________________________________________ 23213 23214 13.18.1. mqueue.h 23215 23216 typedef int mqd_t; 23217 struct mq_attr { 23218 long int mq_flags; 23219 long int mq_maxmsg; 23220 long int mq_msgsize; 23221 long int mq_curmsgs; 23222 long int __pad[4]; 23223 }; 23224 extern int mq_close(mqd_t __mqdes); 23225 extern int mq_getattr(mqd_t __mqdes, struct mq_attr *__mqstat); 23226 extern int mq_notify(mqd_t __mqdes, const struct sigevent *__notification); 23227 extern mqd_t mq_open(const char *__name, int __oflag, ...); 23228 extern ssize_t mq_receive(mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, 23229 unsigned int *__msg_prio); 23230 extern int mq_send(mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, 23231 unsigned int __msg_prio); 23232 extern int mq_setattr(mqd_t __mqdes, const struct mq_attr *__mqstat, 23233 struct mq_attr *__omqstat); 23234 extern ssize_t mq_timedreceive(mqd_t __mqdes, char *__msg_ptr, 23235 size_t __msg_len, unsigned int *__msg_prio, 23236 const struct timespec *__abs_timeout); 23237 extern int mq_timedsend(mqd_t __mqdes, const char *__msg_ptr, 23238 size_t __msg_len, unsigned int __msg_prio, 23239 const struct timespec *__abs_timeout); 23240 extern int mq_unlink(const char *__name); 23241 __________________________________________________________ 23242 23243 13.19. Interfaces for libcrypt 23244 23245 Table 13-55 defines the library name and shared object name for 23246 the libcrypt library 23247 23248 Table 13-55. libcrypt Definition 23249 Library: libcrypt 23250 SONAME: libcrypt.so.1 23251 23252 The behavior of the interfaces in this library is specified by 23253 the following specifications: 23254 23255 [SUSv3] ISO POSIX (2003) 23256 __________________________________________________________ 23257 23258 13.19.1. Encryption 23259 __________________________________________________________ 23260 23261 13.19.1.1. Interfaces for Encryption 23262 23263 An LSB conforming implementation shall provide the generic 23264 functions for Encryption specified in Table 13-56, with the 23265 full mandatory functionality as described in the referenced 23266 underlying specification. 23267 23268 Table 13-56. libcrypt - Encryption Function Interfaces 23269 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 23270 __________________________________________________________ 23271 23272 13.20. Interfaces for libpam 23273 23274 Table 13-57 defines the library name and shared object name for 23275 the libpam library 23276 23277 Table 13-57. libpam Definition 23278 Library: libpam 23279 SONAME: libpam.so.0 23280 23281 The Pluggable Authentication Module (PAM) interfaces allow 23282 applications to request authentication via a system 23283 administrator defined mechanism, known as a service. 23284 23285 A single service name, other, shall always be present. The 23286 behavior of this service shall be determined by the system 23287 administrator. Additional service names may also exist. 23288 23289 Note: Future versions of this specification might define 23290 additional service names. 23291 23292 The behavior of the interfaces in this library is specified by 23293 the following specifications: 23294 23295 [LSB] This Specification 23296 __________________________________________________________ 23297 23298 13.20.1. Pluggable Authentication API 23299 __________________________________________________________ 23300 23301 13.20.1.1. Interfaces for Pluggable Authentication API 23302 23303 An LSB conforming implementation shall provide the generic 23304 functions for Pluggable Authentication API specified in Table 23305 13-58, with the full mandatory functionality as described in 23306 the referenced underlying specification. 23307 23308 Table 13-58. libpam - Pluggable Authentication API Function 23309 Interfaces 23310 pam_acct_mgmt [LSB] pam_authenticate [LSB] pam_chauthtok [LSB] 23311 pam_close_session [LSB] 23312 pam_end [LSB] pam_fail_delay [LSB] pam_get_item [LSB] 23313 pam_getenv [LSB] 23314 pam_getenvlist [LSB] pam_open_session [LSB] pam_putenv [LSB] 23315 pam_set_item [LSB] 23316 pam_setcred [LSB] pam_start [LSB] pam_strerror [LSB] 23317 __________________________________________________________ 23318 23319 13.21. Data Definitions for libpam 23320 23321 This section defines global identifiers and their values that 23322 are associated with interfaces contained in libpam. These 23323 definitions are organized into groups that correspond to system 23324 headers. This convention is used as a convenience for the 23325 reader, and does not imply the existence of these headers, or 23326 their content. Where an interface is defined as requiring a 23327 particular system header file all of the data definitions for 23328 that system header file presented here shall be in effect. 23329 23330 This section gives data definitions to promote binary 23331 application portability, not to repeat source interface 23332 definitions available elsewhere. System providers and 23333 application developers should use this ABI to supplement - not 23334 to replace - source interface definition specifications. 23335 23336 This specification uses the ISO C (1999) C Language as the 23337 reference programming language, and data definitions are 23338 specified in ISO C format. The C language is used here as a 23339 convenient notation. Using a C language description of these 23340 data objects does not preclude their use by other programming 23341 languages. 23342 __________________________________________________________ 23343 23344 13.21.1. security/pam_appl.h 23345 23346 typedef struct pam_handle pam_handle_t; 23347 struct pam_message { 23348 int msg_style; 23349 const char *msg; 23350 }; 23351 struct pam_response { 23352 char *resp; 23353 int resp_retcode; /* currently un-used, zero expected */ 23354 }; 23355 23356 struct pam_conv { 23357 int (*conv) (int num_msg, const struct pam_message * *msg, 23358 struct pam_response * *resp, void *appdata_ptr); 23359 void *appdata_ptr; 23360 }; 23361 23362 #define PAM_PROMPT_ECHO_OFF 1 23363 #define PAM_PROMPT_ECHO_ON 2 23364 #define PAM_ERROR_MSG 3 23365 #define PAM_TEXT_INFO 4 23366 23367 #define PAM_SERVICE 1 /* The service name */ 23368 #define PAM_USER 2 /* The user name */ 23369 #define PAM_TTY 3 /* The tty name */ 23370 #define PAM_RHOST 4 /* The remote host name */ 23371 #define PAM_CONV 5 /* The pam_conv structure */ 23372 #define PAM_RUSER 8 /* The remote user name */ 23373 #define PAM_USER_PROMPT 9 /* the prompt for getting a username */ 23374 23375 #define PAM_SUCCESS 0 /* Successful function return */ 23376 #define PAM_OPEN_ERR 1 /* dlopen() failure */ 23377 #define PAM_USER_UNKNOWN 10 /* User not known to the underlying authenticaiton module */ 23378 #define PAM_MAXTRIES 11 /* An authentication service has maintained a retry count which */ 23379 #define PAM_NEW_AUTHTOK_REQD 12 /* New authentication token required */ 23380 #define PAM_ACCT_EXPIRED 13 /* User account has expired */ 23381 #define PAM_SESSION_ERR 14 /* Can not make/remove an entry for the specified session */ 23382 #define PAM_CRED_UNAVAIL 15 /* Underlying authentication service can not retrieve user cred */ 23383 #define PAM_CRED_EXPIRED 16 /* User credentials expired */ 23384 #define PAM_CRED_ERR 17 /* Failure setting user credentials */ 23385 #define PAM_CONV_ERR 19 /* Conversation error */ 23386 #define PAM_SYMBOL_ERR 2 /* Symbol not found */ 23387 #define PAM_AUTHTOK_ERR 20 /* Authentication token manipulation error */ 23388 #define PAM_AUTHTOK_RECOVER_ERR 21 /* Authentication information cannot be recovered */ 23389 #define PAM_AUTHTOK_LOCK_BUSY 22 /* Authentication token lock busy */ 23390 #define PAM_AUTHTOK_DISABLE_AGING 23 /* Authentication tokenaging disabled */ 23391 #define PAM_TRY_AGAIN 24 /* Preliminary check by password service */ 23392 #define PAM_ABORT 26 /* Critical error (?module fail now request) */ 23393 #define PAM_AUTHTOK_EXPIRED 27 /* user's authentication token has expired */ 23394 #define PAM_BAD_ITEM 29 /* Bad item passed to pam_*_item() */ 23395 #define PAM_SERVICE_ERR 3 /* Error in service module */ 23396 #define PAM_SYSTEM_ERR 4 /* System error */ 23397 #define PAM_BUF_ERR 5 /* Memory buffer error */ 23398 #define PAM_PERM_DENIED 6 /* Permission denied */ 23399 #define PAM_AUTH_ERR 7 /* Authentication failure */ 23400 #define PAM_CRED_INSUFFICIENT 8 /* Can not access authentication data due to insufficient crede */ 23401 #define PAM_AUTHINFO_UNAVAIL 9 /* Underlying authentication service can not retrieve authentic */ 23402 23403 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 23404 #define PAM_ESTABLISH_CRED 0x0002U /* Set user credentials for an authentication service */ 23405 #define PAM_DELETE_CRED 0x0004U /* Delete user credentials associated with an authentication se */ 23406 #define PAM_REINITIALIZE_CRED 0x0008U /* Reinitialize user credentials */ 23407 #define PAM_REFRESH_CRED 0x0010U /* Extend lifetime of user credentials */ 23408 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U /* Extend lifetime of user credentials */ 23409 #define PAM_SILENT 0x8000U /* Authentication service should not generate any messages */ 23410 23411 extern int pam_acct_mgmt(pam_handle_t *, int); 23412 extern int pam_authenticate(pam_handle_t *, int); 23413 extern int pam_chauthtok(pam_handle_t *, int); 23414 extern int pam_close_session(pam_handle_t *, int); 23415 extern int pam_end(pam_handle_t *, int); 23416 extern int pam_fail_delay(pam_handle_t *, unsigned int); 23417 extern int pam_get_item(const pam_handle_t *, int, const void **); 23418 extern const char *pam_getenv(pam_handle_t *, const char *); 23419 extern char **pam_getenvlist(pam_handle_t *); 23420 extern int pam_open_session(pam_handle_t *, int); 23421 extern int pam_putenv(pam_handle_t *, const char *); 23422 extern int pam_set_item(pam_handle_t *, int, const void *); 23423 extern int pam_setcred(pam_handle_t *, int); 23424 extern int pam_start(const char *, const char *, const struct pam_conv *, 23425 pam_handle_t * *); 23426 extern const char *pam_strerror(pam_handle_t *, int); 23427 __________________________________________________________ 23428 23429 13.22. Interface Definitions for libpam 23430 23431 Table of Contents 23432 pam_acct_mgmt -- establish the status of a user's account 23433 pam_authenticate -- authenticate the user 23434 pam_chauthtok -- change the authentication token for a given 23435 user 23436 23437 pam_close_session -- indicate that an authenticated session has 23438 ended 23439 23440 pam_end -- terminate the use of the PAM library 23441 pam_fail_delay -- specify delay time to use on authentication 23442 error 23443 23444 pam_get_item -- obtain the value of the indicated item. 23445 pam_getenv -- get a PAM environment variable 23446 pam_getenvlist -- returns a pointer to the complete PAM 23447 environment. 23448 23449 pam_open_session -- indicate session has started 23450 pam_putenv -- Add, replace or delete a PAM environment variable 23451 pam_set_item -- (re)set the value of an item. 23452 pam_setcred -- set the module-specific credentials of the user 23453 pam_start -- initialize the PAM library 23454 pam_strerror -- returns a string describing the PAM error 23455 23456 The interfaces defined on the following pages are included in 23457 libpam and are defined by this specification. Unless otherwise 23458 noted, these interfaces shall be included in the source 23459 standard. 23460 23461 Other interfaces listed in Section 13.20 shall behave as 23462 described in the referenced base document. 23463 23464 pam_acct_mgmt 23465 23466 Name 23467 23468 pam_acct_mgmt -- establish the status of a user's account 23469 23470 Synopsis 23471 23472 #include 23473 23474 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 23475 23476 Description 23477 23478 pam_acct_mgmt() establishes the account's usability and the 23479 user's accessibility to the system. It is typically called 23480 after the user has been authenticated. 23481 23482 flags may be specified as any valid flag (namely, one of those 23483 applicable to the flags argument of pam_authenticate()). 23484 Additionally, the value of flags may be logically or'd with 23485 PAM_SILENT. 23486 23487 Return Value 23488 23489 PAM_SUCCESS 23490 23491 Success. 23492 PAM_NEW_AUTHTOK_REQD 23493 23494 User is valid, but user's authentication token has expired. The 23495 correct response to this return-value is to require that the 23496 user satisfy the pam_chauthtok() function before obtaining 23497 service. It may not be possible for an application to do this. 23498 In such a case, the user should be denied access until the 23499 account password is updated. 23500 PAM_ACCT_EXPIRED 23501 23502 User is no longer permitted access to the system. 23503 PAM_AUTH_ERR 23504 23505 Authentication error. 23506 PAM_PERM_DENIED 23507 23508 User is not permitted to gain access at this time. 23509 PAM_USER_UNKNOWN 23510 23511 User is not known to a module's account management component. 23512 23513 Note: Errors may be translated to text with pam_strerror(). 23514 23515 pam_authenticate 23516 23517 Name 23518 23519 pam_authenticate -- authenticate the user 23520 23521 Synopsis 23522 23523 #include 23524 23525 int pam_authenticate(pam_handle_t * pamh, int flags); 23526 23527 Description 23528 23529 pam_authenticate() serves as an interface to the authentication 23530 mechanisms of the loaded modules. 23531 23532 flags is an optional parameter that may be specified by the 23533 following value: 23534 23535 PAM_DISALLOW_NULL_AUTHTOK 23536 Instruct the authentication modules to return 23537 PAM_AUTH_ERR if the user does not have a registered 23538 authorization token. 23539 23540 Additionally, the value of flags may be logically or'd with 23541 PAM_SILENT. 23542 23543 The process may need to be privileged in order to successfully 23544 call this function. 23545 23546 Return Value 23547 23548 PAM_SUCCESS 23549 Success. 23550 23551 PAM_AUTH_ERR 23552 User was not authenticated or process did not have 23553 sufficient privileges to perform authentication. 23554 23555 PAM_CRED_INSUFFICIENT 23556 Application does not have sufficient credentials to 23557 authenticate the user. 23558 23559 PAM_AUTHINFO_UNAVAIL 23560 Modules were not able to access the authentication 23561 information. This might be due to a network or hardware 23562 failure, etc. 23563 23564 PAM_USER_UNKNOWN 23565 Supplied username is not known to the authentication 23566 service. 23567 23568 PAM_MAXTRIES 23569 One or more authentication modules has reached its limit 23570 of tries authenticating the user. Do not try again. 23571 23572 PAM_ABORT 23573 One or more authentication modules failed to load. 23574 23575 Note: Errors may be translated to text with pam_strerror(). 23576 23577 pam_chauthtok 23578 23579 Name 23580 23581 pam_chauthtok -- change the authentication token for a given 23582 user 23583 23584 Synopsis 23585 23586 #include 23587 23588 int pam_chauthtok(pam_handle_t * pamh, const int flags); 23589 23590 Description 23591 23592 pam_chauthtok() is used to change the authentication token for 23593 a given user as indicated by the state associated with the 23594 handle pamh. 23595 23596 flags is an optional parameter that may be specified by the 23597 following value: 23598 23599 PAM_CHANGE_EXPIRED_AUTHTOK 23600 User's authentication token should only be changed if it 23601 has expired. 23602 23603 Additionally, the value of flags may be logically or'd with 23604 PAM_SILENT. 23605 23606 RETURN VALUE 23607 23608 PAM_SUCCESS 23609 Success. 23610 23611 PAM_AUTHTOK_ERR 23612 A module was unable to obtain the new authentication 23613 token. 23614 23615 PAM_AUTHTOK_RECOVER_ERR 23616 A module was unable to obtain the old authentication 23617 token. 23618 23619 PAM_AUTHTOK_LOCK_BUSY 23620 One or more modules were unable to change the 23621 authentication token since it is currently locked. 23622 23623 PAM_AUTHTOK_DISABLE_AGING 23624 Authentication token aging has been disabled for at 23625 least one of the modules. 23626 23627 PAM_PERM_DENIED 23628 Permission denied. 23629 23630 PAM_TRY_AGAIN 23631 Not all modules were in a position to update the 23632 authentication token(s). In such a case, none of the 23633 user's authentication tokens are updated. 23634 23635 PAM_USER_UNKNOWN 23636 User is not known to the authentication token changing 23637 service. 23638 23639 Note: Errors may be translated to text with pam_strerror(). 23640 23641 pam_close_session 23642 23643 Name 23644 23645 pam_close_session -- indicate that an authenticated session has 23646 ended 23647 23648 Synopsis 23649 23650 #include 23651 23652 int pam_close_session(pam_handle_t * pamh, int flags); 23653 23654 Description 23655 23656 pam_close_session() is used to indicate that an authenticated 23657 session has ended. It is used to inform the module that the 23658 user is exiting a session. It should be possible for the PAM 23659 library to open a session and close the same session from 23660 different applications. 23661 23662 flags may have the value PAM_SILENT to indicate that no output 23663 should be generated as a result of this function call. 23664 23665 Return Value 23666 23667 PAM_SUCCESS 23668 23669 Success. 23670 PAM_SESSION_ERR 23671 23672 One of the required loaded modules was unable to close a 23673 session for the user. 23674 23675 Note: Errors may be translated to text with pam_strerror(). 23676 23677 pam_end 23678 23679 Name 23680 23681 pam_end -- terminate the use of the PAM library 23682 23683 Synopsis 23684 23685 #include 23686 23687 int pam_end(pam_handle_t * pamh, int pam_status); 23688 23689 Description 23690 23691 pam_end() terminates use of the PAM library. On success, the 23692 contents of *pamh are no longer valid, and all memory 23693 associated with it is invalid. 23694 23695 Normally, pam_status is passed the value PAM_SUCCESS, but in 23696 the event of an unsuccessful service application, the 23697 appropriate PAM error return value should be used. 23698 23699 Return Value 23700 23701 PAM_SUCCESS 23702 23703 Success. 23704 23705 Note: Errors may be translated to text with pam_strerror(). 23706 23707 pam_fail_delay 23708 23709 Name 23710 23711 pam_fail_delay -- specify delay time to use on authentication 23712 error 23713 23714 Synopsis 23715 23716 #include 23717 23718 int pam_fail_delay(pam_handle_t * pamh, unsigned int 23719 micro_sec); 23720 23721 Description 23722 23723 pam_fail_delay() specifies the minimum delay for the PAM 23724 library to use when an authentication error occurs. The actual 23725 delay can vary by as much at 25%. If this function is called 23726 multiple times, the longest time specified by any of the call 23727 will be used. 23728 23729 The delay is invoked if an authentication error occurs during 23730 the pam_authenticate() or pam_chauthtok() function calls. 23731 23732 Independent of the success of pam_authenticate() or 23733 pam_chauthtok(), the delay time is reset to its default value 23734 of 0 when the PAM library returns control to the application 23735 from these two functions. 23736 23737 Return Value 23738 23739 PAM_SUCCESS 23740 23741 Success. 23742 23743 Note: Errors may be translated to text with pam_strerror(). 23744 23745 pam_get_item 23746 23747 Name 23748 23749 pam_get_item -- obtain the value of the indicated item. 23750 23751 Synopsis 23752 23753 #include 23754 23755 int pam_get_item(const pam_handle_t * pamh, int item_type, 23756 const void * * item); 23757 23758 Description 23759 23760 pam_get_item() obtains the value of the indicated item_type. 23761 The possible values of item_type are the same as listed for 23762 pam_set_item(). 23763 23764 On success, item contains a pointer to the value of the 23765 corresponding item. Note that this is a pointer to the actual 23766 data and should not be free()'d or over-written. 23767 23768 Return Value 23769 23770 PAM_SUCCESS 23771 23772 Success. 23773 PAM_PERM_DENIED 23774 23775 Application passed a NULL pointer for item. 23776 PAM_BAD_ITEM 23777 23778 Application attempted to get an undefined item. 23779 23780 Note: Errors may be translated to text with pam_strerror(). 23781 23782 pam_getenv 23783 23784 Name 23785 23786 pam_getenv -- get a PAM environment variable 23787 23788 Synopsis 23789 23790 #include 23791 23792 const char * pam_getenv(const pam_handle_t * pamh, const char * 23793 name); 23794 23795 Description 23796 23797 The pam_getenv() function shall search the environment 23798 associated with the PAM handle pamh for the environment 23799 variable name. If the specified environment variable cannot be 23800 found, a null pointer shall be returned. The application shall 23801 ensure that it does not modify the string pointed to by the 23802 pam_getenv() function. 23803 23804 Return Value 23805 23806 On success, pam_getenv() returns a pointer to a string of the 23807 form name=value. 23808 23809 pam_getenvlist 23810 23811 Name 23812 23813 pam_getenvlist -- returns a pointer to the complete PAM 23814 environment. 23815 23816 Synopsis 23817 23818 #include 23819 23820 char * const * pam_getenvlist(pam_handle_t * pamh); 23821 23822 Description 23823 23824 pam_getenvlist() returns a pointer to the complete PAM 23825 environment. This pointer points to an array of pointers to 23826 NUL-terminated strings and must be terminated by a NULL 23827 pointer. Each string has the form "name=value". 23828 23829 The PAM library module allocates memory for the returned value 23830 and the associated strings. The calling application is 23831 responsible for freeing this memory. 23832 23833 Return Value 23834 23835 pam_getenvlist() returns an array of string pointers containing 23836 the PAM environment. On error, NULL is returned. 23837 23838 pam_open_session 23839 23840 Name 23841 23842 pam_open_session -- indicate session has started 23843 23844 Synopsis 23845 23846 #include 23847 23848 int pam_open_session(pam_handle_t * pamh, int flags); 23849 23850 Description 23851 23852 The pam_open_session() function is used to indicate that an 23853 authenticated session has begun, after the user has been 23854 identified (see pam_authenticate()) and, if necessary, granted 23855 credentials (see pam_setcred()). It is used to inform the 23856 module that the user is currently in a session. It should be 23857 possible for the PAM library to open a session and close the 23858 same session from different applications. 23859 23860 flags may have the value PAM_SILENT to indicate that no output 23861 be generated as a result of this function call. 23862 23863 Return Value 23864 23865 PAM_SUCCESS 23866 23867 Success. 23868 PAM_SESSION_ERR 23869 23870 One of the loaded modules was unable to open a session for the 23871 user. 23872 23873 Note: Errors may be translated to text with pam_strerror(). 23874 23875 pam_putenv 23876 23877 Name 23878 23879 pam_putenv -- Add, replace or delete a PAM environment variable 23880 23881 Synopsis 23882 23883 #include 23884 23885 int pam_putenv(const pam_handle_t * pamh, const char * 23886 name_value); 23887 23888 Description 23889 23890 The pam_putenv() function shall modify the environment list 23891 associated with pamh. If name_value contains an '=' character, 23892 the characters to the left of the first '=' character represent 23893 the name, and the remaining characters after the '=' represent 23894 the value. 23895 23896 If the name environment variable exists in the environment 23897 associated with pamh, it shall be modified to have the value 23898 value. Otherwise, the name shall be added to the environment 23899 associated with pamh with the value value. 23900 23901 If there is no '=' character in name_value, the variable in the 23902 environment associated with pamh named name_value shall be 23903 deleted. 23904 23905 Return Value 23906 23907 On success, the pam_putenv() function shall return PAM_SUCCESS. 23908 Otherwise the return value indicates the error: 23909 23910 PAM_PERM_DENIED 23911 23912 The name_value argument is a null pointer. 23913 PAM_BAD_ITEM 23914 23915 The PAM environment varable named name_value does not exist and 23916 therefore cannot be deleted. 23917 PAM_ABORT 23918 23919 The PAM handle identifed by pamh is corrupt. 23920 PAM_BUF_ERR 23921 23922 Memory buffer error. 23923 23924 pam_set_item 23925 23926 Name 23927 23928 pam_set_item -- (re)set the value of an item. 23929 23930 Synopsis 23931 23932 #include 23933 23934 int pam_set_item(pam_handle_t * pamh, int item_type, const void 23935 * item); 23936 23937 Description 23938 23939 pam_set_item() (re)sets the value of one of the following 23940 item_types: 23941 23942 PAM_SERVICE 23943 23944 service name 23945 PAM_USER 23946 23947 user name 23948 PAM_TTY 23949 23950 terminal name 23951 23952 The value for a device file should include the /dev/ prefix. 23953 The value for graphical, X-based, applications should be the 23954 $DISPLAY variable. 23955 PAM_RHOST 23956 23957 remote host name 23958 PAM_CONV 23959 23960 conversation structure 23961 PAM_RUSER 23962 23963 remote user name 23964 PAM_USER_PROMPT 23965 23966 string to be used when prompting for a user's name 23967 23968 The default value for this string is Please enter username: . 23969 23970 For all item_types other than PAM_CONV, item is a pointer to a 23971 NULL-terminated character string. In the case of PAM_CONV, item 23972 points to an initialized pam_conv structure. 23973 23974 Return Value 23975 23976 PAM_SUCCESS 23977 23978 Success. 23979 PAM_PERM_DENIED 23980 23981 An attempt was made to replace the conversation structure with 23982 a NULL value. 23983 PAM_BUF_ERR 23984 23985 Function ran out of memory making a copy of the item. 23986 PAM_BAD_ITEM 23987 23988 Application attempted to set an undefined item. 23989 23990 Note: Errors may be translated to text with pam_strerror(). 23991 23992 pam_setcred 23993 23994 Name 23995 23996 pam_setcred -- set the module-specific credentials of the user 23997 23998 Synopsis 23999 24000 #include 24001 24002 extern int pam_setcred(pam_handle_t * pamh, int flags); 24003 24004 Description 24005 24006 pam_setcred() sets the module-specific credentials of the user. 24007 It is usually called after the user has been authenticated, 24008 after the account management function has been called and after 24009 a session has been opened for the user. 24010 24011 flags maybe specified from among the following values: 24012 24013 PAM_ESTABLISH_CRED 24014 set credentials for the authentication service 24015 24016 PAM_DELETE_CRED 24017 delete credentials associated with the authentication 24018 service 24019 24020 PAM_REINITIALIZE_CRED 24021 reinitialize the user credentials 24022 24023 PAM_REFRESH_CRED 24024 extend lifetime of the user credentials 24025 24026 Additionally, the value of flags may be logically or'd with 24027 PAM_SILENT. 24028 24029 Return Value 24030 24031 PAM_SUCCESS 24032 24033 Success. 24034 PAM_CRED_UNAVAIL 24035 24036 Module cannot retrieve the user's credentials. 24037 PAM_CRED_EXPIRED 24038 24039 User's credentials have expired. 24040 PAM_USER_UNKNOWN 24041 24042 User is not known to an authentication module. 24043 PAM_CRED_ERR 24044 24045 Module was unable to set the credentials of the user. 24046 24047 Note: Errors may be translated to text with pam_strerror(). 24048 24049 pam_start 24050 24051 Name 24052 24053 pam_start -- initialize the PAM library 24054 24055 Synopsis 24056 24057 #include 24058 24059 int pam_start(const char * service_name, const char * user, 24060 const struct pam_conv * pam_conversation, pam_handle_t * * 24061 pamh); 24062 24063 Description 24064 24065 pam_start() is used to initialize the PAM library. It must be 24066 called prior to any other usage of the PAM library. On success, 24067 *pamh becomes a handle that provides continuity for successive 24068 calls to the PAM library. pam_start() expects arguments as 24069 follows: the service_name of the program, the username of the 24070 individual to be authenticated, a pointer to an 24071 application-supplied pam_conv structure, and a pointer to a 24072 pam_handle_t pointer. 24073 24074 An application must provide the conversation function used for 24075 direct communication between a loaded module and the 24076 application. The application also typically provides a means 24077 for the module to prompt the user for a password, etc. 24078 24079 The structure, pam_conv, is defined to be, 24080 struct pam_conv { 24081 int (*conv) (int num_msg, 24082 const struct pam_message * *msg, 24083 struct pam_response * *resp, 24084 void *appdata_ptr); 24085 void *appdata_ptr; 24086 }; 24087 24088 It is initialized by the application before it is passed to the 24089 library. The contents of this structure are attached to the 24090 *pamh handle. The point of this argument is to provide a 24091 mechanism for any loaded module to interact directly with the 24092 application program; this is why it is called a conversation 24093 structure. 24094 24095 When a module calls the referenced conv() function, appdata_ptr 24096 is set to the second element of this structure. 24097 24098 The other arguments of a call to conv() concern the information 24099 exchanged by module and application. num_msg holds the length 24100 of the array of pointers passed via msg. On success, the 24101 pointer resp points to an array of num_msg pam_response 24102 structures, holding the application-supplied text. Note that 24103 resp is a struct pam_response array and not an array of 24104 pointers. 24105 24106 Return Value 24107 24108 PAM_SUCCESS 24109 24110 Success. 24111 PAM_BUF_ERR 24112 24113 Memory allocation error. 24114 PAM_ABORT 24115 24116 Internal failure. 24117 24118 ERRORS 24119 24120 May be translated to text with pam_strerror(). 24121 24122 pam_strerror 24123 24124 Name 24125 24126 pam_strerror -- returns a string describing the PAM error 24127 24128 Synopsis 24129 24130 #include 24131 24132 const char * pam_strerror(pam_handle_t * pamh, int errnum); 24133 24134 Description 24135 24136 pam_strerror() returns a string describing the PAM error 24137 associated with errnum. 24138 24139 Return Value 24140 24141 On success, this function returns a description of the 24142 indicated error. The application should not free or modify this 24143 string. Otherwise, a string indicating that the error is 24144 unknown shall be returned. It is unspecified whether or not the 24145 string returned is translated according to the setting of 24146 LC_MESSAGES. 24147 24148 IV. Utility Libraries 24149 24150 Table of Contents 24151 14. Utility Libraries 24152 24153 14.1. Introduction 24154 14.2. Interfaces for libz 24155 24156 14.2.1. Compression Library 24157 24158 14.3. Data Definitions for libz 24159 24160 14.3.1. zlib.h 24161 24162 14.4. Interface Definitions for libz 24163 24164 adler32 -- compute Adler 32 Checksum 24165 compress -- compress data 24166 compress2 -- compress data at a specified level 24167 compressBound -- compute compressed data size 24168 crc32 -- compute CRC-32 Checksum 24169 deflate -- compress data 24170 deflateBound -- compute compressed data size 24171 deflateCopy -- copy compression stream 24172 deflateEnd -- free compression stream state 24173 deflateInit2_ -- initialize compression system 24174 deflateInit_ -- initialize compression system 24175 deflateParams -- set compression parameters 24176 deflateReset -- reset compression stream state 24177 deflateSetDictionary -- initialize compression 24178 dictionary 24179 24180 get_crc_table -- generate a table for crc 24181 calculations 24182 24183 gzclose -- close a compressed file stream 24184 gzdopen -- open a compressed file 24185 gzeof -- check for end-of-file on a compressed file 24186 stream 24187 24188 gzerror -- decode an error on a compressed file 24189 stream 24190 24191 gzflush -- flush a compressed file stream 24192 gzgetc -- read a character from a compressed file 24193 gzgets -- read a string from a compressed file 24194 gzopen -- open a compressed file 24195 gzprintf -- format data and compress 24196 gzputc -- write character to a compressed file 24197 gzputs -- string write to a compressed file 24198 gzread -- read from a compressed file 24199 gzrewind -- reset the file-position indicator on a 24200 compressed file stream 24201 24202 gzseek -- reposition a file-position indicator in a 24203 compressed file stream 24204 24205 gzsetparams -- dynamically set compression 24206 parameters 24207 24208 gztell -- find position on a compressed file stream 24209 gzwrite -- write to a compressed file 24210 inflate -- decompress data 24211 inflateEnd -- free decompression stream state 24212 inflateInit2_ -- initialize decompression system 24213 inflateInit_ -- initialize decompression system 24214 inflateReset -- reset decompression stream state 24215 inflateSetDictionary -- initialize decompression 24216 dictionary 24217 24218 inflateSync -- advance compression stream to next 24219 sync point 24220 24221 inflateSyncPoint -- test for synchronization point 24222 uncompress -- uncompress data 24223 zError -- translate error number to string 24224 zlibVersion -- discover library version at run time 24225 24226 14.5. Interfaces for libncurses 24227 24228 14.5.1. Curses 24229 24230 14.6. Data Definitions for libncurses 24231 24232 14.6.1. curses.h 24233 14.6.2. term.h 24234 24235 14.7. Interface Definitions for libncurses 24236 24237 inchnstr -- obtain a string of characters and their 24238 attributes from a curses window 24239 24240 inchstr -- obtain a string of characters and their 24241 attributes from a curses window 24242 24243 instr -- obtain a string of characters from a curses 24244 window 24245 24246 mvcur -- send cursor movement commands to terminal 24247 mvinchnstr -- obtain a string of characters and 24248 their attributes from a curses window 24249 24250 mvinchstr -- obtain a string of characters and their 24251 attributes from a curses window 24252 24253 mvinstr -- obtain a string of characters from a 24254 curses window 24255 24256 mvscanw -- convert formatted input from a curses 24257 window 24258 24259 mvwinchnstr -- obtain a string of characters and 24260 their attributes from a curses window 24261 24262 mvwinchstr -- obtain a string of characters and 24263 their attributes from a curses window 24264 24265 mvwinstr -- obtain a string of characters from a 24266 curses window 24267 24268 mvwscanw -- convert formatted input from a curses 24269 window 24270 24271 ripoffline -- obtain a string of characters and 24272 their attributes from a curses window 24273 24274 scanw -- convert formatted input from a curses 24275 window 24276 24277 vw_scanw -- convert formatted input from a curses 24278 window 24279 24280 vwscanw -- convert formatted input from a curses 24281 window 24282 24283 winchnstr -- obtain a string of characters and their 24284 attributes from a curses window 24285 24286 winchstr -- obtain a string of characters and their 24287 attributes from a curses window 24288 24289 winstr -- obtain a string of characters from a 24290 curses window 24291 24292 wscanw -- convert formatted input from a curses 24293 window 24294 24295 14.8. Interfaces for libutil 24296 24297 14.8.1. Utility Functions 24298 24299 14.9. Interface Definitions for libutil 24300 24301 forkpty -- Create a new process attached to an 24302 available pseudo-terminal 24303 24304 login -- login utility function 24305 login_tty -- Prepare a terminal for login 24306 logout -- logout utility function 24307 logwtmp -- append an entry to the wtmp file 24308 openpty -- find and open an available 24309 pseudo-terminal 24310 __________________________________________________________ 24311 24312 Chapter 14. Utility Libraries 24313 24314 14.1. Introduction 24315 24316 An LSB-conforming implementation shall also support the 24317 following utility libraries which are built on top of the 24318 interfaces provided by the base libraries. These libraries 24319 implement common functionality, and hide additional system 24320 dependent information such as file formats and device names. 24321 24322 * libz 24323 * libcurses 24324 * libutil 24325 24326 The structure of the definitions for these libraries follows 24327 the same model as used for Base Libraries. 24328 __________________________________________________________ 24329 24330 14.2. Interfaces for libz 24331 24332 Table 14-1 defines the library name and shared object name for 24333 the libz library 24334 24335 Table 14-1. libz Definition 24336 Library: libz 24337 SONAME: libz.so.1 24338 24339 The behavior of the interfaces in this library is specified by 24340 the following specifications: 24341 24342 [LSB] This Specification 24343 __________________________________________________________ 24344 24345 14.2.1. Compression Library 24346 __________________________________________________________ 24347 24348 14.2.1.1. Interfaces for Compression Library 24349 24350 An LSB conforming implementation shall provide the generic 24351 functions for Compression Library specified in Table 14-2, with 24352 the full mandatory functionality as described in the referenced 24353 underlying specification. 24354 24355 Table 14-2. libz - Compression Library Function Interfaces 24356 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 24357 [LSB] 24358 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 24359 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 24360 deflateParams [LSB] 24361 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 24362 [LSB] gzclose [LSB] 24363 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 24364 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 24365 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 24366 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 24367 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] inflateInit_ 24368 [LSB] 24369 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync [LSB] 24370 inflateSyncPoint [LSB] 24371 uncompress [LSB] zError [LSB] zlibVersion [LSB] 24372 __________________________________________________________ 24373 24374 14.3. Data Definitions for libz 24375 24376 This section defines global identifiers and their values that 24377 are associated with interfaces contained in libz. These 24378 definitions are organized into groups that correspond to system 24379 headers. This convention is used as a convenience for the 24380 reader, and does not imply the existence of these headers, or 24381 their content. Where an interface is defined as requiring a 24382 particular system header file all of the data definitions for 24383 that system header file presented here shall be in effect. 24384 24385 This section gives data definitions to promote binary 24386 application portability, not to repeat source interface 24387 definitions available elsewhere. System providers and 24388 application developers should use this ABI to supplement - not 24389 to replace - source interface definition specifications. 24390 24391 This specification uses the ISO C (1999) C Language as the 24392 reference programming language, and data definitions are 24393 specified in ISO C format. The C language is used here as a 24394 convenient notation. Using a C language description of these 24395 data objects does not preclude their use by other programming 24396 languages. 24397 __________________________________________________________ 24398 24399 14.3.1. zlib.h 24400 24401 #define Z_NULL 0 24402 #define ZLIB_VERSION "1.2.2" 24403 #define MAX_WBITS 15 /* 32K LZ77 window */ 24404 #define MAX_MEM_LEVEL 9 /* Maximum value for memLevel in deflateInit2 */ 24405 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy)\ 24406 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 24407 #define deflateInit(strm,level) \ 24408 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 24409 #define inflateInit2(strm,windowBits) \ 24410 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 24411 #define inflateInit(strm) \ 24412 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 24413 24414 typedef char charf; 24415 typedef int intf; 24416 24417 typedef void *voidpf; 24418 typedef unsigned int uInt; 24419 typedef unsigned long int uLong; 24420 typedef uLong uLongf; 24421 typedef void *voidp; 24422 typedef unsigned char Byte; 24423 typedef off_t z_off_t; 24424 typedef void *const voidpc; 24425 24426 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 24427 typedef void (*free_func) (voidpf opaque, voidpf address); 24428 struct internal_state { 24429 int dummy; 24430 }; 24431 typedef Byte Bytef; 24432 typedef uInt uIntf; 24433 24434 typedef struct z_stream_s { 24435 Bytef *next_in; /* next input byte */ 24436 uInt avail_in; /* number of bytes available at next_in*/ 24437 uLong total_in; /* total nb of input bytes read so far */ 24438 Bytef *next_out; /* next output byte should be put there*/ 24439 uInt avail_out; /* remaining free space at next_out */ 24440 uLong total_out; /* total nb of bytes output so far */ 24441 char *msg; /* last error message, NULL if no error*/ 24442 struct internal_state *state; /* not visible by applications */ 24443 alloc_func zalloc; /* used to allocate the internal state */ 24444 free_func zfree; /* used to free the internal state */ 24445 voidpf opaque; /* private data object passed to zallocand zfree */ 24446 int data_type; /* best guess about the data type: ascii or binary */ 24447 uLong adler; /* adler32 value of the uncompressed data */ 24448 uLong reserved; /* reserved for future use */ 24449 } z_stream; 24450 24451 typedef z_stream *z_streamp; 24452 typedef voidp gzFile; 24453 24454 #define Z_NO_FLUSH 0 24455 #define Z_PARTIAL_FLUSH 1 24456 #define Z_SYNC_FLUSH 2 24457 #define Z_FULL_FLUSH 3 24458 #define Z_FINISH 4 24459 #define Z_BLOCK 5 24460 24461 #define Z_ERRNO (-1) 24462 #define Z_STREAM_ERROR (-2) 24463 #define Z_DATA_ERROR (-3) 24464 #define Z_MEM_ERROR (-4) 24465 #define Z_BUF_ERROR (-5) 24466 #define Z_VERSION_ERROR (-6) 24467 #define Z_OK 0 24468 #define Z_STREAM_END 1 24469 #define Z_NEED_DICT 2 24470 24471 #define Z_DEFAULT_COMPRESSION (-1) 24472 #define Z_NO_COMPRESSION 0 24473 #define Z_BEST_SPEED 1 24474 #define Z_BEST_COMPRESSION 9 24475 24476 #define Z_DEFAULT_STRATEGY 0 24477 #define Z_FILTERED 1 24478 #define Z_HUFFMAN_ONLY 2 24479 24480 #define Z_BINARY 0 24481 #define Z_ASCII 1 24482 #define Z_UNKNOWN 2 24483 24484 #define Z_DEFLATED 8 24485 24486 extern uLong adler32(uLong adler, const Bytef * buf, uInt len); 24487 extern int compress(Bytef * dest, uLongf * destLen, const Bytef * source, 24488 uLong sourceLen); 24489 extern int compress2(Bytef * dest, uLongf * destLen, const Bytef * source, 24490 uLong sourceLen, int level); 24491 extern uLong compressBound(uLong sourceLen); 24492 extern uLong crc32(uLong crc, const Bytef * buf, uInt len); 24493 extern int deflate(z_streamp strm, int flush); 24494 extern uLong deflateBound(z_streamp strm, uLong sourceLen); 24495 extern int deflateCopy(z_streamp dest, z_streamp source); 24496 extern int deflateEnd(z_streamp strm); 24497 extern int deflateInit2_(z_streamp strm, int level, int method, 24498 int windowBits, int memLevel, int strategy, 24499 const char *version, int stream_size); 24500 extern int deflateInit_(z_streamp strm, int level, const char *version, 24501 int stream_size); 24502 extern int deflateParams(z_streamp strm, int level, int strategy); 24503 extern int deflateReset(z_streamp strm); 24504 extern int deflateSetDictionary(z_streamp strm, const Bytef * dictionary, 24505 uInt dictLength); 24506 extern const uLongf *get_crc_table(void); 24507 extern int gzclose(gzFile file); 24508 extern gzFile gzdopen(int fd, const char *mode); 24509 extern int gzeof(gzFile file); 24510 extern const char *gzerror(gzFile file, int *errnum); 24511 extern int gzflush(gzFile file, int flush); 24512 extern int gzgetc(gzFile file); 24513 extern char *gzgets(gzFile file, char *buf, int len); 24514 extern gzFile gzopen(const char *path, const char *mode); 24515 extern int gzprintf(gzFile file, const char *format, ...); 24516 extern int gzputc(gzFile file, int c); 24517 extern int gzputs(gzFile file, const char *s); 24518 extern int gzread(gzFile file, voidp buf, unsigned int len); 24519 extern int gzrewind(gzFile file); 24520 extern z_off_t gzseek(gzFile file, z_off_t offset, int whence); 24521 extern int gzsetparams(gzFile file, int level, int strategy); 24522 extern z_off_t gztell(gzFile file); 24523 extern int gzwrite(gzFile file, voidpc buf, unsigned int len); 24524 extern int inflate(z_streamp strm, int flush); 24525 extern int inflateEnd(z_streamp strm); 24526 extern int inflateInit2_(z_streamp strm, int windowBits, 24527 const char *version, int stream_size); 24528 extern int inflateInit_(z_streamp strm, const char *version, 24529 int stream_size); 24530 extern int inflateReset(z_streamp strm); 24531 extern int inflateSetDictionary(z_streamp strm, const Bytef * dictionary, 24532 uInt dictLength); 24533 extern int inflateSync(z_streamp strm); 24534 extern int inflateSyncPoint(z_streamp z); 24535 extern int uncompress(Bytef * dest, uLongf * destLen, const Bytef * source, 24536 uLong sourceLen); 24537 extern const char *zError(int); 24538 extern const char *zlibVersion(void); 24539 __________________________________________________________ 24540 24541 14.4. Interface Definitions for libz 24542 24543 Table of Contents 24544 adler32 -- compute Adler 32 Checksum 24545 compress -- compress data 24546 compress2 -- compress data at a specified level 24547 compressBound -- compute compressed data size 24548 crc32 -- compute CRC-32 Checksum 24549 deflate -- compress data 24550 deflateBound -- compute compressed data size 24551 deflateCopy -- copy compression stream 24552 deflateEnd -- free compression stream state 24553 deflateInit2_ -- initialize compression system 24554 deflateInit_ -- initialize compression system 24555 deflateParams -- set compression parameters 24556 deflateReset -- reset compression stream state 24557 deflateSetDictionary -- initialize compression dictionary 24558 get_crc_table -- generate a table for crc calculations 24559 gzclose -- close a compressed file stream 24560 gzdopen -- open a compressed file 24561 gzeof -- check for end-of-file on a compressed file stream 24562 gzerror -- decode an error on a compressed file stream 24563 gzflush -- flush a compressed file stream 24564 gzgetc -- read a character from a compressed file 24565 gzgets -- read a string from a compressed file 24566 gzopen -- open a compressed file 24567 gzprintf -- format data and compress 24568 gzputc -- write character to a compressed file 24569 gzputs -- string write to a compressed file 24570 gzread -- read from a compressed file 24571 gzrewind -- reset the file-position indicator on a compressed 24572 file stream 24573 24574 gzseek -- reposition a file-position indicator in a compressed 24575 file stream 24576 24577 gzsetparams -- dynamically set compression parameters 24578 gztell -- find position on a compressed file stream 24579 gzwrite -- write to a compressed file 24580 inflate -- decompress data 24581 inflateEnd -- free decompression stream state 24582 inflateInit2_ -- initialize decompression system 24583 inflateInit_ -- initialize decompression system 24584 inflateReset -- reset decompression stream state 24585 inflateSetDictionary -- initialize decompression dictionary 24586 inflateSync -- advance compression stream to next sync point 24587 inflateSyncPoint -- test for synchronization point 24588 uncompress -- uncompress data 24589 zError -- translate error number to string 24590 zlibVersion -- discover library version at run time 24591 24592 The interfaces defined on the following pages are included in 24593 libz and are defined by this specification. Unless otherwise 24594 noted, these interfaces shall be included in the source 24595 standard. 24596 24597 Other interfaces listed in Section 14.2 shall behave as 24598 described in the referenced base document. 24599 24600 adler32 24601 24602 Name 24603 24604 adler32 -- compute Adler 32 Checksum 24605 24606 Synopsis 24607 24608 #include 24609 24610 uLong adler32(uLong adler, const Bytef * buf, uInt len); 24611 24612 Description 24613 24614 The adler32() function shall compute a running Adler-32 24615 checksum (as described in RFC 1950: ZLIB Compressed Data Format 24616 Specication). On entry, adler is the previous value for the 24617 checksum, and buf shall point to an array of len bytes of data 24618 to be added to this checksum. The adler32() function shall 24619 return the new checksum. 24620 24621 If buf is NULL (or Z_NULL), adler32() shall return the initial 24622 checksum. 24623 24624 Return Value 24625 24626 The adler32() function shall return the new checksum value. 24627 24628 Errors 24629 24630 None defined. 24631 24632 Application Usage (informative) 24633 24634 The following code fragment demonstrates typical usage of the 24635 adler32() function: 24636 uLong adler = adler32(0L, Z_NULL, 0); 24637 24638 while (read_buffer(buffer, length) != EOF) { 24639 adler = adler32(adler, buffer, length); 24640 } 24641 if (adler != original_adler) error(); 24642 24643 compress 24644 24645 Name 24646 24647 compress -- compress data 24648 24649 Synopsis 24650 24651 #include 24652 24653 int compress(Bytef * dest, uLongf * destLen, const Bytef * 24654 source, uLong sourceLen); 24655 24656 Description 24657 24658 The compress() function shall attempt to compress sourceLen 24659 bytes of data in the buffer source, placing the result in the 24660 buffer dest. 24661 24662 On entry, destLen should point to a value describing the size 24663 of the dest buffer. The application should ensure that this 24664 value be at least (sourceLen × 1.001) + 12. On successful exit, 24665 the variable referenced by destLen shall be updated to hold the 24666 length of compressed data in dest. 24667 24668 The compress() function is equivalent to compress2() with a 24669 level of Z_DEFAULT_COMPRESSION. 24670 24671 Return Value 24672 24673 On success, compress() shall return Z_OK. Otherwise, compress() 24674 shall return a value to indicate the error. 24675 24676 Errors 24677 24678 On error, compress() shall return a value as described below: 24679 24680 Z_BUF_ERROR 24681 24682 The buffer dest was not large enough to hold the compressed 24683 data. 24684 Z_MEM_ERROR 24685 24686 Insufficient memory. 24687 24688 compress2 24689 24690 Name 24691 24692 compress2 -- compress data at a specified level 24693 24694 Synopsis 24695 24696 #include 24697 24698 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 24699 source, uLong sourceLen, int level); 24700 24701 Description 24702 24703 The compress2() function shall attempt to compress sourceLen 24704 bytes of data in the buffer source, placing the result in the 24705 buffer dest, at the level described by level. The level 24706 supplied shall be a value between 0 and 9, or the value 24707 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest speed, 24708 while a level of 9 requests the highest compression. A level of 24709 0 indicates that no compression should be used, and the output 24710 shall be the same as the input. 24711 24712 On entry, destLen should point to a value describing the size 24713 of the dest buffer. The application should ensure that this 24714 value be at least (sourceLen × 1.001) + 12. On successful exit, 24715 the variable referenced by destLen shall be updated to hold the 24716 length of compressed data in dest. 24717 24718 The compress() function is equivalent to compress2() with a 24719 level of Z_DEFAULT_COMPRESSION. 24720 24721 Return Value 24722 24723 On success, compress2() shall return Z_OK. Otherwise, 24724 compress2() shall return a value to indicate the error. 24725 24726 Errors 24727 24728 On error, compress2() shall return a value as described below: 24729 24730 Z_BUF_ERROR 24731 24732 The buffer dest was not large enough to hold the compressed 24733 data. 24734 Z_MEM_ERROR 24735 24736 Insufficient memory. 24737 Z_STREAM_ERROR 24738 24739 The level was not Z_DEFAULT_COMPRESSION, or was not between 0 24740 and 9. 24741 24742 compressBound 24743 24744 Name 24745 24746 compressBound -- compute compressed data size 24747 24748 Synopsis 24749 24750 #include 24751 24752 int compressBound(uLong sourceLen); 24753 24754 Description 24755 24756 The compressBound() function shall estimate the size of buffer 24757 required to compress sourceLen bytes of data using the 24758 compress() or compress2() functions. If successful, the value 24759 returned shall be an upper bound for the size of buffer 24760 required to compress sourceLen bytes of data, using the 24761 parameters stored in stream, in a single call to compress() or 24762 compress2(). 24763 24764 Return Value 24765 24766 The compressBound() shall return a value representing the upper 24767 bound of an array to allocate to hold the compressed data in a 24768 single call to compress() or compress2(). This function may 24769 return a conservative value that may be larger than sourceLen. 24770 24771 Errors 24772 24773 None defined. 24774 24775 crc32 24776 24777 Name 24778 24779 crc32 -- compute CRC-32 Checksum 24780 24781 Synopsis 24782 24783 #include 24784 24785 uLong crc32(uLong crc, const Bytef * buf, uInt len); 24786 24787 Description 24788 24789 The crc32() function shall compute a running Cyclic Redundancy 24790 Check checksum, as defined in ITU-T V.42. On entry, crc is the 24791 previous value for the checksum, and buf shall point to an 24792 array of len bytes of data to be added to this checksum. The 24793 crc32() function shall return the new checksum. 24794 24795 If buf is NULL (or Z_NULL), crc32() shall return the initial 24796 checksum. 24797 24798 Return Value 24799 24800 The crc32() function shall return the new checksum value. 24801 24802 Errors 24803 24804 None defined. 24805 24806 Application Usage (informative) 24807 24808 The following code fragment demonstrates typical usage of the 24809 crc32() function: 24810 uLong crc = crc32(0L, Z_NULL, 0); 24811 24812 while (read_buffer(buffer, length) != EOF) { 24813 crc = crc32(crc, buffer, length); 24814 } 24815 if (crc != original_crc) error(); 24816 24817 deflate 24818 24819 Name 24820 24821 deflate -- compress data 24822 24823 Synopsis 24824 24825 #include 24826 24827 int deflate(z_streamp stream, int flush); 24828 24829 Description 24830 24831 The deflate() function shall attempt to compress data until 24832 either the input buffer is empty or the output buffer is full. 24833 The stream references a z_stream structure. Before the first 24834 call to deflate(), this structure should have been initialized 24835 by a call to deflateInit2_(). 24836 24837 Note: deflateInit2_() is only in the binary standard; source 24838 level applications should initialize stream via a call to 24839 deflateInit() or deflateInit2(). 24840 24841 In addition, the stream input and output buffers should have 24842 been initialized as follows: 24843 24844 next_in 24845 24846 should point to the data to be compressed. 24847 avail_in 24848 24849 should contain the number of bytes of data in the buffer 24850 referenced by next_in. 24851 next_out 24852 24853 should point to a buffer where compressed data may be placed. 24854 avail_out 24855 24856 should contain the size in bytes of the buffer referenced by 24857 next_out 24858 24859 The deflate() function shall perform one or both of the 24860 following actions: 24861 24862 1. Compress input data from next_in and update next_in, 24863 avail_in and total_in to reflect the data that has been 24864 compressed. 24865 2. Fill the output buffer referenced by next_out, and update 24866 next_out, avail_out and total_out to reflect the compressed 24867 data that has been placed there. If flush is not 24868 Z_NO_FLUSH, and avail_out indicates that there is still 24869 space in output buffer, this action shall always occur (see 24870 below for further details). 24871 24872 The deflate() function shall return when either avail_in 24873 reaches zero (indicating that all the input data has been 24874 compressed), or avail_out reaches zero (indicating that the 24875 output buffer is full). 24876 24877 On success, the deflate() function shall set the adler field of 24878 the stream to the adler32() checksum of all the input data 24879 compressed so far (represented by total_in). 24880 24881 If the deflate() function shall attempt to determine the type 24882 of input data, and set field data_type in stream to Z_ASCII if 24883 the majority of the data bytes fall within the ASCII (ISO 646) 24884 printable character range. Otherwise, it shall set data_type to 24885 Z_BINARY. This data type is informational only, and does not 24886 affect the compression algorithm. 24887 24888 Note: Future versions of the LSB may remove this 24889 requirement, since it is based on an outdated character set 24890 that does not support Internationalization, and does not 24891 affect the algorithm. It is included for information only at 24892 this release. Applications should not depend on this field. 24893 24894 Flush Operation 24895 24896 The parameter flush determines when compressed bits are added 24897 to the output buffer in next_out. If flush is Z_NO_FLUSH, 24898 deflate() may return with some data pending output, and not yet 24899 added to the output buffer. 24900 24901 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 24902 output to next_out and align the output to a byte boundary. A 24903 synchronization point is generated in the output. 24904 24905 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 24906 Z_SYNC_FLUSH, and the compression state shall be reset. A 24907 synchronization point is generated in the output. 24908 24909 Rationale: Z_SYNC_FLUSH is intended to ensure that the 24910 compressed data contains all the data compressed so far, and 24911 allows a decompressor to reconstruct all of the input data. 24912 Z_FULL_FLUSH allows decompression to restart from this point 24913 if the previous compressed data has been lost or damaged. 24914 Flushing is likely to degrade the performance of the 24915 compression system, and should only be used where necessary. 24916 24917 If flush is set to Z_FINISH, all pending input shall be 24918 processed and deflate() shall return with Z_STREAM_END if there 24919 is sufficient space in the output buffer at next_out, as 24920 indicated by avail_out. If deflate() is called with flush set 24921 to Z_FINISH and there is insufficient space to store the 24922 compressed data, and no other error has occurred during 24923 compression, deflate() shall return Z_OK, and the application 24924 should call deflate() again with flush unchanged, and having 24925 updated next_out and avail_out. 24926 24927 If all the compression is to be done in a single step, 24928 deflate() may be called with flush set to Z_FINISH immediately 24929 after the stream has been initialized if avail_out is set to at 24930 least the value returned by deflateBound(). 24931 24932 Return Value 24933 24934 On success, deflate() shall return Z_OK, unless flush was set 24935 to Z_FINISH and there was sufficient space in the output buffer 24936 to compress all of the input data. In this case, deflate() 24937 shall return Z_STREAM_END. On error, deflate() shall return a 24938 value to indicate the error. 24939 24940 Note: If deflate() returns Z_OK and has set avail_out to 24941 zero, the function should be called again with the same 24942 value for flush, and with updated next_out and avail_out 24943 until deflate() returns with Z_OK (or Z_STREAM_END if flush 24944 is set to Z_FINISH) and a non-zero avail_out. 24945 24946 Errors 24947 24948 On error, deflate() shall return a value as described below, 24949 and set the msg field of stream to point to a string describing 24950 the error: 24951 24952 Z_BUF_ERROR 24953 24954 No progress is possible; either avail_in or avail_out was zero. 24955 Z_MEM_ERROR 24956 24957 Insufficient memory. 24958 Z_STREAM_ERROR 24959 24960 The state (as represented in stream) is inconsistent, or stream 24961 was NULL. 24962 24963 deflateBound 24964 24965 Name 24966 24967 deflateBound -- compute compressed data size 24968 24969 Synopsis 24970 24971 #include 24972 24973 int deflateBound(z_streamp stream, uLong sourceLen); 24974 24975 Description 24976 24977 The deflateBound() function shall estimate the size of buffer 24978 required to compress sourceLen bytes of data. If successful, 24979 the value returned shall be an upper bound for the size of 24980 buffer required to compress sourceLen bytes of data, using the 24981 parameters stored in stream, in a single call to deflate() with 24982 flush set to Z_FINISH. 24983 24984 On entry, stream should have been initialized via a call to 24985 deflateInit_() or deflateInit2_(). 24986 24987 Return Value 24988 24989 The deflateBound() shall return a value representing the upper 24990 bound of an array to allocate to hold the compressed data in a 24991 single call to deflate(). If the stream is not correctly 24992 initialized, or is NULL, then deflateBound() may return a 24993 conservative value that may be larger than sourceLen. 24994 24995 Errors 24996 24997 None defined. 24998 24999 deflateCopy 25000 25001 Name 25002 25003 deflateCopy -- copy compression stream 25004 25005 Synopsis 25006 25007 #include 25008 25009 int deflateCopy(z_streamp dest, z_streamp source); 25010 25011 Description 25012 25013 The deflateCopy() function shall copy the compression state 25014 information in source to the uninitialized z_stream structure 25015 referenced by dest. 25016 25017 On successful return, dest will be an exact copy of the stream 25018 referenced by source. The input and output buffer pointers in 25019 next_in and next_out will reference the same data. 25020 25021 Return Value 25022 25023 On success, deflateCopy() shall return Z_OK. Otherwise it shall 25024 return a value less than zero to indicate the error. 25025 25026 Errors 25027 25028 On error, deflateCopy() shall return a value as described 25029 below: 25030 25031 Z_STREAM_ERROR 25032 25033 The state in source is inconsistent, or either source or dest 25034 was NULL. 25035 Z_MEM_ERROR 25036 25037 Insufficient memory available. 25038 25039 Application Usage (informative) 25040 25041 This function can be useful when several compression strategies 25042 will be tried, for example when there are several ways of 25043 pre-processing the input data with a filter. The streams that 25044 will be discarded should then be freed by calling deflateEnd(). 25045 Note that deflateCopy() duplicates the internal compression 25046 state which can be quite large, so this strategy may be slow 25047 and can consume lots of memory. 25048 25049 deflateEnd 25050 25051 Name 25052 25053 deflateEnd -- free compression stream state 25054 25055 Synopsis 25056 25057 #include 25058 25059 int deflateEnd(z_streamp stream); 25060 25061 Description 25062 25063 The deflateEnd() function shall free all allocated state 25064 information referenced by stream. All pending output is 25065 discarded, and unprocessed input is ignored. 25066 25067 Return Value 25068 25069 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 25070 there was pending output discarded or input unprocessed. 25071 Otherwise it shall return Z_STREAM_ERROR to indicate the error. 25072 25073 Errors 25074 25075 On error, deflateEnd() shall return Z_STREAM_ERROR. The 25076 following conditions shall be treated as an error: 25077 25078 * The state in stream is inconsistent or inappropriate. 25079 * stream is NULL. 25080 25081 deflateInit2_ 25082 25083 Name 25084 25085 deflateInit2_ -- initialize compression system 25086 25087 Synopsis 25088 25089 #include 25090 25091 int deflateInit2_ (z_streamp strm, int level, int method, int 25092 windowBits, int memLevel, int strategy, char * version, int 25093 stream_size); 25094 25095 Description 25096 25097 The deflateInit2_() function shall initialize the compression 25098 system. On entry, strm shall refer to a user supplied z_stream 25099 object (a z_stream_s structure). The following fields shall be 25100 set on entry: 25101 25102 zalloc 25103 25104 a pointer to an alloc_func function, used to allocate state 25105 information. If this is NULL, a default allocation function 25106 will be used. 25107 zfree 25108 25109 a pointer to a free_func function, used to free memory 25110 allocated by the zalloc function. If this is NULL a default 25111 free function will be used. 25112 opaque 25113 25114 If alloc_func is not NULL, opaque is a user supplied pointer to 25115 data that will be passed to the alloc_func and free_func 25116 functions. 25117 25118 If the version requested is not compatible with the version 25119 implemented, or if the size of the z_stream_s structure 25120 provided in stream_size does not match the size in the library 25121 implementation, deflateInit2_() shall fail, and return 25122 Z_VERSION_ERROR. 25123 25124 The level supplied shall be a value between 0 and 9, or the 25125 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 25126 speed, while a level of 9 requests the highest compression. A 25127 level of 0 indicates that no compression should be used, and 25128 the output shall be the same as the input. 25129 25130 The method selects the compression algorithm to use. LSB 25131 conforming implementation shall support the Z_DEFLATED method, 25132 and may support other implementation defined methods. 25133 25134 The windowBits parameter shall be a base 2 logarithm of the 25135 window size to use, and shall be a value between 8 and 15. A 25136 smaller value will use less memory, but will result in a poorer 25137 compression ratio, while a higher value will give better 25138 compression but utilize more memory. 25139 25140 The memLevel parameter specifies how much memory to use for the 25141 internal state. The value of memLevel shall be between 1 and 25142 MAX_MEM_LEVEL. Smaller values use less memory but are slower, 25143 while higher values use more memory to gain compression speed. 25144 25145 The strategy parameter selects the compression strategy to use: 25146 25147 Z_DEFAULT_STRATEGY 25148 25149 use the system default compression strategy. Z_DEFAULT_STRATEGY 25150 is particularly appropriate for text data. 25151 Z_FILTERED 25152 25153 use a compression strategy tuned for data consisting largely of 25154 small values with a fairly random distribution. Z_FILTERED uses 25155 more Huffman encoding and less string matching than 25156 Z_DEFAULT_STRATEGY. 25157 Z_HUFFMAN_ONLY 25158 25159 force Huffman encoding only, with no string match. 25160 25161 The deflateInit2_() function is not in the source standard; it 25162 is only in the binary standard. Source applications should use 25163 the deflateInit2() macro. 25164 25165 Return Value 25166 25167 On success, the deflateInit2_() function shall return Z_OK. 25168 Otherwise, deflateInit2_() shall return a value as described 25169 below to indicate the error. 25170 25171 Errors 25172 25173 On error, deflateInit2_() shall return one of the following 25174 error indicators: 25175 25176 Z_STREAM_ERROR 25177 25178 Invalid parameter. 25179 Z_MEM_ERROR 25180 25181 Insufficient memory available. 25182 Z_VERSION_ERROR 25183 25184 The version requested is not compatible with the library 25185 version, or the z_stream size differs from that used by the 25186 library. 25187 25188 In addition, the msg field of the strm may be set to an error 25189 message. 25190 25191 deflateInit_ 25192 25193 Name 25194 25195 deflateInit_ -- initialize compression system 25196 25197 Synopsis 25198 25199 #include 25200 25201 int deflateInit_(z_streamp stream, int level, const char * 25202 version, int stream_size); 25203 25204 Description 25205 25206 The deflateInit_() function shall initialize the compression 25207 system. On entry, stream shall refer to a user supplied 25208 z_stream object (a z_stream_s structure). The following fields 25209 shall be set on entry: 25210 25211 zalloc 25212 25213 a pointer to an alloc_func function, used to allocate state 25214 information. If this is NULL, a default allocation function 25215 will be used. 25216 zfree 25217 25218 a pointer to a free_func function, used to free memory 25219 allocated by the zalloc function. If this is NULL a default 25220 free function will be used. 25221 opaque 25222 25223 If alloc_func is not NULL, opaque is a user supplied pointer to 25224 data that will be passed to the alloc_func and free_func 25225 functions. 25226 25227 If the version requested is not compatible with the version 25228 implemented, or if the size of the z_stream_s structure 25229 provided in stream_size does not match the size in the library 25230 implementation, deflateInit_() shall fail, and return 25231 Z_VERSION_ERROR. 25232 25233 The level supplied shall be a value between 0 and 9, or the 25234 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 25235 speed, while a level of 9 requests the highest compression. A 25236 level of 0 indicates that no compression should be used, and 25237 the output shall be the same as the input. 25238 25239 The deflateInit_() function is not in the source standard; it 25240 is only in the binary standard. Source applications should use 25241 the deflateInit() macro. 25242 25243 The deflateInit_() function is equivalent to 25244 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, MAX_MEM_LEVEL, 25245 Z_DEFAULT_STRATEGY, version, stream_size); 25246 25247 Return Value 25248 25249 On success, the deflateInit_() function shall return Z_OK. 25250 Otherwise, deflateInit_() shall return a value as described 25251 below to indicate the error. 25252 25253 Errors 25254 25255 On error, deflateInit_() shall return one of the following 25256 error indicators: 25257 25258 Z_STREAM_ERROR 25259 25260 Invalid parameter. 25261 Z_MEM_ERROR 25262 25263 Insufficient memory available. 25264 Z_VERSION_ERROR 25265 25266 The version requested is not compatible with the library 25267 version, or the z_stream size differs from that used by the 25268 library. 25269 25270 In addition, the msg field of the stream may be set to an error 25271 message. 25272 25273 deflateParams 25274 25275 Name 25276 25277 deflateParams -- set compression parameters 25278 25279 Synopsis 25280 25281 #include 25282 25283 int deflateParams(z_streamp stream, int level, int strategy); 25284 25285 Description 25286 25287 The deflateParams() function shall dynamically alter the 25288 compression parameters for the compression stream object 25289 stream. On entry, stream shall refer to a user supplied 25290 z_stream object (a z_stream_s structure), already initialized 25291 via a call to deflateInit_() or deflateInit2_(). 25292 25293 The level supplied shall be a value between 0 and 9, or the 25294 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 25295 speed, while a level of 9 requests the highest compression. A 25296 level of 0 indicates that no compression should be used, and 25297 the output shall be the same as the input. If the compression 25298 level is altered by deflateParams(), and some data has already 25299 been compressed with this stream (i.e. total_in is not zero), 25300 and the new level requires a different underlying compression 25301 method, then stream shall be flushed by a call to deflate(). 25302 25303 The strategy parameter selects the compression strategy to use: 25304 25305 Z_DEFAULT_STRATEGY 25306 25307 use the system default compression strategy. Z_DEFAULT_STRATEGY 25308 is particularly appropriate for text data. 25309 Z_FILTERED 25310 25311 use a compression strategy tuned for data consisting largely of 25312 small values with a fairly random distribution. Z_FILTERED uses 25313 more Huffman encoding and less string matching than 25314 Z_DEFAULT_STRATEGY. 25315 Z_HUFFMAN_ONLY 25316 25317 force Huffman encoding only, with no string match. 25318 25319 Return Value 25320 25321 On success, the deflateParams() function shall return Z_OK. 25322 Otherwise, deflateParams() shall return a value as described 25323 below to indicate the error. 25324 25325 Errors 25326 25327 On error, deflateParams() shall return one of the following 25328 error indicators: 25329 25330 Z_STREAM_ERROR 25331 25332 Invalid parameter. 25333 Z_MEM_ERROR 25334 25335 Insufficient memory available. 25336 Z_BUF_ERROR 25337 25338 Insufficient space in stream to flush the current output. 25339 25340 In addition, the msg field of the strm may be set to an error 25341 message. 25342 25343 Application Usage (Informative) 25344 25345 Applications should ensure that the stream is flushed, e.g. by 25346 a call to deflate(stream, Z_SYNC_FLUSH) before calling 25347 deflateParams(), or ensure that there is sufficient space in 25348 next_out (as identified by avail_out) to ensure that all 25349 pending output and all uncompressed input can be flushed in a 25350 single call to deflate(). 25351 25352 Rationale: Although the deflateParams() function should 25353 flush pending output and compress all pending input, the 25354 result is unspecified if there is insufficient space in the 25355 output buffer. Applications should only call deflateParams() 25356 when the stream is effectively empty (flushed). 25357 25358 The deflateParams() can be used to switch between 25359 compression and straight copy of the input data, or to 25360 switch to a different kind of input data requiring a 25361 different strategy. 25362 25363 deflateReset 25364 25365 Name 25366 25367 deflateReset -- reset compression stream state 25368 25369 Synopsis 25370 25371 #include 25372 25373 int deflateReset(z_streamp stream); 25374 25375 Description 25376 25377 The deflateReset() function shall reset all state associated 25378 with stream. All pending output shall be discarded, and the 25379 counts of processed bytes (total_in and total_out) shall be 25380 reset to zero. 25381 25382 Return Value 25383 25384 On success, deflateReset() shall return Z_OK. Otherwise it 25385 shall return Z_STREAM_ERROR to indicate the error. 25386 25387 Errors 25388 25389 On error, deflateReset() shall return Z_STREAM_ERROR. The 25390 following conditions shall be treated as an error: 25391 25392 * The state in stream is inconsistent or inappropriate. 25393 * stream is NULL. 25394 25395 deflateSetDictionary 25396 25397 Name 25398 25399 deflateSetDictionary -- initialize compression dictionary 25400 25401 Synopsis 25402 25403 #include 25404 25405 int deflateSetDictionary(z_streamp stream, const Bytef * 25406 dictionary, uInt dictlen); 25407 25408 Description 25409 25410 The deflateSetDictionary() function shall initialize the 25411 compression dictionary associated with stream using the dictlen 25412 bytes referenced by dictionary. 25413 25414 The implementation may silently use a subset of the provided 25415 dictionary if the dictionary cannot fit in the current window 25416 associated with stream (see deflateInit2_()). The application 25417 should ensure that the dictionary is sorted such that the most 25418 commonly used strings occur at the end of the dictionary. 25419 25420 If the dictionary is successfully set, the Adler32 checksum of 25421 the entire provided dictionary shall be stored in the adler 25422 member of stream. This value may be used by the decompression 25423 system to select the correct dictionary. The compression and 25424 decompression systems must use the same dictionary. 25425 25426 stream shall reference an initialized compression stream, with 25427 total_in zero (i.e. no data has been compressed since the 25428 stream was initialized). 25429 25430 Return Value 25431 25432 On success, deflateSetDictionary() shall return Z_OK. Otherwise 25433 it shall return Z_STREAM_ERROR to indicate an error. 25434 25435 Errors 25436 25437 On error, deflateSetDictionary() shall return a value as 25438 described below: 25439 25440 Z_STREAM_ERROR 25441 25442 The state in stream is inconsistent, or stream was NULL. 25443 25444 Application Usage (informative) 25445 25446 The application should provide a dictionary consisting of 25447 strings {{{ed note: do we really mean "strings"? Null 25448 terminated?}}} that are likely to be encountered in the data to 25449 be compressed. The application should ensure that the 25450 dictionary is sorted such that the most commonly used strings 25451 occur at the end of the dictionary. 25452 25453 The use of a dictionary is optional; however if the data to be 25454 compressed is relatively short and has a predictable structure, 25455 the use of a dictionary can substantially improve the 25456 compression ratio. 25457 25458 get_crc_table 25459 25460 Name 25461 25462 get_crc_table -- generate a table for crc calculations 25463 25464 Synopsis 25465 25466 #include 25467 25468 const uLongf * get_crc_table(void); 25469 25470 Description 25471 25472 Generate tables for a byte-wise 32-bit CRC calculation based on 25473 the polynomial: 25474 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 25475 25476 In a multi-threaded application, get_crc_table() should be 25477 called by one thread to initialize the tables before any other 25478 thread calls any libz function. 25479 25480 Return Value 25481 25482 The get_crc_table() function shall return a pointer to the 25483 first of a set of tables used internally to calculate CRC-32 25484 values (see crc32()). 25485 25486 Errors 25487 25488 None defined. 25489 25490 gzclose 25491 25492 Name 25493 25494 gzclose -- close a compressed file stream 25495 25496 Synopsis 25497 25498 #include 25499 25500 int gzclose (gzFile file ); 25501 25502 Description 25503 25504 The gzclose() function shall close the compressed file stream 25505 file. If file was open for writing, gzclose() shall first flush 25506 any pending output. Any state information allocated shall be 25507 freed. 25508 25509 Return Value 25510 25511 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 25512 shall return an error value as described below. 25513 25514 Errors 25515 25516 On error, gzclose() may set the global variable errno to 25517 indicate the error. The gzclose() shall return a value other 25518 than Z_OK on error. 25519 25520 Z_STREAM_ERROR 25521 25522 file was NULL (or Z_NULL), or did not refer to an open 25523 compressed file stream. 25524 Z_ERRNO 25525 25526 An error occurred in the underlying base libraries, and the 25527 application should check errno for further information. 25528 Z_BUF_ERROR 25529 25530 no compression progress is possible during buffer flush (see 25531 deflate()). 25532 25533 gzdopen 25534 25535 Name 25536 25537 gzdopen -- open a compressed file 25538 25539 Synopsis 25540 25541 #include 25542 25543 gzFile gzdopen ( int fd, const char *mode ); 25544 25545 Description 25546 25547 The gzdopen() function shall attempt to associate the open file 25548 referenced by fd with a gzFile object. The mode argument is 25549 based on that of fopen(), but the mode parameter may also 25550 contain the following characters: 25551 25552 digit 25553 25554 set the compression level to digit. A low value (e.g. 1) means 25555 high speed, while a high value (e.g. 9) means high compression. 25556 A compression level of 0 (zero) means no compression. See 25557 deflateInit2_() for further details. 25558 [fhR] 25559 25560 set the compression strategy to [fhR]. The letter f corresponds 25561 to filtered data, the letter h corresponds to Huffman only 25562 compression, and the letter R corresponds to Run Length 25563 Encoding. See deflateInit2_() for further details. 25564 25565 If fd refers to an uncompressed file, and mode refers to a read 25566 mode, gzdopen() shall attempt to open the file and return a 25567 gzFile object suitable for reading directly from the file 25568 without any decompression. 25569 25570 If mode is NULL, or if mode does not contain one of r, w, or a, 25571 gzdopen() shall return Z_NULL, and need not set any other error 25572 condition. 25573 25574 Example 25575 25576 gzdopen(fileno(stdin), "r"); 25577 25578 Attempt to associate the standard input with a gzFile object. 25579 25580 Return Value 25581 25582 On success, gzdopen() shall return a gzFile object. On failure, 25583 gzdopen() shall return Z_NULL and may set errno accordingly. 25584 25585 Note: At version 1.2.2, zlib does not set errno for several 25586 error conditions. Applications may not be able to determine 25587 the cause of an error. 25588 25589 Errors 25590 25591 On error, gzdopen() may set the global variable errno to 25592 indicate the error. 25593 25594 gzeof 25595 25596 Name 25597 25598 gzeof -- check for end-of-file on a compressed file stream 25599 25600 Synopsis 25601 25602 #include 25603 25604 int gzeof (gzFile file ); 25605 25606 Description 25607 25608 The gzeof() function shall test the compressed file stream file 25609 for end of file. 25610 25611 Return Value 25612 25613 If file was open for reading and end of file has been reached, 25614 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 25615 25616 Errors 25617 25618 None defined. 25619 25620 gzerror 25621 25622 Name 25623 25624 gzerror -- decode an error on a compressed file stream 25625 25626 Synopsis 25627 25628 #include 25629 25630 const char * gzerror (gzFile file, int * errnum); 25631 25632 Description 25633 25634 The gzerror() function shall return a string describing the 25635 last error to have occurred associated with the open compressed 25636 file stream referred to by file. It shall also set the location 25637 referenced by errnum to an integer value that further 25638 identifies the error. 25639 25640 Return Value 25641 25642 The gzerror() function shall return a string that describes the 25643 last error associated with the given file compressed file 25644 stream. This string shall have the format "%s: %s", with the 25645 name of the file, followed by a colon, a space, and the 25646 description of the error. If the compressed file stream was 25647 opened by a call to gzdopen(), the format of the filename is 25648 unspecified. 25649 25650 Rationale: Although in all current implementations of libz 25651 file descriptors are named "", the code suggests that 25652 this is for debugging purposes only, and may change in a 25653 future release. 25654 25655 It is unspecified if the string returned is determined by the 25656 setting of the LC_MESSAGES category in the current locale. 25657 25658 Errors 25659 25660 None defined. 25661 25662 gzflush 25663 25664 Name 25665 25666 gzflush -- flush a compressed file stream 25667 25668 Synopsis 25669 25670 #include 25671 25672 int gzflush(gzFile file, int flush); 25673 25674 Description 25675 25676 The gzflush() function shall flush pending output to the 25677 compressed file stream identified by file, which must be open 25678 for writing. 25679 25680 Flush Operation 25681 25682 The parameter flush determines which compressed bits are added 25683 to the output file. If flush is Z_NO_FLUSH, gzflush() may 25684 return with some data pending output, and not yet written to 25685 the file. 25686 25687 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 25688 output to file and align the output to a byte boundary. There 25689 may still be data pending compression that is not flushed. 25690 25691 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 25692 Z_SYNC_FLUSH, and the compression state shall be reset. There 25693 may still be data pending compression that is not flushed. 25694 25695 Rationale: Z_SYNC_FLUSH is intended to ensure that the 25696 compressed data contains all the data compressed so far, and 25697 allows a decompressor to reconstruct all of the input data. 25698 Z_FULL_FLUSH allows decompression to restart from this point 25699 if the previous compressed data has been lost or damaged. 25700 Flushing is likely to degrade the performance of the 25701 compression system, and should only be used where necessary. 25702 25703 If flush is set to Z_FINISH, all pending uncompressed data 25704 shall be compressed and all output shall be flushed. 25705 25706 Return Value 25707 25708 On success, gzflush() shall return the value Z_OK. Otherwise 25709 gzflush() shall return a value to indicate the error, and may 25710 set the error number associated with the compressed file stream 25711 file. 25712 25713 Note: If flush is set to Z_FINISH and the flush operation is 25714 successful, gzflush() will return Z_OK, but the compressed 25715 file stream error value may be set to Z_STREAM_END. 25716 25717 Errors 25718 25719 On error, gzflush() shall return an error value, and may set 25720 the error number associated with the stream identified by file 25721 to indicate the error. Applications may use gzerror() to access 25722 this error value. 25723 25724 Z_ERRNO 25725 25726 An underlying base library function has indicated an error. The 25727 global variable errno may be examined for further information. 25728 Z_STREAM_ERROR 25729 25730 The stream is invalid, is not open for writing, or is in an 25731 invalid state. 25732 Z_BUF_ERROR 25733 25734 no compression progress is possible (see deflate()). 25735 Z_MEM_ERROR 25736 25737 Insufficient memory available to compress. 25738 25739 gzgetc 25740 25741 Name 25742 25743 gzgetc -- read a character from a compressed file 25744 25745 Synopsis 25746 25747 #include 25748 25749 int gzgetc (gzFile file); 25750 25751 Description 25752 25753 The gzgetc() function shall read the next single character from 25754 the compressed file stream referenced by file, which shall have 25755 been opened in a read mode (see gzopen() and gzdopen()). 25756 25757 Return Value 25758 25759 On success, gzgetc() shall return the uncompressed character 25760 read, otherwise, on end of file or error, gzgetc() shall return 25761 -1. 25762 25763 Errors 25764 25765 On end of file or error, gzgetc() shall return -1. Further 25766 information can be found by calling gzerror() with a pointer to 25767 the compressed file stream. 25768 25769 gzgets 25770 25771 Name 25772 25773 gzgets -- read a string from a compressed file 25774 25775 Synopsis 25776 25777 #include 25778 25779 char * gzgets (gzFile file, char * buf, int len); 25780 25781 Description 25782 25783 The gzgets() function shall attempt to read data from the 25784 compressed file stream file, uncompressing it into buf until 25785 either len-1 bytes have been inserted into buf, or until a 25786 newline character has been uncompressed into buf. A null byte 25787 shall be appended to the uncompressed data. The file shall have 25788 been opened in for reading (see gzopen() and gzdopen()). 25789 25790 Return Value 25791 25792 On success, gzgets() shall return a pointer to buf. Otherwise, 25793 gzgets() shall return Z_NULL. Applications may examine the 25794 cause using gzerror(). 25795 25796 Errors 25797 25798 On error, gzgets() shall return Z_NULL. The following 25799 conditions shall always be treated as an error: 25800 25801 file is NULL, or does not refer to a file open for reading; 25802 buf is NULL; 25803 len is less than or equal to zero. 25804 25805 gzopen 25806 25807 Name 25808 25809 gzopen -- open a compressed file 25810 25811 Synopsis 25812 25813 #include 25814 25815 gzFile gzopen (const char *path , const char *mode ); 25816 25817 Description 25818 25819 The gzopen() function shall open the compressed file named by 25820 path. The mode argument is based on that of fopen(), but the 25821 mode parameter may also contain the following characters: 25822 25823 digit 25824 25825 set the compression level to digit. A low value (e.g. 1) means 25826 high speed, while a high value (e.g. 9) means high compression. 25827 A compression level of 0 (zero) means no compression. See 25828 deflateInit2_() for further details. 25829 [fhR] 25830 25831 set the compression strategy to [fhR]. The letter f corresponds 25832 to filtered data, the letter h corresponds to Huffman only 25833 compression, and the letter R corresponds to Run Length 25834 Encoding. See deflateInit2_() for further details. 25835 25836 If path refers to an uncompressed file, and mode refers to a 25837 read mode, gzopen() shall attempt to open the file and return a 25838 gzFile object suitable for reading directly from the file 25839 without any decompression. 25840 25841 If path or mode is NULL, or if mode does not contain one of r, 25842 w, or a, gzopen() shall return Z_NULL, and need not set any 25843 other error condition. 25844 25845 The gzFile object is also referred to as a compressed file 25846 stream. 25847 25848 Example 25849 25850 gzopen("file.gz", "w6h"); 25851 25852 Attempt to create a new compressed file, file.gz, at 25853 compression level 6 using Huffman only compression. 25854 25855 Return Value 25856 25857 On success, gzopen() shall return a gzFile object (also known 25858 as a compressed file stream). On failure, gzopen() shall return 25859 Z_NULL and may set errno accordingly. 25860 25861 Note: At version 1.2.2, zlib does not set errno for several 25862 error conditions. Applications may not be able to determine 25863 the cause of an error. 25864 25865 Errors 25866 25867 On error, gzopen() may set the global variable errno to 25868 indicate the error. 25869 25870 gzprintf 25871 25872 Name 25873 25874 gzprintf -- format data and compress 25875 25876 Synopsis 25877 25878 #include 25879 25880 int gzprintf (gzFile file, const char * fmt, ...); 25881 25882 Description 25883 25884 The gzprintf() function shall format data as for fprintf(), and 25885 write the resulting string to the compressed file stream file. 25886 25887 Return Value 25888 25889 The gzprintf() function shall return the number of uncompressed 25890 bytes actually written, or a value less than or equal to 0 in 25891 the event of an error. 25892 25893 Errors 25894 25895 If file is NULL, or refers to a compressed file stream that has 25896 not been opened for writing, gzprintf() shall return 25897 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 25898 25899 gzputc 25900 25901 Name 25902 25903 gzputc -- write character to a compressed file 25904 25905 Synopsis 25906 25907 #include 25908 25909 int gzputc (gzFile file, int c); 25910 25911 Description 25912 25913 The gzputc() function shall write the single character c, 25914 converted from integer to unsigned character, to the compressed 25915 file referenced by file, which shall have been opened in a 25916 write mode (see gzopen() and gzdopen()). 25917 25918 Return Value 25919 25920 On success, gzputc() shall return the value written, otherwise 25921 gzputc() shall return -1. 25922 25923 Errors 25924 25925 On error, gzputc() shall return -1. 25926 25927 gzputs 25928 25929 Name 25930 25931 gzputs -- string write to a compressed file 25932 25933 Synopsis 25934 25935 #include 25936 25937 int gzputs (gzFile file, const char * s); 25938 25939 Description 25940 25941 The gzputs() function shall write the null terminated string s 25942 to the compressed file referenced by file, which shall have 25943 been opened in a write mode (see gzopen() and gzdopen()). The 25944 terminating null character shall not be written. The gzputs() 25945 function shall return the number of uncompressed bytes actually 25946 written. 25947 25948 Return Value 25949 25950 On success, gzputs() shall return the number of uncompressed 25951 bytes actually written to file. On error gzputs() shall return 25952 a value less than or equal to 0. Applications may examine the 25953 cause using gzerror(). 25954 25955 Errors 25956 25957 On error, gzputs() shall set the error number associated with 25958 the stream identified by file to indicate the error. 25959 Applications should use gzerror() to access this error value. 25960 If file is NULL, gzputs() shall return Z_STREAM_ERR. 25961 25962 Z_ERRNO 25963 25964 An underlying base library function has indicated an error. The 25965 global variable errno may be examined for further information. 25966 Z_STREAM_ERROR 25967 25968 The stream is invalid, is not open for writing, or is in an 25969 invalid state. 25970 Z_BUF_ERROR 25971 25972 no compression progress is possible (see deflate()). 25973 Z_MEM_ERROR 25974 25975 Insufficient memory available to compress. 25976 25977 gzread 25978 25979 Name 25980 25981 gzread -- read from a compressed file 25982 25983 Synopsis 25984 25985 #include 25986 25987 int gzread (gzFile file, voidp buf, unsigned int len); 25988 25989 Description 25990 25991 The gzread() function shall read data from the compressed file 25992 referenced by file, which shall have been opened in a read mode 25993 (see gzopen() and gzdopen()). The gzread() function shall read 25994 data from file, and uncompress it into buf. At most, len bytes 25995 of uncompressed data shall be copied to buf. If the file is not 25996 compressed, gzread() shall simply copy data from file to buf 25997 without alteration. 25998 25999 Return Value 26000 26001 On success, gzread() shall return the number of bytes 26002 decompressed into buf. If gzread() returns 0, either the 26003 end-of-file has been reached or an underlying read error has 26004 occurred. Applications should use gzerror() or gzeof() to 26005 determine which occurred. On other errors, gzread() shall 26006 return a value less than 0 and applications may examine the 26007 cause using gzerror(). 26008 26009 Errors 26010 26011 On error, gzread() shall set the error number associated with 26012 the stream identified by file to indicate the error. 26013 Applications should use gzerror() to access this error value. 26014 26015 Z_ERRNO 26016 26017 An underlying base library function has indicated an error. The 26018 global variable errno may be examined for further information. 26019 Z_STREAM_END 26020 26021 End of file has been reached on input. 26022 Z_DATA_ERROR 26023 26024 A CRC error occurred when reading data; the file is corrupt. 26025 Z_STREAM_ERROR 26026 26027 The stream is invalid, or is in an invalid state. 26028 Z_NEED_DICT 26029 26030 A dictionary is needed (see inflateSetDictionary()). 26031 Z_MEM_ERROR 26032 26033 Insufficient memory available to decompress. 26034 26035 gzrewind 26036 26037 Name 26038 26039 gzrewind -- reset the file-position indicator on a compressed 26040 file stream 26041 26042 Synopsis 26043 26044 #include 26045 26046 int gzrewind(gzFile file); 26047 26048 Description 26049 26050 The gzrewind() function shall set the starting position for the 26051 next read on compressed file stream file to the beginning of 26052 file. file must be open for reading. 26053 26054 gzrewind() is equivalent to 26055 (int)gzseek(file, 0L, SEEK_SET) 26056 26057 . 26058 26059 Return Value 26060 26061 On success, gzrewind() shall return 0. On error, gzrewind() 26062 shall return -1, and may set the error value for file 26063 accordingly. 26064 26065 Errors 26066 26067 On error, gzrewind() shall return -1, indicating that file is 26068 NULL, or does not represent an open compressed file stream, or 26069 represents a compressed file stream that is open for writing 26070 and is not currently at the beginning of file. 26071 26072 gzseek 26073 26074 Name 26075 26076 gzseek -- reposition a file-position indicator in a compressed 26077 file stream 26078 26079 Synopsis 26080 26081 #include 26082 26083 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 26084 26085 Description 26086 26087 The gzseek() function shall set the file-position indicator for 26088 the compressed file stream file. The file-position indicator 26089 controls where the next read or write operation on the 26090 compressed file stream shall take place. The offset indicates a 26091 byte offset in the uncompressed data. The whence parameter may 26092 be one of: 26093 26094 SEEK_SET 26095 26096 the offset is relative to the start of the uncompressed data. 26097 SEEK_CUR 26098 26099 the offset is relative to the current positition in the 26100 uncompressed data. 26101 26102 Note: The value SEEK_END need not be supported. 26103 26104 If the file is open for writing, the new offset must be greater 26105 than or equal to the current offset. In this case, gzseek() 26106 shall compress a sequence of null bytes to fill the gap from 26107 the previous offset to the new offset. 26108 26109 Return Value 26110 26111 On success, gzseek() shall return the resulting offset in the 26112 file expressed as a byte position in the uncompressed data 26113 stream. On error, gzseek() shall return -1, and may set the 26114 error value for file accordingly. 26115 26116 Errors 26117 26118 On error, gzseek() shall return -1. The following conditions 26119 shall always result in an error: 26120 26121 * file is NULL 26122 * file does not represent an open compressed file stream. 26123 * file refers to a compressed file stream that is open for 26124 writing, and the newly computed offset is less than the 26125 current offset. 26126 * The newly computed offset is less than zero. 26127 * whence is not one of the supported values. 26128 26129 Application Usage (informative) 26130 26131 If file is open for reading, the implementation may still need 26132 to uncompress all of the data up to the new offset. As a 26133 result, gzseek() may be extremely slow in some circumstances. 26134 26135 gzsetparams 26136 26137 Name 26138 26139 gzsetparams -- dynamically set compression parameters 26140 26141 Synopsis 26142 26143 #include 26144 26145 int gzsetparams (gzFile file, int level, int strategy); 26146 26147 Description 26148 26149 The gzsetparams() function shall set the compression level and 26150 compression strategy on the compressed file stream referenced 26151 by file. The compressed file stream shall have been opened in a 26152 write mode. The level and strategy are as defined in 26153 deflateInit2.. If there is any data pending writing, it shall 26154 be flushed before the parameters are updated. 26155 26156 Return Value 26157 26158 On success, the gzsetparams() function shall return Z_OK. 26159 26160 Errors 26161 26162 On error, gzsetparams() shall return one of the following error 26163 indications: 26164 26165 Z_STREAM_ERROR 26166 26167 Invalid parameter, or file not open for writing. 26168 Z_BUF_ERROR 26169 26170 An internal inconsistency was detected while flushing the 26171 previous buffer. 26172 26173 gztell 26174 26175 Name 26176 26177 gztell -- find position on a compressed file stream 26178 26179 Synopsis 26180 26181 #include 26182 26183 z_off_t gztell (gzFile file ); 26184 26185 Description 26186 26187 The gztell() function shall return the starting position for 26188 the next read or write operation on compressed file stream 26189 file. This position represents the number of bytes from the 26190 beginning of file in the uncompressed data. 26191 26192 gztell() is equivalent to 26193 gzseek(file, 0L, SEEK_CUR) 26194 26195 . 26196 26197 Return Value 26198 26199 gztell() shall return the current offset in the file expressed 26200 as a byte position in the uncompressed data stream. On error, 26201 gztell() shall return -1, and may set the error value for file 26202 accordingly. 26203 26204 Errors 26205 26206 On error, gztell() shall return -1, indicating that file is 26207 NULL, or does not represent an open compressed file stream. 26208 26209 gzwrite 26210 26211 Name 26212 26213 gzwrite -- write to a compressed file 26214 26215 Synopsis 26216 26217 #include 26218 26219 int gzwrite (gzFile file, voidpc buf, unsigned int len); 26220 26221 Description 26222 26223 The gzwrite() function shall write data to the compressed file 26224 referenced by file, which shall have been opened in a write 26225 mode (see gzopen() and gzdopen()). On entry, buf shall point to 26226 a buffer containing len bytes of uncompressed data. The 26227 gzwrite() function shall compress this data and write it to 26228 file. The gzwrite() function shall return the number of 26229 uncompressed bytes actually written. 26230 26231 Return Value 26232 26233 On success, gzwrite() shall return the number of uncompressed 26234 bytes actually written to file. On error gzwrite() shall return 26235 a value less than or equal to 0. Applications may examine the 26236 cause using gzerror(). 26237 26238 Errors 26239 26240 On error, gzwrite() shall set the error number associated with 26241 the stream identified by file to indicate the error. 26242 Applications should use gzerror() to access this error value. 26243 26244 Z_ERRNO 26245 26246 An underlying base library function has indicated an error. The 26247 global variable errno may be examined for further information. 26248 Z_STREAM_ERROR 26249 26250 The stream is invalid, is not open for writing, or is in an 26251 invalid state. 26252 Z_BUF_ERROR 26253 26254 no compression progress is possible (see deflate()). 26255 Z_MEM_ERROR 26256 26257 Insufficient memory available to compress. 26258 26259 inflate 26260 26261 Name 26262 26263 inflate -- decompress data 26264 26265 Synopsis 26266 26267 #include 26268 26269 int inflate(z_streamp stream, int flush); 26270 26271 Description 26272 26273 The inflate() function shall attempt to decompress data until 26274 either the input buffer is empty or the output buffer is full. 26275 The stream references a z_stream structure. Before the first 26276 call to inflate(), this structure should have been initialized 26277 by a call to inflateInit2_(). 26278 26279 Note: inflateInit2_() is only in the binary standard; source 26280 level applications should initialize stream via a call to 26281 inflateInit() or inflateInit2(). 26282 26283 In addition, the stream input and output buffers should have 26284 been initialized as follows: 26285 26286 next_in 26287 26288 should point to the data to be decompressed. 26289 avail_in 26290 26291 should contain the number of bytes of data in the buffer 26292 referenced by next_in. 26293 next_out 26294 26295 should point to a buffer where decompressed data may be placed. 26296 avail_out 26297 26298 should contain the size in bytes of the buffer referenced by 26299 next_out 26300 26301 The inflate() function shall perform one or both of the 26302 following actions: 26303 26304 1. Decompress input data from next_in and update next_in, 26305 avail_in and total_in to reflect the data that has been 26306 decompressed. 26307 2. Fill the output buffer referenced by next_out, and update 26308 next_out, avail_out, and total_out to reflect the 26309 decompressed data that has been placed there. If flush is 26310 not Z_NO_FLUSH, and avail_out indicates that there is still 26311 space in output buffer, this action shall always occur (see 26312 below for further details). 26313 26314 The inflate() function shall return when either avail_in 26315 reaches zero (indicating that all the input data has been 26316 compressed), or avail_out reaches zero (indicating that the 26317 output buffer is full). 26318 26319 Flush Operation 26320 26321 The parameter flush determines when uncompressed bytes are 26322 added to the output buffer in next_out. If flush is Z_NO_FLUSH, 26323 inflate() may return with some data pending output, and not yet 26324 added to the output buffer. 26325 26326 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 26327 output to next_out, and update next_out and avail_out 26328 accordingly. 26329 26330 If flush is set to Z_BLOCK, inflate() shall stop adding data to 26331 the output buffer if and when the next compressed block 26332 boundary is reached (see RFC 1951: DEFLATE Compressed Data 26333 Format Specification). 26334 26335 If flush is set to Z_FINISH, all of the compressed input shall 26336 be decompressed and added to the output. If there is 26337 insufficient output space (i.e. the compressed input data 26338 uncompresses to more than avail_out bytes), then inflate() 26339 shall fail and return Z_BUF_ERROR. 26340 26341 Return Value 26342 26343 On success, inflate() shall return Z_OK if decompression 26344 progress has been made, or Z_STREAM_END if all of the input 26345 data has been decompressed and there was sufficient space in 26346 the output buffer to store the uncompressed result. On error, 26347 inflate() shall return a value to indicate the error. 26348 26349 Note: If inflate() returns Z_OK and has set avail_out to 26350 zero, the function should be called again with the same 26351 value for flush, and with updated next_out and avail_out 26352 until inflate() returns with either Z_OK or Z_STREAM_END and 26353 a non-zero avail_out. 26354 26355 On success, inflate() shall set the adler to the Adler-32 26356 checksum of the output produced so far (i.e. total_out bytes). 26357 26358 Errors 26359 26360 On error, inflate() shall return a value as described below, 26361 and may set the msg field of stream to point to a string 26362 describing the error: 26363 26364 Z_BUF_ERROR 26365 26366 No progress is possible; either avail_in or avail_out was zero. 26367 Z_MEM_ERROR 26368 26369 Insufficient memory. 26370 Z_STREAM_ERROR 26371 26372 The state (as represented in stream) is inconsistent, or stream 26373 was NULL. 26374 Z_NEED_DICT 26375 26376 A preset dictionary is required. The adler field shall be set 26377 to the Adler-32 checksum of the dictionary chosen by the 26378 compressor. 26379 26380 inflateEnd 26381 26382 Name 26383 26384 inflateEnd -- free decompression stream state 26385 26386 Synopsis 26387 26388 #include 26389 26390 int inflateEnd(z_streamp stream); 26391 26392 Description 26393 26394 The inflateEnd() function shall free all allocated state 26395 information referenced by stream. All pending output is 26396 discarded, and unprocessed input is ignored. 26397 26398 Return Value 26399 26400 On success, inflateEnd() shall return Z_OK. Otherwise it shall 26401 return Z_STREAM_ERROR to indicate the error. 26402 26403 Errors 26404 26405 On error, inflateEnd() shall return Z_STREAM_ERROR. The 26406 following conditions shall be treated as an error: 26407 26408 * The state in stream is inconsistent. 26409 * stream is NULL. 26410 * The zfree function pointer is NULL. 26411 26412 inflateInit2_ 26413 26414 Name 26415 26416 inflateInit2_ -- initialize decompression system 26417 26418 Synopsis 26419 26420 #include 26421 26422 int inflateInit2_ (z_streamp strm, int windowBits, char * 26423 version, int stream_size); 26424 26425 Description 26426 26427 The inflateInit2_() function shall initialize the decompression 26428 system. On entry, strm shall refer to a user supplied z_stream 26429 object (a z_stream_s structure). The following fields shall be 26430 set on entry: 26431 26432 zalloc 26433 26434 a pointer to an alloc_func function, used to allocate state 26435 information. If this is NULL, a default allocation function 26436 will be used. 26437 zfree 26438 26439 a pointer to a free_func function, used to free memory 26440 allocated by the zalloc function. If this is NULL a default 26441 free function will be used. 26442 opaque 26443 26444 If alloc_func is not NULL, opaque is a user supplied pointer to 26445 data that will be passed to the alloc_func and free_func 26446 functions. 26447 26448 If the version requested is not compatible with the version 26449 implemented, or if the size of the z_stream_s structure 26450 provided in stream_size does not match the size in the library 26451 implementation, inflateInit2_() shall fail, and return 26452 Z_VERSION_ERROR. 26453 26454 The windowBits parameter shall be a base 2 logarithm of the 26455 maximum window size to use, and shall be a value between 8 and 26456 15. If the input data was compressed with a larger window size, 26457 subsequent attempts to decompress this data will fail with 26458 Z_DATA_ERROR, rather than try to allocate a larger window. 26459 26460 The inflateInit2_() function is not in the source standard; it 26461 is only in the binary standard. Source applications should use 26462 the inflateInit2() macro. 26463 26464 Return Value 26465 26466 On success, the inflateInit2_() function shall return Z_OK. 26467 Otherwise, inflateInit2_() shall return a value as described 26468 below to indicate the error. 26469 26470 Errors 26471 26472 On error, inflateInit2_() shall return one of the following 26473 error indicators: 26474 26475 Z_STREAM_ERROR 26476 26477 Invalid parameter. 26478 Z_MEM_ERROR 26479 26480 Insufficient memory available. 26481 Z_VERSION_ERROR 26482 26483 The version requested is not compatible with the library 26484 version, or the z_stream size differs from that used by the 26485 library. 26486 26487 In addition, the msg field of the strm may be set to an error 26488 message. 26489 26490 inflateInit_ 26491 26492 Name 26493 26494 inflateInit_ -- initialize decompression system 26495 26496 Synopsis 26497 26498 #include 26499 26500 int inflateInit_(z_streamp stream, const char * version, int 26501 stream_size); 26502 26503 Description 26504 26505 The inflateInit_() function shall initialize the decompression 26506 system. On entry, stream shall refer to a user supplied 26507 z_stream object (a z_stream_s structure). The following fields 26508 shall be set on entry: 26509 26510 zalloc 26511 26512 a pointer to an alloc_func function, used to allocate state 26513 information. If this is NULL, a default allocation function 26514 will be used. 26515 zfree 26516 26517 a pointer to a free_func function, used to free memory 26518 allocated by the zalloc function. If this is NULL a default 26519 free function will be used. 26520 opaque 26521 26522 If alloc_func is not NULL, opaque is a user supplied pointer to 26523 data that will be passed to the alloc_func and free_func 26524 functions. 26525 26526 If the version requested is not compatible with the version 26527 implemented, or if the size of the z_stream_s structure 26528 provided in stream_size does not match the size in the library 26529 implementation, inflateInit_() shall fail, and return 26530 Z_VERSION_ERROR. 26531 26532 The inflateInit_() function is not in the source standard; it 26533 is only in the binary standard. Source applications should use 26534 the inflateInit() macro. 26535 26536 The inflateInit_() shall be equivalent to 26537 inflateInit2_(strm, MAX_WBITS, version, stream_size); 26538 26539 Return Value 26540 26541 On success, the inflateInit_() function shall return Z_OK. 26542 Otherwise, inflateInit_() shall return a value as described 26543 below to indicate the error. 26544 26545 Errors 26546 26547 On error, inflateInit_() shall return one of the following 26548 error indicators: 26549 26550 Z_STREAM_ERROR 26551 26552 Invalid parameter. 26553 Z_MEM_ERROR 26554 26555 Insufficient memory available. 26556 Z_VERSION_ERROR 26557 26558 The version requested is not compatible with the library 26559 version, or the z_stream size differs from that used by the 26560 library. 26561 26562 In addition, the msg field of the strm may be set to an error 26563 message. 26564 26565 inflateReset 26566 26567 Name 26568 26569 inflateReset -- reset decompression stream state 26570 26571 Synopsis 26572 26573 #include 26574 26575 int inflateReset(z_streamp stream); 26576 26577 Description 26578 26579 The inflateReset() function shall reset all state associated 26580 with stream. All pending output shall be discarded, and the 26581 counts of processed bytes (total_in and total_out) shall be 26582 reset to zero. 26583 26584 Return Value 26585 26586 On success, inflateReset() shall return Z_OK. Otherwise it 26587 shall return Z_STREAM_ERROR to indicate the error. 26588 26589 Errors 26590 26591 On error, inflateReset() shall return Z_STREAM_ERROR. The 26592 following conditions shall be treated as an error: 26593 26594 * The state in stream is inconsistent or inappropriate. 26595 * stream is NULL. 26596 26597 inflateSetDictionary 26598 26599 Name 26600 26601 inflateSetDictionary -- initialize decompression dictionary 26602 26603 Synopsis 26604 26605 #include 26606 26607 int inflateSetDictionary(z_streamp stream, const Bytef * 26608 dictionary, uInt dictlen); 26609 26610 Description 26611 26612 The inflateSetDictionary() function shall initialize the 26613 decompression dictionary associated with stream using the 26614 dictlen bytes referenced by dictionary. 26615 26616 The inflateSetDictionary() function should be called 26617 immediately after a call to inflate() has failed with return 26618 value Z_NEED_DICT. The dictionary must have the same Adler-32 26619 checksum as the dictionary used for the compression (see 26620 deflateSetDictionary()). 26621 26622 stream shall reference an initialized decompression stream, 26623 with total_in zero (i.e. no data has been decompressed since 26624 the stream was initialized). 26625 26626 Return Value 26627 26628 On success, inflateSetDictionary() shall return Z_OK. Otherwise 26629 it shall return a value as indicated below. 26630 26631 Errors 26632 26633 On error, inflateSetDictionary() shall return a value as 26634 described below: 26635 26636 Z_STREAM_ERROR 26637 26638 The state in stream is inconsistent, or stream was NULL. 26639 Z_DATA_ERROR 26640 26641 The Adler-32 checksum of the supplied dictionary does not match 26642 that used for the compression. 26643 26644 Application Usage (informative) 26645 26646 The application should provide a dictionary consisting of 26647 strings {{{ed note: do we really mean "strings"? Null 26648 terminated?}}} that are likely to be encountered in the data to 26649 be compressed. The application should ensure that the 26650 dictionary is sorted such that the most commonly used strings 26651 occur at the end of the dictionary. 26652 26653 The use of a dictionary is optional; however if the data to be 26654 compressed is relatively short and has a predictable structure, 26655 the use of a dictionary can substantially improve the 26656 compression ratio. 26657 26658 inflateSync 26659 26660 Name 26661 26662 inflateSync -- advance compression stream to next sync point 26663 26664 Synopsis 26665 26666 #include 26667 26668 int inflateSync(z_streamp stream); 26669 26670 Description 26671 26672 The inflateSync() function shall advance through the compressed 26673 data in stream, skipping any invalid compressed data, until the 26674 next full flush point is reached, or all input is exhausted. 26675 See the description for deflate() with flush level 26676 Z_FULL_FLUSH. No output is placed in next_out. 26677 26678 Return Value 26679 26680 On success, inflateSync() shall return Z_OK, and update the 26681 next_in, avail_in, and total_in fields of stream to reflect the 26682 number of bytes of compressed data that have been skipped. 26683 Otherwise, inflateSync() shall return a value as described 26684 below to indicate the error. 26685 26686 Errors 26687 26688 On error, inflateSync() shall return a value as described 26689 below: 26690 26691 Z_STREAM_ERROR 26692 26693 The state (as represented in stream) is inconsistent, or stream 26694 was NULL. 26695 Z_BUF_ERROR 26696 26697 There is no data available to skip over. 26698 Z_DATA_ERROR 26699 26700 No sync point was found. 26701 26702 inflateSyncPoint 26703 26704 Name 26705 26706 inflateSyncPoint -- test for synchronization point 26707 26708 Synopsis 26709 26710 #include 26711 26712 int inflateSyncPoint(z_streamp stream); 26713 26714 Description 26715 26716 The inflateSyncPoint() function shall return a non-zero value 26717 if the compressed data stream referenced by stream is at a 26718 synchronization point. 26719 26720 Return Value 26721 26722 If the compressed data in stream is at a synchronization point 26723 (see deflate() with a flush level of Z_SYNC_FLUSH or 26724 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 26725 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 26726 valid, inflateSyncPoint() shall return 0. If stream is invalid, 26727 or in an invalid state, inflateSyncPoint() shall return 26728 Z_STREAM_ERROR to indicate the error. 26729 26730 Errors 26731 26732 On error, inflateSyncPoint() shall return a value as described 26733 below: 26734 26735 Z_STREAM_ERROR 26736 26737 The state (as represented in stream) is inconsistent, or stream 26738 was NULL. 26739 26740 uncompress 26741 26742 Name 26743 26744 uncompress -- uncompress data 26745 26746 Synopsis 26747 26748 #include 26749 26750 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 26751 source, uLong sourceLen); 26752 26753 Description 26754 26755 The uncompress() function shall attempt to uncompress sourceLen 26756 bytes of data in the buffer source, placing the result in the 26757 buffer dest. 26758 26759 On entry, destLen should point to a value describing the size 26760 of the dest buffer. The application should ensure that this 26761 value is large enough to hold the entire uncompressed data. 26762 26763 Note: The LSB does not describe any mechanism by which a 26764 compressor can communicate the size required to the 26765 uncompressor. 26766 26767 On successful exit, the variable referenced by destLen shall be 26768 updated to hold the length of uncompressed data in dest. 26769 26770 Return Value 26771 26772 On success, uncompress() shall return Z_OK. Otherwise, 26773 uncompress() shall return a value to indicate the error. 26774 26775 Errors 26776 26777 On error, uncompress() shall return a value as described below: 26778 26779 Z_BUF_ERROR 26780 26781 The buffer dest was not large enough to hold the uncompressed 26782 data. 26783 Z_MEM_ERROR 26784 26785 Insufficient memory. 26786 Z_DATA_ERROR 26787 26788 The compressed data (referenced by source) was corrupted. 26789 26790 zError 26791 26792 Name 26793 26794 zError -- translate error number to string 26795 26796 Synopsis 26797 26798 #include 26799 26800 const char * zError(int err); 26801 26802 Description 26803 26804 The zError() function shall return the string identifying the 26805 error associated with err. This allows for conversion from 26806 error code to string for functions such as compress() and 26807 uncompress(), that do not always set the string version of an 26808 error. 26809 26810 Return Value 26811 26812 The zError() function shall return a the string identifying the 26813 error associated with err, or NULL if err is not a valid error 26814 code. 26815 26816 It is unspecified if the string returned is determined by the 26817 setting of the LC_MESSAGES category in the current locale. 26818 26819 Errors 26820 26821 None defined. 26822 26823 zlibVersion 26824 26825 Name 26826 26827 zlibVersion -- discover library version at run time 26828 26829 Synopsis 26830 26831 #include 26832 26833 const char * zlibVersion (void); 26834 26835 Description 26836 26837 The zlibVersion() function shall return the string identifying 26838 the interface version at the time the library was built. 26839 26840 Applications should compare the value returned from 26841 zlibVersion() with the macro constant ZLIB_VERSION for 26842 compatibility. 26843 26844 Return Value 26845 26846 The zlibVersion() function shall return a the string 26847 identifying the version of the library currently implemented. 26848 26849 Errors 26850 26851 None defined. 26852 __________________________________________________________ 26853 26854 14.5. Interfaces for libncurses 26855 26856 Table 14-3 defines the library name and shared object name for 26857 the libncurses library 26858 26859 Table 14-3. libncurses Definition 26860 Library: libncurses 26861 SONAME: libncurses.so.5 26862 26863 The parameters or return types of the following interfaces have 26864 had the const qualifier added as shown here, as compared to the 26865 specification in X/Open Curses. 26866 extern const char *keyname (int); 26867 extern SCREEN *newterm (const char *, FILE *, FILE *); 26868 extern const char *unctrl (chtype); 26869 26870 extern int mvprintw (int, int, const char *, ...); 26871 extern int mvwprintw (WINDOW *, int, int, const char *, ...); 26872 extern int printw (const char *, ...); 26873 extern int vwprintw (WINDOW *, const char *, va_list); 26874 extern int vw_printw (WINDOW *, const char *, va_list); 26875 extern int wprintw (WINDOW *, const char *, ...); 26876 26877 extern int mvscanw (int, int, const char *, ...); 26878 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 26879 extern int scanw (const char *, ...); 26880 extern int vwscanw (WINDOW *, const char *, va_list); 26881 extern int vw_scanw (WINDOW *, const char *, va_list); 26882 extern int wscanw (WINDOW *, const char *, ...); 26883 26884 The behavior of the interfaces in this library is specified by 26885 the following specifications: 26886 26887 [LSB] This Specification 26888 [SUS-CURSES] X/Open Curses 26889 __________________________________________________________ 26890 26891 14.5.1. Curses 26892 __________________________________________________________ 26893 26894 14.5.1.1. Interfaces for Curses 26895 26896 An LSB conforming implementation shall provide the generic 26897 functions for Curses specified in Table 14-4, with the full 26898 mandatory functionality as described in the referenced 26899 underlying specification. 26900 26901 Table 14-4. libncurses - Curses Function Interfaces 26902 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr [SUS-CURSES] 26903 addnstr [SUS-CURSES] 26904 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off [SUS-CURSES] 26905 attr_on [SUS-CURSES] 26906 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 26907 attrset [SUS-CURSES] 26908 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 26909 bkgdset [SUS-CURSES] 26910 border [SUS-CURSES] box [SUS-CURSES] can_change_color 26911 [SUS-CURSES] cbreak [SUS-CURSES] 26912 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 26913 clrtobot [SUS-CURSES] 26914 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 26915 [SUS-CURSES] copywin [SUS-CURSES] 26916 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] def_shell_mode 26917 [SUS-CURSES] del_curterm [SUS-CURSES] 26918 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 26919 [SUS-CURSES] delscreen [SUS-CURSES] 26920 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 26921 dupwin [SUS-CURSES] 26922 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 26923 erase [SUS-CURSES] 26924 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 26925 flushinp [SUS-CURSES] 26926 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 26927 getstr [SUS-CURSES] 26928 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 26929 [SUS-CURSES] has_ic [SUS-CURSES] 26930 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] idlok 26931 [SUS-CURSES] 26932 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [LSB] inchstr 26933 [LSB] 26934 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 26935 [SUS-CURSES] innstr [SUS-CURSES] 26936 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 26937 insnstr [SUS-CURSES] 26938 insstr [SUS-CURSES] instr [LSB] intrflush [SUS-CURSES] 26939 is_linetouched [SUS-CURSES] 26940 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 26941 [SUS-CURSES] keypad [SUS-CURSES] 26942 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 26943 [SUS-CURSES] meta [SUS-CURSES] 26944 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr [SUS-CURSES] 26945 mvaddchstr [SUS-CURSES] 26946 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 26947 [SUS-CURSES] mvcur [LSB] 26948 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch [SUS-CURSES] 26949 mvgetnstr [SUS-CURSES] 26950 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 26951 mvinchnstr [LSB] 26952 mvinchstr [LSB] mvinnstr [SUS-CURSES] mvinsch [SUS-CURSES] 26953 mvinsnstr [SUS-CURSES] 26954 mvinsstr [SUS-CURSES] mvinstr [LSB] mvprintw [SUS-CURSES] 26955 mvscanw [LSB] 26956 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 26957 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 26958 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 26959 [SUS-CURSES] mvwdelch [SUS-CURSES] 26960 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 26961 [SUS-CURSES] mvwhline [SUS-CURSES] 26962 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr [LSB] 26963 mvwinchstr [LSB] 26964 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 26965 [SUS-CURSES] mvwinsstr [SUS-CURSES] 26966 mvwinstr [LSB] mvwprintw [SUS-CURSES] mvwscanw [LSB] mvwvline 26967 [SUS-CURSES] 26968 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 26969 newwin [SUS-CURSES] 26970 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 26971 noecho [SUS-CURSES] 26972 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 26973 notimeout [SUS-CURSES] 26974 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 26975 [SUS-CURSES] pechochar [SUS-CURSES] 26976 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 26977 [SUS-CURSES] putp [SUS-CURSES] 26978 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 26979 redrawwin [SUS-CURSES] 26980 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 26981 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 26982 restartterm [SUS-CURSES] ripoffline [LSB] savetty [SUS-CURSES] 26983 scanw [LSB] 26984 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 26985 [SUS-CURSES] scr_set [SUS-CURSES] 26986 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 26987 set_curterm [SUS-CURSES] 26988 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 26989 [SUS-CURSES] slk_attr_set [SUS-CURSES] 26990 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 26991 [SUS-CURSES] slk_clear [SUS-CURSES] 26992 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 26993 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 26994 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 26995 [SUS-CURSES] slk_touch [SUS-CURSES] 26996 standend [SUS-CURSES] standout [SUS-CURSES] start_color 26997 [SUS-CURSES] subpad [SUS-CURSES] 26998 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 26999 termname [SUS-CURSES] 27000 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum [SUS-CURSES] 27001 tgetstr [SUS-CURSES] 27002 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum [SUS-CURSES] 27003 tigetstr [SUS-CURSES] 27004 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 27005 [SUS-CURSES] tparm [SUS-CURSES] 27006 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 27007 ungetch [SUS-CURSES] 27008 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 27009 [SUS-CURSES] vidputs [SUS-CURSES] 27010 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw [LSB] 27011 vwprintw [SUS-CURSES] 27012 vwscanw [LSB] waddch [SUS-CURSES] waddchnstr [SUS-CURSES] 27013 waddchstr [SUS-CURSES] 27014 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 27015 [SUS-CURSES] wattr_off [SUS-CURSES] 27016 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 27017 [SUS-CURSES] wattron [SUS-CURSES] 27018 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 27019 wborder [SUS-CURSES] 27020 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 27021 wclrtoeol [SUS-CURSES] 27022 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 27023 [SUS-CURSES] wdeleteln [SUS-CURSES] 27024 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 27025 wgetnstr [SUS-CURSES] 27026 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 27027 winchnstr [LSB] 27028 winchstr [LSB] winnstr [SUS-CURSES] winsch [SUS-CURSES] 27029 winsdelln [SUS-CURSES] 27030 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 27031 [SUS-CURSES] winstr [LSB] 27032 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 27033 [SUS-CURSES] wredrawln [SUS-CURSES] 27034 wrefresh [SUS-CURSES] wscanw [LSB] wscrl [SUS-CURSES] 27035 wsetscrreg [SUS-CURSES] 27036 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 27037 [SUS-CURSES] wsyncup [SUS-CURSES] 27038 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline [SUS-CURSES] 27039 27040 An LSB conforming implementation shall provide the generic 27041 deprecated functions for Curses specified in Table 14-5, with 27042 the full mandatory functionality as described in the referenced 27043 underlying specification. 27044 27045 Note: These interfaces are deprecated, and applications 27046 should avoid using them. These interfaces may be withdrawn 27047 in future releases of this specification. 27048 27049 Table 14-5. libncurses - Curses Deprecated Function Interfaces 27050 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum [SUS-CURSES] 27051 tgetstr [SUS-CURSES] 27052 tgoto [SUS-CURSES] 27053 27054 An LSB conforming implementation shall provide the generic data 27055 interfaces for Curses specified in Table 14-6, with the full 27056 mandatory functionality as described in the referenced 27057 underlying specification. 27058 27059 Table 14-6. libncurses - Curses Data Interfaces 27060 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 27061 LINES [SUS-CURSES] 27062 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 27063 stdscr [SUS-CURSES] 27064 __________________________________________________________ 27065 27066 14.6. Data Definitions for libncurses 27067 27068 This section defines global identifiers and their values that 27069 are associated with interfaces contained in libncurses. These 27070 definitions are organized into groups that correspond to system 27071 headers. This convention is used as a convenience for the 27072 reader, and does not imply the existence of these headers, or 27073 their content. Where an interface is defined as requiring a 27074 particular system header file all of the data definitions for 27075 that system header file presented here shall be in effect. 27076 27077 This section gives data definitions to promote binary 27078 application portability, not to repeat source interface 27079 definitions available elsewhere. System providers and 27080 application developers should use this ABI to supplement - not 27081 to replace - source interface definition specifications. 27082 27083 This specification uses the ISO C (1999) C Language as the 27084 reference programming language, and data definitions are 27085 specified in ISO C format. The C language is used here as a 27086 convenient notation. Using a C language description of these 27087 data objects does not preclude their use by other programming 27088 languages. 27089 __________________________________________________________ 27090 27091 14.6.1. curses.h 27092 27093 #define ERR (-1) 27094 #define OK (0) 27095 #define ACS_RARROW (acs_map['+']) 27096 #define ACS_LARROW (acs_map[',']) 27097 #define ACS_UARROW (acs_map['-']) 27098 #define ACS_DARROW (acs_map['.']) 27099 #define ACS_BLOCK (acs_map['0']) 27100 #define ACS_CKBOARD (acs_map['a']) 27101 #define ACS_DEGREE (acs_map['f']) 27102 #define ACS_PLMINUS (acs_map['g']) 27103 #define ACS_BOARD (acs_map['h']) 27104 #define ACS_LANTERN (acs_map['i']) 27105 #define ACS_LRCORNER (acs_map['j']) 27106 #define ACS_URCORNER (acs_map['k']) 27107 #define ACS_ULCORNER (acs_map['l']) 27108 #define ACS_LLCORNER (acs_map['m']) 27109 #define ACS_PLUS (acs_map['n']) 27110 #define ACS_S1 (acs_map['o']) 27111 #define ACS_HLINE (acs_map['q']) 27112 #define ACS_S9 (acs_map['s']) 27113 #define ACS_LTEE (acs_map['t']) 27114 #define ACS_RTEE (acs_map['u']) 27115 #define ACS_BTEE (acs_map['v']) 27116 #define ACS_TTEE (acs_map['w']) 27117 #define ACS_VLINE (acs_map['x']) 27118 #define ACS_DIAMOND (acs_map['`']) 27119 #define ACS_BULLET (acs_map['~']) 27120 #define getmaxyx(win,y,x) \ 27121 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 27122 #define getbegyx(win,y,x) \ 27123 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 27124 #define getyx(win,y,x) \ 27125 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 27126 #define getparyx(win,y,x) \ 27127 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 27128 27129 #define __NCURSES_H 1 27130 #define NCURSES_EXPORT(type) type 27131 #define NCURSES_EXPORT_VAR(type) type 27132 27133 #define WA_ALTCHARSET A_ALTCHARSET 27134 #define WA_ATTRIBUTES A_ATTRIBUTES 27135 #define WA_BLINK A_BLINK 27136 #define WA_BOLD A_BOLD 27137 #define WA_DIM A_DIM 27138 #define WA_HORIZONTAL A_HORIZONTAL 27139 #define WA_INVIS A_INVIS 27140 #define WA_LEFT A_LEFT 27141 #define WA_LOW A_LOW 27142 #define WA_NORMAL A_NORMAL 27143 #define WA_PROTECT A_PROTECT 27144 #define WA_REVERSE A_REVERSE 27145 #define WA_RIGHT A_RIGHT 27146 #define WA_STANDOUT A_STANDOUT 27147 #define WA_TOP A_TOP 27148 #define WA_UNDERLINE A_UNDERLINE 27149 #define WA_VERTICAL A_VERTICAL 27150 #define A_REVERSE NCURSES_BITS(1UL,10) 27151 27152 #define COLOR_BLACK 0 27153 #define COLOR_RED 1 27154 #define COLOR_GREEN 2 27155 #define COLOR_YELLOW 3 27156 #define COLOR_BLUE 4 27157 #define COLOR_MAGENTA 5 27158 #define COLOR_CYAN 6 27159 #define COLOR_WHITE 7 27160 27161 #define _SUBWIN 0x01 27162 #define _ENDLINE 0x02 27163 #define _FULLWIN 0x04 27164 #define _SCROLLWIN 0x08 27165 #define _ISPAD 0x10 27166 #define _HASMOVED 0x20 27167 27168 typedef unsigned char bool; 27169 27170 typedef unsigned long int chtype; 27171 typedef struct screen SCREEN; 27172 typedef struct _win_st WINDOW; 27173 typedef chtype attr_t; 27174 typedef struct { 27175 attr_t attr; 27176 wchar_t chars[5]; 27177 } cchar_t; 27178 struct pdat { 27179 short _pad_y; 27180 short _pad_x; 27181 short _pad_top; 27182 short _pad_left; 27183 short _pad_bottom; 27184 short _pad_right; 27185 }; 27186 27187 struct _win_st { 27188 short _cury; /* current cursor position */ 27189 short _curx; 27190 short _maxy; /* maximums of x and y, NOT window size*/ 27191 short _maxx; 27192 short _begy; /* screen coords of upper-left-hand corner */ 27193 short _begx; 27194 short _flags; /* window state flags */ 27195 attr_t _attrs; /* current attribute for non-space character */ 27196 chtype _bkgd; /* current background char/attribute pair */ 27197 bool _notimeout; /* no time out on function-key entry? */ 27198 bool _clear; /* consider all data in the window invalid? */ 27199 bool _leaveok; /* OK to not reset cursor on exit? */ 27200 bool _scroll; /* OK to scroll this window? */ 27201 bool _idlok; /* OK to use insert/delete line? */ 27202 bool _idcok; /* OK to use insert/delete char? */ 27203 bool _immed; /* window in immed mode? (not yet used)*/ 27204 bool _sync; /* window in sync mode? */ 27205 bool _use_keypad; /* process function keys into KEY_ symbols? */ 27206 int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ 27207 struct ldat *_line; /* the actual line data */ 27208 short _regtop; /* top line of scrolling region */ 27209 short _regbottom; /* bottom line of scrolling region */ 27210 int _parx; /* x coordinate of this window in parent */ 27211 int _pary; /* y coordinate of this window in parent */ 27212 WINDOW *_parent; /* pointer to parent if a sub-window */ 27213 struct pdat _pad; 27214 short _yoffset; /* real begy is _begy + _yoffset */ 27215 cchar_t _bkgrnd; /* current background char/attribute pair */ 27216 }; 27217 27218 #define KEY_F(n) (KEY_F0+(n)) 27219 #define KEY_CODE_YES 0400 27220 #define KEY_BREAK 0401 27221 #define KEY_MIN 0401 27222 #define KEY_DOWN 0402 27223 #define KEY_UP 0403 27224 #define KEY_LEFT 0404 27225 #define KEY_RIGHT 0405 27226 #define KEY_HOME 0406 27227 #define KEY_BACKSPACE 0407 27228 #define KEY_F0 0410 27229 #define KEY_DL 0510 27230 #define KEY_IL 0511 27231 #define KEY_DC 0512 27232 #define KEY_IC 0513 27233 #define KEY_EIC 0514 27234 #define KEY_CLEAR 0515 27235 #define KEY_EOS 0516 27236 #define KEY_EOL 0517 27237 #define KEY_SF 0520 27238 #define KEY_SR 0521 27239 #define KEY_NPAGE 0522 27240 #define KEY_PPAGE 0523 27241 #define KEY_STAB 0524 27242 #define KEY_CTAB 0525 27243 #define KEY_CATAB 0526 27244 #define KEY_ENTER 0527 27245 #define KEY_SRESET 0530 27246 #define KEY_RESET 0531 27247 #define KEY_PRINT 0532 27248 #define KEY_LL 0533 27249 #define KEY_A1 0534 27250 #define KEY_A3 0535 27251 #define KEY_B2 0536 27252 #define KEY_C1 0537 27253 #define KEY_C3 0540 27254 #define KEY_BTAB 0541 27255 #define KEY_BEG 0542 27256 #define KEY_CANCEL 0543 27257 #define KEY_CLOSE 0544 27258 #define KEY_COMMAND 0545 27259 #define KEY_COPY 0546 27260 #define KEY_CREATE 0547 27261 #define KEY_END 0550 27262 #define KEY_EXIT 0551 27263 #define KEY_FIND 0552 27264 #define KEY_HELP 0553 27265 #define KEY_MARK 0554 27266 #define KEY_MESSAGE 0555 27267 #define KEY_MOVE 0556 27268 #define KEY_NEXT 0557 27269 #define KEY_OPEN 0560 27270 #define KEY_OPTIONS 0561 27271 #define KEY_PREVIOUS 0562 27272 #define KEY_REDO 0563 27273 #define KEY_REFERENCE 0564 27274 #define KEY_REFRESH 0565 27275 #define KEY_REPLACE 0566 27276 #define KEY_RESTART 0567 27277 #define KEY_RESUME 0570 27278 #define KEY_SAVE 0571 27279 #define KEY_SBEG 0572 27280 #define KEY_SCANCEL 0573 27281 #define KEY_SCOMMAND 0574 27282 #define KEY_SCOPY 0575 27283 #define KEY_SCREATE 0576 27284 #define KEY_SDC 0577 27285 #define KEY_SDL 0600 27286 #define KEY_SELECT 0601 27287 #define KEY_SEND 0602 27288 #define KEY_SEOL 0603 27289 #define KEY_SEXIT 0604 27290 #define KEY_SFIND 0605 27291 #define KEY_SHELP 0606 27292 #define KEY_SHOME 0607 27293 #define KEY_SIC 0610 27294 #define KEY_SLEFT 0611 27295 #define KEY_SMESSAGE 0612 27296 #define KEY_SMOVE 0613 27297 #define KEY_SNEXT 0614 27298 #define KEY_SOPTIONS 0615 27299 #define KEY_SPREVIOUS 0616 27300 #define KEY_SPRINT 0617 27301 #define KEY_SREDO 0620 27302 #define KEY_SREPLACE 0621 27303 #define KEY_SRIGHT 0622 27304 #define KEY_SRSUME 0623 27305 #define KEY_SSAVE 0624 27306 #define KEY_SSUSPEND 0625 27307 #define KEY_SUNDO 0626 27308 #define KEY_SUSPEND 0627 27309 #define KEY_UNDO 0630 27310 #define KEY_MOUSE 0631 27311 #define KEY_RESIZE 0632 27312 #define KEY_MAX 0777 27313 27314 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 27315 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 27316 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 27317 #define A_NORMAL 0L 27318 #define NCURSES_ATTR_SHIFT 8 27319 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 27320 #define A_BLINK NCURSES_BITS(1UL,11) 27321 #define A_DIM NCURSES_BITS(1UL,12) 27322 #define A_BOLD NCURSES_BITS(1UL,13) 27323 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 27324 #define A_INVIS NCURSES_BITS(1UL,15) 27325 #define A_PROTECT NCURSES_BITS(1UL,16) 27326 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 27327 #define A_LEFT NCURSES_BITS(1UL,18) 27328 #define A_LOW NCURSES_BITS(1UL,19) 27329 #define A_RIGHT NCURSES_BITS(1UL,20) 27330 #define A_TOP NCURSES_BITS(1UL,21) 27331 #define A_VERTICAL NCURSES_BITS(1UL,22) 27332 #define A_STANDOUT NCURSES_BITS(1UL,8) 27333 #define A_UNDERLINE NCURSES_BITS(1UL,9) 27334 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 27335 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 27336 27337 extern int COLORS; 27338 extern int COLOR_PAIRS; 27339 extern int COLS; 27340 extern int LINES; 27341 extern chtype acs_map[]; 27342 extern int addch(const chtype); 27343 extern int addchnstr(const chtype *, int); 27344 extern int addchstr(const chtype *); 27345 extern int addnstr(const char *, int); 27346 extern int addstr(const char *); 27347 extern int attr_get(attr_t *, short *, void *); 27348 extern int attr_off(attr_t, void *); 27349 extern int attr_on(attr_t, void *); 27350 extern int attr_set(attr_t, short, void *); 27351 extern int attroff(int); 27352 extern int attron(int); 27353 extern int attrset(int); 27354 extern int baudrate(void); 27355 extern int beep(void); 27356 extern int bkgd(chtype); 27357 extern void bkgdset(chtype); 27358 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 27359 chtype); 27360 extern int box(WINDOW *, chtype, chtype); 27361 extern bool can_change_color(void); 27362 extern int cbreak(void); 27363 extern int chgat(int, attr_t, short, const void *); 27364 extern int clear(void); 27365 extern int clearok(WINDOW *, bool); 27366 extern int clrtobot(void); 27367 extern int clrtoeol(void); 27368 extern int color_content(short, short *, short *, short *); 27369 extern int color_set(short, void *); 27370 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 27371 int); 27372 extern int curs_set(int); 27373 extern WINDOW *curscr; 27374 extern int def_prog_mode(void); 27375 extern int def_shell_mode(void); 27376 extern int delay_output(int); 27377 extern int delch(void); 27378 extern int deleteln(void); 27379 extern void delscreen(SCREEN *); 27380 extern int delwin(WINDOW *); 27381 extern WINDOW *derwin(WINDOW *, int, int, int, int); 27382 extern int doupdate(void); 27383 extern WINDOW *dupwin(WINDOW *); 27384 extern int echo(void); 27385 extern int echochar(const chtype); 27386 extern int endwin(void); 27387 extern int erase(void); 27388 extern char erasechar(void); 27389 extern void filter(void); 27390 extern int flash(void); 27391 extern int flushinp(void); 27392 extern chtype getbkgd(WINDOW *); 27393 extern int getch(void); 27394 extern int getnstr(char *, int); 27395 extern int getstr(char *); 27396 extern WINDOW *getwin(FILE *); 27397 extern int halfdelay(int); 27398 extern bool has_colors(void); 27399 extern bool has_ic(void); 27400 extern bool has_il(void); 27401 extern int hline(chtype, int); 27402 extern void idcok(WINDOW *, bool); 27403 extern int idlok(WINDOW *, bool); 27404 extern void immedok(WINDOW *, bool); 27405 extern chtype inch(void); 27406 extern int inchnstr(chtype *, int); 27407 extern int inchstr(chtype *); 27408 extern int init_color(short, short, short, short); 27409 extern int init_pair(short, short, short); 27410 extern WINDOW *initscr(void); 27411 extern int innstr(char *, int); 27412 extern int insch(chtype); 27413 extern int insdelln(int); 27414 extern int insertln(void); 27415 extern int insnstr(const char *, int); 27416 extern int insstr(const char *); 27417 extern int instr(char *); 27418 extern int intrflush(WINDOW *, bool); 27419 extern bool is_linetouched(WINDOW *, int); 27420 extern bool is_wintouched(WINDOW *); 27421 extern bool isendwin(void); 27422 extern const char *keyname(int); 27423 extern int keypad(WINDOW *, bool); 27424 extern char killchar(void); 27425 extern int leaveok(WINDOW *, bool); 27426 extern char *longname(void); 27427 extern int meta(WINDOW *, bool); 27428 extern int move(int, int); 27429 extern int mvaddch(int, int, const chtype); 27430 extern int mvaddchnstr(int, int, const chtype *, int); 27431 extern int mvaddchstr(int, int, const chtype *); 27432 extern int mvaddnstr(int, int, const char *, int); 27433 extern int mvaddstr(int, int, const char *); 27434 extern int mvchgat(int, int, int, attr_t, short, const void *); 27435 extern int mvcur(int, int, int, int); 27436 extern int mvdelch(int, int); 27437 extern int mvderwin(WINDOW *, int, int); 27438 extern int mvgetch(int, int); 27439 extern int mvgetnstr(int, int, char *, int); 27440 extern int mvgetstr(int, int, char *); 27441 extern int mvhline(int, int, chtype, int); 27442 extern chtype mvinch(int, int); 27443 extern int mvinchnstr(int, int, chtype *, int); 27444 extern int mvinchstr(int, int, chtype *); 27445 extern int mvinnstr(int, int, char *, int); 27446 extern int mvinsch(int, int, chtype); 27447 extern int mvinsnstr(int, int, const char *, int); 27448 extern int mvinsstr(int, int, const char *); 27449 extern int mvinstr(int, int, char *); 27450 extern int mvprintw(int, int, const char *, ...); 27451 extern int mvscanw(int, int, const char *, ...); 27452 extern int mvvline(int, int, chtype, int); 27453 extern int mvwaddch(WINDOW *, int, int, const chtype); 27454 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 27455 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 27456 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 27457 extern int mvwaddstr(WINDOW *, int, int, const char *); 27458 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *); 27459 extern int mvwdelch(WINDOW *, int, int); 27460 extern int mvwgetch(WINDOW *, int, int); 27461 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 27462 extern int mvwgetstr(WINDOW *, int, int, char *); 27463 extern int mvwhline(WINDOW *, int, int, chtype, int); 27464 extern int mvwin(WINDOW *, int, int); 27465 extern chtype mvwinch(WINDOW *, int, int); 27466 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 27467 extern int mvwinchstr(WINDOW *, int, int, chtype *); 27468 extern int mvwinnstr(WINDOW *, int, int, char *, int); 27469 extern int mvwinsch(WINDOW *, int, int, chtype); 27470 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 27471 extern int mvwinsstr(WINDOW *, int, int, const char *); 27472 extern int mvwinstr(WINDOW *, int, int, char *); 27473 extern int mvwprintw(WINDOW *, int, int, const char *, ...); 27474 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 27475 extern int mvwvline(WINDOW *, int, int, chtype, int); 27476 extern int napms(int); 27477 extern WINDOW *newpad(int, int); 27478 extern SCREEN *newterm(const char *, FILE *, FILE *); 27479 extern WINDOW *newwin(int, int, int, int); 27480 extern int nl(void); 27481 extern int nocbreak(void); 27482 extern int nodelay(WINDOW *, bool); 27483 extern int noecho(void); 27484 extern int nonl(void); 27485 extern void noqiflush(void); 27486 extern int noraw(void); 27487 extern int notimeout(WINDOW *, bool); 27488 extern int overlay(const WINDOW *, WINDOW *); 27489 extern int overwrite(const WINDOW *, WINDOW *); 27490 extern int pair_content(short, short *, short *); 27491 extern int pechochar(WINDOW *, chtype); 27492 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 27493 extern int prefresh(WINDOW *, int, int, int, int, int, int); 27494 extern int printw(const char *, ...); 27495 extern int putwin(WINDOW *, FILE *); 27496 extern void qiflush(void); 27497 extern int raw(void); 27498 extern int redrawwin(WINDOW *); 27499 extern int refresh(void); 27500 extern int reset_prog_mode(void); 27501 extern int reset_shell_mode(void); 27502 extern int resetty(void); 27503 extern int ripoffline(int, int (*)(WINDOW *, int)); 27504 extern int savetty(void); 27505 extern int scanw(const char *, ...); 27506 extern int scr_dump(const char *); 27507 extern int scr_init(const char *); 27508 extern int scr_restore(const char *); 27509 extern int scr_set(const char *); 27510 extern int scrl(int); 27511 extern int scroll(WINDOW *); 27512 extern int scrollok(WINDOW *, bool); 27513 extern SCREEN *set_term(SCREEN *); 27514 extern int setscrreg(int, int); 27515 extern int slk_attr_set(const attr_t, short, void *); 27516 extern int slk_attroff(const chtype); 27517 extern int slk_attron(const chtype); 27518 extern int slk_attrset(const chtype); 27519 extern int slk_clear(void); 27520 extern int slk_color(short); 27521 extern int slk_init(int); 27522 extern char *slk_label(int); 27523 extern int slk_noutrefresh(void); 27524 extern int slk_refresh(void); 27525 extern int slk_restore(void); 27526 extern int slk_set(int, const char *, int); 27527 extern int slk_touch(void); 27528 extern int standend(void); 27529 extern int standout(void); 27530 extern int start_color(void); 27531 extern WINDOW *stdscr; 27532 extern WINDOW *subpad(WINDOW *, int, int, int, int); 27533 extern WINDOW *subwin(WINDOW *, int, int, int, int); 27534 extern int syncok(WINDOW *, bool); 27535 extern chtype termattrs(void); 27536 extern char *termname(void); 27537 extern void timeout(int); 27538 extern int touchline(WINDOW *, int, int); 27539 extern int touchwin(WINDOW *); 27540 extern int typeahead(int); 27541 extern const char *unctrl(chtype); 27542 extern int ungetch(int); 27543 extern int untouchwin(WINDOW *); 27544 extern void use_env(bool); 27545 extern int vidattr(chtype); 27546 extern int vidputs(chtype, int (*)(int)); 27547 extern int vline(chtype, int); 27548 extern int vw_printw(WINDOW *, const char *, va_list); 27549 extern int vw_scanw(WINDOW *, const char *, va_list); 27550 extern int vwprintw(WINDOW *, const char *, va_list); 27551 extern int vwscanw(WINDOW *, const char *, va_list); 27552 extern int waddch(WINDOW *, const chtype); 27553 extern int waddchnstr(WINDOW *, const chtype *, int); 27554 extern int waddchstr(WINDOW *, const chtype *); 27555 extern int waddnstr(WINDOW *, const char *, int); 27556 extern int waddstr(WINDOW *, const char *); 27557 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 27558 extern int wattr_off(WINDOW *, attr_t, void *); 27559 extern int wattr_on(WINDOW *, attr_t, void *); 27560 extern int wattr_set(WINDOW *, attr_t, short, void *); 27561 extern int wattroff(WINDOW *, int); 27562 extern int wattron(WINDOW *, int); 27563 extern int wattrset(WINDOW *, int); 27564 extern int wbkgd(WINDOW *, chtype); 27565 extern void wbkgdset(WINDOW *, chtype); 27566 extern int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, 27567 chtype, chtype, chtype); 27568 extern int wchgat(WINDOW *, int, attr_t, short, const void *); 27569 extern int wclear(WINDOW *); 27570 extern int wclrtobot(WINDOW *); 27571 extern int wclrtoeol(WINDOW *); 27572 extern int wcolor_set(WINDOW *, short, void *); 27573 extern void wcursyncup(WINDOW *); 27574 extern int wdelch(WINDOW *); 27575 extern int wdeleteln(WINDOW *); 27576 extern int wechochar(WINDOW *, const chtype); 27577 extern int werase(WINDOW *); 27578 extern int wgetch(WINDOW *); 27579 extern int wgetnstr(WINDOW *, char *, int); 27580 extern int wgetstr(WINDOW *, char *); 27581 extern int whline(WINDOW *, chtype, int); 27582 extern chtype winch(WINDOW *); 27583 extern int winchnstr(WINDOW *, chtype *, int); 27584 extern int winchstr(WINDOW *, chtype *); 27585 extern int winnstr(WINDOW *, char *, int); 27586 extern int winsch(WINDOW *, chtype); 27587 extern int winsdelln(WINDOW *, int); 27588 extern int winsertln(WINDOW *); 27589 extern int winsnstr(WINDOW *, const char *, int); 27590 extern int winsstr(WINDOW *, const char *); 27591 extern int winstr(WINDOW *, char *); 27592 extern int wmove(WINDOW *, int, int); 27593 extern int wnoutrefresh(WINDOW *); 27594 extern int wprintw(WINDOW *, const char *, ...); 27595 extern int wredrawln(WINDOW *, int, int); 27596 extern int wrefresh(WINDOW *); 27597 extern int wscanw(WINDOW *, const char *, ...); 27598 extern int wscrl(WINDOW *, int); 27599 extern int wsetscrreg(WINDOW *, int, int); 27600 extern int wstandend(WINDOW *); 27601 extern int wstandout(WINDOW *); 27602 extern void wsyncdown(WINDOW *); 27603 extern void wsyncup(WINDOW *); 27604 extern void wtimeout(WINDOW *, int); 27605 extern int wtouchln(WINDOW *, int, int, int); 27606 extern int wvline(WINDOW *, chtype, int); 27607 __________________________________________________________ 27608 27609 14.6.2. term.h 27610 27611 extern TERMINAL *cur_term; 27612 extern int del_curterm(TERMINAL *); 27613 extern int putp(const char *); 27614 extern int restartterm(char *, int, int *); 27615 extern TERMINAL *set_curterm(TERMINAL *); 27616 extern int setupterm(char *, int, int *); 27617 extern int tgetent(char *, const char *); 27618 extern int tgetflag(char *); 27619 extern int tgetnum(char *); 27620 extern char *tgetstr(char *, char **); 27621 extern char *tgoto(const char *, int, int); 27622 extern int tigetflag(const char *); 27623 extern int tigetnum(const char *); 27624 extern char *tigetstr(const char *); 27625 extern char *tparm(const char *, ...); 27626 extern int tputs(const char *, int, int (*)(int)); 27627 __________________________________________________________ 27628 27629 14.7. Interface Definitions for libncurses 27630 27631 Table of Contents 27632 inchnstr -- obtain a string of characters and their attributes 27633 from a curses window 27634 27635 inchstr -- obtain a string of characters and their attributes 27636 from a curses window 27637 27638 instr -- obtain a string of characters from a curses window 27639 mvcur -- send cursor movement commands to terminal 27640 mvinchnstr -- obtain a string of characters and their 27641 attributes from a curses window 27642 27643 mvinchstr -- obtain a string of characters and their attributes 27644 from a curses window 27645 27646 mvinstr -- obtain a string of characters from a curses window 27647 mvscanw -- convert formatted input from a curses window 27648 mvwinchnstr -- obtain a string of characters and their 27649 attributes from a curses window 27650 27651 mvwinchstr -- obtain a string of characters and their 27652 attributes from a curses window 27653 27654 mvwinstr -- obtain a string of characters from a curses window 27655 mvwscanw -- convert formatted input from a curses window 27656 ripoffline -- obtain a string of characters and their 27657 attributes from a curses window 27658 27659 scanw -- convert formatted input from a curses window 27660 vw_scanw -- convert formatted input from a curses window 27661 vwscanw -- convert formatted input from a curses window 27662 winchnstr -- obtain a string of characters and their attributes 27663 from a curses window 27664 27665 winchstr -- obtain a string of characters and their attributes 27666 from a curses window 27667 27668 winstr -- obtain a string of characters from a curses window 27669 wscanw -- convert formatted input from a curses window 27670 27671 The interfaces defined on the following pages are included in 27672 libncurses and are defined by this specification. Unless 27673 otherwise noted, these interfaces shall be included in the 27674 source standard. 27675 27676 Other interfaces listed in Section 14.5 shall behave as 27677 described in the referenced base document. 27678 27679 inchnstr 27680 27681 Name 27682 27683 inchnstr -- obtain a string of characters and their attributes 27684 from a curses window 27685 27686 Synopsis 27687 27688 #include 27689 27690 int inchnstr(chtype * chstr, int n); 27691 27692 Description 27693 27694 The interface inchnstr() shall behave as specified in X/Open 27695 Curses, except that inchnstr() shall return the number of 27696 characters that were read. 27697 27698 inchstr 27699 27700 Name 27701 27702 inchstr -- obtain a string of characters and their attributes 27703 from a curses window 27704 27705 Synopsis 27706 27707 #include 27708 27709 int inchstr(chtype * chstr); 27710 27711 Description 27712 27713 The interface inchstr() shall behave as specified in X/Open 27714 Curses, except that inchstr() shall return the number of 27715 characters that were read. 27716 27717 instr 27718 27719 Name 27720 27721 instr -- obtain a string of characters from a curses window 27722 27723 Synopsis 27724 27725 #include 27726 27727 int instr(char * str); 27728 27729 Description 27730 27731 The interface instr() shall behave as specified in X/Open 27732 Curses, except that instr() shall return the number of 27733 characters that were read. 27734 27735 mvcur 27736 27737 Name 27738 27739 mvcur -- send cursor movement commands to terminal 27740 27741 Synopsis 27742 27743 #include 27744 27745 int mvcur(int oldrow, int oldcol, int newrow, int newcol); 27746 27747 Description 27748 27749 The interface mvcur() shall behave as described in X/Open 27750 Curses, except that if (newrow, newcol) is not a valid address 27751 for the terminal in use, the results of the mvcur() function 27752 are unspecified. 27753 27754 mvinchnstr 27755 27756 Name 27757 27758 mvinchnstr -- obtain a string of characters and their 27759 attributes from a curses window 27760 27761 Synopsis 27762 27763 #include 27764 27765 int mvinchnstr(int y, int x, chtype * chstr, int n); 27766 27767 Description 27768 27769 The interface mvinchnstr() shall behave as specified in X/Open 27770 Curses, except that mvinchnstr() shall return the number of 27771 characters that were read. 27772 27773 mvinchstr 27774 27775 Name 27776 27777 mvinchstr -- obtain a string of characters and their attributes 27778 from a curses window 27779 27780 Synopsis 27781 27782 #include 27783 27784 int mvinchstr(int y, int x, chtype * chstr); 27785 27786 Description 27787 27788 The interface mvinchstr() shall behave as specified in X/Open 27789 Curses, except that mvinchstr() shall return the number of 27790 characters that were read. 27791 27792 mvinstr 27793 27794 Name 27795 27796 mvinstr -- obtain a string of characters from a curses window 27797 27798 Synopsis 27799 27800 #include 27801 27802 int mvinstr(int y, int x, char * str); 27803 27804 Description 27805 27806 The interface mvinstr() shall behave as specified in X/Open 27807 Curses, except that mvinstr() shall return the number of 27808 characters that were read. 27809 27810 mvscanw 27811 27812 Name 27813 27814 mvscanw -- convert formatted input from a curses window 27815 27816 Synopsis 27817 27818 #include 27819 27820 int mvscanw(int y, int x, const char *fmt, ...); 27821 27822 Description 27823 27824 The scanw family of functions shall behave as described in 27825 X/Open Curses, except as noted below. 27826 27827 Differences 27828 27829 This function returns ERR on failure. On success it returns the 27830 number of successfully matched and assigned input items. This 27831 differs from X/Open Curses, which indicates this function 27832 returns OK on success. 27833 27834 mvwinchnstr 27835 27836 Name 27837 27838 mvwinchnstr -- obtain a string of characters and their 27839 attributes from a curses window 27840 27841 Synopsis 27842 27843 #include 27844 27845 int mvwinchnstr(WINDOW * win, int y, int x, chtype * chstr, int 27846 n); 27847 27848 Description 27849 27850 The interface mvwinchnstr() shall behave as specified in X/Open 27851 Curses, except that mvwinchnstr() shall return the number of 27852 characters that were read. 27853 27854 mvwinchstr 27855 27856 Name 27857 27858 mvwinchstr -- obtain a string of characters and their 27859 attributes from a curses window 27860 27861 Synopsis 27862 27863 #include 27864 27865 int mvwinchstr(WINDOW * win, int y, int x, chtype * chstr); 27866 27867 Description 27868 27869 The interface mvwinchstr() shall behave as specified in X/Open 27870 Curses, except that mvwinchstr() shall return the number of 27871 characters that were read. 27872 27873 mvwinstr 27874 27875 Name 27876 27877 mvwinstr -- obtain a string of characters from a curses window 27878 27879 Synopsis 27880 27881 #include 27882 27883 int mvwinstr(WINDOW * win, int y, int x, char * str); 27884 27885 Description 27886 27887 The interface mvwinstr() shall behave as specified in X/Open 27888 Curses, except that mvwinstr() shall return the number of 27889 characters that were read. 27890 27891 mvwscanw 27892 27893 Name 27894 27895 mvwscanw -- convert formatted input from a curses window 27896 27897 Synopsis 27898 27899 #include 27900 27901 int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...); 27902 27903 Description 27904 27905 The scanw family of functions shall behave as described in 27906 X/Open Curses, except as noted below. 27907 27908 Differences 27909 27910 This function returns ERR on failure. On success it returns the 27911 number of successfully matched and assigned input items. This 27912 differs from X/Open Curses, which indicates this function 27913 returns OK on success. 27914 27915 ripoffline 27916 27917 Name 27918 27919 ripoffline -- obtain a string of characters and their 27920 attributes from a curses window 27921 27922 Synopsis 27923 27924 #include 27925 27926 int ripoffline(int line, int (*init) (WINDOW *, int)); 27927 27928 Description 27929 27930 The interface ripoffline() shall behave as specified in X/Open 27931 Curses, except that ripoffline() shall return -1 if the number 27932 of lines that were ripped off exceeds five. 27933 27934 scanw 27935 27936 Name 27937 27938 scanw -- convert formatted input from a curses window 27939 27940 Synopsis 27941 27942 #include 27943 27944 int scanw(const char *fmt, ...); 27945 27946 Description 27947 27948 The scanw family of functions shall behave as described in 27949 X/Open Curses, except as noted below. 27950 27951 Differences 27952 27953 This function returns ERR on failure. On success it returns the 27954 number of successfully matched and assigned input items. This 27955 differs from X/Open Curses, which indicates this function 27956 returns OK on success. 27957 27958 vw_scanw 27959 27960 Name 27961 27962 vw_scanw -- convert formatted input from a curses window 27963 27964 Synopsis 27965 27966 #include 27967 27968 int vw_scanw(WINDOW *win, const char *fmt, va_list vararglist); 27969 27970 Description 27971 27972 The scanw family of functions shall behave as described in 27973 X/Open Curses, except as noted below. 27974 27975 Differences 27976 27977 This function returns ERR on failure. On success it returns the 27978 number of successfully matched and assigned input items. This 27979 differs from X/Open Curses, which indicates this function 27980 returns OK on success. 27981 27982 vwscanw 27983 27984 Name 27985 27986 vwscanw -- convert formatted input from a curses window 27987 27988 Synopsis 27989 27990 #include 27991 27992 int vw_scanw(WINDOW *win, const char *fmt, va_list vararglist); 27993 27994 Description 27995 27996 The scanw family of functions shall behave as described in 27997 X/Open Curses, except as noted below. 27998 27999 Differences 28000 28001 This function returns ERR on failure. On success it returns the 28002 number of successfully matched and assigned input items. This 28003 differs from X/Open Curses, which indicates this function 28004 returns OK on success. 28005 28006 winchnstr 28007 28008 Name 28009 28010 winchnstr -- obtain a string of characters and their attributes 28011 from a curses window 28012 28013 Synopsis 28014 28015 #include 28016 28017 int winchnstr(WINDOW * win, chtype * chstr, int n); 28018 28019 Description 28020 28021 The interface winchnstr() shall behave as specified in X/Open 28022 Curses, except that winchnstr() shall return the number of 28023 characters that were read. 28024 28025 winchstr 28026 28027 Name 28028 28029 winchstr -- obtain a string of characters and their attributes 28030 from a curses window 28031 28032 Synopsis 28033 28034 #include 28035 28036 int winchstr(WINDOW * win, chtype * chstr); 28037 28038 Description 28039 28040 The interface winchstr() shall behave as specified in X/Open 28041 Curses, except that winchstr() shall return the number of 28042 characters that were read. 28043 28044 winstr 28045 28046 Name 28047 28048 winstr -- obtain a string of characters from a curses window 28049 28050 Synopsis 28051 28052 #include 28053 28054 int winstr(WINDOW * win, char * str); 28055 28056 Description 28057 28058 The interface winstr() shall behave as specified in ISO POSIX 28059 (2003), except that winstr() shall return the number of 28060 characters that were read. 28061 28062 wscanw 28063 28064 Name 28065 28066 wscanw -- convert formatted input from a curses window 28067 28068 Synopsis 28069 28070 #include 28071 28072 int wscanw(WINDOW *win, const char *fmt, ...); 28073 28074 Description 28075 28076 The scanw family of functions shall behave as described in 28077 X/Open Curses, except as noted below. 28078 28079 Differences 28080 28081 This function returns ERR on failure. On success it returns the 28082 number of successfully matched and assigned input items. This 28083 differs from X/Open Curses, which indicates this function 28084 returns OK on success. 28085 __________________________________________________________ 28086 28087 14.8. Interfaces for libutil 28088 28089 Table 14-7 defines the library name and shared object name for 28090 the libutil library 28091 28092 Table 14-7. libutil Definition 28093 Library: libutil 28094 SONAME: libutil.so.1 28095 28096 The behavior of the interfaces in this library is specified by 28097 the following specifications: 28098 28099 [LSB] This Specification 28100 __________________________________________________________ 28101 28102 14.8.1. Utility Functions 28103 __________________________________________________________ 28104 28105 14.8.1.1. Interfaces for Utility Functions 28106 28107 An LSB conforming implementation shall provide the generic 28108 functions for Utility Functions specified in Table 14-8, with 28109 the full mandatory functionality as described in the referenced 28110 underlying specification. 28111 28112 Table 14-8. libutil - Utility Functions Function Interfaces 28113 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 28114 logwtmp [LSB] openpty [LSB] 28115 __________________________________________________________ 28116 28117 14.9. Interface Definitions for libutil 28118 28119 Table of Contents 28120 forkpty -- Create a new process attached to an available 28121 pseudo-terminal 28122 28123 login -- login utility function 28124 login_tty -- Prepare a terminal for login 28125 logout -- logout utility function 28126 logwtmp -- append an entry to the wtmp file 28127 openpty -- find and open an available pseudo-terminal 28128 28129 The interfaces defined on the following pages are included in 28130 libutil and are defined by this specification. Unless otherwise 28131 noted, these interfaces shall be included in the source 28132 standard. 28133 28134 Other interfaces listed in Section 14.8 shall behave as 28135 described in the referenced base document. 28136 28137 forkpty 28138 28139 Name 28140 28141 forkpty -- Create a new process attached to an available 28142 pseudo-terminal 28143 28144 Synopsis 28145 28146 #include 28147 28148 int forkpty(int * amaster, char * name, struct termios * termp, 28149 struct winsize * winp); 28150 28151 Description 28152 28153 The forkpty() function shall find and open a pseudo-terminal 28154 device pair in the same manner as the openpty() function. If a 28155 pseudo-terminal is available, forkpty() shall create a new 28156 process in the same manner as the fork() function, and prepares 28157 the new process for login in the same manner as login_tty(). 28158 28159 If termp is not null, it shall refer to a termios structure 28160 that shall be used to initialize the characteristics of the 28161 slave device. If winp is not null, it shall refer to a winsize 28162 structure used to initialize the window size of the slave 28163 device. 28164 28165 Return Value 28166 28167 On success, the parent process shall return the process id of 28168 the child, and the child shall return 0. On error, no new 28169 process shall be created, -1 shall be returned, and errno shall 28170 be set appropriately. On success, the parent process shall 28171 receive the file descriptor of the master side of the 28172 pseudo-terminal in the location referenced by amaster, and, if 28173 name is not NULL, the filename of the slave device in name. 28174 28175 Errors 28176 28177 EAGAIN 28178 28179 Unable to create a new process. 28180 ENOENT 28181 28182 There are no available pseudo-terminals. 28183 ENOMEM 28184 28185 Insufficient memory was available. 28186 28187 login 28188 28189 Name 28190 28191 login -- login utility function 28192 28193 Synopsis 28194 28195 #include 28196 28197 void login (struct utmp * ut ); 28198 28199 Description 28200 28201 The login() function shall update the user accounting 28202 databases. The ut parameter shall reference a utmp structure 28203 for all fields except the following: 28204 28205 1. The ut_type field shall be set to USER_PROCESS. 28206 2. The ut_pid field shall be set to the process identifier for 28207 the current process. 28208 3. The ut_line field shall be set to the name of the 28209 controlling terminal device. The name shall be found by 28210 examining the device associated with the standard input, 28211 output and error streams in sequence, until one associated 28212 with a terminal device is found. If none of these streams 28213 refers to a terminal device, the ut_line field shall be set 28214 to "???". If the terminal device is in the /dev directory 28215 hierarchy, the ut_line field shall not contain the leading 28216 "/dev/", otherwise it shall be set to the final component 28217 of the pathname of the device. If the user accounting 28218 database imposes a limit on the size of the ut_line field, 28219 it shall truncate the name, but any such limit shall not be 28220 smaller than UT_LINESIZE (including a terminating null 28221 character). 28222 28223 Return Value 28224 28225 None 28226 28227 Errors 28228 28229 None 28230 28231 login_tty 28232 28233 Name 28234 28235 login_tty -- Prepare a terminal for login 28236 28237 Synopsis 28238 28239 #include 28240 28241 int login_tty (int fdr); 28242 28243 Description 28244 28245 The login_tty() function shall prepare the terminal device 28246 referenced by the file descriptor fdr. This function shall 28247 create a new session, make the terminal the controlling 28248 terminal for the current process, and set the standard input, 28249 output, and error streams of the current process to the 28250 terminal. If fdr is not the standard input, output or error 28251 stream, then login_tty() shall close fdr. 28252 28253 Return Value 28254 28255 On success, login_tty() shall return zero; otherwise -1 is 28256 returned, and errno shall be set appropriately. 28257 28258 Errors 28259 28260 ENOTTY 28261 28262 fdr does not refer to a terminal device. 28263 28264 logout 28265 28266 Name 28267 28268 logout -- logout utility function 28269 28270 Synopsis 28271 28272 #include 28273 28274 int logout (const char * line ); 28275 28276 Description 28277 28278 Given the device line, the logout() function shall search the 28279 user accounting database which is read by getutent() for an 28280 entry with the corresponding line, and with the type of 28281 USER_PROCESS. If a corresponding entry is located, it shall be 28282 updated as follows: 28283 28284 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 28285 bytes). 28286 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 28287 bytes). 28288 3. The ut_tv shall be set to the current time of day. 28289 4. The ut_type field shall be set to DEAD_PROCESS. 28290 28291 Return Value 28292 28293 On success, the logout() function shall return non-zero. Zero 28294 is returned if there was no entry to remove, or if the utmp 28295 file could not be opened or updated. 28296 28297 logwtmp 28298 28299 Name 28300 28301 logwtmp -- append an entry to the wtmp file 28302 28303 Synopsis 28304 28305 #include 28306 28307 void logwtmp (const char * line , const char * name , const 28308 char * host ); 28309 28310 Description 28311 28312 If the process has permission to update the user accounting 28313 databases, the logwtmp() function shall append a record to the 28314 user accounting database that records all logins and logouts. 28315 The record to be appended shall be constructed as follows: 28316 28317 1. The ut_line field shall be initialized from line. If the 28318 user accounting database imposes a limit on the size of the 28319 ut_line field, it shall truncate the value, but any such 28320 limit shall not be smaller than UT_LINESIZE (including a 28321 terminating null character). 28322 2. The ut_name field shall be initialized from name. If the 28323 user accounting database imposes a limit on the size of the 28324 ut_name field, it shall truncate the value, but any such 28325 limit shall not be smaller than UT_NAMESIZE (including a 28326 terminating null character). 28327 3. The ut_host field shall be initialized from host. If the 28328 user accounting database imposes a limit on the size of the 28329 ut_host field, it shall truncate the value, but any such 28330 limit shall not be smaller than UT_HOSTSIZE (including a 28331 terminating null character). 28332 4. If the name parameter does not refer to an empty string 28333 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 28334 otherwise the ut_type field shall be set to DEAD_PROCESS. 28335 5. The ut_id field shall be set to the process identifier for 28336 the current process. 28337 6. The ut_tv field shall be set to the current time of day. 28338 28339 Note: If a process does not have write access to the the 28340 user accounting database, the logwtmp() function will not 28341 update it. Since the function does not return any value, an 28342 application has no way of knowing whether it succeeded or 28343 failed. 28344 28345 Return Value 28346 28347 None. 28348 28349 openpty 28350 28351 Name 28352 28353 openpty -- find and open an available pseudo-terminal 28354 28355 Synopsis 28356 28357 #include 28358 28359 int openpty(int *amaster, int *aslave, char *name, struct 28360 termios *termp, struct winsize *winp); 28361 28362 Description 28363 28364 The openpty() function shall find an available pseudo-terminal 28365 and return file descriptors for the master and slave devices in 28366 the locations referenced by amaster and aslave respectively. If 28367 name is not NULL, the filename of the slave shall be placed in 28368 the user supplied buffer referenced by name. If termp is not 28369 NULL, it shall point to a termios structure used to initialize 28370 the terminal parameters of the slave pseudo-terminal device. If 28371 winp is not NULL, it shall point to a winsize structure used to 28372 initialize the window size parameters of the slave 28373 pseudo-terminal device. 28374 28375 Return Value 28376 28377 On success, zero is returned. On error, -1 is returned, and 28378 errno is set appropriately. 28379 28380 Errors 28381 28382 ENOENT 28383 28384 There are no available pseudo-terminals. 28385 28386 V. Commands and Utilities 28387 28388 Table of Contents 28389 15. Commands and Utilities 28390 28391 15.1. Commands and Utilities 28392 15.2. Command Behavior 28393 28394 ar -- create and maintain library archives 28395 (DEPRECATED) 28396 28397 at -- examine or delete jobs for later execution 28398 awk -- pattern scanning and processing language 28399 batch -- schedule commands to be executed in a batch 28400 queue 28401 28402 bc -- an arbitrary precision calculator language 28403 chfn -- change user name and information 28404 chsh -- change login shell 28405 col -- filter reverse line feeds from input 28406 cpio -- copy file archives in and out 28407 crontab -- maintain crontab files for individual 28408 users 28409 28410 df -- report file system disk space usage 28411 dmesg -- print or control the system message buffer 28412 du -- estimate file space usage 28413 echo -- write arguments to standard output 28414 egrep -- search a file with an Extended Regular 28415 Expression pattern 28416 28417 fgrep -- search a file with a fixed pattern 28418 file -- determine file type 28419 fuser -- identify processes using files or sockets 28420 gettext -- retrieve text string from message catalog 28421 grep -- print lines matching a pattern 28422 groupadd -- create a new group 28423 groupdel -- delete a group 28424 groupmod -- modify a group 28425 groups -- display a group 28426 gunzip -- uncompress files 28427 gzip -- compress or expand files 28428 hostname -- show or set the system's host name 28429 install -- copy files and set attributes 28430 install_initd -- activate an init script 28431 ipcrm -- remove IPC Resources 28432 ipcs -- provide information on ipc facilities 28433 killall -- kill processes by name 28434 lpr -- off line print 28435 ls -- list directory contents 28436 lsb_release -- print distribution specific 28437 information 28438 28439 m4 -- macro processor 28440 md5sum -- generate or check MD5 message digests 28441 mknod -- make special files 28442 mktemp -- make temporary file name (unique) 28443 more -- display files on a page-by-page basis 28444 mount -- mount a file system 28445 msgfmt -- create a message object from a message 28446 file 28447 28448 newgrp -- change group ID 28449 od -- dump files in octal and other formats 28450 passwd -- change user password 28451 patch -- apply a diff file to an original 28452 pidof -- find the process ID of a running program 28453 remove_initd -- clean up init script system 28454 modifications introduced by install_initd 28455 28456 renice -- alter priority of running processes 28457 sed -- stream editor 28458 sendmail -- an electronic mail transport agent 28459 seq -- generate a sequence of numbers 28460 sh -- shell, the standard command language 28461 interpreter 28462 28463 shutdown -- shut the system down 28464 su -- change user ID 28465 sync -- flush file system buffers 28466 tar -- file archiver 28467 umount -- unmount file systems 28468 useradd -- create a new user or update default new 28469 user information 28470 28471 userdel -- delete a user account and related files 28472 usermod -- modify a user account 28473 xargs -- build and execute command lines from 28474 standard input 28475 28476 zcat -- uncompress files to standard output 28477 __________________________________________________________ 28478 28479 Chapter 15. Commands and Utilities 28480 28481 15.1. Commands and Utilities 28482 28483 An LSB conforming implementation shall provide the commands and 28484 utilities as described in Table 15-1, with at least the 28485 behavior described as mandatory in the referenced underlying 28486 specification, with the following exceptions: 28487 28488 1. If any operand (except one which follows --) starts with a 28489 hyphen, the behavior is unspecified. 28490 28491 Rationale (Informative): Applications should place options 28492 before operands, or use --, as needed. This text is needed 28493 because, by default, GNU option parsing differs from POSIX, 28494 unless the environment variable POSIXLY_CORRECT is set. For 28495 example, ls . -a in GNU ls means to list the current 28496 directory, showing all files (that is, "." is an operand and 28497 -a is an option). In POSIX, "." and -a are both operands, 28498 and the command means to list the current directory, and 28499 also the file named -a. Suggesting that applications rely on 28500 the setting of the POSIXLY_CORRECT environment variable, or 28501 try to set it, seems worse than just asking the applications 28502 to invoke commands in ways which work with either the POSIX 28503 or GNU behaviors. 28504 28505 Table 15-1. Commands And Utilities 28506 [ [1] dmesg [2] id [1] msgfmt [2] split [1] 28507 ar [2] du [2] install [2] mv [1] strip [1] 28508 at [2] echo [2] install_initd [2] newgrp [2] stty [1] 28509 awk [2] ed [1] ipcrm [2] nice [1] su [2] 28510 basename [1] egrep [2] ipcs [2] nl [1] sync [2] 28511 batch [2] env [1] join [1] nohup [1] tail [1] 28512 bc [2] expand [1] kill [1] od [2] tar [2] 28513 cat [1] expr [1] killall [2] passwd [2] tee [1] 28514 chfn [2] false [1] ln [1] paste [1] test [1] 28515 chgrp [1] fgrep [2] locale [1] patch [2] time [1] 28516 chmod [1] file [2] localedef [1] pathchk [1] touch [1] 28517 chown [1] find [2] logger [1] pax [1] tr [1] 28518 chsh [2] find [1] logname [1] pidof [2] true [1] 28519 cksum [1] fold [1] lp [1] pr [1] tsort [1] 28520 cmp [1] fuser [2] lpr [2] printf [1] tty [1] 28521 col [2] gencat [1] ls [2] ps [1] umount [2] 28522 comm [1] getconf [1] lsb_release [2] pwd [1] uname [1] 28523 cp [1] gettext [2] m4 [2] remove_initd [2] unexpand [1] 28524 cpio [2] grep [2] mailx [1] renice [2] uniq [1] 28525 crontab [2] groupadd [2] make [1] rm [1] useradd [2] 28526 csplit [1] groupdel [2] man [1] rmdir [1] userdel [2] 28527 cut [2] groupmod [2] md5sum [2] sed [2] usermod [2] 28528 cut [1] groups [2] mkdir [1] sendmail [2] wc [1] 28529 date [1] gunzip [2] mkfifo [1] seq [2] xargs [2] 28530 dd [1] gzip [2] mknod [2] sh [2] zcat [2] 28531 df [2] head [1] mktemp [2] shutdown [2] 28532 diff [1] hostname [2] more [2] sleep [1] 28533 dirname [1] iconv [1] mount [2] sort [1] 28534 28535 Referenced Specification(s) 28536 28537 [1]. ISO POSIX (2003) 28538 28539 [2]. This Specification 28540 28541 An LSB conforming implementation shall provide the shell built 28542 in utilities as described in Table 15-2, with at least the 28543 behavior described as mandatory in the referenced underlying 28544 specification, with the following exceptions: 28545 28546 1. The built in commands and utilities shall be provided by 28547 the sh utility itself, and need not be implemented in a 28548 manner so that they can be accessed via the exec family of 28549 functions as defined in ISO POSIX (2003) and should not be 28550 invoked directly by those standard utilities that execute 28551 other utilities ( env, find, nice, nohup, time, xargs). 28552 28553 Rationale (Informative): Since the built in utilities must 28554 affect the environment of the calling process, they have no 28555 effect when executed as a file. 28556 28557 Table 15-2. Built In Utilities 28558 cd [1] getopts [1] type [1] umask [1] 28559 command [1] read [1] ulimit [1] wait [1] 28560 28561 Referenced Specification(s) 28562 28563 [1]. ISO POSIX (2003) 28564 __________________________________________________________ 28565 28566 15.2. Command Behavior 28567 28568 Table of Contents 28569 ar -- create and maintain library archives (DEPRECATED) 28570 at -- examine or delete jobs for later execution 28571 awk -- pattern scanning and processing language 28572 batch -- schedule commands to be executed in a batch queue 28573 bc -- an arbitrary precision calculator language 28574 chfn -- change user name and information 28575 chsh -- change login shell 28576 col -- filter reverse line feeds from input 28577 cpio -- copy file archives in and out 28578 crontab -- maintain crontab files for individual users 28579 df -- report file system disk space usage 28580 dmesg -- print or control the system message buffer 28581 du -- estimate file space usage 28582 echo -- write arguments to standard output 28583 egrep -- search a file with an Extended Regular Expression 28584 pattern 28585 28586 fgrep -- search a file with a fixed pattern 28587 file -- determine file type 28588 fuser -- identify processes using files or sockets 28589 gettext -- retrieve text string from message catalog 28590 grep -- print lines matching a pattern 28591 groupadd -- create a new group 28592 groupdel -- delete a group 28593 groupmod -- modify a group 28594 groups -- display a group 28595 gunzip -- uncompress files 28596 gzip -- compress or expand files 28597 hostname -- show or set the system's host name 28598 install -- copy files and set attributes 28599 install_initd -- activate an init script 28600 ipcrm -- remove IPC Resources 28601 ipcs -- provide information on ipc facilities 28602 killall -- kill processes by name 28603 lpr -- off line print 28604 ls -- list directory contents 28605 lsb_release -- print distribution specific information 28606 m4 -- macro processor 28607 md5sum -- generate or check MD5 message digests 28608 mknod -- make special files 28609 mktemp -- make temporary file name (unique) 28610 more -- display files on a page-by-page basis 28611 mount -- mount a file system 28612 msgfmt -- create a message object from a message file 28613 newgrp -- change group ID 28614 od -- dump files in octal and other formats 28615 passwd -- change user password 28616 patch -- apply a diff file to an original 28617 pidof -- find the process ID of a running program 28618 remove_initd -- clean up init script system modifications 28619 introduced by install_initd 28620 28621 renice -- alter priority of running processes 28622 sed -- stream editor 28623 sendmail -- an electronic mail transport agent 28624 seq -- generate a sequence of numbers 28625 sh -- shell, the standard command language interpreter 28626 shutdown -- shut the system down 28627 su -- change user ID 28628 sync -- flush file system buffers 28629 tar -- file archiver 28630 umount -- unmount file systems 28631 useradd -- create a new user or update default new user 28632 information 28633 28634 userdel -- delete a user account and related files 28635 usermod -- modify a user account 28636 xargs -- build and execute command lines from standard input 28637 zcat -- uncompress files to standard output 28638 28639 This section contains descriptions for commands and utilities 28640 whose specified behavior in the LSB contradicts or extends the 28641 standards referenced. It also contains commands and utilities 28642 only required by the LSB and not specified by other standards. 28643 28644 ar 28645 28646 Name 28647 28648 ar -- create and maintain library archives (DEPRECATED) 28649 28650 Description 28651 28652 ar is deprecated from the LSB and is expected to disappear from 28653 a future version of the LSB. 28654 28655 Rationale: The LSB generally does not include software 28656 development utilities nor does it specify .o and .a file 28657 formats. 28658 28659 ar is as specified in ISO POSIX (2003) but with differences as 28660 listed below. 28661 28662 Differences 28663 28664 -T, -C 28665 28666 need not be accepted. 28667 -l 28668 28669 has unspecified behavior. 28670 -q 28671 28672 has unspecified behavior; using -r is suggested. 28673 28674 at 28675 28676 Name 28677 28678 at -- examine or delete jobs for later execution 28679 28680 Description 28681 28682 at is as specified in ISO POSIX (2003) but with differences as 28683 listed below. 28684 28685 Differences 28686 28687 Options 28688 28689 -d 28690 28691 is functionally equivalent to the -r option specified in ISO 28692 POSIX (2003). 28693 -r 28694 28695 need not be supported, but the '-d' option is equivalent. 28696 -t time 28697 28698 need not be supported. 28699 28700 Optional Control Files 28701 28702 The implementation shall support the XSI optional behavior for 28703 access control; however the files at.allow and at.deny may 28704 reside in /etc rather than /usr/lib/cron. 28705 28706 awk 28707 28708 Name 28709 28710 awk -- pattern scanning and processing language 28711 28712 Description 28713 28714 awk is as specified in ISO POSIX (2003) but with differences as 28715 listed below. 28716 28717 Differences 28718 28719 Certain aspects of internationalized regular expressions are 28720 optional; see Regular Expressions. 28721 28722 batch 28723 28724 Name 28725 28726 batch -- schedule commands to be executed in a batch queue 28727 28728 Description 28729 28730 The specification for batch is as specified in ISO POSIX 28731 (2003), but with differences as listed below. 28732 28733 Optional Control Files 28734 28735 The implementation shall support the XSI optional behavior for 28736 access control; however the files at.allow and at.deny may 28737 reside in /etc rather than /usr/lib/cron. 28738 28739 bc 28740 28741 Name 28742 28743 bc -- an arbitrary precision calculator language 28744 28745 Description 28746 28747 bc is as specified in ISO POSIX (2003) but with extensions as 28748 listed below. 28749 28750 Extensions 28751 28752 The bc language may be extended in an implementation defined 28753 manner. If an implementation supports extensions, it shall also 28754 support the additional options: 28755 28756 -s|--standard 28757 28758 processes exactly the POSIX bc language. 28759 -w|--warn 28760 28761 gives warnings for extensions to POSIX bc. 28762 28763 chfn 28764 28765 Name 28766 28767 chfn -- change user name and information 28768 28769 Synopsis 28770 28771 chfn [-f full_name] [-h home_phone] [user] 28772 28773 Description 28774 28775 chfn shall update the user database. An unprivileged user may 28776 only change the fields for their own account, a user with 28777 appropriate privileges may change the fields for any account. 28778 28779 The fields full_name and home_phone may contain any character 28780 except: 28781 28782 any control character 28783 comma 28784 colon 28785 equal sign 28786 28787 If none of the options are selected, chfn operates in an 28788 interactive fashion. The prompts and expected input in 28789 interactive mode are unspecified and should not be relied upon. 28790 28791 As it is possible for the system to be configured to restrict 28792 which fields a non-privileged user is permitted to change, 28793 applications should be written to gracefully handle these 28794 situations. 28795 28796 Standard Options 28797 28798 -f full_name 28799 28800 sets the user's full name. 28801 -h home_phone 28802 28803 sets the user's home phone number. 28804 28805 Future Directions 28806 28807 The following two options are expected to be added in a future 28808 version of the LSB: 28809 28810 -o office 28811 28812 sets the user's office room number. 28813 -p office_phone 28814 28815 sets the user's office phone number. 28816 28817 Note that some implementations contain a "-o other" option 28818 which specifies an additional field called "other". 28819 Traditionally, this field is not subject to the constraints 28820 about legitimate characters in fields. Also, one traditionally 28821 shall have appropriate privileges to change the other field. At 28822 this point there is no consensus about whether it is desirable 28823 to specify the other field; applications may wish to avoid 28824 using it. 28825 28826 The "-w work_phone" field found in some implementations should 28827 be replaced by the "-p office_phone" field. The "-r 28828 room_number" field found in some implementations is the 28829 equivalent of the "-o office" option mentioned above; which one 28830 of these two options to specify will depend on implementation 28831 experience and the decision regarding the other field. 28832 28833 chsh 28834 28835 Name 28836 28837 chsh -- change login shell 28838 28839 Synopsis 28840 28841 chsh [-s login_shell] [user] 28842 28843 Description 28844 28845 chsh changes the user login shell. This determines the name of 28846 the user's initial login command. An unprivileged user may only 28847 change the login shell for their own account, a user with 28848 appropriate privilege may change the login shell for any 28849 account specified by user. 28850 28851 Unless the user has appropriate privilege, the initial login 28852 command name shall be one of those listed in /etc/shells. The 28853 login_shell shall be the absolute path (i.e. it must start with 28854 '/') to an executable file. Accounts which are restricted (in 28855 an implementation-defined manner) may not change their login 28856 shell. 28857 28858 If the -s option is not selected, chsh operates in an 28859 interactive mode. The prompts and expected input in this mode 28860 are unspecified. 28861 28862 Standard Options 28863 28864 -s login_shell 28865 28866 sets the login shell. 28867 28868 col 28869 28870 Name 28871 28872 col -- filter reverse line feeds from input 28873 28874 Description 28875 28876 col is as specified in SUSv2 but with differences as listed 28877 below. 28878 28879 Differences 28880 28881 The -p option has unspecified behavior. 28882 28883 Note: Although col is shown as legacy in SUSv2, it is not 28884 (yet) deprecated in the LSB. 28885 28886 cpio 28887 28888 Name 28889 28890 cpio -- copy file archives in and out 28891 28892 Description 28893 28894 cpio is as specified in SUSv2, but with differences as listed 28895 below. 28896 28897 Differences 28898 28899 Some elements of the Pattern Matching Notation are optional; 28900 see Pattern Matching Notation. 28901 28902 crontab 28903 28904 Name 28905 28906 crontab -- maintain crontab files for individual users 28907 28908 Synopsis 28909 28910 crontab [-u user] file 28911 crontab [-u user] {-l | -r | -e} 28912 28913 Description 28914 28915 crontab is as specified in ISO POSIX (2003), but with 28916 differences as listed below. 28917 28918 Optional Control Files 28919 28920 The implementation shall support the XSI optional behavior for 28921 access control; however the files cron.allow and cron.deny may 28922 reside in /etc rather than /usr/lib/cron. 28923 28924 df 28925 28926 Name 28927 28928 df -- report file system disk space usage 28929 28930 Description 28931 28932 The df command shall behave as specified in ISO POSIX (2003), 28933 but with differences as listed below. 28934 28935 Differences 28936 28937 Options 28938 28939 If the -k option is not specified, disk space is shown in 28940 unspecified units. If the -P option is specified, the size of 28941 the unit shall be printed on the header line in the format 28942 "%4s-blocks". Applications should specify -k. 28943 28944 The XSI option -t has unspecified behavior. Applications should 28945 not specify -t. 28946 28947 Rationale: The most common implementation of df uses the -t 28948 option for a different purpose (restricting output to a 28949 particular file system type), and use of -t is therefore 28950 non-portable. 28951 28952 Operand May Identify Special File 28953 28954 If an argument is the absolute file name of a special file 28955 containing a mounted file system, df shall show the space 28956 available on that file system rather than on the file system 28957 containing the special file (which is typically the root file 28958 system). 28959 28960 Note: In ISO POSIX (2003) the XSI optional behavior permits 28961 an operand to name a special file, but appears to require 28962 the operation be performed on the file system containing the 28963 special file. A defect report has been submitted for this 28964 case. 28965 28966 dmesg 28967 28968 Name 28969 28970 dmesg -- print or control the system message buffer 28971 28972 Synopsis 28973 28974 dmesg [-c | -n level | -s bufsize] 28975 28976 Description 28977 28978 dmesg examines or controls the system message buffer. Only a 28979 user with appropriate privileges may modify the system message 28980 buffer parameters or contents. 28981 28982 Standard Options 28983 28984 -c 28985 28986 If the user has appropriate privilege, clears the system 28987 message buffer contents after printing. 28988 -n level 28989 28990 If the user has appropriate privilege, sets the level at which 28991 logging of messages is done to the console. 28992 -s bufsize 28993 28994 uses a buffer of bufsize to query the system message buffer. 28995 This is 16392 by default. 28996 28997 du 28998 28999 Name 29000 29001 du -- estimate file space usage 29002 29003 Description 29004 29005 du is as specified in ISO POSIX (2003), but with differences as 29006 listed below. 29007 29008 Differences 29009 29010 If the -k option is not specified, disk space is shown in 29011 unspecified units. Applications should specify -k. 29012 29013 echo 29014 29015 Name 29016 29017 echo -- write arguments to standard output 29018 29019 Synopsis 29020 29021 echo [string...] 29022 29023 Description 29024 29025 The echo command is as specified in ISO POSIX (2003), but with 29026 the following differences. 29027 29028 Implementations may support implementation-defined options to 29029 echo. The behavior of echo if any arguments contain backslashes 29030 is also implementation defined. 29031 29032 Application Usage 29033 29034 Conforming applications should not run echo with a first 29035 argument starting with a hyphen, or with any arguments 29036 containing backslashes; they should use printf in those cases. 29037 29038 Note: The behavior specified here is similar to that 29039 specified by ISO POSIX (2003) without the XSI option. 29040 However, the LSB strongly recommends conforming applications 29041 not use any options (even if the implementation provides 29042 them) while ISO POSIX (2003) specifies behavior if the first 29043 operand is the string -n. 29044 29045 egrep 29046 29047 Name 29048 29049 egrep -- search a file with an Extended Regular Expression 29050 pattern 29051 29052 Description 29053 29054 egrep is equivalent to grep -E. For further details, see the 29055 specification for grep. 29056 29057 fgrep 29058 29059 Name 29060 29061 fgrep -- search a file with a fixed pattern 29062 29063 Description 29064 29065 fgrep is equivalent to grep -F. For further details, see the 29066 specification for grep. 29067 29068 file 29069 29070 Name 29071 29072 file -- determine file type 29073 29074 Description 29075 29076 file is as specified in ISO POSIX (2003), but with differences 29077 as listed below. 29078 29079 Differences 29080 29081 The -M, -h, -d, and -i options need not be supported. 29082 29083 fuser 29084 29085 Name 29086 29087 fuser -- identify processes using files or sockets 29088 29089 Description 29090 29091 fuser is as specified in ISO POSIX (2003), but with differences 29092 as listed below. 29093 29094 Differences 29095 29096 The fuser command is a system administration utility, see Path 29097 For System Administration Utilities. 29098 29099 Option Differences 29100 29101 -c 29102 29103 has unspecified behavior. 29104 -f 29105 29106 has unspecified behavior. 29107 29108 gettext 29109 29110 Name 29111 29112 gettext -- retrieve text string from message catalog 29113 29114 Synopsis 29115 29116 gettext [options] [textdomain] msgid 29117 gettext -s [options] msgid... 29118 29119 Description 29120 29121 The gettext utility retrieves a translated text string 29122 corresponding to string msgid from a message object generated 29123 with msgfmt utility. 29124 29125 The message object name is derived from the optional argument 29126 textdomain if present, otherwise from the TEXTDOMAIN 29127 environment variable. If no domain is specified, or if a 29128 corresponding string cannot be found, gettext prints msgid. 29129 29130 Ordinarily gettext looks for its message object in 29131 dirname/lang/LC_MESSAGES where dirname is the 29132 implementation-defined default directory and lang is the locale 29133 name. If present, the TEXTDOMAINDIR environment variable 29134 replaces the dirname. 29135 29136 This utility interprets C escape sequences such as \t for tab. 29137 Use \\ to print a backslash. To produce a message on a line of 29138 its own, either put a \n at the end of msgid, or use this 29139 command in conjunction with the printf utility. 29140 29141 When used with the -s option the gettext utility behaves like 29142 the echo utility, except that the message corresponding to 29143 msgid in the selected catalog provides the arguments. 29144 29145 Options 29146 29147 -d domainname, --domain=domainname 29148 29149 PARAMETER translated messages from domainname. 29150 -e 29151 29152 Enable expansion of some escape sequences. 29153 -n 29154 29155 Suppress trailing newline. 29156 29157 Operands 29158 29159 The following operands are supported: 29160 29161 textdomain 29162 29163 A domain name used to retrieve the messages. 29164 msgid 29165 29166 A key to retrieve the localized message. 29167 29168 Environment Variables 29169 29170 LANGUAGE 29171 29172 Specifies one or more locale names. 29173 LANG 29174 29175 Specifies locale name. 29176 LC_MESSAGES 29177 29178 Specifies messaging locale, and if present overrides LANG for 29179 messages. 29180 TEXTDOMAIN 29181 29182 Specifies the text domain name, which is identical to the 29183 message object filename without .mo suffix. 29184 TEXTDOMAINDIR 29185 29186 Specifies the pathname to the message catalog, and if present 29187 replaces the implementation-defined default directory. 29188 29189 Exit Status 29190 29191 The following exit values are returned: 29192 29193 0 29194 29195 Successful completion. 29196 >0 29197 29198 An error occurred. 29199 29200 grep 29201 29202 Name 29203 29204 grep -- print lines matching a pattern 29205 29206 Description 29207 29208 grep is as specified in ISO POSIX (2003), but with differences 29209 as listed below. 29210 29211 LSB Differences 29212 29213 Certain aspects of regular expression matching are optional; 29214 see Regular Expressions. 29215 29216 groupadd 29217 29218 Name 29219 29220 groupadd -- create a new group 29221 29222 Synopsis 29223 29224 groupadd [-g gid [-o]] group 29225 29226 Description 29227 29228 If the caller has appropriate privilege, the groupadd command 29229 shall create a new group named group. The group name shall be 29230 unique in the group database. If no gid is specified, groupadd 29231 shall create the new group with a unique group ID. 29232 29233 The groupadd command is a system administration utility, see 29234 Path For System Administration Utilities. 29235 29236 Options 29237 29238 -g gid [-o] 29239 29240 The new group shall have group ID gid. If the -o option is not 29241 used, no other group shall have this group ID. The value of gid 29242 shall be non-negative. 29243 29244 groupdel 29245 29246 Name 29247 29248 groupdel -- delete a group 29249 29250 Synopsis 29251 29252 groupdel group 29253 29254 Description 29255 29256 If the caller has sufficient privilege, the groupdel command 29257 shall modify the system group database, deleting the group 29258 named group. If the group named group does not exist, groupdel 29259 shall issue a diagnostic message and exit with a non-zero exit 29260 status. 29261 29262 The groupdel command is a system administration utility, see 29263 Path For System Administration Utilities. 29264 29265 groupmod 29266 29267 Name 29268 29269 groupmod -- modify a group 29270 29271 Synopsis 29272 29273 groupmod [-g gid [-o]] [-n group_name] group 29274 29275 Description 29276 29277 If the caller has appropriate privilege, the groupmod command 29278 shall modify the entry in the system group database 29279 corresponding to a group named group. 29280 29281 The groupmod command is a system administration utility, see 29282 Path For System Administration Utilities. 29283 29284 Options 29285 29286 -g gid [-o] 29287 29288 Modify the group's group ID, setting it to gid. If the -o 29289 option is not used, no other group shall have this group ID. 29290 The value of gidshall be non-negative. 29291 29292 Note: Only the group ID in the database is altered; any 29293 files with group ownership set to the original group ID are 29294 unchanged by this modification. 29295 29296 -n group_name 29297 29298 changes the name of the group from group to group_name. 29299 29300 groups 29301 29302 Name 29303 29304 groups -- display a group 29305 29306 Synopsis 29307 29308 groups [user] 29309 29310 Description 29311 29312 The groups command shall behave as id -Gn [user], as specified 29313 in ISO POSIX (2003). The optional user parameter will display 29314 the groups for the named user. 29315 29316 gunzip 29317 29318 Name 29319 29320 gunzip -- uncompress files 29321 29322 Description 29323 29324 gunzip is equivalent to gzip -d. See the specification for gzip 29325 for further details. 29326 29327 Filesystem Hierarchy Standard requires that if gunzip exists, 29328 it must be a symbolic or hard link to /bin/gzip. This 29329 specification additionally allows gunzip to be a wrapper script 29330 which calls gzip -d. 29331 29332 gzip 29333 29334 Name 29335 29336 gzip -- compress or expand files 29337 29338 Synopsis 29339 29340 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 29341 29342 Description 29343 29344 The gzip command shall attempt to reduce the size of the named 29345 files. Whenever possible, each file is replaced by one with the 29346 extension .gz, while keeping the same ownership, modes, access 29347 and modification times. If no files are specified, or if a file 29348 name is -, the standard input is compressed to the standard 29349 output. gzip shall only attempt to compress regular files. In 29350 particular, it will ignore symbolic links. 29351 29352 When compressing, gzip uses the deflate algorithm specified in 29353 RFC 1951: DEFLATE Compressed Data Format Specification and 29354 stores the result in a file using the gzip file format 29355 specified in RFC 1952: GZIP File Format Specification. 29356 29357 Options 29358 29359 -c, --stdout, --to-stdout 29360 writes output on standard output, leaving the original 29361 files unchanged. If there are several input files, the 29362 output consists of a sequence of independently 29363 compressed members. To obtain better compression, 29364 concatenate all input files before compressing them. 29365 29366 -d, --decompress, --uncompress 29367 the name operands are compressed files, and gzip shall 29368 decompress them. 29369 29370 -f, --force 29371 forces compression or decompression even if the file has 29372 multiple links or the corresponding file already exists, 29373 or if the compressed data is read from or written to a 29374 terminal. If the input data is not in a format 29375 recognized by gzip, and if the option --stdout is also 29376 given, copy the input data without change to the 29377 standard ouput: let gzip behave as cat. If -f is not 29378 given, and when not running in the background, gzip 29379 prompts to verify whether an existing file should be 29380 overwritten. 29381 29382 -l, --list 29383 lists the compressed size, uncompressed size, ratio and 29384 uncompressed name for each compressed file. For files 29385 that are not in gzip format, the uncompressed size shall 29386 be given as -1. If the --verbose or -v option is also 29387 specified, the crc and timestamp for the uncompressed 29388 file shall also be displayed. 29389 29390 For decompression, gzip shall support at least the 29391 following compression methods: 29392 29393 + deflate (RFC 1951: DEFLATE Compressed Data Format 29394 Specification) 29395 + compress (ISO POSIX (2003)) 29396 29397 The crc shall be given as ffffffff for a file not in 29398 gzip format. 29399 29400 If the --name or -N option is also specified, the 29401 uncompressed name, date and time are those stored within 29402 the compressed file, if present. 29403 29404 If the --quiet or -q option is also specified, the title 29405 and totals lines are not displayed. 29406 29407 -L, --license 29408 displays the gzip license and quit. 29409 29410 -n, --no-name 29411 does not save the original file name and time stamp by 29412 default when compressing. (The original name is always 29413 saved if the name had to be truncated.) When 29414 decompressing, do not restore the original file name if 29415 present (remove only the gzip suffix from the compressed 29416 file name) and do not restore the original time stamp if 29417 present (copy it from the compressed file). This option 29418 is the default when decompressing. 29419 29420 -N, --name 29421 always saves the original file name and time stamp when 29422 compressing; this is the default. When decompressing, 29423 restore the original file name and time stamp if 29424 present. This option is useful on systems which have a 29425 limit on file name length or when the time stamp has 29426 been lost after a file transfer. 29427 29428 -q, --quiet 29429 suppresses all warnings. 29430 29431 -r, --recursive 29432 travels the directory structure recursively. If any of 29433 the file names specified on the command line are 29434 directories, gzip will descend into the directory and 29435 compress all the files it finds there (or decompress 29436 them in the case of gunzip). 29437 29438 -S .suf, --sufix .suf 29439 uses suffix .suf instead of .gz. 29440 29441 -t, --test 29442 checks the compressed file integrity. 29443 29444 -v, --verbose 29445 displays the name and percentage reduction for each file 29446 compressed or decompressed. 29447 29448 -#, --fast, --best 29449 regulates the speed of compression using the specified 29450 digit #, where -1 or --fast indicates the fastest 29451 compression method (less compression) and -9 or --best 29452 indicates the slowest compression method (best 29453 compression). The default compression level is -6 (that 29454 is, biased towards high compression at expense of 29455 speed). 29456 29457 LSB Deprecated Options 29458 29459 The behaviors specified in this section are expected to 29460 disappear from a future version of the LSB; applications should 29461 only use the non-LSB-deprecated behaviors. 29462 29463 -V, --version 29464 29465 displays the version number and compilation options, then 29466 quits. 29467 29468 hostname 29469 29470 Name 29471 29472 hostname -- show or set the system's host name 29473 29474 Synopsis 29475 29476 hostname [name] 29477 29478 Description 29479 29480 hostname is used to either display or, with appropriate 29481 privileges, set the current host name of the system. The host 29482 name is used by many applications to identify the machine. 29483 29484 When called without any arguments, the program displays the 29485 name of the system as returned by the gethostname() function. 29486 29487 When called with a name argument, and the user has appropriate 29488 privilege, the command sets the host name. 29489 29490 Note: It is not specified if the hostname displayed will be 29491 a fully qualified domain name. Applications requiring a 29492 particular format of hostname should check the output and 29493 take appropriate action. 29494 29495 install 29496 29497 Name 29498 29499 install -- copy files and set attributes 29500 29501 Synopsis 29502 29503 install [option...] SOURCE DEST 29504 install [option...] SOURCE... DEST 29505 install [-d | --directory] [option...] DIRECTORY... 29506 29507 Description 29508 29509 In the first two formats, copy SOURCE to DEST or multiple 29510 SOURCE(s) to the existing DEST directory, optionally setting 29511 permission modes and file ownership. In the third format, each 29512 DIRECTORY and any missing parent directories shall be created. 29513 29514 Standard Options 29515 29516 --backup[=METHOD] 29517 makes a backup of each existing destination file. METHOD 29518 may be one of the following: 29519 29520 none or off 29521 29522 never make backups. 29523 numbered or t 29524 29525 make numbered backups. A numbered backup has the form 29526 "%s.~%d~", target_name, version_number. Each backup shall 29527 increment the version number by 1. 29528 existing or nil 29529 29530 behave as numbered if numbered backups exist, or simple 29531 otherwise. 29532 simple or never 29533 29534 append a suffix to the name. The default suffix is '~', but can 29535 be overriden by setting SIMPLE_BACKUP_SUFFIX in the 29536 environment, or via the -S or --suffix option. 29537 29538 If no METHOD is specified, the environment variable 29539 VERSION_CONTROL shall be examined for one of the above. 29540 Unambiguous abbreviations of METHOD shall be accepted. 29541 If no METHOD is specified, or if METHOD is empty, the 29542 backup method shall default to existing. 29543 29544 If METHOD is invalid or ambiguous, install shall fail 29545 and issue a diagnostic message. 29546 29547 -b 29548 is equivalent to --backup=existing. 29549 29550 -d, --directory 29551 treats all arguments as directory names; creates all 29552 components of the specified directories. 29553 29554 -D 29555 creates all leading components of DEST except the last, 29556 then copies SOURCE to DEST; useful in the 1st format. 29557 29558 -g GROUP, --group=GROUP 29559 if the user has appropriate privilege, sets group 29560 ownership, instead of process' current group. GROUP is 29561 either a name in the user group database, or a positive 29562 integer, which shall be used as a group-id. 29563 29564 -m MODE, --mode=MODE 29565 sets permission mode (specified as in chmod), instead of 29566 the default rwxr-xr-x. 29567 29568 -o OWNER, --owner=OWNER 29569 if the user has appropriate privilege, sets ownership. 29570 OWNER is either a name in the user login database, or a 29571 positive integer, which shall be used as a user-id. 29572 29573 -p, --preserve-timestamps 29574 copies the access and modification times of SOURCE files 29575 to corresponding destination files. 29576 29577 -s, --strip 29578 strips symbol tables, only for 1st and 2nd formats. 29579 29580 -S SUFFIX, --suffix=SUFFIX 29581 equivalent to --backup=existing, except if a simple 29582 suffix is required, use SUFFIX. 29583 29584 --verbose 29585 prints the name of each directory as it is created. 29586 29587 -v, --verbose 29588 print the name of each file before copying it to stdout. 29589 29590 install_initd 29591 29592 Name 29593 29594 install_initd -- activate an init script 29595 29596 Synopsis 29597 29598 /usr/lib/lsb/install_initd initd_file 29599 29600 Description 29601 29602 install_initd shall activate a system initialization file that 29603 has been copied to an implementation defined location such that 29604 this file shall be run at the appropriate point during system 29605 initialization. The install_initd command is typically called 29606 in the postinstall script of a package, after the script has 29607 been copied to /etc/init.d. See also Installation and Removal 29608 of Init Scripts. 29609 29610 ipcrm 29611 29612 Name 29613 29614 ipcrm -- remove IPC Resources 29615 29616 Synopsis 29617 29618 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | 29619 -M shmkey]... 29620 ipcrm [shm | msg | msg] id... 29621 29622 Description 29623 29624 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 29625 the ipcrm shall behave as described in ISO POSIX (2003). 29626 29627 Otherwise, ipcrm shall remove the resource of the specified 29628 type identified by id. 29629 29630 Future Directions 29631 29632 A future revision of this specification may deprecate the 29633 second synopsis form. 29634 29635 Rationale: In its first Linux implementation, ipcrm used the 29636 second syntax shown in the SYNOPSIS. Functionality present 29637 in other implementations of ipcrm has since been added, 29638 namely the ability to delete resources by key (not just 29639 identifier), and to respect the same command line syntax. 29640 The previous syntax is still supported for backwards 29641 compatibility only. 29642 29643 ipcs 29644 29645 Name 29646 29647 ipcs -- provide information on ipc facilities 29648 29649 Synopsis 29650 29651 ipcs [-smq] [-tcp] 29652 29653 Description 29654 29655 ipcs provides information on the ipc facilities for which the 29656 calling process has read access. 29657 29658 Note: Although this command has many similarities with the 29659 optional ipcs utility described in ISO POSIX (2003), it has 29660 substantial differences and is therefore described 29661 separately. The options specified here have similar meaning 29662 to those in ISO POSIX (2003); other options specified there 29663 have unspecified behavior on an LSB conforming 29664 implementation. See Application Usage below. The output 29665 format is not specified. 29666 29667 Resource display options 29668 29669 -m 29670 29671 shared memory segments. 29672 -q 29673 29674 message queues. 29675 -s 29676 29677 semaphore arrays. 29678 29679 Output format options 29680 29681 -t 29682 29683 time. 29684 -p 29685 29686 pid. 29687 -c 29688 29689 creator. 29690 29691 Application Usage 29692 29693 In some implementations of ipcs the -a option will print all 29694 information available. In other implementations the -a option 29695 will print all resource types. Therefore, applications shall 29696 not use the -a option. 29697 29698 Some implementations of ipcs provide more output formats than 29699 are specified here. These options are not consistent between 29700 differing implementations of ipcs. Therefore, only the -t, -c 29701 and -p option formatting flags may be used. At least one of the 29702 -t, -c and -p options and at least one of -m, -q and -s options 29703 shall be specified. If no options are specified, the output is 29704 unspecified. 29705 29706 killall 29707 29708 Name 29709 29710 killall -- kill processes by name 29711 29712 Synopsis 29713 29714 killall [-egiqvw] [-signal] name... 29715 killall -l 29716 killall -V 29717 29718 Description 29719 29720 killall sends a signal to all processes running any of the 29721 specified commands. If no signal name is specified, SIGTERM is 29722 sent. 29723 29724 Signals can be specified either by name (e.g. -HUP) or by 29725 number (e.g. -1). Signal 0 (check if a process exists) can only 29726 be specified by number. 29727 29728 If the command name contains a slash (/), processes executing 29729 that particular file will be selected for killing, independent 29730 of their name. 29731 29732 killall returns a non-zero return code if no process has been 29733 killed for any of the listed commands. If at least one process 29734 has been killed for each command, killall returns zero. 29735 29736 A killall process never kills itself (but may kill other 29737 killall processes). 29738 29739 Standard Options 29740 29741 -e 29742 29743 requires an exact match for very long names. If a command name 29744 is longer than 15 characters, the full name may be unavailable 29745 (i.e. it is swapped out). In this case, killall will kill 29746 everything that matches within the first 15 characters. With 29747 -e, such entries are skipped. killall prints a message for each 29748 skipped entry if -v is specified in addition to -e. 29749 -g 29750 29751 kills the process group to which the process belongs. The kill 29752 signal is only sent once per group, even if multiple processes 29753 belonging to the same process group were found. 29754 -i 29755 29756 asks interactively for confirmation before killing. 29757 -l 29758 29759 lists all known signal names. 29760 -q 29761 29762 does not complain if no processes were killed. 29763 -v 29764 29765 reports if the signal was successfully sent. 29766 29767 LSB Deprecated Options 29768 29769 The behaviors specified in this section are expected to 29770 disappear from a future version of the LSB; applications should 29771 only use the non-LSB-deprecated behaviors. 29772 29773 -V 29774 29775 displays version information. 29776 29777 lpr 29778 29779 Name 29780 29781 lpr -- off line print 29782 29783 Synopsis 29784 29785 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 29786 title] [name ......] 29787 29788 Description 29789 29790 lpr uses a spooling daemon to print the named files when 29791 facilities become available. If no names appear, the standard 29792 input is assumed. 29793 29794 Standard Options 29795 29796 -l 29797 29798 identifies binary data that is not to be filtered but sent as 29799 raw input to printer. 29800 -p 29801 29802 formats with "pr" before sending to printer. 29803 -Pprinter 29804 29805 sends output to the printer named printer instead of the 29806 default printer. 29807 -h 29808 29809 suppresses header page. 29810 -s 29811 29812 uses symbolic links. 29813 -#copies 29814 29815 specifies copies as the number of copies to print. 29816 -J name 29817 29818 specifies name as the job name for the header page. 29819 -T title 29820 29821 specifies title as the title used for "pr". 29822 29823 ls 29824 29825 Name 29826 29827 ls -- list directory contents 29828 29829 Description 29830 29831 ls shall behave as specified in ISO POSIX (2003), but with 29832 extensions listed below. 29833 29834 Extensions 29835 29836 -l 29837 29838 If the file is a character special or block special file, the 29839 size of the file shall be replaced with two unsigned numbers in 29840 the format "%u, %u", representing the major and minor device 29841 numbers associated with the special file. 29842 29843 Note: The LSB does not specify the meaning of the major and 29844 minor devices numbers. 29845 29846 -p 29847 29848 in addition to ISO POSIX (2003) XSI optional behavior of 29849 printing a slash for a directory, ls -p may display other 29850 characters for other file types. 29851 29852 lsb_release 29853 29854 Name 29855 29856 lsb_release -- print distribution specific information 29857 29858 Synopsis 29859 29860 lsb_release [OPTION...] 29861 29862 Description 29863 29864 The lsb_release command prints certain LSB (Linux Standard 29865 Base) and Distribution information. 29866 29867 If no options are given, the -v option is assumed. 29868 29869 Options 29870 29871 -v, --version 29872 29873 displays version of LSB against which distribution is 29874 compliant. The version is expressed as a colon separated list 29875 of LSB module descriptions. LSB module descriptions are dash 29876 separated tuples containing the module name, version, and 29877 architecture name. The output is a single line of text of the 29878 following format: 29879 29880 LSB Version:\tListAsDescribedAbove 29881 29882 Note: An implementation may support multiple releases of the 29883 same module. Version specific library interfaces, if any, 29884 will be selected by the program interpreter, which changes 29885 from release to release. Version specific commands and 29886 utilities, if any, will be described in the relevant 29887 specification. 29888 29889 -i, --id 29890 29891 displays string id of distributor. The output is a single line 29892 of text of the following format: 29893 29894 Distributor ID:\tDistributorID 29895 -d, --description 29896 29897 displays single line text description of distribution. The 29898 output is of the following format: 29899 29900 Description:\tDescription 29901 -r, --release 29902 29903 displays release number of distribution. The output is a single 29904 line of text of the following format: 29905 29906 Release:\tRelease 29907 -c, --codename 29908 29909 displays codename according to distribution release. The output 29910 is a single line of text of the following format. 29911 29912 Codename:\tCodename 29913 -a, --all 29914 29915 displays all of the above information. 29916 -s, --short 29917 29918 displays all of the above information in short output format. 29919 -h, --help 29920 29921 displays a human-readable help message. 29922 29923 Example 29924 29925 The following command will list the LSB Profiles which are 29926 currently supported on this platform. 29927 example% lsb_release -v 29928 LSB Version: core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch 29929 29930 m4 29931 29932 Name 29933 29934 m4 -- macro processor 29935 29936 Description 29937 29938 m4 is as specified in ISO POSIX (2003), but with extensions as 29939 listed below. 29940 29941 Extensions 29942 29943 -P 29944 29945 forces all builtins to be prefixed with m4_. For example, 29946 define becomes m4_define. 29947 -I directory 29948 29949 Add directory to the end of the search path for includes. 29950 29951 md5sum 29952 29953 Name 29954 29955 md5sum -- generate or check MD5 message digests 29956 29957 Synopsis 29958 29959 md5sum [-c [file] | file...] 29960 29961 Description 29962 29963 For each file, write to standard output a line containing the 29964 MD5 message digest of that file, followed by one or more blank 29965 characters, followed by the name of the file. The MD5 message 29966 digest shall be calculated according to RFC 1321: The MD5 29967 Message-Digest Algorithm and output as 32 hexadecimal digits. 29968 29969 If no file names are specified as operands, read from standard 29970 input and use "-" as the file name in the output. 29971 29972 Options 29973 29974 -c [file] 29975 29976 checks the MD5 message digest of all files named in file 29977 against the message digest listed in the same file. The actual 29978 format of file is the same as the output of md5sum. That is, 29979 each line in the file describes a file. If file is not 29980 specified, read message digests from stdin. 29981 29982 Exit Status 29983 29984 md5sum shall exit with status 0 if the sum was generated 29985 successfully, or, in check mode, if the check matched. 29986 Otherwise, md5sum shall exit with a non-zero status. 29987 29988 mknod 29989 29990 Name 29991 29992 mknod -- make special files 29993 29994 Synopsis 29995 29996 mknod [-m mode | --mode=mode] name type [major minor] 29997 mknod [--version] 29998 29999 Description 30000 30001 The mknod command shall create a special file named name of the 30002 given type. 30003 30004 The type shall be one of the following: 30005 30006 b 30007 30008 creates a block (buffered) special file with the specified 30009 major and minor device numbers. 30010 c, u 30011 30012 creates a character (unbuffered) special file with the 30013 specified major and minor device numbers. 30014 p 30015 30016 creates a FIFO. 30017 30018 Options 30019 30020 -m mode, --mode=mode 30021 30022 create the special file with file access permissions set as 30023 described in mode. The permissions may be any absolute value 30024 (i.e. one not containing '+' or '-') acceptable to the chmod 30025 command. 30026 --version 30027 30028 output version information and exit. 30029 30030 Note: This option may be deprecated in a future release of 30031 this specification. 30032 30033 If type is p, major and minor shall not be specified. 30034 Otherwise, these parameters are mandatory. 30035 30036 Future Directions 30037 30038 This command may be deprecated in a future version of this 30039 specification. The major and minor operands are insufficently 30040 portable to be specified usefully here. Only a FIFO can be 30041 portably created by this command, and the mkfifo command is a 30042 simpler interface for that purpose. 30043 30044 mktemp 30045 30046 Name 30047 30048 mktemp -- make temporary file name (unique) 30049 30050 Synopsis 30051 30052 mktemp [-q] [-u] template 30053 30054 Description 30055 30056 The mktemp command takes the given file name template and 30057 overwrites a portion of it to create a file name. This file 30058 name shall be unique and suitable for use by the application. 30059 30060 The template should have at least six trailing 'X' characters. 30061 These characters are replaced with characters from the portable 30062 filename character set in order to generate a unique name. 30063 30064 If mktemp can successfully generate a unique file name, and the 30065 -u option is not present, the file shall be created with read 30066 and write permission only for the current user. The mktemp 30067 command shall write the filename generated to the standard 30068 output. 30069 30070 Options 30071 30072 -q 30073 30074 fail silently if an error occurs. Diagnostic messages to stderr 30075 are suppressed, but the command shall still exit with a 30076 non-zero exit status if an error occurs. 30077 -u 30078 30079 operates in `unsafe' mode. A unique name is generated, but the 30080 temporary file shall be unlinked before mktemp exits. Use of 30081 this option is not encouraged. 30082 30083 more 30084 30085 Name 30086 30087 more -- display files on a page-by-page basis 30088 30089 Description 30090 30091 more is as specified in ISO POSIX (2003), but with differences 30092 as listed below. 30093 30094 Differences 30095 30096 The more command need not respect the LINES and COLUMNS 30097 environment variables. 30098 30099 The following additional options may be supported: 30100 30101 -num 30102 30103 specifies an integer which is the screen size (in lines). 30104 +num 30105 30106 starts at line number num. 30107 +/pattern 30108 30109 Start at the first line matching the pattern, equivalent to 30110 executing the search forward (/) command with the given pattern 30111 immediately after opening each file. 30112 30113 The following options from ISO POSIX (2003) may behave 30114 differently: 30115 30116 -e 30117 30118 has unspecified behavior. 30119 -i 30120 30121 has unspecified behavior. 30122 -n 30123 30124 has unspecified behavior. 30125 -p 30126 30127 Either clear the whole screen before displaying any text 30128 (instead of the usual scrolling behavior), or provide the 30129 behavior specified by ISO POSIX (2003). In the latter case, the 30130 syntax is "-p command". 30131 -t 30132 30133 has unspecified behavior. 30134 30135 The more command need not support the following interactive 30136 commands: 30137 30138 g 30139 G 30140 u 30141 control u 30142 control f 30143 newline 30144 j 30145 k 30146 r 30147 R 30148 m 30149 ' (return to mark) 30150 /! 30151 ? 30152 N 30153 :e 30154 :t 30155 control g 30156 ZZ 30157 30158 Rationale 30159 30160 The +num and +/string options are deprecated in SUSv2, and have 30161 been removed in ISO POSIX (2003); however this specification 30162 continues to specify them because the publicly available 30163 util-linux package does not support the replacement (-p 30164 command). The +command option as found in SUSv2 is more general 30165 than is specified here, but the util-linux package appears to 30166 only support the more specific +num and +/string forms. 30167 30168 mount 30169 30170 Name 30171 30172 mount -- mount a file system 30173 30174 Synopsis 30175 30176 mount [-hV] 30177 mount [-a] [-fFnrsvw] [-t vfstype] 30178 mount [-fnrsvw] [-o options [,...]] [device | dir] 30179 mount [-fnrsvw] [-t vfstype] [-o options] device dir 30180 30181 Description 30182 30183 As described in ISO POSIX (2003), all files in the system are 30184 organized in a directed graph, known as the file hierarchy, 30185 rooted at /. These files can be spread out over several 30186 underlying devices. The mount command shall attach the file 30187 system found on some underlying device to the file hierarchy. 30188 30189 Options 30190 30191 -v 30192 30193 invoke verbose mode. The mount command shall provide diagnostic 30194 messages on stdout. 30195 -a 30196 30197 mount all file systems (of the given types) mentioned in 30198 /etc/fstab. 30199 -F 30200 30201 If the -a option is also present, fork a new incarnation of 30202 mount for each device to be mounted. This will do the mounts on 30203 different devices or different NFS servers in parallel. 30204 -f 30205 30206 cause everything to be done except for the actual system call; 30207 if it's not obvious, this `fakes' mounting the file system. 30208 -n 30209 30210 mount without writing in /etc/mtab. This is necessary for 30211 example when /etc is on a read-only file system. 30212 -s 30213 30214 ignore mount options not supported by a file system type. Not 30215 all file systems support this option. 30216 -r 30217 30218 mount the file system read-only. A synonym is -o ro. 30219 -w 30220 30221 mount the file system read/write. (default) A synonym is -o rw. 30222 -L label 30223 30224 If the file /proc/partitions is supported, mount the partition 30225 that has the specified label. 30226 -U uuid 30227 30228 If the file /proc/partitions is supported, mount the partition 30229 that has the specified uuid. 30230 -t vfstype 30231 30232 indicate a file system type of vfstype. 30233 30234 More than one type may be specified in a comma separated list. 30235 The list of file system types can be prefixed with no to 30236 specify the file system types on which no action should be 30237 taken. 30238 -o 30239 30240 options are specified with a -o flag followed by a 30241 comma-separated string of options. Some of these options are 30242 only useful when they appear in the /etc/fstab file. The 30243 following options apply to any file system that is being 30244 mounted: 30245 30246 async 30247 30248 perform all I/O to the file system asynchronously. 30249 atime 30250 30251 update inode access time for each access. (default) 30252 auto 30253 30254 in /etc/fstab, indicate the device is mountable with -a. 30255 defaults 30256 30257 use default options: rw, suid, dev, exec, auto, nouser, async. 30258 dev 30259 30260 interpret character or block special devices on the file 30261 system. 30262 exec 30263 30264 permit execution of binaries. 30265 noatime 30266 30267 do not update file access times on this file system. 30268 noauto 30269 30270 in /etc/fstab, indicates the device is only explicitly 30271 mountable. 30272 nodev 30273 30274 do not interpret character or block special devices on the file 30275 system. 30276 noexec 30277 30278 do not allow execution of any binaries on the mounted file 30279 system. 30280 nosuid 30281 30282 do not allow set-user-identifier or set-group-identifier bits 30283 to take effect. 30284 nouser 30285 30286 forbid an unprivileged user to mount the file system. (default) 30287 remount 30288 30289 remount an already-mounted file system. This is commonly used 30290 to change the mount options for a file system, especially to 30291 make a read-only file system writable. 30292 ro 30293 30294 mount the file system read-only. 30295 rw 30296 30297 mount the file system read-write. 30298 suid 30299 30300 allow set-user-identifier or set-group-identifier bits to take 30301 effect. 30302 sync 30303 30304 do all I/O to the file system synchronously. 30305 user 30306 30307 allow an unprivilieged user to mount the file system. This 30308 option implies the options noexec, nosuid, nodev unless 30309 overridden by subsequent options. 30310 30311 LSB Deprecated Options 30312 30313 The behaviors specified in this section are expected to 30314 disappear from a future version of the LSB; applications should 30315 only use the non-LSB-deprecated behaviors. 30316 30317 -V 30318 30319 output version and exit. 30320 30321 msgfmt 30322 30323 Name 30324 30325 msgfmt -- create a message object from a message file 30326 30327 Synopsis 30328 30329 msgfmt [options...] filename... 30330 30331 Description 30332 30333 The msgfmt command generates a binary message catalog from a 30334 textual translation description. Message catalogs, or message 30335 object files, are stored in files with a .mo extension. 30336 30337 Note: The format of message object files is not guaranteed 30338 to be portable. Message catalogs should always be generated 30339 on the target architecture using the msgfmt command. 30340 30341 The source message files, otherwise known as portable object 30342 files, have a .po extension. 30343 30344 The filename operands shall be portable object files. The .po 30345 file contains messages to be displayed to users by system 30346 utilities or by application programs. The portable object files 30347 are text files, and the messages in them can be rewritten in 30348 any language supported by the system. 30349 30350 If any filename is -, a portable object file shall be read from 30351 the standard input. 30352 30353 The msgfmt command interprets data as characters according to 30354 the current setting of the LC_CTYPE locale category. 30355 30356 Options 30357 30358 -c, --check 30359 Detect and diagnose input file anomalies which might 30360 represent translation errors. The msgid and msgstr 30361 strings are studied and compared. It is considered 30362 abnormal that one string starts or ends with a newline 30363 while the other does not. 30364 30365 If the message is flagged as c-format (see Comment 30366 Handling), check that the msgid string and the msgstr 30367 translation have the same number of % format specifiers, 30368 with matching types. 30369 30370 -D directory, --directory=directory 30371 Add directory to list for input files search. If 30372 filename is not an absolute pathname and filename cannot 30373 be opened, search for it in directory. This option may 30374 be repeated. Directories shall be searched in order, 30375 with the leftmost directory searched first. 30376 30377 -f, --use-fuzzy 30378 Use entries marked as fuzzy in output. If this option is 30379 not specified, such entries are not included into the 30380 output. See Comment Handling below. 30381 30382 -o output-file, --output-file=output-file 30383 Specify the output file name as output-file. If multiple 30384 domains or duplicate msgids in the .po file are present, 30385 the behavior is unspecified. If output-file is -, output 30386 is written to standard output. 30387 30388 --strict 30389 Ensure that all output files have a .mo extension. 30390 Output files are named either by the -o (or 30391 --output-file) option, or by domains found in the input 30392 files. 30393 30394 -v, --verbose 30395 Print additional information to the standard error, 30396 including the number of translated strings processed. 30397 30398 Operands 30399 30400 The filename operands are treated as portable object files. The 30401 format of portable object files is defined in EXTENDED 30402 DESCRIPTION. 30403 30404 Standard Input 30405 30406 The standard input is not used unless a filename operand is 30407 specified as "-". 30408 30409 Environment Variables 30410 30411 LANGUAGE 30412 30413 Specifies one or more locale names. 30414 LANG 30415 30416 Specifies locale name. 30417 LC_ALL 30418 30419 Specifies locale name for all categories. If defined, overrides 30420 LANG, LC_CTYPE and LC_MESSAGES. 30421 LC_CTYPE 30422 30423 Determine the locale for the interpretation of sequences of 30424 bytes of text data as characters (for example, single-byte as 30425 opposed to multi-byte characters in arguments and input files). 30426 LC_MESSAGES 30427 30428 Specifies messaging locale, and if present overrides LANG for 30429 messages. 30430 30431 Standard Output 30432 30433 The standard output is not used unless the option-argument of 30434 the -o option is specified as -. 30435 30436 Extended Description 30437 30438 The format of portable object files (.po files) is defined as 30439 follows. Each .po file contains one or more lines, with each 30440 line containing either a comment or a statement. Comments start 30441 the line with a hash mark (#) and end with the newline 30442 character. Empty lines, or lines containing only white-space, 30443 shall be ignored. Comments can in certain circumstances alter 30444 the behavior of msgfmt. See Comment Handling below for details 30445 on comment processing. The format of a statement is: 30446 30447 directive value 30448 30449 Each directive starts at the beginning of the line and is 30450 separated from value by white space (such as one or more space 30451 or tab characters). The value consists of one or more quoted 30452 strings separated by white space. If two or more strings are 30453 specified as value, they are normalized into single string 30454 using the string normalization syntax specified in ISO C 30455 (1999). The following directives are supported: 30456 30457 domain domainname 30458 30459 msgid message_identifier 30460 30461 msgid_plural untranslated_string_plural 30462 30463 msgstr message_string 30464 30465 msgstr[n] message_string 30466 30467 The behavior of the domain directive is affected by the options 30468 used. See OPTIONS for the behavior when the -o option is 30469 specified. If the -o option is not specified, the behavior of 30470 the domain directive is as follows: 30471 30472 1. All msgids from the beginning of each .po file to the first 30473 domain directive are put into a default message object 30474 file, messages (or messages.mo if the --strict option is 30475 specified). 30476 2. When msgfmt encounters a domain domainname directive in the 30477 .po file, all following msgids until the next domain 30478 directive are put into the message object file domainname 30479 (or domainname.mo if --strict option is specified). 30480 3. Duplicate msgids are defined in the scope of each domain. 30481 That is, a msgid is considered a duplicate only if the 30482 identical msgid exists in the same domain. 30483 4. All duplicate msgids are ignored. 30484 30485 The msgid directive specifies the value of a message identifier 30486 associated with the directive that follows it. The msgid_plural 30487 directive specifies the plural form message specified to the 30488 plural message handling functions ngettext(), dngettext() or 30489 dcngettext(). The message_identifier string identifies a target 30490 string to be used at retrieval time. Each statement containing 30491 a msgid directive shall be followed by a statement containing a 30492 msgstr directive or msgstr[n] directives. 30493 30494 The msgstr directive specifies the target string associated 30495 with the message_identifier string declared in the immediately 30496 preceding msgid directive. 30497 30498 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 30499 target string to be used with plural form handling functions 30500 ngettext(), dngettext() and dcngettext(). 30501 30502 Message strings can contain the following escape sequences: 30503 30504 Table 15-1. Escape Sequences 30505 \n newline 30506 \t tab 30507 \v vertical tab 30508 \b backspace 30509 \r carriage return 30510 \f formfeed 30511 \\ backslash 30512 \" double quote 30513 \ddd octal bit pattern 30514 \xHH hexadecimal bit pattern 30515 30516 Comment Handling 30517 30518 Comments are introduced by a #, and continue to the end of the 30519 line. The second character (i.e. the character following the #) 30520 has special meaning. Regular comments should follow a space 30521 character. Other comment types include: 30522 30523 # normal-comments 30524 30525 #. automatic-comments 30526 30527 #: reference... 30528 30529 #, flag 30530 30531 Automatic and reference comments are typically generated by 30532 external utilities, and are not specified by the LSB. The 30533 msgfmt command shall ignore such comments. 30534 30535 Note: Portable object files may be produced by unspecified 30536 tools. Some of the comment types described here may arise 30537 from the use of such tools. It is beyond the scope of this 30538 specification to describe these tools. 30539 30540 The #, comments require one or more flags separated by the 30541 comma (,) character. The following flags can be specified: 30542 30543 fuzzy 30544 30545 This flag shows that the following msgstr string might not be a 30546 correct translation. Only the translator (i.e. the individual 30547 undertaking the translation) can judge if the translation 30548 requires further modification, or is acceptable as is. Once 30549 satisfied with the translation, the translator then removes 30550 this fuzzy flag. 30551 30552 If this flag is specified, the msgfmt utility will not generate 30553 the entry for the immediately following msgid in the output 30554 message catalog, unless the --use-fuzzy is specified. 30555 c-format, no-c-format 30556 30557 The c-format flag indicates that the msgid string is used as 30558 format string by printf()-like functions. If the c-format flag 30559 is given for a string the msgfmt utility may perform additional 30560 tests to check the validity of the translation. 30561 30562 Plurals 30563 30564 The msgid entry with empty string ("") is called the header 30565 entry and is treated specially. If the message string for the 30566 header entry contains nplurals=value, the value indicates the 30567 number of plural forms. For example, if nplurals=4, there are 4 30568 plural forms. If nplurals is defined, there should be a 30569 plural=expression on the same line, separated by a semicolon 30570 (;) character. The expression is a C language expression to 30571 determine which version of msgstr[n] to be used based on the 30572 value of n, the last argument of ngettext(), dngettext() or 30573 dcngettext(). For example: 30574 nplurals=2; plural=n == 1 ? 0 : 1 30575 30576 indicates that there are 2 plural forms in the language; 30577 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 30578 Another example: 30579 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 30580 30581 indicates that there are 3 plural forms in the language; 30582 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 30583 otherwise msgstr[2] is used. 30584 30585 If the header entry contains charset=codeset string, the 30586 codeset is used to indicate the codeset to be used to encode 30587 the message strings. If the output string's codeset is 30588 different from the message string's codeset, codeset conversion 30589 from the message strings's codeset to the output string's 30590 codeset will be performed upon the call of gettext(), 30591 dgettext(), dcgettext(), ngettext(), dngettext(), and 30592 dcngettext(). The output string's codeset is determined by the 30593 current locale's codeset (the return value of 30594 nl_langinfo(CODESET)) by default, and can be changed by the 30595 call of bind_textdomain_codeset(). 30596 30597 Exit Status 30598 30599 The following exit values are returned: 30600 30601 0 30602 30603 Successful completion. 30604 >0 30605 30606 An error occurred. 30607 30608 Application Usage 30609 30610 Neither msgfmt nor any gettext() function imposes a limit on 30611 the total length of a message. Installing message catalogs 30612 under the C locale is pointless, since they are ignored for the 30613 sake of efficiency. 30614 30615 Examples 30616 30617 Example 1: Examples of creating message objects from message 30618 files. 30619 30620 In this example module1.po, module2.po and module3.po are 30621 portable message object files. 30622 example% cat module1.po 30623 30624 # default domain "messages" 30625 30626 msgid "message one" 30627 30628 msgstr "mensaje número uno" 30629 30630 # 30631 30632 domain "help_domain" 30633 30634 msgid "help two" 30635 30636 msgstr "ayuda número dos" 30637 30638 # 30639 30640 domain "error_domain" 30641 30642 msgid "error three" 30643 30644 msgstr "error número tres" 30645 30646 example% cat module2.po 30647 30648 # default domain "messages" 30649 30650 msgid "message four" 30651 30652 msgstr "mensaje número cuatro" 30653 30654 # 30655 30656 domain "error_domain" 30657 30658 msgid "error five" 30659 30660 msgstr "error número cinco" 30661 30662 # 30663 30664 domain "window_domain" 30665 30666 msgid "window six" 30667 30668 msgstr "ventana número seises" 30669 30670 example% cat module3.po 30671 30672 # default domain "messages" 30673 30674 msgid "message seven" 30675 30676 msgstr "mensaje número siete" 30677 30678 The following command will produce the output files messages, 30679 help_domain, and error_domain. 30680 example% msgfmt module1.po 30681 30682 The following command will produce the output files 30683 messages.mo, help_domain.mo, error_domain.mo, and 30684 window_domain.mo. 30685 example% msgfmt module1.po module2.po 30686 30687 The following example will produce the output file hello.mo. 30688 example% msgfmt -o hello.mo module3.po 30689 30690 newgrp 30691 30692 Name 30693 30694 newgrp -- change group ID 30695 30696 Synopsis 30697 30698 newgrp [group] 30699 30700 Description 30701 30702 The newgrp command is as specified in ISO POSIX (2003), but 30703 with differences as listed below. 30704 30705 Differences 30706 30707 The -l option specified in ISO POSIX (2003) need not be 30708 supported. 30709 30710 od 30711 30712 Name 30713 30714 od -- dump files in octal and other formats 30715 30716 Synopsis 30717 30718 od [-abcdfilox] [-w width | --width-width] [-v] [-A 30719 address_base] [-j skip] [-n count] [-t type_string] [file...] 30720 od --traditional [options] [file] [[+]offset [.] [b]] [[+]label 30721 [.] [b]] 30722 30723 Description 30724 30725 The od command shall provide all of the madatory functionality 30726 specified in ISO POSIX (2003), but with extensions and 30727 differences to the XSI optional behavior as listed below. 30728 30729 Extensions and Differences 30730 30731 -s 30732 unspecified behavior. 30733 30734 Note: Applications wishing to achieve the ISO POSIX (2003) 30735 behavior for -s should instead use -t d2. 30736 30737 -wwidth, --width[=width] 30738 each output line is limited to width bytes from the 30739 input. 30740 30741 --traditional 30742 accepts arguments in traditional form, see Traditional 30743 Usage below. 30744 30745 Note: The XSI optional behavior for offset handling 30746 described in ISO POSIX (2003) is not supported unless the 30747 --traditional option is also specified. 30748 30749 Pre-POSIX and XSI Specifications 30750 30751 The LSB supports mixing options between the mandatory and XSI 30752 optional synopsis forms in ISO POSIX (2003). The LSB shall 30753 support the following options: 30754 30755 -a 30756 30757 is equivalent to -t a, selects named characters. 30758 -b 30759 30760 is equivalent to -t o1, selects octal bytes. 30761 -c 30762 30763 is equivalent to -t c, selects characters. 30764 -d 30765 30766 is equivalent to -t u2, selects unsigned decimal two byte 30767 units. 30768 -f 30769 30770 is equivalent to -t fF, selects floats. 30771 -i 30772 30773 is equivalent to -t d2, selects decimal two byte units. 30774 30775 Note: This usage may change in future releases; portable 30776 applications should use -t d2. 30777 30778 -l 30779 30780 is equivalent to -t d4, selects decimal longs. 30781 -o 30782 30783 is equivalent to -t o2, selects octal two byte units. 30784 -x 30785 30786 is equivalent to -t x2, selects hexadecimal two byte units. 30787 30788 Note that the XSI option -s need not be supported. 30789 30790 Traditional Usage 30791 30792 If the --traditional option is specified, there may be between 30793 zero and three operands specified. 30794 30795 If no operands are specified, then od shall read the standard 30796 input. 30797 30798 If there is exactly one operand, and it is an offset of the 30799 form [+]offset[.][b], then it shall be interpreted as specified 30800 in ISO POSIX (2003). The file to be dumped shall be the 30801 standard input. 30802 30803 If there are exactly two operands, and they are both of the 30804 form [+]offset[.][b], then the first shall be treated as an 30805 offset (as above), and the second shall be a label, in the same 30806 format as the offset. If a label is specified, then the first 30807 output line produced for each input block shall be preceded by 30808 the input offset, cumulative across input files, of the next 30809 byte to be written, followed by the label, in parentheses. The 30810 label shall increment in the same manner as the offset. 30811 30812 If there are three operands, then the first shall be the file 30813 to dump, the second the offset, and the third the label. 30814 30815 Note: Recent versions of coreutils contain an od utility 30816 that conforms to ISO POSIX (2003). However, in April 2005, 30817 this version was not in widespread use. A future version of 30818 this specification may remove the differences. 30819 30820 passwd 30821 30822 Name 30823 30824 passwd -- change user password 30825 30826 Synopsis 30827 30828 passwd [-x max] [-n min] [-w warn] [-i inact] name 30829 passwd {-l | -u} name 30830 30831 Description 30832 30833 passwd changes authentication information for user and group 30834 accounts, including passwords and password expiry details, and 30835 may be used to enable and disable accounts. Only a user with 30836 appropriate privilege may change the password for other users 30837 or modify the expiry information. 30838 30839 Options 30840 30841 -x max 30842 30843 sets the maximum number of days a password remains valid. 30844 -n min 30845 30846 sets the minimum number of days before a password may be 30847 changed. 30848 -w warn 30849 30850 sets the number of days warning the user will receive before 30851 their password will expire. 30852 -i inactive 30853 30854 disables an account after the password has been expired for the 30855 given number of days. 30856 -l 30857 30858 disables an account by changing the password to a value which 30859 matches no possible encrypted value. 30860 -u 30861 30862 re-enables an account by changing the password back to its 30863 previous value. 30864 30865 patch 30866 30867 Name 30868 30869 patch -- apply a diff file to an original 30870 30871 Description 30872 30873 patch is as specified in ISO POSIX (2003), but with extensions 30874 as listed below. 30875 30876 Extensions 30877 30878 --binary 30879 30880 reads and write all files in binary mode, except for standard 30881 output and /dev/tty. This option has no effect on 30882 POSIX-compliant systems. 30883 -u, --unified 30884 30885 interprets the patch file as a unified context diff. 30886 30887 pidof 30888 30889 Name 30890 30891 pidof -- find the process ID of a running program 30892 30893 Synopsis 30894 30895 pidof [-s] [-x] [-o omitpid...] program... 30896 30897 Description 30898 30899 Return the process ID of a process which is running the program 30900 named on the command line. 30901 30902 The pidof command is a system administration utility, see Path 30903 For System Administration Utilities. 30904 30905 Options 30906 30907 -s 30908 30909 instructs the program to only return one pid. 30910 -x 30911 30912 causes the program to also return process id's of shells 30913 running the named scripts. 30914 -o 30915 30916 omits processes with specified process id. 30917 30918 remove_initd 30919 30920 Name 30921 30922 remove_initd -- clean up init script system modifications 30923 introduced by install_initd 30924 30925 Synopsis 30926 30927 /usr/lib/lsb/remove_initd initd_file 30928 30929 Description 30930 30931 remove_initd processes the removal of the modifications made to 30932 a distribution's init script system by the install_initd 30933 program. This cleanup is performed in the preuninstall script 30934 of a package; however, the package manager is still responsible 30935 for removing the script from the repository. See also 30936 Installation and Removal of Init Scripts. 30937 30938 renice 30939 30940 Name 30941 30942 renice -- alter priority of running processes 30943 30944 Description 30945 30946 renice is as specified in ISO POSIX (2003), but with 30947 differences as listed below. 30948 30949 Differences 30950 30951 -n increment 30952 30953 has unspecified behavior. 30954 30955 sed 30956 30957 Name 30958 30959 sed -- stream editor 30960 30961 Description 30962 30963 sed is as specified in ISO POSIX (2003), but with differences 30964 as listed below. 30965 30966 LSB Differences 30967 30968 Certain aspects of internationalized regular expressions are 30969 optional; see Regular Expressions. 30970 30971 sendmail 30972 30973 Name 30974 30975 sendmail -- an electronic mail transport agent 30976 30977 Synopsis 30978 30979 /usr/sbin/sendmail [options] [address...] 30980 30981 Description 30982 30983 To deliver electronic mail (email), applications shall support 30984 the interface provided by sendmail (described here). This 30985 interface shall be the default delivery method for 30986 applications. 30987 30988 This program sends an email message to one or more recipients, 30989 routing the message as necessary. This program is not intended 30990 as a user interface routine. 30991 30992 With no options, sendmail reads its standard input up to an 30993 end-of-file or a line consisting only of a single dot and sends 30994 a copy of the message found there to all of the addresses 30995 listed. It determines the network(s) to use based on the syntax 30996 and contents of the addresses. 30997 30998 If an address is preceded by a backslash, '\', it is 30999 unspecified if the address is subject to local alias expansion. 31000 31001 The format of messages shall be as defined in RFC 2822:Internet 31002 Message Format. 31003 31004 Note: The name sendmail was chosen for historical reasons, 31005 but the sendmail command specified here is intended to 31006 reflect functionality provided by smail, exim and other 31007 implementations, not just the sendmail implementation. 31008 31009 Options 31010 31011 -bm 31012 31013 read mail from standard input and deliver it to the recipient 31014 addresses. This is the default mode of operation. 31015 -bp 31016 31017 If the user has sufficient privilege, list information about 31018 messages currently in the mail queue. 31019 -bs 31020 31021 use the SMTP protocol as described in RFC 2821:Simple Mail 31022 Transfer Protocol; read SMTP commands on standard input and 31023 write SMTP responses on standard output. 31024 31025 In this mode, sendmail shall accept \r\n (CR-LF), as required 31026 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 31027 terminators. 31028 -F fullname 31029 31030 explicitly set the full name of the sender for incoming mail 31031 unless the message already contains a From: message header. 31032 31033 If the user running sendmail is not sufficiently trusted, then 31034 the actual sender may be indicated in the message, depending on 31035 the configuration of the agent. 31036 -f name 31037 31038 explicitly set the envelope sender address for incoming mail. 31039 If there is no From: header, the address specified in the From: 31040 header will also be set. 31041 31042 If the user running sendmail is not sufficiently trusted, then 31043 the actual sender shall be indicated in the message. 31044 -i 31045 31046 ignore dots alone on lines by themselves in incoming messages. 31047 If this options is not specified, a line consisting of a single 31048 dot shall terminate the input. If -bs is also used, the 31049 behavior is unspecified. 31050 -odb 31051 31052 deliver any mail in background, if supported; otherwise 31053 ignored. 31054 -odf 31055 31056 deliver any mail in foreground, if supported; otherwise 31057 ignored. 31058 -oem or -em 31059 31060 mail errors back to the sender. (default) 31061 -oep or -ep 31062 31063 write errors to the standard error output. 31064 -oeq or -eq 31065 31066 do not send notification of errors to the sender. This only 31067 works for mail delivered locally. 31068 -oi 31069 31070 is equivalent to -i. 31071 -om 31072 31073 indicate that the sender of a message should receive a copy of 31074 the message if the sender appears in an alias expansion. 31075 Ignored if aliases are not supported. 31076 -t 31077 31078 read the message to obtain recipients from the To:, Cc:, and 31079 Bcc: headers in the message instead of from the command 31080 arguments. If a Bcc: header is present, it is removed from the 31081 message unless there is no To: or Cc: header, in which case a 31082 Bcc: header with no data is created, in accordance with RFC 31083 2822:Internet Message Format. 31084 31085 If there are any operands, the recipients list is unspecified. 31086 31087 This option may be ignored when not in -bm mode (the default). 31088 31089 Note: It is recommended that applications use as few options 31090 as necessary, none if possible. 31091 31092 Exit status 31093 31094 0 31095 31096 successful completion on all addresses. This does not indicate 31097 successful delivery. 31098 >0 31099 31100 there was an error. 31101 31102 seq 31103 31104 Name 31105 31106 seq -- generate a sequence of numbers 31107 31108 Synopsis 31109 31110 /usr/bin/seq [-f fmt_str] [-s sep_str] [first_num] [inc_num] 31111 last_num 31112 31113 Description 31114 31115 The seq command shall output a sequence of numbers from 31116 first_num to last_num, stepping by the increment inc_num. The 31117 first_num and last_num parameters may be omitted, and default 31118 to 1 even when first_num is greater than last_num. 31119 Floating-point values may be specified for first_num, inc_num, 31120 and last_num. 31121 31122 The fmt_str parameter is a floating point format string like 31123 the one used for the printf() function in C. 31124 31125 The sep_str parameter string separates the values that are 31126 output. The default is a newline character (/n). 31127 31128 Note: If first_num is less than last_num and inc_num is 31129 negative, or first_num is greater than last_num and inc_num 31130 is positive, seq shall not generate any output. 31131 31132 Standard Options 31133 31134 -f fmt_str 31135 31136 Format the numbers in the output sequence according to fmt_str, 31137 a floating point format string like the one used for the 31138 printf() function in C. 31139 -s sep_str 31140 31141 Separate the numbers in the output sequence with sep_str. The 31142 default separator string is a newline character (\n). 31143 first_num 31144 31145 The first number in the output sequence. Defaults to 1. May be 31146 a floating point value. 31147 inc_num 31148 31149 The increment for the output sequence. Defaults to 1. May be a 31150 floating point value. 31151 last_num 31152 31153 The last number in the output sequence. May be a floating point 31154 value. 31155 31156 sh 31157 31158 Name 31159 31160 sh -- shell, the standard command language interpreter 31161 31162 Description 31163 31164 The sh utility shall behave as specified in ISO POSIX (2003), 31165 but with extensions listed below. 31166 31167 Shell Invocation 31168 31169 The shell shall support an additional option, -l (the letter 31170 ell). If the -l option is specified, or if the first character 31171 of argument zero (the command name) is a '-', this invokation 31172 of the shell is a login shell. 31173 31174 An interactive shell, as specified in ISO POSIX (2003), that is 31175 also a login shell, or any shell if invoked with the -l option, 31176 shall, prior to reading from the input file, first read and 31177 execute commands from the file /etc/profile, if that file 31178 exists, and then from a file called ~/.profile, if such a file 31179 exists. 31180 31181 Note: This specification requires that the sh utility shall 31182 also read and execute commands in its current execution 31183 environment from all the shell scripts in the directory 31184 /etc/profile.d. Such scripts are read and executed as a part 31185 of reading and executing /etc/profile. 31186 31187 shutdown 31188 31189 Name 31190 31191 shutdown -- shut the system down 31192 31193 Synopsis 31194 31195 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 31196 [warning-message] 31197 /sbin/shutdown -c [warning-message] 31198 31199 Description 31200 31201 The shutdown command shall shut the system down in a secure way 31202 (first synopsis), or cancel a pending shutdown (second 31203 synopsis). When the shutdown is initiated, all logged-in users 31204 shall be notified immediately that the system is going down, 31205 and users shall be prevented from logging in to the system. The 31206 time specifies when the actual shutdown shall commence. See 31207 below for details. At the specified time all processes are 31208 first notified that the system is going down by the signal 31209 SIGTERM. After an interval (see -t) all processes shall be sent 31210 the signal SIGKILL. If neither the -h or the -r argument is 31211 specified, then the default behavior shall be to take the 31212 system to a runlevel where administrative tasks can be run. See 31213 also Run Levels. 31214 31215 Note: This is sometimes referred to as "single user mode". 31216 31217 The -h and -r options are mutually exclusive. If either the -h 31218 or -r options are specified, the system shall be halted or 31219 rebooted respectively. 31220 31221 Standard Options 31222 31223 -a 31224 31225 use access control. See below. 31226 -t sec 31227 31228 tell the system to wait sec seconds between sending processes 31229 the warning and the kill signal, before changing to another 31230 runlevel. The default period is unspecified. 31231 -k 31232 31233 do not really shutdown; only send the warning messages to 31234 everybody. 31235 -r 31236 31237 reboot after shutdown. 31238 -h 31239 31240 halt after shutdown. Actions after halting are unspecified 31241 (e.g. power off). 31242 -f 31243 31244 advise the system to skip file system consistency checks on 31245 reboot. 31246 -F 31247 31248 advise the system to force file system consistency checks on 31249 reboot. 31250 -c 31251 31252 cancel an already running shutdown. 31253 time 31254 31255 specify when to shut down. 31256 31257 The time argument shall have the following format: [now | 31258 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 31259 hour (1 or 2 digits) and mm is the minute of the hour (exactly 31260 two digits), and the shutdown shall commence at the next 31261 occurence of the specified time. If the format is mins (or 31262 +mins), where mins is a decimal number, shutdown shall commence 31263 in the specified number of minutes. The word now is an alias 31264 for +0. 31265 warning-message 31266 31267 specify a message to send to all users. 31268 31269 Access Control 31270 31271 If the shutdown utility is invoked with the -a option, it shall 31272 check that an authorized user is currently logged in on the 31273 system console. Authorized users are listed, one per line, in 31274 the file /etc/shutdown.allow. Lines in this file that begin 31275 with a '#' or are blank shall be ignored. 31276 31277 Note: The intent of this scheme is to allow a keyboard 31278 sequence entered on the system console (e.g. CTRL-ALT-DEL, 31279 or STOP-A) to automatically invoke shutdown -a, and can be 31280 used to prevent unauthorized users from shutting the system 31281 down in this fashion. 31282 31283 su 31284 31285 Name 31286 31287 su -- change user ID 31288 31289 Synopsis 31290 31291 su [options] [-] [username [ARGS]] 31292 31293 Description 31294 31295 The su command shall start a shell running with the real and 31296 effective user and group IDs of the user username. If username 31297 is not specified, su shall default to an unspecified user with 31298 all appropriate privileges. If the -s or --shell is not 31299 specified, the shell to be invoked shall be that specified for 31300 username in the user database (see getpwnam()), or /bin/sh if 31301 there is no shell specified in the user database. 31302 31303 If the - option is specified, or if the first operand is -, the 31304 environment for the shell shall be initialized as if the new 31305 shell was a login shell (see Shell Invocation). 31306 31307 If the invoking user does not have appropriate privileges, the 31308 su command shall prompt for a password and validate this before 31309 continuing. Invalid passwords shall produce an error message. 31310 The su command shall log in an unspecified manner all 31311 invokations, whether successful or unsuccessful. 31312 31313 Any operands specified after the username shall be passed to 31314 the invoked shell. 31315 31316 If the option - is not specified, and if the first operand is 31317 not -, the environemnt for the new shell shall be intialized 31318 from the current environment. If none of the -m, -p, or 31319 --preserve-environment options are specified, the environment 31320 may be modified in unspecified ways before invoking the shell. 31321 If any of the -m, -p, or --preserve-environment options are 31322 specified, the environment shall not be altered. 31323 31324 Note: Although the su command shall not alter the 31325 environment, the invoked shell may still alter it before it 31326 is ready to intepret any commands. 31327 31328 Standard Options 31329 31330 - 31331 the invoked shell shall be a login shell. 31332 31333 -c command, --command=command 31334 Invoke the shell with the option -c command. 31335 31336 -m, -p, --preserve-environment 31337 The current environment shall be passed to the invoked 31338 shell. If the environment variable SHELL is set, it 31339 shall specify the shell to invoke, if it matches an 31340 entry in /etc/shells. If there is no matching entry in 31341 /etc/shells, this option shall be ignored if the - 31342 option is also specified, or if the first operand is -. 31343 31344 -s shell, --shell=shell 31345 Invoke shell as the comamnd interpreter. The shell 31346 specified shall be present in /etc/shells. 31347 31348 sync 31349 31350 Name 31351 31352 sync -- flush file system buffers 31353 31354 Synopsis 31355 31356 sync 31357 31358 Description 31359 31360 Force changed blocks to disk, update the super block. 31361 31362 tar 31363 31364 Name 31365 31366 tar -- file archiver 31367 31368 Description 31369 31370 tar is as specified in SUSv2, but with differences as listed 31371 below. 31372 31373 Differences 31374 31375 Some elements of the Pattern Matching Notation are optional; 31376 see Pattern Matching Notation. 31377 31378 -h 31379 31380 doesn't dump symlinks; dumps the files they point to. 31381 -z 31382 31383 filters the archive through gzip. 31384 31385 umount 31386 31387 Name 31388 31389 umount -- unmount file systems 31390 31391 Synopsis 31392 31393 umount [-hV] 31394 umount -a [-nrv] [-t vfstype] 31395 umount [-nrv] device | dir... 31396 31397 Description 31398 31399 umount detaches the file system(s) mentioned from the file 31400 hierarchy. A file system is specified by giving the directory 31401 where it has been mounted. 31402 31403 Standard Options 31404 31405 -v 31406 31407 invokes verbose mode. 31408 -n 31409 31410 unmounts without writing in /etc/mtab. 31411 -r 31412 31413 tries to remount read-only if unmounting fails. 31414 -a 31415 31416 unmounts all of the file systems described in /etc/mtab except 31417 for the proc file system. 31418 -t vfstype 31419 31420 indicates that the actions should only be taken on file systems 31421 of the specified type. More than one type may be specified in a 31422 comma separated list. The list of file system types can be 31423 prefixed with no to specify the file system types on which no 31424 action should be taken. 31425 -f 31426 31427 forces unmount (in case of an unreachable NFS system). 31428 31429 LSB Deprecated Options 31430 31431 The behaviors specified in this section are expected to 31432 disappear from a future version of the LSB; applications should 31433 only use the non-LSB-deprecated behaviors. 31434 31435 -V 31436 31437 print version and exits. 31438 31439 useradd 31440 31441 Name 31442 31443 useradd -- create a new user or update default new user 31444 information 31445 31446 Synopsis 31447 31448 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 31449 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 31450 [-u uid [-o]] login 31451 useradd -D [-g default_group] [-b default_home] [-s 31452 default_shell] 31453 31454 Description 31455 31456 When invoked without the -D option, and with appropriate 31457 privilege, useradd creates a new user account using the values 31458 specified on the command line and the default values from the 31459 system. The new user account will be entered into the system 31460 files as needed, the home directory will be created, and 31461 initial files copied, depending on the command line options. 31462 31463 When invoked with the -D option, useradd will either display 31464 the current default values, or, with appropriate privilege, 31465 update the default values from the command line. If no options 31466 are specified, useradd displays the current default values. 31467 31468 The useradd command is a system administration utility, see 31469 Path For System Administration Utilities. 31470 31471 Standard Options 31472 31473 -c comment 31474 31475 specifies the new user's password file comment field value. 31476 -d home_dir 31477 31478 creates the new user using home_dir as the value for the user's 31479 login directory. The default is to append the login name to 31480 default_home and use that as the login directory name. 31481 -g initial_group 31482 31483 specifies the group name or number of the user's initial login 31484 group. The group name shall exist. A group number shall refer 31485 to an already existing group. If -g is not specified, the 31486 implementation will follow the normal user default for that 31487 system. This may create a new group or choose a default group 31488 that normal users are placed in. Applications which require 31489 control of the groups into which a user is placed should 31490 specify -g. 31491 -G group[,...] 31492 31493 specifies a list of supplementary groups which the user is also 31494 a member of. Each group is separated from the next by a comma, 31495 with no intervening whitespace. The groups are subject to the 31496 same restrictions as the group given with the -g option. The 31497 default is for the user to belong only to the initial group. 31498 -m [-k skeleton_dir] 31499 31500 specifies the user's home directory will be created if it does 31501 not exist. The files contained in skeleton_dir will be copied 31502 to the home directory if the -k option is used, otherwise the 31503 files contained in /etc/skel will be used instead. Any 31504 directories contained in skeleton_dir or /etc/skel will be 31505 created in the user's home directory as well. The -k option is 31506 only valid in conjunction with the -m option. The default is to 31507 not create the directory and to not copy any files. 31508 -p passwd 31509 31510 is the encrypted password, as returned by crypt(). The default 31511 is to disable the account. 31512 -r 31513 31514 creates a system account, that is, a user with a User ID in the 31515 range reserved for system account users. If there is not a User 31516 ID free in the reserved range the command will fail. 31517 -s shell 31518 31519 specifies the name of the user's login shell. The default is to 31520 leave this field blank, which causes the system to select the 31521 default login shell. 31522 -u uid [-o] 31523 31524 specifies the numerical value of the user's ID. This value 31525 shall be unique, unless the -o option is used. The value shall 31526 be non-negative. The default is the smallest ID value greater 31527 than 499 which is not yet used. 31528 31529 Change Default Options 31530 31531 -b default_home 31532 31533 specifies the initial path prefix for a new user's home 31534 directory. The user's name will be affixed to the end of 31535 default_home to create the new directory name if the -d option 31536 is not used when creating a new account. 31537 -g default_group 31538 31539 specifies the group name or ID for a new user's initial group. 31540 The named group shall exist, and a numerical group ID shall 31541 have an existing entry. 31542 -s default_shell 31543 31544 specifies the name of the new user's login shell. The named 31545 program will be used for all future new user accounts. 31546 -c comment 31547 31548 specifies the new user's password file comment field value. 31549 31550 Application Usage 31551 31552 The -D option will typically be used by system administration 31553 packages. Most applications should not change defaults which 31554 will affect other applications and users. 31555 31556 userdel 31557 31558 Name 31559 31560 userdel -- delete a user account and related files 31561 31562 Synopsis 31563 31564 userdel [-r] login 31565 31566 Description 31567 31568 Delete the user account named login. If there is also a group 31569 named login, this command may delete the group as well, or may 31570 leave it alone. 31571 31572 The userdel command is a system administration utility, see 31573 Path For System Administration Utilities. 31574 31575 Options 31576 31577 -r 31578 31579 removes files in the user's home directory along with the home 31580 directory itself. Files located in other file system will have 31581 to be searched for and deleted manually. 31582 31583 usermod 31584 31585 Name 31586 31587 usermod -- modify a user account 31588 31589 Synopsis 31590 31591 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] [-G 31592 group [,...]] [-l login_name] [-p passwd] [-s shell] [-u uid [ 31593 -o]] login 31594 31595 Description 31596 31597 The usermod command shall modify an entry in the user account 31598 database. 31599 31600 The usermod command is a system administration utility, see 31601 Path For System Administration Utilities. 31602 31603 Options 31604 31605 -c comment 31606 31607 specifies the new value of the user's password file comment 31608 field. 31609 -d home_dir 31610 31611 specifies the user's new login directory. If the -m option is 31612 given the contents of the current home directory will be moved 31613 to the new home directory, which is created if it does not 31614 already exist. 31615 -g initial_group 31616 31617 specifies the group name or number of the user's new initial 31618 login group. The group name shall exist. A group number shall 31619 refer to an already existing group. 31620 -G group,[...] 31621 31622 specifies a list of supplementary groups which the user is also 31623 a member of. Each group is separated from the next by a comma, 31624 with no intervening whitespace. The groups are subject to the 31625 same restrictions as the group given with the -g option. If the 31626 user is currently a member of a group which is not listed, the 31627 user will be removed from the group. 31628 -l login_name 31629 31630 changes the name of the user from login to login_name. Nothing 31631 else is changed. In particular, the user's home directory name 31632 should probably be changed to reflect the new login name. 31633 -p passwd 31634 31635 is the encrypted password, as returned by crypt(3). 31636 -s shell 31637 31638 specifies the name of the user's new login shell. Setting this 31639 field to blank causes the system to select the default login 31640 shell. 31641 -u uid [-o] 31642 31643 specifies the numerical value of the user's ID. This value 31644 shall be unique, unless the -o option is used. The value shall 31645 be non-negative. Any files which the user owns and which are 31646 located in the directory tree rooted at the user's home 31647 directory will have the file user ID changed automatically. 31648 Files outside of the user's home directory shall be altered 31649 manually. 31650 31651 xargs 31652 31653 Name 31654 31655 xargs -- build and execute command lines from standard input 31656 31657 Description 31658 31659 xargs is as specified in ISO POSIX (2003), but with differences 31660 as listed below. 31661 31662 Differences 31663 31664 -E 31665 31666 has unspecified behavior. 31667 -I 31668 31669 has unspecified behavior. 31670 -L 31671 31672 has unspecified behavior. 31673 31674 Note: These options have been implemented in 31675 findutils-4.2.9, but this version of the utilities is not in 31676 widespread use as of April 2005. However, future versions of 31677 this specification will require support for these arguments. 31678 31679 zcat 31680 31681 Name 31682 31683 zcat -- uncompress files to standard output 31684 31685 Description 31686 31687 The zcat utility shall behave as described in ISO POSIX (2003), 31688 with differences listed below. 31689 31690 The Filesystem Hierarchy Standard requires that if zcat exists, 31691 it must be a symbolic or hard link to /bin/gzip. This 31692 specification additionally allows zcat to be a wrapper script 31693 which calls gzip -c -d. 31694 31695 Differences 31696 31697 The zcat utility shall write to standard output the 31698 uncompressed form of files that have been compressed using any 31699 of the compression methods supported by the gzip utility. It is 31700 the equivalent of gzip -c -d. Input files are not affected. 31701 31702 VI. Execution Environment 31703 31704 Table of Contents 31705 16. File System Hierarchy 31706 31707 16.1. /dev: Device Files 31708 16.2. /etc: Host-specific system configuration 31709 31710 16.2.1. File Naming Conventions 31711 31712 16.3. User Accounting Databases 31713 16.4. Path For System Administration Utilities 31714 31715 17. Additional Recommendations 31716 31717 17.1. Recommendations for applications on ownership and 31718 permissions 31719 31720 17.1.1. Directory Write Permissions 31721 17.1.2. File Write Permissions 31722 17.1.3. File Read and execute Permissions 31723 17.1.4. SUID and SGID Permissions 31724 17.1.5. Privileged users 31725 17.1.6. Changing permissions 31726 17.1.7. Removable Media (Cdrom, Floppy, etc.) 31727 17.1.8. Installable applications 31728 31729 18. Additional Behaviors 31730 31731 18.1. Mandatory Optional Behaviors 31732 31733 18.1.1. Special Requirements 31734 31735 18.2. Optional Mandatory Behaviors 31736 18.3. Executable Scripts 31737 31738 19. Localization 31739 31740 19.1. Introduction 31741 19.2. Regular Expressions 31742 19.3. Pattern Matching Notation 31743 __________________________________________________________ 31744 31745 Chapter 16. File System Hierarchy 31746 31747 An LSB conforming implementation shall provide the mandatory 31748 portions of the file system hierarchy specified in the 31749 Filesystem Hierarchy Standard (FHS), together with any 31750 additional requirements made in this specification. 31751 31752 An LSB conforming application shall conform to the Filesystem 31753 Hierarchy Standard. 31754 31755 The FHS allows many components or subsystems to be optional. An 31756 application shall check for the existence of an optional 31757 component before using it, and should behave in a reasonable 31758 manner if the optional component is not present. 31759 31760 The FHS requirement to locate the operating system kernel in 31761 either / or /boot does not apply if the operating system kernel 31762 does not exist as a file in the file system. 31763 31764 The FHS specifies certain behaviors for a variety of commands 31765 if they are present (for example, ping or python). However, LSB 31766 conforming applications shall not rely on any commands beyond 31767 those specified by the LSB. The mere existence of a command may 31768 not be used as an indication that the command behaves in any 31769 particular way. 31770 31771 The following directories or links need not be present: 31772 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 31773 __________________________________________________________ 31774 31775 16.1. /dev: Device Files 31776 31777 The devices described in Chapter 6. "Operating System Specific 31778 Annex", Section 6.1. "Linux", subsection 6.1.3. "/dev: Devices 31779 and special files" in the Filesystem Hierarchy Standard are 31780 required on an LSB conforming system. Other devices may also 31781 exist in /dev. Device names may exist as symbolic links to 31782 other device nodes located in /dev or subdirectories of /dev. 31783 There is no requirement concerning major/minor number values. 31784 __________________________________________________________ 31785 31786 16.2. /etc: Host-specific system configuration 31787 31788 In addition to the requirements for /etc in the Filesystem 31789 Hierarchy Standard, an LSB conforming system shall also provide 31790 the following directories or symbolic links to directories: 31791 31792 /etc/cron.d 31793 31794 A directory containing extended crontab files; see Cron Jobs. 31795 /etc/cron.daily 31796 31797 A directory containing shell scripts to be executed once a day; 31798 see Cron Jobs. 31799 /etc/cron.hourly 31800 31801 A directory containing shell scripts to be executed once per 31802 hour; see Cron Jobs. 31803 /etc/cron.monthly 31804 31805 A directory containing shell scripts to be executed once per 31806 month; see Cron Jobs. 31807 /etc/cron.weekly 31808 31809 A directory containing shell scripts to be executed once a 31810 week; see Cron Jobs. 31811 /etc/init.d 31812 31813 A directory containing system initialization scripts; see 31814 Installation and Removal of Init Scripts. 31815 /etc/profile.d 31816 31817 A directory containing shell scripts. Script names should 31818 follow the same conventions as specified for cron jobs (see 31819 Cron Jobs, but should have the suffix .sh. The behavior is 31820 unspecified if a script is installed in this directory that 31821 does not have the suffix .sh. 31822 31823 The sh utility shall read and execute commands in its current 31824 execution environment from all the shell scripts in this 31825 directory that have the suffix .sh when invoked as an 31826 interactive login shell, or if the -l (the letter ell) is 31827 specified (see Shell Invocation). 31828 31829 Future Directions: These directories are required at this 31830 version of the LSB since there is not yet an agreed method 31831 for abstracting the implementation so that applications need 31832 not be aware of these locations during installation. 31833 However, Future Directions describes a tool, lsbinstall, 31834 that will make these directories implementation specific and 31835 no longer required. 31836 __________________________________________________________ 31837 31838 16.2.1. File Naming Conventions 31839 31840 Conforming implementations and applications installing files 31841 into any of the above locations under /etc may only use 31842 filenames from the following managed namespaces: 31843 31844 * Assigned names. Such names must be chosen from the 31845 character set [a-z0-9]. In order to avoid conflicts these 31846 names shall be reserved through the Linux Assigned Names 31847 and Numbers Authority (LANANA). Information about the 31848 LANANA may be found at www.lanana.org. 31849 31850 Note: Commonly used names should be reserved in advance; 31851 developers for projects are encouraged to reserve names from 31852 LANANA, so that each distribution can use the same name, and 31853 to avoid conflicts with other projects. 31854 * Hierarchical names. Script names in this category take the 31855 form: --...-, where name is taken from 31856 the character set [a-z0-9], and where there may be one or 31857 more components. may either be an LSB 31858 provider name assigned by the LANANA, or it may be owners' 31859 DNS name in lower case, with at least one '.'. e.g. 31860 "debian.org", "staroffice.sun.com", etc. The LSB provider 31861 name assigned by LANANA shall only consist of the ASCII 31862 characters [a-z0-9]. 31863 * Reserved names. Names that begin with the character '_' are 31864 reserved for distribution use only. These names should be 31865 used for essential system packages only. 31866 31867 Note: A non-conforming application may still have polluted 31868 these managed namespaces with unregistered filenames; a 31869 conforming application should check for namespace collisions 31870 and take appropriate steps if they occur. 31871 31872 In general, if a package or some system function is likely 31873 to be used on multiple systems, the package developers or 31874 the distribution should get a registered name through 31875 LANANA, and distributions should strive to use the same name 31876 whenever possible. For applications which may not be 31877 essential or may not be commonly installed, the hierarchical 31878 namespace may be more appropriate. An advantage to the 31879 hierarchical namespace is that there is no need to consult 31880 with the LANANA before obtaining an assigned name. 31881 31882 Short names are highly desirable, since system 31883 administrators may need to manually start and stop services. 31884 Given this, they should be standardized on a per-package 31885 basis. This is the rationale behind having the LANANA 31886 organization assign these names. The LANANA may be called 31887 upon to handle other namespace issues, such as 31888 package/prerequisites naming. 31889 __________________________________________________________ 31890 31891 16.3. User Accounting Databases 31892 31893 The Filesystem Hierarchy Standard specifies two optional 31894 locations for user accounting databases used by the getutent(), 31895 getutent_r(), getutxent(), getutxid(), getutxline(), and 31896 pututxline() functions. These are /var/run/utmp and 31897 /var/run/wtmp. 31898 31899 The LSB does not specify the format or structure of these 31900 files, or even if they are files at all. They should be used 31901 only as "magic cookies" to the utmpname() function. 31902 __________________________________________________________ 31903 31904 16.4. Path For System Administration Utilities 31905 31906 Certain utilities used for system administration (and other 31907 privileged commands) may be stored in /sbin, /usr/sbin, and 31908 /usr/local/sbin. Applications requiring to use commands 31909 identified as system administration utilities should add these 31910 directories to their PATH. By default, as described in ISO 31911 POSIX (2003), standard utilities shall be found on the PATH 31912 returned by getconf PATH (or command -p getconf PATH to be 31913 guaranteed to invoke the correct version of getconf). 31914 __________________________________________________________ 31915 31916 Chapter 17. Additional Recommendations 31917 31918 17.1. Recommendations for applications on ownership and permissions 31919 31920 17.1.1. Directory Write Permissions 31921 31922 The application should not depend on having directory write 31923 permission in any directory except /tmp, /var/tmp, and the 31924 invoking user's home directory. 31925 31926 In addition, the application may store variable data in 31927 /var/opt/package, (where package is the name of the application 31928 package), if such a directory is created with appropriate 31929 permissions during the package installation. 31930 31931 For these directories the application should be able to work 31932 with directory write permissions restricted by the S_ISVTXT 31933 bit, implementing the restricted deletion mode as described for 31934 the XSI option for ISO POSIX (2003).. 31935 __________________________________________________________ 31936 31937 17.1.2. File Write Permissions 31938 31939 The application should not depend on file write permission to 31940 any file that it does not itself create. 31941 __________________________________________________________ 31942 31943 17.1.3. File Read and execute Permissions 31944 31945 The application should not depend on having read permission to 31946 every file and directory. 31947 __________________________________________________________ 31948 31949 17.1.4. SUID and SGID Permissions 31950 31951 The application should not depend on the set user ID or set 31952 group ID (the S_ISUID or S_ISGID permission bits) permissions 31953 of a file not packaged with the application. Instead, the 31954 distribution is responsible for assuming that all system 31955 commands have the required permissions and work correctly. 31956 31957 Rationale: In order to implement common security policies it 31958 is strongly advisable for applications to use the minimum 31959 set of security attributes necessary for correct operation. 31960 Applications that require substantial appropriate privilege 31961 are likely to cause problems with such security policies. 31962 __________________________________________________________ 31963 31964 17.1.5. Privileged users 31965 31966 In general, applications should not depend on running as a 31967 privileged user. This specification uses the term "appropriate 31968 privilege" throughout to identify operations that cannot be 31969 achieved without some special granting of additional privilege. 31970 31971 Applications that have a reason to run with appropriate 31972 privilege should outline this reason clearly in their 31973 documentation. Users of the application should be informed, 31974 that "this application demands security privileges, which could 31975 interfere with system security". 31976 31977 The application should not contain binary-only software that 31978 requires being run with appropriate privilege, as this makes 31979 security auditing harder or even impossible. 31980 __________________________________________________________ 31981 31982 17.1.6. Changing permissions 31983 31984 The application shall not change permissions of files and 31985 directories that do not belong to its own package. Should an 31986 application require that certain files and directories not 31987 directly belonging to the package have a particular ownership, 31988 the application shall document this requirement, and may fail 31989 during installation if the permissions on these files is 31990 inappropriate. 31991 __________________________________________________________ 31992 31993 17.1.7. Removable Media (Cdrom, Floppy, etc.) 31994 31995 Applications that expect to be runnable from removable media 31996 should not depend on logging in as a privileged user, and 31997 should be prepared to deal with a restrictive environment. 31998 Examples of such restrictions could be default mount options 31999 that disable set-user/group-ID attributes, disabling block or 32000 character-special files on the medium, or remapping the user 32001 and group IDs of files away from any privileged value. 32002 32003 Rationale: System vendors and local system administrators 32004 want to run applications from removable media, but want the 32005 possibility to control what the application can do. 32006 __________________________________________________________ 32007 32008 17.1.8. Installable applications 32009 32010 Where the installation of an application needs additional 32011 privileges, it must clearly document all files and system 32012 databases that are modified outside of those in /opt/pkg-name 32013 and /var/opt/pkg-name, other than those that may be updated by 32014 system logging or auditing activities. 32015 32016 Without this, the local system administrator would have to 32017 blindly trust a piece of software, particularly with respect to 32018 its security. 32019 __________________________________________________________ 32020 32021 Chapter 18. Additional Behaviors 32022 32023 18.1. Mandatory Optional Behaviors 32024 32025 This section specifies behaviors in which there is optional 32026 behavior in one of the standards on which this specification 32027 relies, and where this specification requires a specific 32028 behavior. 32029 32030 Note: This specification does not require the kernel to be 32031 Linux; the set of mandated options reflects current existing 32032 practice, but may be modified in future releases. 32033 32034 LSB conforming implementations shall support the following 32035 options defined within the ISO POSIX (2003): 32036 32037 _POSIX_FSYNC 32038 _POSIX_MAPPED_FILES 32039 _POSIX_MEMLOCK 32040 _POSIX_MEMLOCK_RANGE 32041 _POSIX_MEMORY_PROTECTION 32042 _POSIX_PRIORITY_SCHEDULING 32043 _POSIX_REALTIME_SIGNALS 32044 _POSIX_THREAD_ATTR_STACKADDR 32045 _POSIX_THREAD_ATTR_STACKSIZE 32046 _POSIX_THREAD_PROCESS_SHARED 32047 _POSIX_THREAD_SAFE_FUNCTIONS 32048 _POSIX_THREADS 32049 32050 The opendir() function shall consume a file descriptor in the 32051 same fashion as open(), and therefore may fail with EMFILE or 32052 ENFILE. 32053 32054 The START and STOP termios characters shall be changeable, as 32055 described as optional behavior in the "General Terminal 32056 Interface" section of the ISO POSIX (2003). 32057 32058 The access() function function shall fail with errno set to 32059 EINVAL if the amode argument contains bits other than those set 32060 by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 32061 32062 The link() function shall require access to the existing file 32063 in order to succeed, as described as optional behavior in the 32064 ISO POSIX (2003). 32065 32066 Calling unlink() on a directory shall fail. Calling link() 32067 specifying a directory as the first argument shall fail. See 32068 also unlink. 32069 32070 Note: Linux allows rename() on a directory without having 32071 write access, but this specification does not require this 32072 behavior. 32073 __________________________________________________________ 32074 32075 18.1.1. Special Requirements 32076 32077 LSB conforming systems shall enforce certain special additional 32078 restrictions above and beyond those required by ISO POSIX 32079 (2003). 32080 32081 Note: These additional restrictions are required in order to 32082 support the testing and certification programs associated 32083 with the LSB. In each case, these are values that defined 32084 macros must not have; conforming applications that use these 32085 values shall trigger a failure in the interface that is 32086 otherwise described as a "may fail". 32087 32088 The fcntl() function shall treat the "cmd" value -1 as invalid. 32089 32090 The whence value -1 shall be an invalid value for the lseek(), 32091 fseek() and fcntl() functions. 32092 32093 The value -5 shall be an invalid signal number. 32094 32095 If the sigaddset() or sigdelset() functions are passed an 32096 invalid signal number, they shall return with EINVAL. 32097 Implementations are only required to enforce this requirement 32098 for signal numbers which are specified to be invalid by this 32099 specification (such as the -5 mentioned above). 32100 32101 The mode value -1 to the access() function shall be treated as 32102 invalid. 32103 32104 A value of -1 shall be an invalid "_PC_..." value for 32105 pathconf(). 32106 32107 A value of -1 shall be an invalid "_SC..." value for sysconf(). 32108 32109 The nl_item value -1 shall be invalid for nl_langinfo(). 32110 32111 The value -1 shall be an invalid "_CS_..." value for confstr(). 32112 32113 The value "a" shall be an invalid mode argument to popen(). 32114 32115 The fcntl() function shall fail and set errno to EDEADLK if the 32116 cmd argument is F_SETLKW, and the lock is blocked by a lock 32117 from another process already blocked by the current process. 32118 32119 The opendir() function shall consume a file descriptor; the 32120 readdir() function shall fail and set errno to EBADF if the 32121 underlying file descriptor is closed. 32122 32123 The link() function shall not work across file systems, and 32124 shall fail and set errno to EXDEV as described as optional 32125 behavior in ISO POSIX (2003). 32126 __________________________________________________________ 32127 32128 18.2. Optional Mandatory Behaviors 32129 32130 This section specifies behaviors that are mandatory in one of 32131 the standards on which this specification relies, but which are 32132 optional in this specification. 32133 32134 ISO POSIX (2003) describes the behavior of the file access 32135 time, available as the st_atime field of the stat and stat64 32136 structures. An LSB conforming implementation need not update 32137 this information every time a file is accessed. 32138 32139 Note: A subsequent edition of the POSIX standard no longer 32140 mandates updating of st_atime but the older edition is still 32141 the guiding standard for this specification, thus this 32142 exception is needed. 32143 __________________________________________________________ 32144 32145 18.3. Executable Scripts 32146 32147 An executable script is an executable file of which the first 32148 two characters are #! as defined in the portable character set. 32149 In ISO POSIX (2003), this construct is undefined, but reserved 32150 for implementations which wish to provide this functionality. 32151 LSB conforming implementations shall support executable 32152 scripts. 32153 32154 A successful call to a function of the exec family with an 32155 executable script as the first parameter shall result in a new 32156 process, where the process image started is that of the 32157 interpreter. The path name of the interpreter follows the #! 32158 characters. 32159 32160 If the executable script has a first line 32161 32162 #! interpreter [arg] 32163 32164 then interpreter shall be called with an argument array 32165 consisting of an unspecified zeroth argument, followed by arg 32166 (if present), followed by a path name for the script, followed 32167 by the arguments following the zeroth argument in the exec call 32168 of the script. 32169 32170 The interpreter shall not perform any operations on the first 32171 line of an executable script. 32172 32173 The first line of the executable script shall meet all of the 32174 following criteria otherwise the results are unspecified: 32175 32176 1. Is of one of the forms: 32177 32178 #!interpreter 32179 #! interpreter 32180 #!interpreter arg 32181 #! interpreter arg 32182 32183 2. The interpreter argument is an absolute pathname of an 32184 executable file other than an executable script. 32185 3. Neither the interpreter argument nor the arg argument, if 32186 present, contain any quoting characters. 32187 4. Neither the interpreter argument nor the arg argument, if 32188 present, contain any whitespace characters. 32189 5. The length of the entire line is no longer than 80 bytes. 32190 32191 If the interpreter is required by this specification to be in a 32192 specfic named directory, a conforming application must use that 32193 path for interpreter, as implementations are not prohibited 32194 from having other, possibly non-conforming, versions of the 32195 same interpreter installed on the system. If the interpreter is 32196 a required command in this specification, but does not have a 32197 required path, the application should take special measures to 32198 insure the appropriate version is selected. If the interpreter 32199 is not a required command in this specification, the 32200 application must make appropriate provisions that the 32201 interpreter is available at the appropriate path. 32202 32203 Note: In case the path is not specified, it is recommended 32204 that an installation script for executable scripts use the 32205 standard PATH returned by a call to the getconf command with 32206 the argument PATH, combined with the command command to 32207 determine the location of a standard command. 32208 32209 For example to determine the location of the standard awk 32210 command: 32211 32212 PATH=`getconf PATH` command -v awk 32213 32214 The installation script should ensure that the returned 32215 pathname is an absolute pathname prior to use, since a shell 32216 builtin might be returned for some utilities. 32217 32218 Use of the common form #!/usr/bin/env interpreter is not 32219 recommended as the PATH will be unknown at execution time 32220 and an alternative version of interpreter might be selected. 32221 __________________________________________________________ 32222 32223 Chapter 19. Localization 32224 32225 19.1. Introduction 32226 32227 In order to install a message catalog, the installation 32228 procedure shall supply the message catalog in a format readable 32229 by the msgfmt command, which shall be invoked to compile the 32230 message catalog into an appropriate binary format on the target 32231 system. 32232 32233 Rationale: The original intent was to allow an application 32234 to contain the binary GNU MO format files. However, the 32235 format of these files is not officially stable, hence it is 32236 necessary to compile these catalogs on the target system. 32237 These binary catalogs may differ from architecture to 32238 architecture as well. 32239 32240 The resulting binary message catalog shall be located in the 32241 package's private area under /opt, and the application may use 32242 bindtextdomain() to specify this location. 32243 32244 Implementations shall support the POSIX and C locales as 32245 specified in ISO POSIX (2003). Other locales may be supported. 32246 32247 Implementations may define additional locale categories not 32248 defined by that standard. 32249 32250 Note: Implementations choosing additional locale categories 32251 should be aware of ISO/IEC TR14652 and are advised not to 32252 choose names that conflict with that specification. If 32253 implementations provide locale categories whose names are 32254 part of the FDCC set of ISO/IEC TR14652, they should behave 32255 as defined by that specification. 32256 __________________________________________________________ 32257 32258 19.2. Regular Expressions 32259 32260 Utilities that process regular expressions shall support Basic 32261 Regular Expressions and Extended Regular Expressions as 32262 specified in ISO POSIX (2003), with the following exceptions: 32263 32264 Range expression (such as [a-z]) can be based on code point 32265 order instead of collating element order. 32266 32267 Equivalence class expression (such as [=a=]) and 32268 multi-character collating element expression (such as [.ch.]) 32269 are optional. 32270 32271 Handling of a multi-character collating element is optional. 32272 32273 This affects at least the following utilities: 32274 32275 * awk (see awk) 32276 * grep (see grep) (including egrep , see egrep) 32277 * sed (see sed) 32278 32279 It also affects the behavior of interfaces in the base 32280 libraries, including at least 32281 32282 * regexec() (see regexec) 32283 __________________________________________________________ 32284 32285 19.3. Pattern Matching Notation 32286 32287 Utilities that perform filename pattern matching (also known as 32288 Filename Globbing) shall do it as specified in ISO POSIX 32289 (2003), Pattern Matching Notation, with the following 32290 exceptions: 32291 32292 Pattern bracket expressions (such as [a-z]) can be based on 32293 code point order instead of collating element order. 32294 32295 Equivalence class expression (such as [=a=]) and 32296 multi-character collating element expression (such as [.ch.]) 32297 are optional. 32298 32299 Handling of a multi-character collating element is optional. 32300 32301 This affects at least the following utilities: cpio (cpio), 32302 find and tar (tar). 32303 32304 VII. System Initialization 32305 32306 Table of Contents 32307 20. System Initialization 32308 32309 20.1. Cron Jobs 32310 20.2. Init Script Actions 32311 20.3. Comment Conventions for Init Scripts 32312 20.4. Installation and Removal of Init Scripts 32313 20.5. Run Levels 32314 20.6. Facility Names 32315 20.7. Script Names 32316 20.8. Init Script Functions 32317 __________________________________________________________ 32318 32319 Chapter 20. System Initialization 32320 32321 20.1. Cron Jobs 32322 32323 In addition to the individual user crontab files specified by 32324 ISO POSIX (2003), which are located in /var/spool/cron as 32325 specified by the Filesystem Hierarchy Standard (FHS), the 32326 process that executes scheduled commands shall also process the 32327 following additional crontab files, which are in a different 32328 format (see below). /etc/crontab, /etc/cron.d/*. The 32329 installation of a package shall not modify the crontab file 32330 /etc/crontab, and shall not directly modify the user crontab 32331 files in /var/spool/cron/crontabs. but may use the crontab 32332 command to modify the latter. 32333 32334 If a package wishes to install a job that has to be executed 32335 periodically, it shall place an executable cron script in one 32336 of the following directories: 32337 32338 /etc/cron.hourly 32339 /etc/cron.daily 32340 /etc/cron.weekly 32341 /etc/cron.monthly 32342 32343 As these directory names suggest, the files within them are 32344 executed on a hourly, daily, weekly, or monthly basis, 32345 respectively, under the control of an entry in one of the 32346 system crontab files, at an unspecified time of day. See below 32347 for the rules concerning the names of cron scripts. 32348 32349 Note: It is recommended that cron scripts installed in any 32350 of these directories be script files rather than compiled 32351 binaries so that they may be modified by the local system 32352 administrator. Conforming applications may only install cron 32353 scripts which use an interpreter required by this 32354 specification or provided by this or another conforming 32355 application. 32356 32357 This specification does not define the concept of a package 32358 upgrade. Implementations may do different things when 32359 packages are upgraded, including not replacing a cron script 32360 if it marked as a configuration file, particularly if the 32361 cron script appears to have been modified since 32362 installation. In some circumstances, the cron script may not 32363 be removed when the package is uninstalled. Applications 32364 should design their installation procedure and cron scripts 32365 to be robust in the face of such behavior. In particular, 32366 cron scripts should not fail obscurely if run in unexpected 32367 circumstances. Testing for the existence of application 32368 binaries before executing them is suggested. 32369 32370 Future versions of this specification may remove the need to 32371 install file directly into these directories, and instead 32372 abstract the interface to the cron utility in such a way as 32373 to hide the implementation. Please see Future Directions. 32374 32375 If a certain task has to be executed at other than the 32376 predefined frequencies, the package shall install a file 32377 /etc/cron.d/cron-name. The file shall have the same format as 32378 that described for the crontab command in ISO POSIX (2003), 32379 except that there shall be an additional field, username, 32380 before the name of the command to execute. For completeness, 32381 the seven fields shall be: 32382 32383 1. Minute [0,59] 32384 2. Hour [0,23] 32385 3. Day of the month [1,31] 32386 4. Month of the year [1,12] 32387 5. Day of the week [0,6] (with 0=Sunday) 32388 6. Username 32389 7. command [args ...] 32390 32391 This file shall be processed by the system automatically, with 32392 the named command being run at the specified time, as the 32393 specified username. 32394 32395 Applications installing files in these directories shall use 32396 the LSB naming conventions (see File Naming Conventions). 32397 __________________________________________________________ 32398 32399 20.2. Init Script Actions 32400 32401 Conforming applications which need to execute commands on 32402 changes to the system run level (including boot and shutdown), 32403 may install one or more init scripts. Init scripts provided by 32404 conforming applications shall accept a single argument which 32405 selects the action: 32406 32407 start start the service 32408 stop stop the service 32409 restart stop and restart the service if the service is already 32410 running, otherwise start the service 32411 try-restart restart the service if the service is already 32412 running 32413 reload cause the configuration of the service to be reloaded 32414 without actually stopping and restarting the service 32415 force-reload cause the configuration to be reloaded if the 32416 service supports this, otherwise restart the service if it is 32417 running 32418 status print the current status of the service 32419 32420 The start, stop, restart, force-reload, and status actions 32421 shall be supported by all init scripts; the reload and the 32422 try-restart actions are optional. Other init-script actions may 32423 be defined by the init script. 32424 32425 Init scripts shall ensure that they will behave sensibly if 32426 invoked with start when the service is already running, or with 32427 stop when not running, and that they do not kill 32428 similarly-named user processes. The best way to achieve this is 32429 to use the init-script functions provided by 32430 /lib/lsb/init-functions (see Init Script Functions) 32431 32432 If a service reloads its configuration automatically (as in the 32433 case of cron, for example), the reload action of the init 32434 script shall behave as if the configuration was reloaded 32435 successfully. The restart, try-restart, reload and force-reload 32436 actions may be atomic; that is if a service is known not to be 32437 operational after a restart or reload, the script may return an 32438 error without any further action. 32439 32440 Note: This specification does not define the concept of a 32441 package upgrade. Implementations may do different things 32442 when packages are upgraded, including not replacing an init 32443 script if it is marked as a configuration file, particularly 32444 if the file appears to have been modified since 32445 installation. In some circumstances, the init script may not 32446 be removed when the package is uninstalled. Applications 32447 should design their installation procedure and init scripts 32448 to be robust in the face of such behavior. In particular, 32449 init scripts should not fail obscurely if run in unexpected 32450 circumstances. Testing for the existence of application 32451 binaries before executing them is suggested. 32452 32453 If the status action is requested, the init script will return 32454 the following exit status codes. 32455 32456 0 program is running or service is OK 32457 1 program is dead and /var/run pid file exists 32458 2 program is dead and /var/lock lock file exists 32459 3 program is not running 32460 4 program or service status is unknown 32461 5-99 reserved for future LSB use 32462 100-149 reserved for distribution use 32463 150-199 reserved for application use 32464 200-254 reserved 32465 32466 For all other init-script actions, the init script shall return 32467 an exit status of zero if the action was successful. Otherwise, 32468 the exit status shall be non-zero, as defined below. In 32469 addition to straightforward success, the following situations 32470 are also to be considered successful: 32471 32472 * restarting a service (instead of reloading it) with the 32473 force-reload argument 32474 * running start on a service already running 32475 * running stop on a service already stopped or not running 32476 * running restart on a service already stopped or not running 32477 * running try-restart on a service already stopped or not 32478 running 32479 32480 In case of an error while processing any init-script action 32481 except for status, the init script shall print an error message 32482 and exit with a non-zero status code: 32483 32484 1 generic or unspecified error (current practice) 32485 2 invalid or excess argument(s) 32486 3 unimplemented feature (for example, "reload") 32487 4 user had insufficient privilege 32488 5 program is not installed 32489 6 program is not configured 32490 7 program is not running 32491 8-99 reserved for future LSB use 32492 100-149 reserved for distribution use 32493 150-199 reserved for application use 32494 200-254 reserved 32495 32496 Error and status messages should be printed with the logging 32497 functions (see Init Script Functions) log_success_msg(), 32498 log_failure_msg() and log_warning_msg(). Scripts may write to 32499 standard error or standard output, but implementations need not 32500 present text written to standard error/output to the user or do 32501 anything else with it. 32502 32503 Note: Since init scripts may be run manually by a system 32504 administrator with non-standard environment variable values 32505 for PATH, USER, LOGNAME, etc., init scripts should not 32506 depend on the values of these environment variables. They 32507 should set them to some known/default values if they are 32508 needed. 32509 __________________________________________________________ 32510 32511 20.3. Comment Conventions for Init Scripts 32512 32513 Conforming applications may install one or more init scripts. 32514 These init scripts must be activated by invoking the 32515 install_initd command. Prior to package removal, the changes 32516 applied by install_initd must be undone by invoking 32517 remove_initd. See Installation and Removal of Init Scripts for 32518 more details. 32519 32520 install_initd and remove_initd determine actions to take by 32521 decoding a specially formatted block of lines in the script. 32522 This block shall be delimited by the lines 32523 ### BEGIN INIT INFO 32524 ### END INIT INFO 32525 32526 The delimiter lines may contain trailing whitespace, which 32527 shall be ignored. All lines inside the block shall begin with a 32528 hash character '#' in the first column, so the shell interprets 32529 them as comment lines which do not affect operation of the 32530 script. The lines shall be of the form: 32531 # {keyword}: arg1 [arg2...] 32532 32533 with exactly one space character between the '#' and the 32534 keyword, with a single exception. In lines following a line 32535 containing the Description keyword, and until the next keyword 32536 or block ending delimiter is seen, a line where the '#' is 32537 followed by more than one space or a tab character shall be 32538 treated as a continuation of the previous line. 32539 32540 The information extracted from the block is used by the 32541 installation tool or the init-script system to assure that init 32542 scripts are run in the correct order. It is unspecified whether 32543 the information is evaluated only when install_initd runs, when 32544 the init scripts are executed, or both. The information 32545 extracted includes run levels, defined in Run Levels, and boot 32546 facilities, defined in Facility Names. 32547 32548 The following keywords, with their arguments, are defined: 32549 32550 Provides: boot_facility_1 [boot_facility_2...] 32551 boot facilities provided by this init script. When an 32552 init script is run with a start argument, the boot 32553 facility or facilities specified by the Provides keyword 32554 shall be deemed present and hence init scripts which 32555 require those boot facilities should be started later. 32556 When an init script is run with a stop argument, the 32557 boot facilities specified by the Provides keyword are 32558 deemed no longer present. 32559 32560 Required-Start: boot_facility_1 [boot_facility_2...] 32561 facilities which must be available during startup of 32562 this service. The init-script system should insure init 32563 scripts which provide the Required-Start facilities are 32564 started before starting this script. 32565 32566 Required-Stop: boot_facility_1 [boot_facility_2...] 32567 facilities which must be available during the shutdown 32568 of this service. The init-script system should avoid 32569 stopping init scripts which provide the Required-Stop 32570 facilities until this script is stopped. 32571 32572 Should-Start: boot_facility_1 [boot_facility_2...] 32573 facilities which, if present, should be available during 32574 startup of this service. This allows for weak 32575 dependencies which do not cause the service to fail if a 32576 facility is not available. The service may provide 32577 reduced functionality in this situation. Conforming 32578 applications should not rely on the existence of this 32579 feature. 32580 32581 Should-Stop: boot_facility_1 [boot_facility_2...] 32582 facilities which should be available during shutdown of 32583 this service. 32584 32585 Default-Start: run_level_1 [run_level_2...], Default-Stop: 32586 run_level_1 [run_level_2...] 32587 which run levels should by default run the init script 32588 with a start (stop) argument to start (stop) the 32589 services controlled by the init script. 32590 32591 For example, if a service should run in runlevels 3, 4, 32592 and 5 only, specify "Default-Start: 3 4 5" and 32593 "Default-Stop: 0 1 2 6". 32594 32595 Short-Description: short_description 32596 provide a brief description of the actions of the init 32597 script. Limited to a single line of text. 32598 32599 Description: multiline_description 32600 provide a more complete description of the actions of 32601 the init script. May span mulitple lines. In a multiline 32602 description, each continuation line shall begin with a 32603 '#' followed by tab character or a '#' followed by at 32604 least two space characters. The multiline description is 32605 terminated by the first line that does not match this 32606 criteria. 32607 32608 Additional keywords may be defined in future versions of this 32609 specification. Also, implementations may define local 32610 extensions by using the prefix X-implementor. For example, 32611 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 32612 32613 Example: 32614 32615 ### BEGIN INIT INFO 32616 # Provides: lsb-ourdb 32617 # Required-Start: $local_fs $network $remote_fs 32618 # Required-Stop: $local_fs $network $remote_fs 32619 # Default-Start: 2 3 4 5 32620 # Default-Stop: 0 1 6 32621 # Short-Description: start and stop OurDB 32622 # Description: OurDB is a very fast and reliable database 32623 # engine used for illustrating init scripts 32624 ### END INIT INFO 32625 32626 The comment conventions described in this section are only 32627 required for init scripts installed by conforming applications. 32628 Conforming runtime implementations are not required to use this 32629 scheme in their system provided init scripts. 32630 32631 Note: This specification does not require, but is designed 32632 to allow, the development of a system which runs init 32633 scripts in parallel. Hence, enforced-serialization of 32634 scripts is avoided unless it is explicitly necessary. 32635 __________________________________________________________ 32636 32637 20.4. Installation and Removal of Init Scripts 32638 32639 Conforming applications may install one or more initialization 32640 scripts (or init scripts). An init script shall be installed in 32641 /etc/init.d (which may be a symbolic link to another location), 32642 by the package installer. 32643 32644 Note: The requirement to install scripts in /etc/init.d may 32645 be removed in future versions of this specification. See 32646 Host-specific system configuration and Future Directions for 32647 further details. 32648 32649 During the installer's post-install processing phase the 32650 program /usr/lib/lsb/install_initd must be called to activate 32651 the init script. Activation consists of arranging for the init 32652 script to be called in the correct order on system run-level 32653 changes (including system boot and shutdown), based on 32654 dependencies supplied in the init script (see Comment 32655 Conventions for Init Scripts). The install_initd command should 32656 be thought of as a wrapper which hides the implementation 32657 details; how any given implementation arranges for the init 32658 script to be called at the appropriate time is not specified. 32659 32660 Example: if an init script specified "Default-Start: 3 4 5" 32661 and "Default-Stop: 0 1 2 6", install_initd might create 32662 "start" symbolic links with names starting with 'S' in 32663 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 32664 links with names starting with 'K' in /etc/rc0.d, 32665 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 32666 be similar to the System V Init mechanism, but is by no 32667 means the only way this specification could be implemented. 32668 32669 The install_initd command takes a single argument, the full 32670 pathname of the installed init script. The init script must 32671 already be installed in /etc/init.d. The install_initd command 32672 will not copy it there, only activate it once it has been 32673 installed. For example: 32674 32675 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 32676 32677 The install_initd command shall return an exit status of zero 32678 if the init-script activation was successful or if the init 32679 script was already activated. If the dependencies in the init 32680 script (see Comment Conventions for Init Scripts) cannot be 32681 met, an exit status of one shall be returned and the init 32682 script shall not be activated. 32683 32684 When a software package is removed, /usr/lib/lsb/remove_initd 32685 must be called to deactivate the init script. This must occur 32686 before the init script itself is removed, as the dependency 32687 information in the script may be required for successful 32688 completion. Thus the installer's pre-remove processing phase 32689 must call remove_initd, and pass the full pathname of the 32690 installed init script. The package installer is still 32691 responsible for removing the init script. For example: 32692 32693 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 32694 32695 The remove_initd program shall return an exit status of zero if 32696 the init script has been successfully deactivated or if the 32697 init script is not activated. If another init script which 32698 depends on a boot facility provided by this init script is 32699 activated, an exit status of one shall be returned and the init 32700 script shall remain activated. The installer must fail on such 32701 an exit code so it does not subsequently remove the init 32702 script. 32703 32704 Note: This specification does not describe a mechanism for 32705 the system administrator to manipulate the run levels at 32706 which an init script is started or stopped. There is no 32707 assurance that modifying the comment block for this purpose 32708 will have the desired effect. 32709 __________________________________________________________ 32710 32711 20.5. Run Levels 32712 32713 The following run levels are specified for use by the 32714 Default-Start and Default-Stop actions defined in Comment 32715 Conventions for Init Scripts as hints to the install_initd 32716 command. Conforming implementations are not required to provide 32717 these exact run levels or give them the meanings described 32718 here, and may map any level described here to a different level 32719 which provides the equivalent functionality. Applications may 32720 not depend on specific run-level numbers. 32721 32722 0 halt 32723 1 single user mode 32724 2 multiuser with no network services exported 32725 3 normal/full multiuser 32726 4 reserved for local use, default is normal/full multiuser 32727 5 multiuser with a display manager or equivalent 32728 6 reboot 32729 32730 Note: These run levels were chosen as reflecting the most 32731 frequent existing practice, and in the absence of other 32732 considerations, implementors are strongly encouraged to 32733 follow this convention to provide consistency for system 32734 administrators who need to work with multiple distributions. 32735 __________________________________________________________ 32736 32737 20.6. Facility Names 32738 32739 Boot facilities are used to indicate dependencies in 32740 initialization scripts, as defined in Comment Conventions for 32741 Init Scripts. Facility names are assigned to scripts by the 32742 Provides: keyword. Facility names that begin with a dollar sign 32743 ('$') are reserved system facility names. 32744 32745 Note: Facility names are only recognized in the context of 32746 the init script comment block and are not available in the 32747 body of the init script. In particular, the use of the 32748 leading '$' character does not imply system facility names 32749 are subject to shell variable expansion, since they appear 32750 inside comments. 32751 32752 Conforming applications shall not provide facilities that begin 32753 with a dollar sign. Implementations shall provide the following 32754 facility names: 32755 32756 $local_fs 32757 32758 all local file systems are mounted 32759 $network 32760 32761 basic networking support is available. Example: a server 32762 program could listen on a socket. 32763 $named 32764 32765 IP name-to-address translation, using the interfaces described 32766 in this specification, are available to the level the system 32767 normally provides them. Example: if a DNS query daemon normally 32768 provides this facility, then that daemon has been started. 32769 $portmap 32770 32771 daemons providing SunRPC/ONCRPC portmapping service as defined 32772 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 32773 present) are running. 32774 $remote_fs 32775 32776 all remote file systems are available. In some configurations, 32777 file systems such as /usr may be remote. Many applications that 32778 require $local_fs will probably also require $remote_fs. 32779 $syslog 32780 32781 system logger is operational. 32782 $time 32783 32784 the system time has been set, for example by using a 32785 network-based time program such as ntp or rdate, or via the 32786 hardware Real Time Clock. 32787 32788 Other (non-system) facilities may be defined by other 32789 conforming applications. These facilities shall be named using 32790 the same conventions defined for naming init scripts (see 32791 Script Names). Commonly, the facility provided by a conforming 32792 init script will have the same name as the name assigned to the 32793 init script. 32794 __________________________________________________________ 32795 32796 20.7. Script Names 32797 32798 Since init scripts live in a single directory, they must share 32799 a single namespace. To avoid conflicts, applications installing 32800 files in this directories shall use the LSB naming conventions 32801 (see File Naming Conventions). 32802 __________________________________________________________ 32803 32804 20.8. Init Script Functions 32805 32806 Each conforming init script shall execute the commands in the 32807 file /lib/lsb/init-functions in the current environment (see 32808 shell special built-in command dot). This file shall cause the 32809 following shell script commands to be defined in an unspecified 32810 manner. 32811 32812 Note: This can be done either by adding a directory to the 32813 PATH variable which defines these commands, or by defining 32814 shell aliases or functions. 32815 32816 Although the commands made available via this mechanism need 32817 not be conforming applications in their own right, 32818 applications that use them should only depend on features 32819 described in this specification. 32820 32821 Conforming scripts shall not specify the "exit on error" option 32822 (i.e. set -e) when sourcing this file, or calling any of the 32823 commands thus made available. 32824 32825 The start_daemon, killproc and pidofproc functions shall use 32826 the following algorithm for determining the status and the 32827 process identifiers of the specified program. 32828 32829 1. If the -p pidfile option is specified, and the named 32830 pidfile exists, a single line at the start of the pidfile 32831 shall be read. If this line contains one or more numeric 32832 values, separated by spaces, these values shall be used. If 32833 the -p pidfile option is specified and the named pidfile 32834 does not exist, the functions shall assume that the daemon 32835 is not running. 32836 2. Otherwise, /var/run/basename.pid shall be read in a similar 32837 fashion. If this contains one or more numeric values on the 32838 first line, these values shall be used. Optionally, 32839 implementations may use unspecified additional methods to 32840 locate the process identifiers required. 32841 32842 The method used to determine the status is implementation 32843 defined, but should allow for non-binary programs. 32844 32845 Note: Commonly used methods check either for the existence 32846 of the /proc/pid directory or use /proc/pid/exe and 32847 /proc/pid/cmdline. Relying only on /proc/pid/exe is 32848 discouraged since this specification does not specify the 32849 existence of, or semantics for, /proc. Additionally, using 32850 /proc/pid/exe may result in a not-running status for daemons 32851 that are written in a script language. 32852 32853 Conforming implementations may use other mechanisms besides 32854 those based on pidfiles, unless the -p pidfile option has been 32855 used. Conforming applications should not rely on such 32856 mechanisms and should always use a pidfile. When a program is 32857 stopped, it should delete its pidfile. Multiple process 32858 identifiers shall be separated by a single space in the pidfile 32859 and in the output of pidofproc. 32860 32861 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 32862 [args...] 32863 runs the specified program as a daemon. The start_daemon 32864 function shall check if the program is already running 32865 using the algorithm given above. If so, it shall not 32866 start another copy of the daemon unless the -f option is 32867 given. The -n option specifies a nice level. See nice. 32868 start_daemon shall return the LSB defined exit status 32869 codes. It shall return 0 if the program has been 32870 successfully started or is running and not 0 otherwise. 32871 32872 killproc [-p pidfile] pathname [signal] 32873 The killproc function shall stop the specified program. 32874 The program is found using the algorithm given above. If 32875 a signal is specified, using the -signal_name or 32876 -signal_number syntaxes as specified by the kill 32877 command, the program is sent that signal. Otherwise, a 32878 SIGTERM followed by a SIGKILL after an unspecified 32879 number of seconds shall be sent. If a program has been 32880 terminated, the pidfile should be removed if the 32881 terminated process has not already done so. The killproc 32882 function shall return the LSB defined exit status codes. 32883 If called without a signal, it shall return 0 if the 32884 program has been stopped or is not running and not 0 32885 otherwise. If a signal is given, it shall return 0 only 32886 if the program is running. 32887 32888 pidofproc [-p pidfile] pathname 32889 The pidofproc function shall return one or more process 32890 identifiers for a particular daemon using the algorithm 32891 given above. Only process identifiers of running 32892 processes should be returned. Multiple process 32893 identifiers shall be separated by a single space. 32894 32895 Note: A process may exit between pidofproc discovering its 32896 identity and the caller of pidofproc being able to act on 32897 that identity. As a result, no test assertion can be made 32898 that the process identifiers returned by pidofproc shall be 32899 running processes. 32900 32901 The pidofproc function shall return the LSB defined exit 32902 status codes for "status". It shall return 0 if the 32903 program is running and not 0 otherwise. 32904 32905 log_success_msg message 32906 The log_success_msg function shall cause the system to 32907 write a success message to an unspecified log file. The 32908 format of the message is unspecified. The 32909 log_success_msg function may also write a message to the 32910 standard output. 32911 32912 Note: The message should be relatively short; no more than 32913 60 characters is highly desirable. 32914 32915 log_failure_msg message 32916 The log_failure_msg function shall cause the system to 32917 write a failure message to an unspecified log file. The 32918 format of the message is unspecified. The 32919 log_failure_msg function may also write a message to the 32920 standard output. 32921 32922 Note: The message should be relatively short; no more than 32923 60 characters is highly desirable. 32924 32925 log_warning_msg message 32926 The log_warning_msg function shall cause the system to 32927 write a warning message to an unspecified log file. The 32928 format of the message is unspecified. The 32929 log_warning_msg function may also write a message to the 32930 standard output. 32931 32932 Note: The message should be relatively short; no more than 32933 60 characters is highly desirable. 32934 32935 VIII. Users & Groups 32936 32937 Table of Contents 32938 21. Users & Groups 32939 32940 21.1. User and Group Database 32941 21.2. User & Group Names 32942 21.3. User ID Ranges 32943 21.4. Rationale 32944 __________________________________________________________ 32945 32946 Chapter 21. Users & Groups 32947 32948 21.1. User and Group Database 32949 32950 The format of the User and Group databases is not specified. 32951 Programs may only read these databases using the provided API. 32952 Changes to these databases should be made using the provided 32953 commands. 32954 __________________________________________________________ 32955 32956 21.2. User & Group Names 32957 32958 Table 21-1 describes required mnemonic user and group names. 32959 This specification makes no attempt to numerically assign user 32960 or group identity numbers, with the exception that both the 32961 User ID and Group ID for the user root shall be equal to 0. 32962 32963 Table 21-1. Required User & Group Names 32964 User Group Comments 32965 root root Administrative user with all appropriate privileges 32966 bin bin Legacy User ID/Group ID[a] 32967 daemon daemon Legacy User ID/Group ID[b] 32968 Notes: 32969 a. The bin User ID/Group ID is included for compatibility with 32970 legacy applications. New applications should no longer use the 32971 bin User ID/Group ID. 32972 b. The daemon User ID/Group ID was used as an unprivileged User 32973 ID/Group ID for daemons to execute under in order to limit 32974 their access to the system. Generally daemons should now run 32975 under individual User ID/Group IDs in order to further 32976 partition daemons from one another. 32977 32978 Table 21-2 is a table of optional mnemonic user and group 32979 names. This specification makes no attempt to numerically 32980 assign uid or gid numbers. If the username exists on a system, 32981 then they should be in the suggested corresponding group. These 32982 user and group names are for use by distributions, not by 32983 applications. 32984 32985 Table 21-2. Optional User & Group Names 32986 User Group Comments 32987 adm adm Administrative special privileges 32988 lp lp Printer special privileges 32989 sync sync Login to sync the system 32990 shutdown shutdown Login to shutdown the system 32991 halt halt Login to halt the system 32992 mail mail Mail special privileges 32993 news news News special privileges 32994 uucp uucp UUCP special privileges 32995 operator root Operator special privileges 32996 man man Man special privileges 32997 nobody nobody Used by NFS 32998 32999 Only a minimum working set of "user names" and their 33000 corresponding "user groups" are required. Applications cannot 33001 assume non system user or group names will be defined. 33002 33003 Applications cannot assume any policy for the default file 33004 creation mask (umask) or the default directory permissions a 33005 user may have. Applications should enforce user only file 33006 permissions on private files such as mailboxes. The location of 33007 the users home directory is also not defined by policy other 33008 than the recommendations of the Filesystem Hierarchy Standard 33009 and should be obtained by the getpwnam(), getpwnam_r(), 33010 getpwent(), getpwuid(), and getpwuid_r() functions. 33011 __________________________________________________________ 33012 33013 21.3. User ID Ranges 33014 33015 The system User IDs from 0 to 99 should be statically allocated 33016 by the system, and shall not be created by applications. 33017 33018 The system User IDs from 100 to 499 should be reserved for 33019 dynamic allocation by system administrators and post install 33020 scripts using useradd. 33021 __________________________________________________________ 33022 33023 21.4. Rationale 33024 33025 The purpose of specifying optional users and groups is to 33026 reduce the potential for name conflicts between applications 33027 and distributions. 33028 33029 IX. Package Format and Installation 33030 33031 Table of Contents 33032 22. Software Installation 33033 33034 22.1. Introduction 33035 22.2. Package File Format 33036 33037 22.2.1. Lead Section 33038 22.2.2. Header Structure 33039 22.2.3. Signature Section 33040 22.2.4. Header Section 33041 22.2.5. Payload Section 33042 33043 22.3. Package Script Restrictions 33044 22.4. Package Tools 33045 22.5. Package Naming 33046 22.6. Package Dependencies 33047 22.7. Package Architecture Considerations 33048 __________________________________________________________ 33049 33050 Chapter 22. Software Installation 33051 33052 22.1. Introduction 33053 33054 Applications shall either be packaged in the RPM packaging 33055 format as defined in this specification, or supply an installer 33056 which is LSB conforming (for example, calls LSB commands and 33057 utilities). 33058 33059 Note: Supplying an RPM format package is encouraged because 33060 it makes systems easier to manage. This specification does 33061 not require the implementation to use RPM as the package 33062 manager; it only specifies the format of the package file. 33063 33064 Applications are also encouraged to uninstall cleanly. 33065 33066 A package in RPM format may include a dependency on the LSB 33067 Core and other LSB specifications, as described in Section 33068 22.6. Packages that are not in RPM format may test for the 33069 presence of a conforming implementation by means of the 33070 lsb_release utility. 33071 33072 Implementations shall provide a mechanism for installing 33073 applications in this packaging format with some restrictions 33074 listed below. 33075 33076 Note: The implementation itself may use a different 33077 packaging format for its own packages, and of course it may 33078 use any available mechanism for installing the 33079 LSB-conformant packages. 33080 __________________________________________________________ 33081 33082 22.2. Package File Format 33083 33084 An RPM format file consists of 4 sections, the Lead, Signature, 33085 Header, and the Payload. All values are stored in network byte 33086 order. 33087 33088 Table 22-1. RPM File Format 33089 Lead 33090 Signature 33091 Header 33092 Payload 33093 33094 These 4 sections shall exist in the order specified. 33095 33096 The lead section is used to identify the package file. 33097 33098 The signature section is used to verify the integrity, and 33099 optionally, the authenticity of the majority of the package 33100 file. 33101 33102 The header section contains all available information about the 33103 package. Entries such as the package's name, version, and file 33104 list, are contained in the header. 33105 33106 The payload section holds the files to be installed. 33107 __________________________________________________________ 33108 33109 22.2.1. Lead Section 33110 33111 struct rpmlead { 33112 unsigned char magic[4]; 33113 unsigned char major, minor; 33114 short type; 33115 short archnum; 33116 char name[66]; 33117 short osnum; 33118 short signature_type; 33119 char reserved[16]; 33120 } ; 33121 33122 magic 33123 33124 Value identifying this file as an RPM format file. This value 33125 shall be "\355\253\356\333". 33126 major 33127 33128 Value indicating the major version number of the file format 33129 version. This value shall be 3. 33130 minor 33131 33132 Value indicating the minor revision number of file format 33133 version. This value shall be 0. 33134 type 33135 33136 Value indicating whether this is a source or binary package. 33137 This value shall be 0 to indicate a binary package. 33138 archnum 33139 33140 Value indicating the architecture for which this package is 33141 valid. This value is specified in the relevant architecture 33142 specific part of ISO/IEC 23360. 33143 name 33144 33145 A NUL terminated string that provides the package name. This 33146 name shall conform with the Package Naming section of this 33147 specification. 33148 osnum 33149 33150 Value indicating the Operating System for which this package is 33151 valid. This value shall be 1. 33152 signature_type 33153 33154 Value indicating the type of the signature used in the 33155 Signature part of the file. This value shall be 5. 33156 reserved 33157 33158 Reserved space. The value is undefined. 33159 __________________________________________________________ 33160 33161 22.2.2. Header Structure 33162 33163 The Header structure is used for both the Signature and Header 33164 Sections. A Header Structure consists of 3 parts, a Header 33165 record, followed by 1 or more Index records, followed by 0 or 33166 more bytes of data associated with the Index records. A Header 33167 structure shall be aligned to an 8 byte boundary. 33168 33169 Table 22-2. Signature Format 33170 Header Record 33171 Array of Index Records 33172 Store of Index Values 33173 __________________________________________________________ 33174 33175 22.2.2.1. Header Record 33176 33177 struct rpmheader { 33178 unsigned char magic[4]; 33179 unsigned char reserved[4]; 33180 int nindex; 33181 int hsize; 33182 } ; 33183 33184 magic 33185 33186 Value identifying this record as an RPM header record. This 33187 value shall be "\216\255\350\001". 33188 reserved 33189 33190 Reserved space. This value shall be "\000\000\000\000". 33191 nindex 33192 33193 The number of Index Records that follow this Header Record. 33194 There should be at least 1 Index Record. 33195 hsize 33196 33197 The size in bytes of the storage area for the data pointed to 33198 by the Index Records. 33199 __________________________________________________________ 33200 33201 22.2.2.2. Index Record 33202 33203 struct rpmhdrindex { 33204 int tag; 33205 int type; 33206 int offset; 33207 int count; 33208 } ; 33209 33210 tag 33211 33212 Value identifying the purpose of the data associated with this 33213 Index Record. The value of this field is dependent on the 33214 context in which the Index Record is used, and is defined below 33215 and in later sections. 33216 type 33217 33218 Value identifying the type of the data associated with this 33219 Index Record. The possible type values are defined below. 33220 offset 33221 33222 Location in the Store of the data associated with this Index 33223 Record. This value should between 0 and the value contained in 33224 the hsize of the Header Structure. 33225 count 33226 33227 Size of the data associated with this Index Record. The count 33228 is the number of elements whose size is defined by the type of 33229 this Record. 33230 __________________________________________________________ 33231 33232 22.2.2.2.1. Index Type Values 33233 33234 The possible values for the type field are defined in this 33235 table. 33236 33237 Table 22-3. Index Type values 33238 Type Value Size (in bytes) Alignment 33239 RPM_NULL_TYPE 0 Not Implemented. 33240 RPM_CHAR_TYPE 1 1 1 33241 RPM_INT8_TYPE 2 1 1 33242 RPM_INT16_TYPE 3 2 2 33243 RPM_INT32_TYPE 4 4 4 33244 RPM_INT64_TYPE 5 Reserved. 33245 RPM_STRING_TYPE 6 variable, NUL terminated 1 33246 RPM_BIN_TYPE 7 1 1 33247 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 33248 strings 1 33249 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 33250 strings 1 33251 33252 The string arrays specified for entries of type 33253 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 33254 strings in a contiguous block of memory, each element separated 33255 from its neighbors by a NUL character. 33256 33257 Index records with type RPM_I18NSTRING_TYPE shall always have a 33258 count of 1. The array entries in an index of type 33259 RPM_I18NSTRING_TYPE correspond to the locale names contained in 33260 the RPMTAG_HDRI18NTABLE index. 33261 __________________________________________________________ 33262 33263 22.2.2.2.2. Index Tag Values 33264 33265 Some values are designated as header private, and may appear in 33266 any header structure. These are defined here. Additional values 33267 are defined in later sections. 33268 33269 Table 22-4. Header Private Tag Values 33270 Name Tag Value Type Count Status 33271 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 33272 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 33273 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Optional 33274 33275 RPMTAG_HEADERSIGNATURES 33276 The signature tag differentiates a signature header from 33277 a metadata header, and identifies the original contents 33278 of the signature header. 33279 33280 RPMTAG_HEADERIMMUTABLE 33281 This tag contains an index record which specifies the 33282 portion of the Header Record which was used for the 33283 calculation of a signature. This data shall be preserved 33284 or any header-only signature will be invalidated. 33285 33286 RPMTAG_HEADERI18NTABLE 33287 Contains a list of locales for which strings are 33288 provided in other parts of the package. 33289 33290 Not all Index records defined here will be present in all 33291 packages. Each tag value has a status which is defined here. 33292 33293 Required 33294 33295 This Index Record shall be present. 33296 Optional 33297 33298 This Index Record may be present. 33299 Informational 33300 33301 This Index Record may be present, but does not contribute to 33302 the processing of the package. 33303 Deprecated 33304 33305 This Index Record should not be present. 33306 Obsolete 33307 33308 This Index Record shall not be present. 33309 Reserved 33310 33311 This Index Record shall not be present. 33312 __________________________________________________________ 33313 33314 22.2.2.3. Header Store 33315 33316 The header store contains the values specified by the Index 33317 structures. These values are aligned according to their type 33318 and padding is used if needed. The store is located immediately 33319 following the Index structures. 33320 __________________________________________________________ 33321 33322 22.2.3. Signature Section 33323 33324 The Signature section is implemented using the Header 33325 structure. The signature section defines the following 33326 additional tag values which may be used in the Index 33327 structures. 33328 33329 These values exist to provide additional information about the 33330 rest of the package. 33331 33332 Table 22-5. Signature Tag Values 33333 Name Tag Value Type Count Status 33334 RPMSIGTAG_SIZE 1000 INT32 1 Required 33335 RPMSIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 33336 33337 RPMSIGTAG_SIZE 33338 This tag specifies the combined size of the Header and 33339 Payload sections. 33340 33341 RPMSIGTAG_PAYLOADSIZE 33342 This tag specifies the uncompressed size of the Payload 33343 archive, including the cpio headers. 33344 33345 These values exist to ensure the integrity of the rest of the 33346 package. 33347 33348 Table 22-6. Signature Digest Tag Values 33349 Name Tag Value Type Count Status 33350 RPMSIGTAG_SHA1 269 STRING 1 Optional 33351 RPMSIGTAG_MD5 1004 BIN 16 Required 33352 33353 RPMSIGTAG_SHA1 33354 33355 This index contains the SHA1 checksum of the entire Header 33356 Section, including the Header Record, Index Records and Header 33357 store. 33358 RPMSIGTAG_MD5 33359 33360 This tag specifies the 128-bit MD5 checksum of the combined 33361 Header and Archive sections. 33362 33363 These values exist to provide authentication of the package. 33364 33365 Table 22-7. Signature Signing Tag Values 33366 Name Tag Value Type Count Status 33367 RPMSIGTAG_DSA 267 BIN 65 Optional 33368 RPMSIGTAG_RSA 268 BIN 1 Optional 33369 RPMSIGTAG_PGP 1002 BIN 1 Optional 33370 RPMSIGTAG_GPG 1005 BIN 65 Optional 33371 33372 RPMSIGTAG_DSA 33373 33374 The tag contains the DSA signature of the Header section. The 33375 data is formatted as a Version 3 Signature Packet as specified 33376 in RFC 2440: OpenPGP Message Format. If this tag is present, 33377 then the SIGTAG_GPG tag shall also be present. 33378 RPMSIGTAG_RSA 33379 33380 The tag contains the RSA signature of the Header section.The 33381 data is formatted as a Version 3 Signature Packet as specified 33382 in RFC 2440: OpenPGP Message Format. If this tag is present, 33383 then the SIGTAG_PGP shall also be present. 33384 RPMSIGTAG_PGP 33385 33386 This tag specifies the RSA signature of the combined Header and 33387 Payload sections. The data is formatted as a Version 3 33388 Signature Packet as specified in RFC 2440: OpenPGP Message 33389 Format. 33390 RPMSIGTAG_GPG 33391 33392 The tag contains the DSA signature of the combined Header and 33393 Payload sections. The data is formatted as a Version 3 33394 Signature Packet as specified in RFC 2440: OpenPGP Message 33395 Format. 33396 __________________________________________________________ 33397 33398 22.2.4. Header Section 33399 33400 The Header section is implemented using the Header structure. 33401 The Header section defines the following additional tag values 33402 which may be used in the Index structures. 33403 __________________________________________________________ 33404 33405 22.2.4.1. Package Information 33406 33407 The following tag values are used to indicate information that 33408 describes the package as a whole. 33409 33410 Table 22-8. Package Info Tag Values 33411 Name Tag Value Type Count Status 33412 RPMTAG_NAME 1000 STRING 1 Required 33413 RPMTAG_VERSION 1001 STRING 1 Required 33414 RPMTAG_RELEASE 1002 STRING 1 Required 33415 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 33416 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 33417 RPMTAG_SIZE 1009 INT32 1 Required 33418 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 33419 RPMTAG_VENDOR 1011 STRING 1 Informational 33420 RPMTAG_LICENSE 1014 STRING 1 Required 33421 RPMTAG_PACKAGER 1015 STRING 1 Informational 33422 RPMTAG_GROUP 1016 I18NSTRING 1 Required 33423 RPMTAG_URL 1020 STRING 1 Informational 33424 RPMTAG_OS 1021 STRING 1 Required 33425 RPMTAG_ARCH 1022 STRING 1 Required 33426 RPMTAG_SOURCERPM 1044 STRING 1 Informational 33427 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 33428 RPMTAG_RPMVERSION 1064 STRING 1 Informational 33429 RPMTAG_COOKIE 1094 STRING 1 Optional 33430 RPMTAG_DISTURL 1123 STRING 1 Informational 33431 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 33432 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 33433 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 33434 33435 RPMTAG_NAME 33436 This tag specifies the name of the package. 33437 33438 RPMTAG_VERSION 33439 This tag specifies the version of the package. 33440 33441 RPMTAG_RELEASE 33442 This tag specifies the release of the package. 33443 33444 RPMTAG_SUMMARY 33445 This tag specifies the summary description of the 33446 package. The summary value pointed to by this index 33447 record contains a one line description of the package. 33448 33449 RPMTAG_DESCRIPTION 33450 This tag specifies the description of the package. The 33451 description value pointed to by this index record 33452 contains a full desription of the package. 33453 33454 RPMTAG_SIZE 33455 This tag specifies the sum of the sizes of the regular 33456 files in the archive. 33457 33458 RPMTAG_DISTRIBUTION 33459 A string containing the name of the distribution on 33460 which the package was built. 33461 33462 RPMTAG_VENDOR 33463 A string containing the name of the organization that 33464 produced the package. 33465 33466 RPMTAG_LICENSE 33467 This tag specifies the license which applies to this 33468 package. 33469 33470 RPMTAG_PACKAGER 33471 A string identifying the tool used to build the package. 33472 33473 RPMTAG_GROUP 33474 This tag specifies the administrative group to which 33475 this package belongs. 33476 33477 RPMTAG_URL 33478 Generic package information URL. 33479 33480 RPMTAG_OS 33481 This tag specifies the OS of the package. The OS value 33482 pointed to by this index record shall be "linux". 33483 33484 RPMTAG_ARCH 33485 This tag specifies the architecture of the package. The 33486 architecture value pointed to by this index record is 33487 defined in architecture specific LSB specification. 33488 33489 RPMTAG_SOURCERPM 33490 This tag specifies the name of the source RPM. 33491 33492 RPMTAG_ARCHIVESIZE 33493 This tag specifies the uncompressed size of the Payload 33494 archive, including the cpio headers. 33495 33496 RPMTAG_RPMVERSION 33497 This tag indicates the version of RPM tool used to build 33498 this package. The value is unused. 33499 33500 RPMTAG_COOKIE 33501 This tag contains an opaque string whose contents are 33502 undefined. 33503 33504 RPMTAG_DISTURL 33505 URL for package. 33506 33507 RPMTAG_PAYLOADFORMAT 33508 This tag specifies the format of the Archive section. 33509 The format value pointed to by this index record shall 33510 be 'cpio'. 33511 33512 RPMTAG_PAYLOADCOMPRESSOR 33513 This tag specifies the compression used on the Archive 33514 section. The compression value pointed to by this index 33515 record shall be 'gzip'. 33516 33517 RPMTAG_PAYLOADFLAGS 33518 This tag indicates the compression level used for the 33519 Payload. This value shall always be '9'. 33520 __________________________________________________________ 33521 33522 22.2.4.2. Installation Information 33523 33524 The following tag values are used to provide information needed 33525 during the installation of the package. 33526 33527 Table 22-9. Installation Tag Values 33528 Name Tag Value Type Count Status 33529 RPMTAG_PREIN 1023 STRING 1 Optional 33530 RPMTAG_POSTIN 1024 STRING 1 Optional 33531 RPMTAG_PREUN 1025 STRING 1 Optional 33532 RPMTAG_POSTUN 1026 STRING 1 Optional 33533 RPMTAG_PREINPROG 1085 STRING 1 Optional 33534 RPMTAG_POSTINPROG 1086 STRING 1 Optional 33535 RPMTAG_PREUNPROG 1087 STRING 1 Optional 33536 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 33537 33538 RPMTAG_PREIN 33539 33540 This tag specifies the preinstall scriptlet. If present, then 33541 RPMTAG_PREINPROG shall also be present. 33542 RPMTAG_POSTIN 33543 33544 This tag specifies the postinstall scriptlet. If present, then 33545 RPMTAG_POSTINPROG shall also be present. 33546 RPMTAG_PREUN 33547 33548 his tag specifies the preuninstall scriptlet. If present, then 33549 RPMTAG_PREUNPROG shall also be present. 33550 RPMTAG_POSTUN 33551 33552 This tag specified the postuninstall scriptlet. If present, 33553 then RPMTAG_POSTUNPROG shall also be present. 33554 RPMTAG_PREINPROG 33555 33556 This tag specifies the name of the intepreter to which the 33557 preinstall scriptlet will be passed. The intepreter pointed to 33558 by this index record shall be /bin/sh. 33559 RPMTAG_POSTINPROG 33560 33561 This tag specifies the name of the intepreter to which the 33562 postinstall scriptlet will be passed. The intepreter pointed to 33563 by this index record shall be /bin/sh. 33564 RPMTAG_PREUNPROG 33565 33566 This tag specifies the name of the intepreter to which the 33567 preuninstall scriptlet will be passed. The intepreter pointed 33568 to by this index record shall be /bin/sh. 33569 RPMTAG_POSTUNPROG 33570 33571 This program specifies the name of the intepreter to which the 33572 postuninstall scriptlet will be passed. The intepreter pointed 33573 to by this index record shall be /bin/sh. 33574 __________________________________________________________ 33575 33576 22.2.4.3. File Information 33577 33578 The following tag values are used to provide information about 33579 the files in the payload. This information is provided in the 33580 header to allow more efficient access of the information. 33581 33582 Table 22-10. File Info Tag Values 33583 Name Tag Value Type Count Status 33584 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 33585 RPMTAG_FILESIZES 1028 INT32 Required 33586 RPMTAG_FILEMODES 1030 INT16 Required 33587 RPMTAG_FILERDEVS 1033 INT16 Required 33588 RPMTAG_FILEMTIMES 1034 INT32 Required 33589 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 33590 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 33591 RPMTAG_FILEFLAGS 1037 INT32 Required 33592 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 33593 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 33594 RPMTAG_FILEDEVICES 1095 INT32 Required 33595 RPMTAG_FILEINODES 1096 INT32 Required 33596 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 33597 RPMTAG_DIRINDEXES 1116 INT32 Optional 33598 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 33599 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 33600 33601 RPMTAG_OLDFILENAMES 33602 33603 This tag specifies the filenames when not in a compressed 33604 format as determined by the absence of 33605 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME index. 33606 RPMTAG_FILESIZES 33607 33608 This tag specifies the size of each file in the archive. 33609 RPMTAG_FILEMODES 33610 33611 This tag specifies the mode of each file in the archive. 33612 RPMTAG_FILERDEVS 33613 33614 This tag specifies the device number from which the file was 33615 copied. 33616 RPMTAG_FILEMTIMES 33617 33618 This tag specifies the modification time in seconds since the 33619 epoch of each file in the archive. 33620 RPMTAG_FILEMD5S 33621 33622 This tag specifies the ASCII representation of the MD5 sum of 33623 the corresponding file contents. This value is empty if the 33624 corresponding archive entry is not a regular file. 33625 RPMTAG_FILELINKTOS 33626 33627 The target for a symlink, otherwise NULL. 33628 RPMTAG_FILEFLAGS 33629 33630 This tag specifies the bit(s) to classify and control how files 33631 are to be installed. See below. 33632 RPMTAG_FILEUSERNAME 33633 33634 This tag specifies the owner of the corresponding file. 33635 RPMTAG_FILEGROUPNAME 33636 33637 This tag specifies the group of the corresponding file. 33638 RPMTAG_FILEDEVICES 33639 33640 This tag specifies the 16 bit device number from which the file 33641 was copied. 33642 RPMTAG_FILEINODES 33643 33644 This tag specifies the inode value from the original file 33645 system on the the system on which it was built. 33646 RPMTAG_FILELANGS 33647 33648 This tag specifies a per-file locale marker used to install 33649 only locale specific subsets of files when the package is 33650 installed. 33651 RPMTAG_DIRINDEXES 33652 33653 This tag specifies the index into the array provided by the 33654 RPMTAG_DIRNAMES Index which contains the directory name for the 33655 corresponding filename. 33656 RPMTAG_BASENAMES 33657 33658 This tag specifies the base portion of the corresponding 33659 filename. 33660 RPMTAG_DIRNAMES 33661 33662 One of RPMTAG_OLDFILENAMES or the tuple 33663 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 33664 present, but not both. 33665 __________________________________________________________ 33666 33667 22.2.4.3.1. File Flags 33668 33669 The RPMTAG_FILEFLAGS tag value shall identify various 33670 characteristics of the file in the payload that it describes. 33671 It shall be an INT32 value consisting of either the value 33672 RPMFILE_NONE (0) or the bitwise inclusive or of one or more of 33673 the following values: 33674 33675 Table 22-11. File Flags 33676 Name Value 33677 RPMFILE_CONFIG (1 << 0) 33678 RPMFILE_DOC (1 << 1) 33679 RPMFILE_DONOTUSE (1 << 2) 33680 RPMFILE_MISSINGOK (1 << 3) 33681 RPMFILE_NOREPLACE (1 << 4) 33682 RPMFILE_SPECFILE (1 << 5) 33683 RPMFILE_GHOST (1 << 6) 33684 RPMFILE_LICENSE (1 << 7) 33685 RPMFILE_README (1 << 8) 33686 RPMFILE_EXCLUDE (1 << 9) 33687 33688 These bits have the following meaning: 33689 33690 RPMFILE_CONFIG 33691 33692 The file is a configuration file, and an existing file should 33693 be saved during a package upgrade operation and not removed 33694 during a pakage removal operation. 33695 RPMFILE_DOC 33696 33697 The file contains documentation. 33698 RPMFILE_DONOTUSE 33699 33700 This value is reserved for future use; conforming packages may 33701 not use this flag. 33702 RPMFILE_MISSINGOK 33703 33704 The file need not exist on the installed system. 33705 RPMFILE_NOREPLACE 33706 33707 Similar to the RPMFILE_CONFIG, this flag indicates that during 33708 an upgrade operation the original file on the system should not 33709 be altered. 33710 RPMFILE_SPECFILE 33711 33712 The file is a package specification. 33713 RPMFILE_GHOST 33714 33715 The file is not actually included in the payload, but should 33716 still be considered as a part of the package. For example, a 33717 log file generated by the application at run time. 33718 RPMFILE_LICENSE 33719 33720 The file contains the license conditions. 33721 RPMFILE_README 33722 33723 The file contains high level notes about the package. 33724 RPMFILE_EXCLUDE 33725 33726 The corresponding file is not a part of the package, and should 33727 not be installed. 33728 __________________________________________________________ 33729 33730 22.2.4.4. Dependency Information 33731 33732 The following tag values are used to provide information about 33733 interdependencies between packages. 33734 33735 Table 22-12. Package Dependency Tag Values 33736 Name Tag Value Type Count Status 33737 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 33738 RPMTAG_REQUIREFLAGS 1048 INT32 Required 33739 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 33740 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 33741 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 33742 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 33743 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 33744 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 33745 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 33746 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 33747 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 33748 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 33749 33750 RPMTAG_PROVIDENAME 33751 This tag indicates the name of the dependency provided 33752 by this package. 33753 33754 RPMTAG_REQUIREFLAGS 33755 Bits(s) to specify the dependency range and context. 33756 33757 RPMTAG_REQUIRENAME 33758 This tag indicates the dependencies for this package. 33759 33760 RPMTAG_REQUIREVERSION 33761 This tag indicates the versions associated with the 33762 values found in the RPMTAG_REQUIRENAME Index. 33763 33764 RPMTAG_CONFLICTFLAGS 33765 Bits(s) to specify the conflict range and context. 33766 33767 RPMTAG_CONFLICTNAME 33768 This tag indicates the conflicting dependencies for this 33769 package. 33770 33771 RPMTAG_CONFLICTVERSION 33772 This tag indicates the versions associated with the 33773 values found in the RPMTAG_CONFLICTNAME Index. 33774 33775 RPMTAG_OBSOLETENAME 33776 This tag indicates the obsoleted dependencies for this 33777 package. 33778 33779 RPMTAG_PROVIDEFLAGS 33780 Bits(s) to specify the conflict range and context. 33781 33782 RPMTAG_PROVIDEVERSION 33783 This tag indicates the versions associated with the 33784 values found in the RPMTAG_PROVIDENAME Index. 33785 33786 RPMTAG_OBSOLETEFLAGS 33787 Bits(s) to specify the conflict range and context. 33788 33789 RPMTAG_OBSOLETEVERSION 33790 This tag indicates the versions associated with the 33791 values found in the RPMTAG_OBSOLETENAME Index. 33792 __________________________________________________________ 33793 33794 22.2.4.4.1. Package Dependency Values 33795 33796 The package dependencies are stored in the RPMTAG_REQUIRENAME 33797 and RPMTAG_REQUIREVERSION index records. The following values 33798 may be used. 33799 33800 Table 22-13. Index Type values 33801 Name Version Meaning Status 33802 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 33803 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 33804 RPMTAG_PREREQ records that have a version associated with them. 33805 Optional 33806 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames in 33807 the Archive have had "." prepended to them. Optional 33808 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 33809 filenames in the Payload are represented in the 33810 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES indexes. 33811 Optional 33812 /bin/sh Interpreter usually required for installation 33813 scripts. Optional 33814 33815 Additional dependencies are specified in the Package 33816 Dependencies section of this specification, and in the relevant 33817 architecture specific part of ISO/IEC 23360. 33818 __________________________________________________________ 33819 33820 22.2.4.4.2. Package Dependencies Attributes 33821 33822 The package dependency attributes are stored in the 33823 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 33824 RPMTAG_OBSOLETEFLAGS index records. The following values may be 33825 used. 33826 33827 Table 22-14. Package Dependency Attributes 33828 Name Value Meaning 33829 RPMSENSE_LESS 0x02 33830 RPMSENSE_GREATER 0x04 33831 RPMSENSE_EQUAL 0x08 33832 RPMSENSE_PREREQ 0x40 33833 RPMSENSE_INTERP 0x100 33834 RPMSENSE_SCRIPT_PRE 0x200 33835 RPMSENSE_SCRIPT_POST 0x400 33836 RPMSENSE_SCRIPT_PREUN 0x800 33837 RPMSENSE_SCRIPT_POSTUN 0x1000 33838 RPMSENSE_RPMLIB 0x1000000 33839 __________________________________________________________ 33840 33841 22.2.4.5. Other Information 33842 33843 The following tag values are also found in the Header section. 33844 33845 Table 22-15. Other Tag Values 33846 Name Tag Value Type Count Status 33847 RPMTAG_BUILDTIME 1006 INT32 1 Informational 33848 RPMTAG_BUILDHOST 1007 STRING 1 Informational 33849 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 33850 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 33851 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 33852 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 33853 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 33854 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 33855 RPMTAG_PLATFORM 1132 STRING 1 Informational 33856 33857 RPMTAG_BUILDTIME 33858 This tag specifies the time as seconds since the epoch 33859 at which the package was built. 33860 33861 RPMTAG_BUILDHOST 33862 This tag specifies the hostname of the system on which 33863 which the package was built. 33864 33865 RPMTAG_FILEVERIFYFLAGS 33866 This tag specifies the bit(s) to control how files are 33867 to be verified after install, specifying which checks 33868 should be performed. 33869 33870 RPMTAG_CHANGELOGTIME 33871 This tag specifies the Unix time in seconds since the 33872 epoch associated with each entry in the Changelog file. 33873 33874 RPMTAG_CHANGELOGNAME 33875 This tag specifies the name of who made a change to this 33876 package. 33877 33878 RPMTAG_CHANGELOGTEXT 33879 This tag specifies the changes asssociated with a 33880 changelog entry. 33881 33882 RPMTAG_OPTFLAGS 33883 This tag indicates additional flags which may have been 33884 passed to the compiler when building this package. 33885 33886 RPMTAG_RHNPLATFORM 33887 This tag contains an opaque string whose contents are 33888 undefined. 33889 33890 RPMTAG_PLATFORM 33891 This tag contains an opaque string whose contents are 33892 undefined. 33893 __________________________________________________________ 33894 33895 22.2.5. Payload Section 33896 33897 The Payload section contains a compressed cpio archive. The 33898 format of this section is defined by RFC 1952: GZIP File Format 33899 Specification. 33900 33901 When uncompressed, the cpio archive contains a sequence of 33902 records for each file. Each record contains a CPIO Header, 33903 Filename, Padding, and File Data. 33904 33905 Table 22-16. CPIO File Format 33906 CPIO Header Header structure as defined below. 33907 Filename NUL terminated ASCII string containing the name of the 33908 file. 33909 Padding 0-3 bytes as needed to align the file stream to a 4 33910 byte boundary. 33911 File data The contents of the file. 33912 Padding 0-3 bytes as needed to align the file stream to a 4 33913 byte boundary. 33914 33915 The CPIO Header uses the following header structure (sometimes 33916 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 33917 stored as ASCII representations of their hexadecimal value with 33918 leading zeros as needed to fill the field. With the exception 33919 of c_namesize and the corresponding name string, and 33920 c_checksum, all information contained in the CPIO Header is 33921 also represented in the Header Section. The values in the CPIO 33922 Header shall match the values contained in the Header Section. 33923 struct { 33924 char c_magic[6]; 33925 char c_ino[8]; 33926 char c_mode[8]; 33927 char c_uid[8]; 33928 char c_gid[8]; 33929 char c_nlink[8]; 33930 char c_mtime[8]; 33931 char c_filesize[8]; 33932 char c_devmajor[8]; 33933 char c_devminor[8]; 33934 char c_rdevmajor[8]; 33935 char c_rdevminor[8]; 33936 char c_namesize[8]; 33937 char c_checksum[8]; 33938 }; 33939 33940 c_magic 33941 33942 Value identifying this cpio format. This value shall be 33943 "070701". 33944 c_ino 33945 33946 This field contains the inode number from the filesystem from 33947 which the file was read. This field is ignored when installing 33948 a package. This field shall match the corresponding value in 33949 the RPMTAG_FILEINODES index in the Header section. 33950 c_mode 33951 33952 Permission bits of the file. This is an ascii representation of 33953 the hexadecimal number representing the bit as defined for the 33954 st_mode field of the stat structure defined for the stat 33955 function. This field shall match the corresponding value in the 33956 RPMTAG_FILEMODES index in the Header section. 33957 c_uid 33958 33959 Value identifying this owner of this file. This value matches 33960 the uid value of the corresponding user in the 33961 RPMTAG_FILEUSERNAME as found on the system where this package 33962 was built. The username specified in RPMTAG_FILEUSERNAME should 33963 take precedence when installing the package. 33964 c_gid 33965 33966 Value identifying this group of this file. This value matches 33967 the gid value of the corresponding user in the 33968 RPMTAG_FILEGROUPNAME as found on the system where this package 33969 was built. The groupname specified in RPMTAG_FILEGROUPNAME 33970 should take precedence when installing the package. 33971 c_nlink 33972 33973 Value identifying the number of links associated with this 33974 file. If the value is greater than 1, then this filename will 33975 be linked to 1 or more files in this archive that has a 33976 matching value for the c_ino, c_devmajor and c_devminor fields. 33977 c_mtime 33978 33979 Value identifying the modification time of the file when it was 33980 read. This field shall match the corresponding value in the 33981 RPMTAG_FILEMTIMES index in the Header section. 33982 c_filesize 33983 33984 Value identifying the size of the file. This field shall match 33985 the corresponding value in the RPMTAG_FILESIZES index in the 33986 Header section. 33987 c_devmajor 33988 33989 The major number of the device containing the file system from 33990 which the file was read. With the exception of processing files 33991 with c_nlink >1, this field is ignored when installing a 33992 package. This field shall match the corresponding value in the 33993 RPMTAG_FILEDEVICES index in the Header section. 33994 c_devminor 33995 33996 The minor number of the device containing the file system from 33997 which the file was read. With the exception of processing files 33998 with c_nlink >1, this field is ignored when installing a 33999 package. This field shall match the corresponding value in the 34000 RPMTAG_FILEDEVICES index in the Header section. 34001 c_rdevmajor 34002 34003 The major number of the raw device containing the file system 34004 from which the file was read. This field is ignored when 34005 installing a package. This field shall match the corresponding 34006 value in the RPMTAG_RDEVS index in the Header section. 34007 c_rdevminor 34008 34009 The minor number of the raw device containing the file system 34010 from which the file was read. This field is ignored when 34011 installing a package. This field shall match the corresponding 34012 value in the RPMTAG_RDEVS index in the Header section. 34013 c_namesize 34014 34015 Value identifying the length of the filename, which is located 34016 immediately following the CPIO Header structure. 34017 c_checksum 34018 34019 Value containing the CRC checksum of the file data. This field 34020 is not used, and shall contain the value "00000000". This field 34021 is ignored when installing a package. 34022 34023 A record with the filename "TRAILER!!!" indicates the last 34024 record in the archive. 34025 __________________________________________________________ 34026 34027 22.3. Package Script Restrictions 34028 34029 Scripts used as part of the package install and uninstall shall 34030 only use commands and interfaces that are specified by the LSB. 34031 All other commands are not guaranteed to be present, or to 34032 behave in expected ways. 34033 34034 Packages shall not use RPM triggers. 34035 34036 Packages shall not depend on the order in which scripts are 34037 executed (pre-install, pre-uninstall, etc), when doing an 34038 upgrade. 34039 __________________________________________________________ 34040 34041 22.4. Package Tools 34042 34043 The LSB does not specify the interface to the tools used to 34044 manipulate LSB-conformant packages. Each conforming 34045 implementation shall provide documentation for installing LSB 34046 packages. 34047 __________________________________________________________ 34048 34049 22.5. Package Naming 34050 34051 Packages supplied by implementations and applications shall 34052 follow the following rules for the name field within the 34053 package. These rules are not required for the filename of the 34054 package file itself. 34055 34056 Note: There are discrepancies among implementations 34057 concerning whether the name might be 34058 frobnicator-1.7-21-ppc32.rpm or 34059 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 34060 recommended practice is for the filename of the package file 34061 to match the name within the package. 34062 34063 The following rules apply to the name field alone, not 34064 including any release or version. 34065 34066 Note: If the name with the release and version is 34067 frobnicator-1.7-21, the name part is frobnicator and falls 34068 under the rules for a name with no hyphens. 34069 34070 * If the name begins with lsb- and contains no other hyphens, 34071 the name shall be assigned by the Linux Assigned Names and 34072 Numbers Authority (LANANA), which shall maintain a registry 34073 of LSB names. The name may be registered by either an 34074 implementation or an application. 34075 * If the package name begins with lsb- and contains more than 34076 one hyphen (for example lsb-distro.example.com-database or 34077 lsb-gnome-gnumeric), then the portion of the package name 34078 between first and second hyphens shall either be an LSB 34079 provider name assigned by the LANANA, or it may be one of 34080 the owners' fully-qualified domain names in lower case 34081 (e.g., debian.org, staroffice.sun.com). The LSB provider 34082 name assigned by LANANA shall only consist of the ASCII 34083 characters [a-z0-9]. The provider name or domain name may 34084 be either that of an implementation or an application. 34085 * Package names containing no hyphens are reserved for use by 34086 implementations. Applications shall not use such names. 34087 * Package names which do not start with lsb- and which 34088 contain a hyphen are open to both implementations and 34089 applications. Implementations may name packages in any part 34090 of this namespace. They are encouraged to use names from 34091 one of the other namespaces available to them, but this is 34092 not required due to the large amount of current practice to 34093 the contrary. 34094 34095 Note: Widespread existing practice includes such names as 34096 ssh-common, ssh-client, kernel-pcmcia, and the like. 34097 Possible alternative names include sshcommon, 34098 foolinux-ssh-common (where foolinux is registered to the 34099 implementation), or lsb-foolinux-ssh-common. 34100 Applications may name their packages this way, but only if 34101 the portion of the name before the first hyphen is a 34102 provider name or registered domain name as described above. 34103 34104 Note: If an application vendor has domain name such as 34105 visicalc.example.com and has registered visicalc as a 34106 provider name, they might name packages visicalc-base, 34107 visicalc.example.com-charting, and the like. 34108 Package names in this namespace are available to both the 34109 implementation and an application. Implementations and 34110 applications will need to consider this potential for 34111 conflicts when deciding to use these names rather than the 34112 alternatives (such as names starting with lsb-). 34113 __________________________________________________________ 34114 34115 22.6. Package Dependencies 34116 34117 Packages shall have a dependency that indicates which LSB 34118 modules are required. LSB module descriptions are dash 34119 seperated tuples containing the name 'lsb', the module name, 34120 and the architecture name. The following dependencies may be 34121 used. 34122 34123 lsb-core-arch 34124 34125 This dependency is used to indicate that the application is 34126 dependent on features contained in the LSB-Core specification. 34127 lsb-core-noarch 34128 34129 This dependency is used to indicate that the application is 34130 dependent on features contained in the LSB-Core specification 34131 and that the package does not contain any architecture specific 34132 files. 34133 34134 These dependencies shall have a version of 3.0. 34135 34136 Packages shall not depend on other system-provided 34137 dependencies. They shall not depend on non-system-provided 34138 dependencies unless the package provider also makes available 34139 the LSB conforming packages needed to satisfy such 34140 dependencies. 34141 34142 Other modules in the LSB may supplement this list. The 34143 architecture specific dependencies are described in the 34144 relevant architecture specific LSB. 34145 __________________________________________________________ 34146 34147 22.7. Package Architecture Considerations 34148 34149 Packages which do not contain any architecture specific files 34150 should specify an architecture of noarch. An LSB runtime 34151 environment shall accept values noarch, or the value specified 34152 in the relevant architecture specific part of ISO/IEC 23360. 34153 34154 Additional specifications or restrictions may be found in the 34155 architecture specific LSB specification. 34156 __________________________________________________________ 34157 34158 Appendix A. Alphabetical Listing of Interfaces 34159 __________________________________________________________ 34160 34161 A.1. libc 34162 34163 The behavior of the interfaces in this library is specified by 34164 the following Standards. 34165 34166 Large File Support [LFS] 34167 This Specification [LSB] 34168 RFC 1831/1832 RPC & XDR [RPC & XDR] 34169 SUSv2 [SUSv2] 34170 ISO POSIX (2003) [SUSv3] 34171 POSIX 1003.1 2008 [SUSv4] 34172 SVID Issue 3 [SVID.3] 34173 SVID Issue 4 [SVID.4] 34174 34175 Table A-1. libc Function Interfaces 34176 _Exit[SUSv3] getcwd[SUSv3] sched_rr_get_interval[SUSv3] 34177 _IO_feof[LSB] getdate[SUSv3] 34178 sched_setaffinity(GLIBC_2.3.4)[LSB] 34179 _IO_getc[LSB] getdelim[SUSv4] sched_setparam[SUSv3] 34180 _IO_putc[LSB] getdomainname[LSB] sched_setscheduler[LSB] 34181 _IO_puts[LSB] getdtablesize[LSB] sched_yield[SUSv3] 34182 __assert_fail[LSB] getegid[SUSv3] seed48[SUSv3] 34183 __chk_fail(GLIBC_2.3.4)[LSB] getenv[SUSv3] seed48_r[LSB] 34184 __confstr_chk(GLIBC_2.4)[LSB] geteuid[SUSv3] seekdir[SUSv3] 34185 __ctype_b_loc(GLIBC_2.3)[LSB] getgid[SUSv3] select[SUSv3] 34186 __ctype_get_mb_cur_max[LSB] getgrent[SUSv3] semctl[SUSv3] 34187 __ctype_tolower_loc(GLIBC_2.3)[LSB] getgrent_r[LSB] 34188 semget[SUSv3] 34189 __ctype_toupper_loc(GLIBC_2.3)[LSB] getgrgid[SUSv3] 34190 semop[SUSv3] 34191 __cxa_atexit[LSB] getgrgid_r[SUSv3] send[SUSv4] 34192 __cxa_finalize[LSB] getgrnam[SUSv3] sendfile[LSB] 34193 __errno_location[LSB] getgrnam_r[SUSv3] 34194 sendfile64(GLIBC_2.3)[LSB] 34195 __fgets_chk(GLIBC_2.4)[LSB] getgrouplist[LSB] sendmsg[SUSv4] 34196 __fgets_unlocked_chk(GLIBC_2.4)[LSB] getgroups[SUSv3] 34197 sendto[SUSv4] 34198 __fgetws_chk(GLIBC_2.4)[LSB] gethostbyaddr[SUSv3] setbuf[SUSv3] 34199 __fgetws_unlocked_chk(GLIBC_2.4)[LSB] gethostbyaddr_r[LSB] 34200 setbuffer[LSB] 34201 __fpending[LSB] gethostbyname[SUSv3] setcontext[SUSv3] 34202 __fprintf_chk[LSB] gethostbyname2[LSB] setegid[SUSv3] 34203 __fwprintf_chk(GLIBC_2.4)[LSB] gethostbyname2_r[LSB] 34204 setenv[SUSv3] 34205 __fxstat[LSB] gethostbyname_r[LSB] seteuid[SUSv3] 34206 __fxstat64[LSB] gethostid[SUSv3] setgid[SUSv3] 34207 __fxstatat(GLIBC_2.4)[LSB] gethostname[SUSv3] setgrent[SUSv3] 34208 __fxstatat64(GLIBC_2.4)[LSB] getitimer[SUSv3] setgroups[LSB] 34209 __getcwd_chk(GLIBC_2.4)[LSB] getline[SUSv4] sethostname[LSB] 34210 __getgroups_chk(GLIBC_2.4)[LSB] getloadavg[LSB] 34211 setitimer[SUSv3] 34212 __gethostname_chk(GLIBC_2.4)[LSB] getlogin[SUSv3] 34213 setlocale[SUSv3] 34214 __getlogin_r_chk(GLIBC_2.4)[LSB] getlogin_r[SUSv3] 34215 setlogmask[SUSv3] 34216 __getpagesize[LSB] getnameinfo[SUSv3] setpgid[SUSv3] 34217 __getpgid[LSB] getopt[LSB] setpgrp[SUSv3] 34218 __h_errno_location[LSB] getopt_long[LSB] setpriority[SUSv3] 34219 __isinf[LSB] getopt_long_only[LSB] setprotoent[SUSv3] 34220 __isinff[LSB] getpagesize[LSB] setpwent[SUSv3] 34221 __isinfl[LSB] getpeername[SUSv3] setregid[SUSv3] 34222 __isnan[LSB] getpgid[SUSv3] setreuid[SUSv3] 34223 __isnanf[LSB] getpgrp[SUSv3] setrlimit[SUSv3] 34224 __isnanl[LSB] getpid[SUSv3] setrlimit64[LFS] 34225 __libc_current_sigrtmax[LSB] getppid[SUSv3] setservent[SUSv3] 34226 __libc_current_sigrtmin[LSB] getpriority[SUSv3] setsid[SUSv3] 34227 __libc_start_main[LSB] getprotobyname[SUSv3] setsockopt[LSB] 34228 __lxstat[LSB] getprotobyname_r[LSB] setstate[SUSv3] 34229 __lxstat64[LSB] getprotobynumber[SUSv3] setstate_r[LSB] 34230 __mbsnrtowcs_chk(GLIBC_2.4)[LSB] getprotobynumber_r[LSB] 34231 setuid[SUSv3] 34232 __mbsrtowcs_chk(GLIBC_2.4)[LSB] getprotoent[SUSv3] 34233 setutent[LSB] 34234 __mbstowcs_chk(GLIBC_2.4)[LSB] getprotoent_r[LSB] 34235 setutxent[SUSv3] 34236 __memcpy_chk(GLIBC_2.3.4)[LSB] getpwent[SUSv3] setvbuf[SUSv3] 34237 __memmove_chk(GLIBC_2.3.4)[LSB] getpwent_r[LSB] shmat[SUSv3] 34238 __mempcpy[LSB] getpwnam[SUSv3] shmctl[SUSv3] 34239 __mempcpy_chk(GLIBC_2.3.4)[LSB] getpwnam_r[SUSv3] shmdt[SUSv3] 34240 __memset_chk(GLIBC_2.3.4)[LSB] getpwuid[SUSv3] shmget[SUSv3] 34241 __pread64_chk(GLIBC_2.4)[LSB] getpwuid_r[SUSv3] shutdown[SUSv3] 34242 __pread_chk(GLIBC_2.4)[LSB] getrlimit[SUSv3] sigaction[SUSv3] 34243 __printf_chk[LSB] getrlimit64[LFS] sigaddset[SUSv3] 34244 __rawmemchr[LSB] getrusage[SUSv3] sigaltstack[SUSv3] 34245 __read_chk(GLIBC_2.4)[LSB] getservbyname[SUSv3] sigandset[LSB] 34246 __readlink_chk(GLIBC_2.4)[LSB] getservbyname_r[LSB] 34247 sigdelset[SUSv3] 34248 __realpath_chk(GLIBC_2.4)[LSB] getservbyport[SUSv3] 34249 sigemptyset[SUSv3] 34250 __recv_chk(GLIBC_2.4)[LSB] getservbyport_r[LSB] 34251 sigfillset[SUSv3] 34252 __recvfrom_chk(GLIBC_2.4)[LSB] getservent[SUSv3] sighold[SUSv3] 34253 __register_atfork(GLIBC_2.3.2)[LSB] getservent_r[LSB] 34254 sigignore[SUSv3] 34255 __sigsetjmp[LSB] getsid[SUSv3] siginterrupt[SUSv3] 34256 __snprintf_chk[LSB] getsockname[SUSv3] sigisemptyset[LSB] 34257 __sprintf_chk[LSB] getsockopt[LSB] sigismember[SUSv3] 34258 __stack_chk_fail(GLIBC_2.4)[LSB] getsubopt[SUSv3] 34259 siglongjmp[SUSv3] 34260 __stpcpy[LSB] gettext[LSB] signal[SUSv3] 34261 __stpcpy_chk(GLIBC_2.3.4)[LSB] gettimeofday[SUSv3] 34262 sigorset[LSB] 34263 __stpncpy_chk(GLIBC_2.4)[LSB] getuid[SUSv3] sigpause[LSB] 34264 __strcat_chk(GLIBC_2.3.4)[LSB] getutent[LSB] sigpending[SUSv3] 34265 __strcpy_chk(GLIBC_2.3.4)[LSB] getutent_r[LSB] 34266 sigprocmask[SUSv3] 34267 __strdup[LSB] getutxent[SUSv3] sigqueue[SUSv3] 34268 __strncat_chk(GLIBC_2.3.4)[LSB] getutxid[SUSv3] sigrelse[SUSv3] 34269 __strncpy_chk(GLIBC_2.3.4)[LSB] getutxline[SUSv3] 34270 sigreturn[LSB] 34271 __strtod_internal[LSB] getw[SUSv2] sigset[SUSv3] 34272 __strtof_internal[LSB] getwc[SUSv3] sigsuspend[SUSv3] 34273 __strtok_r[LSB] getwc_unlocked[LSB] sigtimedwait[SUSv3] 34274 __strtol_internal[LSB] getwchar[SUSv3] sigwait[SUSv3] 34275 __strtold_internal[LSB] getwchar_unlocked[LSB] 34276 sigwaitinfo[SUSv3] 34277 __strtoll_internal[LSB] getwd[SUSv3] sleep[SUSv3] 34278 __strtoul_internal[LSB] glob[SUSv3] snprintf[SUSv3] 34279 __strtoull_internal[LSB] glob64[LSB] sockatmark[SUSv3] 34280 __swprintf_chk(GLIBC_2.4)[LSB] globfree[SUSv3] socket[SUSv3] 34281 __sysconf[LSB] globfree64[LSB] socketpair[SUSv3] 34282 __syslog_chk(GLIBC_2.4)[LSB] gmtime[SUSv3] sprintf[SUSv3] 34283 __sysv_signal[LSB] gmtime_r[SUSv3] srand[SUSv3] 34284 __ttyname_r_chk(GLIBC_2.4)[LSB] grantpt[SUSv3] srand48[SUSv3] 34285 __vfprintf_chk[LSB] hcreate[SUSv3] srand48_r[LSB] 34286 __vfwprintf_chk(GLIBC_2.4)[LSB] hcreate_r[LSB] srandom[SUSv3] 34287 __vprintf_chk[LSB] hdestroy[SUSv3] srandom_r[LSB] 34288 __vsnprintf_chk[LSB] hdestroy_r[LSB] sscanf[LSB] 34289 __vsprintf_chk[LSB] hsearch[SUSv3] statfs[LSB] 34290 __vswprintf_chk(GLIBC_2.4)[LSB] hsearch_r[LSB] statfs64[LSB] 34291 __vsyslog_chk(GLIBC_2.4)[LSB] htonl[SUSv3] statvfs[SUSv3] 34292 __vwprintf_chk(GLIBC_2.4)[LSB] htons[SUSv3] statvfs64[LFS] 34293 __wcpcpy_chk(GLIBC_2.4)[LSB] iconv[SUSv3] stime[LSB] 34294 __wcpncpy_chk(GLIBC_2.4)[LSB] iconv_close[SUSv3] stpcpy[LSB] 34295 __wcrtomb_chk(GLIBC_2.4)[LSB] iconv_open[SUSv3] stpncpy[LSB] 34296 __wcscat_chk(GLIBC_2.4)[LSB] if_freenameindex[SUSv3] 34297 strcasecmp[SUSv3] 34298 __wcscpy_chk(GLIBC_2.4)[LSB] if_indextoname[SUSv3] 34299 strcasestr[LSB] 34300 __wcsncat_chk(GLIBC_2.4)[LSB] if_nameindex[SUSv3] strcat[SUSv3] 34301 __wcsncpy_chk(GLIBC_2.4)[LSB] if_nametoindex[SUSv3] 34302 strchr[SUSv3] 34303 __wcsnrtombs_chk(GLIBC_2.4)[LSB] imaxabs[SUSv3] strcmp[SUSv3] 34304 __wcsrtombs_chk(GLIBC_2.4)[LSB] imaxdiv[SUSv3] strcoll[SUSv3] 34305 __wcstod_internal[LSB] index[SUSv3] strcpy[SUSv3] 34306 __wcstof_internal[LSB] inet_addr[SUSv3] strcspn[SUSv3] 34307 __wcstol_internal[LSB] inet_aton[LSB] strdup[SUSv3] 34308 __wcstold_internal[LSB] inet_ntoa[SUSv3] strerror[SUSv3] 34309 __wcstombs_chk(GLIBC_2.4)[LSB] inet_ntop[SUSv3] strerror_r[LSB] 34310 __wcstoul_internal[LSB] inet_pton[SUSv3] strfmon[SUSv3] 34311 __wctomb_chk(GLIBC_2.4)[LSB] initgroups[LSB] strftime[SUSv3] 34312 __wmemcpy_chk(GLIBC_2.4)[LSB] initstate[SUSv3] strlen[SUSv3] 34313 __wmemmove_chk(GLIBC_2.4)[LSB] initstate_r[LSB] 34314 strncasecmp[SUSv3] 34315 __wmempcpy_chk(GLIBC_2.4)[LSB] 34316 inotify_add_watch(GLIBC_2.4)[LSB] strncat[SUSv3] 34317 __wmemset_chk(GLIBC_2.4)[LSB] inotify_init(GLIBC_2.4)[LSB] 34318 strncmp[SUSv3] 34319 __wprintf_chk(GLIBC_2.4)[LSB] inotify_rm_watch(GLIBC_2.4)[LSB] 34320 strncpy[SUSv3] 34321 __xmknod[LSB] insque[SUSv3] strndup[LSB] 34322 __xmknodat(GLIBC_2.4)[LSB] ioctl[LSB] strnlen[LSB] 34323 __xpg_basename[LSB] isalnum[SUSv3] strpbrk[SUSv3] 34324 __xpg_sigpause[LSB] isalpha[SUSv3] strptime[LSB] 34325 __xpg_strerror_r(GLIBC_2.3.4)[LSB] isascii[SUSv3] 34326 strrchr[SUSv3] 34327 __xstat[LSB] isatty[SUSv3] strsep[LSB] 34328 __xstat64[LSB] isblank[SUSv3] strsignal[LSB] 34329 _exit[SUSv3] iscntrl[SUSv3] strspn[SUSv3] 34330 _longjmp[SUSv3] isdigit[SUSv3] strstr[SUSv3] 34331 _setjmp[SUSv3] isgraph[SUSv3] strtod[SUSv3] 34332 _tolower[SUSv3] islower[SUSv3] strtof[SUSv3] 34333 _toupper[SUSv3] isprint[SUSv3] strtoimax[SUSv3] 34334 a64l[SUSv3] ispunct[SUSv3] strtok[SUSv3] 34335 abort[SUSv3] isspace[SUSv3] strtok_r[SUSv3] 34336 abs[SUSv3] isupper[SUSv3] strtol[SUSv3] 34337 accept[SUSv3] iswalnum[SUSv3] strtold[SUSv3] 34338 access[SUSv3] iswalpha[SUSv3] strtoll[SUSv3] 34339 acct[LSB] iswblank[SUSv3] strtoq[LSB] 34340 adjtime[LSB] iswcntrl[SUSv3] strtoul[SUSv3] 34341 alarm[SUSv3] iswctype[SUSv3] strtoull[SUSv3] 34342 alphasort[SUSv4] iswdigit[SUSv3] strtoumax[SUSv3] 34343 alphasort64[LSB] iswgraph[SUSv3] strtouq[LSB] 34344 asctime[SUSv3] iswlower[SUSv3] strxfrm[SUSv3] 34345 asctime_r[SUSv3] iswprint[SUSv3] svc_getreqset[SVID.3] 34346 asprintf[LSB] iswpunct[SUSv3] svc_register[LSB] 34347 atof[SUSv3] iswspace[SUSv3] svc_run[LSB] 34348 atoi[SUSv3] iswupper[SUSv3] svc_sendreply[LSB] 34349 atol[SUSv3] iswxdigit[SUSv3] svcerr_auth[SVID.3] 34350 atoll[SUSv3] isxdigit[SUSv3] svcerr_decode[SVID.3] 34351 authnone_create[SVID.4] jrand48[SUSv3] svcerr_noproc[SVID.3] 34352 basename[LSB] jrand48_r[LSB] svcerr_noprog[SVID.3] 34353 bcmp[SUSv3] key_decryptsession[SVID.3] svcerr_progvers[SVID.3] 34354 bcopy[SUSv3] kill[LSB] svcerr_systemerr[SVID.3] 34355 bind[SUSv3] killpg[SUSv3] svcerr_weakauth[SVID.3] 34356 bind_textdomain_codeset[LSB] l64a[SUSv3] svcfd_create[RPC & 34357 XDR] 34358 bindresvport[LSB] labs[SUSv3] svcraw_create[RPC & XDR] 34359 bindtextdomain[LSB] lchown[SUSv3] svctcp_create[LSB] 34360 brk[SUSv2] lcong48[SUSv3] svcudp_create[LSB] 34361 bsd_signal[SUSv3] lcong48_r[LSB] swab[SUSv3] 34362 bsearch[SUSv3] ldiv[SUSv3] swapcontext[SUSv3] 34363 btowc[SUSv3] lfind[SUSv3] swprintf[SUSv3] 34364 bzero[SUSv3] link[LSB] swscanf[LSB] 34365 calloc[SUSv3] linkat(GLIBC_2.4)[SUSv4] symlink[SUSv3] 34366 callrpc[RPC & XDR] listen[SUSv3] symlinkat(GLIBC_2.4)[SUSv4] 34367 catclose[SUSv3] llabs[SUSv3] sync[SUSv3] 34368 catgets[SUSv3] lldiv[SUSv3] sysconf[LSB] 34369 catopen[SUSv3] localeconv[SUSv3] syslog[SUSv3] 34370 cfgetispeed[SUSv3] localtime[SUSv3] system[LSB] 34371 cfgetospeed[SUSv3] localtime_r[SUSv3] tcdrain[SUSv3] 34372 cfmakeraw[LSB] lockf[SUSv3] tcflow[SUSv3] 34373 cfsetispeed[SUSv3] lockf64[LFS] tcflush[SUSv3] 34374 cfsetospeed[SUSv3] longjmp[SUSv3] tcgetattr[SUSv3] 34375 cfsetspeed[LSB] lrand48[SUSv3] tcgetpgrp[SUSv3] 34376 chdir[SUSv3] lrand48_r[LSB] tcgetsid[SUSv3] 34377 chmod[SUSv3] lsearch[SUSv3] tcsendbreak[SUSv3] 34378 chown[SUSv3] lseek[SUSv3] tcsetattr[SUSv3] 34379 chroot[SUSv2] makecontext[SUSv3] tcsetpgrp[SUSv3] 34380 clearerr[SUSv3] malloc[SUSv3] tdelete[SUSv3] 34381 clearerr_unlocked[LSB] mblen[SUSv3] telldir[SUSv3] 34382 clnt_create[SVID.4] mbrlen[SUSv3] tempnam[SUSv3] 34383 clnt_pcreateerror[SVID.4] mbrtowc[SUSv3] textdomain[LSB] 34384 clnt_perrno[SVID.4] mbsinit[SUSv3] tfind[SUSv3] 34385 clnt_perror[SVID.4] mbsnrtowcs[LSB] time[SUSv3] 34386 clnt_spcreateerror[SVID.4] mbsrtowcs[SUSv3] times[SUSv3] 34387 clnt_sperrno[SVID.4] mbstowcs[SUSv3] tmpfile[SUSv3] 34388 clnt_sperror[SVID.4] mbtowc[SUSv3] tmpfile64[LFS] 34389 clntraw_create[RPC & XDR] memccpy[SUSv3] tmpnam[SUSv3] 34390 clnttcp_create[RPC & XDR] memchr[SUSv3] toascii[SUSv3] 34391 clntudp_bufcreate[RPC & XDR] memcmp[SUSv3] tolower[SUSv3] 34392 clntudp_create[RPC & XDR] memcpy[SUSv3] toupper[SUSv3] 34393 clock[SUSv3] memmem[LSB] towctrans[SUSv3] 34394 close[SUSv3] memmove[SUSv3] towlower[SUSv3] 34395 closedir[SUSv3] memrchr[LSB] towupper[SUSv3] 34396 closelog[SUSv3] memset[SUSv3] truncate[SUSv3] 34397 confstr[SUSv3] mkdir[SUSv3] truncate64[LFS] 34398 connect[SUSv3] mkdirat(GLIBC_2.4)[SUSv4] tsearch[SUSv3] 34399 creat[SUSv3] mkdtemp[SUSv4] ttyname[SUSv3] 34400 creat64[LFS] mkfifo[SUSv3] ttyname_r[SUSv3] 34401 ctermid[SUSv3] mkfifoat(GLIBC_2.4)[SUSv4] twalk[SUSv3] 34402 ctime[SUSv3] mkstemp[SUSv3] tzset[SUSv3] 34403 ctime_r[SUSv3] mkstemp64[LSB] ualarm[SUSv3] 34404 cuserid[SUSv2] mktemp[SUSv3] ulimit[SUSv3] 34405 daemon[LSB] mktime[SUSv3] umask[SUSv3] 34406 dcgettext[LSB] mlock[SUSv3] uname[SUSv3] 34407 dcngettext[LSB] mlockall[SUSv3] ungetc[SUSv3] 34408 dgettext[LSB] mmap[SUSv3] ungetwc[SUSv3] 34409 difftime[SUSv3] mmap64[LFS] unlink[LSB] 34410 dirfd[SUSv4] mprotect[SUSv3] unlinkat(GLIBC_2.4)[SUSv4] 34411 dirname[SUSv3] mrand48[SUSv3] unlockpt[SUSv3] 34412 div[SUSv3] mrand48_r[LSB] unsetenv[SUSv3] 34413 dngettext[LSB] mremap[LSB] uselocale(GLIBC_2.3)[LSB] 34414 dprintf[SUSv4] msgctl[SUSv3] usleep[SUSv3] 34415 drand48[SUSv3] msgget[SUSv3] utime[SUSv3] 34416 drand48_r[LSB] msgrcv[SUSv3] utimes[SUSv3] 34417 dup[SUSv3] msgsnd[SUSv3] utmpname[LSB] 34418 dup2[SUSv3] msync[SUSv3] vasprintf[LSB] 34419 duplocale(GLIBC_2.3)[LSB] munlock[SUSv3] vdprintf[LSB] 34420 ecvt[SUSv3] munlockall[SUSv3] verrx[LSB] 34421 endgrent[SUSv3] munmap[SUSv3] vfork[SUSv3] 34422 endprotoent[SUSv3] nanosleep[SUSv3] vfprintf[SUSv3] 34423 endpwent[SUSv3] newlocale(GLIBC_2.3)[LSB] vfscanf[LSB] 34424 endservent[SUSv3] nftw[SUSv3] vfwprintf[SUSv3] 34425 endutent[LSB] nftw64[LFS] vfwscanf[LSB] 34426 endutxent[SUSv3] ngettext[LSB] vprintf[SUSv3] 34427 epoll_create(GLIBC_2.3.2)[LSB] nice[SUSv3] vscanf[LSB] 34428 epoll_ctl(GLIBC_2.3.2)[LSB] nl_langinfo[SUSv3] vsnprintf[SUSv3] 34429 epoll_wait(GLIBC_2.3.2)[LSB] nrand48[SUSv3] vsprintf[SUSv3] 34430 erand48[SUSv3] nrand48_r[LSB] vsscanf[LSB] 34431 erand48_r[LSB] ntohl[SUSv3] vswprintf[SUSv3] 34432 err[LSB] ntohs[SUSv3] vswscanf[LSB] 34433 error[LSB] open[SUSv3] vsyslog[LSB] 34434 errx[LSB] open_memstream[SUSv4] vwprintf[SUSv3] 34435 execl[SUSv3] open_wmemstream(GLIBC_2.4)[SUSv4] vwscanf[LSB] 34436 execle[SUSv3] openat(GLIBC_2.4)[SUSv4] wait[SUSv3] 34437 execlp[SUSv3] openat64(GLIBC_2.4)[LSB] wait4[LSB] 34438 execv[SUSv3] opendir[SUSv3] waitid[SUSv3] 34439 execve[SUSv3] openlog[SUSv3] waitpid[SUSv3] 34440 execvp[SUSv3] pathconf[SUSv3] warn[LSB] 34441 exit[SUSv3] pause[SUSv3] warnx[LSB] 34442 faccessat(GLIBC_2.4)[SUSv4] pclose[SUSv3] wcpcpy[LSB] 34443 fchdir[SUSv3] perror[SUSv3] wcpncpy[LSB] 34444 fchmod[SUSv3] pipe[SUSv3] wcrtomb[SUSv3] 34445 fchmodat(GLIBC_2.4)[SUSv4] pmap_getport[LSB] wcscasecmp[LSB] 34446 fchown[SUSv3] pmap_set[LSB] wcscat[SUSv3] 34447 fchownat(GLIBC_2.4)[SUSv4] pmap_unset[LSB] wcschr[SUSv3] 34448 fclose[SUSv3] poll[SUSv3] wcscmp[SUSv3] 34449 fcntl[LSB] popen[SUSv3] wcscoll[SUSv3] 34450 fcvt[SUSv3] posix_fadvise[SUSv3] wcscpy[SUSv3] 34451 fdatasync[SUSv3] posix_fadvise64[LSB] wcscspn[SUSv3] 34452 fdopen[SUSv3] posix_fallocate[SUSv3] wcsdup[LSB] 34453 fdopendir(GLIBC_2.4)[SUSv4] posix_fallocate64[LSB] 34454 wcsftime[SUSv3] 34455 feof[SUSv3] posix_madvise[SUSv3] wcslen[SUSv3] 34456 feof_unlocked[LSB] posix_memalign[SUSv3] wcsncasecmp[LSB] 34457 ferror[SUSv3] posix_openpt[SUSv3] wcsncat[SUSv3] 34458 ferror_unlocked[LSB] posix_spawn[SUSv3] wcsncmp[SUSv3] 34459 fexecve[SUSv4] posix_spawn_file_actions_addclose[SUSv3] 34460 wcsncpy[SUSv3] 34461 fflush[SUSv3] posix_spawn_file_actions_adddup2[SUSv3] 34462 wcsnlen[LSB] 34463 fflush_unlocked[LSB] posix_spawn_file_actions_addopen[SUSv3] 34464 wcsnrtombs[LSB] 34465 ffs[SUSv3] posix_spawn_file_actions_destroy[SUSv3] 34466 wcspbrk[SUSv3] 34467 fgetc[SUSv3] posix_spawn_file_actions_init[SUSv3] 34468 wcsrchr[SUSv3] 34469 fgetc_unlocked[LSB] posix_spawnattr_destroy[SUSv3] 34470 wcsrtombs[SUSv3] 34471 fgetpos[SUSv3] posix_spawnattr_getflags[SUSv3] wcsspn[SUSv3] 34472 fgetpos64[LFS] posix_spawnattr_getpgroup[SUSv3] wcsstr[SUSv3] 34473 fgets[SUSv3] posix_spawnattr_getschedparam[SUSv3] wcstod[SUSv3] 34474 fgets_unlocked[LSB] posix_spawnattr_getschedpolicy[SUSv3] 34475 wcstof[SUSv3] 34476 fgetwc[SUSv3] posix_spawnattr_getsigdefault[SUSv3] 34477 wcstoimax[SUSv3] 34478 fgetwc_unlocked[LSB] posix_spawnattr_getsigmask[SUSv3] 34479 wcstok[SUSv3] 34480 fgetws[SUSv3] posix_spawnattr_init[SUSv3] wcstol[SUSv3] 34481 fgetws_unlocked[LSB] posix_spawnattr_setflags[SUSv3] 34482 wcstold[SUSv3] 34483 fileno[SUSv3] posix_spawnattr_setpgroup[SUSv3] wcstoll[SUSv3] 34484 fileno_unlocked[LSB] posix_spawnattr_setschedparam[SUSv3] 34485 wcstombs[SUSv3] 34486 flock[LSB] posix_spawnattr_setschedpolicy[SUSv3] wcstoq[LSB] 34487 flockfile[SUSv3] posix_spawnattr_setsigdefault[SUSv3] 34488 wcstoul[SUSv3] 34489 fmemopen[SUSv4] posix_spawnattr_setsigmask[SUSv3] 34490 wcstoull[SUSv3] 34491 fmtmsg[SUSv3] posix_spawnp[SUSv3] wcstoumax[SUSv3] 34492 fnmatch[SUSv3] printf[SUSv3] wcstouq[LSB] 34493 fopen[SUSv3] pselect[SUSv3] wcswcs[SUSv3] 34494 fopen64[LFS] psignal[LSB] wcswidth[SUSv3] 34495 fork[SUSv3] ptsname[SUSv3] wcsxfrm[SUSv3] 34496 fpathconf[SUSv3] putc[SUSv3] wctob[SUSv3] 34497 fprintf[SUSv3] putc_unlocked[SUSv3] wctomb[SUSv3] 34498 fputc[SUSv3] putchar[SUSv3] wctrans[SUSv3] 34499 fputc_unlocked[LSB] putchar_unlocked[SUSv3] wctype[SUSv3] 34500 fputs[SUSv3] putenv[SUSv3] wcwidth[SUSv3] 34501 fputs_unlocked[LSB] puts[SUSv3] wmemchr[SUSv3] 34502 fputwc[SUSv3] pututxline[SUSv3] wmemcmp[SUSv3] 34503 fputwc_unlocked[LSB] putw[SUSv2] wmemcpy[SUSv3] 34504 fputws[SUSv3] putwc[SUSv3] wmemmove[SUSv3] 34505 fputws_unlocked[LSB] putwc_unlocked[LSB] wmemset[SUSv3] 34506 fread[SUSv3] putwchar[SUSv3] wordexp[SUSv3] 34507 fread_unlocked[LSB] putwchar_unlocked[LSB] wordfree[SUSv3] 34508 free[SUSv3] qsort[SUSv3] wprintf[SUSv3] 34509 freeaddrinfo[SUSv3] raise[SUSv3] write[SUSv3] 34510 freelocale(GLIBC_2.3)[LSB] rand[SUSv3] writev[SUSv3] 34511 freopen[SUSv3] rand_r[SUSv3] wscanf[LSB] 34512 freopen64[LFS] random[SUSv3] xdr_accepted_reply[SVID.3] 34513 fscanf[LSB] random_r[LSB] xdr_array[SVID.3] 34514 fseek[SUSv3] read[SUSv3] xdr_bool[SVID.3] 34515 fseeko[SUSv3] readdir[SUSv3] xdr_bytes[SVID.3] 34516 fseeko64[LFS] readdir64[LFS] xdr_callhdr[SVID.3] 34517 fsetpos[SUSv3] readdir64_r[LSB] xdr_callmsg[SVID.3] 34518 fsetpos64[LFS] readdir_r[SUSv3] xdr_char[SVID.3] 34519 fstatfs[LSB] readlink[SUSv3] xdr_double[SVID.3] 34520 fstatfs64[LSB] readlinkat(GLIBC_2.4)[SUSv4] xdr_enum[SVID.3] 34521 fstatvfs[SUSv3] readv[SUSv3] xdr_float[SVID.3] 34522 fstatvfs64[LFS] realloc[SUSv3] xdr_free[SVID.3] 34523 fsync[SUSv3] realpath[SUSv3] xdr_int[SVID.3] 34524 ftell[SUSv3] recv[SUSv3] xdr_long[SVID.3] 34525 ftello[SUSv3] recvfrom[SUSv3] xdr_opaque[SVID.3] 34526 ftello64[LFS] recvmsg[SUSv3] xdr_opaque_auth[SVID.3] 34527 ftime[SUSv3] regcomp[SUSv3] xdr_pointer[SVID.3] 34528 ftok[SUSv3] regerror[SUSv3] xdr_reference[SVID.3] 34529 ftruncate[SUSv3] regexec[LSB] xdr_rejected_reply[SVID.3] 34530 ftruncate64[LFS] regfree[SUSv3] xdr_replymsg[SVID.3] 34531 ftrylockfile[SUSv3] remove[SUSv3] xdr_short[SVID.3] 34532 ftw[SUSv3] remque[SUSv3] xdr_string[SVID.3] 34533 ftw64[LFS] rename[SUSv3] xdr_u_char[SVID.3] 34534 funlockfile[SUSv3] renameat(GLIBC_2.4)[SUSv4] xdr_u_int[LSB] 34535 fwide[SUSv3] rewind[SUSv3] xdr_u_long[SVID.3] 34536 fwprintf[SUSv3] rewinddir[SUSv3] xdr_u_short[SVID.3] 34537 fwrite[SUSv3] rindex[SUSv3] xdr_union[SVID.3] 34538 fwrite_unlocked[LSB] rmdir[SUSv3] xdr_vector[SVID.3] 34539 fwscanf[LSB] sbrk[SUSv2] xdr_void[SVID.3] 34540 gai_strerror[SUSv3] scandir[SUSv4] xdr_wrapstring[SVID.3] 34541 gcvt[SUSv3] scandir64[LSB] xdrmem_create[SVID.3] 34542 getaddrinfo[SUSv3] scanf[LSB] xdrrec_create[SVID.3] 34543 getc[SUSv3] sched_get_priority_max[SUSv3] 34544 xdrrec_endofrecord[RPC & XDR] 34545 getc_unlocked[SUSv3] sched_get_priority_min[SUSv3] 34546 xdrrec_eof[SVID.3] 34547 getchar[SUSv3] sched_getaffinity(GLIBC_2.3.4)[LSB] 34548 xdrrec_skiprecord[RPC & XDR] 34549 getchar_unlocked[SUSv3] sched_getparam[SUSv3] 34550 xdrstdio_create[LSB] 34551 getcontext[SUSv3] sched_getscheduler[SUSv3] 34552 34553 Table A-2. libc Data Interfaces 34554 __daylight[LSB] __tzname[LSB] in6addr_loopback[SUSv3] 34555 __environ[LSB] _sys_errlist[LSB] 34556 __timezone[LSB] in6addr_any[SUSv3] 34557 __________________________________________________________ 34558 34559 A.2. libcrypt 34560 34561 The behavior of the interfaces in this library is specified by 34562 the following Standards. 34563 34564 ISO POSIX (2003) [SUSv3] 34565 34566 Table A-3. libcrypt Function Interfaces 34567 crypt[SUSv3] encrypt[SUSv3] setkey[SUSv3] 34568 __________________________________________________________ 34569 34570 A.3. libdl 34571 34572 The behavior of the interfaces in this library is specified by 34573 the following Standards. 34574 34575 This Specification [LSB] 34576 ISO POSIX (2003) [SUSv3] 34577 34578 Table A-4. libdl Function Interfaces 34579 dladdr[LSB] dlerror[SUSv3] dlsym[LSB] 34580 dlclose[SUSv3] dlopen[LSB] 34581 __________________________________________________________ 34582 34583 A.4. libm 34584 34585 The behavior of the interfaces in this library is specified by 34586 the following Standards. 34587 34588 This Specification [LSB] 34589 ISO POSIX (2003) [SUSv3] 34590 SVID Issue 3 [SVID.3] 34591 34592 Table A-5. libm Function Interfaces 34593 __finite[LSB] csinl[SUSv3] llroundf[SUSv3] 34594 __finitef[LSB] csqrt[SUSv3] llroundl[SUSv3] 34595 __finitel[LSB] csqrtf[SUSv3] log[SUSv3] 34596 __fpclassify[LSB] csqrtl[SUSv3] log10[SUSv3] 34597 __fpclassifyf[LSB] ctan[SUSv3] log10f[SUSv3] 34598 __signbit[LSB] ctanf[SUSv3] log10l[SUSv3] 34599 __signbitf[LSB] ctanh[SUSv3] log1p[SUSv3] 34600 acos[SUSv3] ctanhf[SUSv3] log1pf[SUSv3] 34601 acosf[SUSv3] ctanhl[SUSv3] log1pl[SUSv3] 34602 acosh[SUSv3] ctanl[SUSv3] log2[SUSv3] 34603 acoshf[SUSv3] drem[LSB] log2f[SUSv3] 34604 acoshl[SUSv3] dremf[LSB] log2l[SUSv3] 34605 acosl[SUSv3] dreml[LSB] logb[SUSv3] 34606 asin[SUSv3] erf[SUSv3] logbf[SUSv3] 34607 asinf[SUSv3] erfc[SUSv3] logbl[SUSv3] 34608 asinh[SUSv3] erfcf[SUSv3] logf[SUSv3] 34609 asinhf[SUSv3] erfcl[SUSv3] logl[SUSv3] 34610 asinhl[SUSv3] erff[SUSv3] lrint[SUSv3] 34611 asinl[SUSv3] erfl[SUSv3] lrintf[SUSv3] 34612 atan[SUSv3] exp[SUSv3] lrintl[SUSv3] 34613 atan2[SUSv3] exp10[LSB] lround[SUSv3] 34614 atan2f[SUSv3] exp10f[LSB] lroundf[SUSv3] 34615 atan2l[SUSv3] exp10l[LSB] lroundl[SUSv3] 34616 atanf[SUSv3] exp2[SUSv3] matherr[SVID.3] 34617 atanh[SUSv3] exp2f[SUSv3] modf[SUSv3] 34618 atanhf[SUSv3] expf[SUSv3] modff[SUSv3] 34619 atanhl[SUSv3] expl[SUSv3] modfl[SUSv3] 34620 atanl[SUSv3] expm1[SUSv3] nan[SUSv3] 34621 cabs[SUSv3] expm1f[SUSv3] nanf[SUSv3] 34622 cabsf[SUSv3] expm1l[SUSv3] nanl[SUSv3] 34623 cabsl[SUSv3] fabs[SUSv3] nearbyint[SUSv3] 34624 cacos[SUSv3] fabsf[SUSv3] nearbyintf[SUSv3] 34625 cacosf[SUSv3] fabsl[SUSv3] nearbyintl[SUSv3] 34626 cacosh[SUSv3] fdim[SUSv3] nextafter[SUSv3] 34627 cacoshf[SUSv3] fdimf[SUSv3] nextafterf[SUSv3] 34628 cacoshl[SUSv3] fdiml[SUSv3] nextafterl[SUSv3] 34629 cacosl[SUSv3] feclearexcept[SUSv3] nexttoward[SUSv3] 34630 carg[SUSv3] fedisableexcept[LSB] nexttowardf[SUSv3] 34631 cargf[SUSv3] feenableexcept[LSB] nexttowardl[SUSv3] 34632 cargl[SUSv3] fegetenv[SUSv3] pow[SUSv3] 34633 casin[SUSv3] fegetexcept[LSB] pow10[LSB] 34634 casinf[SUSv3] fegetexceptflag[SUSv3] pow10f[LSB] 34635 casinh[SUSv3] fegetround[SUSv3] pow10l[LSB] 34636 casinhf[SUSv3] feholdexcept[SUSv3] powf[SUSv3] 34637 casinhl[SUSv3] feraiseexcept[SUSv3] powl[SUSv3] 34638 casinl[SUSv3] fesetenv[SUSv3] remainder[SUSv3] 34639 catan[SUSv3] fesetexceptflag[SUSv3] remainderf[SUSv3] 34640 catanf[SUSv3] fesetround[SUSv3] remainderl[SUSv3] 34641 catanh[SUSv3] fetestexcept[SUSv3] remquo[SUSv3] 34642 catanhf[SUSv3] feupdateenv[SUSv3] remquof[SUSv3] 34643 catanhl[SUSv3] finite[LSB] remquol[SUSv3] 34644 catanl[SUSv3] finitef[LSB] rint[SUSv3] 34645 cbrt[SUSv3] finitel[LSB] rintf[SUSv3] 34646 cbrtf[SUSv3] floor[SUSv3] rintl[SUSv3] 34647 cbrtl[SUSv3] floorf[SUSv3] round[SUSv3] 34648 ccos[SUSv3] floorl[SUSv3] roundf[SUSv3] 34649 ccosf[SUSv3] fma[SUSv3] roundl[SUSv3] 34650 ccosh[SUSv3] fmaf[SUSv3] scalb[SUSv3] 34651 ccoshf[SUSv3] fmal[SUSv3] scalbf[LSB] 34652 ccoshl[SUSv3] fmax[SUSv3] scalbl[LSB] 34653 ccosl[SUSv3] fmaxf[SUSv3] scalbln[SUSv3] 34654 ceil[SUSv3] fmaxl[SUSv3] scalblnf[SUSv3] 34655 ceilf[SUSv3] fmin[SUSv3] scalblnl[SUSv3] 34656 ceill[SUSv3] fminf[SUSv3] scalbn[SUSv3] 34657 cexp[SUSv3] fminl[SUSv3] scalbnf[SUSv3] 34658 cexpf[SUSv3] fmod[SUSv3] scalbnl[SUSv3] 34659 cexpl[SUSv3] fmodf[SUSv3] significand[LSB] 34660 cimag[SUSv3] fmodl[SUSv3] significandf[LSB] 34661 cimagf[SUSv3] frexp[SUSv3] significandl[LSB] 34662 cimagl[SUSv3] frexpf[SUSv3] sin[SUSv3] 34663 clog[SUSv3] frexpl[SUSv3] sincos[LSB] 34664 clog10[LSB] gamma[LSB] sincosf[LSB] 34665 clog10f[LSB] gammaf[LSB] sincosl[LSB] 34666 clog10l[LSB] gammal[LSB] sinf[SUSv3] 34667 clogf[SUSv3] hypot[SUSv3] sinh[SUSv3] 34668 clogl[SUSv3] hypotf[SUSv3] sinhf[SUSv3] 34669 conj[SUSv3] hypotl[SUSv3] sinhl[SUSv3] 34670 conjf[SUSv3] ilogb[SUSv3] sinl[SUSv3] 34671 conjl[SUSv3] ilogbf[SUSv3] sqrt[SUSv3] 34672 copysign[SUSv3] ilogbl[SUSv3] sqrtf[SUSv3] 34673 copysignf[SUSv3] j0[SUSv3] sqrtl[SUSv3] 34674 copysignl[SUSv3] j0f[LSB] tan[SUSv3] 34675 cos[SUSv3] j0l[LSB] tanf[SUSv3] 34676 cosf[SUSv3] j1[SUSv3] tanh[SUSv3] 34677 cosh[SUSv3] j1f[LSB] tanhf[SUSv3] 34678 coshf[SUSv3] j1l[LSB] tanhl[SUSv3] 34679 coshl[SUSv3] jn[SUSv3] tanl[SUSv3] 34680 cosl[SUSv3] jnf[LSB] tgamma[SUSv3] 34681 cpow[SUSv3] jnl[LSB] tgammaf[SUSv3] 34682 cpowf[SUSv3] ldexp[SUSv3] tgammal[SUSv3] 34683 cpowl[SUSv3] ldexpf[SUSv3] trunc[SUSv3] 34684 cproj[SUSv3] ldexpl[SUSv3] truncf[SUSv3] 34685 cprojf[SUSv3] lgamma[SUSv3] truncl[SUSv3] 34686 cprojl[SUSv3] lgamma_r[LSB] y0[SUSv3] 34687 creal[SUSv3] lgammaf[SUSv3] y0f[LSB] 34688 crealf[SUSv3] lgammaf_r[LSB] y0l[LSB] 34689 creall[SUSv3] lgammal[SUSv3] y1[SUSv3] 34690 csin[SUSv3] lgammal_r[LSB] y1f[LSB] 34691 csinf[SUSv3] llrint[SUSv3] y1l[LSB] 34692 csinh[SUSv3] llrintf[SUSv3] yn[SUSv3] 34693 csinhf[SUSv3] llrintl[SUSv3] ynf[LSB] 34694 csinhl[SUSv3] llround[SUSv3] ynl[LSB] 34695 34696 Table A-6. libm Data Interfaces 34697 signgam[SUSv3] 34698 __________________________________________________________ 34699 34700 A.5. libncurses 34701 34702 The behavior of the interfaces in this library is specified by 34703 the following Standards. 34704 34705 This Specification [LSB] 34706 X/Open Curses [SUS-CURSES] 34707 34708 Table A-7. libncurses Function Interfaces 34709 addch[SUS-CURSES] mvdelch[SUS-CURSES] slk_refresh[SUS-CURSES] 34710 addchnstr[SUS-CURSES] mvderwin[SUS-CURSES] 34711 slk_restore[SUS-CURSES] 34712 addchstr[SUS-CURSES] mvgetch[SUS-CURSES] slk_set[SUS-CURSES] 34713 addnstr[SUS-CURSES] mvgetnstr[SUS-CURSES] slk_touch[SUS-CURSES] 34714 addstr[SUS-CURSES] mvgetstr[SUS-CURSES] standend[SUS-CURSES] 34715 attr_get[SUS-CURSES] mvhline[SUS-CURSES] standout[SUS-CURSES] 34716 attr_off[SUS-CURSES] mvinch[SUS-CURSES] start_color[SUS-CURSES] 34717 attr_on[SUS-CURSES] mvinchnstr[LSB] subpad[SUS-CURSES] 34718 attr_set[SUS-CURSES] mvinchstr[LSB] subwin[SUS-CURSES] 34719 attroff[SUS-CURSES] mvinnstr[SUS-CURSES] syncok[SUS-CURSES] 34720 attron[SUS-CURSES] mvinsch[SUS-CURSES] termattrs[SUS-CURSES] 34721 attrset[SUS-CURSES] mvinsnstr[SUS-CURSES] termname[SUS-CURSES] 34722 baudrate[SUS-CURSES] mvinsstr[SUS-CURSES] tgetent[SUS-CURSES] 34723 beep[SUS-CURSES] mvinstr[LSB] tgetflag[SUS-CURSES] 34724 bkgd[SUS-CURSES] mvprintw[SUS-CURSES] tgetnum[SUS-CURSES] 34725 bkgdset[SUS-CURSES] mvscanw[LSB] tgetstr[SUS-CURSES] 34726 border[SUS-CURSES] mvvline[SUS-CURSES] tgoto[SUS-CURSES] 34727 box[SUS-CURSES] mvwaddch[SUS-CURSES] tigetflag[SUS-CURSES] 34728 can_change_color[SUS-CURSES] mvwaddchnstr[SUS-CURSES] 34729 tigetnum[SUS-CURSES] 34730 cbreak[SUS-CURSES] mvwaddchstr[SUS-CURSES] tigetstr[SUS-CURSES] 34731 chgat[SUS-CURSES] mvwaddnstr[SUS-CURSES] timeout[SUS-CURSES] 34732 clear[SUS-CURSES] mvwaddstr[SUS-CURSES] touchline[SUS-CURSES] 34733 clearok[SUS-CURSES] mvwchgat[SUS-CURSES] touchwin[SUS-CURSES] 34734 clrtobot[SUS-CURSES] mvwdelch[SUS-CURSES] tparm[SUS-CURSES] 34735 clrtoeol[SUS-CURSES] mvwgetch[SUS-CURSES] tputs[SUS-CURSES] 34736 color_content[SUS-CURSES] mvwgetnstr[SUS-CURSES] 34737 typeahead[SUS-CURSES] 34738 color_set[SUS-CURSES] mvwgetstr[SUS-CURSES] unctrl[SUS-CURSES] 34739 copywin[SUS-CURSES] mvwhline[SUS-CURSES] ungetch[SUS-CURSES] 34740 curs_set[SUS-CURSES] mvwin[SUS-CURSES] untouchwin[SUS-CURSES] 34741 def_prog_mode[SUS-CURSES] mvwinch[SUS-CURSES] 34742 use_env[SUS-CURSES] 34743 def_shell_mode[SUS-CURSES] mvwinchnstr[LSB] vidattr[SUS-CURSES] 34744 del_curterm[SUS-CURSES] mvwinchstr[LSB] vidputs[SUS-CURSES] 34745 delay_output[SUS-CURSES] mvwinnstr[SUS-CURSES] 34746 vline[SUS-CURSES] 34747 delch[SUS-CURSES] mvwinsch[SUS-CURSES] vw_printw[SUS-CURSES] 34748 deleteln[SUS-CURSES] mvwinsnstr[SUS-CURSES] vw_scanw[LSB] 34749 delscreen[SUS-CURSES] mvwinsstr[SUS-CURSES] 34750 vwprintw[SUS-CURSES] 34751 delwin[SUS-CURSES] mvwinstr[LSB] vwscanw[LSB] 34752 derwin[SUS-CURSES] mvwprintw[SUS-CURSES] waddch[SUS-CURSES] 34753 doupdate[SUS-CURSES] mvwscanw[LSB] waddchnstr[SUS-CURSES] 34754 dupwin[SUS-CURSES] mvwvline[SUS-CURSES] waddchstr[SUS-CURSES] 34755 echo[SUS-CURSES] napms[SUS-CURSES] waddnstr[SUS-CURSES] 34756 echochar[SUS-CURSES] newpad[SUS-CURSES] waddstr[SUS-CURSES] 34757 endwin[SUS-CURSES] newterm[SUS-CURSES] wattr_get[SUS-CURSES] 34758 erase[SUS-CURSES] newwin[SUS-CURSES] wattr_off[SUS-CURSES] 34759 erasechar[SUS-CURSES] nl[SUS-CURSES] wattr_on[SUS-CURSES] 34760 filter[SUS-CURSES] nocbreak[SUS-CURSES] wattr_set[SUS-CURSES] 34761 flash[SUS-CURSES] nodelay[SUS-CURSES] wattroff[SUS-CURSES] 34762 flushinp[SUS-CURSES] noecho[SUS-CURSES] wattron[SUS-CURSES] 34763 getbkgd[SUS-CURSES] nonl[SUS-CURSES] wattrset[SUS-CURSES] 34764 getch[SUS-CURSES] noqiflush[SUS-CURSES] wbkgd[SUS-CURSES] 34765 getnstr[SUS-CURSES] noraw[SUS-CURSES] wbkgdset[SUS-CURSES] 34766 getstr[SUS-CURSES] notimeout[SUS-CURSES] wborder[SUS-CURSES] 34767 getwin[SUS-CURSES] overlay[SUS-CURSES] wchgat[SUS-CURSES] 34768 halfdelay[SUS-CURSES] overwrite[SUS-CURSES] wclear[SUS-CURSES] 34769 has_colors[SUS-CURSES] pair_content[SUS-CURSES] 34770 wclrtobot[SUS-CURSES] 34771 has_ic[SUS-CURSES] pechochar[SUS-CURSES] wclrtoeol[SUS-CURSES] 34772 has_il[SUS-CURSES] pnoutrefresh[SUS-CURSES] 34773 wcolor_set[SUS-CURSES] 34774 hline[SUS-CURSES] prefresh[SUS-CURSES] wcursyncup[SUS-CURSES] 34775 idcok[SUS-CURSES] printw[SUS-CURSES] wdelch[SUS-CURSES] 34776 idlok[SUS-CURSES] putp[SUS-CURSES] wdeleteln[SUS-CURSES] 34777 immedok[SUS-CURSES] putwin[SUS-CURSES] wechochar[SUS-CURSES] 34778 inch[SUS-CURSES] qiflush[SUS-CURSES] werase[SUS-CURSES] 34779 inchnstr[LSB] raw[SUS-CURSES] wgetch[SUS-CURSES] 34780 inchstr[LSB] redrawwin[SUS-CURSES] wgetnstr[SUS-CURSES] 34781 init_color[SUS-CURSES] refresh[SUS-CURSES] wgetstr[SUS-CURSES] 34782 init_pair[SUS-CURSES] reset_prog_mode[SUS-CURSES] 34783 whline[SUS-CURSES] 34784 initscr[SUS-CURSES] reset_shell_mode[SUS-CURSES] 34785 winch[SUS-CURSES] 34786 innstr[SUS-CURSES] resetty[SUS-CURSES] winchnstr[LSB] 34787 insch[SUS-CURSES] restartterm[SUS-CURSES] winchstr[LSB] 34788 insdelln[SUS-CURSES] ripoffline[LSB] winnstr[SUS-CURSES] 34789 insertln[SUS-CURSES] savetty[SUS-CURSES] winsch[SUS-CURSES] 34790 insnstr[SUS-CURSES] scanw[LSB] winsdelln[SUS-CURSES] 34791 insstr[SUS-CURSES] scr_dump[SUS-CURSES] winsertln[SUS-CURSES] 34792 instr[LSB] scr_init[SUS-CURSES] winsnstr[SUS-CURSES] 34793 intrflush[SUS-CURSES] scr_restore[SUS-CURSES] 34794 winsstr[SUS-CURSES] 34795 is_linetouched[SUS-CURSES] scr_set[SUS-CURSES] winstr[LSB] 34796 is_wintouched[SUS-CURSES] scrl[SUS-CURSES] wmove[SUS-CURSES] 34797 isendwin[SUS-CURSES] scroll[SUS-CURSES] 34798 wnoutrefresh[SUS-CURSES] 34799 keyname[SUS-CURSES] scrollok[SUS-CURSES] wprintw[SUS-CURSES] 34800 keypad[SUS-CURSES] set_curterm[SUS-CURSES] 34801 wredrawln[SUS-CURSES] 34802 killchar[SUS-CURSES] set_term[SUS-CURSES] wrefresh[SUS-CURSES] 34803 leaveok[SUS-CURSES] setscrreg[SUS-CURSES] wscanw[LSB] 34804 longname[SUS-CURSES] setupterm[SUS-CURSES] wscrl[SUS-CURSES] 34805 meta[SUS-CURSES] slk_attr_set[SUS-CURSES] 34806 wsetscrreg[SUS-CURSES] 34807 move[SUS-CURSES] slk_attroff[SUS-CURSES] wstandend[SUS-CURSES] 34808 mvaddch[SUS-CURSES] slk_attron[SUS-CURSES] 34809 wstandout[SUS-CURSES] 34810 mvaddchnstr[SUS-CURSES] slk_attrset[SUS-CURSES] 34811 wsyncdown[SUS-CURSES] 34812 mvaddchstr[SUS-CURSES] slk_clear[SUS-CURSES] 34813 wsyncup[SUS-CURSES] 34814 mvaddnstr[SUS-CURSES] slk_color[SUS-CURSES] 34815 wtimeout[SUS-CURSES] 34816 mvaddstr[SUS-CURSES] slk_init[SUS-CURSES] wtouchln[SUS-CURSES] 34817 mvchgat[SUS-CURSES] slk_label[SUS-CURSES] wvline[SUS-CURSES] 34818 mvcur[LSB] slk_noutrefresh[SUS-CURSES] 34819 34820 Table A-8. libncurses Data Interfaces 34821 COLORS[SUS-CURSES] LINES[SUS-CURSES] curscr[SUS-CURSES] 34822 COLOR_PAIRS[SUS-CURSES] acs_map[SUS-CURSES] stdscr[SUS-CURSES] 34823 COLS[SUS-CURSES] cur_term[SUS-CURSES] 34824 __________________________________________________________ 34825 34826 A.6. libpam 34827 34828 The behavior of the interfaces in this library is specified by 34829 the following Standards. 34830 34831 This Specification [LSB] 34832 34833 Table A-9. libpam Function Interfaces 34834 pam_acct_mgmt[LSB] pam_fail_delay[LSB] pam_putenv[LSB] 34835 pam_authenticate[LSB] pam_get_item[LSB] pam_set_item[LSB] 34836 pam_chauthtok[LSB] pam_getenv[LSB] pam_setcred[LSB] 34837 pam_close_session[LSB] pam_getenvlist[LSB] pam_start[LSB] 34838 pam_end[LSB] pam_open_session[LSB] pam_strerror[LSB] 34839 __________________________________________________________ 34840 34841 A.7. libpthread 34842 34843 The behavior of the interfaces in this library is specified by 34844 the following Standards. 34845 34846 Large File Support [LFS] 34847 This Specification [LSB] 34848 ISO POSIX (2003) [SUSv3] 34849 POSIX 1003.1 2008 [SUSv4] 34850 34851 Table A-10. libpthread Function Interfaces 34852 _pthread_cleanup_pop[LSB] pthread_cond_timedwait[SUSv3] 34853 pthread_rwlock_init[SUSv3] 34854 _pthread_cleanup_push[LSB] pthread_cond_wait[SUSv3] 34855 pthread_rwlock_rdlock[SUSv3] 34856 lseek64[LFS] pthread_condattr_destroy[SUSv3] 34857 pthread_rwlock_timedrdlock[SUSv3] 34858 open64[LFS] pthread_condattr_getpshared[SUSv3] 34859 pthread_rwlock_timedwrlock[SUSv3] 34860 pread[SUSv3] pthread_condattr_init[SUSv3] 34861 pthread_rwlock_tryrdlock[SUSv3] 34862 pread64[LSB] pthread_condattr_setpshared[SUSv3] 34863 pthread_rwlock_trywrlock[SUSv3] 34864 pthread_attr_destroy[SUSv3] pthread_create[SUSv3] 34865 pthread_rwlock_unlock[SUSv3] 34866 pthread_attr_getdetachstate[SUSv3] pthread_detach[SUSv3] 34867 pthread_rwlock_wrlock[SUSv3] 34868 pthread_attr_getguardsize[SUSv3] pthread_equal[SUSv3] 34869 pthread_rwlockattr_destroy[SUSv3] 34870 pthread_attr_getinheritsched[SUSv3] pthread_exit[SUSv3] 34871 pthread_rwlockattr_getpshared[SUSv3] 34872 pthread_attr_getschedparam[SUSv3] pthread_getconcurrency[SUSv3] 34873 pthread_rwlockattr_init[SUSv3] 34874 pthread_attr_getschedpolicy[SUSv3] pthread_getcpuclockid[SUSv3] 34875 pthread_rwlockattr_setpshared[SUSv3] 34876 pthread_attr_getscope[SUSv3] pthread_getschedparam[SUSv3] 34877 pthread_self[SUSv3] 34878 pthread_attr_getstack[SUSv3] pthread_getspecific[SUSv3] 34879 pthread_setcancelstate[SUSv3] 34880 pthread_attr_getstackaddr[SUSv3] pthread_join[SUSv3] 34881 pthread_setcanceltype[SUSv3] 34882 pthread_attr_getstacksize[SUSv3] pthread_key_create[SUSv3] 34883 pthread_setconcurrency[SUSv3] 34884 pthread_attr_init[SUSv3] pthread_key_delete[SUSv3] 34885 pthread_setschedparam[SUSv3] 34886 pthread_attr_setdetachstate[SUSv3] pthread_kill[SUSv3] 34887 pthread_setschedprio(GLIBC_2.3.4)[SUSv3] 34888 pthread_attr_setguardsize[SUSv3] pthread_mutex_destroy[SUSv3] 34889 pthread_setspecific[SUSv3] 34890 pthread_attr_setinheritsched[SUSv3] 34891 pthread_mutex_getprioceiling(GLIBC_2.4)[SUSv4] 34892 pthread_sigmask[SUSv3] 34893 pthread_attr_setschedparam[SUSv3] pthread_mutex_init[SUSv3] 34894 pthread_spin_destroy[SUSv3] 34895 pthread_attr_setschedpolicy[SUSv3] pthread_mutex_lock[SUSv3] 34896 pthread_spin_init[SUSv3] 34897 pthread_attr_setscope[SUSv3] 34898 pthread_mutex_setprioceiling(GLIBC_2.4)[SUSv4] 34899 pthread_spin_lock[SUSv3] 34900 pthread_attr_setstack[SUSv3] pthread_mutex_timedlock[SUSv3] 34901 pthread_spin_trylock[SUSv3] 34902 pthread_attr_setstackaddr[SUSv3] pthread_mutex_trylock[SUSv3] 34903 pthread_spin_unlock[SUSv3] 34904 pthread_attr_setstacksize[SUSv3] pthread_mutex_unlock[SUSv3] 34905 pthread_testcancel[SUSv3] 34906 pthread_barrier_destroy[SUSv3] pthread_mutexattr_destroy[SUSv3] 34907 pwrite[SUSv3] 34908 pthread_barrier_init[SUSv3] 34909 pthread_mutexattr_getprioceiling(GLIBC_2.4)[SUSv4] 34910 pwrite64[LSB] 34911 pthread_barrier_wait[SUSv3] 34912 pthread_mutexattr_getprotocol(GLIBC_2.4)[SUSv4] 34913 sem_close[SUSv3] 34914 pthread_barrierattr_destroy[SUSv3] 34915 pthread_mutexattr_getpshared[SUSv3] sem_destroy[SUSv3] 34916 pthread_barrierattr_getpshared(GLIBC_2.3.3)[SUSv3] 34917 pthread_mutexattr_gettype[SUSv3] sem_getvalue[SUSv3] 34918 pthread_barrierattr_init[SUSv3] pthread_mutexattr_init[SUSv3] 34919 sem_init[SUSv3] 34920 pthread_barrierattr_setpshared[SUSv3] 34921 pthread_mutexattr_setprioceiling(GLIBC_2.4)[SUSv4] 34922 sem_open[SUSv3] 34923 pthread_cancel[SUSv3] 34924 pthread_mutexattr_setprotocol(GLIBC_2.4)[SUSv4] sem_post[SUSv3] 34925 pthread_cond_broadcast[SUSv3] 34926 pthread_mutexattr_setpshared[SUSv3] sem_timedwait[SUSv3] 34927 pthread_cond_destroy[SUSv3] pthread_mutexattr_settype[SUSv3] 34928 sem_trywait[SUSv3] 34929 pthread_cond_init[SUSv3] pthread_once[SUSv3] sem_unlink[SUSv3] 34930 pthread_cond_signal[SUSv3] pthread_rwlock_destroy[SUSv3] 34931 sem_wait[SUSv3] 34932 __________________________________________________________ 34933 34934 A.8. librt 34935 34936 The behavior of the interfaces in this library is specified by 34937 the following Standards. 34938 34939 ISO POSIX (2003) [SUSv3] 34940 34941 Table A-11. librt Function Interfaces 34942 clock_getcpuclockid[SUSv3] mq_open(GLIBC_2.3.4)[SUSv3] 34943 shm_unlink[SUSv3] 34944 clock_getres[SUSv3] mq_receive(GLIBC_2.3.4)[SUSv3] 34945 timer_create[SUSv3] 34946 clock_gettime[SUSv3] mq_send(GLIBC_2.3.4)[SUSv3] 34947 timer_delete[SUSv3] 34948 clock_nanosleep[SUSv3] mq_setattr(GLIBC_2.3.4)[SUSv3] 34949 timer_getoverrun[SUSv3] 34950 clock_settime[SUSv3] mq_timedreceive(GLIBC_2.3.4)[SUSv3] 34951 timer_gettime[SUSv3] 34952 mq_close(GLIBC_2.3.4)[SUSv3] mq_timedsend(GLIBC_2.3.4)[SUSv3] 34953 timer_settime[SUSv3] 34954 mq_getattr(GLIBC_2.3.4)[SUSv3] mq_unlink(GLIBC_2.3.4)[SUSv3] 34955 mq_notify(GLIBC_2.3.4)[SUSv3] shm_open[SUSv3] 34956 __________________________________________________________ 34957 34958 A.9. libutil 34959 34960 The behavior of the interfaces in this library is specified by 34961 the following Standards. 34962 34963 This Specification [LSB] 34964 34965 Table A-12. libutil Function Interfaces 34966 forkpty[LSB] login_tty[LSB] logwtmp[LSB] 34967 login[LSB] logout[LSB] openpty[LSB] 34968 __________________________________________________________ 34969 34970 A.10. libz 34971 34972 The behavior of the interfaces in this library is specified by 34973 the following Standards. 34974 34975 This Specification [LSB] 34976 34977 Table A-13. libz Function Interfaces 34978 adler32[LSB] gzclose[LSB] gztell[LSB] 34979 compress[LSB] gzdopen[LSB] gzwrite[LSB] 34980 compress2[LSB] gzeof[LSB] inflate[LSB] 34981 compressBound[LSB] gzerror[LSB] inflateEnd[LSB] 34982 crc32[LSB] gzflush[LSB] inflateInit2_[LSB] 34983 deflate[LSB] gzgetc[LSB] inflateInit_[LSB] 34984 deflateBound[LSB] gzgets[LSB] inflateReset[LSB] 34985 deflateCopy[LSB] gzopen[LSB] inflateSetDictionary[LSB] 34986 deflateEnd[LSB] gzprintf[LSB] inflateSync[LSB] 34987 deflateInit2_[LSB] gzputc[LSB] inflateSyncPoint[LSB] 34988 deflateInit_[LSB] gzputs[LSB] uncompress[LSB] 34989 deflateParams[LSB] gzread[LSB] zError[LSB] 34990 deflateReset[LSB] gzrewind[LSB] zlibVersion[LSB] 34991 deflateSetDictionary[LSB] gzseek[LSB] 34992 get_crc_table[LSB] gzsetparams[LSB] 34993 __________________________________________________________ 34994 34995 Appendix B. Future Directions (Informative) 34996 34997 B.1. Introduction 34998 34999 This appendix describes interfaces that are under development 35000 and aimed at future releases of this specification. At this 35001 stage, such interfaces are at best recommended practice, and do 35002 not constitute normative requirements of this specification. 35003 Applications may not assume that any system provides these 35004 interfaces. 35005 35006 We encourage system implementors and ISVs to provide these 35007 interfaces, and to provide feedback on their specification to 35008 lsbspec@freestandards.org. These interfaces may well be further 35009 modified during the development process, and may be withdrawn 35010 if concensus cannot be reached. 35011 __________________________________________________________ 35012 35013 B.2. Commands And Utilities 35014 35015 Table of Contents 35016 lsbinstall -- installation tool for various types of data 35017 35018 lsbinstall 35019 35020 Name 35021 35022 lsbinstall -- installation tool for various types of data 35023 35024 Synopsis 35025 35026 /usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] { -t 35027 type | --type=type } [-p package | --package=package] 35028 operand... 35029 35030 Description 35031 35032 The lsbinstall utility may be used to install certain types of 35033 files into system specific locations, repositories, or 35034 databases. This command may be used during a package post 35035 installation script to add package specific data to system wide 35036 repositories. A user may need appropriate privilege to invoke 35037 lsbinstall. 35038 35039 The operand (or operands) name an object of type type (see 35040 below) that belongs to a package named package. The combination 35041 of package name, object type and object name should be unique 35042 amongst all objects installed by lsbinstall. The lsbinstall 35043 utility may rename an object if another package already owns an 35044 object of the same type with the same name. 35045 35046 Note: If a namespace collision is detected by lsbinstall, it 35047 is unspecified how the object is renamed, although typical 35048 implementations may prepend the package name to the object 35049 in some way (e.g. package.obj-name). The lsbinstall utility 35050 may maintain a database of the mappings it has performed 35051 during installation in order to ensure that the correct 35052 object is removed during a subsequent removal operation. 35053 35054 Scripts installed by lsbinstall should not make use of the 35055 script name in order to decide on their functionality. 35056 35057 Note: It is appropriate for such a script to use the script 35058 name in error messages, usage statements, etc. The only 35059 guarantee made by lsbinstall is the effect that an 35060 installation (or removal) should have, not where a script is 35061 installed, or how it is named. 35062 35063 The -p pkg or --package=pkg is required for all object types 35064 unless explicitly noted below. 35065 35066 If the -c or --check option is specified, lsbinstall should 35067 test to see if there is an existing object of the type 35068 specified already installed. If there is, lsbinstall should 35069 print a message to its standard output and immediately exit 35070 with a status of zero. If there is no object of the type and 35071 name specified already installed, lsbinstall should exit with a 35072 non-zero status and take no further action. 35073 35074 If the -r or --remove is specified, the named object of the 35075 specified type should be removed or disabled from the system, 35076 except as noted below. The behavior is unspecified if the named 35077 object was not previously installed by lsbinstall. 35078 35079 Note: lsbinstall may rename objects during installation in 35080 order to prevent name collisions where another package has 35081 already installed an object with the given name. Using 35082 lsbinstall --remove will remove only the object belonging to 35083 the named package, and not the object belonging to another 35084 package. 35085 35086 Also note that the intent of the --remove option is to 35087 prevent the effect of the installed object; it should be 35088 sufficient to disable or comment out the addition in some 35089 way, while leaving the content behind. It is not intended 35090 that --remove be required to be the exact reverse of 35091 installation. 35092 35093 Object Types 35094 35095 The -t type or --type=type option should support at least the 35096 following types: 35097 35098 profile 35099 35100 install a profile script into a system specific location. There 35101 should be one operand, that names a profile shell script. The 35102 behavior is unspecified if this name does not have the suffix 35103 .sh. 35104 35105 The sh utility should read and execute commands in its current 35106 execution environment from all such installed profile shell 35107 scripts when invoked as an interactive login shell, or if the 35108 -l (the letter ell) is specified (see Shell Invocation). 35109 service 35110 35111 ensure a service name and number pair is known to the system 35112 service database. When installing, there must be at least two 35113 operands. The first operand should have the format %d/%s with 35114 the port number and protocol values (e.g. 22/tcp), and the 35115 second operand should be the name of the service. Any 35116 subsequent operands provide aliases for this service. The -p 35117 pkg or --package=pkg option is not required for service 35118 objects, and is ignored if specified. If any of the -r, 35119 --remove, -c or --check options are specified, there should be 35120 a single operand identifying the port and protocol values (with 35121 the same format as above). 35122 35123 It should not be an error to attempt to add a service name to 35124 the system service database if that service name already exists 35125 for the same port and protocol combination. If the port and 35126 protocol combination was already present, but the name unknown, 35127 the name should be added as an alias to the existing entry. It 35128 should be an error to attempt to add a second entry for a given 35129 service name and protocol, but where the port number differs 35130 from an existing entry. 35131 35132 If the -r or --remove is specified, the system service database 35133 need not be updated to remove or disable the named service. 35134 inet 35135 35136 add an entry to the system's network super daemon 35137 configuration. If none of the -r, --remove, -c or --check 35138 options are specified, the first operand should have the 35139 format: 35140 "%s:%s:%s:%s:%s:%s" 35141 35142 Otherwise, the first operand should have the format 35143 "%s:%s" 35144 35145 The fields in the first operand have the following meaning, in 35146 order: 35147 35148 svc_name 35149 35150 The name of this service. If the name does not contain a /, 35151 this should match the name of an already installed service (see 35152 also getservbyname()). If the name contains a / character, the 35153 behavior is unspecified. 35154 35155 Rationale: This version of the LSB does not specify 35156 getrpcbyname() nor the existence or format of the /etc/rpc 35157 file. Therefore, installation of RPC based services is not 35158 specified at this point. A future version of this 35159 specification may require names containing a / character to 35160 be Remote Procedure Call based services. 35161 35162 protocol 35163 35164 The name of a protocol. The name should be one of those listed 35165 in /etc/protocols. If this attribute is not specified (i.e. a 35166 null value is passed), the system should use an implementation 35167 defined default protocol. 35168 socket_type 35169 35170 One of the following values: 35171 35172 stream 35173 35174 the service will use a stream type socket. 35175 dgram 35176 35177 the service will use a datagram type socket. 35178 seqpacket 35179 35180 the service will use a sequenced packet type socket. 35181 This field is not required for the -c, --check, -r, or --remove 35182 options. 35183 wait_flag 35184 35185 If the value of this attribute is wait, once the service is 35186 started, no further requests for that service will be handled 35187 until the service exits. If the value is nowait, the network 35188 super daemon should continue to handle further requests for the 35189 given service while that service is running. 35190 35191 Note: If the service has the socket_type attribute set to 35192 dgram, the wait_flag attribute should be set to wait, since 35193 such services do not have any distinction between the socket 35194 used for listening and that used for accepting. 35195 35196 This field is not required for the -c, --check, -r, or --remove 35197 options. 35198 user[.group] 35199 35200 The name of a user from the user login database, optionally 35201 followed by the name of a group from the group database. The 35202 service started to handle this request should run with the 35203 privileges of the specified user and group. This field is not 35204 required for the -c, --check, -r, or --remove options. 35205 server [arg ...] 35206 35207 The name of a program to run to handle the request, optionally 35208 followed by any arguments required. The server name and each of 35209 its arguments is separated by whitespace. This field is not 35210 required for the -c, --check, -r, or --remove options. 35211 If the implementation supports additional controls over 35212 services started through the inet super daemon, there may be 35213 additional, implementation-defined, operands. 35214 35215 Rationale: Systems that use the xinetd super daemon may 35216 support additional controls such as IP address restrictions, 35217 logging requirements, etc. The LSB does not require these 35218 additional controls. However, it was believed to be of 35219 sufficient benefit that implementations are granted 35220 permission to extend this interface as required. 35221 35222 Examples 35223 35224 lsbinstall --package=myapp --type=profile myco.com-prod.sh 35225 35226 Install the profile shell script for myco.com-prod.sh, part of 35227 the myapp package.. 35228 lsbinstall --package=myapp --check --type=profile myco.com-prod.sh 35229 35230 Test to see if the profile shell script for myco.com-prod.sh, 35231 as part of the myapp package, is installed correctly. 35232 35233 Exit Status 35234 35235 If the -c or --check option is specified, lsbinstall should 35236 exit with a zero status if an object of the specified type and 35237 name is already installed, or non-zero otherwise. Otherwise, 35238 lsbinstall should exit with a zero status if the object with 35239 the specified type and name was successfully installed (or 35240 removed if the -r or --remove option was specified), and 35241 non-zero if the installation (or removal) failed. On failure, a 35242 diagnostic message should be printed to the standard error file 35243 descriptor. 35244 __________________________________________________________ 35245 35246 Appendix C. GNU Free Documentation License (Informative) 35247 35248 This specification is published under the terms of the GNU Free 35249 Documentation License, Version 1.1, March 2000 35250 35251 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 35252 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 35253 permitted to copy and distribute verbatim copies of this 35254 license document, but changing it is not allowed. 35255 __________________________________________________________ 35256 35257 C.1. PREAMBLE 35258 35259 The purpose of this License is to make a manual, textbook, or 35260 other written document "free" in the sense of freedom: to 35261 assure everyone the effective freedom to copy and redistribute 35262 it, with or without modifying it, either commercially or 35263 noncommercially. Secondarily, this License preserves for the 35264 author and publisher a way to get credit for their work, while 35265 not being considered responsible for modifications made by 35266 others. 35267 35268 This License is a kind of "copyleft", which means that 35269 derivative works of the document must themselves be free in the 35270 same sense. It complements the GNU General Public License, 35271 which is a copyleft license designed for free software. 35272 35273 We have designed this License in order to use it for manuals 35274 for free software, because free software needs free 35275 documentation: a free program should come with manuals 35276 providing the same freedoms that the software does. But this 35277 License is not limited to software manuals; it can be used for 35278 any textual work, regardless of subject matter or whether it is 35279 published as a printed book. We recommend this License 35280 principally for works whose purpose is instruction or 35281 reference. 35282 __________________________________________________________ 35283 35284 C.2. APPLICABILITY AND DEFINITIONS 35285 35286 This License applies to any manual or other work that contains 35287 a notice placed by the copyright holder saying it can be 35288 distributed under the terms of this License. The "Document", 35289 below, refers to any such manual or work. Any member of the 35290 public is a licensee, and is addressed as "you". 35291 35292 A "Modified Version" of the Document means any work containing 35293 the Document or a portion of it, either copied verbatim, or 35294 with modifications and/or translated into another language. 35295 35296 A "Secondary Section" is a named appendix or a front-matter 35297 section of the Document that deals exclusively with the 35298 relationship of the publishers or authors of the Document to 35299 the Document's overall subject (or to related matters) and 35300 contains nothing that could fall directly within that overall 35301 subject. (For example, if the Document is in part a textbook of 35302 mathematics, a Secondary Section may not explain any 35303 mathematics.) The relationship could be a matter of historical 35304 connection with the subject or with related matters, or of 35305 legal, commercial, philosophical, ethical or political position 35306 regarding them. 35307 35308 The "Invariant Sections" are certain Secondary Sections whose 35309 titles are designated, as being those of Invariant Sections, in 35310 the notice that says that the Document is released under this 35311 License. 35312 35313 The "Cover Texts" are certain short passages of text that are 35314 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 35315 that says that the Document is released under this License. 35316 35317 A "Transparent" copy of the Document means a machine-readable 35318 copy, represented in a format whose specification is available 35319 to the general public, whose contents can be viewed and edited 35320 directly and straightforwardly with generic text editors or 35321 (for images composed of pixels) generic paint programs or (for 35322 drawings) some widely available drawing editor, and that is 35323 suitable for input to text formatters or for automatic 35324 translation to a variety of formats suitable for input to text 35325 formatters. A copy made in an otherwise Transparent file format 35326 whose markup has been designed to thwart or discourage 35327 subsequent modification by readers is not Transparent. A copy 35328 that is not "Transparent" is called "Opaque". 35329 35330 Examples of suitable formats for Transparent copies include 35331 plain ASCII without markup, Texinfo input format, LaTeX input 35332 format, SGML or XML using a publicly available DTD, and 35333 standard-conforming simple HTML designed for human 35334 modification. Opaque formats include PostScript, PDF, 35335 proprietary formats that can be read and edited only by 35336 proprietary word processors, SGML or XML for which the DTD 35337 and/or processing tools are not generally available, and the 35338 machine-generated HTML produced by some word processors for 35339 output purposes only. 35340 35341 The "Title Page" means, for a printed book, the title page 35342 itself, plus such following pages as are needed to hold, 35343 legibly, the material this License requires to appear in the 35344 title page. For works in formats which do not have any title 35345 page as such, "Title Page" means the text near the most 35346 prominent appearance of the work's title, preceding the 35347 beginning of the body of the text. 35348 __________________________________________________________ 35349 35350 C.3. VERBATIM COPYING 35351 35352 You may copy and distribute the Document in any medium, either 35353 commercially or noncommercially, provided that this License, 35354 the copyright notices, and the license notice saying this 35355 License applies to the Document are reproduced in all copies, 35356 and that you add no other conditions whatsoever to those of 35357 this License. You may not use technical measures to obstruct or 35358 control the reading or further copying of the copies you make 35359 or distribute. However, you may accept compensation in exchange 35360 for copies. If you distribute a large enough number of copies 35361 you must also follow the conditions in section 3. 35362 35363 You may also lend copies, under the same conditions stated 35364 above, and you may publicly display copies. 35365 __________________________________________________________ 35366 35367 C.4. COPYING IN QUANTITY 35368 35369 If you publish printed copies of the Document numbering more 35370 than 100, and the Document's license notice requires Cover 35371 Texts, you must enclose the copies in covers that carry, 35372 clearly and legibly, all these Cover Texts: Front-Cover Texts 35373 on the front cover, and Back-Cover Texts on the back cover. 35374 Both covers must also clearly and legibly identify you as the 35375 publisher of these copies. The front cover must present the 35376 full title with all words of the title equally prominent and 35377 visible. You may add other material on the covers in addition. 35378 Copying with changes limited to the covers, as long as they 35379 preserve the title of the Document and satisfy these 35380 conditions, can be treated as verbatim copying in other 35381 respects. 35382 35383 If the required texts for either cover are too voluminous to 35384 fit legibly, you should put the first ones listed (as many as 35385 fit reasonably) on the actual cover, and continue the rest onto 35386 adjacent pages. 35387 35388 If you publish or distribute Opaque copies of the Document 35389 numbering more than 100, you must either include a 35390 machine-readable Transparent copy along with each Opaque copy, 35391 or state in or with each Opaque copy a publicly-accessible 35392 computer-network location containing a complete Transparent 35393 copy of the Document, free of added material, which the general 35394 network-using public has access to download anonymously at no 35395 charge using public-standard network protocols. If you use the 35396 latter option, you must take reasonably prudent steps, when you 35397 begin distribution of Opaque copies in quantity, to ensure that 35398 this Transparent copy will remain thus accessible at the stated 35399 location until at least one year after the last time you 35400 distribute an Opaque copy (directly or through your agents or 35401 retailers) of that edition to the public. 35402 35403 It is requested, but not required, that you contact the authors 35404 of the Document well before redistributing any large number of 35405 copies, to give them a chance to provide you with an updated 35406 version of the Document. 35407 __________________________________________________________ 35408 35409 C.5. MODIFICATIONS 35410 35411 You may copy and distribute a Modified Version of the Document 35412 under the conditions of sections 2 and 3 above, provided that 35413 you release the Modified Version under precisely this License, 35414 with the Modified Version filling the role of the Document, 35415 thus licensing distribution and modification of the Modified 35416 Version to whoever possesses a copy of it. In addition, you 35417 must do these things in the Modified Version: 35418 35419 A. Use in the Title Page (and on the covers, if any) a title 35420 distinct from that of the Document, and from those of 35421 previous versions (which should, if there were any, be 35422 listed in the History section of the Document). You may use 35423 the same title as a previous version if the original 35424 publisher of that version gives permission. 35425 B. List on the Title Page, as authors, one or more persons or 35426 entities responsible for authorship of the modifications in 35427 the Modified Version, together with at least five of the 35428 principal authors of the Document (all of its principal 35429 authors, if it has less than five). 35430 C. State on the Title page the name of the publisher of the 35431 Modified Version, as the publisher. 35432 D. Preserve all the copyright notices of the Document. 35433 E. Add an appropriate copyright notice for your modifications 35434 adjacent to the other copyright notices. 35435 F. Include, immediately after the copyright notices, a license 35436 notice giving the public permission to use the Modified 35437 Version under the terms of this License, in the form shown 35438 in the Addendum below. 35439 G. Preserve in that license notice the full lists of Invariant 35440 Sections and required Cover Texts given in the Document's 35441 license notice. 35442 H. Include an unaltered copy of this License. 35443 I. Preserve the section entitled "History", and its title, and 35444 add to it an item stating at least the title, year, new 35445 authors, and publisher of the Modified Version as given on 35446 the Title Page. If there is no section entitled "History" 35447 in the Document, create one stating the title, year, 35448 authors, and publisher of the Document as given on its 35449 Title Page, then add an item describing the Modified 35450 Version as stated in the previous sentence. 35451 J. Preserve the network location, if any, given in the 35452 Document for public access to a Transparent copy of the 35453 Document, and likewise the network locations given in the 35454 Document for previous versions it was based on. These may 35455 be placed in the "History" section. You may omit a network 35456 location for a work that was published at least four years 35457 before the Document itself, or if the original publisher of 35458 the version it refers to gives permission. 35459 K. In any section entitled "Acknowledgements" or 35460 "Dedications", preserve the section's title, and preserve 35461 in the section all the substance and tone of each of the 35462 contributor acknowledgements and/or dedications given 35463 therein. 35464 L. Preserve all the Invariant Sections of the Document, 35465 unaltered in their text and in their titles. Section 35466 numbers or the equivalent are not considered part of the 35467 section titles. 35468 M. Delete any section entitled "Endorsements". Such a section 35469 may not be included in the Modified Version. 35470 N. Do not retitle any existing section as "Endorsements" or to 35471 conflict in title with any Invariant Section. 35472 35473 If the Modified Version includes new front-matter sections or 35474 appendices that qualify as Secondary Sections and contain no 35475 material copied from the Document, you may at your option 35476 designate some or all of these sections as invariant. To do 35477 this, add their titles to the list of Invariant Sections in the 35478 Modified Version's license notice. These titles must be 35479 distinct from any other section titles. 35480 35481 You may add a section entitled "Endorsements", provided it 35482 contains nothing but endorsements of your Modified Version by 35483 various parties--for example, statements of peer review or that 35484 the text has been approved by an organization as the 35485 authoritative definition of a standard. 35486 35487 You may add a passage of up to five words as a Front-Cover 35488 Text, and a passage of up to 25 words as a Back-Cover Text, to 35489 the end of the list of Cover Texts in the Modified Version. 35490 Only one passage of Front-Cover Text and one of Back-Cover Text 35491 may be added by (or through arrangements made by) any one 35492 entity. If the Document already includes a cover text for the 35493 same cover, previously added by you or by arrangement made by 35494 the same entity you are acting on behalf of, you may not add 35495 another; but you may replace the old one, on explicit 35496 permission from the previous publisher that added the old one. 35497 35498 The author(s) and publisher(s) of the Document do not by this 35499 License give permission to use their names for publicity for or 35500 to assert or imply endorsement of any Modified Version. 35501 __________________________________________________________ 35502 35503 C.6. COMBINING DOCUMENTS 35504 35505 You may combine the Document with other documents released 35506 under this License, under the terms defined in section 4 above 35507 for modified versions, provided that you include in the 35508 combination all of the Invariant Sections of all of the 35509 original documents, unmodified, and list them all as Invariant 35510 Sections of your combined work in its license notice. 35511 35512 The combined work need only contain one copy of this License, 35513 and multiple identical Invariant Sections may be replaced with 35514 a single copy. If there are multiple Invariant Sections with 35515 the same name but different contents, make the title of each 35516 such section unique by adding at the end of it, in parentheses, 35517 the name of the original author or publisher of that section if 35518 known, or else a unique number. Make the same adjustment to the 35519 section titles in the list of Invariant Sections in the license 35520 notice of the combined work. 35521 35522 In the combination, you must combine any sections entitled 35523 "History" in the various original documents, forming one 35524 section entitled "History"; likewise combine any sections 35525 entitled "Acknowledgements", and any sections entitled 35526 "Dedications". You must delete all sections entitled 35527 "Endorsements." 35528 __________________________________________________________ 35529 35530 C.7. COLLECTIONS OF DOCUMENTS 35531 35532 You may make a collection consisting of the Document and other 35533 documents released under this License, and replace the 35534 individual copies of this License in the various documents with 35535 a single copy that is included in the collection, provided that 35536 you follow the rules of this License for verbatim copying of 35537 each of the documents in all other respects. 35538 35539 You may extract a single document from such a collection, and 35540 distribute it individually under this License, provided you 35541 insert a copy of this License into the extracted document, and 35542 follow this License in all other respects regarding verbatim 35543 copying of that document. 35544 __________________________________________________________ 35545 35546 C.8. AGGREGATION WITH INDEPENDENT WORKS 35547 35548 A compilation of the Document or its derivatives with other 35549 separate and independent documents or works, in or on a volume 35550 of a storage or distribution medium, does not as a whole count 35551 as a Modified Version of the Document, provided no compilation 35552 copyright is claimed for the compilation. Such a compilation is 35553 called an "aggregate", and this License does not apply to the 35554 other self-contained works thus compiled with the Document, on 35555 account of their being thus compiled, if they are not 35556 themselves derivative works of the Document. 35557 35558 If the Cover Text requirement of section 3 is applicable to 35559 these copies of the Document, then if the Document is less than 35560 one quarter of the entire aggregate, the Document's Cover Texts 35561 may be placed on covers that surround only the Document within 35562 the aggregate. Otherwise they must appear on covers around the 35563 whole aggregate. 35564 __________________________________________________________ 35565 35566 C.9. TRANSLATION 35567 35568 Translation is considered a kind of modification, so you may 35569 distribute translations of the Document under the terms of 35570 section 4. Replacing Invariant Sections with translations 35571 requires special permission from their copyright holders, but 35572 you may include translations of some or all Invariant Sections 35573 in addition to the original versions of these Invariant 35574 Sections. You may include a translation of this License 35575 provided that you also include the original English version of 35576 this License. In case of a disagreement between the translation 35577 and the original English version of this License, the original 35578 English version will prevail. 35579 __________________________________________________________ 35580 35581 C.10. TERMINATION 35582 35583 You may not copy, modify, sublicense, or distribute the 35584 Document except as expressly provided for under this License. 35585 Any other attempt to copy, modify, sublicense or distribute the 35586 Document is void, and will automatically terminate your rights 35587 under this License. However, parties who have received copies, 35588 or rights, from you under this License will not have their 35589 licenses terminated so long as such parties remain in full 35590 compliance. 35591 __________________________________________________________ 35592 35593 C.11. FUTURE REVISIONS OF THIS LICENSE 35594 35595 The Free Software Foundation may publish new, revised versions 35596 of the GNU Free Documentation License from time to time. Such 35597 new versions will be similar in spirit to the present version, 35598 but may differ in detail to address new problems or concerns. 35599 See http://www.gnu.org/copyleft/. 35600 35601 Each version of the License is given a distinguishing version 35602 number. If the Document specifies that a particular numbered 35603 version of this License "or any later version" applies to it, 35604 you have the option of following the terms and conditions 35605 either of that specified version or of any later version that 35606 has been published (not as a draft) by the Free Software 35607 Foundation. If the Document does not specify a version number 35608 of this License, you may choose any version ever published (not 35609 as a draft) by the Free Software Foundation. 35610 __________________________________________________________ 35611 35612 C.12. How to use this License for your documents 35613 35614 To use this License in a document you have written, include a 35615 copy of the License in the document and put the following 35616 copyright and license notices just after the title page: 35617 35618 Copyright (c) YEAR YOUR NAME. Permission is granted to copy, 35619 distribute and/or modify this document under the terms of 35620 the GNU Free Documentation License, Version 1.1 or any later 35621 version published by the Free Software Foundation; with the 35622 Invariant Sections being LIST THEIR TITLES, with the 35623 Front-Cover Texts being LIST, and with the Back-Cover Texts 35624 being LIST. A copy of the license is included in the section 35625 entitled "GNU Free Documentation License". 35626 35627 If you have no Invariant Sections, write "with no Invariant 35628 Sections" instead of saying which ones are invariant. If you 35629 have no Front-Cover Texts, write "no Front-Cover Texts" instead 35630 of "Front-Cover Texts being LIST"; likewise for Back-Cover 35631 Texts. 35632 35633 If your document contains nontrivial examples of program code, 35634 we recommend releasing these examples in parallel under your 35635 choice of free software license, such as the GNU General Public 35636 License, to permit their use in free software.