1 Linux Standard Base Core Specification 4.1 2 3 Copyright © 2010 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 Status of this Document 57 Introduction 58 I. Introductory Elements 59 60 1. Scope 61 62 1.1. General 63 1.2. Module Specific Scope 64 65 2. References 66 67 2.1. Normative References 68 2.2. Informative References/Bibliography 69 70 3. Requirements 71 72 3.1. Relevant Libraries 73 3.2. LSB Implementation Conformance 74 3.3. LSB Application Conformance 75 76 4. Terms and Definitions 77 5. Documentation Conventions 78 6. Relationship To ISO/IEC 9945 POSIX 79 7. Relationship To Other Linux Foundation Specifications 80 81 II. Executable And Linking Format (ELF) 82 83 8. Introduction 84 9. Low Level System Information 85 86 9.1. Operating System Interface 87 9.2. Machine Interface 88 89 10. Object Format 90 91 10.1. Object Files 92 10.2. Sections 93 10.3. Special Sections 94 10.4. Symbol Mapping 95 10.5. DWARF Extensions 96 10.6. Exception Frames 97 10.7. Symbol Versioning 98 10.8. ABI note tag 99 100 11. Dynamic Linking 101 102 11.1. Program Loading and Dynamic Linking 103 11.2. Program Header 104 11.3. Dynamic Entries 105 106 III. Base Libraries 107 108 12. Base Libraries 109 110 12.1. Introduction 111 12.2. Program Interpreter 112 12.3. Interfaces for libc 113 12.4. Data Definitions for libc 114 12.5. Interface Definitions for libc 115 12.6. Interfaces for libm 116 12.7. Data Definitions for libm 117 12.8. Interface Definitions for libm 118 12.9. Interfaces for libpthread 119 12.10. Data Definitions for libpthread 120 12.11. Interface Definitions for libpthread 121 12.12. Interfaces for libgcc_s 122 12.13. Data Definitions for libgcc_s 123 12.14. Interface Definitions for libgcc_s 124 12.15. Interfaces for libdl 125 12.16. Data Definitions for libdl 126 12.17. Interface Definitions for libdl 127 12.18. Interfaces for librt 128 12.19. Data Definitions for librt 129 12.20. Interfaces for libcrypt 130 12.21. Interfaces for libpam 131 12.22. Data Definitions for libpam 132 12.23. Interface Definitions for libpam 133 134 IV. Utility Libraries 135 136 13. Utility Libraries 137 138 13.1. Introduction 139 13.2. Interfaces for libz 140 13.3. Data Definitions for libz 141 13.4. Interface Definitions for libz 142 13.5. Interfaces for libncurses 143 13.6. Data Definitions for libncurses 144 13.7. Interface Definitions for libncurses 145 13.8. Interfaces for libutil 146 13.9. Interface Definitions for libutil 147 148 V. Network Security Services 149 150 14. Libraries 151 152 14.1. Interfaces for libnspr4 153 14.2. Data Definitions for libnspr4 154 14.3. Interfaces for libnss3 155 14.4. Data Definitions for libnss3 156 14.5. Interfaces for libssl3 157 14.6. Data Definitions for libssl3 158 159 VI. Commands and Utilities 160 161 15. Commands and Utilities 162 163 15.1. Commands and Utilities 164 15.2. Command Behavior 165 166 VII. Execution Environment 167 168 16. File System Hierarchy 169 170 16.1. /dev: Device Files 171 16.2. /etc: Host-specific system configuration 172 16.3. User Accounting Databases 173 16.4. Path For System Administration Utilities 174 175 17. Additional Recommendations 176 177 17.1. Recommendations for applications on ownership 178 and permissions 179 180 18. Additional Behaviors 181 182 18.1. Mandatory Optional Behaviors 183 18.2. Optional Mandatory Behaviors 184 18.3. Executable Scripts 185 186 19. Localization 187 188 19.1. Introduction 189 19.2. Regular Expressions 190 19.3. Pattern Matching Notation 191 192 VIII. System Initialization 193 194 20. System Initialization 195 196 20.1. Cron Jobs 197 20.2. Init Script Actions 198 20.3. Comment Conventions for Init Scripts 199 20.4. Installation and Removal of Init Scripts 200 20.5. Run Levels 201 20.6. Facility Names 202 20.7. Script Names 203 20.8. Init Script Functions 204 205 IX. Users & Groups 206 207 21. Users & Groups 208 209 21.1. User and Group Database 210 21.2. User & Group Names 211 21.3. User ID Ranges 212 21.4. Rationale 213 214 X. Package Format and Installation 215 216 22. Software Installation 217 218 22.1. Introduction 219 22.2. Package File Format 220 22.3. Package Script Restrictions 221 22.4. Package Tools 222 22.5. Package Naming 223 22.6. Package Dependencies 224 22.7. Package Architecture Considerations 225 226 A. Alphabetical Listing of Interfaces 227 228 A.1. libc 229 A.2. libcrypt 230 A.3. libdl 231 A.4. libgcc_s 232 A.5. libm 233 A.6. libncurses 234 A.7. libpam 235 A.8. libpthread 236 A.9. librt 237 A.10. libutil 238 A.11. libz 239 240 B. GNU Free Documentation License (Informative) 241 242 B.1. PREAMBLE 243 B.2. APPLICABILITY AND DEFINITIONS 244 B.3. VERBATIM COPYING 245 B.4. COPYING IN QUANTITY 246 B.5. MODIFICATIONS 247 B.6. COMBINING DOCUMENTS 248 B.7. COLLECTIONS OF DOCUMENTS 249 B.8. AGGREGATION WITH INDEPENDENT WORKS 250 B.9. TRANSLATION 251 B.10. TERMINATION 252 B.11. FUTURE REVISIONS OF THIS LICENSE 253 B.12. How to use this License for your documents 254 255 List of Figures 256 10-1. Version Definition Entries 257 10-2. Version Definition Auxiliary Entries 258 10-3. Version Needed Entries 259 10-4. Version Needed Auxiliary Entries 260 11-1. Dynamic Structure 261 262 List of Tables 263 2-1. Normative References 264 2-2. Other References 265 3-1. Standard Library Names 266 3-2. Standard Library Names defined in the Architecture 267 Specific Parts of ISO/IEC 23360 268 269 9-1. Scalar Types 270 10-1. ELF Section Types 271 10-2. Additional Section Types 272 10-3. ELF Special Sections 273 10-4. Additional Special Sections 274 10-5. DWARF Exception Header value format 275 10-6. DWARF Exception Header application 276 10-7. Additional DWARF Call Frame Instructions 277 10-8. Call Frame Information Format 278 10-9. Common Information Entry Format 279 10-10. Frame Description Entry Format 280 10-11. .eh_frame_hdr Section Format 281 11-1. Linux Segment Types 282 12-1. libc Definition 283 12-2. libc - RPC Function Interfaces 284 12-3. libc - RPC Deprecated Function Interfaces 285 12-4. libc - Epoll Function Interfaces 286 12-5. libc - System Calls Function Interfaces 287 12-6. libc - System Calls Deprecated Function Interfaces 288 12-7. libc - Standard I/O Function Interfaces 289 12-8. libc - Standard I/O Deprecated Function Interfaces 290 12-9. libc - Standard I/O Data Interfaces 291 12-10. libc - Signal Handling Function Interfaces 292 12-11. libc - Signal Handling Deprecated Function Interfaces 293 12-12. libc - Signal Handling Data Interfaces 294 12-13. libc - Localization Functions Function Interfaces 295 12-14. libc - Localization Functions Data Interfaces 296 12-15. libc - Posix Spawn Option Function Interfaces 297 12-16. libc - Posix Advisory Option Function Interfaces 298 12-17. libc - Socket Interface Function Interfaces 299 12-18. libc - Socket Interface Data Interfaces 300 12-19. libc - Wide Characters Function Interfaces 301 12-20. libc - String Functions Function Interfaces 302 12-21. libc - String Functions Deprecated Function Interfaces 303 12-22. libc - IPC Functions Function Interfaces 304 12-23. libc - Regular Expressions Function Interfaces 305 12-24. libc - Character Type Functions Function Interfaces 306 12-25. libc - Time Manipulation Function Interfaces 307 12-26. libc - Time Manipulation Data Interfaces 308 12-27. libc - Terminal Interface Functions Function Interfaces 309 12-28. libc - System Database Interface Function Interfaces 310 12-29. libc - System Database Interface Deprecated Function 311 Interfaces 312 313 12-30. libc - Language Support Function Interfaces 314 12-31. libc - Large File Support Function Interfaces 315 12-32. libc - Large File Support Deprecated Function Interfaces 316 12-33. libc - Inotify Function Interfaces 317 12-34. libc - Standard Library Function Interfaces 318 12-35. libc - Standard Library Deprecated Function Interfaces 319 12-36. libc - Standard Library Data Interfaces 320 12-37. libc - GNU Extensions for libc Function Interfaces 321 12-38. libm Definition 322 12-39. libm - Math Function Interfaces 323 12-40. libm - Math Deprecated Function Interfaces 324 12-41. libm - Math Data Interfaces 325 12-42. libpthread Definition 326 12-43. libpthread - Realtime Threads Function Interfaces 327 12-44. libpthread - Advanced Realtime Threads Function 328 Interfaces 329 330 12-45. libpthread - Posix Threads Function Interfaces 331 12-46. libpthread - Posix Threads Deprecated Function 332 Interfaces 333 334 12-47. libpthread - Thread aware versions of libc interfaces 335 Function Interfaces 336 337 12-48. libpthread - GNU Extensions for libpthread Function 338 Interfaces 339 340 12-49. libgcc_s Definition 341 12-50. libgcc_s - Unwind Library Function Interfaces 342 12-51. libdl Definition 343 12-52. libdl - Dynamic Loader Function Interfaces 344 12-53. librt Definition 345 12-54. librt - Shared Memory Objects Function Interfaces 346 12-55. librt - Clock Function Interfaces 347 12-56. librt - Timers Function Interfaces 348 12-57. librt - Message Queues Function Interfaces 349 12-58. libcrypt Definition 350 12-59. libcrypt - Encryption Function Interfaces 351 12-60. libpam Definition 352 12-61. libpam - Pluggable Authentication API Function 353 Interfaces 354 355 13-1. libz Definition 356 13-2. libz - Compression Library Function Interfaces 357 13-3. libncurses Definition 358 13-4. libncurses - Curses Function Interfaces 359 13-5. libncurses - Curses Deprecated Function Interfaces 360 13-6. libncurses - Curses Data Interfaces 361 13-7. libutil Definition 362 13-8. libutil - Utility Functions Function Interfaces 363 14-1. libnspr4 Definition 364 14-2. libnspr4 - Netscape Portable Runtime Function Interfaces 365 14-3. libnss3 Definition 366 14-4. libnss3 - NSS Utility Function Interfaces 367 14-5. libssl3 Definition 368 14-6. libssl3 - NSS SSL Function Interfaces 369 15-1. Commands And Utilities 370 15-2. Built In Utilities 371 15-1. Escape Sequences 372 21-1. Required User & Group Names 373 21-2. Optional User & Group Names 374 22-1. RPM File Format 375 22-2. Signature Format 376 22-3. Index Type values 377 22-4. Header Private Tag Values 378 22-5. Signature Tag Values 379 22-6. Signature Digest Tag Values 380 22-7. Signature Signing Tag Values 381 22-8. Package Info Tag Values 382 22-9. Installation Tag Values 383 22-10. File Info Tag Values 384 22-11. File Flags 385 22-12. Package Dependency Tag Values 386 22-13. Index Type values 387 22-14. Package Dependency Attributes 388 22-15. Other Tag Values 389 22-16. CPIO File Format 390 A-1. libc Function Interfaces 391 A-2. libc Data Interfaces 392 A-3. libcrypt Function Interfaces 393 A-4. libdl Function Interfaces 394 A-5. libgcc_s Function Interfaces 395 A-6. libm Function Interfaces 396 A-7. libm Data Interfaces 397 A-8. libncurses Function Interfaces 398 A-9. libncurses Data Interfaces 399 A-10. libpam Function Interfaces 400 A-11. libpthread Function Interfaces 401 A-12. librt Function Interfaces 402 A-13. libutil Function Interfaces 403 A-14. libz Function Interfaces 404 __________________________________________________________ 405 406 Foreword 407 408 This is version 4.1 of the Linux Standard Base Core 409 Specification. This specification is one of a series of volumes 410 under the collective title Linux Standard Base: 411 412 * Core 413 * C++ 414 * Desktop 415 * Languages 416 * Printing 417 418 Note that the Core, C++ and Desktop volumes consist of a 419 generic volume augmented by an architecture-specific volume. 420 __________________________________________________________ 421 422 Status of this Document 423 424 This is a released specification. Other documents may supersede 425 or augment this specification. A list of current Linux Standard 426 Base (LSB) specifications is available at 427 http://refspecs.linuxfoundation.org. 428 429 If you wish to make comments regarding this document in a 430 manner that is tracked by the LSB project, please submit them 431 using our public bug database at http://bugs.linuxbase.org. 432 Please enter your feedback, carefully indicating the title of 433 the section for which you are submitting feedback, and the 434 volume and version of the specification where you found the 435 problem, quoting the incorrect text if appropriate. If you are 436 suggesting a new feature, please indicate what the problem you 437 are trying to solve is. That is more important than the 438 solution, in fact. 439 440 If you do not have or wish to create a bug database account 441 then you can also e-mail feedback to 442 (subscribe, archives), 443 and arrangements will be made to transpose the comments to our 444 public bug database. 445 __________________________________________________________ 446 447 Introduction 448 449 The LSB defines a binary interface for application programs 450 that are compiled and packaged for LSB-conforming 451 implementations on many different hardware architectures. A 452 binary specification must include information specific to the 453 computer processor architecture for which it is intended. To 454 avoid the complexity of conditional descriptions, the 455 specification has instead been divided into generic parts which 456 are augmented by one of several architecture-specific parts, 457 depending on the target processor architecture; the generic 458 part will indicate when reference must be made to the 459 architecture part, and vice versa. 460 461 This document should be used in conjunction with the documents 462 it references. This document enumerates the system components 463 it includes, but descriptions of those components may be 464 included entirely or partly in this document, partly in other 465 documents, or entirely in other reference documents. For 466 example, the section that describes system service routines 467 includes a list of the system routines supported in this 468 interface, formal declarations of the data structures they use 469 that are visible to applications, and a pointer to the 470 underlying referenced specification for information about the 471 syntax and semantics of each call. Only those routines not 472 described in standards referenced by this document, or 473 extensions to those standards, are described in the detail. 474 Information referenced in this way is as much a part of this 475 document as is the information explicitly included here. 476 477 The specification carries a version number of either the form 478 x.y or x.y.z. This version number carries the following 479 meaning: 480 481 1. The first number (x) is the major version number. Versions 482 sharing the same major version number shall be compatible 483 in a backwards direction; that is, a newer version shall be 484 compatible with an older version. Any deletion of a library 485 results in a new major version number. Interfaces marked as 486 deprecated may be removed from the specification at a major 487 version change. 488 2. The second number (y) is the minor version number. 489 Libraries and individual interfaces may be added, but not 490 removed. Interfaces may be marked as deprecated at a minor 491 version change. Other minor changes may be permitted at the 492 discretion of the LSB workgroup. 493 3. The third number (z), if present, is the editorial level. 494 Only editorial changes should be included in such versions. 495 496 Since this specification is a descriptive Application Binary 497 Interface, and not a source level API specification, it is not 498 possible to make a guarantee of 100% backward compatibility 499 between major releases. However, it is the intent that those 500 parts of the binary interface that are visible in the source 501 level API will remain backward compatible from version to 502 version, except where a feature marked as "Deprecated" in one 503 release may be removed from a future release. Implementors are 504 strongly encouraged to make use of symbol versioning to permit 505 simultaneous support of applications conforming to different 506 releases of this specification. 507 508 LSB is a trademark of the Linux Foundation. Developers of 509 applications or implementations interested in using the 510 trademark should see the Linux Foundation Certification Policy 511 for details. 512 513 I. Introductory Elements 514 515 Table of Contents 516 1. Scope 517 518 1.1. General 519 1.2. Module Specific Scope 520 521 2. References 522 523 2.1. Normative References 524 2.2. Informative References/Bibliography 525 526 3. Requirements 527 528 3.1. Relevant Libraries 529 3.2. LSB Implementation Conformance 530 3.3. LSB Application Conformance 531 532 4. Terms and Definitions 533 5. Documentation Conventions 534 6. Relationship To ISO/IEC 9945 POSIX 535 7. Relationship To Other Linux Foundation Specifications 536 __________________________________________________________ 537 538 Chapter 1. Scope 539 540 1.1. General 541 542 The Linux Standard Base (LSB) defines a system interface for 543 compiled applications and a minimal environment for support of 544 installation scripts. Its purpose is to enable a uniform 545 industry standard environment for high-volume applications 546 conforming to the LSB. 547 548 These specifications are composed of two basic parts: A common 549 specification ("LSB-generic" or "generic LSB"), ISO/IEC 23360 550 Part 1, describing those parts of the interface that remain 551 constant across all implementations of the LSB, and an 552 architecture-specific part ("LSB-arch") describing the parts of 553 the interface that vary by processor architecture. Together, 554 the LSB-generic and the relevant architecture-specific part of 555 ISO/IEC 23360 for a single hardware architecture provide a 556 complete interface specification for compiled application 557 programs on systems that share a common hardware architecture. 558 559 ISO/IEC 23360 Part 1, the LSB-generic document, should be used 560 in conjunction with an architecture-specific part. Whenever a 561 section of the LSB-generic specification is supplemented by 562 architecture-specific information, the LSB-generic document 563 includes a reference to the architecture part. 564 Architecture-specific parts of ISO/IEC 23360 may also contain 565 additional information that is not referenced in the 566 LSB-generic document. 567 568 The LSB contains both a set of Application Program Interfaces 569 (APIs) and Application Binary Interfaces (ABIs). APIs may 570 appear in the source code of portable applications, while the 571 compiled binary of that application may use the larger set of 572 ABIs. A conforming implementation provides all of the ABIs 573 listed here. The compilation system may replace (e.g. by macro 574 definition) certain APIs with calls to one or more of the 575 underlying binary interfaces, and may insert calls to binary 576 interfaces as needed. 577 578 The LSB is primarily a binary interface definition. Not all of 579 the source level APIs available to applications may be 580 contained in this specification. 581 __________________________________________________________ 582 583 1.2. Module Specific Scope 584 585 This is the Core module of the Linux Standard Base (LSB), 586 ISO/IEC 23360 Part 1. This module provides the fundamental 587 system interfaces, libraries, and runtime environment upon 588 which all conforming applications and libraries depend. 589 590 Interfaces described in this part of ISO/IEC 23360 are 591 mandatory except where explicitly listed otherwise. Core 592 interfaces may be supplemented by other modules; all modules 593 are built upon the core. 594 __________________________________________________________ 595 596 Chapter 2. References 597 598 2.1. Normative References 599 600 The following referenced documents are indispensable for the 601 application of this document. For dated references, only the 602 edition cited applies. For undated references, the latest 603 edition of the referenced document (including any amendments) 604 applies. 605 606 Note: Where copies of a document are available on the World 607 Wide Web, a Uniform Resource Locator (URL) is given for 608 informative purposes only. This may point to a more recent 609 copy of the referenced specification, or may be out of date. 610 Reference copies of specifications at the revision level 611 indicated may be found at the Linux Foundation's Reference 612 Specifications site. 613 614 Table 2-1. Normative References 615 Name Title URL 616 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 617 (FHS) 2.3 http://www.pathname.com/fhs/ 618 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 619 Itanium™ C++ ABI Itanium™ C++ ABI (Revision 1.86) 620 http://refspecs.linuxfoundation.org/cxxabi-1.86.html 621 Large File Support Large File Support 622 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 623 POSIX 1003.1-2001 (ISO/IEC 9945-2003) 624 625 ISO/IEC 9945-1:2003 Information technology -- Portable 626 Operating System Interface (POSIX) -- Part 1: Base Definitions 627 628 ISO/IEC 9945-2:2003 Information technology -- Portable 629 Operating System Interface (POSIX) -- Part 2: System Interfaces 630 631 ISO/IEC 9945-3:2003 Information technology -- Portable 632 Operating System Interface (POSIX) -- Part 3: Shell and 633 Utilities 634 635 ISO/IEC 9945-4:2003 Information technology -- Portable 636 Operating System Interface (POSIX) -- Part 4: Rationale 637 638 Including Technical Cor. 1: 2004 639 http://www.unix.org/version3/ 640 POSIX 1003.1-2008 (ISO/IEC 9945-2009) Portable Operating System 641 Interface (POSIX®) 2008 Edition / The Open Group Technical 642 Standard Base Specifications, Issue 7 643 http://www.unix.org/version4/ 644 SUSv2 CAE Specification, January 1997, System Interfaces and 645 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 646 http://www.opengroup.org/publications/catalog/un.htm 647 SVID Issue 3 American Telephone and Telegraph Company, System V 648 Interface Definition, Issue 3; Morristown, NJ, UNIX Press, 649 1989. (ISBN 0201566524) 650 SVID Issue 4 System V Interface Definition, Fourth Edition 651 http://refspecs.linuxfoundation.org/svid4/ 652 System V ABI System V Application Binary Interface, Edition 4.1 653 http://www.sco.com/developers/devspecs/gabi41.pdf 654 System V ABI Update System V Application Binary Interface - 655 DRAFT - 17 December 2003 656 http://www.sco.com/developers/gabi/2003-12-17/contents.html 657 X/Open Curses CAE Specification, May 1996, X/Open Curses, Issue 658 4, Version 2 (ISBN: 1-85912-171-3, C610), plus Corrigendum U018 659 http://www.opengroup.org/publications/catalog/un.htm 660 __________________________________________________________ 661 662 2.2. Informative References/Bibliography 663 664 In addition, the specifications listed below provide essential 665 background information to implementors of this specification. 666 These references are included for information only. 667 668 Table 2-2. Other References 669 Name Title URL 670 DWARF Debugging Information Format, Revision 2.0.0 DWARF 671 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 672 http://refspecs.linux-foundation.org/dwarf/dwarf-2.0.0.pdf 673 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 674 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 675 http://refspecs.linux-foundation.org/dwarf 676 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 677 floating-point arithmetic for microprocessor systems 678 http://www.ieee.org/ 679 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 680 Specification method for cultural conventions 681 ITU-T V.42 International Telecommunication Union Recommendation 682 V.42 (2002): Error-correcting procedures for DCEs using 683 asynchronous-to-synchronous conversionITUV 684 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&p 685 arent=T-REC-V.42 686 Li18nux Globalization Specification LI18NUX 2000 Globalization 687 Specification, Version 1.0 with Amendment 4 688 http://www.openi18n.org/docs/html/LI18NUX-2000-amd4.htm 689 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 690 http://www.lanana.org/docs/device-list/devices.txt 691 Mozilla's NSS SSL Reference Mozilla's NSS SSL Reference 692 http://www.mozilla.org/projects/security/pki/nss/ref/ssl/ 693 NSPR Reference Mozilla's NSPR Reference 694 http://refspecs.linuxfoundation.org/NSPR_API_Reference/NSPR_API 695 .html 696 PAM Open Software Foundation, Request For Comments: 86.0 , 697 October 1995, V. Samar & R.Schemers (SunSoft) 698 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 699 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 700 MD5 Message-Digest Algorithm 701 http://www.ietf.org/rfc/rfc1321.txt 702 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 703 http://www.ietf.org/ 704 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 705 1833: Binding Protocols for ONC RPC Version 2 706 http://www.ietf.org/rfc/rfc1833.txt 707 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 708 1950: ZLIB Compressed Data Format Specification 709 http://www.ietf.org/rfc/rfc1950.txt 710 RFC 1951: DEFLATE Compressed Data Format Specification IETF RFC 711 1951: DEFLATE Compressed Data Format Specification version 1.3 712 http://www.ietf.org/rfc/rfc1951.txt 713 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 714 file format specification version 4.3 715 http://www.ietf.org/rfc/rfc1952.txt 716 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP Message 717 Format http://www.ietf.org/rfc/rfc2440.txt 718 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 719 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 720 RFC 2822:Internet Message Format IETF RFC 2822: Internet 721 Message Format http://www.ietf.org/rfc/rfc2822.txt 722 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 723 Specification http://www.ietf.org/rfc/rfc791.txt 724 RPM Package Format RPM Package Format V3.0 725 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.h 726 tml 727 SUSv2 Commands and Utilities The Single UNIX Specification(SUS) 728 Version 2, Commands and Utilities (XCU), Issue 5 (ISBN: 729 1-85912-191-8, C604) 730 http://www.opengroup.org/publications/catalog/un.htm 731 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 732 __________________________________________________________ 733 734 Chapter 3. Requirements 735 736 3.1. Relevant Libraries 737 738 The libraries listed in Table 3-1 shall be available on a Linux 739 Standard Base system, with the specified runtime names. The 740 libraries listed in Table 3-2 are architecture specific, but 741 shall be available on all LSB conforming systems. This list may 742 be supplemented or amended by the relevant architecture 743 specific part of ISO/IEC 23360. 744 745 Table 3-1. Standard Library Names 746 Library Runtime Name 747 libdl libdl.so.2 748 libcrypt libcrypt.so.1 749 libz libz.so.1 750 libncurses libncurses.so.5 751 libutil libutil.so.1 752 libpthread libpthread.so.0 753 librt librt.so.1 754 libpam libpam.so.0 755 libgcc_s libgcc_s.so.1 756 757 Table 3-2. Standard Library Names defined in the Architecture 758 Specific Parts of ISO/IEC 23360 759 Library Runtime Name 760 libm See archLSB 761 libc See archLSB 762 proginterp See archLSB 763 764 These libraries will be in an implementation-defined directory 765 which the dynamic linker shall search by default. 766 __________________________________________________________ 767 768 3.2. LSB Implementation Conformance 769 770 A conforming implementation is necessarily architecture 771 specific, and must provide the interfaces specified by both the 772 generic LSB Core specification (ISO/IEC 23360 Part 1) and the 773 relevant architecture specific part of ISO/IEC 23360. 774 775 Rationale: An implementation must provide at least the 776 interfaces specified in these specifications. It may also 777 provide additional interfaces. 778 779 A conforming implementation shall satisfy the following 780 requirements: 781 782 * A processor architecture represents a family of related 783 processors which may not have identical feature sets. The 784 architecture specific parts of ISO/IEC 23360 that 785 supplement this specification for a given target processor 786 architecture describe a minimum acceptable processor. The 787 implementation shall provide all features of this 788 processor, whether in hardware or through emulation 789 transparent to the application. 790 * The implementation shall be capable of executing compiled 791 applications having the format and using the system 792 interfaces described in this document. 793 * The implementation shall provide libraries containing the 794 interfaces specified by this document, and shall provide a 795 dynamic linking mechanism that allows these interfaces to 796 be attached to applications at runtime. All the interfaces 797 shall behave as specified in this document. 798 * The map of virtual memory provided by the implementation 799 shall conform to the requirements of this document. 800 * The implementation's low-level behavior with respect to 801 function call linkage, system traps, signals, and other 802 such activities shall conform to the formats described in 803 this document. 804 * The implementation shall provide all of the mandatory 805 interfaces in their entirety. 806 * The implementation may provide one or more of the optional 807 interfaces. Each optional interface that is provided shall 808 be provided in its entirety. The product documentation 809 shall state which optional interfaces are provided. 810 * The implementation shall provide all files and utilities 811 specified as part of this document in the format defined 812 here and in other referenced documents. All commands and 813 utilities shall behave as required by this document. The 814 implementation shall also provide all mandatory components 815 of an application's runtime environment that are included 816 or referenced in this document. 817 * The implementation, when provided with standard data 818 formats and values at a named interface, shall provide the 819 behavior defined for those values and data formats at that 820 interface. However, a conforming implementation may consist 821 of components which are separately packaged and/or sold. 822 For example, a vendor of a conforming implementation might 823 sell the hardware, operating system, and windowing system 824 as separately packaged items. 825 * The implementation may provide additional interfaces with 826 different names. It may also provide additional behavior 827 corresponding to data values outside the standard ranges, 828 for standard named interfaces. 829 __________________________________________________________ 830 831 3.3. LSB Application Conformance 832 833 A conforming application is necessarily architecture specific, 834 and must conform to both the generic LSB Core specification 835 (ISO/IEC 23360 Part 1)and the relevant architecture specific 836 part of ISO/IEC 23360. 837 838 A conforming application shall satisfy the following 839 requirements: 840 841 * Its executable files shall be either shell scripts or 842 object files in the format defined for the Object File 843 Format system interface. 844 * Its object files shall participate in dynamic linking as 845 defined in the Program Loading and Linking System 846 interface. 847 * It shall employ only the instructions, traps, and other 848 low-level facilities defined in the Low-Level System 849 interface as being for use by applications. 850 * If it requires any optional interface defined in this 851 document in order to be installed or to execute 852 successfully, the requirement for that optional interface 853 shall be stated in the application's documentation. 854 * It shall not use any interface or data format that is not 855 required to be provided by a conforming implementation, 856 unless: 857 + If such an interface or data format is supplied by 858 another application through direct invocation of that 859 application during execution, that application shall 860 be in turn an LSB conforming application. 861 + The use of that interface or data format, as well as 862 its source, shall be identified in the documentation 863 of the application. 864 * It shall not use any values for a named interface that are 865 reserved for vendor extensions. 866 867 A strictly conforming application shall not require or use any 868 interface, facility, or implementation-defined extension that 869 is not defined in this document in order to be installed or to 870 execute successfully. 871 __________________________________________________________ 872 873 Chapter 4. Terms and Definitions 874 875 For the purposes of this document, the terms given in ISO/IEC 876 Directives, Part 2, Annex H and the following apply. 877 878 archLSB 879 Some LSB specification documents have both a generic, 880 architecture-neutral part and an architecture-specific 881 part. The latter describes elements whose definitions 882 may be unique to a particular processor architecture. 883 The term archLSB may be used in the generic part to 884 refer to the corresponding section of the 885 architecture-specific part. 886 887 Binary Standard, ABI 888 The total set of interfaces that are available to be 889 used in the compiled binary code of a conforming 890 application, including the run-time details such as 891 calling conventions, binary format, C++ name mangling, 892 etc. 893 894 Implementation-defined 895 Describes a value or behavior that is not defined by 896 this document but is selected by an implementor. The 897 value or behavior may vary among implementations that 898 conform to this document. An application should not rely 899 on the existence of the value or behavior. An 900 application that relies on such a value or behavior 901 cannot be assured to be portable across conforming 902 implementations. The implementor shall document such a 903 value or behavior so that it can be used correctly by an 904 application. 905 906 Shell Script 907 A file that is read by an interpreter (e.g., awk). The 908 first line of the shell script includes a reference to 909 its interpreter binary. 910 911 Source Standard, API 912 The total set of interfaces that are available to be 913 used in the source code of a conforming application. Due 914 to translations, the Binary Standard and the Source 915 Standard may contain some different interfaces. 916 917 Undefined 918 Describes the nature of a value or behavior not defined 919 by this document which results from use of an invalid 920 program construct or invalid data input. The value or 921 behavior may vary among implementations that conform to 922 this document. An application should not rely on the 923 existence or validity of the value or behavior. An 924 application that relies on any particular value or 925 behavior cannot be assured to be portable across 926 conforming implementations. 927 928 Unspecified 929 Describes the nature of a value or behavior not 930 specified by this document which results from use of a 931 valid program construct or valid data input. The value 932 or behavior may vary among implementations that conform 933 to this document. An application should not rely on the 934 existence or validity of the value or behavior. An 935 application that relies on any particular value or 936 behavior cannot be assured to be portable across 937 conforming implementations. 938 939 In addition, for the portions of this specification which build 940 on IEEE Std 1003.1-2001, the definitions given in IEEE Std 941 1003.1-2001, Base Definitions, Chapter 3 apply. 942 __________________________________________________________ 943 944 Chapter 5. Documentation Conventions 945 946 Throughout this document, the following typographic conventions 947 are used: 948 949 function() 950 951 the name of a function 952 command 953 954 the name of a command or utility 955 CONSTANT 956 957 a constant value 958 parameter 959 960 a parameter 961 variable 962 963 a variable 964 965 Throughout this specification, several tables of interfaces are 966 presented. Each entry in these tables has the following format: 967 968 name 969 970 the name of the interface 971 (symver) 972 973 An optional symbol version identifier, if required. 974 [refno] 975 976 A reference number indexing the table of referenced 977 specifications that follows this table. 978 979 For example, 980 981 forkpty(GLIBC_2.0) [SUSv3] 982 983 refers to the interface named forkpty() with symbol version 984 GLIBC_2.0 that is defined in the SUSv3 reference. 985 986 Note: For symbols with versions which differ between 987 architectures, the symbol versions are defined in the 988 architecture specific parts of ISO/IEC 23360 only. 989 __________________________________________________________ 990 991 Chapter 6. Relationship To ISO/IEC 9945 POSIX 992 993 This specification includes many interfaces described in POSIX 994 1003.1-2001 (ISO/IEC 9945-2003). Unless otherwise specified, 995 such interfaces should behave exactly as described in that 996 specification. Any conflict between the requirements described 997 here and the POSIX 1003.1-2001 (ISO/IEC 9945-2003) standard is 998 unintentional, except as explicitly noted otherwise. 999 1000 Note: In addition to the differences noted inline in this 1001 specification, PDTR 24715 has extracted the differences 1002 between this specification and POSIX 1003.1-2001 (ISO/IEC 1003 9945-2003) into a single place. It is the long term plan of 1004 the Linux Foundation to converge the LSB Core Specification 1005 with ISO/IEC 9945 POSIX. 1006 1007 The LSB Specification Authority is responsible for deciding the 1008 meaning of conformance to normative referenced standards in the 1009 LSB context. Problem Reports regarding underlying or referenced 1010 standards in any other context will be referred to the relevant 1011 maintenance body for that standard. 1012 __________________________________________________________ 1013 1014 Chapter 7. Relationship To Other Linux Foundation Specifications 1015 1016 The LSB is the base for several other specification projects 1017 under the umbrella of the Linux Foundation (LF). This 1018 specification is the foundation, and other specifications build 1019 on the interfaces defined here. However, beyond those 1020 specifications listed as Normative References, this 1021 specification has no dependencies on other LF projects. 1022 1023 II. Executable And Linking Format (ELF) 1024 1025 Table of Contents 1026 8. Introduction 1027 9. Low Level System Information 1028 1029 9.1. Operating System Interface 1030 9.2. Machine Interface 1031 1032 9.2.1. Data Representation 1033 1034 10. Object Format 1035 1036 10.1. Object Files 1037 10.2. Sections 1038 1039 10.2.1. Introduction 1040 10.2.2. Sections Types 1041 1042 10.3. Special Sections 1043 1044 10.3.1. Special Sections 1045 1046 10.4. Symbol Mapping 1047 1048 10.4.1. Introduction 1049 1050 10.5. DWARF Extensions 1051 1052 10.5.1. DWARF Exception Header Encoding 1053 10.5.2. DWARF CFI Extensions 1054 1055 10.6. Exception Frames 1056 1057 10.6.1. The .eh_frame section 1058 10.6.2. The .eh_frame_hdr section 1059 1060 10.7. Symbol Versioning 1061 1062 10.7.1. Introduction 1063 10.7.2. Symbol Version Table 1064 10.7.3. Version Definitions 1065 10.7.4. Version Requirements 1066 10.7.5. Startup Sequence 1067 10.7.6. Symbol Resolution 1068 1069 10.8. ABI note tag 1070 1071 11. Dynamic Linking 1072 1073 11.1. Program Loading and Dynamic Linking 1074 11.2. Program Header 1075 11.3. Dynamic Entries 1076 1077 11.3.1. Introduction 1078 11.3.2. Dynamic Entries 1079 __________________________________________________________ 1080 1081 Chapter 8. Introduction 1082 1083 Executable and Linking Format (ELF) defines the object format 1084 for compiled applications. This specification supplements the 1085 information found in System V ABI Update and is intended to 1086 document additions made since the publication of that document. 1087 __________________________________________________________ 1088 1089 Chapter 9. Low Level System Information 1090 1091 9.1. Operating System Interface 1092 1093 LSB-conforming applications shall assume that stack, heap and 1094 other allocated memory regions will be non-executable. The 1095 application must take steps to make them executable if needed. 1096 __________________________________________________________ 1097 1098 9.2. Machine Interface 1099 1100 9.2.1. Data Representation 1101 1102 LSB-conforming applications shall use the data representation 1103 as defined in the Arcitecture specific ELF documents. 1104 __________________________________________________________ 1105 1106 9.2.1.1. Fundamental Types 1107 1108 In addition to the fundamental types specified in the relevant 1109 architecture specific part of ISO/IEC 23360, a 1 byte data type 1110 is defined here. 1111 1112 Table 9-1. Scalar Types 1113 Type C C++ sizeof Alignment (bytes) Architecture Representation 1114 Integral _Bool bool 1 1 byte 1115 __________________________________________________________ 1116 1117 Chapter 10. Object Format 1118 1119 10.1. Object Files 1120 1121 LSB-conforming implementations shall support the object file 1122 Executable and Linking Format (ELF), which is defined by the 1123 following documents: 1124 1125 * System V ABI 1126 * System V ABI Update 1127 * this specification 1128 * the relevant architecture specific part of ISO/IEC 23360 1129 1130 Conforming implementations may also support other unspecified 1131 object file formats. 1132 __________________________________________________________ 1133 1134 10.2. Sections 1135 1136 10.2.1. Introduction 1137 1138 As described in System V ABI, an ELF object file contains a 1139 number of sections. 1140 __________________________________________________________ 1141 1142 10.2.2. Sections Types 1143 1144 The section header table is an array of Elf32_Shdr or 1145 Elf64_Shdr structures as described in System V ABI. The sh_type 1146 member shall be either a value from Table 10-1, drawn from the 1147 System V ABI, or one of the additional values specified in 1148 Table 10-2. 1149 1150 A section header's sh_type member specifies the sections's 1151 semantics. 1152 __________________________________________________________ 1153 1154 10.2.2.1. ELF Section Types 1155 1156 The following section types are defined in the System V ABI and 1157 the System V ABI Update. 1158 1159 Table 10-1. ELF Section Types 1160 Name Value Description 1161 SHT_DYNAMIC 0x6 The section holds information for dynamic 1162 linking. Currently, an object file shall have only one dynamic 1163 section, but this restriction may be relaxed in the future. See 1164 `Dynamic Section' in Chapter 5 of System V ABI Update for 1165 details. 1166 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1167 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1168 an object file may have either a section of SHT_SYMTAB type or 1169 a section of SHT_DYNSYM type, but not both. This restriction 1170 may be relaxed in the future. 1171 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1172 to termination functions, as described in `Initialization and 1173 Termination Functions' in Chapter 5 of System V ABI Update. 1174 Each pointer in the array is taken as a parameterless procedure 1175 with a void return. 1176 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1177 an object file shall have only one hash table, but this 1178 restriction may be relaxed in the future. See `Hash Table' in 1179 Chapter 5 of System V ABI Update for details. 1180 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1181 to initialization functions, as described in `Initialization 1182 and Termination Functions' in Chapter 5 of System V ABI Update. 1183 Each pointer in the array is taken as a parameterless procedure 1184 with a void return. 1185 SHT_NOBITS 0x8 A section of this type occupies no space in the 1186 file but otherwise resembles SHT_PROGBITS. Although this 1187 section contains no bytes, the sh_offset member contains the 1188 conceptual file offset. 1189 SHT_NOTE 0x7 The section holds information that marks the file 1190 in some way. See `Note Section' in Chapter 5 of System V ABI 1191 Update for details. 1192 SHT_NULL 0x0 This value marks the section header as inactive; 1193 it does not have an associated section. Other members of the 1194 section header have undefined values. 1195 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1196 pointers to functions that are invoked before all other 1197 initialization functions, as described in `Initialization and 1198 Termination Functions' in Chapter 5 of System V ABI Update. 1199 Each pointer in the array is taken as a parameterless proceure 1200 with a void return. 1201 SHT_PROGBITS 0x1 The section holds information defined by the 1202 program, whose format and meaning are determined solely by the 1203 program. 1204 SHT_REL 0x9 The section holds relocation entries without 1205 explicit addends, such as type Elf32_Rel for the 32-bit class 1206 of object files or type Elf64_Rel for the 64-bit class of 1207 object files. An object file may have multiple relocation 1208 sections. See `Relocation' in Chapter 4 of System V ABI Update 1209 for details. 1210 SHT_RELA 0x4 The section holds relocation entries with explicit 1211 addends, such as type Elf32_Rela for the 32-bit class of object 1212 files or type Elf64_Rela for the 64-bit class of object files. 1213 An object file may have multiple relocation sections. See 1214 `Relocation' in Chapter 4 of System V ABI Update for details. 1215 SHT_STRTAB 0x3 The section holds a string table. An object file 1216 may have multiple string table sections. See `String Table' in 1217 Chapter 4 of System V ABI Update for details. 1218 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, an 1219 object file may have either a section of SHT_SYMTAB type or a 1220 section of SHT_DYNSYM type, but not both. This restriction may 1221 be relaxed in the future. Typically, SHT_SYMTAB provides 1222 symbols for link editing, though it may also be used for 1223 dynamic linking. As a complete symbol table, it may contain 1224 many symbols unnecessary for dynamic linking. 1225 __________________________________________________________ 1226 1227 10.2.2.2. Additional Section Types 1228 1229 The following additional section types are defined here. 1230 1231 Table 10-2. Additional Section Types 1232 Name Value Description 1233 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1234 versions that are provided. 1235 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1236 versions that are required. 1237 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1238 Version Table. 1239 __________________________________________________________ 1240 1241 10.3. Special Sections 1242 1243 10.3.1. Special Sections 1244 1245 Various sections hold program and control information. Sections 1246 in the lists below are used by the system and have the 1247 indicated types and attributes. 1248 __________________________________________________________ 1249 1250 10.3.1.1. ELF Special Sections 1251 1252 The following sections are defined in the System V ABI and the 1253 System V ABI Update. 1254 1255 Table 10-3. ELF Special Sections 1256 Name Type Attributes 1257 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1258 .comment SHT_PROGBITS 0 1259 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1260 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1261 .debug SHT_PROGBITS 0 1262 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1263 .dynstr SHT_STRTAB SHF_ALLOC 1264 .dynsym SHT_DYNSYM SHF_ALLOC 1265 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1266 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1267 .hash SHT_HASH SHF_ALLOC 1268 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1269 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1270 .interp SHT_PROGBITS SHF_ALLOC 1271 .line SHT_PROGBITS 0 1272 .note SHT_NOTE 0 1273 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1274 .rodata SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1275 .rodata1 SHT_PROGBITS SHF_ALLOC+SHF_MERGE+SHF_STRINGS 1276 .shstrtab SHT_STRTAB 0 1277 .strtab SHT_STRTAB SHF_ALLOC 1278 .symtab SHT_SYMTAB SHF_ALLOC 1279 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1280 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1281 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1282 1283 .bss 1284 1285 This section holds data that contributes to the program's 1286 memory image. The program may treat this data as uninitialized. 1287 However, the system shall initialize this data with zeroes when 1288 the program begins to run. The section occupies no file space, 1289 as indicated by the section type, SHT_NOBITS. 1290 .comment 1291 1292 This section holds version control information. 1293 .data 1294 1295 This section holds initialized data that contribute to the 1296 program's memory image. 1297 .data1 1298 1299 This section holds initialized data that contribute to the 1300 program's memory image. 1301 .debug 1302 1303 This section holds information for symbolic debugging. The 1304 contents are unspecified. All section names with the prefix 1305 .debug hold information for symbolic debugging. The contents of 1306 these sections are unspecified. 1307 .dynamic 1308 1309 This section holds dynamic linking information. The section's 1310 attributes will include the SHF_ALLOC bit. Whether the 1311 SHF_WRITE bit is set is processor specific. See Chapter 5 of 1312 System V ABI Update for more information. 1313 .dynstr 1314 1315 This section holds strings needed for dynamic linking, most 1316 commonly the strings that represent the names associated with 1317 symbol table entries. See Chapter 5 of System V ABI Update for 1318 more information. 1319 .dynsym 1320 1321 This section holds the dynamic linking symbol table, as 1322 described in `Symbol Table' of System V ABI Update. 1323 .fini 1324 1325 This section holds executable instructions that contribute to 1326 the process termination code. That is, when a program exits 1327 normally, the system arranges to execute the code in this 1328 section. 1329 .fini_array 1330 1331 This section holds an array of function pointers that 1332 contributes to a single termination array for the executable or 1333 shared object containing the section. 1334 .hash 1335 1336 This section holds a symbol hash table. See `Hash Table' in 1337 Chapter 5 of System V ABI Update for more information. 1338 .init 1339 1340 This section holds executable instructions that contribute to 1341 the process initialization code. When a program starts to run, 1342 the system arranges to execute the code in this section before 1343 calling the main program entry point (called main for C 1344 programs). 1345 .init_array 1346 1347 This section holds an array of function pointers that 1348 contributes to a single initialization array for the executable 1349 or shared object containing the section. 1350 .interp 1351 1352 This section holds the path name of a program interpreter. If 1353 the file has a loadable segment that includes relocation, the 1354 sections' attributes will include the SHF_ALLOC bit; otherwise, 1355 that bit will be off. See Chapter 5 of System V ABI Update for 1356 more information. 1357 .line 1358 1359 This section holds line number information for symbolic 1360 debugging, which describes the correspondence between the 1361 source program and the machine code. The contents are 1362 unspecified. 1363 .note 1364 1365 This section holds information in the format that `Note 1366 Section' in Chapter 5 of System V ABI Update describes. 1367 .preinit_array 1368 1369 This section holds an array of function pointers that 1370 contributes to a single pre-initialization array for the 1371 executable or shared object containing the section. 1372 .rodata 1373 1374 This section holds read-only data that typically contribute to 1375 a non-writable segment in the process image. See `Program 1376 Header' in Chapter 5 of System V ABI Update for more 1377 information. 1378 .rodata1 1379 1380 This section holds read-only data that typically contribute to 1381 a non-writable segment in the process image. See `Program 1382 Header' in Chapter 5 of System V ABI Update for more 1383 information. 1384 .shstrtab 1385 1386 This section holds section names. 1387 .strtab 1388 1389 This section holds strings, most commonly the strings that 1390 represent the names associated with symbol table entries. If 1391 the file has a loadable segment that includes the symbol string 1392 table, the section's attributes will include the SHF_ALLOC bit; 1393 otherwise, that bit will be off. 1394 .symtab 1395 1396 This section holds a symbol table, as `Symbol Table' in Chapter 1397 4 of System V ABI Update describes. If the file has a loadable 1398 segment that includes the symbol table, the section's 1399 attributes will include the SHF_ALLOC bit; otherwise, that bit 1400 will be off. 1401 .tbss 1402 1403 This section holds uninitialized thread-local data that 1404 contribute to the program's memory image. By definition, the 1405 system initializes the data with zeros when the data is 1406 instantiated for each new execution flow. The section occupies 1407 no file space, as indicated by the section type, SHT_NOBITS. 1408 Implementations need not support thread-local storage. 1409 .tdata 1410 1411 This section holds initialized thread-local data that 1412 contributes to the program's memory image. A copy of its 1413 contents is instantiated by the system for each new execution 1414 flow. Implementations need not support thread-local storage. 1415 .text 1416 1417 This section holds the `text', or executable instructions, of a 1418 program. 1419 __________________________________________________________ 1420 1421 10.3.1.2. Additional Special Sections 1422 1423 Object files in an LSB conforming application may also contain 1424 one or more of the additional special sections described below. 1425 1426 Table 10-4. Additional Special Sections 1427 Name Type Attributes 1428 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1429 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1430 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1431 .eh_frame SHT_PROGBITS SHF_ALLOC 1432 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1433 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1434 .gnu.version SHT_GNU_versym SHF_ALLOC 1435 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1436 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1437 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1438 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1439 .note.ABI-tag SHT_NOTE SHF_ALLOC 1440 .stab SHT_PROGBITS 0 1441 .stabstr SHT_STRTAB 0 1442 1443 .ctors 1444 1445 This section contains a list of global constructor function 1446 pointers. 1447 .data.rel.ro 1448 1449 This section holds initialized data that contribute to the 1450 program's memory image. This section may be made read-only 1451 after relocations have been applied. 1452 .dtors 1453 1454 This section contains a list of global destructor function 1455 pointers. 1456 .eh_frame 1457 1458 This section contains information necessary for frame unwinding 1459 during exception handling. See Section 10.6.1. 1460 .eh_frame_hdr 1461 1462 This section contains a pointer to the .eh_frame section which 1463 is accessible to the runtime support code of a C++ application. 1464 This section may also contain a binary search table which may 1465 be used by the runtime support code to more efficiently access 1466 records in the .eh_frame section. See Section 10.6.2. 1467 .gcc_except_table 1468 1469 This section holds Language Specific Data. 1470 .gnu.version 1471 1472 This section contains the Symbol Version Table. See Section 1473 10.7.2. 1474 .gnu.version_d 1475 1476 This section contains the Version Definitions. See Section 1477 10.7.3. 1478 .gnu.version_r 1479 1480 This section contains the Version Requirements. See Section 1481 10.7.4. 1482 .got.plt 1483 1484 This section holds the read-only portion of the GLobal Offset 1485 Table. This section may be made read-only after relocations 1486 have been applied. 1487 .jcr 1488 1489 This section contains information necessary for registering 1490 compiled Java classes. The contents are compiler-specific and 1491 used by compiler initialization functions. 1492 .note.ABI-tag 1493 1494 Specify ABI details. See Section 10.8. 1495 .stab 1496 1497 This section contains debugging information. The contents are 1498 not specified as part of the LSB. 1499 .stabstr 1500 1501 This section contains strings associated with the debugging 1502 infomation contained in the .stab section. 1503 __________________________________________________________ 1504 1505 10.4. Symbol Mapping 1506 1507 10.4.1. Introduction 1508 1509 Symbols in a source program are translated by the compilation 1510 system into symbols that exist in the object file. 1511 __________________________________________________________ 1512 1513 10.4.1.1. C Language 1514 1515 External C symbols shall be unchanged in an object file's 1516 symbol table. 1517 __________________________________________________________ 1518 1519 10.5. DWARF Extensions 1520 1521 The LSB does not specify debugging information, however, some 1522 additional sections contain information which is encoded using 1523 the the encoding as specified by DWARF Debugging Information 1524 Format, Revision 2.0.0 with extensions defined here. 1525 1526 Note: The extensions specified here also exist in DWARF 1527 Debugging Information Format, Revision 3.0.0 (Draft). It is 1528 expected that future versions of the LSB will reference the 1529 final version of that document, and that the definitions 1530 here will be taken from that document instead of being 1531 specified here. 1532 __________________________________________________________ 1533 1534 10.5.1. DWARF Exception Header Encoding 1535 1536 The DWARF Exception Header Encoding is used to describe the 1537 type of data used in the .eh_frame and .eh_frame_hdr section. 1538 The upper 4 bits indicate how the value is to be applied. The 1539 lower 4 bits indicate the format of the data. 1540 1541 Table 10-5. DWARF Exception Header value format 1542 Name Value Meaning 1543 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1544 is determined by the architecture. 1545 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1546 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1547 Information Format, Revision 2.0.0. 1548 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1549 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1550 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1551 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1552 Endian Base 128 (LEB128) as defined by DWARF Debugging 1553 Information Format, Revision 2.0.0. 1554 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1555 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1556 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1557 1558 Table 10-6. DWARF Exception Header application 1559 Name Value Meaning 1560 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1561 counter. 1562 DW_EH_PE_textrel 0x20 Value is relative to the beginning of the 1563 .text section. 1564 DW_EH_PE_datarel 0x30 Value is relative to the beginning of the 1565 .got or .eh_frame_hdr section. 1566 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of the 1567 function. 1568 DW_EH_PE_aligned 0x50 Value is aligned to an address unit sized 1569 boundary. 1570 1571 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1572 indicate that no value ispresent. 1573 __________________________________________________________ 1574 1575 10.5.2. DWARF CFI Extensions 1576 1577 In addition to the Call Frame Instructions defined in section 1578 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1579 the following additional Call Frame Instructions may also be 1580 used. 1581 1582 Table 10-7. Additional DWARF Call Frame Instructions 1583 Name Value Meaning 1584 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1585 two operands: an unsigned LEB128 value representing a register 1586 number, and a DW_FORM_block value representing a DWARF 1587 expression. The required action is to establish the DWARF 1588 expression as the means by which the address in which the given 1589 register contents are found may be computed. The value of the 1590 CFA is pushed on the DWARF evaluation stack prior to execution 1591 of the DWARF expression. The DW_OP_call2, DW_OP_call4, 1592 DW_OP_call_ref and DW_OP_push_object_address DWARF operators 1593 (see Section 2.4.1 of DWARF Debugging Information Format, 1594 Revision 2.0.0) cannot be used in such a DWARF expression. 1595 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1596 instruction takes two operands: an unsigned LEB128 value 1597 representing a register number and a signed LEB128 factored 1598 offset. This instruction is identical to DW_CFA_offset_extended 1599 except that the second operand is signed. 1600 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1601 two operands: an unsigned LEB128 value representing a register 1602 number and a signed LEB128 factored offset. This instruction is 1603 identical to DW_CFA_def_cfa except that the second operand is 1604 signed and factored. 1605 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1606 instruction takes a signed LEB128 operand representing a 1607 factored offset. This instruction is identical to 1608 DW_CFA_def_cfa_offset except that the operand is signed and 1609 factored. 1610 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1611 takes an unsigned LEB128 operand representing an argument size. 1612 This instruction specifies the total of the size of the 1613 arguments which have been pushed onto the stack. 1614 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1615 instruction takes two operands: an unsigned LEB128 value 1616 representing a register number and an unsigned LEB128 which 1617 represents the magnitude of the offset. This instruction is 1618 identical to DW_CFA_offset_extended_sf except that the operand 1619 is subtracted to produce the offset. This instructions is 1620 obsoleted by DW_CFA_offset_extended_sf. 1621 __________________________________________________________ 1622 1623 10.6. Exception Frames 1624 1625 When using languages that support exceptions, such as C++, 1626 additional information must be provided to the runtime 1627 environment that describes the call frames that must be unwound 1628 during the processing of an exception. This information is 1629 contained in the special sections .eh_frame and .eh_framehdr. 1630 1631 Note: The format of the .eh_frame section is similar in 1632 format and purpose to the .debug_frame section which is 1633 specified in DWARF Debugging Information Format, Revision 1634 3.0.0 (Draft). Readers are advised that there are some 1635 subtle difference, and care should be taken when comparing 1636 the two sections. 1637 __________________________________________________________ 1638 1639 10.6.1. The .eh_frame section 1640 1641 The .eh_frame section shall contain 1 or more Call Frame 1642 Information (CFI) records. The number of records present shall 1643 be determined by size of the section as contained in the 1644 section header. Each CFI record contains a Common Information 1645 Entry (CIE) record followed by 1 or more Frame Description 1646 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1647 addressing unit sized boundary. 1648 1649 Table 10-8. Call Frame Information Format 1650 Common Information Entry Record 1651 Frame Description Entry Record(s) 1652 __________________________________________________________ 1653 1654 10.6.1.1. The Common Information Entry Format 1655 1656 Table 10-9. Common Information Entry Format 1657 Length Required 1658 Extended Length Optional 1659 CIE ID Required 1660 Version Required 1661 Augmentation String Required 1662 Code Alignment Factor Required 1663 Data Alignment Factor Required 1664 Return Address Register Required 1665 Augmentation Data Length Optional 1666 Augmentation Data Optional 1667 Initial Instructions Required 1668 Padding 1669 1670 Length 1671 A 4 byte unsigned value indicating the length in bytes 1672 of the CIE structure, not including the Length field 1673 itself. If Length contains the value 0xffffffff, then 1674 the length is contained in the Extended Length field. If 1675 Length contains the value 0, then this CIE shall be 1676 considered a terminator and processing shall end. 1677 1678 Extended Length 1679 A 8 byte unsigned value indicating the length in bytes 1680 of the CIE structure, not including the Length and 1681 Extended Length fields. 1682 1683 CIE ID 1684 A 4 byte unsigned value that is used to distinguish CIE 1685 records from FDE records. This value shall always be 0, 1686 which indicates this record is a CIE. 1687 1688 Version 1689 A 1 byte value that identifies the version number of the 1690 frame information structure. This value shall be 1. 1691 1692 Augmentation String 1693 This value is a NUL terminated string that identifies 1694 the augmentation to the CIE or to the FDEs associated 1695 with this CIE. A zero length string indicates that no 1696 augmentation data is present. The augmentation string is 1697 case sensitive and shall be interpreted as described 1698 below. 1699 1700 Code Alignment Factor 1701 An unsigned LEB128 encoded value that is factored out of 1702 all advance location instructions that are associated 1703 with this CIE or its FDEs. This value shall be 1704 multiplied by the delta argument of an adavance location 1705 instruction to obtain the new location value. 1706 1707 Data Alignment Factor 1708 A signed LEB128 encoded value that is factored out of 1709 all offset instructions that are associated with this 1710 CIE or its FDEs. This value shall be multiplied by the 1711 register offset argument of an offset instruction to 1712 obtain the new offset value. 1713 1714 Augmentation Length 1715 An unsigned LEB128 encoded value indicating the length 1716 in bytes of the Augmentation Data. This field is only 1717 present if the Augmentation String contains the 1718 character 'z'. 1719 1720 Augmentation Data 1721 A block of data whose contents are defined by the 1722 contents of the Augmentation String as described below. 1723 This field is only present if the Augmentation String 1724 contains the character 'z'. The size of this data is 1725 given by the Augentation Length. 1726 1727 Initial Instructions 1728 Initial set of Call Frame Instructions. The number of 1729 instructions is determined by the remaining space in the 1730 CIE record. 1731 1732 Padding 1733 Extra bytes to align the CIE structure to an addressing 1734 unit size boundary. 1735 __________________________________________________________ 1736 1737 10.6.1.1.1. Augmentation String Format 1738 1739 The Agumentation String indicates the presence of some optional 1740 fields, and how those fields should be intepreted. This string 1741 is case sensitive. Each character in the augmentation string in 1742 the CIE can be interpreted as below: 1743 1744 'z' 1745 1746 A 'z' may be present as the first character of the string. If 1747 present, the Augmentation Data field shall be present. The 1748 contents of the Augmentation Data shall be intepreted according 1749 to other characters in the Augmentation String. 1750 'L' 1751 1752 A 'L' may be present at any position after the first character 1753 of the string. This character may only be present if 'z' is the 1754 first character of the string. If present, it indicates the 1755 presence of one argument in the Augmentation Data of the CIE, 1756 and a corresponding argument in the Augmentation Data of the 1757 FDE. The argument in the Augmentation Data of the CIE is 1-byte 1758 and represents the pointer encoding used for the argument in 1759 the Augmentation Data of the FDE, which is the address of a 1760 language-specific data area (LSDA). The size of the LSDA 1761 pointer is specified by the pointer encoding used. 1762 'P' 1763 1764 A 'P' may be present at any position after the first character 1765 of the string. This character may only be present if 'z' is the 1766 first character of the string. If present, it indicates the 1767 presence of two arguments in the Augmentation Data of the CIE. 1768 The first argument is 1-byte and represents the pointer 1769 encoding used for the second argument, which is the address of 1770 a personality routine handler. The personality routine is used 1771 to handle language and vendor-specific tasks. The system unwind 1772 library interface accesses the language-specific exception 1773 handling semantics via the pointer to the personality routine. 1774 The personality routine does not have an ABI-specific name. The 1775 size of the personality routine pointer is specified by the 1776 pointer encoding used. 1777 'R' 1778 1779 A 'R' may be present at any position after the first character 1780 of the string. This character may only be present if 'z' is the 1781 first character of the string. If present, The Augmentation 1782 Data shall include a 1 byte argument that represents the 1783 pointer encoding for the address pointers used in the FDE. 1784 __________________________________________________________ 1785 1786 10.6.1.2. The Frame Description Entry Format 1787 1788 Table 10-10. Frame Description Entry Format 1789 Length Required 1790 Extended Length Optional 1791 CIE Pointer Required 1792 PC Begin Required 1793 PC Range Required 1794 Augmentation Data Length Optional 1795 Augmentation Data Optional 1796 Call Frame Instructions Required 1797 Padding 1798 1799 Length 1800 A 4 byte unsigned value indicating the length in bytes 1801 of the CIE structure, not including the Length field 1802 itself. If Length contains the value 0xffffffff, then 1803 the length is contained the Extended Length field. If 1804 Length contains the value 0, then this CIE shall be 1805 considered a terminator and processing shall end. 1806 1807 Extended Length 1808 A 8 byte unsigned value indicating the length in bytes 1809 of the CIE structure, not including the Length field 1810 itself. 1811 1812 CIE Pointer 1813 A 4 byte unsigned value that when subtracted from the 1814 offset of the the CIE Pointer in the current FDE yields 1815 the offset of the start of the associated CIE. This 1816 value shall never be 0. 1817 1818 PC Begin 1819 An encoded value that indicates the address of the 1820 initial location associated with this FDE. The encoding 1821 format is specified in the Augmentation Data. 1822 1823 PC Range 1824 An absolute value that indicates the number of bytes of 1825 instructions associated with this FDE. 1826 1827 Augmentation Length 1828 An unsigned LEB128 encoded value indicating the length 1829 in bytes of the Augmentation Data. This field is only 1830 present if the Augmentation String in the associated CIE 1831 contains the character 'z'. 1832 1833 Augmentation Data 1834 A block of data whose contents are defined by the 1835 contents of the Augmentation String in the associated 1836 CIE as described above. This field is only present if 1837 the Augmentation String in the associated CIE contains 1838 the character 'z'. The size of this data is given by the 1839 Augentation Length. 1840 1841 Call Frame Instructions 1842 A set of Call Frame Instructions. 1843 1844 Padding 1845 Extra bytes to align the FDE structure to an addressing 1846 unit size boundary. 1847 __________________________________________________________ 1848 1849 10.6.2. The .eh_frame_hdr section 1850 1851 The .eh_frame_hdr section contains additional information about 1852 the .eh_frame section. A pointer to the start of the .eh_frame 1853 data, and optionally, a binary search table of pointers to the 1854 .eh_frame records are found in this section. 1855 1856 Data in this section is encoded according to Section 10.5.1. 1857 1858 Table 10-11. .eh_frame_hdr Section Format 1859 Encoding Field 1860 unsigned byte version 1861 unsigned byte eh_frame_ptr_enc 1862 unsigned byte fde_count_enc 1863 unsigned byte table_enc 1864 encoded eh_frame_ptr 1865 encoded fde_count 1866 binary search table 1867 1868 version 1869 1870 Version of the .eh_frame_hdr format. This value shall be 1. 1871 eh_frame_ptr_enc 1872 1873 The encoding format of the eh_frame_ptr field. 1874 fde_count_enc 1875 1876 The encoding format of the fde_count field. A value of 1877 DW_EH_PE_omit indicates the binary search table is not present. 1878 table_enc 1879 1880 The encoding format of the entries in the binary search table. 1881 A value of DW_EH_PE_omit indicates the binary search table is 1882 not present. 1883 eh_frame_ptr 1884 1885 The encoded value of the pointer to the start of the .eh_frame 1886 section. 1887 fde_count 1888 1889 The encoded value of the count of entries in the binary search 1890 table. 1891 binary search table 1892 1893 A binary search table containing fde_count entries. Each entry 1894 of the table consist of two encoded values, the initial 1895 location, and the address. The entries are sorted in an 1896 increasing order by the initial location value. 1897 __________________________________________________________ 1898 1899 10.7. Symbol Versioning 1900 1901 10.7.1. Introduction 1902 1903 This chapter describes the Symbol Versioning mechanism. All ELF 1904 objects may provide or depend on versioned symbols. Symbol 1905 Versioning is implemented by 3 section types: SHT_GNU_versym, 1906 SHT_GNU_verdef, and SHT_GNU_verneed. 1907 1908 The prefix Elfxx in the following descriptions and code 1909 fragments stands for either "Elf32" or "Elf64", depending on 1910 the architecture. 1911 1912 Versions are described by strings. The structures that are used 1913 for symbol versions also contain a member that holds the ELF 1914 hashing values of the strings. This allows for more efficient 1915 processing. 1916 __________________________________________________________ 1917 1918 10.7.2. Symbol Version Table 1919 1920 The special section .gnu.version which has a section type of 1921 SHT_GNU_versym shall contain the Symbol Version Table. This 1922 section shall have the same number of entries as the Dynamic 1923 Symbol Table in the .dynsym section. 1924 1925 The .gnu.version section shall contain an array of elements of 1926 type Elfxx_Half. Each entry specifies the version defined for 1927 or required by the corresponding symbol in the Dynamic Symbol 1928 Table. 1929 1930 The values in the Symbol Version Table are specific to the 1931 object in which they are located. These values are identifiers 1932 that are provided by the the vna_other member of the 1933 Elfxx_Vernaux structure or the vd_ndx member of the 1934 Elfxx_Verdef structure. 1935 1936 The values 0 and 1 are reserved. 1937 1938 0 1939 1940 The symbol is local, not available outside the object. 1941 1 1942 1943 The symbol is defined in this object and is globally available. 1944 1945 All other values are used to identify version strings located 1946 in one of the other Symbol Version sections. The value itself 1947 is not the version associated with the symbol. The string 1948 identified by the value defines the version of the symbol. 1949 __________________________________________________________ 1950 1951 10.7.3. Version Definitions 1952 1953 The special section .gnu.version_d which has a section type of 1954 SHT_GNU_verdef shall contain symbol version definitions. The 1955 number of entries in this section shall be contained in the 1956 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The sh_link 1957 member of the section header (see figure 4-8 in the System V 1958 ABI) shall point to the section that contains the strings 1959 referenced by this section. 1960 1961 The section shall contain an array of Elfxx_Verdef structures, 1962 as described in Figure 10-1, optionally followed by an array of 1963 Elfxx_Verdaux structures, as defined in Figure 10-2. 1964 typedef struct { 1965 Elfxx_Half vd_version; 1966 Elfxx_Half vd_flags; 1967 Elfxx_Half vd_ndx; 1968 Elfxx_Half vd_cnt; 1969 Elfxx_Word vd_hash; 1970 Elfxx_Word vd_aux; 1971 Elfxx_Word vd_next; 1972 } Elfxx_Verdef; 1973 1974 Figure 10-1. Version Definition Entries 1975 1976 vd_version 1977 1978 Version revision. This field shall be set to 1. 1979 vd_flags 1980 1981 Version information flag bitmask. 1982 vd_ndx 1983 1984 Version index numeric value referencing the SHT_GNU_versym 1985 section. 1986 vd_cnt 1987 1988 Number of associated verdaux array entries. 1989 vd_hash 1990 1991 Version name hash value (ELF hash function). 1992 vd_aux 1993 1994 Offset in bytes to a corresponding entry in an array of 1995 Elfxx_Verdaux structures as defined in Figure 10-2 1996 vd_next 1997 1998 Offset to the next verdef entry, in bytes. 1999 typedef struct { 2000 Elfxx_Word vda_name; 2001 Elfxx_Word vda_next; 2002 } Elfxx_Verdaux; 2003 2004 Figure 10-2. Version Definition Auxiliary Entries 2005 2006 vda_name 2007 2008 Offset to the version or dependency name string in the section 2009 header, in bytes. 2010 vda_next 2011 2012 Offset to the next verdaux entry, in bytes. 2013 __________________________________________________________ 2014 2015 10.7.4. Version Requirements 2016 2017 The special section .gnu.version_r which has a section type of 2018 SHT_GNU_verneed shall contain required symbol version 2019 definitions. The number of entries in this section shall be 2020 contained in the DT_VERNEEDNUM entry of the Dynamic Section 2021 .dynamic. The sh_link member of the section header (see figure 2022 4-8 in System V ABI) shall point to the section that contains 2023 the strings referenced by this section. 2024 2025 The section shall contain an array of Elfxx_Verneed structures, 2026 as described in Figure 10-3, optionally followed by an array of 2027 Elfxx_Vernaux structures, as defined in Figure 10-4. 2028 typedef struct { 2029 Elfxx_Half vn_version; 2030 Elfxx_Half vn_cnt; 2031 Elfxx_Word vn_file; 2032 Elfxx_Word vn_aux; 2033 Elfxx_Word vn_next; 2034 } Elfxx_Verneed; 2035 2036 Figure 10-3. Version Needed Entries 2037 2038 vn_version 2039 2040 Version of structure. This value is currently set to 1, and 2041 will be reset if the versioning implementation is incompatibly 2042 altered. 2043 vn_cnt 2044 2045 Number of associated verneed array entries. 2046 vn_file 2047 2048 Offset to the file name string in the section header, in bytes. 2049 vn_aux 2050 2051 Offset to a corresponding entry in the vernaux array, in bytes. 2052 vn_next 2053 2054 Offset to the next verneed entry, in bytes. 2055 typedef struct { 2056 Elfxx_Word vna_hash; 2057 Elfxx_Half vna_flags; 2058 Elfxx_Half vna_other; 2059 Elfxx_Word vna_name; 2060 Elfxx_Word vna_next; 2061 } Elfxx_Vernaux; 2062 2063 Figure 10-4. Version Needed Auxiliary Entries 2064 2065 vna_hash 2066 2067 Dependency name hash value (ELF hash function). 2068 vna_flags 2069 2070 Dependency information flag bitmask. 2071 vna_other 2072 2073 Object file version identifier used in the .gnu.version symbol 2074 version array. Bit number 15 controls whether or not the object 2075 is hidden; if this bit is set, the object cannot be used and 2076 the static linker will ignore the symbol's presence in the 2077 object. 2078 vna_name 2079 2080 Offset to the dependency name string in the section header, in 2081 bytes. 2082 vna_next 2083 2084 Offset to the next vernaux entry, in bytes. 2085 __________________________________________________________ 2086 2087 10.7.5. Startup Sequence 2088 2089 When loading a sharable object the system shall analyze version 2090 definition data from the loaded object to assure that it meets 2091 the version requirements of the calling object. This step is 2092 referred to as definition testing. The dynamic loader shall 2093 retrieve the entries in the caller's Elfxx_Verneed array and 2094 attempt to find matching definition information in the loaded 2095 Elfxx_Verdef table. 2096 2097 Each object and dependency shall be tested in turn. If a symbol 2098 definition is missing and the vna_flags bit for VER_FLG_WEAK is 2099 not set, the loader shall return an error and exit. If the 2100 vna_flags bit for VER_FLG_WEAK is set in the Elfxx_Vernaux 2101 entry, and the loader shall issue a warning and continue 2102 operation. 2103 2104 When the versions referenced by undefined symbols in the loaded 2105 object are found, version availability is certified. The test 2106 completes without error and the object shall be made available. 2107 __________________________________________________________ 2108 2109 10.7.6. Symbol Resolution 2110 2111 When symbol versioning is used in an object, relocations extend 2112 definition testing beyond the simple match of symbol name 2113 strings: the version of the reference shall also equal the name 2114 of the definition. 2115 2116 The same index that is used in the symbol table can be 2117 referenced in the SHT_GNU_versym section, and the value of this 2118 index is then used to acquire name data. The corresponding 2119 requirement string is retrieved from the Elfxx_Verneed array, 2120 and likewise, the corresponding definition string from the 2121 Elfxx_Verdef table. 2122 2123 If the high order bit (bit number 15) of the version symbolis 2124 set, the object cannot be used and the static linker shall 2125 ignore the symbol's presence in the object. 2126 2127 When an object with a reference and an object with the 2128 definition are being linked, the following rules shall govern 2129 the result: 2130 2131 * The object with the reference and the object with the 2132 definitions both use versioning. All described matching is 2133 processed in this case. A fatal error shall be triggered 2134 when no matching definition can be found in the object 2135 whose name is the one referenced by the vn_name element in 2136 the Elfxx_Verneed entry. 2137 * The object with the reference does not use versioning, 2138 while the object with the definitions does. In this 2139 instance, only the definitions with index numbers 1 and 2 2140 will be used in the reference match, the same identified by 2141 the static linker as the base definition. In cases where 2142 the static linker was not used, such as in calls to 2143 dlopen(), a version that does not have the base definition 2144 index shall be acceptable if it is the only version for 2145 which the symbol is defined. 2146 * The object with the reference uses versioning, but the 2147 object with the definitions specifies none. A matching 2148 symbol shall be accepted in this case. A fatal error shall 2149 be triggered if a corruption in the required symbols list 2150 obscures an outdated object file and causes a match on the 2151 object filename in the Elfxx_Verneed entry. 2152 * Neither the object with the reference nor the object with 2153 the definitions use versioning. The behavior in this 2154 instance shall default to pre-existing symbol rules. 2155 __________________________________________________________ 2156 2157 10.8. ABI note tag 2158 2159 Every executable shall contain a section named .note.ABI-tag of 2160 type SHT_NOTE. This section is structured as a note section as 2161 documented in the ELF spec. The section shall contain at least 2162 the following entry. The name field (namesz/name) contains the 2163 string "GNU". The type field shall be 1. The descsz field shall 2164 be at least 16, and the first 16 bytes of the desc field shall 2165 be as follows. 2166 2167 The first 32-bit word of the desc field shall be 0 (this 2168 signifies a Linux executable). The second, third, and fourth 2169 32-bit words of the desc field contain the earliest compatible 2170 kernel version. For example, if the 3 words are 2, 2, and 5, 2171 this signifies a 2.2.5 kernel. 2172 __________________________________________________________ 2173 2174 Chapter 11. Dynamic Linking 2175 2176 11.1. Program Loading and Dynamic Linking 2177 2178 LSB-conforming implementations shall support the object file 2179 information and system actions that create running programs as 2180 specified in the System V ABI and System V ABI Update and as 2181 further required by this specification and the relevant 2182 architecture specific part of ISO/IEC 23360. 2183 2184 Any shared object that is loaded shall contain sufficient 2185 DT_NEEDED records to satisfy the symbols on the shared library. 2186 __________________________________________________________ 2187 2188 11.2. Program Header 2189 2190 In addition to the Segment Types defined in the System V ABI 2191 and System V ABI Update the following Segment Types shall also 2192 be supported. 2193 2194 Table 11-1. Linux Segment Types 2195 Name Value 2196 PT_GNU_EH_FRAME 0x6474e550 2197 PT_GNU_STACK 0x6474e551 2198 PT_GNU_RELRO 0x6474e552 2199 2200 PT_GNU_EH_FRAME 2201 2202 The array element specifies the location and size of the 2203 exception handling information as defined by the .eh_frame_hdr 2204 section. 2205 PT_GNU_STACK 2206 2207 The p_flags member specifies the permissions on the segment 2208 containing the stack and is used to indicate wether the stack 2209 should be executable. The absense of this header indicates that 2210 the stack will be executable. 2211 PT_GNU_RELRO 2212 2213 the array element specifies the location and size of a segment 2214 which may be made read-only after relocations have been 2215 processed. 2216 __________________________________________________________ 2217 2218 11.3. Dynamic Entries 2219 2220 11.3.1. Introduction 2221 2222 As described in System V ABI, if an object file participates in 2223 dynamic linking, its program header table shall have an element 2224 of type PT_DYNAMIC. This `segment' contains the .dynamic 2225 section. A special symbol, _DYNAMIC, labels the section, which 2226 contains an array of the following structures. 2227 typedef struct { 2228 Elf32_Sword d_tag; 2229 union { 2230 Elf32_Word d_val; 2231 Elf32_Addr d_ptr; 2232 } d_un; 2233 } Elf32_Dyn; 2234 2235 extern Elf32_Dyn _DYNAMIC[]; 2236 2237 typedef struct { 2238 Elf64_Sxword d_tag; 2239 union { 2240 Elf64_Xword d_val; 2241 Elf64_Addr d_ptr; 2242 } d_un; 2243 } Elf64_Dyn; 2244 2245 extern Elf64_Dyn _DYNAMIC[]; 2246 2247 Figure 11-1. Dynamic Structure 2248 2249 For each object with this type, d_tag controls the 2250 interpretation of d_un. 2251 __________________________________________________________ 2252 2253 11.3.2. Dynamic Entries 2254 __________________________________________________________ 2255 2256 11.3.2.1. ELF Dynamic Entries 2257 2258 The following dynamic entries are defined in the System V ABI 2259 and System V ABI Update. 2260 2261 DT_BIND_NOW 2262 2263 Process relocations of object 2264 DT_DEBUG 2265 2266 For debugging; unspecified 2267 DT_FINI 2268 2269 Address of termination function 2270 DT_FINI_ARRAY 2271 2272 The address of an array of pointers to termination functions. 2273 DT_FINI_ARRAYSZ 2274 2275 Size in bytes of DT_FINI_ARRAY 2276 DT_FLAGS 2277 2278 Flag values specific to the object being loaded 2279 DT_HASH 2280 2281 Address of symbol hash table 2282 DT_HIPROC 2283 2284 End of processor-specific 2285 DT_INIT 2286 2287 Address of init function 2288 DT_INIT_ARRAY 2289 2290 The address of an array of pointers to initialization 2291 functions. 2292 DT_INIT_ARRAYSZ 2293 2294 Size in bytes of DT_INIT_ARRAY 2295 DT_JMPREL 2296 2297 Address of PLT relocs 2298 DT_LOPROC 2299 2300 Start of processor-specific 2301 DT_NEEDED 2302 2303 Name of needed library 2304 DT_NULL 2305 2306 Marks end of dynamic section 2307 DT_PLTREL 2308 2309 Type of reloc in PLT 2310 DT_PLTRELSZ 2311 2312 Size in bytes of PLT relocs 2313 DT_PREINIT_ARRAY 2314 2315 Array with addresses of preinit functions 2316 DT_PREINIT_ARRAYSZ 2317 2318 Size in bytes of DT_PREINIT_ARRAY 2319 DT_REL 2320 2321 Address of Rel relocs 2322 DT_RELA 2323 2324 Address of Rela relocs 2325 DT_RELAENT 2326 2327 Size of one Rela reloc 2328 DT_RELASZ 2329 2330 Total size of Rela relocs 2331 DT_RELENT 2332 2333 Size of one Rel reloc 2334 DT_RELSZ 2335 2336 Total size of Rel relocs 2337 DT_RPATH 2338 2339 Library search path 2340 DT_RUNPATH 2341 2342 null-terminated library search path string 2343 DT_SONAME 2344 2345 Name of shared object 2346 DT_STRSZ 2347 2348 Size of string table 2349 DT_STRTAB 2350 2351 Address of string table 2352 DT_SYMBOLIC 2353 2354 Start symbol search here 2355 DT_SYMENT 2356 2357 Size of one symbol table entry 2358 DT_SYMTAB 2359 2360 Address of symbol table 2361 DT_TEXTREL 2362 2363 Reloc might modify .text 2364 __________________________________________________________ 2365 2366 11.3.2.2. Additional Dynamic Entries 2367 2368 An LSB conforming object may also use the following additional 2369 Dynamic Entry types. 2370 2371 DT_ADDRRNGHI 2372 2373 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2374 definition by an archLSB. 2375 DT_ADDRRNGLO 2376 2377 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2378 definition by an archLSB. 2379 DT_AUXILIARY 2380 2381 Shared object to load before self 2382 DT_FILTER 2383 2384 Shared object to get values from 2385 DT_HIOS 2386 2387 Values from DT_LOOS through DT_HIOS are reserved for definition 2388 by specific operating systems. 2389 DT_LOOS 2390 2391 Values from DT_LOOS through DT_HIOS are reserved for definition 2392 by specific operating systems. 2393 DT_NUM 2394 2395 Number of dynamic entry tags defined (excepting reserved 2396 ranges). 2397 DT_POSFLAG_1 2398 2399 Flags for DT_* entries, effecting the following DT_* entry 2400 DT_RELCOUNT 2401 2402 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2403 single block and this entry specifies the number of entries in 2404 that block. This permits ld.so.1 to streamline the processing 2405 of RELATIVE relocations. 2406 DT_SYMINENT 2407 2408 Entry size of syminfo 2409 DT_SYMINFO 2410 2411 Address of the Syminfo table. 2412 DT_SYMINSZ 2413 2414 Size of syminfo table (in bytes) 2415 DT_VALRNGHI 2416 2417 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2418 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2419 DT_VALRNGLO 2420 2421 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2422 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2423 DT_VERDEF 2424 2425 Address of version definition table 2426 DT_VERDEFNUM 2427 2428 Number of version definitions 2429 DT_VERNEED 2430 2431 Address of table with needed versions 2432 DT_VERNEEDNUM 2433 2434 Number of needed versions 2435 DT_VERSYM 2436 2437 Address of the table provided by the .gnu.version section. 2438 2439 III. Base Libraries 2440 2441 Table of Contents 2442 12. Base Libraries 2443 2444 12.1. Introduction 2445 12.2. Program Interpreter 2446 12.3. Interfaces for libc 2447 2448 12.3.1. RPC 2449 12.3.2. Epoll 2450 12.3.3. System Calls 2451 12.3.4. Standard I/O 2452 12.3.5. Signal Handling 2453 12.3.6. Localization Functions 2454 12.3.7. Posix Spawn Option 2455 12.3.8. Posix Advisory Option 2456 12.3.9. Socket Interface 2457 12.3.10. Wide Characters 2458 12.3.11. String Functions 2459 12.3.12. IPC Functions 2460 12.3.13. Regular Expressions 2461 12.3.14. Character Type Functions 2462 12.3.15. Time Manipulation 2463 12.3.16. Terminal Interface Functions 2464 12.3.17. System Database Interface 2465 12.3.18. Language Support 2466 12.3.19. Large File Support 2467 12.3.20. Inotify 2468 12.3.21. Standard Library 2469 12.3.22. GNU Extensions for libc 2470 2471 12.4. Data Definitions for libc 2472 2473 12.4.1. arpa/inet.h 2474 12.4.2. assert.h 2475 12.4.3. cpio.h 2476 12.4.4. ctype.h 2477 12.4.5. dirent.h 2478 12.4.6. elf.h 2479 12.4.7. endian.h 2480 12.4.8. err.h 2481 12.4.9. errno.h 2482 12.4.10. execinfo.h 2483 12.4.11. fcntl.h 2484 12.4.12. fmtmsg.h 2485 12.4.13. fnmatch.h 2486 12.4.14. ftw.h 2487 12.4.15. getopt.h 2488 12.4.16. glob.h 2489 12.4.17. gnu/libc-version.h 2490 12.4.18. grp.h 2491 12.4.19. iconv.h 2492 12.4.20. inttypes.h 2493 12.4.21. langinfo.h 2494 12.4.22. libgen.h 2495 12.4.23. libintl.h 2496 12.4.24. limits.h 2497 12.4.25. link.h 2498 12.4.26. locale.h 2499 12.4.27. monetary.h 2500 12.4.28. net/if.h 2501 12.4.29. netdb.h 2502 12.4.30. netinet/icmp6.h 2503 12.4.31. netinet/igmp.h 2504 12.4.32. netinet/in.h 2505 12.4.33. netinet/in_systm.h 2506 12.4.34. netinet/ip.h 2507 12.4.35. netinet/ip6.h 2508 12.4.36. netinet/ip_icmp.h 2509 12.4.37. netinet/tcp.h 2510 12.4.38. netinet/udp.h 2511 12.4.39. nl_types.h 2512 12.4.40. poll.h 2513 12.4.41. pty.h 2514 12.4.42. pwd.h 2515 12.4.43. regex.h 2516 12.4.44. rpc/auth.h 2517 12.4.45. rpc/clnt.h 2518 12.4.46. rpc/pmap_clnt.h 2519 12.4.47. rpc/rpc_msg.h 2520 12.4.48. rpc/svc.h 2521 12.4.49. rpc/types.h 2522 12.4.50. rpc/xdr.h 2523 12.4.51. sched.h 2524 12.4.52. search.h 2525 12.4.53. setjmp.h 2526 12.4.54. signal.h 2527 12.4.55. spawn.h 2528 12.4.56. stddef.h 2529 12.4.57. stdint.h 2530 12.4.58. stdio.h 2531 12.4.59. stdlib.h 2532 12.4.60. string.h 2533 12.4.61. strings.h 2534 12.4.62. sys/epoll.h 2535 12.4.63. sys/file.h 2536 12.4.64. sys/inotify.h 2537 12.4.65. sys/ioctl.h 2538 12.4.66. sys/ipc.h 2539 12.4.67. sys/mman.h 2540 12.4.68. sys/msg.h 2541 12.4.69. sys/param.h 2542 12.4.70. sys/poll.h 2543 12.4.71. sys/ptrace.h 2544 12.4.72. sys/resource.h 2545 12.4.73. sys/select.h 2546 12.4.74. sys/sem.h 2547 12.4.75. sys/sendfile.h 2548 12.4.76. sys/shm.h 2549 12.4.77. sys/socket.h 2550 12.4.78. sys/stat.h 2551 12.4.79. sys/statfs.h 2552 12.4.80. sys/statvfs.h 2553 12.4.81. sys/sysinfo.h 2554 12.4.82. sys/time.h 2555 12.4.83. sys/timeb.h 2556 12.4.84. sys/times.h 2557 12.4.85. sys/types.h 2558 12.4.86. sys/uio.h 2559 12.4.87. sys/un.h 2560 12.4.88. sys/utsname.h 2561 12.4.89. sys/wait.h 2562 12.4.90. syslog.h 2563 12.4.91. tar.h 2564 12.4.92. termios.h 2565 12.4.93. time.h 2566 12.4.94. ucontext.h 2567 12.4.95. ulimit.h 2568 12.4.96. unistd.h 2569 12.4.97. utime.h 2570 12.4.98. utmp.h 2571 12.4.99. utmpx.h 2572 12.4.100. wchar.h 2573 12.4.101. wctype.h 2574 12.4.102. wordexp.h 2575 2576 12.5. Interface Definitions for libc 2577 2578 _IO_feof -- alias for feof 2579 _IO_getc -- alias for getc 2580 _IO_putc -- alias for putc 2581 _IO_puts -- alias for puts 2582 __assert_fail -- abort the program after false 2583 assertion 2584 2585 __chk_fail -- terminate a function in case of buffer 2586 overflow 2587 2588 __confstr_chk -- get configuration dependent string 2589 variables, with buffer overflow checking 2590 2591 __ctype_b_loc -- accessor function for __ctype_b 2592 array for ctype functions 2593 2594 __ctype_get_mb_cur_max -- maximum length of a 2595 multibyte character in the current locale 2596 2597 __ctype_tolower_loc -- accessor function for 2598 __ctype_b_tolower array for ctype tolower() 2599 function 2600 2601 __ctype_toupper_loc -- accessor function for 2602 __ctype_b_toupper() array for ctype 2603 toupper() function 2604 2605 __cxa_atexit -- register a function to be called by 2606 exit or when a shared library is unloaded 2607 2608 __cxa_finalize -- call destructors of global (or 2609 local static) C++ objects and exit functions 2610 registered with atexit 2611 2612 __daylight -- external daylight savings time flag 2613 __environ -- alias for environ - user environment 2614 __errno_location -- address of errno variable 2615 __fgets_chk -- string input, with buffer overflow 2616 checking 2617 2618 __fgets_unlocked_chk -- non-locking string input, 2619 with buffer overflow checking 2620 2621 __fgetws_chk -- read a wide-character string from a 2622 FILE stream, with buffer overflow checking 2623 2624 __fgetws_unlocked_chk -- read a wide-character 2625 string from a FILE stream in a non-locking 2626 manner, with stack checking 2627 2628 __fpending -- returns in bytes the amount of output 2629 pending on a stream 2630 2631 __fprintf_chk -- convert formatted output, with 2632 stack checking 2633 2634 __fwprintf_chk -- convert formatted wide-character 2635 output, with stack checking 2636 2637 __fxstatat -- get file status relative to directory 2638 file descriptor 2639 2640 __fxstatat64, fstatat64 -- get file status relative 2641 to a directory file descriptor (Large File 2642 Support) 2643 2644 __getcwd_chk -- get current working directory, with 2645 buffer overflow checking 2646 2647 __getgroups_chk -- get list of supplementary group 2648 IDs, with buffer overflow checking 2649 2650 __gethostname_chk -- get host name, with buffer 2651 overflow checking 2652 2653 __getlogin_r_chk -- get user name, with buffer 2654 overflow checking (reentrant) 2655 2656 __getpagesize -- alias for getpagesize - get current 2657 page size 2658 2659 __getpgid -- get the process group id 2660 __h_errno_location -- address of h_errno variable 2661 __isinf -- test for infinity 2662 __isinff -- test for infinity 2663 __isinfl -- test for infinity 2664 __isnan -- test for infinity 2665 __isnanf -- test for infinity 2666 __isnanl -- test for infinity 2667 __libc_current_sigrtmax -- return number of 2668 available real-time signal with lowest 2669 priority 2670 2671 __libc_current_sigrtmin -- return number of 2672 available real-time signal with highest 2673 priority 2674 2675 __libc_start_main -- initialization routine 2676 __mbsnrtowcs_chk -- convert a multibyte string to a 2677 wide-character string, with buffer overflow 2678 checking 2679 2680 __mbsrtowcs_chk -- convert a multibyte string to a 2681 wide-character string, with buffer overflow 2682 checking 2683 2684 __mbstowcs_chk -- convert a multibyte string to a 2685 wide-character string, with buffer overflow 2686 checking 2687 2688 __memcpy_chk -- copy memory area, with buffer 2689 overflow checking 2690 2691 __memmove_chk -- copy memory area, with buffer 2692 overflow checking 2693 2694 __mempcpy -- copy given number of bytes of source to 2695 destination 2696 2697 __mempcpy_chk -- copy memory area, with buffer 2698 overflow checking 2699 2700 __memset_chk -- fill memory with a constant byte, 2701 using buffer overflow checking 2702 2703 __pread64_chk -- read from a file descriptor at a 2704 given offset, with buffer overflow checking 2705 2706 __pread_chk -- read from a file descriptor at a 2707 given offset, with buffer overflow checking 2708 2709 __printf_chk -- format and print data, with stack 2710 checking 2711 2712 __rawmemchr -- scan memory 2713 __read_chk -- read from a file descriptor, with 2714 buffer overflow checking 2715 2716 __readlink_chk -- display value of a symbolic link, 2717 with buffer overflow checking 2718 2719 __realpath_chk -- return the canonicalized absolute 2720 pathname, with buffer overflow checking 2721 2722 __recv_chk -- receive a message from a socket, with 2723 buffer overflow checking 2724 2725 __recvfrom_chk -- receive a message from a socket, 2726 with buffer overflow checking 2727 2728 __register_atfork -- alias for register_atfork 2729 __sigsetjmp -- save stack context for non-local goto 2730 __snprintf_chk -- convert formatted output, with 2731 buffer overflow checking 2732 2733 __sprintf_chk -- convert formatted output, with 2734 stack checking 2735 2736 __stack_chk_fail -- terminate a function in case of 2737 stack overflow 2738 2739 __stpcpy -- alias for stpcpy 2740 __stpcpy_chk -- copy a string returning a pointer to 2741 its end, with buffer overflow checking 2742 2743 __stpncpy_chk -- copy a fixed-size string, returning 2744 a pointer to its end, with buffer overflow 2745 checking 2746 2747 __strcat_chk -- concatenate two strings, with buffer 2748 overflow checking 2749 2750 __strcpy_chk -- copy a string, with buffer overflow 2751 checking 2752 2753 __strdup -- alias for strdup 2754 __strncat_chk -- concatenate two strings, with 2755 buffer overflow checking 2756 2757 __strncpy_chk -- copy a string, with buffer overflow 2758 checking 2759 2760 __strtod_internal -- underlying function for strtod 2761 __strtof_internal -- underlying function for strtof 2762 __strtok_r -- alias for strtok_r 2763 __strtol_internal -- alias for strtol 2764 __strtold_internal -- underlying function for 2765 strtold 2766 2767 __strtoll_internal -- underlying function for 2768 strtoll 2769 2770 __strtoul_internal -- underlying function for 2771 strtoul 2772 2773 __strtoull_internal -- underlying function for 2774 strtoull 2775 2776 __swprintf_chk -- convert formatted wide-character 2777 output, with stack checking 2778 2779 __sysconf -- get configuration information at 2780 runtime 2781 2782 __syslog_chk -- send messages to the system logger, 2783 with stack checking 2784 2785 __sysv_signal -- signal handling 2786 __timezone -- external variable containing timezone 2787 __ttyname_r_chk -- return name of a terminal, with 2788 buffer overflow checking (reentrant) 2789 2790 __tzname -- external variable containing the 2791 timezone names 2792 2793 __vfprintf_chk -- convert formatted output, with 2794 stack checking 2795 2796 __vfwprintf_chk -- convert formatted wide-character 2797 output, with stack checking 2798 2799 __vprintf_chk -- convert formatted output, with 2800 stack checking 2801 2802 __vsnprintf_chk -- convert formatted output, with 2803 stack checking 2804 2805 __vsprintf_chk -- convert formatted output, with 2806 stack checking 2807 2808 __vswprintf_chk -- convert formatted wide-character 2809 output, with stack checking 2810 2811 __vsyslog_chk -- send messages to the system logger, 2812 with stack checking 2813 2814 __vwprintf_chk -- convert formatted wide-character 2815 output, with stack checking 2816 2817 __wcpcpy_chk -- copy a wide-character string, 2818 returning a pointer to its end, with buffer 2819 overflow checking 2820 2821 __wcpncpy_chk -- copy a fixed-size string of wide 2822 characters, returning a pointer to its end, 2823 with buffer overflow checking 2824 2825 __wcrtomb_chk -- convert a wide character to a 2826 multibyte sequence, with buffer overflow 2827 checking 2828 2829 __wcscat_chk -- concatenate two wide-character 2830 strings, with buffer overflow checking 2831 2832 __wcscpy_chk -- copy a wide-character string, with 2833 buffer overflow checking 2834 2835 __wcsncat_chk -- concatenate two wide-character 2836 strings, with buffer overflow checking 2837 2838 __wcsncpy_chk -- copy a fixed-size string of wide 2839 characters, with buffer overflow checking 2840 2841 __wcsnrtombs_chk -- convert a wide-character string 2842 to a multibyte string, with buffer overflow 2843 checking 2844 2845 __wcsrtombs_chk -- convert a wide-character string 2846 to a multibyte string, with buffer overflow 2847 checking 2848 2849 __wcstod_internal -- underlying function for wcstod 2850 __wcstof_internal -- underlying function for wcstof 2851 __wcstol_internal -- underlying function for wcstol 2852 __wcstold_internal -- underlying function for 2853 wcstold 2854 2855 __wcstombs_chk -- convert a wide-character string to 2856 a multibyte string, with buffer overflow 2857 checking 2858 2859 __wcstoul_internal -- underlying function for 2860 wcstoul 2861 2862 __wctomb_chk -- convert a wide character to a 2863 multibyte sequence, with buffer overflow 2864 checking 2865 2866 __wmemcpy_chk -- copy an array of wide-characters, 2867 with buffer overflow checking 2868 2869 __wmemmove_chk -- copy an array of wide-characters, 2870 with buffer overflow checking 2871 2872 __wmempcpy_chk -- copy memory area, with buffer 2873 overflow checking 2874 2875 __wmemset_chk -- fill an array of wide-characters 2876 with a constant wide character, with buffer 2877 overflow checking 2878 2879 __wprintf_chk -- convert formatted wide-character 2880 output, with stack checking 2881 2882 __xmknod -- make a special file 2883 __xmknodat -- make a special file relative to a 2884 directory file descriptor 2885 2886 __xpg_basename -- return the last component of a 2887 file name 2888 2889 __xpg_sigpause -- remove a signal from the signal 2890 mask and suspend the thread 2891 2892 __xpg_strerror_r -- return string describing error 2893 number 2894 2895 __xstat -- get File Status 2896 __xstat64 -- get File Status 2897 _environ -- alias for environ - user environment 2898 _nl_msg_cat_cntr -- new catalog load counter 2899 _sys_errlist -- array containing the "C" locale 2900 strings used by strerror() 2901 2902 _sys_siglist -- array containing the names of the 2903 signal names 2904 2905 acct -- switch process accounting on or off 2906 adjtime -- correct the time to allow synchronization 2907 of the system clock 2908 2909 alphasort64 -- Comparison function for directory 2910 scanning (Large File Support) 2911 2912 asprintf -- write formatted output to a dynamically 2913 allocated string 2914 2915 backtrace, backtrace_symbols, 2916 backtrace_symbols_fd -- runtime stack back 2917 tracing 2918 2919 basename -- return the last component of a file name 2920 bind_textdomain_codeset -- specify encoding for 2921 message retrieval 2922 2923 bindresvport -- bind socket to privileged IP port 2924 bindtextdomain -- specify the location of a message 2925 catalog 2926 2927 cfmakeraw -- get and set terminal attributes 2928 cfsetspeed -- set terminal input and output data 2929 rate 2930 2931 clearerr_unlocked -- non-thread-safe clearerr 2932 daemon -- run in the background 2933 dcgettext -- perform domain and category specific 2934 lookup in message catalog 2935 2936 dcngettext -- perform domain and category specific 2937 lookup in message catalog with plural 2938 2939 dgettext -- perform lookup in message catalog for 2940 the current LC_MESSAGES locale 2941 2942 dl_iterate_phdr -- iterate over a program's loaded 2943 shared objects 2944 2945 dngettext -- perform lookup in message catalog for 2946 the current locale 2947 2948 drand48_r -- reentrantly generate pseudorandom 2949 numbers in a uniform distribution 2950 2951 duplocale -- provide new handle for selection of 2952 locale 2953 2954 endutent -- access utmp file entries 2955 epoll_create -- open an epoll file descriptor 2956 epoll_ctl -- control an epoll file descriptor 2957 epoll_wait -- wait for I/O events on an epoll file 2958 descriptor 2959 2960 erand48_r -- reentrantly generate pseudorandom 2961 numbers in a uniform distribution 2962 2963 err -- display formatted error messages 2964 error -- print error message 2965 errx -- display formatted error message and exit 2966 fcntl -- file control 2967 feof_unlocked -- non-thread-safe feof 2968 ferror_unlocked -- non-thread-safe ferror 2969 fflush_unlocked -- non thread safe fflush 2970 fgetc_unlocked -- non-thread-safe fgetc 2971 fgets_unlocked -- non-thread-safe fgets 2972 fgetwc_unlocked -- non thread safe fgetwc 2973 fgetws_unlocked -- non-thread-safe fgetws 2974 fileno_unlocked -- non-thread-safe fileno 2975 flock -- apply or remove an advisory lock on an open 2976 file 2977 2978 fputc_unlocked -- non-thread-safe fputc 2979 fputs_unlocked -- non-thread-safe fputs 2980 fputwc_unlocked -- non-thread-safe fputwc 2981 fputws_unlocked -- non-thread-safe fputws 2982 fread_unlocked -- non-thread-safe fread 2983 freelocale -- free a locale object 2984 fscanf -- convert formatted input 2985 fstatfs -- (deprecated) 2986 fstatfs64 -- (deprecated) 2987 fwrite_unlocked -- non-thread-safe fwrite 2988 fwscanf -- convert formatted input 2989 getdomainname -- get NIS domain name (DEPRECATED). 2990 getdtablesize -- get file descriptor table size 2991 (DEPRECATED) 2992 2993 getgrent_r -- reentrantly get entry in group file 2994 getgrouplist -- get groups a user belongs to 2995 gethostbyaddr_r -- find network host database entry 2996 matching host name (DEPRECATED) 2997 2998 gethostbyname2 -- find network host database entry 2999 matching host name (DEPRECATED) 3000 3001 gethostbyname2_r -- find network host database entry 3002 matching host name (DEPRECATED) 3003 3004 gethostbyname_r -- find network host database entry 3005 matching host name (DEPRECATED) 3006 3007 getloadavg -- get system load averages 3008 getopt -- parse command line options 3009 getopt_long -- parse command line options 3010 getopt_long_only -- parse command line options 3011 getpagesize -- get memory page size (DEPRECATED) 3012 getprotobyname_r -- retrieve information from the 3013 network protocol database by protocol name, 3014 reentrantly 3015 3016 getprotobynumber_r -- retrieve information from the 3017 network protocol database by protocol 3018 number, reentrantly 3019 3020 getprotoent_r -- read the next entry of the protocol 3021 database, reentrantly 3022 3023 getpwent_r -- reentrantly get entry in passwd file 3024 getservbyname_r -- retrieve information from the 3025 network services database by service name, 3026 reentrantly 3027 3028 getservbyport_r -- retrieve information from the 3029 network services database by service port, 3030 reentrantly 3031 3032 getservent_r -- read the next entry of the network 3033 services database, reentrantly 3034 3035 getsockopt -- get socket options 3036 gettext -- search message catalogs for a string 3037 getutent -- access user accounting database entries 3038 getutent_r -- access user accounting database 3039 entries 3040 3041 getwc_unlocked -- non-thread-safe getwc 3042 getwchar_unlocked -- non-thread-safe getwchar 3043 glob64 -- find pathnames matching a pattern (Large 3044 File Support) 3045 3046 globfree64 -- free memory from glob64() (Large File 3047 Support) 3048 3049 gnu_get_libc_version, gnu_get_libc_release -- get 3050 glibc-specific version and release 3051 3052 hcreate_r -- allocate space for a hash search table, 3053 reentrantly 3054 3055 hdestroy_r -- dispose of a hash search table, 3056 reentrantly 3057 3058 hsearch_r -- search a hash table, reentrantly 3059 inet_aton -- Internet address manipulation routine 3060 initgroups -- initialize the supplementary group 3061 access list 3062 3063 initstate_r -- reentrantly initialize a state array 3064 for random number generator functions 3065 3066 inotify_add_watch -- add a watch to a watch list 3067 inotify_init -- instantiate inotify 3068 inotify_rm_watch -- remove a watch from an inotify 3069 watch list 3070 3071 ioctl -- control device 3072 sockio -- socket ioctl commands 3073 ttyio -- tty ioctl commands 3074 jrand48_r -- reentrantly generate pseudorandom 3075 numbers in a uniform distribution 3076 3077 kill -- send a signal 3078 lcong48_r -- reentrantly generate pseudorandom 3079 numbers in a uniform distribution 3080 3081 link -- create a link to a file 3082 lrand48_r -- reentrantly generate pseudorandom 3083 numbers in a uniform distribution 3084 3085 mbsnrtowcs -- convert a multibyte string to a wide 3086 character string 3087 3088 memmem -- locate bytes 3089 memrchr -- scan memory for a character 3090 mkstemp64 -- create a unique temporary file (Large 3091 File Support) 3092 3093 mrand48_r -- reentrantly generate pseudorandom 3094 numbers in a uniform distribution 3095 3096 mremap -- remap a virtual memory address 3097 newlocale -- allocate a locale object 3098 ngettext -- search message catalogs for plural 3099 string 3100 3101 nrand48_r -- reentrantly generate pseudorandom 3102 numbers in a uniform distribution 3103 3104 openat64 -- open a file relative to a directory file 3105 descriptor (Large File Support) 3106 3107 pmap_getport -- find the port number assigned to a 3108 service registered with a portmapper. 3109 3110 pmap_set -- establishes mapping to machine's RPC 3111 Bind service. 3112 3113 pmap_unset -- destroys RPC Binding 3114 posix_fadvise64 -- File advisory information (Large 3115 File Support) 3116 3117 posix_fallocate64 -- file space control (Large File 3118 Support) 3119 3120 pread64 -- read from a file (Large File Support) 3121 psignal -- print signal message 3122 ptrace -- process trace 3123 putwc_unlocked -- non-thread-safe putwc 3124 putwchar_unlocked -- non-thread-safe putwchar 3125 pwrite64 -- write on a file (Large File Support) 3126 random_r -- reentrantly generate pseudorandom 3127 numbers in a uniform distribution 3128 3129 readdir64_r -- read a directory (Large File Support) 3130 regexec -- regular expression matching 3131 scandir64 -- scan a directory (Large File Support) 3132 scanf -- convert formatted input 3133 sched_getaffinity -- retrieve the affinity mask of a 3134 process 3135 3136 sched_setaffinity -- set the CPU affinity mask for a 3137 process 3138 3139 sched_setscheduler -- set scheduling policy and 3140 parameters 3141 3142 seed48_r -- reentrantly generate pseudorandom 3143 numbers in a uniform distribution 3144 3145 sendfile -- transfer data between two file 3146 descriptors 3147 3148 sendfile64 -- transfer data between two file 3149 descriptors (Large File Support) 3150 3151 setbuffer -- stream buffering operation 3152 setgroups -- set list of supplementary group IDs 3153 sethostname -- set host name 3154 setsockopt -- set socket options 3155 setstate_r -- reentrantly change the state array 3156 used by random number generator functions 3157 3158 setutent -- access user accounting database entries 3159 sigandset -- build a new signal set by combining the 3160 two input sets using logical AND 3161 3162 sigisemptyset -- check for empty signal set 3163 sigorset -- build a new signal set by combining the 3164 two input sets using logical OR 3165 3166 sigpause -- remove a signal from the signal mask and 3167 suspend the thread (deprecated) 3168 3169 sigreturn -- return from signal handler and cleanup 3170 stack frame 3171 3172 srand48_r -- reentrantly generate pseudorandom 3173 numbers in a uniform distribution 3174 3175 srandom_r -- reentrantly set the seed for a new 3176 sequence of pseudorandom numbers 3177 3178 sscanf -- convert formatted input 3179 statfs -- (deprecated) 3180 statfs64 -- (deprecated) 3181 stime -- set time 3182 stpcpy -- copy a string returning a pointer to its 3183 end 3184 3185 stpncpy -- copy a fixed-size string, returning a 3186 pointer to its end 3187 3188 strcasestr -- locate a substring ignoring case 3189 strerror_r -- return string describing error number 3190 strndup -- return a malloc'd copy of at most the 3191 specified number of bytes of a string 3192 3193 strnlen -- determine the length of a fixed-size 3194 string 3195 3196 strptime -- parse a time string 3197 strsep -- extract token from string 3198 strsignal -- return string describing signal 3199 strtoq -- convert string value to a long or quad_t 3200 integer 3201 3202 strtouq -- convert a string to an unsigned long long 3203 svc_register -- register Remote Procedure Call 3204 interface 3205 3206 svc_run -- waits for RPC requests to arrive and 3207 calls service procedure 3208 3209 svc_sendreply -- called by RPC service's dispatch 3210 routine 3211 3212 svctcp_create -- create a TCP/IP-based RPC service 3213 transport 3214 3215 svcudp_create -- create a UDP-based RPC service 3216 transport 3217 3218 swscanf -- convert formatted input 3219 sysconf -- Get configuration information at runtime 3220 sysinfo -- return system information 3221 system -- execute a shell command 3222 textdomain -- set the current default message domain 3223 unlink -- remove a directory entry 3224 uselocale -- set locale for thread 3225 utmpname -- set user accounting database 3226 vasprintf -- write formatted output to a dynamically 3227 allocated string 3228 3229 vdprintf -- write formatted output to a file 3230 descriptor 3231 3232 verrx -- display formatted error message and exit 3233 vfscanf -- convert formatted input 3234 vfwscanf -- convert formatted input 3235 vscanf -- convert formatted input 3236 vsscanf -- convert formatted input 3237 vswscanf -- convert formatted input 3238 vsyslog -- log to system log 3239 vwscanf -- convert formatted input 3240 wait4 -- wait for process termination, BSD style 3241 warn -- formatted error messages 3242 warnx -- formatted error messages 3243 wcpcpy -- copy a wide character string, returning a 3244 pointer to its end 3245 3246 wcpncpy -- copy a fixed-size string of wide 3247 characters, returning a pointer to its end 3248 3249 wcscasecmp -- compare two wide-character strings, 3250 ignoring case 3251 3252 wcsdup -- duplicate a wide-character string 3253 wcsncasecmp -- compare two fixed-size wide-character 3254 strings, ignoring case 3255 3256 wcsnlen -- determine the length of a fixed-size 3257 wide-character string 3258 3259 wcsnrtombs -- convert a wide character string to a 3260 multi-byte string 3261 3262 wcstoq -- convert wide string to long long int 3263 representation 3264 3265 wcstouq -- convert wide string to unsigned long long 3266 int representation 3267 3268 wscanf -- convert formatted input 3269 xdr_u_int -- library routines for external data 3270 representation 3271 3272 xdrstdio_create -- library routines for external 3273 data representation 3274 3275 12.6. Interfaces for libm 3276 3277 12.6.1. Math 3278 3279 12.7. Data Definitions for libm 3280 3281 12.7.1. complex.h 3282 12.7.2. fenv.h 3283 12.7.3. math.h 3284 3285 12.8. Interface Definitions for libm 3286 3287 __finite -- test for infinity 3288 __finitef -- test for infinity 3289 __finitel -- test for infinity 3290 __fpclassify -- Classify real floating type 3291 __fpclassifyf -- Classify real floating type 3292 __signbit -- test sign of floating point value 3293 __signbitf -- test sign of floating point value 3294 clog10 -- Logarithm of a Complex Number 3295 clog10f -- Logarithm of a Complex Number 3296 clog10l -- Logarithm of a Complex Number 3297 drem -- Floating Point Remainder (DEPRECATED) 3298 dremf -- Floating Point Remainder (DEPRECATED) 3299 dreml -- Floating Point Remainder (DEPRECATED) 3300 exp10 -- Base-10 power function 3301 exp10f -- Base-10 power function 3302 exp10l -- Base-10 power function 3303 fedisableexcept -- disable floating point exceptions 3304 feenableexcept -- enable floating point exceptions 3305 fegetexcept -- query floating point exception 3306 handling state 3307 3308 finite -- test for infinity (DEPRECATED) 3309 finitef -- test for infinity (DEPRECATED) 3310 finitel -- test for infinity (DEPRECATED) 3311 gamma -- log gamma function (DEPRECATED) 3312 gammaf -- log gamma function (DEPRECATED) 3313 gammal -- log gamma function (DEPRECATED) 3314 j0f -- Bessel functions 3315 j0l -- Bessel functions 3316 j1f -- Bessel functions 3317 j1l -- Bessel functions 3318 jnf -- Bessel functions 3319 jnl -- Bessel functions 3320 lgamma_r -- log gamma functions 3321 lgammaf_r -- log gamma functions 3322 lgammal_r -- log gamma functions 3323 matherr -- math library exception handling 3324 pow10 -- Base-10 power function 3325 pow10f -- Base-10 power function 3326 pow10l -- Base-10 power function 3327 scalbf -- load exponent of radix-independent 3328 floating point number 3329 3330 scalbl -- load exponent of radix-independent 3331 floating point number 3332 3333 significand -- floating point mantissa 3334 significandf -- floating point mantissa 3335 significandl -- floating point mantissa 3336 sincos -- trigonometric functions 3337 sincosf -- trigonometric functions 3338 sincosl -- trigonometric functions 3339 y0f -- Bessel functions 3340 y0l -- Bessel functions 3341 y1f -- Bessel functions 3342 y1l -- Bessel functions 3343 ynf -- Bessel functions 3344 ynl -- Bessel functions 3345 3346 12.9. Interfaces for libpthread 3347 3348 12.9.1. Realtime Threads 3349 12.9.2. Advanced Realtime Threads 3350 12.9.3. Posix Threads 3351 12.9.4. Thread aware versions of libc interfaces 3352 12.9.5. GNU Extensions for libpthread 3353 3354 12.10. Data Definitions for libpthread 3355 3356 12.10.1. pthread.h 3357 12.10.2. semaphore.h 3358 3359 12.11. Interface Definitions for libpthread 3360 3361 _pthread_cleanup_pop -- establish cancellation 3362 handlers 3363 3364 _pthread_cleanup_push -- establish cancellation 3365 handlers 3366 3367 pthread_getattr_np -- get thread attributes 3368 pthread_mutex_consistent_np -- mark state protected 3369 by robust mutex as consistent 3370 3371 pthread_mutexattr_getrobust_np, 3372 pthread_mutexattr_setrobust_np -- get and 3373 set the mutex robust attribute 3374 3375 pthread_rwlockattr_getkind_np, 3376 pthread_rwlockattr_setkind_np -- get/set the 3377 read-write lock kind of the thread 3378 read-write lock attribute object 3379 3380 12.12. Interfaces for libgcc_s 3381 3382 12.12.1. Unwind Library 3383 3384 12.13. Data Definitions for libgcc_s 3385 3386 12.13.1. unwind.h 3387 3388 12.14. Interface Definitions for libgcc_s 3389 3390 _Unwind_Backtrace -- private C++ error handling 3391 method 3392 3393 _Unwind_DeleteException -- private C++ error 3394 handling method 3395 3396 _Unwind_FindEnclosingFunction -- private C++ error 3397 handling method 3398 3399 _Unwind_ForcedUnwind -- private C++ error handling 3400 method 3401 3402 _Unwind_GetCFA -- private C++ error handling method 3403 _Unwind_GetGR -- private C++ error handling method 3404 _Unwind_GetIP -- private C++ error handling method 3405 _Unwind_GetIPInfo -- private C++ error handling 3406 method 3407 3408 _Unwind_GetLanguageSpecificData -- private C++ error 3409 handling method 3410 3411 _Unwind_GetRegionStart -- private C++ error handling 3412 method 3413 3414 _Unwind_RaiseException -- private C++ error handling 3415 method 3416 3417 _Unwind_Resume -- private C++ error handling method 3418 _Unwind_Resume_or_Rethrow -- private C++ error 3419 handling method 3420 3421 _Unwind_SetGR -- private C++ error handling method 3422 _Unwind_SetIP -- private C++ error handling method 3423 3424 12.15. Interfaces for libdl 3425 3426 12.15.1. Dynamic Loader 3427 3428 12.16. Data Definitions for libdl 3429 3430 12.16.1. dlfcn.h 3431 3432 12.17. Interface Definitions for libdl 3433 3434 dladdr -- find the shared object containing a given 3435 address 3436 3437 dlopen -- open dynamic object 3438 dlsym -- obtain the address of a symbol from a 3439 dlopen object 3440 3441 dlvsym -- obtain the address of a symbol from a 3442 dlopen object 3443 3444 12.18. Interfaces for librt 3445 3446 12.18.1. Shared Memory Objects 3447 12.18.2. Clock 3448 12.18.3. Timers 3449 12.18.4. Message Queues 3450 3451 12.19. Data Definitions for librt 3452 3453 12.19.1. mqueue.h 3454 3455 12.20. Interfaces for libcrypt 3456 3457 12.20.1. Encryption 3458 3459 12.21. Interfaces for libpam 3460 3461 12.21.1. Pluggable Authentication API 3462 3463 12.22. Data Definitions for libpam 3464 3465 12.22.1. security/pam_appl.h 3466 3467 12.23. Interface Definitions for libpam 3468 3469 pam_acct_mgmt -- establish the status of a user's 3470 account 3471 3472 pam_authenticate -- authenticate the user 3473 pam_chauthtok -- change the authentication token for 3474 a given user 3475 3476 pam_close_session -- indicate that an authenticated 3477 session has ended 3478 3479 pam_end -- terminate the use of the PAM library 3480 pam_fail_delay -- specify delay time to use on 3481 authentication error 3482 3483 pam_get_item -- obtain the value of the indicated 3484 item. 3485 3486 pam_getenv -- get a PAM environment variable 3487 pam_getenvlist -- returns a pointer to the complete 3488 PAM environment. 3489 3490 pam_open_session -- indicate session has started 3491 pam_putenv -- Add, replace or delete a PAM 3492 environment variable 3493 3494 pam_set_item -- (re)set the value of an item. 3495 pam_setcred -- set the module-specific credentials 3496 of the user 3497 3498 pam_start -- initialize the PAM library 3499 pam_strerror -- returns a string describing the PAM 3500 error 3501 __________________________________________________________ 3502 3503 Chapter 12. Base Libraries 3504 3505 12.1. Introduction 3506 3507 An LSB-conforming implementation shall support the following 3508 base libraries which provide interfaces for accessing the 3509 operating system, processor and other hardware in the system. 3510 3511 * libc 3512 * libm 3513 * libgcc_s 3514 * libdl 3515 * librt 3516 * libcrypt 3517 * libpam 3518 3519 There are three main parts to the definition of each of these 3520 libraries. 3521 3522 The "Interfaces" section defines the required library name and 3523 version, and the required public symbols (interfaces and global 3524 data), as well as symbol versions, if any. 3525 3526 The "Interface Definitions" section provides complete or 3527 partial definitions of certain interfaces where either this 3528 specification is the source specification, or where there are 3529 variations from the source specification. If an interface 3530 definition requires one or more header files, one of those 3531 headers shall include the function prototype for the interface. 3532 3533 For source definitions of interfaces which include a reference 3534 to a header file, the contents of such header files form a part 3535 of the specification. The "Data Definitions" section provides 3536 the binary-level details for the header files from the source 3537 specifications, such as values for macros and enumerated types, 3538 as well as structure layouts, sizes and padding, etc. These 3539 data definitions, although presented in the form of header 3540 files for convenience, should not be taken a representing 3541 complete header files, as they are a supplement to the source 3542 specifications. Application developers should follow the 3543 guidelines of the source specifications when determining which 3544 header files need to be included to completely resolve all 3545 references. 3546 3547 Note: While the Data Definitions supplement the source 3548 specifications, this specification itself does not require 3549 conforming implementations to supply any header files. 3550 __________________________________________________________ 3551 3552 12.2. Program Interpreter 3553 3554 The Program Interpreter is specified in the appropriate 3555 architecture specific part of ISO/IEC 23360. 3556 __________________________________________________________ 3557 3558 12.3. Interfaces for libc 3559 3560 Table 12-1 defines the library name and shared object name for 3561 the libc library 3562 3563 Table 12-1. libc Definition 3564 Library: libc 3565 SONAME: See archLSB. 3566 3567 The behavior of the interfaces in this library is specified by 3568 the following specifications: 3569 3570 [LFS] Large File Support 3571 [LSB] This Specification 3572 [RPC & XDR] RFC 1831/1832 RPC & XDR 3573 [SUSv2] SUSv2 3574 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 3575 [SUSv4] POSIX 1003.1-2008 (ISO/IEC 9945-2009) 3576 [SVID.4] SVID Issue 4 3577 __________________________________________________________ 3578 3579 12.3.1. RPC 3580 __________________________________________________________ 3581 3582 12.3.1.1. Interfaces for RPC 3583 3584 An LSB conforming implementation shall provide the generic 3585 functions for RPC specified in Table 12-2, with the full 3586 mandatory functionality as described in the referenced 3587 underlying specification. 3588 3589 Table 12-2. libc - RPC Function Interfaces 3590 authnone_create [SVID.4] callrpc [RPC & XDR] clnt_create 3591 [SVID.4] clnt_pcreateerror [SVID.4] 3592 clnt_perrno [SVID.4] clnt_perror [SVID.4] clnt_spcreateerror 3593 [SVID.4] clnt_sperrno [SVID.4] 3594 clnt_sperror [SVID.4] clntraw_create [RPC & XDR] clnttcp_create 3595 [RPC & XDR] clntudp_bufcreate [RPC & XDR] 3596 clntudp_create [RPC & XDR] key_decryptsession [SVID.4] 3597 pmap_getport [LSB] pmap_set [LSB] 3598 pmap_unset [LSB] svc_getreqset [SVID.4] svc_register [LSB] 3599 svc_run [LSB] 3600 svc_sendreply [LSB] svcerr_auth [SVID.4] svcerr_decode [SVID.4] 3601 svcerr_noproc [SVID.4] 3602 svcerr_noprog [SVID.4] svcerr_progvers [SVID.4] 3603 svcerr_systemerr [SVID.4] svcerr_weakauth [SVID.4] 3604 svcfd_create [RPC & XDR] svcraw_create [RPC & XDR] 3605 svctcp_create [LSB] svcudp_create [LSB] 3606 xdr_accepted_reply [SVID.4] xdr_array [SVID.4] xdr_bool 3607 [SVID.4] xdr_bytes [SVID.4] 3608 xdr_callhdr [SVID.4] xdr_callmsg [SVID.4] xdr_char [SVID.4] 3609 xdr_double [SVID.4] 3610 xdr_enum [SVID.4] xdr_float [SVID.4] xdr_free [SVID.4] xdr_int 3611 [SVID.4] 3612 xdr_long [SVID.4] xdr_opaque [SVID.4] xdr_opaque_auth [SVID.4] 3613 xdr_pointer [SVID.4] 3614 xdr_reference [SVID.4] xdr_rejected_reply [SVID.4] xdr_replymsg 3615 [SVID.4] xdr_short [SVID.4] 3616 xdr_string [SVID.4] xdr_u_char [SVID.4] xdr_u_int [LSB] 3617 xdr_u_long [SVID.4] 3618 xdr_u_short [SVID.4] xdr_union [SVID.4] xdr_vector [SVID.4] 3619 xdr_void [SVID.4] 3620 xdr_wrapstring [SVID.4] xdrmem_create [SVID.4] xdrrec_create 3621 [SVID.4] xdrrec_endofrecord [RPC & XDR] 3622 xdrrec_eof [SVID.4] xdrrec_skiprecord [RPC & XDR] 3623 xdrstdio_create [LSB] 3624 3625 An LSB conforming implementation shall provide the generic 3626 deprecated functions for RPC specified in Table 12-3, with the 3627 full mandatory functionality as described in the referenced 3628 underlying specification. 3629 3630 Note: These interfaces are deprecated, and applications 3631 should avoid using them. These interfaces may be withdrawn 3632 in future releases of this specification. 3633 3634 Table 12-3. libc - RPC Deprecated Function Interfaces 3635 key_decryptsession [SVID.4] 3636 __________________________________________________________ 3637 3638 12.3.2. Epoll 3639 __________________________________________________________ 3640 3641 12.3.2.1. Interfaces for Epoll 3642 3643 An LSB conforming implementation shall provide the generic 3644 functions for Epoll specified in Table 12-4, with the full 3645 mandatory functionality as described in the referenced 3646 underlying specification. 3647 3648 Table 12-4. libc - Epoll Function Interfaces 3649 epoll_create(GLIBC_2.3.2) [LSB] epoll_ctl(GLIBC_2.3.2) [LSB] 3650 epoll_wait(GLIBC_2.3.2) [LSB] 3651 __________________________________________________________ 3652 3653 12.3.3. System Calls 3654 __________________________________________________________ 3655 3656 12.3.3.1. Interfaces for System Calls 3657 3658 An LSB conforming implementation shall provide the generic 3659 functions for System Calls specified in Table 12-5, with the 3660 full mandatory functionality as described in the referenced 3661 underlying specification. 3662 3663 Table 12-5. libc - System Calls Function Interfaces 3664 __chk_fail(GLIBC_2.3.4) [LSB] __fxstat [LSB] 3665 __fxstatat(GLIBC_2.4) [LSB] __getgroups_chk(GLIBC_2.4) [LSB] 3666 __getpgid [LSB] __lxstat [LSB] __read_chk(GLIBC_2.4) [LSB] 3667 __readlink_chk(GLIBC_2.4) [LSB] 3668 __stack_chk_fail(GLIBC_2.4) [LSB] __xmknod [LSB] 3669 __xmknodat(GLIBC_2.4) [LSB] __xstat [LSB] 3670 access [SUSv3] acct [LSB] alarm [SUSv3] backtrace [LSB] 3671 backtrace_symbols [LSB] backtrace_symbols_fd [LSB] brk [SUSv2] 3672 chdir [SUSv3] 3673 chmod [SUSv3] chown [SUSv3] chroot [SUSv2] clock [SUSv3] 3674 close [SUSv3] closedir [SUSv3] creat [SUSv3] dup [SUSv3] 3675 dup2 [SUSv3] execl [SUSv3] execle [SUSv3] execlp [SUSv3] 3676 execv [SUSv3] execve [SUSv3] execvp [SUSv3] exit [SUSv3] 3677 faccessat(GLIBC_2.4) [SUSv4] fchdir [SUSv3] fchmod [SUSv3] 3678 fchmodat(GLIBC_2.4) [SUSv4] 3679 fchown [SUSv3] fchownat(GLIBC_2.4) [SUSv4] fcntl [LSB] 3680 fdatasync [SUSv3] 3681 fdopendir(GLIBC_2.4) [SUSv4] fexecve [SUSv4] flock [LSB] fork 3682 [SUSv3] 3683 fstatfs [LSB] fstatvfs [SUSv3] fsync [SUSv3] ftime [SUSv3] 3684 ftruncate [SUSv3] getcontext [SUSv3] getdtablesize [LSB] 3685 getegid [SUSv3] 3686 geteuid [SUSv3] getgid [SUSv3] getgroups [SUSv3] getitimer 3687 [SUSv3] 3688 getloadavg [LSB] getpagesize [LSB] getpgid [SUSv3] getpgrp 3689 [SUSv3] 3690 getpid [SUSv3] getppid [SUSv3] getpriority [SUSv3] getrlimit 3691 [SUSv3] 3692 getrusage [SUSv3] getsid [SUSv3] getuid [SUSv3] getwd [SUSv3] 3693 initgroups [LSB] ioctl [LSB] kill [LSB] killpg [SUSv3] 3694 lchown [SUSv3] link [LSB] linkat(GLIBC_2.4) [SUSv4] lockf 3695 [SUSv3] 3696 lseek [SUSv3] mkdir [SUSv3] mkdirat(GLIBC_2.4) [SUSv4] mkfifo 3697 [SUSv3] 3698 mkfifoat(GLIBC_2.4) [SUSv4] mlock [SUSv3] mlockall [SUSv3] mmap 3699 [SUSv3] 3700 mprotect [SUSv3] mremap [LSB] msync [SUSv3] munlock [SUSv3] 3701 munlockall [SUSv3] munmap [SUSv3] nanosleep [SUSv3] nice 3702 [SUSv3] 3703 open [SUSv3] openat(GLIBC_2.4) [SUSv4] opendir [SUSv3] pathconf 3704 [SUSv3] 3705 pause [SUSv3] pipe [SUSv3] poll [SUSv3] pread [SUSv3] 3706 pselect [SUSv3] ptrace [LSB] pwrite [SUSv3] read [SUSv3] 3707 readdir [SUSv3] readdir_r [SUSv3] readlink [SUSv3] 3708 readlinkat(GLIBC_2.4) [SUSv4] 3709 readv [SUSv3] rename [SUSv3] renameat(GLIBC_2.4) [SUSv4] rmdir 3710 [SUSv3] 3711 sbrk [SUSv2] sched_get_priority_max [SUSv3] 3712 sched_get_priority_min [SUSv3] sched_getaffinity(GLIBC_2.3.4) 3713 [LSB] 3714 sched_getparam [SUSv3] sched_getscheduler [SUSv3] 3715 sched_rr_get_interval [SUSv3] sched_setaffinity(GLIBC_2.3.4) 3716 [LSB] 3717 sched_setparam [SUSv3] sched_setscheduler [LSB] sched_yield 3718 [SUSv3] select [SUSv3] 3719 setcontext [SUSv3] setegid [SUSv3] seteuid [SUSv3] setgid 3720 [SUSv3] 3721 setitimer [SUSv3] setpgid [SUSv3] setpgrp [SUSv3] setpriority 3722 [SUSv3] 3723 setregid [SUSv3] setreuid [SUSv3] setrlimit [SUSv3] setrlimit64 3724 [LFS] 3725 setsid [SUSv3] setuid [SUSv3] sleep [SUSv3] statfs [LSB] 3726 statvfs [SUSv3] stime [LSB] symlink [SUSv3] 3727 symlinkat(GLIBC_2.4) [SUSv4] 3728 sync [SUSv3] sysconf [LSB] sysinfo [LSB] time [SUSv3] 3729 times [SUSv3] truncate [SUSv3] ulimit [SUSv3] umask [SUSv3] 3730 uname [SUSv3] unlink [LSB] unlinkat(GLIBC_2.4) [SUSv4] utime 3731 [SUSv3] 3732 utimes [SUSv3] vfork [SUSv3] wait [SUSv3] wait4 [LSB] 3733 waitid [SUSv3] waitpid [SUSv3] write [SUSv3] writev [SUSv3] 3734 3735 An LSB conforming implementation shall provide the generic 3736 deprecated functions for System Calls specified in Table 12-6, 3737 with the full mandatory functionality as described in the 3738 referenced underlying specification. 3739 3740 Note: These interfaces are deprecated, and applications 3741 should avoid using them. These interfaces may be withdrawn 3742 in future releases of this specification. 3743 3744 Table 12-6. libc - System Calls Deprecated Function Interfaces 3745 fstatfs [LSB] getdtablesize [LSB] getpagesize [LSB] getwd 3746 [SUSv3] 3747 statfs [LSB] 3748 __________________________________________________________ 3749 3750 12.3.4. Standard I/O 3751 __________________________________________________________ 3752 3753 12.3.4.1. Interfaces for Standard I/O 3754 3755 An LSB conforming implementation shall provide the generic 3756 functions for Standard I/O specified in Table 12-7, with the 3757 full mandatory functionality as described in the referenced 3758 underlying specification. 3759 3760 Table 12-7. libc - Standard I/O Function Interfaces 3761 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 3762 __fgets_chk(GLIBC_2.4) [LSB] __fgets_unlocked_chk(GLIBC_2.4) 3763 [LSB] __fgetws_unlocked_chk(GLIBC_2.4) [LSB] __fprintf_chk 3764 [LSB] 3765 __printf_chk [LSB] __snprintf_chk [LSB] __sprintf_chk [LSB] 3766 __vfprintf_chk [LSB] 3767 __vprintf_chk [LSB] __vsnprintf_chk [LSB] __vsprintf_chk [LSB] 3768 asprintf [LSB] 3769 clearerr [SUSv3] clearerr_unlocked [LSB] ctermid [SUSv3] 3770 dprintf [SUSv4] 3771 fclose [SUSv3] fdopen [SUSv3] feof [SUSv3] feof_unlocked [LSB] 3772 ferror [SUSv3] ferror_unlocked [LSB] fflush [SUSv3] 3773 fflush_unlocked [LSB] 3774 fgetc [SUSv3] fgetc_unlocked [LSB] fgetpos [SUSv3] fgets 3775 [SUSv3] 3776 fgets_unlocked [LSB] fgetwc_unlocked [LSB] fgetws_unlocked 3777 [LSB] fileno [SUSv3] 3778 fileno_unlocked [LSB] flockfile [SUSv3] fopen [SUSv3] fprintf 3779 [SUSv3] 3780 fputc [SUSv3] fputc_unlocked [LSB] fputs [SUSv3] fputs_unlocked 3781 [LSB] 3782 fputwc_unlocked [LSB] fputws_unlocked [LSB] fread [SUSv3] 3783 fread_unlocked [LSB] 3784 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 3785 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 3786 fwrite_unlocked [LSB] getc [SUSv3] getc_unlocked [SUSv3] 3787 getchar [SUSv3] 3788 getchar_unlocked [SUSv3] getdelim [SUSv4] getline [SUSv4] getw 3789 [SUSv2] 3790 getwc_unlocked [LSB] getwchar_unlocked [LSB] pclose [SUSv3] 3791 popen [SUSv3] 3792 printf [SUSv3] putc [SUSv3] putc_unlocked [SUSv3] putchar 3793 [SUSv3] 3794 putchar_unlocked [SUSv3] puts [SUSv3] putw [SUSv2] 3795 putwc_unlocked [LSB] 3796 putwchar_unlocked [LSB] remove [SUSv3] rewind [SUSv3] rewinddir 3797 [SUSv3] 3798 scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] setbuffer [LSB] 3799 setvbuf [SUSv3] snprintf [SUSv3] sprintf [SUSv3] sscanf [LSB] 3800 telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] vasprintf [LSB] 3801 vdprintf [LSB] vfprintf [SUSv3] vprintf [SUSv3] vsnprintf 3802 [SUSv3] 3803 vsprintf [SUSv3] 3804 3805 An LSB conforming implementation shall provide the generic 3806 deprecated functions for Standard I/O specified in Table 12-8, 3807 with the full mandatory functionality as described in the 3808 referenced underlying specification. 3809 3810 Note: These interfaces are deprecated, and applications 3811 should avoid using them. These interfaces may be withdrawn 3812 in future releases of this specification. 3813 3814 Table 12-8. libc - Standard I/O Deprecated Function Interfaces 3815 tempnam [SUSv3] 3816 3817 An LSB conforming implementation shall provide the generic data 3818 interfaces for Standard I/O specified in Table 12-9, with the 3819 full mandatory functionality as described in the referenced 3820 underlying specification. 3821 3822 Table 12-9. libc - Standard I/O Data Interfaces 3823 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 3824 __________________________________________________________ 3825 3826 12.3.5. Signal Handling 3827 __________________________________________________________ 3828 3829 12.3.5.1. Interfaces for Signal Handling 3830 3831 An LSB conforming implementation shall provide the generic 3832 functions for Signal Handling specified in Table 12-10, with 3833 the full mandatory functionality as described in the referenced 3834 underlying specification. 3835 3836 Table 12-10. libc - Signal Handling Function Interfaces 3837 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 3838 __sigsetjmp [LSB] __sysv_signal [LSB] 3839 __xpg_sigpause [LSB] bsd_signal [SUSv3] psignal [LSB] raise 3840 [SUSv3] 3841 sigaction [SUSv3] sigaddset [SUSv3] sigaltstack [SUSv3] 3842 sigandset [LSB] 3843 sigdelset [SUSv3] sigemptyset [SUSv3] sigfillset [SUSv3] 3844 sighold [SUSv3] 3845 sigignore [SUSv3] siginterrupt [SUSv3] sigisemptyset [LSB] 3846 sigismember [SUSv3] 3847 siglongjmp [SUSv3] signal [SUSv3] sigorset [LSB] sigpause [LSB] 3848 sigpending [SUSv3] sigprocmask [SUSv3] sigqueue [SUSv3] 3849 sigrelse [SUSv3] 3850 sigreturn [LSB] sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait 3851 [SUSv3] 3852 sigwait [SUSv3] sigwaitinfo [SUSv3] 3853 3854 An LSB conforming implementation shall provide the generic 3855 deprecated functions for Signal Handling specified in Table 3856 12-11, with the full mandatory functionality as described in 3857 the referenced underlying specification. 3858 3859 Note: These interfaces are deprecated, and applications 3860 should avoid using them. These interfaces may be withdrawn 3861 in future releases of this specification. 3862 3863 Table 12-11. libc - Signal Handling Deprecated Function 3864 Interfaces 3865 sigpause [LSB] 3866 3867 An LSB conforming implementation shall provide the generic data 3868 interfaces for Signal Handling specified in Table 12-12, with 3869 the full mandatory functionality as described in the referenced 3870 underlying specification. 3871 3872 Table 12-12. libc - Signal Handling Data Interfaces 3873 _sys_siglist [LSB] 3874 __________________________________________________________ 3875 3876 12.3.6. Localization Functions 3877 __________________________________________________________ 3878 3879 12.3.6.1. Interfaces for Localization Functions 3880 3881 An LSB conforming implementation shall provide the generic 3882 functions for Localization Functions specified in Table 12-13, 3883 with the full mandatory functionality as described in the 3884 referenced underlying specification. 3885 3886 Table 12-13. libc - Localization Functions Function Interfaces 3887 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 3888 [SUSv3] catgets [SUSv3] 3889 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext [LSB] 3890 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 3891 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 3892 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] localeconv 3893 [SUSv3] 3894 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 3895 setlocale [SUSv3] 3896 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 3897 3898 An LSB conforming implementation shall provide the generic data 3899 interfaces for Localization Functions specified in Table 12-14, 3900 with the full mandatory functionality as described in the 3901 referenced underlying specification. 3902 3903 Table 12-14. libc - Localization Functions Data Interfaces 3904 _nl_msg_cat_cntr [LSB] 3905 __________________________________________________________ 3906 3907 12.3.7. Posix Spawn Option 3908 __________________________________________________________ 3909 3910 12.3.7.1. Interfaces for Posix Spawn Option 3911 3912 An LSB conforming implementation shall provide the generic 3913 functions for Posix Spawn Option specified in Table 12-15, with 3914 the full mandatory functionality as described in the referenced 3915 underlying specification. 3916 3917 Table 12-15. libc - Posix Spawn Option Function Interfaces 3918 posix_spawn [SUSv3] posix_spawn_file_actions_addclose [SUSv3] 3919 posix_spawn_file_actions_adddup2 [SUSv3] 3920 posix_spawn_file_actions_addopen [SUSv3] 3921 posix_spawn_file_actions_destroy [SUSv3] 3922 posix_spawn_file_actions_init [SUSv3] posix_spawnattr_destroy 3923 [SUSv3] posix_spawnattr_getflags [SUSv3] 3924 posix_spawnattr_getpgroup [SUSv3] posix_spawnattr_getschedparam 3925 [SUSv3] posix_spawnattr_getschedpolicy [SUSv3] 3926 posix_spawnattr_getsigdefault [SUSv3] 3927 posix_spawnattr_getsigmask [SUSv3] posix_spawnattr_init [SUSv3] 3928 posix_spawnattr_setflags [SUSv3] posix_spawnattr_setpgroup 3929 [SUSv3] 3930 posix_spawnattr_setschedparam [SUSv3] 3931 posix_spawnattr_setschedpolicy [SUSv3] 3932 posix_spawnattr_setsigdefault [SUSv3] 3933 posix_spawnattr_setsigmask [SUSv3] 3934 posix_spawnp [SUSv3] 3935 __________________________________________________________ 3936 3937 12.3.8. Posix Advisory Option 3938 __________________________________________________________ 3939 3940 12.3.8.1. Interfaces for Posix Advisory Option 3941 3942 An LSB conforming implementation shall provide the generic 3943 functions for Posix Advisory Option specified in Table 12-16, 3944 with the full mandatory functionality as described in the 3945 referenced underlying specification. 3946 3947 Table 12-16. libc - Posix Advisory Option Function Interfaces 3948 posix_fadvise [SUSv3] posix_fallocate [SUSv3] posix_madvise 3949 [SUSv3] posix_memalign [SUSv3] 3950 __________________________________________________________ 3951 3952 12.3.9. Socket Interface 3953 __________________________________________________________ 3954 3955 12.3.9.1. Interfaces for Socket Interface 3956 3957 An LSB conforming implementation shall provide the generic 3958 functions for Socket Interface specified in Table 12-17, with 3959 the full mandatory functionality as described in the referenced 3960 underlying specification. 3961 3962 Table 12-17. libc - Socket Interface Function Interfaces 3963 __gethostname_chk(GLIBC_2.4) [LSB] __h_errno_location [LSB] 3964 __recv_chk(GLIBC_2.4) [LSB] __recvfrom_chk(GLIBC_2.4) [LSB] 3965 accept [SUSv3] bind [SUSv3] bindresvport [LSB] connect [SUSv3] 3966 gethostid [SUSv3] gethostname [SUSv3] getpeername [SUSv3] 3967 getsockname [SUSv3] 3968 getsockopt [LSB] if_freenameindex [SUSv3] if_indextoname 3969 [SUSv3] if_nameindex [SUSv3] 3970 if_nametoindex [SUSv3] listen [SUSv3] recv [SUSv3] recvfrom 3971 [SUSv3] 3972 recvmsg [SUSv3] send [SUSv4] sendmsg [SUSv4] sendto [SUSv4] 3973 setsockopt [LSB] shutdown [SUSv3] sockatmark [SUSv3] socket 3974 [SUSv3] 3975 socketpair [SUSv3] 3976 3977 An LSB conforming implementation shall provide the generic data 3978 interfaces for Socket Interface specified in Table 12-18, with 3979 the full mandatory functionality as described in the referenced 3980 underlying specification. 3981 3982 Table 12-18. libc - Socket Interface Data Interfaces 3983 in6addr_any [SUSv3] in6addr_loopback [SUSv3] 3984 __________________________________________________________ 3985 3986 12.3.10. Wide Characters 3987 __________________________________________________________ 3988 3989 12.3.10.1. Interfaces for Wide Characters 3990 3991 An LSB conforming implementation shall provide the generic 3992 functions for Wide Characters specified in Table 12-19, with 3993 the full mandatory functionality as described in the referenced 3994 underlying specification. 3995 3996 Table 12-19. libc - Wide Characters Function Interfaces 3997 __fgetws_chk(GLIBC_2.4) [LSB] __fwprintf_chk(GLIBC_2.4) [LSB] 3998 __mbsnrtowcs_chk(GLIBC_2.4) [LSB] __mbsrtowcs_chk(GLIBC_2.4) 3999 [LSB] 4000 __mbstowcs_chk(GLIBC_2.4) [LSB] __swprintf_chk(GLIBC_2.4) [LSB] 4001 __vfwprintf_chk(GLIBC_2.4) [LSB] __vswprintf_chk(GLIBC_2.4) 4002 [LSB] 4003 __vwprintf_chk(GLIBC_2.4) [LSB] __wcpcpy_chk(GLIBC_2.4) [LSB] 4004 __wcpncpy_chk(GLIBC_2.4) [LSB] __wcrtomb_chk(GLIBC_2.4) [LSB] 4005 __wcscat_chk(GLIBC_2.4) [LSB] __wcscpy_chk(GLIBC_2.4) [LSB] 4006 __wcsncat_chk(GLIBC_2.4) [LSB] __wcsncpy_chk(GLIBC_2.4) [LSB] 4007 __wcsnrtombs_chk(GLIBC_2.4) [LSB] __wcsrtombs_chk(GLIBC_2.4) 4008 [LSB] __wcstod_internal [LSB] __wcstof_internal [LSB] 4009 __wcstol_internal [LSB] __wcstold_internal [LSB] 4010 __wcstombs_chk(GLIBC_2.4) [LSB] __wcstoul_internal [LSB] 4011 __wctomb_chk(GLIBC_2.4) [LSB] __wmemcpy_chk(GLIBC_2.4) [LSB] 4012 __wmemmove_chk(GLIBC_2.4) [LSB] __wmempcpy_chk(GLIBC_2.4) [LSB] 4013 __wmemset_chk(GLIBC_2.4) [LSB] __wprintf_chk(GLIBC_2.4) [LSB] 4014 btowc [SUSv3] fgetwc [SUSv3] 4015 fgetws [SUSv3] fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] 4016 fwprintf [SUSv3] fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] 4017 mblen [SUSv3] mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] 4018 mbsnrtowcs [LSB] mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc 4019 [SUSv3] 4020 putwc [SUSv3] putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] 4021 towctrans [SUSv3] towlower [SUSv3] towupper [SUSv3] ungetwc 4022 [SUSv3] 4023 vfwprintf [SUSv3] vfwscanf [LSB] vswprintf [SUSv3] vswscanf 4024 [LSB] 4025 vwprintf [SUSv3] vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] 4026 wcrtomb [SUSv3] wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] 4027 wcscmp [SUSv3] wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] 4028 wcsdup [LSB] wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] 4029 wcsncat [SUSv3] wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] 4030 wcsnrtombs [LSB] wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs 4031 [SUSv3] 4032 wcsspn [SUSv3] wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] 4033 wcstoimax [SUSv3] wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] 4034 wcstoll [SUSv3] wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] 4035 wcstoull [SUSv3] wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] 4036 wcswidth [SUSv3] wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] 4037 wctrans [SUSv3] wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] 4038 wmemcmp [SUSv3] wmemcpy [SUSv3] wmemmove [SUSv3] wmemset 4039 [SUSv3] 4040 wprintf [SUSv3] wscanf [LSB] 4041 __________________________________________________________ 4042 4043 12.3.11. String Functions 4044 __________________________________________________________ 4045 4046 12.3.11.1. Interfaces for String Functions 4047 4048 An LSB conforming implementation shall provide the generic 4049 functions for String Functions specified in Table 12-20, with 4050 the full mandatory functionality as described in the referenced 4051 underlying specification. 4052 4053 Table 12-20. libc - String Functions Function Interfaces 4054 __memcpy_chk(GLIBC_2.3.4) [LSB] __memmove_chk(GLIBC_2.3.4) 4055 [LSB] __mempcpy [LSB] __mempcpy_chk(GLIBC_2.3.4) [LSB] 4056 __memset_chk(GLIBC_2.3.4) [LSB] __rawmemchr [LSB] __stpcpy 4057 [LSB] __stpcpy_chk(GLIBC_2.3.4) [LSB] 4058 __stpncpy_chk(GLIBC_2.4) [LSB] __strcat_chk(GLIBC_2.3.4) [LSB] 4059 __strcpy_chk(GLIBC_2.3.4) [LSB] __strdup [LSB] 4060 __strncat_chk(GLIBC_2.3.4) [LSB] __strncpy_chk(GLIBC_2.3.4) 4061 [LSB] __strtod_internal [LSB] __strtof_internal [LSB] 4062 __strtok_r [LSB] __strtol_internal [LSB] __strtold_internal 4063 [LSB] __strtoll_internal [LSB] 4064 __strtoul_internal [LSB] __strtoull_internal [LSB] 4065 __xpg_strerror_r(GLIBC_2.3.4) [LSB] bcmp [SUSv3] 4066 bcopy [SUSv3] bzero [SUSv3] ffs [SUSv3] index [SUSv3] 4067 memccpy [SUSv3] memchr [SUSv3] memcmp [SUSv3] memcpy [SUSv3] 4068 memmove [SUSv3] memrchr [LSB] memset [SUSv3] rindex [SUSv3] 4069 stpcpy [LSB] stpncpy [LSB] strcasecmp [SUSv3] strcasestr [LSB] 4070 strcat [SUSv3] strchr [SUSv3] strcmp [SUSv3] strcoll [SUSv3] 4071 strcpy [SUSv3] strcspn [SUSv3] strdup [SUSv3] strerror [SUSv3] 4072 strerror_r [LSB] strfmon [SUSv3] strftime [SUSv3] strlen 4073 [SUSv3] 4074 strncasecmp [SUSv3] strncat [SUSv3] strncmp [SUSv3] strncpy 4075 [SUSv3] 4076 strndup [LSB] strnlen [LSB] strpbrk [SUSv3] strptime [LSB] 4077 strrchr [SUSv3] strsep [LSB] strsignal [LSB] strspn [SUSv3] 4078 strstr [SUSv3] strtof [SUSv3] strtoimax [SUSv3] strtok [SUSv3] 4079 strtok_r [SUSv3] strtold [SUSv3] strtoll [SUSv3] strtoq [LSB] 4080 strtoull [SUSv3] strtoumax [SUSv3] strtouq [LSB] strxfrm 4081 [SUSv3] 4082 swab [SUSv3] 4083 4084 An LSB conforming implementation shall provide the generic 4085 deprecated functions for String Functions specified in Table 4086 12-21, with the full mandatory functionality as described in 4087 the referenced underlying specification. 4088 4089 Note: These interfaces are deprecated, and applications 4090 should avoid using them. These interfaces may be withdrawn 4091 in future releases of this specification. 4092 4093 Table 12-21. libc - String Functions Deprecated Function 4094 Interfaces 4095 strerror_r [LSB] 4096 __________________________________________________________ 4097 4098 12.3.12. IPC Functions 4099 __________________________________________________________ 4100 4101 12.3.12.1. Interfaces for IPC Functions 4102 4103 An LSB conforming implementation shall provide the generic 4104 functions for IPC Functions specified in Table 12-22, with the 4105 full mandatory functionality as described in the referenced 4106 underlying specification. 4107 4108 Table 12-22. libc - IPC Functions Function Interfaces 4109 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 4110 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 4111 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 4112 __________________________________________________________ 4113 4114 12.3.13. Regular Expressions 4115 __________________________________________________________ 4116 4117 12.3.13.1. Interfaces for Regular Expressions 4118 4119 An LSB conforming implementation shall provide the generic 4120 functions for Regular Expressions specified in Table 12-23, 4121 with the full mandatory functionality as described in the 4122 referenced underlying specification. 4123 4124 Table 12-23. libc - Regular Expressions Function Interfaces 4125 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 4126 __________________________________________________________ 4127 4128 12.3.14. Character Type Functions 4129 __________________________________________________________ 4130 4131 12.3.14.1. Interfaces for Character Type Functions 4132 4133 An LSB conforming implementation shall provide the generic 4134 functions for Character Type Functions specified in Table 4135 12-24, with the full mandatory functionality as described in 4136 the referenced underlying specification. 4137 4138 Table 12-24. libc - Character Type Functions Function 4139 Interfaces 4140 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 4141 __ctype_tolower_loc(GLIBC_2.3) [LSB] 4142 __ctype_toupper_loc(GLIBC_2.3) [LSB] 4143 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 4144 [SUSv3] 4145 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph [SUSv3] 4146 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace [SUSv3] 4147 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 4148 [SUSv3] 4149 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 4150 [SUSv3] 4151 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 4152 [SUSv3] 4153 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 4154 [SUSv3] 4155 tolower [SUSv3] toupper [SUSv3] 4156 __________________________________________________________ 4157 4158 12.3.15. Time Manipulation 4159 __________________________________________________________ 4160 4161 12.3.15.1. Interfaces for Time Manipulation 4162 4163 An LSB conforming implementation shall provide the generic 4164 functions for Time Manipulation specified in Table 12-25, with 4165 the full mandatory functionality as described in the referenced 4166 underlying specification. 4167 4168 Table 12-25. libc - Time Manipulation Function Interfaces 4169 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 4170 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 4171 [SUSv3] 4172 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 4173 [SUSv3] 4174 ualarm [SUSv3] 4175 4176 An LSB conforming implementation shall provide the generic data 4177 interfaces for Time Manipulation specified in Table 12-26, with 4178 the full mandatory functionality as described in the referenced 4179 underlying specification. 4180 4181 Table 12-26. libc - Time Manipulation Data Interfaces 4182 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 4183 [SUSv3] 4184 timezone [SUSv3] tzname [SUSv3] 4185 __________________________________________________________ 4186 4187 12.3.16. Terminal Interface Functions 4188 __________________________________________________________ 4189 4190 12.3.16.1. Interfaces for Terminal Interface Functions 4191 4192 An LSB conforming implementation shall provide the generic 4193 functions for Terminal Interface Functions specified in Table 4194 12-27, with the full mandatory functionality as described in 4195 the referenced underlying specification. 4196 4197 Table 12-27. libc - Terminal Interface Functions Function 4198 Interfaces 4199 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 4200 cfsetispeed [SUSv3] 4201 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 4202 [SUSv3] 4203 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 4204 [SUSv3] 4205 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 4206 __________________________________________________________ 4207 4208 12.3.17. System Database Interface 4209 __________________________________________________________ 4210 4211 12.3.17.1. Interfaces for System Database Interface 4212 4213 An LSB conforming implementation shall provide the generic 4214 functions for System Database Interface specified in Table 4215 12-28, with the full mandatory functionality as described in 4216 the referenced underlying specification. 4217 4218 Table 12-28. libc - System Database Interface Function 4219 Interfaces 4220 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 4221 endservent [SUSv3] 4222 endutent [LSB] endutxent [SUSv3] getgrent [SUSv3] getgrent_r 4223 [LSB] 4224 getgrgid [SUSv3] getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r 4225 [SUSv3] 4226 getgrouplist [LSB] gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] 4227 gethostbyname [SUSv3] 4228 gethostbyname2 [LSB] gethostbyname2_r [LSB] gethostbyname_r 4229 [LSB] getprotobyname [SUSv3] 4230 getprotobyname_r [LSB] getprotobynumber [SUSv3] 4231 getprotobynumber_r [LSB] getprotoent [SUSv3] 4232 getprotoent_r [LSB] getpwent [SUSv3] getpwent_r [LSB] getpwnam 4233 [SUSv3] 4234 getpwnam_r [SUSv3] getpwuid [SUSv3] getpwuid_r [SUSv3] 4235 getservbyname [SUSv3] 4236 getservbyname_r [LSB] getservbyport [SUSv3] getservbyport_r 4237 [LSB] getservent [SUSv3] 4238 getservent_r [LSB] getutent [LSB] getutent_r [LSB] getutxent 4239 [SUSv3] 4240 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] setgrent 4241 [SUSv3] 4242 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] setservent 4243 [SUSv3] 4244 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 4245 4246 An LSB conforming implementation shall provide the generic 4247 deprecated functions for System Database Interface specified in 4248 Table 12-29, with the full mandatory functionality as described 4249 in the referenced underlying specification. 4250 4251 Note: These interfaces are deprecated, and applications 4252 should avoid using them. These interfaces may be withdrawn 4253 in future releases of this specification. 4254 4255 Table 12-29. libc - System Database Interface Deprecated 4256 Function Interfaces 4257 gethostbyaddr [SUSv3] gethostbyaddr_r [LSB] gethostbyname 4258 [SUSv3] gethostbyname2 [LSB] 4259 gethostbyname2_r [LSB] gethostbyname_r [LSB] 4260 __________________________________________________________ 4261 4262 12.3.18. Language Support 4263 __________________________________________________________ 4264 4265 12.3.18.1. Interfaces for Language Support 4266 4267 An LSB conforming implementation shall provide the generic 4268 functions for Language Support specified in Table 12-30, with 4269 the full mandatory functionality as described in the referenced 4270 underlying specification. 4271 4272 Table 12-30. libc - Language Support Function Interfaces 4273 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 4274 __________________________________________________________ 4275 4276 12.3.19. Large File Support 4277 __________________________________________________________ 4278 4279 12.3.19.1. Interfaces for Large File Support 4280 4281 An LSB conforming implementation shall provide the generic 4282 functions for Large File Support specified in Table 12-31, with 4283 the full mandatory functionality as described in the referenced 4284 underlying specification. 4285 4286 Table 12-31. libc - Large File Support Function Interfaces 4287 __fxstat64 [LSB] __fxstatat64(GLIBC_2.4) [LSB] __lxstat64 [LSB] 4288 __xstat64 [LSB] 4289 creat64 [LFS] fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] 4290 fseeko64 [LFS] fsetpos64 [LFS] fstatfs64 [LSB] fstatvfs64 [LFS] 4291 ftello64 [LFS] ftruncate64 [LFS] ftw64 [LFS] getrlimit64 [LFS] 4292 lockf64 [LFS] lseek64 [LFS] mkstemp64 [LSB] mmap64 [LFS] 4293 nftw64 [LFS] open64 [LFS] openat64(GLIBC_2.4) [LSB] 4294 posix_fadvise64 [LSB] 4295 posix_fallocate64 [LSB] pread64 [LSB] pwrite64 [LSB] readdir64 4296 [LFS] 4297 readdir64_r [LSB] statfs64 [LSB] statvfs64 [LFS] tmpfile64 4298 [LFS] 4299 truncate64 [LFS] 4300 4301 An LSB conforming implementation shall provide the generic 4302 deprecated functions for Large File Support specified in Table 4303 12-32, with the full mandatory functionality as described in 4304 the referenced underlying specification. 4305 4306 Note: These interfaces are deprecated, and applications 4307 should avoid using them. These interfaces may be withdrawn 4308 in future releases of this specification. 4309 4310 Table 12-32. libc - Large File Support Deprecated Function 4311 Interfaces 4312 fstatfs64 [LSB] statfs64 [LSB] 4313 __________________________________________________________ 4314 4315 12.3.20. Inotify 4316 __________________________________________________________ 4317 4318 12.3.20.1. Interfaces for Inotify 4319 4320 An LSB conforming implementation shall provide the generic 4321 functions for Inotify specified in Table 12-33, with the full 4322 mandatory functionality as described in the referenced 4323 underlying specification. 4324 4325 Table 12-33. libc - Inotify Function Interfaces 4326 inotify_add_watch(GLIBC_2.4) [LSB] inotify_init(GLIBC_2.4) 4327 [LSB] inotify_rm_watch(GLIBC_2.4) [LSB] 4328 __________________________________________________________ 4329 4330 12.3.21. Standard Library 4331 __________________________________________________________ 4332 4333 12.3.21.1. Interfaces for Standard Library 4334 4335 An LSB conforming implementation shall provide the generic 4336 functions for Standard Library specified in Table 12-34, with 4337 the full mandatory functionality as described in the referenced 4338 underlying specification. 4339 4340 Table 12-34. libc - Standard Library Function Interfaces 4341 _Exit [SUSv3] __assert_fail [LSB] __confstr_chk(GLIBC_2.4) 4342 [LSB] __cxa_atexit [LSB] 4343 __cxa_finalize [LSB] __errno_location [LSB] __fpending [LSB] 4344 __getcwd_chk(GLIBC_2.4) [LSB] 4345 __getlogin_r_chk(GLIBC_2.4) [LSB] __getpagesize [LSB] __isinf 4346 [LSB] __isinff [LSB] 4347 __isinfl [LSB] __isnan [LSB] __isnanf [LSB] __isnanl [LSB] 4348 __pread64_chk(GLIBC_2.4) [LSB] __pread_chk(GLIBC_2.4) [LSB] 4349 __realpath_chk(GLIBC_2.4) [LSB] __sysconf [LSB] 4350 __syslog_chk(GLIBC_2.4) [LSB] __ttyname_r_chk(GLIBC_2.4) [LSB] 4351 __vsyslog_chk(GLIBC_2.4) [LSB] __xpg_basename [LSB] 4352 _exit [SUSv3] _longjmp [SUSv3] _setjmp [SUSv3] a64l [SUSv3] 4353 abort [SUSv3] abs [SUSv3] alphasort [SUSv4] alphasort64 [LSB] 4354 atof [SUSv3] atoi [SUSv3] atol [SUSv3] atoll [SUSv3] 4355 basename [LSB] bsearch [SUSv3] calloc [SUSv3] closelog [SUSv3] 4356 confstr [SUSv3] cuserid [SUSv2] daemon [LSB] dirfd [SUSv4] 4357 dirname [SUSv3] div [SUSv3] dl_iterate_phdr [LSB] drand48 4358 [SUSv3] 4359 drand48_r [LSB] ecvt [SUSv3] erand48 [SUSv3] erand48_r [LSB] 4360 err [LSB] error [LSB] errx [LSB] fcvt [SUSv3] 4361 fmemopen [SUSv4] fmtmsg [SUSv3] fnmatch [SUSv3] fpathconf 4362 [SUSv3] 4363 free [SUSv3] freeaddrinfo [SUSv3] ftrylockfile [SUSv3] ftw 4364 [SUSv3] 4365 funlockfile [SUSv3] gai_strerror [SUSv3] gcvt [SUSv3] 4366 getaddrinfo [SUSv3] 4367 getcwd [SUSv3] getdate [SUSv3] getdomainname [LSB] getenv 4368 [SUSv3] 4369 getlogin [SUSv3] getlogin_r [SUSv3] getnameinfo [SUSv3] getopt 4370 [LSB] 4371 getopt_long [LSB] getopt_long_only [LSB] getsubopt [SUSv3] 4372 gettimeofday [SUSv3] 4373 glob [SUSv3] glob64 [LSB] globfree [SUSv3] globfree64 [LSB] 4374 grantpt [SUSv3] hcreate [SUSv3] hcreate_r [LSB] hdestroy 4375 [SUSv3] 4376 hdestroy_r [LSB] hsearch [SUSv3] hsearch_r [LSB] htonl [SUSv3] 4377 htons [SUSv3] imaxabs [SUSv3] imaxdiv [SUSv3] inet_addr [SUSv3] 4378 inet_aton [LSB] inet_ntoa [SUSv3] inet_ntop [SUSv3] inet_pton 4379 [SUSv3] 4380 initstate [SUSv3] initstate_r [LSB] insque [SUSv3] isatty 4381 [SUSv3] 4382 isblank [SUSv3] jrand48 [SUSv3] jrand48_r [LSB] l64a [SUSv3] 4383 labs [SUSv3] lcong48 [SUSv3] lcong48_r [LSB] ldiv [SUSv3] 4384 lfind [SUSv3] llabs [SUSv3] lldiv [SUSv3] longjmp [SUSv3] 4385 lrand48 [SUSv3] lrand48_r [LSB] lsearch [SUSv3] makecontext 4386 [SUSv3] 4387 malloc [SUSv3] memmem [LSB] mkdtemp [SUSv4] mkstemp [SUSv3] 4388 mktemp [SUSv3] mrand48 [SUSv3] mrand48_r [LSB] nftw [SUSv3] 4389 nrand48 [SUSv3] nrand48_r [LSB] ntohl [SUSv3] ntohs [SUSv3] 4390 open_memstream [SUSv4] open_wmemstream(GLIBC_2.4) [SUSv4] 4391 openlog [SUSv3] perror [SUSv3] 4392 posix_openpt [SUSv3] ptsname [SUSv3] putenv [SUSv3] qsort 4393 [SUSv3] 4394 rand [SUSv3] rand_r [SUSv3] random [SUSv3] random_r [LSB] 4395 realloc [SUSv3] realpath [SUSv3] remque [SUSv3] scandir [SUSv4] 4396 scandir64 [LSB] seed48 [SUSv3] seed48_r [LSB] sendfile [LSB] 4397 sendfile64(GLIBC_2.3) [LSB] setenv [SUSv3] sethostname [LSB] 4398 setlogmask [SUSv3] 4399 setstate [SUSv3] setstate_r [LSB] srand [SUSv3] srand48 [SUSv3] 4400 srand48_r [LSB] srandom [SUSv3] srandom_r [LSB] strtod [SUSv3] 4401 strtol [SUSv3] strtoul [SUSv3] swapcontext [SUSv3] syslog 4402 [SUSv3] 4403 system [LSB] tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] 4404 tmpnam [SUSv3] tsearch [SUSv3] ttyname [SUSv3] ttyname_r 4405 [SUSv3] 4406 twalk [SUSv3] unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] 4407 verrx [LSB] vfscanf [LSB] vscanf [LSB] vsscanf [LSB] 4408 vsyslog [LSB] warn [LSB] warnx [LSB] wordexp [SUSv3] 4409 wordfree [SUSv3] 4410 4411 An LSB conforming implementation shall provide the generic 4412 deprecated functions for Standard Library specified in Table 4413 12-35, with the full mandatory functionality as described in 4414 the referenced underlying specification. 4415 4416 Note: These interfaces are deprecated, and applications 4417 should avoid using them. These interfaces may be withdrawn 4418 in future releases of this specification. 4419 4420 Table 12-35. libc - Standard Library Deprecated Function 4421 Interfaces 4422 basename [LSB] getdomainname [LSB] inet_aton [LSB] tmpnam 4423 [SUSv3] 4424 4425 An LSB conforming implementation shall provide the generic data 4426 interfaces for Standard Library specified in Table 12-36, with 4427 the full mandatory functionality as described in the referenced 4428 underlying specification. 4429 4430 Table 12-36. libc - Standard Library Data Interfaces 4431 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 4432 [SUSv3] 4433 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 4434 [SUSv3] 4435 optopt [SUSv3] 4436 __________________________________________________________ 4437 4438 12.3.22. GNU Extensions for libc 4439 __________________________________________________________ 4440 4441 12.3.22.1. Interfaces for GNU Extensions for libc 4442 4443 An LSB conforming implementation shall provide the generic 4444 functions for GNU Extensions for libc specified in Table 12-37, 4445 with the full mandatory functionality as described in the 4446 referenced underlying specification. 4447 4448 Table 12-37. libc - GNU Extensions for libc Function Interfaces 4449 gnu_get_libc_release [LSB] gnu_get_libc_version [LSB] 4450 __________________________________________________________ 4451 4452 12.4. Data Definitions for libc 4453 4454 This section defines global identifiers and their values that 4455 are associated with interfaces contained in libc. These 4456 definitions are organized into groups that correspond to system 4457 headers. This convention is used as a convenience for the 4458 reader, and does not imply the existence of these headers, or 4459 their content. Where an interface is defined as requiring a 4460 particular system header file all of the data definitions for 4461 that system header file presented here shall be in effect. 4462 4463 This section gives data definitions to promote binary 4464 application portability, not to repeat source interface 4465 definitions available elsewhere. System providers and 4466 application developers should use this ABI to supplement - not 4467 to replace - source interface definition specifications. 4468 4469 This specification uses the ISO C (1999) C Language as the 4470 reference programming language, and data definitions are 4471 specified in ISO C format. The C language is used here as a 4472 convenient notation. Using a C language description of these 4473 data objects does not preclude their use by other programming 4474 languages. 4475 __________________________________________________________ 4476 4477 12.4.1. arpa/inet.h 4478 4479 extern uint32_t htonl(uint32_t); 4480 extern uint16_t htons(uint16_t); 4481 extern in_addr_t inet_addr(const char *__cp); 4482 extern int inet_aton(const char *__cp, struct in_addr *__inp); 4483 extern char *inet_ntoa(struct in_addr __in); 4484 extern const char *inet_ntop(int __af, const void *__cp, char *__buf, 4485 socklen_t __len); 4486 extern int inet_pton(int __af, const char *__cp, void *__buf); 4487 extern uint32_t ntohl(uint32_t); 4488 extern uint16_t ntohs(uint16_t); 4489 __________________________________________________________ 4490 4491 12.4.2. assert.h 4492 4493 #ifdef NDEBUG 4494 #define assert(expr) ((void)0) 4495 #else 4496 #define assert(expr) ((void) ((expr) ? 0 : (__assert_fail (#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__), 0))) 4497 #endif 4498 4499 extern void __assert_fail(const char *__assertion, const char *__file, 4500 unsigned int __line, const char *__function); 4501 __________________________________________________________ 4502 4503 12.4.3. cpio.h 4504 4505 #define C_IXOTH 000001 4506 #define C_IWOTH 000002 4507 #define C_IROTH 000004 4508 #define C_IXGRP 000010 4509 #define C_IWGRP 000020 4510 #define C_IRGRP 000040 4511 #define C_IXUSR 000100 4512 #define C_IWUSR 000200 4513 #define C_IRUSR 000400 4514 #define C_ISVTX 001000 4515 #define C_ISGID 002000 4516 #define C_ISUID 004000 4517 #define C_ISFIFO 010000 4518 #define C_ISREG 0100000 4519 #define C_ISCTG 0110000 4520 #define C_ISLNK 0120000 4521 #define C_ISSOCK 0140000 4522 #define C_ISCHR 020000 4523 #define C_ISDIR 040000 4524 #define C_ISBLK 060000 4525 #define MAGIC "070707" 4526 __________________________________________________________ 4527 4528 12.4.4. ctype.h 4529 4530 extern const unsigned short **__ctype_b_loc(void); 4531 extern const int32_t **__ctype_tolower_loc(void); 4532 extern const int32_t **__ctype_toupper_loc(void); 4533 extern int _tolower(int); 4534 extern int _toupper(int); 4535 extern int isalnum(int); 4536 extern int isalpha(int); 4537 extern int isascii(int __c); 4538 extern int isblank(int); 4539 extern int iscntrl(int); 4540 extern int isdigit(int); 4541 extern int isgraph(int); 4542 extern int islower(int); 4543 extern int isprint(int); 4544 extern int ispunct(int); 4545 extern int isspace(int); 4546 extern int isupper(int); 4547 extern int isxdigit(int); 4548 extern int toascii(int __c); 4549 extern int tolower(int __c); 4550 extern int toupper(int __c); 4551 __________________________________________________________ 4552 4553 12.4.5. dirent.h 4554 4555 typedef struct __dirstream DIR; 4556 4557 struct dirent { 4558 long int d_ino; 4559 off_t d_off; 4560 unsigned short d_reclen; 4561 unsigned char d_type; 4562 char d_name[256]; 4563 }; 4564 struct dirent64 { 4565 uint64_t d_ino; 4566 int64_t d_off; 4567 unsigned short d_reclen; 4568 unsigned char d_type; 4569 char d_name[256]; 4570 }; 4571 extern int alphasort(const struct dirent **__e1, 4572 const struct dirent **__e2); 4573 extern int alphasort64(const struct dirent64 **__e1, 4574 const struct dirent64 **__e2); 4575 extern int closedir(DIR * __dirp); 4576 extern int dirfd(DIR * __dirp); 4577 extern DIR *fdopendir(int __fd); 4578 extern DIR *opendir(const char *__name); 4579 extern struct dirent *readdir(DIR * __dirp); 4580 extern struct dirent64 *readdir64(DIR * __dirp); 4581 extern int readdir64_r(DIR * __dirp, struct dirent64 *__entry, 4582 struct dirent64 **__result); 4583 extern int readdir_r(DIR * __dirp, struct dirent *__entry, 4584 struct dirent **__result); 4585 extern void rewinddir(DIR * __dirp); 4586 extern int scandir(const char *__dir, struct dirent ***__namelist, 4587 int (*__selector) (const struct dirent *), 4588 int (*__cmp) (const struct dirent * *, 4589 const struct dirent * *)); 4590 extern int scandir64(const char *__dir, struct dirent64 ***__namelist, 4591 int (*__selector) (const struct dirent64 *), 4592 int (*__cmp) (const struct dirent64 * *, 4593 const struct dirent64 * *)); 4594 extern void seekdir(DIR * __dirp, long int __pos); 4595 extern long int telldir(DIR * __dirp); 4596 __________________________________________________________ 4597 4598 12.4.6. elf.h 4599 4600 #define ELFMAG1 'E' 4601 #define ELFMAG3 'F' 4602 #define ELFMAG2 'L' 4603 #define ELF32_ST_INFO(bind,type) (((bind) << 4) + ((type) & 0xf)) 4604 #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) 4605 #define ELF32_ST_TYPE(val) ((val) & 0xf) 4606 #define PF_X (1 << 0) 4607 #define SHF_WRITE (1 << 0) 4608 #define PF_W (1 << 1) 4609 #define SHF_ALLOC (1 << 1) 4610 #define SHF_TLS (1 << 10) 4611 #define PF_R (1 << 2) 4612 #define SHF_EXECINSTR (1 << 2) 4613 #define SHF_MERGE (1 << 4) 4614 #define SHF_STRINGS (1 << 5) 4615 #define SHF_LINK_ORDER (1 << 7) 4616 #define EI_NIDENT (16) 4617 #define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) 4618 #define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) 4619 #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) 4620 #define PT_IA_64_UNWIND (PT_LOPROC + 1) 4621 #define SHT_IA_64_EXT (SHT_LOPROC + 0) 4622 #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) 4623 #define DT_NULL 0 4624 #define EI_MAG0 0 4625 #define ELFCLASSNONE 0 4626 #define ELFDATANONE 0 4627 #define ELFOSABI_NONE 0 4628 #define ELFOSABI_SYSV 0 4629 #define ET_NONE 0 4630 #define EV_NONE 0 4631 #define PT_NULL 0 4632 #define SHN_UNDEF 0 4633 #define SHT_NULL 0 4634 #define STB_LOCAL 0 4635 #define STT_NOTYPE 0 4636 #define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */ 4637 #define DF_SYMBOLIC 0x00000002 /* Symbol resolutions start with this object */ 4638 #define DF_TEXTREL 0x00000004 /* Object contains text relocations */ 4639 #define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ 4640 #define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ 4641 #define SHF_IA_64_SHORT 0x10000000 4642 #define PT_LOOS 0x60000000 4643 #define DT_LOOS 0x6000000d 4644 #define PT_GNU_EH_FRAME 0x6474e550 4645 #define PT_GNU_STACK 0x6474e551 4646 #define PT_GNU_RELRO 0x6474e552 4647 #define DT_HIOS 0x6ffff000 4648 #define DT_VALRNGLO 0x6ffffd00 4649 #define DT_GNU_PRELINKED 0x6ffffdf5 4650 #define DT_GNU_CONFLICTSZ 0x6ffffdf6 4651 #define DT_GNU_LIBLISTSZ 0x6ffffdf7 4652 #define DT_CHECKSUM 0x6ffffdf8 4653 #define DT_PLTPADSZ 0x6ffffdf9 4654 #define DT_MOVEENT 0x6ffffdfa 4655 #define DT_MOVESZ 0x6ffffdfb 4656 #define DT_FEATURE_1 0x6ffffdfc 4657 #define DT_POSFLAG_1 0x6ffffdfd 4658 #define DT_SYMINSZ 0x6ffffdfe 4659 #define DT_SYMINENT 0x6ffffdff 4660 #define DT_VALRNGHI 0x6ffffdff 4661 #define DT_ADDRRNGLO 0x6ffffe00 4662 #define DT_GNU_HASH 0x6ffffef5 4663 #define DT_TLSDESC_PLT 0x6ffffef6 4664 #define DT_TLSDESC_GOT 0x6ffffef7 4665 #define DT_GNU_CONFLICT 0x6ffffef8 4666 #define DT_GNU_LIBLIST 0x6ffffef9 4667 #define DT_CONFIG 0x6ffffefa 4668 #define DT_DEPAUDIT 0x6ffffefb 4669 #define DT_AUDIT 0x6ffffefc 4670 #define DT_PLTPAD 0x6ffffefd 4671 #define DT_MOVETAB 0x6ffffefe 4672 #define DT_ADDRRNGHI 0x6ffffeff 4673 #define DT_SYMINFO 0x6ffffeff 4674 #define DT_VERSYM 0x6ffffff0 4675 #define DT_RELACOUNT 0x6ffffff9 4676 #define DT_RELCOUNT 0x6ffffffa 4677 #define DT_FLAGS_1 0x6ffffffb 4678 #define DT_VERDEF 0x6ffffffc 4679 #define DT_VERDEFNUM 0x6ffffffd 4680 #define SHT_GNU_verdef 0x6ffffffd 4681 #define DT_VERNEED 0x6ffffffe 4682 #define SHT_GNU_verneed 0x6ffffffe 4683 #define DT_VERNEEDNUM 0x6fffffff 4684 #define SHT_GNU_versym 0x6fffffff 4685 #define DT_LOPROC 0x70000000 4686 #define PT_LOPROC 0x70000000 4687 #define SHT_LOPROC 0x70000000 4688 #define ELFMAG0 0x7f 4689 #define DT_AUXILIARY 0x7ffffffd 4690 #define DT_FILTER 0x7fffffff 4691 #define DT_HIPROC 0x7fffffff 4692 #define PT_HIPROC 0x7fffffff 4693 #define SHT_HIPROC 0x7fffffff 4694 #define SHT_LOUSER 0x80000000 4695 #define SHT_HIUSER 0x8fffffff 4696 #define ET_LOOS 0xfe00 4697 #define ET_HIOS 0xfeff 4698 #define ET_LOPROC 0xff00 4699 #define SHN_LOPROC 0xff00 4700 #define SHN_LORESERVE 0xff00 4701 #define SHN_HIPROC 0xff1f 4702 #define SHN_LOOS 0xff20 4703 #define SHN_HIOS 0xff3f 4704 #define SHN_ABS 0xfff1 4705 #define SHN_COMMON 0xfff2 4706 #define ET_HIPROC 0xffff 4707 #define SHN_HIRESERVE 0xffff 4708 #define SHN_XINDEX 0xffff 4709 #define DT_NEEDED 1 4710 #define EI_MAG1 1 4711 #define ELFCLASS32 1 4712 #define ELFDATA2LSB 1 4713 #define ET_REL 1 4714 #define EV_CURRENT 1 4715 #define PT_LOAD 1 4716 #define SHT_PROGBITS 1 4717 #define STB_GLOBAL 1 4718 #define STT_OBJECT 1 4719 #define DT_STRSZ 10 4720 #define SHT_SHLIB 10 4721 #define STB_LOOS 10 4722 #define DT_ADDRNUM 11 4723 #define DT_SYMENT 11 4724 #define SHT_DYNSYM 11 4725 #define DT_INIT 12 4726 #define DT_VALNUM 12 4727 #define STB_HIOS 12 4728 #define DT_FINI 13 4729 #define STB_LOPROC 13 4730 #define DT_SONAME 14 4731 #define SHT_INIT_ARRAY 14 4732 #define DT_RPATH 15 4733 #define SHT_FINI_ARRAY 15 4734 #define STB_HIPROC 15 4735 #define DT_SYMBOLIC 16 4736 #define DT_VERSIONTAGNUM 16 4737 #define SHT_PREINIT_ARRAY 16 4738 #define DT_REL 17 4739 #define DT_RELSZ 18 4740 #define DT_RELENT 19 4741 #define DT_PLTRELSZ 2 4742 #define EI_MAG2 2 4743 #define ELFCLASS64 2 4744 #define ELFDATA2MSB 2 4745 #define ET_EXEC 2 4746 #define EV_NUM 2 4747 #define PT_DYNAMIC 2 4748 #define SHT_SYMTAB 2 4749 #define STB_WEAK 2 4750 #define STT_FUNC 2 4751 #define DT_PLTREL 20 4752 #define DT_DEBUG 21 4753 #define DT_TEXTREL 22 4754 #define DT_JMPREL 23 4755 #define DT_BIND_NOW 24 4756 #define DT_INIT_ARRAY 25 4757 #define DT_FINI_ARRAY 26 4758 #define DT_INIT_ARRAYSZ 27 4759 #define DT_FINI_ARRAYSZ 28 4760 #define DT_RUNPATH 29 4761 #define DT_EXTRANUM 3 4762 #define DT_PLTGOT 3 4763 #define EI_MAG3 3 4764 #define ELFCLASSNUM 3 4765 #define ELFDATANUM 3 4766 #define ELFOSABI_LINUX 3 4767 #define ET_DYN 3 4768 #define PT_INTERP 3 4769 #define SHT_STRTAB 3 4770 #define STB_NUM 3 4771 #define DT_FLAGS 30 4772 #define DT_ENCODING 32 4773 #define DT_PREINIT_ARRAY 32 4774 #define DT_PREINIT_ARRAYSZ 33 4775 #define DT_NUM 34 4776 #define DT_HASH 4 4777 #define EI_CLASS 4 4778 #define ET_CORE 4 4779 #define PT_NOTE 4 4780 #define SELFMAG 4 4781 #define SHT_RELA 4 4782 #define DT_STRTAB 5 4783 #define EI_DATA 5 4784 #define ET_NUM 5 4785 #define PT_SHLIB 5 4786 #define SHT_HASH 5 4787 #define DT_SYMTAB 6 4788 #define EI_VERSION 6 4789 #define PT_PHDR 6 4790 #define SHT_DYNAMIC 6 4791 #define DT_RELA 7 4792 #define EI_OSABI 7 4793 #define PT_TLS 7 4794 #define SHT_NOTE 7 4795 #define DT_RELASZ 8 4796 #define EI_ABIVERSION 8 4797 #define PT_NUM 8 4798 #define SHT_NOBITS 8 4799 #define DT_RELAENT 9 4800 #define SHT_REL 9 4801 #define ELF64_ST_BIND(val) ELF32_ST_BIND (val) 4802 #define ELF64_ST_INFO(bind,type) ELF32_ST_INFO ((bind), (type)) 4803 #define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) 4804 #define ELFMAG "\177ELF" 4805 4806 typedef uint32_t Elf32_Addr; 4807 typedef uint64_t Elf64_Addr; 4808 typedef uint32_t Elf32_Word; 4809 typedef uint32_t Elf64_Word; 4810 typedef int32_t Elf32_Sword; 4811 typedef int32_t Elf64_Sword; 4812 typedef uint64_t Elf32_Xword; 4813 typedef uint64_t Elf64_Xword; 4814 typedef int64_t Elf32_Sxword; 4815 typedef int64_t Elf64_Sxword; 4816 typedef uint32_t Elf32_Off; 4817 typedef uint64_t Elf64_Off; 4818 typedef struct { 4819 Elf32_Word p_type; /* Segment type */ 4820 Elf32_Off p_offset; /* Segment file offset */ 4821 Elf32_Addr p_vaddr; /* Segment virtual address */ 4822 Elf32_Addr p_paddr; /* Segment physical address */ 4823 Elf32_Word p_filesz; /* Segment size in file */ 4824 Elf32_Word p_memsz; /* Segment size in memory */ 4825 Elf32_Word p_flags; /* Segment flags */ 4826 Elf32_Word p_align; /* Segment alignment */ 4827 } Elf32_Phdr; 4828 typedef struct { 4829 Elf64_Word p_type; /* Segment type */ 4830 Elf64_Word p_flags; /* Segment flags */ 4831 Elf64_Off p_offset; /* Segment file offset */ 4832 Elf64_Addr p_vaddr; /* Segment virtual address */ 4833 Elf64_Addr p_paddr; /* Segment physical address */ 4834 Elf64_Xword p_filesz; /* Segment size in file */ 4835 Elf64_Xword p_memsz; /* Segment size in memory */ 4836 Elf64_Xword p_align; /* Segment alignment */ 4837 } Elf64_Phdr; 4838 typedef uint16_t Elf32_Half; 4839 typedef uint16_t Elf64_Half; 4840 typedef uint16_t Elf32_Section; 4841 typedef uint16_t Elf64_Section; 4842 typedef struct { 4843 Elf32_Word n_namesz; 4844 Elf32_Word n_descsz; 4845 Elf32_Word n_type; 4846 } Elf32_Nhdr; 4847 typedef struct { 4848 Elf64_Word n_namesz; 4849 Elf64_Word n_descsz; 4850 Elf64_Word n_type; 4851 } Elf64_Nhdr; 4852 typedef struct { 4853 Elf64_Word st_name; 4854 unsigned char st_info; 4855 unsigned char st_other; 4856 Elf64_Section st_shndx; 4857 Elf64_Addr st_value; 4858 Elf64_Xword st_size; 4859 } Elf64_Sym; 4860 typedef struct { 4861 Elf32_Word st_name; 4862 Elf32_Addr st_value; 4863 Elf32_Word st_size; 4864 unsigned char st_info; 4865 unsigned char st_other; 4866 Elf32_Section st_shndx; 4867 } Elf32_Sym; 4868 typedef struct { 4869 Elf64_Addr r_offset; 4870 Elf64_Xword r_info; 4871 } Elf64_Rel; 4872 typedef struct { 4873 Elf32_Addr r_offset; 4874 Elf32_Word r_info; 4875 } Elf32_Rel; 4876 typedef struct { 4877 Elf64_Addr r_offset; 4878 Elf64_Xword r_info; 4879 Elf64_Sxword r_addend; 4880 } Elf64_Rela; 4881 typedef struct { 4882 Elf32_Addr r_offset; 4883 Elf32_Word r_info; 4884 Elf32_Sword r_addend; 4885 } Elf32_Rela; 4886 typedef struct { 4887 Elf32_Half vd_version; 4888 Elf32_Half vd_flags; 4889 Elf32_Half vd_ndx; 4890 Elf32_Half vd_cnt; 4891 Elf32_Word vd_hash; 4892 Elf32_Word vd_aux; 4893 Elf32_Word vd_next; 4894 } Elf32_Verdef; 4895 typedef struct { 4896 Elf64_Half vd_version; 4897 Elf64_Half vd_flags; 4898 Elf64_Half vd_ndx; 4899 Elf64_Half vd_cnt; 4900 Elf64_Word vd_hash; 4901 Elf64_Word vd_aux; 4902 Elf64_Word vd_next; 4903 } Elf64_Verdef; 4904 typedef struct { 4905 Elf64_Word vda_name; 4906 Elf64_Word vda_next; 4907 } Elf64_Verdaux; 4908 typedef struct { 4909 Elf32_Word vda_name; 4910 Elf32_Word vda_next; 4911 } Elf32_Verdaux; 4912 typedef struct { 4913 Elf32_Half vn_version; 4914 Elf32_Half vn_cnt; 4915 Elf32_Word vn_file; 4916 Elf32_Word vn_aux; 4917 Elf32_Word vn_next; 4918 } Elf32_Verneed; 4919 typedef struct { 4920 Elf64_Half vn_version; 4921 Elf64_Half vn_cnt; 4922 Elf64_Word vn_file; 4923 Elf64_Word vn_aux; 4924 Elf64_Word vn_next; 4925 } Elf64_Verneed; 4926 typedef struct { 4927 Elf32_Word vna_hash; 4928 Elf32_Half vna_flags; 4929 Elf32_Half vna_other; 4930 Elf32_Word vna_name; 4931 Elf32_Word vna_next; 4932 } Elf32_Vernaux; 4933 typedef struct { 4934 Elf64_Word vna_hash; 4935 Elf64_Half vna_flags; 4936 Elf64_Half vna_other; 4937 Elf64_Word vna_name; 4938 Elf64_Word vna_next; 4939 } Elf64_Vernaux; 4940 typedef struct { 4941 unsigned char e_ident[EI_NIDENT]; 4942 Elf64_Half e_type; 4943 Elf64_Half e_machine; 4944 Elf64_Word e_version; 4945 Elf64_Addr e_entry; 4946 Elf64_Off e_phoff; 4947 Elf64_Off e_shoff; 4948 Elf64_Word e_flags; 4949 Elf64_Half e_ehsize; 4950 Elf64_Half e_phentsize; 4951 Elf64_Half e_phnum; 4952 Elf64_Half e_shentsize; 4953 Elf64_Half e_shnum; 4954 Elf64_Half e_shstrndx; 4955 } Elf64_Ehdr; 4956 typedef struct { 4957 unsigned char e_ident[EI_NIDENT]; 4958 Elf32_Half e_type; 4959 Elf32_Half e_machine; 4960 Elf32_Word e_version; 4961 Elf32_Addr e_entry; 4962 Elf32_Off e_phoff; 4963 Elf32_Off e_shoff; 4964 Elf32_Word e_flags; 4965 Elf32_Half e_ehsize; 4966 Elf32_Half e_phentsize; 4967 Elf32_Half e_phnum; 4968 Elf32_Half e_shentsize; 4969 Elf32_Half e_shnum; 4970 Elf32_Half e_shstrndx; 4971 } Elf32_Ehdr; 4972 typedef struct { 4973 Elf32_Word sh_name; 4974 Elf32_Word sh_type; 4975 Elf32_Word sh_flags; 4976 Elf32_Addr sh_addr; 4977 Elf32_Off sh_offset; 4978 Elf32_Word sh_size; 4979 Elf32_Word sh_link; 4980 Elf32_Word sh_info; 4981 Elf32_Word sh_addralign; 4982 Elf32_Word sh_entsize; 4983 } Elf32_Shdr; 4984 typedef struct { 4985 Elf64_Word sh_name; 4986 Elf64_Word sh_type; 4987 Elf64_Xword sh_flags; 4988 Elf64_Addr sh_addr; 4989 Elf64_Off sh_offset; 4990 Elf64_Xword sh_size; 4991 Elf64_Word sh_link; 4992 Elf64_Word sh_info; 4993 Elf64_Xword sh_addralign; 4994 Elf64_Xword sh_entsize; 4995 } Elf64_Shdr; 4996 typedef struct { 4997 Elf32_Sword d_tag; 4998 union { 4999 Elf32_Word d_val; 5000 Elf32_Addr d_ptr; 5001 } d_un; 5002 } Elf32_Dyn; 5003 typedef struct { 5004 Elf64_Sxword d_tag; 5005 union { 5006 Elf64_Xword d_val; 5007 Elf64_Addr d_ptr; 5008 } d_un; 5009 } Elf64_Dyn; 5010 __________________________________________________________ 5011 5012 12.4.7. endian.h 5013 5014 #define __LITTLE_ENDIAN 1234 5015 #define __BIG_ENDIAN 4321 5016 #define BIG_ENDIAN __BIG_ENDIAN 5017 #define BYTE_ORDER __BYTE_ORDER 5018 #define LITTLE_ENDIAN __LITTLE_ENDIAN 5019 __________________________________________________________ 5020 5021 12.4.8. err.h 5022 5023 extern void err(int __status, const char *__format, ...); 5024 extern void error(int, int, const char *, ...); 5025 extern void errx(int __status, const char *__format, ...); 5026 extern void warn(const char *__format, ...); 5027 extern void warnx(const char *__format, ...); 5028 __________________________________________________________ 5029 5030 12.4.9. errno.h 5031 5032 #define errno (*__errno_location()) 5033 5034 #define EPERM 1 /* Operation not permitted */ 5035 #define ECHILD 10 /* No child processes */ 5036 #define ENETDOWN 100 /* Network is down */ 5037 #define ENETUNREACH 101 /* Network is unreachable */ 5038 #define ENETRESET 102 /* Network dropped connection because of reset */ 5039 #define ECONNABORTED 103 /* Software caused connection abort */ 5040 #define ECONNRESET 104 /* Connection reset by peer */ 5041 #define ENOBUFS 105 /* No buffer space available */ 5042 #define EISCONN 106 /* Transport endpoint is already connected */ 5043 #define ENOTCONN 107 /* Transport endpoint is not connected */ 5044 #define ESHUTDOWN 108 /* Cannot send after transport endpointshutdown */ 5045 #define ETOOMANYREFS 109 /* Too many references: cannot splice */ 5046 #define EAGAIN 11 /* Try again */ 5047 #define ETIMEDOUT 110 /* Connection timed out */ 5048 #define ECONNREFUSED 111 /* Connection refused */ 5049 #define EHOSTDOWN 112 /* Host is down */ 5050 #define EHOSTUNREACH 113 /* No route to host */ 5051 #define EALREADY 114 /* Operation already in progress */ 5052 #define EINPROGRESS 115 /* Operation now in progress */ 5053 #define ESTALE 116 /* Stale NFS file handle */ 5054 #define EUCLEAN 117 /* Structure needs cleaning */ 5055 #define ENOTNAM 118 /* Not a XENIX named type file */ 5056 #define ENAVAIL 119 /* No XENIX semaphores available */ 5057 #define ENOMEM 12 /* Out of memory */ 5058 #define EISNAM 120 /* Is a named type file */ 5059 #define EREMOTEIO 121 /* Remote I/O error */ 5060 #define EDQUOT 122 /* Quota exceeded */ 5061 #define ENOMEDIUM 123 /* No medium found */ 5062 #define EMEDIUMTYPE 124 /* Wrong medium type */ 5063 #define ECANCELED 125 /* Operation Canceled */ 5064 #define EACCES 13 /* Permission denied */ 5065 #define EOWNERDEAD 130 5066 #define ENOTRECOVERABLE 131 5067 #define EFAULT 14 /* Bad address */ 5068 #define ENOTBLK 15 /* Block device required */ 5069 #define EBUSY 16 /* Device or resource busy */ 5070 #define EEXIST 17 /* File exists */ 5071 #define EXDEV 18 /* Cross-device link */ 5072 #define ENODEV 19 /* No such device */ 5073 #define ENOENT 2 /* No such file or directory */ 5074 #define ENOTDIR 20 /* Not a directory */ 5075 #define EISDIR 21 /* Is a directory */ 5076 #define EINVAL 22 /* Invalid argument */ 5077 #define ENFILE 23 /* File table overflow */ 5078 #define EMFILE 24 /* Too many open files */ 5079 #define ENOTTY 25 /* Not a typewriter */ 5080 #define ETXTBSY 26 /* Text file busy */ 5081 #define EFBIG 27 /* File too large */ 5082 #define ENOSPC 28 /* No space left on device */ 5083 #define ESPIPE 29 /* Illegal seek */ 5084 #define ESRCH 3 /* No such process */ 5085 #define EROFS 30 /* Read-only file system */ 5086 #define EMLINK 31 /* Too many links */ 5087 #define EPIPE 32 /* Broken pipe */ 5088 #define EDOM 33 /* Math argument out of domain of func */ 5089 #define ERANGE 34 /* Math result not representable */ 5090 #define EDEADLK 35 /* Resource deadlock would occur */ 5091 #define ENAMETOOLONG 36 /* File name too long */ 5092 #define ENOLCK 37 /* No record locks available */ 5093 #define ENOSYS 38 /* Function not implemented */ 5094 #define ENOTEMPTY 39 /* Directory not empty */ 5095 #define EINTR 4 /* Interrupted system call */ 5096 #define ELOOP 40 /* Too many symbolic links encountered */ 5097 #define ENOMSG 42 /* No message of desired type */ 5098 #define EIDRM 43 /* Identifier removed */ 5099 #define ECHRNG 44 /* Channel number out of range */ 5100 #define EL2NSYNC 45 /* Level 2 not synchronized */ 5101 #define EL3HLT 46 /* Level 3 halted */ 5102 #define EL3RST 47 /* Level 3 reset */ 5103 #define ELNRNG 48 /* Link number out of range */ 5104 #define EUNATCH 49 /* Protocol driver not attached */ 5105 #define EIO 5 /* I/O error */ 5106 #define ENOANO 55 /* No anode */ 5107 #define EBADRQC 56 /* Invalid request code */ 5108 #define EBADSLT 57 /* Invalid slot */ 5109 #define EBFONT 59 /* Bad font file format */ 5110 #define ENXIO 6 /* No such device or address */ 5111 #define ENOSTR 60 /* Device not a stream */ 5112 #define ENODATA 61 /* No data available */ 5113 #define ETIME 62 /* Timer expired */ 5114 #define ENOSR 63 /* Out of streams resources */ 5115 #define ENONET 64 /* Machine is not on the network */ 5116 #define ENOPKG 65 /* Package not installed */ 5117 #define EREMOTE 66 /* Object is remote */ 5118 #define ENOLINK 67 /* Link has been severed */ 5119 #define EADV 68 /* Advertise error */ 5120 #define ESRMNT 69 /* Srmount error */ 5121 #define E2BIG 7 /* Argument list too long */ 5122 #define ECOMM 70 /* Communication error on send */ 5123 #define EPROTO 71 /* Protocol error */ 5124 #define EMULTIHOP 72 /* Multihop attempted */ 5125 #define EDOTDOT 73 /* RFS specific error */ 5126 #define EBADMSG 74 /* Not a data message */ 5127 #define EOVERFLOW 75 /* Value too large for defined data type */ 5128 #define ENOTUNIQ 76 /* Name not unique on network */ 5129 #define EBADFD 77 /* File descriptor in bad state */ 5130 #define EREMCHG 78 /* Remote address changed */ 5131 #define ELIBACC 79 /* Can not access a needed shared library */ 5132 #define ENOEXEC 8 /* Exec format error */ 5133 #define ELIBBAD 80 /* Accessing a corrupted shared library*/ 5134 #define ELIBSCN 81 /* .lib section in a.out corrupted */ 5135 #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ 5136 #define ELIBEXEC 83 /* Cannot exec a shared library directly */ 5137 #define EILSEQ 84 /* Illegal byte sequence */ 5138 #define ERESTART 85 /* Interrupted system call should be restarted */ 5139 #define ESTRPIPE 86 /* Streams pipe error */ 5140 #define EUSERS 87 /* Too many users */ 5141 #define ENOTSOCK 88 /* Socket operation on non-socket */ 5142 #define EDESTADDRREQ 89 /* Destination address required */ 5143 #define EBADF 9 /* Bad file number */ 5144 #define EMSGSIZE 90 /* Message too long */ 5145 #define EPROTOTYPE 91 /* Protocol wrong type for socket */ 5146 #define ENOPROTOOPT 92 /* Protocol not available */ 5147 #define EPROTONOSUPPORT 93 /* Protocol not supported */ 5148 #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ 5149 #define EOPNOTSUPP 95 /* Operation not supported on transportendpoint */ 5150 #define EPFNOSUPPORT 96 /* Protocol family not supported */ 5151 #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ 5152 #define EADDRINUSE 98 /* Address already in use */ 5153 #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ 5154 #define EWOULDBLOCK EAGAIN /* Operation would block */ 5155 #define ENOTSUP EOPNOTSUPP 5156 5157 extern int *__errno_location(void); 5158 __________________________________________________________ 5159 5160 12.4.10. execinfo.h 5161 5162 extern int backtrace(void **__array, int __size); 5163 extern char **backtrace_symbols(void *const *__array, int __size); 5164 extern void backtrace_symbols_fd(void *const *__array, int __size, 5165 int __fd); 5166 __________________________________________________________ 5167 5168 12.4.11. fcntl.h 5169 5170 #define POSIX_FADV_NORMAL 0 5171 #define O_RDONLY 00 5172 #define O_ACCMODE 0003 5173 #define O_WRONLY 01 5174 #define O_CREAT 0100 5175 #define O_TRUNC 01000 5176 #define O_DSYNC 010000 5177 #define O_RSYNC 010000 5178 #define O_SYNC 010000 5179 #define O_RDWR 02 5180 #define O_EXCL 0200 5181 #define O_APPEND 02000 5182 #define O_ASYNC 020000 5183 #define O_NOCTTY 0400 5184 #define O_NDELAY 04000 5185 #define O_NONBLOCK 04000 5186 #define FD_CLOEXEC 1 5187 #define POSIX_FADV_RANDOM 1 5188 #define POSIX_FADV_SEQUENTIAL 2 5189 #define POSIX_FADV_WILLNEED 3 5190 5191 struct flock { 5192 short l_type; 5193 short l_whence; 5194 off_t l_start; 5195 off_t l_len; 5196 pid_t l_pid; 5197 }; 5198 struct flock64 { 5199 short l_type; 5200 short l_whence; 5201 loff_t l_start; 5202 loff_t l_len; 5203 pid_t l_pid; 5204 }; 5205 5206 #define AT_FDCWD -100 5207 #define AT_SYMLINK_NOFOLLOW 0x100 5208 #define AT_EACCESS 0x200 5209 #define AT_REMOVEDIR 0x200 5210 #define AT_SYMLINK_FOLLOW 0x400 5211 5212 #define F_DUPFD 0 5213 #define F_RDLCK 0 5214 #define F_GETFD 1 5215 #define F_WRLCK 1 5216 #define F_SETSIG 10 5217 #define F_GETSIG 11 5218 #define F_SETFD 2 5219 #define F_UNLCK 2 5220 #define F_GETFL 3 5221 #define F_SETFL 4 5222 #define F_GETLK 5 5223 #define F_SETLK 6 5224 #define F_SETLKW 7 5225 #define F_SETOWN 8 5226 #define F_GETOWN 9 5227 5228 extern int creat(const char *__file, mode_t __mode); 5229 extern int creat64(const char *__file, mode_t __mode); 5230 extern int fcntl(int __fd, int __cmd, ...); 5231 extern int open(const char *__file, int __oflag, ...); 5232 extern int open64(const char *__file, int __oflag, ...); 5233 extern int openat(int __fd, const char *__file, int __oflag, ...); 5234 extern int openat64(int __fd, const char *__file, int __oflag, ...); 5235 extern int posix_fadvise(int __fd, off_t __offset, off_t __len, 5236 int __advise); 5237 extern int posix_fadvise64(int __fd, off64_t __offset, off64_t __len, 5238 int __advise); 5239 extern int posix_fallocate(int __fd, off_t __offset, off_t __len); 5240 extern int posix_fallocate64(int __fd, off64_t __offset, off64_t __len); 5241 __________________________________________________________ 5242 5243 12.4.12. fmtmsg.h 5244 5245 #define MM_HARD 1 /* Source of the condition is hardware.*/ 5246 #define MM_NRECOV 128 /* Non-recoverable error. */ 5247 #define MM_UTIL 16 /* Condition detected by utility. */ 5248 #define MM_SOFT 2 /* Source of the condition is software.*/ 5249 #define MM_PRINT 256 /* Display message in standard error. */ 5250 #define MM_OPSYS 32 /* Condition detected by operating system. */ 5251 #define MM_FIRM 4 /* Source of the condition is firmware.*/ 5252 #define MM_CONSOLE 512 /* Display message on system console. */ 5253 #define MM_RECOVER 64 /* Recoverable error. */ 5254 #define MM_APPL 8 /* Condition detected by application. */ 5255 5256 #define MM_NOSEV 0 /* No severity level provided for the message. */ 5257 #define MM_HALT 1 /* Error causing application to halt. */ 5258 #define MM_ERROR 2 /* Application has encountered a non-fatal fault. */ 5259 #define MM_WARNING 3 /* Application has detected unusual non-error condition. */ 5260 #define MM_INFO 4 /* Informative message. */ 5261 5262 #define MM_NULLACT ((char *) 0) 5263 #define MM_NULLLBL ((char *) 0) 5264 #define MM_NULLTAG ((char *) 0) 5265 #define MM_NULLTXT ((char *) 0) 5266 #define MM_NULLMC ((long int) 0) 5267 #define MM_NULLSEV 0 5268 5269 #define MM_NOTOK -1 /* The function failed completely. */ 5270 #define MM_OK 0 /* The function succeeded. */ 5271 #define MM_NOMSG 1 /* The function was unable to generate a message on standard error, but otherwise succeeded. */ 5272 #define MM_NOCON 4 /* The function was unable to generate a console message, but otherwise succeeded. */ 5273 5274 extern int fmtmsg(long int __classification, const char *__label, 5275 int __severity, const char *__text, const char *__action, 5276 const char *__tag); 5277 __________________________________________________________ 5278 5279 12.4.13. fnmatch.h 5280 5281 #define FNM_PATHNAME (1<<0) 5282 #define FNM_NOESCAPE (1<<1) 5283 #define FNM_PERIOD (1<<2) 5284 #define FNM_NOMATCH 1 5285 5286 extern int fnmatch(const char *__pattern, const char *__name, int __flags); 5287 __________________________________________________________ 5288 5289 12.4.14. ftw.h 5290 5291 #define FTW_D FTW_D 5292 #define FTW_DNR FTW_DNR 5293 #define FTW_DP FTW_DP 5294 #define FTW_F FTW_F 5295 #define FTW_NS FTW_NS 5296 #define FTW_SL FTW_SL 5297 #define FTW_SLN FTW_SLN 5298 5299 enum { 5300 FTW_F, 5301 FTW_D, 5302 FTW_DNR, 5303 FTW_NS, 5304 FTW_SL, 5305 FTW_DP, 5306 FTW_SLN 5307 }; 5308 5309 enum { 5310 FTW_PHYS = 1, 5311 FTW_MOUNT = 2, 5312 FTW_CHDIR = 4, 5313 FTW_DEPTH = 8 5314 }; 5315 5316 struct FTW { 5317 int base; 5318 int level; 5319 }; 5320 5321 typedef int (*__ftw_func_t) (const char *__filename, 5322 const struct stat * __status, int __flag); 5323 typedef int (*__ftw64_func_t) (const char *__filename, 5324 const struct stat64 * __status, int __flag); 5325 typedef int (*__nftw_func_t) (const char *__filename, 5326 const struct stat * __status, int __flag, 5327 struct FTW * __info); 5328 typedef int (*__nftw64_func_t) (const char *__filename, 5329 const struct stat64 * __status, int __flag, 5330 struct FTW * __info); 5331 extern int ftw(const char *__dir, __ftw_func_t __func, int __descriptors); 5332 extern int ftw64(const char *__dir, __ftw64_func_t __func, 5333 int __descriptors); 5334 extern int nftw(const char *__dir, __nftw_func_t __func, int __descriptors, 5335 int __flag); 5336 extern int nftw64(const char *__dir, __nftw64_func_t __func, 5337 int __descriptors, int __flag); 5338 __________________________________________________________ 5339 5340 12.4.15. getopt.h 5341 5342 #define no_argument 0 5343 #define required_argument 1 5344 #define optional_argument 2 5345 5346 struct option { 5347 const char *name; 5348 int has_arg; 5349 int *flag; 5350 int val; 5351 }; 5352 extern int getopt_long(int ___argc, char *const ___argv[], 5353 const char *__shortopts, 5354 const struct option *__longopts, int *__longind); 5355 extern int getopt_long_only(int ___argc, char *const ___argv[], 5356 const char *__shortopts, 5357 const struct option *__longopts, 5358 int *__longind); 5359 __________________________________________________________ 5360 5361 12.4.16. glob.h 5362 5363 #define GLOB_ERR (1<<0) 5364 #define GLOB_MARK (1<<1) 5365 #define GLOB_BRACE (1<<10) 5366 #define GLOB_NOMAGIC (1<<11) 5367 #define GLOB_TILDE (1<<12) 5368 #define GLOB_ONLYDIR (1<<13) 5369 #define GLOB_TILDE_CHECK (1<<14) 5370 #define GLOB_NOSORT (1<<2) 5371 #define GLOB_DOOFFS (1<<3) 5372 #define GLOB_NOCHECK (1<<4) 5373 #define GLOB_APPEND (1<<5) 5374 #define GLOB_NOESCAPE (1<<6) 5375 #define GLOB_PERIOD (1<<7) 5376 #define GLOB_MAGCHAR (1<<8) 5377 #define GLOB_ALTDIRFUNC (1<<9) 5378 5379 #define GLOB_NOSPACE 1 5380 #define GLOB_ABORTED 2 5381 #define GLOB_NOMATCH 3 5382 #define GLOB_NOSYS 4 5383 5384 typedef struct { 5385 size_t gl_pathc; 5386 char **gl_pathv; 5387 size_t gl_offs; 5388 int gl_flags; 5389 void (*gl_closedir) (void *); 5390 struct dirent *(*gl_readdir) (void *); 5391 void *(*gl_opendir) (const char *); 5392 int (*gl_lstat) (const char *, struct stat *); 5393 int (*gl_stat) (const char *, struct stat *); 5394 } glob_t; 5395 5396 typedef struct { 5397 size_t gl_pathc; 5398 char **gl_pathv; 5399 size_t gl_offs; 5400 int gl_flags; 5401 void (*gl_closedir) (void *); 5402 struct dirent64 *(*gl_readdir) (void *); 5403 void *(*gl_opendir) (const char *); 5404 int (*gl_lstat) (const char *, struct stat *); 5405 int (*gl_stat) (const char *, struct stat *); 5406 } glob64_t; 5407 extern int glob(const char *__pattern, int __flags, 5408 int (*__errfunc) (const char *, int), glob_t * __pglob); 5409 extern int glob64(const char *__pattern, int __flags, 5410 int (*__errfunc) (const char *, int), 5411 glob64_t * __pglob); 5412 extern void globfree(glob_t * __pglob); 5413 extern void globfree64(glob64_t * __pglob); 5414 __________________________________________________________ 5415 5416 12.4.17. gnu/libc-version.h 5417 5418 extern const char *gnu_get_libc_release(void); 5419 extern const char *gnu_get_libc_version(void); 5420 __________________________________________________________ 5421 5422 12.4.18. grp.h 5423 5424 struct group { 5425 char *gr_name; 5426 char *gr_passwd; 5427 gid_t gr_gid; 5428 char **gr_mem; 5429 }; 5430 5431 extern void endgrent(void); 5432 extern struct group *getgrent(void); 5433 extern int getgrent_r(struct group *__resultbuf, char *__buffer, 5434 size_t __buflen, struct group **__result); 5435 extern struct group *getgrgid(gid_t __gid); 5436 extern int getgrgid_r(gid_t __gid, struct group *__resultbuf, 5437 char *__buffer, size_t __buflen, 5438 struct group **__result); 5439 extern struct group *getgrnam(const char *__name); 5440 extern int getgrnam_r(const char *__name, struct group *__resultbuf, 5441 char *__buffer, size_t __buflen, 5442 struct group **__result); 5443 extern int getgrouplist(const char *__user, gid_t __group, 5444 gid_t * __groups, int *__ngroups); 5445 extern int initgroups(const char *__user, gid_t __group); 5446 extern void setgrent(void); 5447 extern int setgroups(size_t __n, const gid_t * __groups); 5448 __________________________________________________________ 5449 5450 12.4.19. iconv.h 5451 5452 typedef void *iconv_t; 5453 extern size_t iconv(iconv_t __cd, char **__inbuf, size_t * __inbytesleft, 5454 char **__outbuf, size_t * __outbytesleft); 5455 extern int iconv_close(iconv_t __cd); 5456 extern iconv_t iconv_open(const char *__tocode, const char *__fromcode); 5457 __________________________________________________________ 5458 5459 12.4.20. inttypes.h 5460 5461 typedef lldiv_t imaxdiv_t; 5462 5463 #define __PDP_ENDIAN 3412 5464 #define PDP_ENDIAN __PDP_ENDIAN 5465 5466 extern intmax_t imaxabs(intmax_t __n); 5467 extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom); 5468 extern intmax_t strtoimax(const char *__nptr, char **__endptr, int __base); 5469 extern uintmax_t strtoumax(const char *__nptr, char **__endptr, 5470 int __base); 5471 extern intmax_t wcstoimax(const wchar_t * __nptr, wchar_t * *__endptr, 5472 int __base); 5473 extern uintmax_t wcstoumax(const wchar_t * __nptr, wchar_t * *__endptr, 5474 int __base); 5475 __________________________________________________________ 5476 5477 12.4.21. langinfo.h 5478 5479 #define ABDAY_1 0x20000 /* Sun. */ 5480 #define ABDAY_2 0x20001 5481 #define ABDAY_3 0x20002 5482 #define ABDAY_4 0x20003 5483 #define ABDAY_5 0x20004 5484 #define ABDAY_6 0x20005 5485 #define ABDAY_7 0x20006 5486 5487 #define DAY_1 0x20007 5488 #define DAY_2 0x20008 5489 #define DAY_3 0x20009 5490 #define DAY_4 0x2000A 5491 #define DAY_5 0x2000B 5492 #define DAY_6 0x2000C 5493 #define DAY_7 0x2000D 5494 5495 #define ABMON_1 0x2000E 5496 #define ABMON_2 0x2000F 5497 #define ABMON_3 0x20010 5498 #define ABMON_4 0x20011 5499 #define ABMON_5 0x20012 5500 #define ABMON_6 0x20013 5501 #define ABMON_7 0x20014 5502 #define ABMON_8 0x20015 5503 #define ABMON_9 0x20016 5504 #define ABMON_10 0x20017 5505 #define ABMON_11 0x20018 5506 #define ABMON_12 0x20019 5507 5508 #define MON_1 0x2001A 5509 #define MON_2 0x2001B 5510 #define MON_3 0x2001C 5511 #define MON_4 0x2001D 5512 #define MON_5 0x2001E 5513 #define MON_6 0x2001F 5514 #define MON_7 0x20020 5515 #define MON_8 0x20021 5516 #define MON_9 0x20022 5517 #define MON_10 0x20023 5518 #define MON_11 0x20024 5519 #define MON_12 0x20025 5520 5521 #define AM_STR 0x20026 5522 #define PM_STR 0x20027 5523 5524 #define D_T_FMT 0x20028 5525 #define D_FMT 0x20029 5526 #define T_FMT 0x2002A 5527 #define T_FMT_AMPM 0x2002B 5528 5529 #define ERA 0x2002C 5530 #define ERA_D_FMT 0x2002E 5531 #define ALT_DIGITS 0x2002F 5532 #define ERA_D_T_FMT 0x20030 5533 #define ERA_T_FMT 0x20031 5534 5535 #define CODESET 14 5536 5537 #define CRNCYSTR 0x4000F 5538 5539 #define RADIXCHAR 0x10000 5540 #define THOUSEP 0x10001 5541 #define YESEXPR 0x50000 5542 #define NOEXPR 0x50001 5543 #define YESSTR 0x50002 5544 #define NOSTR 0x50003 5545 5546 extern char *nl_langinfo(nl_item __item); 5547 __________________________________________________________ 5548 5549 12.4.22. libgen.h 5550 5551 #define basename __xpg_basename 5552 5553 extern char *__xpg_basename(char *__path); 5554 extern char *dirname(char *__path); 5555 __________________________________________________________ 5556 5557 12.4.23. libintl.h 5558 5559 extern char *bind_textdomain_codeset(const char *__domainname, 5560 const char *__codeset); 5561 extern char *bindtextdomain(const char *__domainname, 5562 const char *__dirname); 5563 extern char *dcgettext(const char *__domainname, const char *__msgid, 5564 int __category); 5565 extern char *dcngettext(const char *__domainname, const char *__msgid1, 5566 const char *__msgid2, unsigned long int __n, 5567 int __category); 5568 extern char *dgettext(const char *__domainname, const char *__msgid); 5569 extern char *dngettext(const char *__domainname, const char *__msgid1, 5570 const char *__msgid2, unsigned long int __n); 5571 extern char *gettext(const char *__msgid); 5572 extern char *ngettext(const char *__msgid1, const char *__msgid2, 5573 unsigned long int __n); 5574 extern char *textdomain(const char *__domainname); 5575 __________________________________________________________ 5576 5577 12.4.24. limits.h 5578 5579 #define LLONG_MIN (-LLONG_MAX-1LL) 5580 #define _POSIX_AIO_MAX 1 5581 #define _POSIX_QLIMIT 1 5582 #define _POSIX2_BC_STRING_MAX 1000 5583 #define _POSIX2_CHARCLASS_NAME_MAX 14 5584 #define _POSIX_NAME_MAX 14 5585 #define _POSIX_UIO_MAXIOV 16 5586 #define ULLONG_MAX 18446744073709551615ULL 5587 #define _POSIX2_COLL_WEIGHTS_MAX 2 5588 #define _POSIX_AIO_LISTIO_MAX 2 5589 #define _POSIX_OPEN_MAX 20 5590 #define _POSIX_CLOCKRES_MIN 20000000 5591 #define CHARCLASS_NAME_MAX 2048 5592 #define LINE_MAX 2048 5593 #define _POSIX2_BC_DIM_MAX 2048 5594 #define _POSIX2_LINE_MAX 2048 5595 #define _POSIX_CHILD_MAX 25 5596 #define COLL_WEIGHTS_MAX 255 5597 #define _POSIX2_RE_DUP_MAX 255 5598 #define _POSIX_HOST_NAME_MAX 255 5599 #define _POSIX_MAX_CANON 255 5600 #define _POSIX_MAX_INPUT 255 5601 #define _POSIX_RE_DUP_MAX 255 5602 #define _POSIX_SYMLINK_MAX 255 5603 #define _POSIX_PATH_MAX 256 5604 #define _POSIX_SEM_NSEMS_MAX 256 5605 #define NGROUPS_MAX 32 5606 #define _POSIX2_EXPR_NEST_MAX 32 5607 #define _POSIX_DELAYTIMER_MAX 32 5608 #define _POSIX_MQ_PRIO_MAX 32 5609 #define _POSIX_SIGQUEUE_MAX 32 5610 #define _POSIX_TIMER_MAX 32 5611 #define _POSIX_SEM_VALUE_MAX 32767 5612 #define _POSIX_SSIZE_MAX 32767 5613 #define PATH_MAX 4096 5614 #define _POSIX_ARG_MAX 4096 5615 #define _POSIX_PIPE_BUF 512 5616 #define _POSIX_TZNAME_MAX 6 5617 #define _POSIX_LINK_MAX 8 5618 #define _POSIX_MQ_OPEN_MAX 8 5619 #define _POSIX_NGROUPS_MAX 8 5620 #define _POSIX_RTSIG_MAX 8 5621 #define _POSIX_STREAM_MAX 8 5622 #define _POSIX_SYMLOOP_MAX 8 5623 #define _POSIX_LOGIN_NAME_MAX 9 5624 #define _POSIX_TTY_NAME_MAX 9 5625 #define LLONG_MAX 9223372036854775807LL 5626 #define _POSIX2_BC_BASE_MAX 99 5627 #define _POSIX2_BC_SCALE_MAX 99 5628 #define SSIZE_MAX LONG_MAX /* Maximum value of an object of type ssize_t */ 5629 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX 5630 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX 5631 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX 5632 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX 5633 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX 5634 #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX 5635 #define _POSIX_HIWAT _POSIX_PIPE_BUF 5636 5637 #define MB_LEN_MAX 16 5638 5639 #define SCHAR_MIN (-128) 5640 #define SCHAR_MAX 127 5641 #define UCHAR_MAX 255 5642 #define CHAR_BIT 8 5643 5644 #define SHRT_MIN (-32768) 5645 #define SHRT_MAX 32767 5646 #define USHRT_MAX 65535 5647 5648 #define INT_MIN (-INT_MAX-1) 5649 #define INT_MAX 2147483647 5650 #define UINT_MAX 4294967295U 5651 5652 #define LONG_MIN (-LONG_MAX-1L) 5653 5654 #define PTHREAD_KEYS_MAX 1024 5655 #define PTHREAD_THREADS_MAX 16384 5656 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 5657 __________________________________________________________ 5658 5659 12.4.25. link.h 5660 5661 extern int 5662 dl_iterate_phdr(int (*callback) (struct dl_phdr_info *, size_t, void *), 5663 void *data); 5664 __________________________________________________________ 5665 5666 12.4.26. locale.h 5667 5668 struct lconv { 5669 char *decimal_point; 5670 char *thousands_sep; 5671 char *grouping; 5672 char *int_curr_symbol; 5673 char *currency_symbol; 5674 char *mon_decimal_point; 5675 char *mon_thousands_sep; 5676 char *mon_grouping; 5677 char *positive_sign; 5678 char *negative_sign; 5679 char int_frac_digits; 5680 char frac_digits; 5681 char p_cs_precedes; 5682 char p_sep_by_space; 5683 char n_cs_precedes; 5684 char n_sep_by_space; 5685 char p_sign_posn; 5686 char n_sign_posn; 5687 char int_p_cs_precedes; 5688 char int_p_sep_by_space; 5689 char int_n_cs_precedes; 5690 char int_n_sep_by_space; 5691 char int_p_sign_posn; 5692 char int_n_sign_posn; 5693 }; 5694 5695 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 5696 #define LC_CTYPE 0 5697 #define LC_NUMERIC 1 5698 #define LC_TELEPHONE 10 5699 #define LC_MEASUREMENT 11 5700 #define LC_IDENTIFICATION 12 5701 #define LC_TIME 2 5702 #define LC_COLLATE 3 5703 #define LC_MONETARY 4 5704 #define LC_MESSAGES 5 5705 #define LC_ALL 6 5706 #define LC_PAPER 7 5707 #define LC_NAME 8 5708 #define LC_ADDRESS 9 5709 5710 struct __locale_struct { 5711 struct locale_data *__locales[13]; 5712 const unsigned short *__ctype_b; 5713 const int *__ctype_tolower; 5714 const int *__ctype_toupper; 5715 const char *__names[13]; 5716 }; 5717 typedef struct __locale_struct *__locale_t; 5718 5719 typedef struct __locale_struct *locale_t; 5720 5721 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 5722 #define LC_COLLATE_MASK (1 << LC_COLLATE) 5723 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 5724 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 5725 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 5726 #define LC_MONETARY_MASK (1 << LC_MONETARY) 5727 #define LC_NAME_MASK (1 << LC_NAME) 5728 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 5729 #define LC_PAPER_MASK (1 << LC_PAPER) 5730 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 5731 #define LC_TIME_MASK (1 << LC_TIME) 5732 #define LC_CTYPE_MASK (1<icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) 5966 #define ICMP6_FILTER_WILLPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) 5967 #define ICMP6_FILTER_SETPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))) 5968 #define ICMP6_FILTER_SETBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))) 5969 #define ICMP6_DST_UNREACH_NOROUTE 0 5970 #define ICMP6_PARAMPROB_HEADER 0 5971 #define ICMP6_TIME_EXCEED_TRANSIT 0 5972 #define ICMP6_RR_FLAGS_PREVDONE 0x08 5973 #define ICMP6_RR_FLAGS_SPECSITE 0x10 5974 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10 5975 #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 5976 #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20 5977 #define ND_OPT_PI_FLAG_RADDR 0x20 5978 #define ND_RA_FLAG_HOME_AGENT 0x20 5979 #define ICMP6_RR_FLAGS_REQRESULT 0x40 5980 #define ND_OPT_PI_FLAG_AUTO 0x40 5981 #define ND_RA_FLAG_OTHER 0x40 5982 #define ICMP6_INFOMSG_MASK 0x80 5983 #define ICMP6_RR_FLAGS_TEST 0x80 5984 #define ND_OPT_PI_FLAG_ONLINK 0x80 5985 #define ND_RA_FLAG_MANAGED 0x80 5986 #define ICMP6_DST_UNREACH 1 5987 #define ICMP6_DST_UNREACH_ADMIN 1 5988 #define ICMP6_FILTER 1 5989 #define ICMP6_FILTER_BLOCK 1 5990 #define ICMP6_PARAMPROB_NEXTHEADER 1 5991 #define ICMP6_TIME_EXCEED_REASSEMBLY 1 5992 #define ND_OPT_SOURCE_LINKADDR 1 5993 #define RPM_PCO_ADD 1 5994 #define ICMP6_ECHO_REQUEST 128 5995 #define ICMP6_ECHO_REPLY 129 5996 #define MLD_LISTENER_QUERY 130 5997 #define MLD_LISTENER_REPORT 131 5998 #define MLD_LISTENER_REDUCTION 132 5999 #define ND_ROUTER_SOLICIT 133 6000 #define ND_ROUTER_ADVERT 134 6001 #define ND_NEIGHBOR_SOLICIT 135 6002 #define ND_NEIGHBOR_ADVERT 136 6003 #define ND_REDIRECT 137 6004 #define ICMP6_ROUTER_RENUMBERING 138 6005 #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 6006 #define ICMP6_FILTER_PASS 2 6007 #define ICMP6_PACKET_TOO_BIG 2 6008 #define ICMP6_PARAMPROB_OPTION 2 6009 #define ND_OPT_TARGET_LINKADDR 2 6010 #define RPM_PCO_CHANGE 2 6011 #define ICMP6_DST_UNREACH_ADDR 3 6012 #define ICMP6_FILTER_BLOCKOTHERS 3 6013 #define ICMP6_TIME_EXCEEDED 3 6014 #define ND_OPT_PREFIX_INFORMATION 3 6015 #define RPM_PCO_SETGLOBAL 3 6016 #define ICMP6_DST_UNREACH_NOPORT 4 6017 #define ICMP6_FILTER_PASSONLY 4 6018 #define ICMP6_PARAM_PROB 4 6019 #define ND_OPT_REDIRECTED_HEADER 4 6020 #define ND_OPT_MTU 5 6021 #define ND_OPT_RTR_ADV_INTERVAL 7 6022 #define ND_OPT_HOME_AGENT_INFO 8 6023 #define icmp6_id icmp6_data16[0] 6024 #define icmp6_maxdelay icmp6_data16[0] 6025 #define icmp6_seq icmp6_data16[1] 6026 #define icmp6_mtu icmp6_data32[0] 6027 #define icmp6_pptr icmp6_data32[0] 6028 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 6029 #define icmp6_data32 icmp6_dataun.icmp6_un_data32 6030 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 6031 #define ICMP6_FILTER_SETPASSALL(filterp) memset (filterp, 0, sizeof (struct icmp6_filter)); 6032 #define ICMP6_FILTER_SETBLOCKALL(filterp) memset (filterp, 0xFF, sizeof (struct icmp6_filter)); 6033 #define mld_cksum mld_icmp6_hdr.icmp6_cksum 6034 #define mld_code mld_icmp6_hdr.icmp6_code 6035 #define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0] 6036 #define mld_reserved mld_icmp6_hdr.icmp6_data16[1] 6037 #define mld_type mld_icmp6_hdr.icmp6_type 6038 #define nd_na_cksum nd_na_hdr.icmp6_cksum 6039 #define nd_na_code nd_na_hdr.icmp6_code 6040 #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] 6041 #define nd_na_type nd_na_hdr.icmp6_type 6042 #define nd_ns_cksum nd_ns_hdr.icmp6_cksum 6043 #define nd_ns_code nd_ns_hdr.icmp6_code 6044 #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] 6045 #define nd_ns_type nd_ns_hdr.icmp6_type 6046 #define nd_ra_cksum nd_ra_hdr.icmp6_cksum 6047 #define nd_ra_code nd_ra_hdr.icmp6_code 6048 #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] 6049 #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] 6050 #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] 6051 #define nd_ra_type nd_ra_hdr.icmp6_type 6052 #define nd_rd_cksum nd_rd_hdr.icmp6_cksum 6053 #define nd_rd_code nd_rd_hdr.icmp6_code 6054 #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] 6055 #define nd_rd_type nd_rd_hdr.icmp6_type 6056 #define nd_rs_cksum nd_rs_hdr.icmp6_cksum 6057 #define nd_rs_code nd_rs_hdr.icmp6_code 6058 #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] 6059 #define nd_rs_type nd_rs_hdr.icmp6_type 6060 #define rr_cksum rr_hdr.icmp6_cksum 6061 #define rr_code rr_hdr.icmp6_code 6062 #define rr_seqnum rr_hdr.icmp6_data32[0] 6063 #define rr_type rr_hdr.icmp6_type 6064 6065 struct icmp6_filter { 6066 uint32_t icmp6_filt[8]; 6067 }; 6068 struct icmp6_hdr { 6069 uint8_t icmp6_type; 6070 uint8_t icmp6_code; 6071 uint16_t icmp6_cksum; 6072 union { 6073 uint32_t icmp6_un_data32[1]; 6074 uint16_t icmp6_un_data16[2]; 6075 uint8_t icmp6_un_data8[4]; 6076 } icmp6_dataun; 6077 }; 6078 struct nd_router_solicit { 6079 struct icmp6_hdr nd_rs_hdr; 6080 }; 6081 struct nd_router_advert { 6082 struct icmp6_hdr nd_ra_hdr; 6083 uint32_t nd_ra_reachable; 6084 uint32_t nd_ra_retransmit; 6085 }; 6086 struct nd_neighbor_solicit { 6087 struct icmp6_hdr nd_ns_hdr; 6088 struct in6_addr nd_ns_target; 6089 }; 6090 struct nd_neighbor_advert { 6091 struct icmp6_hdr nd_na_hdr; 6092 struct in6_addr nd_na_target; 6093 }; 6094 struct nd_redirect { 6095 struct icmp6_hdr nd_rd_hdr; 6096 struct in6_addr nd_rd_target; 6097 struct in6_addr nd_rd_dst; 6098 }; 6099 struct nd_opt_hdr { 6100 uint8_t nd_opt_type; 6101 uint8_t nd_opt_len; 6102 }; 6103 struct nd_opt_prefix_info { 6104 uint8_t nd_opt_pi_type; 6105 uint8_t nd_opt_pi_len; 6106 uint8_t nd_opt_pi_prefix_len; 6107 uint8_t nd_opt_pi_flags_reserved; 6108 uint32_t nd_opt_pi_valid_time; 6109 uint32_t nd_opt_pi_preferred_time; 6110 uint32_t nd_opt_pi_reserved2; 6111 struct in6_addr nd_opt_pi_prefix; 6112 }; 6113 struct nd_opt_rd_hdr { 6114 uint8_t nd_opt_rh_type; 6115 uint8_t nd_opt_rh_len; 6116 uint16_t nd_opt_rh_reserved1; 6117 uint32_t nd_opt_rh_reserved2; 6118 }; 6119 struct nd_opt_mtu { 6120 uint8_t nd_opt_mtu_type; 6121 uint8_t nd_opt_mtu_len; 6122 uint16_t nd_opt_mtu_reserved; 6123 uint32_t nd_opt_mtu_mtu; 6124 }; 6125 struct mld_hdr { 6126 struct icmp6_hdr mld_icmp6_hdr; 6127 struct in6_addr mld_addr; 6128 }; 6129 struct icmp6_router_renum { 6130 struct icmp6_hdr rr_hdr; 6131 uint8_t rr_segnum; 6132 uint8_t rr_flags; 6133 uint16_t rr_maxdelay; 6134 uint32_t rr_reserved; 6135 }; 6136 struct rr_pco_match { 6137 uint8_t rpm_code; 6138 uint8_t rpm_len; 6139 uint8_t rpm_ordinal; 6140 uint8_t rpm_matchlen; 6141 uint8_t rpm_minlen; 6142 uint8_t rpm_maxlen; 6143 uint16_t rpm_reserved; 6144 struct in6_addr rpm_prefix; 6145 }; 6146 struct rr_pco_use { 6147 uint8_t rpu_uselen; 6148 uint8_t rpu_keeplen; 6149 uint8_t rpu_ramask; 6150 uint8_t rpu_raflags; 6151 uint32_t rpu_vltime; 6152 uint32_t rpu_pltime; 6153 uint32_t rpu_flags; 6154 struct in6_addr rpu_prefix; 6155 }; 6156 struct rr_result { 6157 uint16_t rrr_flags; 6158 uint8_t rrr_ordinal; 6159 uint8_t rrr_matchedlen; 6160 uint32_t rrr_ifid; 6161 struct in6_addr rrr_prefix; 6162 }; 6163 struct nd_opt_adv_interval { 6164 uint8_t nd_opt_adv_interval_type; 6165 uint8_t nd_opt_adv_interval_len; 6166 uint16_t nd_opt_adv_interval_reserved; 6167 uint32_t nd_opt_adv_interval_ival; 6168 }; 6169 struct nd_opt_home_agent_info { 6170 uint8_t nd_opt_home_agent_info_type; 6171 uint8_t nd_opt_home_agent_info_len; 6172 uint16_t nd_opt_home_agent_info_reserved; 6173 int16_t nd_opt_home_agent_info_preference; 6174 uint16_t nd_opt_home_agent_info_lifetime; 6175 }; 6176 __________________________________________________________ 6177 6178 12.4.31. netinet/igmp.h 6179 6180 #define IGMP_MEMBERSHIP_QUERY 0x11 6181 #define IGMP_V1_MEMBERSHIP_REPORT 0x12 6182 #define IGMP_DVMRP 0x13 6183 #define IGMP_PIM 0x14 6184 #define IGMP_TRACE 0x15 6185 #define IGMP_V2_MEMBERSHIP_REPORT 0x16 6186 #define IGMP_V2_LEAVE_GROUP 0x17 6187 #define IGMP_MTRACE_RESP 0x1e 6188 #define IGMP_MTRACE 0x1f 6189 #define IGMP_DELAYING_MEMBER 1 6190 #define IGMP_v1_ROUTER 1 6191 #define IGMP_MAX_HOST_REPORT_DELAY 10 6192 #define IGMP_TIMER_SCALE 10 6193 #define IGMP_IDLE_MEMBER 2 6194 #define IGMP_v2_ROUTER 2 6195 #define IGMP_LAZY_MEMBER 3 6196 #define IGMP_SLEEPING_MEMBER 4 6197 #define IGMP_AWAKENING_MEMBER 5 6198 #define IGMP_MINLEN 8 6199 #define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY 6200 #define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT 6201 #define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP 6202 #define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT 6203 6204 struct igmp { 6205 u_int8_t igmp_type; 6206 u_int8_t igmp_code; 6207 u_int16_t igmp_cksum; 6208 struct in_addr igmp_group; 6209 }; 6210 __________________________________________________________ 6211 6212 12.4.32. netinet/in.h 6213 6214 #define IPPROTO_IP 0 6215 #define IPPROTO_ICMP 1 6216 #define IPPROTO_UDP 17 6217 #define IPPROTO_IGMP 2 6218 #define IPPROTO_RAW 255 6219 #define IPPROTO_IPV6 41 6220 #define IPPROTO_ICMPV6 58 6221 #define IPPROTO_TCP 6 6222 6223 typedef uint16_t in_port_t; 6224 6225 struct in_addr { 6226 uint32_t s_addr; 6227 }; 6228 typedef uint32_t in_addr_t; 6229 6230 #define INADDR_NONE ((in_addr_t) 0xffffffff) 6231 #define INADDR_BROADCAST (0xffffffff) 6232 #define INADDR_ANY 0 6233 #define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */ 6234 6235 #define s6_addr16 in6_u.u6_addr16 6236 #define s6_addr32 in6_u.u6_addr32 6237 #define s6_addr in6_u.u6_addr8 6238 6239 struct in6_addr { 6240 union { 6241 uint8_t u6_addr8[16]; 6242 uint16_t u6_addr16[8]; 6243 uint32_t u6_addr32[4]; 6244 } in6_u; 6245 }; 6246 6247 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }} } 6248 #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }} } 6249 6250 #define IN_MULTICAST(a) ((((in_addr_t)(a))&0xf0000000)==0xe0000000) 6251 #define INET_ADDRSTRLEN 16 6252 6253 struct sockaddr_in { 6254 sa_family_t sin_family; 6255 unsigned short sin_port; 6256 struct in_addr sin_addr; 6257 unsigned char sin_zero[8]; 6258 }; 6259 6260 #define IN6_IS_ADDR_LINKLOCAL(a) ((((const uint32_t *) (a))[0] &htonl (0xffc00000)) == htonl (0xfe800000)) 6261 #define IN6_IS_ADDR_SITELOCAL(a) ((((const uint32_t *) (a))[0] &htonl (0xffc00000)) == htonl (0xfec00000)) 6262 #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])) 6263 #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)) 6264 #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))) 6265 #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) 6266 #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)) 6267 #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) 6268 #define IN6_IS_ADDR_MC_NODELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x1)) 6269 #define IN6_IS_ADDR_MC_LINKLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x2)) 6270 #define IN6_IS_ADDR_MC_SITELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x5)) 6271 #define IN6_IS_ADDR_MC_ORGLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0x8)) 6272 #define IN6_IS_ADDR_MC_GLOBAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((const uint8_t *) (a))[1] & 0xf) == 0xe)) 6273 #define INET6_ADDRSTRLEN 46 6274 6275 struct sockaddr_in6 { 6276 unsigned short sin6_family; /* AF_INET6 */ 6277 uint16_t sin6_port; /* Transport layer port # */ 6278 uint32_t sin6_flowinfo; /* IPv6 flow information */ 6279 struct in6_addr sin6_addr; /* IPv6 address */ 6280 uint32_t sin6_scope_id; /* scope id (new in RFC2553) */ 6281 }; 6282 6283 #define SOL_IP 0 6284 #define IP_TOS 1 /* IP type of service and precedence */ 6285 #define IPV6_UNICAST_HOPS 16 6286 #define IPV6_MULTICAST_IF 17 6287 #define IPV6_MULTICAST_HOPS 18 6288 #define IPV6_MULTICAST_LOOP 19 6289 #define IP_TTL 2 /* IP time to live */ 6290 #define IPV6_JOIN_GROUP 20 6291 #define IPV6_LEAVE_GROUP 21 6292 #define IPV6_V6ONLY 26 6293 #define IP_MULTICAST_IF 32 /* set/get IP multicast i/f */ 6294 #define IP_MULTICAST_TTL 33 /* set/get IP multicast ttl */ 6295 #define IP_MULTICAST_LOOP 34 /* set/get IP multicast loopback */ 6296 #define IP_ADD_MEMBERSHIP 35 /* add an IP group membership */ 6297 #define IP_DROP_MEMBERSHIP 36 /* drop an IP group membership */ 6298 #define IP_OPTIONS 4 /* IP per-packet options */ 6299 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP 6300 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP 6301 6302 struct ipv6_mreq { 6303 struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address of group */ 6304 int ipv6mr_interface; /* local IPv6 address of interface */ 6305 }; 6306 struct ip_mreq { 6307 struct in_addr imr_multiaddr; /* IP multicast address of group */ 6308 struct in_addr imr_interface; /* local IP address of interface */ 6309 }; 6310 extern int bindresvport(int, struct sockaddr_in *); 6311 extern const struct in6_addr in6addr_any; 6312 extern const struct in6_addr in6addr_loopback; 6313 __________________________________________________________ 6314 6315 12.4.33. netinet/in_systm.h 6316 6317 typedef u_int16_t n_short; 6318 typedef u_int32_t n_long; 6319 typedef u_int32_t n_time; 6320 __________________________________________________________ 6321 6322 12.4.34. netinet/ip.h 6323 6324 #define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK) 6325 #define IPOPT_COPIED(o) ((o) & IPOPT_COPY) 6326 #define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK) 6327 #define IPOPT_EOL 0 6328 #define IPOPT_OPTVAL 0 6329 #define IPOPT_TS_TSONLY 0 6330 #define IPOPT_CONTROL 0x00 6331 #define IPOPT_SECUR_UNCLASS 0x0000 6332 #define IPOPT_NUMBER_MASK 0x1f 6333 #define IP_OFFMASK 0x1fff 6334 #define IPOPT_RESERVED1 0x20 6335 #define IP_MF 0x2000 6336 #define IPOPT_DEBMEAS 0x40 6337 #define IP_DF 0x4000 6338 #define IPOPT_CLASS_MASK 0x60 6339 #define IPOPT_RESERVED2 0x60 6340 #define IPOPT_SECUR_TOPSECRET 0x6bc5 6341 #define IPOPT_SECUR_EFTO 0x789a 6342 #define IPOPT_COPY 0x80 6343 #define IP_RF 0x8000 6344 #define IPOPT_SECUR_RESTR 0xaf13 6345 #define IPOPT_SECUR_MMMM 0xbc4d 6346 #define IPOPT_SECUR_SECRET 0xd788 6347 #define IPOPT_SECUR_CONFID 0xf135 6348 #define IPOPT_NOP 1 6349 #define IPOPT_OLEN 1 6350 #define IPOPT_TS_TSANDADDR 1 6351 #define IPTTLDEC 1 6352 #define IPOPT_SECURITY 130 6353 #define IPOPT_LSRR 131 6354 #define IPOPT_SATID 136 6355 #define IPOPT_SSRR 137 6356 #define IPOPT_RA 148 6357 #define IPOPT_OFFSET 2 6358 #define MAXTTL 255 6359 #define IPOPT_TS_PRESPEC 3 6360 #define IPOPT_MINOFF 4 6361 #define IPVERSION 4 6362 #define MAX_IPOPTLEN 40 6363 #define IP_MSS 576 6364 #define IPFRAGTTL 60 6365 #define IPDEFTTL 64 6366 #define IP_MAXPACKET 65535 6367 #define IPOPT_TS 68 6368 #define IPOPT_RR 7 6369 #define IPOPT_MEASUREMENT IPOPT_DEBMEAS 6370 #define IPOPT_END IPOPT_EOL 6371 #define IPOPT_NOOP IPOPT_NOP 6372 #define IPOPT_SID IPOPT_SATID 6373 #define IPOPT_SEC IPOPT_SECURITY 6374 #define IPOPT_TIMESTAMP IPOPT_TS 6375 6376 #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) 6377 #define IPTOS_LOWCOST 0x02 6378 #define IPTOS_RELIABILITY 0x04 6379 #define IPTOS_THROUGHPUT 0x08 6380 #define IPTOS_LOWDELAY 0x10 6381 #define IPTOS_TOS_MASK 0x1e 6382 #define IPTOS_MINCOST IPTOS_LOWCOST 6383 6384 #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) 6385 #define IPTOS_PREC_MASK 0xe0 6386 __________________________________________________________ 6387 6388 12.4.35. netinet/ip6.h 6389 6390 #define IP6OPT_TYPE(o) ((o) & 0xc0) 6391 #define IP6OPT_PAD1 0 6392 #define IP6OPT_TYPE_SKIP 0x00 6393 #define IP6OPT_TUNNEL_LIMIT 0x04 6394 #define IP6OPT_ROUTER_ALERT 0x05 6395 #define IP6OPT_TYPE_MUTABLE 0x20 6396 #define IP6OPT_TYPE_DISCARD 0x40 6397 #define IP6OPT_TYPE_FORCEICMP 0x80 6398 #define IP6OPT_TYPE_ICMP 0xc0 6399 #define IP6OPT_JUMBO 0xc2 6400 #define IP6OPT_NSAP_ADDR 0xc3 6401 #define IP6OPT_PADN 1 6402 #define IP6OPT_JUMBO_LEN 6 6403 #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow 6404 #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim 6405 #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim 6406 #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt 6407 #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen 6408 #define ip6_vfc ip6_ctlun.ip6_un2_vfc 6409 6410 struct ip6_hdrctl { 6411 uint32_t ip6_un1_flow; 6412 uint16_t ip6_un1_plen; 6413 uint8_t ip6_un1_nxt; 6414 uint8_t ip6_un1_hlim; 6415 }; 6416 struct ip6_hdr { 6417 struct in6_addr ip6_src; 6418 struct in6_addr ip6_dst; 6419 }; 6420 struct ip6_ext { 6421 uint8_t ip6e_nxt; 6422 uint8_t ip6e_len; 6423 }; 6424 struct ip6_hbh { 6425 uint8_t ip6h_nxt; 6426 uint8_t ip6h_len; 6427 }; 6428 struct ip6_dest { 6429 uint8_t ip6d_nxt; 6430 uint8_t ip6d_len; 6431 }; 6432 struct ip6_rthdr { 6433 uint8_t ip6r_nxt; 6434 uint8_t ip6r_len; 6435 uint8_t ip6r_type; 6436 uint8_t ip6r_segleft; 6437 }; 6438 struct ip6_frag { 6439 uint8_t ip6f_nxt; 6440 uint8_t ip6f_reserved; 6441 uint16_t ip6f_offlg; 6442 uint32_t ip6f_ident; 6443 }; 6444 struct ip6_opt { 6445 uint8_t ip6o_type; 6446 uint8_t ip6o_len; 6447 }; 6448 struct ip6_opt_jumbo { 6449 uint8_t ip6oj_type; 6450 uint8_t ip6oj_len; 6451 uint8_t ip6oj_jumbo_len[4]; 6452 }; 6453 struct ip6_opt_nsap { 6454 uint8_t ip6on_type; 6455 uint8_t ip6on_len; 6456 uint8_t ip6on_src_nsap_len; 6457 uint8_t ip6on_dst_nsap_len; 6458 }; 6459 struct ip6_opt_tunnel { 6460 uint8_t ip6ot_type; 6461 uint8_t ip6ot_len; 6462 uint8_t ip6ot_encap_limit; 6463 }; 6464 struct ip6_opt_router { 6465 uint8_t ip6or_type; 6466 uint8_t ip6or_len; 6467 uint8_t ip6or_value[2]; 6468 }; 6469 __________________________________________________________ 6470 6471 12.4.36. netinet/ip_icmp.h 6472 6473 #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) 6474 #define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) 6475 #define ICMP_TSLEN (8 + 3 * sizeof (n_time)) 6476 #define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) 6477 #define ICMP_ECHOREPLY 0 6478 #define ICMP_EXC_TTL 0 6479 #define ICMP_NET_UNREACH 0 6480 #define ICMP_REDIRECT_NET 0 6481 #define ICMP_REDIR_NET 0 6482 #define ICMP_TIMXCEED_INTRANS 0 6483 #define ICMP_UNREACH_NET 0 6484 #define ICMP_EXC_FRAGTIME 1 6485 #define ICMP_HOST_UNREACH 1 6486 #define ICMP_PARAMPROB_OPTABSENT 1 6487 #define ICMP_REDIRECT_HOST 1 6488 #define ICMP_REDIR_HOST 1 6489 #define ICMP_TIMXCEED_REASS 1 6490 #define ICMP_UNREACH_HOST 1 6491 #define ICMP_HOST_ANO 10 6492 #define ICMP_ROUTERSOLICIT 10 6493 #define ICMP_UNREACH_HOST_PROHIB 10 6494 #define ICMP_NET_UNR_TOS 11 6495 #define ICMP_TIME_EXCEEDED 11 6496 #define ICMP_TIMXCEED 11 6497 #define ICMP_UNREACH_TOSNET 11 6498 #define ICMP_HOST_UNR_TOS 12 6499 #define ICMP_MASKLEN 12 6500 #define ICMP_PARAMETERPROB 12 6501 #define ICMP_PARAMPROB 12 6502 #define ICMP_UNREACH_TOSHOST 12 6503 #define ICMP_PKT_FILTERED 13 6504 #define ICMP_TIMESTAMP 13 6505 #define ICMP_TSTAMP 13 6506 #define ICMP_UNREACH_FILTER_PROHIB 13 6507 #define ICMP_PREC_VIOLATION 14 6508 #define ICMP_TIMESTAMPREPLY 14 6509 #define ICMP_TSTAMPREPLY 14 6510 #define ICMP_UNREACH_HOST_PRECEDENCE 14 6511 #define ICMP_INFO_REQUEST 15 6512 #define ICMP_IREQ 15 6513 #define ICMP_PREC_CUTOFF 15 6514 #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 6515 #define NR_ICMP_UNREACH 15 6516 #define ICMP_INFO_REPLY 16 6517 #define ICMP_IREQREPLY 16 6518 #define ICMP_ADDRESS 17 6519 #define ICMP_MASKREQ 17 6520 #define ICMP_ADDRESSREPLY 18 6521 #define ICMP_MASKREPLY 18 6522 #define ICMP_MAXTYPE 18 6523 #define NR_ICMP_TYPES 18 6524 #define ICMP_PROT_UNREACH 2 6525 #define ICMP_REDIRECT_TOSNET 2 6526 #define ICMP_REDIR_NETTOS 2 6527 #define ICMP_UNREACH_PROTOCOL 2 6528 #define ICMP_DEST_UNREACH 3 6529 #define ICMP_PORT_UNREACH 3 6530 #define ICMP_REDIRECT_TOSHOST 3 6531 #define ICMP_REDIR_HOSTTOS 3 6532 #define ICMP_UNREACH 3 6533 #define ICMP_UNREACH_PORT 3 6534 #define ICMP_FRAG_NEEDED 4 6535 #define ICMP_SOURCEQUENCH 4 6536 #define ICMP_SOURCE_QUENCH 4 6537 #define ICMP_UNREACH_NEEDFRAG 4 6538 #define ICMP_REDIRECT 5 6539 #define ICMP_SR_FAILED 5 6540 #define ICMP_UNREACH_SRCFAIL 5 6541 #define ICMP_NET_UNKNOWN 6 6542 #define ICMP_UNREACH_NET_UNKNOWN 6 6543 #define ICMP_HOST_UNKNOWN 7 6544 #define ICMP_UNREACH_HOST_UNKNOWN 7 6545 #define ICMP_ECHO 8 6546 #define ICMP_HOST_ISOLATED 8 6547 #define ICMP_MINLEN 8 6548 #define ICMP_UNREACH_ISOLATED 8 6549 #define ICMP_NET_ANO 9 6550 #define ICMP_ROUTERADVERT 9 6551 #define ICMP_UNREACH_NET_PROHIB 9 6552 #define icmp_data icmp_dun.id_data 6553 #define icmp_ip icmp_dun.id_ip.idi_ip 6554 #define icmp_mask icmp_dun.id_mask 6555 #define icmp_radv icmp_dun.id_radv 6556 #define icmp_otime icmp_dun.id_ts.its_otime 6557 #define icmp_rtime icmp_dun.id_ts.its_rtime 6558 #define icmp_ttime icmp_dun.id_ts.its_ttime 6559 #define icmp_gwaddr icmp_hun.ih_gwaddr 6560 #define icmp_id icmp_hun.ih_idseq.icd_id 6561 #define icmp_seq icmp_hun.ih_idseq.icd_seq 6562 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu 6563 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void 6564 #define icmp_pptr icmp_hun.ih_pptr 6565 #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime 6566 #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs 6567 #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa 6568 #define icmp_void icmp_hun.ih_void 6569 6570 struct icmphdr { 6571 u_int8_t type; 6572 u_int8_t code; 6573 u_int16_t checksum; 6574 union { 6575 struct { 6576 u_int16_t id; 6577 u_int16_t sequence; 6578 } echo; 6579 u_int32_t gateway; 6580 struct { 6581 u_int16_t __unused; 6582 u_int16_t mtu; 6583 } frag; 6584 } un; 6585 }; 6586 struct icmp_ra_addr { 6587 u_int32_t ira_addr; 6588 u_int32_t ira_preference; 6589 }; 6590 struct ih_idseq { 6591 u_int16_t icd_id; 6592 u_int16_t icd_seq; 6593 }; 6594 struct ih_pmtu { 6595 u_int16_t ipm_void; 6596 u_int16_t ipm_nextmtu; 6597 }; 6598 struct ih_rtradv { 6599 u_int8_t irt_num_addrs; 6600 u_int8_t irt_wpa; 6601 u_int16_t irt_lifetime; 6602 }; 6603 struct icmp { 6604 u_int8_t icmp_type; 6605 u_int8_t icmp_code; 6606 u_int16_t icmp_cksum; 6607 union { 6608 u_int16_t ih_pptr; 6609 struct in_addr ih_gwaddr; 6610 struct ih_idseq ih_idseq; 6611 u_int32_t ih_void; 6612 struct ih_pmtu ih_pmtu; 6613 struct ih_rtradv ih_rtradv; 6614 } icmp_hun; 6615 union { 6616 struct { 6617 u_int32_t its_otime; 6618 u_int32_t its_rtime; 6619 u_int32_t its_ttime; 6620 } id_ts; 6621 struct { 6622 struct ip idi_ip; 6623 } id_ip; 6624 struct icmp_ra_addr id_radv; 6625 u_int32_t id_mask; 6626 u_int8_t id_data[1]; 6627 } icmp_dun; 6628 }; 6629 __________________________________________________________ 6630 6631 12.4.37. netinet/tcp.h 6632 6633 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) 6634 #define TCPOPT_TSTAMP_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) 6635 #define TCPOPT_EOL 0 6636 #define TCPI_OPT_TIMESTAMPS 1 6637 #define TCPOPT_NOP 1 6638 #define TCP_NODELAY 1 6639 #define TCPOLEN_TIMESTAMP 10 6640 #define TCP_WINDOW_CLAMP 10 6641 #define TCP_INFO 11 6642 #define TCP_QUICKACK 12 6643 #define TCP_CONGESTION 13 6644 #define TCP_MAX_WINSHIFT 14 6645 #define TCPI_OPT_SACK 2 6646 #define TCPOLEN_SACK_PERMITTED 2 6647 #define TCPOPT_MAXSEG 2 6648 #define TCP_MAXSEG 2 6649 #define TCPOLEN_WINDOW 3 6650 #define TCPOPT_WINDOW 3 6651 #define TCP_CORK 3 6652 #define TCPI_OPT_WSCALE 4 6653 #define TCPOLEN_MAXSEG 4 6654 #define TCPOPT_SACK_PERMITTED 4 6655 #define TCP_KEEPIDLE 4 6656 #define TCPOPT_SACK 5 6657 #define TCP_KEEPINTVL 5 6658 #define TCP_MSS 512 6659 #define SOL_TCP 6 6660 #define TCP_KEEPCNT 6 6661 #define TCP_MAXWIN 65535 6662 #define TCP_SYNCNT 7 6663 #define TCPI_OPT_ECN 8 6664 #define TCPOPT_TIMESTAMP 8 6665 #define TCP_LINGER2 8 6666 #define TCP_DEFER_ACCEPT 9 6667 6668 enum tcp_ca_state { 6669 TCP_CA_Open, 6670 TCP_CA_Disorder, 6671 TCP_CA_CWR, 6672 TCP_CA_Recovery, 6673 TCP_CA_Loss 6674 }; 6675 struct tcp_info { 6676 uint8_t tcpi_state; 6677 uint8_t tcpi_ca_state; 6678 uint8_t tcpi_retransmits; 6679 uint8_t tcpi_probes; 6680 uint8_t tcpi_backoff; 6681 uint8_t tcpi_options; 6682 uint8_t tcpi_snd_wscale:4; 6683 uint8_t tcpi_rcv_wscale:4; 6684 uint32_t tcpi_rto; 6685 uint32_t tcpi_ato; 6686 uint32_t tcpi_snd_mss; 6687 uint32_t tcpi_rcv_mss; 6688 uint32_t tcpi_unacked; 6689 uint32_t tcpi_sacked; 6690 uint32_t tcpi_lost; 6691 uint32_t tcpi_retrans; 6692 uint32_t tcpi_fackets; 6693 uint32_t tcpi_last_data_sent; 6694 uint32_t tcpi_last_ack_sent; 6695 uint32_t tcpi_last_data_recv; 6696 uint32_t tcpi_last_ack_recv; 6697 uint32_t tcpi_pmtu; 6698 uint32_t tcpi_rcv_ssthresh; 6699 uint32_t tcpi_rtt; 6700 uint32_t tcpi_rttvar; 6701 uint32_t tcpi_snd_ssthresh; 6702 uint32_t tcpi_snd_cwnd; 6703 uint32_t tcpi_advmss; 6704 uint32_t tcpi_reordering; 6705 }; 6706 enum { 6707 TCP_ESTABLISHED = 1, 6708 TCP_SYN_SENT = 2, 6709 TCP_SYN_RECV = 3, 6710 TCP_FIN_WAIT1 = 4, 6711 TCP_FIN_WAIT2 = 5, 6712 TCP_TIME_WAIT = 6, 6713 TCP_CLOSE = 7, 6714 TCP_CLOSE_WAIT = 8, 6715 TCP_LAST_ACK = 9, 6716 TCP_LISTEN = 10, 6717 TCP_CLOSING = 11 6718 }; 6719 __________________________________________________________ 6720 6721 12.4.38. netinet/udp.h 6722 6723 #define SOL_UDP 17 6724 6725 struct udphdr { 6726 u_int16_t source; 6727 u_int16_t dest; 6728 u_int16_t len; 6729 u_int16_t check; 6730 }; 6731 __________________________________________________________ 6732 6733 12.4.39. nl_types.h 6734 6735 #define NL_CAT_LOCALE 1 6736 #define NL_SETD 1 6737 6738 typedef void *nl_catd; 6739 6740 typedef int nl_item; 6741 extern int catclose(nl_catd __catalog); 6742 extern char *catgets(nl_catd __catalog, int __set, int __number, 6743 const char *__string); 6744 extern nl_catd catopen(const char *__cat_name, int __flag); 6745 __________________________________________________________ 6746 6747 12.4.40. poll.h 6748 6749 extern int poll(struct pollfd *__fds, nfds_t __nfds, int __timeout); 6750 __________________________________________________________ 6751 6752 12.4.41. pty.h 6753 6754 extern int forkpty(int *__amaster, char *__name, 6755 const struct termios *__termp, 6756 const struct winsize *__winp); 6757 extern int openpty(int *__amaster, int *__aslave, char *__name, 6758 const struct termios *__termp, 6759 const struct winsize *__winp); 6760 __________________________________________________________ 6761 6762 12.4.42. pwd.h 6763 6764 struct passwd { 6765 char *pw_name; 6766 char *pw_passwd; 6767 uid_t pw_uid; 6768 gid_t pw_gid; 6769 char *pw_gecos; 6770 char *pw_dir; 6771 char *pw_shell; 6772 }; 6773 extern void endpwent(void); 6774 extern struct passwd *getpwent(void); 6775 extern int getpwent_r(struct passwd *__resultbuf, char *__buffer, 6776 size_t __buflen, struct passwd **__result); 6777 extern struct passwd *getpwnam(const char *__name); 6778 extern int getpwnam_r(const char *__name, struct passwd *__resultbuf, 6779 char *__buffer, size_t __buflen, 6780 struct passwd **__result); 6781 extern struct passwd *getpwuid(uid_t __uid); 6782 extern int getpwuid_r(uid_t __uid, struct passwd *__resultbuf, 6783 char *__buffer, size_t __buflen, 6784 struct passwd **__result); 6785 extern void setpwent(void); 6786 __________________________________________________________ 6787 6788 12.4.43. regex.h 6789 6790 #define RE_DUP_MAX (0x7fff) 6791 6792 typedef unsigned long int reg_syntax_t; 6793 6794 typedef struct re_pattern_buffer { 6795 unsigned char *buffer; 6796 unsigned long int allocated; 6797 unsigned long int used; 6798 reg_syntax_t syntax; 6799 char *fastmap; 6800 char *translate; 6801 size_t re_nsub; 6802 unsigned int can_be_null:1; 6803 unsigned int regs_allocated:2; 6804 unsigned int fastmap_accurate:1; 6805 unsigned int no_sub:1; 6806 unsigned int not_bol:1; 6807 unsigned int not_eol:1; 6808 unsigned int newline_anchor:1; 6809 } regex_t; 6810 typedef int regoff_t; 6811 typedef struct { 6812 regoff_t rm_so; 6813 regoff_t rm_eo; 6814 } regmatch_t; 6815 6816 #define REG_ICASE (REG_EXTENDED<<1) 6817 #define REG_NEWLINE (REG_ICASE<<1) 6818 #define REG_NOSUB (REG_NEWLINE<<1) 6819 #define REG_EXTENDED 1 6820 6821 #define REG_NOTEOL (1<<1) 6822 #define REG_NOTBOL 1 6823 6824 typedef enum { 6825 REG_ENOSYS = -1, 6826 REG_NOERROR = 0, 6827 REG_NOMATCH = 1, 6828 REG_BADPAT = 2, 6829 REG_ECOLLATE = 3, 6830 REG_ECTYPE = 4, 6831 REG_EESCAPE = 5, 6832 REG_ESUBREG = 6, 6833 REG_EBRACK = 7, 6834 REG_EPAREN = 8, 6835 REG_EBRACE = 9, 6836 REG_BADBR = 10, 6837 REG_ERANGE = 11, 6838 REG_ESPACE = 12, 6839 REG_BADRPT = 13, 6840 REG_EEND = 14, 6841 REG_ESIZE = 15, 6842 REG_ERPAREN = 16 6843 } reg_errcode_t; 6844 extern int regcomp(regex_t * __preg, const char *__pattern, int __cflags); 6845 extern size_t regerror(int __errcode, const regex_t * __preg, 6846 char *__errbuf, size_t __errbuf_size); 6847 extern int regexec(const regex_t * __preg, const char *__string, 6848 size_t __nmatch, regmatch_t __pmatch[], int __eflags); 6849 extern void regfree(regex_t * __preg); 6850 __________________________________________________________ 6851 6852 12.4.44. rpc/auth.h 6853 6854 #define auth_destroy(auth) ((*((auth)->ah_ops->ah_destroy))(auth)) 6855 6856 enum auth_stat { 6857 AUTH_OK = 0, 6858 AUTH_BADCRED = 1, /* bogus credentials (seal broken) */ 6859 AUTH_REJECTEDCRED = 2, /* client should begin new session */ 6860 AUTH_BADVERF = 3, /* bogus verifier (seal broken) */ 6861 AUTH_REJECTEDVERF = 4, /* verifier expired or was replayed */ 6862 AUTH_TOOWEAK = 5, /* Rpc calls return an enum clnt_stat. */ 6863 AUTH_INVALIDRESP = 6, /* bogus response verifier */ 6864 AUTH_FAILED = 7 /* some unknown reason */ 6865 }; 6866 6867 union des_block { 6868 struct { 6869 u_int32_t high; 6870 u_int32_t low; 6871 } key; 6872 char c[8]; 6873 }; 6874 6875 struct opaque_auth { 6876 enum_t oa_flavor; /* flavor of auth */ 6877 caddr_t oa_base; /* address of more auth stuff */ 6878 u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ 6879 }; 6880 6881 typedef struct AUTH { 6882 struct opaque_auth ah_cred; 6883 struct opaque_auth ah_verf; 6884 union des_block ah_key; 6885 struct auth_ops *ah_ops; 6886 caddr_t ah_private; 6887 } AUTH; 6888 6889 struct auth_ops { 6890 void (*ah_nextverf) (struct AUTH *); 6891 int (*ah_marshal) (struct AUTH *, XDR *); /* nextverf & serialize*/ 6892 int (*ah_validate) (struct AUTH *, struct opaque_auth *); /* validate verifier */ 6893 int (*ah_refresh) (struct AUTH *); /* refresh credentials */ 6894 void (*ah_destroy) (struct AUTH *); /* Rpc calls return an enum clnt_stat. */ 6895 }; 6896 extern struct AUTH *authnone_create(void); 6897 extern int key_decryptsession(char *, union des_block *); 6898 extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); 6899 __________________________________________________________ 6900 6901 12.4.45. rpc/clnt.h 6902 6903 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 6904 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 6905 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 6906 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 6907 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 6908 #define NULLPROC ((u_long)0) /* By convention, procedure 0 takes null arguments and returns */ 6909 #define CLSET_TIMEOUT 1 /* set timeout (timeval) */ 6910 #define CLGET_XID 10 /* Get xid */ 6911 #define CLSET_XID 11 /* Set xid */ 6912 #define CLGET_VERS 12 /* Get version number */ 6913 #define CLSET_VERS 13 /* Set version number */ 6914 #define CLGET_PROG 14 /* Get program number */ 6915 #define CLSET_PROG 15 /* Set program number */ 6916 #define CLGET_TIMEOUT 2 /* get timeout (timeval) */ 6917 #define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ 6918 #define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ 6919 #define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ 6920 #define CLGET_FD 6 /* get connections file descriptor */ 6921 #define CLGET_SVC_ADDR 7 /* get server's address (netbuf) */ 6922 #define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */ 6923 #define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy */ 6924 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 6925 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 6926 6927 enum clnt_stat { 6928 RPC_SUCCESS = 0, /* call succeeded */ 6929 RPC_CANTENCODEARGS = 1, /* can't encode arguments */ 6930 RPC_CANTDECODERES = 2, /* can't decode results */ 6931 RPC_CANTSEND = 3, /* failure in sending call */ 6932 RPC_CANTRECV = 4, /* failure in receiving result */ 6933 RPC_TIMEDOUT = 5, /* call timed out */ 6934 RPC_VERSMISMATCH = 6, /* rpc versions not compatible */ 6935 RPC_AUTHERROR = 7, /* authentication error */ 6936 RPC_PROGUNAVAIL = 8, /* program not available */ 6937 RPC_PROGVERSMISMATCH = 9, /* program version mismatched */ 6938 RPC_PROCUNAVAIL = 10, /* procedure unavailable */ 6939 RPC_CANTDECODEARGS = 11, /* decode arguments error */ 6940 RPC_SYSTEMERROR = 12, /* generic "other problem" */ 6941 RPC_NOBROADCAST = 21, /* Broadcasting not supported */ 6942 RPC_UNKNOWNHOST = 13, /* unknown host name */ 6943 RPC_UNKNOWNPROTO = 17, /* unknown protocol */ 6944 RPC_UNKNOWNADDR = 19, /* Remote address unknown */ 6945 RPC_RPCBFAILURE = 14, /* portmapper failed in its call */ 6946 RPC_PROGNOTREGISTERED = 15, /* remote program is not registered */ 6947 RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */ 6948 RPC_FAILED = 16, 6949 RPC_INTR = 18, 6950 RPC_TLIERROR = 20, 6951 RPC_UDERROR = 23, 6952 RPC_INPROGRESS = 24, 6953 RPC_STALERACHANDLE = 25 6954 }; 6955 struct rpc_err { 6956 enum clnt_stat re_status; 6957 union { 6958 int RE_errno; 6959 enum auth_stat RE_why; 6960 struct { 6961 u_long low; 6962 u_long high; 6963 } RE_vers; 6964 struct { 6965 long int s1; 6966 long int s2; 6967 } RE_lb; 6968 } ru; 6969 }; 6970 6971 typedef struct CLIENT { 6972 struct AUTH *cl_auth; 6973 struct clnt_ops *cl_ops; 6974 caddr_t cl_private; 6975 } CLIENT; 6976 6977 struct clnt_ops { 6978 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 6979 xdrproc_t, caddr_t, struct timeval); 6980 void (*cl_abort) (void); 6981 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 6982 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 6983 void (*cl_destroy) (struct CLIENT *); 6984 bool_t(*cl_control) (struct CLIENT *, int, char *); 6985 }; 6986 extern int callrpc(const char *__host, const u_long __prognum, 6987 const u_long __versnum, const u_long __procnum, 6988 const xdrproc_t __inproc, const char *__in, 6989 const xdrproc_t __outproc, char *__out); 6990 extern struct CLIENT *clnt_create(const char *__host, const u_long __prog, 6991 const u_long __vers, const char *__prot); 6992 extern void clnt_pcreateerror(const char *__msg); 6993 extern void clnt_perrno(enum clnt_stat __num); 6994 extern void clnt_perror(struct CLIENT *__clnt, const char *__msg); 6995 extern char *clnt_spcreateerror(const char *__msg); 6996 extern char *clnt_sperrno(enum clnt_stat __num); 6997 extern char *clnt_sperror(struct CLIENT *__clnt, const char *__msg); 6998 extern struct CLIENT *clntraw_create(u_long __prog, u_long __vers); 6999 extern struct CLIENT *clnttcp_create(struct sockaddr_in *__raddr, 7000 u_long __prog, u_long __version, 7001 int *__sockp, u_int __sendsz, 7002 u_int __recvsz); 7003 extern struct CLIENT *clntudp_bufcreate(struct sockaddr_in *__raddr, 7004 u_long __program, u_long __version, 7005 struct timeval __wait_resend, 7006 int *__sockp, u_int __sendsz, 7007 u_int __recvsz); 7008 extern struct CLIENT *clntudp_create(struct sockaddr_in *__raddr, 7009 u_long __program, u_long __version, 7010 struct timeval __wait_resend, 7011 int *__sockp); 7012 __________________________________________________________ 7013 7014 12.4.46. rpc/pmap_clnt.h 7015 7016 extern u_short pmap_getport(struct sockaddr_in *__address, 7017 const u_long __program, const u_long __version, 7018 u_int __protocol); 7019 extern bool_t pmap_set(const u_long __program, const u_long __vers, 7020 int __protocol, u_short __port); 7021 extern bool_t pmap_unset(u_long __program, u_long __vers); 7022 __________________________________________________________ 7023 7024 12.4.47. rpc/rpc_msg.h 7025 7026 enum msg_type { 7027 CALL = 0, 7028 REPLY = 1 7029 }; 7030 enum reply_stat { 7031 MSG_ACCEPTED = 0, 7032 MSG_DENIED = 1 7033 }; 7034 enum accept_stat { 7035 SUCCESS = 0, 7036 PROG_UNAVAIL = 1, 7037 PROG_MISMATCH = 2, 7038 PROC_UNAVAIL = 3, 7039 GARBAGE_ARGS = 4, 7040 SYSTEM_ERR = 5 7041 }; 7042 enum reject_stat { 7043 RPC_MISMATCH = 0, 7044 AUTH_ERROR = 1 7045 }; 7046 7047 #define ar_results ru.AR_results 7048 #define ar_vers ru.AR_versions 7049 7050 struct accepted_reply { 7051 struct opaque_auth ar_verf; 7052 enum accept_stat ar_stat; 7053 union { 7054 struct { 7055 unsigned long int low; 7056 unsigned long int high; 7057 } AR_versions; 7058 struct { 7059 caddr_t where; 7060 xdrproc_t proc; 7061 } AR_results; 7062 } ru; 7063 }; 7064 7065 #define rj_vers ru.RJ_versions 7066 #define rj_why ru.RJ_why 7067 7068 struct rejected_reply { 7069 enum reject_stat rj_stat; 7070 union { 7071 struct { 7072 unsigned long int low; 7073 unsigned long int high; 7074 } RJ_versions; 7075 enum auth_stat RJ_why; /* why authentication did not work */ 7076 } ru; 7077 }; 7078 7079 #define rp_acpt ru.RP_ar 7080 #define rp_rjct ru.RP_dr 7081 7082 struct reply_body { 7083 enum reply_stat rp_stat; 7084 union { 7085 struct accepted_reply RP_ar; 7086 struct rejected_reply RP_dr; 7087 } ru; 7088 }; 7089 7090 struct call_body { 7091 unsigned long int cb_rpcvers; /* must be equal to two */ 7092 unsigned long int cb_prog; 7093 unsigned long int cb_vers; 7094 unsigned long int cb_proc; 7095 struct opaque_auth cb_cred; 7096 struct opaque_auth cb_verf; /* protocol specific - provided by client */ 7097 }; 7098 7099 #define rm_call ru.RM_cmb 7100 #define rm_reply ru.RM_rmb 7101 #define acpted_rply ru.RM_rmb.ru.RP_ar 7102 #define rjcted_rply ru.RM_rmb.ru.RP_dr 7103 7104 struct rpc_msg { 7105 unsigned long int rm_xid; 7106 enum msg_type rm_direction; 7107 union { 7108 struct call_body RM_cmb; 7109 struct reply_body RM_rmb; 7110 } ru; 7111 }; 7112 extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); 7113 extern bool_t xdr_callhdr(XDR * __xdrs, struct rpc_msg *__cmsg); 7114 extern bool_t xdr_callmsg(XDR * __xdrs, struct rpc_msg *__cmsg); 7115 extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); 7116 extern bool_t xdr_replymsg(XDR * __xdrs, struct rpc_msg *__rmsg); 7117 __________________________________________________________ 7118 7119 12.4.48. rpc/svc.h 7120 7121 #define svc_getcaller(x) (&(x)->xp_raddr) 7122 #define svc_destroy(xprt) (*(xprt)->xp_ops->xp_destroy)(xprt) 7123 #define svc_recv(xprt,msg) (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) 7124 #define svc_reply(xprt,msg) (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) 7125 #define svc_stat(xprt) (*(xprt)->xp_ops->xp_stat)(xprt) 7126 #define RPC_ANYSOCK -1 7127 #define svc_freeargs(xprt,xargs, argsp) \ 7128 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 7129 #define svc_getargs(xprt,xargs, argsp) \ 7130 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 7131 7132 enum xprt_stat { 7133 XPRT_DIED, 7134 XPRT_MOREREQS, 7135 XPRT_IDLE 7136 }; 7137 7138 typedef struct SVCXPRT { 7139 int xp_sock; 7140 u_short xp_port; 7141 struct xp_ops *xp_ops; 7142 int xp_addrlen; 7143 struct sockaddr_in xp_raddr; 7144 struct opaque_auth xp_verf; 7145 caddr_t xp_p1; 7146 caddr_t xp_p2; 7147 char xp_pad[256]; 7148 } SVCXPRT; 7149 7150 struct svc_req { 7151 rpcprog_t rq_prog; 7152 rpcvers_t rq_vers; 7153 rpcproc_t rq_proc; 7154 struct opaque_auth rq_cred; 7155 caddr_t rq_clntcred; 7156 SVCXPRT *rq_xprt; 7157 }; 7158 7159 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 7160 7161 struct xp_ops { 7162 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 7163 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 7164 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 7165 caddr_t args_ptr); 7166 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 7167 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 7168 caddr_t args_ptr); 7169 void (*xp_destroy) (SVCXPRT * __xprt); 7170 }; 7171 extern void svc_getreqset(fd_set * __readfds); 7172 extern bool_t svc_register(SVCXPRT * __xprt, rpcprog_t __prog, 7173 rpcvers_t __vers, __dispatch_fn_t __dispatch, 7174 rpcprot_t __protocol); 7175 extern void svc_run(void); 7176 extern bool_t svc_sendreply(SVCXPRT * xprt, xdrproc_t __xdr_results, 7177 caddr_t __xdr_location); 7178 extern void svcerr_auth(SVCXPRT * __xprt, enum auth_stat __why); 7179 extern void svcerr_decode(SVCXPRT * __xprt); 7180 extern void svcerr_noproc(SVCXPRT * __xprt); 7181 extern void svcerr_noprog(SVCXPRT * __xprt); 7182 extern void svcerr_progvers(SVCXPRT * __xprt, rpcvers_t __low_vers, 7183 rpcvers_t __high_vers); 7184 extern void svcerr_systemerr(SVCXPRT * __xprt); 7185 extern void svcerr_weakauth(SVCXPRT * __xprt); 7186 extern SVCXPRT *svcraw_create(void); 7187 extern SVCXPRT *svctcp_create(int __sock, u_int __sendsize, 7188 u_int __recvsize); 7189 extern SVCXPRT *svcudp_create(int __sock); 7190 __________________________________________________________ 7191 7192 12.4.49. rpc/types.h 7193 7194 typedef int bool_t; 7195 typedef int enum_t; 7196 typedef unsigned long int rpcprog_t; 7197 typedef unsigned long int rpcvers_t; 7198 typedef unsigned long int rpcproc_t; 7199 typedef unsigned long int rpcprot_t; 7200 __________________________________________________________ 7201 7202 12.4.50. rpc/xdr.h 7203 7204 #define XDR_DESTROY(xdrs) \ 7205 do { if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ 7206 } while (0) 7207 #define xdr_destroy(xdrs) \ 7208 do { if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ 7209 } while (0) 7210 #define XDR_GETBYTES(xdrs,addr,len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) 7211 #define xdr_getbytes(xdrs,addr,len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) 7212 #define XDR_GETINT32(xdrs,int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) 7213 #define xdr_getint32(xdrs,int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) 7214 #define XDR_GETLONG(xdrs,longp) (*(xdrs)->x_ops->x_getlong)(xdrs, longp) 7215 #define xdr_getlong(xdrs,longp) (*(xdrs)->x_ops->x_getlong)(xdrs, longp) 7216 #define XDR_GETPOS(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) 7217 #define xdr_getpos(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) 7218 #define XDR_INLINE(xdrs,len) (*(xdrs)->x_ops->x_inline)(xdrs, len) 7219 #define xdr_inline(xdrs,len) (*(xdrs)->x_ops->x_inline)(xdrs, len) 7220 #define XDR_PUTBYTES(xdrs,addr,len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) 7221 #define xdr_putbytes(xdrs,addr,len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) 7222 #define XDR_PUTINT32(xdrs,int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) 7223 #define xdr_putint32(xdrs,int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) 7224 #define XDR_PUTLONG(xdrs,longp) (*(xdrs)->x_ops->x_putlong)(xdrs, longp) 7225 #define xdr_putlong(xdrs,longp) (*(xdrs)->x_ops->x_putlong)(xdrs, longp) 7226 #define XDR_SETPOS(xdrs,pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) 7227 #define xdr_setpos(xdrs,pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) 7228 7229 enum xdr_op { 7230 XDR_ENCODE, 7231 XDR_DECODE, 7232 XDR_FREE 7233 }; 7234 typedef struct XDR { 7235 enum xdr_op x_op; 7236 struct xdr_ops *x_ops; 7237 caddr_t x_public; 7238 caddr_t x_private; 7239 caddr_t x_base; 7240 int x_handy; 7241 } XDR; 7242 7243 struct xdr_ops { 7244 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 7245 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 7246 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 7247 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 7248 u_int(*x_getpostn) (XDR * __xdrs); 7249 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 7250 int32_t *(*x_inline) (XDR * __xdrs, int __len); 7251 void (*x_destroy) (XDR * __xdrs); 7252 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 7253 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 7254 }; 7255 7256 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 7257 7258 struct xdr_discrim { 7259 int value; 7260 xdrproc_t proc; 7261 }; 7262 extern bool_t xdr_array(XDR * _xdrs, caddr_t * __addrp, u_int * __sizep, 7263 u_int __maxsize, u_int __elsize, 7264 xdrproc_t __elproc); 7265 extern bool_t xdr_bool(XDR * __xdrs, bool_t * __bp); 7266 extern bool_t xdr_bytes(XDR * __xdrs, char **__cpp, u_int * __sizep, 7267 u_int __maxsize); 7268 extern bool_t xdr_char(XDR * __xdrs, char *__cp); 7269 extern bool_t xdr_double(XDR * __xdrs, double *__dp); 7270 extern bool_t xdr_enum(XDR * __xdrs, enum_t * __ep); 7271 extern bool_t xdr_float(XDR * __xdrs, float *__fp); 7272 extern void xdr_free(xdrproc_t __proc, char *__objp); 7273 extern bool_t xdr_int(XDR * __xdrs, int *__ip); 7274 extern bool_t xdr_long(XDR * __xdrs, long int *__lp); 7275 extern bool_t xdr_opaque(XDR * __xdrs, caddr_t __cp, u_int __cnt); 7276 extern bool_t xdr_pointer(XDR * __xdrs, char **__objpp, u_int __obj_size, 7277 xdrproc_t __xdr_obj); 7278 extern bool_t xdr_reference(XDR * __xdrs, caddr_t * __xpp, u_int __size, 7279 xdrproc_t __proc); 7280 extern bool_t xdr_short(XDR * __xdrs, short *__sp); 7281 extern bool_t xdr_string(XDR * __xdrs, char **__cpp, u_int __maxsize); 7282 extern bool_t xdr_u_char(XDR * __xdrs, u_char * __cp); 7283 extern bool_t xdr_u_int(XDR * __xdrs, u_int * __up); 7284 extern bool_t xdr_u_long(XDR * __xdrs, u_long * __ulp); 7285 extern bool_t xdr_u_short(XDR * __xdrs, u_short * __usp); 7286 extern bool_t xdr_union(XDR * __xdrs, enum_t * __dscmp, char *__unp, 7287 const struct xdr_discrim *__choices, 7288 xdrproc_t dfault); 7289 extern bool_t xdr_vector(XDR * __xdrs, char *__basep, u_int __nelem, 7290 u_int __elemsize, xdrproc_t __xdr_elem); 7291 extern bool_t xdr_void(void); 7292 extern bool_t xdr_wrapstring(XDR * __xdrs, char **__cpp); 7293 extern void xdrmem_create(XDR * __xdrs, caddr_t __addr, u_int __size, 7294 enum xdr_op __xop); 7295 extern void xdrrec_create(XDR * __xdrs, u_int __sendsize, u_int __recvsize, 7296 caddr_t __tcp_handle, int (*__readit) (char *, 7297 char *, 7298 int), 7299 int (*__writeit) (char *, char *, int)); 7300 extern bool_t xdrrec_endofrecord(XDR * __xdrs, bool_t __sendnow); 7301 extern bool_t xdrrec_eof(XDR * __xdrs); 7302 extern bool_t xdrrec_skiprecord(XDR * __xdrs); 7303 extern void xdrstdio_create(XDR * __xdrs, FILE * __file, 7304 enum xdr_op __xop); 7305 __________________________________________________________ 7306 7307 12.4.51. sched.h 7308 7309 #define __CPU_ALLOC_SIZE(count) ((((count) + __NCPUBITS - 1) / __NCPUBITS) * 8) 7310 #define __CPUELT(cpu) ((cpu) / __NCPUBITS) 7311 #define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) 7312 #define __NCPUBITS (8 * sizeof (__cpu_mask)) 7313 #define SCHED_OTHER 0 7314 #define SCHED_FIFO 1 7315 #define __CPU_SETSIZE 1024 7316 #define SCHED_RR 2 7317 #define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ 7318 (__extension__\ 7319 ({ cpu_set_t *__dest = (destset); \ 7320 cpu_set_t *__arr1 = (srcset1); \ 7321 cpu_set_t *__arr2 = (srcset2); \ 7322 size_t __imax = (setsize) / sizeof (__cpu_mask); \ 7323 size_t __i; \ 7324 for (__i = 0; __i < __imax; ++__i)\ 7325 __dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i]; \ 7326 __dest; })) 7327 #define __CPU_SET_S(cpu, setsize, cpusetp) \ 7328 (__extension__\ 7329 ({ size_t __cpu = (cpu); \ 7330 __cpu < 8 * (setsize) \ 7331 ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; })) 7332 #define __CPU_ISSET_S(cpu, setsize, cpusetp) \ 7333 (__extension__\ 7334 ({ size_t __cpu = (cpu); \ 7335 __cpu < 8 * (setsize)\ 7336 ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0\ 7337 : 0; })) 7338 #define __CPU_CLR_S(cpu, setsize, cpusetp) \ 7339 (__extension__\ 7340 ({ size_t __cpu = (cpu); \ 7341 __cpu < 8 * (setsize)\ 7342 ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0;})) 7343 #define __CPU_ZERO_S(setsize, cpusetp) \ 7344 do {\ 7345 size_t __i; \ 7346 size_t __imax = (setsize) / sizeof (__cpu_mask); \ 7347 cpu_set_t *__arr = (cpusetp); \ 7348 for (__i = 0; __i < __imax; ++__i)\ 7349 __arr->__bits[__i] = 0; \ 7350 } while (0) 7351 #define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) 7352 #define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) 7353 #define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t),cpusetp) 7354 #define CPU_AND_S(setsize, destset, srcset1, srcset2) __CPU_OP_S (setsize, destset, srcset1, srcset2, &) 7355 #define CPU_XOR_S(setsize, destset, srcset1, srcset2) __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) 7356 #define CPU_OR_S(setsize, destset, srcset1, srcset2) __CPU_OP_S (setsize, destset, srcset1, srcset2, |) 7357 #define CPU_AND(destset, srcset1, srcset2) __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) 7358 #define CPU_XOR(destset, srcset1, srcset2) __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) 7359 #define CPU_OR(destset, srcset1, srcset2) __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) 7360 #define CPU_SETSIZE __CPU_SETSIZE 7361 #define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) 7362 #define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) 7363 7364 struct sched_param { 7365 int sched_priority; 7366 }; 7367 typedef unsigned long int __cpu_mask; 7368 typedef struct { 7369 __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; 7370 } cpu_set_t; 7371 extern int sched_get_priority_max(int __algorithm); 7372 extern int sched_get_priority_min(int __algorithm); 7373 extern int sched_getaffinity(pid_t __pid, size_t __cpusetsize, 7374 cpu_set_t * __cpuset); 7375 extern int sched_getparam(pid_t __pid, struct sched_param *__param); 7376 extern int sched_getscheduler(pid_t __pid); 7377 extern int sched_rr_get_interval(pid_t __pid, struct timespec *__t); 7378 extern int sched_setaffinity(pid_t __pid, size_t __cpusetsize, 7379 const cpu_set_t * __cpuset); 7380 extern int sched_setparam(pid_t __pid, const struct sched_param *__param); 7381 extern int sched_setscheduler(pid_t __pid, int __policy, 7382 const struct sched_param *__param); 7383 extern int sched_yield(void); 7384 __________________________________________________________ 7385 7386 12.4.52. search.h 7387 7388 typedef struct entry { 7389 char *key; 7390 void *data; 7391 } ENTRY; 7392 typedef enum { 7393 FIND, 7394 ENTER 7395 } ACTION; 7396 struct _ENTRY; 7397 typedef enum { 7398 preorder, 7399 postorder, 7400 endorder, 7401 leaf 7402 } VISIT; 7403 struct hsearch_data { 7404 struct _ENTRY *table; 7405 unsigned int size; 7406 unsigned int filled; 7407 }; 7408 7409 typedef void (*__action_fn_t) (const void *__nodep, VISIT __value, 7410 int __level); 7411 extern int hcreate(size_t __nel); 7412 extern int hcreate_r(size_t __nel, struct hsearch_data *__htab); 7413 extern void hdestroy(void); 7414 extern void hdestroy_r(struct hsearch_data *__htab); 7415 extern ENTRY *hsearch(ENTRY __item, ACTION __action); 7416 extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY * *__retval, 7417 struct hsearch_data *__htab); 7418 extern void insque(void *__elem, void *__prev); 7419 extern void *lfind(const void *__key, const void *__base, size_t * __nmemb, 7420 size_t __size, __compar_fn_t __compar); 7421 extern void *lsearch(const void *__key, void *__base, size_t * __nmemb, 7422 size_t __size, __compar_fn_t __compar); 7423 extern void remque(void *__elem); 7424 extern void *tdelete(const void *__key, void **__rootp, 7425 __compar_fn_t __compar); 7426 extern void *tfind(const void *__key, void *const *__rootp, 7427 __compar_fn_t __compar); 7428 extern void *tsearch(const void *__key, void **__rootp, 7429 __compar_fn_t __compar); 7430 extern void twalk(const void *__root, __action_fn_t __action); 7431 __________________________________________________________ 7432 7433 12.4.53. setjmp.h 7434 7435 #define setjmp(env) _setjmp(env) 7436 #define sigsetjmp(a,b) __sigsetjmp(a,b) 7437 7438 struct __jmp_buf_tag { 7439 __jmp_buf __jmpbuf; 7440 int __mask_was_saved; 7441 sigset_t __saved_mask; 7442 }; 7443 7444 typedef struct __jmp_buf_tag jmp_buf[1]; 7445 typedef jmp_buf sigjmp_buf; 7446 extern int __sigsetjmp(jmp_buf __env, int __savemask); 7447 extern void _longjmp(jmp_buf __env, int __val); 7448 extern int _setjmp(jmp_buf __env); 7449 extern void longjmp(jmp_buf __env, int __val); 7450 extern void siglongjmp(sigjmp_buf __env, int __val); 7451 __________________________________________________________ 7452 7453 12.4.54. signal.h 7454 7455 #define sigpause __xpg_sigpause 7456 7457 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 7458 #define SIGRTMAX (__libc_current_sigrtmax ()) 7459 #define SIGRTMIN (__libc_current_sigrtmin ()) 7460 #define NSIG 65 7461 #define SIG_BLOCK 0 /* Block signals. */ 7462 #define SIG_UNBLOCK 1 /* Unblock signals. */ 7463 #define SIG_SETMASK 2 /* Set the set of blocked signals. */ 7464 7465 typedef int sig_atomic_t; 7466 7467 typedef void (*sighandler_t) (int); 7468 7469 #define SIG_HOLD ((sighandler_t) 2) /* Request that signal be held. */ 7470 #define SIG_DFL ((sighandler_t)0) /* Request for default signal handling. */ 7471 #define SIG_IGN ((sighandler_t)1) /* Request that signal be ignored. */ 7472 #define SIG_ERR ((sighandler_t)-1) /* Return value from signal() in case of error. */ 7473 7474 #define SIGHUP 1 /* Hangup. */ 7475 #define SIGINT 2 /* Terminal interrupt signal. */ 7476 #define SIGQUIT 3 /* Terminal quit signal. */ 7477 #define SIGILL 4 /* Illegal instruction. */ 7478 #define SIGTRAP 5 /* Trace/breakpoint trap. */ 7479 #define SIGABRT 6 /* Process abort signal. */ 7480 #define SIGIOT 6 /* IOT trap */ 7481 #define SIGBUS 7 /* Access to an undefined portion of a memory object. */ 7482 #define SIGFPE 8 /* Erroneous arithmetic operation. */ 7483 #define SIGKILL 9 /* Kill (cannot be caught or ignored). */ 7484 #define SIGUSR1 10 /* User-defined signal 1. */ 7485 #define SIGSEGV 11 /* Invalid memory reference. */ 7486 #define SIGUSR2 12 /* User-defined signal 2. */ 7487 #define SIGPIPE 13 /* Write on a pipe with no one to readit. */ 7488 #define SIGALRM 14 /* Alarm clock. */ 7489 #define SIGTERM 15 /* Termination signal. */ 7490 #define SIGSTKFLT 16 /* Stack fault. */ 7491 #define SIGCHLD 17 /* Child process terminated, stopped, or continued. */ 7492 #define SIGCLD SIGCHLD /* Same as SIGCHLD */ 7493 #define SIGCONT 18 /* Continue executing, if stopped. */ 7494 #define SIGSTOP 19 /* Stop executing (cannot be caught or ignored). */ 7495 #define SIGTSTP 20 /* Terminal stop signal. */ 7496 #define SIGTTIN 21 /* Background process attempting read. */ 7497 #define SIGTTOU 22 /* Background process attempting write.*/ 7498 #define SIGURG 23 /* High bandwidth data is available at a socket. */ 7499 #define SIGXCPU 24 /* CPU time limit exceeded. */ 7500 #define SIGXFSZ 25 /* File size limit exceeded. */ 7501 #define SIGVTALRM 26 /* Virtual timer expired. */ 7502 #define SIGPROF 27 /* Profiling timer expired. */ 7503 #define SIGWINCH 28 /* Window size change. */ 7504 #define SIGIO 29 /* I/O now possible. */ 7505 #define SIGPOLL SIGIO /* Pollable event. */ 7506 #define SIGPWR 30 /* Power failure restart */ 7507 #define SIGSYS 31 /* Bad system call. */ 7508 #define SIGUNUSED 31 7509 7510 #define SV_ONSTACK (1<<0) /* Take the signal on the signal stack.*/ 7511 #define SV_INTERRUPT (1<<1) /* Do not restart system calls. */ 7512 #define SV_RESETHAND (1<<2) /* Reset handler to SIG_DFL on receipt.*/ 7513 7514 typedef union sigval { 7515 int sival_int; 7516 void *sival_ptr; 7517 } sigval_t; 7518 7519 #define SIGEV_SIGNAL 0 /* Notify via signal. */ 7520 #define SIGEV_NONE 1 /* Other notification: meaningless. */ 7521 #define SIGEV_THREAD 2 /* Deliver via thread creation. */ 7522 #define SIGEV_MAX_SIZE 64 7523 7524 typedef struct sigevent { 7525 sigval_t sigev_value; 7526 int sigev_signo; 7527 int sigev_notify; 7528 union { 7529 int _pad[SIGEV_PAD_SIZE]; 7530 struct { 7531 void (*_function) (sigval_t); 7532 void *_attribute; 7533 } _sigev_thread; 7534 } _sigev_un; 7535 } sigevent_t; 7536 7537 #define SI_MAX_SIZE 128 7538 #define si_pid _sifields._kill._pid 7539 #define si_uid _sifields._kill._uid 7540 #define si_value _sifields._rt._sigval 7541 #define si_int _sifields._rt._sigval.sival_int 7542 #define si_ptr _sifields._rt._sigval.sival_ptr 7543 #define si_status _sifields._sigchld._status 7544 #define si_stime _sifields._sigchld._stime 7545 #define si_utime _sifields._sigchld._utime 7546 #define si_addr _sifields._sigfault._addr 7547 #define si_band _sifields._sigpoll._band 7548 #define si_fd _sifields._sigpoll._fd 7549 #define si_timer1 _sifields._timer._timer1 7550 #define si_timer2 _sifields._timer._timer2 7551 7552 typedef struct siginfo { 7553 int si_signo; /* Signal number. */ 7554 int si_errno; 7555 int si_code; /* Signal code. */ 7556 union { 7557 int _pad[SI_PAD_SIZE]; 7558 struct { 7559 pid_t _pid; 7560 uid_t _uid; 7561 } _kill; 7562 struct { 7563 unsigned int _timer1; 7564 unsigned int _timer2; 7565 } _timer; 7566 struct { 7567 pid_t _pid; 7568 uid_t _uid; 7569 sigval_t _sigval; 7570 } _rt; 7571 struct { 7572 pid_t _pid; 7573 uid_t _uid; 7574 int _status; 7575 clock_t _utime; 7576 clock_t _stime; 7577 } _sigchld; 7578 struct { 7579 void *_addr; 7580 } _sigfault; 7581 struct { 7582 int _band; 7583 int _fd; 7584 } _sigpoll; 7585 } _sifields; 7586 } siginfo_t; 7587 7588 #define SI_QUEUE -1 /* Sent by sigqueue. */ 7589 #define SI_TIMER -2 /* Sent by timer expiration. */ 7590 #define SI_MESGQ -3 /* Sent by real time mesq state change.*/ 7591 #define SI_ASYNCIO -4 /* Sent by AIO completion. */ 7592 #define SI_SIGIO -5 /* Sent by queued SIGIO. */ 7593 #define SI_TKILL -6 /* Sent by tkill. */ 7594 #define SI_ASYNCNL -60 /* Sent by asynch name lookup completion. */ 7595 #define SI_USER 0 /* Sent by kill, sigsend, raise. */ 7596 #define SI_KERNEL 0x80 /* Sent by kernel. */ 7597 7598 #define ILL_ILLOPC 1 /* Illegal opcode. */ 7599 #define ILL_ILLOPN 2 /* Illegal operand. */ 7600 #define ILL_ILLADR 3 /* Illegal addressing mode. */ 7601 #define ILL_ILLTRP 4 /* Illegal trap. */ 7602 #define ILL_PRVOPC 5 /* Privileged opcode. */ 7603 #define ILL_PRVREG 6 /* Privileged register. */ 7604 #define ILL_COPROC 7 /* Coprocessor error. */ 7605 #define ILL_BADSTK 8 /* Internal stack error. */ 7606 7607 #define FPE_INTDIV 1 /* Integer divide by zero. */ 7608 #define FPE_INTOVF 2 /* Integer overflow. */ 7609 #define FPE_FLTDIV 3 /* Floating-point divide by zero. */ 7610 #define FPE_FLTOVF 4 /* Floating-point overflow. */ 7611 #define FPE_FLTUND 5 /* Floating-point underflow. */ 7612 #define FPE_FLTRES 6 /* Floating-point inexact result. */ 7613 #define FPE_FLTINV 7 /* Invalid floating-point operation. */ 7614 #define FPE_FLTSUB 8 /* Subscript out of range. */ 7615 7616 #define SEGV_MAPERR 1 /* Address not mapped to object. */ 7617 #define SEGV_ACCERR 2 /* Invalid permissions for mapped object. */ 7618 7619 #define BUS_ADRALN 1 /* Invalid address alignment. */ 7620 #define BUS_ADRERR 2 /* Nonexistent physical address. */ 7621 #define BUS_OBJERR 3 /* Object-specific hardware error. */ 7622 7623 #define TRAP_BRKPT 1 /* Process breakpoint. */ 7624 #define TRAP_TRACE 2 /* Process trace trap. */ 7625 7626 #define CLD_EXITED 1 /* Child has exited. */ 7627 #define CLD_KILLED 2 /* Child has terminated abnormally and did not create a core fi */ 7628 #define CLD_DUMPED 3 /* Child has terminated abnormally and created a core file. */ 7629 #define CLD_TRAPPED 4 /* Traced child has trapped. */ 7630 #define CLD_STOPPED 5 /* Child has stopped. */ 7631 #define CLD_CONTINUED 6 /* Stopped child has continued. */ 7632 7633 #define POLL_IN 1 /* Data input available. */ 7634 #define POLL_OUT 2 /* Output buffers available. */ 7635 #define POLL_MSG 3 /* Input message available. */ 7636 #define POLL_ERR 4 /* I/O error. */ 7637 #define POLL_PRI 5 /* High priority input available. */ 7638 #define POLL_HUP 6 /* Device disconnected. */ 7639 7640 typedef struct { 7641 unsigned long int sig[_SIGSET_NWORDS]; 7642 } sigset_t; 7643 7644 #define SA_INTERRUPT 0x20000000 7645 #define sa_handler __sigaction_handler._sa_handler 7646 #define sa_sigaction __sigaction_handler._sa_sigaction 7647 #define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer`. */ 7648 #define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry tohandler. */ 7649 #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ 7650 #define SA_SIGINFO 0x00000004 /* Invoke signal-catching function with three arguments instead of one. */ 7651 #define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ 7652 #define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ 7653 #define SA_NOCLDWAIT 0x00000002 /* Don't create zombie on childdeath. */ 7654 #define SA_NOMASK SA_NODEFER 7655 #define SA_ONESHOT SA_RESETHAND 7656 7657 typedef struct sigaltstack { 7658 void *ss_sp; 7659 int ss_flags; 7660 size_t ss_size; 7661 } stack_t; 7662 7663 #define SS_ONSTACK 1 7664 #define SS_DISABLE 2 7665 7666 extern int __libc_current_sigrtmax(void); 7667 extern int __libc_current_sigrtmin(void); 7668 extern sighandler_t __sysv_signal(int __sig, sighandler_t __handler); 7669 extern int __xpg_sigpause(int); 7670 extern char *const _sys_siglist[]; 7671 extern sighandler_t bsd_signal(int __sig, sighandler_t __handler); 7672 extern int kill(pid_t __pid, int __sig); 7673 extern int killpg(pid_t __pgrp, int __sig); 7674 extern void psignal(int __sig, const char *__s); 7675 extern int pthread_kill(pthread_t, int); 7676 extern int pthread_sigmask(int, const sigset_t *, sigset_t *); 7677 extern int raise(int __sig); 7678 extern int sigaction(int __sig, const struct sigaction *__act, 7679 struct sigaction *__oact); 7680 extern int sigaddset(sigset_t * __set, int __signo); 7681 extern int sigaltstack(const struct sigaltstack *__ss, 7682 struct sigaltstack *__oss); 7683 extern int sigandset(sigset_t * __set, const sigset_t * __left, 7684 const sigset_t * __right); 7685 extern int sigdelset(sigset_t * __set, int __signo); 7686 extern int sigemptyset(sigset_t * __set); 7687 extern int sigfillset(sigset_t * __set); 7688 extern int sighold(int __sig); 7689 extern int sigignore(int __sig); 7690 extern int siginterrupt(int __sig, int __interrupt); 7691 extern int sigisemptyset(const sigset_t * __set); 7692 extern int sigismember(const sigset_t * __set, int __signo); 7693 extern sighandler_t signal(int __sig, sighandler_t __handler); 7694 extern int sigorset(sigset_t * __set, const sigset_t * __left, 7695 const sigset_t * __right); 7696 extern int sigpending(sigset_t * __set); 7697 extern int sigprocmask(int __how, const sigset_t * __set, 7698 sigset_t * __oset); 7699 extern int sigqueue(pid_t __pid, int __sig, const union sigval __val); 7700 extern int sigrelse(int __sig); 7701 extern int sigreturn(struct sigcontext *__scp); 7702 extern sighandler_t sigset(int __sig, sighandler_t __disp); 7703 extern int sigsuspend(const sigset_t * __set); 7704 extern int sigtimedwait(const sigset_t * __set, siginfo_t * __info, 7705 const struct timespec *__timeout); 7706 extern int sigwait(const sigset_t * __set, int *__sig); 7707 extern int sigwaitinfo(const sigset_t * __set, siginfo_t * __info); 7708 __________________________________________________________ 7709 7710 12.4.55. spawn.h 7711 7712 #define POSIX_SPAWN_RESETIDS 0x01 7713 #define POSIX_SPAWN_SETPGROUP 0x02 7714 #define POSIX_SPAWN_SETSIGDEF 0x04 7715 #define POSIX_SPAWN_SETSIGMASK 0x08 7716 #define POSIX_SPAWN_SETSCHEDPARAM 0x10 7717 #define POSIX_SPAWN_SETSCHEDULER 0x20 7718 7719 typedef struct { 7720 int __allocated; 7721 int __used; 7722 struct __spawn_action *__actions; 7723 int __pad[16]; 7724 } posix_spawn_file_actions_t; 7725 typedef struct { 7726 short __flags; 7727 pid_t __pgrp; 7728 sigset_t __sd; 7729 sigset_t __ss; 7730 struct sched_param __sp; 7731 int __policy; 7732 int __pad[16]; 7733 } posix_spawnattr_t; 7734 extern int posix_spawn(pid_t * __pid, const char *__path, 7735 const posix_spawn_file_actions_t * __file_actions, 7736 const posix_spawnattr_t * __attrp, 7737 char *const argv[], char *const envp[]); 7738 extern int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* 7739 __file_actions, int __fd); 7740 extern int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t * 7741 __file_actions, int __fd, 7742 int __newfd); 7743 extern int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t * 7744 __file_actions, int __fd, 7745 const char *__path, 7746 int __oflag, mode_t __mode); 7747 extern int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t * 7748 __file_actions); 7749 extern int posix_spawn_file_actions_init(posix_spawn_file_actions_t * 7750 __file_actions); 7751 extern int posix_spawnattr_destroy(posix_spawnattr_t * __attr); 7752 extern int posix_spawnattr_getflags(const posix_spawnattr_t * __attr, 7753 short int *__flags); 7754 extern int posix_spawnattr_getpgroup(const posix_spawnattr_t * __attr, 7755 pid_t * __pgroup); 7756 extern int posix_spawnattr_getschedparam(const posix_spawnattr_t * __attr, 7757 struct sched_param *__schedparam); 7758 extern int posix_spawnattr_getschedpolicy(const posix_spawnattr_t * __attr, 7759 int *__schedpolicy); 7760 extern int posix_spawnattr_getsigdefault(const posix_spawnattr_t * __attr, 7761 sigset_t * __sigdefault); 7762 extern int posix_spawnattr_getsigmask(const posix_spawnattr_t * __attr, 7763 sigset_t * __sigmask); 7764 extern int posix_spawnattr_init(posix_spawnattr_t * __attr); 7765 extern int posix_spawnattr_setflags(posix_spawnattr_t * _attr, 7766 short int __flags); 7767 extern int posix_spawnattr_setpgroup(posix_spawnattr_t * __attr, 7768 pid_t __pgroup); 7769 extern int posix_spawnattr_setschedparam(posix_spawnattr_t * __attr, 7770 const struct sched_param 7771 *__schedparam); 7772 extern int posix_spawnattr_setschedpolicy(posix_spawnattr_t * __attr, 7773 int __schedpolicy); 7774 extern int posix_spawnattr_setsigdefault(posix_spawnattr_t * __attr, 7775 const sigset_t * __sigdefault); 7776 extern int posix_spawnattr_setsigmask(posix_spawnattr_t * __attr, 7777 const sigset_t * __sigmask); 7778 extern int posix_spawnp(pid_t * __pid, const char *__file, 7779 const posix_spawn_file_actions_t * __file_actions, 7780 const posix_spawnattr_t * __attrp, 7781 char *const argv[], char *const envp[]); 7782 __________________________________________________________ 7783 7784 12.4.56. stddef.h 7785 7786 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 7787 #ifndef NULL 7788 # ifdef __cplusplus 7789 # define NULL (0L) 7790 # else 7791 # define NULL ((void*) 0) 7792 # endif 7793 #endif 7794 __________________________________________________________ 7795 7796 12.4.57. stdint.h 7797 7798 #define INT16_C(c) c 7799 #define INT32_C(c) c 7800 #define INT8_C(c) c 7801 #define UINT16_C(c) c 7802 #define UINT8_C(c) c 7803 #define UINT32_C(c) c ## U 7804 7805 #define INT8_MIN (-128) 7806 #define INT_FAST8_MIN (-128) 7807 #define INT_LEAST8_MIN (-128) 7808 #define INT32_MIN (-2147483647-1) 7809 #define INT_LEAST32_MIN (-2147483647-1) 7810 #define SIG_ATOMIC_MIN (-2147483647-1) 7811 #define INT16_MIN (-32767-1) 7812 #define INT_LEAST16_MIN (-32767-1) 7813 #define INT64_MIN (-__INT64_C(9223372036854775807)-1) 7814 #define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) 7815 #define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) 7816 #define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) 7817 #define WINT_MIN (0u) 7818 #define INT8_MAX (127) 7819 #define INT_FAST8_MAX (127) 7820 #define INT_LEAST8_MAX (127) 7821 #define INT32_MAX (2147483647) 7822 #define INT_LEAST32_MAX (2147483647) 7823 #define SIG_ATOMIC_MAX (2147483647) 7824 #define UINT8_MAX (255) 7825 #define UINT_FAST8_MAX (255) 7826 #define UINT_LEAST8_MAX (255) 7827 #define INT16_MAX (32767) 7828 #define INT_LEAST16_MAX (32767) 7829 #define UINT32_MAX (4294967295U) 7830 #define UINT_LEAST32_MAX (4294967295U) 7831 #define WINT_MAX (4294967295u) 7832 #define UINT16_MAX (65535) 7833 #define UINT_LEAST16_MAX (65535) 7834 #define INT64_MAX (__INT64_C(9223372036854775807)) 7835 #define INTMAX_MAX (__INT64_C(9223372036854775807)) 7836 #define INT_FAST64_MAX (__INT64_C(9223372036854775807)) 7837 #define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) 7838 #define UINT64_MAX (__UINT64_C(18446744073709551615)) 7839 #define UINTMAX_MAX (__UINT64_C(18446744073709551615)) 7840 #define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) 7841 #define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) 7842 7843 typedef signed char int8_t; 7844 typedef short int16_t; 7845 typedef int int32_t; 7846 typedef unsigned char uint8_t; 7847 typedef unsigned short uint16_t; 7848 typedef unsigned int uint32_t; 7849 typedef signed char int_least8_t; 7850 typedef short int int_least16_t; 7851 typedef int int_least32_t; 7852 typedef unsigned char uint_least8_t; 7853 typedef unsigned short uint_least16_t; 7854 typedef unsigned int uint_least32_t; 7855 typedef signed char int_fast8_t; 7856 typedef unsigned char uint_fast8_t; 7857 __________________________________________________________ 7858 7859 12.4.58. stdio.h 7860 7861 #define EOF (-1) 7862 #define P_tmpdir "/tmp" 7863 #define FOPEN_MAX 16 7864 #define L_tmpnam 20 7865 #define TMP_MAX 238328 7866 #define FILENAME_MAX 4096 7867 #define BUFSIZ 8192 7868 #define L_ctermid 9 7869 #define L_cuserid 9 7870 7871 typedef struct { 7872 off_t __pos; 7873 mbstate_t __state; 7874 } fpos_t; 7875 typedef struct { 7876 off64_t __pos; 7877 mbstate_t __state; 7878 } fpos64_t; 7879 7880 typedef struct _IO_FILE FILE; 7881 7882 #define _IOFBF 0 7883 #define _IOLBF 1 7884 #define _IONBF 2 7885 7886 extern char *__fgets_chk(char *, size_t, int, FILE *); 7887 extern char *__fgets_unlocked_chk(char *, size_t, int, FILE *); 7888 extern size_t __fpending(FILE *); 7889 extern int __printf_chk(int, const char *, ...); 7890 extern int __snprintf_chk(char *, size_t, int, size_t, const char *, ...); 7891 extern int __sprintf_chk(char *, int, size_t, const char *, ...); 7892 extern int __vprintf_chk(int, const char *, va_list); 7893 extern int __vsnprintf_chk(char *, size_t, int, size_t, const char *, 7894 va_list); 7895 extern int __vsprintf_chk(char *, int, size_t, const char *, va_list); 7896 extern char *const _sys_errlist[]; 7897 extern int asprintf(char **__ptr, const char *__fmt, ...); 7898 extern void clearerr(FILE * __stream); 7899 extern void clearerr_unlocked(FILE * __stream); 7900 extern int dprintf(int __fd, const char *__fmt, ...); 7901 extern int fclose(FILE * __stream); 7902 extern FILE *fdopen(int __fd, const char *__modes); 7903 extern int feof(FILE * __stream); 7904 extern int feof_unlocked(FILE * __stream); 7905 extern int ferror(FILE * __stream); 7906 extern int ferror_unlocked(FILE * __stream); 7907 extern int fflush(FILE * __stream); 7908 extern int fflush_unlocked(FILE * __stream); 7909 extern int fgetc(FILE * __stream); 7910 extern int fgetc_unlocked(FILE * __stream); 7911 extern int fgetpos(FILE * __stream, fpos_t * __pos); 7912 extern int fgetpos64(FILE * __stream, fpos64_t * __pos); 7913 extern char *fgets(char *__s, int __n, FILE * __stream); 7914 extern char *fgets_unlocked(char *__s, int __n, FILE * __stream); 7915 extern int fileno(FILE * __stream); 7916 extern int fileno_unlocked(FILE * __stream); 7917 extern void flockfile(FILE * __stream); 7918 extern FILE *fmemopen(void *__s, size_t __len, const char *__modes); 7919 extern FILE *fopen(const char *__filename, const char *__modes); 7920 extern FILE *fopen64(const char *__filename, const char *__modes); 7921 extern int fprintf(FILE * __stream, const char *__format, ...); 7922 extern int fputc(int __c, FILE * __stream); 7923 extern int fputc_unlocked(int __c, FILE * __stream); 7924 extern int fputs(const char *__s, FILE * __stream); 7925 extern int fputs_unlocked(const char *__s, FILE * __stream); 7926 extern size_t fread(void *__ptr, size_t __size, size_t __n, 7927 FILE * __stream); 7928 extern size_t fread_unlocked(void *__ptr, size_t __size, size_t __n, 7929 FILE * __stream); 7930 extern FILE *freopen(const char *__filename, const char *__modes, 7931 FILE * __stream); 7932 extern FILE *freopen64(const char *__filename, const char *__modes, 7933 FILE * __stream); 7934 extern int fscanf(FILE * __stream, const char *__format, ...); 7935 extern int fseek(FILE * __stream, long int __off, int __whence); 7936 extern int fseeko(FILE * __stream, off_t __off, int __whence); 7937 extern int fseeko64(FILE * __stream, loff_t __off, int __whence); 7938 extern int fsetpos(FILE * __stream, const fpos_t * __pos); 7939 extern int fsetpos64(FILE * __stream, const fpos64_t * __pos); 7940 extern long int ftell(FILE * __stream); 7941 extern off_t ftello(FILE * __stream); 7942 extern loff_t ftello64(FILE * __stream); 7943 extern int ftrylockfile(FILE * __stream); 7944 extern void funlockfile(FILE * __stream); 7945 extern size_t fwrite(const void *__ptr, size_t __size, size_t __n, 7946 FILE * __s); 7947 extern size_t fwrite_unlocked(const void *__ptr, size_t __size, size_t __n, 7948 FILE * __stream); 7949 extern int getc(FILE * __stream); 7950 extern int getc_unlocked(FILE * __stream); 7951 extern int getchar(void); 7952 extern int getchar_unlocked(void); 7953 extern ssize_t getdelim(char **__lineptr, size_t * __n, int __delimiter, 7954 FILE * __stream); 7955 extern ssize_t getline(char **__lineptr, size_t * __n, FILE * __stream); 7956 extern int getw(FILE * __stream); 7957 extern FILE *open_memstream(char **__bufloc, size_t * __sizeloc); 7958 extern int pclose(FILE * __stream); 7959 extern void perror(const char *__s); 7960 extern FILE *popen(const char *__command, const char *__modes); 7961 extern int printf(const char *__format, ...); 7962 extern int putc(int __c, FILE * __stream); 7963 extern int putc_unlocked(int __c, FILE * __stream); 7964 extern int putchar(int __c); 7965 extern int putchar_unlocked(int __c); 7966 extern int puts(const char *__s); 7967 extern int putw(int __w, FILE * __stream); 7968 extern int remove(const char *__filename); 7969 extern int renameat(int __oldfd, const char *__old, int __newfd, 7970 const char *__new); 7971 extern void rewind(FILE * __stream); 7972 extern int scanf(const char *__format, ...); 7973 extern void setbuf(FILE * __stream, char *__buf); 7974 extern void setbuffer(FILE * __stream, char *__buf, size_t __size); 7975 extern int setvbuf(FILE * __stream, char *__buf, int __modes, size_t __n); 7976 extern int snprintf(char *__s, size_t __maxlen, const char *__format, ...); 7977 extern int sprintf(char *__s, const char *__format, ...); 7978 extern int sscanf(const char *__s, const char *__format, ...); 7979 extern FILE *stderr; 7980 extern FILE *stdin; 7981 extern FILE *stdout; 7982 extern char *tempnam(const char *__dir, const char *__pfx); 7983 extern FILE *tmpfile(void); 7984 extern FILE *tmpfile64(void); 7985 extern char *tmpnam(char *__s); 7986 extern int ungetc(int __c, FILE * __stream); 7987 extern int vasprintf(char **__ptr, const char *__f, va_list __arg); 7988 extern int vdprintf(int __fd, const char *__fmt, va_list __arg); 7989 extern int vfprintf(FILE * __s, const char *__format, va_list __arg); 7990 extern int vfscanf(FILE * __s, const char *__format, va_list __arg); 7991 extern int vprintf(const char *__format, va_list __arg); 7992 extern int vscanf(const char *__format, va_list __arg); 7993 extern int vsnprintf(char *__s, size_t __maxlen, const char *__format, 7994 va_list __arg); 7995 extern int vsprintf(char *__s, const char *__format, va_list __arg); 7996 extern int vsscanf(const char *__s, const char *__format, va_list __arg); 7997 __________________________________________________________ 7998 7999 12.4.59. stdlib.h 8000 8001 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 8002 #define EXIT_SUCCESS 0 8003 #define EXIT_FAILURE 1 8004 #define RAND_MAX 2147483647 8005 8006 struct drand48_data { 8007 unsigned short __x[3]; 8008 unsigned short __old_x[3]; 8009 unsigned short __c; 8010 unsigned short __init; 8011 unsigned long long int __a; 8012 }; 8013 typedef int (*__compar_fn_t) (const void *, const void *); 8014 struct random_data { 8015 int32_t *fptr; /* Front pointer. */ 8016 int32_t *rptr; /* Rear pointer. */ 8017 int32_t *state; /* Array of state values. */ 8018 int rand_type; /* Type of random number generator. */ 8019 int rand_deg; /* Degree of random number generator. */ 8020 int rand_sep; /* Distance between front and rear. */ 8021 int32_t *end_ptr; /* Pointer behind state table. */ 8022 }; 8023 8024 typedef struct { 8025 int quot; 8026 int rem; 8027 } div_t; 8028 8029 typedef struct { 8030 long int quot; 8031 long int rem; 8032 } ldiv_t; 8033 8034 typedef struct { 8035 long long int quot; 8036 long long int rem; 8037 } lldiv_t; 8038 extern void _Exit(int __status); 8039 extern size_t __ctype_get_mb_cur_max(void); 8040 extern size_t __mbstowcs_chk(wchar_t *, const char *, size_t, size_t); 8041 extern char *__realpath_chk(const char *, char *, size_t); 8042 extern double __strtod_internal(const char *, char **, int); 8043 extern float __strtof_internal(const char *, char **, int); 8044 extern long int __strtol_internal(const char *, char **, int, int); 8045 extern long double __strtold_internal(const char *, char **, int); 8046 extern long long int __strtoll_internal(const char *, char **, int, int); 8047 extern unsigned long int __strtoul_internal(const char *, char **, int, 8048 int); 8049 extern unsigned long long int __strtoull_internal(const char *, char **, 8050 int, int); 8051 extern size_t __wcstombs_chk(char *, const wchar_t *, size_t, size_t); 8052 extern int __wctomb_chk(char *, wchar_t, size_t); 8053 extern long int a64l(const char *__s); 8054 extern void abort(void); 8055 extern int abs(int __x); 8056 extern int atexit(void (*__func) (void)); 8057 extern double atof(const char *__nptr); 8058 extern int atoi(const char *__nptr); 8059 extern long int atol(const char *__nptr); 8060 extern long long int atoll(const char *__nptr); 8061 extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, 8062 size_t __size, __compar_fn_t __compar); 8063 extern void *calloc(size_t __nmemb, size_t __size); 8064 extern div_t div(int __numer, int __denom); 8065 extern double drand48(void); 8066 extern int drand48_r(struct drand48_data *__buffer, double *__result); 8067 extern char *ecvt(double __value, int __ndigit, int *__decpt, int *__sign); 8068 extern char **environ; 8069 extern double erand48(unsigned short __xsubi[3]); 8070 extern int erand48_r(unsigned short __xsubi[3], 8071 struct drand48_data *__buffer, double *__result); 8072 extern void exit(int __status); 8073 extern char *fcvt(double __value, int __ndigit, int *__decpt, int *__sign); 8074 extern void free(void *__ptr); 8075 extern char *gcvt(double __value, int __ndigit, char *__buf); 8076 extern char *getenv(const char *__name); 8077 extern int getloadavg(double __loadavg[], int __nelem); 8078 extern int getsubopt(char **__optionp, char *const *__tokens, 8079 char **__valuep); 8080 extern int grantpt(int __fd); 8081 extern char *initstate(unsigned int __seed, char *__statebuf, 8082 size_t __statelen); 8083 extern int initstate_r(unsigned int __seed, char *__statebuf, 8084 size_t __statelen, struct random_data *__buf); 8085 extern long int jrand48(unsigned short __xsubi[3]); 8086 extern int jrand48_r(unsigned short __xsubi[3], 8087 struct drand48_data *__buffer, long int *__result); 8088 extern char *l64a(long int __n); 8089 extern long int labs(long int __x); 8090 extern void lcong48(unsigned short __param[7]); 8091 extern int lcong48_r(unsigned short __param[7], 8092 struct drand48_data *__buffer); 8093 extern ldiv_t ldiv(long int __numer, long int __denom); 8094 extern long long int llabs(long long int __x); 8095 extern lldiv_t lldiv(long long int __numer, long long int __denom); 8096 extern long int lrand48(void); 8097 extern int lrand48_r(struct drand48_data *__buffer, long int *__result); 8098 extern void *malloc(size_t __size); 8099 extern int mblen(const char *__s, size_t __n); 8100 extern size_t mbstowcs(wchar_t * __pwcs, const char *__s, size_t __n); 8101 extern int mbtowc(wchar_t * __pwc, const char *__s, size_t __n); 8102 extern char *mkdtemp(char *__template); 8103 extern int mkstemp64(char *__template); 8104 extern char *mktemp(char *__template); 8105 extern long int mrand48(void); 8106 extern int mrand48_r(struct drand48_data *__buffer, long int *__result); 8107 extern long int nrand48(unsigned short __xsubi[3]); 8108 extern int nrand48_r(unsigned short __xsubi[3], 8109 struct drand48_data *__buffer, long int *__result); 8110 extern int posix_memalign(void **__memptr, size_t __alignment, 8111 size_t __size); 8112 extern int posix_openpt(int __oflag); 8113 extern char *ptsname(int __fd); 8114 extern int putenv(char *__string); 8115 extern void qsort(void *__base, size_t __nmemb, size_t __size, 8116 const __compar_fn_t __compar); 8117 extern int rand(void); 8118 extern int rand_r(unsigned int *__seed); 8119 extern long int random(void); 8120 extern int random_r(struct random_data *__buf, int32_t * __result); 8121 extern void *realloc(void *__ptr, size_t __size); 8122 extern char *realpath(const char *__name, char *__resolved); 8123 extern unsigned short *seed48(unsigned short __seed16v[3]); 8124 extern int seed48_r(unsigned short __seed16v[3], 8125 struct drand48_data *__buffer); 8126 extern int setenv(const char *__name, const char *__value, int __replace); 8127 extern char *setstate(char *__statebuf); 8128 extern int setstate_r(char *__statebuf, struct random_data *__buf); 8129 extern void srand(unsigned int __seed); 8130 extern void srand48(long int __seedval); 8131 extern int srand48_r(long int __seedval, struct drand48_data *__buffer); 8132 extern void srandom(unsigned int __seed); 8133 extern int srandom_r(unsigned int __seed, struct random_data *__buf); 8134 extern double strtod(const char *__nptr, char **__endptr); 8135 extern float strtof(const char *__nptr, char **__endptr); 8136 extern long int strtol(const char *__nptr, char **__endptr, int __base); 8137 extern long double strtold(const char *__nptr, char **__endptr); 8138 extern long long int strtoll(const char *__nptr, char **__endptr, 8139 int __base); 8140 extern long long int strtoq(const char *__nptr, char **__endptr, 8141 int __base); 8142 extern unsigned long int strtoul(const char *__nptr, char **__endptr, 8143 int __base); 8144 extern unsigned long long int strtoull(const char *__nptr, char **__endptr, 8145 int __base); 8146 extern unsigned long long int strtouq(const char *__nptr, char **__endptr, 8147 int __base); 8148 extern int system(const char *__command); 8149 extern int unlockpt(int __fd); 8150 extern int unsetenv(const char *__name); 8151 extern size_t wcstombs(char *__s, const wchar_t * __pwcs, size_t __n); 8152 extern int wctomb(char *__s, wchar_t __wchar); 8153 __________________________________________________________ 8154 8155 12.4.60. string.h 8156 8157 #define strerror_r __xpg_strerror_r 8158 8159 extern void *__memcpy_chk(void *, const void *, size_t, size_t); 8160 extern void *__memmove_chk(void *, const void *, size_t, size_t); 8161 extern void *__mempcpy(void *__dest, const void *__src, size_t __n); 8162 extern void *__mempcpy_chk(void *, const void *, size_t, size_t); 8163 extern void *__memset_chk(void *, int, size_t, size_t); 8164 extern char *__stpcpy(char *__dest, const char *__src); 8165 extern char *__stpcpy_chk(char *, const char *, size_t); 8166 extern char *__strcat_chk(char *, const char *, size_t); 8167 extern char *__strcpy_chk(char *, const char *, size_t); 8168 extern char *__strncat_chk(char *, const char *, size_t, size_t); 8169 extern char *__strncpy_chk(char *, const char *, size_t, size_t); 8170 extern char *__strtok_r(char *__s, const char *__delim, char **__save_ptr); 8171 extern int __xpg_strerror_r(int, char *, size_t); 8172 extern void *memccpy(void *__dest, const void *__src, int __c, size_t __n); 8173 extern void *memchr(const void *__s, int __c, size_t __n); 8174 extern int memcmp(const void *__s1, const void *__s2, size_t __n); 8175 extern void *memcpy(void *__dest, const void *__src, size_t __n); 8176 extern void *memmem(const void *__haystack, size_t __haystacklen, 8177 const void *__needle, size_t __needlelen); 8178 extern void *memmove(void *__dest, const void *__src, size_t __n); 8179 extern void *memrchr(const void *__s, int __c, size_t __n); 8180 extern void *memset(void *__s, int __c, size_t __n); 8181 extern char *stpcpy(char *__dest, const char *__src); 8182 extern char *stpncpy(char *__dest, const char *__src, size_t __n); 8183 extern char *strcasestr(const char *__haystack, const char *__needle); 8184 extern char *strcat(char *__dest, const char *__src); 8185 extern char *strchr(const char *__s, int __c); 8186 extern int strcmp(const char *__s1, const char *__s2); 8187 extern int strcoll(const char *__s1, const char *__s2); 8188 extern char *strcpy(char *__dest, const char *__src); 8189 extern size_t strcspn(const char *__s, const char *__reject); 8190 extern char *strdup(const char *__s); 8191 extern char *strerror(int __errnum); 8192 extern size_t strlen(const char *__s); 8193 extern char *strncat(char *__dest, const char *__src, size_t __n); 8194 extern int strncmp(const char *__s1, const char *__s2, size_t __n); 8195 extern char *strncpy(char *__dest, const char *__src, size_t __n); 8196 extern char *strndup(const char *__string, size_t __n); 8197 extern size_t strnlen(const char *__string, size_t __maxlen); 8198 extern char *strpbrk(const char *__s, const char *__accept); 8199 extern char *strrchr(const char *__s, int __c); 8200 extern char *strsep(char **__stringp, const char *__delim); 8201 extern char *strsignal(int __sig); 8202 extern size_t strspn(const char *__s, const char *__accept); 8203 extern char *strstr(const char *__haystack, const char *__needle); 8204 extern char *strtok(char *__s, const char *__delim); 8205 extern char *strtok_r(char *__s, const char *__delim, char **__save_ptr); 8206 extern size_t strxfrm(char *__dest, const char *__src, size_t __n); 8207 __________________________________________________________ 8208 8209 12.4.61. strings.h 8210 8211 extern int bcmp(const void *__s1, const void *__s2, size_t __n); 8212 extern void bcopy(const void *__src, void *__dest, size_t __n); 8213 extern void bzero(void *__s, size_t __n); 8214 extern int ffs(int __i); 8215 extern char *index(const char *__s, int __c); 8216 extern char *rindex(const char *__s, int __c); 8217 extern int strcasecmp(const char *__s1, const char *__s2); 8218 extern int strncasecmp(const char *__s1, const char *__s2, size_t __n); 8219 __________________________________________________________ 8220 8221 12.4.62. sys/epoll.h 8222 8223 #define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */ 8224 #define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */ 8225 #define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */ 8226 #define EPOLLIN 1 8227 #define EPOLLPRI 2 8228 #define EPOLLOUT 4 8229 #define EPOLLERR 8 8230 #define EPOLLHUP 16 8231 #define EPOLLRDHUP 0x2000 8232 #define EPOLLONESHOT (1 << 30) 8233 #define EPOLLET (1 << 31) 8234 8235 typedef union epoll_data { 8236 void *ptr; 8237 int fd; 8238 uint32_t u32; 8239 uint64_t u64; 8240 } epoll_data_t; 8241 8242 struct epoll_event { 8243 uint32_t events; 8244 epoll_data_t data; 8245 }; 8246 extern int epoll_create(int __size); 8247 extern int epoll_ctl(int __epfd, int __op, int __fd, 8248 struct epoll_event *__event); 8249 extern int epoll_wait(int __epfd, struct epoll_event *__events, 8250 int __maxevents, int __timeout); 8251 __________________________________________________________ 8252 8253 12.4.63. sys/file.h 8254 8255 #define LOCK_SH 1 8256 #define LOCK_EX 2 8257 #define LOCK_NB 4 8258 #define LOCK_UN 8 8259 8260 extern int flock(int __fd, int __operation); 8261 __________________________________________________________ 8262 8263 12.4.64. sys/inotify.h 8264 8265 #define IN_ACCESS 0x00000001 8266 #define IN_MODIFY 0x00000002 8267 #define IN_ATTRIB 0x00000004 8268 #define IN_CLOSE_WRITE 0x00000008 8269 #define IN_CLOSE_NOWRITE 0x00000010 8270 #define IN_OPEN 0x00000020 8271 #define IN_MOVED_FROM 0x00000040 8272 #define IN_MOVED_TO 0x00000080 8273 #define IN_CREATE 0x00000100 8274 #define IN_DELETE 0x00000200 8275 #define IN_DELETE_SELF 0x00000400 8276 #define IN_MOVE_SELF 0x00000800 8277 #define IN_UNMOUNT 0x00002000 8278 #define IN_Q_OVERFLOW 0x00004000 8279 #define IN_IGNORED 0x00008000 8280 #define IN_ISDIR 0x40000000 8281 #define IN_ONESHOT 0x80000000 8282 #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) 8283 #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) 8284 #define IN_ALL_EVENTS \ 8285 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ 8286 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | IN_MOVED_TO | IN_CREATE | \ 8287 IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF) 8288 8289 struct inotify_event { 8290 int wd; 8291 uint32_t mask; 8292 uint32_t cookie; 8293 uint32_t len; 8294 char name[]; 8295 }; 8296 extern int inotify_add_watch(int __fd, const char *__name, 8297 uint32_t __mask); 8298 extern int inotify_init(void); 8299 extern int inotify_rm_watch(int __fd, int __wd); 8300 __________________________________________________________ 8301 8302 12.4.65. sys/ioctl.h 8303 8304 struct winsize { 8305 unsigned short ws_row; /* Rows, in characters. */ 8306 unsigned short ws_col; /* Columns, in characters. */ 8307 unsigned short ws_xpixel; /* Horizontal pixels. */ 8308 unsigned short ws_ypixel; /* Vertical pixels. */ 8309 }; 8310 extern int ioctl(int __fd, unsigned long int __request, ...); 8311 __________________________________________________________ 8312 8313 12.4.66. sys/ipc.h 8314 8315 #define IPC_PRIVATE ((key_t)0) 8316 #define IPC_RMID 0 8317 #define IPC_CREAT 00001000 8318 #define IPC_EXCL 00002000 8319 #define IPC_NOWAIT 00004000 8320 #define IPC_SET 1 8321 #define IPC_STAT 2 8322 8323 extern key_t ftok(const char *__pathname, int __proj_id); 8324 __________________________________________________________ 8325 8326 12.4.67. sys/mman.h 8327 8328 #define MAP_FAILED ((void*)-1) 8329 #define POSIX_MADV_NORMAL 0 8330 #define PROT_NONE 0x0 8331 #define MAP_SHARED 0x01 8332 #define MAP_PRIVATE 0x02 8333 #define PROT_READ 0x1 8334 #define MAP_FIXED 0x10 8335 #define PROT_WRITE 0x2 8336 #define MAP_ANONYMOUS 0x20 8337 #define PROT_EXEC 0x4 8338 #define MREMAP_MAYMOVE 1 8339 #define MS_ASYNC 1 8340 #define POSIX_MADV_RANDOM 1 8341 #define MREMAP_FIXED 2 8342 #define MS_INVALIDATE 2 8343 #define POSIX_MADV_SEQUENTIAL 2 8344 #define POSIX_MADV_WILLNEED 3 8345 #define MS_SYNC 4 8346 #define POSIX_MADV_DONTNEED 4 8347 #define MAP_ANON MAP_ANONYMOUS 8348 8349 extern int mlock(const void *__addr, size_t __len); 8350 extern int mlockall(int __flags); 8351 extern void *mmap(void *__addr, size_t __len, int __prot, int __flags, 8352 int __fd, off_t __offset); 8353 extern void *mmap64(void *__addr, size_t __len, int __prot, int __flags, 8354 int __fd, off64_t __offset); 8355 extern int mprotect(void *__addr, size_t __len, int __prot); 8356 extern void *mremap(void *__addr, size_t __old_len, size_t __new_len, 8357 int __flags, ...); 8358 extern int msync(void *__addr, size_t __len, int __flags); 8359 extern int munlock(const void *__addr, size_t __len); 8360 extern int munlockall(void); 8361 extern int munmap(void *__addr, size_t __len); 8362 extern int posix_madvise(void *__addr, size_t __len, int __advice); 8363 extern int shm_open(const char *__name, int __oflag, mode_t __mode); 8364 extern int shm_unlink(const char *__name); 8365 __________________________________________________________ 8366 8367 12.4.68. sys/msg.h 8368 8369 #define MSG_NOERROR 010000 8370 8371 extern int msgctl(int __msqid, int __cmd, struct msqid_ds *__buf); 8372 extern int msgget(key_t __key, int __msgflg); 8373 extern ssize_t msgrcv(int __msqid, void *__msgp, size_t __msgsz, 8374 long int __msgtyp, int __msgflg); 8375 extern int msgsnd(int __msqid, const void *__msgp, size_t __msgsz, 8376 int __msgflg); 8377 __________________________________________________________ 8378 8379 12.4.69. sys/param.h 8380 8381 #define NOFILE 256 8382 #define MAXPATHLEN 4096 8383 __________________________________________________________ 8384 8385 12.4.70. sys/poll.h 8386 8387 #define POLLIN 0x0001 /* There is data to read */ 8388 #define POLLPRI 0x0002 /* There is urgent data to read */ 8389 #define POLLOUT 0x0004 /* Writing now will not block */ 8390 #define POLLERR 0x0008 /* Error condition */ 8391 #define POLLHUP 0x0010 /* Hung up */ 8392 #define POLLNVAL 0x0020 /* Invalid request: fd not open */ 8393 #define POLLRDNORM 0x0040 /* Normal data may be read */ 8394 #define POLLRDBAND 0x0080 /* Priority data may be read */ 8395 #define POLLWRNORM 0x0100 /* Writing now will not block */ 8396 #define POLLWRBAND 0x0200 /* Priority data may be written */ 8397 8398 struct pollfd { 8399 int fd; /* File descriptor to poll. */ 8400 short events; /* Types of events poller cares about. */ 8401 short revents; /* Types of events that actually occurred. */ 8402 }; 8403 typedef unsigned long int nfds_t; 8404 __________________________________________________________ 8405 8406 12.4.71. sys/ptrace.h 8407 8408 enum __ptrace_setoptions { 8409 PTRACE_O_TRACESYSGOOD = 0x00000001, 8410 PTRACE_O_TRACEFORK = 0x00000002, 8411 PTRACE_O_TRACEVFORK = 0x00000004, 8412 PTRACE_O_TRACECLONE = 0x00000008, 8413 PTRACE_O_TRACEEXEC = 0x00000010, 8414 PTRACE_O_TRACEVFORKDONE = 0x00000020, 8415 PTRACE_O_TRACEEXIT = 0x00000040, 8416 PTRACE_O_MASK = 0x0000007f 8417 }; 8418 enum __ptrace_eventcodes { 8419 PTRACE_EVENT_FORK = 1, 8420 PTRACE_EVENT_VFORK = 2, 8421 PTRACE_EVENT_CLONE = 3, 8422 PTRACE_EVENT_EXEC = 4, 8423 PTRACE_EVENT_VFORK_DONE = 5, 8424 PTRACE_EVENT_EXIT = 6 8425 }; 8426 extern long int ptrace(enum __ptrace_request, ...); 8427 __________________________________________________________ 8428 8429 12.4.72. sys/resource.h 8430 8431 #define RUSAGE_CHILDREN (-1) 8432 #define RLIM_INFINITY (~0UL) 8433 #define RLIM_SAVED_CUR -1 8434 #define RLIM_SAVED_MAX -1 8435 #define RLIMIT_CPU 0 8436 #define RUSAGE_SELF 0 8437 #define RLIMIT_FSIZE 1 8438 #define RLIMIT_LOCKS 10 8439 #define RLIM_NLIMITS 11 8440 #define RLIMIT_DATA 2 8441 #define RLIMIT_STACK 3 8442 #define RLIMIT_CORE 4 8443 #define RLIMIT_RSS 5 8444 #define RLIMIT_NPROC 6 8445 #define RLIMIT_NOFILE 7 8446 #define RLIMIT_MEMLOCK 8 8447 #define RLIMIT_AS 9 8448 8449 typedef unsigned long int rlim_t; 8450 typedef unsigned long long int rlim64_t; 8451 typedef int __rlimit_resource_t; 8452 8453 struct rlimit { 8454 rlim_t rlim_cur; /* The current (soft) limit. */ 8455 rlim_t rlim_max; /* The hard limit. */ 8456 }; 8457 struct rlimit64 { 8458 rlim64_t rlim_cur; /* The current (soft) limit. */ 8459 rlim64_t rlim_max; /* The hard limit. */ 8460 }; 8461 8462 struct rusage { 8463 struct timeval ru_utime; /* Total amount of user time used. */ 8464 struct timeval ru_stime; /* Total amount of system time used. */ 8465 long int ru_maxrss; /* Maximum resident set size (in kilobytes). */ 8466 long int ru_ixrss; /* Amount of sharing of text segment memory with other p */ 8467 long int ru_idrss; /* Amount of data segment memory used (kilobyte-seconds). */ 8468 long int ru_isrss; /* Amount of stack memory used (kilobyte-seconds). */ 8469 long int ru_minflt; /* Number of soft page faults (i.e. those serviced by reclaimin */ 8470 long int ru_majflt; /* Number of hard page faults (i.e. those that required I/O). */ 8471 long int ru_nswap; /* Number of times a process was swapped out of physical memory */ 8472 long int ru_inblock; /* Number of input operations via the file system. Note: This */ 8473 long int ru_oublock; /* Number of output operations via the file system. */ 8474 long int ru_msgsnd; /* Number of IPC messages sent. */ 8475 long int ru_msgrcv; /* Number of IPC messages received. */ 8476 long int ru_nsignals; /* Number of signals delivered. */ 8477 long int ru_nvcsw; /* Number of voluntary context switches, i.e. because the proce */ 8478 long int ru_nivcsw; /* Number of involuntary context switches, i.e. a higher priori */ 8479 }; 8480 8481 enum __priority_which { 8482 PRIO_PROCESS = 0, /* WHO is a process ID. */ 8483 PRIO_PGRP = 1, /* WHO is a process group ID. */ 8484 PRIO_USER = 2 /* WHO is a user ID. */ 8485 }; 8486 8487 #define PRIO_PGRP PRIO_PGRP 8488 #define PRIO_PROCESS PRIO_PROCESS 8489 #define PRIO_USER PRIO_USER 8490 8491 typedef enum __priority_which __priority_which_t; 8492 extern int getpriority(__priority_which_t __which, id_t __who); 8493 extern int getrlimit(__rlimit_resource_t __resource, 8494 struct rlimit *__rlimits); 8495 extern int getrlimit64(id_t __resource, struct rlimit64 *__rlimits); 8496 extern int getrusage(int __who, struct rusage *__usage); 8497 extern int setpriority(__priority_which_t __which, id_t __who, int __prio); 8498 extern int setrlimit(__rlimit_resource_t __resource, 8499 const struct rlimit *__rlimits); 8500 extern int setrlimit64(__rlimit_resource_t __resource, 8501 const struct rlimit64 *__rlimits); 8502 __________________________________________________________ 8503 8504 12.4.73. sys/select.h 8505 8506 #define NFDBITS (8 * sizeof (long)) 8507 8508 extern int pselect(int __nfds, fd_set * __readfds, fd_set * __writefds, 8509 fd_set * __exceptfds, const struct timespec *__timeout, 8510 const sigset_t * __sigmask); 8511 __________________________________________________________ 8512 8513 12.4.74. sys/sem.h 8514 8515 #define SEM_UNDO 0x1000 8516 #define GETPID 11 8517 #define GETVAL 12 8518 #define GETALL 13 8519 #define GETNCNT 14 8520 #define GETZCNT 15 8521 #define SETVAL 16 8522 #define SETALL 17 8523 8524 struct sembuf { 8525 short sem_num; 8526 short sem_op; 8527 short sem_flg; 8528 }; 8529 extern int semctl(int __semid, int __semnum, int __cmd, ...); 8530 extern int semget(key_t __key, int __nsems, int __semflg); 8531 extern int semop(int __semid, struct sembuf *__sops, size_t __nsops); 8532 __________________________________________________________ 8533 8534 12.4.75. sys/sendfile.h 8535 8536 extern ssize_t sendfile(int __out_fd, int __in_fd, off_t * __offset, 8537 size_t __count); 8538 extern ssize_t sendfile64(int __out_fd, int __in_fd, off64_t * __offset, 8539 size_t __count); 8540 __________________________________________________________ 8541 8542 12.4.76. sys/shm.h 8543 8544 #define SHM_RDONLY 010000 8545 #define SHM_W 0200 8546 #define SHM_RND 020000 8547 #define SHM_R 0400 8548 #define SHM_REMAP 040000 8549 #define SHM_LOCK 11 8550 #define SHM_UNLOCK 12 8551 8552 extern int __getpagesize(void); 8553 extern void *shmat(int __shmid, const void *__shmaddr, int __shmflg); 8554 extern int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf); 8555 extern int shmdt(const void *__shmaddr); 8556 extern int shmget(key_t __key, size_t __size, int __shmflg); 8557 __________________________________________________________ 8558 8559 12.4.77. sys/socket.h 8560 8561 #define CMSG_FIRSTHDR(msg) ((size_t) (msg)->msg_controllen >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(msg)->msg_control : (struct cmsghdr *) NULL) 8562 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 8563 #define SCM_RIGHTS 0x01 8564 #define SOL_SOCKET 1 8565 #define SOMAXCONN 128 8566 #define SOL_RAW 255 8567 #define CMSG_ALIGN(len) \ 8568 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 8569 #define CMSG_DATA(cmsg) \ 8570 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 8571 #define CMSG_SPACE(len) \ 8572 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 8573 #define CMSG_NXTHDR(mhdr,cmsg) \ 8574 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 8575 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 8576 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 8577 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \ 8578 (struct cmsghdr *)NULL : \ 8579 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 8580 8581 struct linger { 8582 int l_onoff; 8583 int l_linger; 8584 }; 8585 struct cmsghdr { 8586 size_t cmsg_len; 8587 int cmsg_level; 8588 int cmsg_type; 8589 }; 8590 struct iovec { 8591 void *iov_base; 8592 size_t iov_len; 8593 }; 8594 8595 typedef unsigned short sa_family_t; 8596 typedef unsigned int socklen_t; 8597 8598 struct sockaddr { 8599 sa_family_t sa_family; 8600 char sa_data[14]; 8601 }; 8602 struct sockaddr_storage { 8603 sa_family_t ss_family; 8604 __ss_aligntype __ss_align; 8605 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 8606 }; 8607 8608 struct msghdr { 8609 void *msg_name; 8610 int msg_namelen; 8611 struct iovec *msg_iov; 8612 size_t msg_iovlen; 8613 void *msg_control; 8614 size_t msg_controllen; 8615 unsigned int msg_flags; 8616 }; 8617 8618 #define AF_UNSPEC 0 8619 #define AF_UNIX 1 8620 #define AF_INET6 10 8621 #define AF_INET 2 8622 8623 #define PF_INET AF_INET 8624 #define PF_INET6 AF_INET6 8625 #define PF_UNIX AF_UNIX 8626 #define PF_UNSPEC AF_UNSPEC 8627 8628 #define SOCK_STREAM 1 8629 #define SOCK_PACKET 10 8630 #define SOCK_DGRAM 2 8631 #define SOCK_RAW 3 8632 #define SOCK_RDM 4 8633 #define SOCK_SEQPACKET 5 8634 8635 #define SO_DEBUG 1 8636 #define SO_OOBINLINE 10 8637 #define SO_NO_CHECK 11 8638 #define SO_PRIORITY 12 8639 #define SO_LINGER 13 8640 #define SO_BSDCOMPAT 14 8641 #define SO_REUSEADDR 2 8642 #define SO_TYPE 3 8643 #define SO_ACCEPTCONN 30 8644 #define SO_ERROR 4 8645 #define SO_DONTROUTE 5 8646 #define SO_BROADCAST 6 8647 #define SO_SNDBUF 7 8648 #define SO_RCVBUF 8 8649 #define SO_KEEPALIVE 9 8650 8651 #define SIOCGIFNAME 0x8910 8652 #define SIOCGIFCONF 0x8912 8653 #define SIOCGIFFLAGS 0x8913 8654 #define SIOCGIFADDR 0x8915 8655 #define SIOCGIFDSTADDR 0x8917 8656 #define SIOCGIFBRDADDR 0x8919 8657 #define SIOCGIFNETMASK 0x891b 8658 #define SIOCGIFMTU 0x8921 8659 #define SIOCGIFHWADDR 0x8927 8660 8661 #define SHUT_RD 0 8662 #define SHUT_WR 1 8663 #define SHUT_RDWR 2 8664 8665 #define MSG_WAITALL 0x100 8666 #define MSG_TRUNC 0x20 8667 #define MSG_NOSIGNAL 0x4000 8668 #define MSG_EOR 0x80 8669 #define MSG_OOB 1 8670 #define MSG_PEEK 2 8671 #define MSG_DONTROUTE 4 8672 #define MSG_CTRUNC 8 8673 8674 extern ssize_t __recv_chk(int, void *, size_t, size_t, int); 8675 extern ssize_t __recvfrom_chk(int, void *, size_t, size_t, int, 8676 struct sockaddr *, socklen_t *); 8677 extern int accept(int __fd, struct sockaddr *__addr, 8678 socklen_t * __addr_len); 8679 extern int bind(int __fd, const struct sockaddr *__addr, socklen_t __len); 8680 extern int connect(int __fd, const struct sockaddr *__addr, 8681 socklen_t __len); 8682 extern int getnameinfo(const struct sockaddr *__sa, socklen_t __salen, 8683 char *__host, socklen_t __hostlen, char *__serv, 8684 socklen_t __servlen, unsigned int __flags); 8685 extern int getpeername(int __fd, struct sockaddr *__addr, 8686 socklen_t * __len); 8687 extern int getsockname(int __fd, struct sockaddr *__addr, 8688 socklen_t * __len); 8689 extern int getsockopt(int __fd, int __level, int __optname, void *__optval, 8690 socklen_t * __optlen); 8691 extern int listen(int __fd, int __n); 8692 extern ssize_t recv(int __fd, void *__buf, size_t __n, int __flags); 8693 extern ssize_t recvfrom(int __fd, void *__buf, size_t __n, int __flags, 8694 struct sockaddr *__addr, socklen_t * __addr_len); 8695 extern ssize_t recvmsg(int __fd, struct msghdr *__message, int __flags); 8696 extern ssize_t send(int __fd, const void *__buf, size_t __n, int __flags); 8697 extern ssize_t sendmsg(int __fd, const struct msghdr *__message, 8698 int __flags); 8699 extern ssize_t sendto(int __fd, const void *__buf, size_t __n, int __flags, 8700 const struct sockaddr *__addr, socklen_t __addr_len); 8701 extern int setsockopt(int __fd, int __level, int __optname, 8702 const void *__optval, socklen_t __optlen); 8703 extern int shutdown(int __fd, int __how); 8704 extern int sockatmark(int __fd); 8705 extern int socket(int __domain, int __type, int __protocol); 8706 extern int socketpair(int __domain, int __type, int __protocol, 8707 int __fds[2]); 8708 __________________________________________________________ 8709 8710 12.4.78. sys/stat.h 8711 8712 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 8713 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 8714 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 8715 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 8716 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 8717 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 8718 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 8719 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 8720 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 8721 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 8722 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 8723 #define S_IROTH (S_IRGRP>>3) 8724 #define S_IRGRP (S_IRUSR>>3) 8725 #define S_IRWXO (S_IRWXG>>3) 8726 #define S_IRWXG (S_IRWXU>>3) 8727 #define S_IWOTH (S_IWGRP>>3) 8728 #define S_IWGRP (S_IWUSR>>3) 8729 #define S_IXOTH (S_IXGRP>>3) 8730 #define S_IXGRP (S_IXUSR>>3) 8731 #define S_ISVTX 01000 8732 #define S_IXUSR 0x0040 8733 #define S_IWUSR 0x0080 8734 #define S_IRUSR 0x0100 8735 #define S_ISGID 0x0400 8736 #define S_ISUID 0x0800 8737 #define S_IFIFO 0x1000 8738 #define S_IFCHR 0x2000 8739 #define S_IFDIR 0x4000 8740 #define S_IFBLK 0x6000 8741 #define S_IFREG 0x8000 8742 #define S_IFLNK 0xa000 8743 #define S_IFSOCK 0xc000 8744 #define S_IFMT 0xf000 8745 #define st_atime st_atim.tv_sec 8746 #define st_ctime st_ctim.tv_sec 8747 #define st_mtime st_mtim.tv_sec 8748 #define S_IREAD S_IRUSR 8749 #define S_IWRITE S_IWUSR 8750 #define S_IEXEC S_IXUSR 8751 8752 extern int __fxstat(int __ver, int __fildes, struct stat *__stat_buf); 8753 extern int __fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf); 8754 extern int __fxstatat(int __ver, int __fildes, const char *__filename, 8755 struct stat *__stat_buf, int __flag); 8756 extern int __fxstatat64(int __ver, int __fildes, const char *__filename, 8757 struct stat64 *__stat_buf, int __flag); 8758 extern int __lxstat(int __ver, const char *__filename, 8759 struct stat *__stat_buf); 8760 extern int __lxstat64(int __ver, const char *__filename, 8761 struct stat64 *__stat_buf); 8762 extern int __xmknod(int __ver, const char *__path, mode_t __mode, 8763 dev_t * __dev); 8764 extern int __xmknodat(int __ver, int __fd, const char *__path, 8765 mode_t __mode, dev_t * __dev); 8766 extern int __xstat(int __ver, const char *__filename, 8767 struct stat *__stat_buf); 8768 extern int __xstat64(int __ver, const char *__filename, 8769 struct stat64 *__stat_buf); 8770 extern int chmod(const char *__file, mode_t __mode); 8771 extern int fchmod(int __fd, mode_t __mode); 8772 extern int fchmodat(int __fd, const char *__file, mode_t mode, int __flag); 8773 extern int fstat(int __fd, struct stat *__buf); 8774 extern int fstat64(int __fd, struct stat64 *__buf); 8775 extern int fstatat(int __fd, const char *__file, struct stat *__buf, 8776 int __flag); 8777 extern int fstatat64(int __fd, const char *__file, struct stat64 *__buf, 8778 int __flag); 8779 extern int lstat(const char *__file, struct stat *__buf); 8780 extern int lstat64(const char *__file, struct stat64 *__buf); 8781 extern int mkdir(const char *__path, mode_t __mode); 8782 extern int mkdirat(int __fd, const char *__path, mode_t __mode); 8783 extern int mkfifo(const char *__path, mode_t __mode); 8784 extern int mkfifoat(int __fd, const char *__path, mode_t __mode); 8785 extern int mknod(const char *__path, mode_t __mode, dev_t __dev); 8786 extern int mknodat(int __fd, const char *__path, mode_t __mode, 8787 dev_t __dev); 8788 extern int stat(const char *__file, struct stat *__buf); 8789 extern int stat64(const char *__file, struct stat64 *__buf); 8790 extern mode_t umask(mode_t __mask); 8791 __________________________________________________________ 8792 8793 12.4.79. sys/statfs.h 8794 8795 #define NFS_SUPER_MAGIC 0x6969 8796 8797 extern int fstatfs(int __fildes, struct statfs *__buf); 8798 extern int fstatfs64(int __fildes, struct statfs64 *__buf); 8799 extern int statfs(const char *__file, struct statfs *__buf); 8800 extern int statfs64(const char *__file, struct statfs64 *__buf); 8801 __________________________________________________________ 8802 8803 12.4.80. sys/statvfs.h 8804 8805 extern int fstatvfs(int __fildes, struct statvfs *__buf); 8806 extern int fstatvfs64(int __fildes, struct statvfs64 *__buf); 8807 extern int statvfs(const char *__file, struct statvfs *__buf); 8808 extern int statvfs64(const char *__file, struct statvfs64 *__buf); 8809 __________________________________________________________ 8810 8811 12.4.81. sys/sysinfo.h 8812 8813 struct sysinfo { 8814 long int uptime; /* Seconds since boot */ 8815 unsigned long int loads[3]; /* 1, 5, and 15 minute load averages */ 8816 unsigned long int totalram; /* Total usable main memory size */ 8817 unsigned long int freeram; /* Available memory size */ 8818 unsigned long int sharedram; /* Amount of shared memory */ 8819 unsigned long int bufferram; /* Memory used by buffers */ 8820 unsigned long int totalswap; /* Total swap space size */ 8821 unsigned long int freeswap; /* Swap space still available */ 8822 unsigned short procs; /* Number of current processes */ 8823 unsigned short pad; /* Padding for m68k */ 8824 unsigned long int totalhigh; /* Total high memory size */ 8825 unsigned long int freehigh; /* Available high memory size */ 8826 unsigned int mem_unit; /* Memory unit size in bytes */ 8827 char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding for libc5 */ 8828 }; 8829 extern int sysinfo(struct sysinfo *info); 8830 __________________________________________________________ 8831 8832 12.4.82. sys/time.h 8833 8834 #define ITIMER_REAL 0 8835 #define ITIMER_VIRTUAL 1 8836 #define ITIMER_PROF 2 8837 8838 struct timezone { 8839 int tz_minuteswest; 8840 int tz_dsttime; 8841 }; 8842 8843 typedef int __itimer_which_t; 8844 8845 struct timespec { 8846 time_t tv_sec; 8847 long int tv_nsec; 8848 }; 8849 8850 struct timeval { 8851 time_t tv_sec; 8852 suseconds_t tv_usec; 8853 }; 8854 8855 struct itimerval { 8856 struct timeval it_interval; 8857 struct timeval it_value; 8858 }; 8859 extern int adjtime(const struct timeval *__delta, 8860 struct timeval *__olddelta); 8861 extern int getitimer(__itimer_which_t __which, struct itimerval *__value); 8862 extern int gettimeofday(struct timeval *__tv, struct timezone *__tz); 8863 extern int setitimer(__itimer_which_t __which, 8864 const struct itimerval *__new, 8865 struct itimerval *__old); 8866 extern int utimes(const char *__file, const struct timeval *__tvp); 8867 __________________________________________________________ 8868 8869 12.4.83. sys/timeb.h 8870 8871 struct timeb { 8872 time_t time; /* Seconds since epoch, as from time. */ 8873 unsigned short millitm; /* Additional milliseconds. */ 8874 short timezone; /* Minutes west of GMT. */ 8875 short dstflag; /* Nonzero if Daylight Savings Time used. */ 8876 }; 8877 extern int ftime(struct timeb *__timebuf); 8878 __________________________________________________________ 8879 8880 12.4.84. sys/times.h 8881 8882 struct tms { 8883 clock_t tms_utime; 8884 clock_t tms_stime; 8885 clock_t tms_cutime; 8886 clock_t tms_cstime; 8887 }; 8888 extern clock_t times(struct tms *__buffer); 8889 __________________________________________________________ 8890 8891 12.4.85. sys/types.h 8892 8893 #ifndef FALSE 8894 #define FALSE 0 8895 #endif 8896 #ifndef TRUE 8897 #define TRUE 1 8898 #endif 8899 #define FD_SETSIZE 1024 8900 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 8901 #define FD_ISSET(d,set) \ 8902 (((set)->fds_bits[((d)/(8*sizeof(long)))]&(1L<<((d)%(8*sizeof(long)))))!=0) 8903 #define FD_CLR(d,set) \ 8904 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1L<<((d)%(8*sizeof(long))))) 8905 #define FD_SET(d,set) \ 8906 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1L<<((d)%(8*sizeof(long))))) 8907 8908 typedef unsigned char u_int8_t; 8909 typedef unsigned short u_int16_t; 8910 typedef unsigned int u_int32_t; 8911 typedef unsigned long long int u_int64_t; 8912 typedef unsigned int uid_t; 8913 typedef int pid_t; 8914 typedef long int off_t; 8915 typedef int key_t; 8916 typedef long int suseconds_t; 8917 typedef unsigned int u_int; 8918 typedef struct { 8919 int __val[2]; 8920 } fsid_t; 8921 typedef unsigned int useconds_t; 8922 typedef long int blksize_t; 8923 typedef long int fd_mask; 8924 typedef void *timer_t; 8925 typedef int clockid_t; 8926 8927 typedef unsigned int id_t; 8928 8929 typedef unsigned long long int ino64_t; 8930 typedef long long int loff_t; 8931 typedef long int blkcnt_t; 8932 typedef unsigned long int fsblkcnt_t; 8933 typedef unsigned long int fsfilcnt_t; 8934 typedef long long int blkcnt64_t; 8935 typedef unsigned long long int fsblkcnt64_t; 8936 typedef unsigned long long int fsfilcnt64_t; 8937 typedef unsigned char u_char; 8938 typedef unsigned short u_short; 8939 typedef unsigned long int u_long; 8940 8941 typedef unsigned long int ino_t; 8942 typedef unsigned int gid_t; 8943 typedef unsigned long long int dev_t; 8944 typedef unsigned int mode_t; 8945 typedef unsigned long int nlink_t; 8946 typedef char *caddr_t; 8947 8948 typedef struct { 8949 unsigned long int fds_bits[__FDSET_LONGS]; 8950 } fd_set; 8951 8952 typedef long int clock_t; 8953 typedef long int time_t; 8954 __________________________________________________________ 8955 8956 12.4.86. sys/uio.h 8957 8958 extern ssize_t readv(int __fd, const struct iovec *__iovec, int __count); 8959 extern ssize_t writev(int __fd, const struct iovec *__iovec, int __count); 8960 __________________________________________________________ 8961 8962 12.4.87. sys/un.h 8963 8964 #define UNIX_PATH_MAX 108 8965 8966 struct sockaddr_un { 8967 sa_family_t sun_family; /* AF_UNIX */ 8968 char sun_path[UNIX_PATH_MAX]; 8969 }; 8970 __________________________________________________________ 8971 8972 12.4.88. sys/utsname.h 8973 8974 #define SYS_NMLN 65 8975 8976 struct utsname { 8977 char sysname[65]; 8978 char nodename[65]; 8979 char release[65]; 8980 char version[65]; 8981 char machine[65]; 8982 char domainname[65]; 8983 }; 8984 extern int uname(struct utsname *__name); 8985 __________________________________________________________ 8986 8987 12.4.89. sys/wait.h 8988 8989 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 8990 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 8991 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 8992 #define WTERMSIG(status) ((status) & 0x7f) 8993 #define WCOREDUMP(status) ((status) & 0x80) 8994 #define WIFEXITED(status) (WTERMSIG(status) == 0) 8995 #define WNOHANG 0x00000001 8996 #define WUNTRACED 0x00000002 8997 #define WCOREFLAG 0x80 8998 #define WSTOPSIG(status) WEXITSTATUS(status) 8999 9000 typedef enum { 9001 P_ALL, 9002 P_PID, 9003 P_PGID 9004 } idtype_t; 9005 extern pid_t wait(int *__stat_loc); 9006 extern pid_t wait4(pid_t __pid, int *__stat_loc, int __options, 9007 struct rusage *__usage); 9008 extern int waitid(idtype_t __idtype, id_t __id, siginfo_t * __infop, 9009 int __options); 9010 extern pid_t waitpid(pid_t __pid, int *__stat_loc, int __options); 9011 __________________________________________________________ 9012 9013 12.4.90. syslog.h 9014 9015 #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) 9016 #define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */ 9017 #define LOG_EMERG 0 /* system is unusable */ 9018 #define LOG_PRIMASK 0x07 /* mask to extract priority part */ 9019 #define LOG_ALERT 1 /* action must be taken immediately */ 9020 #define LOG_CRIT 2 /* critical conditions */ 9021 #define LOG_ERR 3 /* error conditions */ 9022 #define LOG_WARNING 4 /* warning conditions */ 9023 #define LOG_NOTICE 5 /* normal but significant condition */ 9024 #define LOG_INFO 6 /* informational */ 9025 #define LOG_DEBUG 7 /* debug-level messages */ 9026 9027 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */ 9028 #define LOG_KERN (0<<3) /* kernel messages */ 9029 #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ 9030 #define LOG_FTP (11<<3) /* ftp daemon */ 9031 #define LOG_USER (1<<3) /* random user-level messages */ 9032 #define LOG_MAIL (2<<3) /* mail system */ 9033 #define LOG_DAEMON (3<<3) /* system daemons */ 9034 #define LOG_AUTH (4<<3) /* security/authorization messages */ 9035 #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ 9036 #define LOG_LPR (6<<3) /* line printer subsystem */ 9037 #define LOG_NEWS (7<<3) /* network news subsystem */ 9038 #define LOG_UUCP (8<<3) /* UUCP subsystem */ 9039 #define LOG_CRON (9<<3) /* clock daemon */ 9040 #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ 9041 9042 #define LOG_LOCAL0 (16<<3) /* reserved for local use */ 9043 #define LOG_LOCAL1 (17<<3) /* reserved for local use */ 9044 #define LOG_LOCAL2 (18<<3) /* reserved for local use */ 9045 #define LOG_LOCAL3 (19<<3) /* reserved for local use */ 9046 #define LOG_LOCAL4 (20<<3) /* reserved for local use */ 9047 #define LOG_LOCAL5 (21<<3) /* reserved for local use */ 9048 #define LOG_LOCAL6 (22<<3) /* reserved for local use */ 9049 #define LOG_LOCAL7 (23<<3) /* reserved for local use */ 9050 9051 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ 9052 #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ 9053 9054 #define LOG_PID 0x01 /* log the pid with each message */ 9055 #define LOG_CONS 0x02 /* log on the console if errors in sending */ 9056 #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ 9057 #define LOG_NDELAY 0x08 /* don't delay open */ 9058 #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ 9059 #define LOG_PERROR 0x20 /* log to stderr as well */ 9060 9061 extern void __syslog_chk(int, int, const char *, ...); 9062 extern void __vsyslog_chk(int, int, const char *, va_list); 9063 extern void closelog(void); 9064 extern void openlog(const char *__ident, int __option, int __facility); 9065 extern int setlogmask(int __mask); 9066 extern void syslog(int __pri, const char *__fmt, ...); 9067 extern void vsyslog(int __pri, const char *__fmt, va_list __ap); 9068 __________________________________________________________ 9069 9070 12.4.91. tar.h 9071 9072 #define REGTYPE '0' 9073 #define LNKTYPE '1' 9074 #define SYMTYPE '2' 9075 #define CHRTYPE '3' 9076 #define BLKTYPE '4' 9077 #define DIRTYPE '5' 9078 #define FIFOTYPE '6' 9079 #define CONTTYPE '7' 9080 #define AREGTYPE '\0' 9081 #define TVERSION "00" 9082 #define TOEXEC 00001 9083 #define TOWRITE 00002 9084 #define TOREAD 00004 9085 #define TGEXEC 00010 9086 #define TGWRITE 00020 9087 #define TGREAD 00040 9088 #define TUEXEC 00100 9089 #define TUWRITE 00200 9090 #define TUREAD 00400 9091 #define TSVTX 01000 9092 #define TSGID 02000 9093 #define TSUID 04000 9094 #define TVERSLEN 2 9095 #define TMAGLEN 6 9096 #define TMAGIC "ustar" 9097 __________________________________________________________ 9098 9099 12.4.92. termios.h 9100 9101 #define TCIFLUSH 0 9102 #define TCOOFF 0 9103 #define TCSANOW 0 9104 #define BS0 0000000 9105 #define CR0 0000000 9106 #define FF0 0000000 9107 #define NL0 0000000 9108 #define TAB0 0000000 9109 #define VT0 0000000 9110 #define OPOST 0000001 9111 #define OCRNL 0000010 9112 #define ONOCR 0000020 9113 #define ONLRET 0000040 9114 #define OFILL 0000100 9115 #define OFDEL 0000200 9116 #define NL1 0000400 9117 #define TCOFLUSH 1 9118 #define TCOON 1 9119 #define TCSADRAIN 1 9120 #define TCIOFF 2 9121 #define TCIOFLUSH 2 9122 #define TCSAFLUSH 2 9123 #define TCION 3 9124 9125 typedef unsigned int speed_t; 9126 typedef unsigned char cc_t; 9127 typedef unsigned int tcflag_t; 9128 9129 #define NCCS 32 9130 9131 struct termios { 9132 tcflag_t c_iflag; /* input mode flags */ 9133 tcflag_t c_oflag; /* output mode flags */ 9134 tcflag_t c_cflag; /* control mode flags */ 9135 tcflag_t c_lflag; /* local mode flags */ 9136 cc_t c_line; /* line discipline */ 9137 cc_t c_cc[NCCS]; /* control characters */ 9138 speed_t c_ispeed; /* input speed */ 9139 speed_t c_ospeed; /* output speed */ 9140 }; 9141 9142 #define VINTR 0 9143 #define VQUIT 1 9144 #define VLNEXT 15 9145 #define VERASE 2 9146 #define VKILL 3 9147 #define VEOF 4 9148 9149 #define IGNBRK 0000001 9150 #define BRKINT 0000002 9151 #define IGNPAR 0000004 9152 #define PARMRK 0000010 9153 #define INPCK 0000020 9154 #define ISTRIP 0000040 9155 #define INLCR 0000100 9156 #define IGNCR 0000200 9157 #define ICRNL 0000400 9158 #define IXANY 0004000 9159 #define IMAXBEL 0020000 9160 9161 #define CS5 0000000 9162 9163 #define ECHO 0000010 9164 9165 #define B0 0000000 9166 #define B50 0000001 9167 #define B75 0000002 9168 #define B110 0000003 9169 #define B134 0000004 9170 #define B150 0000005 9171 #define B200 0000006 9172 #define B300 0000007 9173 #define B600 0000010 9174 #define B1200 0000011 9175 #define B1800 0000012 9176 #define B2400 0000013 9177 #define B4800 0000014 9178 #define B9600 0000015 9179 #define B19200 0000016 9180 #define B38400 0000017 9181 9182 extern speed_t cfgetispeed(const struct termios *__termios_p); 9183 extern speed_t cfgetospeed(const struct termios *__termios_p); 9184 extern void cfmakeraw(struct termios *__termios_p); 9185 extern int cfsetispeed(struct termios *__termios_p, speed_t __speed); 9186 extern int cfsetospeed(struct termios *__termios_p, speed_t __speed); 9187 extern int cfsetspeed(struct termios *__termios_p, speed_t __speed); 9188 extern int tcdrain(int __fd); 9189 extern int tcflow(int __fd, int __action); 9190 extern int tcflush(int __fd, int __queue_selector); 9191 extern int tcgetattr(int __fd, struct termios *__termios_p); 9192 extern pid_t tcgetsid(int __fd); 9193 extern int tcsendbreak(int __fd, int __duration); 9194 extern int tcsetattr(int __fd, int __optional_actions, 9195 const struct termios *__termios_p); 9196 __________________________________________________________ 9197 9198 12.4.93. time.h 9199 9200 #define CLK_TCK ((clock_t)sysconf(2)) 9201 #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 9202 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 9203 #define CLOCK_REALTIME 0 9204 #define CLOCK_MONOTONIC 1 9205 #define TIMER_ABSTIME 1 9206 #define CLOCKS_PER_SEC 1000000l 9207 #define CLOCK_PROCESS_CPUTIME_ID 2 9208 #define CLOCK_THREAD_CPUTIME_ID 3 9209 #define timeradd(a,b,result) \ 9210 do { \ 9211 (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ 9212 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ 9213 if ((result)->tv_usec >= 1000000) \ 9214 { \ 9215 ++(result)->tv_sec; \ 9216 (result)->tv_usec -= 1000000; \ 9217 } \ 9218 } while (0) 9219 #define timersub(a,b,result) \ 9220 do { \ 9221 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ 9222 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ 9223 if ((result)->tv_usec < 0) { \ 9224 --(result)->tv_sec; \ 9225 (result)->tv_usec += 1000000; \ 9226 } \ 9227 } while (0) 9228 #define timercmp(a,b,CMP) \ 9229 (((a)->tv_sec == (b)->tv_sec) ? \ 9230 ((a)->tv_usec CMP (b)->tv_usec) : \ 9231 ((a)->tv_sec CMP (b)->tv_sec)) 9232 9233 struct tm { 9234 int tm_sec; 9235 int tm_min; 9236 int tm_hour; 9237 int tm_mday; 9238 int tm_mon; 9239 int tm_year; 9240 int tm_wday; 9241 int tm_yday; 9242 int tm_isdst; 9243 long int tm_gmtoff; 9244 char *tm_zone; 9245 }; 9246 struct itimerspec { 9247 struct timespec it_interval; 9248 struct timespec it_value; 9249 }; 9250 9251 extern int __daylight; 9252 extern long int __timezone; 9253 extern char *__tzname[]; 9254 extern char *asctime(const struct tm *__tp); 9255 extern char *asctime_r(const struct tm *__tp, char *__buf); 9256 extern clock_t clock(void); 9257 extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id); 9258 extern int clock_getres(clockid_t __clock_id, struct timespec *__res); 9259 extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp); 9260 extern int clock_nanosleep(clockid_t __clock_id, int __flags, 9261 const struct timespec *__req, 9262 struct timespec *__rem); 9263 extern int clock_settime(clockid_t __clock_id, 9264 const struct timespec *__tp); 9265 extern char *ctime(const time_t * __timer); 9266 extern char *ctime_r(const time_t * __timer, char *__buf); 9267 extern int daylight; 9268 extern double difftime(time_t __time1, time_t __time0); 9269 extern struct tm *getdate(const char *__string); 9270 extern int getdate_err; 9271 extern struct tm *gmtime(const time_t * __timer); 9272 extern struct tm *gmtime_r(const time_t * __timer, struct tm *__tp); 9273 extern struct tm *localtime(const time_t * __timer); 9274 extern struct tm *localtime_r(const time_t * __timer, struct tm *__tp); 9275 extern time_t mktime(struct tm *__tp); 9276 extern int nanosleep(const struct timespec *__requested_time, 9277 struct timespec *__remaining); 9278 extern int stime(const time_t * __when); 9279 extern size_t strftime(char *__s, size_t __maxsize, const char *__format, 9280 const struct tm *__tp); 9281 extern char *strptime(const char *__s, const char *__fmt, struct tm *__tp); 9282 extern time_t time(time_t * __timer); 9283 extern int timer_create(clockid_t __clock_id, struct sigevent *__evp, 9284 timer_t * __timerid); 9285 extern int timer_delete(timer_t __timerid); 9286 extern int timer_getoverrun(timer_t __timerid); 9287 extern int timer_gettime(timer_t __timerid, struct itimerspec *__value); 9288 extern int timer_settime(timer_t __timerid, int __flags, 9289 const struct itimerspec *__value, 9290 struct itimerspec *__ovalue); 9291 extern long int timezone; 9292 extern char *tzname[]; 9293 extern void tzset(void); 9294 __________________________________________________________ 9295 9296 12.4.94. ucontext.h 9297 9298 extern int getcontext(ucontext_t * __ucp); 9299 extern void makecontext(ucontext_t * __ucp, void (*__func) (void), 9300 int __argc, ...); 9301 extern int setcontext(const struct ucontext *__ucp); 9302 extern int swapcontext(ucontext_t * __oucp, const struct ucontext *__ucp); 9303 __________________________________________________________ 9304 9305 12.4.95. ulimit.h 9306 9307 #define UL_GETFSIZE 1 9308 #define UL_SETFSIZE 2 9309 9310 extern long int ulimit(int __cmd, ...); 9311 __________________________________________________________ 9312 9313 12.4.96. unistd.h 9314 9315 #define SEEK_SET 0 9316 #define STDIN_FILENO 0 9317 #define SEEK_CUR 1 9318 #define STDOUT_FILENO 1 9319 #define SEEK_END 2 9320 #define STDERR_FILENO 2 9321 9322 typedef long long int off64_t; 9323 9324 #define F_OK 0 9325 #define X_OK 1 9326 #define W_OK 2 9327 #define R_OK 4 9328 9329 #define _POSIX_VDISABLE '\0' 9330 #define _POSIX_CHOWN_RESTRICTED 1 9331 #define _POSIX_JOB_CONTROL 1 9332 #define _POSIX_NO_TRUNC 1 9333 #define _POSIX_SHELL 1 9334 #define _POSIX2_C_BIND 200112L 9335 #define _POSIX2_VERSION 200112L 9336 #define _POSIX_FSYNC 200112L 9337 #define _POSIX_MAPPED_FILES 200112L 9338 #define _POSIX_MEMLOCK 200112L 9339 #define _POSIX_MEMLOCK_RANGE 200112L 9340 #define _POSIX_MEMORY_PROTECTION 200112L 9341 #define _POSIX_SEMAPHORES 200112L 9342 #define _POSIX_SHARED_MEMORY_OBJECTS 200112L 9343 #define _POSIX_THREADS 200112L 9344 #define _POSIX_THREAD_PROCESS_SHARED 200112L 9345 #define _POSIX_TIMERS 200112L 9346 #define _POSIX_VERSION 200112L 9347 9348 #define _PC_LINK_MAX 0 9349 #define _PC_MAX_CANON 1 9350 #define _PC_ASYNC_IO 10 9351 #define _PC_PRIO_IO 11 9352 #define _PC_FILESIZEBITS 13 9353 #define _PC_REC_INCR_XFER_SIZE 14 9354 #define _PC_REC_MIN_XFER_SIZE 16 9355 #define _PC_REC_XFER_ALIGN 17 9356 #define _PC_ALLOC_SIZE_MIN 18 9357 #define _PC_MAX_INPUT 2 9358 #define _PC_2_SYMLINKS 20 9359 #define _PC_NAME_MAX 3 9360 #define _PC_PATH_MAX 4 9361 #define _PC_PIPE_BUF 5 9362 #define _PC_CHOWN_RESTRICTED 6 9363 #define _PC_NO_TRUNC 7 9364 #define _PC_VDISABLE 8 9365 #define _PC_SYNC_IO 9 9366 9367 #define _SC_ARG_MAX 0 9368 #define _SC_CHILD_MAX 1 9369 #define _SC_PRIORITY_SCHEDULING 10 9370 #define _SC_XOPEN_XPG4 100 9371 #define _SC_CHAR_BIT 101 9372 #define _SC_CHAR_MAX 102 9373 #define _SC_CHAR_MIN 103 9374 #define _SC_INT_MAX 104 9375 #define _SC_INT_MIN 105 9376 #define _SC_LONG_BIT 106 9377 #define _SC_WORD_BIT 107 9378 #define _SC_MB_LEN_MAX 108 9379 #define _SC_NZERO 109 9380 #define _SC_TIMERS 11 9381 #define _SC_SSIZE_MAX 110 9382 #define _SC_SCHAR_MAX 111 9383 #define _SC_SCHAR_MIN 112 9384 #define _SC_SHRT_MAX 113 9385 #define _SC_SHRT_MIN 114 9386 #define _SC_UCHAR_MAX 115 9387 #define _SC_UINT_MAX 116 9388 #define _SC_ULONG_MAX 117 9389 #define _SC_USHRT_MAX 118 9390 #define _SC_NL_ARGMAX 119 9391 #define _SC_ASYNCHRONOUS_IO 12 9392 #define _SC_NL_LANGMAX 120 9393 #define _SC_NL_MSGMAX 121 9394 #define _SC_NL_NMAX 122 9395 #define _SC_NL_SETMAX 123 9396 #define _SC_NL_TEXTMAX 124 9397 #define _SC_XBS5_ILP32_OFF32 125 9398 #define _SC_XBS5_ILP32_OFFBIG 126 9399 #define _SC_XBS5_LP64_OFF64 127 9400 #define _SC_XBS5_LPBIG_OFFBIG 128 9401 #define _SC_XOPEN_LEGACY 129 9402 #define _SC_PRIORITIZED_IO 13 9403 #define _SC_XOPEN_REALTIME 130 9404 #define _SC_XOPEN_REALTIME_THREADS 131 9405 #define _SC_ADVISORY_INFO 132 9406 #define _SC_BARRIERS 133 9407 #define _SC_BASE 134 9408 #define _SC_C_LANG_SUPPORT 135 9409 #define _SC_C_LANG_SUPPORT_R 136 9410 #define _SC_CLOCK_SELECTION 137 9411 #define _SC_CPUTIME 138 9412 #define _SC_THREAD_CPUTIME 139 9413 #define _SC_SYNCHRONIZED_IO 14 9414 #define _SC_DEVICE_IO 140 9415 #define _SC_DEVICE_SPECIFIC 141 9416 #define _SC_DEVICE_SPECIFIC_R 142 9417 #define _SC_FD_MGMT 143 9418 #define _SC_FIFO 144 9419 #define _SC_PIPE 145 9420 #define _SC_FILE_ATTRIBUTES 146 9421 #define _SC_FILE_LOCKING 147 9422 #define _SC_FILE_SYSTEM 148 9423 #define _SC_MONOTONIC_CLOCK 149 9424 #define _SC_FSYNC 15 9425 #define _SC_MULTI_PROCESS 150 9426 #define _SC_SINGLE_PROCESS 151 9427 #define _SC_NETWORKING 152 9428 #define _SC_READER_WRITER_LOCKS 153 9429 #define _SC_SPIN_LOCKS 154 9430 #define _SC_REGEXP 155 9431 #define _SC_REGEX_VERSION 156 9432 #define _SC_SHELL 157 9433 #define _SC_SIGNALS 158 9434 #define _SC_SPAWN 159 9435 #define _SC_MAPPED_FILES 16 9436 #define _SC_SPORADIC_SERVER 160 9437 #define _SC_THREAD_SPORADIC_SERVER 161 9438 #define _SC_SYSTEM_DATABASE 162 9439 #define _SC_SYSTEM_DATABASE_R 163 9440 #define _SC_TIMEOUTS 164 9441 #define _SC_TYPED_MEMORY_OBJECTS 165 9442 #define _SC_USER_GROUPS 166 9443 #define _SC_USER_GROUPS_R 167 9444 #define _SC_2_PBS 168 9445 #define _SC_2_PBS_ACCOUNTING 169 9446 #define _SC_MEMLOCK 17 9447 #define _SC_2_PBS_LOCATE 170 9448 #define _SC_2_PBS_MESSAGE 171 9449 #define _SC_2_PBS_TRACK 172 9450 #define _SC_SYMLOOP_MAX 173 9451 #define _SC_STREAMS 174 9452 #define _SC_2_PBS_CHECKPOINT 175 9453 #define _SC_V6_ILP32_OFF32 176 9454 #define _SC_V6_ILP32_OFFBIG 177 9455 #define _SC_V6_LP64_OFF64 178 9456 #define _SC_V6_LPBIG_OFFBIG 179 9457 #define _SC_MEMLOCK_RANGE 18 9458 #define _SC_HOST_NAME_MAX 180 9459 #define _SC_TRACE 181 9460 #define _SC_TRACE_EVENT_FILTER 182 9461 #define _SC_TRACE_INHERIT 183 9462 #define _SC_TRACE_LOG 184 9463 #define _SC_LEVEL1_ICACHE_SIZE 185 9464 #define _SC_LEVEL1_ICACHE_ASSOC 186 9465 #define _SC_LEVEL1_ICACHE_LINESIZE 187 9466 #define _SC_LEVEL1_DCACHE_SIZE 188 9467 #define _SC_LEVEL1_DCACHE_ASSOC 189 9468 #define _SC_MEMORY_PROTECTION 19 9469 #define _SC_LEVEL1_DCACHE_LINESIZE 190 9470 #define _SC_LEVEL2_CACHE_SIZE 191 9471 #define _SC_LEVEL2_CACHE_ASSOC 192 9472 #define _SC_LEVEL2_CACHE_LINESIZE 193 9473 #define _SC_LEVEL3_CACHE_SIZE 194 9474 #define _SC_LEVEL3_CACHE_ASSOC 195 9475 #define _SC_LEVEL3_CACHE_LINESIZE 196 9476 #define _SC_LEVEL4_CACHE_SIZE 197 9477 #define _SC_LEVEL4_CACHE_ASSOC 198 9478 #define _SC_LEVEL4_CACHE_LINESIZE 199 9479 #define _SC_CLK_TCK 2 9480 #define _SC_MESSAGE_PASSING 20 9481 #define _SC_SEMAPHORES 21 9482 #define _SC_SHARED_MEMORY_OBJECTS 22 9483 #define _SC_AIO_LISTIO_MAX 23 9484 #define _SC_IPV6 235 9485 #define _SC_RAW_SOCKETS 236 9486 #define _SC_AIO_MAX 24 9487 #define _SC_AIO_PRIO_DELTA_MAX 25 9488 #define _SC_DELAYTIMER_MAX 26 9489 #define _SC_MQ_OPEN_MAX 27 9490 #define _SC_MQ_PRIO_MAX 28 9491 #define _SC_VERSION 29 9492 #define _SC_NGROUPS_MAX 3 9493 #define _SC_PAGESIZE 30 9494 #define _SC_PAGE_SIZE 30 9495 #define _SC_RTSIG_MAX 31 9496 #define _SC_SEM_NSEMS_MAX 32 9497 #define _SC_SEM_VALUE_MAX 33 9498 #define _SC_SIGQUEUE_MAX 34 9499 #define _SC_TIMER_MAX 35 9500 #define _SC_BC_BASE_MAX 36 9501 #define _SC_BC_DIM_MAX 37 9502 #define _SC_BC_SCALE_MAX 38 9503 #define _SC_BC_STRING_MAX 39 9504 #define _SC_OPEN_MAX 4 9505 #define _SC_COLL_WEIGHTS_MAX 40 9506 #define _SC_EQUIV_CLASS_MAX 41 9507 #define _SC_EXPR_NEST_MAX 42 9508 #define _SC_LINE_MAX 43 9509 #define _SC_RE_DUP_MAX 44 9510 #define _SC_CHARCLASS_NAME_MAX 45 9511 #define _SC_2_VERSION 46 9512 #define _SC_2_C_BIND 47 9513 #define _SC_2_C_DEV 48 9514 #define _SC_2_FORT_DEV 49 9515 #define _SC_STREAM_MAX 5 9516 #define _SC_2_FORT_RUN 50 9517 #define _SC_2_SW_DEV 51 9518 #define _SC_2_LOCALEDEF 52 9519 #define _SC_PII 53 9520 #define _SC_PII_XTI 54 9521 #define _SC_PII_SOCKET 55 9522 #define _SC_PII_INTERNET 56 9523 #define _SC_PII_OSI 57 9524 #define _SC_POLL 58 9525 #define _SC_SELECT 59 9526 #define _SC_TZNAME_MAX 6 9527 #define _SC_IOV_MAX 60 9528 #define _SC_UIO_MAXIOV 60 9529 #define _SC_PII_INTERNET_STREAM 61 9530 #define _SC_PII_INTERNET_DGRAM 62 9531 #define _SC_PII_OSI_COTS 63 9532 #define _SC_PII_OSI_CLTS 64 9533 #define _SC_PII_OSI_M 65 9534 #define _SC_T_IOV_MAX 66 9535 #define _SC_THREADS 67 9536 #define _SC_THREAD_SAFE_FUNCTIONS 68 9537 #define _SC_GETGR_R_SIZE_MAX 69 9538 #define _SC_JOB_CONTROL 7 9539 #define _SC_GETPW_R_SIZE_MAX 70 9540 #define _SC_LOGIN_NAME_MAX 71 9541 #define _SC_TTY_NAME_MAX 72 9542 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 9543 #define _SC_THREAD_KEYS_MAX 74 9544 #define _SC_THREAD_STACK_MIN 75 9545 #define _SC_THREAD_THREADS_MAX 76 9546 #define _SC_THREAD_ATTR_STACKADDR 77 9547 #define _SC_THREAD_ATTR_STACKSIZE 78 9548 #define _SC_THREAD_PRIORITY_SCHEDULING 79 9549 #define _SC_SAVED_IDS 8 9550 #define _SC_THREAD_PRIO_INHERIT 80 9551 #define _SC_THREAD_PRIO_PROTECT 81 9552 #define _SC_THREAD_PROCESS_SHARED 82 9553 #define _SC_NPROCESSORS_CONF 83 9554 #define _SC_NPROCESSORS_ONLN 84 9555 #define _SC_PHYS_PAGES 85 9556 #define _SC_AVPHYS_PAGES 86 9557 #define _SC_ATEXIT_MAX 87 9558 #define _SC_PASS_MAX 88 9559 #define _SC_XOPEN_VERSION 89 9560 #define _SC_REALTIME_SIGNALS 9 9561 #define _SC_XOPEN_XCU_VERSION 90 9562 #define _SC_XOPEN_UNIX 91 9563 #define _SC_XOPEN_CRYPT 92 9564 #define _SC_XOPEN_ENH_I18N 93 9565 #define _SC_XOPEN_SHM 94 9566 #define _SC_2_CHAR_TERM 95 9567 #define _SC_2_C_VERSION 96 9568 #define _SC_2_UPE 97 9569 #define _SC_XOPEN_XPG2 98 9570 #define _SC_XOPEN_XPG3 99 9571 9572 #define _CS_PATH 0 9573 #define _POSIX_REGEXP 1 9574 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 9575 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 9576 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 9577 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 9578 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 9579 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 9580 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 9581 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 9582 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 9583 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 9584 #define _CS_XBS5_LP64_OFF64_LIBS 1110 9585 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 9586 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 9587 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 9588 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 9589 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 9590 9591 #define _XOPEN_XPG4 1 9592 #define _XOPEN_VERSION 500 9593 9594 #define F_ULOCK 0 9595 #define F_LOCK 1 9596 #define F_TLOCK 2 9597 #define F_TEST 3 9598 9599 extern size_t __confstr_chk(int, char *, size_t, size_t); 9600 extern char **__environ; 9601 extern char *__getcwd_chk(char *, size_t, size_t); 9602 extern int __getgroups_chk(int, gid_t *, size_t); 9603 extern int __gethostname_chk(char *, size_t, size_t); 9604 extern int __getlogin_r_chk(char *, size_t, size_t); 9605 extern pid_t __getpgid(pid_t __pid); 9606 extern ssize_t __pread64_chk(int, void *, size_t, off64_t, size_t); 9607 extern ssize_t __pread_chk(int, void *, size_t, off_t, size_t); 9608 extern ssize_t __read_chk(int, void *, size_t, size_t); 9609 extern ssize_t __readlink_chk(const char *, char *, size_t, size_t); 9610 extern int __ttyname_r_chk(int, char *, size_t, size_t); 9611 extern char **_environ; 9612 extern void _exit(int __status); 9613 extern int access(const char *__name, int __type); 9614 extern int acct(const char *__name); 9615 extern unsigned int alarm(unsigned int __seconds); 9616 extern int brk(void *__addr); 9617 extern int chdir(const char *__path); 9618 extern int chown(const char *__file, uid_t __owner, gid_t __group); 9619 extern int chroot(const char *__path); 9620 extern int close(int __fd); 9621 extern size_t confstr(int __name, char *__buf, size_t __len); 9622 extern char *crypt(const char *__key, const char *__salt); 9623 extern char *ctermid(char *__s); 9624 extern char *cuserid(char *__s); 9625 extern int daemon(int __nochdir, int __noclose); 9626 extern int dup(int __fd); 9627 extern int dup2(int __fd, int __fd2); 9628 extern void encrypt(char *__block, int __edflag); 9629 extern int execl(const char *__path, const char *__arg, ...); 9630 extern int execle(const char *__path, const char *__arg, ...); 9631 extern int execlp(const char *__file, const char *__arg, ...); 9632 extern int execv(const char *__path, char *const __argv[]); 9633 extern int execve(const char *__path, char *const __argv[], 9634 char *const __envp[]); 9635 extern int execvp(const char *__file, char *const __argv[]); 9636 extern int faccessat(int __fd, const char *__file, int __type, int __flag); 9637 extern int fchdir(int __fd); 9638 extern int fchown(int __fd, uid_t __owner, gid_t __group); 9639 extern int fchownat(int __fd, const char *__file, uid_t __owner, 9640 gid_t __group, int __flag); 9641 extern int fdatasync(int __fildes); 9642 extern int fexecve(int __fd, char *const __argv[], char *const __envp[]); 9643 extern pid_t fork(void); 9644 extern long int fpathconf(int __fd, int __name); 9645 extern int fsync(int __fd); 9646 extern int ftruncate(int __fd, off_t __length); 9647 extern int ftruncate64(int __fd, off64_t __length); 9648 extern char *getcwd(char *__buf, size_t __size); 9649 extern int getdomainname(char *__name, size_t __len); 9650 extern int getdtablesize(void); 9651 extern gid_t getegid(void); 9652 extern uid_t geteuid(void); 9653 extern gid_t getgid(void); 9654 extern int getgroups(int __size, gid_t __list[]); 9655 extern long int gethostid(void); 9656 extern int gethostname(char *__name, size_t __len); 9657 extern char *getlogin(void); 9658 extern int getlogin_r(char *__name, size_t __name_len); 9659 extern int getopt(int ___argc, char *const ___argv[], 9660 const char *__shortopts); 9661 extern int getpagesize(void); 9662 extern pid_t getpgid(pid_t __pid); 9663 extern pid_t getpgrp(void); 9664 extern pid_t getpid(void); 9665 extern pid_t getppid(void); 9666 extern pid_t getsid(pid_t __pid); 9667 extern uid_t getuid(void); 9668 extern char *getwd(char *__buf); 9669 extern int isatty(int __fd); 9670 extern int lchown(const char *__file, uid_t __owner, gid_t __group); 9671 extern int link(const char *__from, const char *__to); 9672 extern int linkat(int __fromfd, const char *__from, int __tofd, 9673 const char *__to, int __flags); 9674 extern int lockf(int __fd, int __cmd, off_t __len); 9675 extern int lockf64(int __fd, int __cmd, off64_t __len); 9676 extern off_t lseek(int __fd, off_t __offset, int __whence); 9677 extern loff_t lseek64(int __fd, loff_t __offset, int __whence); 9678 extern int mkstemp(char *__template); 9679 extern int nice(int __inc); 9680 extern char *optarg; 9681 extern int opterr; 9682 extern int optind; 9683 extern int optopt; 9684 extern long int pathconf(const char *__path, int __name); 9685 extern int pause(void); 9686 extern int pipe(int __pipedes[2]); 9687 extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, 9688 off_t __offset); 9689 extern ssize_t pread64(int __fd, void *__buf, size_t __nbytes, 9690 off64_t __offset); 9691 extern ssize_t pwrite(int __fd, const void *__buf, size_t __n, 9692 off_t __offset); 9693 extern ssize_t pwrite64(int __fd, const void *__buf, size_t __n, 9694 off64_t __offset); 9695 extern ssize_t read(int __fd, void *__buf, size_t __nbytes); 9696 extern ssize_t readlink(const char *__path, char *__buf, size_t __len); 9697 extern ssize_t readlinkat(int __fd, const char *__path, char *__buf, 9698 size_t __len); 9699 extern int rename(const char *__old, const char *__new); 9700 extern int rmdir(const char *__path); 9701 extern void *sbrk(intptr_t __delta); 9702 extern int select(int __nfds, fd_set * __readfds, fd_set * __writefds, 9703 fd_set * __exceptfds, struct timeval *__timeout); 9704 extern int setegid(gid_t __gid); 9705 extern int seteuid(uid_t __uid); 9706 extern int setgid(gid_t __gid); 9707 extern int sethostname(const char *__name, size_t __len); 9708 extern void setkey(const char *__key); 9709 extern int setpgid(pid_t __pid, pid_t __pgid); 9710 extern int setpgrp(void); 9711 extern int setregid(gid_t __rgid, gid_t __egid); 9712 extern int setreuid(uid_t __ruid, uid_t __euid); 9713 extern pid_t setsid(void); 9714 extern int setuid(uid_t __uid); 9715 extern unsigned int sleep(unsigned int __seconds); 9716 extern void swab(const void *__from, void *__to, ssize_t __n); 9717 extern int symlink(const char *__from, const char *__to); 9718 extern int symlinkat(const char *__from, int __tofd, const char *__to); 9719 extern void sync(void); 9720 extern long int sysconf(int __name); 9721 extern pid_t tcgetpgrp(int __fd); 9722 extern int tcsetpgrp(int __fd, pid_t __pgrp_id); 9723 extern int truncate(const char *__file, off_t __length); 9724 extern int truncate64(const char *__file, off64_t __length); 9725 extern char *ttyname(int __fd); 9726 extern int ttyname_r(int __fd, char *__buf, size_t __buflen); 9727 extern unsigned int ualarm(useconds_t __value, useconds_t __interval); 9728 extern int unlink(const char *__name); 9729 extern int unlinkat(int __fd, const char *__name, int __flag); 9730 extern int usleep(useconds_t __useconds); 9731 extern pid_t vfork(void); 9732 extern ssize_t write(int __fd, const void *__buf, size_t __n); 9733 __________________________________________________________ 9734 9735 12.4.97. utime.h 9736 9737 struct utimbuf { 9738 time_t actime; 9739 time_t modtime; 9740 }; 9741 extern int utime(const char *__file, const struct utimbuf *__file_times); 9742 __________________________________________________________ 9743 9744 12.4.98. utmp.h 9745 9746 #define UT_HOSTSIZE 256 9747 #define UT_LINESIZE 32 9748 #define UT_NAMESIZE 32 9749 #define ut_addr ut_addr_v6[0] 9750 #define ut_time ut_tv.tv_sec 9751 #define ut_name ut_user /* Backwards compatability */ 9752 9753 struct exit_status { 9754 short e_termination; /* Process termination status. */ 9755 short e_exit; /* Process exit status. */ 9756 }; 9757 9758 #define EMPTY 0 /* No valid user accounting information. */ 9759 #define RUN_LVL 1 /* The system's runlevel. */ 9760 #define BOOT_TIME 2 /* Time of system boot. */ 9761 #define NEW_TIME 3 /* Time after system clock changed. */ 9762 #define OLD_TIME 4 /* Time when system clock changed. */ 9763 #define INIT_PROCESS 5 /* Process spawned by the init process.*/ 9764 #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ 9765 #define USER_PROCESS 7 /* Normal process. */ 9766 #define DEAD_PROCESS 8 /* Terminated process. */ 9767 #define ACCOUNTING 9 9768 9769 extern void endutent(void); 9770 extern struct utmp *getutent(void); 9771 extern int getutent_r(struct utmp *__buffer, struct utmp **__result); 9772 extern void login(const struct utmp *__entry); 9773 extern int login_tty(int __fd); 9774 extern int logout(const char *__ut_line); 9775 extern void logwtmp(const char *__ut_line, const char *__ut_name, 9776 const char *__ut_host); 9777 extern void setutent(void); 9778 extern int utmpname(const char *__file); 9779 __________________________________________________________ 9780 9781 12.4.99. utmpx.h 9782 9783 extern void endutxent(void); 9784 extern struct utmpx *getutxent(void); 9785 extern struct utmpx *getutxid(const struct utmpx *__id); 9786 extern struct utmpx *getutxline(const struct utmpx *__line); 9787 extern struct utmpx *pututxline(const struct utmpx *__utmpx); 9788 extern void setutxent(void); 9789 __________________________________________________________ 9790 9791 12.4.100. wchar.h 9792 9793 #define WEOF (0xffffffffu) 9794 #define WCHAR_MAX 0x7FFFFFFF 9795 #define WCHAR_MIN 0x80000000 9796 9797 extern wchar_t *__fgetws_chk(wchar_t *, size_t, int, FILE *); 9798 extern wchar_t *__fgetws_unlocked_chk(wchar_t *, size_t, int, FILE *); 9799 extern int __fwprintf_chk(FILE *, int, const wchar_t *, ...); 9800 extern size_t __mbsnrtowcs_chk(wchar_t *, const char **, size_t, size_t, 9801 mbstate_t *, size_t); 9802 extern size_t __mbsrtowcs_chk(wchar_t *, const char **, size_t, 9803 mbstate_t *, size_t); 9804 extern int __swprintf_chk(wchar_t *, size_t, int, size_t, const wchar_t*, 9805 ...); 9806 extern int __vfwprintf_chk(FILE *, int, const wchar_t *, va_list); 9807 extern int __vswprintf_chk(wchar_t *, size_t, int, size_t, const wchar_t *, 9808 va_list); 9809 extern int __vwprintf_chk(int, const wchar_t *, va_list); 9810 extern wchar_t *__wcpcpy_chk(wchar_t *, const wchar_t *, size_t); 9811 extern wchar_t *__wcpncpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9812 extern size_t __wcrtomb_chk(char *, wchar_t, mbstate_t *, size_t); 9813 extern wchar_t *__wcscat_chk(wchar_t *, const wchar_t *, size_t); 9814 extern wchar_t *__wcscpy_chk(wchar_t *, const wchar_t *, size_t); 9815 extern wchar_t *__wcsncat_chk(wchar_t *, const wchar_t *, size_t, size_t); 9816 extern wchar_t *__wcsncpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9817 extern size_t __wcsnrtombs_chk(char *, const wchar_t * *, size_t, size_t, 9818 mbstate_t *, size_t); 9819 extern size_t __wcsrtombs_chk(char *, const wchar_t * *, size_t, 9820 mbstate_t *, size_t); 9821 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 9822 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 9823 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 9824 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 9825 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t * *, 9826 int, int); 9827 extern wchar_t *__wmemcpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9828 extern wchar_t *__wmemmove_chk(wchar_t *, const wchar_t *, size_t, size_t); 9829 extern wchar_t *__wmempcpy_chk(wchar_t *, const wchar_t *, size_t, size_t); 9830 extern wchar_t *__wmemset_chk(wchar_t *, wchar_t, size_t, size_t); 9831 extern int __wprintf_chk(int, const wchar_t *, ...); 9832 extern wint_t btowc(int __c); 9833 extern wint_t fgetwc(FILE * __stream); 9834 extern wint_t fgetwc_unlocked(FILE * __stream); 9835 extern wchar_t *fgetws(wchar_t * __ws, int __n, FILE * __stream); 9836 extern wchar_t *fgetws_unlocked(wchar_t * __ws, int __n, FILE * __stream); 9837 extern wint_t fputwc(wchar_t __wc, FILE * __stream); 9838 extern wint_t fputwc_unlocked(wchar_t __wc, FILE * __stream); 9839 extern int fputws(const wchar_t * __ws, FILE * __stream); 9840 extern int fputws_unlocked(const wchar_t * __ws, FILE * __stream); 9841 extern int fwide(FILE * __fp, int __mode); 9842 extern int fwprintf(FILE * __stream, const wchar_t * __format, ...); 9843 extern int fwscanf(FILE * __stream, const wchar_t * __format, ...); 9844 extern wint_t getwc(FILE * __stream); 9845 extern wint_t getwc_unlocked(FILE * __stream); 9846 extern wint_t getwchar(void); 9847 extern wint_t getwchar_unlocked(void); 9848 extern size_t mbrlen(const char *__s, size_t __n, mbstate_t * __ps); 9849 extern size_t mbrtowc(wchar_t * __pwc, const char *__s, size_t __n, 9850 mbstate_t * __p); 9851 extern int mbsinit(const mbstate_t * __ps); 9852 extern size_t mbsnrtowcs(wchar_t * __dst, const char **__src, size_t __nmc, 9853 size_t __len, mbstate_t * __ps); 9854 extern size_t mbsrtowcs(wchar_t * __dst, const char **__src, size_t __len, 9855 mbstate_t * __ps); 9856 extern FILE *open_wmemstream(wchar_t * *__bufloc, size_t * __sizeloc); 9857 extern wint_t putwc(wchar_t __wc, FILE * __stream); 9858 extern wint_t putwc_unlocked(wchar_t __wc, FILE * __stream); 9859 extern wint_t putwchar(wchar_t __wc); 9860 extern wint_t putwchar_unlocked(wchar_t __wc); 9861 extern int swprintf(wchar_t * __s, size_t __n, const wchar_t * __format, 9862 ...); 9863 extern int swscanf(const wchar_t * __s, const wchar_t * __format, ...); 9864 extern wint_t ungetwc(wint_t __wc, FILE * __stream); 9865 extern int vfwprintf(FILE * __s, const wchar_t * __format, va_list __arg); 9866 extern int vfwscanf(FILE * __s, const wchar_t * __format, va_list __arg); 9867 extern int vswprintf(wchar_t * __s, size_t __n, const wchar_t * __format, 9868 va_list __arg); 9869 extern int vswscanf(const wchar_t * __s, const wchar_t * __format, 9870 va_list __arg); 9871 extern int vwprintf(const wchar_t * __format, va_list __arg); 9872 extern int vwscanf(const wchar_t * __format, va_list __arg); 9873 extern wchar_t *wcpcpy(wchar_t * __dest, const wchar_t * __src); 9874 extern wchar_t *wcpncpy(wchar_t * __dest, const wchar_t * __src, 9875 size_t __n); 9876 extern size_t wcrtomb(char *__s, wchar_t __wc, mbstate_t * __ps); 9877 extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2); 9878 extern wchar_t *wcscat(wchar_t * __dest, const wchar_t * __src); 9879 extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc); 9880 extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2); 9881 extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2); 9882 extern wchar_t *wcscpy(wchar_t * __dest, const wchar_t * __src); 9883 extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject); 9884 extern wchar_t *wcsdup(const wchar_t * __s); 9885 extern size_t wcsftime(wchar_t * __s, size_t __maxsize, 9886 const wchar_t * __format, const struct tm *__tp); 9887 extern size_t wcslen(const wchar_t * __s); 9888 extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, 9889 size_t __n); 9890 extern wchar_t *wcsncat(wchar_t * __dest, const wchar_t * __src, 9891 size_t __n); 9892 extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); 9893 extern wchar_t *wcsncpy(wchar_t * __dest, const wchar_t * __src, 9894 size_t __n); 9895 extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen); 9896 extern size_t wcsnrtombs(char *__dst, const wchar_t * *__src, size_t __nwc, 9897 size_t __len, mbstate_t * __ps); 9898 extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept); 9899 extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc); 9900 extern size_t wcsrtombs(char *__dst, const wchar_t * *__src, size_t __len, 9901 mbstate_t * __ps); 9902 extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept); 9903 extern wchar_t *wcsstr(const wchar_t * __haystack, 9904 const wchar_t * __needle); 9905 extern double wcstod(const wchar_t * __nptr, wchar_t * *__endptr); 9906 extern float wcstof(const wchar_t * __nptr, wchar_t * *__endptr); 9907 extern wchar_t *wcstok(wchar_t * __s, const wchar_t * __delim, 9908 wchar_t * *__ptr); 9909 extern long int wcstol(const wchar_t * __nptr, wchar_t * *__endptr, 9910 int __base); 9911 extern long double wcstold(const wchar_t * __nptr, wchar_t * *__endptr); 9912 extern long long int wcstoll(const wchar_t * __nptr, wchar_t * *__endptr, 9913 int __base); 9914 extern long long int wcstoq(const wchar_t * __nptr, wchar_t * *__endptr, 9915 int __base); 9916 extern unsigned long int wcstoul(const wchar_t * __nptr, 9917 wchar_t * *__endptr, int __base); 9918 extern unsigned long long int wcstoull(const wchar_t * __nptr, 9919 wchar_t * *__endptr, int __base); 9920 extern unsigned long long int wcstouq(const wchar_t * __nptr, 9921 wchar_t * *__endptr, int __base); 9922 extern wchar_t *wcswcs(const wchar_t * __haystack, 9923 const wchar_t * __needle); 9924 extern int wcswidth(const wchar_t * __s, size_t __n); 9925 extern size_t wcsxfrm(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9926 extern int wctob(wint_t __c); 9927 extern int wcwidth(wchar_t __c); 9928 extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n); 9929 extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); 9930 extern wchar_t *wmemcpy(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9931 extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n); 9932 extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n); 9933 extern int wprintf(const wchar_t * __format, ...); 9934 extern int wscanf(const wchar_t * __format, ...); 9935 __________________________________________________________ 9936 9937 12.4.101. wctype.h 9938 9939 typedef unsigned long int wctype_t; 9940 typedef unsigned int wint_t; 9941 typedef const int32_t *wctrans_t; 9942 typedef struct { 9943 int count; 9944 wint_t value; 9945 } __mbstate_t; 9946 9947 typedef __mbstate_t mbstate_t; 9948 extern int iswalnum(wint_t __wc); 9949 extern int iswalpha(wint_t __wc); 9950 extern int iswblank(wint_t __wc); 9951 extern int iswcntrl(wint_t __wc); 9952 extern int iswctype(wint_t __wc, wctype_t __desc); 9953 extern int iswdigit(wint_t __wc); 9954 extern int iswgraph(wint_t __wc); 9955 extern int iswlower(wint_t __wc); 9956 extern int iswprint(wint_t __wc); 9957 extern int iswpunct(wint_t __wc); 9958 extern int iswspace(wint_t __wc); 9959 extern int iswupper(wint_t __wc); 9960 extern int iswxdigit(wint_t __wc); 9961 extern wint_t towctrans(wint_t __wc, wctrans_t __desc); 9962 extern wint_t towlower(wint_t __wc); 9963 extern wint_t towupper(wint_t __wc); 9964 extern wctrans_t wctrans(const char *__property); 9965 extern wctype_t wctype(const char *__property); 9966 __________________________________________________________ 9967 9968 12.4.102. wordexp.h 9969 9970 enum { 9971 WRDE_DOOFFS = 1, 9972 WRDE_APPEND = 2, 9973 WRDE_NOCMD = 4, 9974 WRDE_REUSE = 8, 9975 WRDE_SHOWERR = 16, 9976 WRDE_UNDEF = 32 9977 }; 9978 9979 typedef struct { 9980 size_t we_wordc; 9981 char **we_wordv; 9982 size_t we_offs; 9983 } wordexp_t; 9984 9985 enum { 9986 WRDE_NOSYS = -1, 9987 WRDE_NOSPACE = 1, 9988 WRDE_BADCHAR = 2, 9989 WRDE_BADVAL = 3, 9990 WRDE_CMDSUB = 4, 9991 WRDE_SYNTAX = 5 9992 }; 9993 extern int wordexp(const char *__words, wordexp_t * __pwordexp, 9994 int __flags); 9995 extern void wordfree(wordexp_t * __wordexp); 9996 __________________________________________________________ 9997 9998 12.5. Interface Definitions for libc 9999 10000 Table of Contents 10001 _IO_feof -- alias for feof 10002 _IO_getc -- alias for getc 10003 _IO_putc -- alias for putc 10004 _IO_puts -- alias for puts 10005 __assert_fail -- abort the program after false assertion 10006 __chk_fail -- terminate a function in case of buffer overflow 10007 __confstr_chk -- get configuration dependent string variables, 10008 with buffer overflow checking 10009 10010 __ctype_b_loc -- accessor function for __ctype_b array for 10011 ctype functions 10012 10013 __ctype_get_mb_cur_max -- maximum length of a multibyte 10014 character in the current locale 10015 10016 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 10017 array for ctype tolower() function 10018 10019 __ctype_toupper_loc -- accessor function for 10020 __ctype_b_toupper() array for ctype toupper() function 10021 10022 __cxa_atexit -- register a function to be called by exit or 10023 when a shared library is unloaded 10024 10025 __cxa_finalize -- call destructors of global (or local static) 10026 C++ objects and exit functions registered with atexit 10027 10028 __daylight -- external daylight savings time flag 10029 __environ -- alias for environ - user environment 10030 __errno_location -- address of errno variable 10031 __fgets_chk -- string input, with buffer overflow checking 10032 __fgets_unlocked_chk -- non-locking string input, with buffer 10033 overflow checking 10034 10035 __fgetws_chk -- read a wide-character string from a FILE 10036 stream, with buffer overflow checking 10037 10038 __fgetws_unlocked_chk -- read a wide-character string from a 10039 FILE stream in a non-locking manner, with stack checking 10040 10041 __fpending -- returns in bytes the amount of output pending on 10042 a stream 10043 10044 __fprintf_chk -- convert formatted output, with stack checking 10045 __fwprintf_chk -- convert formatted wide-character output, with 10046 stack checking 10047 10048 __fxstatat -- get file status relative to directory file 10049 descriptor 10050 10051 __fxstatat64, fstatat64 -- get file status relative to a 10052 directory file descriptor (Large File Support) 10053 10054 __getcwd_chk -- get current working directory, with buffer 10055 overflow checking 10056 10057 __getgroups_chk -- get list of supplementary group IDs, with 10058 buffer overflow checking 10059 10060 __gethostname_chk -- get host name, with buffer overflow 10061 checking 10062 10063 __getlogin_r_chk -- get user name, with buffer overflow 10064 checking (reentrant) 10065 10066 __getpagesize -- alias for getpagesize - get current page size 10067 __getpgid -- get the process group id 10068 __h_errno_location -- address of h_errno variable 10069 __isinf -- test for infinity 10070 __isinff -- test for infinity 10071 __isinfl -- test for infinity 10072 __isnan -- test for infinity 10073 __isnanf -- test for infinity 10074 __isnanl -- test for infinity 10075 __libc_current_sigrtmax -- return number of available real-time 10076 signal with lowest priority 10077 10078 __libc_current_sigrtmin -- return number of available real-time 10079 signal with highest priority 10080 10081 __libc_start_main -- initialization routine 10082 __mbsnrtowcs_chk -- convert a multibyte string to a 10083 wide-character string, with buffer overflow checking 10084 10085 __mbsrtowcs_chk -- convert a multibyte string to a 10086 wide-character string, with buffer overflow checking 10087 10088 __mbstowcs_chk -- convert a multibyte string to a 10089 wide-character string, with buffer overflow checking 10090 10091 __memcpy_chk -- copy memory area, with buffer overflow checking 10092 __memmove_chk -- copy memory area, with buffer overflow 10093 checking 10094 10095 __mempcpy -- copy given number of bytes of source to 10096 destination 10097 10098 __mempcpy_chk -- copy memory area, with buffer overflow 10099 checking 10100 10101 __memset_chk -- fill memory with a constant byte, using buffer 10102 overflow checking 10103 10104 __pread64_chk -- read from a file descriptor at a given offset, 10105 with buffer overflow checking 10106 10107 __pread_chk -- read from a file descriptor at a given offset, 10108 with buffer overflow checking 10109 10110 __printf_chk -- format and print data, with stack checking 10111 __rawmemchr -- scan memory 10112 __read_chk -- read from a file descriptor, with buffer overflow 10113 checking 10114 10115 __readlink_chk -- display value of a symbolic link, with buffer 10116 overflow checking 10117 10118 __realpath_chk -- return the canonicalized absolute pathname, 10119 with buffer overflow checking 10120 10121 __recv_chk -- receive a message from a socket, with buffer 10122 overflow checking 10123 10124 __recvfrom_chk -- receive a message from a socket, with buffer 10125 overflow checking 10126 10127 __register_atfork -- alias for register_atfork 10128 __sigsetjmp -- save stack context for non-local goto 10129 __snprintf_chk -- convert formatted output, with buffer 10130 overflow checking 10131 10132 __sprintf_chk -- convert formatted output, with stack checking 10133 __stack_chk_fail -- terminate a function in case of stack 10134 overflow 10135 10136 __stpcpy -- alias for stpcpy 10137 __stpcpy_chk -- copy a string returning a pointer to its end, 10138 with buffer overflow checking 10139 10140 __stpncpy_chk -- copy a fixed-size string, returning a pointer 10141 to its end, with buffer overflow checking 10142 10143 __strcat_chk -- concatenate two strings, with buffer overflow 10144 checking 10145 10146 __strcpy_chk -- copy a string, with buffer overflow checking 10147 __strdup -- alias for strdup 10148 __strncat_chk -- concatenate two strings, with buffer overflow 10149 checking 10150 10151 __strncpy_chk -- copy a string, with buffer overflow checking 10152 __strtod_internal -- underlying function for strtod 10153 __strtof_internal -- underlying function for strtof 10154 __strtok_r -- alias for strtok_r 10155 __strtol_internal -- alias for strtol 10156 __strtold_internal -- underlying function for strtold 10157 __strtoll_internal -- underlying function for strtoll 10158 __strtoul_internal -- underlying function for strtoul 10159 __strtoull_internal -- underlying function for strtoull 10160 __swprintf_chk -- convert formatted wide-character output, with 10161 stack checking 10162 10163 __sysconf -- get configuration information at runtime 10164 __syslog_chk -- send messages to the system logger, with stack 10165 checking 10166 10167 __sysv_signal -- signal handling 10168 __timezone -- external variable containing timezone 10169 __ttyname_r_chk -- return name of a terminal, with buffer 10170 overflow checking (reentrant) 10171 10172 __tzname -- external variable containing the timezone names 10173 __vfprintf_chk -- convert formatted output, with stack checking 10174 __vfwprintf_chk -- convert formatted wide-character output, 10175 with stack checking 10176 10177 __vprintf_chk -- convert formatted output, with stack checking 10178 __vsnprintf_chk -- convert formatted output, with stack 10179 checking 10180 10181 __vsprintf_chk -- convert formatted output, with stack checking 10182 __vswprintf_chk -- convert formatted wide-character output, 10183 with stack checking 10184 10185 __vsyslog_chk -- send messages to the system logger, with stack 10186 checking 10187 10188 __vwprintf_chk -- convert formatted wide-character output, with 10189 stack checking 10190 10191 __wcpcpy_chk -- copy a wide-character string, returning a 10192 pointer to its end, with buffer overflow checking 10193 10194 __wcpncpy_chk -- copy a fixed-size string of wide characters, 10195 returning a pointer to its end, with buffer overflow 10196 checking 10197 10198 __wcrtomb_chk -- convert a wide character to a multibyte 10199 sequence, with buffer overflow checking 10200 10201 __wcscat_chk -- concatenate two wide-character strings, with 10202 buffer overflow checking 10203 10204 __wcscpy_chk -- copy a wide-character string, with buffer 10205 overflow checking 10206 10207 __wcsncat_chk -- concatenate two wide-character strings, with 10208 buffer overflow checking 10209 10210 __wcsncpy_chk -- copy a fixed-size string of wide characters, 10211 with buffer overflow checking 10212 10213 __wcsnrtombs_chk -- convert a wide-character string to a 10214 multibyte string, with buffer overflow checking 10215 10216 __wcsrtombs_chk -- convert a wide-character string to a 10217 multibyte string, with buffer overflow checking 10218 10219 __wcstod_internal -- underlying function for wcstod 10220 __wcstof_internal -- underlying function for wcstof 10221 __wcstol_internal -- underlying function for wcstol 10222 __wcstold_internal -- underlying function for wcstold 10223 __wcstombs_chk -- convert a wide-character string to a 10224 multibyte string, with buffer overflow checking 10225 10226 __wcstoul_internal -- underlying function for wcstoul 10227 __wctomb_chk -- convert a wide character to a multibyte 10228 sequence, with buffer overflow checking 10229 10230 __wmemcpy_chk -- copy an array of wide-characters, with buffer 10231 overflow checking 10232 10233 __wmemmove_chk -- copy an array of wide-characters, with buffer 10234 overflow checking 10235 10236 __wmempcpy_chk -- copy memory area, with buffer overflow 10237 checking 10238 10239 __wmemset_chk -- fill an array of wide-characters with a 10240 constant wide character, with buffer overflow checking 10241 10242 __wprintf_chk -- convert formatted wide-character output, with 10243 stack checking 10244 10245 __xmknod -- make a special file 10246 __xmknodat -- make a special file relative to a directory file 10247 descriptor 10248 10249 __xpg_basename -- return the last component of a file name 10250 __xpg_sigpause -- remove a signal from the signal mask and 10251 suspend the thread 10252 10253 __xpg_strerror_r -- return string describing error number 10254 __xstat -- get File Status 10255 __xstat64 -- get File Status 10256 _environ -- alias for environ - user environment 10257 _nl_msg_cat_cntr -- new catalog load counter 10258 _sys_errlist -- array containing the "C" locale strings used by 10259 strerror() 10260 10261 _sys_siglist -- array containing the names of the signal names 10262 acct -- switch process accounting on or off 10263 adjtime -- correct the time to allow synchronization of the 10264 system clock 10265 10266 alphasort64 -- Comparison function for directory scanning 10267 (Large File Support) 10268 10269 asprintf -- write formatted output to a dynamically allocated 10270 string 10271 10272 backtrace, backtrace_symbols, backtrace_symbols_fd -- runtime 10273 stack back tracing 10274 10275 basename -- return the last component of a file name 10276 bind_textdomain_codeset -- specify encoding for message 10277 retrieval 10278 10279 bindresvport -- bind socket to privileged IP port 10280 bindtextdomain -- specify the location of a message catalog 10281 cfmakeraw -- get and set terminal attributes 10282 cfsetspeed -- set terminal input and output data rate 10283 clearerr_unlocked -- non-thread-safe clearerr 10284 daemon -- run in the background 10285 dcgettext -- perform domain and category specific lookup in 10286 message catalog 10287 10288 dcngettext -- perform domain and category specific lookup in 10289 message catalog with plural 10290 10291 dgettext -- perform lookup in message catalog for the current 10292 LC_MESSAGES locale 10293 10294 dl_iterate_phdr -- iterate over a program's loaded shared 10295 objects 10296 10297 dngettext -- perform lookup in message catalog for the current 10298 locale 10299 10300 drand48_r -- reentrantly generate pseudorandom numbers in a 10301 uniform distribution 10302 10303 duplocale -- provide new handle for selection of locale 10304 endutent -- access utmp file entries 10305 epoll_create -- open an epoll file descriptor 10306 epoll_ctl -- control an epoll file descriptor 10307 epoll_wait -- wait for I/O events on an epoll file descriptor 10308 erand48_r -- reentrantly generate pseudorandom numbers in a 10309 uniform distribution 10310 10311 err -- display formatted error messages 10312 error -- print error message 10313 errx -- display formatted error message and exit 10314 fcntl -- file control 10315 feof_unlocked -- non-thread-safe feof 10316 ferror_unlocked -- non-thread-safe ferror 10317 fflush_unlocked -- non thread safe fflush 10318 fgetc_unlocked -- non-thread-safe fgetc 10319 fgets_unlocked -- non-thread-safe fgets 10320 fgetwc_unlocked -- non thread safe fgetwc 10321 fgetws_unlocked -- non-thread-safe fgetws 10322 fileno_unlocked -- non-thread-safe fileno 10323 flock -- apply or remove an advisory lock on an open file 10324 fputc_unlocked -- non-thread-safe fputc 10325 fputs_unlocked -- non-thread-safe fputs 10326 fputwc_unlocked -- non-thread-safe fputwc 10327 fputws_unlocked -- non-thread-safe fputws 10328 fread_unlocked -- non-thread-safe fread 10329 freelocale -- free a locale object 10330 fscanf -- convert formatted input 10331 fstatfs -- (deprecated) 10332 fstatfs64 -- (deprecated) 10333 fwrite_unlocked -- non-thread-safe fwrite 10334 fwscanf -- convert formatted input 10335 getdomainname -- get NIS domain name (DEPRECATED). 10336 getdtablesize -- get file descriptor table size (DEPRECATED) 10337 getgrent_r -- reentrantly get entry in group file 10338 getgrouplist -- get groups a user belongs to 10339 gethostbyaddr_r -- find network host database entry matching 10340 host name (DEPRECATED) 10341 10342 gethostbyname2 -- find network host database entry matching 10343 host name (DEPRECATED) 10344 10345 gethostbyname2_r -- find network host database entry matching 10346 host name (DEPRECATED) 10347 10348 gethostbyname_r -- find network host database entry matching 10349 host name (DEPRECATED) 10350 10351 getloadavg -- get system load averages 10352 getopt -- parse command line options 10353 getopt_long -- parse command line options 10354 getopt_long_only -- parse command line options 10355 getpagesize -- get memory page size (DEPRECATED) 10356 getprotobyname_r -- retrieve information from the network 10357 protocol database by protocol name, reentrantly 10358 10359 getprotobynumber_r -- retrieve information from the network 10360 protocol database by protocol number, reentrantly 10361 10362 getprotoent_r -- read the next entry of the protocol database, 10363 reentrantly 10364 10365 getpwent_r -- reentrantly get entry in passwd file 10366 getservbyname_r -- retrieve information from the network 10367 services database by service name, reentrantly 10368 10369 getservbyport_r -- retrieve information from the network 10370 services database by service port, reentrantly 10371 10372 getservent_r -- read the next entry of the network services 10373 database, reentrantly 10374 10375 getsockopt -- get socket options 10376 gettext -- search message catalogs for a string 10377 getutent -- access user accounting database entries 10378 getutent_r -- access user accounting database entries 10379 getwc_unlocked -- non-thread-safe getwc 10380 getwchar_unlocked -- non-thread-safe getwchar 10381 glob64 -- find pathnames matching a pattern (Large File 10382 Support) 10383 10384 globfree64 -- free memory from glob64() (Large File Support) 10385 gnu_get_libc_version, gnu_get_libc_release -- get 10386 glibc-specific version and release 10387 10388 hcreate_r -- allocate space for a hash search table, 10389 reentrantly 10390 10391 hdestroy_r -- dispose of a hash search table, reentrantly 10392 hsearch_r -- search a hash table, reentrantly 10393 inet_aton -- Internet address manipulation routine 10394 initgroups -- initialize the supplementary group access list 10395 initstate_r -- reentrantly initialize a state array for random 10396 number generator functions 10397 10398 inotify_add_watch -- add a watch to a watch list 10399 inotify_init -- instantiate inotify 10400 inotify_rm_watch -- remove a watch from an inotify watch list 10401 ioctl -- control device 10402 sockio -- socket ioctl commands 10403 ttyio -- tty ioctl commands 10404 jrand48_r -- reentrantly generate pseudorandom numbers in a 10405 uniform distribution 10406 10407 kill -- send a signal 10408 lcong48_r -- reentrantly generate pseudorandom numbers in a 10409 uniform distribution 10410 10411 link -- create a link to a file 10412 lrand48_r -- reentrantly generate pseudorandom numbers in a 10413 uniform distribution 10414 10415 mbsnrtowcs -- convert a multibyte string to a wide character 10416 string 10417 10418 memmem -- locate bytes 10419 memrchr -- scan memory for a character 10420 mkstemp64 -- create a unique temporary file (Large File 10421 Support) 10422 10423 mrand48_r -- reentrantly generate pseudorandom numbers in a 10424 uniform distribution 10425 10426 mremap -- remap a virtual memory address 10427 newlocale -- allocate a locale object 10428 ngettext -- search message catalogs for plural string 10429 nrand48_r -- reentrantly generate pseudorandom numbers in a 10430 uniform distribution 10431 10432 openat64 -- open a file relative to a directory file descriptor 10433 (Large File Support) 10434 10435 pmap_getport -- find the port number assigned to a service 10436 registered with a portmapper. 10437 10438 pmap_set -- establishes mapping to machine's RPC Bind service. 10439 pmap_unset -- destroys RPC Binding 10440 posix_fadvise64 -- File advisory information (Large File 10441 Support) 10442 10443 posix_fallocate64 -- file space control (Large File Support) 10444 pread64 -- read from a file (Large File Support) 10445 psignal -- print signal message 10446 ptrace -- process trace 10447 putwc_unlocked -- non-thread-safe putwc 10448 putwchar_unlocked -- non-thread-safe putwchar 10449 pwrite64 -- write on a file (Large File Support) 10450 random_r -- reentrantly generate pseudorandom numbers in a 10451 uniform distribution 10452 10453 readdir64_r -- read a directory (Large File Support) 10454 regexec -- regular expression matching 10455 scandir64 -- scan a directory (Large File Support) 10456 scanf -- convert formatted input 10457 sched_getaffinity -- retrieve the affinity mask of a process 10458 sched_setaffinity -- set the CPU affinity mask for a process 10459 sched_setscheduler -- set scheduling policy and parameters 10460 seed48_r -- reentrantly generate pseudorandom numbers in a 10461 uniform distribution 10462 10463 sendfile -- transfer data between two file descriptors 10464 sendfile64 -- transfer data between two file descriptors (Large 10465 File Support) 10466 10467 setbuffer -- stream buffering operation 10468 setgroups -- set list of supplementary group IDs 10469 sethostname -- set host name 10470 setsockopt -- set socket options 10471 setstate_r -- reentrantly change the state array used by random 10472 number generator functions 10473 10474 setutent -- access user accounting database entries 10475 sigandset -- build a new signal set by combining the two input 10476 sets using logical AND 10477 10478 sigisemptyset -- check for empty signal set 10479 sigorset -- build a new signal set by combining the two input 10480 sets using logical OR 10481 10482 sigpause -- remove a signal from the signal mask and suspend 10483 the thread (deprecated) 10484 10485 sigreturn -- return from signal handler and cleanup stack frame 10486 srand48_r -- reentrantly generate pseudorandom numbers in a 10487 uniform distribution 10488 10489 srandom_r -- reentrantly set the seed for a new sequence of 10490 pseudorandom numbers 10491 10492 sscanf -- convert formatted input 10493 statfs -- (deprecated) 10494 statfs64 -- (deprecated) 10495 stime -- set time 10496 stpcpy -- copy a string returning a pointer to its end 10497 stpncpy -- copy a fixed-size string, returning a pointer to its 10498 end 10499 10500 strcasestr -- locate a substring ignoring case 10501 strerror_r -- return string describing error number 10502 strndup -- return a malloc'd copy of at most the specified 10503 number of bytes of a string 10504 10505 strnlen -- determine the length of a fixed-size string 10506 strptime -- parse a time string 10507 strsep -- extract token from string 10508 strsignal -- return string describing signal 10509 strtoq -- convert string value to a long or quad_t integer 10510 strtouq -- convert a string to an unsigned long long 10511 svc_register -- register Remote Procedure Call interface 10512 svc_run -- waits for RPC requests to arrive and calls service 10513 procedure 10514 10515 svc_sendreply -- called by RPC service's dispatch routine 10516 svctcp_create -- create a TCP/IP-based RPC service transport 10517 svcudp_create -- create a UDP-based RPC service transport 10518 swscanf -- convert formatted input 10519 sysconf -- Get configuration information at runtime 10520 sysinfo -- return system information 10521 system -- execute a shell command 10522 textdomain -- set the current default message domain 10523 unlink -- remove a directory entry 10524 uselocale -- set locale for thread 10525 utmpname -- set user accounting database 10526 vasprintf -- write formatted output to a dynamically allocated 10527 string 10528 10529 vdprintf -- write formatted output to a file descriptor 10530 verrx -- display formatted error message and exit 10531 vfscanf -- convert formatted input 10532 vfwscanf -- convert formatted input 10533 vscanf -- convert formatted input 10534 vsscanf -- convert formatted input 10535 vswscanf -- convert formatted input 10536 vsyslog -- log to system log 10537 vwscanf -- convert formatted input 10538 wait4 -- wait for process termination, BSD style 10539 warn -- formatted error messages 10540 warnx -- formatted error messages 10541 wcpcpy -- copy a wide character string, returning a pointer to 10542 its end 10543 10544 wcpncpy -- copy a fixed-size string of wide characters, 10545 returning a pointer to its end 10546 10547 wcscasecmp -- compare two wide-character strings, ignoring case 10548 wcsdup -- duplicate a wide-character string 10549 wcsncasecmp -- compare two fixed-size wide-character strings, 10550 ignoring case 10551 10552 wcsnlen -- determine the length of a fixed-size wide-character 10553 string 10554 10555 wcsnrtombs -- convert a wide character string to a multi-byte 10556 string 10557 10558 wcstoq -- convert wide string to long long int representation 10559 wcstouq -- convert wide string to unsigned long long int 10560 representation 10561 10562 wscanf -- convert formatted input 10563 xdr_u_int -- library routines for external data representation 10564 xdrstdio_create -- library routines for external data 10565 representation 10566 10567 The interfaces defined on the following pages are included in 10568 libc and are defined by this specification. Unless otherwise 10569 noted, these interfaces shall be included in the source 10570 standard. 10571 10572 Other interfaces listed in Section 12.3 shall behave as 10573 described in the referenced base document. 10574 10575 _IO_feof 10576 10577 Name 10578 10579 _IO_feof -- alias for feof 10580 10581 Synopsis 10582 10583 int _IO_feof(_IO_FILE * __fp); 10584 10585 Description 10586 10587 _IO_feof() tests the end-of-file indicator for the stream 10588 pointed to by __fp, returning a non-zero value if it is set. 10589 10590 _IO_feof() is not in the source standard; it is only in the 10591 binary standard. 10592 10593 _IO_getc 10594 10595 Name 10596 10597 _IO_getc -- alias for getc 10598 10599 Synopsis 10600 10601 int _IO_getc(_IO_FILE * __fp); 10602 10603 Description 10604 10605 _IO_getc() reads the next character from __fp and returns it as 10606 an unsigned char cast to an int, or EOF on end-of-file or 10607 error. 10608 10609 _IO_getc() is not in the source standard; it is only in the 10610 binary standard. 10611 10612 _IO_putc 10613 10614 Name 10615 10616 _IO_putc -- alias for putc 10617 10618 Synopsis 10619 10620 int _IO_putc(int __c, _IO_FILE * __fp); 10621 10622 Description 10623 10624 _IO_putc() writes the character __c, cast to an unsigned char, 10625 to __fp. 10626 10627 _IO_putc() is not in the source standard; it is only in the 10628 binary standard. 10629 10630 _IO_puts 10631 10632 Name 10633 10634 _IO_puts -- alias for puts 10635 10636 Synopsis 10637 10638 int _IO_puts(const char * __c); 10639 10640 Description 10641 10642 _IO_puts() writes the string __s and a trailing newline to 10643 stdout. 10644 10645 _IO_puts() is not in the source standard; it is only in the 10646 binary standard. 10647 10648 __assert_fail 10649 10650 Name 10651 10652 __assert_fail -- abort the program after false assertion 10653 10654 Synopsis 10655 10656 void __assert_fail(const char * assertion, const char * file, 10657 unsigned int line, const char * function); 10658 10659 Description 10660 10661 The __assert_fail() function is used to implement the assert() 10662 interface of POSIX 1003.1-2001 (ISO/IEC 9945-2003). The 10663 __assert_fail() function shall print the given file filename, 10664 line line number, function function name and a message on the 10665 standard error stream in an unspecified format, and abort 10666 program execution via the abort() function. For example: 10667 10668 a.c:10: foobar: Assertion a == b failed. 10669 10670 If function is NULL, __assert_fail() shall omit information 10671 about the function. 10672 10673 assertion, file, and line shall be non-NULL. 10674 10675 The __assert_fail() function is not in the source standard; it 10676 is only in the binary standard. The assert() interface is not 10677 in the binary standard; it is only in the source standard. The 10678 assert() may be implemented as a macro. 10679 10680 __chk_fail 10681 10682 Name 10683 10684 __chk_fail -- terminate a function in case of buffer overflow 10685 10686 Synopsis 10687 10688 #include 10689 10690 void __chk_fail(void); 10691 10692 Description 10693 10694 The interface __chk_fail() shall abort the function that called 10695 it with a message that a buffer overflow has been detected. The 10696 program that called the function shall then exit. 10697 10698 Application Usage (informative) 10699 10700 The interface __chk_fail() does not check for a buffer overflow 10701 itself. It merely reports one when invoked. 10702 10703 __confstr_chk 10704 10705 Name 10706 10707 __confstr_chk -- get configuration dependent string variables, 10708 with buffer overflow checking 10709 10710 Synopsis 10711 10712 #include 10713 10714 size_t __confstr_chk(int name, char * buf, size_t len, size_t 10715 buflen); 10716 10717 Description 10718 10719 The interface __confstr_chk() shall function in the same way as 10720 the interface confstr(), except that __confstr_chk() shall 10721 check for buffer overflow before computing a result. If an 10722 overflow is anticipated, the function shall abort and the 10723 program calling it shall exit. 10724 10725 The parameter buflen specifies the size of the buffer buf. If 10726 len exceeds buflen, the function shall abort, and the program 10727 calling it shall exit. 10728 10729 The __confstr_chk() function is not in the source standard; it 10730 is only in the binary standard. 10731 10732 __ctype_b_loc 10733 10734 Name 10735 10736 __ctype_b_loc -- accessor function for __ctype_b array for 10737 ctype functions 10738 10739 Synopsis 10740 10741 #include 10742 10743 const unsigned short * * __ctype_b_loc (void); 10744 10745 Description 10746 10747 The __ctype_b_loc() function shall return a pointer into an 10748 array of characters in the current locale that contains 10749 characteristics for each character in the current character 10750 set. The array shall contain a total of 384 characters, and can 10751 be indexed with any signed or unsigned char (i.e. with an index 10752 value between -128 and 255). If the application is 10753 multithreaded, the array shall be local to the current thread. 10754 10755 This interface is not in the source standard; it is only in the 10756 binary standard. 10757 10758 Return Value 10759 10760 The __ctype_b_loc() function shall return a pointer to the 10761 array of characters to be used for the ctype() family of 10762 functions (see ). 10763 10764 __ctype_get_mb_cur_max 10765 10766 Name 10767 10768 __ctype_get_mb_cur_max -- maximum length of a multibyte 10769 character in the current locale 10770 10771 Synopsis 10772 10773 size_t __ctype_get_mb_cur_max(void); 10774 10775 Description 10776 10777 __ctype_get_mb_cur_max() returns the maximum length of a 10778 multibyte character in the current locale. 10779 10780 __ctype_get_mb_cur_max() is not in the source standard; it is 10781 only in the binary standard. 10782 10783 __ctype_tolower_loc 10784 10785 Name 10786 10787 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 10788 array for ctype tolower() function 10789 10790 Synopsis 10791 10792 #include 10793 10794 int32_t * * __ctype_tolower_loc(void); 10795 10796 Description 10797 10798 The __ctype_tolower_loc() function shall return a pointer into 10799 an array of characters in the current locale that contains 10800 lower case equivalents for each character in the current 10801 character set. The array shall contain a total of 384 10802 characters, and can be indexed with any signed or unsigned char 10803 (i.e. with an index value between -128 and 255). If the 10804 application is multithreaded, the array shall be local to the 10805 current thread. 10806 10807 This interface is not in the source standard; it is only in the 10808 binary standard. 10809 10810 Return Value 10811 10812 The __ctype_tolower_loc() function shall return a pointer to 10813 the array of characters to be used for the ctype() family of 10814 functions (see ). 10815 10816 __ctype_toupper_loc 10817 10818 Name 10819 10820 __ctype_toupper_loc -- accessor function for 10821 __ctype_b_toupper() array for ctype toupper() function 10822 10823 Synopsis 10824 10825 #include 10826 10827 int32_t * * __ctype_toupper_loc(void); 10828 10829 Description 10830 10831 The __ctype_toupper_loc() function shall return a pointer into 10832 an array of characters in the current locale that contains 10833 upper case equivalents for each character in the current 10834 character set. The array shall contain a total of 384 10835 characters, and can be indexed with any signed or unsigned char 10836 (i.e. with an index value between -128 and 255). If the 10837 application is multithreaded, the array shall be local to the 10838 current thread. 10839 10840 This interface is not in the source standard; it is only in the 10841 binary standard. 10842 10843 Return Value 10844 10845 The __ctype_toupper_loc() function shall return a pointer to 10846 the array of characters to be used for the ctype() family of 10847 functions (see ). 10848 10849 __cxa_atexit 10850 10851 Name 10852 10853 __cxa_atexit -- register a function to be called by exit or 10854 when a shared library is unloaded 10855 10856 Synopsis 10857 10858 int __cxa_atexit(void (*func) (void *), void * arg, void * 10859 dso_handle); 10860 10861 Description 10862 10863 As described in the Itanium™ C++ ABI, __cxa_atexit() registers 10864 a destructor function to be called by exit() or when a shared 10865 library is unloaded. When a shared library is unloaded, any 10866 destructor function associated with that shared library, 10867 identified by dso_handle, shall be called with the single 10868 argument arg, and then that function shall be removed, or 10869 marked as complete, from the list of functions to run at 10870 exit(). On a call to exit(), any remaining functions registered 10871 shall be called with the single argument arg. Destructor 10872 functions shall always be called in the reverse order to their 10873 registration (i.e. the most recently registered function shall 10874 be called first), 10875 10876 The __cxa_atexit() function is used to implement atexit(), as 10877 described in POSIX 1003.1-2001 (ISO/IEC 9945-2003). Calling 10878 atexit(func) from the statically linked part of an application 10879 shall be equivalent to __cxa_atexit(func, NULL, NULL). 10880 10881 __cxa_atexit() is not in the source standard; it is only in the 10882 binary standard. 10883 10884 Note: atexit() is not in the binary standard; it is only in 10885 the source standard. 10886 10887 __cxa_finalize 10888 10889 Name 10890 10891 __cxa_finalize -- call destructors of global (or local static) 10892 C++ objects and exit functions registered with atexit 10893 10894 Synopsis 10895 10896 void __cxa_finalize(void * d); 10897 10898 Description 10899 10900 As described in the Itanium® C++ ABI, the C runtime library 10901 shall maintain a list of termination function entries 10902 containing the following information: 10903 10904 * A pointer to a termination function. 10905 * An operand to be passed to the function. 10906 * A handle identifying the home shared library of the entry. 10907 10908 The list is populated by entries of two kinds: 10909 10910 * Destructors of global (or local static) C++ objects that 10911 require destruction on exit. 10912 * Functions registered by the user with atexit(). 10913 10914 In the former case an entry consists of a pointer to the 10915 destructor, a pointer to the corresponding object and a handle 10916 for the home shared library of the object. In the latter case 10917 the pointer to the function is the pointer passed to atexit(), 10918 while the other pointers are NULL. 10919 10920 When __cxa_finalize(d) is called, it shall walk the termination 10921 function list, calling each in turn if d matches the handle of 10922 the termination function entry. If d is NULL, it shall call all 10923 the termination funtions. Multiple calls to __cxa_finalize 10924 shall not result in calling termination function entries 10925 multiple times; the implementation may either remove entries or 10926 mark them finished. The termination functions shall always be 10927 called in the reverse order of their registration (i.e. the 10928 most recently registered function shall be called first). 10929 10930 An application shall not call __cxa_finalize() directly. The 10931 implementation shall arrange for__cxa_finalize() to be called 10932 during early shared library unload (e.g. dlclose()) with a 10933 handle to the shared library. When the main program calls exit, 10934 the implementation shall cause any remaining 10935 __cxa_atexit-registered functions to be called, either by 10936 calling __cxa_finalize(NULL), or by walking the registration 10937 list itself. 10938 10939 __cxa_finalize() is not in the source standard; it is only in 10940 the binary standard. 10941 10942 __daylight 10943 10944 Name 10945 10946 __daylight -- external daylight savings time flag 10947 10948 Synopsis 10949 10950 int __daylight; 10951 10952 Description 10953 10954 The external variable __daylight shall implement the daylight 10955 savings time flag daylight as specified in POSIX 1003.1-2001 10956 (ISO/IEC 9945-2003). __daylight has the same specification as 10957 daylight. 10958 10959 __environ 10960 10961 Name 10962 10963 __environ -- alias for environ - user environment 10964 10965 Synopsis 10966 10967 extern char **__environ; 10968 10969 Description 10970 10971 The external variable __environ shall implement the environment 10972 variable environ as specified in POSIX 1003.1-2001 (ISO/IEC 10973 9945-2003). __environ has the same specification as environ. 10974 10975 __errno_location 10976 10977 Name 10978 10979 __errno_location -- address of errno variable 10980 10981 Synopsis 10982 10983 int * __errno_location(void); 10984 10985 Description 10986 10987 The __errno_location() function shall return the address of the 10988 errno variable for the current thread. 10989 10990 __errno_location() is not in the source standard; it is only in 10991 the binary standard. 10992 10993 __fgets_chk 10994 10995 Name 10996 10997 __fgets_chk -- string input, with buffer overflow checking 10998 10999 Synopsis 11000 11001 #include 11002 11003 char * __fgets_chk(char * s, size_t size, int strsize, FILE * 11004 stream); 11005 11006 Description 11007 11008 The interface __fgets_chk() shall function in the same way as 11009 the interface fgets(), except that __fgets_chk() shall check 11010 for buffer overflow before computing a result. If an overflow 11011 is anticipated, the function shall abort and the program 11012 calling it shall exit. 11013 11014 The parameter strsize specifies the size of the object pointed 11015 to by stream. 11016 11017 The __fgets_chk() function is not in the source standard; it is 11018 only in the binary standard. 11019 11020 __fgets_unlocked_chk 11021 11022 Name 11023 11024 __fgets_unlocked_chk -- non-locking string input, with buffer 11025 overflow checking 11026 11027 Synopsis 11028 11029 #include 11030 11031 char * __fgets_unlocked_chk(char * s, size_t size, int strsize, 11032 FILE * stream); 11033 11034 Description 11035 11036 The interface __fgets_unlocked_chk() shall function in the same 11037 way as the interface fgets_unlocked(), except that 11038 __fgets_unlocked_chk() shall check for buffer overflow before 11039 computing a result. If an overflow is anticipated, the function 11040 shall abort and the program calling it shall exit. 11041 11042 The parameter strsize specifies the size of the object pointed 11043 to by stream. 11044 11045 The __fgets_unlocked_chk() function is not in the source 11046 standard; it is only in the binary standard. 11047 11048 __fgetws_chk 11049 11050 Name 11051 11052 __fgetws_chk -- read a wide-character string from a FILE 11053 stream, with buffer overflow checking 11054 11055 Synopsis 11056 11057 #include 11058 11059 wchar_t * __fgetws_chk(wchar_t * ws, size_t size, int strsize, 11060 FILE * stream); 11061 11062 Description 11063 11064 The interface __fgetws_chk() shall function in the same way as 11065 the interface fgetws(), except that __fgetws_chk() shall check 11066 for buffer overflow before computing a result. If an overflow 11067 is anticipated, the function shall abort and the program 11068 calling it shall exit. 11069 11070 The parameter strsize specifies the size of the object pointed 11071 to by stream. 11072 11073 The __fgetws_chk() function is not in the source standard; it 11074 is only in the binary standard. 11075 11076 __fgetws_unlocked_chk 11077 11078 Name 11079 11080 __fgetws_unlocked_chk -- read a wide-character string from a 11081 FILE stream in a non-locking manner, with stack checking 11082 11083 Synopsis 11084 11085 #include 11086 11087 wchar_t * __fgetws_unlocked_chk(wchar_t * ws, size_t strsize, 11088 int n, FILE * stream); 11089 11090 Description 11091 11092 The interface __fgetws_unlocked_chk() shall function in the 11093 same way as the interface fgetws_unlocked(), except that 11094 __fgetws_unlocked_chk() shall check for stack overflow before 11095 computing a result. If an overflow is anticipated, the function 11096 shall abort and the program calling it shall exit. 11097 11098 The parameter strsize specifies the size of the object pointed 11099 to by stream. 11100 11101 The __fgetws_unlocked_chk() function is not in the source 11102 standard; it is only in the binary standard. 11103 11104 __fpending 11105 11106 Name 11107 11108 __fpending -- returns in bytes the amount of output pending on 11109 a stream 11110 11111 Synopsis 11112 11113 size_t __fpending(FILE * stream); 11114 11115 Description 11116 11117 __fpending() returns the amount of output in bytes pending on a 11118 stream. 11119 11120 __fpending() is not in the source standard; it is only in the 11121 binary standard. 11122 11123 __fprintf_chk 11124 11125 Name 11126 11127 __fprintf_chk -- convert formatted output, with stack checking 11128 11129 Synopsis 11130 11131 #include 11132 11133 int __fprintf_chk(FILE * stream, int flag, const char * 11134 format); 11135 11136 Description 11137 11138 The interface __fprintf_chk() shall function in the same way as 11139 the interface fprintf(), except that __fprintf_chk() shall 11140 check for stack overflow before computing a result, depending 11141 on the value of the flag parameter. If an overflow is 11142 anticipated, the function shall abort and the program calling 11143 it shall exit. 11144 11145 In general, the higher the value of flag, the more security 11146 measures this interface shall take in the form of checking the 11147 stack, parameter values, and so on. 11148 11149 The __fprintf_chk() function is not in the source standard; it 11150 is only in the binary standard. 11151 11152 __fwprintf_chk 11153 11154 Name 11155 11156 __fwprintf_chk -- convert formatted wide-character output, with 11157 stack checking 11158 11159 Synopsis 11160 11161 #include 11162 11163 int __fwprintf_chk(FILE * stream, int flag, const wchar_t * 11164 format); 11165 11166 Description 11167 11168 The interface __fwprintf_chk() shall function in the same way 11169 as the interface fwprintf(), except that __fwprintf_chk() shall 11170 check for stack overflow before computing a result, depending 11171 on the value of the flag parameter. If an overflow is 11172 anticipated, the function shall abort and the program calling 11173 it shall exit. 11174 11175 In general, the higher the value of flag, the more security 11176 measures this interface shall take in the form of checking the 11177 stack, parameter values, and so on. 11178 11179 The __fwprintf_chk() function is not in the source standard; it 11180 is only in the binary standard. 11181 11182 __fxstatat 11183 11184 Name 11185 11186 __fxstatat -- get file status relative to directory file 11187 descriptor 11188 11189 Synopsis 11190 11191 #include 11192 #include 11193 11194 int __fxstatat(int ver, int dirfd, const char * path, struct 11195 stat * stat_buf, int flags); 11196 11197 Description 11198 11199 The __fxstatat() function shall implement the fstatat() 11200 function. The behavior of __fxstatat() for values of ver other 11201 than _STAT_VER is undefined. See Data Definitions in the 11202 architecture specific part of this specification for the 11203 correct value of _STAT_VER. 11204 11205 __fxstatat(_STAT_VER, dirfd, stat_buf, flags) shall behave as 11206 fstatat(dirfd, stat_buf, flags) as specified by POSIX 11207 1003.1-2008 (ISO/IEC 9945-2009). 11208 11209 __fxstatat() is not in the source standard; it is only in the 11210 binary standard. 11211 11212 Note: The fstatat() function is not in the binary standard; 11213 it is only in the source standard. 11214 11215 __fxstatat64, fstatat64 11216 11217 Name 11218 11219 __fxstatat64, fstatat64 -- get file status relative to a 11220 directory file descriptor (Large File Support) 11221 11222 Synopsis 11223 11224 #include 11225 #include 11226 11227 int __fxstatat64(int ver, int dirfd, const char * path, struct 11228 stat64 * stat_buf, int flags); 11229 11230 int fstatat64(int dirfd, const char * file, struct stat64 * 11231 buf, int flag); 11232 11233 Description 11234 11235 fstatat64() is a large-file version of the fstatat() function 11236 as defined in POSIX 1003.1-2008 (ISO/IEC 9945-2009). It differs 11237 from fstatat() only in that the buf parameter refers to a 11238 large-file version of the stat structure. 11239 11240 The __fxstatat64() function shall implement the fstatat64() 11241 function. The behavior of __fxstatat64() for values of ver 11242 other than _STAT_VER is undefined. See Data Definitions in the 11243 architecture specific part of this specification for the 11244 correct value of _STAT_VER. 11245 11246 __fxstatat64(_STAT_VER, dirfd, stat_buf, flags) shall behave as 11247 fstatat64(dirfd, stat_buf, flags) 11248 11249 __fxstatat64() is not in the source standard; it is only in the 11250 binary standard. 11251 11252 Note: The fstatat64() function is not in the binary 11253 standard; it is only in the source standard. 11254 11255 __getcwd_chk 11256 11257 Name 11258 11259 __getcwd_chk -- get current working directory, with buffer 11260 overflow checking 11261 11262 Synopsis 11263 11264 #include 11265 11266 char * __getcwd_chk(char * buf, size_t len, size_t buflen); 11267 11268 Description 11269 11270 The interface __getcwd_chk() shall function in the same way as 11271 the interface getcwd(), except that __getcwd_chk() shall check 11272 for buffer overflow before computing a result. If an overflow 11273 is anticipated, the function shall abort and the program 11274 calling it shall exit. 11275 11276 The parameter buflen specifies the size of the buffer buf. If 11277 len exceeds buflen, the function shall abort, and the program 11278 calling it shall exit. 11279 11280 The __getcwd_chk() function is not in the source standard; it 11281 is only in the binary standard. 11282 11283 __getgroups_chk 11284 11285 Name 11286 11287 __getgroups_chk -- get list of supplementary group IDs, with 11288 buffer overflow checking 11289 11290 Synopsis 11291 11292 #include 11293 11294 int __getgroups_chk(int size, gid_t * list, size_t listlen); 11295 11296 Description 11297 11298 The interface __getgroups_chk() shall function in the same way 11299 as the interface getgroups(), except that __getgroups_chk() 11300 shall check for buffer overflow before computing a result. If 11301 an overflow is anticipated, the function shall abort and the 11302 program calling it shall exit. 11303 11304 The parameter listlen specifies the size in bytes of the object 11305 list. 11306 11307 The __getgroups_chk() function is not in the source standard; 11308 it is only in the binary standard. 11309 11310 __gethostname_chk 11311 11312 Name 11313 11314 __gethostname_chk -- get host name, with buffer overflow 11315 checking 11316 11317 Synopsis 11318 11319 #include 11320 11321 int __gethostname_chk(char * buf, size_t buflen, size_t 11322 maxlen); 11323 11324 Description 11325 11326 The interface __gethostname_chk() shall function in the same 11327 way as the interface gethostname(), except that 11328 __gethostname_chk() shall check for buffer overflow before 11329 computing a result. If an overflow is anticipated, the function 11330 shall abort and the program calling it shall exit. 11331 11332 The parameter buflen specifies the size of the buffer buf. If 11333 buflen exceeds maxlen, the function shall abort, and the 11334 program calling it shall exit. 11335 11336 The __gethostname_chk() function is not in the source standard; 11337 it is only in the binary standard. 11338 11339 __getlogin_r_chk 11340 11341 Name 11342 11343 __getlogin_r_chk -- get user name, with buffer overflow 11344 checking (reentrant) 11345 11346 Synopsis 11347 11348 #include 11349 11350 int __getlogin_r_chk(char * buf, size_t buflen, size_t maxlen); 11351 11352 Description 11353 11354 The interface __getlogin_r_chk() shall function in the same way 11355 as the interface getlogin_r(), except that __getlogin_r_chk() 11356 shall check for buffer overflow before computing a result. If 11357 an overflow is anticipated, the function shall abort and the 11358 program calling it shall exit. 11359 11360 The parameter buflen specifies the size of the buffer buf. If 11361 buflen exceeds maxlen, the function shall abort, and the 11362 program calling it shall exit. 11363 11364 The __getlogin_r_chk() function is not in the source standard; 11365 it is only in the binary standard. 11366 11367 __getpagesize 11368 11369 Name 11370 11371 __getpagesize -- alias for getpagesize - get current page size 11372 11373 Synopsis 11374 11375 int __getpagesize(void); 11376 11377 Description 11378 11379 __getpagesize() is an alias for getpagesize() - get current 11380 page size. 11381 11382 __getpagesize() has the same specification as getpagesize(). 11383 11384 __getpagesize() is not in the source standard; it is only in 11385 the binary standard. 11386 11387 __getpgid 11388 11389 Name 11390 11391 __getpgid -- get the process group id 11392 11393 Synopsis 11394 11395 pid_t __getpgid(pid_t pid); 11396 11397 Description 11398 11399 __getpgid() has the same specification as getpgid(). 11400 11401 __getpgid() is not in the source standard; it is only in the 11402 binary standard. 11403 11404 __h_errno_location 11405 11406 Name 11407 11408 __h_errno_location -- address of h_errno variable 11409 11410 Synopsis 11411 11412 int * __h_errno_location(void); 11413 11414 Description 11415 11416 __h_errno_location() returns the address of the h_errno 11417 variable, where h_errno is as specified in POSIX 1003.1-2001 11418 (ISO/IEC 9945-2003). 11419 11420 __h_errno_location() is not in the source standard; it is only 11421 in the binary standard. Note that h_errno itself is only in the 11422 source standard; it is not in the binary standard. 11423 11424 __isinf 11425 11426 Name 11427 11428 __isinf -- test for infinity 11429 11430 Synopsis 11431 11432 int __isinf(double arg); 11433 11434 Description 11435 11436 __isinf() has the same specification as isinf() in POSIX 11437 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 11438 for __isinf() is known to be double. 11439 11440 __isinf() is not in the source standard; it is only in the 11441 binary standard. 11442 11443 __isinff 11444 11445 Name 11446 11447 __isinff -- test for infinity 11448 11449 Synopsis 11450 11451 int __isinff(float arg); 11452 11453 Description 11454 11455 __isinff() has the same specification as isinf() in POSIX 11456 1003.1-2001 (ISO/IEC 9945-2003) except that the argument type 11457 for __isinff() is known to be float. 11458 11459 __isinff() is not in the source standard; it is only in the 11460 binary standard. 11461 11462 __isinfl 11463 11464 Name 11465 11466 __isinfl -- test for infinity 11467 11468 Synopsis 11469 11470 int __isinfl(long double arg); 11471 11472 Description 11473 11474 __isinfl() has the same specification as isinf() in the POSIX 11475 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 11476 for __isinfl() is known to be long double. 11477 11478 __isinfl() is not in the source standard; it is only in the 11479 binary standard. 11480 11481 __isnan 11482 11483 Name 11484 11485 __isnan -- test for infinity 11486 11487 Synopsis 11488 11489 int __isnan(double arg); 11490 11491 Description 11492 11493 __isnan() has the same specification as isnan() in POSIX 11494 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 11495 for __isnan() is known to be double. 11496 11497 __isnan() is not in the source standard; it is only in the 11498 binary standard. 11499 11500 __isnanf 11501 11502 Name 11503 11504 __isnanf -- test for infinity 11505 11506 Synopsis 11507 11508 int __isnanf(float arg); 11509 11510 Description 11511 11512 __isnanf() has the same specification as isnan() in POSIX 11513 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 11514 for __isnanf() is known to be float. 11515 11516 __isnanf() is not in the source standard; it is only in the 11517 binary standard. 11518 11519 __isnanl 11520 11521 Name 11522 11523 __isnanl -- test for infinity 11524 11525 Synopsis 11526 11527 int __isnanl(long double arg); 11528 11529 Description 11530 11531 __isnanl() has the same specification as isnan() in POSIX 11532 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 11533 for __isnanl() is known to be long double. 11534 11535 __isnanl() is not in the source standard; it is only in the 11536 binary standard. 11537 11538 __libc_current_sigrtmax 11539 11540 Name 11541 11542 __libc_current_sigrtmax -- return number of available real-time 11543 signal with lowest priority 11544 11545 Synopsis 11546 11547 int __libc_current_sigrtmax(void); 11548 11549 Description 11550 11551 __libc_current_sigrtmax() returns the number of an available 11552 real-time signal with the lowest priority. 11553 11554 __libc_current_sigrtmax() is not in the source standard; it is 11555 only in the binary standard. 11556 11557 __libc_current_sigrtmin 11558 11559 Name 11560 11561 __libc_current_sigrtmin -- return number of available real-time 11562 signal with highest priority 11563 11564 Synopsis 11565 11566 int __libc_current_sigrtmin(void); 11567 11568 Description 11569 11570 __libc_current_sigrtmin() returns the number of an available 11571 real-time signal with the highest priority. 11572 11573 __libc_current_sigrtmin() is not in the source standard; it is 11574 only in the binary standard. 11575 11576 __libc_start_main 11577 11578 Name 11579 11580 __libc_start_main -- initialization routine 11581 11582 Synopsis 11583 11584 int __libc_start_main(int (*main) (int, char **, char **), int 11585 argc, char ** ubp_av, void (*init) (void), void (*fini) (void), 11586 void (*rtld_fini) (void), void (*stack_end)); 11587 11588 Description 11589 11590 The __libc_start_main() function shall perform any necessary 11591 initialization of the execution environment, call the main 11592 function with appropriate arguments, and handle the return from 11593 main(). If the main() function returns, the return value shall 11594 be passed to the exit() function. 11595 11596 Note: While this specification is intended to be 11597 implementation independent, process and library 11598 initialization may include: 11599 11600 * performing any necessary security checks if the effective 11601 user ID is not the same as the real user ID. 11602 * initialize the threading subsystem. 11603 * registering the rtld_fini to release resources when this 11604 dynamic shared object exits (or is unloaded). 11605 * registering the fini handler to run at program exit. 11606 * calling the initializer function (*init)(). 11607 * calling main() with appropriate arguments. 11608 * calling exit() with the return value from main(). 11609 11610 This list is an example only. 11611 11612 __libc_start_main() is not in the source standard; it is only 11613 in the binary standard. 11614 11615 See Also 11616 11617 The section on Process Initialization in each of the 11618 architecture specific parts of ISO/IEC 23360. 11619 11620 __mbsnrtowcs_chk 11621 11622 Name 11623 11624 __mbsnrtowcs_chk -- convert a multibyte string to a 11625 wide-character string, with buffer overflow checking 11626 11627 Synopsis 11628 11629 #include 11630 11631 size_t __mbsnrtowcs_chk(wchar_t * dest, const char * * src, 11632 size_t nmc, size_t len, mbstate_t * ps, size_t destlen); 11633 11634 Description 11635 11636 The interface __mbsnrtowcs_chk() shall function in the same way 11637 as the interface mbsnrtowcs(), except that __mbsnrtowcs_chk() 11638 shall check for buffer overflow before computing a result. If 11639 an overflow is anticipated, the function shall abort and the 11640 program calling it shall exit. 11641 11642 The parameter destlen specifies the size of the object dest. If 11643 len exceeds destlen, the function shall abort, and the program 11644 calling it shall exit. 11645 11646 The __mbsnrtowcs_chk() function is not in the source standard; 11647 it is only in the binary standard. 11648 11649 __mbsrtowcs_chk 11650 11651 Name 11652 11653 __mbsrtowcs_chk -- convert a multibyte string to a 11654 wide-character string, with buffer overflow checking 11655 11656 Synopsis 11657 11658 #include 11659 11660 size_t __mbsrtowcs_chk(wchar_t * dest, const char * * src, 11661 size_t len, mbstate_t * ps, size_t destlen); 11662 11663 Description 11664 11665 The interface __mbsrtowcs_chk() shall function in the same way 11666 as the interface mbsrtowcs(), except that __mbsrtowcs_chk() 11667 shall check for buffer overflow before computing a result. If 11668 an overflow is anticipated, the function shall abort and the 11669 program calling it shall exit. 11670 11671 The parameter destlen specifies the size of the object dest. If 11672 len exceeds destlen, the function shall abort, and the program 11673 calling it shall exit. 11674 11675 The __mbsrtowcs_chk() function is not in the source standard; 11676 it is only in the binary standard. 11677 11678 __mbstowcs_chk 11679 11680 Name 11681 11682 __mbstowcs_chk -- convert a multibyte string to a 11683 wide-character string, with buffer overflow checking 11684 11685 Synopsis 11686 11687 #include 11688 11689 size_t __mbstowcs_chk(wchar_t * dest, const char * src, size_t 11690 len, size_t destlen); 11691 11692 Description 11693 11694 The interface __mbstowcs_chk() shall function in the same way 11695 as the interface mbstowcs(), except that __mbstowcs_chk() shall 11696 check for buffer overflow before computing a result. If an 11697 overflow is anticipated, the function shall abort and the 11698 program calling it shall exit. 11699 11700 The parameter destlen specifies the size of the object dest. If 11701 len exceeds destlen, the function shall abort, and the program 11702 calling it shall exit. 11703 11704 The __mbstowcs_chk() function is not in the source standard; it 11705 is only in the binary standard. 11706 11707 __memcpy_chk 11708 11709 Name 11710 11711 __memcpy_chk -- copy memory area, with buffer overflow checking 11712 11713 Synopsis 11714 11715 #include 11716 11717 void * __memcpy_chk(void * dest, const void * src, size_t len, 11718 size_t destlen); 11719 11720 Description 11721 11722 The interface __memcpy_chk() shall function in the same way as 11723 the interface memcpy(), except that __memcpy_chk() shall check 11724 for buffer overflow before computing a result. If an overflow 11725 is anticipated, the function shall abort and the program 11726 calling it shall exit. 11727 11728 The parameter destlen specifies the size of the object dest. If 11729 len exceeds destlen, the function shall abort, and the program 11730 calling it shall exit. 11731 11732 The __memcpy_chk() function is not in the source standard; it 11733 is only in the binary standard. 11734 11735 __memmove_chk 11736 11737 Name 11738 11739 __memmove_chk -- copy memory area, with buffer overflow 11740 checking 11741 11742 Synopsis 11743 11744 #include 11745 11746 void * __memmove_chk(void * dest, const void * src, size_t len, 11747 size_t destlen); 11748 11749 Description 11750 11751 The interface __memmove_chk() shall function in the same way as 11752 the interface memmove(), except that __memmove_chk() shall 11753 check for buffer overflow before computing a result. If an 11754 overflow is anticipated, the function shall abort and the 11755 program calling it shall exit. 11756 11757 The parameter destlen specifies the size of the object dest. If 11758 len exceeds destlen, the function shall abort, and the program 11759 calling it shall exit. 11760 11761 The __memmove_chk() function is not in the source standard; it 11762 is only in the binary standard. 11763 11764 __mempcpy 11765 11766 Name 11767 11768 __mempcpy -- copy given number of bytes of source to 11769 destination 11770 11771 Synopsis 11772 11773 #include 11774 11775 void * __mempcpy(void * restrict dest, const void * restrict 11776 src, size_t n); 11777 11778 Description 11779 11780 __mempcpy() copies n bytes of src to dest, returning a pointer 11781 to the byte after the last written byte. 11782 11783 If copying takes place between objects that overlap, the 11784 behavior is undefined. 11785 11786 If either dest or src is a null pointer, the behavior is 11787 undefined. 11788 11789 If n is 0 and the other parameters are valid, the return value 11790 is dest. 11791 11792 __mempcpy() is not in the source standard; it is only in the 11793 binary standard. 11794 11795 __mempcpy_chk 11796 11797 Name 11798 11799 __mempcpy_chk -- copy memory area, with buffer overflow 11800 checking 11801 11802 Synopsis 11803 11804 #include 11805 11806 void * __mempcpy_chk(void * dest, const void * src, size_t len, 11807 size_t destlen); 11808 11809 Description 11810 11811 The interface __mempcpy_chk() shall function in the same way as 11812 the interface mempcpy(), except that __mempcpy_chk() shall 11813 check for buffer overflow before computing a result. If an 11814 overflow is anticipated, the function shall abort and the 11815 program calling it shall exit. 11816 11817 The parameter destlen specifies the size of the object dest. If 11818 len exceeds destlen, the function shall abort, and the program 11819 calling it shall exit. 11820 11821 The __mempcpy_chk() function is not in the source standard; it 11822 is only in the binary standard. 11823 11824 __memset_chk 11825 11826 Name 11827 11828 __memset_chk -- fill memory with a constant byte, using buffer 11829 overflow checking 11830 11831 Synopsis 11832 11833 #include 11834 11835 void * __memset_chk(void * dest, int c, size_t len, size_t 11836 destlen); 11837 11838 Description 11839 11840 The interface __memset_chk() shall function in the same way as 11841 the interface memset(), except that __memset_chk() shall check 11842 for buffer overflow before computing a result. If an overflow 11843 is anticipated, the function shall abort and the program 11844 calling it shall exit. 11845 11846 The parameter destlen specifies the size of the object dest. If 11847 len exceeds destlen, the function shall abort, and the program 11848 calling it shall exit. 11849 11850 The __memset_chk() function is not in the source standard; it 11851 is only in the binary standard. 11852 11853 __pread64_chk 11854 11855 Name 11856 11857 __pread64_chk -- read from a file descriptor at a given offset, 11858 with buffer overflow checking 11859 11860 Synopsis 11861 11862 #include 11863 11864 ssize_t __pread64_chk(int fd, void * buf, size_t nbytes, 11865 off64_t offset, size_t buflen); 11866 11867 Description 11868 11869 The interface __pread64_chk() shall function in the same way as 11870 the interface pread64(), except that __pread64_chk() shall 11871 check for buffer overflow before computing a result. If an 11872 overflow is anticipated, the function shall abort and the 11873 program calling it shall exit. 11874 11875 The parameter buflen specifies the size of the buffer buf. If 11876 nbytes exceeds buflen, the function shall abort, and the 11877 program calling it shall exit. 11878 11879 The __pread64_chk() function is not in the source standard; it 11880 is only in the binary standard. 11881 11882 __pread_chk 11883 11884 Name 11885 11886 __pread_chk -- read from a file descriptor at a given offset, 11887 with buffer overflow checking 11888 11889 Synopsis 11890 11891 #include 11892 11893 ssize_t __pread_chk(int fd, void * buf, size_t nbytes, off_t 11894 offset, size_t buflen); 11895 11896 Description 11897 11898 The interface __pread_chk() shall function in the same way as 11899 the interface pread(), except that __pread_chk() shall check 11900 for buffer overflow before computing a result. If an overflow 11901 is anticipated, the function shall abort and the program 11902 calling it shall exit. 11903 11904 The parameter buflen specifies the size of the buffer buf. If 11905 nbytes exceeds buflen, the function shall abort, and the 11906 program calling it shall exit. 11907 11908 The __pread_chk() function is not in the source standard; it is 11909 only in the binary standard. 11910 11911 __printf_chk 11912 11913 Name 11914 11915 __printf_chk -- format and print data, with stack checking 11916 11917 Synopsis 11918 11919 #include 11920 11921 int __printf_chk(int flag, const char * format); 11922 11923 Description 11924 11925 The interface __printf_chk() shall function in the same way as 11926 the interface printf(), except that __printf_chk() shall check 11927 for stack overflow before computing a result, depending on the 11928 value of the flag parameter. If an overflow is anticipated, the 11929 function shall abort and the program calling it shall exit. 11930 11931 In general, the higher the value of flag, the more security 11932 measures this interface shall take in the form of checking the 11933 stack, parameter values, and so on. 11934 11935 The __printf_chk() function is not in the source standard; it 11936 is only in the binary standard. 11937 11938 __rawmemchr 11939 11940 Name 11941 11942 __rawmemchr -- scan memory 11943 11944 Synopsis 11945 11946 #include 11947 11948 void * __rawmemchr(const void * s, int c); 11949 11950 Description 11951 11952 The __rawmemchr() function shall locate the first occurrence of 11953 c (converted to an unsigned char) in the object pointed to by 11954 s. If the byte does not occur in the object, then the behavior 11955 is undefined. 11956 11957 __rawmemchr() is a weak alias for rawmemchr(). It is similar to 11958 memchr(), but it has no length limit. 11959 11960 __rawmemchr() is not in the source standard; it is only in the 11961 binary standard. 11962 11963 Return Value 11964 11965 The __rawmemchr() function shall return a pointer to the 11966 located byte. 11967 11968 __read_chk 11969 11970 Name 11971 11972 __read_chk -- read from a file descriptor, with buffer overflow 11973 checking 11974 11975 Synopsis 11976 11977 #include 11978 11979 ssize_t __read_chk(int fd, void * buf, size_t nbytes, size_t 11980 buflen); 11981 11982 Description 11983 11984 The interface __read_chk() shall function in the same way as 11985 the interface read(), except that __read_chk() shall check for 11986 buffer overflow before computing a result. If an overflow is 11987 anticipated, the function shall abort and the program calling 11988 it shall exit. 11989 11990 The parameter buflen specifies the size of the buffer buf. If 11991 nbytes exceeds buflen, the function shall abort, and the 11992 program calling it shall exit. 11993 11994 The __read_chk() function is not in the source standard; it is 11995 only in the binary standard. 11996 11997 __readlink_chk 11998 11999 Name 12000 12001 __readlink_chk -- display value of a symbolic link, with buffer 12002 overflow checking 12003 12004 Synopsis 12005 12006 #include 12007 12008 ssize_t __readlink_chk(const char * path, char * buf, size_t 12009 len, size_t buflen); 12010 12011 Description 12012 12013 The interface __readlink_chk() shall function in the same way 12014 as the interface readlink(), except that __readlink_chk() shall 12015 check for buffer overflow before computing a result. If an 12016 overflow is anticipated, the function shall abort and the 12017 program calling it shall exit. 12018 12019 The parameter buflen specifies the size of the buffer buf. If 12020 len exceeds buflen, the function shall abort, and the program 12021 calling it shall exit. 12022 12023 The __readlink_chk() function is not in the source standard; it 12024 is only in the binary standard. 12025 12026 __realpath_chk 12027 12028 Name 12029 12030 __realpath_chk -- return the canonicalized absolute pathname, 12031 with buffer overflow checking 12032 12033 Synopsis 12034 12035 #include 12036 12037 char * __realpath_chk(const char * path, char * resolved_path, 12038 size_t resolved_len); 12039 12040 Description 12041 12042 The interface __realpath_chk() shall function in the same way 12043 as the interface realpath(), except that __realpath_chk() shall 12044 check for buffer overflow before computing a result. If an 12045 overflow is anticipated, the function shall abort and the 12046 program calling it shall exit. 12047 12048 The parameter resolved_len specifies the size of the string 12049 resolved_path. If resolved_len is less than PATH_MAX, then the 12050 function shall abort, and the program calling it shall exit. 12051 12052 The __realpath_chk() function is not in the source standard; it 12053 is only in the binary standard. 12054 12055 __recv_chk 12056 12057 Name 12058 12059 __recv_chk -- receive a message from a socket, with buffer 12060 overflow checking 12061 12062 Synopsis 12063 12064 #include 12065 12066 ssize_t __recv_chk(int fd, void * buf, size_t len, size_t 12067 buflen, int flag); 12068 12069 Description 12070 12071 The interface __recv_chk() shall function in the same way as 12072 the interface recv(), except that __recv_chk() shall check for 12073 buffer overflow before computing a result, depending on the 12074 value of the flag parameter. If an overflow is anticipated, the 12075 function shall abort and the program calling it shall exit. 12076 12077 In general, the higher the value of flag, the more security 12078 measures this interface shall take in the form of checking the 12079 buffer, parameter values, and so on. 12080 12081 The parameter buflen specifies the size of the buffer buf. If 12082 len exceeds buflen, the function shall abort, and the program 12083 calling it shall exit. 12084 12085 The __recv_chk() function is not in the source standard; it is 12086 only in the binary standard. 12087 12088 __recvfrom_chk 12089 12090 Name 12091 12092 __recvfrom_chk -- receive a message from a socket, with buffer 12093 overflow checking 12094 12095 Synopsis 12096 12097 #include 12098 12099 ssize_t __recvfrom_chk(int fd, void * buf, size_t len, size_t 12100 buflen, int flag, struct sockaddr * from, socklen_t * fromlen); 12101 12102 Description 12103 12104 The interface __recvfrom_chk() shall function in the same way 12105 as the interface recvfrom(), except that __recvfrom_chk() shall 12106 check for buffer overflow before computing a result, depending 12107 on the value of the flag parameter. If an overflow is 12108 anticipated, the function shall abort and the program calling 12109 it shall exit. 12110 12111 In general, the higher the value of flag, the more security 12112 measures this interface shall take in the form of checking the 12113 buffer, parameter values, and so on. 12114 12115 The parameter buflen specifies the size of the buffer buf. If 12116 len exceeds buflen, the function shall abort, and the program 12117 calling it shall exit. 12118 12119 The __recvfrom_chk() function is not in the source standard; it 12120 is only in the binary standard. 12121 12122 __register_atfork 12123 12124 Name 12125 12126 __register_atfork -- alias for register_atfork 12127 12128 Synopsis 12129 12130 int __register_atfork(void (*prepare) (void), void (*parent) 12131 (void), void (*child) (void), void *__dso_handle); 12132 12133 Description 12134 12135 __register_atfork() implements pthread_atfork() as specified in 12136 POSIX 1003.1-2001 (ISO/IEC 9945-2003). The additional parameter 12137 __dso_handle allows a shared object to pass in it's handle so 12138 that functions registered by __register_atfork() can be 12139 unregistered by the runtime when the shared object is unloaded. 12140 12141 __sigsetjmp 12142 12143 Name 12144 12145 __sigsetjmp -- save stack context for non-local goto 12146 12147 Synopsis 12148 12149 int __sigsetjmp(jmp_buf env, int savemask); 12150 12151 Description 12152 12153 __sigsetjmp() has the same behavior as sigsetjmp() as specified 12154 by POSIX 1003.1-2001 (ISO/IEC 9945-2003). 12155 12156 __sigsetjmp() is not in the source standard; it is only in the 12157 binary standard. 12158 12159 __snprintf_chk 12160 12161 Name 12162 12163 __snprintf_chk -- convert formatted output, with buffer 12164 overflow checking 12165 12166 Synopsis 12167 12168 #include 12169 12170 int __snprintf_chk(char * str, size_t maxlen, int flag, size_t 12171 strlen, const char * format); 12172 12173 Description 12174 12175 The interface __snprintf_chk() shall function in the same way 12176 as the interface snprintf(), except that __snprintf_chk() shall 12177 check for buffer overflow before computing a result, depending 12178 on the value of the flag parameter. If an overflow is 12179 anticipated, the function shall abort and the program calling 12180 it shall exit. 12181 12182 In general, the higher the value of flag, the more security 12183 measures this interface shall take in the form of checking the 12184 buffer, parameter values, and so on. 12185 12186 The parameter strlen specifies the size of the buffer str. If 12187 strlen is less than maxlen, the function shall abort, and the 12188 program calling it shall exit. 12189 12190 The __snprintf_chk() function is not in the source standard; it 12191 is only in the binary standard. 12192 12193 __sprintf_chk 12194 12195 Name 12196 12197 __sprintf_chk -- convert formatted output, with stack checking 12198 12199 Synopsis 12200 12201 #include 12202 12203 int __sprintf_chk(char * str, int flag, size_t strlen, const 12204 char * format); 12205 12206 Description 12207 12208 The interface __sprintf_chk() shall function in the same way as 12209 the interface sprintf(), except that __sprintf_chk() shall 12210 check for stack overflow before computing a result, depending 12211 on the value of the flag parameter. If an overflow is 12212 anticipated, the function shall abort and the program calling 12213 it shall exit. 12214 12215 In general, the higher the value of flag, the more security 12216 measures this interface shall take in the form of checking the 12217 stack, parameter values, and so on. 12218 12219 The parameter strlen specifies the size of the string str. If 12220 strlen is zero, the function shall abort, and the program 12221 calling it shall exit. 12222 12223 The __sprintf_chk() function is not in the source standard; it 12224 is only in the binary standard. 12225 12226 __stack_chk_fail 12227 12228 Name 12229 12230 __stack_chk_fail -- terminate a function in case of stack 12231 overflow 12232 12233 Synopsis 12234 12235 #include 12236 12237 void __stack_chk_fail(void); 12238 12239 Description 12240 12241 The interface __stack_chk_fail() shall abort the function that 12242 called it with a message that a stack overflow has been 12243 detected. The program that called the function shall then exit. 12244 12245 Application Usage (informative) 12246 12247 The interface __stack_chk_fail() does not check for a stack 12248 overflow itself. It merely reports one when invoked. 12249 12250 __stpcpy 12251 12252 Name 12253 12254 __stpcpy -- alias for stpcpy 12255 12256 Synopsis 12257 12258 #include 12259 12260 char * __stpcpy(char * dest, const char * src); 12261 12262 Description 12263 12264 The __stpcpy() function has the same specification as the 12265 stpcpy(). 12266 12267 __stpcpy() is not in the source standard; it is only in the 12268 binary standard. 12269 12270 __stpcpy_chk 12271 12272 Name 12273 12274 __stpcpy_chk -- copy a string returning a pointer to its end, 12275 with buffer overflow checking 12276 12277 Synopsis 12278 12279 #include 12280 12281 char * __stpcpy_chk(char * dest, const char * src, size_t 12282 destlen); 12283 12284 Description 12285 12286 The interface __stpcpy_chk() shall function in the same way as 12287 the interface stpcpy(), except that __stpcpy_chk() shall check 12288 for buffer overflow before computing a result. If an overflow 12289 is anticipated, the function shall abort and the program 12290 calling it shall exit. 12291 12292 The parameter destlen specifies the size of the object pointed 12293 to by dest. 12294 12295 The __stpcpy_chk() function is not in the source standard; it 12296 is only in the binary standard. 12297 12298 __stpncpy_chk 12299 12300 Name 12301 12302 __stpncpy_chk -- copy a fixed-size string, returning a pointer 12303 to its end, with buffer overflow checking 12304 12305 Synopsis 12306 12307 #include 12308 12309 char * __stpncpy_chk(char * dest, const char * src, size_t n, 12310 size_t destlen); 12311 12312 Description 12313 12314 The interface __stpncpy_chk() shall function in the same way as 12315 the interface stpncpy(), except that __stpncpy_chk() shall 12316 check for buffer overflow before computing a result. If an 12317 overflow is anticipated, the function shall abort and the 12318 program calling it shall exit. 12319 12320 The parameter destlen specifies the size of the object pointed 12321 to by dest. If n exceeds destlen, the function shall abort, and 12322 the program calling it shall exit. 12323 12324 The __stpncpy_chk() function is not in the source standard; it 12325 is only in the binary standard. 12326 12327 __strcat_chk 12328 12329 Name 12330 12331 __strcat_chk -- concatenate two strings, with buffer overflow 12332 checking 12333 12334 Synopsis 12335 12336 #include 12337 12338 char * __strcat_chk(char * dest, const char * src, size_t 12339 destlen); 12340 12341 Description 12342 12343 The interface __strcat_chk() shall function in the same way as 12344 the interface strcat(), except that __strcat_chk() shall check 12345 for buffer overflow before computing a result. If an overflow 12346 is anticipated, the function shall abort and the program 12347 calling it shall exit. 12348 12349 The parameter destlen specifies the size of the object pointed 12350 to by dest. 12351 12352 The __strcat_chk() function is not in the source standard; it 12353 is only in the binary standard. 12354 12355 __strcpy_chk 12356 12357 Name 12358 12359 __strcpy_chk -- copy a string, with buffer overflow checking 12360 12361 Synopsis 12362 12363 #include 12364 12365 char * __strcpy_chk(char * dest, const char * src, size_t 12366 destlen); 12367 12368 Description 12369 12370 The interface __strcpy_chk() shall function in the same way as 12371 the interface strcpy(), except that __strcpy_chk() shall check 12372 for buffer overflow before computing a result. If an overflow 12373 is anticipated, the function shall abort and the program 12374 calling it shall exit. 12375 12376 The parameter destlen specifies the size of the object pointed 12377 to by dest. 12378 12379 The __strcpy_chk() function is not in the source standard; it 12380 is only in the binary standard. 12381 12382 __strdup 12383 12384 Name 12385 12386 __strdup -- alias for strdup 12387 12388 Synopsis 12389 12390 char * __strdup(const char * string); 12391 12392 Description 12393 12394 __strdup() has the same specification as strdup(). 12395 12396 __strdup() is not in the source standard; it is only in the 12397 binary standard. 12398 12399 __strncat_chk 12400 12401 Name 12402 12403 __strncat_chk -- concatenate two strings, with buffer overflow 12404 checking 12405 12406 Synopsis 12407 12408 #include 12409 12410 char * __strncat_chk(char * s1, const char * s2, size_t n, 12411 size_t s1len); 12412 12413 Description 12414 12415 The interface __strncat_chk() shall function in the same way as 12416 the interface strncat(), except that __strncat_chk() shall 12417 check for buffer overflow before computing a result. If an 12418 overflow is anticipated, the function shall abort and the 12419 program calling it shall exit. 12420 12421 The parameter s1len specifies the size of the object pointed to 12422 by s1. 12423 12424 The __strncat_chk() function is not in the source standard; it 12425 is only in the binary standard. 12426 12427 __strncpy_chk 12428 12429 Name 12430 12431 __strncpy_chk -- copy a string, with buffer overflow checking 12432 12433 Synopsis 12434 12435 #include 12436 12437 char * __strncpy_chk(char * s1, const char * s2, size_t n, 12438 size_t s1len); 12439 12440 Description 12441 12442 The interface __strncpy_chk() shall function in the same way as 12443 the interface strncpy(), except that __strncpy_chk() shall 12444 check for buffer overflow before computing a result. If an 12445 overflow is anticipated, the function shall abort and the 12446 program calling it shall exit. 12447 12448 The parameter s1len specifies the size of the object pointed to 12449 by s1. 12450 12451 The __strncpy_chk() function is not in the source standard; it 12452 is only in the binary standard. 12453 12454 __strtod_internal 12455 12456 Name 12457 12458 __strtod_internal -- underlying function for strtod 12459 12460 Synopsis 12461 12462 double __strtod_internal(const char * __nptr, char * * 12463 __endptr, int __group); 12464 12465 Description 12466 12467 __group shall be 0 or the behavior of __strtod_internal() is 12468 undefined. 12469 12470 __strtod_internal(__nptr, __endptr, 0)() has the same 12471 specification as strtod(__nptr, __endptr)(). 12472 12473 __strtod_internal() is not in the source standard; it is only 12474 in the binary standard. 12475 12476 __strtof_internal 12477 12478 Name 12479 12480 __strtof_internal -- underlying function for strtof 12481 12482 Synopsis 12483 12484 float __strtof_internal(const char * __nptr, char * * __endptr, 12485 int __group); 12486 12487 Description 12488 12489 __group shall be 0 or the behavior of __strtof_internal() is 12490 undefined. 12491 12492 __strtof_internal(__nptr, __endptr, 0)() has the same 12493 specification as strtof(__nptr, __endptr)(). 12494 12495 __strtof_internal() is not in the source standard; it is only 12496 in the binary standard. 12497 12498 __strtok_r 12499 12500 Name 12501 12502 __strtok_r -- alias for strtok_r 12503 12504 Synopsis 12505 12506 char * __strtok_r(char * restrict s, const char * restrict 12507 delim, char * * restrict save_ptr); 12508 12509 Description 12510 12511 __strtok_r() has the same specification as strtok_r(). 12512 12513 __strtok_r() is not in the source standard; it is only in the 12514 binary standard. 12515 12516 __strtol_internal 12517 12518 Name 12519 12520 __strtol_internal -- alias for strtol 12521 12522 Synopsis 12523 12524 long int __strtol_internal(const char * __nptr, char * * 12525 __endptr, int __base, int __group); 12526 12527 Description 12528 12529 __group shall be 0 or the behavior of __strtol_internal() is 12530 undefined. 12531 12532 __strtol_internal(__nptr, __endptr, __base, 0) has the same 12533 specification as strtol(__nptr, __endptr, __base). 12534 12535 __strtol_internal() is not in the source standard; it is only 12536 in the binary standard. 12537 12538 __strtold_internal 12539 12540 Name 12541 12542 __strtold_internal -- underlying function for strtold 12543 12544 Synopsis 12545 12546 long double __strtold_internal(const char * __nptr, char * * 12547 __endptr, int __group); 12548 12549 Description 12550 12551 __group shall be 0 or the behavior of __strtold_internal() is 12552 undefined. 12553 12554 __strtold_internal(__nptr, __endptr, 0) has the same 12555 specification as strtold(__nptr, __endptr). 12556 12557 __strtold_internal() is not in the source standard; it is only 12558 in the binary standard. 12559 12560 __strtoll_internal 12561 12562 Name 12563 12564 __strtoll_internal -- underlying function for strtoll 12565 12566 Synopsis 12567 12568 long long __strtoll_internal(const char * __nptr, char * * 12569 __endptr, int __base, int __group); 12570 12571 Description 12572 12573 __group shall be 0 or the behavior of __strtoll_internal() is 12574 undefined. 12575 12576 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 12577 specification as strtoll(__nptr, __endptr, __base). 12578 12579 __strtoll_internal() is not in the source standard; it is only 12580 in the binary standard. 12581 12582 __strtoul_internal 12583 12584 Name 12585 12586 __strtoul_internal -- underlying function for strtoul 12587 12588 Synopsis 12589 12590 unsigned long int __strtoul_internal(const char * __nptr, char 12591 * * __endptr, int __base, int __group); 12592 12593 Description 12594 12595 __group shall be 0 or the behavior of __strtoul_internal() is 12596 undefined. 12597 12598 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 12599 specification as strtoul(__nptr, __endptr, __base). 12600 12601 __strtoul_internal() is not in the source standard; it is only 12602 in the binary standard. 12603 12604 __strtoull_internal 12605 12606 Name 12607 12608 __strtoull_internal -- underlying function for strtoull 12609 12610 Synopsis 12611 12612 unsigned long long __strtoull_internal(const char * __nptr, 12613 char * * __endptr, int __base, int __group); 12614 12615 Description 12616 12617 __group shall be 0 or the behavior of __strtoull_internal() is 12618 undefined. 12619 12620 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 12621 specification as strtoull(__nptr, __endptr, __base). 12622 12623 __strtoull_internal() is not in the source standard; it is only 12624 in the binary standard. 12625 12626 __swprintf_chk 12627 12628 Name 12629 12630 __swprintf_chk -- convert formatted wide-character output, with 12631 stack checking 12632 12633 Synopsis 12634 12635 #include 12636 12637 int __swprintf_chk(wchar_t * s, size_t n, int flag, size_t 12638 slen, const wchar_t * format); 12639 12640 Description 12641 12642 The interface __swprintf_chk() shall function in the same way 12643 as the interface swprintf(), except that __swprintf_chk() shall 12644 check for stack overflow before computing a result, depending 12645 on the value of the flag parameter. If an overflow is 12646 anticipated, the function shall abort and the program calling 12647 it shall exit. 12648 12649 In general, the higher the value of flag, the more security 12650 measures this interface shall take in the form of checking the 12651 stack, parameter values, and so on. 12652 12653 The parameter slen specifies the size of the object pointed to 12654 by s. If slen is less than maxlen, the function shall abort and 12655 the program calling it shall exit. 12656 12657 In general, the higher the value of flag, the more security 12658 measures this interface shall take in the form of checking the 12659 stack, parameter values, and so on. 12660 12661 The __swprintf_chk() function is not in the source standard; it 12662 is only in the binary standard. 12663 12664 __sysconf 12665 12666 Name 12667 12668 __sysconf -- get configuration information at runtime 12669 12670 Synopsis 12671 12672 #include 12673 12674 long __sysconf(int name); 12675 12676 Description 12677 12678 __sysconf() gets configuration information at runtime. 12679 12680 __sysconf() is weak alias to sysconf(). 12681 12682 __sysconf() has the same specification as sysconf(). 12683 12684 __sysconf() is not in the source standard; it is only in the 12685 binary standard. 12686 12687 __syslog_chk 12688 12689 Name 12690 12691 __syslog_chk -- send messages to the system logger, with stack 12692 checking 12693 12694 Synopsis 12695 12696 #include 12697 12698 void __syslog_chk(int priority, int flag, const char * format); 12699 12700 Description 12701 12702 The interface __syslog_chk() shall function in the same way as 12703 the interface syslog(), except that __syslog_chk() shall check 12704 for stack overflow before computing a result, depending on the 12705 value of the flag parameter. If an overflow is anticipated, the 12706 function shall abort and the program calling it shall exit. 12707 12708 In general, the higher the value of flag, the more security 12709 measures this interface shall take in the form of checking the 12710 stack, parameter values, and so on. 12711 12712 The __syslog_chk() function is not in the source standard; it 12713 is only in the binary standard. 12714 12715 __sysv_signal 12716 12717 Name 12718 12719 __sysv_signal -- signal handling 12720 12721 Synopsis 12722 12723 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 12724 12725 Description 12726 12727 __sysv_signal() has the same behavior as signal() as specified 12728 by POSIX 1003.1-2001 (ISO/IEC 9945-2003). 12729 12730 __sysv_signal() is not in the source standard; it is only in 12731 the binary standard. 12732 12733 __timezone 12734 12735 Name 12736 12737 __timezone -- external variable containing timezone 12738 12739 Synopsis 12740 12741 long int __timezone; 12742 12743 Description 12744 12745 The external variable __timezone shall implement the timezone 12746 variable timezone as specified in POSIX 1003.1-2001 (ISO/IEC 12747 9945-2003). __timezone has the same specification as timezone. 12748 12749 __ttyname_r_chk 12750 12751 Name 12752 12753 __ttyname_r_chk -- return name of a terminal, with buffer 12754 overflow checking (reentrant) 12755 12756 Synopsis 12757 12758 #include 12759 12760 int __ttyname_r_chk(int fd, char * buf, size_t buflen, size_t 12761 nreal); 12762 12763 Description 12764 12765 The interface __ttyname_r_chk() shall function in the same way 12766 as the interface ttyname_r(), except that __ttyname_r_chk() 12767 shall check for buffer overflow before computing a result. If 12768 an overflow is anticipated, the function shall abort and the 12769 program calling it shall exit. 12770 12771 The parameter buflen specifies the size of the object pointed 12772 to by buf. If buflen exceeds nreal, the function shall abort 12773 and the program calling it shall exit. 12774 12775 The __ttyname_r_chk() function is not in the source standard; 12776 it is only in the binary standard. 12777 12778 __tzname 12779 12780 Name 12781 12782 __tzname -- external variable containing the timezone names 12783 12784 Synopsis 12785 12786 char * __tzname[2]; 12787 12788 Description 12789 12790 The external variable __tzname shall implement the timezone 12791 name variable tzname as specified in POSIX 1003.1-2001 (ISO/IEC 12792 9945-2003) function tzset(). __tzname has the same 12793 specification as tzname. 12794 12795 __vfprintf_chk 12796 12797 Name 12798 12799 __vfprintf_chk -- convert formatted output, with stack checking 12800 12801 Synopsis 12802 12803 #include 12804 12805 int __vfprintf_chk(FILE * fp, int flag, const char * format, 12806 va_list ap); 12807 12808 Description 12809 12810 The interface __vfprintf_chk() shall function in the same way 12811 as the interface vfprintf(), except that __vfprintf_chk() shall 12812 check for stack overflow before computing a result, depending 12813 on the value of the flag parameter. If an overflow is 12814 anticipated, the function shall abort and the program calling 12815 it shall exit. 12816 12817 In general, the higher the value of flag, the more security 12818 measures this interface shall take in the form of checking the 12819 stack, parameter values, and so on. 12820 12821 The __vfprintf_chk() function is not in the source standard; it 12822 is only in the binary standard. 12823 12824 __vfwprintf_chk 12825 12826 Name 12827 12828 __vfwprintf_chk -- convert formatted wide-character output, 12829 with stack checking 12830 12831 Synopsis 12832 12833 #include 12834 12835 int __vfwprintf_chk(FILE * fp, int flag, const wchar_t * 12836 format, va_list ap); 12837 12838 Description 12839 12840 The interface __vfwprintf_chk() shall function in the same way 12841 as the interface vfwprintf(), except that __vfwprintf_chk() 12842 shall check for stack overflow before computing a result, 12843 depending on the value of the flag parameter. If an overflow is 12844 anticipated, the function shall abort and the program calling 12845 it shall exit. 12846 12847 In general, the higher the value of flag, the more security 12848 measures this interface shall take in the form of checking the 12849 stack, parameter values, and so on. 12850 12851 The __vfwprintf_chk() function is not in the source standard; 12852 it is only in the binary standard. 12853 12854 __vprintf_chk 12855 12856 Name 12857 12858 __vprintf_chk -- convert formatted output, with stack checking 12859 12860 Synopsis 12861 12862 #include 12863 12864 int __vprintf_chk(int flag, const char * format, va_list ap); 12865 12866 Description 12867 12868 The interface __vprintf_chk() shall function in the same way as 12869 the interface vprintf(), except that __vprintf_chk() shall 12870 check for stack overflow before computing a result, depending 12871 on the value of the flag parameter. If an overflow is 12872 anticipated, the function shall abort and the program calling 12873 it shall exit. 12874 12875 In general, the higher the value of flag, the more security 12876 measures this interface shall take in the form of checking the 12877 stack, parameter values, and so on. 12878 12879 The __vprintf_chk() function is not in the source standard; it 12880 is only in the binary standard. 12881 12882 __vsnprintf_chk 12883 12884 Name 12885 12886 __vsnprintf_chk -- convert formatted output, with stack 12887 checking 12888 12889 Synopsis 12890 12891 #include 12892 12893 int __vsnprintf_chk(char * s, size_t maxlen, int flag, size_t 12894 slen, const char * format, va_list args); 12895 12896 Description 12897 12898 The interface __vsnprintf_chk() shall function in the same way 12899 as the interface vsnprintf(), except that __vsnprintf_chk() 12900 shall check for stack overflow before computing a result, 12901 depending on the value of the flag parameter. If an overflow is 12902 anticipated, the function shall abort and the program calling 12903 it shall exit. 12904 12905 In general, the higher the value of flag, the more security 12906 measures this interface shall take in the form of checking the 12907 stack, parameter values, and so on. 12908 12909 The parameter slen specifies the size of the object pointed to 12910 by s. If slen is less than maxlen, the function shall abort and 12911 the program calling it shall exit. 12912 12913 In general, the higher the value of flag, the more security 12914 measures this interface shall take in the form of checking the 12915 stack, parameter values, and so on. 12916 12917 The __vsnprintf_chk() function is not in the source standard; 12918 it is only in the binary standard. 12919 12920 __vsprintf_chk 12921 12922 Name 12923 12924 __vsprintf_chk -- convert formatted output, with stack checking 12925 12926 Synopsis 12927 12928 #include 12929 12930 int __vsprintf_chk(char * s, int flag, size_t slen, const char 12931 * format, va_list args); 12932 12933 Description 12934 12935 The interface __vsprintf_chk() shall function in the same way 12936 as the interface vsprintf(), except that __vsprintf_chk() shall 12937 check for stack overflow before computing a result, depending 12938 on the value of the flag parameter. If an overflow is 12939 anticipated, the function shall abort and the program calling 12940 it shall exit. 12941 12942 In general, the higher the value of flag, the more security 12943 measures this interface shall take in the form of checking the 12944 stack, parameter values, and so on. 12945 12946 The parameter slen specifies the size of the object pointed to 12947 by s. If its value is zero, the function shall abort and the 12948 program calling it shall exit. 12949 12950 The __vsprintf_chk() function is not in the source standard; it 12951 is only in the binary standard. 12952 12953 __vswprintf_chk 12954 12955 Name 12956 12957 __vswprintf_chk -- convert formatted wide-character output, 12958 with stack checking 12959 12960 Synopsis 12961 12962 #include 12963 12964 int __vswprintf_chk(wchar_t * s, size_t maxlen, int flag, 12965 size_t slen, const wchar_t * format, va_list args); 12966 12967 Description 12968 12969 The interface __vswprintf_chk() shall function in the same way 12970 as the interface vswprintf(), except that __vswprintf_chk() 12971 shall check for stack overflow before computing a result, 12972 depending on the value of the flag parameter. If an overflow is 12973 anticipated, the function shall abort and the program calling 12974 it shall exit. 12975 12976 In general, the higher the value of flag, the more security 12977 measures this interface shall take in the form of checking the 12978 stack, parameter values, and so on. 12979 12980 The parameter slen specifies the size of the object pointed to 12981 by s. If slen is less than maxlen, the function shall abort and 12982 the program calling it shall exit. 12983 12984 The __vswprintf_chk() function is not in the source standard; 12985 it is only in the binary standard. 12986 12987 __vsyslog_chk 12988 12989 Name 12990 12991 __vsyslog_chk -- send messages to the system logger, with stack 12992 checking 12993 12994 Synopsis 12995 12996 #include 12997 12998 void __vsyslog_chk(int priority, int flag, const char * format, 12999 va_list ap); 13000 13001 Description 13002 13003 The interface __vsyslog_chk() shall function in the same way as 13004 the interface vsyslog(), except that __vsyslog_chk() shall 13005 check for stack overflow before computing a result, depending 13006 on the value of the flag parameter. If an overflow is 13007 anticipated, the function shall abort and the program calling 13008 it shall exit. 13009 13010 In general, the higher the value of flag, the more security 13011 measures this interface shall take in the form of checking the 13012 stack, parameter values, and so on. 13013 13014 The __vsyslog_chk() function is not in the source standard; it 13015 is only in the binary standard. 13016 13017 __vwprintf_chk 13018 13019 Name 13020 13021 __vwprintf_chk -- convert formatted wide-character output, with 13022 stack checking 13023 13024 Synopsis 13025 13026 #include 13027 13028 int __vwprintf_chk(int flag, const wchar_t * format, va_list 13029 ap); 13030 13031 Description 13032 13033 The interface __vwprintf_chk() shall function in the same way 13034 as the interface vwprintf(), except that __vwprintf_chk() shall 13035 check for stack overflow before computing a result, depending 13036 on the value of the flag parameter. If an overflow is 13037 anticipated, the function shall abort and the program calling 13038 it shall exit. 13039 13040 In general, the higher the value of flag, the more security 13041 measures this interface shall take in the form of checking the 13042 stack, parameter values, and so on. 13043 13044 The __vwprintf_chk() function is not in the source standard; it 13045 is only in the binary standard. 13046 13047 __wcpcpy_chk 13048 13049 Name 13050 13051 __wcpcpy_chk -- copy a wide-character string, returning a 13052 pointer to its end, with buffer overflow checking 13053 13054 Synopsis 13055 13056 #include 13057 13058 wchar_t * __wcpcpy_chk(wchar_t * dest, const wchar_t * src, 13059 size_t destlen); 13060 13061 Description 13062 13063 The interface __wcpcpy_chk() shall function in the same way as 13064 the interface wcpcpy(), except that __wcpcpy_chk() shall check 13065 for buffer overflow before computing a result. If an overflow 13066 is anticipated, the function shall abort and the program 13067 calling it shall exit. 13068 13069 The parameter destlen specifies the size of the object pointed 13070 to by dest. 13071 13072 The __wcpcpy_chk() function is not in the source standard; it 13073 is only in the binary standard. 13074 13075 __wcpncpy_chk 13076 13077 Name 13078 13079 __wcpncpy_chk -- copy a fixed-size string of wide characters, 13080 returning a pointer to its end, with buffer overflow checking 13081 13082 Synopsis 13083 13084 #include 13085 13086 wchar_t * __wcpncpy_chk(wchar_t * dest, const wchar_t * src, 13087 size_t n, size_t destlen); 13088 13089 Description 13090 13091 The interface __wcpncpy_chk() shall function in the same way as 13092 the interface wcpncpy(), except that __wcpncpy_chk() shall 13093 check for buffer overflow before computing a result. If an 13094 overflow is anticipated, the function shall abort and the 13095 program calling it shall exit. 13096 13097 The parameter destlen specifies the size of the object pointed 13098 to by dest. If n exceeds destlen, the function shall abort and 13099 the program calling it shall exit. 13100 13101 The __wcpncpy_chk() function is not in the source standard; it 13102 is only in the binary standard. 13103 13104 __wcrtomb_chk 13105 13106 Name 13107 13108 __wcrtomb_chk -- convert a wide character to a multibyte 13109 sequence, with buffer overflow checking 13110 13111 Synopsis 13112 13113 #include 13114 13115 size_t __wcrtomb_chk(char * s, wchar_t wchar, mbstate_t * ps, 13116 size_t buflen); 13117 13118 Description 13119 13120 The interface __wcrtomb_chk() shall function in the same way as 13121 the interface wcrtomb(), except that __wcrtomb_chk() shall 13122 check for buffer overflow before computing a result. If an 13123 overflow is anticipated, the function shall abort and the 13124 program calling it shall exit. 13125 13126 The parameter buflen specifies the size of the object pointed 13127 to by s. If it is less than MB_CUR_MAX, then the function shall 13128 abort and the program calling it shall exit. 13129 13130 The __wcrtomb_chk() function is not in the source standard; it 13131 is only in the binary standard. 13132 13133 __wcscat_chk 13134 13135 Name 13136 13137 __wcscat_chk -- concatenate two wide-character strings, with 13138 buffer overflow checking 13139 13140 Synopsis 13141 13142 #include 13143 13144 wchar_t * __wcscat_chk(wchar_t * dest, const wchar_t * src, 13145 size_t destlen); 13146 13147 Description 13148 13149 The interface __wcscat_chk() shall function in the same way as 13150 the interface wcscat(), except that __wcscat_chk() shall check 13151 for buffer overflow before computing a result. If an overflow 13152 is anticipated, the function shall abort and the program 13153 calling it shall exit. 13154 13155 The parameter destlen specifies the size of the object pointed 13156 to by dest. 13157 13158 The __wcscat_chk() function is not in the source standard; it 13159 is only in the binary standard. 13160 13161 __wcscpy_chk 13162 13163 Name 13164 13165 __wcscpy_chk -- copy a wide-character string, with buffer 13166 overflow checking 13167 13168 Synopsis 13169 13170 #include 13171 13172 wchar_t * __wcscpy_chk(wchar_t * dest, const wchar_t * src, 13173 size_t n); 13174 13175 Description 13176 13177 The interface __wcscpy_chk() shall function in the same way as 13178 the interface wcscpy(), except that __wcscpy_chk() shall check 13179 for buffer overflow before computing a result. If an overflow 13180 is anticipated, the function shall abort and the program 13181 calling it shall exit. 13182 13183 The __wcscpy_chk() function is not in the source standard; it 13184 is only in the binary standard. 13185 13186 __wcsncat_chk 13187 13188 Name 13189 13190 __wcsncat_chk -- concatenate two wide-character strings, with 13191 buffer overflow checking 13192 13193 Synopsis 13194 13195 #include 13196 13197 wchar_t * __wcsncat_chk(wchar_t * dest, const wchar_t * src, 13198 size_t n, size_t destlen); 13199 13200 Description 13201 13202 The interface __wcsncat_chk() shall function in the same way as 13203 the interface wcsncat(), except that __wcsncat_chk() shall 13204 check for buffer overflow before computing a result. If an 13205 overflow is anticipated, the function shall abort and the 13206 program calling it shall exit. 13207 13208 The parameter destlen specifies the size of the object pointed 13209 to by dest. 13210 13211 The __wcsncat_chk() function is not in the source standard; it 13212 is only in the binary standard. 13213 13214 __wcsncpy_chk 13215 13216 Name 13217 13218 __wcsncpy_chk -- copy a fixed-size string of wide characters, 13219 with buffer overflow checking 13220 13221 Synopsis 13222 13223 #include 13224 13225 wchar_t * __wcsncpy_chk(wchar_t * dest, const wchar_t * src, 13226 size_t n, size_t destlen); 13227 13228 Description 13229 13230 The interface __wcsncpy_chk() shall function in the same way as 13231 the interface wcsncpy(), except that __wcsncpy_chk() shall 13232 check for buffer overflow before computing a result. If an 13233 overflow is anticipated, the function shall abort and the 13234 program calling it shall exit. 13235 13236 The parameter destlen specifies the size of the object pointed 13237 to by dest. If len exceeds destlen, the function shall abort 13238 and the program calling it shall exit. 13239 13240 The __wcsncpy_chk() function is not in the source standard; it 13241 is only in the binary standard. 13242 13243 __wcsnrtombs_chk 13244 13245 Name 13246 13247 __wcsnrtombs_chk -- convert a wide-character string to a 13248 multibyte string, with buffer overflow checking 13249 13250 Synopsis 13251 13252 #include 13253 13254 size_t __wcsnrtombs_chk(char * dest, const wchar_t * * src, 13255 size_t nwc, size_t len, mbstate_t * ps, size_t destlen); 13256 13257 Description 13258 13259 The interface __wcsnrtombs_chk() shall function in the same way 13260 as the interface wcsnrtombs(), except that __wcsnrtombs_chk() 13261 shall check for buffer overflow before computing a result. If 13262 an overflow is anticipated, the function shall abort and the 13263 program calling it shall exit. 13264 13265 The parameter destlen specifies the size of the object pointed 13266 to by dest. If len exceeds destlen, the function shall abort 13267 and the program calling it shall exit. 13268 13269 The __wcsnrtombs_chk() function is not in the source standard; 13270 it is only in the binary standard. 13271 13272 __wcsrtombs_chk 13273 13274 Name 13275 13276 __wcsrtombs_chk -- convert a wide-character string to a 13277 multibyte string, with buffer overflow checking 13278 13279 Synopsis 13280 13281 #include 13282 13283 size_t __wcsrtombs_chk(char * dest, const wchar_t * * src, 13284 size_t len, mbstate_t * ps, size_t destlen); 13285 13286 Description 13287 13288 The interface __wcsrtombs_chk() shall function in the same way 13289 as the interface wcsrtombs(), except that __wcsrtombs_chk() 13290 shall check for buffer overflow before computing a result. If 13291 an overflow is anticipated, the function shall abort and the 13292 program calling it shall exit. 13293 13294 The parameter destlen specifies the size of the object pointed 13295 to by dest. If len exceeds destlen, the function shall abort 13296 and the program calling it shall exit. 13297 13298 The __wcsrtombs_chk() function is not in the source standard; 13299 it is only in the binary standard. 13300 13301 __wcstod_internal 13302 13303 Name 13304 13305 __wcstod_internal -- underlying function for wcstod 13306 13307 Synopsis 13308 13309 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 13310 endptr, int group); 13311 13312 Description 13313 13314 group shall be 0 or the behavior of __wcstod_internal() is 13315 undefined. 13316 13317 __wcstod_internal(nptr, endptr, 0) shall behave as wcstod(nptr, 13318 endptr) as specified by POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13319 13320 __wcstod_internal() is not in the source standard; it is only 13321 in the binary standard. 13322 13323 __wcstof_internal 13324 13325 Name 13326 13327 __wcstof_internal -- underlying function for wcstof 13328 13329 Synopsis 13330 13331 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 13332 endptr, int group); 13333 13334 Description 13335 13336 group shall be 0 or the behavior of __wcstof_internal() is 13337 undefined. 13338 13339 __wcstof_internal(nptr, endptr, 0) shall behave as wcstof(nptr, 13340 endptr) as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13341 13342 __wcstof_internal() is not in the source standard; it is only 13343 in the binary standard. 13344 13345 __wcstol_internal 13346 13347 Name 13348 13349 __wcstol_internal -- underlying function for wcstol 13350 13351 Synopsis 13352 13353 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 13354 endptr, int base, int group); 13355 13356 Description 13357 13358 group shall be 0 or the behavior of __wcstol_internal() is 13359 undefined. 13360 13361 __wcstol_internal(nptr, endptr, base, 0) shall behave as 13362 wcstol(nptr, endptr, base) as specified by POSIX 1003.1-2001 13363 (ISO/IEC 9945-2003). 13364 13365 __wcstol_internal() is not in the source standard; it is only 13366 in the binary standard. 13367 13368 __wcstold_internal 13369 13370 Name 13371 13372 __wcstold_internal -- underlying function for wcstold 13373 13374 Synopsis 13375 13376 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 13377 * endptr, int group); 13378 13379 Description 13380 13381 group shall be 0 or the behavior of __wcstold_internal() is 13382 undefined. 13383 13384 __wcstold_internal(nptr, endptr, 0) shall behave as 13385 wcstold(nptr, endptr) as specified by POSIX 1003.1-2001 13386 (ISO/IEC 9945-2003). 13387 13388 __wcstold_internal() is not in the source standard; it is only 13389 in the binary standard. 13390 13391 __wcstombs_chk 13392 13393 Name 13394 13395 __wcstombs_chk -- convert a wide-character string to a 13396 multibyte string, with buffer overflow checking 13397 13398 Synopsis 13399 13400 #include 13401 13402 size_t __wcstombs_chk(char * dest, const wchar_t * src, size_t 13403 len, size_t destlen); 13404 13405 Description 13406 13407 The interface __wcstombs_chk() shall function in the same way 13408 as the interface wcstombs(), except that __wcstombs_chk() shall 13409 check for buffer overflow before computing a result. If an 13410 overflow is anticipated, the function shall abort and the 13411 program calling it shall exit. 13412 13413 The parameter destlen specifies the size of the object pointed 13414 to by dest. If len exceeds destlen, the function shall abort 13415 and the program calling it shall exit. 13416 13417 The __wcstombs_chk() function is not in the source standard; it 13418 is only in the binary standard. 13419 13420 __wcstoul_internal 13421 13422 Name 13423 13424 __wcstoul_internal -- underlying function for wcstoul 13425 13426 Synopsis 13427 13428 unsigned long __wcstoul_internal(const wchar_t * restrict nptr, 13429 wchar_t * * restrict endptr, int base, int group); 13430 13431 Description 13432 13433 group shall be 0 or the behavior of __wcstoul_internal() is 13434 undefined. 13435 13436 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 13437 wcstoul(nptr, endptr, base)() as specified by POSIX 1003.1-2001 13438 (ISO/IEC 9945-2003). 13439 13440 __wcstoul_internal() is not in the source standard; it is only 13441 in the binary standard. 13442 13443 __wctomb_chk 13444 13445 Name 13446 13447 __wctomb_chk -- convert a wide character to a multibyte 13448 sequence, with buffer overflow checking 13449 13450 Synopsis 13451 13452 #include 13453 13454 int __wctomb_chk(char * s, wchar_t wchar, size_t buflen); 13455 13456 Description 13457 13458 The interface __wctomb_chk() shall function in the same way as 13459 the interface wctomb(), except that __wctomb_chk() shall check 13460 for buffer overflow before computing a result. If an overflow 13461 is anticipated, the function shall abort and the program 13462 calling it shall exit. 13463 13464 The parameter buflen specifies the size of the object pointed 13465 to by s. If it is less than MB_CUR_MAX, then the function shall 13466 abort and the program calling it shall exit. 13467 13468 The __wctomb_chk() function is not in the source standard; it 13469 is only in the binary standard. 13470 13471 __wmemcpy_chk 13472 13473 Name 13474 13475 __wmemcpy_chk -- copy an array of wide-characters, with buffer 13476 overflow checking 13477 13478 Synopsis 13479 13480 #include 13481 13482 wchar_t * __wmemcpy_chk(wchar_t * s1, const wchar_t * s2, 13483 size_t n, size_t ns1); 13484 13485 Description 13486 13487 The interface __wmemcpy_chk() shall function in the same way as 13488 the interface wmemcpy(), except that __wmemcpy_chk() shall 13489 check for buffer overflow before computing a result. If an 13490 overflow is anticipated, the function shall abort and the 13491 program calling it shall exit. 13492 13493 The parameter ns1 specifies the size of the object pointed to 13494 by s1. If n exceeds ns1, the function shall abort and the 13495 program calling it shall exit. 13496 13497 The __wmemcpy_chk() function is not in the source standard; it 13498 is only in the binary standard. 13499 13500 __wmemmove_chk 13501 13502 Name 13503 13504 __wmemmove_chk -- copy an array of wide-characters, with buffer 13505 overflow checking 13506 13507 Synopsis 13508 13509 #include 13510 13511 wchar_t * __wmemmove_chk(wchar_t * s1, const wchar_t * s2, 13512 size_t n, size_t ns1); 13513 13514 Description 13515 13516 The interface __wmemmove_chk() shall function in the same way 13517 as the interface wmemmove(), except that __wmemmove_chk() shall 13518 check for buffer overflow before computing a result. If an 13519 overflow is anticipated, the function shall abort and the 13520 program calling it shall exit. 13521 13522 The parameter ns1 specifies the size of the object pointed to 13523 by s1. If n exceeds ns1, the function shall abort and the 13524 program calling it shall exit. 13525 13526 The __wmemmove_chk() function is not in the source standard; it 13527 is only in the binary standard. 13528 13529 __wmempcpy_chk 13530 13531 Name 13532 13533 __wmempcpy_chk -- copy memory area, with buffer overflow 13534 checking 13535 13536 Synopsis 13537 13538 #include 13539 13540 wchar_t * __wmempcpy_chk(wchar_t * s1, const wchar_t * s2, 13541 size_t n, size_t ns1); 13542 13543 Description 13544 13545 The interface __wmempcpy_chk() shall function in the same way 13546 as the interface wmempcpy(), except that __wmempcpy_chk() shall 13547 check for buffer overflow before computing a result. If an 13548 overflow is anticipated, the function shall abort and the 13549 program calling it shall exit. 13550 13551 The parameter ns1 specifies the size of the object pointed to 13552 by s1. If n exceeds ns1, the function shall abort and the 13553 program calling it shall exit. 13554 13555 The __wmempcpy_chk() function is not in the source standard; it 13556 is only in the binary standard. 13557 13558 __wmemset_chk 13559 13560 Name 13561 13562 __wmemset_chk -- fill an array of wide-characters with a 13563 constant wide character, with buffer overflow checking 13564 13565 Synopsis 13566 13567 #include 13568 13569 wchar_t * __wmemset_chk(wchar_t * s, wchar_t c, size_t n, 13570 size_t destlen); 13571 13572 Description 13573 13574 The interface __wmemset_chk() shall function in the same way as 13575 the interface wmemset(), except that __wmemset_chk() shall 13576 check for buffer overflow before computing a result. If an 13577 overflow is anticipated, the function shall abort and the 13578 program calling it shall exit. 13579 13580 The parameter destlen specifies the size of the object pointed 13581 to by s. If n exceeds destlen, the function shall abort and the 13582 program calling it shall exit. 13583 13584 The __wmemset_chk() function is not in the source standard; it 13585 is only in the binary standard. 13586 13587 __wprintf_chk 13588 13589 Name 13590 13591 __wprintf_chk -- convert formatted wide-character output, with 13592 stack checking 13593 13594 Synopsis 13595 13596 #include 13597 13598 int __wprintf_chk(int flag, const wchar_t * format); 13599 13600 Description 13601 13602 The interface __wprintf_chk() shall function in the same way as 13603 the interface wprintf(), except that __wprintf_chk() shall 13604 check for stack overflow before computing a result, depending 13605 on the value of the flag parameter. If an overflow is 13606 anticipated, the function shall abort and the program calling 13607 it shall exit. 13608 13609 In general, the higher the value of flag, the more security 13610 measures this interface shall take in the form of checking the 13611 stack, parameter values, and so on. 13612 13613 The __wprintf_chk() function is not in the source standard; it 13614 is only in the binary standard. 13615 13616 __xmknod 13617 13618 Name 13619 13620 __xmknod -- make a special file 13621 13622 Synopsis 13623 13624 #include 13625 13626 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 13627 dev); 13628 13629 Description 13630 13631 The __xmknod() function shall implement the mknod() interface. 13632 The behavior of __xmknod() for values of ver other than 13633 _MKNOD_VER is undefined. See Data Definitions in the 13634 architecture specific part of this specification for the 13635 correct value of _MKNOD_VER. 13636 13637 __xmknod(_MKNOD_VER, path, mode, dev) shall behave as 13638 mknod(path, mode, dev) as specified by POSIX 1003.1-2001 13639 (ISO/IEC 9945-2003). 13640 13641 The __xmknod() function is not in the source standard; it is 13642 only in the binary standard. 13643 13644 Note: The mknod() function is not in the binary standard; it 13645 is only in the source standard. 13646 13647 __xmknodat 13648 13649 Name 13650 13651 __xmknodat -- make a special file relative to a directory file 13652 descriptor 13653 13654 Synopsis 13655 13656 #include 13657 13658 int __xmknodat(int ver, int dirfd, const char * path, mode_t 13659 path, dev_t * dev); 13660 13661 Description 13662 13663 The __xmknodat() function shall implement the mknodat() 13664 function. The behavior of __xmknodat() for values of ver other 13665 than _MKNOD_VER is undefined. See Data Definitions in the 13666 architecture specific part of this specification for the 13667 correct value of _MKNOD_VER. 13668 13669 __xmknodat(_MKNOD_VER, dirfd, path, mode, dev) shall behave as 13670 mknodat(dirfd, path, mode, dev) as specified by POSIX 13671 1003.1-2008 (ISO/IEC 9945-2009). 13672 13673 The __xmknodat() function is not in the source standard; it is 13674 only in the binary standard. 13675 13676 Note: The mknodat() function is not in the binary standard; 13677 it is only in the source standard. 13678 13679 __xpg_basename 13680 13681 Name 13682 13683 __xpg_basename -- return the last component of a file name 13684 13685 Synopsis 13686 13687 #include 13688 13689 char * __xpg_basename(const char * path); 13690 13691 Description 13692 13693 The __xpg_basename() function shall return a pointer to the 13694 final component of the pathname named by path, as described in 13695 POSIX 1003.1-2001 (ISO/IEC 9945-2003) basename(). 13696 13697 This function is not in the source standard, it is only in the 13698 binary standard. 13699 13700 Return Value 13701 13702 See POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13703 13704 __xpg_sigpause 13705 13706 Name 13707 13708 __xpg_sigpause -- remove a signal from the signal mask and 13709 suspend the thread 13710 13711 Synopsis 13712 13713 #include 13714 13715 int __xpg_sigpause(int sig); 13716 13717 Description 13718 13719 The __xpg_sigpause() function shall implement the sigpause() 13720 described in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13721 13722 This function is not in the source standard, it is only in the 13723 binary standard. 13724 13725 Return Value 13726 13727 See POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13728 13729 __xpg_strerror_r 13730 13731 Name 13732 13733 __xpg_strerror_r -- return string describing error number 13734 13735 Synopsis 13736 13737 #include 13738 13739 int __xpg_strerror_r(int errnum, char * buf, size_t buflen); 13740 13741 Description 13742 13743 The __xpg_strerror_r() function shall map the error number in 13744 errnum to a locale-dependent error message string and shall 13745 return the string in the buffer pointed to by strerrbuf, with 13746 length buflen, as described in POSIX 1003.1-2001 (ISO/IEC 13747 9945-2003) strerror_r(). 13748 13749 This function is not in the source standard, it is only in the 13750 binary standard. 13751 13752 Return Value 13753 13754 See POSIX 1003.1-2001 (ISO/IEC 9945-2003). 13755 13756 __xstat 13757 13758 Name 13759 13760 __xstat -- get File Status 13761 13762 Synopsis 13763 13764 #include 13765 #include 13766 13767 int __xstat(int ver, const char * path, struct stat * 13768 stat_buf); 13769 13770 int __lxstat(int ver, const char * path, struct stat * 13771 stat_buf); 13772 13773 int __fxstat(int ver, int fildes, struct stat * stat_buf); 13774 13775 Description 13776 13777 The functions __xstat(), __lxstat(), and __fxstat() shall 13778 implement the functions stat(), lstat(), and fstat() 13779 respectively. 13780 13781 The behavior of these functions for values of ver other than 13782 _STAT_VER is undefined. See Data Definitions in the 13783 architecture specific part of this specification for the 13784 correct value of _STAT_VER. 13785 13786 __xstat(_STAT_VER, path, stat_buf) shall implement stat(path, 13787 stat_buf) as specified by POSIX 1003.1-2001 (ISO/IEC 13788 9945-2003). 13789 13790 __lxstat(_STAT_VER, path, stat_buf) shall implement lstat(path, 13791 stat_buf) as specified by POSIX 1003.1-2001 (ISO/IEC 13792 9945-2003). 13793 13794 __fxstat(_STAT_VER, fildes, stat_buf) shall implement 13795 fstat(fildes, stat_buf) as specified by POSIX 1003.1-2001 13796 (ISO/IEC 9945-2003). 13797 13798 __xstat(), __lxstat(), and __fxstat() are not in the source 13799 standard; they are only in the binary standard. 13800 13801 stat(), lstat(), and fstat() are not in the binary standard; 13802 they are only in the source standard. 13803 13804 __xstat64 13805 13806 Name 13807 13808 __xstat64 -- get File Status 13809 13810 Synopsis 13811 13812 #define _LARGEFILE_SOURCE 1 13813 #include 13814 #include 13815 13816 int __xstat64(int ver, const char * path, struct stat64 * 13817 stat_buf); 13818 13819 int __lxstat64(int ver, const char * path, struct stat64 * 13820 stat_buf); 13821 13822 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 13823 13824 Description 13825 13826 The functions __xstat64(), __lxstat64(), and __fxstat64() shall 13827 implement the functions stat64(), lstat64(), and fstat64() 13828 respectively. 13829 13830 The behavior of these functions for values of ver other than 13831 _STAT_VER is undefined. See Data Definitions in the 13832 architecture specific part of this specification for the 13833 correct value of _STAT_VER. 13834 13835 __xstat64(_STAT_VER, path, stat_buf) shall behave as 13836 stat64(path, stat_buf) as specified by Large File Support. 13837 13838 __lxstat64(_STAT_VER, path, stat_buf) shall behave as 13839 lstat64(path, stat_buf) as specified by Large File Support. 13840 13841 __fxstat64(_STAT_VER, fildes, stat_buf) shall behave as 13842 fstat64(fildes, stat_buf) as specified by Large File Support. 13843 13844 __xstat64(), __lxstat64(), and __fxstat64() are not in the 13845 source standard; they are only in the binary standard. 13846 13847 stat64(), lstat64(), and fstat64() are not in the binary 13848 standard; they are only in the source standard. 13849 13850 _environ 13851 13852 Name 13853 13854 _environ -- alias for environ - user environment 13855 13856 Synopsis 13857 13858 extern char * *_environ; 13859 13860 Description 13861 13862 _environ is an alias for environ - user environment. 13863 13864 _nl_msg_cat_cntr 13865 13866 Name 13867 13868 _nl_msg_cat_cntr -- new catalog load counter 13869 13870 Synopsis 13871 13872 #include 13873 13874 extern int _nl_msg_cat_cntr; 13875 13876 Description 13877 13878 The global variable _nl_msg_cat_cntr is incremented each time a 13879 new catalog is loaded. This variable is only in the binary 13880 standard; it is not in the source standard. 13881 13882 _sys_errlist 13883 13884 Name 13885 13886 _sys_errlist -- array containing the "C" locale strings used by 13887 strerror() 13888 13889 Synopsis 13890 13891 #include 13892 13893 extern const char *const _sys_errlist[]; 13894 13895 Description 13896 13897 _sys_errlist is an array containing the "C" locale strings used 13898 by strerror(). This normally should not be used directly. 13899 strerror() provides all of the needed functionality. 13900 13901 _sys_siglist 13902 13903 Name 13904 13905 _sys_siglist -- array containing the names of the signal names 13906 13907 Synopsis 13908 13909 #include 13910 13911 extern const char *const _sys_siglist[NSIG]; 13912 13913 Description 13914 13915 _sys_siglist is an array containing signal description strings 13916 ordered by signal number. 13917 13918 The _sys_siglist array is only in the binary standard; it is 13919 not in the source standard. Applications wishing to access 13920 signal descriptions should use the strsignal() function. 13921 13922 acct 13923 13924 Name 13925 13926 acct -- switch process accounting on or off 13927 13928 Synopsis 13929 13930 #include 13931 13932 int acct(const char * filename); 13933 13934 Description 13935 13936 When filename is the name of an existing file, acct() turns 13937 accounting on and appends a record to filename for each 13938 terminating process. When filename is NULL, acct() turns 13939 accounting off. 13940 13941 Return Value 13942 13943 On success, 0 is returned. On error, -1 is returned and the 13944 global variable errno is set appropriately. 13945 13946 Errors 13947 13948 ENOSYS 13949 13950 BSD process accounting has not been enabled when the operating 13951 system kernel was compiled. The kernel configuration parameter 13952 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 13953 ENOMEM 13954 13955 Out of memory. 13956 EPERM 13957 13958 The calling process has no permission to enable process 13959 accounting. 13960 EACCES 13961 13962 filename is not a regular file. 13963 EIO 13964 13965 Error writing to the filename. 13966 EUSERS 13967 13968 There are no more free file structures or we run out of memory. 13969 13970 adjtime 13971 13972 Name 13973 13974 adjtime -- correct the time to allow synchronization of the 13975 system clock 13976 13977 Synopsis 13978 13979 #include 13980 13981 int adjtime(const struct timeval * delta, struct timeval * 13982 olddelta); 13983 13984 Description 13985 13986 adjtime() makes small adjustments to the system time as 13987 returned by gettimeofday()(2), advancing or retarding it by the 13988 time specified by the timeval delta. If delta is negative, the 13989 clock is slowed down by incrementing it more slowly than normal 13990 until the correction is complete. If delta is positive, a 13991 larger increment than normal is used. The skew used to perform 13992 the correction is generally a fraction of one percent. Thus, 13993 the time is always a monotonically increasing function. A time 13994 correction from an earlier call to adjtime() may not be 13995 finished when adjtime() is called again. If olddelta is 13996 non-NULL, the structure pointed to will contain, upon return, 13997 the number of microseconds still to be corrected from the 13998 earlier call. 13999 14000 adjtime() may be used by time servers that synchronize the 14001 clocks of computers in a local area network. Such time servers 14002 would slow down the clocks of some machines and speed up the 14003 clocks of others to bring them to the average network time. 14004 14005 Appropriate privilege is required to adjust the system time. 14006 14007 Return Value 14008 14009 On success, 0 is returned. On error, -1 is returned and the 14010 global variable errno is set appropriately. 14011 14012 Errors 14013 14014 EFAULT 14015 14016 An argument points outside the process's allocated address 14017 space. 14018 EPERM 14019 14020 The process does not have appropriate privilege. 14021 14022 alphasort64 14023 14024 Name 14025 14026 alphasort64 -- Comparison function for directory scanning 14027 (Large File Support) 14028 14029 Synopsis 14030 14031 #include 14032 14033 int alphasort64(const struct dirent64 ** d1, const struct 14034 dirent64 ** d2); 14035 14036 Description 14037 14038 alpahsort64() is a large-file version of the alphasort() 14039 function as defined in POSIX 1003.1-2008 (ISO/IEC 9945-2009). 14040 If differs only in that the d1 and d2 parameters are of type 14041 dirent64 instead of type dirent. 14042 14043 asprintf 14044 14045 Name 14046 14047 asprintf -- write formatted output to a dynamically allocated 14048 string 14049 14050 Synopsis 14051 14052 #include 14053 14054 int asprintf(char ** restrict ptr, const char * restrict 14055 format, ...); 14056 14057 Description 14058 14059 The asprintf() function shall behave as sprintf(), except that 14060 the output string shall be dynamically allocated space of 14061 sufficient length to hold the resulting string. The address of 14062 this dynamically allocated string shall be stored in the 14063 location referenced by ptr. 14064 14065 Return Value 14066 14067 Refer to fprintf(). 14068 14069 Errors 14070 14071 Refer to fprintf(). 14072 14073 backtrace, backtrace_symbols, backtrace_symbols_fd 14074 14075 Name 14076 14077 backtrace, backtrace_symbols, backtrace_symbols_fd -- runtime 14078 stack back tracing 14079 14080 Synopsis 14081 14082 #include 14083 14084 int backtrace(void **array, int size); 14085 14086 char **backtrace_symbols(void *const *array, int size); 14087 14088 void backtrace_symbols_fd(void *const *array, int size, int 14089 fd); 14090 14091 Description 14092 14093 backtrace() obtains a backtrace for the current thread as a 14094 list of pointers filled in to array. The size parameter 14095 describes the number of elements that will fit into array, 14096 backtrace() will truncate the list if necessary. A backtrace is 14097 a list of currently active function calls in a thread; each 14098 function call allocates a new stack frame and backtrace() 14099 obtains the return address from each stack frame. 14100 14101 backtrace_symbols() translates the information obtained from 14102 backtrace() into an array of strings. array is a pointer to an 14103 array of addresses as obtained from backtrace(). size is the 14104 number of entries in array, and should be the return value of 14105 the call to backtrace(). The strings contain the function name 14106 if it can be determined, a hedxadecimal offset into the 14107 function, and the actual return address in hexadecimal. Note 14108 that the pointer returned by backtrace_symbols() is obtained by 14109 an internal call to malloc() and should be freed when no longer 14110 needed. 14111 14112 backtrace_symbols_fd() performs the same transformation as 14113 backtrace_symbols() given the same argument pair array, size, 14114 but writes the strings to the file descriptor contained in fd. 14115 This avoids the allocation of string space. 14116 14117 Return Value 14118 14119 backtrace() returns the number of entries placed into array, no 14120 more than size. If the value is less than size, the full 14121 backtrace was returned; else it may have been truncated. 14122 14123 On success, backtrace_symbols() returns a pointer to an array 14124 of strings, which will have size entries. On error, NULL is 14125 returned. 14126 14127 Errors 14128 14129 No errors are defined for these functions. If 14130 backtrace_symbols_fd() fails, it will be due to a failure in 14131 the call to malloc(), and errno will be set accordingly. 14132 14133 Notes 14134 14135 The ability to obtain useful backtrace information, in 14136 particular function names, is dependent on a number of factors 14137 at the time of program construction, such as compiler 14138 optimization options. Even if the program itself is constructed 14139 so as to make symbols visible, the call trace may descend into 14140 system libraries which have not been so constructed. 14141 14142 Inlined functions do not have stack frames, and functions 14143 declared as static are not exposed and so will not be available 14144 in the backtrace. 14145 14146 See Also 14147 14148 malloc() 14149 14150 basename 14151 14152 Name 14153 14154 basename -- return the last component of a file name 14155 14156 Synopsis 14157 14158 #include 14159 14160 char * basename(const char * path); 14161 14162 Description 14163 14164 In the source standard, basename() is implemented as a macro 14165 causing it to behave as described in POSIX 1003.1-2001 (ISO/IEC 14166 9945-2003), and is equivalent to the function __xpg_basename(). 14167 If the macro is undefined, basename() from the binary standard 14168 is used, with differences as described here: 14169 14170 The string identified by path shall not be modified. 14171 14172 If path is "/", or ends with a trailing '/' character, the 14173 basename() function shall return a pointer to an empty string. 14174 14175 Return Value 14176 14177 On success, the basename() function shall return a pointer to 14178 the final component of path. Otherwise, it shall return a null 14179 pointer. 14180 14181 See Also 14182 14183 __xpg_basename() 14184 14185 bind_textdomain_codeset 14186 14187 Name 14188 14189 bind_textdomain_codeset -- specify encoding for message 14190 retrieval 14191 14192 Synopsis 14193 14194 #include 14195 14196 char * bind_textdomain_codeset (const char * domainname , const 14197 char * codeset ); 14198 14199 Description 14200 14201 The bind_textdomain_codeset() function can be used to specify 14202 the output codeset for message catalogs for domain domainname. 14203 The codeset argument shall be a valid codeset name which can be 14204 used tor the iconv_open function, or a null pointer. If the 14205 codeset argument is the null pointer, then function returns the 14206 currently selected codeset for the domain with the name 14207 domainname. It shall return a null pointer if no codeset has 14208 yet been selected. 14209 14210 Each successive call to bind_textdomain_codeset() function 14211 overrrides the settings made by the preceding call with the 14212 same domainname. 14213 14214 The bind_textdomain_codeset() function shall return a pointer 14215 to a string containing the name of the selected codeset. The 14216 string shall be allocated internally in the function and shall 14217 not be changed or freed by the user. 14218 14219 Parameters 14220 14221 domainname 14222 14223 The domainname argument is applied to the currently active 14224 LC_MESSAGE locale. It is equivalent in syntax and meaning to 14225 the domainname argument to textdomain, except that the 14226 selection of the domain is valid only for the duration of the 14227 call. 14228 codeset 14229 14230 The name of the output codeset for the selected domain, or NULL 14231 to select the current codeset. 14232 14233 If domainname is the null pointer, or is an empty string, 14234 bind_textdomain_codeset() shall fail, but need not set errno. 14235 14236 Return Value 14237 14238 Returns the currently selected codeset name. It returns a null 14239 pointer if no codeset has yet been selected. 14240 14241 Errors 14242 14243 ENOMEM 14244 14245 Insufficient memory available to allocate return value. 14246 14247 See Also 14248 14249 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 14250 textdomain, bindtextdomain 14251 14252 bindresvport 14253 14254 Name 14255 14256 bindresvport -- bind socket to privileged IP port 14257 14258 Synopsis 14259 14260 #include 14261 #include 14262 14263 int bindresvport(int sd, struct sockaddr_in * sin); 14264 14265 Description 14266 14267 If the process has appropriate privilege, the bindresvport() 14268 function shall bind a socket to an anonymous privileged IP 14269 port, that is, arbitrarily selected from the range 512 through 14270 1023. 14271 14272 If the bind is successful and sin is not NULL, and the port 14273 number bound to is returned in the sin_port member of sin. Any 14274 caller-supplied value of sin_port is ignored. 14275 14276 If sin is NULL, the address family is taken to be AF_INET and 14277 an available privileged port is bound to. Since there is no 14278 sockaddr_in structure, the port number chosen cannot be 14279 returned. The getsockname() may be used to query for this 14280 information. 14281 14282 Return Value 14283 14284 On success, 0 is returned. On error, -1 is returned and errno 14285 is set to indicate the error. 14286 14287 Errors 14288 14289 bindresvport() may fail in the same way as bind() in POSIX 14290 1003.1-2001 (ISO/IEC 9945-2003). The following additional or 14291 differing failures may occur: 14292 14293 EADDRINUSE 14294 14295 All privileged ports are in use. 14296 EAFNOSUPPORT 14297 14298 The specified address is not a valid address for the address 14299 family of the specified socket, or the address family is not 14300 supported. 14301 EPFNOSUPPORT 14302 14303 The same meaning as EAFNOSUPPORT. Some older implementations 14304 may return this error instead. 14305 14306 Note: At this time, only AF_INET is supported. Applications 14307 should be prepared for either the EAFNOSUPPORT or 14308 EPFNOSUPPORT error to be indicated. 14309 14310 bindtextdomain 14311 14312 Name 14313 14314 bindtextdomain -- specify the location of a message catalog 14315 14316 Synopsis 14317 14318 #include 14319 14320 char * bindtextdomain(const char * domainname, const char * 14321 dirname); 14322 14323 Description 14324 14325 The bindtextdomain() shall set the the base directory of the 14326 hierarchy containing message catalogs for a given message 14327 domain. 14328 14329 The bindtextdomain() function specifies that the domainname 14330 message catalog can be found in the dirname directory 14331 hierarchy, rather than in the system default locale data base. 14332 14333 If dirname is not NULL, the base directory for message catalogs 14334 belonging to domain domainname shall be set to dirname. If 14335 dirname is NULL, the base directory for message catalogs shall 14336 not be altered. 14337 14338 The function shall make copies of the argument strings as 14339 needed. 14340 14341 dirname can be an absolute or relative pathname. 14342 14343 Note: Applications that wish to use chdir() should always 14344 use absolute pathnames to avoid misadvertently selecting the 14345 wrong or non-existant directory. 14346 14347 If domainname is the null pointer, or is an empty string, 14348 bindtextdomain() shall fail, but need not set errno. 14349 14350 The bindtextdomain() function shall return a pointer to a 14351 string containing the name of the selected directory. The 14352 string shall be allocated internally in the function and shall 14353 not be changed or freed by the user. 14354 14355 Return Value 14356 14357 On success, bindtextdomain() shall return a pointer to a string 14358 containing the directory pathname currently bound to the 14359 domain. On failure, a NULL pointer is returned, and the global 14360 variable errno may be set to indicate the error. 14361 14362 Errors 14363 14364 ENOMEM 14365 14366 Insufficient memory was available. 14367 14368 See Also 14369 14370 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 14371 textdomain, bind_textdomain_codeset 14372 14373 cfmakeraw 14374 14375 Name 14376 14377 cfmakeraw -- get and set terminal attributes 14378 14379 Synopsis 14380 14381 #include 14382 14383 void cfmakeraw(struct termios * termios_p); 14384 14385 Description 14386 14387 The cfmakeraw() function shall set the attributes of the 14388 termios structure referenced by termios_p as follows: 14389 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 14390 |INLCR|IGNCR|ICRNL|IXON); 14391 14392 termios_p->c_oflag &= ~OPOST; 14393 14394 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 14395 14396 termios_p->c_cflag &= ~(CSIZE|PARENB); 14397 14398 termios_p->c_cflag |= CS8; 14399 14400 termios_p shall point to a termios structure that contains the 14401 following members: 14402 tcflag_t c_iflag; /* input modes */ 14403 tcflag_t c_oflag; /* output modes */ 14404 tcflag_t c_cflag; /* control modes */ 14405 tcflag_t c_lflag; /* local modes */ 14406 cc_t c_cc[NCCS]; /* control chars */ 14407 14408 cfsetspeed 14409 14410 Name 14411 14412 cfsetspeed -- set terminal input and output data rate 14413 14414 Synopsis 14415 14416 #include 14417 14418 int cfsetspeed(struct termios *t, speed_t speed); 14419 14420 Description 14421 14422 The cfsetspeed() function shall set the input and output speeds 14423 in t to the value specified by speed. The effects of the 14424 function on the terminal as described below do not become 14425 effective, nor are all errors detected, until the tcsetattr() 14426 function is called. Certain values for baud rates set in 14427 termios and passed to tcsetattr() have special meanings. 14428 14429 Return Value 14430 14431 On success, 0 is returned. On error, -1 is returned and the 14432 global variable errno is set appropriately. 14433 14434 Errors 14435 14436 EINVAL 14437 14438 Invalid speed argument 14439 14440 clearerr_unlocked 14441 14442 Name 14443 14444 clearerr_unlocked -- non-thread-safe clearerr 14445 14446 Description 14447 14448 clearerr_unlocked() is the same as clearerr(), except that it 14449 need not be thread-safe. That is, it may only be invoked in the 14450 ways which are legal for getc_unlocked(). 14451 14452 daemon 14453 14454 Name 14455 14456 daemon -- run in the background 14457 14458 Synopsis 14459 14460 #include 14461 14462 int daemon(int nochdir, int noclose); 14463 14464 Description 14465 14466 The daemon() function shall create a new process, detached from 14467 the controlling terminal. If successful, the calling process 14468 shall exit and the new process shall continue to execute the 14469 application in the background. If nochdir evaluates to true, 14470 the current directory shall not be changed. Otherwise, daemon() 14471 shall change the current working directory to the root (`/'). 14472 If noclose evaluates to true the standard input, standard 14473 output, and standard error file descriptors shall not be 14474 altered. Otherwise, daemon() shall close the standard input, 14475 standard output and standard error file descriptors and reopen 14476 them attached to /dev/null. 14477 14478 Return Value 14479 14480 On error, -1 is returned, and the global variable errno is set 14481 to any of the errors specified for the library functions fork() 14482 and setsid(). 14483 14484 dcgettext 14485 14486 Name 14487 14488 dcgettext -- perform domain and category specific lookup in 14489 message catalog 14490 14491 Synopsis 14492 14493 #include 14494 #include 14495 14496 char * dcgettext(const char * domainname, const char * msgid, 14497 int category); 14498 14499 Description 14500 14501 The dcgettext() function is a domain specified version of 14502 gettext(). 14503 14504 The dcgettext() function shall lookup the translation in the 14505 current locale of the message identified by msgid in the domain 14506 specified by domainname and in the locale category specified by 14507 category. If domainname is NULL, the current default domain 14508 shall be used. The msgid argument shall be a NULL-terminated 14509 string to be matched in the catalogue. category shall specify 14510 the locale category to be used for retrieving message strings. 14511 The category parameter shall be one of LC_CTYPE, LC_COLLATE, 14512 LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The default 14513 domain shall not be changed by a call to dcgettext(). 14514 14515 Return Value 14516 14517 If a translation was found in one of the specified catalogs, it 14518 shall be converted to the current locale's codeset and 14519 returned. The resulting NULL-terminated string shall be 14520 allocated by the dcgettext function, and must not be modified 14521 or freed. If no translation was found, or category was invalid, 14522 msgid shall be returned. 14523 14524 Errors 14525 14526 dcgettext() shall not modify the errno global variable. 14527 14528 See Also 14529 14530 gettext, dgettext, ngettext, dngettext, dcngettext, textdomain, 14531 bindtextdomain, bind_textdomain_codeset 14532 14533 dcngettext 14534 14535 Name 14536 14537 dcngettext -- perform domain and category specific lookup in 14538 message catalog with plural 14539 14540 Synopsis 14541 14542 #include 14543 #include 14544 14545 char * dcngettext(const char * domainname, const char * msgid1, 14546 const char * msgid2, unsigned long int n, int category); 14547 14548 Description 14549 14550 The dcngettext() function is a domain specific version of 14551 gettext, capable of returning either a singular or plural form 14552 of the message. The dcngettext() function shall lookup the 14553 translation in the current locale of the message identified by 14554 msgid1 in the domain specified by domainname and in the locale 14555 category specified by category. If domainname is NULL, the 14556 current default domain shall be used. The msgid1 argument shall 14557 be a NULL-terminated string to be matched in the catalogue. 14558 category shall specify the locale category to be used for 14559 retrieving message strings. The category parameter shall be one 14560 of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, 14561 or LC_TIME. The default domain shall not be changed by a call 14562 to dcngettext(). If n is 1 then the singular version of the 14563 message is returned, otherwise one of the plural forms is 14564 returned, depending on the value of n and the current locale 14565 settings. 14566 14567 Return Value 14568 14569 If a translation corresponding to the value of n was found in 14570 one of the specified catalogs for msgid1, it shall be converted 14571 to the current locale's codeset and returned. The resulting 14572 NULL-terminated string shall be allocated by the dcngettext() 14573 function, and must not be modified or freed. If no translation 14574 was found, or category was invalid, msgid1 shall be returned if 14575 n has the value 1, otherwise msgid2 shall be returned. 14576 14577 Errors 14578 14579 dcngettext() shall not modify the errno global variable. 14580 14581 See Also 14582 14583 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 14584 bindtextdomain, bind_textdomain_codeset 14585 14586 dgettext 14587 14588 Name 14589 14590 dgettext -- perform lookup in message catalog for the current 14591 LC_MESSAGES locale 14592 14593 Synopsis 14594 14595 #include 14596 14597 char * dgettext(const char * domainname, const char * msgid); 14598 14599 Description 14600 14601 dgettext() is a domain specified version of gettext(). 14602 14603 The dgettext() function shall search the currently selected 14604 message catalogs in the domain domainname for a string 14605 identified by the string msgid. If a string is located, that 14606 string shall be returned. The domain specified by domainname 14607 applies to the currently active LC_MESSAGE locale. The default 14608 domain shall not be changed by a call to dgettext(). 14609 14610 Note: The usage of domainanme is equivalent in syntax and 14611 meaning to the textdomain() function's application of 14612 domainname, except that the selection of the domain in 14613 dgettext() is valid only for the duration of the call. 14614 14615 The dgettext() function is equivalent to dcgettext(domainname, 14616 msgid, LC_MESSAGES). 14617 14618 Return Value 14619 14620 On success of a msgid query, the translated NULL-terminated 14621 string is returned. On error, the original msgid is returned. 14622 The length of the string returned is undetermined until 14623 dgettext() is called. 14624 14625 Errors 14626 14627 dgettext() shall not modify the errno global variable. 14628 14629 See Also 14630 14631 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 14632 textdomain, bindtextdomain, bind_textdomain_codeset 14633 14634 dl_iterate_phdr 14635 14636 Name 14637 14638 dl_iterate_phdr -- iterate over a program's loaded shared 14639 objects 14640 14641 Synopsis 14642 14643 #include 14644 14645 int dl_iterate_phdr(int(*callback) (struct dl_phdr_info *, 14646 size_t, void *), void *data); 14647 14648 Description 14649 14650 dl_iterate_phdr() allows a program to iterate over the shared 14651 objects it has loaded. The function described by the callback 14652 parameter is called once for each loaded shared object, 14653 allowing an action to be taken for each one. callback is called 14654 with three arguments which are filled in by the implementation: 14655 a pointer to a structure of type dl_phdr_info containing 14656 information about the shared object; an integer size of the 14657 structure; and a copy of the data argument to 14658 dl_iterate_phdr(). If callback returns a non-zero value, 14659 dl_iterate_phdr() will stop processing, even if there are 14660 unprocessed shared objects. The order of processing is 14661 unspecified. 14662 14663 The dl_phdr_info structure has the following members (note that 14664 on 64-bit architectures the types here shown as Elf32_type will 14665 instead be Elf64_type): 14666 14667 Elf32_Addr dlpi_addr; 14668 const char *dlpi_name; 14669 const Elf32_Phdr *dlpi_phdr; 14670 Elf32_Half dlpi_phnum; 14671 unsigned long long int dlpi_adds; 14672 unsigned long long int dlpi_subs; 14673 size_t dlpi_tls_modid; 14674 void *dlpi_tls_data; 14675 14676 dlpi_addr contains the base address of the shared object. 14677 14678 dlpi_name is a null-terminated string giving the pathname from 14679 which the shared object was loaded. 14680 14681 dlpi_phdr is a pointer to an array of program headers for this 14682 shared object, while dlpi_phnum is the number of entries in 14683 this array. 14684 14685 dlpi_adds and dlpi_subs are incremented when shared objects are 14686 added or removed, respectively. 14687 14688 dlpi_tls_modid contains the module ID used in TLS relocations, 14689 if there is a PT_TLS segment. Otherwise the value shall be 14690 zero. 14691 14692 dlpi_tls_data contains the address of the calling thread's 14693 instance of this module's PT_TLS segment, if there is one and 14694 it has been allocated in the calling thread. Otherwise the 14695 value shall be a null pointer. 14696 14697 Some implementations may not provide all fields in 14698 dl_phdr_info, although the first four are always mandatory. 14699 Applications are advised to have the callback function check 14700 the size parameter before examining the later members. 14701 14702 Return Value 14703 14704 The dl_iterate_phdr() function returns whatever value was 14705 returned by the last call to callback. This will be zero if 14706 processing completed normally, since processing does not 14707 continue unless the callback function returns zero. 14708 14709 Errors 14710 14711 No errors are defined by dl_iterate_phdr(); as noted the 14712 callback function must use a zero return to indicate success 14713 but may assign any meaning it wishes to non-zero returns. 14714 14715 dngettext 14716 14717 Name 14718 14719 dngettext -- perform lookup in message catalog for the current 14720 locale 14721 14722 Synopsis 14723 14724 #include 14725 14726 char * dngettext(const char * domainname, const char * msgid1, 14727 const char * msgid2, unsigned long int n); 14728 14729 Description 14730 14731 dngettext() shall be equivalent to a call to 14732 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 14733 14734 See dcngettext() for more information. 14735 14736 See Also 14737 14738 gettext, dgettext, ngettext, dcgettext, dcngettext, textdomain, 14739 bindtextdomain, bind_textdomain_codeset 14740 14741 drand48_r 14742 14743 Name 14744 14745 drand48_r -- reentrantly generate pseudorandom numbers in a 14746 uniform distribution 14747 14748 Synopsis 14749 14750 #include 14751 14752 int drand48_r(struct drand48_data * buffer, double * result); 14753 14754 Description 14755 14756 The interface drand48_r() shall function in the same way as the 14757 interface drand48(), except that drand48_r() shall use the data 14758 in buffer instead of the global random number generator state. 14759 14760 Before it is used, buffer must be initialized, for example, by 14761 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 14762 it with zeroes. 14763 14764 duplocale 14765 14766 Name 14767 14768 duplocale -- provide new handle for selection of locale 14769 14770 Synopsis 14771 14772 #include 14773 14774 locale_t duplocale(locale_t locale); 14775 14776 Description 14777 14778 The duplocale() function shall provide a new locale object 14779 based on the locale object provided in locale, suitable for use 14780 in the newlocale() or uselocale() functions. The new object may 14781 be released by calling freelocale(). 14782 14783 Return Value 14784 14785 On success, the duplocale() function shall return a locale 14786 object. Otherwise, it shall return NULL, and set errno to 14787 indicate the error. 14788 14789 Errors 14790 14791 The duplocale() function shall fail if: 14792 14793 ENOMEM 14794 14795 Insufficient memory. 14796 14797 See Also 14798 14799 setlocale(), freelocale(), newlocale(), uselocale() 14800 14801 endutent 14802 14803 Name 14804 14805 endutent -- access utmp file entries 14806 14807 Synopsis 14808 14809 #include 14810 14811 void endutent(void); 14812 14813 Description 14814 14815 endutent() closes the utmp file. It should be called when the 14816 user code is done accessing the file with the other functions. 14817 14818 epoll_create 14819 14820 Name 14821 14822 epoll_create -- open an epoll file descriptor 14823 14824 Synopsis 14825 14826 #include 14827 14828 int epoll_create(int size); 14829 14830 Description 14831 14832 The epoll API, which consists of the interfaces epoll_create(), 14833 epoll_ctl(), and epoll_wait(), shall support all file 14834 descriptors compatible with poll(). These interfaces shall be 14835 usable in either level-triggered or edge-triggered mode. In 14836 level-triggered mode, epoll has similar semantics to poll(), 14837 and can be used as a faster replacement for it. In 14838 edge-triggered mode, epoll shall only report events for a file 14839 descriptor when changes occur on it. 14840 14841 The epoll_create() interface shall open an epoll file 14842 descriptor by allocating an event backing store of 14843 approximately size size. The size parameter is a hint to the 14844 kernel about how large the event storage should be, not a 14845 rigidly-defined maximum size. 14846 14847 Return Value 14848 14849 On success, epoll_create() shall return the file descriptor, a 14850 non-negative integer that shall be used for subsequent epoll 14851 calls. It should be closed with the close() function. 14852 14853 On failure, epoll_create() shall return -1 and set errno as 14854 follows. 14855 14856 Errors 14857 14858 EINVAL 14859 14860 The size parameter is not positive. 14861 ENFILE 14862 14863 The maximum number of open files has been reached by the 14864 system. 14865 ENOMEM 14866 14867 Not enough memory to create the kernel object. 14868 14869 See Also 14870 14871 close(), epoll_ctl(), epoll_wait(), poll(). 14872 14873 epoll_ctl 14874 14875 Name 14876 14877 epoll_ctl -- control an epoll file descriptor 14878 14879 Synopsis 14880 14881 #include 14882 14883 int epoll_ctl(int epfd, int op, int fd, struct epoll_event * 14884 event); 14885 14886 Description 14887 14888 The interface epoll_ctl() shall control an epoll file 14889 descriptor. 14890 14891 The parameter epfd shall specify the epoll file descriptor to 14892 control. 14893 14894 The parameter op shall specify the operation to perform on the 14895 specified target file descriptor. 14896 14897 The parameter fd shall specify the target file descriptor on 14898 which to perform the specified operation. 14899 14900 The parameter event shall specify the object associated with 14901 the target file descriptor. The events member of the event 14902 parameter is a bit set composed of the event types listed 14903 below. 14904 14905 Event types 14906 14907 EPOLLERR 14908 14909 An error condition occurred on the target file descriptor. It 14910 shall not be necessary to set this event in events; this 14911 interface shall always wait for it. 14912 EPOLLET 14913 14914 This event shall set edge-triggered behavior for the target 14915 file descriptor. The default epoll behavior shall be 14916 level-triggered. 14917 EPOLLHUP 14918 14919 A hang up occurred on the target file descriptor. It shall not 14920 be necessary to set this event in events; this interface shall 14921 always wait for it. 14922 EPOLLIN 14923 14924 The file is accessible to read() operations. 14925 EPOLLONESHOT 14926 14927 This event shall set one-shot behavior for the target file 14928 descriptor. After epoll_wait() retrieves an event, the file 14929 descriptor shall be disabled and epoll shall not report any 14930 other events. To reenable the file descriptor with a new event 14931 mask, the user should invoke epoll_ctl() with EPOLL_CTL_MOD in 14932 the op parameter. 14933 EPOLLOUT 14934 14935 The file is accessible to write() operations. 14936 EPOLLPRI 14937 14938 Urgent data exists for read() operations. 14939 EPOLLRDHUP 14940 14941 A stream socket peer closed the connection, or else the peer 14942 shut down the writing half of the connection. 14943 14944 Values of the op parameter 14945 14946 EPOLL_CTL_ADD 14947 14948 Associate event with the file described by fd, and add fd to 14949 the epoll descriptor epfd. 14950 EPOLL_CTL_DEL 14951 14952 Remove fd from epfd, and ignore event, which can be NULL. 14953 EPOLL_CTL_MOD 14954 14955 Change the event event associated with fd. 14956 14957 Return Value 14958 14959 On success, epoll_ctl() shall return 0. 14960 14961 On failure, epoll_ctl() shall return -1 and set errno as 14962 follows. 14963 14964 Errors 14965 14966 EBADF 14967 14968 The parameter epfd or the parameter fd is an invalid file 14969 descriptor. 14970 EEXIST 14971 14972 The parameter op was EPOLL_CTL_ADD, but the file descriptor fd 14973 is already in epfd. 14974 EINVAL 14975 14976 The parameter epfd is invalid, or it is the same as fd, or the 14977 operation specified by the parameter op is unsupported. 14978 ENOENT 14979 14980 The parameter op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, but the 14981 file descriptor fd is not in epfd. 14982 ENOMEM 14983 14984 Not enough memory for the operation specified by the parameter 14985 op. 14986 EPERM 14987 14988 The file specified by fd does not support epoll. 14989 14990 See Also 14991 14992 close(), epoll_create(), epoll_wait(), poll(). 14993 14994 epoll_wait 14995 14996 Name 14997 14998 epoll_wait -- wait for I/O events on an epoll file descriptor 14999 15000 Synopsis 15001 15002 #include 15003 15004 int epoll_wait(int epfd, struct epoll_event * events, int 15005 maxevents, int timeout); 15006 15007 Description 15008 15009 The interface epoll_wait() shall wait for events on the epoll 15010 file descriptor specified by the parameter epfd. 15011 15012 Upon success, the output parameter events shall refer to an 15013 area of memory containing epoll_event structures available to 15014 the caller. The data members of these structures shall contain 15015 the data set by the user with the interface epoll_ctl(). The 15016 events members shall contain the event bit field that was 15017 returned. 15018 15019 The parameter maxevents shall specify the maximum number of 15020 events that epoll_wait() may return in the output parameter 15021 events. The value of this parameter should be greater than 0. 15022 15023 The parameter timeout shall specify the maximum number of 15024 milliseconds that epoll_wait() shall wait for events. If the 15025 value of this parameter is 0, then epoll_wait() shall return 15026 immediately, even if no events are available, in which case the 15027 return code shall be 0. If the value of timeout is -1, then 15028 epoll_wait() shall block until either a requested event occurs 15029 or the call is interrupted. 15030 15031 Return Value 15032 15033 On success, epoll_wait() shall return the number of file 15034 descriptors that are ready for the I/O that was requested, or 15035 else 0 if no descriptors became ready during timeout. 15036 15037 On failure, epoll_wait() shall return -1 and set errno as 15038 follows. 15039 15040 Errors 15041 15042 EBADF 15043 15044 The parameter epfd is not a valid file descriptor. 15045 EFAULT 15046 15047 The area of memory referenced by the parameter events cannot be 15048 accessed with write permissions. 15049 EINTR 15050 15051 The call was interrupted by a signal handler before the timeout 15052 expired or any requested event took place. 15053 EINVAL 15054 15055 The parameter epfd is not a valid epoll file descriptor, or 15056 else the parameter maxevents is less than or equal to 0. 15057 15058 See Also 15059 15060 close(), epoll_ctl(), epoll_create(), poll(). 15061 15062 erand48_r 15063 15064 Name 15065 15066 erand48_r -- reentrantly generate pseudorandom numbers in a 15067 uniform distribution 15068 15069 Synopsis 15070 15071 #include 15072 15073 int erand48_r(unsigned short[3] xsubi, struct drand48_data * 15074 buffer, double * result); 15075 15076 Description 15077 15078 The interface erand48_r() shall function in the same way as the 15079 interface erand48(), except that erand48_r() shall use the data 15080 in buffer instead of the global random number generator state. 15081 15082 Before it is used, buffer must be initialized, for example, by 15083 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 15084 it with zeroes. 15085 15086 err 15087 15088 Name 15089 15090 err -- display formatted error messages 15091 15092 Synopsis 15093 15094 #include 15095 15096 void err(int eval, const char * fmt, ...); 15097 15098 Description 15099 15100 The err() function shall display a formatted error message on 15101 the standard error stream. First, err() shall write the last 15102 component of the program name, a colon character, and a space 15103 character. If fmt is non-NULL, it shall be used as a format 15104 string for the printf() family of functions, and err() shall 15105 write the formatted message, a colon character, and a space. 15106 Finally, the error message string affiliated with the current 15107 value of the global variable errno shall be written, followed 15108 by a newline character. 15109 15110 The err() function shall not return, the program shall 15111 terminate with the exit value of eval. 15112 15113 See Also 15114 15115 error(), errx() 15116 15117 Return Value 15118 15119 None. 15120 15121 Errors 15122 15123 None. 15124 15125 error 15126 15127 Name 15128 15129 error -- print error message 15130 15131 Synopsis 15132 15133 #include 15134 15135 void error(int exitstatus, int errnum, const char * format, 15136 ...); 15137 15138 Description 15139 15140 error() shall print a message to standard error. 15141 15142 error() shall build the message from the following elements in 15143 their specified order: 15144 15145 1. the program name. If the application has provided a 15146 function named error_print_progname(), error() shall call 15147 this to supply the program name; otherwise, error() uses 15148 the content of the global variable program_name. 15149 2. the colon and space characters, then the result of using 15150 the printf-style format and the optional arguments. 15151 3. if errnum is nonzero, error() shall add the colon and space 15152 characters, then the result of strerror(errnum). 15153 4. a newline. 15154 15155 If exitstatus is nonzero, error() shall call exit(exitstatus). 15156 15157 See Also 15158 15159 err(), errx() 15160 15161 errx 15162 15163 Name 15164 15165 errx -- display formatted error message and exit 15166 15167 Synopsis 15168 15169 #include 15170 15171 void errx(int eval, const char * fmt, ...); 15172 15173 Description 15174 15175 The errx() function shall display a formatted error message on 15176 the standard error stream. The last component of the program 15177 name, a colon character, and a space shall be output. If fmt is 15178 non-NULL, it shall be used as the format string for the 15179 printf() family of functions, and the formatted error message, 15180 a colon character, and a space shall be output. The output 15181 shall be followed by a newline character. 15182 15183 errx() does not return, but shall exit with the value of eval. 15184 15185 Return Value 15186 15187 None. 15188 15189 Errors 15190 15191 None. 15192 15193 See Also 15194 15195 error(), err() 15196 15197 fcntl 15198 15199 Name 15200 15201 fcntl -- file control 15202 15203 Description 15204 15205 fcntl() is as specified in POSIX 1003.1-2001 (ISO/IEC 15206 9945-2003), but with differences as listed below. 15207 15208 Implementation may set O_LARGEFILE 15209 15210 According to POSIX 1003.1-2001 (ISO/IEC 9945-2003), only an 15211 application sets fcntl() flags, for example O_LARGEFILE. 15212 However, this specification also allows an implementation to 15213 set the O_LARGEFILE flag in the case where the programming 15214 environment is one of _POSIX_V6_ILP32_OFFBIG, 15215 _POSIX_V6_LP64_OFF64, _POSIX_V6_LPBIG_OFFBIG. See getconf and 15216 c99 in POSIX 1003.1-2001 (ISO/IEC 9945-2003) for a description 15217 of these environments. Thus, calling fcntl() with the F_GETFL 15218 command may return O_LARGEFILE as well as flags explicitly set 15219 by the application in the case that both the implementation and 15220 the application support an off_t of at least 64 bits. 15221 15222 Additional flags 15223 15224 In addition to the available values for cmd, as documented in 15225 POSIX 1003.1-2001 (ISO/IEC 9945-2003), this specification 15226 permits the following constants. 15227 15228 F_GETSIG shall get the number of the signal to be sent when 15229 input or output can occur. If the value is 0, then SIGIO shall 15230 be sent. Otherwise, the value retrieved shall be the signal 15231 sent, and the signal handler can discover more information when 15232 installed with the SA_SIGINFO flag. 15233 15234 F_SETSIG shall set the number of the signal to be sent when 15235 input or output can occur. If the value is 0, then SIGIO shall 15236 be sent. Otherwise, the value set shall be the signal to be 15237 sent, and the signal handler can discover more information when 15238 installed with the SA_SIGINFO flag. 15239 15240 F_GETLK64 is analogous to the F_GETLK constant in POSIX 15241 1003.1-2001 (ISO/IEC 9945-2003), but shall provide a 64-bit 15242 interface on non-64-bit architectures. It is identical to 15243 F_GETLK on a 64-bit machine, but is provided in 64-bit 15244 environments for source code consistency among architectures. 15245 15246 F_SETLK64 is analogous to the F_SETLK constant in POSIX 15247 1003.1-2001 (ISO/IEC 9945-2003), but shall provide a 64-bit 15248 interface on non-64-bit architectures. It is identical to 15249 F_SETLK on a 64-bit machine, but is provided in 64-bit 15250 environments for source code consistency among architectures. 15251 15252 F_SETLKW64 is analogous to the F_SETLKW constant in POSIX 15253 1003.1-2001 (ISO/IEC 9945-2003), but provides a 64-bit 15254 interface on non-64-bit architectures. It is identical to 15255 F_SETLKW on a 64-bit machine, but is provided in 64-bit 15256 environments for source code consistency among architectures. 15257 15258 feof_unlocked 15259 15260 Name 15261 15262 feof_unlocked -- non-thread-safe feof 15263 15264 Description 15265 15266 feof_unlocked() is the same as feof(), except that it need not 15267 be thread-safe. That is, it may only be invoked in the ways 15268 which are legal for getc_unlocked(). 15269 15270 ferror_unlocked 15271 15272 Name 15273 15274 ferror_unlocked -- non-thread-safe ferror 15275 15276 Description 15277 15278 ferror_unlocked() is the same as ferror(), except that it need 15279 not be thread-safe. That is, it may only be invoked in the ways 15280 which are legal for getc_unlocked(). 15281 15282 fflush_unlocked 15283 15284 Name 15285 15286 fflush_unlocked -- non thread safe fflush 15287 15288 Description 15289 15290 fflush_unlocked() is the same as fflush() except that it need 15291 not be thread safe. That is, it may only be invoked in the ways 15292 which are legal for getc_unlocked(). 15293 15294 fgetc_unlocked 15295 15296 Name 15297 15298 fgetc_unlocked -- non-thread-safe fgetc 15299 15300 Description 15301 15302 fgetc_unlocked() is the same as fgetc(), except that it need 15303 not be thread-safe. That is, it may only be invoked in the ways 15304 which are legal for getc_unlocked(). 15305 15306 fgets_unlocked 15307 15308 Name 15309 15310 fgets_unlocked -- non-thread-safe fgets 15311 15312 Description 15313 15314 fgets_unlocked() is the same as fgets(), except that it need 15315 not be thread-safe. That is, it may only be invoked in the ways 15316 which are legal for getc_unlocked(). 15317 15318 fgetwc_unlocked 15319 15320 Name 15321 15322 fgetwc_unlocked -- non thread safe fgetwc 15323 15324 Description 15325 15326 fgetwc_unlocked() is the same as fgetwc() except that it need 15327 not be thread safe. That is, it may only be invoked in the ways 15328 which are legal for getc_unlocked(). 15329 15330 fgetws_unlocked 15331 15332 Name 15333 15334 fgetws_unlocked -- non-thread-safe fgetws 15335 15336 Description 15337 15338 fgetws_unlocked() is the same as fgetws(), except that it need 15339 not be thread-safe. That is, it may only be invoked in the ways 15340 which are legal for getc_unlocked(). 15341 15342 fileno_unlocked 15343 15344 Name 15345 15346 fileno_unlocked -- non-thread-safe fileno 15347 15348 Description 15349 15350 fileno_unlocked() is the same as fileno(), except that it need 15351 not be thread-safe. That is, it may only be invoked in the ways 15352 which are legal for getc_unlocked(). 15353 15354 flock 15355 15356 Name 15357 15358 flock -- apply or remove an advisory lock on an open file 15359 15360 Synopsis 15361 15362 int flock(int fd, int operation); 15363 15364 Description 15365 15366 flock() applies or removes an advisory lock on the open file 15367 fd. Valid operation types are: 15368 15369 LOCK_SH 15370 15371 Shared lock. More than one process may hold a shared lock for a 15372 given file at a given time. 15373 LOCK_EX 15374 15375 Exclusive lock. Only one process may hold an exclusive lock for 15376 a given file at a given time. 15377 LOCK_UN 15378 15379 Unlock. 15380 LOCK_NB 15381 15382 Don't block when locking. May be specified (by oring) along 15383 with one of the other operations. 15384 15385 A single file may not simultaneously have both shared and 15386 exclusive locks. 15387 15388 Return Value 15389 15390 On success, 0 is returned. On error, -1 is returned and the 15391 global variable errno is set appropriately. 15392 15393 Errors 15394 15395 EWOULDBLOCK 15396 15397 The file is locked and the LOCK_NB flag was selected. 15398 EBADF 15399 15400 fd is not a not an open file descriptor. 15401 EINTR 15402 15403 While waiting to acquire a lock, the call was interrupted by 15404 delivery of a signal caught by a handler. 15405 EINVAL 15406 15407 The operation is invalid. 15408 ENOLCK 15409 15410 The implementation ran out of memory for allocating lock 15411 records. 15412 15413 fputc_unlocked 15414 15415 Name 15416 15417 fputc_unlocked -- non-thread-safe fputc 15418 15419 Description 15420 15421 fputc_unlocked() is the same as fputc(), except that it need 15422 not be thread-safe. That is, it may only be invoked in the ways 15423 which are legal for getc_unlocked(). 15424 15425 fputs_unlocked 15426 15427 Name 15428 15429 fputs_unlocked -- non-thread-safe fputs 15430 15431 Description 15432 15433 fputs_unlocked() is the same as fputs(), except that it need 15434 not be thread-safe. That is, it may only be invoked in the ways 15435 which are legal for getc_unlocked(). 15436 15437 fputwc_unlocked 15438 15439 Name 15440 15441 fputwc_unlocked -- non-thread-safe fputwc 15442 15443 Description 15444 15445 fputwc_unlocked() is the same as fputwc(), except that it need 15446 not be thread-safe. That is, it may only be invoked in the ways 15447 which are legal for getc_unlocked(). 15448 15449 fputws_unlocked 15450 15451 Name 15452 15453 fputws_unlocked -- non-thread-safe fputws 15454 15455 Description 15456 15457 fputws_unlocked() is the same as fputws(), except that it need 15458 not be thread-safe. That is, it may only be invoked in the ways 15459 which are legal for getc_unlocked(). 15460 15461 fread_unlocked 15462 15463 Name 15464 15465 fread_unlocked -- non-thread-safe fread 15466 15467 Description 15468 15469 fread_unlocked() is the same as fread(), except that it need 15470 not be thread-safe. That is, it may only be invoked in the ways 15471 which are legal for getc_unlocked(). 15472 15473 freelocale 15474 15475 Name 15476 15477 freelocale -- free a locale object 15478 15479 Synopsis 15480 15481 #include 15482 15483 void freelocale(locale_t locale); 15484 15485 Description 15486 15487 The freelocale() function shall free the locale object locale, 15488 and release any resources associated with it. 15489 15490 Return Value 15491 15492 None. 15493 15494 Errors 15495 15496 None defined. 15497 15498 See Also 15499 15500 setlocale(), newlocale(), duplocale(), uselocale() 15501 15502 fscanf 15503 15504 Name 15505 15506 fscanf -- convert formatted input 15507 15508 Description 15509 15510 The scanf() family of functions shall behave as described in 15511 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 15512 15513 Differences 15514 15515 The %s, %S and %[ conversion specifiers shall accept an option 15516 length modifier a, which shall cause a memory buffer to be 15517 allocated to hold the string converted. In such a case, the 15518 argument corresponding to the conversion specifier should be a 15519 reference to a pointer value that will receive a pointer to the 15520 allocated buffer. If there is insufficient memory to allocate a 15521 buffer, the function may set errno to ENOMEM and a conversion 15522 error results. 15523 15524 Note: This directly conflicts with the ISO C (1999) usage of 15525 %a as a conversion specifier for hexadecimal float values. 15526 While this conversion specifier should be supported, a 15527 format specifier such as "%aseconds" will have a different 15528 meaning on an LSB conforming system. 15529 15530 fstatfs 15531 15532 Name 15533 15534 fstatfs -- (deprecated) 15535 15536 Synopsis 15537 15538 #include 15539 15540 int fstatfs(int fd, struct statfs * buf); 15541 15542 Description 15543 15544 The fstatfs() function returns information about a mounted file 15545 system. The file system is identified by fd, a file descriptor 15546 of an open file within the mounted filesystem. The results are 15547 placed in the structure pointed to by buf. 15548 15549 Fields that are undefined for a particular file system shall be 15550 set to 0. 15551 15552 Note: Application developers should use the fstatvfs() 15553 function to obtain general file system information. 15554 Applications should only use the fstatfs() function if they 15555 must determine the file system type, which need not be 15556 provided by fstatvfs(). 15557 15558 Return Value 15559 15560 On success, the fstatfs() function shall return 0 and set the 15561 fields of the structure idenfitied by buf accordingly. On 15562 error, the fstatfs() function shall return -1 and set errno 15563 accordingly. 15564 15565 Errors 15566 15567 EBADF 15568 15569 fd is not a valid open file descriptor. 15570 EFAULT 15571 15572 buf points to an invalid address. 15573 EIO 15574 15575 An I/O error occurred while reading from or writing to the file 15576 system. 15577 ENOSYS 15578 15579 The filesystem fd is open on does not support statfs(). 15580 15581 fstatfs64 15582 15583 Name 15584 15585 fstatfs64 -- (deprecated) 15586 15587 Synopsis 15588 15589 #include 15590 15591 int fstatfs64(int fd, struct statfs64 * buf); 15592 15593 Description 15594 15595 The fstatfs64() function returns information about a mounted 15596 file system. The file system is identified by fd, a file 15597 descriptor of an open file within the mounted filesystem. The 15598 results are placed in the structure pointed to by buf. 15599 15600 Fields that are undefined for a particular file system shall be 15601 set to 0. 15602 15603 fstatfs64() is a large-file version of the fstatfs() function. 15604 15605 Note: Application developers should use the fstatvfs64() 15606 function to obtain general file system information. 15607 Applications should only use the fstatfs64() function if 15608 they must determine the file system type, which need not be 15609 provided by fstatvfs64(). 15610 15611 Return Value 15612 15613 On success, the fstatfs64() function shall return 0 and set the 15614 fields of the structure idenfitied by buf accordingly. On 15615 error, the fstatfs64() function shall return -1 and set errno 15616 accordingly. 15617 15618 Errors 15619 15620 See fstatfs(). 15621 15622 fwrite_unlocked 15623 15624 Name 15625 15626 fwrite_unlocked -- non-thread-safe fwrite 15627 15628 Description 15629 15630 fwrite_unlocked() is the same as fwrite(), except that it need 15631 not be thread-safe. That is, it may only be invoked in the ways 15632 which are legal for getc_unlocked(). 15633 15634 fwscanf 15635 15636 Name 15637 15638 fwscanf -- convert formatted input 15639 15640 Description 15641 15642 The scanf() family of functions shall behave as described in 15643 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 15644 15645 Differences 15646 15647 The %s, %S and %[ conversion specifiers shall accept an option 15648 length modifier a, which shall cause a memory buffer to be 15649 allocated to hold the string converted. In such a case, the 15650 argument corresponding to the conversion specifier should be a 15651 reference to a pointer value that will receive a pointer to the 15652 allocated buffer. If there is insufficient memory to allocate a 15653 buffer, the function may set errno to ENOMEM and a conversion 15654 error results. 15655 15656 Note: This directly conflicts with the ISO C (1999) usage of 15657 %a as a conversion specifier for hexadecimal float values. 15658 While this conversion specifier should be supported, a 15659 format specifier such as "%aseconds" will have a different 15660 meaning on an LSB conforming system. 15661 15662 getdomainname 15663 15664 Name 15665 15666 getdomainname -- get NIS domain name (DEPRECATED). 15667 15668 Synopsis 15669 15670 #include 15671 15672 int getdomainname (char * name , size_t namelen ); 15673 15674 Description 15675 15676 If the Network Information System (NIS) is in use, 15677 getdomainname() shall copy the NIS domain name to the supplied 15678 buffer identified by name, with maximum length namelen. If the 15679 NIS domain name is not currently set, getdomainname() shall 15680 copy the string "(none)" to the name. If namelen is less than 15681 the length of the string to be copied, getdomainname() shall 15682 either truncate the string to namelen characters and place it 15683 in name (without a terminating null character), or shall fail 15684 with EINVAL. 15685 15686 Note: The NIS domain name is not the same as the domain 15687 portion of a fully qualified domain name (for example, in 15688 DNS). 15689 15690 The LSB does not include other NIS functions, nor does it 15691 specify how NIS may affect other database functions. No 15692 conforming application can make use of this information 15693 beyond noting whether or not the domain name has been set. 15694 If the name is set to a value other than the string 15695 "(none)", the application should not imply that NIS is in 15696 use. Similarly, if it is set to "(none)", the application 15697 should not assume that NIS is not in use, although NIS 15698 functionality may be restricted in this case. 15699 15700 Return Value 15701 15702 On success, getdomainname() shall return 0. Otherwise, it shall 15703 return -1 and set errno to indicate the error. 15704 15705 Errors 15706 15707 EINVAL 15708 15709 name is a null pointer. 15710 EINVAL 15711 15712 The buffer identified by name and namelen is of insufficient 15713 size to store the NIS domain name string, and the 15714 implementation considers this an error. 15715 15716 Future Directions 15717 15718 The LSB does not include other NIS interfaces, and a future 15719 version of this specification may remove this interface. 15720 Application developers should avoid using this interface where 15721 possible. 15722 15723 getdtablesize 15724 15725 Name 15726 15727 getdtablesize -- get file descriptor table size (DEPRECATED) 15728 15729 Synopsis 15730 15731 #include 15732 15733 int getdtablesize (void ); 15734 15735 Description 15736 15737 The function getdtablesize() returns the number of files a 15738 process can have open. 15739 15740 Note: The getdtablesize() function is deprecated. Portable 15741 applications should call sysconf() with the _SC_OPEN_MAX 15742 option instead. 15743 15744 Return Value 15745 15746 The getdtablesize() function returns the current soft limit as 15747 if obtained by a call to sysconf() with the _SC_OPEN_MAX 15748 option. 15749 15750 Errors 15751 15752 No errors are defined. 15753 15754 getgrent_r 15755 15756 Name 15757 15758 getgrent_r -- reentrantly get entry in group file 15759 15760 Synopsis 15761 15762 #include 15763 15764 int getgrent_r(struct group * gbuf, char * buf, size_t buflen, 15765 struct group * * gbufp); 15766 15767 Description 15768 15769 The reentrant interface getgrent_r() shall function in the same 15770 way as the interface getgrent(), except that getgrent_r() shall 15771 return the group name, group password, and group members in 15772 buffers provided by the caller, rather than as a pointer to 15773 static storage. 15774 15775 The parameter gbuf contains the struct group that was read from 15776 the stream, if any. 15777 15778 The parameter buf contains additional strings, if any. 15779 15780 The parameter buflen specifies the size of buf. 15781 15782 The parameter *gbufp returns a pointer to the struct group in 15783 *gbuf. 15784 15785 Return Value 15786 15787 On success, getgrent_r() shall return 0, and *gbufp shall 15788 contain a pointer to the result. 15789 15790 On failure, *gbufp shall contain NULL, and getgrent_r() shall 15791 return an error as follows. 15792 15793 Errors 15794 15795 ENOENT 15796 15797 No more group entries. 15798 ERANGE 15799 15800 Not enough buffer space. Specify a larger buffer and try again. 15801 15802 getgrouplist 15803 15804 Name 15805 15806 getgrouplist -- get groups a user belongs to 15807 15808 Synopsis 15809 15810 #include 15811 15812 int getgrouplist(const char * user, gid_t group, gid_t * 15813 groups, int * ngroups); 15814 15815 Description 15816 15817 The getgrouplist() function shall fill in the array groups with 15818 the supplementary groups for the user specified by user. On 15819 entry, ngroups shall refer to an integer containing the maximum 15820 number of elements in the groups array. The group group shall 15821 also be included in the values returned in groups. It is 15822 expected that group would be specified as the user's primary 15823 group from the password file (obtainable via getpwnam() or a 15824 similar function). 15825 15826 Return Value 15827 15828 If on entry the value referenced by ngroups was greater than or 15829 equal to the number of supplementary group identifiers to be 15830 copied to the array identified by groups, getgrouplist() shall 15831 return the number of group identifiers actually copied, and 15832 shall set the value referenced by ngroups to this value. 15833 15834 If on entry the value referenced by ngroups was less than the 15835 number of supplementary group identifiers, getgrouplist() shall 15836 return -1. The initial ngroups entries in groups shall be 15837 overwritten. 15838 15839 If the number of groups exceeds the input ngroups value, then 15840 as well as returning -1, ngroups shall be set to the number of 15841 groups that would have been placed in groups if it had been 15842 large enough. 15843 15844 Note: In such a case, the caller can use the information 15845 returned to make a further getgrouplist() call with a 15846 correctly sized groups array. 15847 15848 If user does not refer to a valid user on the system, then the 15849 behavior of this function is undefined. 15850 15851 Errors 15852 15853 None defined. 15854 15855 See Also 15856 15857 getgroups() 15858 15859 gethostbyaddr_r 15860 15861 Name 15862 15863 gethostbyaddr_r -- find network host database entry matching 15864 host name (DEPRECATED) 15865 15866 Synopsis 15867 15868 #include 15869 15870 int gethostbyaddr_r(const void * restrict addr, socklen_t len, 15871 int type, struct hostent * restrict result_buf, char * restrict 15872 buf, size_t buflen, struct hostent * * restrict result, int * 15873 h_errnop); 15874 15875 Description 15876 15877 Note: The gethostbyaddr_r() function is deprecated; 15878 applications should use getaddrinfo() instead. 15879 15880 gethostbyaddr_r() is a reentrant version of gethostbyaddr() 15881 that searches the network host database for a host address 15882 match. 15883 15884 The gethostbyaddr_r() function shall search the network host 15885 database for an entry of address family type with the host with 15886 address addr. The len argument contains the length of the 15887 address referenced by addr. 15888 15889 If type is AF_INET, the addr argument shall be an in_addr 15890 structure. If type is AF_INET6, the addr argument shall be an 15891 in6_addr structure. If type is any other value, the behavior is 15892 unspecified. 15893 15894 The application must provide a buffer for the gethostbyaddr_r() 15895 to use during the lookup process. The buffer is referenced by 15896 buf, and is of size buflen. If the buffer is not of sufficient 15897 size, gethostbyaddr_r() may fail and return ERANGE. If a 15898 matching entry is found in the database, gethostbyaddr_r() 15899 shall copy the relevant information to the application supplied 15900 hostent structure referenced by result_buf, and return a 15901 pointer to this structure in *result. If no matching entry is 15902 found, *result shall be set to a null pointer. Additional error 15903 information shall be set in the variable referenced by 15904 h_errnop. 15905 15906 Return Value 15907 15908 On success, the gethostbyaddr_r() function shall return zero. 15909 If the return value was ERANGE, the size of the buffer buf, 15910 indicated by buflen, was too small. If the gethostbyaddr_r() 15911 function returns returns any other value, then the variable 15912 referenced by h_errnop shall be set to indicate the cause as 15913 for gethostbyaddr(). 15914 15915 gethostbyname2 15916 15917 Name 15918 15919 gethostbyname2 -- find network host database entry matching 15920 host name (DEPRECATED) 15921 15922 Synopsis 15923 15924 int gethostbyname2(const char * restrict name, int af); 15925 15926 Description 15927 15928 Note: The gethostbyname2() function is deprecated; 15929 applications should use getaddrinfo() instead. 15930 15931 The gethostbyname2() function shall search the network host 15932 database for an entry with name name. This function is similar 15933 to the gethostbyname() function but additionally allows the 15934 search to be restricted to a particular address family 15935 specified by af. 15936 15937 Return Value 15938 15939 On success, the gethostbyname2() function shall return a 15940 pointer to a hostent structure if the requested entry was 15941 found, and a null pointer otherwise. 15942 15943 On unsuccessful completion, gethostbyname2() shall set h_errno 15944 as for gethostbyname() in POSIX 1003.1-2001 (ISO/IEC 15945 9945-2003). 15946 15947 Errors 15948 15949 The gethostbyname2() shall set h_errno as for gethostbyname() 15950 in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 15951 15952 gethostbyname2_r 15953 15954 Name 15955 15956 gethostbyname2_r -- find network host database entry matching 15957 host name (DEPRECATED) 15958 15959 Synopsis 15960 15961 int gethostbyname2_r(const char * restrict name, int af, struct 15962 hostent * restrict result_buf, char * restrict buf, size_t 15963 buflen, struct hostent ** restrict result, int * restrict 15964 h_errnop); 15965 15966 Description 15967 15968 Note: The gethostbyname2_r() function is deprecated; 15969 applications should use getaddrinfo() instead. 15970 15971 The gethostbyname2_r() function shall search the network host 15972 database for an entry with name name. gethostbyname2_r() is a 15973 reentrant version of gethostbyname2(). These functions are 15974 similar to the gethostbyname() and gethostbyname_r() functions 15975 but additionally allow the search to be restricted to a 15976 particular address family specified by af. 15977 15978 The application must provide a buffer for the 15979 gethostbyname2_r() function to use during the lookup process. 15980 The buffer is referenced by buf, and is of size buflen. If the 15981 buffer is not of sufficient size, gethostbyname_r() may fail 15982 and return ERANGE. If a matching entry is found in the 15983 database, gethostbyname_r() shall copy the relevant information 15984 to the application-supplied hostent structure referenced by 15985 result_buf, and return a pointer to this structure in *result. 15986 If no matching entry is found, *result shall be set to a null 15987 pointer. Additional error information shall be set in the 15988 variable referenced by h_errnop. 15989 15990 Return Value 15991 15992 On success, the gethostbyname2_r() function shall return zero. 15993 If the return value was ERANGE, the size of the buffer buf, 15994 indicated by buflen, was too small. If the gethostbyname2_r() 15995 function returns returns any other value, then the variable 15996 referenced by h_errnop shall be set to indicate the cause as 15997 for gethostbyname_r(). 15998 15999 gethostbyname_r 16000 16001 Name 16002 16003 gethostbyname_r -- find network host database entry matching 16004 host name (DEPRECATED) 16005 16006 Synopsis 16007 16008 int gethostbyname_r(const char * restrict name, struct hostent 16009 * restrict result_buf, char * restrict buf, size_t buflen, 16010 struct hostent ** restrict result, int * restrict h_errnop); 16011 16012 Description 16013 16014 Note: The gethostbyname_r() function is deprecated; 16015 applications should use getaddrinfo() instead. 16016 16017 gethostbyname_r() is a reentrant version of gethostbyname() 16018 that searches the network host database for a host name match. 16019 16020 The gethostbyname_r() function shall search the network host 16021 database for an entry with name name. 16022 16023 The application must provide a buffer for the gethostbyname_r() 16024 to use during the lookup process. The buffer is referenced by 16025 buf, and is of size buflen. If the buffer is not of sufficient 16026 size, gethostbyname_r() may fail and return ERANGE. If a 16027 matching entry is found in the database, gethostbyname_r() 16028 shall copy the relevant information to the application supplied 16029 hostent structure referenced by result_buf, and return a 16030 pointer to this structure in *result. If no matching entry is 16031 found, *result shall be set to a null pointer. Additional error 16032 information shall be set in the variable referenced by 16033 h_errnop. 16034 16035 Return Value 16036 16037 On success, the gethostbyname_r() function shall return zero. 16038 If the return value was ERANGE, the size of the buffer buf, 16039 indicated by buflen, was too small. If the gethostbyname_r() 16040 function returns returns any other value, then the variable 16041 referenced by h_errnop shall be set to indicate the cause as 16042 for gethostbyname(). 16043 16044 getloadavg 16045 16046 Name 16047 16048 getloadavg -- get system load averages 16049 16050 Synopsis 16051 16052 #include 16053 16054 int getloadavg(double loadavg[], int nelem); 16055 16056 Description 16057 16058 getloadavg() returns the number of processes in the system run 16059 queue averaged over various periods of time. Up to nelem 16060 samples are retrieved and assigned to successive elements of 16061 loadavg[]. The system imposes a maximum of 3 samples, 16062 representing averages over the last 1, 5, and 15 minutes, 16063 respectively. 16064 16065 Return Value 16066 16067 If the load average could not be obtained, -1 is returned. 16068 Otherwise, the number of samples actually retrieved is 16069 returned. 16070 16071 getopt 16072 16073 Name 16074 16075 getopt -- parse command line options 16076 16077 Synopsis 16078 16079 #include 16080 16081 int getopt(int argc, char * const argv[], const char * 16082 optstring); 16083 16084 extern char *optarg; 16085 extern int optind, opterr, optopt; 16086 16087 Description 16088 16089 The getopt() function shall parse command line arguments as 16090 described in POSIX 1003.1-2001 (ISO/IEC 9945-2003), with the 16091 following exceptions, where LSB and POSIX specifications vary. 16092 LSB systems shall implement the modified behaviors described 16093 below. 16094 16095 Argument Ordering 16096 16097 The getopt() function can process command line arguments 16098 referenced by argv in one of three ways: 16099 16100 PERMUTE 16101 16102 the order of arguments in argv is altered so that all options 16103 (and their arguments) are moved in front of all of the 16104 operands. This is the default behavior. 16105 16106 Note: This behavior has undefined results if argv is not 16107 modifiable. This is to support historic behavior predating 16108 the use of const and ISO C (1999). The function prototype 16109 was aligned with POSIX 1003.1-2001 (ISO/IEC 9945-2003) 16110 despite the fact that it modifies argv, and the library 16111 maintainers are unwilling to change this. 16112 16113 REQUIRE_ORDER 16114 16115 The arguments in argv are processed in exactly the order given, 16116 and option processing stops when the first non-option argument 16117 is reached, or when the element of argv is "--". This ordering 16118 can be enforced either by setting the environment variable 16119 POSIXLY_CORRECT, or by setting the first character of optstring 16120 to '+'. 16121 RETURN_IN_ORDER 16122 16123 The order of arguments is not altered, and all arguments are 16124 processed. Non-option arguments (operands) are handled as if 16125 they were the argument to an option with the value 1 ('\001'). 16126 This ordering is selected by setting the first character of 16127 optstring to '-'; 16128 16129 Option Characteristics 16130 16131 LSB specifies that: 16132 16133 * an element of argv that starts with "-" (and is not exactly 16134 "-" or "--") is an option element. 16135 * characters of an option element, aside from the initial 16136 "-", are option characters. 16137 16138 POSIX specifies that: 16139 16140 * applications using getopt() shall obey the following syntax 16141 guidelines: 16142 + option name is a single alphanumeric character from 16143 the portable character set 16144 + option is preceded by the '-' delimiter character 16145 + options without option-arguments should be accepted 16146 when grouped behind one '-' delimiter 16147 + each option and option-argument is a separate argument 16148 + option-arguments are not optional 16149 + all options should precede operands on the command 16150 line 16151 + the argument "--" is accepted as a delimiter 16152 indicating the end of options and the consideration of 16153 subsequent arguments, if any, as operands 16154 * historical implementations of getopt() support other 16155 characters as options as an allowed extension, but 16156 applications that use extensions are not maximally 16157 portable. 16158 * support for multi-byte option characters is only possible 16159 when such characters can be represented as type int. 16160 * applications that call any utility with a first operand 16161 starting with '-' should usually specify "--" to mark the 16162 end of the options. Standard utilities that do not support 16163 this guideline indicate that fact in the OPTIONS section of 16164 the utility description. 16165 16166 Extensions 16167 16168 LSB specifies that: 16169 16170 * if a character is followed by two colons, the option takes 16171 an optional argument; if there is text in the current argv 16172 element, it is returned in optarg, otherwise optarg is set 16173 to 0. 16174 * if optstring contains W followed by a semi-colon (;), then 16175 -W foo is treated as the long option --foo. 16176 16177 Note: See getopt_long() for a description of long options. 16178 * The first character of optstring shall modify the behavior 16179 of getopt() as follows: 16180 + if the first character is '+', then REQUIRE_ORDER 16181 processing shall be in effect (see above) 16182 + if the first character is '-', then RETURN_IN_ORDER 16183 processing shall be in effect (see above) 16184 + if the first character is ':', then getopt() shall 16185 return ':' instead of '?' to indicate a missing option 16186 argument, and shall not print any diagnostic message 16187 to stderr. 16188 16189 POSIX specifies that: 16190 16191 * the -W option is reserved for implementation extensions. 16192 16193 Return Values 16194 16195 LSB specifies the following additional getopt() return values: 16196 16197 * '\001' is returned if RETURN_IN_ORDER argument ordering is 16198 in effect, and the next argument is an operand, not an 16199 option. The argument is available in optarg. 16200 16201 Any other return value has the same meaning as for POSIX. 16202 16203 POSIX specifies the following getopt() return values: 16204 16205 * the next option character is returned, if found 16206 successfully. 16207 * ':' is returned if a parameter is missing for one of the 16208 options and the first character of optstring is ':'. 16209 * '?' is returned if an unknown option character not in 16210 optstring is encountered, or if getopt() detects a missing 16211 argument and the first character of optstring is not ':'. 16212 * -1 is returned for the end of the option list. 16213 16214 Environment Variables 16215 16216 LSB specifies that: 16217 16218 * if the variable POSIXLY_CORRECT is set, option processing 16219 stops as soon as a non-option argument is encountered. 16220 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 16221 is the process ID for the current process), contains a 16222 space separated list of arguments that should not be 16223 treated as arguments even though they appear to be so. 16224 16225 Rationale: This was used by bash 2.0 to communicate to GNU 16226 libc which arguments resulted from wildcard expansion and so 16227 should not be considered as options. This behavior was 16228 removed in bash version 2.01, but the support remains in GNU 16229 libc. 16230 This behavior is DEPRECATED in this version of the LSB; 16231 future revisions of this specification may not include this 16232 requirement. 16233 16234 getopt_long 16235 16236 Name 16237 16238 getopt_long -- parse command line options 16239 16240 Synopsis 16241 16242 #define _GNU_SOURCE 16243 #include 16244 16245 int getopt_long(int argc, char * const argv[], const char * 16246 opstring, const struct option * longopts, int * longindex); 16247 16248 Description 16249 16250 getopt_long() works like getopt() except that it also accepts 16251 long options, started out by two dashes. Long option names may 16252 be abbreviated if the abbreviation is unique or is an exact 16253 match for some defined option. A long option may take a 16254 parameter, of the form --arg=param or --arg param. 16255 16256 longopts is a pointer to the first element of an array of 16257 struct option declared in getopt.h as: 16258 struct option { 16259 const char *name; 16260 int has_arg; 16261 int *flag; 16262 int val; 16263 }; 16264 16265 The fields in this structure have the following meaning: 16266 16267 name 16268 16269 The name of the long option. 16270 has_arg 16271 16272 One of: 16273 16274 no_argument (or 0) if the option does not take an argument, 16275 required_argument (or 1) if the option requires an argument, or 16276 optional_argument (or 2) if the option takes an optional 16277 argument. 16278 16279 flag 16280 16281 specifies how results are returned for a long option. If flag 16282 is NULL, then getopt_long() shall return val. (For example, the 16283 calling program may set val to the equivalent short option 16284 character.) Otherwise, getopt_long() returns 0, and flag shall 16285 point to a variable which shall be set to val if the option is 16286 found, but left unchanged if the option is not found. 16287 val 16288 16289 The value to return, or to load into the variable pointed to by 16290 flag. 16291 16292 If longindex is not NULL, it points to a variable which is set 16293 to the index of the long option relative to longopts. 16294 16295 Return Value 16296 16297 getopt_long() returns the option character if a short option 16298 was found successfully, or ":" if there was a missing parameter 16299 for one of the options, or "?" for an unknown option character, 16300 or -1 for the end of the option list. 16301 16302 For a long option, getopt_long() returns val if flag is NULL, 16303 and 0 otherwise. Error and -1 returns are the same as for 16304 getopt(), plus "?" for an ambiguous match or an extraneous 16305 parameter. 16306 16307 getopt_long_only 16308 16309 Name 16310 16311 getopt_long_only -- parse command line options 16312 16313 Synopsis 16314 16315 #define _GNU_SOURCE 16316 #include 16317 16318 int getopt_long_only(int argc, char * const argv[], const char 16319 * optstring, const struct option * longopts, int * longindex); 16320 16321 Description 16322 16323 getopt_long_only() is like getopt_long(), but "-" as well as 16324 "--" can indicate a long option. If an option that starts with 16325 "-" (not "--") doesn't match a long option, but does match a 16326 short option, it is parsed as a short option instead. 16327 16328 Note: The getopt_long_only() function is intended only for 16329 supporting certain programs whose command line syntax was 16330 designed before the Utility Syntax Guidelines of POSIX 16331 1003.1-2001 (ISO/IEC 9945-2003) were developed. New programs 16332 should generally call getopt_long() instead, which provides 16333 the --option syntax for long options, which is preferred by 16334 GNU and consistent with POSIX 1003.1-2001 (ISO/IEC 16335 9945-2003). 16336 16337 Return Value 16338 16339 getopt_long_only() returns the option character if the option 16340 was found successfully, or ":" if there was a missing parameter 16341 for one of the options, or "?" for an unknown option character, 16342 or -1 for the end of the option list. 16343 16344 getopt_long_only() also returns the option character when a 16345 short option is recognized. For a long option, they return val 16346 if flag is NULL, and 0 otherwise. Error and -1 returns are the 16347 same as for getopt(), plus "?" for an ambiguous match or an 16348 extraneous parameter. 16349 16350 getpagesize 16351 16352 Name 16353 16354 getpagesize -- get memory page size (DEPRECATED) 16355 16356 Synopsis 16357 16358 #include 16359 16360 int getpagesize (void ); 16361 16362 Description 16363 16364 The function getpagesize() returns the number of bytes in a 16365 meory page. 16366 16367 Note: The getpagesize() function is deprecated. Portable 16368 applications should use sysconf(_SC_PAGE_SIZE) instead. 16369 16370 Return Value 16371 16372 The getpagesize() function returns the current page size. 16373 16374 Errors 16375 16376 No errors are defined. 16377 16378 getprotobyname_r 16379 16380 Name 16381 16382 getprotobyname_r -- retrieve information from the network 16383 protocol database by protocol name, reentrantly 16384 16385 Synopsis 16386 16387 #include 16388 16389 int getprotobyname_r(const char * name, struct protoent * 16390 result_buf, char * buf, size_t buflen, struct protoent * * 16391 result); 16392 16393 Description 16394 16395 The getprotobyname_r() function is a reentrant version of the 16396 getprotobyname() function. 16397 16398 The getprotobyname_r() function shall search the network 16399 protocol database for an entry with the name name. 16400 16401 If a matching entry is found in the database, this function 16402 shall copy the relevant information to the application-supplied 16403 protoent structure referenced by result_buf, and return a 16404 pointer to this structure in *result. If no matching entry is 16405 found, *result shall be set to a null pointer. 16406 16407 The array buf shall contain the string fields referenced by the 16408 protoent structure that was returned. The parameter buflen 16409 shall specify the array's size. 1024 bytes should be enough for 16410 most uses. 16411 16412 Return Value 16413 16414 On success, the getprotobyname_r() function shall return 0. If 16415 the return value was ERANGE, the size of the buffer buf, 16416 indicated by buflen, was too small. 16417 16418 getprotobynumber_r 16419 16420 Name 16421 16422 getprotobynumber_r -- retrieve information from the network 16423 protocol database by protocol number, reentrantly 16424 16425 Synopsis 16426 16427 #include 16428 16429 int getprotobynumber_r(int proto, struct protoent * result_buf, 16430 char * buf, size_t buflen, struct protoent * * result); 16431 16432 Description 16433 16434 The getprotobynumber_r() function is a reentrant version of the 16435 getprotobynumber() function. 16436 16437 The getprotobynumber_r() function shall search the network 16438 protocol database for an entry with protocol number proto. 16439 16440 If a matching entry is found in the database, this function 16441 shall copy the relevant information to the application-supplied 16442 protoent structure referenced by result_buf, and return a 16443 pointer to this structure in *result. If no matching entry is 16444 found, *result shall be set to a null pointer. 16445 16446 The array buf shall contain the string fields referenced by the 16447 protoent structure that was returned. The parameter buflen 16448 shall specify the array's size. 1024 bytes should be enough for 16449 most uses. 16450 16451 Return Value 16452 16453 On success, the getprotobynumber_r() function shall return 0. 16454 If the return value was ERANGE, the size of the buffer buf, 16455 indicated by buflen, was too small. 16456 16457 getprotoent_r 16458 16459 Name 16460 16461 getprotoent_r -- read the next entry of the protocol database, 16462 reentrantly 16463 16464 Synopsis 16465 16466 #include 16467 16468 int getprotoent_r(struct protoent * result_buf, char * buf, 16469 size_t buflen, struct protoent * * result); 16470 16471 Description 16472 16473 The getprotoent_r() function is a reentrant version of the 16474 getprotoent() function. 16475 16476 The getprotoent_r() function shall search the network protocol 16477 database for the next entry. 16478 16479 If the next entry is found in the database, this function shall 16480 copy the relevant information to the application-supplied 16481 protoent structure referenced by result_buf, and return a 16482 pointer to this structure in *result. If no next entry is 16483 found, *result shall be set to a null pointer. 16484 16485 The array buf shall contain the string fields referenced by the 16486 protoent structure that was returned. The parameter buflen 16487 shall specify the array's size. 1024 bytes should be enough for 16488 most uses. 16489 16490 Return Value 16491 16492 On success, the getprotoent_r() function shall return zero. 16493 16494 If the return value was ENOENT, there were no more entries in 16495 the database. 16496 16497 If the return value was ERANGE, the size of the buffer buf, 16498 indicated by buflen, was too small. 16499 16500 getpwent_r 16501 16502 Name 16503 16504 getpwent_r -- reentrantly get entry in passwd file 16505 16506 Synopsis 16507 16508 #include 16509 16510 int getpwent_r(struct passwd * pwbuf, char * buf, size_t 16511 buflen, struct passwd * * pwbufp); 16512 16513 Description 16514 16515 The reentrant interface getpwent_r() shall function in the same 16516 way as the interface getpwent(), except that getpwent_r() shall 16517 return the user name, user password, GECOS field, home 16518 directory, and shell program in buffers provided by the caller, 16519 rather than as a pointer to static storage. 16520 16521 The parameter pwbuf contains the struct passwd that was read 16522 from the stream, if any. 16523 16524 The parameter buf contains additional strings, if any. 16525 16526 The parameter buflen specifies the size of buf. 16527 16528 The parameter *pwbufp returns a pointer to the struct passwd in 16529 *pwbuf. 16530 16531 Return Value 16532 16533 On success, getpwent_r() shall return 0, and *pwbufp shall 16534 contain a pointer to the result. 16535 16536 On failure, *pwbufp shall contain NULL, and getpwent_r() shall 16537 return an error as follows. 16538 16539 Errors 16540 16541 ENOENT 16542 16543 No more password entries. 16544 ERANGE 16545 16546 Not enough buffer space. Specify a larger buffer and try again. 16547 16548 getservbyname_r 16549 16550 Name 16551 16552 getservbyname_r -- retrieve information from the network 16553 services database by service name, reentrantly 16554 16555 Synopsis 16556 16557 #include 16558 16559 int getservbyname_r(const char * name, const char * proto, 16560 struct servent * result_buf, char * buf, size_t buflen, struct 16561 servent * * result); 16562 16563 Description 16564 16565 The getservbyname_r() function is a reentrant version of the 16566 getservbyname() function. 16567 16568 The getservbyname_r() function shall search the network 16569 services database for an entry with the name name. The proto 16570 parameter shall restrict the search to entries with the 16571 specified protocol. If proto is NULL, getservbyname_r() may 16572 return entries with any protocol. 16573 16574 If a matching entry is found in the database, this function 16575 shall copy the relevant information to the application-supplied 16576 servent structure referenced by result_buf, and return a 16577 pointer to this structure in *result. If no matching entry is 16578 found, *result shall be set to a null pointer. 16579 16580 The array buf shall contain the string fields referenced by the 16581 servent structure that was returned. The parameter buflen shall 16582 specify the array's size. 1024 bytes should be enough for most 16583 uses. 16584 16585 Return Value 16586 16587 On success, the getservbyname_r() function shall return zero. 16588 If the return value was ERANGE, the size of the buffer buf, 16589 indicated by buflen, was too small. 16590 16591 getservbyport_r 16592 16593 Name 16594 16595 getservbyport_r -- retrieve information from the network 16596 services database by service port, reentrantly 16597 16598 Synopsis 16599 16600 #include 16601 16602 int getservbyport_r(int port, const char * proto, struct 16603 servent * result_buf, char * buf, size_t buflen, struct servent 16604 * * result); 16605 16606 Description 16607 16608 The getservbyport_r() function is a reentrant version of the 16609 getservbyport() function. 16610 16611 The getservbyport_r() function shall search the network 16612 services database for an entry with the port port. The proto 16613 parameter shall restrict the search to entries with the 16614 specified protocol. If proto is NULL, getservbyport_r() may 16615 return entries with any protocol. 16616 16617 If a matching entry is found in the database, this function 16618 shall copy the relevant information to the application-supplied 16619 servent structure referenced by result_buf, and return a 16620 pointer to this structure in *result. If no matching entry is 16621 found, *result shall be set to a null pointer. 16622 16623 The array buf shall contain the string fields referenced by the 16624 servent structure that was returned. The parameter buflen shall 16625 specify the array's size. 1024 bytes should be enough for most 16626 uses. 16627 16628 Return Value 16629 16630 On success, the getservbyport_r() function shall return zero. 16631 If the return value was ERANGE, the size of the buffer buf, 16632 indicated by buflen, was too small. 16633 16634 getservent_r 16635 16636 Name 16637 16638 getservent_r -- read the next entry of the network services 16639 database, reentrantly 16640 16641 Synopsis 16642 16643 #include 16644 16645 int getservent_r(struct servent * result_buf, char * buf, 16646 size_t buflen, struct servent * * result); 16647 16648 Description 16649 16650 The getservent_r() function is a reentrant version of the 16651 getservent() function. 16652 16653 The getservent_r() function shall search the network services 16654 database for the next entry. 16655 16656 If the next entry is found in the database, this function shall 16657 copy the relevant information to the application-supplied 16658 servent structure referenced by result_buf, and return a 16659 pointer to this structure in *result. If no next entry is 16660 found, *result shall be set to a null pointer. 16661 16662 The array buf shall contain the string fields referenced by the 16663 servent structure that was returned. The parameter buflen shall 16664 specify the array's size. 1024 bytes should be enough for most 16665 uses. 16666 16667 Return Value 16668 16669 On success, the getservent_r() function shall return 0. 16670 16671 If the return value was ENOENT, there were no more entries in 16672 the database. 16673 16674 If the return value was ERANGE, the size of the buffer buf, 16675 indicated by buflen, was too small. 16676 16677 getsockopt 16678 16679 Name 16680 16681 getsockopt -- get socket options 16682 16683 Synopsis 16684 16685 #include 16686 #include 16687 16688 int getsockopt(int socket, int level, int option_name, void * 16689 restrict option_value, socklen_t * restrict option_len); 16690 16691 Description 16692 16693 The getsockopt() function shall behave as specified in POSIX 16694 1003.1-2001 (ISO/IEC 9945-2003), with the following extensions. 16695 16696 IP Protocol Level Options 16697 16698 If the level parameter is IPPROTO_IP, the following values 16699 shall be supported for option_name (see RFC 791:Internet 16700 Protocol for further details): 16701 16702 IP_OPTIONS 16703 16704 Get the Internet Protocol options sent with every packet from 16705 this socket. The option_value shall point to a memory buffer in 16706 which the options shall be placed; on entry option_len shall 16707 point to an integer value indicating the maximum size of the 16708 memory buffer, in bytes. On successful return, the value 16709 referenced by option_len shall be updated to the size of data 16710 copied to the buffer. For IPv4, the maximum length of options 16711 is 40 bytes. 16712 IP_TTL 16713 16714 Get the current unicast Internet Protocol Time To Live value 16715 used when sending packets with this socket. The option_value 16716 shall point to a buffer large enough to hold the time to live 16717 value (at least 1 byte), and option_len shall point to an 16718 integer value holding the maximum size of that buffer. On 16719 successful return, the value referenced by option_len shall be 16720 updated to contain the number of bytes copied into the buffer, 16721 which shall be no larger than the initial value, and 16722 option_value shall point to an integer containing the time to 16723 live value. 16724 IP_TOS 16725 16726 Get the Internet Protocol type of service indicator used when 16727 sending packets with this socket. The option_value shall point 16728 to a buffer large enough to hold the type of service indicator 16729 (at least 1 byte), and option_len shall point to an integer 16730 value holding the maximum size of that buffer. On successful 16731 return, the value referenced by option_len shall be updated to 16732 contain the number of bytes copied into the buffer, which shall 16733 be no larger than the initial value, and option_value shall 16734 point to an integer containing the time to live value. 16735 16736 gettext 16737 16738 Name 16739 16740 gettext -- search message catalogs for a string 16741 16742 Synopsis 16743 16744 #include 16745 16746 char * gettext(const char * msgid); 16747 16748 Description 16749 16750 The gettext() function shall search the currently selected 16751 message catalogs for a string identified by the string msgid. 16752 If a string is located, that string shall be returned. 16753 16754 The gettext() function is equivalent to dcgettext(NULL, msgid, 16755 LC_MESSAGES). 16756 16757 Return Value 16758 16759 If a string is found in the currently selected message catalogs 16760 for msgid, then a pointer to that string shall be returned. 16761 Otherwise, a pointer to msgid shall be returned. 16762 16763 Applications shall not modify the string returned by gettext(). 16764 16765 Errors 16766 16767 None. 16768 16769 The gettext() function shall not modify errno. 16770 16771 See Also 16772 16773 dgettext, ngettext, dngettext, dcgettext, dcngettext, 16774 textdomain, bindtextdomain, bind_textdomain_codeset 16775 16776 getutent 16777 16778 Name 16779 16780 getutent -- access user accounting database entries 16781 16782 Synopsis 16783 16784 #include 16785 16786 struct utmp *getutent(void); 16787 16788 Description 16789 16790 The getutent() function shall read the next entry from the user 16791 accounting database. 16792 16793 Return Value 16794 16795 Upon successful completion, getutent() shall return a pointer 16796 to a utmp structure containing a copy of the requested entry in 16797 the user accounting database. Otherwise, a null pointer shall 16798 be returned. The return value may point to a static area which 16799 is overwritten by a subsequent call to getutent(). 16800 16801 Errors 16802 16803 None defined. 16804 16805 getutent_r 16806 16807 Name 16808 16809 getutent_r -- access user accounting database entries 16810 16811 Synopsis 16812 16813 int getutent_r(struct utmp * buffer, struct utmp ** result); 16814 16815 Description 16816 16817 The getutent_r() function is a reentrant version of the 16818 getutent() function. On entry, buffer should point to a user 16819 supplied buffer to which the next entry in the database will be 16820 copied, and result should point to a location where the result 16821 will be stored. 16822 16823 Return Value 16824 16825 On success, getutent_r() shall return 0 and set the location 16826 referenced by result to a pointer to buffer. Otherwise, 16827 getutent_r() shall return -1 and set the location referenced by 16828 result to NULL. 16829 16830 getwc_unlocked 16831 16832 Name 16833 16834 getwc_unlocked -- non-thread-safe getwc 16835 16836 Description 16837 16838 getwc_unlocked() is the same as getwc(), except that it need 16839 not be thread-safe. That is, it may only be invoked in the ways 16840 which are legal for getc_unlocked(). 16841 16842 getwchar_unlocked 16843 16844 Name 16845 16846 getwchar_unlocked -- non-thread-safe getwchar 16847 16848 Description 16849 16850 getwchar_unlocked() is the same as getwchar(), except that it 16851 need not be thread-safe. That is, it may only be invoked in the 16852 ways which are legal for getc_unlocked(). 16853 16854 glob64 16855 16856 Name 16857 16858 glob64 -- find pathnames matching a pattern (Large File 16859 Support) 16860 16861 Synopsis 16862 16863 #include 16864 16865 int glob64(const char * pattern, int flags, int (*errfunc) 16866 (const char *, int), glob64_t * pglob); 16867 16868 Description 16869 16870 glob64() is a large-file version of the glob() function defined 16871 in POSIX 1003.1-2001 (ISO/IEC 9945-2003). It shall search for 16872 pathnames matching pattern according to the rules used by the 16873 shell, /bin/sh. No tilde expansion or parameter substitution is 16874 done; see wordexp(). 16875 16876 The results of a glob64() call are stored in the structure 16877 pointed to by pglob, which is a glob64_t declared in glob.h 16878 with the following members: 16879 typedef struct 16880 { 16881 size_t gl_pathc; 16882 char **gl_pathv; 16883 size_t gl_offs; 16884 int gl_flags; 16885 void (*gl_closedir) (void *); 16886 struct dirent64 *(*gl_readdir64) (void *); 16887 void *(*gl_opendir) (const char *); 16888 int (*gl_lstat) (const char *, struct stat *); 16889 int (*gl_stat) (const char *, struct stat *); 16890 } 16891 glob64_t; 16892 16893 Structure members with the same name as corresponding members 16894 of a glob_t as defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003) 16895 shall have the same purpose. 16896 16897 Other members are defined as follows: 16898 16899 gl_flags 16900 16901 reserved for internal use 16902 gl_closedir 16903 16904 pointer to a function capable of closing a directory opened by 16905 gl_opendir 16906 gl_readdir64 16907 16908 pointer to a function capable of reading entries in a large 16909 directory 16910 gl_opendir 16911 16912 pointer to a function capable of opening a large directory 16913 gl_stat 16914 16915 pointer to a function capable of returning file status for a 16916 large file 16917 gl_lstat 16918 16919 pointer to a function capable of returning file status 16920 information for a large file or symbolic link 16921 16922 A large file or large directory is one with a size which cannot 16923 be represented by a variable of type off_t. 16924 16925 Return Value 16926 16927 On success, 0 is returned. Other possible returns are: 16928 16929 GLOB_NOSPACE 16930 16931 out of memory 16932 GLOB_ABORTED 16933 16934 read error 16935 GLOB_NOMATCH 16936 16937 no match found 16938 16939 globfree64 16940 16941 Name 16942 16943 globfree64 -- free memory from glob64() (Large File Support) 16944 16945 Synopsis 16946 16947 #include 16948 16949 void globfree64(glob64_t * pglob); 16950 16951 Description 16952 16953 globfree64() frees the dynamically allocated storage from an 16954 earlier call to glob64(). 16955 16956 globfree64() is a large-file version of the globfree() function 16957 defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 16958 16959 gnu_get_libc_version, gnu_get_libc_release 16960 16961 Name 16962 16963 gnu_get_libc_version, gnu_get_libc_release -- get 16964 glibc-specific version and release 16965 16966 Synopsis 16967 16968 #include 16969 16970 const char * gnu_get_libc_version(void); 16971 16972 const char * gnu_get_libc_release(void); 16973 16974 Description 16975 16976 gnu_get_libc_version() returns a string that identifies the 16977 version of the C library running the program making the call. 16978 16979 gnu_get_libc_release() returns a string indicates the release 16980 status of the C library running the program making the call. 16981 This will be a string such as "stable". 16982 16983 Return Value 16984 16985 The functions return strings. The contents of these strings are 16986 unspecified. 16987 16988 Errors 16989 16990 No errors are defined. 16991 16992 Notes 16993 16994 These functions are specific to GNU libc (glibc). This 16995 specification does not require the implementation of libc to be 16996 glibc, although it requires these functions. 16997 16998 The string returned by gnu_get_libc_version() will be a dotted 16999 version string, which may have meaning to developers otherwise 17000 familiar with glibc. These functions have been requested to aid 17001 in portability of software which also runs in non-LSB contexts, 17002 but decisions based on the return value should be tempered by 17003 an understanding of what the behavioral requirements of this 17004 specification are. That is, it may or may not be useful to 17005 discover that a running system, for example, has version 17006 "2.10.1" if that implies different behavior than described by 17007 this specification. 17008 17009 hcreate_r 17010 17011 Name 17012 17013 hcreate_r -- allocate space for a hash search table, 17014 reentrantly 17015 17016 Synopsis 17017 17018 #include 17019 17020 int hcreate_r(size_t nel, struct hsearch_data * htab); 17021 17022 Description 17023 17024 The hcreate_r() function is a reentrant version of the 17025 hcreate() function. 17026 17027 hcreate_r() shall initialize the object referenced by htab with 17028 a hash table containing at least nel elements. Unlike its 17029 non-reentrant equivalent, hcreate(), the hcreate_r() function 17030 may work with more than one hash table. 17031 17032 The memory for the htab object may be dynamically allocated. It 17033 must be initialized with 0 before hcreate_r() is called. 17034 17035 Return Value 17036 17037 On success, hcreate_r() shall return a non-zero value. 17038 17039 On failure, hcreate_r() shall return 0. This usually happens 17040 because not enough memory was available. 17041 17042 hdestroy_r 17043 17044 Name 17045 17046 hdestroy_r -- dispose of a hash search table, reentrantly 17047 17048 Synopsis 17049 17050 #include 17051 17052 void hdestroy_r(struct hsearch_data * htab); 17053 17054 Description 17055 17056 The hdestroy_r() function is a reentrant version of the 17057 hdestroy() function. 17058 17059 hdestroy_r() frees the resources allocated by hcreate_r() for 17060 the object htab. 17061 17062 hsearch_r 17063 17064 Name 17065 17066 hsearch_r -- search a hash table, reentrantly 17067 17068 Synopsis 17069 17070 #include 17071 17072 int hsearch_r(ENTRY item, ACTION action, ENTRY * * retval, 17073 struct hsearch_data * htab); 17074 17075 Description 17076 17077 The hsearch_r() is a reentrant version of the hsearch() 17078 function, but instead of operating on a single global hash 17079 table, hsearch_r() operates on the table described by the 17080 object that htab references. This object can be initialized 17081 with the function hcreate_r(). 17082 17083 Unlike the hsearch() function, hsearch_r() returns a pointer to 17084 the found entry in the variable referred to by retval, rather 17085 than directly. 17086 17087 Return Value 17088 17089 On success, hsearch_r() shall return a non-zero value. 17090 17091 On failure, hsearch_r() shall return 0 and set errno to an 17092 appropriate value. 17093 17094 Errors 17095 17096 ENOMEM 17097 17098 action was set to ENTER, but the table was full. 17099 ESRCH 17100 17101 action was set to FIND, but no matching element was found in 17102 the table. 17103 17104 inet_aton 17105 17106 Name 17107 17108 inet_aton -- Internet address manipulation routine 17109 17110 Synopsis 17111 17112 #include 17113 #include 17114 #include 17115 17116 int anet_iton(const char * cp, struct in_addr * inp); 17117 17118 Description 17119 17120 inet_aton() converts the Internet host address cp from the 17121 standard IPv4 numbers-and-dots notation into binary data and 17122 stores it in the structure that inp points to. 17123 17124 inet_aton() returns a nonzero value if the address is valid, 0 17125 if not. 17126 17127 Note: Note that on some LSB architectures, the host byte 17128 order is Least Significant Byte first, whereas the network 17129 byte order, as used on the Internet, is Most Significant 17130 Byte first. 17131 17132 initgroups 17133 17134 Name 17135 17136 initgroups -- initialize the supplementary group access list 17137 17138 Synopsis 17139 17140 #include 17141 #include 17142 17143 int initgroups(const char * user, gid_t group); 17144 17145 Description 17146 17147 If the process has appropriate privilege, the initgroups() 17148 function shall initialize the Supplementary Group IDs for the 17149 current process by reading the group database and using all 17150 groups of which user is a member. The additional group group is 17151 also added to the list. 17152 17153 Return Value 17154 17155 On success, 0 is returned. On error, -1 is returned and the 17156 global variable errno is set appropriately. 17157 17158 Errors 17159 17160 EPERM 17161 17162 The calling process does not have sufficient privileges. 17163 ENOMEM 17164 17165 Insufficient memory to allocate group information structure. 17166 17167 See Also 17168 17169 setgroups() 17170 17171 initstate_r 17172 17173 Name 17174 17175 initstate_r -- reentrantly initialize a state array for random 17176 number generator functions 17177 17178 Synopsis 17179 17180 #include 17181 17182 int initstate_r(unsigned int seed, char * statebuf, size_t 17183 statelen, struct random_data * buffer); 17184 17185 Description 17186 17187 The interface initstate_r() shall function in the same way as 17188 the interface initstate(), except that initstate_r() shall use 17189 the data in buffer instead of the global random number 17190 generator state. 17191 17192 inotify_add_watch 17193 17194 Name 17195 17196 inotify_add_watch -- add a watch to a watch list 17197 17198 Synopsis 17199 17200 #include 17201 17202 int inotify_add_watch(int fd, const char * path, uint32_t 17203 mask); 17204 17205 Description 17206 17207 inotify_add_watch() shall add a watch to, or modify an existing 17208 watch on, the watch list of the inotify instance specified by 17209 the file descriptor fd, for the file specified by path, to 17210 monitor the events specified by the bitmask mask. The caller 17211 must have read access to the file. 17212 17213 Return Value 17214 17215 On success, inotify_add_watch() shall return the unique, 17216 non-negative watch descriptor associated with the file path and 17217 the inotify instance specified by the file descriptor fd. 17218 17219 If path was already on the watch list, then inotify_add_watch() 17220 shall return the existing watch descriptor. 17221 17222 If path was not already on the watch list, then 17223 inotify_add_watch() shall allocate a new watch descriptor. 17224 17225 inotify_add_watch() shall not work recursively. Monitoring 17226 subdirectories of path shall require adding watches to them. 17227 17228 On failure, inotify_add_watch() shall return -1 and set errno 17229 to an appropriate value. 17230 17231 Errors 17232 17233 EACCESS 17234 17235 The caller does not have read access to path. 17236 EBADF 17237 17238 The file descriptor fd is invalid. 17239 EFAULT 17240 17241 path is outside of the address space accessible by the process. 17242 EINVAL 17243 17244 mask contains no legal events, or fd is not a valid inotify 17245 file descriptor. 17246 ENOMEM 17247 17248 There is not enough kernel memory available. 17249 ENOSPC 17250 17251 The maximum number of watches has been created for this user, 17252 or the kernel cannot allocate a resource. 17253 17254 Application Usage 17255 17256 Reading 17257 17258 The function read() can be used to determine which inotify 17259 events have occurred. A blocking file descriptor will make 17260 read() block until at least one event has occurred. 17261 17262 If successful, read() will return at least one of the following 17263 inotify_event structures in a buffer: 17264 17265 struct inotify_event { 17266 int wd; 17267 uint32_t mask; 17268 uint32_t cookie; 17269 uint32_t len; 17270 char path[]; 17271 }; 17272 17273 wd is a watch descriptor that specifies the watch associated 17274 with the event. It is obtained from a previous invocation of 17275 inotify_add_watch(). 17276 17277 mask is a bit mask describing inotify events. See the section 17278 on masks below. 17279 17280 cookie is an integer associating related inotify events. The 17281 integer value is unique, and currently only enables the 17282 application to associate IN_MOVE_FROM and IN_MOVE_TO rename 17283 events. 17284 17285 len is a count of the bytes in path, including null bytes. This 17286 means that the total length of an inotify_event structure is 17287 17288 sizeof(inotify_event)+len 17289 17290 path is only returned when an event occurs for a file within a 17291 watched directory. This string is null-terminated, and it may 17292 contain more null bytes so that future reads will be aligned 17293 properly on an address boundary. 17294 17295 In kernels before 2.6.21, read() returns 0 when the buffer 17296 given to it is too small to return data about the next event. 17297 In subsequent kernels, it fails with the error EINVAL. 17298 17299 For a given file descriptor, the inotify events are returned in 17300 an ordered queue. Events on a file descriptor will always be 17301 returned in the correct order of occurrence. If two or more 17302 inotify events for a given file descriptor have identical 17303 values for all fields, then only one inotify_event will be 17304 returned to represent all of them. 17305 17306 The number of bytes that can be read from an inotify file 17307 descriptor can be determined by making a FIONREAD ioctl() call. 17308 17309 Masks 17310 17311 The mask argument of inotify_add_watch() and the mask field of 17312 the inotify_event structure are bit masks that specify inotify 17313 events. The bits in the list below can be set in the mask 17314 argument of inotify_add_watch() and returned in the mask field 17315 of inotify_event. 17316 17317 IN_ACCESS 17318 17319 File was read. 17320 IN_ALL_EVENTS 17321 17322 Bit mask of all events in this list. 17323 IN_ATTRIB 17324 17325 File's metadata changed (including timestamps and permissions). 17326 IN_CLOSE 17327 17328 Same as 17329 17330 IN_CLOSE_WRITE | IN_CLOSE_NOWRITE 17331 17332 IN_CLOSE_WRITE 17333 17334 File that was opened for writing was closed. 17335 IN_CLOSE_NOWRITE 17336 17337 File that was not opened for writing was closed. 17338 IN_CREATE 17339 17340 File or directory was created in a watched directory. 17341 IN_DELETE 17342 17343 File or directory was deleted in a watched directory. 17344 IN_DELETE_SELF 17345 17346 Watched file or directory was deleted. 17347 IN_MODIFY 17348 17349 File was changed. 17350 IN_MOVE 17351 17352 Same as 17353 17354 IN_MOVED_FROM | IN_MOVED_TO 17355 17356 IN_MOVE_SELF 17357 17358 Watched file or directory was moved 17359 IN_MOVED_FROM 17360 17361 File was moved out of watched directory. 17362 IN_MOVED_TO 17363 17364 File was moved into watched directory. 17365 IN_OPEN 17366 17367 File was opened. 17368 17369 All of the events above, except for IN_DELETE_SELF and 17370 IN_MOVE_SELF, cause the name field of the inotify_event 17371 structure to contain the name of the file or directory being 17372 monitored. 17373 17374 The following bit is valid for inotify_add_watch() only. 17375 17376 IN_ONESHOT 17377 17378 Monitor path for an event, and then remove it from the watch 17379 list. 17380 17381 The following bits are valid for the inotify_event structure 17382 only. 17383 17384 IN_IGNORED 17385 17386 Watch was removed, either explicitly (via inotify_rm_watch()) 17387 or implicitly (file deletion or file system unmounting). 17388 IN_ISDIR 17389 17390 Object being watched is a directory. 17391 IN_Q_OVERFLOW 17392 17393 The event queue overflowed (wd is set to -1). 17394 IN_UNMOUNT 17395 17396 File system of object being watched was unmounted. 17397 17398 Notes 17399 17400 It is possible to monitor file descriptors with the functions 17401 epoll(), poll(), and select(). 17402 17403 When all of the file descriptors that point to an inotify 17404 instance have been closed, the instance and its associated 17405 resources and watches are freed by the kernel. 17406 17407 See Also 17408 17409 inotify_init(), inotify_rm_watch() 17410 17411 inotify_init 17412 17413 Name 17414 17415 inotify_init -- instantiate inotify 17416 17417 Synopsis 17418 17419 #include 17420 17421 int inotify_init(void); 17422 17423 Description 17424 17425 inotify_init() shall create one instance of inotify. 17426 17427 Return Value 17428 17429 On success, inotify_init() shall return a file descriptor 17430 pointing to the new inotify instance. 17431 17432 On failure, inotify_init() shall return -1 and set errno to an 17433 appropriate value. 17434 17435 Errors 17436 17437 EMFILE 17438 17439 The maximum number of inotify instances has been created for 17440 this user. 17441 ENFILE 17442 17443 The maximum number of file descriptors has been created on the 17444 system. 17445 ENOMEM 17446 17447 There is not enough kernel memory available. 17448 17449 See Also 17450 17451 inotify_add_watch(), inotify_rm_watch() 17452 17453 inotify_rm_watch 17454 17455 Name 17456 17457 inotify_rm_watch -- remove a watch from an inotify watch list 17458 17459 Synopsis 17460 17461 #include 17462 17463 int inotify_rm_watch(int fd, int wd); 17464 17465 Description 17466 17467 inotify_rm_watch() shall remove the watch associated with the 17468 watch descriptor wd from the watch list of the inotify instance 17469 associated with the file descriptor fd. 17470 17471 If a watch is removed, its watch descriptor shall generate the 17472 IN_IGNORED event. 17473 17474 Return Value 17475 17476 On success, inotify_rm_watch() shall return 0. 17477 17478 On failure, inotify_rm_watch() shall return -1 and set errno to 17479 an appropriate value. 17480 17481 Errors 17482 17483 EBADF 17484 17485 The file descriptor fd is invalid. 17486 EINVAL 17487 17488 wd is invalid, or fd is not a valid inotify file descriptor. 17489 17490 See Also 17491 17492 inotify_add_watch(), inotify_init() 17493 17494 ioctl 17495 17496 Name 17497 17498 ioctl -- control device 17499 17500 Synopsis 17501 17502 #include 17503 17504 int ioctl (int fildes , int request , ...); 17505 17506 Description 17507 17508 The ioctl() function shall manipulate the underlying device 17509 parameters of special files. fildes shall be an open file 17510 descriptor referring to a special file. The ioctl() function 17511 shall take three parameters; the type and value of the third 17512 parameter is dependent on the device and request. 17513 17514 Conforming LSB applications shall not call ioctl() except in 17515 situations explicitly stated in this specification. 17516 17517 Return Value 17518 17519 On success, 0 is returned. An ioctl() may use the return value 17520 as an output parameter and return a non-negative value on 17521 success. On error, -1 is returned and the global variable errno 17522 is set appropriately. 17523 17524 Errors 17525 17526 EBADF 17527 17528 fildes is not a valid descriptor. 17529 EFAULT 17530 17531 The third parameter references an inaccessible memory area. 17532 ENOTTY 17533 17534 fildes is not associated with a character special device. 17535 ENOTTY 17536 17537 The specified request does not apply to the kind of object that 17538 fildes references. 17539 EINVAL 17540 17541 request or the third parameter is not valid. 17542 17543 Relationship to POSIX (Informative) 17544 17545 It should be noted that POSIX 1003.1-2001 (ISO/IEC 9945-2003) 17546 contains an interface named ioctl(). The LSB only defines 17547 behavior when fildes refers to a socket (see sockio) or 17548 terminal device (see ttyio), while POSIX 1003.1-2001 (ISO/IEC 17549 9945-2003) only defines behavior when fildes refers to a 17550 STREAMS device. An implementation may support both behaviors; 17551 the LSB does not require any STREAMS support. 17552 17553 sockio 17554 17555 Name 17556 17557 sockio -- socket ioctl commands 17558 17559 Synopsis 17560 17561 #include 17562 #include 17563 #include 17564 #include 17565 17566 int ioctl(int sockfd, int request, void * argp); 17567 17568 Description 17569 17570 Socket ioctl() commands are a subset of the ioctl() calls, 17571 which can perform a variety of functions on sockets. sockfd 17572 shall be an open file descriptor referring to a socket (see the 17573 socket() or accept() functions). 17574 17575 Socket ioctl() commands apply to the underlying network 17576 interfaces, and affect the entire system, not just the file 17577 descriptor used to issue the ioctl(). 17578 17579 The following values for request are accepted: 17580 17581 SIOCGIFCONF (Deprecated) 17582 Get the interface configuration list for the system. 17583 17584 Note: The SIOCGIFCONF interface is superceded by the 17585 if_nameindex() family of functions (see POSIX 1003.1-2001 17586 (ISO/IEC 9945-2003)). A future version of this specification 17587 may withdraw this value for request. 17588 17589 argp shall point to a ifconf structure, as described in 17590 . Before calling, the caller shall set the 17591 ifc_ifcu.ifcu_req field to point to an array of ifreq 17592 structures, and set ifc_len to the size in bytes of this 17593 allocated array. Upon return, ifc_len will contain the 17594 size in bytes of the array which was actually used. If 17595 it is the same as the length upon calling, the caller 17596 should assume that the array was too small and try again 17597 with a larger array. 17598 17599 On success, SIOCGIFCONF shall return a nonnegative 17600 value. 17601 17602 Rationale: Historical UNIX systems disagree on the meaning 17603 of the return value. 17604 17605 SIOCGIFFLAGS 17606 Get the interface flags for the indicated interface. 17607 argp shall point to a ifreq structure. Before calling, 17608 the caller should fill in the ifr_name field with the 17609 interface name, and upon return, the ifr_ifru.ifru_flags 17610 field is set with the interface flags. 17611 17612 SIOCGIFADDR 17613 Get the interface address for the given interface. argp 17614 shall point to a ifreq structure. Before calling, the 17615 caller should fill in the ifr_name field with the 17616 interface name, and upon return, the ifr_ifru.ifru_addr 17617 field is set with the interface address. 17618 17619 SIOCGIFBRDADDR 17620 Get the interface broadcast address for the given 17621 interface. argp shall point to a ifreq structure. Before 17622 calling, the caller should fill in the ifr_name field 17623 with the interface name, and upon return, the 17624 ifr_ifru.ifru_broadcast field is set with the interface 17625 broadcast address. 17626 17627 SIOCGIFDSTADDR 17628 Get the point-to-point address for the given interface. 17629 argp shall point to a ifreq structure. Before calling, 17630 the caller should fill in the ifr_name field with the 17631 interface name, and upon return, the ifr_dstaddr field 17632 is set with the point-to-point address. 17633 17634 SIOCGIFNAME 17635 Get the name of an interface. argp shall point to a 17636 ifreq structure. Before calling, the caller should fill 17637 in the ifr_ifindex field with the number (index) of the 17638 interface, and upon return, the ifr_name field is set 17639 with the interface name. 17640 17641 SIOCGIFNETMASK 17642 Get the network mask for the given interface. argp shall 17643 point to a ifreq structure. Before calling, the caller 17644 should fill in the ifr_name field with the interface 17645 name, and upon return, the ifr_ifru.ifru_netmask field 17646 is set with the network mask. 17647 17648 SIOCGIFMTU 17649 Get the Maximum Transmission Unit (MTU) size for the 17650 given interface. argp shall point to a ifreq structure. 17651 Before calling, the caller should fill in the ifr_name 17652 field with the interface name, and upon return, the 17653 ifr_ifru.ifru_mtu field is set with the MTU. Note: The 17654 range of valid values for MTU varies for an interface 17655 depending on the interface type. 17656 17657 FIONREAD 17658 Get the amount of queued unread data in the receive 17659 buffer. argp shall point to an integer where the result 17660 is to be placed. 17661 17662 Note: Some implementations may also support the use of 17663 FIONREAD on other types of file descriptor. However, the LSB 17664 only specifies its behavior for a socket related file 17665 descriptor. 17666 17667 Return Value 17668 17669 On success, if request is SIOCGIFCONF, a non-negative integer 17670 shall be returned. If request is not SIOCGIFCONF, on success 0 17671 is returned. On error, -1 is returned and the global variable 17672 errno is set appropriately. 17673 17674 Errors 17675 17676 EBADF 17677 17678 sockfd is not a valid descriptor. 17679 EFAULT 17680 17681 argp references an inaccessible memory area. 17682 ENOTTY 17683 17684 The specified request does not apply to the kind of object that 17685 the descriptor sockfd references. 17686 EINVAL 17687 17688 Either request or argp is invalid. 17689 ENOTCONN 17690 17691 The operation is only defined on a connected socket, but the 17692 socket wasn't connected. 17693 17694 ttyio 17695 17696 Name 17697 17698 ttyio -- tty ioctl commands 17699 17700 Synopsis 17701 17702 #include 17703 #include 17704 17705 int ioctl(int fd, unsigned long request, int * argp); 17706 17707 Description 17708 17709 Tty ioctl commands are a subset of the ioctl() calls, which can 17710 perform a variety of functions on tty devices. fd shall be an 17711 open file descriptor referring to a terminal device. 17712 17713 The following ioctl()s are provided: 17714 17715 TIOCGWINSZ 17716 17717 Get the size attributes of the terminal or pseudo-terminal 17718 identified by fd. On entry, argp shall reference a winsize 17719 structure. On return, the structure will have ws_row set to the 17720 number of rows of text (i.e. lines of text) that can be viewed 17721 on the device, and ws_col set to the number of columns (i.e. 17722 text width). 17723 17724 Note: The number of columns stored in ws_col assumes that 17725 the terminal device is using a mono-spaced font. 17726 17727 Return Value 17728 17729 On success, 0 is returned. On error, -1 is returned and the 17730 global variable errno is set appropriately. 17731 17732 Errors 17733 17734 EBADF 17735 17736 fd is not a valid descriptor. 17737 EFAULT 17738 17739 argp references an inaccessible memory area. 17740 EINVAL 17741 17742 request and argp are not valid. 17743 17744 jrand48_r 17745 17746 Name 17747 17748 jrand48_r -- reentrantly generate pseudorandom numbers in a 17749 uniform distribution 17750 17751 Synopsis 17752 17753 #include 17754 17755 int jrand48_r(unsigned short[3] xsubi, struct drand48_data * 17756 buffer, long int * result); 17757 17758 Description 17759 17760 The interface jrand48_r() shall function in the same way as the 17761 interface jrand48(), except that jrand48_r() shall use the data 17762 in buffer instead of the global random number generator state. 17763 17764 Before it is used, buffer must be initialized, for example, by 17765 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 17766 it with zeroes. 17767 17768 kill 17769 17770 Name 17771 17772 kill -- send a signal 17773 17774 Synopsis 17775 17776 #include 17777 17778 int kill(pid_t pid, int sig); 17779 17780 Description 17781 17782 kill() is as specified in the POSIX 1003.1-2001 (ISO/IEC 17783 9945-2003), but with differences as listed below. 17784 17785 Process ID -1 doesn't affect calling process 17786 17787 If pid is specified as -1, sig shall not be sent to the calling 17788 process. Other than this, the rules in the POSIX 1003.1-2001 17789 (ISO/IEC 9945-2003) apply. 17790 17791 Rationale: This was a deliberate Linus decision after an 17792 unpopular experiment in including the calling process in the 17793 2.5.1 kernel. See "What does it mean to signal everybody?", 17794 Linux Weekly News, 20 December 2001, 17795 http://lwn.net/2001/1220/kernel.php3 17796 17797 lcong48_r 17798 17799 Name 17800 17801 lcong48_r -- reentrantly generate pseudorandom numbers in a 17802 uniform distribution 17803 17804 Synopsis 17805 17806 #include 17807 17808 int lcong48_r(unsigned short[7] param, struct drand48_data * 17809 buffer); 17810 17811 Description 17812 17813 The interface lcong48_r() shall function in the same way as the 17814 interface lcong48(), except that lcong48_r() shall use the data 17815 in buffer instead of the global random number generator state. 17816 17817 link 17818 17819 Name 17820 17821 link -- create a link to a file 17822 17823 Synopsis 17824 17825 #include 17826 17827 int link(const char * path1, const char * path2); 17828 17829 Description 17830 17831 The link() function shall behave as specified in POSIX 17832 1003.1-2001 (ISO/IEC 9945-2003), except with differences as 17833 listed below. 17834 17835 Need Not Follow Symlinks 17836 17837 POSIX 1003.1-2001 (ISO/IEC 9945-2003) specifies that pathname 17838 resolution shall follow symbolic links during pathname 17839 resolution unless the function is required to act on the 17840 symbolic link itself, or certain arguments direct that the 17841 function act on the symbolic link itself. The link() function 17842 in POSIX 1003.1-2001 (ISO/IEC 9945-2003) contains no such 17843 requirement to operate on a symbolic link. However, a 17844 conforming LSB implementation need not follow a symbolic link 17845 for the path1 argument. 17846 17847 lrand48_r 17848 17849 Name 17850 17851 lrand48_r -- reentrantly generate pseudorandom numbers in a 17852 uniform distribution 17853 17854 Synopsis 17855 17856 #include 17857 17858 int lrand48_r(struct drand48_data * buffer, long int * result); 17859 17860 Description 17861 17862 The interface lrand48_r() shall function in the same way as the 17863 interface lrand48(), except that lrand48_r() shall use the data 17864 in buffer instead of the global random number generator state. 17865 17866 Before it is used, buffer must be initialized, for example, by 17867 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 17868 it with zeroes. 17869 17870 mbsnrtowcs 17871 17872 Name 17873 17874 mbsnrtowcs -- convert a multibyte string to a wide character 17875 string 17876 17877 Synopsis 17878 17879 #include 17880 17881 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 17882 nms, size_t len, mbstate_t * ps); 17883 17884 Description 17885 17886 mbsnrtowcs() is like mbsrtowcs(), except that the number of 17887 bytes to be converted, starting at src, is limited to nms. 17888 17889 If dest is not a NULL pointer, mbsnrtowcs() converts at most 17890 nms bytes from the multibyte string src to a wide-character 17891 string starting at dest. At most, len wide characters are 17892 written to dest. The shift state ps is updated. 17893 17894 The conversion is effectively performed by repeatedly calling: 17895 17896 mbrtowc(dest, *src, n, ps) 17897 17898 where n is some positive number, as long as this call succeeds, 17899 and then incrementing dest by one and src by the number of 17900 bytes consumed. 17901 17902 The conversion can stop for three reasons: 17903 17904 * An invalid multibyte sequence has been encountered. In this 17905 case src is left pointing to the invalid multibyte 17906 sequence, (size_t)(-1) is returned, and errno is set to 17907 EILSEQ. 17908 * The nms limit forces a stop, or len non-L'\0' wide 17909 characters have been stored at dest. In this case, src is 17910 left pointing to the next multibyte sequence to be 17911 converted, and the number of wide characters written to 17912 dest is returned. 17913 * The multibyte string has been completely converted, 17914 including the terminating '\0' (which has the side effect 17915 of bringing back ps to the initial state). In this case, 17916 src is set to NULL, and the number of wide characters 17917 written to dest, excluding the terminating L'\0' character, 17918 is returned. 17919 17920 If dest is NULL, len is ignored, and the conversion proceeds as 17921 above, except that the converted wide characters are not 17922 written out to memory, and that no destination length limit 17923 exists. 17924 17925 In both of the above cases, if ps is a NULL pointer, a static 17926 anonymous state only known to mbsnrtowcs() is used instead. 17927 17928 The programmer shall ensure that there is room for at least len 17929 wide characters at dest. 17930 17931 Return Value 17932 17933 mbsnrtowcs() returns the number of wide characters that make up 17934 the converted part of the wide character string, not including 17935 the terminating null wide character. If an invalid multibyte 17936 sequence was encountered, (size_t)(-1) is returned, and the 17937 global variable errno is set to EILSEQ. 17938 17939 Notes 17940 17941 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 17942 of the current locale. 17943 17944 Passing NULL as ps is not multi-thread safe. 17945 17946 memmem 17947 17948 Name 17949 17950 memmem -- locate bytes 17951 17952 Synopsis 17953 17954 #define _GNU_SOURCE 17955 #include 17956 17957 void * memmem(const void * haystack, size_t haystacklen, const 17958 void * needle, size_t needlelen); 17959 17960 Description 17961 17962 memmem() finds the start of the first occurrence of the byte 17963 array referenced by needle of length needlelen in the memory 17964 area haystack of length haystacklen. 17965 17966 Return Value 17967 17968 If needle is found, memmem() returns a pointer to it. If 17969 needlelen is 0, memmem returns haystack. If needle is not found 17970 in haystack, memmem() returns NULL. 17971 17972 Notes 17973 17974 Earlier versions of the C library (prior to glibc 2.1) 17975 contained a memmem() with various problems, and application 17976 developers should treat this function with care. 17977 17978 memrchr 17979 17980 Name 17981 17982 memrchr -- scan memory for a character 17983 17984 Synopsis 17985 17986 #include 17987 17988 void * memrchr(const void * s, int c, size_t n); 17989 17990 Description 17991 17992 The memrchr() function shall locate the last occurence of c 17993 (converted to an unsigned char) in the initial n bytes (each 17994 interpreted as an unsigned char) of the object pointed to by s. 17995 17996 Return Value 17997 17998 The memrchr() shall return a pointer to the located byte, or a 17999 null pointer if the byte does not occur in the object. 18000 18001 Errors 18002 18003 No errors are defined. 18004 18005 See Also 18006 18007 memchr() 18008 18009 mkstemp64 18010 18011 Name 18012 18013 mkstemp64 -- create a unique temporary file (Large File 18014 Support) 18015 18016 Synopsis 18017 18018 #include 18019 #include 18020 18021 int mkstemp64(char * template); 18022 18023 Description 18024 18025 mkstemp64() shall generates a unique temporary file name from 18026 template. The last six characters of template shall be XXXXXX 18027 and these are replaced with a string that makes the file name 18028 unique; the file is then created and an open file descriptor 18029 returned as described for mkstemp(). 18030 18031 mkstemp64() is a large-file version of the mkstemp() function 18032 as defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003). The only 18033 difference is that the temporary file is opened with open64() 18034 instead of with open(). 18035 18036 Return Value 18037 18038 On success, mkstemp64() returns the file descriptor of the 18039 temporary file. Otherwise mkstemp64() shall return -1 and set 18040 errno to indicate the error. 18041 18042 Errors 18043 18044 See mkstemp() for possible error values. 18045 18046 mrand48_r 18047 18048 Name 18049 18050 mrand48_r -- reentrantly generate pseudorandom numbers in a 18051 uniform distribution 18052 18053 Synopsis 18054 18055 #include 18056 18057 int mrand48_r(struct drand48_data * buffer, long int * result); 18058 18059 Description 18060 18061 The interface mrand48_r() shall function in the same way as the 18062 interface mrand48(), except that mrand48_r() shall use the data 18063 in buffer instead of the global random number generator state. 18064 18065 Before it is used, buffer must be initialized, for example, by 18066 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 18067 it with zeroes. 18068 18069 mremap 18070 18071 Name 18072 18073 mremap -- remap a virtual memory address 18074 18075 Synopsis 18076 18077 #include 18078 18079 void * mremap(void * old_address, size_t old_size, size_t 18080 new_size, int flags); 18081 18082 Description 18083 18084 The mremap() function expands (or shrinks) an existing memory 18085 mapping, potentially moving it at the same time, depending on 18086 the flags argument and the available virtual address space. 18087 18088 old_address is the old address of the virtual memory block to 18089 be resized. Note that old_address must be page aligned. 18090 old_size is the old size of the virtual memory block. new_size 18091 is the requested size of the virtual memory block after the 18092 resize. 18093 18094 In Linux the memory is divided into pages. A user process has 18095 (one or) several linear virtual memory segments. Each virtual 18096 memory segment has one or more mappings to real memory pages 18097 (in the page table). Each virtual memory segment has its own 18098 protection (access rights), which may cause a segmentation 18099 violation if the memory is accessed incorrectly (e.g., writing 18100 to a read-only segment). Accessing virtual memory outside of 18101 the segments will also cause a segmentation violation. 18102 18103 mremap() uses the Linux page table scheme. mremap() changes the 18104 mapping between virtual addresses and memory pages. This can be 18105 used to implement a very efficient form of realloc(). 18106 18107 The flags bit-mask argument may be 0, or include the following 18108 flag: 18109 18110 MREMAP_MAYMOVE 18111 18112 By default, if there is not sufficient space to expand a 18113 mapping at its current location, then mremap() fails. If this 18114 flag is specified, then the kernel is permitted to relocate the 18115 mapping to a new virtual address, if necessary. If the mapping 18116 is relocated, then absolute pointers into the old mapping 18117 location become invalid (offsets relative to the starting 18118 address of the mapping should be employed). 18119 MREMAP_FIXED 18120 18121 This flag serves a similar purpose to the MAP_FIXED flag of 18122 mmap(). If this flag is specified, then mremap()accepts a fifth 18123 argument, void *new_address, which specifies a pagealigned 18124 address to which the mapping must be moved. Any previous 18125 mapping at the address range specified by new_address and 18126 new_size is unmapped. If MREMAP_FIXED is specified, then 18127 MREMAP_MAYMOVE must also be specified. 18128 18129 If the memory segment specified by old_address and old_size is 18130 locked (using mlock() or similar), then this lock is maintained 18131 when the segment is resized and/or relocated. As a consequence, 18132 the amount of memory locked by the process may change. 18133 18134 Return Value 18135 18136 The mremap() function returns a pointer to the new virtual 18137 memory area on success. On error, the value MAP_FAILED is 18138 returned, and errno is set appropriately. 18139 18140 Errors 18141 18142 EAGAIN 18143 18144 The caller tried to expand a memory segment that is locked, but 18145 this was not possible without exceeding the RLIMIT_MEMLOCK 18146 resource limit. 18147 EFAULT 18148 18149 "Segmentation fault." Some address in the range old_address to 18150 old_address+old_size is an invalid virtual memory address for 18151 this process. You can also get EFAULT even if there exist 18152 mappings that cover the whole address space requested, but 18153 those mappings are of different types. 18154 EINVAL 18155 18156 An invalid argument was given. Possible causes are: old_address 18157 was not page aligned; a value other than MREMAP_MAYMOVE or 18158 MREMAP_FIXED was specified in flags; new_size was zero; 18159 new_size or new_address was invalid; or the new address range 18160 specified by new_address and new_size overlapped the old 18161 address range specified by old_address and old_size; or 18162 MREMAP_FIXED was specified without also specifying 18163 MREMAP_MAYMOVE. 18164 ENOMEM 18165 18166 The memory area cannot be expanded at the current virtual 18167 address, and the MREMAP_MAYMOVE flag is not set in flags, or, 18168 there is not enough (virtual) memory available. 18169 18170 newlocale 18171 18172 Name 18173 18174 newlocale -- allocate a locale object 18175 18176 Synopsis 18177 18178 #include 18179 18180 locale_t newlocale(int category_mask, const char * locale, 18181 locale_t base); 18182 18183 Description 18184 18185 The newlocale() function shall initialize a locale object. If 18186 base is NULL, then newlocale() shall first allocate the object; 18187 otherwise it shall use the locale object referenced by base. 18188 18189 The object shall be initialized for the locale named by locale, 18190 and for the categories selected in category_mask. The 18191 category_mask value is a bitwise inclusive OR of the required 18192 LC_name_MASK values, or the value LC_ALL_MASK. 18193 18194 Return Value 18195 18196 On success, the newlocale() function shall return the 18197 initialized locale object. Otherwise, it shall return NULL, and 18198 set errno to indicate the error. 18199 18200 Errors 18201 18202 The newlocale() function shall fail if: 18203 18204 ENOMEM 18205 18206 Insufficient memory. 18207 EINVAL 18208 18209 An invalid category_mask was provided, or the locale was NULL. 18210 ENOENT 18211 18212 For any of the categories in category_mask, the locale data is 18213 not available. 18214 18215 Application Usage (Informative) 18216 18217 The only portable way to allocate a locale object is to call 18218 newlocale() with a NULL base. The allocated object may be 18219 reinitialized to a new locale by passing it back to 18220 newlocale(). The new object may be released by calling 18221 freelocale(). 18222 18223 See Also 18224 18225 setlocale(), freelocale(), duplocale(), uselocale() 18226 18227 ngettext 18228 18229 Name 18230 18231 ngettext -- search message catalogs for plural string 18232 18233 Synopsis 18234 18235 #include 18236 18237 char * ngettext(const char * msgid1, const char * msgid2, 18238 unsigned long int n); 18239 18240 Description 18241 18242 The ngettext() function shall search the currently selected 18243 message catalogs for a string matching the singular string 18244 msgid1. If a string is located, and if n is 1, that string 18245 shall be returned. If n is not 1, a pluralized version 18246 (dependent on n) of the string shall be returned. 18247 18248 The ngettext() function is equivalent to dcngettext(NULL, 18249 msgid1, msgid2, n, LC_MESSAGES)(). 18250 18251 Return Value 18252 18253 If a string is found in the currently selected message catalogs 18254 for msgid1, then if n is 1 a pointer to the located string 18255 shall be returned. If n is not 1, a pointer to an appropriately 18256 pluralized version of the string shall be returned. If no 18257 message could be found in the currently selected mesage 18258 catalogs, then if n is 1, a pointer to msgid1 shall be 18259 returned, otherwise a pointer to msgid2 shall be returned. 18260 18261 Applications shall not modify the string returned by 18262 ngettext(). 18263 18264 Errors 18265 18266 None. 18267 18268 The ngettext() function shall not modify errno. 18269 18270 See Also 18271 18272 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 18273 textdomain, bindtextdomain, bind_textdomain_codeset 18274 18275 nrand48_r 18276 18277 Name 18278 18279 nrand48_r -- reentrantly generate pseudorandom numbers in a 18280 uniform distribution 18281 18282 Synopsis 18283 18284 #include 18285 18286 int nrand48_r(unsigned short[3] xsubi, struct drand48_data * 18287 buffer, long int * result); 18288 18289 Description 18290 18291 The interface nrand48_r() shall function in the same way as the 18292 interface nrand48(), except that nrand48_r() shall use the data 18293 in buffer instead of the global random number generator state. 18294 18295 Before it is used, buffer must be initialized, for example, by 18296 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 18297 it with zeroes. 18298 18299 openat64 18300 18301 Name 18302 18303 openat64 -- open a file relative to a directory file descriptor 18304 (Large File Support) 18305 18306 Synopsis 18307 18308 #include 18309 18310 int openat64(int fd, const char * path, int oflag, ...); 18311 18312 Description 18313 18314 openat64() shall establish a connection between a file and a 18315 file descriptor. It shall be identical open64() except in the 18316 case where path specifies a relative path. In this case, the 18317 file to be opened shall be determined relative to the directory 18318 associated with the file descriptor fd instead of the current 18319 working directory. 18320 18321 openat64() is a large-file version of the openat() function as 18322 defined in POSIX 1003.1-2008 (ISO/IEC 9945-2009). It differs 18323 from openat() in the same way that open64() differs from 18324 open(), that the open is done in large-file mode. 18325 18326 Return Value 18327 18328 On success, openat64() returns a new file descriptor. Otherwise 18329 openat64() shall return -1 and set errno to indicate the error. 18330 18331 Errors 18332 18333 See openat() for possible error values. 18334 18335 pmap_getport 18336 18337 Name 18338 18339 pmap_getport -- find the port number assigned to a service 18340 registered with a portmapper. 18341 18342 Synopsis 18343 18344 #include 18345 18346 u_short * pmap_getport(struct sockaddr_in * address, const 18347 u_long program, const u_long * version, u_int protocol); 18348 18349 Description 18350 18351 The pmap_getport() function shall return the port number 18352 assigned to a service registered with a RPC Binding service 18353 running on a given target system, using the protocol described 18354 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 18355 pmap_getport() function shall be called given the RPC program 18356 number program, the program version version, and transport 18357 protocol protocol. Conforming implementations shall support 18358 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 18359 shall specify the address of the system on which the portmapper 18360 to be contacted resides. The value of address->sin_port shall 18361 be ignored, and the standard value for the portmapper port 18362 shall always be used. 18363 18364 Note: Security and network restrictions may prevent a 18365 conforming application from contacting a remote RPC Binding 18366 Service. 18367 18368 Return Value 18369 18370 On success, the pmap_getport() function shall return the port 18371 number in host byte order of the RPC application registered 18372 with the remote portmapper. On failure, if either the program 18373 was not registered or the remote portmapper service could not 18374 be reached, the pmap_getport() function shall return 0. If the 18375 remote portmap service could not be reached, the status is left 18376 in the global variable rpc_createerr. 18377 18378 pmap_set 18379 18380 Name 18381 18382 pmap_set -- establishes mapping to machine's RPC Bind service. 18383 18384 Synopsis 18385 18386 #include 18387 18388 bool_t pmap_set(const u_long program, const u_long version, int 18389 protocol, u_short port); 18390 18391 Description 18392 18393 pmap_set() establishes a mapping between the triple 18394 [program,version,protocol] and port on the machine's RPC Bind 18395 service. The value of protocol is most likely IPPROTO_UDP or 18396 IPPROTO_TCP. Automatically done by svc_register(). 18397 18398 Return Value 18399 18400 pmap_set() returns non-zero if it suceeds, 0 otherwise. 18401 18402 pmap_unset 18403 18404 Name 18405 18406 pmap_unset -- destroys RPC Binding 18407 18408 Synopsis 18409 18410 #include 18411 18412 bool_t pmap_unset(u_long prognum, u_long versnum); 18413 18414 Description 18415 18416 As a user interface to the RPC Bind service, pmap_unset() 18417 destroys all mapping between the triple [prognum,versnum, *] 18418 and ports on the machine's RPC Bind service. 18419 18420 Return Value 18421 18422 pmap_unset() returns non-zero if it succeeds, zero otherwise. 18423 18424 posix_fadvise64 18425 18426 Name 18427 18428 posix_fadvise64 -- File advisory information (Large File 18429 Support) 18430 18431 Synopsis 18432 18433 #include 18434 18435 int posix_fadvise64(int fd, off64_t offset, off64_t len, int 18436 advice); 18437 18438 Description 18439 18440 The posix_fadvise64() function is a large-file version of the 18441 posix_fadvise() function defined in POSIX 1003.1-2001 (ISO/IEC 18442 9945-2003). It shall advise the implementation on the expected 18443 behavior of the application with respect to the data in the 18444 file associated with the open file descriptor, fd, starting at 18445 offset and continuing for len bytes. The specified range need 18446 not currently exist in the file. If len is zero, all data 18447 following offset is specified. The implementation may use this 18448 information to optimize handling of the specified data. The 18449 posix_fadvise() function shall have no effect on the semantics 18450 of other operations on the specified data, although it may 18451 affect the performance of other operations. 18452 18453 The advice to be applied to the data is specified by the advice 18454 parameter, as specified in posix_fadvise(). 18455 18456 Return Value 18457 18458 On success, posix_fadvise64() shall return 0. Otherwise an 18459 error number shall be returned to indicate the error. See 18460 posix_fadvise() for possible error values. 18461 18462 posix_fallocate64 18463 18464 Name 18465 18466 posix_fallocate64 -- file space control (Large File Support) 18467 18468 Synopsis 18469 18470 #include 18471 18472 int posix_fallocate64(int fd, off64_t offset, off64_t len); 18473 18474 Description 18475 18476 The posix_fallocate64() function is a large file version of 18477 posix_fallocate(). It shall behave as posix_fallocate() in 18478 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except that the offset 18479 and len arguments are off64_t objects rather than off_t. 18480 18481 Return Value 18482 18483 See posix_fallocate(). 18484 18485 Errors 18486 18487 See posix_fallocate(). 18488 18489 pread64 18490 18491 Name 18492 18493 pread64 -- read from a file (Large File Support) 18494 18495 Synopsis 18496 18497 #include 18498 18499 ssize_t pread64(int fd, void * buf, size_t count, off64_t 18500 offset); 18501 18502 Description 18503 18504 pread64() shall read count bytes into buf from the file 18505 associated with the open file descriptor fd, at the position 18506 specified by offset, without changing the file position. 18507 18508 pread64() is a large-file version of the pread() function as 18509 defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003). It differs 18510 from pread() in that the offset parameter is an off64_t instead 18511 of an off_t 18512 18513 Return Value 18514 18515 On success, pread64() shall return the number of bytes actually 18516 read. Otherwise pread64() shall return -1 and set errno to 18517 indicate the error. 18518 18519 Errors 18520 18521 See pread() for possible error values. 18522 18523 psignal 18524 18525 Name 18526 18527 psignal -- print signal message 18528 18529 Synopsis 18530 18531 #include 18532 18533 void psignal(int sig, const char * s); 18534 18535 extern const char *const sys_siglist[] 18536 18537 Description 18538 18539 The psignal() function shall display a message on the stderr 18540 stream. If s is not the null pointer, and does not point to an 18541 empty string (e.g. "\0"), the message shall consist of the 18542 string s, a colon, a space, and a string describing the signal 18543 number sig; otherwise psignal() shall display only a message 18544 describing the signal number sig. If sig is invalid, the 18545 message displayed shall indicate an unknown signal. 18546 18547 The array sys_siglist holds the signal description strings 18548 indexed by signal number. 18549 18550 Return Value 18551 18552 psignal() returns no value. 18553 18554 ptrace 18555 18556 Name 18557 18558 ptrace -- process trace 18559 18560 Synopsis 18561 18562 #include 18563 18564 long ptrace(enum __ptrace_request request, pid_t pid, void * 18565 addr, void * data); 18566 18567 Description 18568 18569 The ptrace() system call shall enable a process to observe and 18570 control the execution of another process, as well as examine 18571 and change certain attributes of that process. 18572 18573 This function operates via requests, which act on the traced 18574 process using the other parameters in ways unique to each 18575 request type. The tracing process must initiate tracing, either 18576 via the PTRACE_TRACEME or PTRACE_ATTACH requests, before other 18577 requests may be performed. Except for PTRACE_TRACEME and 18578 PTRACE_KILL, all requests must be performed on a traced process 18579 that has been stopped. 18580 18581 All signals, except one, delivered to the traced process cause 18582 it to stop, irrespective of its registered signal handling, and 18583 cause an event to be delivered to the tracing process which can 18584 be detected using the wait(2) system call. The exception is the 18585 SIGKILL signal, which is delivered immediately and performs its 18586 usual specified behavior. 18587 18588 The following requests are defined: 18589 18590 PTRACE_TRACEME 18591 This request initates a trace from the perspective of 18592 the traced process, indicating that the parent of the 18593 current process shall be the tracing process. When this 18594 is called, a subsequent call to execve(2) shall cause 18595 the tracing process to receive a SIGTRAP signal, and 18596 shall stop the current process. This is the only request 18597 a traced process may perform, and a tracing process may 18598 not perform this request. The other parameters are 18599 ignored. 18600 18601 PTRACE_ATTACH 18602 This request initates a trace from the perspective of 18603 the tracing process on the process specified by pid. 18604 After this call succeeds, the traced process will appear 18605 to be a child of the tracing process, although the 18606 original parent will still be returned to the traced 18607 process via getppid(2). The traced process will receive 18608 a SIGSTOP signal; the tracing process should use wait(2) 18609 to ensure that the traced process has stopped. A tracing 18610 process is only guaranteed to be able to trace its child 18611 processes; the tracing of other processes may not be 18612 allowed by the system, and the process with process ID 1 18613 may not be traced under any circumstances. The addr and 18614 data parameters are ignored. 18615 18616 PTRACE_CONT 18617 This request restarts a traced process, given in pid, 18618 which has been stopped. The data parameter may point to 18619 a signal ID to deliver to the traced process; if it is 18620 zero or SIGSTOP, no signal is delivered to the child. 18621 The addr is ignored. 18622 18623 PTRACE_DETACH 18624 This request performs the same function, in the same 18625 way, as PTRACE_CONT, except that the tracing 18626 relationship between the tracing and traced processes is 18627 also undone. If the trace was initiated using 18628 PTRACE_ATTACH, the original parent-child relationships 18629 that existed beforehand are restored. 18630 18631 PTRACE_KILL 18632 This request causes a SIGKILL signal to be sent to the 18633 traced process specified in pid. The addr and data 18634 parameters are ignored. 18635 18636 PTRACE_PEEKTEXT 18637 This request reads a word at the location addr of the 18638 traced process pid, and returns it to the caller. The 18639 data parameter is ignored. 18640 18641 PTRACE_PEEKDATA 18642 This request performs identically to the PTRACE_PEEKTEXT 18643 request. 18644 18645 PTRACE_PEEKUSER 18646 This request reads a word at offset addr in the USER 18647 area of the traced process pid. The offset must be 18648 word-aligned. The data parameter is ignored. 18649 18650 PTRACE_POKETEXT 18651 This request writes the word pointed at by data to the 18652 location addr of the traced process pid. 18653 18654 PTRACE_POKEDATA 18655 This request performs identically to the PTRACE_POKETEXT 18656 request. 18657 18658 PTRACE_POKEUSER 18659 This request writes the word pointed at by data to 18660 offset addr in the USER area of the traced process pid. 18661 The offset must be word-aligned. Implementations may 18662 choose to disallow some modifications to the USER area. 18663 18664 PTRACE_GETREGS 18665 This request copies the general purpose registers from 18666 the traced process pid to the tracing process at 18667 location data. This parameter may not be available on 18668 all architectures. The addr parameter is ignored. 18669 18670 PTRACE_GETFPREGS 18671 This request copies the floating point registers from 18672 the traced process pid to the tracing process at 18673 location data. This parameter may not be available on 18674 all architectures. The addr parameter is ignored. 18675 18676 PTRACE_SETREGS 18677 This request writes the general purpose registers to the 18678 traced process pid from the tracing process at location 18679 data. This parameter may not be available on all 18680 architectures. Implementations may choose to disallow 18681 some register modifications. The addr parameter is 18682 ignored. 18683 18684 PTRACE_SETFPREGS 18685 This request writes the floating point registers to the 18686 traced process pid from the tracing process at location 18687 data. This parameter may not be available on all 18688 architectures. Implementations may choose to disallow 18689 some register modifications. The addr parameter is 18690 ignored. 18691 18692 PTRACE_GETSIGINFO 18693 This request writes information about the signal which 18694 caused the traced process pid to stop to the tracing 18695 process at location data, as a siginfo_t. The addr 18696 parameter is ignored. 18697 18698 PTRACE_SETSIGINFO 18699 This request writes signal information to the traced 18700 process pid from a siginfo_t structure pointed at by 18701 data, such that it will be used as the signal 18702 information by the traced process when it is resumed. 18703 The addr parameter is ignored. 18704 18705 PTRACE_GETEVENTMSG 18706 This request stores information about the most recent 18707 ptrace event for the traced process pid in the unsigned 18708 long pointed at by data. For PTRACE_EVENT_EXIT, this is 18709 the exit status of the traced process. For 18710 PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, or 18711 PTRACE_EVENT_CLONE, this is the PID of the newly created 18712 process. The addr parameter is ignored. 18713 18714 PTRACE_SYSCALL 18715 This request performs the same function, in the same 18716 way, as PTRACE_CONT, but with the additional step of 18717 causing the traced process to stop at the next entry to 18718 or exit from a system call. The usual events that would 18719 also cause the traced process to stop continue to do so. 18720 18721 PTRACE_SINGLESTEP 18722 This request performs the same function, in the same 18723 way, as PTRACE_CONT, but with the additional step of 18724 causing the traced process to stop after execution of a 18725 single instruction. The usual events that would also 18726 cause the traced process to stop continue to do so. 18727 18728 PTRACE_SYSEMU 18729 This request performs the same function, in the same 18730 way, as PTRACE_CONT, but with the additional step of 18731 causing the traced process to stop on entry to the next 18732 syscall, which will then not be executed. 18733 18734 PTRACE_SYSEMU_SINGLESTEP 18735 This request performs the same function, in the same 18736 way, as PTRACE_CONT, but with the additional step of 18737 causing the traced process to stop on entry to the next 18738 syscall, which will then not be executed. If the next 18739 instruction is not itself a syscall, the traced process 18740 will stop after a single instruction is executed. 18741 18742 PTRACE_SETOPTIONS 18743 This request sets ptrace() options for the traced 18744 process pid from the location pointed to by data. The 18745 addr is ignored. This location is interpreted as a 18746 bitmask of options, as defined by the following flags: 18747 18748 PTRACE_O_TRACESYSGOOD 18749 This option, when set, causes syscall traps to set 18750 bit 7 in the signal number. 18751 18752 PTRACE_O_TRACEFORK 18753 This option, when set, causes the traced process 18754 to stop when it calls fork(2). The original traced 18755 process will stop with SIGTRAP | PTRACE_EVENT_FORK 18756 << 8, and the new process will be stopped with 18757 SIGSTOP. The new process will also be traced by 18758 the tracing process, as if the tracing process had 18759 sent the PTRACE_ATTACH request for that process. 18760 The PID of the new process may be retrieved with 18761 the PTRACE_GETEVENTMSG request. 18762 18763 PTRACE_O_TRACEVFORK 18764 This option, when set, causes the traced process 18765 to stop when it calls vfork(2). The original 18766 traced process will stop with SIGTRAP | 18767 PTRACE_EVENT_VFORK << 8, and the new process will 18768 be stopped with SIGSTOP. The new process will also 18769 be traced by the tracing process, as if the 18770 tracing process had sent the PTRACE_ATTACH request 18771 for that process. The PID of the new process may 18772 be retrieved with the PTRACE_GETEVENTMSG request. 18773 18774 PTRACE_O_TRACECLONE 18775 This option, when set, causes the traced process 18776 to stop when it calls clone(2). The original 18777 traced process will stop with SIGTRAP | 18778 PTRACE_EVENT_CLONE << 8, and the new process will 18779 be stopped with SIGSTOP. The new process will also 18780 be traced by the tracing process, as if the 18781 tracing process had sent the PTRACE_ATTACH request 18782 for that process. The PID of the new process may 18783 be retrieved with the PTRACE_GETEVENTMSG request. 18784 Under certain circumstances, clone(2) calls by the 18785 traced process will generate events and 18786 information consistent with the 18787 PTRACE_O_TRACEVFORK or PTRACE_O_TRACEFORK options 18788 above. 18789 18790 PTRACE_O_TRACEEXEC 18791 This option, when set, causes the traced process 18792 to stop when it calls execve(2). The traced 18793 process will stop with SIGTRAP | PTRACE_EVENT_EXEC 18794 << 8. 18795 18796 PTRACE_O_TRACEVFORKDONE 18797 This option, when set, causes the traced process 18798 to stop at the completion of its next vfork(2) 18799 call. The traced process will stop with SIGTRAP | 18800 PTRACE_EVENT_EXEC << 8. 18801 18802 PTRACE_O_TRACEEXIT 18803 This option, when set, causes the traced process 18804 to stop upon exit. The traced process will stop 18805 with SIGTRAP | PTRACE_EVENT_EXIT << 8, and its 18806 exit status can be retrieved with the 18807 PTRACE_GETEVENTMSG request. The stop is guaranteed 18808 to be early in the process exit process, meaning 18809 that information such as register status at exit 18810 is preserved. Upon continuing, the traced process 18811 will immediately exit. 18812 18813 Return Value 18814 18815 On success, ptrace() shall return the requested data for 18816 PTRACE_PEEK requests, or zero for all other requests. On error, 18817 all requests return -1, with errno set to an appropriate value. 18818 Note that -1 may be a valid return value for PTRACE_PEEK 18819 requests; the application is responsible for distinguishing 18820 between an error condition and a valid return value in that 18821 case. 18822 18823 Errors 18824 18825 On error, ptrace() shall set errno to one of the regular error 18826 values below: 18827 18828 EBUSY 18829 18830 An error occurred while allocating or freeing a debug register. 18831 EFAULT 18832 18833 The request attempted to read from or write to an invalid area 18834 in the memory space of the tracing or traced process. 18835 EIO 18836 18837 The request was invalid, or it attempted to read from or write 18838 to an invalid area in the memory space of the tracing or traced 18839 process, or it violated a word-alignment boundary, or an 18840 invalid signal was given to continue the traced process. 18841 EINVAL 18842 18843 An attempt was made to set an invalid option. 18844 EPERM 18845 18846 The request to trace a process was denied by the system. 18847 ESRCH 18848 18849 The process requested does not exist, is not being traced by 18850 the current process, or is not stopped. 18851 18852 putwc_unlocked 18853 18854 Name 18855 18856 putwc_unlocked -- non-thread-safe putwc 18857 18858 Description 18859 18860 putwc_unlocked() is the same as putwc(), except that it need 18861 not be thread-safe. That is, it may only be invoked in the ways 18862 which are legal for getc_unlocked(). 18863 18864 putwchar_unlocked 18865 18866 Name 18867 18868 putwchar_unlocked -- non-thread-safe putwchar 18869 18870 Description 18871 18872 putwchar_unlocked() is the same as putwchar(), except that it 18873 need not be thread-safe. That is, it may only be invoked in the 18874 ways which are legal for getc_unlocked(). 18875 18876 pwrite64 18877 18878 Name 18879 18880 pwrite64 -- write on a file (Large File Support) 18881 18882 Synopsis 18883 18884 #include 18885 18886 ssize_t pwrite64(int fd, const void * buf, size_t count, 18887 off64_t offset); 18888 18889 Description 18890 18891 pwrite64() shall write count bytes from buf to the file 18892 associated with the open file descriptor fd, at the position 18893 specified by offset, without changing the file position. 18894 18895 pwrite64() is a large-file version of the pwrite() function as 18896 defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003). It differs 18897 from pwrite() in that the offset parameter is an off64_t 18898 instead of an off_t 18899 18900 Return Value 18901 18902 On success, pwrite64() shall return the number of bytes 18903 actually written. Otherwise pwrite() shall return -1 and set 18904 errno to indicate the error. 18905 18906 Errors 18907 18908 See pwrite() for possible error values. 18909 18910 random_r 18911 18912 Name 18913 18914 random_r -- reentrantly generate pseudorandom numbers in a 18915 uniform distribution 18916 18917 Synopsis 18918 18919 #include 18920 18921 int random_r(struct random_data * buffer, int32_t * result); 18922 18923 Description 18924 18925 The interface random_r() shall function in the same way as the 18926 interface random(), except that random_r() shall use the data 18927 in buffer instead of the global random number generator state. 18928 18929 Before it is used, buffer must be initialized, for example, by 18930 calling lcong48_r(), seed48_r(), or srand48_r(), or by filling 18931 it with zeroes. 18932 18933 readdir64_r 18934 18935 Name 18936 18937 readdir64_r -- read a directory (Large File Support) 18938 18939 Synopsis 18940 18941 #include 18942 18943 int readdir64_r(DIR * dirp, struct dirent64 * entry, struct 18944 dirent64 * * result); 18945 18946 Description 18947 18948 The readdir64_r() function is a large file version of 18949 readdir_r(). It shall behave as readdir_r() in POSIX 18950 1003.1-2001 (ISO/IEC 9945-2003), except that the entry and 18951 result arguments are dirent64 structures rather than dirent. 18952 18953 Return Value 18954 18955 See readdir_r(). 18956 18957 Errors 18958 18959 See readdir_r(). 18960 18961 regexec 18962 18963 Name 18964 18965 regexec -- regular expression matching 18966 18967 Description 18968 18969 The regexec() function shall behave as specified in POSIX 18970 1003.1-2001 (ISO/IEC 9945-2003), except with differences as 18971 listed below. 18972 18973 Differences 18974 18975 Certain aspects of regular expression matching are optional; 18976 see Regular Expressions. 18977 18978 scandir64 18979 18980 Name 18981 18982 scandir64 -- scan a directory (Large File Support) 18983 18984 Synopsis 18985 18986 #include 18987 18988 int scandir64(const char * dir, const struct dirent64 ** 18989 namelist, int (*sel) (const struct dirent64 *), int (*compar) 18990 (const struct dirent64 **, const struct dirent64 **)); 18991 18992 Description 18993 18994 scandir64() is a large-file version of the scandir() function 18995 as defined in POSIX 1003.1-2008 (ISO/IEC 9945-2009). If differs 18996 only in that the namelist and the paramters to the selection 18997 function sel and comparison function compar are of type 18998 dirent64 instead of type dirent. 18999 19000 scanf 19001 19002 Name 19003 19004 scanf -- convert formatted input 19005 19006 Description 19007 19008 The scanf() family of functions shall behave as described in 19009 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 19010 19011 Differences 19012 19013 The %s, %S and %[ conversion specifiers shall accept an option 19014 length modifier a, which shall cause a memory buffer to be 19015 allocated to hold the string converted. In such a case, the 19016 argument corresponding to the conversion specifier should be a 19017 reference to a pointer value that will receive a pointer to the 19018 allocated buffer. If there is insufficient memory to allocate a 19019 buffer, the function may set errno to ENOMEM and a conversion 19020 error results. 19021 19022 Note: This directly conflicts with the ISO C (1999) usage of 19023 %a as a conversion specifier for hexadecimal float values. 19024 While this conversion specifier should be supported, a 19025 format specifier such as "%aseconds" will have a different 19026 meaning on an LSB conforming system. 19027 19028 sched_getaffinity 19029 19030 Name 19031 19032 sched_getaffinity -- retrieve the affinity mask of a process 19033 19034 Synopsis 19035 19036 #include 19037 19038 int sched_getaffinity(pid_t pid, unsigned int cpusetsize, 19039 cpu_set_t * mask); 19040 19041 Description 19042 19043 sched_getaffinity() shall retrieve the affinity mask of a 19044 process. 19045 19046 The parameter pid specifies the ID for the process. If pid is 19047 0, then the calling process is specified instead. 19048 19049 The parameter cpusetsize specifies the length of the data 19050 pointed to by mask, in bytes. Normally, this parameter is 19051 specified as sizeof(cpu_set_t). 19052 19053 Return Value 19054 19055 On success, sched_getaffinity() shall return 0, and the 19056 structure pointed to by mask shall contain the affinity mask of 19057 the specified process. 19058 19059 On failure, sched_getaffinity() shall return -1 and set errno 19060 as follows. 19061 19062 Errors 19063 19064 EFAULT 19065 19066 Bad address. 19067 EINVAL 19068 19069 mask does not specify any processors that exist in the system, 19070 or cpusetsize is smaller than the kernel's affinity mask. 19071 ESRCH 19072 19073 The specified process could not be found. 19074 19075 See Also 19076 19077 sched_setscheduler(), sched_setaffinity(). 19078 19079 sched_setaffinity 19080 19081 Name 19082 19083 sched_setaffinity -- set the CPU affinity mask for a process 19084 19085 Synopsis 19086 19087 #include 19088 19089 int sched_setaffinity(pid_t pid, unsigned int cpusetsize, 19090 cpu_set_t * mask); 19091 19092 Description 19093 19094 sched_setaffinity() shall set the CPU affinity mask for a 19095 process. 19096 19097 The parameter pid specifies the ID for the process. If pid is 19098 0, then the calling process is specified instead. 19099 19100 The parameter cpusetsize specifies the length of the data 19101 pointed to by mask, in bytes. Normally, this parameter is 19102 specified as sizeof(cpu_set_t). 19103 19104 The parameter mask specifies the new value for the CPU affinity 19105 mask. The structure pointed to by mask represents the set of 19106 CPUs on which the process may run. If mask does not specify one 19107 of the CPUs on which the specified process is currently 19108 running, then sched_setaffinity() shall migrate the process to 19109 one of those CPUs. 19110 19111 Setting the mask on a multiprocessor system can improve 19112 performance. For example, setting the mask for one process to 19113 specify a particular CPU, and then setting the mask of all 19114 other processes to exclude the CPU, dedicates the CPU to the 19115 process so that the process runs as fast as possible. This 19116 technique also prevents loss of performance in case the process 19117 terminates on one CPU and starts again on another, invalidating 19118 cache. 19119 19120 Return Value 19121 19122 On success, sched_setaffinity() shall return 0. 19123 19124 On failure, sched_setaffinity() shall return -1 and set errno 19125 as follows. 19126 19127 Errors 19128 19129 EFAULT 19130 19131 Bad address. 19132 EINVAL 19133 19134 mask does not specify any processors that exist in the system, 19135 or cpusetsize is smaller than the kernel's affinity mask. 19136 EPERM 19137 19138 Insufficient privileges. The effective user ID of the process 19139 calling sched_setaffinity() is not equal to the user ID or 19140 effective user ID of the specified process, and the calling 19141 process does not have appropriate privileges. 19142 ESRCH 19143 19144 The specified process could not be found. 19145 19146 See Also 19147 19148 sched_setscheduler(), sched_getaffinity(). 19149 19150 sched_setscheduler 19151 19152 Name 19153 19154 sched_setscheduler -- set scheduling policy and parameters 19155 19156 Synopsis 19157 19158 #include 19159 19160 int sched_setscheduler(pid_t pid, int policy, const struct 19161 sched_param * param); 19162 19163 Description 19164 19165 The sched_setscheduler() shall behave as described in POSIX 19166 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 19167 19168 Return Value 19169 19170 On success, 0 is returned instead of the former scheduling 19171 policy. 19172 19173 seed48_r 19174 19175 Name 19176 19177 seed48_r -- reentrantly generate pseudorandom numbers in a 19178 uniform distribution 19179 19180 Synopsis 19181 19182 #include 19183 19184 int seed48_r(unsigned short[3] seed16v, struct drand48_data * 19185 buffer); 19186 19187 Description 19188 19189 The interface seed48_r() shall function in the same way as the 19190 interface seed48(), except that seed48_r() shall use the data 19191 in buffer instead of the global random number generator state. 19192 19193 sendfile 19194 19195 Name 19196 19197 sendfile -- transfer data between two file descriptors 19198 19199 Synopsis 19200 19201 #include 19202 19203 ssize_t sendfile(int out_fd, int in_fd, off_t * offset, size_t 19204 count); 19205 19206 Description 19207 19208 The sendfile() function shall copy data between the file 19209 descriptor in_fd, which must not be a socket, and the file 19210 descriptor out_fd, which must be a socket. in_fd should be 19211 opened for reading, and out_fd should be opened for writing. 19212 19213 The offset parameter points to a variable set to the file 19214 offset at which sendfile() shall start reading from in_fd, 19215 unless it is NULL. On exit, this variable shall contain the 19216 offset of the byte immediately after the last byte read. 19217 sendfile() shall not change the current file offset of in_fd, 19218 unless it is NULL. In that case, sendfile() shall adjust the 19219 current file offset to show how many bytes were read. 19220 19221 The count parameter specifies how many bytes to copy. 19222 19223 Return Value 19224 19225 On success, sendfile() shall return the number of bytes written 19226 to out_fd. 19227 19228 On failure, sendfile() shall return -1 and set errno 19229 appropriately, as follows. 19230 19231 Errors 19232 19233 EAGAIN 19234 19235 Non-blocking I/O with O_NONBLOCK has been chosen, but the write 19236 would block. 19237 EBADF 19238 19239 The input file is not open for reading, or the output file is 19240 not open for writing. 19241 EFAULT 19242 19243 Bad address. 19244 EINVAL 19245 19246 An mmap()-like operation is unavailable for in_fd, or file 19247 descriptor is locked or invalid. 19248 EIO 19249 19250 There was an unspecified error while reading. 19251 ENOMEM 19252 19253 There is not enough memory to read from in_fd. 19254 19255 Notes 19256 19257 sendfile() is usually faster than combining read() and write() 19258 calls, because it is part of the kernel. However, if it fails 19259 with EINVAL, falling back to read() and write() may be 19260 advisable. 19261 19262 It is advisable for performance reasons to use the TCP_CORK 19263 option of the tcp() function when sending header data with file 19264 contents to a TCP socket. This minimizes the number of packets. 19265 19266 See Also 19267 19268 mmap(), open(), socket(), splice(). 19269 19270 sendfile64 19271 19272 Name 19273 19274 sendfile64 -- transfer data between two file descriptors (Large 19275 File Support) 19276 19277 Synopsis 19278 19279 #include 19280 19281 ssize_t sendfile64(int out_fd, int in_fd, off64_t * offset, 19282 size_t count); 19283 19284 Description 19285 19286 The sendfile64() function is a large-file version of the 19287 sendfile() function. 19288 19289 setbuffer 19290 19291 Name 19292 19293 setbuffer -- stream buffering operation 19294 19295 Synopsis 19296 19297 #include 19298 19299 void setbuffer(FILE * stream, char * buf, size_t size); 19300 19301 Description 19302 19303 setbuffer() is an alias for the call to setvbuf(). It works the 19304 same, except that the size of the buffer in setbuffer() is up 19305 to the caller, rather than being determined by the default 19306 BUFSIZ. 19307 19308 setgroups 19309 19310 Name 19311 19312 setgroups -- set list of supplementary group IDs 19313 19314 Synopsis 19315 19316 #include 19317 19318 int setgroups(size_t size, const gid_t * list); 19319 19320 Description 19321 19322 If the process has appropriate privilege, the setgroups() 19323 function shall set the supplementary group IDs for the current 19324 process. list shall reference an array of size group IDs. A 19325 process may have at most NGROUPS_MAX supplementary group IDs. 19326 19327 Return Value 19328 19329 On successful completion, 0 is returned. On error, -1 is 19330 returned and the errno is set to indicate the error. 19331 19332 Errors 19333 19334 EFAULT 19335 19336 list has an invalid address. 19337 EPERM 19338 19339 The process does not have appropriate privileges. 19340 EINVAL 19341 19342 size is greater than NGROUPS_MAX. 19343 19344 sethostname 19345 19346 Name 19347 19348 sethostname -- set host name 19349 19350 Synopsis 19351 19352 #include 19353 #include 19354 #include 19355 19356 int sethostname(const char * name, size_t len); 19357 19358 Description 19359 19360 If the process has appropriate privileges, the sethostname() 19361 function shall change the host name for the current machine. 19362 The name shall point to a null-terminated string of at most len 19363 bytes that holds the new hostname. 19364 19365 If the symbol HOST_NAME_MAX is defined, or if 19366 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 19367 this value shall represent the maximum length of the new 19368 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 19369 value shall represent the maximum length for the new hostname. 19370 If none of these values are defined, the maximum length shall 19371 be the size of the nodename field of the utsname structure. 19372 19373 Return Value 19374 19375 On success, 0 is returned. On error, -1 is returned and the 19376 global variable errno is set appropriately. 19377 19378 Errors 19379 19380 EINVAL 19381 19382 len is negative or larger than the maximum allowed size. 19383 EPERM 19384 19385 the process did not have appropriate privilege. 19386 EFAULT 19387 19388 name is an invalid address. 19389 19390 Rationale 19391 19392 POSIX 1003.1-2001 (ISO/IEC 9945-2003) guarantees that: 19393 19394 Maximum length of a host name (not including the terminating 19395 null) as returned from the gethostname() function shall be 19396 at least 255 bytes. 19397 19398 The glibc C library does not currently define HOST_NAME_MAX, 19399 and although it provides the name _SC_HOST_NAME_MAX a call to 19400 sysconf() returns -1 and does not alter errno in this case 19401 (indicating that there is no restriction on the hostname 19402 length). However, the glibc manual idicates that some 19403 implementations may have MAXHOSTNAMELEN as a means of detecting 19404 the maximum length, while the Linux kernel at release 2.4 and 19405 2.6 stores this hostname in the utsname structure. While the 19406 glibc manual suggests simply shortening the name until 19407 sethostname() succeeds, the LSB requires that one of the first 19408 four mechanisms works. Future versions of glibc may provide a 19409 more reasonable result from sysconf(_SC_HOST_NAME_MAX). 19410 19411 setsockopt 19412 19413 Name 19414 19415 setsockopt -- set socket options 19416 19417 Synopsis 19418 19419 #include 19420 #include 19421 19422 int setsockopt(int socket, int level, int option_name, const 19423 void * option_value, socklen_t option_len); 19424 19425 Description 19426 19427 The setsockopt() function shall behave as specified in POSIX 19428 1003.1-2001 (ISO/IEC 9945-2003), with the following extensions. 19429 19430 IP Protocol Level Options 19431 19432 If the level parameter is IPPROTO_IP, the following values 19433 shall be supported for option_name (see RFC 791:Internet 19434 Protocol for further details): 19435 19436 IP_OPTIONS 19437 19438 Set the Internet Protocol options sent with every packet from 19439 this socket. The option_value shall point to a memory buffer 19440 containing the options and option_len shall contain the size in 19441 bytes of that buffer. For IPv4, the maximum length of options 19442 is 40 bytes. 19443 IP_TOS 19444 19445 Set the Type of Service flags to use when sending packets with 19446 this socket. The option_value shall point to a value containing 19447 the type of service value. The least significant two bits of 19448 the value shall contain the new Type of Service indicator. Use 19449 of other bits in the value is unspecified. The option_len 19450 parameter shall hold the size, in bytes, of the buffer referred 19451 to by option_value. 19452 IP_TTL 19453 19454 Set the current unicast Internet Protocol Time To Live value 19455 used when sending packets with this socket. The option_value 19456 shall point to a value containing the time to live value, which 19457 shall be between 1 and 255. The option_len parameter shall hold 19458 the size, in bytes, of the buffer referred to by option_value. 19459 IP_MULTICAST_TTL 19460 19461 Sets the Time To Live value of outgoing multicast packets for 19462 this socket. optval shall point to an integer which contains 19463 the new TTL value. If the new TTL value is -1, the 19464 implementation should use an unspecified default TTL value. If 19465 the new TTL value is out of the range of acceptable values 19466 (0-255), setsockopt() shall return -1 and set errno to indicate 19467 the error. 19468 IP_MULTICAST_LOOP 19469 19470 Sets a boolean flag indicating whether multicast packets 19471 originating locally should be looped back to the local sockets. 19472 optval shall point to an integer which contains the new flag 19473 value. 19474 IP_ADD_MEMBERSHIP 19475 19476 Join a multicast group. optval shall point to a ip_mreq 19477 structure. Before calling, the caller should fill in the 19478 imr_multiaddr field with the multicast group address and the 19479 imr_address field with the address of the local interface. If 19480 imr_address is set to INADDR_ANY, then an appropriate interface 19481 is chosen by the system. 19482 IP_DROP_MEMBERSHIP 19483 19484 Leave a multicast group. optval shall point to a ip_mreq 19485 structure containing the same values as were used with 19486 IP_ADD_MEMBERSHIP. 19487 IP_MULTICAST_IF 19488 19489 Set the local device for a multicast socket. optval shall point 19490 to either an ip_mreqn structure or an in_addr structure. If 19491 using the ip_mreqn structure, the imr_multiaddr field should be 19492 set to multicast group address, the imr_address field to the 19493 address of the local interface, and the imr_index field to the 19494 interface index. If using the in_addr structure, the address of 19495 the local interface shall be specified. If in_addr or 19496 imr_address is set to INADDR_ANY, then an appropriate interface 19497 is chosen by the system. If imr_index is zero, then an 19498 appropriate interface index is chosen by the implementation. 19499 19500 The ip_mreq structure contains two struct in_addr fields: 19501 imr_multiaddr and imr_address. 19502 19503 Return Value 19504 19505 On success, 0 is returned. On error, -1 is returned and the 19506 global variable errno is set appropriately. 19507 19508 Errors 19509 19510 As defined in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 19511 19512 setstate_r 19513 19514 Name 19515 19516 setstate_r -- reentrantly change the state array used by random 19517 number generator functions 19518 19519 Synopsis 19520 19521 #include 19522 19523 int setstate_r(char * statebuf, struct random_data * buf); 19524 19525 Description 19526 19527 The interface setstate_r() shall function in the same way as 19528 the interface setstate(), except that setstate_r() shall use 19529 the data in statebuf instead of the global random number 19530 generator state. 19531 19532 setutent 19533 19534 Name 19535 19536 setutent -- access user accounting database entries 19537 19538 Synopsis 19539 19540 #include 19541 19542 void setutent(void); 19543 19544 Description 19545 19546 The setutent() function shall reset the user accounting 19547 database such that the next call to getutent() shall return the 19548 first record in the database. It is recommended to call it 19549 before any of the other functions that operate on the user 19550 accounting databases (e.g. getutent()) 19551 19552 Return Value 19553 19554 None. 19555 19556 sigandset 19557 19558 Name 19559 19560 sigandset -- build a new signal set by combining the two input 19561 sets using logical AND 19562 19563 Synopsis 19564 19565 #include 19566 19567 int sigandset(sigset_t * set, const sigset_t * left, const 19568 sigset_t * right); 19569 19570 Description 19571 19572 The sigandset() function shall combine the two signal sets 19573 referenced by left and right, using a logical AND operation, 19574 and shall place the result in the location referenced by set, 19575 The resulting signal set shall contain only signals that are in 19576 both the set referenced by left and the set referenced by 19577 right. 19578 19579 Applications shall call sigemptyset() or sigfillset() at least 19580 once for each object of type sigset_t to initialize it. If an 19581 uninitialized or NULL object is passed to sigandset(), the 19582 results are undefined. 19583 19584 Return Value 19585 19586 sigandset() returns 0. There are no defined error returns. 19587 19588 See Also 19589 19590 sigorset() 19591 19592 sigisemptyset 19593 19594 Name 19595 19596 sigisemptyset -- check for empty signal set 19597 19598 Synopsis 19599 19600 #include 19601 19602 int sigisemptyset(const sigset_t * set); 19603 19604 Description 19605 19606 The sigisemptyset() function shall check for empty signal set 19607 referenced by set. 19608 19609 Applications shall call sigemptyset() or sigfillset() at least 19610 once for each object of type sigset_t to initialize it. If an 19611 uninitialized or NULL object is passed to sigisemptyset(), the 19612 results are undefined. 19613 19614 Return Value 19615 19616 The sigisemptyset() function shall return a positive non-zero 19617 value if the signal set referenced by set is empty, or zero if 19618 this set is empty. There are no defined error returns. 19619 19620 sigorset 19621 19622 Name 19623 19624 sigorset -- build a new signal set by combining the two input 19625 sets using logical OR 19626 19627 Synopsis 19628 19629 #include 19630 19631 int sigorset(sigset_t * set, const sigset_t * left, const 19632 sigset_t * right); 19633 19634 Description 19635 19636 The sigorset() function shall combine the two signal sets 19637 referenced by left and right, using a logical OR operation, and 19638 shall place the result in the location referenced by set, The 19639 resulting signal set shall contain only signals that are in 19640 either the set referenced by left or the set referenced by 19641 right. 19642 19643 Applications shall call sigemptyset() or sigfillset() at least 19644 once for each object of type sigset_t to initialize it. If an 19645 uninitialized or NULL object is passed to sigorset(), the 19646 results are undefined. 19647 19648 Return Value 19649 19650 sigorset() returns 0. There are no defined error returns. 19651 19652 See Also 19653 19654 sigandset() 19655 19656 sigpause 19657 19658 Name 19659 19660 sigpause -- remove a signal from the signal mask and suspend 19661 the thread (deprecated) 19662 19663 Synopsis 19664 19665 #include 19666 19667 int sigpause(int sig); 19668 19669 Description 19670 19671 The sigpause() function is deprecated from the LSB and is 19672 expected to disappear from a future version of the LSB. 19673 Conforming applications should use sigsuspend() instead. 19674 19675 In the source standard, sigpause() is implemented as a macro 19676 causing it to behave as described in POSIX 1003.1-2001 (ISO/IEC 19677 9945-2003), and is equivalent to the function __xpg_sigpause(). 19678 If the macro is undefined, sigpause() from the binary standard 19679 is used, with differences as described here: 19680 19681 The sigpause() function shall block those signals indicated by 19682 sig and suspend execution of the thread until a signal is 19683 delivered. When a signal is delivered, the original signal mask 19684 shall be restored. 19685 19686 See Also 19687 19688 __xpg_sigpause() 19689 19690 sigreturn 19691 19692 Name 19693 19694 sigreturn -- return from signal handler and cleanup stack frame 19695 19696 Synopsis 19697 19698 int sigreturn(struct sigcontext * scp); 19699 19700 Description 19701 19702 The sigreturn() function is used by the system to cleanup after 19703 a signal handler has returned. This function is not in the 19704 source standard; it is only in the binary standard. 19705 19706 Return Value 19707 19708 sigreturn() never returns. 19709 19710 srand48_r 19711 19712 Name 19713 19714 srand48_r -- reentrantly generate pseudorandom numbers in a 19715 uniform distribution 19716 19717 Synopsis 19718 19719 #include 19720 19721 int srand48_r(long int seedval, struct drand48_data * buffer); 19722 19723 Description 19724 19725 The interface srand48_r() shall function in the same way as the 19726 interface srand48(), except that srand48_r() shall use the data 19727 in buffer instead of the global random number generator state. 19728 19729 srandom_r 19730 19731 Name 19732 19733 srandom_r -- reentrantly set the seed for a new sequence of 19734 pseudorandom numbers 19735 19736 Synopsis 19737 19738 #include 19739 19740 int srandom_r(unsigned int seed, struct random_data * buffer); 19741 19742 Description 19743 19744 The interface srandom_r() shall function in the same way as the 19745 interface srandom(), except that srandom_r() shall use the data 19746 in buffer instead of the global random number generator state. 19747 19748 sscanf 19749 19750 Name 19751 19752 sscanf -- convert formatted input 19753 19754 Description 19755 19756 The scanf() family of functions shall behave as described in 19757 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 19758 19759 Differences 19760 19761 The %s, %S and %[ conversion specifiers shall accept an option 19762 length modifier a, which shall cause a memory buffer to be 19763 allocated to hold the string converted. In such a case, the 19764 argument corresponding to the conversion specifier should be a 19765 reference to a pointer value that will receive a pointer to the 19766 allocated buffer. If there is insufficient memory to allocate a 19767 buffer, the function may set errno to ENOMEM and a conversion 19768 error results. 19769 19770 Note: This directly conflicts with the ISO C (1999) usage of 19771 %a as a conversion specifier for hexadecimal float values. 19772 While this conversion specifier should be supported, a 19773 format specifier such as "%aseconds" will have a different 19774 meaning on an LSB conforming system. 19775 19776 statfs 19777 19778 Name 19779 19780 statfs -- (deprecated) 19781 19782 Synopsis 19783 19784 #include 19785 19786 int statfs(const char *path, struct statfs *buf); 19787 19788 Description 19789 19790 The statfs() function returns information about a mounted file 19791 system. The file system is identified by path, a path name of a 19792 file within the mounted filesystem. The results are placed in 19793 the structure pointed to by 19794 19795 Fields that are undefined for a particular file system shall be 19796 set to 0. 19797 19798 Note: Application developers should use the statvfs() 19799 function to obtain general file system information. 19800 Applications should only use the statfs() function if they 19801 must determine the file system type, which need not be 19802 provided by statvfs(). 19803 19804 Return Value 19805 19806 On success, the statfs() function shall return 0 and set the 19807 fields of the structure idenfitied by buf accordingly. On 19808 error, the statfs() function shall return -1 and set errno 19809 accordingly. 19810 19811 Errors 19812 19813 ENOTDIR 19814 19815 A component of the path prefix of path is not a directory. 19816 ENAMETOOLONG 19817 19818 path is too long. 19819 ENOENT 19820 19821 The file referred to by path does not exist. 19822 EACCES 19823 19824 Search permission is denied for a component of the path prefix 19825 of path. 19826 ELOOP 19827 19828 Too many symbolic links were encountered in translating path. 19829 EFAULT 19830 19831 buf or path points to an invalid address. 19832 EIO 19833 19834 An I/O error occurred while reading from or writing to the file 19835 system. 19836 ENOMEM 19837 19838 Insufficient kernel memory was available. 19839 ENOSYS 19840 19841 The filesystem path is on does not support statfs(). 19842 19843 statfs64 19844 19845 Name 19846 19847 statfs64 -- (deprecated) 19848 19849 Synopsis 19850 19851 #include 19852 19853 int statfs64(const char * path, struct statfs64 *buf); 19854 19855 Description 19856 19857 The statfs64() function returns information about a mounted 19858 file system. The file system is identified by path, a path name 19859 of a file within the mounted filesystem. The results are placed 19860 in the structure pointed to by buf. 19861 19862 statfs64() is a large-file version of the statfs() function. 19863 19864 Fields that are undefined for a particular file system shall be 19865 set to 0. 19866 19867 Note: Application developers should use the statvfs64() 19868 function to obtain general file system information. 19869 Applications should only use the statfs64() function if they 19870 must determine the file system type, which need not be 19871 provided by statvfs64(). 19872 19873 Return Value 19874 19875 On success, the statfs64() function shall return 0 and set the 19876 fields of the structure idenfitied by buf accordingly. On 19877 error, the statfs64() function shall return -1 and set errno 19878 accordingly. 19879 19880 Errors 19881 19882 See fstatfs(). 19883 19884 stime 19885 19886 Name 19887 19888 stime -- set time 19889 19890 Synopsis 19891 19892 #define _SVID_SOURCE 19893 #include 19894 19895 int stime(const time_t * t); 19896 19897 Description 19898 19899 If the process has appropriate privilege, the stime() function 19900 shall set the system's idea of the time and date. Time, 19901 referenced by t, is measured in seconds from the epoch (defined 19902 in POSIX 1003.1-2001 (ISO/IEC 9945-2003) as 00:00:00 UTC 19903 January 1, 1970). 19904 19905 Return Value 19906 19907 On success, stime() shall return 0. Otherwise, stime() shall 19908 return -1 and errno shall be set to indicate the error. 19909 19910 Errors 19911 19912 EPERM 19913 19914 The process does not have appropriate privilege. 19915 EINVAL 19916 19917 t is a null pointer. 19918 19919 stpcpy 19920 19921 Name 19922 19923 stpcpy -- copy a string returning a pointer to its end 19924 19925 Synopsis 19926 19927 #include 19928 19929 char * stpcpy(char * restrict dest, const char * restrict src); 19930 19931 Description 19932 19933 The stpcpy() function shall copy the string pointed to by src 19934 (including the terminating null character) to the array pointed 19935 to by dest. The strings may not overlap, and the destination 19936 string dest shall be large enough to receive the copy. 19937 19938 Return Value 19939 19940 stpcpy() returns a pointer to the end of the string dest (that 19941 is, the address of the terminating null character) rather than 19942 the beginning. 19943 19944 Example 19945 19946 This program uses stpcpy() to concatenate foo and bar to 19947 produce foobar, which it then prints. 19948 #include 19949 19950 int 19951 main (void) 19952 { 19953 char buffer[256]; 19954 char *to = buffer; 19955 to = stpcpy (to, "foo"); 19956 to = stpcpy (to, "bar"); 19957 printf ("%s\n", buffer); 19958 } 19959 19960 stpncpy 19961 19962 Name 19963 19964 stpncpy -- copy a fixed-size string, returning a pointer to its 19965 end 19966 19967 Synopsis 19968 19969 #include 19970 19971 char * stpncpy(char * restrict dest, const char * restrict src, 19972 size_t n); 19973 19974 Description 19975 19976 The stpncpy() function shall copy at most n characters from the 19977 string pointed to by src, including the terminating null 19978 character, to the array pointed to by dest. Exactly n 19979 characters are written at dest. If the length strlen()(src) is 19980 smaller than n, the remaining characters in dest are filled 19981 with '\0' characters. If the length strlen(src) is greater than 19982 or equal to n, dest will not be null terminated. 19983 19984 The strings may not overlap. 19985 19986 The programmer shall ensure that there is room for at least n 19987 characters at dest. 19988 19989 Return Value 19990 19991 The stpncpy() function shall return a pointer to the 19992 terminating NULL in dest, or, if dest is not NULL-terminated, 19993 dest + n. 19994 19995 strcasestr 19996 19997 Name 19998 19999 strcasestr -- locate a substring ignoring case 20000 20001 Synopsis 20002 20003 #include 20004 20005 char * strcasestr(const char * s1, const char * s2); 20006 20007 Description 20008 20009 The strcasestr() shall behave as strstr(), except that it shall 20010 ignore the case of both strings. The strcasestr() function 20011 shall be locale aware; that is strcasestr() shall behave as if 20012 both strings had been converted to lower case in the current 20013 locale before the comparison is performed. 20014 20015 Return Value 20016 20017 Upon successful completion, strcasestr() shall return a pointer 20018 to the located string or a null pointer if the string is not 20019 found. If s2 points to a string with zero length, the function 20020 shall return s1. 20021 20022 strerror_r 20023 20024 Name 20025 20026 strerror_r -- return string describing error number 20027 20028 Synopsis 20029 20030 #include 20031 20032 char * strerror_r(int errnum, char * buf, size_t buflen); 20033 20034 Description 20035 20036 In the source standard, strerror_r() is implemented as a macro 20037 causing it to behave as described in POSIX 1003.1-2001 (ISO/IEC 20038 9945-2003), and is equivalent to the function 20039 __xpg_strerror_r(). If the macro is undefined, strerror_r() 20040 from the binary standard is used, with differences as described 20041 here. 20042 20043 The strerror_r() function shall return a pointer to the string 20044 corresponding to the error number errnum. The returned pointer 20045 may point within the buffer buf (at most buflen bytes). 20046 20047 Return Value 20048 20049 On success, strerror_r() shall return a pointer to the 20050 generated message string (determined by the setting of the 20051 LC_MESSAGES category in the current locale). Otherwise, 20052 strerror_r() shall return the string corresponding to "Unknown 20053 error". 20054 20055 See Also 20056 20057 __xpg_strerror_r() 20058 20059 strndup 20060 20061 Name 20062 20063 strndup -- return a malloc'd copy of at most the specified 20064 number of bytes of a string 20065 20066 Synopsis 20067 20068 #include 20069 20070 char * strndup(const char * string, size_t n); 20071 20072 Description 20073 20074 The strndup() function shall return a malloc()'d copy of at 20075 most n bytes of string. The resultant string shall be 20076 terminated even if no NULL terminator appears before string+n. 20077 20078 Return Value 20079 20080 On success, strndup() shall return a pointer to a newly 20081 allocated block of memory containing a copy of at most n bytes 20082 of string. Otherwise, strndup() shall return NULL and set errno 20083 to indicate the error. 20084 20085 Errors 20086 20087 ENOMEM 20088 20089 Insufficient memory available. 20090 20091 strnlen 20092 20093 Name 20094 20095 strnlen -- determine the length of a fixed-size string 20096 20097 Synopsis 20098 20099 #include 20100 20101 size_t strnlen(const char * s, size_t maxlen); 20102 20103 Description 20104 20105 The strnlen() function shall compute the number of bytes in the 20106 array to which s points, stopping at maxlen bytes. A null byte 20107 and any bytes following it are not counted. 20108 20109 Return Value 20110 20111 The strnlen() function shall return the length of s if that is 20112 less than maxlen, or maxlen if there is no null byte in the 20113 first maxlen bytes. 20114 20115 Errors 20116 20117 No errors are defined. 20118 20119 strptime 20120 20121 Name 20122 20123 strptime -- parse a time string 20124 20125 Description 20126 20127 The strptime() shall behave as specified in the POSIX 20128 1003.1-2001 (ISO/IEC 9945-2003) with differences as listed 20129 below. 20130 20131 Number of leading zeroes may be limited 20132 20133 The POSIX 1003.1-2001 (ISO/IEC 9945-2003) specifies fields for 20134 which "leading zeros are permitted but not required"; however, 20135 applications shall not expect to be able to supply more leading 20136 zeroes for these fields than would be implied by the range of 20137 the field. Implementations may choose to either match an input 20138 with excess leading zeroes, or treat this as a non-matching 20139 input. For example, %j has a range of 001 to 366, so 0, 00, 20140 000, 001, and 045 are acceptable inputs, but inputs such as 20141 0000, 0366 and the like are not. 20142 20143 Rationale 20144 20145 glibc developers consider it appropriate behavior to forbid 20146 excess leading zeroes. When trying to parse a given input 20147 against several format strings, forbidding excess leading 20148 zeroes could be helpful. For example, if one matches 0011-12-26 20149 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for 20150 the first match to fail, as it would be perverse to parse that 20151 date as November 12, year 26. The second pattern parses it as 20152 December 26, year 11. 20153 20154 The POSIX 1003.1-2001 (ISO/IEC 9945-2003) is not explicit that 20155 an unlimited number of leading zeroes are required, although it 20156 may imply this. The LSB explicitly allows implementations to 20157 have either behavior. Future versions of this standard may 20158 require implementations to forbid excess leading zeroes. 20159 20160 An Interpretation Request is currently pending against POSIX 20161 1003.1-2001 (ISO/IEC 9945-2003) for this matter. 20162 20163 strsep 20164 20165 Name 20166 20167 strsep -- extract token from string 20168 20169 Synopsis 20170 20171 #include 20172 20173 char * strsep(char * * stringp, const char * delim); 20174 20175 Description 20176 20177 The strsep() function shall find the first token in the string 20178 referenced by the pointer stringp, using the characters in 20179 delim as delimiters. 20180 20181 If stringp is NULL, strsep() shall return NULL and do nothing 20182 else. 20183 20184 If stringp is non-NULL, strsep() shall find the first token in 20185 the string referenced by stringp, where tokens are delimited by 20186 characters in the string delim. This token shall be terminated 20187 with a \0 character by overwriting the delimiter, and stringp 20188 shall be updated to point past the token. In case no delimiter 20189 was found, the token is taken to be the entire string 20190 referenced by stringp, and the location referenced by stringp 20191 is made NULL. 20192 20193 Return Value 20194 20195 strsep() shall return a pointer to the beginning of the token. 20196 20197 Notes 20198 20199 The strsep() function was introduced as a replacement for 20200 strtok(), since the latter cannot handle empty fields. However, 20201 strtok() conforms to ISO C (1999) and to POSIX 1003.1-2001 20202 (ISO/IEC 9945-2003) and hence is more portable. 20203 20204 See Also 20205 20206 strtok(), strtok_r(). 20207 20208 strsignal 20209 20210 Name 20211 20212 strsignal -- return string describing signal 20213 20214 Synopsis 20215 20216 #define _GNU_SOURCE 20217 #include 20218 20219 char * strsignal(int sig); 20220 20221 Description 20222 20223 The strsignal() function shall return a pointer to a string 20224 describing the signal number sig. The string can only be used 20225 until the next call to strsignal(). 20226 20227 Return Value 20228 20229 If sig is a valid signal number, strsignal() shall return a 20230 pointer to the appropriate description string. If sig is not a 20231 valid signal number, strsignal() shall return a pointer to an 20232 error string. The contents of either type of string are 20233 unspecified. 20234 20235 Although the function is not declared as returning a pointer to 20236 a constant character string, applications shall not modify the 20237 returned string. 20238 20239 strtoq 20240 20241 Name 20242 20243 strtoq -- convert string value to a long or quad_t integer 20244 20245 Synopsis 20246 20247 #include 20248 #include 20249 #include 20250 20251 long long strtoq(const char * nptr, char * * endptr, int base); 20252 20253 Description 20254 20255 strtoq() converts the string nptr to a quadt value. The 20256 conversion is done according to the given base, which shall be 20257 between 2 and 36 inclusive, or be the special value 0. 20258 20259 nptr may begin with an arbitrary amount of white space (as 20260 determined by isspace()), followed by a single optional + or - 20261 sign character. If base is 0 or 16, the string may then include 20262 a 0x prefix, and the number will be read in base 16; otherwise, 20263 a 0 base is taken as 10 (decimal), unless the next character is 20264 0, in which case it is taken as 8 (octal). 20265 20266 The remainder of the string is converted to a long value in the 20267 obvious manner, stopping at the first character which is not a 20268 valid digit in the given base. (In bases above 10, the letter A 20269 in either upper or lower case represents 10, B represents 11, 20270 and so forth, with Z representing 35.) 20271 20272 Return Value 20273 20274 strtoq() returns the result of the conversion, unless the value 20275 would underflow or overflow. If an underflow occurs, strtoq() 20276 returns QUAD_MIN. If an overflow occurs, strtoq() returns 20277 QUAD_MAX. In both cases, the global variable errno is set to 20278 ERANGE. 20279 20280 Errors 20281 20282 ERANGE 20283 20284 The given string was out of range; the value converted has been 20285 clamped. 20286 20287 strtouq 20288 20289 Name 20290 20291 strtouq -- convert a string to an unsigned long long 20292 20293 Synopsis 20294 20295 #include 20296 #include 20297 #include 20298 20299 unsigned long long strtouq(const char * nptr, char * * endptr, 20300 int base); 20301 20302 Description 20303 20304 strtouq() converts the string nptr to an unsigned long long 20305 value. The conversion is done according to the given base, 20306 which shall be between 2 and 36 inclusive, or be the special 20307 value 0. 20308 20309 nptr may begin with an arbitrary amount of white space (as 20310 determined by isspace()), followed by a single optional + or - 20311 sign character. If base is 0 or 16, the string may then include 20312 a 0x prefix, and the number will be read in base 16; otherwise, 20313 a 0 base is taken as 10 (decimal), unless the next character is 20314 0, in which case it is taken as 8 (octal). 20315 20316 The remainder of the string is converted to an unsigned long 20317 value in the obvious manner, stopping at the end of the string 20318 or at the first character that does not produce a valid digit 20319 in the given base. (In bases above 10, the letter A in either 20320 upper or lower case represents 10, B represents 11, and so 20321 forth, with Z representing 35.) 20322 20323 Return Value 20324 20325 On success, strtouq() returns either the result of the 20326 conversion or, if there was a leading minus sign, the negation 20327 of the result of the conversion, unless the original 20328 (non-negated) value would overflow. In the case of an overflow 20329 the function returns UQUAD_MAX and the global variable errno is 20330 set to ERANGE. 20331 20332 Errors 20333 20334 ERANGE 20335 20336 The given string was out of range; the value converted has been 20337 clamped. 20338 20339 svc_register 20340 20341 Name 20342 20343 svc_register -- register Remote Procedure Call interface 20344 20345 Synopsis 20346 20347 #include 20348 20349 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 20350 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 20351 protocol); 20352 20353 Description 20354 20355 The svc_register() function shall associate the program 20356 identified by prognum at version versnum with the service 20357 dispatch procedure, dispatch. If protocol is zero, the service 20358 is not registered with the portmap service. If protocol is 20359 non-zero, then a mapping of the triple [prognum, versnum, 20360 protocol] to xprt->xp_port is established with the local 20361 portmap service. The procedure dispatch has the following form: 20362 20363 int dispatch(struct svc_req * request, SVCXPRT * xprt); 20364 20365 Return Value 20366 20367 svc_register() returns 1 if it succeeds, and zero otherwise. 20368 20369 svc_run 20370 20371 Name 20372 20373 svc_run -- waits for RPC requests to arrive and calls service 20374 procedure 20375 20376 Synopsis 20377 20378 #include 20379 20380 void svc_run(void); 20381 20382 Description 20383 20384 The svc_run() function shall wait for RPC requests to arrive, 20385 read and unpack each request, and dispatch it to the 20386 appropriate registered handler. Under normal conditions, 20387 svc_run() shall not return; it shall only return if serious 20388 errors occur that prevent further processing. 20389 20390 svc_sendreply 20391 20392 Name 20393 20394 svc_sendreply -- called by RPC service's dispatch routine 20395 20396 Synopsis 20397 20398 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 20399 out); 20400 20401 Description 20402 20403 Called by an RPC service's dispatch routine to send the results 20404 of a remote procedure call. The parameter xprt is the request's 20405 associated transport handle; outproc is the XDR routine which 20406 is used to encode the results; and out is the address of the 20407 results. This routine returns one if it succeeds, zero 20408 otherwise. 20409 20410 svctcp_create 20411 20412 Name 20413 20414 svctcp_create -- create a TCP/IP-based RPC service transport 20415 20416 Synopsis 20417 20418 #include 20419 20420 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 20421 recv_buf_size); 20422 20423 Description 20424 20425 svctcp_create() creates a TCP/IP-based RPC service transport, 20426 to which it returns a pointer. The transport is associated with 20427 the socket sock, which may be RPC_ANYSOCK, in which case a new 20428 socket is created. If the socket is not bound to a local TCP 20429 port, then this routine binds it to an arbitrary port. Upon 20430 completion, xprt->xp_sock is the transport's socket descriptor, 20431 and xprt->xp_port is the transport's port number. Since 20432 TCP-based RPC uses buffered I/O, users may specify the size of 20433 buffers; values of zero choose suitable defaults. 20434 20435 Return Value 20436 20437 svctcp_create() returns NULL if it fails, or a pointer to the 20438 RPC service transport otherwise. 20439 20440 svcudp_create 20441 20442 Name 20443 20444 svcudp_create -- create a UDP-based RPC service transport 20445 20446 Synopsis 20447 20448 SVCXPRT * 20449 20450 svcudp_create(int sock); 20451 20452 Description 20453 20454 The svcudp_create() function shall create a UDP/IP-based RPC 20455 service transport, and return a pointer to its descriptor. The 20456 transport is associated with the socket sock, which may be 20457 RPC_ANYSOCK, in which case a new socket shall be created. If 20458 the socket is not bound to a local UDP port, then 20459 svcudp_create() shall bind it to an arbitrary port. 20460 20461 If svcudp_create() returns successfully, then the xp_sock field 20462 in the result shall be the transport's socket descriptor, and 20463 the xp_port field shall be the transport's port number. 20464 20465 Return Value 20466 20467 Upon successful completion, svcudp_create() shall return a 20468 pointer to a RPC service transport; otherwise, a null pointer 20469 shall be returned. 20470 20471 swscanf 20472 20473 Name 20474 20475 swscanf -- convert formatted input 20476 20477 Description 20478 20479 The scanf() family of functions shall behave as described in 20480 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20481 20482 Differences 20483 20484 The %s, %S and %[ conversion specifiers shall accept an option 20485 length modifier a, which shall cause a memory buffer to be 20486 allocated to hold the string converted. In such a case, the 20487 argument corresponding to the conversion specifier should be a 20488 reference to a pointer value that will receive a pointer to the 20489 allocated buffer. If there is insufficient memory to allocate a 20490 buffer, the function may set errno to ENOMEM and a conversion 20491 error results. 20492 20493 Note: This directly conflicts with the ISO C (1999) usage of 20494 %a as a conversion specifier for hexadecimal float values. 20495 While this conversion specifier should be supported, a 20496 format specifier such as "%aseconds" will have a different 20497 meaning on an LSB conforming system. 20498 20499 sysconf 20500 20501 Name 20502 20503 sysconf -- Get configuration information at runtime 20504 20505 Synopsis 20506 20507 #include 20508 20509 long sysconf(int name); 20510 20511 DESCRIPTION 20512 20513 sysconf() is as specified in POSIX 1003.1-2001 (ISO/IEC 20514 9945-2003), but with differences as listed below. 20515 20516 Extra Variables 20517 20518 These additional values extend the list in POSIX 1003.1-2001 20519 (ISO/IEC 9945-2003). 20520 20521 - _SC_PHYS_PAGES 20522 The number of pages of physical memory. 20523 20524 - _SC_AVPHYS_PAGES 20525 The number of currently available pages of physical 20526 memory. 20527 20528 - _SC_NPROCESSORS_CONF 20529 The number of processors configured. 20530 20531 - _SC_NPROCESSORS_ONLN 20532 The number of processors currently online (available). 20533 20534 Extra Versions 20535 20536 While this specification only requires conformance with POSIX 20537 1003.1-2001 (ISO/IEC 9945-2003), implementations are not 20538 constrained from moving on and claiming conformance with a 20539 susequent edition, POSIX 1003.1-2008 (ISO/IEC 9945-2009). Thus 20540 for run-time checks using sysconf(), the wording is amended to 20541 allow return values of 0, -1, 200112L or 200809L where formerly 20542 200809L was not listed as allowed. 20543 20544 sysinfo 20545 20546 Name 20547 20548 sysinfo -- return system information 20549 20550 Synopsis 20551 20552 #include 20553 20554 int sysinfo(struct sysinfo *info); 20555 20556 Description 20557 20558 sysinfo() provides a way to obtain certain system statistics. 20559 Statistics are written into a sysinfo structure pointed to by 20560 info. Elements which take a size are sized in units indicated 20561 by the value of the mem_unit member of info. The other members 20562 have traditional meanings as indicated in Data Definitions, but 20563 are not formally part of this specification. 20564 20565 Return Value 20566 20567 Returns zero on success. On error, -1 is returned and errno is 20568 set to indicate the error. 20569 20570 Errors 20571 20572 EFAULT 20573 20574 The info parameter does not point to a valid sysinfo structure. 20575 20576 system 20577 20578 Name 20579 20580 system -- execute a shell command 20581 20582 Synopsis 20583 20584 #include 20585 20586 int system(const char * string); 20587 20588 Description 20589 20590 The system() function shall behave as described in POSIX 20591 1003.1-2001 (ISO/IEC 9945-2003). 20592 20593 Notes 20594 20595 The fact that system() ignores interrupts is often not what a 20596 program wants. POSIX 1003.1-2001 (ISO/IEC 9945-2003) describes 20597 some of the consequences; an additional consequence is that a 20598 program calling system() from a loop cannot be reliably 20599 interrupted. Many programs will want to use the exec() family 20600 of functions instead. 20601 20602 Do not use system() from a program with suid or sgid 20603 privileges, because unexpected values for some environment 20604 variables might be used to subvert system integrity. Use the 20605 exec() family of functions instead, but not execlp() or 20606 execvp(). system() will not, in fact, work properly from 20607 programs with suid or sgid privileges on systems on which 20608 /bin/sh is bash version 2, since bash 2 drops privileges on 20609 startup. (Debian uses a modified bash which does not do this 20610 when invoked as sh.) 20611 20612 The check for the availability of /bin/sh is not actually 20613 performed; it is always assumed to be available. ISO C (1999) 20614 specifies the check, but POSIX 1003.1-2001 (ISO/IEC 9945-2003) 20615 specifies that the return shall always be nonzero, since a 20616 system without the shell is not conforming, and it is this that 20617 is implemented. 20618 20619 It is possible for the shell command to return 127, so that 20620 code is not a sure indication that the execve() call failed; 20621 check the global variable errno to make sure. 20622 20623 textdomain 20624 20625 Name 20626 20627 textdomain -- set the current default message domain 20628 20629 Synopsis 20630 20631 #include 20632 20633 char * textdomain(const char * domainname); 20634 20635 Description 20636 20637 The textdomain() function shall set the current default message 20638 domain to domainname. Subsequent calls to gettext() and 20639 ngettext() use the default message domain. 20640 20641 If domainname is NULL, the default message domain shall not be 20642 altered. 20643 20644 If domainname is "", textdomain() shall reset the default 20645 domain to the system default of "messages". 20646 20647 Return 20648 20649 On success, textdomain() shall return the currently selected 20650 domain. Otherwise, a null pointer shall be returned, and errno 20651 is set to indicate the error. 20652 20653 Errors 20654 20655 ENOMEM 20656 20657 Insufficent memory available. 20658 20659 unlink 20660 20661 Name 20662 20663 unlink -- remove a directory entry 20664 20665 Synopsis 20666 20667 int unlink(const char * path); 20668 20669 Description 20670 20671 unlink() is as specified in POSIX 1003.1-2001 (ISO/IEC 20672 9945-2003), but with differences as listed below. 20673 20674 See also Section 18.1, Additional behaviors: unlink/link on 20675 directory. 20676 20677 May return EISDIR on directories 20678 20679 If path specifies a directory, the implementation may return 20680 EISDIR instead of EPERM as specified by POSIX 1003.1-2001 20681 (ISO/IEC 9945-2003). 20682 20683 Rationale: The Linux kernel has deliberately chosen EISDIR 20684 for this case and does not expect to change. 20685 20686 uselocale 20687 20688 Name 20689 20690 uselocale -- set locale for thread 20691 20692 Synopsis 20693 20694 #include 20695 20696 locale_t uselocale(locale_t newloc); 20697 20698 Description 20699 20700 The uselocale() function shall set the locale for the calling 20701 thread to the locale specified by newloc. 20702 20703 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 20704 shall be set to the process current global locale, as set by 20705 setlocale(). If newloc is NULL, the thread's locale is not 20706 altered. 20707 20708 Return Value 20709 20710 The uselocale() function shall return the previous locale, or 20711 LC_GLOBAL_LOCALE if the thread local locale has not been 20712 previously set. 20713 20714 Errors 20715 20716 None defined. 20717 20718 See Also 20719 20720 setlocale(), freelocale(), duplocale(), newlocale() 20721 20722 utmpname 20723 20724 Name 20725 20726 utmpname -- set user accounting database 20727 20728 Synopsis 20729 20730 #include 20731 20732 int utmpname(const char * dbname); 20733 20734 Description 20735 20736 The utmpname() function shall cause the user accounting 20737 database used by the getutent(), getutent_r(), getutxent(), 20738 getutxid(), getutxline(), and pututxline() functions to be that 20739 named by dbname, instead of the system default database. See 20740 Section 16.3 for further information. 20741 20742 Note: The LSB does not specify the format of the user 20743 accounting database, nor the names of the file or files that 20744 may contain it. 20745 20746 Return Value 20747 20748 None. 20749 20750 Errors 20751 20752 None defined. 20753 20754 vasprintf 20755 20756 Name 20757 20758 vasprintf -- write formatted output to a dynamically allocated 20759 string 20760 20761 Synopsis 20762 20763 #include 20764 #include 20765 20766 int vasprintf(char * * restrict ptr, const char * restrict 20767 format, va_list arg); 20768 20769 Description 20770 20771 The vasprintf() function shall write formatted output to a 20772 dynamically allocated string, and store the address of that 20773 string in the location referenced by ptr. It shall behave as 20774 asprintf(), except that instead of being called with a variable 20775 number of arguments, it is called with an argument list as 20776 defined by . 20777 20778 Return Value 20779 20780 Refer to fprintf(). 20781 20782 Errors 20783 20784 Refer to fprintf(). 20785 20786 vdprintf 20787 20788 Name 20789 20790 vdprintf -- write formatted output to a file descriptor 20791 20792 Synopsis 20793 20794 #include 20795 20796 int vdprintf(int fd, const char * restrict format, va_list 20797 arg); 20798 20799 Description 20800 20801 The vdprintf() function shall behave as vfprintf(), except that 20802 vdprintf() shall write output to the file associated with the 20803 file descriptor specified by the fd argument, rather than place 20804 output on a stream (as defined by POSIX 1003.1-2001 (ISO/IEC 20805 9945-2003)). 20806 20807 Return Value 20808 20809 Refer to fprintf(). 20810 20811 Errors 20812 20813 Refer to fprintf(). 20814 20815 verrx 20816 20817 Name 20818 20819 verrx -- display formatted error message and exit 20820 20821 Synopsis 20822 20823 #include 20824 #include 20825 20826 void verrx(int eval, const char * fmt, va_list args); 20827 20828 Description 20829 20830 The verrx() shall behave as errx() except that instead of being 20831 called with a variable number of arguments, it is called with 20832 an argument list as defined by . 20833 20834 verrx() does not return, but exits with the value of eval. 20835 20836 Return Value 20837 20838 None. 20839 20840 Errors 20841 20842 None. 20843 20844 vfscanf 20845 20846 Name 20847 20848 vfscanf -- convert formatted input 20849 20850 Description 20851 20852 The scanf() family of functions shall behave as described in 20853 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20854 20855 Differences 20856 20857 The %s, %S and %[ conversion specifiers shall accept an option 20858 length modifier a, which shall cause a memory buffer to be 20859 allocated to hold the string converted. In such a case, the 20860 argument corresponding to the conversion specifier should be a 20861 reference to a pointer value that will receive a pointer to the 20862 allocated buffer. If there is insufficient memory to allocate a 20863 buffer, the function may set errno to ENOMEM and a conversion 20864 error results. 20865 20866 Note: This directly conflicts with the ISO C (1999) usage of 20867 %a as a conversion specifier for hexadecimal float values. 20868 While this conversion specifier should be supported, a 20869 format specifier such as "%aseconds" will have a different 20870 meaning on an LSB conforming system. 20871 20872 vfwscanf 20873 20874 Name 20875 20876 vfwscanf -- convert formatted input 20877 20878 Description 20879 20880 The scanf() family of functions shall behave as described in 20881 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20882 20883 Differences 20884 20885 The %s, %S and %[ conversion specifiers shall accept an option 20886 length modifier a, which shall cause a memory buffer to be 20887 allocated to hold the string converted. In such a case, the 20888 argument corresponding to the conversion specifier should be a 20889 reference to a pointer value that will receive a pointer to the 20890 allocated buffer. If there is insufficient memory to allocate a 20891 buffer, the function may set errno to ENOMEM and a conversion 20892 error results. 20893 20894 Note: This directly conflicts with the ISO C (1999) usage of 20895 %a as a conversion specifier for hexadecimal float values. 20896 While this conversion specifier should be supported, a 20897 format specifier such as "%aseconds" will have a different 20898 meaning on an LSB conforming system. 20899 20900 vscanf 20901 20902 Name 20903 20904 vscanf -- convert formatted input 20905 20906 Description 20907 20908 The scanf() family of functions shall behave as described in 20909 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20910 20911 Differences 20912 20913 The %s, %S and %[ conversion specifiers shall accept an option 20914 length modifier a, which shall cause a memory buffer to be 20915 allocated to hold the string converted. In such a case, the 20916 argument corresponding to the conversion specifier should be a 20917 reference to a pointer value that will receive a pointer to the 20918 allocated buffer. If there is insufficient memory to allocate a 20919 buffer, the function may set errno to ENOMEM and a conversion 20920 error results. 20921 20922 Note: This directly conflicts with the ISO C (1999) usage of 20923 %a as a conversion specifier for hexadecimal float values. 20924 While this conversion specifier should be supported, a 20925 format specifier such as "%aseconds" will have a different 20926 meaning on an LSB conforming system. 20927 20928 vsscanf 20929 20930 Name 20931 20932 vsscanf -- convert formatted input 20933 20934 Description 20935 20936 The scanf() family of functions shall behave as described in 20937 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20938 20939 Differences 20940 20941 The %s, %S and %[ conversion specifiers shall accept an option 20942 length modifier a, which shall cause a memory buffer to be 20943 allocated to hold the string converted. In such a case, the 20944 argument corresponding to the conversion specifier should be a 20945 reference to a pointer value that will receive a pointer to the 20946 allocated buffer. If there is insufficient memory to allocate a 20947 buffer, the function may set errno to ENOMEM and a conversion 20948 error results. 20949 20950 Note: This directly conflicts with the ISO C (1999) usage of 20951 %a as a conversion specifier for hexadecimal float values. 20952 While this conversion specifier should be supported, a 20953 format specifier such as "%aseconds" will have a different 20954 meaning on an LSB conforming system. 20955 20956 vswscanf 20957 20958 Name 20959 20960 vswscanf -- convert formatted input 20961 20962 Description 20963 20964 The scanf() family of functions shall behave as described in 20965 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 20966 20967 Differences 20968 20969 The %s, %S and %[ conversion specifiers shall accept an option 20970 length modifier a, which shall cause a memory buffer to be 20971 allocated to hold the string converted. In such a case, the 20972 argument corresponding to the conversion specifier should be a 20973 reference to a pointer value that will receive a pointer to the 20974 allocated buffer. If there is insufficient memory to allocate a 20975 buffer, the function may set errno to ENOMEM and a conversion 20976 error results. 20977 20978 Note: This directly conflicts with the ISO C (1999) usage of 20979 %a as a conversion specifier for hexadecimal float values. 20980 While this conversion specifier should be supported, a 20981 format specifier such as "%aseconds" will have a different 20982 meaning on an LSB conforming system. 20983 20984 vsyslog 20985 20986 Name 20987 20988 vsyslog -- log to system log 20989 20990 Synopsis 20991 20992 #include 20993 #include 20994 20995 void vsyslog(int priority, char * message, va_list arglist); 20996 20997 Description 20998 20999 The vsyslog() function is identical to syslog() as specified in 21000 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except that arglist (as 21001 defined by stdarg.h) replaces the variable number of arguments. 21002 21003 vwscanf 21004 21005 Name 21006 21007 vwscanf -- convert formatted input 21008 21009 Description 21010 21011 The scanf() family of functions shall behave as described in 21012 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 21013 21014 Differences 21015 21016 The %s, %S and %[ conversion specifiers shall accept an option 21017 length modifier a, which shall cause a memory buffer to be 21018 allocated to hold the string converted. In such a case, the 21019 argument corresponding to the conversion specifier should be a 21020 reference to a pointer value that will receive a pointer to the 21021 allocated buffer. If there is insufficient memory to allocate a 21022 buffer, the function may set errno to ENOMEM and a conversion 21023 error results. 21024 21025 Note: This directly conflicts with the ISO C (1999) usage of 21026 %a as a conversion specifier for hexadecimal float values. 21027 While this conversion specifier should be supported, a 21028 format specifier such as "%aseconds" will have a different 21029 meaning on an LSB conforming system. 21030 21031 wait4 21032 21033 Name 21034 21035 wait4 -- wait for process termination, BSD style 21036 21037 Synopsis 21038 21039 #include 21040 #include 21041 #include 21042 21043 pid_t wait4(pid_t pid, int * status, int options, struct rusage 21044 * rusage); 21045 21046 Description 21047 21048 wait4() suspends execution of the current process until a child 21049 (as specified by pid) has exited, or until a signal is 21050 delivered whose action is to terminate the current process or 21051 to call a signal handling function. If a child (as requested by 21052 pid) has already exited by the time of the call (a so-called 21053 "zombie" process), the function returns immediately. Any system 21054 resources used by the child are freed. 21055 21056 The value of pid can be one of: 21057 21058 < -1 21059 21060 wait for any child process whose process group ID is equal to 21061 the absolute value of pid. 21062 -1 21063 21064 wait for any child process; this is equivalent to calling 21065 wait3(). 21066 0 21067 21068 wait for any child process whose process group ID is equal to 21069 that of the calling process. 21070 > 0 21071 21072 wait for the child whose process ID is equal to the value of 21073 pid. 21074 21075 The value of options is a bitwise or of zero or more of the 21076 following constants: 21077 21078 WNOHANG 21079 21080 return immediately if no child is there to be waited for. 21081 WUNTRACED 21082 21083 return for children that are stopped, and whose status has not 21084 been reported. 21085 21086 If status is not NULL, wait4() stores status information in the 21087 location status. This status can be evaluated with the 21088 following macros: 21089 21090 Note: These macros take the status value (an int) as an 21091 argument -- not a pointer to the value! 21092 21093 WIFEXITED(status) 21094 21095 is nonzero if the child exited normally. 21096 WEXITSTATUS(status) 21097 21098 evaluates to the least significant eight bits of the return 21099 code of the child that terminated, which may have been set as 21100 the argument to a call to exit() or as the argument for a 21101 return statement in the main program. This macro can only be 21102 evaluated if WIFEXITED() returned nonzero. 21103 WIFSIGNALED(status) 21104 21105 returns true if the child process exited because of a signal 21106 that was not caught. 21107 WTERMSIG(status) 21108 21109 returns the number of the signal that caused the child process 21110 to terminate. This macro can only be evaluated if WIFSIGNALED() 21111 returned nonzero. 21112 WIFSTOPPED(status) 21113 21114 returns true if the child process that caused the return is 21115 currently stopped; this is only possible if the call was done 21116 using WUNTRACED(). 21117 WSTOPSIG(status) 21118 21119 returns the number of the signal that caused the child to stop. 21120 This macro can only be evaluated if WIFSTOPPED() returned 21121 nonzero. 21122 21123 If rusage is not NULL, the struct rusage (as defined in 21124 sys/resource.h) that it points to will be filled with 21125 accounting information. See getrusage() for details. 21126 21127 Return Value 21128 21129 On success, the process ID of the child that exited is 21130 returned. On error, -1 is returned (in particular, when no 21131 unwaited-for child processes of the specified kind exist), or 0 21132 if WNOHANG() was used and no child was available yet. In the 21133 latter two cases, the global variable errno is set 21134 appropriately. 21135 21136 Errors 21137 21138 ECHILD 21139 21140 No unwaited-for child process as specified does exist. 21141 ERESTARTSYS 21142 21143 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 21144 was caught. This error is returned by the system call. The 21145 library interface is not allowed to return ERESTARTSYS, but 21146 will return EINTR. 21147 21148 warn 21149 21150 Name 21151 21152 warn -- formatted error messages 21153 21154 Synopsis 21155 21156 #include 21157 21158 void warn(const char * fmt, ...); 21159 21160 Description 21161 21162 The warn() function shall display a formatted error message on 21163 the standard error stream. The output shall consist of the last 21164 component of the program name, a colon character, and a space 21165 character. If fmt is non-NULL, it shall be used as a format 21166 string for the printf() family of functions, and the formatted 21167 message, a colon character, and a space are written to stderr. 21168 Finally, the error message string affiliated with the current 21169 value of the global variable errno shall be written to stderr, 21170 followed by a newline character. 21171 21172 Return Value 21173 21174 None. 21175 21176 Errors 21177 21178 None. 21179 21180 warnx 21181 21182 Name 21183 21184 warnx -- formatted error messages 21185 21186 Synopsis 21187 21188 #include 21189 21190 void warnx(const char * fmt, ...); 21191 21192 Description 21193 21194 The warnx() function shall display a formatted error message on 21195 the standard error stream. The last component of the program 21196 name, a colon character, and a space shall be output. If fmt is 21197 non-NULL, it shall be used as the format string for the 21198 printf() family of functions, and the formatted error message, 21199 a colon character, and a space shall be output. The output 21200 shall be followed by a newline character. 21201 21202 Return Value 21203 21204 None. 21205 21206 Errors 21207 21208 None. 21209 21210 wcpcpy 21211 21212 Name 21213 21214 wcpcpy -- copy a wide character string, returning a pointer to 21215 its end 21216 21217 Synopsis 21218 21219 #include 21220 21221 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 21222 21223 Description 21224 21225 wcpcpy() is the wide-character equivalent of stpcpy(). It 21226 copies the wide character string src, including the terminating 21227 null wide character code, to the array dest. 21228 21229 The strings may not overlap. 21230 21231 The programmer shall ensure that there is room for at least 21232 wcslen()(src)+1 wide characters at dest. 21233 21234 Return Value 21235 21236 wcpcpy() returns a pointer to the end of the wide-character 21237 string dest, that is, a pointer to the terminating null wide 21238 character code. 21239 21240 wcpncpy 21241 21242 Name 21243 21244 wcpncpy -- copy a fixed-size string of wide characters, 21245 returning a pointer to its end 21246 21247 Synopsis 21248 21249 #include 21250 21251 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 21252 n); 21253 21254 Description 21255 21256 wcpncpy() is the wide-character equivalent of stpncpy(). It 21257 copies at most n wide characters from the wide-character string 21258 src, including the terminating null wide character code, to the 21259 array dest. Exactly n wide characters are written at dest. If 21260 the length wcslen()(src) is smaller than n, the remaining wide 21261 characters in the array dest are filled with null wide 21262 character codes. If the length wcslen()(src) is greater than or 21263 equal to n, the string dest will not be terminated with a null 21264 wide character code. 21265 21266 The strings may not overlap. 21267 21268 The programmer shall ensure that there is room for at least n 21269 wide characters at dest. 21270 21271 Return Value 21272 21273 wcpncpy() returns a pointer to the wide character one past the 21274 last non-null wide character written. 21275 21276 wcscasecmp 21277 21278 Name 21279 21280 wcscasecmp -- compare two wide-character strings, ignoring case 21281 21282 Synopsis 21283 21284 #include 21285 21286 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 21287 21288 Description 21289 21290 wcscasecmp() is the wide-character equivalent of strcasecmp(). 21291 It compares the wide-character string s1 and the wide-character 21292 string s2, ignoring case differences (towupper, towlower). 21293 21294 Return Value 21295 21296 The wcscasecmp() function shall return 0 if the wide-character 21297 strings s1 and s2 are equal except for case distinctions. It 21298 shall return a positive integer if s1 is greater than s2, 21299 ignoring case. It shall return a negative integer if s1 is less 21300 than s2, ignoring case. 21301 21302 Notes 21303 21304 The behavior of wcscasecmp() depends upon the LC_CTYPE category 21305 of the current locale. 21306 21307 wcsdup 21308 21309 Name 21310 21311 wcsdup -- duplicate a wide-character string 21312 21313 Synopsis 21314 21315 #include 21316 21317 wchar_t * wcsdup(const wchar_t * s); 21318 21319 Description 21320 21321 The wcsdup() function is the wide-character equivalent of 21322 strdup(). The wcsdup() function shall return a pointer to a new 21323 wide character string, which is a duplicate of the wide 21324 character string pointed to by s. The returned pointer can be 21325 passed to free(). A null pointer is returned if the new string 21326 cannot be created. 21327 21328 Return Value 21329 21330 The wcsdup() function returns a pointer to a new wide-character 21331 string on success. Otherwise, it shall return NULL and set 21332 errno to indicate the error. 21333 21334 Errors 21335 21336 ENOMEM 21337 21338 Insufficient memory available. 21339 21340 wcsncasecmp 21341 21342 Name 21343 21344 wcsncasecmp -- compare two fixed-size wide-character strings, 21345 ignoring case 21346 21347 Synopsis 21348 21349 #include 21350 21351 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 21352 n); 21353 21354 Description 21355 21356 wcsncasecmp() is the wide-character equivalent of 21357 strncasecmp(). It compares the wide-character string s1 and the 21358 wide-character string s2, but at most n wide characters from 21359 each string, ignoring case differences (towupper, towlower). 21360 21361 Return Value 21362 21363 wcscasecmp() returns 0 if the wide-character strings s1 and s2, 21364 truncated to at most length n, are equal except for case 21365 distinctions. It returns a positive integer if truncated s1 is 21366 greater than truncated s2, ignoring case. It returns a negative 21367 integer if truncated s1 is smaller than truncated s2, ignoring 21368 case. 21369 21370 Notes 21371 21372 The behavior of wcsncasecmp() depends upon the LC_CTYPE 21373 category of the current locale. 21374 21375 wcsnlen 21376 21377 Name 21378 21379 wcsnlen -- determine the length of a fixed-size wide-character 21380 string 21381 21382 Synopsis 21383 21384 #include 21385 21386 size_t wcsnlen(const wchar_t * s, size_t maxlen); 21387 21388 Description 21389 21390 wcsnlen() is the wide-character equivalent of strnlen(). It 21391 returns the number of wide-characters in the string s, not 21392 including the terminating null wide character code, but at most 21393 maxlen. In doing this, wcsnlen() looks only at the first maxlen 21394 wide-characters at s and never beyond s + maxlen. 21395 21396 Return Value 21397 21398 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 21399 maxlen if there is no null wide character code among the first 21400 maxlen wide characters pointed to by s. 21401 21402 wcsnrtombs 21403 21404 Name 21405 21406 wcsnrtombs -- convert a wide character string to a multi-byte 21407 string 21408 21409 Synopsis 21410 21411 #include 21412 21413 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 21414 nwc, size_t len, mbstate_t * ps); 21415 21416 Description 21417 21418 wcsnrtombs() is like wcsrtombs(), except that the number of 21419 wide characters to be converted, starting at src, is limited to 21420 nwc. 21421 21422 If dest is not a NULL pointer, wcsnrtombs() converts at most 21423 nwc wide characters from the wide-character string src to a 21424 multibyte string starting at dest. At most len bytes are 21425 written to dest. The shift state ps is updated. 21426 21427 The conversion is effectively performed by repeatedly calling: 21428 wcrtomb(dest, *src, ps) 21429 21430 as long as this call succeeds, and then incrementing dest by 21431 the number of bytes written and src by 1. 21432 21433 The conversion can stop for three reasons: 21434 21435 * A wide character has been encountered that cannot be 21436 represented as a multibyte sequence (according to the 21437 current locale). In this case src is left pointing to the 21438 invalid wide character, (size_t)(-1) is returned, and errno 21439 is set to EILSEQ. 21440 * nws wide characters have been converted without 21441 encountering a null wide character code, or the length 21442 limit forces a stop. In this case, src is left pointing to 21443 the next wide character to be converted, and the number 21444 bytes written to dest is returned. 21445 * The wide-character string has been completely converted, 21446 including the terminating null wide character code (which 21447 has the side effect of bringing back ps to the initial 21448 state). In this case, src is set to NULL, and the number of 21449 bytes written to dest, excluding the terminating null wide 21450 character code, is returned. 21451 21452 If dest is NULL, len is ignored, and the conversion proceeds as 21453 above, except that the converted bytes are not written out to 21454 memory, and that no destination length limit exists. 21455 21456 In both of the above cases, if ps is a NULL pointer, a static 21457 anonymous state only known to wcsnrtombs() is used instead. 21458 21459 The programmer shall ensure that there is room for at least len 21460 bytes at dest. 21461 21462 Return Value 21463 21464 wcsnrtombs() returns the number of bytes that make up the 21465 converted part of multibyte sequence, not including the 21466 terminating null wide character code. If a wide character was 21467 encountered which could not be converted, (size_t)(-1) is 21468 returned, and the global variable errno set to EILSEQ. 21469 21470 Notes 21471 21472 The behavior of wcsnrtombs() depends on the LC_CTYPE category 21473 of the current locale. 21474 21475 Passing NULL as ps is not multi-thread safe. 21476 21477 wcstoq 21478 21479 Name 21480 21481 wcstoq -- convert wide string to long long int representation 21482 21483 Synopsis 21484 21485 #include 21486 21487 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 21488 restrict endptr, int base); 21489 21490 Description 21491 21492 The wcstoq() function shall convert the initial portion of the 21493 wide string nptr to long long int representation. It is 21494 identical to wcstoll(). 21495 21496 Return Value 21497 21498 Refer to wcstoll(). 21499 21500 Errors 21501 21502 Refer to wcstoll(). 21503 21504 wcstouq 21505 21506 Name 21507 21508 wcstouq -- convert wide string to unsigned long long int 21509 representation 21510 21511 Synopsis 21512 21513 #include 21514 21515 unsigned long long wcstouq(const wchar_t * restrict nptr, 21516 wchar_t ** restrict endptr, int base); 21517 21518 Description 21519 21520 The wcstouq() function shall convert the initial portion of the 21521 wide string nptr to unsigned long long int representation. It 21522 is identical to wcstoull(). 21523 21524 Return Value 21525 21526 Refer to wcstoull(). 21527 21528 Errors 21529 21530 Refer to wcstoull(). 21531 21532 wscanf 21533 21534 Name 21535 21536 wscanf -- convert formatted input 21537 21538 Description 21539 21540 The scanf() family of functions shall behave as described in 21541 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except as noted below. 21542 21543 Differences 21544 21545 The %s, %S and %[ conversion specifiers shall accept an option 21546 length modifier a, which shall cause a memory buffer to be 21547 allocated to hold the string converted. In such a case, the 21548 argument corresponding to the conversion specifier should be a 21549 reference to a pointer value that will receive a pointer to the 21550 allocated buffer. If there is insufficient memory to allocate a 21551 buffer, the function may set errno to ENOMEM and a conversion 21552 error results. 21553 21554 Note: This directly conflicts with the ISO C (1999) usage of 21555 %a as a conversion specifier for hexadecimal float values. 21556 While this conversion specifier should be supported, a 21557 format specifier such as "%aseconds" will have a different 21558 meaning on an LSB conforming system. 21559 21560 xdr_u_int 21561 21562 Name 21563 21564 xdr_u_int -- library routines for external data representation 21565 21566 Synopsis 21567 21568 int xdr_u_int(XDR * xdrs, unsigned int * up); 21569 21570 Description 21571 21572 xdr_u_int() is a filter primitive that translates between C 21573 unsigned integers and their external representations. 21574 21575 Return Value 21576 21577 On success, 1 is returned. On error, 0 is returned. 21578 21579 xdrstdio_create 21580 21581 Name 21582 21583 xdrstdio_create -- library routines for external data 21584 representation 21585 21586 Synopsis 21587 21588 #include 21589 21590 void xdrstdio_create(XDR * xdrs, FILE * file, enum xdr_op op); 21591 21592 Description 21593 21594 The xdrstdio_create() function shall initialize the XDR stream 21595 object referred to by xdrs. The XDR stream data shall be 21596 written to, or read from, the standard I/O stream associated 21597 with file. If the operation op is XDR_ENCODE, encoded data 21598 shall be written to file. If op is XDR_DECODE, encoded data 21599 shall be read from file. If op is XDR_FREE, the XDR stream 21600 object may be used to deallocate storage allocated by a 21601 previous XDR_DECODE. 21602 21603 The associated destroy function shall flush the file I/O 21604 stream, but not close it. 21605 21606 Return Value 21607 21608 None. 21609 __________________________________________________________ 21610 21611 12.6. Interfaces for libm 21612 21613 Table 12-38 defines the library name and shared object name for 21614 the libm library 21615 21616 Table 12-38. libm Definition 21617 Library: libm 21618 SONAME: See archLSB. 21619 21620 The behavior of the interfaces in this library is specified by 21621 the following specifications: 21622 21623 [LSB] This Specification 21624 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 21625 __________________________________________________________ 21626 21627 12.6.1. Math 21628 __________________________________________________________ 21629 21630 12.6.1.1. Interfaces for Math 21631 21632 An LSB conforming implementation shall provide the generic 21633 functions for Math specified in Table 12-39, with the full 21634 mandatory functionality as described in the referenced 21635 underlying specification. 21636 21637 Table 12-39. libm - Math Function Interfaces 21638 __finite [LSB] __finitef [LSB] __finitel [LSB] __fpclassify 21639 [LSB] 21640 __fpclassifyf [LSB] __signbit [LSB] __signbitf [LSB] acos 21641 [SUSv3] 21642 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 21643 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 21644 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 21645 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 21646 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 21647 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 21648 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 21649 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 21650 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 21651 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 21652 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 21653 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 21654 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 21655 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 21656 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 21657 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [LSB] 21658 clog10f [LSB] clog10l [LSB] clogf [SUSv3] clogl [SUSv3] 21659 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 21660 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 21661 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 21662 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 21663 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 21664 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 21665 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 21666 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 21667 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 21668 drem [LSB] dremf [LSB] dreml [LSB] erf [SUSv3] 21669 erfc [SUSv3] erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] 21670 erfl [SUSv3] exp [SUSv3] exp10 [LSB] exp10f [LSB] 21671 exp10l [LSB] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 21672 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 21673 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 21674 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] 21675 fedisableexcept [LSB] 21676 feenableexcept [LSB] fegetenv [SUSv3] fegetexcept [LSB] 21677 fegetexceptflag [SUSv3] 21678 fegetround [SUSv3] feholdexcept [SUSv3] feraiseexcept [SUSv3] 21679 fesetenv [SUSv3] 21680 fesetexceptflag [SUSv3] fesetround [SUSv3] fetestexcept [SUSv3] 21681 feupdateenv [SUSv3] 21682 finite [LSB] finitef [LSB] finitel [LSB] floor [SUSv3] 21683 floorf [SUSv3] floorl [SUSv3] fma [SUSv3] fmaf [SUSv3] 21684 fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] fmaxl [SUSv3] 21685 fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] fmod [SUSv3] 21686 fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] frexpf [SUSv3] 21687 frexpl [SUSv3] gamma [LSB] gammaf [LSB] gammal [LSB] 21688 hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] ilogb [SUSv3] 21689 ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] j0f [LSB] 21690 j0l [LSB] j1 [SUSv3] j1f [LSB] j1l [LSB] 21691 jn [SUSv3] jnf [LSB] jnl [LSB] ldexp [SUSv3] 21692 ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] lgamma_r [LSB] 21693 lgammaf [SUSv3] lgammaf_r [LSB] lgammal [SUSv3] lgammal_r [LSB] 21694 llrint [SUSv3] llrintf [SUSv3] llrintl [SUSv3] llround [SUSv3] 21695 llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] log10 [SUSv3] 21696 log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] log1pf [SUSv3] 21697 log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] log2l [SUSv3] 21698 logb [SUSv3] logbf [SUSv3] logbl [SUSv3] logf [SUSv3] 21699 logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] lrintl [SUSv3] 21700 lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] matherr [LSB] 21701 modf [SUSv3] modff [SUSv3] modfl [SUSv3] nan [SUSv3] 21702 nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] nearbyintf [SUSv3] 21703 nearbyintl [SUSv3] nextafter [SUSv3] nextafterf [SUSv3] 21704 nextafterl [SUSv3] 21705 nexttoward [SUSv3] nexttowardf [SUSv3] nexttowardl [SUSv3] pow 21706 [SUSv3] 21707 pow10 [LSB] pow10f [LSB] pow10l [LSB] powf [SUSv3] 21708 powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] remainderl 21709 [SUSv3] 21710 remquo [SUSv3] remquof [SUSv3] remquol [SUSv3] rint [SUSv3] 21711 rintf [SUSv3] rintl [SUSv3] round [SUSv3] roundf [SUSv3] 21712 roundl [SUSv3] scalb [SUSv3] scalbf [LSB] scalbl [LSB] 21713 scalbln [SUSv3] scalblnf [SUSv3] scalblnl [SUSv3] scalbn 21714 [SUSv3] 21715 scalbnf [SUSv3] scalbnl [SUSv3] significand [LSB] significandf 21716 [LSB] 21717 significandl [LSB] sin [SUSv3] sincos [LSB] sincosf [LSB] 21718 sincosl [LSB] sinf [SUSv3] sinh [SUSv3] sinhf [SUSv3] 21719 sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] sqrtf [SUSv3] 21720 sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] tanh [SUSv3] 21721 tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] tgamma [SUSv3] 21722 tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] truncf [SUSv3] 21723 truncl [SUSv3] y0 [SUSv3] y0f [LSB] y0l [LSB] 21724 y1 [SUSv3] y1f [LSB] y1l [LSB] yn [SUSv3] 21725 ynf [LSB] ynl [LSB] 21726 21727 An LSB conforming implementation shall provide the generic 21728 deprecated functions for Math specified in Table 12-40, with 21729 the full mandatory functionality as described in the referenced 21730 underlying specification. 21731 21732 Note: These interfaces are deprecated, and applications 21733 should avoid using them. These interfaces may be withdrawn 21734 in future releases of this specification. 21735 21736 Table 12-40. libm - Math Deprecated Function Interfaces 21737 drem [LSB] dremf [LSB] dreml [LSB] finite [LSB] 21738 finitef [LSB] finitel [LSB] gamma [LSB] gammaf [LSB] 21739 gammal [LSB] matherr [LSB] 21740 21741 An LSB conforming implementation shall provide the generic data 21742 interfaces for Math specified in Table 12-41, with the full 21743 mandatory functionality as described in the referenced 21744 underlying specification. 21745 21746 Table 12-41. libm - Math Data Interfaces 21747 signgam [SUSv3] 21748 __________________________________________________________ 21749 21750 12.7. Data Definitions for libm 21751 21752 This section defines global identifiers and their values that 21753 are associated with interfaces contained in libm. These 21754 definitions are organized into groups that correspond to system 21755 headers. This convention is used as a convenience for the 21756 reader, and does not imply the existence of these headers, or 21757 their content. Where an interface is defined as requiring a 21758 particular system header file all of the data definitions for 21759 that system header file presented here shall be in effect. 21760 21761 This section gives data definitions to promote binary 21762 application portability, not to repeat source interface 21763 definitions available elsewhere. System providers and 21764 application developers should use this ABI to supplement - not 21765 to replace - source interface definition specifications. 21766 21767 This specification uses the ISO C (1999) C Language as the 21768 reference programming language, and data definitions are 21769 specified in ISO C format. The C language is used here as a 21770 convenient notation. Using a C language description of these 21771 data objects does not preclude their use by other programming 21772 languages. 21773 __________________________________________________________ 21774 21775 12.7.1. complex.h 21776 21777 #define complex _Complex 21778 21779 extern double cabs(double complex); 21780 extern float cabsf(float complex); 21781 extern long double cabsl(long double complex); 21782 extern double complex cacos(double complex); 21783 extern float complex cacosf(float complex); 21784 extern double complex cacosh(double complex); 21785 extern float complex cacoshf(float complex); 21786 extern long double complex cacoshl(long double complex); 21787 extern long double complex cacosl(long double complex); 21788 extern double carg(double complex); 21789 extern float cargf(float complex); 21790 extern long double cargl(long double complex); 21791 extern double complex casin(double complex); 21792 extern float complex casinf(float complex); 21793 extern double complex casinh(double complex); 21794 extern float complex casinhf(float complex); 21795 extern long double complex casinhl(long double complex); 21796 extern long double complex casinl(long double complex); 21797 extern double complex catan(double complex); 21798 extern float complex catanf(float complex); 21799 extern double complex catanh(double complex); 21800 extern float complex catanhf(float complex); 21801 extern long double complex catanhl(long double complex); 21802 extern long double complex catanl(long double complex); 21803 extern double complex ccos(double complex); 21804 extern float complex ccosf(float complex); 21805 extern double complex ccosh(double complex); 21806 extern float complex ccoshf(float complex); 21807 extern long double complex ccoshl(long double complex); 21808 extern long double complex ccosl(long double complex); 21809 extern double complex cexp(double complex); 21810 extern float complex cexpf(float complex); 21811 extern long double complex cexpl(long double complex); 21812 extern double cimag(double complex); 21813 extern float cimagf(float complex); 21814 extern long double cimagl(long double complex); 21815 extern double complex clog(double complex); 21816 extern double complex clog10(double complex); 21817 extern float complex clog10f(float complex); 21818 extern long double complex clog10l(long double complex); 21819 extern float complex clogf(float complex); 21820 extern long double complex clogl(long double complex); 21821 extern double complex conj(double complex); 21822 extern float complex conjf(float complex); 21823 extern long double complex conjl(long double complex); 21824 extern double complex cpow(double complex, double complex); 21825 extern float complex cpowf(float complex, float complex); 21826 extern long double complex cpowl(long double complex, long double complex); 21827 extern double complex cproj(double complex); 21828 extern float complex cprojf(float complex); 21829 extern long double complex cprojl(long double complex); 21830 extern double creal(double complex); 21831 extern float crealf(float complex); 21832 extern long double creall(long double complex); 21833 extern double complex csin(double complex); 21834 extern float complex csinf(float complex); 21835 extern double complex csinh(double complex); 21836 extern float complex csinhf(float complex); 21837 extern long double complex csinhl(long double complex); 21838 extern long double complex csinl(long double complex); 21839 extern double complex csqrt(double complex); 21840 extern float complex csqrtf(float complex); 21841 extern long double complex csqrtl(long double complex); 21842 extern double complex ctan(double complex); 21843 extern float complex ctanf(float complex); 21844 extern double complex ctanh(double complex); 21845 extern float complex ctanhf(float complex); 21846 extern long double complex ctanhl(long double complex); 21847 extern long double complex ctanl(long double complex); 21848 __________________________________________________________ 21849 21850 12.7.2. fenv.h 21851 21852 extern int feclearexcept(int __excepts); 21853 extern int fedisableexcept(int __excepts); 21854 extern int feenableexcept(int __excepts); 21855 extern int fegetenv(fenv_t * __envp); 21856 extern int fegetexcept(void); 21857 extern int fegetexceptflag(fexcept_t * __flagp, int __excepts); 21858 extern int fegetround(void); 21859 extern int feholdexcept(fenv_t * __envp); 21860 extern int feraiseexcept(int __excepts); 21861 extern int fesetenv(const fenv_t * __envp); 21862 extern int fesetexceptflag(const fexcept_t * __flagp, int __excepts); 21863 extern int fesetround(int __rounding_direction); 21864 extern int fetestexcept(int __excepts); 21865 extern int feupdateenv(const fenv_t * __envp); 21866 __________________________________________________________ 21867 21868 12.7.3. math.h 21869 21870 #define DOMAIN 1 21871 #define SING 2 21872 21873 #define FP_NAN 0 21874 #define FP_INFINITE 1 21875 #define FP_ZERO 2 21876 #define FP_SUBNORMAL 3 21877 #define FP_NORMAL 4 21878 21879 #define isnormal(x) (fpclassify (x) == FP_NORMAL) /* Return nonzero value if X is neither zero, subnormal, Inf, n */ 21880 21881 #define HUGE_VAL 0x1.0p2047 21882 #define HUGE_VALF 0x1.0p255f 21883 21884 #define NAN ((float)0x7fc00000UL) 21885 #define M_1_PI 0.31830988618379067154 21886 #define M_LOG10E 0.43429448190325182765 21887 #define M_2_PI 0.63661977236758134308 21888 #define M_LN2 0.69314718055994530942 21889 #define M_SQRT1_2 0.70710678118654752440 21890 #define M_PI_4 0.78539816339744830962 21891 #define M_2_SQRTPI 1.12837916709551257390 21892 #define M_SQRT2 1.41421356237309504880 21893 #define M_LOG2E 1.4426950408889634074 21894 #define M_PI_2 1.57079632679489661923 21895 #define M_LN10 2.30258509299404568402 21896 #define M_E 2.7182818284590452354 21897 #define M_PI 3.14159265358979323846 21898 #define INFINITY HUGE_VALF 21899 21900 #define MATH_ERRNO 1 /* errno set by math functions. */ 21901 #define MATH_ERREXCEPT 2 /* Exceptions raised by math functions.*/ 21902 21903 #define isunordered(u, v) \ 21904 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))/* Return nonzero value if arguments are unordered. */ 21905 #define islessgreater(x, y) \ 21906 (__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 */ 21907 #define isless(x,y) \ 21908 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) /* Return nonzero valueif X is less than Y. */ 21909 #define islessequal(x, y) \ 21910 (__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. */ 21911 #define isgreater(x,y) \ 21912 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) /* Return nonzero valueif X is greater than Y. */ 21913 #define isgreaterequal(x,y) \ 21914 (__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. */ 21915 21916 extern int __finite(double); 21917 extern int __finitef(float); 21918 extern int __finitel(long double); 21919 extern int __fpclassify(double); 21920 extern int __fpclassifyf(float); 21921 extern int __isinf(double); 21922 extern int __isinff(float); 21923 extern int __isinfl(long double); 21924 extern int __isnan(double); 21925 extern int __isnanf(float); 21926 extern int __isnanl(long double); 21927 extern int __signbit(double); 21928 extern int __signbitf(float); 21929 extern double acos(double); 21930 extern float acosf(float); 21931 extern double acosh(double); 21932 extern float acoshf(float); 21933 extern long double acoshl(long double); 21934 extern long double acosl(long double); 21935 extern double asin(double); 21936 extern float asinf(float); 21937 extern double asinh(double); 21938 extern float asinhf(float); 21939 extern long double asinhl(long double); 21940 extern long double asinl(long double); 21941 extern double atan(double); 21942 extern double atan2(double, double); 21943 extern float atan2f(float, float); 21944 extern long double atan2l(long double, long double); 21945 extern float atanf(float); 21946 extern double atanh(double); 21947 extern float atanhf(float); 21948 extern long double atanhl(long double); 21949 extern long double atanl(long double); 21950 extern double cbrt(double); 21951 extern float cbrtf(float); 21952 extern long double cbrtl(long double); 21953 extern double ceil(double); 21954 extern float ceilf(float); 21955 extern long double ceill(long double); 21956 extern double copysign(double, double); 21957 extern float copysignf(float, float); 21958 extern long double copysignl(long double, long double); 21959 extern double cos(double); 21960 extern float cosf(float); 21961 extern double cosh(double); 21962 extern float coshf(float); 21963 extern long double coshl(long double); 21964 extern long double cosl(long double); 21965 extern double drem(double, double); 21966 extern float dremf(float, float); 21967 extern long double dreml(long double, long double); 21968 extern double erf(double); 21969 extern double erfc(double); 21970 extern float erfcf(float); 21971 extern long double erfcl(long double); 21972 extern float erff(float); 21973 extern long double erfl(long double); 21974 extern double exp(double); 21975 extern double exp10(double); 21976 extern float exp10f(float); 21977 extern long double exp10l(long double); 21978 extern double exp2(double); 21979 extern float exp2f(float); 21980 extern float expf(float); 21981 extern long double expl(long double); 21982 extern double expm1(double); 21983 extern float expm1f(float); 21984 extern long double expm1l(long double); 21985 extern double fabs(double); 21986 extern float fabsf(float); 21987 extern long double fabsl(long double); 21988 extern double fdim(double, double); 21989 extern float fdimf(float, float); 21990 extern long double fdiml(long double, long double); 21991 extern int finite(double); 21992 extern int finitef(float); 21993 extern int finitel(long double); 21994 extern double floor(double); 21995 extern float floorf(float); 21996 extern long double floorl(long double); 21997 extern double fma(double, double, double); 21998 extern float fmaf(float, float, float); 21999 extern long double fmal(long double, long double, long double); 22000 extern double fmax(double, double); 22001 extern float fmaxf(float, float); 22002 extern long double fmaxl(long double, long double); 22003 extern double fmin(double, double); 22004 extern float fminf(float, float); 22005 extern long double fminl(long double, long double); 22006 extern double fmod(double, double); 22007 extern float fmodf(float, float); 22008 extern long double fmodl(long double, long double); 22009 extern double frexp(double, int *); 22010 extern float frexpf(float, int *); 22011 extern long double frexpl(long double, int *); 22012 extern double gamma(double); 22013 extern float gammaf(float); 22014 extern long double gammal(long double); 22015 extern double hypot(double, double); 22016 extern float hypotf(float, float); 22017 extern long double hypotl(long double, long double); 22018 extern int ilogb(double); 22019 extern int ilogbf(float); 22020 extern int ilogbl(long double); 22021 extern double j0(double); 22022 extern float j0f(float); 22023 extern long double j0l(long double); 22024 extern double j1(double); 22025 extern float j1f(float); 22026 extern long double j1l(long double); 22027 extern double jn(int, double); 22028 extern float jnf(int, float); 22029 extern long double jnl(int, long double); 22030 extern double ldexp(double, int); 22031 extern float ldexpf(float, int); 22032 extern long double ldexpl(long double, int); 22033 extern double lgamma(double); 22034 extern double lgamma_r(double, int *); 22035 extern float lgammaf(float); 22036 extern float lgammaf_r(float, int *); 22037 extern long double lgammal(long double); 22038 extern long double lgammal_r(long double, int *); 22039 extern long long int llrint(double); 22040 extern long long int llrintf(float); 22041 extern long long int llrintl(long double); 22042 extern long long int llround(double); 22043 extern long long int llroundf(float); 22044 extern long long int llroundl(long double); 22045 extern double log(double); 22046 extern double log10(double); 22047 extern float log10f(float); 22048 extern long double log10l(long double); 22049 extern double log1p(double); 22050 extern float log1pf(float); 22051 extern long double log1pl(long double); 22052 extern double log2(double); 22053 extern float log2f(float); 22054 extern long double log2l(long double); 22055 extern double logb(double); 22056 extern float logbf(float); 22057 extern long double logbl(long double); 22058 extern float logf(float); 22059 extern long double logl(long double); 22060 extern long int lrint(double); 22061 extern long int lrintf(float); 22062 extern long int lrintl(long double); 22063 extern long int lround(double); 22064 extern long int lroundf(float); 22065 extern long int lroundl(long double); 22066 extern double modf(double, double *); 22067 extern float modff(float, float *); 22068 extern long double modfl(long double, long double *); 22069 extern double nan(const char *); 22070 extern float nanf(const char *); 22071 extern long double nanl(const char *); 22072 extern double nearbyint(double); 22073 extern float nearbyintf(float); 22074 extern long double nearbyintl(long double); 22075 extern double nextafter(double, double); 22076 extern float nextafterf(float, float); 22077 extern long double nextafterl(long double, long double); 22078 extern double nexttoward(double, long double); 22079 extern float nexttowardf(float, long double); 22080 extern long double nexttowardl(long double, long double); 22081 extern double pow(double, double); 22082 extern double pow10(double); 22083 extern float pow10f(float); 22084 extern long double pow10l(long double); 22085 extern float powf(float, float); 22086 extern long double powl(long double, long double); 22087 extern double remainder(double, double); 22088 extern float remainderf(float, float); 22089 extern long double remainderl(long double, long double); 22090 extern double remquo(double, double, int *); 22091 extern float remquof(float, float, int *); 22092 extern long double remquol(long double, long double, int *); 22093 extern double rint(double); 22094 extern float rintf(float); 22095 extern long double rintl(long double); 22096 extern double round(double); 22097 extern float roundf(float); 22098 extern long double roundl(long double); 22099 extern double scalb(double, double); 22100 extern float scalbf(float, float); 22101 extern long double scalbl(long double, long double); 22102 extern double scalbln(double, long int); 22103 extern float scalblnf(float, long int); 22104 extern long double scalblnl(long double, long int); 22105 extern double scalbn(double, int); 22106 extern float scalbnf(float, int); 22107 extern long double scalbnl(long double, int); 22108 extern int signgam; 22109 extern double significand(double); 22110 extern float significandf(float); 22111 extern long double significandl(long double); 22112 extern double sin(double); 22113 extern void sincos(double, double *, double *); 22114 extern void sincosf(float, float *, float *); 22115 extern void sincosl(long double, long double *, long double *); 22116 extern float sinf(float); 22117 extern double sinh(double); 22118 extern float sinhf(float); 22119 extern long double sinhl(long double); 22120 extern long double sinl(long double); 22121 extern double sqrt(double); 22122 extern float sqrtf(float); 22123 extern long double sqrtl(long double); 22124 extern double tan(double); 22125 extern float tanf(float); 22126 extern double tanh(double); 22127 extern float tanhf(float); 22128 extern long double tanhl(long double); 22129 extern long double tanl(long double); 22130 extern double tgamma(double); 22131 extern float tgammaf(float); 22132 extern long double tgammal(long double); 22133 extern double trunc(double); 22134 extern float truncf(float); 22135 extern long double truncl(long double); 22136 extern double y0(double); 22137 extern float y0f(float); 22138 extern long double y0l(long double); 22139 extern double y1(double); 22140 extern float y1f(float); 22141 extern long double y1l(long double); 22142 extern double yn(int, double); 22143 extern float ynf(int, float); 22144 extern long double ynl(int, long double); 22145 __________________________________________________________ 22146 22147 12.8. Interface Definitions for libm 22148 22149 Table of Contents 22150 __finite -- test for infinity 22151 __finitef -- test for infinity 22152 __finitel -- test for infinity 22153 __fpclassify -- Classify real floating type 22154 __fpclassifyf -- Classify real floating type 22155 __signbit -- test sign of floating point value 22156 __signbitf -- test sign of floating point value 22157 clog10 -- Logarithm of a Complex Number 22158 clog10f -- Logarithm of a Complex Number 22159 clog10l -- Logarithm of a Complex Number 22160 drem -- Floating Point Remainder (DEPRECATED) 22161 dremf -- Floating Point Remainder (DEPRECATED) 22162 dreml -- Floating Point Remainder (DEPRECATED) 22163 exp10 -- Base-10 power function 22164 exp10f -- Base-10 power function 22165 exp10l -- Base-10 power function 22166 fedisableexcept -- disable floating point exceptions 22167 feenableexcept -- enable floating point exceptions 22168 fegetexcept -- query floating point exception handling state 22169 finite -- test for infinity (DEPRECATED) 22170 finitef -- test for infinity (DEPRECATED) 22171 finitel -- test for infinity (DEPRECATED) 22172 gamma -- log gamma function (DEPRECATED) 22173 gammaf -- log gamma function (DEPRECATED) 22174 gammal -- log gamma function (DEPRECATED) 22175 j0f -- Bessel functions 22176 j0l -- Bessel functions 22177 j1f -- Bessel functions 22178 j1l -- Bessel functions 22179 jnf -- Bessel functions 22180 jnl -- Bessel functions 22181 lgamma_r -- log gamma functions 22182 lgammaf_r -- log gamma functions 22183 lgammal_r -- log gamma functions 22184 matherr -- math library exception handling 22185 pow10 -- Base-10 power function 22186 pow10f -- Base-10 power function 22187 pow10l -- Base-10 power function 22188 scalbf -- load exponent of radix-independent floating point 22189 number 22190 22191 scalbl -- load exponent of radix-independent floating point 22192 number 22193 22194 significand -- floating point mantissa 22195 significandf -- floating point mantissa 22196 significandl -- floating point mantissa 22197 sincos -- trigonometric functions 22198 sincosf -- trigonometric functions 22199 sincosl -- trigonometric functions 22200 y0f -- Bessel functions 22201 y0l -- Bessel functions 22202 y1f -- Bessel functions 22203 y1l -- Bessel functions 22204 ynf -- Bessel functions 22205 ynl -- Bessel functions 22206 22207 The interfaces defined on the following pages are included in 22208 libm and are defined by this specification. Unless otherwise 22209 noted, these interfaces shall be included in the source 22210 standard. 22211 22212 Other interfaces listed in Section 12.6 shall behave as 22213 described in the referenced base document. 22214 22215 __finite 22216 22217 Name 22218 22219 __finite -- test for infinity 22220 22221 Synopsis 22222 22223 #include 22224 22225 int __finite(double arg); 22226 22227 Description 22228 22229 __finite() has the same specification as isfinite() in POSIX 22230 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 22231 for __finite() is known to be double. 22232 22233 __finite() is not in the source standard; it is only in the 22234 binary standard. 22235 22236 __finitef 22237 22238 Name 22239 22240 __finitef -- test for infinity 22241 22242 Synopsis 22243 22244 #include 22245 22246 int __finitef(float arg); 22247 22248 Description 22249 22250 __finitef() has the same specification as isfinite() in POSIX 22251 1003.1-2001 (ISO/IEC 9945-2003) except that the argument type 22252 for __finitef() is known to be float. 22253 22254 __finitef() is not in the source standard; it is only in the 22255 binary standard. 22256 22257 __finitel 22258 22259 Name 22260 22261 __finitel -- test for infinity 22262 22263 Synopsis 22264 22265 #include 22266 22267 int __finitel(long double arg); 22268 22269 Description 22270 22271 __finitel() has the same specification as isfinite() in the 22272 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except that the argument 22273 type for __finitel() is known to be long double. 22274 22275 __finitel() is not in the source standard; it is only in the 22276 binary standard. 22277 22278 __fpclassify 22279 22280 Name 22281 22282 __fpclassify -- Classify real floating type 22283 22284 Synopsis 22285 22286 int __fpclassify(double arg); 22287 22288 Description 22289 22290 __fpclassify() has the same specification as fpclassify() in 22291 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except that the argument 22292 type for __fpclassify() is known to be double. 22293 22294 __fpclassify() is not in the source standard; it is only in the 22295 binary standard. 22296 22297 __fpclassifyf 22298 22299 Name 22300 22301 __fpclassifyf -- Classify real floating type 22302 22303 Synopsis 22304 22305 int __fpclassifyf(float arg); 22306 22307 Description 22308 22309 __fpclassifyf() has the same specification as fpclassify() in 22310 POSIX 1003.1-2001 (ISO/IEC 9945-2003), except that the argument 22311 type for __fpclassifyf() is known to be float. 22312 22313 __fpclassifyf() is not in the source standard; it is only in 22314 the binary standard. 22315 22316 __signbit 22317 22318 Name 22319 22320 __signbit -- test sign of floating point value 22321 22322 Synopsis 22323 22324 #include 22325 22326 int __signbit(double arg); 22327 22328 Description 22329 22330 __signbit() has the same specification as signbit() in POSIX 22331 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 22332 for __signbit() is known to be double. 22333 22334 __signbit() is not in the source standard; it is only in the 22335 binary standard. 22336 22337 __signbitf 22338 22339 Name 22340 22341 __signbitf -- test sign of floating point value 22342 22343 Synopsis 22344 22345 #include 22346 22347 int __signbitf(float arg); 22348 22349 Description 22350 22351 __signbitf() has the same specification as signbit() in POSIX 22352 1003.1-2001 (ISO/IEC 9945-2003), except that the argument type 22353 for __signbitf() is known to be float. 22354 22355 __signbitf() is not in the source standard; it is only in the 22356 binary standard. 22357 22358 clog10 22359 22360 Name 22361 22362 clog10 -- Logarithm of a Complex Number 22363 22364 Synopsis 22365 22366 #include 22367 22368 double complex clog10(double complex z); 22369 22370 Description 22371 22372 The clog10() function shall compute the base 10 logarithm of 22373 the complex number z. 22374 22375 Return Value 22376 22377 The clog10() function shall return the base 10 logarithm. 22378 22379 clog10f 22380 22381 Name 22382 22383 clog10f -- Logarithm of a Complex Number 22384 22385 Synopsis 22386 22387 #include 22388 22389 float complex clog10f(float complex z); 22390 22391 Description 22392 22393 The clog10f() function shall compute the base 10 logarithm of 22394 the complex number z. 22395 22396 Return Value 22397 22398 The clog10f() function shall return the base 10 logarithm. 22399 22400 clog10l 22401 22402 Name 22403 22404 clog10l -- Logarithm of a Complex Number 22405 22406 Synopsis 22407 22408 #include 22409 22410 long double complex clog10l(long double complex z); 22411 22412 Description 22413 22414 The clog10l() function shall compute the base 10 logarithm of 22415 the complex number z. 22416 22417 Return Value 22418 22419 The clog10l() function shall return the base 10 logarithm. 22420 22421 drem 22422 22423 Name 22424 22425 drem -- Floating Point Remainder (DEPRECATED) 22426 22427 Synopsis 22428 22429 #include 22430 22431 double drem(double x, double y); 22432 22433 Description 22434 22435 The drem() function shall return the floating point remainder, 22436 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 22437 same way as remainder(). 22438 22439 Note: This function is included only for backwards 22440 compatibility; applications should use remainder() instead. 22441 22442 Returns 22443 22444 See remainder(). 22445 22446 See Also 22447 22448 remainder(), dremf(), dreml() 22449 22450 dremf 22451 22452 Name 22453 22454 dremf -- Floating Point Remainder (DEPRECATED) 22455 22456 Synopsis 22457 22458 #include 22459 22460 double dremf(double x, double y); 22461 22462 Description 22463 22464 The dremf() function shall return the floating point remainder, 22465 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 22466 same way as remainderf(). 22467 22468 Note: This function is included only for backwards 22469 compatibility; applications should use remainderf() instead. 22470 22471 Returns 22472 22473 See remainderf(). 22474 22475 See Also 22476 22477 remainderf(), drem(), dreml() 22478 22479 dreml 22480 22481 Name 22482 22483 dreml -- Floating Point Remainder (DEPRECATED) 22484 22485 Synopsis 22486 22487 #include 22488 22489 double dreml(double x, double y); 22490 22491 Description 22492 22493 The dreml() function shall return the floating point remainder, 22494 x REM y as required by IEC 60559/IEEE 754 Floating Point in the 22495 same way as remainderl(). 22496 22497 Note: This function is included only for backwards 22498 compatibility; applications should use remainderl() instead. 22499 22500 Returns 22501 22502 See remainderl(). 22503 22504 See Also 22505 22506 remainderl(), drem(), dremf() 22507 22508 exp10 22509 22510 Name 22511 22512 exp10 -- Base-10 power function 22513 22514 Synopsis 22515 22516 #include 22517 22518 double exp10(double x); 22519 22520 Description 22521 22522 The exp10() function shall return 10^x. 22523 22524 Note: This function is identical to pow10(). 22525 22526 Returns 22527 22528 Upon successful completion, exp10() shall return 10 rised to 22529 the power of x. 22530 22531 If the correct value would cause overflow, a range error shall 22532 occur and exp10() shall return ±HUGE_VAL, with the same sign as 22533 the correct value of the function. 22534 22535 See Also 22536 22537 pow10(), exp10f(), exp10l() 22538 22539 exp10f 22540 22541 Name 22542 22543 exp10f -- Base-10 power function 22544 22545 Synopsis 22546 22547 #include 22548 22549 float exp10f(float x); 22550 22551 Description 22552 22553 The exp10f() function shall return 10^x. 22554 22555 Note: This function is identical to pow10f(). 22556 22557 Returns 22558 22559 Upon successful completion, exp10f() shall return 10 rised to 22560 the power of x. 22561 22562 If the correct value would cause overflow, a range error shall 22563 occur and exp10f() shall return ±HUGE_VALF, with the same sign 22564 as the correct value of the function. 22565 22566 See Also 22567 22568 pow10f(), exp10(), exp10l() 22569 22570 exp10l 22571 22572 Name 22573 22574 exp10l -- Base-10 power function 22575 22576 Synopsis 22577 22578 #include 22579 22580 long double exp10l(long double x); 22581 22582 Description 22583 22584 The exp10l() function shall return 10^x. 22585 22586 Note: This function is identical to pow10l(). 22587 22588 Returns 22589 22590 Upon successful completion, exp10l() shall return 10 rised to 22591 the power of x. 22592 22593 If the correct value would cause overflow, a range error shall 22594 occur and exp10l() shall return ±HUGE_VALL, with the same sign 22595 as the correct value of the function. 22596 22597 See Also 22598 22599 pow10l(), exp10(), exp10f() 22600 22601 fedisableexcept 22602 22603 Name 22604 22605 fedisableexcept -- disable floating point exceptions 22606 22607 Synopsis 22608 22609 #include 22610 22611 int fedisableexcept(int excepts); 22612 22613 Description 22614 22615 The fedisableexcept() function disables traps for each of the 22616 exceptions represented by the mask excepts. 22617 22618 Return Value 22619 22620 The fedisableexcept() function returns the previous set of 22621 enabled exceptions on success. On error, -1 is returned. 22622 22623 Errors 22624 22625 No errors are defined, but the function will fail if not 22626 supported on the architecture. 22627 22628 feenableexcept 22629 22630 Name 22631 22632 feenableexcept -- enable floating point exceptions 22633 22634 Synopsis 22635 22636 #include 22637 22638 int feenableexcept(int excepts); 22639 22640 Description 22641 22642 The feenableexcept() function enables traps for each of the 22643 exceptions represented by the mask excepts. 22644 22645 Return Value 22646 22647 The feenableexcept() function returns the previous set of 22648 enabled exceptions on success. On error, -1 is returned. 22649 22650 Errors 22651 22652 No errors are defined, but the function will fail if not 22653 supported on the architecture. 22654 22655 fegetexcept 22656 22657 Name 22658 22659 fegetexcept -- query floating point exception handling state 22660 22661 Synopsis 22662 22663 #include 22664 22665 int fegetexcept 22666 22667 Description 22668 22669 The fegetexcept() function returns the set of all currently 22670 enabled exceptions. 22671 22672 Return Value 22673 22674 The fegetexcept() function returns the set of all currently 22675 enabled exceptions. 22676 22677 Errors 22678 22679 No errors are defined, but the function will fail if not 22680 supported on the architecture. 22681 22682 finite 22683 22684 Name 22685 22686 finite -- test for infinity (DEPRECATED) 22687 22688 Synopsis 22689 22690 #define _SVID_SOURCE 22691 #include 22692 22693 int finite(double arg); 22694 22695 Description 22696 22697 The finite() function shall test whether its argument is 22698 neither INFINITY nor not a number (NaN). 22699 22700 Returns 22701 22702 On success, finite() shall return 1. Otherwise the function 22703 shall return 0. 22704 22705 Note: The ISO C (1999) standard defines the function 22706 isfinite(), which is more general purpose. The finite() 22707 function is deprecated, and applications should use 22708 isfinite() instead. A future revision of this standard may 22709 remove this function. 22710 22711 See Also 22712 22713 isfinite(), finitef(), finitel() 22714 22715 finitef 22716 22717 Name 22718 22719 finitef -- test for infinity (DEPRECATED) 22720 22721 Synopsis 22722 22723 #define _SVID_SOURCE 22724 #include 22725 22726 int finitef(float arg); 22727 22728 Description 22729 22730 The finitef() function shall test whether its argument is 22731 neither INFINITY nor not a number (NaN). 22732 22733 Returns 22734 22735 On success, finitef() shall return 1. Otherwise the function 22736 shall return 0. 22737 22738 Note: The ISO C (1999) standard defines the function 22739 isfinite(), which is more general purpose. The finitef() 22740 function is deprecated, and applications should use 22741 isfinite() instead. A future revision of this standard may 22742 remove this function. 22743 22744 See Also 22745 22746 isfinite(), finite(), finitel() 22747 22748 finitel 22749 22750 Name 22751 22752 finitel -- test for infinity (DEPRECATED) 22753 22754 Synopsis 22755 22756 #define _SVID_SOURCE 22757 #include 22758 22759 int finitel(long double arg); 22760 22761 Description 22762 22763 The finitel() function shall test whether its argument is 22764 neither INFINITY nor not a number (NaN). 22765 22766 Returns 22767 22768 On success, finitel() shall return 1. Otherwise the function 22769 shall return 0. 22770 22771 Note: The ISO C (1999) standard defines the function 22772 isfinite(), which is more general purpose. The finitel() 22773 function is deprecated, and applications should use 22774 isfinite() instead. A future revision of this standard may 22775 remove this function. 22776 22777 See Also 22778 22779 isfinite(), finite(), finitef() 22780 22781 gamma 22782 22783 Name 22784 22785 gamma -- log gamma function (DEPRECATED) 22786 22787 Synopsis 22788 22789 #include 22790 22791 double gammaf(double x); 22792 22793 Description 22794 22795 The gamma() function is identical to lgamma() in POSIX 22796 1003.1-2001 (ISO/IEC 9945-2003). 22797 22798 Note: The name gamma() for this function is deprecated and 22799 should not be used. 22800 22801 Returns 22802 22803 See lgamma(). 22804 22805 See Also 22806 22807 lgamma(), lgammaf(), lgammal(), gammaf(), gammal() 22808 22809 gammaf 22810 22811 Name 22812 22813 gammaf -- log gamma function (DEPRECATED) 22814 22815 Synopsis 22816 22817 #include 22818 22819 float gammaf(float x); 22820 22821 Description 22822 22823 The gammaf() function is identical to lgammaf() in POSIX 22824 1003.1-2001 (ISO/IEC 9945-2003). 22825 22826 Note: The name gammaf() for this function is deprecated and 22827 should not be used. 22828 22829 Returns 22830 22831 See lgammaf(). 22832 22833 See Also 22834 22835 lgamma(), lgammaf(), lgammal(), gamma(), gammal() 22836 22837 gammal 22838 22839 Name 22840 22841 gammal -- log gamma function (DEPRECATED) 22842 22843 Synopsis 22844 22845 #include 22846 22847 long double gammal(long double x); 22848 22849 Description 22850 22851 The gammal() function is identical to lgammal() in POSIX 22852 1003.1-2001 (ISO/IEC 9945-2003). 22853 22854 Note: The name gammal() for this function is deprecated and 22855 should not be used. 22856 22857 Returns 22858 22859 See lgammal(). 22860 22861 See Also 22862 22863 lgamma(), lgammaf(), lgammal(), gamma(), gammaf() 22864 22865 j0f 22866 22867 Name 22868 22869 j0f -- Bessel functions 22870 22871 Synopsis 22872 22873 #include 22874 22875 float j0f(float x); 22876 22877 Description 22878 22879 The j0f() function is identical to j0(), except that the 22880 argument x and the return value is a float. 22881 22882 Returns 22883 22884 See j0(). 22885 22886 See Also 22887 22888 j0(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 22889 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22890 22891 j0l 22892 22893 Name 22894 22895 j0l -- Bessel functions 22896 22897 Synopsis 22898 22899 #include 22900 22901 long double j0l(long double x); 22902 22903 Description 22904 22905 The j0l() function is identical to j0(), except that the 22906 argument x and the return value is a long double. 22907 22908 Returns 22909 22910 See j0(). 22911 22912 See Also 22913 22914 j0(), j0f(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), y0(), 22915 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22916 22917 j1f 22918 22919 Name 22920 22921 j1f -- Bessel functions 22922 22923 Synopsis 22924 22925 #include 22926 22927 float j1f(float x); 22928 22929 Description 22930 22931 The j1f() function is identical to j1(), except that the 22932 argument x and the return value is a float. 22933 22934 Returns 22935 22936 See j1(). 22937 22938 See Also 22939 22940 j0(), j0f(), j0l(), j1(), j1l(), jn(), jnf(), jnl(), y0(), 22941 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22942 22943 j1l 22944 22945 Name 22946 22947 j1l -- Bessel functions 22948 22949 Synopsis 22950 22951 #include 22952 22953 long double j1l(long double x); 22954 22955 Description 22956 22957 The j1l() function is identical to j1(), except that the 22958 argument x and the return value is a long double. 22959 22960 Returns 22961 22962 See j0(). 22963 22964 See Also 22965 22966 j0(), j0f(), j0l(), j1(), j1f(), jn(), jnf(), jnl(), y0(), 22967 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22968 22969 jnf 22970 22971 Name 22972 22973 jnf -- Bessel functions 22974 22975 Synopsis 22976 22977 #include 22978 22979 float jnf(float x); 22980 22981 Description 22982 22983 The jnf() function is identical to jn(), except that the 22984 argument x and the return value is a float. 22985 22986 Returns 22987 22988 See jn(). 22989 22990 See Also 22991 22992 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnl(), y0(), 22993 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 22994 22995 jnl 22996 22997 Name 22998 22999 jnl -- Bessel functions 23000 23001 Synopsis 23002 23003 #include 23004 23005 long double jnl(long double x); 23006 23007 Description 23008 23009 The jnl() function is identical to jn(), except that the 23010 argument x and the return value is a long double. 23011 23012 Returns 23013 23014 See jn(). 23015 23016 See Also 23017 23018 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), y0(), 23019 y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 23020 23021 lgamma_r 23022 23023 Name 23024 23025 lgamma_r -- log gamma functions 23026 23027 Synopsis 23028 23029 #include 23030 23031 double lgamma_r(double x, int * signp); 23032 23033 Description 23034 23035 The lgamma_r() function shall compute the natural logarithm of 23036 the absolute value of the Gamma function, as lgamma(). However, 23037 instead of setting the external integer signgam to the sign of 23038 the Gamma function, lgamma_r() shall set the integer referenced 23039 by signp to the sign. 23040 23041 Returns 23042 23043 See lgamma() and signgam. 23044 23045 See Also 23046 23047 lgamma(), lgammaf_r(), lgammal_r(), signgam 23048 23049 lgammaf_r 23050 23051 Name 23052 23053 lgammaf_r -- log gamma functions 23054 23055 Synopsis 23056 23057 #include 23058 23059 float lgammaf_r(float x, int * signp); 23060 23061 Description 23062 23063 The lgammaf_r() function shall compute the natural logarithm of 23064 the absolute value of the Gamma function, as lgammaf(). 23065 However, instead of setting the external integer signgam to the 23066 sign of the Gamma function, lgammaf_r() shall set the integer 23067 referenced by signp to the sign. 23068 23069 Returns 23070 23071 See lgammaf() and signgam. 23072 23073 See Also 23074 23075 lgamma(), lgamma_r(), lgammal_r(), signgam 23076 23077 lgammal_r 23078 23079 Name 23080 23081 lgammal_r -- log gamma functions 23082 23083 Synopsis 23084 23085 #include 23086 23087 double lgammal_r(double x, int * signp); 23088 23089 Description 23090 23091 The lgammal_r() function shall compute the natural logarithm of 23092 the absolute value of the Gamma function, as lgammal(). 23093 However, instead of setting the external integer signgam to the 23094 sign of the Gamma function, lgammal_r() shall set the integer 23095 referenced by signp to the sign. 23096 23097 Returns 23098 23099 See lgammal() and signgam. 23100 23101 See Also 23102 23103 lgamma(), lgamma_r(), lgammaf_r(), signgam 23104 23105 matherr 23106 23107 Name 23108 23109 matherr -- math library exception handling 23110 23111 Synopsis 23112 23113 #include 23114 23115 int matherr(struct exception *__exc); 23116 23117 Description 23118 23119 The System V Interface Definition (SVID) Issue 3 specifies that 23120 various math functions should invoke a function called 23121 matherr() if a math exception is detected. This function is 23122 called before the math function returns; after matherr() 23123 returns, the system then returns to the math function, which in 23124 turn returns to the caller. 23125 23126 matherr() is obsolete; indeed it was withdrawn in the System V 23127 Interface Definition (SVID) Issue 4, and is required only by 23128 this specification for historical compatibility, and will be 23129 removed in a future version. The floating point environment 23130 function group including fesetenv() should be used instead. 23131 23132 matherr() is not in the source standard; it is only in the 23133 binary standard. 23134 23135 See Also 23136 23137 fesetenv(), fegetenv(), feupdateenv(). 23138 23139 pow10 23140 23141 Name 23142 23143 pow10 -- Base-10 power function 23144 23145 Synopsis 23146 23147 #include 23148 23149 double pow10(double x); 23150 23151 Description 23152 23153 The pow10() function shall return 10^x. 23154 23155 Note: This function is identical to exp10(). 23156 23157 Returns 23158 23159 Upon successful completion, pow10() shall return 10 rised to 23160 the power of x. 23161 23162 If the correct value would cause overflow, a range error shall 23163 occur and pow10() shall return ±HUGE_VAL, with the same sign as 23164 the correct value of the function. 23165 23166 See Also 23167 23168 exp10(), pow10f(), pow10l() 23169 23170 pow10f 23171 23172 Name 23173 23174 pow10f -- Base-10 power function 23175 23176 Synopsis 23177 23178 #include 23179 23180 float pow10f(float x); 23181 23182 Description 23183 23184 The pow10f() function shall return 10^x. 23185 23186 Note: This function is identical to exp10f(). 23187 23188 Returns 23189 23190 Upon successful completion, pow10f() shall return 10 rised to 23191 the power of x. 23192 23193 If the correct value would cause overflow, a range error shall 23194 occur and pow10f() shall return ±HUGE_VALF, with the same sign 23195 as the correct value of the function. 23196 23197 See Also 23198 23199 exp10f(), pow10(), pow10l() 23200 23201 pow10l 23202 23203 Name 23204 23205 pow10l -- Base-10 power function 23206 23207 Synopsis 23208 23209 #include 23210 23211 long double pow10l(long double x); 23212 23213 Description 23214 23215 The pow10l() function shall return 10^x. 23216 23217 Note: This function is identical to exp10l(). 23218 23219 Returns 23220 23221 Upon successful completion, pow10l() shall return 10 rised to 23222 the power of x. 23223 23224 If the correct value would cause overflow, a range error shall 23225 occur and pow10l() shall return ±HUGE_VALL, with the same sign 23226 as the correct value of the function. 23227 23228 See Also 23229 23230 exp10l(), pow10(), pow10f() 23231 23232 scalbf 23233 23234 Name 23235 23236 scalbf -- load exponent of radix-independent floating point 23237 number 23238 23239 Synopsis 23240 23241 #include 23242 23243 float scalbf(float x, double exp); 23244 23245 Description 23246 23247 The scalbf() function is identical to scalb(), except that the 23248 argument x and the return value is of type float. 23249 23250 Returns 23251 23252 See scalb(). 23253 23254 scalbl 23255 23256 Name 23257 23258 scalbl -- load exponent of radix-independent floating point 23259 number 23260 23261 Synopsis 23262 23263 #include 23264 23265 long double scalbl(long double x, double exp); 23266 23267 Description 23268 23269 The scalbl() function is identical to scalb(), except that the 23270 argument x and the return value is of type long double. 23271 23272 Returns 23273 23274 See scalb(). 23275 23276 significand 23277 23278 Name 23279 23280 significand -- floating point mantissa 23281 23282 Synopsis 23283 23284 #include 23285 23286 double significand(double x); 23287 23288 Description 23289 23290 The significand() function shall return the mantissa of x, sig 23291 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 23292 23293 Note: This function is intended for testing conformance to 23294 IEC 60559/IEEE 754 Floating Point, and its use is not 23295 otherwise recommended. 23296 23297 This function is equivalent to scalb(x, (double)-ilogb(x)). 23298 23299 Returns 23300 23301 Upon successful completion, significand() shall return the 23302 mantissa of x in the range 1 ≤ sig < 2. 23303 23304 If x is 0, ±HUGE_VAL, or NaN, the result is undefined. 23305 23306 See Also 23307 23308 significandf(), significandl() 23309 23310 significandf 23311 23312 Name 23313 23314 significandf -- floating point mantissa 23315 23316 Synopsis 23317 23318 #include 23319 23320 float significandf(float x); 23321 23322 Description 23323 23324 The significandf() function shall return the mantissa of x, sig 23325 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 23326 23327 Note: This function is intended for testing conformance to 23328 IEC 60559/IEEE 754 Floating Point, and its use is not 23329 otherwise recommended. 23330 23331 This function is equivalent to scalb(x, (double)-ilogb(x)). 23332 23333 Returns 23334 23335 Upon successful completion, significandf() shall return the 23336 mantissa of x in the range 1 ≤ sig < 2. 23337 23338 If x is 0, ±HUGE_VALF, or NaN, the result is undefined. 23339 23340 See Also 23341 23342 significand(), significandl() 23343 23344 significandl 23345 23346 Name 23347 23348 significandl -- floating point mantissa 23349 23350 Synopsis 23351 23352 #include 23353 23354 long double significandl(long double x); 23355 23356 Description 23357 23358 The significandl() function shall return the mantissa of x, sig 23359 such that x ≡ sig × 2^n scaled such that 1 ≤ sig < 2. 23360 23361 Note: This function is intended for testing conformance to 23362 IEC 60559/IEEE 754 Floating Point, and its use is not 23363 otherwise recommended. 23364 23365 This function is equivalent to scalb(x, (double)-ilogb(x)). 23366 23367 Returns 23368 23369 Upon successful completion, significandl() shall return the 23370 mantissa of x in the range 1 ≤ sig < 2. 23371 23372 If x is 0, ±HUGE_VALL, or NaN, the result is undefined. 23373 23374 See Also 23375 23376 significand(), significandf() 23377 23378 sincos 23379 23380 Name 23381 23382 sincos -- trigonometric functions 23383 23384 Synopsis 23385 23386 #define _GNU_SOURCE 23387 #include 23388 23389 void sincos(double x, double * sin, double * cos); 23390 23391 Description 23392 23393 The sincos() function shall calculate both the sine and cosine 23394 of x. The sine shall be stored in the location referenced by 23395 sin, and the cosine in the location referenced by cosine. 23396 23397 Returns 23398 23399 None. See sin() and cos() for possible error conditions. 23400 23401 See Also 23402 23403 cos(), sin(), sincosf(), sincosl() 23404 23405 sincosf 23406 23407 Name 23408 23409 sincosf -- trigonometric functions 23410 23411 Synopsis 23412 23413 #define _GNU_SOURCE 23414 #include 23415 23416 void sincosf(float x, float * sin, float * cos); 23417 23418 Description 23419 23420 The sincosf() function shall calculate both the sine and cosine 23421 of x. The sine shall be stored in the location referenced by 23422 sin, and the cosine in the location referenced by cosine. 23423 23424 Returns 23425 23426 None. See sin() and cos() for possible error conditions. 23427 23428 See Also 23429 23430 cos(), sin(), sincos(), sincosl() 23431 23432 sincosl 23433 23434 Name 23435 23436 sincosl -- trigonometric functions 23437 23438 Synopsis 23439 23440 #define _GNU_SOURCE 23441 #include 23442 23443 void sincosl(long double x, long double * sin, long double * 23444 cos); 23445 23446 Description 23447 23448 The sincosl() function shall calculate both the sine and cosine 23449 of x. The sine shall be stored in the location referenced by 23450 sin, and the cosine in the location referenced by cosine. 23451 23452 Returns 23453 23454 None. See sin() and cos() for possible error conditions. 23455 23456 See Also 23457 23458 cos(), sin(), sincos(), sincosl() 23459 23460 y0f 23461 23462 Name 23463 23464 y0f -- Bessel functions 23465 23466 Synopsis 23467 23468 #include 23469 23470 float y0f(float x); 23471 23472 Description 23473 23474 The y0f() function is identical to y0(), except that the 23475 argument x and the return value is a float. 23476 23477 Returns 23478 23479 See y0(). 23480 23481 See Also 23482 23483 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23484 y0(), y0l(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 23485 23486 y0l 23487 23488 Name 23489 23490 y0l -- Bessel functions 23491 23492 Synopsis 23493 23494 #include 23495 23496 long double y0l(long double x); 23497 23498 Description 23499 23500 The y0l() function is identical to y0(), except that the 23501 argument x and the return value is a long double. 23502 23503 Returns 23504 23505 See y0(). 23506 23507 See Also 23508 23509 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23510 y0(), y0f(), y1(), y1f(), y1l(), yn(), ynf(), ynl() 23511 23512 y1f 23513 23514 Name 23515 23516 y1f -- Bessel functions 23517 23518 Synopsis 23519 23520 #include 23521 23522 float y1f(float x); 23523 23524 Description 23525 23526 The y1f() function is identical to y1(), except that the 23527 argument x and the return value is a float. 23528 23529 Returns 23530 23531 See y1(). 23532 23533 See Also 23534 23535 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23536 y0(), y0f(), y0l(), y1(), y1l(), yn(), ynf(), ynl() 23537 23538 y1l 23539 23540 Name 23541 23542 y1l -- Bessel functions 23543 23544 Synopsis 23545 23546 #include 23547 23548 long double y1l(long double x); 23549 23550 Description 23551 23552 The y1l() function is identical to y1(), except that the 23553 argument x and the return value is a long double. 23554 23555 Returns 23556 23557 See j0(). 23558 23559 See Also 23560 23561 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23562 y0(), y0f(), y0l(), y1(), y1f(), yn(), ynf(), ynl() 23563 23564 ynf 23565 23566 Name 23567 23568 ynf -- Bessel functions 23569 23570 Synopsis 23571 23572 #include 23573 23574 float ynf(float x); 23575 23576 Description 23577 23578 The ynf() function is identical to yn(), except that the 23579 argument x and the return value is a float. 23580 23581 Returns 23582 23583 See yn(). 23584 23585 See Also 23586 23587 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23588 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynl() 23589 23590 ynl 23591 23592 Name 23593 23594 ynl -- Bessel functions 23595 23596 Synopsis 23597 23598 #include 23599 23600 long double ynl(long double x); 23601 23602 Description 23603 23604 The ynl() function is identical to yn(), except that the 23605 argument x and the return value is a long double. 23606 23607 Returns 23608 23609 See yn(). 23610 23611 See Also 23612 23613 j0(), j0f(), j0l(), j1(), j1f(), j1l(), jn(), jnf(), jnl(), 23614 y0(), y0f(), y0l(), y1(), y1f(), y1l(), yn(), ynf() 23615 __________________________________________________________ 23616 23617 12.9. Interfaces for libpthread 23618 23619 Table 12-42 defines the library name and shared object name for 23620 the libpthread library 23621 23622 Table 12-42. libpthread Definition 23623 Library: libpthread 23624 SONAME: libpthread.so.0 23625 23626 The behavior of the interfaces in this library is specified by 23627 the following specifications: 23628 23629 [LFS] Large File Support 23630 [LSB] This Specification 23631 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 23632 [SUSv4] POSIX 1003.1-2008 (ISO/IEC 9945-2009) 23633 __________________________________________________________ 23634 23635 12.9.1. Realtime Threads 23636 __________________________________________________________ 23637 23638 12.9.1.1. Interfaces for Realtime Threads 23639 23640 An LSB conforming implementation shall provide the generic 23641 functions for Realtime Threads specified in Table 12-43, with 23642 the full mandatory functionality as described in the referenced 23643 underlying specification. 23644 23645 Table 12-43. libpthread - Realtime Threads Function Interfaces 23646 pthread_attr_getinheritsched [SUSv3] 23647 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 23648 [SUSv3] pthread_attr_setinheritsched [SUSv3] 23649 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 23650 [SUSv3] pthread_getschedparam [SUSv3] 23651 pthread_mutex_getprioceiling(GLIBC_2.4) [SUSv4] 23652 pthread_mutex_setprioceiling(GLIBC_2.4) [SUSv4] 23653 pthread_mutexattr_getprioceiling(GLIBC_2.4) [SUSv4] 23654 pthread_mutexattr_getprotocol(GLIBC_2.4) [SUSv4] 23655 pthread_mutexattr_setprioceiling(GLIBC_2.4) [SUSv4] 23656 pthread_mutexattr_setprotocol(GLIBC_2.4) [SUSv4] 23657 pthread_setschedparam [SUSv3] pthread_setschedprio(GLIBC_2.3.4) 23658 [SUSv3] 23659 __________________________________________________________ 23660 23661 12.9.2. Advanced Realtime Threads 23662 __________________________________________________________ 23663 23664 12.9.2.1. Interfaces for Advanced Realtime Threads 23665 23666 An LSB conforming implementation shall provide the generic 23667 functions for Advanced Realtime Threads specified in Table 23668 12-44, with the full mandatory functionality as described in 23669 the referenced underlying specification. 23670 23671 Table 12-44. libpthread - Advanced Realtime Threads Function 23672 Interfaces 23673 pthread_barrier_destroy [SUSv3] pthread_barrier_init [SUSv3] 23674 pthread_barrier_wait [SUSv3] pthread_barrierattr_destroy 23675 [SUSv3] 23676 pthread_barrierattr_getpshared(GLIBC_2.3.3) [SUSv3] 23677 pthread_barrierattr_init [SUSv3] pthread_barrierattr_setpshared 23678 [SUSv3] pthread_getcpuclockid [SUSv3] 23679 pthread_spin_destroy [SUSv3] pthread_spin_init [SUSv3] 23680 pthread_spin_lock [SUSv3] pthread_spin_trylock [SUSv3] 23681 pthread_spin_unlock [SUSv3] 23682 __________________________________________________________ 23683 23684 12.9.3. Posix Threads 23685 __________________________________________________________ 23686 23687 12.9.3.1. Interfaces for Posix Threads 23688 23689 An LSB conforming implementation shall provide the generic 23690 functions for Posix Threads specified in Table 12-45, with the 23691 full mandatory functionality as described in the referenced 23692 underlying specification. 23693 23694 Table 12-45. libpthread - Posix Threads Function Interfaces 23695 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 23696 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 23697 [SUSv3] 23698 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 23699 [SUSv3] pthread_attr_getstack [SUSv3] pthread_attr_getstackaddr 23700 [SUSv3] 23701 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 23702 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 23703 [SUSv3] 23704 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 23705 [SUSv3] pthread_attr_setstackaddr [SUSv3] 23706 pthread_attr_setstacksize [SUSv3] 23707 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 23708 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 23709 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 23710 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 23711 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 23712 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 23713 [SUSv3] 23714 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 23715 [SUSv3] pthread_getconcurrency [SUSv3] 23716 pthread_getspecific [SUSv3] pthread_join [SUSv3] 23717 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 23718 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 23719 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 23720 pthread_mutex_timedlock [SUSv3] pthread_mutex_trylock [SUSv3] 23721 pthread_mutex_unlock [SUSv3] pthread_mutexattr_destroy [SUSv3] 23722 pthread_mutexattr_getpshared [SUSv3] pthread_mutexattr_gettype 23723 [SUSv3] pthread_mutexattr_init [SUSv3] 23724 pthread_mutexattr_setpshared [SUSv3] 23725 pthread_mutexattr_settype [SUSv3] pthread_once [SUSv3] 23726 pthread_rwlock_destroy [SUSv3] pthread_rwlock_init [SUSv3] 23727 pthread_rwlock_rdlock [SUSv3] pthread_rwlock_timedrdlock 23728 [SUSv3] pthread_rwlock_timedwrlock [SUSv3] 23729 pthread_rwlock_tryrdlock [SUSv3] 23730 pthread_rwlock_trywrlock [SUSv3] pthread_rwlock_unlock [SUSv3] 23731 pthread_rwlock_wrlock [SUSv3] pthread_rwlockattr_destroy 23732 [SUSv3] 23733 pthread_rwlockattr_getpshared [SUSv3] pthread_rwlockattr_init 23734 [SUSv3] pthread_rwlockattr_setpshared [SUSv3] pthread_self 23735 [SUSv3] 23736 pthread_setcancelstate [SUSv3] pthread_setcanceltype [SUSv3] 23737 pthread_setconcurrency [SUSv3] pthread_setspecific [SUSv3] 23738 pthread_sigmask [SUSv3] pthread_testcancel [SUSv3] sem_close 23739 [SUSv3] sem_destroy [SUSv3] 23740 sem_getvalue [SUSv3] sem_init [SUSv3] sem_open [SUSv3] sem_post 23741 [SUSv3] 23742 sem_timedwait [SUSv3] sem_trywait [SUSv3] sem_unlink [SUSv3] 23743 sem_wait [SUSv3] 23744 23745 An LSB conforming implementation shall provide the generic 23746 deprecated functions for Posix Threads specified in Table 23747 12-46, with the full mandatory functionality as described in 23748 the referenced underlying specification. 23749 23750 Note: These interfaces are deprecated, and applications 23751 should avoid using them. These interfaces may be withdrawn 23752 in future releases of this specification. 23753 23754 Table 12-46. libpthread - Posix Threads Deprecated Function 23755 Interfaces 23756 pthread_attr_getstackaddr [SUSv3] pthread_attr_setstackaddr 23757 [SUSv3] 23758 __________________________________________________________ 23759 23760 12.9.4. Thread aware versions of libc interfaces 23761 __________________________________________________________ 23762 23763 12.9.4.1. Interfaces for Thread aware versions of libc interfaces 23764 23765 An LSB conforming implementation shall provide the generic 23766 functions for Thread aware versions of libc interfaces 23767 specified in Table 12-47, with the full mandatory functionality 23768 as described in the referenced underlying specification. 23769 23770 Table 12-47. libpthread - Thread aware versions of libc 23771 interfaces Function Interfaces 23772 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LSB] 23773 pwrite [SUSv3] pwrite64 [LSB] 23774 __________________________________________________________ 23775 23776 12.9.5. GNU Extensions for libpthread 23777 __________________________________________________________ 23778 23779 12.9.5.1. Interfaces for GNU Extensions for libpthread 23780 23781 An LSB conforming implementation shall provide the generic 23782 functions for GNU Extensions for libpthread specified in Table 23783 12-48, with the full mandatory functionality as described in 23784 the referenced underlying specification. 23785 23786 Table 12-48. libpthread - GNU Extensions for libpthread 23787 Function Interfaces 23788 pthread_getattr_np [LSB] pthread_mutex_consistent_np [LSB] 23789 pthread_mutexattr_getrobust_np [LSB] 23790 pthread_mutexattr_setrobust_np [LSB] 23791 pthread_rwlockattr_getkind_np [LSB] 23792 pthread_rwlockattr_setkind_np [LSB] 23793 __________________________________________________________ 23794 23795 12.10. Data Definitions for libpthread 23796 23797 This section defines global identifiers and their values that 23798 are associated with interfaces contained in libpthread. These 23799 definitions are organized into groups that correspond to system 23800 headers. This convention is used as a convenience for the 23801 reader, and does not imply the existence of these headers, or 23802 their content. Where an interface is defined as requiring a 23803 particular system header file all of the data definitions for 23804 that system header file presented here shall be in effect. 23805 23806 This section gives data definitions to promote binary 23807 application portability, not to repeat source interface 23808 definitions available elsewhere. System providers and 23809 application developers should use this ABI to supplement - not 23810 to replace - source interface definition specifications. 23811 23812 This specification uses the ISO C (1999) C Language as the 23813 reference programming language, and data definitions are 23814 specified in ISO C format. The C language is used here as a 23815 convenient notation. Using a C language description of these 23816 data objects does not preclude their use by other programming 23817 languages. 23818 __________________________________________________________ 23819 23820 12.10.1. pthread.h 23821 23822 #define PTHREAD_MUTEX_DEFAULT 0 23823 #define PTHREAD_MUTEX_NORMAL 0 23824 #define PTHREAD_SCOPE_SYSTEM 0 23825 #define PTHREAD_MUTEX_RECURSIVE 1 23826 #define PTHREAD_SCOPE_PROCESS 1 23827 #define PTHREAD_MUTEX_ERRORCHECK 2 23828 #define PTHREAD_RWLOCK_DEFAULT_NP 2 23829 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 23830 #define __SIZEOF_PTHREAD_CONDATTR_T 4 23831 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 23832 #define __SIZEOF_PTHREAD_COND_T 48 23833 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 23834 #define pthread_cleanup_push(routine,arg) \ 23835 {struct _pthread_cleanup_buffer _buffer;\ 23836 _pthread_cleanup_push(&_buffer,(routine),(arg)); 23837 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 23838 #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } 23839 23840 struct _pthread_cleanup_buffer { 23841 void (*__routine) (void *); 23842 void *__arg; 23843 int __canceltype; 23844 struct _pthread_cleanup_buffer *__prev; 23845 }; 23846 typedef unsigned int pthread_key_t; 23847 typedef int pthread_once_t; 23848 typedef volatile int pthread_spinlock_t; 23849 typedef union { 23850 char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; 23851 int __align; 23852 } pthread_barrierattr_t; 23853 enum { 23854 PTHREAD_PRIO_NONE, 23855 PTHREAD_PRIO_INHERIT, 23856 PTHREAD_PRIO_PROTECT 23857 }; 23858 enum { 23859 PTHREAD_MUTEX_STALLED_NP = 0, 23860 PTHREAD_MUTEX_ROBUST_NP = 1 23861 }; 23862 23863 typedef unsigned long int pthread_t; 23864 23865 typedef union { 23866 struct __pthread_mutex_s __data; 23867 char __size[__SIZEOF_PTHREAD_MUTEX_T]; 23868 long int __align; 23869 } pthread_mutex_t; 23870 typedef union { 23871 char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; 23872 int __align; 23873 } pthread_mutexattr_t; 23874 23875 typedef union { 23876 char __size[__SIZEOF_PTHREAD_ATTR_T]; 23877 long int __align; 23878 } pthread_attr_t; 23879 23880 typedef union { 23881 struct { 23882 int __lock; 23883 unsigned int __futex; 23884 unsigned long long int __total_seq; 23885 unsigned long long int __wakeup_seq; 23886 unsigned long long int __woken_seq; 23887 void *__mutex; 23888 unsigned int __nwaiters; 23889 unsigned int __broadcast_seq; 23890 } __data; 23891 char __size[__SIZEOF_PTHREAD_COND_T]; 23892 long long int __align; 23893 } pthread_cond_t; 23894 typedef union { 23895 char __size[__SIZEOF_PTHREAD_CONDATTR_T]; 23896 int __align; 23897 } pthread_condattr_t; 23898 23899 typedef union { 23900 char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; 23901 long int __align; 23902 } pthread_rwlockattr_t; 23903 23904 #define PTHREAD_CREATE_JOINABLE 0 23905 #define PTHREAD_INHERIT_SCHED 0 23906 #define PTHREAD_ONCE_INIT 0 23907 #define PTHREAD_PROCESS_PRIVATE 0 23908 #define PTHREAD_CREATE_DETACHED 1 23909 #define PTHREAD_EXPLICIT_SCHED 1 23910 #define PTHREAD_PROCESS_SHARED 1 23911 23912 #define PTHREAD_CANCELED ((void*)-1) 23913 #define PTHREAD_CANCEL_DEFERRED 0 23914 #define PTHREAD_CANCEL_ENABLE 0 23915 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 23916 #define PTHREAD_CANCEL_DISABLE 1 23917 23918 extern int __register_atfork(void (*)(void), void (*)(void), 23919 void (*)(void), void *); 23920 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 23921 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 23922 void (*)(void *), void *); 23923 extern int pthread_atfork(void (*__prepare) (void), 23924 void (*__parent) (void), void (*__child) (void)); 23925 extern int pthread_attr_destroy(pthread_attr_t * __attr); 23926 extern int pthread_attr_getdetachstate(const pthread_attr_t * __attr, 23927 int *__detachstate); 23928 extern int pthread_attr_getguardsize(const pthread_attr_t * __attr, 23929 size_t * __guardsize); 23930 extern int pthread_attr_getinheritsched(const pthread_attr_t * __attr, 23931 int *__inherit); 23932 extern int pthread_attr_getschedparam(const pthread_attr_t * __attr, 23933 struct sched_param *__param); 23934 extern int pthread_attr_getschedpolicy(const pthread_attr_t * __attr, 23935 int *__policy); 23936 extern int pthread_attr_getscope(const pthread_attr_t * __attr, 23937 int *__scope); 23938 extern int pthread_attr_getstack(const pthread_attr_t * __attr, 23939 void **__stackaddr, size_t * __stacksize); 23940 extern int pthread_attr_getstackaddr(const pthread_attr_t * __attr, 23941 void **__stackaddr); 23942 extern int pthread_attr_getstacksize(const pthread_attr_t * __attr, 23943 size_t * __stacksize); 23944 extern int pthread_attr_init(pthread_attr_t * __attr); 23945 extern int pthread_attr_setdetachstate(pthread_attr_t * __attr, 23946 int __detachstate); 23947 extern int pthread_attr_setguardsize(pthread_attr_t * __attr, 23948 size_t __guardsize); 23949 extern int pthread_attr_setinheritsched(pthread_attr_t * __attr, 23950 int __inherit); 23951 extern int pthread_attr_setschedparam(pthread_attr_t * __attr, 23952 const struct sched_param *__param); 23953 extern int pthread_attr_setschedpolicy(pthread_attr_t * __attr, 23954 int __policy); 23955 extern int pthread_attr_setscope(pthread_attr_t * __attr, int __scope); 23956 extern int pthread_attr_setstack(pthread_attr_t * __attr, 23957 void *__stackaddr, size_t __stacksize); 23958 extern int pthread_attr_setstackaddr(pthread_attr_t * __attr, 23959 void *__stackaddr); 23960 extern int pthread_attr_setstacksize(pthread_attr_t * __attr, 23961 size_t __stacksize); 23962 extern int pthread_barrier_destroy(pthread_barrier_t * __barrier); 23963 extern int pthread_barrier_init(pthread_barrier_t * __barrier, 23964 const pthread_barrierattr_t * __attr, 23965 unsigned int __count); 23966 extern int pthread_barrier_wait(pthread_barrier_t * __barrier); 23967 extern int pthread_barrierattr_destroy(pthread_barrierattr_t * __attr); 23968 extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t * 23969 __attr, int *__pshared); 23970 extern int pthread_barrierattr_init(pthread_barrierattr_t * __attr); 23971 extern int pthread_barrierattr_setpshared(pthread_barrierattr_t * __attr, 23972 int __pshared); 23973 extern int pthread_cancel(pthread_t __th); 23974 extern int pthread_cond_broadcast(pthread_cond_t * __cond); 23975 extern int pthread_cond_destroy(pthread_cond_t * __cond); 23976 extern int pthread_cond_init(pthread_cond_t * __cond, 23977 const pthread_condattr_t * __cond_attr); 23978 extern int pthread_cond_signal(pthread_cond_t * __cond); 23979 extern int pthread_cond_timedwait(pthread_cond_t * __cond, 23980 pthread_mutex_t * __mutex, 23981 const struct timespec *__abstime); 23982 extern int pthread_cond_wait(pthread_cond_t * __cond, 23983 pthread_mutex_t * __mutex); 23984 extern int pthread_condattr_destroy(pthread_condattr_t * __attr); 23985 extern int pthread_condattr_getpshared(const pthread_condattr_t * __attr, 23986 int *__pshared); 23987 extern int pthread_condattr_init(pthread_condattr_t * __attr); 23988 extern int pthread_condattr_setpshared(pthread_condattr_t * __attr, 23989 int __pshared); 23990 extern int pthread_create(pthread_t * __newthread, 23991 const pthread_attr_t * __attr, 23992 void *(*__start_routine) (void *), void *__arg); 23993 extern int pthread_detach(pthread_t __th); 23994 extern int pthread_equal(pthread_t __thread1, pthread_t __thread2); 23995 extern void pthread_exit(void *__retval); 23996 extern int pthread_getattr_np(pthread_t thread, pthread_attr_t * attr); 23997 extern int pthread_getconcurrency(void); 23998 extern int pthread_getcpuclockid(pthread_t __thread_id, 23999 clockid_t * __clock_id); 24000 extern int pthread_getschedparam(pthread_t __target_thread, int *__policy, 24001 struct sched_param *__param); 24002 extern void *pthread_getspecific(pthread_key_t __key); 24003 extern int pthread_join(pthread_t __th, void **__thread_return); 24004 extern int pthread_key_create(pthread_key_t * __key, 24005 void (*__destr_function) (void *)); 24006 extern int pthread_key_delete(pthread_key_t __key); 24007 extern int pthread_mutex_consistent_np(pthread_mutex_t * __mutex); 24008 extern int pthread_mutex_destroy(pthread_mutex_t * __mutex); 24009 extern int pthread_mutex_getprioceiling(const pthread_mutex_t * __mutex, 24010 int *__prioceiling); 24011 extern int pthread_mutex_init(pthread_mutex_t * __mutex, 24012 const pthread_mutexattr_t * __mutexattr); 24013 extern int pthread_mutex_lock(pthread_mutex_t * __mutex); 24014 extern int pthread_mutex_setprioceiling(pthread_mutex_t * __mutex, 24015 int __prioceiling, 24016 int *__old_ceiling); 24017 extern int pthread_mutex_timedlock(pthread_mutex_t * __mutex, 24018 const struct timespec *__abstime); 24019 extern int pthread_mutex_trylock(pthread_mutex_t * __mutex); 24020 extern int pthread_mutex_unlock(pthread_mutex_t * __mutex); 24021 extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr); 24022 extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * 24023 __attr, int *__prioceiling); 24024 extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t * 24025 __attr, int *__protocol); 24026 extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t * __attr, 24027 int *__pshared); 24028 extern int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t * 24029 __attr, int *__robustness); 24030 extern int pthread_mutexattr_gettype(const pthread_mutexattr_t * __attr, 24031 int *__kind); 24032 extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr); 24033 extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t * __attr, 24034 int __prioceiling); 24035 extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t * __attr, 24036 int __protocol); 24037 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * __attr, 24038 int __pshared); 24039 extern int pthread_mutexattr_setrobust_np(pthread_mutexattr_t * __attr, 24040 int __robustness); 24041 extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, 24042 int __kind); 24043 extern int pthread_once(pthread_once_t * __once_control, 24044 void (*__init_routine) (void)); 24045 extern int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock); 24046 extern int pthread_rwlock_init(pthread_rwlock_t * __rwlock, 24047 const pthread_rwlockattr_t * __attr); 24048 extern int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock); 24049 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, 24050 const struct timespec *__abstime); 24051 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, 24052 const struct timespec *__abstime); 24053 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock); 24054 extern int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock); 24055 extern int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock); 24056 extern int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock); 24057 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t * __attr); 24058 extern int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t * 24059 __attr, int *__pref); 24060 extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * 24061 __attr, int *__pshared); 24062 extern int pthread_rwlockattr_init(pthread_rwlockattr_t * __attr); 24063 extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * __attr, 24064 int __pref); 24065 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * __attr, 24066 int __pshared); 24067 extern pthread_t pthread_self(void); 24068 extern int pthread_setcancelstate(int __state, int *__oldstate); 24069 extern int pthread_setcanceltype(int __type, int *__oldtype); 24070 extern int pthread_setconcurrency(int __level); 24071 extern int pthread_setschedparam(pthread_t __target_thread, int __policy, 24072 const struct sched_param *__param); 24073 extern int pthread_setschedprio(pthread_t __target_thread, int __prio); 24074 extern int pthread_setspecific(pthread_key_t __key, const void *__pointer); 24075 extern int pthread_spin_destroy(pthread_spinlock_t * __lock); 24076 extern int pthread_spin_init(pthread_spinlock_t * __lock, int __pshared); 24077 extern int pthread_spin_lock(pthread_spinlock_t * __lock); 24078 extern int pthread_spin_trylock(pthread_spinlock_t * __lock); 24079 extern int pthread_spin_unlock(pthread_spinlock_t * __lock); 24080 extern void pthread_testcancel(void); 24081 __________________________________________________________ 24082 24083 12.10.2. semaphore.h 24084 24085 typedef union { 24086 char __size[__SIZEOF_SEM_T]; 24087 long int __align; 24088 } sem_t; 24089 24090 #define SEM_FAILED ((sem_t*)0) 24091 24092 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 24093 24094 extern int sem_close(sem_t * __sem); 24095 extern int sem_destroy(sem_t * __sem); 24096 extern int sem_getvalue(sem_t * __sem, int *__sval); 24097 extern int sem_init(sem_t * __sem, int __pshared, unsigned int __value); 24098 extern sem_t *sem_open(const char *__name, int __oflag, ...); 24099 extern int sem_post(sem_t * __sem); 24100 extern int sem_timedwait(sem_t * __sem, const struct timespec *__abstime); 24101 extern int sem_trywait(sem_t * __sem); 24102 extern int sem_unlink(const char *__name); 24103 extern int sem_wait(sem_t * __sem); 24104 __________________________________________________________ 24105 24106 12.11. Interface Definitions for libpthread 24107 24108 Table of Contents 24109 _pthread_cleanup_pop -- establish cancellation handlers 24110 _pthread_cleanup_push -- establish cancellation handlers 24111 pthread_getattr_np -- get thread attributes 24112 pthread_mutex_consistent_np -- mark state protected by robust 24113 mutex as consistent 24114 24115 pthread_mutexattr_getrobust_np, 24116 pthread_mutexattr_setrobust_np -- get and set the mutex 24117 robust attribute 24118 24119 pthread_rwlockattr_getkind_np, 24120 pthread_rwlockattr_setkind_np -- get/set the read-write 24121 lock kind of the thread read-write lock attribute object 24122 24123 The interfaces defined on the following pages are included in 24124 libpthread and are defined by this specification. Unless 24125 otherwise noted, these interfaces shall be included in the 24126 source standard. 24127 24128 Other interfaces listed in Section 12.9 shall behave as 24129 described in the referenced base document. 24130 24131 _pthread_cleanup_pop 24132 24133 Name 24134 24135 _pthread_cleanup_pop -- establish cancellation handlers 24136 24137 Synopsis 24138 24139 #include 24140 24141 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 24142 int); 24143 24144 Description 24145 24146 The _pthread_cleanup_pop() function provides an implementation 24147 of the pthread_cleanup_pop() macro described in POSIX 24148 1003.1-2001 (ISO/IEC 9945-2003). 24149 24150 The _pthread_cleanup_pop() function is not in the source 24151 standard; it is only in the binary standard. 24152 24153 _pthread_cleanup_push 24154 24155 Name 24156 24157 _pthread_cleanup_push -- establish cancellation handlers 24158 24159 Synopsis 24160 24161 #include 24162 24163 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 24164 void (*) (void *), void *); 24165 24166 Description 24167 24168 The _pthread_cleanup_push() function provides an implementation 24169 of the pthread_cleanup_push() macro described in POSIX 24170 1003.1-2001 (ISO/IEC 9945-2003). 24171 24172 The _pthread_cleanup_push() function is not in the source 24173 standard; it is only in the binary standard. 24174 24175 pthread_getattr_np 24176 24177 Name 24178 24179 pthread_getattr_np -- get thread attributes 24180 24181 Synopsis 24182 24183 #include 24184 24185 int pthread_getattr_np(pthread_t thread, pthread_attr_t *attr); 24186 24187 Description 24188 24189 pthread_getattr_np() fills in the thread attribute object attr 24190 with attribute values describing the running thread thread. 24191 This is useful to detect runtime changes from the values 24192 specified in the thread attributes object used to create the 24193 thread with pthread_create(). The following differences may be 24194 noted: 24195 24196 * The detach state, since a joinable thread may have detached 24197 itself after creation. Use pthread_attr_getdetachstate() to 24198 extract from attr. 24199 * The stack size, which the implementation may align to a 24200 suitable boundary. Use pthread_attr_getstack() to extract 24201 from attr. 24202 * The guard size, which the implementation may round upwards 24203 to a multiple of the page size, or ignore (i.e., treat as 24204 0), if the application is allocating its own stack. Use 24205 pthread_attr_getguardsize() to extract from attr. 24206 24207 If the stack address attribute was not set in the thread 24208 attributes object used to create the thread, then the thread 24209 attributes object returned by pthread_getattr_np() will show 24210 the actual stack address the implementation selected for the 24211 thread. Use pthread_attr_getstack() to extract from attr. 24212 24213 The thread attributes object attr should be destroyed using 24214 pthread_attr_destroy() when it is no longer needed. 24215 24216 Return Value 24217 24218 On success, pthread_getattr_np() returns 0; on error, it 24219 returns a non-zero error number. 24220 24221 Errors 24222 24223 ENOMEM 24224 24225 Insufficient memory to complete the operation. 24226 24227 In addition, if thread refers to the main thread, then 24228 pthread_getattr_np() may also fail due to errors from various 24229 underlying calls: fopen(), if the pseudo-file containing the 24230 memory region map cannot be opened; getrlimit() if the 24231 RLIMIT_STACK resource limit it not supported. 24232 24233 Notes 24234 24235 This function is a GNU extension. 24236 24237 See Also 24238 24239 pthread_attr_destroy(), pthread_attr_getdetachstate(), 24240 pthread_attr_getguardsize(), pthread_attr_getstack(), 24241 pthread_create(). 24242 24243 pthread_mutex_consistent_np 24244 24245 Name 24246 24247 pthread_mutex_consistent_np -- mark state protected by robust 24248 mutex as consistent 24249 24250 Synopsis 24251 24252 #include 24253 24254 int pthread_mutex_consistent_np(pthread_mutex_t * __mutex); 24255 24256 Description 24257 24258 pthread_mutex_consistent_np() shall behave as described for 24259 pthread_mutex_consistent() in POSIX 1003.1-2008 (ISO/IEC 24260 9945-2009). 24261 24262 pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust_np 24263 24264 Name 24265 24266 pthread_mutexattr_getrobust_np, 24267 pthread_mutexattr_setrobust_np -- get and set the mutex robust 24268 attribute 24269 24270 Synopsis 24271 24272 #include 24273 24274 int pthread_mutexattr_getrobust_np(const pthread_mutexattr_t * 24275 __attr, int * __robustness); 24276 24277 int pthread_mutexattr_setrobust_np(const pthread_mutexattr_t * 24278 __attr, int __robustness); 24279 24280 Description 24281 24282 pthread_mutexattr_setrobust_np() shall behave as described for 24283 pthread_mutexattr_setrobust() in POSIX 1003.1-2008 (ISO/IEC 24284 9945-2009). 24285 24286 pthread_mutexattr_getrobust_np() shall behave as described for 24287 pthread_mutexattr_getrobust() in POSIX 1003.1-2008 (ISO/IEC 24288 9945-2009). 24289 24290 Two additional valid values are defined for __robustness: 24291 PTHREAD_MUTEX_STALLED_NP, which is identical to 24292 PTHREAD_MUTEX_STALLED and PTHREAD_MUTEX_ROBUST_NP, which is 24293 identical to PTHREAD_MUTEX_ROBUST. 24294 24295 pthread_rwlockattr_getkind_np, pthread_rwlockattr_setkind_np 24296 24297 Name 24298 24299 pthread_rwlockattr_getkind_np, 24300 pthread_rwlockattr_setkind_np -- get/set the read-write lock 24301 kind of the thread read-write lock attribute object 24302 24303 Synopsis 24304 24305 #include 24306 24307 int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t * 24308 attr, int * pref); 24309 24310 int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * attr, 24311 int * pref); 24312 24313 Description 24314 24315 The pthread_rwlockattr_setkind_np() function sets the kind of 24316 read-write lock of the thread read-write lock attribute object 24317 referred to by attr to the value specified with pref. The 24318 argument pref may be set to PTHREAD_RWLOCK_PREFER_READER_NP, 24319 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, or 24320 PTHREAD_RWLOCK_PREFER_WRITER_NP. The default lock setting is 24321 PTHREAD_RWLOCK_PREFER_READER_NP. A thread may hold multiple 24322 read locks, i.e. read locks are recursive. According to The 24323 Single Unix Specification, the behavior is unspecified when a 24324 reader tries to place a lock, and there is no write lock but 24325 writers are waiting. Giving preference to the reader, as is set 24326 by default with the PTHREAD_RWLOCK_PREFER_READER_NP value 24327 implies that the reader will receive the requested lock, even 24328 if a writer is waiting. As long as there are readers the writer 24329 will be starved. Setting the kind to 24330 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, avoids writer 24331 starvation as long as any read locking is not done in a 24332 recursive fashion. The pthread_rwlockattr_getkind_np() function 24333 returns the value of the read-write lock attribute of the 24334 thread read-write lock attribute object referred to by attr in 24335 the pointer pref. 24336 24337 Return Value 24338 24339 pthread_rwlockattr_setkind_np() function returns 0 on success; 24340 on error, it returns a non-zero error number. 24341 pthread_rwlockattr_setkind_np() function always returns 0. 24342 24343 Errors 24344 24345 EINVAL 24346 24347 pref is set to an unsupported value. 24348 24349 Notes 24350 24351 Setting the value read-write lock kind to 24352 PTHREAD_RWLOCK_PREFER_WRITER_NP, results in the same behavior 24353 as setting the value to PTHREAD_RWLOCK_PREFER_READER_NP. As 24354 long as a reader thread holds the lock the thread holding a 24355 write lock will be starved. Setting the kind value to 24356 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, allows the writer 24357 to run. However, the writer may not be recursive as is implied 24358 by the name. 24359 __________________________________________________________ 24360 24361 12.12. Interfaces for libgcc_s 24362 24363 Table 12-49 defines the library name and shared object name for 24364 the libgcc_s library 24365 24366 Table 12-49. libgcc_s Definition 24367 Library: libgcc_s 24368 SONAME: libgcc_s.so.1 24369 24370 The behavior of the interfaces in this library is specified by 24371 the following specifications: 24372 24373 [LSB] This Specification 24374 __________________________________________________________ 24375 24376 12.12.1. Unwind Library 24377 __________________________________________________________ 24378 24379 12.12.1.1. Interfaces for Unwind Library 24380 24381 An LSB conforming implementation shall provide the generic 24382 functions for Unwind Library specified in Table 12-50, with the 24383 full mandatory functionality as described in the referenced 24384 underlying specification. 24385 24386 Table 12-50. libgcc_s - Unwind Library Function Interfaces 24387 _Unwind_Backtrace [LSB] _Unwind_DeleteException [LSB] 24388 _Unwind_FindEnclosingFunction [LSB] _Unwind_ForcedUnwind [LSB] 24389 _Unwind_GetCFA [LSB] _Unwind_GetGR [LSB] _Unwind_GetIP [LSB] 24390 _Unwind_GetIPInfo(GCC_4.2.0) [LSB] 24391 _Unwind_GetLanguageSpecificData [LSB] _Unwind_GetRegionStart 24392 [LSB] _Unwind_RaiseException [LSB] _Unwind_Resume [LSB] 24393 _Unwind_Resume_or_Rethrow [LSB] _Unwind_SetGR [LSB] 24394 _Unwind_SetIP [LSB] 24395 __________________________________________________________ 24396 24397 12.13. Data Definitions for libgcc_s 24398 24399 This section defines global identifiers and their values that 24400 are associated with interfaces contained in libgcc_s. These 24401 definitions are organized into groups that correspond to system 24402 headers. This convention is used as a convenience for the 24403 reader, and does not imply the existence of these headers, or 24404 their content. Where an interface is defined as requiring a 24405 particular system header file all of the data definitions for 24406 that system header file presented here shall be in effect. 24407 24408 This section gives data definitions to promote binary 24409 application portability, not to repeat source interface 24410 definitions available elsewhere. System providers and 24411 application developers should use this ABI to supplement - not 24412 to replace - source interface definition specifications. 24413 24414 This specification uses the ISO C (1999) C Language as the 24415 reference programming language, and data definitions are 24416 specified in ISO C format. The C language is used here as a 24417 convenient notation. Using a C language description of these 24418 data objects does not preclude their use by other programming 24419 languages. 24420 __________________________________________________________ 24421 24422 12.13.1. unwind.h 24423 24424 struct _Unwind_Context; 24425 struct _Unwind_Exception; 24426 24427 typedef unsigned int _Unwind_Ptr __attribute__ ((__mode__(__pointer__))); 24428 typedef unsigned int _Unwind_Word __attribute__ ((__mode__(__word__))); 24429 typedef unsigned int _Unwind_Exception_Class 24430 __attribute__ ((__mode__(__DI__))); 24431 24432 typedef enum { 24433 _URC_NO_REASON = 0, 24434 _URC_FOREIGN_EXCEPTION_CAUGHT = 1, 24435 _URC_FATAL_PHASE2_ERROR = 2, 24436 _URC_FATAL_PHASE1_ERROR = 3, 24437 _URC_NORMAL_STOP = 4, 24438 _URC_END_OF_STACK = 5, 24439 _URC_HANDLER_FOUND = 6, 24440 _URC_INSTALL_CONTEXT = 7, 24441 _URC_CONTINUE_UNWIND = 8 24442 } _Unwind_Reason_Code; 24443 24444 typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, 24445 struct _Unwind_Exception *); 24446 24447 struct _Unwind_Exception { 24448 _Unwind_Exception_Class exception_class; 24449 _Unwind_Exception_Cleanup_Fn exception_cleanup; 24450 _Unwind_Word private_1; 24451 _Unwind_Word private_2; 24452 } __attribute__ ((__aligned__)); 24453 24454 #define _UA_SEARCH_PHASE 1 24455 #define _UA_END_OF_STACK 16 24456 #define _UA_CLEANUP_PHASE 2 24457 #define _UA_HANDLER_FRAME 4 24458 #define _UA_FORCE_UNWIND 8 24459 24460 typedef int _Unwind_Action; 24461 24462 typedef _Unwind_Reason_Code(*_Unwind_Stop_Fn) (int version, 24463 _Unwind_Action actions, 24464 _Unwind_Exception_Class 24465 exceptionClass, 24466 struct _Unwind_Exception* 24467 exceptionObject, 24468 struct _Unwind_Context * 24469 context, 24470 void *stop_parameter); 24471 24472 typedef _Unwind_Reason_Code(*_Unwind_Trace_Fn) (struct _Unwind_Context *, 24473 void *); 24474 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 24475 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 24476 extern void *_Unwind_FindEnclosingFunction(void *); 24477 extern _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *, 24478 _Unwind_Stop_Fn, void *); 24479 extern _Unwind_Word _Unwind_GetCFA(struct _Unwind_Context *); 24480 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 24481 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 24482 extern _Unwind_Ptr _Unwind_GetIPInfo(struct _Unwind_Context *, int *); 24483 extern void *_Unwind_GetLanguageSpecificData(struct _Unwind_Context *); 24484 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 24485 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 24486 *); 24487 extern void _Unwind_Resume(struct _Unwind_Exception *); 24488 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 24489 _Unwind_Exception *); 24490 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 24491 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 24492 __________________________________________________________ 24493 24494 12.14. Interface Definitions for libgcc_s 24495 24496 Table of Contents 24497 _Unwind_Backtrace -- private C++ error handling method 24498 _Unwind_DeleteException -- private C++ error handling method 24499 _Unwind_FindEnclosingFunction -- private C++ error handling 24500 method 24501 24502 _Unwind_ForcedUnwind -- private C++ error handling method 24503 _Unwind_GetCFA -- private C++ error handling method 24504 _Unwind_GetGR -- private C++ error handling method 24505 _Unwind_GetIP -- private C++ error handling method 24506 _Unwind_GetIPInfo -- private C++ error handling method 24507 _Unwind_GetLanguageSpecificData -- private C++ error handling 24508 method 24509 24510 _Unwind_GetRegionStart -- private C++ error handling method 24511 _Unwind_RaiseException -- private C++ error handling method 24512 _Unwind_Resume -- private C++ error handling method 24513 _Unwind_Resume_or_Rethrow -- private C++ error handling method 24514 _Unwind_SetGR -- private C++ error handling method 24515 _Unwind_SetIP -- private C++ error handling method 24516 24517 The interfaces defined on the following pages are included in 24518 libgcc_s and are defined by this specification. Unless 24519 otherwise noted, these interfaces shall be included in the 24520 source standard. 24521 24522 Other interfaces listed in Section 12.12 shall behave as 24523 described in the referenced base document. 24524 24525 _Unwind_Backtrace 24526 24527 Name 24528 24529 _Unwind_Backtrace -- private C++ error handling method 24530 24531 Synopsis 24532 24533 _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn trace, 24534 void * trace_argument); 24535 24536 Description 24537 24538 _Unwind_Backtrace() performs a stack backtrace using unwind 24539 data. The trace callback is called for every stack frame in the 24540 call chain. No cleanup actions are performed. 24541 24542 _Unwind_DeleteException 24543 24544 Name 24545 24546 _Unwind_DeleteException -- private C++ error handling method 24547 24548 Synopsis 24549 24550 void _Unwind_DeleteException(struct _Unwind_Exception * 24551 object); 24552 24553 Description 24554 24555 _Unwind_DeleteException() deletes the given exception object. 24556 If a given runtime resumes normal execution after catching a 24557 foreign exception, it will not know how to delete that 24558 exception. Such an exception shall be deleted by calling 24559 _Unwind_DeleteException(). This is a convenience function that 24560 calls the function pointed to by the exception_cleanup field of 24561 the exception header. 24562 24563 _Unwind_FindEnclosingFunction 24564 24565 Name 24566 24567 _Unwind_FindEnclosingFunction -- private C++ error handling 24568 method 24569 24570 Synopsis 24571 24572 void * _Unwind_FindEnclosingFunction(void * ip); 24573 24574 Description 24575 24576 _Unwind_FindEnclosingFunction() Find the start address of the 24577 procedure containing the specified ip or NULL if it cannot be 24578 found (for example, because the function has no unwind info). 24579 24580 Note that there is not necessarily a one-to-one correspondence 24581 between source level functions and procedures. Some functions 24582 do not have unwind-info and others are split into multiple 24583 procedures. 24584 24585 _Unwind_ForcedUnwind 24586 24587 Name 24588 24589 _Unwind_ForcedUnwind -- private C++ error handling method 24590 24591 Synopsis 24592 24593 #include 24594 24595 _Unwind_Reason_Code _Unwind_ForcedUnwind(struct 24596 _Unwind_Exception * object, _Unwind_Stop_Fn stop, void * 24597 stop_parameter); 24598 24599 Description 24600 24601 Forced unwinding is a single-phase process. stop and 24602 stop_parameter control the termination of the unwind process 24603 instead of the usual personality routine query. Stop function 24604 stop is called for each unwind frame, with the parameteres 24605 described for the usual personality routine below, plus an 24606 additional stop_parameter. 24607 24608 Return Value 24609 24610 When stop identifies the destination frame, it transfers 24611 control to the user code as appropriate without returning, 24612 normally after calling _Unwind_DeleteException(). If not, then 24613 it should return an _Unwind_Reason_Code value. 24614 24615 If stop returns any reason code other than _URC_NO_REASON, then 24616 the stack state is indeterminate from the point of view of the 24617 caller of _Unwind_ForcedUnwind(). Rather than attempt to 24618 return, therefore, the unwind library should use the 24619 exception_cleanup entry in object, and then call abort(). 24620 24621 _URC_NO_REASON 24622 This is not the destination from. The unwind runtime 24623 will call frame's personality routine with the 24624 _UA_FORCE_UNWIND and _UA_CLEANUP_PHASE flag set in 24625 actions, and then unwind to the next frame and call the 24626 stop() function again. 24627 24628 _URC_END_OF_STACK 24629 In order to allow _Unwind_ForcedUnwind() to perform 24630 special processing when it reaches the end of the stack, 24631 the unwind runtime will call it after the last frame is 24632 rejected, with a NULL stack pointer in the context, and 24633 the STOP() FUNCTION SHALL CATCH THIS CONDITION. iT MAY 24634 return this code if it cannot handle end-of-stack. 24635 24636 _URC_FATAL_PHASE2_ERROR 24637 The stop() function may return this code for other fatal 24638 conditions like stack corruption. 24639 24640 _Unwind_GetCFA 24641 24642 Name 24643 24644 _Unwind_GetCFA -- private C++ error handling method 24645 24646 Synopsis 24647 24648 _Unwind_Word _Unwind_GetCFA(struct _Unwind_Context * context); 24649 24650 Description 24651 24652 _Unwind_GetCFA() shall retrieve the value of the Canonical 24653 Frame Address (CFA) of the given context. 24654 24655 _Unwind_GetGR 24656 24657 Name 24658 24659 _Unwind_GetGR -- private C++ error handling method 24660 24661 Synopsis 24662 24663 _Unwind_Word _Unwind_GetGR(struct _Unwind_Context * context, 24664 int index); 24665 24666 Description 24667 24668 _Unwind_GetGR() returns data at index found in context. The 24669 register is identified by its index: 0 to 31 are for the fixed 24670 registers, and 32 to 127 are for the stacked registers. 24671 24672 During the two phases of unwinding, only GR1 has a guaranteed 24673 value, which is the global pointer of the frame referenced by 24674 the unwind context. If the register has its NAT bit set, the 24675 behavior is unspecified. 24676 24677 _Unwind_GetIP 24678 24679 Name 24680 24681 _Unwind_GetIP -- private C++ error handling method 24682 24683 Synopsis 24684 24685 _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context * context); 24686 24687 Description 24688 24689 _Unwind_GetIP() returns the instruction pointer value for the 24690 routine identified by the unwind context. 24691 24692 _Unwind_GetIPInfo 24693 24694 Name 24695 24696 _Unwind_GetIPInfo -- private C++ error handling method 24697 24698 Synopsis 24699 24700 _Unwind_Ptr _Unwind_GetIPInfo(struct _Unwind_Context * context, 24701 int * ip_before_insn); 24702 24703 Description 24704 24705 _Unwind_GetIPInfo() returns the instruction pointer value for 24706 the routine identified by the unwind context and sets 24707 ip_before_insn flag indicating whether that IP is before or 24708 after first not yet fully executed instruction. 24709 24710 _Unwind_GetLanguageSpecificData 24711 24712 Name 24713 24714 _Unwind_GetLanguageSpecificData -- private C++ error handling 24715 method 24716 24717 Synopsis 24718 24719 #include 24720 24721 _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct 24722 _Unwind_Context * context); 24723 24724 Description 24725 24726 _Unwind_GetLanguageSpecificData() returns the address of the 24727 language specific data area for the current stack frame 24728 described by context. 24729 24730 _Unwind_GetRegionStart 24731 24732 Name 24733 24734 _Unwind_GetRegionStart -- private C++ error handling method 24735 24736 Synopsis 24737 24738 _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context * 24739 context); 24740 24741 Description 24742 24743 _Unwind_GetRegionStart() routine returns the address (i.e., 0) 24744 of the beginning of the procedure or code fragment described by 24745 the current unwind descriptor block. 24746 24747 _Unwind_RaiseException 24748 24749 Name 24750 24751 _Unwind_RaiseException -- private C++ error handling method 24752 24753 Synopsis 24754 24755 _Unwind_Reason_Code _Unwind_RaiseException(struct 24756 _Unwind_Exception * object); 24757 24758 Description 24759 24760 _Unwind_RaiseException() raises an exception, passing along the 24761 given exception object, which should have its exception_class 24762 and exception_cleanup fields set. The exception object has been 24763 allocated by the language-specific runtime, and has a 24764 language-specific format, exception that it shall contain an 24765 _Unwind_Exception. 24766 24767 Return Value 24768 24769 _Unwind_RaiseException() does not return unless an error 24770 condition is found. If an error condition occurs, an 24771 _Unwind_Reason_Code is returnd: 24772 24773 _URC_END_OF_STACK 24774 The unwinder encountered the end of the stack during 24775 phase one without finding a handler. The unwind runtime 24776 will not have modified the stack. The C++ runtime will 24777 normally call uncaught_exception() in this case. 24778 24779 _URC_FATAL_PHASE1_ERROR 24780 The unwinder encountered an unexpected error during 24781 phase one, because of something like stack corruption. 24782 The unwind runtime will not have modified the stack. The 24783 C++ runtime will normally call terminate() in this case. 24784 24785 _URC_FATAL_PHASE2_ERROR 24786 The unwinder encountered an unexpected error during 24787 phase two. This is usually a throw, which will call 24788 terminate(). 24789 24790 _Unwind_Resume 24791 24792 Name 24793 24794 _Unwind_Resume -- private C++ error handling method 24795 24796 Synopsis 24797 24798 void _Unwind_Resume(struct _Unwind_Exception * object); 24799 24800 Description 24801 24802 _Unwind_Resume() resumes propagation of an existing exception 24803 object. A call to this routine is inserted as the end of a 24804 landing pad that performs cleanup, but does not resume normal 24805 execution. It causes unwinding to proceed further. 24806 24807 _Unwind_Resume_or_Rethrow 24808 24809 Name 24810 24811 _Unwind_Resume_or_Rethrow -- private C++ error handling method 24812 24813 Synopsis 24814 24815 _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 24816 _Unwind_Exception * exception_object); 24817 24818 Description 24819 24820 If the unwind was initiated due to a forced unwind, 24821 _Unwind_Resume_or_Rethrow() shall resume that operation, else 24822 it shall re-raise the exception. 24823 24824 _Unwind_SetGR 24825 24826 Name 24827 24828 _Unwind_SetGR -- private C++ error handling method 24829 24830 Synopsis 24831 24832 void _Unwind_SetGR(struct _Unwind_Context * context, int index, 24833 uint value); 24834 24835 Description 24836 24837 _Unwind_SetGR() sets the value of the register indexed for the 24838 routine identified by the unwind context. 24839 24840 _Unwind_SetIP 24841 24842 Name 24843 24844 _Unwind_SetIP -- private C++ error handling method 24845 24846 Synopsis 24847 24848 #include 24849 24850 void _Unwind_SetIP(struct _Unwind_Context * context, 24851 _Unwind_Ptr value); 24852 24853 Description 24854 24855 _Unwind_SetIP() sets the instruction pointer for the routine 24856 identified by the unwind context to value. 24857 __________________________________________________________ 24858 24859 12.15. Interfaces for libdl 24860 24861 Table 12-51 defines the library name and shared object name for 24862 the libdl library 24863 24864 Table 12-51. libdl Definition 24865 Library: libdl 24866 SONAME: libdl.so.2 24867 24868 The behavior of the interfaces in this library is specified by 24869 the following specifications: 24870 24871 [LSB] This Specification 24872 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 24873 __________________________________________________________ 24874 24875 12.15.1. Dynamic Loader 24876 __________________________________________________________ 24877 24878 12.15.1.1. Interfaces for Dynamic Loader 24879 24880 An LSB conforming implementation shall provide the generic 24881 functions for Dynamic Loader specified in Table 12-52, with the 24882 full mandatory functionality as described in the referenced 24883 underlying specification. 24884 24885 Table 12-52. libdl - Dynamic Loader Function Interfaces 24886 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 24887 dlsym [LSB] dlvsym [LSB] 24888 __________________________________________________________ 24889 24890 12.16. Data Definitions for libdl 24891 24892 This section defines global identifiers and their values that 24893 are associated with interfaces contained in libdl. These 24894 definitions are organized into groups that correspond to system 24895 headers. This convention is used as a convenience for the 24896 reader, and does not imply the existence of these headers, or 24897 their content. Where an interface is defined as requiring a 24898 particular system header file all of the data definitions for 24899 that system header file presented here shall be in effect. 24900 24901 This section gives data definitions to promote binary 24902 application portability, not to repeat source interface 24903 definitions available elsewhere. System providers and 24904 application developers should use this ABI to supplement - not 24905 to replace - source interface definition specifications. 24906 24907 This specification uses the ISO C (1999) C Language as the 24908 reference programming language, and data definitions are 24909 specified in ISO C format. The C language is used here as a 24910 convenient notation. Using a C language description of these 24911 data objects does not preclude their use by other programming 24912 languages. 24913 __________________________________________________________ 24914 24915 12.16.1. dlfcn.h 24916 24917 #define RTLD_NEXT ((void *) -1l) 24918 #define RTLD_DEFAULT ((void *) 0) 24919 #define RTLD_LOCAL 0 24920 #define RTLD_LAZY 0x00001 24921 #define RTLD_NOW 0x00002 24922 #define RTLD_GLOBAL 0x00100 24923 24924 typedef struct { 24925 char *dli_fname; 24926 void *dli_fbase; 24927 char *dli_sname; 24928 void *dli_saddr; 24929 } Dl_info; 24930 extern int dladdr(const void *__address, Dl_info * __info); 24931 extern int dlclose(void *__handle); 24932 extern char *dlerror(void); 24933 extern void *dlopen(const char *__file, int __mode); 24934 extern void *dlsym(void *__handle, const char *__name); 24935 extern void *dlvsym(void *handle, const char *name, const char *version); 24936 __________________________________________________________ 24937 24938 12.17. Interface Definitions for libdl 24939 24940 Table of Contents 24941 dladdr -- find the shared object containing a given address 24942 dlopen -- open dynamic object 24943 dlsym -- obtain the address of a symbol from a dlopen object 24944 dlvsym -- obtain the address of a symbol from a dlopen object 24945 24946 The interfaces defined on the following pages are included in 24947 libdl and are defined by this specification. Unless otherwise 24948 noted, these interfaces shall be included in the source 24949 standard. 24950 24951 Other interfaces listed in Section 12.15 shall behave as 24952 described in the referenced base document. 24953 24954 dladdr 24955 24956 Name 24957 24958 dladdr -- find the shared object containing a given address 24959 24960 Synopsis 24961 24962 #include 24963 24964 typedef struct { 24965 const char *dli_fname; 24966 void *dli_fbase; 24967 const char *dli_sname; 24968 void *dli_saddr; 24969 } Dl_info; 24970 24971 int dladdr(const void * addr, Dl_info * dlip); 24972 24973 Description 24974 24975 The dladdr() function shall query the dynamic linker for 24976 information about the shared object containing the address 24977 addr. The information shall be returned in the user supplied 24978 data structure referenced by dlip. 24979 24980 The structure shall contain at least the following members: 24981 24982 dli_fname 24983 24984 The pathname of the shared object containing the address 24985 dli_fbase 24986 24987 The base address at which the shared object is mapped into the 24988 address space of the calling process. 24989 dli_sname 24990 24991 The name of the nearest runtime symbol with value less than or 24992 equal to addr. Where possible, the symbol name shall be 24993 returned as it would appear in C source code. 24994 24995 If no symbol with a suitable value is found, both this field 24996 and dli_saddr shall be set to NULL. 24997 dli_saddr 24998 24999 The address of the symbol returned in dli_sname. This address 25000 has type "pointer to type", where type is the type of the 25001 symbol dli_sname. 25002 25003 Example: If the symbol in dli_sname is a function, then the 25004 type of dli_saddr is of type "pointer to function". 25005 25006 The behavior of dladdr() is only specified in dynamically 25007 linked programs. 25008 25009 Return Value 25010 25011 On success, dladdr() shall return non-zero, and the structure 25012 referenced by dlip shall be filled in as described. Otherwise, 25013 dladdr() shall return zero, and the cause of the error can be 25014 fetched with dlerror(). 25015 25016 Errors 25017 25018 See dlerror(). 25019 25020 Environment 25021 25022 LD_LIBRARY_PATH 25023 25024 directory search-path for object files 25025 25026 dlopen 25027 25028 Name 25029 25030 dlopen -- open dynamic object 25031 25032 Synopsis 25033 25034 #include 25035 25036 void * dlopen(const char * filename, int flag); 25037 25038 Description 25039 25040 The dlopen() function shall behave as specified in POSIX 25041 1003.1-2001 (ISO/IEC 9945-2003), but with additional behaviors 25042 listed below. 25043 25044 If the file argument does not contain a slash character, then 25045 the system shall look for a library of that name in at least 25046 the following directories, and use the first one which is 25047 found: 25048 25049 * The directories specified by the DT_RPATH dynamic entry. 25050 * The directories specified in the LD_LIBRARY_PATH 25051 environment variable (which is a colon separated list of 25052 pathnames). This step shall be skipped for setuid and 25053 setgid executables. 25054 * A set of directories sufficient to contain the libraries 25055 specified in this standard. 25056 25057 Note: Traditionally, /lib and /usr/lib. This case would also 25058 cover cases in which the system used the mechanism of 25059 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 25060 Example: An application which is not linked against libm may 25061 choose to dlopen libm. 25062 25063 dlsym 25064 25065 Name 25066 25067 dlsym -- obtain the address of a symbol from a dlopen object 25068 25069 Description 25070 25071 dlsym() is as specified in the POSIX 1003.1-2001 (ISO/IEC 25072 9945-2003), but with differences as listed below. 25073 25074 RTLD_NEXT, RTLD_DEFAULT Required 25075 25076 The values RTLD_NEXT and RTLD_DEFAULT, described as reserved 25077 for future use in POSIX 1003.1-2001 (ISO/IEC 9945-2003), are 25078 required, with behavior as described in POSIX 1003.1-2001 25079 (ISO/IEC 9945-2003). 25080 25081 dlvsym 25082 25083 Name 25084 25085 dlvsym -- obtain the address of a symbol from a dlopen object 25086 25087 Synopsis 25088 25089 #include 25090 25091 void * dlvsym(void * handle, char * name, char * version); 25092 25093 Description 25094 25095 dlvsym() does the same as dlsym() but takes a version string as 25096 an additional argument. 25097 __________________________________________________________ 25098 25099 12.18. Interfaces for librt 25100 25101 Table 12-53 defines the library name and shared object name for 25102 the librt library 25103 25104 Table 12-53. librt Definition 25105 Library: librt 25106 SONAME: librt.so.1 25107 25108 The behavior of the interfaces in this library is specified by 25109 the following specifications: 25110 25111 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 25112 __________________________________________________________ 25113 25114 12.18.1. Shared Memory Objects 25115 __________________________________________________________ 25116 25117 12.18.1.1. Interfaces for Shared Memory Objects 25118 25119 An LSB conforming implementation shall provide the generic 25120 functions for Shared Memory Objects specified in Table 12-54, 25121 with the full mandatory functionality as described in the 25122 referenced underlying specification. 25123 25124 Table 12-54. librt - Shared Memory Objects Function Interfaces 25125 shm_open [SUSv3] shm_unlink [SUSv3] 25126 __________________________________________________________ 25127 25128 12.18.2. Clock 25129 __________________________________________________________ 25130 25131 12.18.2.1. Interfaces for Clock 25132 25133 An LSB conforming implementation shall provide the generic 25134 functions for Clock specified in Table 12-55, with the full 25135 mandatory functionality as described in the referenced 25136 underlying specification. 25137 25138 Table 12-55. librt - Clock Function Interfaces 25139 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 25140 [SUSv3] clock_nanosleep [SUSv3] 25141 clock_settime [SUSv3] 25142 __________________________________________________________ 25143 25144 12.18.3. Timers 25145 __________________________________________________________ 25146 25147 12.18.3.1. Interfaces for Timers 25148 25149 An LSB conforming implementation shall provide the generic 25150 functions for Timers specified in Table 12-56, with the full 25151 mandatory functionality as described in the referenced 25152 underlying specification. 25153 25154 Table 12-56. librt - Timers Function Interfaces 25155 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 25156 [SUSv3] timer_gettime [SUSv3] 25157 timer_settime [SUSv3] 25158 __________________________________________________________ 25159 25160 12.18.4. Message Queues 25161 __________________________________________________________ 25162 25163 12.18.4.1. Interfaces for Message Queues 25164 25165 An LSB conforming implementation shall provide the generic 25166 functions for Message Queues specified in Table 12-57, with the 25167 full mandatory functionality as described in the referenced 25168 underlying specification. 25169 25170 Table 12-57. librt - Message Queues Function Interfaces 25171 mq_close(GLIBC_2.3.4) [SUSv3] mq_getattr(GLIBC_2.3.4) [SUSv3] 25172 mq_notify(GLIBC_2.3.4) [SUSv3] mq_open(GLIBC_2.3.4) [SUSv3] 25173 mq_receive(GLIBC_2.3.4) [SUSv3] mq_send(GLIBC_2.3.4) [SUSv3] 25174 mq_setattr(GLIBC_2.3.4) [SUSv3] mq_timedreceive(GLIBC_2.3.4) 25175 [SUSv3] 25176 mq_timedsend(GLIBC_2.3.4) [SUSv3] mq_unlink(GLIBC_2.3.4) 25177 [SUSv3] 25178 __________________________________________________________ 25179 25180 12.19. Data Definitions for librt 25181 25182 This section defines global identifiers and their values that 25183 are associated with interfaces contained in librt. These 25184 definitions are organized into groups that correspond to system 25185 headers. This convention is used as a convenience for the 25186 reader, and does not imply the existence of these headers, or 25187 their content. Where an interface is defined as requiring a 25188 particular system header file all of the data definitions for 25189 that system header file presented here shall be in effect. 25190 25191 This section gives data definitions to promote binary 25192 application portability, not to repeat source interface 25193 definitions available elsewhere. System providers and 25194 application developers should use this ABI to supplement - not 25195 to replace - source interface definition specifications. 25196 25197 This specification uses the ISO C (1999) C Language as the 25198 reference programming language, and data definitions are 25199 specified in ISO C format. The C language is used here as a 25200 convenient notation. Using a C language description of these 25201 data objects does not preclude their use by other programming 25202 languages. 25203 __________________________________________________________ 25204 25205 12.19.1. mqueue.h 25206 25207 typedef int mqd_t; 25208 struct mq_attr { 25209 long int mq_flags; 25210 long int mq_maxmsg; 25211 long int mq_msgsize; 25212 long int mq_curmsgs; 25213 long int __pad[4]; 25214 }; 25215 extern int mq_close(mqd_t __mqdes); 25216 extern int mq_getattr(mqd_t __mqdes, struct mq_attr *__mqstat); 25217 extern int mq_notify(mqd_t __mqdes, const struct sigevent *__notification); 25218 extern mqd_t mq_open(const char *__name, int __oflag, ...); 25219 extern ssize_t mq_receive(mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, 25220 unsigned int *__msg_prio); 25221 extern int mq_send(mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, 25222 unsigned int __msg_prio); 25223 extern int mq_setattr(mqd_t __mqdes, const struct mq_attr *__mqstat, 25224 struct mq_attr *__omqstat); 25225 extern ssize_t mq_timedreceive(mqd_t __mqdes, char *__msg_ptr, 25226 size_t __msg_len, unsigned int *__msg_prio, 25227 const struct timespec *__abs_timeout); 25228 extern int mq_timedsend(mqd_t __mqdes, const char *__msg_ptr, 25229 size_t __msg_len, unsigned int __msg_prio, 25230 const struct timespec *__abs_timeout); 25231 extern int mq_unlink(const char *__name); 25232 __________________________________________________________ 25233 25234 12.20. Interfaces for libcrypt 25235 25236 Table 12-58 defines the library name and shared object name for 25237 the libcrypt library 25238 25239 Table 12-58. libcrypt Definition 25240 Library: libcrypt 25241 SONAME: libcrypt.so.1 25242 25243 The behavior of the interfaces in this library is specified by 25244 the following specifications: 25245 25246 [SUSv3] POSIX 1003.1-2001 (ISO/IEC 9945-2003) 25247 __________________________________________________________ 25248 25249 12.20.1. Encryption 25250 __________________________________________________________ 25251 25252 12.20.1.1. Interfaces for Encryption 25253 25254 An LSB conforming implementation shall provide the generic 25255 functions for Encryption specified in Table 12-59, with the 25256 full mandatory functionality as described in the referenced 25257 underlying specification. 25258 25259 Table 12-59. libcrypt - Encryption Function Interfaces 25260 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 25261 __________________________________________________________ 25262 25263 12.21. Interfaces for libpam 25264 25265 Table 12-60 defines the library name and shared object name for 25266 the libpam library 25267 25268 Table 12-60. libpam Definition 25269 Library: libpam 25270 SONAME: libpam.so.0 25271 25272 The Pluggable Authentication Module (PAM) interfaces allow 25273 applications to request authentication via a system 25274 administrator defined mechanism, known as a service. 25275 25276 A single service name, other, shall always be present. The 25277 behavior of this service shall be determined by the system 25278 administrator. Additional service names may also exist. 25279 25280 Note: Future versions of this specification might define 25281 additional service names. 25282 25283 The behavior of the interfaces in this library is specified by 25284 the following specifications: 25285 25286 [LSB] This Specification 25287 __________________________________________________________ 25288 25289 12.21.1. Pluggable Authentication API 25290 __________________________________________________________ 25291 25292 12.21.1.1. Interfaces for Pluggable Authentication API 25293 25294 An LSB conforming implementation shall provide the generic 25295 functions for Pluggable Authentication API specified in Table 25296 12-61, with the full mandatory functionality as described in 25297 the referenced underlying specification. 25298 25299 Table 12-61. libpam - Pluggable Authentication API Function 25300 Interfaces 25301 pam_acct_mgmt(LIBPAM_1.0) [LSB] pam_authenticate(LIBPAM_1.0) 25302 [LSB] pam_chauthtok(LIBPAM_1.0) [LSB] 25303 pam_close_session(LIBPAM_1.0) [LSB] 25304 pam_end(LIBPAM_1.0) [LSB] pam_fail_delay(LIBPAM_1.0) [LSB] 25305 pam_get_item(LIBPAM_1.0) [LSB] pam_getenv(LIBPAM_1.0) [LSB] 25306 pam_getenvlist(LIBPAM_1.0) [LSB] pam_open_session(LIBPAM_1.0) 25307 [LSB] pam_putenv(LIBPAM_1.0) [LSB] pam_set_item(LIBPAM_1.0) 25308 [LSB] 25309 pam_setcred(LIBPAM_1.0) [LSB] pam_start(LIBPAM_1.0) [LSB] 25310 pam_strerror(LIBPAM_1.0) [LSB] 25311 __________________________________________________________ 25312 25313 12.22. Data Definitions for libpam 25314 25315 This section defines global identifiers and their values that 25316 are associated with interfaces contained in libpam. These 25317 definitions are organized into groups that correspond to system 25318 headers. This convention is used as a convenience for the 25319 reader, and does not imply the existence of these headers, or 25320 their content. Where an interface is defined as requiring a 25321 particular system header file all of the data definitions for 25322 that system header file presented here shall be in effect. 25323 25324 This section gives data definitions to promote binary 25325 application portability, not to repeat source interface 25326 definitions available elsewhere. System providers and 25327 application developers should use this ABI to supplement - not 25328 to replace - source interface definition specifications. 25329 25330 This specification uses the ISO C (1999) C Language as the 25331 reference programming language, and data definitions are 25332 specified in ISO C format. The C language is used here as a 25333 convenient notation. Using a C language description of these 25334 data objects does not preclude their use by other programming 25335 languages. 25336 __________________________________________________________ 25337 25338 12.22.1. security/pam_appl.h 25339 25340 typedef struct pam_handle pam_handle_t; 25341 struct pam_message { 25342 int msg_style; 25343 const char *msg; 25344 }; 25345 struct pam_response { 25346 char *resp; 25347 int resp_retcode; /* currently un-used, zero expected */ 25348 }; 25349 25350 struct pam_conv { 25351 int (*conv) (int num_msg, const struct pam_message * *msg, 25352 struct pam_response * *resp, void *appdata_ptr); 25353 void *appdata_ptr; 25354 }; 25355 25356 #define PAM_PROMPT_ECHO_OFF 1 25357 #define PAM_PROMPT_ECHO_ON 2 25358 #define PAM_ERROR_MSG 3 25359 #define PAM_TEXT_INFO 4 25360 25361 #define PAM_SERVICE 1 /* The service name */ 25362 #define PAM_USER 2 /* The user name */ 25363 #define PAM_TTY 3 /* The tty name */ 25364 #define PAM_RHOST 4 /* The remote host name */ 25365 #define PAM_CONV 5 /* The pam_conv structure */ 25366 #define PAM_RUSER 8 /* The remote user name */ 25367 #define PAM_USER_PROMPT 9 /* the prompt for getting a username */ 25368 25369 #define PAM_SUCCESS 0 /* Successful function return */ 25370 #define PAM_OPEN_ERR 1 /* dlopen() failure */ 25371 #define PAM_USER_UNKNOWN 10 /* User not known to the underlying authenticaiton module */ 25372 #define PAM_MAXTRIES 11 /* An authentication service has maintained a retry count which */ 25373 #define PAM_NEW_AUTHTOK_REQD 12 /* New authentication token required */ 25374 #define PAM_ACCT_EXPIRED 13 /* User account has expired */ 25375 #define PAM_SESSION_ERR 14 /* Can not make/remove an entry for the specified session */ 25376 #define PAM_CRED_UNAVAIL 15 /* Underlying authentication service can not retrieve user cred */ 25377 #define PAM_CRED_EXPIRED 16 /* User credentials expired */ 25378 #define PAM_CRED_ERR 17 /* Failure setting user credentials */ 25379 #define PAM_CONV_ERR 19 /* Conversation error */ 25380 #define PAM_SYMBOL_ERR 2 /* Symbol not found */ 25381 #define PAM_AUTHTOK_ERR 20 /* Authentication token manipulation error */ 25382 #define PAM_AUTHTOK_RECOVER_ERR 21 /* Authentication information cannot be recovered */ 25383 #define PAM_AUTHTOK_LOCK_BUSY 22 /* Authentication token lock busy */ 25384 #define PAM_AUTHTOK_DISABLE_AGING 23 /* Authentication tokenaging disabled */ 25385 #define PAM_TRY_AGAIN 24 /* Preliminary check by password service */ 25386 #define PAM_ABORT 26 /* Critical error (?module fail now request) */ 25387 #define PAM_AUTHTOK_EXPIRED 27 /* user's authentication token has expired */ 25388 #define PAM_BAD_ITEM 29 /* Bad item passed to pam_*_item() */ 25389 #define PAM_SERVICE_ERR 3 /* Error in service module */ 25390 #define PAM_SYSTEM_ERR 4 /* System error */ 25391 #define PAM_BUF_ERR 5 /* Memory buffer error */ 25392 #define PAM_PERM_DENIED 6 /* Permission denied */ 25393 #define PAM_AUTH_ERR 7 /* Authentication failure */ 25394 #define PAM_CRED_INSUFFICIENT 8 /* Can not access authentication data due to insufficient crede */ 25395 #define PAM_AUTHINFO_UNAVAIL 9 /* Underlying authentication service can not retrieve authentic */ 25396 25397 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 25398 #define PAM_ESTABLISH_CRED 0x0002U /* Set user credentials for an authentication service */ 25399 #define PAM_DELETE_CRED 0x0004U /* Delete user credentials associated with an authentication se */ 25400 #define PAM_REINITIALIZE_CRED 0x0008U /* Reinitialize user credentials */ 25401 #define PAM_REFRESH_CRED 0x0010U /* Extend lifetime of user credentials */ 25402 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U /* Extend lifetime of user credentials */ 25403 #define PAM_SILENT 0x8000U /* Authentication service should not generate any messages */ 25404 25405 extern int pam_acct_mgmt(pam_handle_t *, int); 25406 extern int pam_authenticate(pam_handle_t *, int); 25407 extern int pam_chauthtok(pam_handle_t *, int); 25408 extern int pam_close_session(pam_handle_t *, int); 25409 extern int pam_end(pam_handle_t *, int); 25410 extern int pam_fail_delay(pam_handle_t *, unsigned int); 25411 extern int pam_get_item(const pam_handle_t *, int, const void **); 25412 extern const char *pam_getenv(pam_handle_t *, const char *); 25413 extern char **pam_getenvlist(pam_handle_t *); 25414 extern int pam_open_session(pam_handle_t *, int); 25415 extern int pam_putenv(pam_handle_t *, const char *); 25416 extern int pam_set_item(pam_handle_t *, int, const void *); 25417 extern int pam_setcred(pam_handle_t *, int); 25418 extern int pam_start(const char *, const char *, const struct pam_conv *, 25419 pam_handle_t * *); 25420 extern const char *pam_strerror(pam_handle_t *, int); 25421 __________________________________________________________ 25422 25423 12.23. Interface Definitions for libpam 25424 25425 Table of Contents 25426 pam_acct_mgmt -- establish the status of a user's account 25427 pam_authenticate -- authenticate the user 25428 pam_chauthtok -- change the authentication token for a given 25429 user 25430 25431 pam_close_session -- indicate that an authenticated session has 25432 ended 25433 25434 pam_end -- terminate the use of the PAM library 25435 pam_fail_delay -- specify delay time to use on authentication 25436 error 25437 25438 pam_get_item -- obtain the value of the indicated item. 25439 pam_getenv -- get a PAM environment variable 25440 pam_getenvlist -- returns a pointer to the complete PAM 25441 environment. 25442 25443 pam_open_session -- indicate session has started 25444 pam_putenv -- Add, replace or delete a PAM environment variable 25445 pam_set_item -- (re)set the value of an item. 25446 pam_setcred -- set the module-specific credentials of the user 25447 pam_start -- initialize the PAM library 25448 pam_strerror -- returns a string describing the PAM error 25449 25450 The interfaces defined on the following pages are included in 25451 libpam and are defined by this specification. Unless otherwise 25452 noted, these interfaces shall be included in the source 25453 standard. 25454 25455 Other interfaces listed in Section 12.21 shall behave as 25456 described in the referenced base document. 25457 25458 pam_acct_mgmt 25459 25460 Name 25461 25462 pam_acct_mgmt -- establish the status of a user's account 25463 25464 Synopsis 25465 25466 #include 25467 25468 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 25469 25470 Description 25471 25472 pam_acct_mgmt() establishes the account's usability and the 25473 user's accessibility to the system. It is typically called 25474 after the user has been authenticated. 25475 25476 flags may be specified as any valid flag (namely, one of those 25477 applicable to the flags argument of pam_authenticate()). 25478 Additionally, the value of flags may be logically or'd with 25479 PAM_SILENT. 25480 25481 Return Value 25482 25483 PAM_SUCCESS 25484 25485 Success. 25486 PAM_NEW_AUTHTOK_REQD 25487 25488 User is valid, but user's authentication token has expired. The 25489 correct response to this return-value is to require that the 25490 user satisfy the pam_chauthtok() function before obtaining 25491 service. It may not be possible for an application to do this. 25492 In such a case, the user should be denied access until the 25493 account password is updated. 25494 PAM_ACCT_EXPIRED 25495 25496 User is no longer permitted access to the system. 25497 PAM_AUTH_ERR 25498 25499 Authentication error. 25500 PAM_PERM_DENIED 25501 25502 User is not permitted to gain access at this time. 25503 PAM_USER_UNKNOWN 25504 25505 User is not known to a module's account management component. 25506 25507 Note: Errors may be translated to text with pam_strerror(). 25508 25509 pam_authenticate 25510 25511 Name 25512 25513 pam_authenticate -- authenticate the user 25514 25515 Synopsis 25516 25517 #include 25518 25519 int pam_authenticate(pam_handle_t * pamh, int flags); 25520 25521 Description 25522 25523 pam_authenticate() serves as an interface to the authentication 25524 mechanisms of the loaded modules. 25525 25526 flags is an optional parameter that may be specified by the 25527 following value: 25528 25529 PAM_DISALLOW_NULL_AUTHTOK 25530 Instruct the authentication modules to return 25531 PAM_AUTH_ERR if the user does not have a registered 25532 authorization token. 25533 25534 Additionally, the value of flags may be logically or'd with 25535 PAM_SILENT. 25536 25537 The process may need to be privileged in order to successfully 25538 call this function. 25539 25540 Return Value 25541 25542 PAM_SUCCESS 25543 Success. 25544 25545 PAM_AUTH_ERR 25546 User was not authenticated or process did not have 25547 sufficient privileges to perform authentication. 25548 25549 PAM_CRED_INSUFFICIENT 25550 Application does not have sufficient credentials to 25551 authenticate the user. 25552 25553 PAM_AUTHINFO_UNAVAIL 25554 Modules were not able to access the authentication 25555 information. This might be due to a network or hardware 25556 failure, etc. 25557 25558 PAM_USER_UNKNOWN 25559 Supplied username is not known to the authentication 25560 service. 25561 25562 PAM_MAXTRIES 25563 One or more authentication modules has reached its limit 25564 of tries authenticating the user. Do not try again. 25565 25566 PAM_ABORT 25567 One or more authentication modules failed to load. 25568 25569 Note: Errors may be translated to text with pam_strerror(). 25570 25571 pam_chauthtok 25572 25573 Name 25574 25575 pam_chauthtok -- change the authentication token for a given 25576 user 25577 25578 Synopsis 25579 25580 #include 25581 25582 int pam_chauthtok(pam_handle_t * pamh, const int flags); 25583 25584 Description 25585 25586 pam_chauthtok() is used to change the authentication token for 25587 a given user as indicated by the state associated with the 25588 handle pamh. 25589 25590 flags is an optional parameter that may be specified by the 25591 following value: 25592 25593 PAM_CHANGE_EXPIRED_AUTHTOK 25594 User's authentication token should only be changed if it 25595 has expired. 25596 25597 Additionally, the value of flags may be logically or'd with 25598 PAM_SILENT. 25599 25600 RETURN VALUE 25601 25602 PAM_SUCCESS 25603 Success. 25604 25605 PAM_AUTHTOK_ERR 25606 A module was unable to obtain the new authentication 25607 token. 25608 25609 PAM_AUTHTOK_RECOVER_ERR 25610 A module was unable to obtain the old authentication 25611 token. 25612 25613 PAM_AUTHTOK_LOCK_BUSY 25614 One or more modules were unable to change the 25615 authentication token since it is currently locked. 25616 25617 PAM_AUTHTOK_DISABLE_AGING 25618 Authentication token aging has been disabled for at 25619 least one of the modules. 25620 25621 PAM_PERM_DENIED 25622 Permission denied. 25623 25624 PAM_TRY_AGAIN 25625 Not all modules were in a position to update the 25626 authentication token(s). In such a case, none of the 25627 user's authentication tokens are updated. 25628 25629 PAM_USER_UNKNOWN 25630 User is not known to the authentication token changing 25631 service. 25632 25633 Note: Errors may be translated to text with pam_strerror(). 25634 25635 pam_close_session 25636 25637 Name 25638 25639 pam_close_session -- indicate that an authenticated session has 25640 ended 25641 25642 Synopsis 25643 25644 #include 25645 25646 int pam_close_session(pam_handle_t * pamh, int flags); 25647 25648 Description 25649 25650 pam_close_session() is used to indicate that an authenticated 25651 session has ended. It is used to inform the module that the 25652 user is exiting a session. It should be possible for the PAM 25653 library to open a session and close the same session from 25654 different applications. 25655 25656 flags may have the value PAM_SILENT to indicate that no output 25657 should be generated as a result of this function call. 25658 25659 Return Value 25660 25661 PAM_SUCCESS 25662 25663 Success. 25664 PAM_SESSION_ERR 25665 25666 One of the required loaded modules was unable to close a 25667 session for the user. 25668 25669 Note: Errors may be translated to text with pam_strerror(). 25670 25671 pam_end 25672 25673 Name 25674 25675 pam_end -- terminate the use of the PAM library 25676 25677 Synopsis 25678 25679 #include 25680 25681 int pam_end(pam_handle_t * pamh, int pam_status); 25682 25683 Description 25684 25685 pam_end() terminates use of the PAM library. On success, the 25686 contents of *pamh are no longer valid, and all memory 25687 associated with it is invalid. 25688 25689 Normally, pam_status is passed the value PAM_SUCCESS, but in 25690 the event of an unsuccessful service application, the 25691 appropriate PAM error return value should be used. 25692 25693 Return Value 25694 25695 PAM_SUCCESS 25696 25697 Success. 25698 25699 Note: Errors may be translated to text with pam_strerror(). 25700 25701 pam_fail_delay 25702 25703 Name 25704 25705 pam_fail_delay -- specify delay time to use on authentication 25706 error 25707 25708 Synopsis 25709 25710 #include 25711 25712 int pam_fail_delay(pam_handle_t * pamh, unsigned int 25713 micro_sec); 25714 25715 Description 25716 25717 pam_fail_delay() specifies the minimum delay for the PAM 25718 library to use when an authentication error occurs. The actual 25719 delay can vary by as much at 25%. If this function is called 25720 multiple times, the longest time specified by any of the call 25721 will be used. 25722 25723 The delay is invoked if an authentication error occurs during 25724 the pam_authenticate() or pam_chauthtok() function calls. 25725 25726 Independent of the success of pam_authenticate() or 25727 pam_chauthtok(), the delay time is reset to its default value 25728 of 0 when the PAM library returns control to the application 25729 from these two functions. 25730 25731 Return Value 25732 25733 PAM_SUCCESS 25734 25735 Success. 25736 25737 Note: Errors may be translated to text with pam_strerror(). 25738 25739 pam_get_item 25740 25741 Name 25742 25743 pam_get_item -- obtain the value of the indicated item. 25744 25745 Synopsis 25746 25747 #include 25748 25749 int pam_get_item(const pam_handle_t * pamh, int item_type, 25750 const void * * item); 25751 25752 Description 25753 25754 pam_get_item() obtains the value of the indicated item_type. 25755 The possible values of item_type are the same as listed for 25756 pam_set_item(). 25757 25758 On success, item contains a pointer to the value of the 25759 corresponding item. Note that this is a pointer to the actual 25760 data and should not be free()'d or over-written. 25761 25762 Return Value 25763 25764 PAM_SUCCESS 25765 25766 Success. 25767 PAM_PERM_DENIED 25768 25769 Application passed a NULL pointer for item. 25770 PAM_BAD_ITEM 25771 25772 Application attempted to get an undefined item. 25773 25774 Note: Errors may be translated to text with pam_strerror(). 25775 25776 pam_getenv 25777 25778 Name 25779 25780 pam_getenv -- get a PAM environment variable 25781 25782 Synopsis 25783 25784 #include 25785 25786 const char * pam_getenv(const pam_handle_t * pamh, const char * 25787 name); 25788 25789 Description 25790 25791 The pam_getenv() function shall search the environment 25792 associated with the PAM handle pamh for the environment 25793 variable name. If the specified environment variable cannot be 25794 found, a null pointer shall be returned. The application shall 25795 ensure that it does not modify the string pointed to by the 25796 pam_getenv() function. 25797 25798 Return Value 25799 25800 On success, pam_getenv() returns a pointer to a string of the 25801 form name=value. 25802 25803 pam_getenvlist 25804 25805 Name 25806 25807 pam_getenvlist -- returns a pointer to the complete PAM 25808 environment. 25809 25810 Synopsis 25811 25812 #include 25813 25814 char * const * pam_getenvlist(pam_handle_t * pamh); 25815 25816 Description 25817 25818 pam_getenvlist() returns a pointer to the complete PAM 25819 environment. This pointer points to an array of pointers to 25820 NUL-terminated strings and must be terminated by a NULL 25821 pointer. Each string has the form "name=value". 25822 25823 The PAM library module allocates memory for the returned value 25824 and the associated strings. The calling application is 25825 responsible for freeing this memory. 25826 25827 Return Value 25828 25829 pam_getenvlist() returns an array of string pointers containing 25830 the PAM environment. On error, NULL is returned. 25831 25832 pam_open_session 25833 25834 Name 25835 25836 pam_open_session -- indicate session has started 25837 25838 Synopsis 25839 25840 #include 25841 25842 int pam_open_session(pam_handle_t * pamh, int flags); 25843 25844 Description 25845 25846 The pam_open_session() function is used to indicate that an 25847 authenticated session has begun, after the user has been 25848 identified (see pam_authenticate()) and, if necessary, granted 25849 credentials (see pam_setcred()). It is used to inform the 25850 module that the user is currently in a session. It should be 25851 possible for the PAM library to open a session and close the 25852 same session from different applications. 25853 25854 flags may have the value PAM_SILENT to indicate that no output 25855 be generated as a result of this function call. 25856 25857 Return Value 25858 25859 PAM_SUCCESS 25860 25861 Success. 25862 PAM_SESSION_ERR 25863 25864 One of the loaded modules was unable to open a session for the 25865 user. 25866 25867 Note: Errors may be translated to text with pam_strerror(). 25868 25869 pam_putenv 25870 25871 Name 25872 25873 pam_putenv -- Add, replace or delete a PAM environment variable 25874 25875 Synopsis 25876 25877 #include 25878 25879 int pam_putenv(const pam_handle_t * pamh, const char * 25880 name_value); 25881 25882 Description 25883 25884 The pam_putenv() function shall modify the environment list 25885 associated with pamh. If name_value contains an '=' character, 25886 the characters to the left of the first '=' character represent 25887 the name, and the remaining characters after the '=' represent 25888 the value. 25889 25890 If the name environment variable exists in the environment 25891 associated with pamh, it shall be modified to have the value 25892 value. Otherwise, the name shall be added to the environment 25893 associated with pamh with the value value. 25894 25895 If there is no '=' character in name_value, the variable in the 25896 environment associated with pamh named name_value shall be 25897 deleted. 25898 25899 Return Value 25900 25901 On success, the pam_putenv() function shall return PAM_SUCCESS. 25902 Otherwise the return value indicates the error: 25903 25904 PAM_PERM_DENIED 25905 25906 The name_value argument is a null pointer. 25907 PAM_BAD_ITEM 25908 25909 The PAM environment varable named name_value does not exist and 25910 therefore cannot be deleted. 25911 PAM_ABORT 25912 25913 The PAM handle identifed by pamh is corrupt. 25914 PAM_BUF_ERR 25915 25916 Memory buffer error. 25917 25918 pam_set_item 25919 25920 Name 25921 25922 pam_set_item -- (re)set the value of an item. 25923 25924 Synopsis 25925 25926 #include 25927 25928 int pam_set_item(pam_handle_t * pamh, int item_type, const void 25929 * item); 25930 25931 Description 25932 25933 pam_set_item() (re)sets the value of one of the following 25934 item_types: 25935 25936 PAM_SERVICE 25937 25938 service name 25939 PAM_USER 25940 25941 user name 25942 PAM_TTY 25943 25944 terminal name 25945 25946 The value for a device file should include the /dev/ prefix. 25947 The value for graphical, X-based, applications should be the 25948 $DISPLAY variable. 25949 PAM_RHOST 25950 25951 remote host name 25952 PAM_CONV 25953 25954 conversation structure 25955 PAM_RUSER 25956 25957 remote user name 25958 PAM_USER_PROMPT 25959 25960 string to be used when prompting for a user's name 25961 25962 The default value for this string is Please enter username: . 25963 25964 For all item_types other than PAM_CONV, item is a pointer to a 25965 NULL-terminated character string. In the case of PAM_CONV, item 25966 points to an initialized pam_conv structure. 25967 25968 Return Value 25969 25970 PAM_SUCCESS 25971 25972 Success. 25973 PAM_PERM_DENIED 25974 25975 An attempt was made to replace the conversation structure with 25976 a NULL value. 25977 PAM_BUF_ERR 25978 25979 Function ran out of memory making a copy of the item. 25980 PAM_BAD_ITEM 25981 25982 Application attempted to set an undefined item. 25983 25984 Note: Errors may be translated to text with pam_strerror(). 25985 25986 pam_setcred 25987 25988 Name 25989 25990 pam_setcred -- set the module-specific credentials of the user 25991 25992 Synopsis 25993 25994 #include 25995 25996 extern int pam_setcred(pam_handle_t * pamh, int flags); 25997 25998 Description 25999 26000 pam_setcred() sets the module-specific credentials of the user. 26001 It is usually called after the user has been authenticated, 26002 after the account management function has been called and after 26003 a session has been opened for the user. 26004 26005 flags maybe specified from among the following values: 26006 26007 PAM_ESTABLISH_CRED 26008 set credentials for the authentication service 26009 26010 PAM_DELETE_CRED 26011 delete credentials associated with the authentication 26012 service 26013 26014 PAM_REINITIALIZE_CRED 26015 reinitialize the user credentials 26016 26017 PAM_REFRESH_CRED 26018 extend lifetime of the user credentials 26019 26020 Additionally, the value of flags may be logically or'd with 26021 PAM_SILENT. 26022 26023 Return Value 26024 26025 PAM_SUCCESS 26026 26027 Success. 26028 PAM_CRED_UNAVAIL 26029 26030 Module cannot retrieve the user's credentials. 26031 PAM_CRED_EXPIRED 26032 26033 User's credentials have expired. 26034 PAM_USER_UNKNOWN 26035 26036 User is not known to an authentication module. 26037 PAM_CRED_ERR 26038 26039 Module was unable to set the credentials of the user. 26040 26041 Note: Errors may be translated to text with pam_strerror(). 26042 26043 pam_start 26044 26045 Name 26046 26047 pam_start -- initialize the PAM library 26048 26049 Synopsis 26050 26051 #include 26052 26053 int pam_start(const char * service_name, const char * user, 26054 const struct pam_conv * pam_conversation, pam_handle_t * * 26055 pamh); 26056 26057 Description 26058 26059 pam_start() is used to initialize the PAM library. It must be 26060 called prior to any other usage of the PAM library. On success, 26061 *pamh becomes a handle that provides continuity for successive 26062 calls to the PAM library. pam_start() expects arguments as 26063 follows: the service_name of the program, the username of the 26064 individual to be authenticated, a pointer to an 26065 application-supplied pam_conv structure, and a pointer to a 26066 pam_handle_t pointer. 26067 26068 An application must provide the conversation function used for 26069 direct communication between a loaded module and the 26070 application. The application also typically provides a means 26071 for the module to prompt the user for a password, etc. 26072 26073 The structure, pam_conv, is defined to be, 26074 struct pam_conv { 26075 int (*conv) (int num_msg, 26076 const struct pam_message * *msg, 26077 struct pam_response * *resp, 26078 void *appdata_ptr); 26079 void *appdata_ptr; 26080 }; 26081 26082 It is initialized by the application before it is passed to the 26083 library. The contents of this structure are attached to the 26084 *pamh handle. The point of this argument is to provide a 26085 mechanism for any loaded module to interact directly with the 26086 application program; this is why it is called a conversation 26087 structure. 26088 26089 When a module calls the referenced conv() function, appdata_ptr 26090 is set to the second element of this structure. 26091 26092 The other arguments of a call to conv() concern the information 26093 exchanged by module and application. num_msg holds the length 26094 of the array of pointers passed via msg. On success, the 26095 pointer resp points to an array of num_msg pam_response 26096 structures, holding the application-supplied text. Note that 26097 resp is a struct pam_response array and not an array of 26098 pointers. 26099 26100 Return Value 26101 26102 PAM_SUCCESS 26103 26104 Success. 26105 PAM_BUF_ERR 26106 26107 Memory allocation error. 26108 PAM_ABORT 26109 26110 Internal failure. 26111 26112 ERRORS 26113 26114 May be translated to text with pam_strerror(). 26115 26116 pam_strerror 26117 26118 Name 26119 26120 pam_strerror -- returns a string describing the PAM error 26121 26122 Synopsis 26123 26124 #include 26125 26126 const char * pam_strerror(pam_handle_t * pamh, int errnum); 26127 26128 Description 26129 26130 pam_strerror() returns a string describing the PAM error 26131 associated with errnum. 26132 26133 Return Value 26134 26135 On success, this function returns a description of the 26136 indicated error. The application should not free or modify this 26137 string. Otherwise, a string indicating that the error is 26138 unknown shall be returned. It is unspecified whether or not the 26139 string returned is translated according to the setting of 26140 LC_MESSAGES. 26141 26142 IV. Utility Libraries 26143 26144 Table of Contents 26145 13. Utility Libraries 26146 26147 13.1. Introduction 26148 13.2. Interfaces for libz 26149 26150 13.2.1. Compression Library 26151 26152 13.3. Data Definitions for libz 26153 26154 13.3.1. zconf.h 26155 13.3.2. zlib.h 26156 26157 13.4. Interface Definitions for libz 26158 26159 adler32 -- compute Adler 32 Checksum 26160 compress -- compress data 26161 compress2 -- compress data at a specified level 26162 compressBound -- compute compressed data size 26163 crc32 -- compute CRC-32 Checksum 26164 deflate -- compress data 26165 deflateBound -- compute compressed data size 26166 deflateCopy -- copy compression stream 26167 deflateEnd -- free compression stream state 26168 deflateInit2_ -- initialize compression system 26169 deflateInit_ -- initialize compression system 26170 deflateParams -- set compression parameters 26171 deflateReset -- reset compression stream state 26172 deflateSetDictionary -- initialize compression 26173 dictionary 26174 26175 get_crc_table -- generate a table for crc 26176 calculations 26177 26178 gzclose -- close a compressed file stream 26179 gzdopen -- open a compressed file 26180 gzeof -- check for end-of-file on a compressed file 26181 stream 26182 26183 gzerror -- decode an error on a compressed file 26184 stream 26185 26186 gzflush -- flush a compressed file stream 26187 gzgetc -- read a character from a compressed file 26188 gzgets -- read a string from a compressed file 26189 gzopen -- open a compressed file 26190 gzprintf -- format data and compress 26191 gzputc -- write character to a compressed file 26192 gzputs -- string write to a compressed file 26193 gzread -- read from a compressed file 26194 gzrewind -- reset the file-position indicator on a 26195 compressed file stream 26196 26197 gzseek -- reposition a file-position indicator in a 26198 compressed file stream 26199 26200 gzsetparams -- dynamically set compression 26201 parameters 26202 26203 gztell -- find position on a compressed file stream 26204 gzwrite -- write to a compressed file 26205 inflate -- decompress data 26206 inflateEnd -- free decompression stream state 26207 inflateInit2_ -- initialize decompression system 26208 inflateInit_ -- initialize decompression system 26209 inflateReset -- reset decompression stream state 26210 inflateSetDictionary -- initialize decompression 26211 dictionary 26212 26213 inflateSync -- advance compression stream to next 26214 sync point 26215 26216 inflateSyncPoint -- test for synchronization point 26217 uncompress -- uncompress data 26218 zError -- translate error number to string 26219 zlibVersion -- discover library version at run time 26220 26221 13.5. Interfaces for libncurses 26222 26223 13.5.1. Curses 26224 26225 13.6. Data Definitions for libncurses 26226 26227 13.6.1. curses.h 26228 13.6.2. term.h 26229 26230 13.7. Interface Definitions for libncurses 26231 26232 inchnstr -- obtain a string of characters and their 26233 attributes from a curses window 26234 26235 inchstr -- obtain a string of characters and their 26236 attributes from a curses window 26237 26238 instr -- obtain a string of characters from a curses 26239 window 26240 26241 mvcur -- send cursor movement commands to terminal 26242 mvinchnstr -- obtain a string of characters and 26243 their attributes from a curses window 26244 26245 mvinchstr -- obtain a string of characters and their 26246 attributes from a curses window 26247 26248 mvinstr -- obtain a string of characters from a 26249 curses window 26250 26251 mvscanw -- convert formatted input from a curses 26252 window 26253 26254 mvwinchnstr -- obtain a string of characters and 26255 their attributes from a curses window 26256 26257 mvwinchstr -- obtain a string of characters and 26258 their attributes from a curses window 26259 26260 mvwinstr -- obtain a string of characters from a 26261 curses window 26262 26263 mvwscanw -- convert formatted input from a curses 26264 window 26265 26266 ripoffline -- obtain a string of characters and 26267 their attributes from a curses window 26268 26269 scanw -- convert formatted input from a curses 26270 window 26271 26272 vw_scanw -- convert formatted input from a curses 26273 window 26274 26275 vwscanw -- convert formatted input from a curses 26276 window 26277 26278 winchnstr -- obtain a string of characters and their 26279 attributes from a curses window 26280 26281 winchstr -- obtain a string of characters and their 26282 attributes from a curses window 26283 26284 winstr -- obtain a string of characters from a 26285 curses window 26286 26287 wscanw -- convert formatted input from a curses 26288 window 26289 26290 13.8. Interfaces for libutil 26291 26292 13.8.1. Utility Functions 26293 26294 13.9. Interface Definitions for libutil 26295 26296 forkpty -- Create a new process attached to an 26297 available pseudo-terminal 26298 26299 login -- login utility function 26300 login_tty -- Prepare a terminal for login 26301 logout -- logout utility function 26302 logwtmp -- append an entry to the wtmp file 26303 openpty -- find and open an available 26304 pseudo-terminal 26305 __________________________________________________________ 26306 26307 Chapter 13. Utility Libraries 26308 26309 13.1. Introduction 26310 26311 An LSB-conforming implementation shall also support the 26312 following utility libraries which are built on top of the 26313 interfaces provided by the base libraries. These libraries 26314 implement common functionality, and hide additional system 26315 dependent information such as file formats and device names. 26316 26317 * libz 26318 * libcurses 26319 * libutil 26320 26321 The structure of the definitions for these libraries follows 26322 the same model as used for Base Libraries. 26323 __________________________________________________________ 26324 26325 13.2. Interfaces for libz 26326 26327 Table 13-1 defines the library name and shared object name for 26328 the libz library 26329 26330 Table 13-1. libz Definition 26331 Library: libz 26332 SONAME: libz.so.1 26333 26334 The behavior of the interfaces in this library is specified by 26335 the following specifications: 26336 26337 [LSB] This Specification 26338 __________________________________________________________ 26339 26340 13.2.1. Compression Library 26341 __________________________________________________________ 26342 26343 13.2.1.1. Interfaces for Compression Library 26344 26345 An LSB conforming implementation shall provide the generic 26346 functions for Compression Library specified in Table 13-2, with 26347 the full mandatory functionality as described in the referenced 26348 underlying specification. 26349 26350 Table 13-2. libz - Compression Library Function Interfaces 26351 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 26352 [LSB] 26353 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 26354 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 26355 deflateParams [LSB] 26356 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 26357 [LSB] gzclose [LSB] 26358 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 26359 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 26360 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 26361 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 26362 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] inflateInit_ 26363 [LSB] 26364 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync [LSB] 26365 inflateSyncPoint [LSB] 26366 uncompress [LSB] zError [LSB] zlibVersion [LSB] 26367 __________________________________________________________ 26368 26369 13.3. Data Definitions for libz 26370 26371 This section defines global identifiers and their values that 26372 are associated with interfaces contained in libz. These 26373 definitions are organized into groups that correspond to system 26374 headers. This convention is used as a convenience for the 26375 reader, and does not imply the existence of these headers, or 26376 their content. Where an interface is defined as requiring a 26377 particular system header file all of the data definitions for 26378 that system header file presented here shall be in effect. 26379 26380 This section gives data definitions to promote binary 26381 application portability, not to repeat source interface 26382 definitions available elsewhere. System providers and 26383 application developers should use this ABI to supplement - not 26384 to replace - source interface definition specifications. 26385 26386 This specification uses the ISO C (1999) C Language as the 26387 reference programming language, and data definitions are 26388 specified in ISO C format. The C language is used here as a 26389 convenient notation. Using a C language description of these 26390 data objects does not preclude their use by other programming 26391 languages. 26392 __________________________________________________________ 26393 26394 13.3.1. zconf.h 26395 26396 #define ZEXPORT 26397 #define ZEXPORTVA 26398 #define OF(args) args 26399 #define ZEXTERN extern 26400 __________________________________________________________ 26401 26402 13.3.2. zlib.h 26403 26404 #define Z_NULL 0 26405 #define ZLIB_VERSION "1.2.2" 26406 #define MAX_WBITS 15 /* 32K LZ77 window */ 26407 #define MAX_MEM_LEVEL 9 /* Maximum value for memLevel in deflateInit2 */ 26408 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy)\ 26409 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 26410 #define deflateInit(strm,level) \ 26411 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 26412 #define inflateInit2(strm,windowBits) \ 26413 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 26414 #define inflateInit(strm) \ 26415 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 26416 26417 typedef char charf; 26418 typedef int intf; 26419 26420 typedef void *voidpf; 26421 typedef unsigned int uInt; 26422 typedef unsigned long int uLong; 26423 typedef uLong uLongf; 26424 typedef void *voidp; 26425 typedef unsigned char Byte; 26426 typedef off_t z_off_t; 26427 typedef void *const voidpc; 26428 26429 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 26430 typedef void (*free_func) (voidpf opaque, voidpf address); 26431 struct internal_state { 26432 int dummy; 26433 }; 26434 typedef Byte Bytef; 26435 typedef uInt uIntf; 26436 26437 typedef struct z_stream_s { 26438 Bytef *next_in; /* next input byte */ 26439 uInt avail_in; /* number of bytes available at next_in*/ 26440 uLong total_in; /* total nb of input bytes read so far */ 26441 Bytef *next_out; /* next output byte should be put there*/ 26442 uInt avail_out; /* remaining free space at next_out */ 26443 uLong total_out; /* total nb of bytes output so far */ 26444 char *msg; /* last error message, NULL if no error*/ 26445 struct internal_state *state; /* not visible by applications */ 26446 alloc_func zalloc; /* used to allocate the internal state */ 26447 free_func zfree; /* used to free the internal state */ 26448 voidpf opaque; /* private data object passed to zallocand zfree */ 26449 int data_type; /* best guess about the data type: ascii or binary */ 26450 uLong adler; /* adler32 value of the uncompressed data */ 26451 uLong reserved; /* reserved for future use */ 26452 } z_stream; 26453 26454 typedef z_stream *z_streamp; 26455 typedef voidp gzFile; 26456 26457 #define Z_NO_FLUSH 0 26458 #define Z_PARTIAL_FLUSH 1 26459 #define Z_SYNC_FLUSH 2 26460 #define Z_FULL_FLUSH 3 26461 #define Z_FINISH 4 26462 #define Z_BLOCK 5 26463 26464 #define Z_ERRNO (-1) 26465 #define Z_STREAM_ERROR (-2) 26466 #define Z_DATA_ERROR (-3) 26467 #define Z_MEM_ERROR (-4) 26468 #define Z_BUF_ERROR (-5) 26469 #define Z_VERSION_ERROR (-6) 26470 #define Z_OK 0 26471 #define Z_STREAM_END 1 26472 #define Z_NEED_DICT 2 26473 26474 #define Z_DEFAULT_COMPRESSION (-1) 26475 #define Z_NO_COMPRESSION 0 26476 #define Z_BEST_SPEED 1 26477 #define Z_BEST_COMPRESSION 9 26478 26479 #define Z_DEFAULT_STRATEGY 0 26480 #define Z_FILTERED 1 26481 #define Z_HUFFMAN_ONLY 2 26482 26483 #define Z_BINARY 0 26484 #define Z_ASCII 1 26485 #define Z_UNKNOWN 2 26486 26487 #define Z_DEFLATED 8 26488 26489 extern uLong adler32(uLong adler, const Bytef * buf, uInt len); 26490 extern int compress(Bytef * dest, uLongf * destLen, const Bytef * source, 26491 uLong sourceLen); 26492 extern int compress2(Bytef * dest, uLongf * destLen, const Bytef * source, 26493 uLong sourceLen, int level); 26494 extern uLong compressBound(uLong sourceLen); 26495 extern uLong crc32(uLong crc, const Bytef * buf, uInt len); 26496 extern int deflate(z_streamp strm, int flush); 26497 extern uLong deflateBound(z_streamp strm, uLong sourceLen); 26498 extern int deflateCopy(z_streamp dest, z_streamp source); 26499 extern int deflateEnd(z_streamp strm); 26500 extern int deflateInit2_(z_streamp strm, int level, int method, 26501 int windowBits, int memLevel, int strategy, 26502 const char *version, int stream_size); 26503 extern int deflateInit_(z_streamp strm, int level, const char *version, 26504 int stream_size); 26505 extern int deflateParams(z_streamp strm, int level, int strategy); 26506 extern int deflateReset(z_streamp strm); 26507 extern int deflateSetDictionary(z_streamp strm, const Bytef * dictionary, 26508 uInt dictLength); 26509 extern const uLongf *get_crc_table(void); 26510 extern int gzclose(gzFile file); 26511 extern gzFile gzdopen(int fd, const char *mode); 26512 extern int gzeof(gzFile file); 26513 extern const char *gzerror(gzFile file, int *errnum); 26514 extern int gzflush(gzFile file, int flush); 26515 extern int gzgetc(gzFile file); 26516 extern char *gzgets(gzFile file, char *buf, int len); 26517 extern gzFile gzopen(const char *path, const char *mode); 26518 extern int gzprintf(gzFile file, const char *format, ...); 26519 extern int gzputc(gzFile file, int c); 26520 extern int gzputs(gzFile file, const char *s); 26521 extern int gzread(gzFile file, voidp buf, unsigned int len); 26522 extern int gzrewind(gzFile file); 26523 extern z_off_t gzseek(gzFile file, z_off_t offset, int whence); 26524 extern int gzsetparams(gzFile file, int level, int strategy); 26525 extern z_off_t gztell(gzFile file); 26526 extern int gzwrite(gzFile file, voidpc buf, unsigned int len); 26527 extern int inflate(z_streamp strm, int flush); 26528 extern int inflateEnd(z_streamp strm); 26529 extern int inflateInit2_(z_streamp strm, int windowBits, 26530 const char *version, int stream_size); 26531 extern int inflateInit_(z_streamp strm, const char *version, 26532 int stream_size); 26533 extern int inflateReset(z_streamp strm); 26534 extern int inflateSetDictionary(z_streamp strm, const Bytef * dictionary, 26535 uInt dictLength); 26536 extern int inflateSync(z_streamp strm); 26537 extern int inflateSyncPoint(z_streamp z); 26538 extern int uncompress(Bytef * dest, uLongf * destLen, const Bytef * source, 26539 uLong sourceLen); 26540 extern const char *zError(int); 26541 extern const char *zlibVersion(void); 26542 __________________________________________________________ 26543 26544 13.4. Interface Definitions for libz 26545 26546 Table of Contents 26547 adler32 -- compute Adler 32 Checksum 26548 compress -- compress data 26549 compress2 -- compress data at a specified level 26550 compressBound -- compute compressed data size 26551 crc32 -- compute CRC-32 Checksum 26552 deflate -- compress data 26553 deflateBound -- compute compressed data size 26554 deflateCopy -- copy compression stream 26555 deflateEnd -- free compression stream state 26556 deflateInit2_ -- initialize compression system 26557 deflateInit_ -- initialize compression system 26558 deflateParams -- set compression parameters 26559 deflateReset -- reset compression stream state 26560 deflateSetDictionary -- initialize compression dictionary 26561 get_crc_table -- generate a table for crc calculations 26562 gzclose -- close a compressed file stream 26563 gzdopen -- open a compressed file 26564 gzeof -- check for end-of-file on a compressed file stream 26565 gzerror -- decode an error on a compressed file stream 26566 gzflush -- flush a compressed file stream 26567 gzgetc -- read a character from a compressed file 26568 gzgets -- read a string from a compressed file 26569 gzopen -- open a compressed file 26570 gzprintf -- format data and compress 26571 gzputc -- write character to a compressed file 26572 gzputs -- string write to a compressed file 26573 gzread -- read from a compressed file 26574 gzrewind -- reset the file-position indicator on a compressed 26575 file stream 26576 26577 gzseek -- reposition a file-position indicator in a compressed 26578 file stream 26579 26580 gzsetparams -- dynamically set compression parameters 26581 gztell -- find position on a compressed file stream 26582 gzwrite -- write to a compressed file 26583 inflate -- decompress data 26584 inflateEnd -- free decompression stream state 26585 inflateInit2_ -- initialize decompression system 26586 inflateInit_ -- initialize decompression system 26587 inflateReset -- reset decompression stream state 26588 inflateSetDictionary -- initialize decompression dictionary 26589 inflateSync -- advance compression stream to next sync point 26590 inflateSyncPoint -- test for synchronization point 26591 uncompress -- uncompress data 26592 zError -- translate error number to string 26593 zlibVersion -- discover library version at run time 26594 26595 The interfaces defined on the following pages are included in 26596 libz and are defined by this specification. Unless otherwise 26597 noted, these interfaces shall be included in the source 26598 standard. 26599 26600 Other interfaces listed in Section 13.2 shall behave as 26601 described in the referenced base document. 26602 26603 adler32 26604 26605 Name 26606 26607 adler32 -- compute Adler 32 Checksum 26608 26609 Synopsis 26610 26611 #include 26612 26613 uLong adler32(uLong adler, const Bytef * buf, uInt len); 26614 26615 Description 26616 26617 The adler32() function shall compute a running Adler-32 26618 checksum (as described in RFC 1950: ZLIB Compressed Data Format 26619 Specication). On entry, adler is the previous value for the 26620 checksum, and buf shall point to an array of len bytes of data 26621 to be added to this checksum. The adler32() function shall 26622 return the new checksum. 26623 26624 If buf is NULL (or Z_NULL), adler32() shall return the initial 26625 checksum. 26626 26627 Return Value 26628 26629 The adler32() function shall return the new checksum value. 26630 26631 Errors 26632 26633 None defined. 26634 26635 Application Usage (informative) 26636 26637 The following code fragment demonstrates typical usage of the 26638 adler32() function: 26639 uLong adler = adler32(0L, Z_NULL, 0); 26640 26641 while (read_buffer(buffer, length) != EOF) { 26642 adler = adler32(adler, buffer, length); 26643 } 26644 if (adler != original_adler) error(); 26645 26646 compress 26647 26648 Name 26649 26650 compress -- compress data 26651 26652 Synopsis 26653 26654 #include 26655 26656 int compress(Bytef * dest, uLongf * destLen, const Bytef * 26657 source, uLong sourceLen); 26658 26659 Description 26660 26661 The compress() function shall attempt to compress sourceLen 26662 bytes of data in the buffer source, placing the result in the 26663 buffer dest. 26664 26665 On entry, destLen should point to a value describing the size 26666 of the dest buffer. The application should ensure that this 26667 value be at least (sourceLen × 1.001) + 12. On successful exit, 26668 the variable referenced by destLen shall be updated to hold the 26669 length of compressed data in dest. 26670 26671 The compress() function is equivalent to compress2() with a 26672 level of Z_DEFAULT_COMPRESSION. 26673 26674 Return Value 26675 26676 On success, compress() shall return Z_OK. Otherwise, compress() 26677 shall return a value to indicate the error. 26678 26679 Errors 26680 26681 On error, compress() shall return a value as described below: 26682 26683 Z_BUF_ERROR 26684 26685 The buffer dest was not large enough to hold the compressed 26686 data. 26687 Z_MEM_ERROR 26688 26689 Insufficient memory. 26690 26691 compress2 26692 26693 Name 26694 26695 compress2 -- compress data at a specified level 26696 26697 Synopsis 26698 26699 #include 26700 26701 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 26702 source, uLong sourceLen, int level); 26703 26704 Description 26705 26706 The compress2() function shall attempt to compress sourceLen 26707 bytes of data in the buffer source, placing the result in the 26708 buffer dest, at the level described by level. The level 26709 supplied shall be a value between 0 and 9, or the value 26710 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest speed, 26711 while a level of 9 requests the highest compression. A level of 26712 0 indicates that no compression should be used, and the output 26713 shall be the same as the input. 26714 26715 On entry, destLen should point to a value describing the size 26716 of the dest buffer. The application should ensure that this 26717 value be at least (sourceLen × 1.001) + 12. On successful exit, 26718 the variable referenced by destLen shall be updated to hold the 26719 length of compressed data in dest. 26720 26721 The compress() function is equivalent to compress2() with a 26722 level of Z_DEFAULT_COMPRESSION. 26723 26724 Return Value 26725 26726 On success, compress2() shall return Z_OK. Otherwise, 26727 compress2() shall return a value to indicate the error. 26728 26729 Errors 26730 26731 On error, compress2() shall return a value as described below: 26732 26733 Z_BUF_ERROR 26734 26735 The buffer dest was not large enough to hold the compressed 26736 data. 26737 Z_MEM_ERROR 26738 26739 Insufficient memory. 26740 Z_STREAM_ERROR 26741 26742 The level was not Z_DEFAULT_COMPRESSION, or was not between 0 26743 and 9. 26744 26745 compressBound 26746 26747 Name 26748 26749 compressBound -- compute compressed data size 26750 26751 Synopsis 26752 26753 #include 26754 26755 int compressBound(uLong sourceLen); 26756 26757 Description 26758 26759 The compressBound() function shall estimate the size of buffer 26760 required to compress sourceLen bytes of data using the 26761 compress() or compress2() functions. If successful, the value 26762 returned shall be an upper bound for the size of buffer 26763 required to compress sourceLen bytes of data, using the 26764 parameters stored in stream, in a single call to compress() or 26765 compress2(). 26766 26767 Return Value 26768 26769 The compressBound() shall return a value representing the upper 26770 bound of an array to allocate to hold the compressed data in a 26771 single call to compress() or compress2(). This function may 26772 return a conservative value that may be larger than sourceLen. 26773 26774 Errors 26775 26776 None defined. 26777 26778 crc32 26779 26780 Name 26781 26782 crc32 -- compute CRC-32 Checksum 26783 26784 Synopsis 26785 26786 #include 26787 26788 uLong crc32(uLong crc, const Bytef * buf, uInt len); 26789 26790 Description 26791 26792 The crc32() function shall compute a running Cyclic Redundancy 26793 Check checksum, as defined in ITU-T V.42. On entry, crc is the 26794 previous value for the checksum, and buf shall point to an 26795 array of len bytes of data to be added to this checksum. The 26796 crc32() function shall return the new checksum. 26797 26798 If buf is NULL (or Z_NULL), crc32() shall return the initial 26799 checksum. 26800 26801 Return Value 26802 26803 The crc32() function shall return the new checksum value. 26804 26805 Errors 26806 26807 None defined. 26808 26809 Application Usage (informative) 26810 26811 The following code fragment demonstrates typical usage of the 26812 crc32() function: 26813 uLong crc = crc32(0L, Z_NULL, 0); 26814 26815 while (read_buffer(buffer, length) != EOF) { 26816 crc = crc32(crc, buffer, length); 26817 } 26818 if (crc != original_crc) error(); 26819 26820 deflate 26821 26822 Name 26823 26824 deflate -- compress data 26825 26826 Synopsis 26827 26828 #include 26829 26830 int deflate(z_streamp stream, int flush); 26831 26832 Description 26833 26834 The deflate() function shall attempt to compress data until 26835 either the input buffer is empty or the output buffer is full. 26836 The stream references a z_stream structure. Before the first 26837 call to deflate(), this structure should have been initialized 26838 by a call to deflateInit2_(). 26839 26840 Note: deflateInit2_() is only in the binary standard; source 26841 level applications should initialize stream via a call to 26842 deflateInit() or deflateInit2(). 26843 26844 In addition, the stream input and output buffers should have 26845 been initialized as follows: 26846 26847 next_in 26848 26849 should point to the data to be compressed. 26850 avail_in 26851 26852 should contain the number of bytes of data in the buffer 26853 referenced by next_in. 26854 next_out 26855 26856 should point to a buffer where compressed data may be placed. 26857 avail_out 26858 26859 should contain the size in bytes of the buffer referenced by 26860 next_out 26861 26862 The deflate() function shall perform one or both of the 26863 following actions: 26864 26865 1. Compress input data from next_in and update next_in, 26866 avail_in and total_in to reflect the data that has been 26867 compressed. 26868 2. Fill the output buffer referenced by next_out, and update 26869 next_out, avail_out and total_out to reflect the compressed 26870 data that has been placed there. If flush is not 26871 Z_NO_FLUSH, and avail_out indicates that there is still 26872 space in output buffer, this action shall always occur (see 26873 below for further details). 26874 26875 The deflate() function shall return when either avail_in 26876 reaches zero (indicating that all the input data has been 26877 compressed), or avail_out reaches zero (indicating that the 26878 output buffer is full). 26879 26880 On success, the deflate() function shall set the adler field of 26881 the stream to the adler32() checksum of all the input data 26882 compressed so far (represented by total_in). 26883 26884 If the deflate() function shall attempt to determine the type 26885 of input data, and set field data_type in stream to Z_ASCII if 26886 the majority of the data bytes fall within the ASCII (ISO 646) 26887 printable character range. Otherwise, it shall set data_type to 26888 Z_BINARY. This data type is informational only, and does not 26889 affect the compression algorithm. 26890 26891 Note: Future versions of the LSB may remove this 26892 requirement, since it is based on an outdated character set 26893 that does not support Internationalization, and does not 26894 affect the algorithm. It is included for information only at 26895 this release. Applications should not depend on this field. 26896 26897 Flush Operation 26898 26899 The parameter flush determines when compressed bits are added 26900 to the output buffer in next_out. If flush is Z_NO_FLUSH, 26901 deflate() may return with some data pending output, and not yet 26902 added to the output buffer. 26903 26904 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 26905 output to next_out and align the output to a byte boundary. A 26906 synchronization point is generated in the output. 26907 26908 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 26909 Z_SYNC_FLUSH, and the compression state shall be reset. A 26910 synchronization point is generated in the output. 26911 26912 Rationale: Z_SYNC_FLUSH is intended to ensure that the 26913 compressed data contains all the data compressed so far, and 26914 allows a decompressor to reconstruct all of the input data. 26915 Z_FULL_FLUSH allows decompression to restart from this point 26916 if the previous compressed data has been lost or damaged. 26917 Flushing is likely to degrade the performance of the 26918 compression system, and should only be used where necessary. 26919 26920 If flush is set to Z_FINISH, all pending input shall be 26921 processed and deflate() shall return with Z_STREAM_END if there 26922 is sufficient space in the output buffer at next_out, as 26923 indicated by avail_out. If deflate() is called with flush set 26924 to Z_FINISH and there is insufficient space to store the 26925 compressed data, and no other error has occurred during 26926 compression, deflate() shall return Z_OK, and the application 26927 should call deflate() again with flush unchanged, and having 26928 updated next_out and avail_out. 26929 26930 If all the compression is to be done in a single step, 26931 deflate() may be called with flush set to Z_FINISH immediately 26932 after the stream has been initialized if avail_out is set to at 26933 least the value returned by deflateBound(). 26934 26935 Return Value 26936 26937 On success, deflate() shall return Z_OK, unless flush was set 26938 to Z_FINISH and there was sufficient space in the output buffer 26939 to compress all of the input data. In this case, deflate() 26940 shall return Z_STREAM_END. On error, deflate() shall return a 26941 value to indicate the error. 26942 26943 Note: If deflate() returns Z_OK and has set avail_out to 26944 zero, the function should be called again with the same 26945 value for flush, and with updated next_out and avail_out 26946 until deflate() returns with Z_OK (or Z_STREAM_END if flush 26947 is set to Z_FINISH) and a non-zero avail_out. 26948 26949 Errors 26950 26951 On error, deflate() shall return a value as described below, 26952 and set the msg field of stream to point to a string describing 26953 the error: 26954 26955 Z_BUF_ERROR 26956 26957 No progress is possible; either avail_in or avail_out was zero. 26958 Z_MEM_ERROR 26959 26960 Insufficient memory. 26961 Z_STREAM_ERROR 26962 26963 The state (as represented in stream) is inconsistent, or stream 26964 was NULL. 26965 26966 deflateBound 26967 26968 Name 26969 26970 deflateBound -- compute compressed data size 26971 26972 Synopsis 26973 26974 #include 26975 26976 int deflateBound(z_streamp stream, uLong sourceLen); 26977 26978 Description 26979 26980 The deflateBound() function shall estimate the size of buffer 26981 required to compress sourceLen bytes of data. If successful, 26982 the value returned shall be an upper bound for the size of 26983 buffer required to compress sourceLen bytes of data, using the 26984 parameters stored in stream, in a single call to deflate() with 26985 flush set to Z_FINISH. 26986 26987 On entry, stream should have been initialized via a call to 26988 deflateInit_() or deflateInit2_(). 26989 26990 Return Value 26991 26992 The deflateBound() shall return a value representing the upper 26993 bound of an array to allocate to hold the compressed data in a 26994 single call to deflate(). If the stream is not correctly 26995 initialized, or is NULL, then deflateBound() may return a 26996 conservative value that may be larger than sourceLen. 26997 26998 Errors 26999 27000 None defined. 27001 27002 deflateCopy 27003 27004 Name 27005 27006 deflateCopy -- copy compression stream 27007 27008 Synopsis 27009 27010 #include 27011 27012 int deflateCopy(z_streamp dest, z_streamp source); 27013 27014 Description 27015 27016 The deflateCopy() function shall copy the compression state 27017 information in source to the uninitialized z_stream structure 27018 referenced by dest. 27019 27020 On successful return, dest will be an exact copy of the stream 27021 referenced by source. The input and output buffer pointers in 27022 next_in and next_out will reference the same data. 27023 27024 Return Value 27025 27026 On success, deflateCopy() shall return Z_OK. Otherwise it shall 27027 return a value less than zero to indicate the error. 27028 27029 Errors 27030 27031 On error, deflateCopy() shall return a value as described 27032 below: 27033 27034 Z_STREAM_ERROR 27035 27036 The state in source is inconsistent, or either source or dest 27037 was NULL. 27038 Z_MEM_ERROR 27039 27040 Insufficient memory available. 27041 27042 Application Usage (informative) 27043 27044 This function can be useful when several compression strategies 27045 will be tried, for example when there are several ways of 27046 pre-processing the input data with a filter. The streams that 27047 will be discarded should then be freed by calling deflateEnd(). 27048 Note that deflateCopy() duplicates the internal compression 27049 state which can be quite large, so this strategy may be slow 27050 and can consume lots of memory. 27051 27052 deflateEnd 27053 27054 Name 27055 27056 deflateEnd -- free compression stream state 27057 27058 Synopsis 27059 27060 #include 27061 27062 int deflateEnd(z_streamp stream); 27063 27064 Description 27065 27066 The deflateEnd() function shall free all allocated state 27067 information referenced by stream. All pending output is 27068 discarded, and unprocessed input is ignored. 27069 27070 Return Value 27071 27072 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 27073 there was pending output discarded or input unprocessed. 27074 Otherwise it shall return Z_STREAM_ERROR to indicate the error. 27075 27076 Errors 27077 27078 On error, deflateEnd() shall return Z_STREAM_ERROR. The 27079 following conditions shall be treated as an error: 27080 27081 * The state in stream is inconsistent or inappropriate. 27082 * stream is NULL. 27083 27084 deflateInit2_ 27085 27086 Name 27087 27088 deflateInit2_ -- initialize compression system 27089 27090 Synopsis 27091 27092 #include 27093 27094 int deflateInit2_ (z_streamp strm, int level, int method, int 27095 windowBits, int memLevel, int strategy, char * version, int 27096 stream_size); 27097 27098 Description 27099 27100 The deflateInit2_() function shall initialize the compression 27101 system. On entry, strm shall refer to a user supplied z_stream 27102 object (a z_stream_s structure). The following fields shall be 27103 set on entry: 27104 27105 zalloc 27106 27107 a pointer to an alloc_func function, used to allocate state 27108 information. If this is NULL, a default allocation function 27109 will be used. 27110 zfree 27111 27112 a pointer to a free_func function, used to free memory 27113 allocated by the zalloc function. If this is NULL a default 27114 free function will be used. 27115 opaque 27116 27117 If alloc_func is not NULL, opaque is a user supplied pointer to 27118 data that will be passed to the alloc_func and free_func 27119 functions. 27120 27121 If the version requested is not compatible with the version 27122 implemented, or if the size of the z_stream_s structure 27123 provided in stream_size does not match the size in the library 27124 implementation, deflateInit2_() shall fail, and return 27125 Z_VERSION_ERROR. 27126 27127 The level supplied shall be a value between 0 and 9, or the 27128 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 27129 speed, while a level of 9 requests the highest compression. A 27130 level of 0 indicates that no compression should be used, and 27131 the output shall be the same as the input. 27132 27133 The method selects the compression algorithm to use. LSB 27134 conforming implementation shall support the Z_DEFLATED method, 27135 and may support other implementation defined methods. 27136 27137 The windowBits parameter shall be a base 2 logarithm of the 27138 window size to use, and shall be a value between 8 and 15. A 27139 smaller value will use less memory, but will result in a poorer 27140 compression ratio, while a higher value will give better 27141 compression but utilize more memory. 27142 27143 The memLevel parameter specifies how much memory to use for the 27144 internal state. The value of memLevel shall be between 1 and 27145 MAX_MEM_LEVEL. Smaller values use less memory but are slower, 27146 while higher values use more memory to gain compression speed. 27147 27148 The strategy parameter selects the compression strategy to use: 27149 27150 Z_DEFAULT_STRATEGY 27151 27152 use the system default compression strategy. Z_DEFAULT_STRATEGY 27153 is particularly appropriate for text data. 27154 Z_FILTERED 27155 27156 use a compression strategy tuned for data consisting largely of 27157 small values with a fairly random distribution. Z_FILTERED uses 27158 more Huffman encoding and less string matching than 27159 Z_DEFAULT_STRATEGY. 27160 Z_HUFFMAN_ONLY 27161 27162 force Huffman encoding only, with no string match. 27163 27164 The deflateInit2_() function is not in the source standard; it 27165 is only in the binary standard. Source applications should use 27166 the deflateInit2() macro. 27167 27168 Return Value 27169 27170 On success, the deflateInit2_() function shall return Z_OK. 27171 Otherwise, deflateInit2_() shall return a value as described 27172 below to indicate the error. 27173 27174 Errors 27175 27176 On error, deflateInit2_() shall return one of the following 27177 error indicators: 27178 27179 Z_STREAM_ERROR 27180 27181 Invalid parameter. 27182 Z_MEM_ERROR 27183 27184 Insufficient memory available. 27185 Z_VERSION_ERROR 27186 27187 The version requested is not compatible with the library 27188 version, or the z_stream size differs from that used by the 27189 library. 27190 27191 In addition, the msg field of the strm may be set to an error 27192 message. 27193 27194 deflateInit_ 27195 27196 Name 27197 27198 deflateInit_ -- initialize compression system 27199 27200 Synopsis 27201 27202 #include 27203 27204 int deflateInit_(z_streamp stream, int level, const char * 27205 version, int stream_size); 27206 27207 Description 27208 27209 The deflateInit_() function shall initialize the compression 27210 system. On entry, stream shall refer to a user supplied 27211 z_stream object (a z_stream_s structure). The following fields 27212 shall be set on entry: 27213 27214 zalloc 27215 27216 a pointer to an alloc_func function, used to allocate state 27217 information. If this is NULL, a default allocation function 27218 will be used. 27219 zfree 27220 27221 a pointer to a free_func function, used to free memory 27222 allocated by the zalloc function. If this is NULL a default 27223 free function will be used. 27224 opaque 27225 27226 If alloc_func is not NULL, opaque is a user supplied pointer to 27227 data that will be passed to the alloc_func and free_func 27228 functions. 27229 27230 If the version requested is not compatible with the version 27231 implemented, or if the size of the z_stream_s structure 27232 provided in stream_size does not match the size in the library 27233 implementation, deflateInit_() shall fail, and return 27234 Z_VERSION_ERROR. 27235 27236 The level supplied shall be a value between 0 and 9, or the 27237 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 27238 speed, while a level of 9 requests the highest compression. A 27239 level of 0 indicates that no compression should be used, and 27240 the output shall be the same as the input. 27241 27242 The deflateInit_() function is not in the source standard; it 27243 is only in the binary standard. Source applications should use 27244 the deflateInit() macro. 27245 27246 The deflateInit_() function is equivalent to 27247 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, MAX_MEM_LEVEL, 27248 Z_DEFAULT_STRATEGY, version, stream_size); 27249 27250 Return Value 27251 27252 On success, the deflateInit_() function shall return Z_OK. 27253 Otherwise, deflateInit_() shall return a value as described 27254 below to indicate the error. 27255 27256 Errors 27257 27258 On error, deflateInit_() shall return one of the following 27259 error indicators: 27260 27261 Z_STREAM_ERROR 27262 27263 Invalid parameter. 27264 Z_MEM_ERROR 27265 27266 Insufficient memory available. 27267 Z_VERSION_ERROR 27268 27269 The version requested is not compatible with the library 27270 version, or the z_stream size differs from that used by the 27271 library. 27272 27273 In addition, the msg field of the stream may be set to an error 27274 message. 27275 27276 deflateParams 27277 27278 Name 27279 27280 deflateParams -- set compression parameters 27281 27282 Synopsis 27283 27284 #include 27285 27286 int deflateParams(z_streamp stream, int level, int strategy); 27287 27288 Description 27289 27290 The deflateParams() function shall dynamically alter the 27291 compression parameters for the compression stream object 27292 stream. On entry, stream shall refer to a user supplied 27293 z_stream object (a z_stream_s structure), already initialized 27294 via a call to deflateInit_() or deflateInit2_(). 27295 27296 The level supplied shall be a value between 0 and 9, or the 27297 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 27298 speed, while a level of 9 requests the highest compression. A 27299 level of 0 indicates that no compression should be used, and 27300 the output shall be the same as the input. If the compression 27301 level is altered by deflateParams(), and some data has already 27302 been compressed with this stream (i.e. total_in is not zero), 27303 and the new level requires a different underlying compression 27304 method, then stream shall be flushed by a call to deflate(). 27305 27306 The strategy parameter selects the compression strategy to use: 27307 27308 Z_DEFAULT_STRATEGY 27309 27310 use the system default compression strategy. Z_DEFAULT_STRATEGY 27311 is particularly appropriate for text data. 27312 Z_FILTERED 27313 27314 use a compression strategy tuned for data consisting largely of 27315 small values with a fairly random distribution. Z_FILTERED uses 27316 more Huffman encoding and less string matching than 27317 Z_DEFAULT_STRATEGY. 27318 Z_HUFFMAN_ONLY 27319 27320 force Huffman encoding only, with no string match. 27321 27322 Return Value 27323 27324 On success, the deflateParams() function shall return Z_OK. 27325 Otherwise, deflateParams() shall return a value as described 27326 below to indicate the error. 27327 27328 Errors 27329 27330 On error, deflateParams() shall return one of the following 27331 error indicators: 27332 27333 Z_STREAM_ERROR 27334 27335 Invalid parameter. 27336 Z_MEM_ERROR 27337 27338 Insufficient memory available. 27339 Z_BUF_ERROR 27340 27341 Insufficient space in stream to flush the current output. 27342 27343 In addition, the msg field of the strm may be set to an error 27344 message. 27345 27346 Application Usage (Informative) 27347 27348 Applications should ensure that the stream is flushed, e.g. by 27349 a call to deflate(stream, Z_SYNC_FLUSH) before calling 27350 deflateParams(), or ensure that there is sufficient space in 27351 next_out (as identified by avail_out) to ensure that all 27352 pending output and all uncompressed input can be flushed in a 27353 single call to deflate(). 27354 27355 Rationale: Although the deflateParams() function should 27356 flush pending output and compress all pending input, the 27357 result is unspecified if there is insufficient space in the 27358 output buffer. Applications should only call deflateParams() 27359 when the stream is effectively empty (flushed). 27360 27361 The deflateParams() can be used to switch between 27362 compression and straight copy of the input data, or to 27363 switch to a different kind of input data requiring a 27364 different strategy. 27365 27366 deflateReset 27367 27368 Name 27369 27370 deflateReset -- reset compression stream state 27371 27372 Synopsis 27373 27374 #include 27375 27376 int deflateReset(z_streamp stream); 27377 27378 Description 27379 27380 The deflateReset() function shall reset all state associated 27381 with stream. All pending output shall be discarded, and the 27382 counts of processed bytes (total_in and total_out) shall be 27383 reset to zero. 27384 27385 Return Value 27386 27387 On success, deflateReset() shall return Z_OK. Otherwise it 27388 shall return Z_STREAM_ERROR to indicate the error. 27389 27390 Errors 27391 27392 On error, deflateReset() shall return Z_STREAM_ERROR. The 27393 following conditions shall be treated as an error: 27394 27395 * The state in stream is inconsistent or inappropriate. 27396 * stream is NULL. 27397 27398 deflateSetDictionary 27399 27400 Name 27401 27402 deflateSetDictionary -- initialize compression dictionary 27403 27404 Synopsis 27405 27406 #include 27407 27408 int deflateSetDictionary(z_streamp stream, const Bytef * 27409 dictionary, uInt dictlen); 27410 27411 Description 27412 27413 The deflateSetDictionary() function shall initialize the 27414 compression dictionary associated with stream using the dictlen 27415 bytes referenced by dictionary. 27416 27417 The implementation may silently use a subset of the provided 27418 dictionary if the dictionary cannot fit in the current window 27419 associated with stream (see deflateInit2_()). The application 27420 should ensure that the dictionary is sorted such that the most 27421 commonly used strings occur at the end of the dictionary. 27422 27423 If the dictionary is successfully set, the Adler32 checksum of 27424 the entire provided dictionary shall be stored in the adler 27425 member of stream. This value may be used by the decompression 27426 system to select the correct dictionary. The compression and 27427 decompression systems must use the same dictionary. 27428 27429 stream shall reference an initialized compression stream, with 27430 total_in zero (i.e. no data has been compressed since the 27431 stream was initialized). 27432 27433 Return Value 27434 27435 On success, deflateSetDictionary() shall return Z_OK. Otherwise 27436 it shall return Z_STREAM_ERROR to indicate an error. 27437 27438 Errors 27439 27440 On error, deflateSetDictionary() shall return a value as 27441 described below: 27442 27443 Z_STREAM_ERROR 27444 27445 The state in stream is inconsistent, or stream was NULL. 27446 27447 Application Usage (informative) 27448 27449 The application should provide a dictionary consisting of 27450 strings {{{ed note: do we really mean "strings"? Null 27451 terminated?}}} that are likely to be encountered in the data to 27452 be compressed. The application should ensure that the 27453 dictionary is sorted such that the most commonly used strings 27454 occur at the end of the dictionary. 27455 27456 The use of a dictionary is optional; however if the data to be 27457 compressed is relatively short and has a predictable structure, 27458 the use of a dictionary can substantially improve the 27459 compression ratio. 27460 27461 get_crc_table 27462 27463 Name 27464 27465 get_crc_table -- generate a table for crc calculations 27466 27467 Synopsis 27468 27469 #include 27470 27471 const uLongf * get_crc_table(void); 27472 27473 Description 27474 27475 Generate tables for a byte-wise 32-bit CRC calculation based on 27476 the polynomial: 27477 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 27478 27479 In a multi-threaded application, get_crc_table() should be 27480 called by one thread to initialize the tables before any other 27481 thread calls any libz function. 27482 27483 Return Value 27484 27485 The get_crc_table() function shall return a pointer to the 27486 first of a set of tables used internally to calculate CRC-32 27487 values (see crc32()). 27488 27489 Errors 27490 27491 None defined. 27492 27493 gzclose 27494 27495 Name 27496 27497 gzclose -- close a compressed file stream 27498 27499 Synopsis 27500 27501 #include 27502 27503 int gzclose (gzFile file ); 27504 27505 Description 27506 27507 The gzclose() function shall close the compressed file stream 27508 file. If file was open for writing, gzclose() shall first flush 27509 any pending output. Any state information allocated shall be 27510 freed. 27511 27512 Return Value 27513 27514 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 27515 shall return an error value as described below. 27516 27517 Errors 27518 27519 On error, gzclose() may set the global variable errno to 27520 indicate the error. The gzclose() shall return a value other 27521 than Z_OK on error. 27522 27523 Z_STREAM_ERROR 27524 27525 file was NULL (or Z_NULL), or did not refer to an open 27526 compressed file stream. 27527 Z_ERRNO 27528 27529 An error occurred in the underlying base libraries, and the 27530 application should check errno for further information. 27531 Z_BUF_ERROR 27532 27533 no compression progress is possible during buffer flush (see 27534 deflate()). 27535 27536 gzdopen 27537 27538 Name 27539 27540 gzdopen -- open a compressed file 27541 27542 Synopsis 27543 27544 #include 27545 27546 gzFile gzdopen ( int fd, const char *mode ); 27547 27548 Description 27549 27550 The gzdopen() function shall attempt to associate the open file 27551 referenced by fd with a gzFile object. The mode argument is 27552 based on that of fopen(), but the mode parameter may also 27553 contain the following characters: 27554 27555 digit 27556 27557 set the compression level to digit. A low value (e.g. 1) means 27558 high speed, while a high value (e.g. 9) means high compression. 27559 A compression level of 0 (zero) means no compression. See 27560 deflateInit2_() for further details. 27561 [fhR] 27562 27563 set the compression strategy to [fhR]. The letter f corresponds 27564 to filtered data, the letter h corresponds to Huffman only 27565 compression, and the letter R corresponds to Run Length 27566 Encoding. See deflateInit2_() for further details. 27567 27568 If fd refers to an uncompressed file, and mode refers to a read 27569 mode, gzdopen() shall attempt to open the file and return a 27570 gzFile object suitable for reading directly from the file 27571 without any decompression. 27572 27573 If mode is NULL, or if mode does not contain one of r, w, or a, 27574 gzdopen() shall return Z_NULL, and need not set any other error 27575 condition. 27576 27577 Example 27578 27579 gzdopen(fileno(stdin), "r"); 27580 27581 Attempt to associate the standard input with a gzFile object. 27582 27583 Return Value 27584 27585 On success, gzdopen() shall return a gzFile object. On failure, 27586 gzdopen() shall return Z_NULL and may set errno accordingly. 27587 27588 Note: At version 1.2.2, zlib does not set errno for several 27589 error conditions. Applications may not be able to determine 27590 the cause of an error. 27591 27592 Errors 27593 27594 On error, gzdopen() may set the global variable errno to 27595 indicate the error. 27596 27597 gzeof 27598 27599 Name 27600 27601 gzeof -- check for end-of-file on a compressed file stream 27602 27603 Synopsis 27604 27605 #include 27606 27607 int gzeof (gzFile file ); 27608 27609 Description 27610 27611 The gzeof() function shall test the compressed file stream file 27612 for end of file. 27613 27614 Return Value 27615 27616 If file was open for reading and end of file has been reached, 27617 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 27618 27619 Errors 27620 27621 None defined. 27622 27623 gzerror 27624 27625 Name 27626 27627 gzerror -- decode an error on a compressed file stream 27628 27629 Synopsis 27630 27631 #include 27632 27633 const char * gzerror (gzFile file, int * errnum); 27634 27635 Description 27636 27637 The gzerror() function shall return a string describing the 27638 last error to have occurred associated with the open compressed 27639 file stream referred to by file. It shall also set the location 27640 referenced by errnum to an integer value that further 27641 identifies the error. 27642 27643 Return Value 27644 27645 The gzerror() function shall return a string that describes the 27646 last error associated with the given file compressed file 27647 stream. This string shall have the format "%s: %s", with the 27648 name of the file, followed by a colon, a space, and the 27649 description of the error. If the compressed file stream was 27650 opened by a call to gzdopen(), the format of the filename is 27651 unspecified. 27652 27653 Rationale: Although in all current implementations of libz 27654 file descriptors are named "", the code suggests that 27655 this is for debugging purposes only, and may change in a 27656 future release. 27657 27658 It is unspecified if the string returned is determined by the 27659 setting of the LC_MESSAGES category in the current locale. 27660 27661 Errors 27662 27663 None defined. 27664 27665 gzflush 27666 27667 Name 27668 27669 gzflush -- flush a compressed file stream 27670 27671 Synopsis 27672 27673 #include 27674 27675 int gzflush(gzFile file, int flush); 27676 27677 Description 27678 27679 The gzflush() function shall flush pending output to the 27680 compressed file stream identified by file, which must be open 27681 for writing. 27682 27683 Flush Operation 27684 27685 The parameter flush determines which compressed bits are added 27686 to the output file. If flush is Z_NO_FLUSH, gzflush() may 27687 return with some data pending output, and not yet written to 27688 the file. 27689 27690 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 27691 output to file and align the output to a byte boundary. There 27692 may still be data pending compression that is not flushed. 27693 27694 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 27695 Z_SYNC_FLUSH, and the compression state shall be reset. There 27696 may still be data pending compression that is not flushed. 27697 27698 Rationale: Z_SYNC_FLUSH is intended to ensure that the 27699 compressed data contains all the data compressed so far, and 27700 allows a decompressor to reconstruct all of the input data. 27701 Z_FULL_FLUSH allows decompression to restart from this point 27702 if the previous compressed data has been lost or damaged. 27703 Flushing is likely to degrade the performance of the 27704 compression system, and should only be used where necessary. 27705 27706 If flush is set to Z_FINISH, all pending uncompressed data 27707 shall be compressed and all output shall be flushed. 27708 27709 Return Value 27710 27711 On success, gzflush() shall return the value Z_OK. Otherwise 27712 gzflush() shall return a value to indicate the error, and may 27713 set the error number associated with the compressed file stream 27714 file. 27715 27716 Note: If flush is set to Z_FINISH and the flush operation is 27717 successful, gzflush() will return Z_OK, but the compressed 27718 file stream error value may be set to Z_STREAM_END. 27719 27720 Errors 27721 27722 On error, gzflush() shall return an error value, and may set 27723 the error number associated with the stream identified by file 27724 to indicate the error. Applications may use gzerror() to access 27725 this error value. 27726 27727 Z_ERRNO 27728 27729 An underlying base library function has indicated an error. The 27730 global variable errno may be examined for further information. 27731 Z_STREAM_ERROR 27732 27733 The stream is invalid, is not open for writing, or is in an 27734 invalid state. 27735 Z_BUF_ERROR 27736 27737 no compression progress is possible (see deflate()). 27738 Z_MEM_ERROR 27739 27740 Insufficient memory available to compress. 27741 27742 gzgetc 27743 27744 Name 27745 27746 gzgetc -- read a character from a compressed file 27747 27748 Synopsis 27749 27750 #include 27751 27752 int gzgetc (gzFile file); 27753 27754 Description 27755 27756 The gzgetc() function shall read the next single character from 27757 the compressed file stream referenced by file, which shall have 27758 been opened in a read mode (see gzopen() and gzdopen()). 27759 27760 Return Value 27761 27762 On success, gzgetc() shall return the uncompressed character 27763 read, otherwise, on end of file or error, gzgetc() shall return 27764 -1. 27765 27766 Errors 27767 27768 On end of file or error, gzgetc() shall return -1. Further 27769 information can be found by calling gzerror() with a pointer to 27770 the compressed file stream. 27771 27772 gzgets 27773 27774 Name 27775 27776 gzgets -- read a string from a compressed file 27777 27778 Synopsis 27779 27780 #include 27781 27782 char * gzgets (gzFile file, char * buf, int len); 27783 27784 Description 27785 27786 The gzgets() function shall attempt to read data from the 27787 compressed file stream file, uncompressing it into buf until 27788 either len-1 bytes have been inserted into buf, or until a 27789 newline character has been uncompressed into buf. A null byte 27790 shall be appended to the uncompressed data. The file shall have 27791 been opened in for reading (see gzopen() and gzdopen()). 27792 27793 Return Value 27794 27795 On success, gzgets() shall return a pointer to buf. Otherwise, 27796 gzgets() shall return Z_NULL. Applications may examine the 27797 cause using gzerror(). 27798 27799 Errors 27800 27801 On error, gzgets() shall return Z_NULL. The following 27802 conditions shall always be treated as an error: 27803 27804 file is NULL, or does not refer to a file open for reading; 27805 buf is NULL; 27806 len is less than or equal to zero. 27807 27808 gzopen 27809 27810 Name 27811 27812 gzopen -- open a compressed file 27813 27814 Synopsis 27815 27816 #include 27817 27818 gzFile gzopen (const char *path , const char *mode ); 27819 27820 Description 27821 27822 The gzopen() function shall open the compressed file named by 27823 path. The mode argument is based on that of fopen(), but the 27824 mode parameter may also contain the following characters: 27825 27826 digit 27827 27828 set the compression level to digit. A low value (e.g. 1) means 27829 high speed, while a high value (e.g. 9) means high compression. 27830 A compression level of 0 (zero) means no compression. See 27831 deflateInit2_() for further details. 27832 [fhR] 27833 27834 set the compression strategy to [fhR]. The letter f corresponds 27835 to filtered data, the letter h corresponds to Huffman only 27836 compression, and the letter R corresponds to Run Length 27837 Encoding. See deflateInit2_() for further details. 27838 27839 If path refers to an uncompressed file, and mode refers to a 27840 read mode, gzopen() shall attempt to open the file and return a 27841 gzFile object suitable for reading directly from the file 27842 without any decompression. 27843 27844 If path or mode is NULL, or if mode does not contain one of r, 27845 w, or a, gzopen() shall return Z_NULL, and need not set any 27846 other error condition. 27847 27848 The gzFile object is also referred to as a compressed file 27849 stream. 27850 27851 Example 27852 27853 gzopen("file.gz", "w6h"); 27854 27855 Attempt to create a new compressed file, file.gz, at 27856 compression level 6 using Huffman only compression. 27857 27858 Return Value 27859 27860 On success, gzopen() shall return a gzFile object (also known 27861 as a compressed file stream). On failure, gzopen() shall return 27862 Z_NULL and may set errno accordingly. 27863 27864 Note: At version 1.2.2, zlib does not set errno for several 27865 error conditions. Applications may not be able to determine 27866 the cause of an error. 27867 27868 Errors 27869 27870 On error, gzopen() may set the global variable errno to 27871 indicate the error. 27872 27873 gzprintf 27874 27875 Name 27876 27877 gzprintf -- format data and compress 27878 27879 Synopsis 27880 27881 #include 27882 27883 int gzprintf (gzFile file, const char * fmt, ...); 27884 27885 Description 27886 27887 The gzprintf() function shall format data as for fprintf(), and 27888 write the resulting string to the compressed file stream file. 27889 27890 Return Value 27891 27892 The gzprintf() function shall return the number of uncompressed 27893 bytes actually written, or a value less than or equal to 0 in 27894 the event of an error. 27895 27896 Errors 27897 27898 If file is NULL, or refers to a compressed file stream that has 27899 not been opened for writing, gzprintf() shall return 27900 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 27901 27902 gzputc 27903 27904 Name 27905 27906 gzputc -- write character to a compressed file 27907 27908 Synopsis 27909 27910 #include 27911 27912 int gzputc (gzFile file, int c); 27913 27914 Description 27915 27916 The gzputc() function shall write the single character c, 27917 converted from integer to unsigned character, to the compressed 27918 file referenced by file, which shall have been opened in a 27919 write mode (see gzopen() and gzdopen()). 27920 27921 Return Value 27922 27923 On success, gzputc() shall return the value written, otherwise 27924 gzputc() shall return -1. 27925 27926 Errors 27927 27928 On error, gzputc() shall return -1. 27929 27930 gzputs 27931 27932 Name 27933 27934 gzputs -- string write to a compressed file 27935 27936 Synopsis 27937 27938 #include 27939 27940 int gzputs (gzFile file, const char * s); 27941 27942 Description 27943 27944 The gzputs() function shall write the null terminated string s 27945 to the compressed file referenced by file, which shall have 27946 been opened in a write mode (see gzopen() and gzdopen()). The 27947 terminating null character shall not be written. The gzputs() 27948 function shall return the number of uncompressed bytes actually 27949 written. 27950 27951 Return Value 27952 27953 On success, gzputs() shall return the number of uncompressed 27954 bytes actually written to file. On error gzputs() shall return 27955 a value less than or equal to 0. Applications may examine the 27956 cause using gzerror(). 27957 27958 Errors 27959 27960 On error, gzputs() shall set the error number associated with 27961 the stream identified by file to indicate the error. 27962 Applications should use gzerror() to access this error value. 27963 If file is NULL, gzputs() shall return Z_STREAM_ERR. 27964 27965 Z_ERRNO 27966 27967 An underlying base library function has indicated an error. The 27968 global variable errno may be examined for further information. 27969 Z_STREAM_ERROR 27970 27971 The stream is invalid, is not open for writing, or is in an 27972 invalid state. 27973 Z_BUF_ERROR 27974 27975 no compression progress is possible (see deflate()). 27976 Z_MEM_ERROR 27977 27978 Insufficient memory available to compress. 27979 27980 gzread 27981 27982 Name 27983 27984 gzread -- read from a compressed file 27985 27986 Synopsis 27987 27988 #include 27989 27990 int gzread (gzFile file, voidp buf, unsigned int len); 27991 27992 Description 27993 27994 The gzread() function shall read data from the compressed file 27995 referenced by file, which shall have been opened in a read mode 27996 (see gzopen() and gzdopen()). The gzread() function shall read 27997 data from file, and uncompress it into buf. At most, len bytes 27998 of uncompressed data shall be copied to buf. If the file is not 27999 compressed, gzread() shall simply copy data from file to buf 28000 without alteration. 28001 28002 Return Value 28003 28004 On success, gzread() shall return the number of bytes 28005 decompressed into buf. If gzread() returns 0, either the 28006 end-of-file has been reached or an underlying read error has 28007 occurred. Applications should use gzerror() or gzeof() to 28008 determine which occurred. On other errors, gzread() shall 28009 return a value less than 0 and applications may examine the 28010 cause using gzerror(). 28011 28012 Errors 28013 28014 On error, gzread() shall set the error number associated with 28015 the stream identified by file to indicate the error. 28016 Applications should use gzerror() to access this error value. 28017 28018 Z_ERRNO 28019 28020 An underlying base library function has indicated an error. The 28021 global variable errno may be examined for further information. 28022 Z_STREAM_END 28023 28024 End of file has been reached on input. 28025 Z_DATA_ERROR 28026 28027 A CRC error occurred when reading data; the file is corrupt. 28028 Z_STREAM_ERROR 28029 28030 The stream is invalid, or is in an invalid state. 28031 Z_NEED_DICT 28032 28033 A dictionary is needed (see inflateSetDictionary()). 28034 Z_MEM_ERROR 28035 28036 Insufficient memory available to decompress. 28037 28038 gzrewind 28039 28040 Name 28041 28042 gzrewind -- reset the file-position indicator on a compressed 28043 file stream 28044 28045 Synopsis 28046 28047 #include 28048 28049 int gzrewind(gzFile file); 28050 28051 Description 28052 28053 The gzrewind() function shall set the starting position for the 28054 next read on compressed file stream file to the beginning of 28055 file. file must be open for reading. 28056 28057 gzrewind() is equivalent to 28058 (int)gzseek(file, 0L, SEEK_SET) 28059 28060 . 28061 28062 Return Value 28063 28064 On success, gzrewind() shall return 0. On error, gzrewind() 28065 shall return -1, and may set the error value for file 28066 accordingly. 28067 28068 Errors 28069 28070 On error, gzrewind() shall return -1, indicating that file is 28071 NULL, or does not represent an open compressed file stream, or 28072 represents a compressed file stream that is open for writing 28073 and is not currently at the beginning of file. 28074 28075 gzseek 28076 28077 Name 28078 28079 gzseek -- reposition a file-position indicator in a compressed 28080 file stream 28081 28082 Synopsis 28083 28084 #include 28085 28086 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 28087 28088 Description 28089 28090 The gzseek() function shall set the file-position indicator for 28091 the compressed file stream file. The file-position indicator 28092 controls where the next read or write operation on the 28093 compressed file stream shall take place. The offset indicates a 28094 byte offset in the uncompressed data. The whence parameter may 28095 be one of: 28096 28097 SEEK_SET 28098 28099 the offset is relative to the start of the uncompressed data. 28100 SEEK_CUR 28101 28102 the offset is relative to the current positition in the 28103 uncompressed data. 28104 28105 Note: The value SEEK_END need not be supported. 28106 28107 If the file is open for writing, the new offset must be greater 28108 than or equal to the current offset. In this case, gzseek() 28109 shall compress a sequence of null bytes to fill the gap from 28110 the previous offset to the new offset. 28111 28112 Return Value 28113 28114 On success, gzseek() shall return the resulting offset in the 28115 file expressed as a byte position in the uncompressed data 28116 stream. On error, gzseek() shall return -1, and may set the 28117 error value for file accordingly. 28118 28119 Errors 28120 28121 On error, gzseek() shall return -1. The following conditions 28122 shall always result in an error: 28123 28124 * file is NULL 28125 * file does not represent an open compressed file stream. 28126 * file refers to a compressed file stream that is open for 28127 writing, and the newly computed offset is less than the 28128 current offset. 28129 * The newly computed offset is less than zero. 28130 * whence is not one of the supported values. 28131 28132 Application Usage (informative) 28133 28134 If file is open for reading, the implementation may still need 28135 to uncompress all of the data up to the new offset. As a 28136 result, gzseek() may be extremely slow in some circumstances. 28137 28138 gzsetparams 28139 28140 Name 28141 28142 gzsetparams -- dynamically set compression parameters 28143 28144 Synopsis 28145 28146 #include 28147 28148 int gzsetparams (gzFile file, int level, int strategy); 28149 28150 Description 28151 28152 The gzsetparams() function shall set the compression level and 28153 compression strategy on the compressed file stream referenced 28154 by file. The compressed file stream shall have been opened in a 28155 write mode. The level and strategy are as defined in 28156 deflateInit2.. If there is any data pending writing, it shall 28157 be flushed before the parameters are updated. 28158 28159 Return Value 28160 28161 On success, the gzsetparams() function shall return Z_OK. 28162 28163 Errors 28164 28165 On error, gzsetparams() shall return one of the following error 28166 indications: 28167 28168 Z_STREAM_ERROR 28169 28170 Invalid parameter, or file not open for writing. 28171 Z_BUF_ERROR 28172 28173 An internal inconsistency was detected while flushing the 28174 previous buffer. 28175 28176 gztell 28177 28178 Name 28179 28180 gztell -- find position on a compressed file stream 28181 28182 Synopsis 28183 28184 #include 28185 28186 z_off_t gztell (gzFile file ); 28187 28188 Description 28189 28190 The gztell() function shall return the starting position for 28191 the next read or write operation on compressed file stream 28192 file. This position represents the number of bytes from the 28193 beginning of file in the uncompressed data. 28194 28195 gztell() is equivalent to 28196 gzseek(file, 0L, SEEK_CUR) 28197 28198 . 28199 28200 Return Value 28201 28202 gztell() shall return the current offset in the file expressed 28203 as a byte position in the uncompressed data stream. On error, 28204 gztell() shall return -1, and may set the error value for file 28205 accordingly. 28206 28207 Errors 28208 28209 On error, gztell() shall return -1, indicating that file is 28210 NULL, or does not represent an open compressed file stream. 28211 28212 gzwrite 28213 28214 Name 28215 28216 gzwrite -- write to a compressed file 28217 28218 Synopsis 28219 28220 #include 28221 28222 int gzwrite (gzFile file, voidpc buf, unsigned int len); 28223 28224 Description 28225 28226 The gzwrite() function shall write data to the compressed file 28227 referenced by file, which shall have been opened in a write 28228 mode (see gzopen() and gzdopen()). On entry, buf shall point to 28229 a buffer containing len bytes of uncompressed data. The 28230 gzwrite() function shall compress this data and write it to 28231 file. The gzwrite() function shall return the number of 28232 uncompressed bytes actually written. 28233 28234 Return Value 28235 28236 On success, gzwrite() shall return the number of uncompressed 28237 bytes actually written to file. On error gzwrite() shall return 28238 a value less than or equal to 0. Applications may examine the 28239 cause using gzerror(). 28240 28241 Errors 28242 28243 On error, gzwrite() shall set the error number associated with 28244 the stream identified by file to indicate the error. 28245 Applications should use gzerror() to access this error value. 28246 28247 Z_ERRNO 28248 28249 An underlying base library function has indicated an error. The 28250 global variable errno may be examined for further information. 28251 Z_STREAM_ERROR 28252 28253 The stream is invalid, is not open for writing, or is in an 28254 invalid state. 28255 Z_BUF_ERROR 28256 28257 no compression progress is possible (see deflate()). 28258 Z_MEM_ERROR 28259 28260 Insufficient memory available to compress. 28261 28262 inflate 28263 28264 Name 28265 28266 inflate -- decompress data 28267 28268 Synopsis 28269 28270 #include 28271 28272 int inflate(z_streamp stream, int flush); 28273 28274 Description 28275 28276 The inflate() function shall attempt to decompress data until 28277 either the input buffer is empty or the output buffer is full. 28278 The stream references a z_stream structure. Before the first 28279 call to inflate(), this structure should have been initialized 28280 by a call to inflateInit2_(). 28281 28282 Note: inflateInit2_() is only in the binary standard; source 28283 level applications should initialize stream via a call to 28284 inflateInit() or inflateInit2(). 28285 28286 In addition, the stream input and output buffers should have 28287 been initialized as follows: 28288 28289 next_in 28290 28291 should point to the data to be decompressed. 28292 avail_in 28293 28294 should contain the number of bytes of data in the buffer 28295 referenced by next_in. 28296 next_out 28297 28298 should point to a buffer where decompressed data may be placed. 28299 avail_out 28300 28301 should contain the size in bytes of the buffer referenced by 28302 next_out 28303 28304 The inflate() function shall perform one or both of the 28305 following actions: 28306 28307 1. Decompress input data from next_in and update next_in, 28308 avail_in and total_in to reflect the data that has been 28309 decompressed. 28310 2. Fill the output buffer referenced by next_out, and update 28311 next_out, avail_out, and total_out to reflect the 28312 decompressed data that has been placed there. If flush is 28313 not Z_NO_FLUSH, and avail_out indicates that there is still 28314 space in output buffer, this action shall always occur (see 28315 below for further details). 28316 28317 The inflate() function shall return when either avail_in 28318 reaches zero (indicating that all the input data has been 28319 compressed), or avail_out reaches zero (indicating that the 28320 output buffer is full). 28321 28322 Flush Operation 28323 28324 The parameter flush determines when uncompressed bytes are 28325 added to the output buffer in next_out. If flush is Z_NO_FLUSH, 28326 inflate() may return with some data pending output, and not yet 28327 added to the output buffer. 28328 28329 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 28330 output to next_out, and update next_out and avail_out 28331 accordingly. 28332 28333 If flush is set to Z_BLOCK, inflate() shall stop adding data to 28334 the output buffer if and when the next compressed block 28335 boundary is reached (see RFC 1951: DEFLATE Compressed Data 28336 Format Specification). 28337 28338 If flush is set to Z_FINISH, all of the compressed input shall 28339 be decompressed and added to the output. If there is 28340 insufficient output space (i.e. the compressed input data 28341 uncompresses to more than avail_out bytes), then inflate() 28342 shall fail and return Z_BUF_ERROR. 28343 28344 Return Value 28345 28346 On success, inflate() shall return Z_OK if decompression 28347 progress has been made, or Z_STREAM_END if all of the input 28348 data has been decompressed and there was sufficient space in 28349 the output buffer to store the uncompressed result. On error, 28350 inflate() shall return a value to indicate the error. 28351 28352 Note: If inflate() returns Z_OK and has set avail_out to 28353 zero, the function should be called again with the same 28354 value for flush, and with updated next_out and avail_out 28355 until inflate() returns with either Z_OK or Z_STREAM_END and 28356 a non-zero avail_out. 28357 28358 On success, inflate() shall set the adler to the Adler-32 28359 checksum of the output produced so far (i.e. total_out bytes). 28360 28361 Errors 28362 28363 On error, inflate() shall return a value as described below, 28364 and may set the msg field of stream to point to a string 28365 describing the error: 28366 28367 Z_BUF_ERROR 28368 28369 No progress is possible; either avail_in or avail_out was zero. 28370 Z_MEM_ERROR 28371 28372 Insufficient memory. 28373 Z_STREAM_ERROR 28374 28375 The state (as represented in stream) is inconsistent, or stream 28376 was NULL. 28377 Z_NEED_DICT 28378 28379 A preset dictionary is required. The adler field shall be set 28380 to the Adler-32 checksum of the dictionary chosen by the 28381 compressor. 28382 28383 inflateEnd 28384 28385 Name 28386 28387 inflateEnd -- free decompression stream state 28388 28389 Synopsis 28390 28391 #include 28392 28393 int inflateEnd(z_streamp stream); 28394 28395 Description 28396 28397 The inflateEnd() function shall free all allocated state 28398 information referenced by stream. All pending output is 28399 discarded, and unprocessed input is ignored. 28400 28401 Return Value 28402 28403 On success, inflateEnd() shall return Z_OK. Otherwise it shall 28404 return Z_STREAM_ERROR to indicate the error. 28405 28406 Errors 28407 28408 On error, inflateEnd() shall return Z_STREAM_ERROR. The 28409 following conditions shall be treated as an error: 28410 28411 * The state in stream is inconsistent. 28412 * stream is NULL. 28413 * The zfree function pointer is NULL. 28414 28415 inflateInit2_ 28416 28417 Name 28418 28419 inflateInit2_ -- initialize decompression system 28420 28421 Synopsis 28422 28423 #include 28424 28425 int inflateInit2_ (z_streamp strm, int windowBits, char * 28426 version, int stream_size); 28427 28428 Description 28429 28430 The inflateInit2_() function shall initialize the decompression 28431 system. On entry, strm shall refer to a user supplied z_stream 28432 object (a z_stream_s structure). The following fields shall be 28433 set on entry: 28434 28435 zalloc 28436 28437 a pointer to an alloc_func function, used to allocate state 28438 information. If this is NULL, a default allocation function 28439 will be used. 28440 zfree 28441 28442 a pointer to a free_func function, used to free memory 28443 allocated by the zalloc function. If this is NULL a default 28444 free function will be used. 28445 opaque 28446 28447 If alloc_func is not NULL, opaque is a user supplied pointer to 28448 data that will be passed to the alloc_func and free_func 28449 functions. 28450 28451 If the version requested is not compatible with the version 28452 implemented, or if the size of the z_stream_s structure 28453 provided in stream_size does not match the size in the library 28454 implementation, inflateInit2_() shall fail, and return 28455 Z_VERSION_ERROR. 28456 28457 The windowBits parameter shall be a base 2 logarithm of the 28458 maximum window size to use, and shall be a value between 8 and 28459 15. If the input data was compressed with a larger window size, 28460 subsequent attempts to decompress this data will fail with 28461 Z_DATA_ERROR, rather than try to allocate a larger window. 28462 28463 The inflateInit2_() function is not in the source standard; it 28464 is only in the binary standard. Source applications should use 28465 the inflateInit2() macro. 28466 28467 Return Value 28468 28469 On success, the inflateInit2_() function shall return Z_OK. 28470 Otherwise, inflateInit2_() shall return a value as described 28471 below to indicate the error. 28472 28473 Errors 28474 28475 On error, inflateInit2_() shall return one of the following 28476 error indicators: 28477 28478 Z_STREAM_ERROR 28479 28480 Invalid parameter. 28481 Z_MEM_ERROR 28482 28483 Insufficient memory available. 28484 Z_VERSION_ERROR 28485 28486 The version requested is not compatible with the library 28487 version, or the z_stream size differs from that used by the 28488 library. 28489 28490 In addition, the msg field of the strm may be set to an error 28491 message. 28492 28493 inflateInit_ 28494 28495 Name 28496 28497 inflateInit_ -- initialize decompression system 28498 28499 Synopsis 28500 28501 #include 28502 28503 int inflateInit_(z_streamp stream, const char * version, int 28504 stream_size); 28505 28506 Description 28507 28508 The inflateInit_() function shall initialize the decompression 28509 system. On entry, stream shall refer to a user supplied 28510 z_stream object (a z_stream_s structure). The following fields 28511 shall be set on entry: 28512 28513 zalloc 28514 28515 a pointer to an alloc_func function, used to allocate state 28516 information. If this is NULL, a default allocation function 28517 will be used. 28518 zfree 28519 28520 a pointer to a free_func function, used to free memory 28521 allocated by the zalloc function. If this is NULL a default 28522 free function will be used. 28523 opaque 28524 28525 If alloc_func is not NULL, opaque is a user supplied pointer to 28526 data that will be passed to the alloc_func and free_func 28527 functions. 28528 28529 If the version requested is not compatible with the version 28530 implemented, or if the size of the z_stream_s structure 28531 provided in stream_size does not match the size in the library 28532 implementation, inflateInit_() shall fail, and return 28533 Z_VERSION_ERROR. 28534 28535 The inflateInit_() function is not in the source standard; it 28536 is only in the binary standard. Source applications should use 28537 the inflateInit() macro. 28538 28539 The inflateInit_() shall be equivalent to 28540 inflateInit2_(strm, MAX_WBITS, version, stream_size); 28541 28542 Return Value 28543 28544 On success, the inflateInit_() function shall return Z_OK. 28545 Otherwise, inflateInit_() shall return a value as described 28546 below to indicate the error. 28547 28548 Errors 28549 28550 On error, inflateInit_() shall return one of the following 28551 error indicators: 28552 28553 Z_STREAM_ERROR 28554 28555 Invalid parameter. 28556 Z_MEM_ERROR 28557 28558 Insufficient memory available. 28559 Z_VERSION_ERROR 28560 28561 The version requested is not compatible with the library 28562 version, or the z_stream size differs from that used by the 28563 library. 28564 28565 In addition, the msg field of the strm may be set to an error 28566 message. 28567 28568 inflateReset 28569 28570 Name 28571 28572 inflateReset -- reset decompression stream state 28573 28574 Synopsis 28575 28576 #include 28577 28578 int inflateReset(z_streamp stream); 28579 28580 Description 28581 28582 The inflateReset() function shall reset all state associated 28583 with stream. All pending output shall be discarded, and the 28584 counts of processed bytes (total_in and total_out) shall be 28585 reset to zero. 28586 28587 Return Value 28588 28589 On success, inflateReset() shall return Z_OK. Otherwise it 28590 shall return Z_STREAM_ERROR to indicate the error. 28591 28592 Errors 28593 28594 On error, inflateReset() shall return Z_STREAM_ERROR. The 28595 following conditions shall be treated as an error: 28596 28597 * The state in stream is inconsistent or inappropriate. 28598 * stream is NULL. 28599 28600 inflateSetDictionary 28601 28602 Name 28603 28604 inflateSetDictionary -- initialize decompression dictionary 28605 28606 Synopsis 28607 28608 #include 28609 28610 int inflateSetDictionary(z_streamp stream, const Bytef * 28611 dictionary, uInt dictlen); 28612 28613 Description 28614 28615 The inflateSetDictionary() function shall initialize the 28616 decompression dictionary associated with stream using the 28617 dictlen bytes referenced by dictionary. 28618 28619 The inflateSetDictionary() function should be called 28620 immediately after a call to inflate() has failed with return 28621 value Z_NEED_DICT. The dictionary must have the same Adler-32 28622 checksum as the dictionary used for the compression (see 28623 deflateSetDictionary()). 28624 28625 stream shall reference an initialized decompression stream, 28626 with total_in zero (i.e. no data has been decompressed since 28627 the stream was initialized). 28628 28629 Return Value 28630 28631 On success, inflateSetDictionary() shall return Z_OK. Otherwise 28632 it shall return a value as indicated below. 28633 28634 Errors 28635 28636 On error, inflateSetDictionary() shall return a value as 28637 described below: 28638 28639 Z_STREAM_ERROR 28640 28641 The state in stream is inconsistent, or stream was NULL. 28642 Z_DATA_ERROR 28643 28644 The Adler-32 checksum of the supplied dictionary does not match 28645 that used for the compression. 28646 28647 Application Usage (informative) 28648 28649 The application should provide a dictionary consisting of 28650 strings {{{ed note: do we really mean "strings"? Null 28651 terminated?}}} that are likely to be encountered in the data to 28652 be compressed. The application should ensure that the 28653 dictionary is sorted such that the most commonly used strings 28654 occur at the end of the dictionary. 28655 28656 The use of a dictionary is optional; however if the data to be 28657 compressed is relatively short and has a predictable structure, 28658 the use of a dictionary can substantially improve the 28659 compression ratio. 28660 28661 inflateSync 28662 28663 Name 28664 28665 inflateSync -- advance compression stream to next sync point 28666 28667 Synopsis 28668 28669 #include 28670 28671 int inflateSync(z_streamp stream); 28672 28673 Description 28674 28675 The inflateSync() function shall advance through the compressed 28676 data in stream, skipping any invalid compressed data, until the 28677 next full flush point is reached, or all input is exhausted. 28678 See the description for deflate() with flush level 28679 Z_FULL_FLUSH. No output is placed in next_out. 28680 28681 Return Value 28682 28683 On success, inflateSync() shall return Z_OK, and update the 28684 next_in, avail_in, and total_in fields of stream to reflect the 28685 number of bytes of compressed data that have been skipped. 28686 Otherwise, inflateSync() shall return a value as described 28687 below to indicate the error. 28688 28689 Errors 28690 28691 On error, inflateSync() shall return a value as described 28692 below: 28693 28694 Z_STREAM_ERROR 28695 28696 The state (as represented in stream) is inconsistent, or stream 28697 was NULL. 28698 Z_BUF_ERROR 28699 28700 There is no data available to skip over. 28701 Z_DATA_ERROR 28702 28703 No sync point was found. 28704 28705 inflateSyncPoint 28706 28707 Name 28708 28709 inflateSyncPoint -- test for synchronization point 28710 28711 Synopsis 28712 28713 #include 28714 28715 int inflateSyncPoint(z_streamp stream); 28716 28717 Description 28718 28719 The inflateSyncPoint() function shall return a non-zero value 28720 if the compressed data stream referenced by stream is at a 28721 synchronization point. 28722 28723 Return Value 28724 28725 If the compressed data in stream is at a synchronization point 28726 (see deflate() with a flush level of Z_SYNC_FLUSH or 28727 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 28728 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 28729 valid, inflateSyncPoint() shall return 0. If stream is invalid, 28730 or in an invalid state, inflateSyncPoint() shall return 28731 Z_STREAM_ERROR to indicate the error. 28732 28733 Errors 28734 28735 On error, inflateSyncPoint() shall return a value as described 28736 below: 28737 28738 Z_STREAM_ERROR 28739 28740 The state (as represented in stream) is inconsistent, or stream 28741 was NULL. 28742 28743 uncompress 28744 28745 Name 28746 28747 uncompress -- uncompress data 28748 28749 Synopsis 28750 28751 #include 28752 28753 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 28754 source, uLong sourceLen); 28755 28756 Description 28757 28758 The uncompress() function shall attempt to uncompress sourceLen 28759 bytes of data in the buffer source, placing the result in the 28760 buffer dest. 28761 28762 On entry, destLen should point to a value describing the size 28763 of the dest buffer. The application should ensure that this 28764 value is large enough to hold the entire uncompressed data. 28765 28766 Note: The LSB does not describe any mechanism by which a 28767 compressor can communicate the size required to the 28768 uncompressor. 28769 28770 On successful exit, the variable referenced by destLen shall be 28771 updated to hold the length of uncompressed data in dest. 28772 28773 Return Value 28774 28775 On success, uncompress() shall return Z_OK. Otherwise, 28776 uncompress() shall return a value to indicate the error. 28777 28778 Errors 28779 28780 On error, uncompress() shall return a value as described below: 28781 28782 Z_BUF_ERROR 28783 28784 The buffer dest was not large enough to hold the uncompressed 28785 data. 28786 Z_MEM_ERROR 28787 28788 Insufficient memory. 28789 Z_DATA_ERROR 28790 28791 The compressed data (referenced by source) was corrupted. 28792 28793 zError 28794 28795 Name 28796 28797 zError -- translate error number to string 28798 28799 Synopsis 28800 28801 #include 28802 28803 const char * zError(int err); 28804 28805 Description 28806 28807 The zError() function shall return the string identifying the 28808 error associated with err. This allows for conversion from 28809 error code to string for functions such as compress() and 28810 uncompress(), that do not always set the string version of an 28811 error. 28812 28813 Return Value 28814 28815 The zError() function shall return a the string identifying the 28816 error associated with err, or NULL if err is not a valid error 28817 code. 28818 28819 It is unspecified if the string returned is determined by the 28820 setting of the LC_MESSAGES category in the current locale. 28821 28822 Errors 28823 28824 None defined. 28825 28826 zlibVersion 28827 28828 Name 28829 28830 zlibVersion -- discover library version at run time 28831 28832 Synopsis 28833 28834 #include 28835 28836 const char * zlibVersion (void); 28837 28838 Description 28839 28840 The zlibVersion() function shall return the string identifying 28841 the interface version at the time the library was built. 28842 28843 Applications should compare the value returned from 28844 zlibVersion() with the macro constant ZLIB_VERSION for 28845 compatibility. 28846 28847 Return Value 28848 28849 The zlibVersion() function shall return a the string 28850 identifying the version of the library currently implemented. 28851 28852 Errors 28853 28854 None defined. 28855 __________________________________________________________ 28856 28857 13.5. Interfaces for libncurses 28858 28859 Table 13-3 defines the library name and shared object name for 28860 the libncurses library 28861 28862 Table 13-3. libncurses Definition 28863 Library: libncurses 28864 SONAME: libncurses.so.5 28865 28866 The parameters or return types of the following interfaces have 28867 had the const qualifier added as shown here, as compared to the 28868 specification in X/Open Curses. 28869 extern const char *keyname (int); 28870 extern SCREEN *newterm (const char *, FILE *, FILE *); 28871 extern const char *unctrl (chtype); 28872 28873 extern int mvprintw (int, int, const char *, ...); 28874 extern int mvwprintw (WINDOW *, int, int, const char *, ...); 28875 extern int printw (const char *, ...); 28876 extern int vwprintw (WINDOW *, const char *, va_list); 28877 extern int vw_printw (WINDOW *, const char *, va_list); 28878 extern int wprintw (WINDOW *, const char *, ...); 28879 28880 extern int mvscanw (int, int, const char *, ...); 28881 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 28882 extern int scanw (const char *, ...); 28883 extern int vwscanw (WINDOW *, const char *, va_list); 28884 extern int vw_scanw (WINDOW *, const char *, va_list); 28885 extern int wscanw (WINDOW *, const char *, ...); 28886 28887 The behavior of the interfaces in this library is specified by 28888 the following specifications: 28889 28890 [LSB] This Specification 28891 [SUS-CURSES] X/Open Curses 28892 __________________________________________________________ 28893 28894 13.5.1. Curses 28895 __________________________________________________________ 28896 28897 13.5.1.1. Interfaces for Curses 28898 28899 An LSB conforming implementation shall provide the generic 28900 functions for Curses specified in Table 13-4, with the full 28901 mandatory functionality as described in the referenced 28902 underlying specification. 28903 28904 Table 13-4. libncurses - Curses Function Interfaces 28905 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr [SUS-CURSES] 28906 addnstr [SUS-CURSES] 28907 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off [SUS-CURSES] 28908 attr_on [SUS-CURSES] 28909 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 28910 attrset [SUS-CURSES] 28911 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 28912 bkgdset [SUS-CURSES] 28913 border [SUS-CURSES] box [SUS-CURSES] can_change_color 28914 [SUS-CURSES] cbreak [SUS-CURSES] 28915 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 28916 clrtobot [SUS-CURSES] 28917 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 28918 [SUS-CURSES] copywin [SUS-CURSES] 28919 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] def_shell_mode 28920 [SUS-CURSES] del_curterm [SUS-CURSES] 28921 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 28922 [SUS-CURSES] delscreen [SUS-CURSES] 28923 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 28924 dupwin [SUS-CURSES] 28925 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 28926 erase [SUS-CURSES] 28927 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 28928 flushinp [SUS-CURSES] 28929 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 28930 getstr [SUS-CURSES] 28931 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 28932 [SUS-CURSES] has_ic [SUS-CURSES] 28933 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] idlok 28934 [SUS-CURSES] 28935 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [LSB] inchstr 28936 [LSB] 28937 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 28938 [SUS-CURSES] innstr [SUS-CURSES] 28939 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 28940 insnstr [SUS-CURSES] 28941 insstr [SUS-CURSES] instr [LSB] intrflush [SUS-CURSES] 28942 is_linetouched [SUS-CURSES] 28943 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 28944 [SUS-CURSES] keypad [SUS-CURSES] 28945 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 28946 [SUS-CURSES] meta [SUS-CURSES] 28947 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr [SUS-CURSES] 28948 mvaddchstr [SUS-CURSES] 28949 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 28950 [SUS-CURSES] mvcur [LSB] 28951 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch [SUS-CURSES] 28952 mvgetnstr [SUS-CURSES] 28953 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 28954 mvinchnstr [LSB] 28955 mvinchstr [LSB] mvinnstr [SUS-CURSES] mvinsch [SUS-CURSES] 28956 mvinsnstr [SUS-CURSES] 28957 mvinsstr [SUS-CURSES] mvinstr [LSB] mvprintw [SUS-CURSES] 28958 mvscanw [LSB] 28959 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 28960 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 28961 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 28962 [SUS-CURSES] mvwdelch [SUS-CURSES] 28963 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 28964 [SUS-CURSES] mvwhline [SUS-CURSES] 28965 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr [LSB] 28966 mvwinchstr [LSB] 28967 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 28968 [SUS-CURSES] mvwinsstr [SUS-CURSES] 28969 mvwinstr [LSB] mvwprintw [SUS-CURSES] mvwscanw [LSB] mvwvline 28970 [SUS-CURSES] 28971 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 28972 newwin [SUS-CURSES] 28973 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 28974 noecho [SUS-CURSES] 28975 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 28976 notimeout [SUS-CURSES] 28977 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 28978 [SUS-CURSES] pechochar [SUS-CURSES] 28979 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 28980 [SUS-CURSES] putp [SUS-CURSES] 28981 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 28982 redrawwin [SUS-CURSES] 28983 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 28984 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 28985 restartterm [SUS-CURSES] ripoffline [LSB] savetty [SUS-CURSES] 28986 scanw [LSB] 28987 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 28988 [SUS-CURSES] scr_set [SUS-CURSES] 28989 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 28990 set_curterm [SUS-CURSES] 28991 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 28992 [SUS-CURSES] slk_attr_set [SUS-CURSES] 28993 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 28994 [SUS-CURSES] slk_clear [SUS-CURSES] 28995 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 28996 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 28997 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 28998 [SUS-CURSES] slk_touch [SUS-CURSES] 28999 standend [SUS-CURSES] standout [SUS-CURSES] start_color 29000 [SUS-CURSES] subpad [SUS-CURSES] 29001 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 29002 termname [SUS-CURSES] 29003 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum [SUS-CURSES] 29004 tgetstr [SUS-CURSES] 29005 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum [SUS-CURSES] 29006 tigetstr [SUS-CURSES] 29007 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 29008 [SUS-CURSES] tparm [SUS-CURSES] 29009 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 29010 ungetch [SUS-CURSES] 29011 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 29012 [SUS-CURSES] vidputs [SUS-CURSES] 29013 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw [LSB] 29014 vwprintw [SUS-CURSES] 29015 vwscanw [LSB] waddch [SUS-CURSES] waddchnstr [SUS-CURSES] 29016 waddchstr [SUS-CURSES] 29017 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 29018 [SUS-CURSES] wattr_off [SUS-CURSES] 29019 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 29020 [SUS-CURSES] wattron [SUS-CURSES] 29021 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 29022 wborder [SUS-CURSES] 29023 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 29024 wclrtoeol [SUS-CURSES] 29025 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 29026 [SUS-CURSES] wdeleteln [SUS-CURSES] 29027 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 29028 wgetnstr [SUS-CURSES] 29029 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 29030 winchnstr [LSB] 29031 winchstr [LSB] winnstr [SUS-CURSES] winsch [SUS-CURSES] 29032 winsdelln [SUS-CURSES] 29033 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 29034 [SUS-CURSES] winstr [LSB] 29035 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 29036 [SUS-CURSES] wredrawln [SUS-CURSES] 29037 wrefresh [SUS-CURSES] wscanw [LSB] wscrl [SUS-CURSES] 29038 wsetscrreg [SUS-CURSES] 29039 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 29040 [SUS-CURSES] wsyncup [SUS-CURSES] 29041 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline [SUS-CURSES] 29042 29043 An LSB conforming implementation shall provide the generic 29044 deprecated functions for Curses specified in Table 13-5, with 29045 the full mandatory functionality as described in the referenced 29046 underlying specification. 29047 29048 Note: These interfaces are deprecated, and applications 29049 should avoid using them. These interfaces may be withdrawn 29050 in future releases of this specification. 29051 29052 Table 13-5. libncurses - Curses Deprecated Function Interfaces 29053 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum [SUS-CURSES] 29054 tgetstr [SUS-CURSES] 29055 tgoto [SUS-CURSES] 29056 29057 An LSB conforming implementation shall provide the generic data 29058 interfaces for Curses specified in Table 13-6, with the full 29059 mandatory functionality as described in the referenced 29060 underlying specification. 29061 29062 Table 13-6. libncurses - Curses Data Interfaces 29063 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 29064 LINES [SUS-CURSES] 29065 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 29066 stdscr [SUS-CURSES] 29067 __________________________________________________________ 29068 29069 13.6. Data Definitions for libncurses 29070 29071 This section defines global identifiers and their values that 29072 are associated with interfaces contained in libncurses. These 29073 definitions are organized into groups that correspond to system 29074 headers. This convention is used as a convenience for the 29075 reader, and does not imply the existence of these headers, or 29076 their content. Where an interface is defined as requiring a 29077 particular system header file all of the data definitions for 29078 that system header file presented here shall be in effect. 29079 29080 This section gives data definitions to promote binary 29081 application portability, not to repeat source interface 29082 definitions available elsewhere. System providers and 29083 application developers should use this ABI to supplement - not 29084 to replace - source interface definition specifications. 29085 29086 This specification uses the ISO C (1999) C Language as the 29087 reference programming language, and data definitions are 29088 specified in ISO C format. The C language is used here as a 29089 convenient notation. Using a C language description of these 29090 data objects does not preclude their use by other programming 29091 languages. 29092 __________________________________________________________ 29093 29094 13.6.1. curses.h 29095 29096 #define ERR (-1) 29097 #define OK (0) 29098 #define ACS_RARROW (acs_map['+']) 29099 #define ACS_LARROW (acs_map[',']) 29100 #define ACS_UARROW (acs_map['-']) 29101 #define ACS_DARROW (acs_map['.']) 29102 #define ACS_BLOCK (acs_map['0']) 29103 #define ACS_CKBOARD (acs_map['a']) 29104 #define ACS_DEGREE (acs_map['f']) 29105 #define ACS_PLMINUS (acs_map['g']) 29106 #define ACS_BOARD (acs_map['h']) 29107 #define ACS_LANTERN (acs_map['i']) 29108 #define ACS_LRCORNER (acs_map['j']) 29109 #define ACS_URCORNER (acs_map['k']) 29110 #define ACS_ULCORNER (acs_map['l']) 29111 #define ACS_LLCORNER (acs_map['m']) 29112 #define ACS_PLUS (acs_map['n']) 29113 #define ACS_S1 (acs_map['o']) 29114 #define ACS_HLINE (acs_map['q']) 29115 #define ACS_S9 (acs_map['s']) 29116 #define ACS_LTEE (acs_map['t']) 29117 #define ACS_RTEE (acs_map['u']) 29118 #define ACS_BTEE (acs_map['v']) 29119 #define ACS_TTEE (acs_map['w']) 29120 #define ACS_VLINE (acs_map['x']) 29121 #define ACS_DIAMOND (acs_map['`']) 29122 #define ACS_BULLET (acs_map['~']) 29123 #define getmaxyx(win,y,x) \ 29124 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 29125 #define getbegyx(win,y,x) \ 29126 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 29127 #define getyx(win,y,x) \ 29128 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 29129 #define getparyx(win,y,x) \ 29130 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 29131 29132 #define __NCURSES_H 1 29133 #define NCURSES_EXPORT(type) type 29134 #define NCURSES_EXPORT_VAR(type) type 29135 29136 #define WA_ALTCHARSET A_ALTCHARSET 29137 #define WA_ATTRIBUTES A_ATTRIBUTES 29138 #define WA_BLINK A_BLINK 29139 #define WA_BOLD A_BOLD 29140 #define WA_DIM A_DIM 29141 #define WA_HORIZONTAL A_HORIZONTAL 29142 #define WA_INVIS A_INVIS 29143 #define WA_LEFT A_LEFT 29144 #define WA_LOW A_LOW 29145 #define WA_NORMAL A_NORMAL 29146 #define WA_PROTECT A_PROTECT 29147 #define WA_REVERSE A_REVERSE 29148 #define WA_RIGHT A_RIGHT 29149 #define WA_STANDOUT A_STANDOUT 29150 #define WA_TOP A_TOP 29151 #define WA_UNDERLINE A_UNDERLINE 29152 #define WA_VERTICAL A_VERTICAL 29153 #define A_REVERSE NCURSES_BITS(1UL,10) 29154 29155 #define COLOR_BLACK 0 29156 #define COLOR_RED 1 29157 #define COLOR_GREEN 2 29158 #define COLOR_YELLOW 3 29159 #define COLOR_BLUE 4 29160 #define COLOR_MAGENTA 5 29161 #define COLOR_CYAN 6 29162 #define COLOR_WHITE 7 29163 29164 #define _SUBWIN 0x01 29165 #define _ENDLINE 0x02 29166 #define _FULLWIN 0x04 29167 #define _SCROLLWIN 0x08 29168 #define _ISPAD 0x10 29169 #define _HASMOVED 0x20 29170 29171 typedef unsigned char bool; 29172 29173 typedef unsigned long int chtype; 29174 typedef struct screen SCREEN; 29175 typedef struct _win_st WINDOW; 29176 typedef chtype attr_t; 29177 typedef struct { 29178 attr_t attr; 29179 wchar_t chars[5]; 29180 } cchar_t; 29181 struct pdat { 29182 short _pad_y; 29183 short _pad_x; 29184 short _pad_top; 29185 short _pad_left; 29186 short _pad_bottom; 29187 short _pad_right; 29188 }; 29189 29190 struct _win_st { 29191 short _cury; /* current cursor position */ 29192 short _curx; 29193 short _maxy; /* maximums of x and y, NOT window size*/ 29194 short _maxx; 29195 short _begy; /* screen coords of upper-left-hand corner */ 29196 short _begx; 29197 short _flags; /* window state flags */ 29198 attr_t _attrs; /* current attribute for non-space character */ 29199 chtype _bkgd; /* current background char/attribute pair */ 29200 bool _notimeout; /* no time out on function-key entry? */ 29201 bool _clear; /* consider all data in the window invalid? */ 29202 bool _leaveok; /* OK to not reset cursor on exit? */ 29203 bool _scroll; /* OK to scroll this window? */ 29204 bool _idlok; /* OK to use insert/delete line? */ 29205 bool _idcok; /* OK to use insert/delete char? */ 29206 bool _immed; /* window in immed mode? (not yet used)*/ 29207 bool _sync; /* window in sync mode? */ 29208 bool _use_keypad; /* process function keys into KEY_ symbols? */ 29209 int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ 29210 struct ldat *_line; /* the actual line data */ 29211 short _regtop; /* top line of scrolling region */ 29212 short _regbottom; /* bottom line of scrolling region */ 29213 int _parx; /* x coordinate of this window in parent */ 29214 int _pary; /* y coordinate of this window in parent */ 29215 WINDOW *_parent; /* pointer to parent if a sub-window */ 29216 struct pdat _pad; 29217 short _yoffset; /* real begy is _begy + _yoffset */ 29218 cchar_t _bkgrnd; /* current background char/attribute pair */ 29219 }; 29220 29221 #define KEY_F(n) (KEY_F0+(n)) 29222 #define KEY_CODE_YES 0400 29223 #define KEY_BREAK 0401 29224 #define KEY_MIN 0401 29225 #define KEY_DOWN 0402 29226 #define KEY_UP 0403 29227 #define KEY_LEFT 0404 29228 #define KEY_RIGHT 0405 29229 #define KEY_HOME 0406 29230 #define KEY_BACKSPACE 0407 29231 #define KEY_F0 0410 29232 #define KEY_DL 0510 29233 #define KEY_IL 0511 29234 #define KEY_DC 0512 29235 #define KEY_IC 0513 29236 #define KEY_EIC 0514 29237 #define KEY_CLEAR 0515 29238 #define KEY_EOS 0516 29239 #define KEY_EOL 0517 29240 #define KEY_SF 0520 29241 #define KEY_SR 0521 29242 #define KEY_NPAGE 0522 29243 #define KEY_PPAGE 0523 29244 #define KEY_STAB 0524 29245 #define KEY_CTAB 0525 29246 #define KEY_CATAB 0526 29247 #define KEY_ENTER 0527 29248 #define KEY_SRESET 0530 29249 #define KEY_RESET 0531 29250 #define KEY_PRINT 0532 29251 #define KEY_LL 0533 29252 #define KEY_A1 0534 29253 #define KEY_A3 0535 29254 #define KEY_B2 0536 29255 #define KEY_C1 0537 29256 #define KEY_C3 0540 29257 #define KEY_BTAB 0541 29258 #define KEY_BEG 0542 29259 #define KEY_CANCEL 0543 29260 #define KEY_CLOSE 0544 29261 #define KEY_COMMAND 0545 29262 #define KEY_COPY 0546 29263 #define KEY_CREATE 0547 29264 #define KEY_END 0550 29265 #define KEY_EXIT 0551 29266 #define KEY_FIND 0552 29267 #define KEY_HELP 0553 29268 #define KEY_MARK 0554 29269 #define KEY_MESSAGE 0555 29270 #define KEY_MOVE 0556 29271 #define KEY_NEXT 0557 29272 #define KEY_OPEN 0560 29273 #define KEY_OPTIONS 0561 29274 #define KEY_PREVIOUS 0562 29275 #define KEY_REDO 0563 29276 #define KEY_REFERENCE 0564 29277 #define KEY_REFRESH 0565 29278 #define KEY_REPLACE 0566 29279 #define KEY_RESTART 0567 29280 #define KEY_RESUME 0570 29281 #define KEY_SAVE 0571 29282 #define KEY_SBEG 0572 29283 #define KEY_SCANCEL 0573 29284 #define KEY_SCOMMAND 0574 29285 #define KEY_SCOPY 0575 29286 #define KEY_SCREATE 0576 29287 #define KEY_SDC 0577 29288 #define KEY_SDL 0600 29289 #define KEY_SELECT 0601 29290 #define KEY_SEND 0602 29291 #define KEY_SEOL 0603 29292 #define KEY_SEXIT 0604 29293 #define KEY_SFIND 0605 29294 #define KEY_SHELP 0606 29295 #define KEY_SHOME 0607 29296 #define KEY_SIC 0610 29297 #define KEY_SLEFT 0611 29298 #define KEY_SMESSAGE 0612 29299 #define KEY_SMOVE 0613 29300 #define KEY_SNEXT 0614 29301 #define KEY_SOPTIONS 0615 29302 #define KEY_SPREVIOUS 0616 29303 #define KEY_SPRINT 0617 29304 #define KEY_SREDO 0620 29305 #define KEY_SREPLACE 0621 29306 #define KEY_SRIGHT 0622 29307 #define KEY_SRSUME 0623 29308 #define KEY_SSAVE 0624 29309 #define KEY_SSUSPEND 0625 29310 #define KEY_SUNDO 0626 29311 #define KEY_SUSPEND 0627 29312 #define KEY_UNDO 0630 29313 #define KEY_MOUSE 0631 29314 #define KEY_RESIZE 0632 29315 #define KEY_MAX 0777 29316 29317 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 29318 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 29319 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 29320 #define A_NORMAL 0L 29321 #define NCURSES_ATTR_SHIFT 8 29322 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 29323 #define A_BLINK NCURSES_BITS(1UL,11) 29324 #define A_DIM NCURSES_BITS(1UL,12) 29325 #define A_BOLD NCURSES_BITS(1UL,13) 29326 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 29327 #define A_INVIS NCURSES_BITS(1UL,15) 29328 #define A_PROTECT NCURSES_BITS(1UL,16) 29329 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 29330 #define A_LEFT NCURSES_BITS(1UL,18) 29331 #define A_LOW NCURSES_BITS(1UL,19) 29332 #define A_RIGHT NCURSES_BITS(1UL,20) 29333 #define A_TOP NCURSES_BITS(1UL,21) 29334 #define A_VERTICAL NCURSES_BITS(1UL,22) 29335 #define A_STANDOUT NCURSES_BITS(1UL,8) 29336 #define A_UNDERLINE NCURSES_BITS(1UL,9) 29337 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 29338 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 29339 29340 extern int COLORS; 29341 extern int COLOR_PAIRS; 29342 extern int COLS; 29343 extern int LINES; 29344 extern chtype acs_map[]; 29345 extern int addch(const chtype); 29346 extern int addchnstr(const chtype *, int); 29347 extern int addchstr(const chtype *); 29348 extern int addnstr(const char *, int); 29349 extern int addstr(const char *); 29350 extern int attr_get(attr_t *, short *, void *); 29351 extern int attr_off(attr_t, void *); 29352 extern int attr_on(attr_t, void *); 29353 extern int attr_set(attr_t, short, void *); 29354 extern int attroff(int); 29355 extern int attron(int); 29356 extern int attrset(int); 29357 extern int baudrate(void); 29358 extern int beep(void); 29359 extern int bkgd(chtype); 29360 extern void bkgdset(chtype); 29361 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 29362 chtype); 29363 extern int box(WINDOW *, chtype, chtype); 29364 extern bool can_change_color(void); 29365 extern int cbreak(void); 29366 extern int chgat(int, attr_t, short, const void *); 29367 extern int clear(void); 29368 extern int clearok(WINDOW *, bool); 29369 extern int clrtobot(void); 29370 extern int clrtoeol(void); 29371 extern int color_content(short, short *, short *, short *); 29372 extern int color_set(short, void *); 29373 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 29374 int); 29375 extern int curs_set(int); 29376 extern WINDOW *curscr; 29377 extern int def_prog_mode(void); 29378 extern int def_shell_mode(void); 29379 extern int delay_output(int); 29380 extern int delch(void); 29381 extern int deleteln(void); 29382 extern void delscreen(SCREEN *); 29383 extern int delwin(WINDOW *); 29384 extern WINDOW *derwin(WINDOW *, int, int, int, int); 29385 extern int doupdate(void); 29386 extern WINDOW *dupwin(WINDOW *); 29387 extern int echo(void); 29388 extern int echochar(const chtype); 29389 extern int endwin(void); 29390 extern int erase(void); 29391 extern char erasechar(void); 29392 extern void filter(void); 29393 extern int flash(void); 29394 extern int flushinp(void); 29395 extern chtype getbkgd(WINDOW *); 29396 extern int getch(void); 29397 extern int getnstr(char *, int); 29398 extern int getstr(char *); 29399 extern WINDOW *getwin(FILE *); 29400 extern int halfdelay(int); 29401 extern bool has_colors(void); 29402 extern bool has_ic(void); 29403 extern bool has_il(void); 29404 extern int hline(chtype, int); 29405 extern void idcok(WINDOW *, bool); 29406 extern int idlok(WINDOW *, bool); 29407 extern void immedok(WINDOW *, bool); 29408 extern chtype inch(void); 29409 extern int inchnstr(chtype *, int); 29410 extern int inchstr(chtype *); 29411 extern int init_color(short, short, short, short); 29412 extern int init_pair(short, short, short); 29413 extern WINDOW *initscr(void); 29414 extern int innstr(char *, int); 29415 extern int insch(chtype); 29416 extern int insdelln(int); 29417 extern int insertln(void); 29418 extern int insnstr(const char *, int); 29419 extern int insstr(const char *); 29420 extern int instr(char *); 29421 extern int intrflush(WINDOW *, bool); 29422 extern bool is_linetouched(WINDOW *, int); 29423 extern bool is_wintouched(WINDOW *); 29424 extern bool isendwin(void); 29425 extern const char *keyname(int); 29426 extern int keypad(WINDOW *, bool); 29427 extern char killchar(void); 29428 extern int leaveok(WINDOW *, bool); 29429 extern char *longname(void); 29430 extern int meta(WINDOW *, bool); 29431 extern int move(int, int); 29432 extern int mvaddch(int, int, const chtype); 29433 extern int mvaddchnstr(int, int, const chtype *, int); 29434 extern int mvaddchstr(int, int, const chtype *); 29435 extern int mvaddnstr(int, int, const char *, int); 29436 extern int mvaddstr(int, int, const char *); 29437 extern int mvchgat(int, int, int, attr_t, short, const void *); 29438 extern int mvcur(int, int, int, int); 29439 extern int mvdelch(int, int); 29440 extern int mvderwin(WINDOW *, int, int); 29441 extern int mvgetch(int, int); 29442 extern int mvgetnstr(int, int, char *, int); 29443 extern int mvgetstr(int, int, char *); 29444 extern int mvhline(int, int, chtype, int); 29445 extern chtype mvinch(int, int); 29446 extern int mvinchnstr(int, int, chtype *, int); 29447 extern int mvinchstr(int, int, chtype *); 29448 extern int mvinnstr(int, int, char *, int); 29449 extern int mvinsch(int, int, chtype); 29450 extern int mvinsnstr(int, int, const char *, int); 29451 extern int mvinsstr(int, int, const char *); 29452 extern int mvinstr(int, int, char *); 29453 extern int mvprintw(int, int, const char *, ...); 29454 extern int mvscanw(int, int, const char *, ...); 29455 extern int mvvline(int, int, chtype, int); 29456 extern int mvwaddch(WINDOW *, int, int, const chtype); 29457 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 29458 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 29459 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 29460 extern int mvwaddstr(WINDOW *, int, int, const char *); 29461 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *); 29462 extern int mvwdelch(WINDOW *, int, int); 29463 extern int mvwgetch(WINDOW *, int, int); 29464 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 29465 extern int mvwgetstr(WINDOW *, int, int, char *); 29466 extern int mvwhline(WINDOW *, int, int, chtype, int); 29467 extern int mvwin(WINDOW *, int, int); 29468 extern chtype mvwinch(WINDOW *, int, int); 29469 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 29470 extern int mvwinchstr(WINDOW *, int, int, chtype *); 29471 extern int mvwinnstr(WINDOW *, int, int, char *, int); 29472 extern int mvwinsch(WINDOW *, int, int, chtype); 29473 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 29474 extern int mvwinsstr(WINDOW *, int, int, const char *); 29475 extern int mvwinstr(WINDOW *, int, int, char *); 29476 extern int mvwprintw(WINDOW *, int, int, const char *, ...); 29477 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 29478 extern int mvwvline(WINDOW *, int, int, chtype, int); 29479 extern int napms(int); 29480 extern WINDOW *newpad(int, int); 29481 extern SCREEN *newterm(const char *, FILE *, FILE *); 29482 extern WINDOW *newwin(int, int, int, int); 29483 extern int nl(void); 29484 extern int nocbreak(void); 29485 extern int nodelay(WINDOW *, bool); 29486 extern int noecho(void); 29487 extern int nonl(void); 29488 extern void noqiflush(void); 29489 extern int noraw(void); 29490 extern int notimeout(WINDOW *, bool); 29491 extern int overlay(const WINDOW *, WINDOW *); 29492 extern int overwrite(const WINDOW *, WINDOW *); 29493 extern int pair_content(short, short *, short *); 29494 extern int pechochar(WINDOW *, chtype); 29495 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 29496 extern int prefresh(WINDOW *, int, int, int, int, int, int); 29497 extern int printw(const char *, ...); 29498 extern int putwin(WINDOW *, FILE *); 29499 extern void qiflush(void); 29500 extern int raw(void); 29501 extern int redrawwin(WINDOW *); 29502 extern int refresh(void); 29503 extern int reset_prog_mode(void); 29504 extern int reset_shell_mode(void); 29505 extern int resetty(void); 29506 extern int ripoffline(int, int (*)(WINDOW *, int)); 29507 extern int savetty(void); 29508 extern int scanw(const char *, ...); 29509 extern int scr_dump(const char *); 29510 extern int scr_init(const char *); 29511 extern int scr_restore(const char *); 29512 extern int scr_set(const char *); 29513 extern int scrl(int); 29514 extern int scroll(WINDOW *); 29515 extern int scrollok(WINDOW *, bool); 29516 extern SCREEN *set_term(SCREEN *); 29517 extern int setscrreg(int, int); 29518 extern int slk_attr_set(const attr_t, short, void *); 29519 extern int slk_attroff(const chtype); 29520 extern int slk_attron(const chtype); 29521 extern int slk_attrset(const chtype); 29522 extern int slk_clear(void); 29523 extern int slk_color(short); 29524 extern int slk_init(int); 29525 extern char *slk_label(int); 29526 extern int slk_noutrefresh(void); 29527 extern int slk_refresh(void); 29528 extern int slk_restore(void); 29529 extern int slk_set(int, const char *, int); 29530 extern int slk_touch(void); 29531 extern int standend(void); 29532 extern int standout(void); 29533 extern int start_color(void); 29534 extern WINDOW *stdscr; 29535 extern WINDOW *subpad(WINDOW *, int, int, int, int); 29536 extern WINDOW *subwin(WINDOW *, int, int, int, int); 29537 extern int syncok(WINDOW *, bool); 29538 extern chtype termattrs(void); 29539 extern char *termname(void); 29540 extern void timeout(int); 29541 extern int touchline(WINDOW *, int, int); 29542 extern int touchwin(WINDOW *); 29543 extern int typeahead(int); 29544 extern const char *unctrl(chtype); 29545 extern int ungetch(int); 29546 extern int untouchwin(WINDOW *); 29547 extern void use_env(bool); 29548 extern int vidattr(chtype); 29549 extern int vidputs(chtype, int (*)(int)); 29550 extern int vline(chtype, int); 29551 extern int vw_printw(WINDOW *, const char *, va_list); 29552 extern int vw_scanw(WINDOW *, const char *, va_list); 29553 extern int vwprintw(WINDOW *, const char *, va_list); 29554 extern int vwscanw(WINDOW *, const char *, va_list); 29555 extern int waddch(WINDOW *, const chtype); 29556 extern int waddchnstr(WINDOW *, const chtype *, int); 29557 extern int waddchstr(WINDOW *, const chtype *); 29558 extern int waddnstr(WINDOW *, const char *, int); 29559 extern int waddstr(WINDOW *, const char *); 29560 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 29561 extern int wattr_off(WINDOW *, attr_t, void *); 29562 extern int wattr_on(WINDOW *, attr_t, void *); 29563 extern int wattr_set(WINDOW *, attr_t, short, void *); 29564 extern int wattroff(WINDOW *, int); 29565 extern int wattron(WINDOW *, int); 29566 extern int wattrset(WINDOW *, int); 29567 extern int wbkgd(WINDOW *, chtype); 29568 extern void wbkgdset(WINDOW *, chtype); 29569 extern int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, 29570 chtype, chtype, chtype); 29571 extern int wchgat(WINDOW *, int, attr_t, short, const void *); 29572 extern int wclear(WINDOW *); 29573 extern int wclrtobot(WINDOW *); 29574 extern int wclrtoeol(WINDOW *); 29575 extern int wcolor_set(WINDOW *, short, void *); 29576 extern void wcursyncup(WINDOW *); 29577 extern int wdelch(WINDOW *); 29578 extern int wdeleteln(WINDOW *); 29579 extern int wechochar(WINDOW *, const chtype); 29580 extern int werase(WINDOW *); 29581 extern int wgetch(WINDOW *); 29582 extern int wgetnstr(WINDOW *, char *, int); 29583 extern int wgetstr(WINDOW *, char *); 29584 extern int whline(WINDOW *, chtype, int); 29585 extern chtype winch(WINDOW *); 29586 extern int winchnstr(WINDOW *, chtype *, int); 29587 extern int winchstr(WINDOW *, chtype *); 29588 extern int winnstr(WINDOW *, char *, int); 29589 extern int winsch(WINDOW *, chtype); 29590 extern int winsdelln(WINDOW *, int); 29591 extern int winsertln(WINDOW *); 29592 extern int winsnstr(WINDOW *, const char *, int); 29593 extern int winsstr(WINDOW *, const char *); 29594 extern int winstr(WINDOW *, char *); 29595 extern int wmove(WINDOW *, int, int); 29596 extern int wnoutrefresh(WINDOW *); 29597 extern int wprintw(WINDOW *, const char *, ...); 29598 extern int wredrawln(WINDOW *, int, int); 29599 extern int wrefresh(WINDOW *); 29600 extern int wscanw(WINDOW *, const char *, ...); 29601 extern int wscrl(WINDOW *, int); 29602 extern int wsetscrreg(WINDOW *, int, int); 29603 extern int wstandend(WINDOW *); 29604 extern int wstandout(WINDOW *); 29605 extern void wsyncdown(WINDOW *); 29606 extern void wsyncup(WINDOW *); 29607 extern void wtimeout(WINDOW *, int); 29608 extern int wtouchln(WINDOW *, int, int, int); 29609 extern int wvline(WINDOW *, chtype, int); 29610 __________________________________________________________ 29611 29612 13.6.2. term.h 29613 29614 extern TERMINAL *cur_term; 29615 extern int del_curterm(TERMINAL *); 29616 extern int putp(const char *); 29617 extern int restartterm(char *, int, int *); 29618 extern TERMINAL *set_curterm(TERMINAL *); 29619 extern int setupterm(char *, int, int *); 29620 extern int tgetent(char *, const char *); 29621 extern int tgetflag(char *); 29622 extern int tgetnum(char *); 29623 extern char *tgetstr(char *, char **); 29624 extern char *tgoto(const char *, int, int); 29625 extern int tigetflag(const char *); 29626 extern int tigetnum(const char *); 29627 extern char *tigetstr(const char *); 29628 extern char *tparm(const char *, ...); 29629 extern int tputs(const char *, int, int (*)(int)); 29630 __________________________________________________________ 29631 29632 13.7. Interface Definitions for libncurses 29633 29634 Table of Contents 29635 inchnstr -- obtain a string of characters and their attributes 29636 from a curses window 29637 29638 inchstr -- obtain a string of characters and their attributes 29639 from a curses window 29640 29641 instr -- obtain a string of characters from a curses window 29642 mvcur -- send cursor movement commands to terminal 29643 mvinchnstr -- obtain a string of characters and their 29644 attributes from a curses window 29645 29646 mvinchstr -- obtain a string of characters and their attributes 29647 from a curses window 29648 29649 mvinstr -- obtain a string of characters from a curses window 29650 mvscanw -- convert formatted input from a curses window 29651 mvwinchnstr -- obtain a string of characters and their 29652 attributes from a curses window 29653 29654 mvwinchstr -- obtain a string of characters and their 29655 attributes from a curses window 29656 29657 mvwinstr -- obtain a string of characters from a curses window 29658 mvwscanw -- convert formatted input from a curses window 29659 ripoffline -- obtain a string of characters and their 29660 attributes from a curses window 29661 29662 scanw -- convert formatted input from a curses window 29663 vw_scanw -- convert formatted input from a curses window 29664 vwscanw -- convert formatted input from a curses window 29665 winchnstr -- obtain a string of characters and their attributes 29666 from a curses window 29667 29668 winchstr -- obtain a string of characters and their attributes 29669 from a curses window 29670 29671 winstr -- obtain a string of characters from a curses window 29672 wscanw -- convert formatted input from a curses window 29673 29674 The interfaces defined on the following pages are included in 29675 libncurses and are defined by this specification. Unless 29676 otherwise noted, these interfaces shall be included in the 29677 source standard. 29678 29679 Other interfaces listed in Section 13.5 shall behave as 29680 described in the referenced base document. 29681 29682 inchnstr 29683 29684 Name 29685 29686 inchnstr -- obtain a string of characters and their attributes 29687 from a curses window 29688 29689 Synopsis 29690 29691 #include 29692 29693 int inchnstr(chtype * chstr, int n); 29694 29695 Description 29696 29697 The interface inchnstr() shall behave as specified in X/Open 29698 Curses, except that inchnstr() shall return the number of 29699 characters that were read. 29700 29701 inchstr 29702 29703 Name 29704 29705 inchstr -- obtain a string of characters and their attributes 29706 from a curses window 29707 29708 Synopsis 29709 29710 #include 29711 29712 int inchstr(chtype * chstr); 29713 29714 Description 29715 29716 The interface inchstr() shall behave as specified in X/Open 29717 Curses, except that inchstr() shall return the number of 29718 characters that were read. 29719 29720 instr 29721 29722 Name 29723 29724 instr -- obtain a string of characters from a curses window 29725 29726 Synopsis 29727 29728 #include 29729 29730 int instr(char * str); 29731 29732 Description 29733 29734 The interface instr() shall behave as specified in X/Open 29735 Curses, except that instr() shall return the number of 29736 characters that were read. 29737 29738 mvcur 29739 29740 Name 29741 29742 mvcur -- send cursor movement commands to terminal 29743 29744 Synopsis 29745 29746 #include 29747 29748 int mvcur(int oldrow, int oldcol, int newrow, int newcol); 29749 29750 Description 29751 29752 The interface mvcur() shall behave as described in X/Open 29753 Curses, except that if (newrow, newcol) is not a valid address 29754 for the terminal in use, the results of the mvcur() function 29755 are unspecified. 29756 29757 mvinchnstr 29758 29759 Name 29760 29761 mvinchnstr -- obtain a string of characters and their 29762 attributes from a curses window 29763 29764 Synopsis 29765 29766 #include 29767 29768 int mvinchnstr(int y, int x, chtype * chstr, int n); 29769 29770 Description 29771 29772 The interface mvinchnstr() shall behave as specified in X/Open 29773 Curses, except that mvinchnstr() shall return the number of 29774 characters that were read. 29775 29776 mvinchstr 29777 29778 Name 29779 29780 mvinchstr -- obtain a string of characters and their attributes 29781 from a curses window 29782 29783 Synopsis 29784 29785 #include 29786 29787 int mvinchstr(int y, int x, chtype * chstr); 29788 29789 Description 29790 29791 The interface mvinchstr() shall behave as specified in X/Open 29792 Curses, except that mvinchstr() shall return the number of 29793 characters that were read. 29794 29795 mvinstr 29796 29797 Name 29798 29799 mvinstr -- obtain a string of characters from a curses window 29800 29801 Synopsis 29802 29803 #include 29804 29805 int mvinstr(int y, int x, char * str); 29806 29807 Description 29808 29809 The interface mvinstr() shall behave as specified in X/Open 29810 Curses, except that mvinstr() shall return the number of 29811 characters that were read. 29812 29813 mvscanw 29814 29815 Name 29816 29817 mvscanw -- convert formatted input from a curses window 29818 29819 Synopsis 29820 29821 #include 29822 29823 int mvscanw(int y, int x, const char *fmt, ...); 29824 29825 Description 29826 29827 The scanw family of functions shall behave as described in 29828 X/Open Curses, except as noted below. 29829 29830 Differences 29831 29832 This function returns ERR on failure. On success it returns the 29833 number of successfully matched and assigned input items. This 29834 differs from X/Open Curses, which indicates this function 29835 returns OK on success. 29836 29837 mvwinchnstr 29838 29839 Name 29840 29841 mvwinchnstr -- obtain a string of characters and their 29842 attributes from a curses window 29843 29844 Synopsis 29845 29846 #include 29847 29848 int mvwinchnstr(WINDOW * win, int y, int x, chtype * chstr, int 29849 n); 29850 29851 Description 29852 29853 The interface mvwinchnstr() shall behave as specified in X/Open 29854 Curses, except that mvwinchnstr() shall return the number of 29855 characters that were read. 29856 29857 mvwinchstr 29858 29859 Name 29860 29861 mvwinchstr -- obtain a string of characters and their 29862 attributes from a curses window 29863 29864 Synopsis 29865 29866 #include 29867 29868 int mvwinchstr(WINDOW * win, int y, int x, chtype * chstr); 29869 29870 Description 29871 29872 The interface mvwinchstr() shall behave as specified in X/Open 29873 Curses, except that mvwinchstr() shall return the number of 29874 characters that were read. 29875 29876 mvwinstr 29877 29878 Name 29879 29880 mvwinstr -- obtain a string of characters from a curses window 29881 29882 Synopsis 29883 29884 #include 29885 29886 int mvwinstr(WINDOW * win, int y, int x, char * str); 29887 29888 Description 29889 29890 The interface mvwinstr() shall behave as specified in X/Open 29891 Curses, except that mvwinstr() shall return the number of 29892 characters that were read. 29893 29894 mvwscanw 29895 29896 Name 29897 29898 mvwscanw -- convert formatted input from a curses window 29899 29900 Synopsis 29901 29902 #include 29903 29904 int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...); 29905 29906 Description 29907 29908 The scanw family of functions shall behave as described in 29909 X/Open Curses, except as noted below. 29910 29911 Differences 29912 29913 This function returns ERR on failure. On success it returns the 29914 number of successfully matched and assigned input items. This 29915 differs from X/Open Curses, which indicates this function 29916 returns OK on success. 29917 29918 ripoffline 29919 29920 Name 29921 29922 ripoffline -- obtain a string of characters and their 29923 attributes from a curses window 29924 29925 Synopsis 29926 29927 #include 29928 29929 int ripoffline(int line, int (*init) (WINDOW *, int)); 29930 29931 Description 29932 29933 The interface ripoffline() shall behave as specified in X/Open 29934 Curses, except that ripoffline() shall return -1 if the number 29935 of lines that were ripped off exceeds five. 29936 29937 scanw 29938 29939 Name 29940 29941 scanw -- convert formatted input from a curses window 29942 29943 Synopsis 29944 29945 #include 29946 29947 int scanw(const char *fmt, ...); 29948 29949 Description 29950 29951 The scanw family of functions shall behave as described in 29952 X/Open Curses, except as noted below. 29953 29954 Differences 29955 29956 This function returns ERR on failure. On success it returns the 29957 number of successfully matched and assigned input items. This 29958 differs from X/Open Curses, which indicates this function 29959 returns OK on success. 29960 29961 vw_scanw 29962 29963 Name 29964 29965 vw_scanw -- convert formatted input from a curses window 29966 29967 Synopsis 29968 29969 #include 29970 29971 int vw_scanw(WINDOW *win, const char *fmt, va_list vararglist); 29972 29973 Description 29974 29975 The scanw family of functions shall behave as described in 29976 X/Open Curses, except as noted below. 29977 29978 Differences 29979 29980 This function returns ERR on failure. On success it returns the 29981 number of successfully matched and assigned input items. This 29982 differs from X/Open Curses, which indicates this function 29983 returns OK on success. 29984 29985 vwscanw 29986 29987 Name 29988 29989 vwscanw -- convert formatted input from a curses window 29990 29991 Synopsis 29992 29993 #include 29994 29995 int vw_scanw(WINDOW *win, const char *fmt, va_list vararglist); 29996 29997 Description 29998 29999 The scanw family of functions shall behave as described in 30000 X/Open Curses, except as noted below. 30001 30002 Differences 30003 30004 This function returns ERR on failure. On success it returns the 30005 number of successfully matched and assigned input items. This 30006 differs from X/Open Curses, which indicates this function 30007 returns OK on success. 30008 30009 winchnstr 30010 30011 Name 30012 30013 winchnstr -- obtain a string of characters and their attributes 30014 from a curses window 30015 30016 Synopsis 30017 30018 #include 30019 30020 int winchnstr(WINDOW * win, chtype * chstr, int n); 30021 30022 Description 30023 30024 The interface winchnstr() shall behave as specified in X/Open 30025 Curses, except that winchnstr() shall return the number of 30026 characters that were read. 30027 30028 winchstr 30029 30030 Name 30031 30032 winchstr -- obtain a string of characters and their attributes 30033 from a curses window 30034 30035 Synopsis 30036 30037 #include 30038 30039 int winchstr(WINDOW * win, chtype * chstr); 30040 30041 Description 30042 30043 The interface winchstr() shall behave as specified in X/Open 30044 Curses, except that winchstr() shall return the number of 30045 characters that were read. 30046 30047 winstr 30048 30049 Name 30050 30051 winstr -- obtain a string of characters from a curses window 30052 30053 Synopsis 30054 30055 #include 30056 30057 int winstr(WINDOW * win, char * str); 30058 30059 Description 30060 30061 The interface winstr() shall behave as specified in POSIX 30062 1003.1-2001 (ISO/IEC 9945-2003), except that winstr() shall 30063 return the number of characters that were read. 30064 30065 wscanw 30066 30067 Name 30068 30069 wscanw -- convert formatted input from a curses window 30070 30071 Synopsis 30072 30073 #include 30074 30075 int wscanw(WINDOW *win, const char *fmt, ...); 30076 30077 Description 30078 30079 The scanw family of functions shall behave as described in 30080 X/Open Curses, except as noted below. 30081 30082 Differences 30083 30084 This function returns ERR on failure. On success it returns the 30085 number of successfully matched and assigned input items. This 30086 differs from X/Open Curses, which indicates this function 30087 returns OK on success. 30088 __________________________________________________________ 30089 30090 13.8. Interfaces for libutil 30091 30092 Table 13-7 defines the library name and shared object name for 30093 the libutil library 30094 30095 Table 13-7. libutil Definition 30096 Library: libutil 30097 SONAME: libutil.so.1 30098 30099 The behavior of the interfaces in this library is specified by 30100 the following specifications: 30101 30102 [LSB] This Specification 30103 __________________________________________________________ 30104 30105 13.8.1. Utility Functions 30106 __________________________________________________________ 30107 30108 13.8.1.1. Interfaces for Utility Functions 30109 30110 An LSB conforming implementation shall provide the generic 30111 functions for Utility Functions specified in Table 13-8, with 30112 the full mandatory functionality as described in the referenced 30113 underlying specification. 30114 30115 Table 13-8. libutil - Utility Functions Function Interfaces 30116 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 30117 logwtmp [LSB] openpty [LSB] 30118 __________________________________________________________ 30119 30120 13.9. Interface Definitions for libutil 30121 30122 Table of Contents 30123 forkpty -- Create a new process attached to an available 30124 pseudo-terminal 30125 30126 login -- login utility function 30127 login_tty -- Prepare a terminal for login 30128 logout -- logout utility function 30129 logwtmp -- append an entry to the wtmp file 30130 openpty -- find and open an available pseudo-terminal 30131 30132 The interfaces defined on the following pages are included in 30133 libutil and are defined by this specification. Unless otherwise 30134 noted, these interfaces shall be included in the source 30135 standard. 30136 30137 Other interfaces listed in Section 13.8 shall behave as 30138 described in the referenced base document. 30139 30140 forkpty 30141 30142 Name 30143 30144 forkpty -- Create a new process attached to an available 30145 pseudo-terminal 30146 30147 Synopsis 30148 30149 #include 30150 30151 int forkpty(int * amaster, char * name, const struct termios * 30152 termp, const struct winsize * winp); 30153 30154 Description 30155 30156 The forkpty() function shall find and open a pseudo-terminal 30157 device pair in the same manner as the openpty() function. If a 30158 pseudo-terminal is available, forkpty() shall create a new 30159 process in the same manner as the fork() function, and prepares 30160 the new process for login in the same manner as login_tty(). 30161 30162 If termp is not null, it shall refer to a termios structure 30163 that shall be used to initialize the characteristics of the 30164 slave device. If winp is not null, it shall refer to a winsize 30165 structure used to initialize the window size of the slave 30166 device. 30167 30168 Return Value 30169 30170 On success, the parent process shall return the process id of 30171 the child, and the child shall return 0. On error, no new 30172 process shall be created, -1 shall be returned, and errno shall 30173 be set appropriately. On success, the parent process shall 30174 receive the file descriptor of the master side of the 30175 pseudo-terminal in the location referenced by amaster, and, if 30176 name is not NULL, the filename of the slave device in name. 30177 30178 Errors 30179 30180 EAGAIN 30181 30182 Unable to create a new process. 30183 ENOENT 30184 30185 There are no available pseudo-terminals. 30186 ENOMEM 30187 30188 Insufficient memory was available. 30189 30190 login 30191 30192 Name 30193 30194 login -- login utility function 30195 30196 Synopsis 30197 30198 #include 30199 30200 void login (struct utmp * ut ); 30201 30202 Description 30203 30204 The login() function shall update the user accounting 30205 databases. The ut parameter shall reference a utmp structure 30206 for all fields except the following: 30207 30208 1. The ut_type field shall be set to USER_PROCESS. 30209 2. The ut_pid field shall be set to the process identifier for 30210 the current process. 30211 3. The ut_line field shall be set to the name of the 30212 controlling terminal device. The name shall be found by 30213 examining the device associated with the standard input, 30214 output and error streams in sequence, until one associated 30215 with a terminal device is found. If none of these streams 30216 refers to a terminal device, the ut_line field shall be set 30217 to "???". If the terminal device is in the /dev directory 30218 hierarchy, the ut_line field shall not contain the leading 30219 "/dev/", otherwise it shall be set to the final component 30220 of the pathname of the device. If the user accounting 30221 database imposes a limit on the size of the ut_line field, 30222 it shall truncate the name, but any such limit shall not be 30223 smaller than UT_LINESIZE (including a terminating null 30224 character). 30225 30226 Return Value 30227 30228 None 30229 30230 Errors 30231 30232 None 30233 30234 login_tty 30235 30236 Name 30237 30238 login_tty -- Prepare a terminal for login 30239 30240 Synopsis 30241 30242 #include 30243 30244 int login_tty (int fdr); 30245 30246 Description 30247 30248 The login_tty() function shall prepare the terminal device 30249 referenced by the file descriptor fdr. This function shall 30250 create a new session, make the terminal the controlling 30251 terminal for the current process, and set the standard input, 30252 output, and error streams of the current process to the 30253 terminal. If fdr is not the standard input, output or error 30254 stream, then login_tty() shall close fdr. 30255 30256 Return Value 30257 30258 On success, login_tty() shall return zero; otherwise -1 is 30259 returned, and errno shall be set appropriately. 30260 30261 Errors 30262 30263 ENOTTY 30264 30265 fdr does not refer to a terminal device. 30266 30267 logout 30268 30269 Name 30270 30271 logout -- logout utility function 30272 30273 Synopsis 30274 30275 #include 30276 30277 int logout (const char * line ); 30278 30279 Description 30280 30281 Given the device line, the logout() function shall search the 30282 user accounting database which is read by getutent() for an 30283 entry with the corresponding line, and with the type of 30284 USER_PROCESS. If a corresponding entry is located, it shall be 30285 updated as follows: 30286 30287 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 30288 bytes). 30289 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 30290 bytes). 30291 3. The ut_tv shall be set to the current time of day. 30292 4. The ut_type field shall be set to DEAD_PROCESS. 30293 30294 Return Value 30295 30296 On success, the logout() function shall return non-zero. Zero 30297 is returned if there was no entry to remove, or if the utmp 30298 file could not be opened or updated. 30299 30300 logwtmp 30301 30302 Name 30303 30304 logwtmp -- append an entry to the wtmp file 30305 30306 Synopsis 30307 30308 #include 30309 30310 void logwtmp (const char * line , const char * name , const 30311 char * host ); 30312 30313 Description 30314 30315 If the process has permission to update the user accounting 30316 databases, the logwtmp() function shall append a record to the 30317 user accounting database that records all logins and logouts. 30318 The record to be appended shall be constructed as follows: 30319 30320 1. The ut_line field shall be initialized from line. If the 30321 user accounting database imposes a limit on the size of the 30322 ut_line field, it shall truncate the value, but any such 30323 limit shall not be smaller than UT_LINESIZE (including a 30324 terminating null character). 30325 2. The ut_name field shall be initialized from name. If the 30326 user accounting database imposes a limit on the size of the 30327 ut_name field, it shall truncate the value, but any such 30328 limit shall not be smaller than UT_NAMESIZE (including a 30329 terminating null character). 30330 3. The ut_host field shall be initialized from host. If the 30331 user accounting database imposes a limit on the size of the 30332 ut_host field, it shall truncate the value, but any such 30333 limit shall not be smaller than UT_HOSTSIZE (including a 30334 terminating null character). 30335 4. If the name parameter does not refer to an empty string 30336 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 30337 otherwise the ut_type field shall be set to DEAD_PROCESS. 30338 5. The ut_id field shall be set to the process identifier for 30339 the current process. 30340 6. The ut_tv field shall be set to the current time of day. 30341 30342 Note: If a process does not have write access to the the 30343 user accounting database, the logwtmp() function will not 30344 update it. Since the function does not return any value, an 30345 application has no way of knowing whether it succeeded or 30346 failed. 30347 30348 Return Value 30349 30350 None. 30351 30352 openpty 30353 30354 Name 30355 30356 openpty -- find and open an available pseudo-terminal 30357 30358 Synopsis 30359 30360 #include 30361 30362 int openpty(int *amaster, int *aslave, char *name, const struct 30363 termios *termp, const struct winsize *winp); 30364 30365 Description 30366 30367 The openpty() function shall find an available pseudo-terminal 30368 and return file descriptors for the master and slave devices in 30369 the locations referenced by amaster and aslave respectively. If 30370 name is not NULL, the filename of the slave shall be placed in 30371 the user supplied buffer referenced by name. If termp is not 30372 NULL, it shall point to a termios structure used to initialize 30373 the terminal parameters of the slave pseudo-terminal device. If 30374 winp is not NULL, it shall point to a winsize structure used to 30375 initialize the window size parameters of the slave 30376 pseudo-terminal device. 30377 30378 Return Value 30379 30380 On success, zero is returned. On error, -1 is returned, and 30381 errno is set appropriately. 30382 30383 Errors 30384 30385 ENOENT 30386 30387 There are no available pseudo-terminals. 30388 30389 V. Network Security Services 30390 30391 Table of Contents 30392 14. Libraries 30393 30394 14.1. Interfaces for libnspr4 30395 30396 14.1.1. Netscape Portable Runtime 30397 30398 14.2. Data Definitions for libnspr4 30399 30400 14.2.1. nspr4/nspr.h 30401 14.2.2. nspr4/plarena.h 30402 14.2.3. nspr4/plhash.h 30403 14.2.4. nspr4/prclist.h 30404 14.2.5. nspr4/prerror.h 30405 14.2.6. nspr4/prinit.h 30406 14.2.7. nspr4/prinrval.h 30407 14.2.8. nspr4/prio.h 30408 14.2.9. nspr4/private/pprio.h 30409 14.2.10. nspr4/prlock.h 30410 14.2.11. nspr4/prmon.h 30411 14.2.12. nspr4/prnetdb.h 30412 14.2.13. nspr4/prthread.h 30413 14.2.14. nspr4/prtime.h 30414 14.2.15. nspr4/prtypes.h 30415 30416 14.3. Interfaces for libnss3 30417 30418 14.3.1. NSS Utility 30419 30420 14.4. Data Definitions for libnss3 30421 30422 14.4.1. nss3/blapit.h 30423 14.4.2. nss3/cert.h 30424 14.4.3. nss3/certt.h 30425 14.4.4. nss3/cmsreclist.h 30426 14.4.5. nss3/cryptoht.h 30427 14.4.6. nss3/hasht.h 30428 14.4.7. nss3/key.h 30429 14.4.8. nss3/keyhi.h 30430 14.4.9. nss3/keyt.h 30431 14.4.10. nss3/keythi.h 30432 14.4.11. nss3/nss.h 30433 14.4.12. nss3/nssb64.h 30434 14.4.13. nss3/nssb64t.h 30435 14.4.14. nss3/nssilckt.h 30436 14.4.15. nss3/nssrwlkt.h 30437 14.4.16. nss3/ocspt.h 30438 14.4.17. nss3/pk11pub.h 30439 14.4.18. nss3/pkcs11t.h 30440 14.4.19. nss3/pkcs7t.h 30441 14.4.20. nss3/secasn1t.h 30442 14.4.21. nss3/seccomon.h 30443 14.4.22. nss3/secdert.h 30444 14.4.23. nss3/secdigt.h 30445 14.4.24. nss3/secmodt.h 30446 14.4.25. nss3/secoidt.h 30447 14.4.26. nss3/secpkcs5.h 30448 14.4.27. nss3/secport.h 30449 30450 14.5. Interfaces for libssl3 30451 30452 14.5.1. NSS SSL 30453 30454 14.6. Data Definitions for libssl3 30455 30456 14.6.1. nss3/ecl-exp.h 30457 14.6.2. nss3/ssl.h 30458 14.6.3. nss3/sslerr.h 30459 14.6.4. nss3/sslproto.h 30460 14.6.5. nss3/sslt.h 30461 __________________________________________________________ 30462 30463 Chapter 14. Libraries 30464 30465 14.1. Interfaces for libnspr4 30466 30467 Table 14-1 defines the library name and shared object name for 30468 the libnspr4 library 30469 30470 Table 14-1. libnspr4 Definition 30471 Library: libnspr4 30472 SONAME: libnspr4.so 30473 30474 The behavior of the interfaces in this library is specified by 30475 the following specifications: 30476 30477 [NSPR] NSPR Reference 30478 __________________________________________________________ 30479 30480 14.1.1. Netscape Portable Runtime 30481 __________________________________________________________ 30482 30483 14.1.1.1. Interfaces for Netscape Portable Runtime 30484 30485 An LSB conforming implementation shall provide the generic 30486 functions for Netscape Portable Runtime specified in Table 30487 14-2, with the full mandatory functionality as described in the 30488 referenced underlying specification. 30489 30490 Table 14-2. libnspr4 - Netscape Portable Runtime Function 30491 Interfaces 30492 PR_Accept [NSPR] PR_Bind [NSPR] PR_Cleanup [NSPR] 30493 PR_Close [NSPR] PR_Connect [NSPR] PR_CreateIOLayerStub [NSPR] 30494 PR_EnumerateAddrInfo [NSPR] PR_FreeAddrInfo [NSPR] 30495 PR_GetAddrInfoByName [NSPR] 30496 PR_GetDefaultIOMethods [NSPR] PR_GetError [NSPR] 30497 PR_GetLayersIdentity [NSPR] 30498 PR_GetSocketOption [NSPR] PR_GetUniqueIdentity [NSPR] 30499 PR_ImportTCPSocket [NSPR] 30500 PR_Interrupt [NSPR] PR_Listen [NSPR] PR_MillisecondsToInterval 30501 [NSPR] 30502 PR_NetAddrToString [NSPR] PR_Now [NSPR] PR_OpenTCPSocket [NSPR] 30503 PR_OpenUDPSocket [NSPR] PR_Poll [NSPR] PR_PopIOLayer [NSPR] 30504 PR_PushIOLayer [NSPR] PR_Read [NSPR] PR_Recv [NSPR] 30505 PR_RecvFrom [NSPR] PR_SecondsToInterval [NSPR] PR_Send [NSPR] 30506 PR_SendTo [NSPR] PR_SetError [NSPR] PR_SetSocketOption [NSPR] 30507 PR_Shutdown [NSPR] PR_StringToNetAddr [NSPR] PR_Write [NSPR] 30508 __________________________________________________________ 30509 30510 14.2. Data Definitions for libnspr4 30511 30512 This section defines global identifiers and their values that 30513 are associated with interfaces contained in libnspr4. These 30514 definitions are organized into groups that correspond to system 30515 headers. This convention is used as a convenience for the 30516 reader, and does not imply the existence of these headers, or 30517 their content. Where an interface is defined as requiring a 30518 particular system header file all of the data definitions for 30519 that system header file presented here shall be in effect. 30520 30521 This section gives data definitions to promote binary 30522 application portability, not to repeat source interface 30523 definitions available elsewhere. System providers and 30524 application developers should use this ABI to supplement - not 30525 to replace - source interface definition specifications. 30526 30527 This specification uses the ISO C (1999) C Language as the 30528 reference programming language, and data definitions are 30529 specified in ISO C format. The C language is used here as a 30530 convenient notation. Using a C language description of these 30531 data objects does not preclude their use by other programming 30532 languages. 30533 __________________________________________________________ 30534 30535 14.2.1. nspr4/nspr.h 30536 30537 #define nspr_h___ 30538 __________________________________________________________ 30539 30540 14.2.2. nspr4/plarena.h 30541 30542 #define plarena_h___ 30543 30544 typedef struct PLArenaPool { 30545 struct PLArena first; 30546 struct PLArena *current; 30547 PRUint32 arenasize; 30548 PRUword mask; 30549 } PLArenaPool; 30550 struct PLArena { 30551 struct PLArena *next; 30552 PRUword base; 30553 PRUword limit; 30554 PRUword avail; 30555 }; 30556 __________________________________________________________ 30557 30558 14.2.3. nspr4/plhash.h 30559 30560 #define plhash_h___ 30561 30562 typedef PRUint32 PLHashNumber; 30563 typedef PRIntn(*PLHashComparator) (const void *, const void *); 30564 typedef struct PLHashAllocOps { 30565 void *(*allocTable) (void *, PRSize); 30566 void (*freeTable) (void *, void *); 30567 struct PLHashEntry *(*allocEntry) (void *, const void *); 30568 void (*freeEntry) (void *, struct PLHashEntry *, PRUintn); 30569 } PLHashAllocOps; 30570 typedef PLHashNumber(*PLHashFunction) (const void *); 30571 struct PLHashEntry { 30572 struct PLHashEntry *next; 30573 PLHashNumber keyHash; 30574 const void *key; 30575 void *value; 30576 }; 30577 struct PLHashTable { 30578 struct PLHashEntry **buckets; 30579 PRUint32 nentries; 30580 PRUint32 shift; 30581 PLHashFunction keyHash; 30582 PLHashComparator keyCompare; 30583 PLHashComparator valueCompare; 30584 const PLHashAllocOps *allocOps; 30585 void *allocPriv; 30586 }; 30587 __________________________________________________________ 30588 30589 14.2.4. nspr4/prclist.h 30590 30591 #define prclist_h___ 30592 30593 typedef struct PRCListStr { 30594 PRCList *next; 30595 PRCList *prev; 30596 } PRCList; 30597 __________________________________________________________ 30598 30599 14.2.5. nspr4/prerror.h 30600 30601 #define prerror_h___ 30602 30603 typedef PRInt32 PRErrorCode; 30604 extern PRErrorCode PR_GetError(void); 30605 extern void PR_SetError(PRErrorCode errorCode, PRInt32 oserr); 30606 __________________________________________________________ 30607 30608 14.2.6. nspr4/prinit.h 30609 30610 #define prinit_h___ 30611 30612 extern PRStatus PR_Cleanup(void); 30613 __________________________________________________________ 30614 30615 14.2.7. nspr4/prinrval.h 30616 30617 #define prinrval_h 30618 30619 typedef PRUint32 PRIntervalTime; 30620 extern PRIntervalTime PR_MillisecondsToInterval(PRUint32 milli); 30621 extern PRIntervalTime PR_SecondsToInterval(PRUint32 seconds); 30622 __________________________________________________________ 30623 30624 14.2.8. nspr4/prio.h 30625 30626 #define prio_h___ 30627 30628 typedef enum PRDescType { 30629 PR_DESC_FILE = 1, 30630 PR_DESC_SOCKET_TCP = 2, 30631 PR_DESC_SOCKET_UDP = 3, 30632 PR_DESC_LAYERED = 4, 30633 PR_DESC_PIPE = 5 30634 } PRDescType; 30635 typedef struct PRIPv6Addr { 30636 union { 30637 PRUint8 _S6_u8[15]; 30638 PRUint16 _S6_u16[7]; 30639 PRUint32 _S6_u32[3]; 30640 PRUint64 _S6_u64[1]; 30641 } _S6_un; 30642 } PRIPv6Addr; 30643 typedef enum PRTransmitFileFlags { 30644 PR_TRANSMITFILE_KEEP_OPEN, 30645 PR_TRANSMITFILE_CLOSE_SOCKET = 1 30646 } PRTransmitFileFlags; 30647 typedef struct PRLinger { 30648 PRBool polarity; 30649 PRIntervalTime linger; 30650 } PRLinger; 30651 typedef struct PRFilePrivate PRFilePrivate; 30652 typedef struct PRFileDesc { 30653 const struct PRIOMethods *methods; 30654 PRFilePrivate *secret; 30655 PRFileDesc *lower; 30656 PRFileDesc *higher; 30657 void (*dtor) (PRFileDesc *); 30658 PRDescIdentity identity; 30659 } PRFileDesc; 30660 typedef union PRNetAddr { 30661 struct { 30662 PRUint16 family; 30663 char data[14]; 30664 } raw; 30665 struct { 30666 PRUint16 family; 30667 PRUint16 port; 30668 PRUint32 ip; 30669 char pad[7]; 30670 } inet; 30671 struct { 30672 PRUint16 family; 30673 PRUint16 port; 30674 PRUint32 flowinfo; 30675 PRIPv6Addr ip; 30676 PRUint32 scope_id; 30677 } ipv6; 30678 struct { 30679 PRUint16 family; 30680 char path[103]; 30681 } local; 30682 } PRNetAddr; 30683 typedef struct PRMcastRequest { 30684 union PRNetAddr mcaddr; 30685 union PRNetAddr ifaddr; 30686 } PRMcastRequest; 30687 typedef struct PRIOVec { 30688 char *iov_base; 30689 int iov_len; 30690 } PRIOVec; 30691 typedef struct PRSocketOptionData { 30692 PRSockOption option; 30693 union { 30694 PRUintn ip_ttl; 30695 PRUintn mcast_ttl; 30696 PRUintn tos; 30697 PRBool non_blocking; 30698 PRBool reuse_addr; 30699 PRBool keep_alive; 30700 PRBool mcast_loopback; 30701 PRBool no_delay; 30702 PRBool broadcast; 30703 PRSize max_segment; 30704 PRSize recv_buffer_size; 30705 PRSize send_buffer_size; 30706 PRLinger linger; 30707 PRMcastRequest add_member; 30708 PRMcastRequest drop_member; 30709 union PRNetAddr mcast_if; 30710 } value; 30711 } PRSocketOptionData; 30712 typedef PRStatus(*PRFsyncFN) (PRFileDesc *); 30713 typedef PRStatus(*PRListenFN) (PRFileDesc *, PRIntn); 30714 typedef enum PRSeekWhence { 30715 PR_SEEK_SET, 30716 PR_SEEK_CUR = 1, 30717 PR_SEEK_END = 2 30718 } PRSeekWhence; 30719 typedef PRInt32(*PRAcceptreadFN) (PRFileDesc *, PRFileDesc * *, 30720 PRNetAddr * *, void *, PRInt32, 30721 PRIntervalTime); 30722 typedef PRStatus(*PRCloseFN) (PRFileDesc *); 30723 typedef PRInt32(*PRTransmitfileFN) (PRFileDesc *, PRFileDesc *, 30724 const void *, PRInt32, 30725 PRTransmitFileFlags, PRIntervalTime); 30726 typedef enum PRSockOption { 30727 PR_SockOpt_Nonblocking, 30728 PR_SockOpt_Linger = 1, 30729 PR_SockOpt_Reuseaddr = 2, 30730 PR_SockOpt_Keepalive = 3, 30731 PR_SockOpt_RecvBufferSize = 4, 30732 PR_SockOpt_SendBufferSize = 5, 30733 PR_SockOpt_IpTimeToLive = 6, 30734 PR_SockOpt_IpTypeOfService = 7, 30735 PR_SockOpt_AddMember = 8, 30736 PR_SockOpt_DropMember = 9, 30737 PR_SockOpt_McastInterface = 10, 30738 PR_SockOpt_McastTimeToLive = 11, 30739 PR_SockOpt_McastLoopback = 12, 30740 PR_SockOpt_NoDelay = 13, 30741 PR_SockOpt_MaxSegment = 14, 30742 PR_SockOpt_Broadcast = 15, 30743 PR_SockOpt_Last = 16 30744 } PRSockOption; 30745 typedef PRFileDesc *(*PRAcceptFN) (PRFileDesc *, PRNetAddr *, 30746 PRIntervalTime); 30747 typedef PRStatus(*PRConnectcontinueFN) (PRFileDesc *, PRInt16); 30748 typedef PRInt32(*PRReadFN) (PRFileDesc *, void *, PRInt32); 30749 typedef struct PRFileInfo64 { 30750 PRFileType type; 30751 PROffset64 size; 30752 PRTime creationTime; 30753 PRTime modifyTime; 30754 } PRFileInfo64; 30755 typedef PRStatus(*PRGetsocketoptionFN) (PRFileDesc *, 30756 PRSocketOptionData *); 30757 typedef PRInt32(*PRSendtoFN) (PRFileDesc *, const void *, PRInt32, PRIntn, 30758 const PRNetAddr *, PRIntervalTime); 30759 typedef PRStatus(*PRGetsocknameFN) (PRFileDesc *, PRNetAddr *); 30760 typedef PRInt32(*PRSendFN) (PRFileDesc *, const void *, PRInt32, PRIntn, 30761 PRIntervalTime); 30762 typedef PROffset32(*PRSeekFN) (PRFileDesc *, PROffset32, PRSeekWhence); 30763 typedef PRInt64(*PRAvailable64FN) (PRFileDesc *); 30764 typedef PRInt32(*PRAvailableFN) (PRFileDesc *); 30765 typedef struct PRFileInfo { 30766 PRFileType type; 30767 PROffset32 size; 30768 PRTime creationTime; 30769 PRTime modifyTime; 30770 } PRFileInfo; 30771 typedef PROffset64(*PRSeek64FN) (PRFileDesc *, PROffset64, PRSeekWhence); 30772 typedef PRStatus(*PRSetsocketoptionFN) (PRFileDesc *, 30773 const PRSocketOptionData *); 30774 typedef PRInt32(*PRRecvFN) (PRFileDesc *, void *, PRInt32, PRIntn, 30775 PRIntervalTime); 30776 typedef struct PRSendFileData { 30777 PRFileDesc *fd; 30778 PRUint32 file_offset; 30779 PRSize file_nbytes; 30780 const void *header; 30781 PRInt32 hlen; 30782 const void *trailer; 30783 PRInt32 tlen; 30784 } PRSendFileData; 30785 typedef PRIntn PRDescIdentity; 30786 typedef PRStatus(*PRConnectFN) (PRFileDesc *, const PRNetAddr *, 30787 PRIntervalTime); 30788 typedef PRInt32(*PRSendfileFN) (PRFileDesc *, PRSendFileData *, 30789 PRTransmitFileFlags, PRIntervalTime); 30790 typedef PRInt32(*PRRecvfromFN) (PRFileDesc *, void *, PRInt32, PRIntn, 30791 PRNetAddr *, PRIntervalTime); 30792 typedef struct PRPollDesc { 30793 PRFileDesc *fd; 30794 PRInt16 in_flags; 30795 PRInt16 out_flags; 30796 } PRPollDesc; 30797 typedef PRInt32(*PRWriteFN) (PRFileDesc *, const void *, PRInt32); 30798 typedef PRStatus(*PRFileInfo64FN) (PRFileDesc *, PRFileInfo64 *); 30799 typedef PRStatus(*PRShutdownFN) (PRFileDesc *, PRIntn); 30800 typedef PRIntn(*PRReservedFN) (PRFileDesc *); 30801 typedef PRStatus(*PRFileInfoFN) (PRFileDesc *, PRFileInfo *); 30802 typedef PRInt32(*PRWritevFN) (PRFileDesc *, const PRIOVec *, PRInt32, 30803 PRIntervalTime); 30804 typedef enum PRFileType { 30805 PR_FILE_FILE = 1, 30806 PR_FILE_DIRECTORY = 2, 30807 PR_FILE_OTHER = 3 30808 } PRFileType; 30809 typedef PRStatus(*PRBindFN) (PRFileDesc *, const PRNetAddr *); 30810 typedef PRInt16(*PRPollFN) (PRFileDesc *, PRInt16, PRInt16 *); 30811 struct PRIOMethods { 30812 PRDescType file_type; 30813 PRCloseFN close; 30814 PRReadFN read; 30815 PRWriteFN write; 30816 PRAvailableFN available; 30817 PRAvailable64FN available64; 30818 PRFsyncFN fsync; 30819 PRSeekFN seek; 30820 PRSeek64FN seek64; 30821 PRFileInfoFN fileInfo; 30822 PRFileInfo64FN fileInfo64; 30823 PRWritevFN writev; 30824 PRConnectFN connect; 30825 PRAcceptFN accept; 30826 PRBindFN bind; 30827 PRListenFN listen; 30828 PRShutdownFN shutdown; 30829 PRRecvFN recv; 30830 PRSendFN send; 30831 PRRecvfromFN recvfrom; 30832 PRSendtoFN sendto; 30833 PRPollFN poll; 30834 PRAcceptreadFN acceptread; 30835 PRTransmitfileFN transmitfile; 30836 PRGetsocknameFN getsockname; 30837 PRGetpeernameFN getpeername; 30838 PRReservedFN reserved_fn_6; 30839 PRReservedFN reserved_fn_5; 30840 PRGetsocketoptionFN getsocketoption; 30841 PRSetsocketoptionFN setsocketoption; 30842 PRSendfileFN sendfile; 30843 PRConnectcontinueFN connectcontinue; 30844 PRReservedFN reserved_fn_3; 30845 PRReservedFN reserved_fn_2; 30846 PRReservedFN reserved_fn_1; 30847 PRReservedFN reserved_fn_0; 30848 }; 30849 typedef PRStatus(*PRGetpeernameFN) (PRFileDesc *, PRNetAddr *); 30850 typedef enum PRShutdownHow { 30851 PR_SHUTDOWN_RCV, 30852 PR_SHUTDOWN_SEND = 1, 30853 PR_SHUTDOWN_BOTH = 2 30854 } PRShutdownHow; 30855 extern PRFileDesc *PR_Accept(PRFileDesc * fd, PRNetAddr * addr, 30856 PRIntervalTime timeout); 30857 extern PRStatus PR_Bind(PRFileDesc * fd, const PRNetAddr * addr); 30858 extern PRStatus PR_Close(PRFileDesc * fd); 30859 extern PRStatus PR_Connect(PRFileDesc * fd, const PRNetAddr * addr, 30860 PRIntervalTime timeout); 30861 extern PRFileDesc *PR_CreateIOLayerStub(PRDescIdentity ident, 30862 const struct PRIOMethods *methods); 30863 extern const struct PRIOMethods *PR_GetDefaultIOMethods(void); 30864 extern PRDescIdentity PR_GetLayersIdentity(PRFileDesc * fd); 30865 extern PRStatus PR_GetSocketOption(PRFileDesc * fd, 30866 PRSocketOptionData * data); 30867 extern PRDescIdentity PR_GetUniqueIdentity(const char *layer_name); 30868 extern PRStatus PR_Listen(PRFileDesc * fd, PRIntn backlog); 30869 extern PRFileDesc *PR_OpenTCPSocket(PRIntn af); 30870 extern PRFileDesc *PR_OpenUDPSocket(PRIntn af); 30871 extern PRInt32 PR_Poll(PRPollDesc * pds, PRIntn npds, 30872 PRIntervalTime timeout); 30873 extern PRFileDesc *PR_PopIOLayer(PRFileDesc * fd_stack, PRDescIdentity id); 30874 extern PRStatus PR_PushIOLayer(PRFileDesc * fd_stack, PRDescIdentity id, 30875 PRFileDesc * layer); 30876 extern PRInt32 PR_Read(PRFileDesc * fd, void *buf, PRInt32 amount); 30877 extern PRInt32 PR_Recv(PRFileDesc * fd, void *buf, PRInt32 amount, 30878 PRIntn flags, PRIntervalTime timeout); 30879 extern PRInt32 PR_RecvFrom(PRFileDesc * fd, void *buf, PRInt32 amount, 30880 PRIntn flags, PRNetAddr * addr, 30881 PRIntervalTime timeout); 30882 extern PRInt32 PR_Send(PRFileDesc * fd, const void *buf, PRInt32 amount, 30883 PRIntn flags, PRIntervalTime timeout); 30884 extern PRInt32 PR_SendTo(PRFileDesc * fd, const void *buf, PRInt32 amount, 30885 PRIntn flags, const PRNetAddr * addr, 30886 PRIntervalTime timeout); 30887 extern PRStatus PR_SetSocketOption(PRFileDesc * fd, 30888 const PRSocketOptionData * data); 30889 extern PRStatus PR_Shutdown(PRFileDesc * fd, PRShutdownHow how); 30890 extern PRInt32 PR_Write(PRFileDesc * fd, const void *buf, PRInt32 amount); 30891 __________________________________________________________ 30892 30893 14.2.9. nspr4/private/pprio.h 30894 30895 #define pprio_h___ 30896 30897 typedef PRInt32 PROsfd; 30898 extern PRFileDesc *PR_ImportTCPSocket(PROsfd osfd); 30899 __________________________________________________________ 30900 30901 14.2.10. nspr4/prlock.h 30902 30903 #define prlock_h___ 30904 30905 typedef struct PRLock PRLock; 30906 __________________________________________________________ 30907 30908 14.2.11. nspr4/prmon.h 30909 30910 #define prmon_h___ 30911 30912 typedef struct PRMonitor PRMonitor; 30913 __________________________________________________________ 30914 30915 14.2.12. nspr4/prnetdb.h 30916 30917 #define prnetdb_h___ 30918 30919 typedef struct PRHostEnt { 30920 char *h_name; 30921 char **h_aliases; 30922 PRInt32 h_addrtype; 30923 PRInt32 h_length; 30924 char **h_addr_list; 30925 } PRHostEnt; 30926 typedef struct PRAddrInfo PRAddrInfo; 30927 extern void *PR_EnumerateAddrInfo(void *enumPtr, 30928 const PRAddrInfo * addrInfo, 30929 PRUint16 port, PRNetAddr * result); 30930 extern void PR_FreeAddrInfo(PRAddrInfo * addrInfo); 30931 extern PRAddrInfo *PR_GetAddrInfoByName(const char *hostname, PRUint16 af, 30932 PRIntn flags); 30933 extern PRStatus PR_NetAddrToString(const PRNetAddr * addr, char *string, 30934 PRUint32 size); 30935 extern PRStatus PR_StringToNetAddr(const char *string, PRNetAddr * addr); 30936 __________________________________________________________ 30937 30938 14.2.13. nspr4/prthread.h 30939 30940 #define prthread_h___ 30941 30942 typedef struct PRThread PRThread; 30943 extern PRStatus PR_Interrupt(PRThread * thread); 30944 __________________________________________________________ 30945 30946 14.2.14. nspr4/prtime.h 30947 30948 #define prtime_h___ 30949 30950 typedef PRInt64 PRTime; 30951 extern PRTime PR_Now(void); 30952 __________________________________________________________ 30953 30954 14.2.15. nspr4/prtypes.h 30955 30956 #define prtypes_h___ 30957 30958 typedef int PRInt32; 30959 typedef unsigned long int PRUword; 30960 typedef int PRIntn; 30961 typedef unsigned long int PRUint64; 30962 typedef unsigned char PRUint8; 30963 typedef short int PRInt16; 30964 typedef long int PRInt64; 30965 typedef PRIntn PRBool; 30966 typedef unsigned short PRUint16; 30967 typedef unsigned int PRUint32; 30968 typedef size_t PRSize; 30969 typedef unsigned int PRUintn; 30970 typedef PRInt64 PROffset64; 30971 typedef PRInt32 PROffset32; 30972 typedef enum { 30973 PR_FAILURE = -1, 30974 PR_SUCCESS 30975 } PRStatus; 30976 __________________________________________________________ 30977 30978 14.3. Interfaces for libnss3 30979 30980 Table 14-3 defines the library name and shared object name for 30981 the libnss3 library 30982 30983 Table 14-3. libnss3 Definition 30984 Library: libnss3 30985 SONAME: libnss3.so 30986 30987 The behavior of the interfaces in this library is specified by 30988 the following specifications: 30989 30990 [NSS SSL] Mozilla's NSS SSL Reference 30991 __________________________________________________________ 30992 30993 14.3.1. NSS Utility 30994 __________________________________________________________ 30995 30996 14.3.1.1. Interfaces for NSS Utility 30997 30998 An LSB conforming implementation shall provide the generic 30999 functions for NSS Utility specified in Table 14-4, with the 31000 full mandatory functionality as described in the referenced 31001 underlying specification. 31002 31003 Table 14-4. libnss3 - NSS Utility Function Interfaces 31004 CERT_CheckCertValidTimes(NSS_3.2) [NSS SSL] 31005 CERT_DestroyCertificate(NSS_3.2) [NSS SSL] 31006 CERT_DupCertificate(NSS_3.2) [NSS SSL] 31007 CERT_FreeNicknames(NSS_3.2) [NSS SSL] 31008 CERT_GetCertNicknames(NSS_3.2) [NSS SSL] 31009 CERT_GetDefaultCertDB(NSS_3.2) [NSS SSL] 31010 CERT_VerifyCertName(NSS_3.2) [NSS SSL] 31011 CERT_VerifyCertNow(NSS_3.2) [NSS SSL] NSS_Init(NSS_3.2) [NSS 31012 SSL] 31013 NSS_InitReadWrite(NSS_3.2) [NSS SSL] NSS_NoDB_Init(NSS_3.2) 31014 [NSS SSL] NSS_Shutdown(NSS_3.2) [NSS SSL] 31015 PK11_FindCertFromNickname(NSS_3.2) [NSS SSL] 31016 PK11_FindKeyByAnyCert(NSS_3.2) [NSS SSL] 31017 PK11_GetSlotName(NSS_3.2) [NSS SSL] 31018 PK11_GetTokenName(NSS_3.2) [NSS SSL] PK11_IsHW(NSS_3.2) [NSS 31019 SSL] PK11_IsPresent(NSS_3.2) [NSS SSL] 31020 PK11_IsReadOnly(NSS_3.2) [NSS SSL] 31021 PK11_SetPasswordFunc(NSS_3.2) [NSS SSL] 31022 SECKEY_DestroyPrivateKey(NSS_3.2) [NSS SSL] 31023 __________________________________________________________ 31024 31025 14.4. Data Definitions for libnss3 31026 31027 This section defines global identifiers and their values that 31028 are associated with interfaces contained in libnss3. These 31029 definitions are organized into groups that correspond to system 31030 headers. This convention is used as a convenience for the 31031 reader, and does not imply the existence of these headers, or 31032 their content. Where an interface is defined as requiring a 31033 particular system header file all of the data definitions for 31034 that system header file presented here shall be in effect. 31035 31036 This section gives data definitions to promote binary 31037 application portability, not to repeat source interface 31038 definitions available elsewhere. System providers and 31039 application developers should use this ABI to supplement - not 31040 to replace - source interface definition specifications. 31041 31042 This specification uses the ISO C (1999) C Language as the 31043 reference programming language, and data definitions are 31044 specified in ISO C format. The C language is used here as a 31045 convenient notation. Using a C language description of these 31046 data objects does not preclude their use by other programming 31047 languages. 31048 __________________________________________________________ 31049 31050 14.4.1. nss3/blapit.h 31051 31052 #define _BLAPIT_H_ 31053 #define PQG_PBITS_TO_INDEX(bits) \ 31054 (((bits) < 512 || (bits) > 1024 || (bits) % 64) ? -1 : \ 31055 (int)((bits)-512)/64) 31056 #define PQG_INDEX_TO_PBITS(j) \ 31057 (((unsigned)(j) > 8) ? -1 : (512 + 64 * (j))) 31058 #define NSS_AES 0 31059 #define NSS_DES 0 31060 #define NSS_RC2 0 31061 #define NSS_RC5 0 31062 #define NSS_AES_CBC 1 31063 #define NSS_DES_CBC 1 31064 #define NSS_RC2_CBC 1 31065 #define NSS_RC5_CBC 1 31066 #define DSA_MAX_P_BITS 1024 31067 #define DH_MIN_P_BITS 128 31068 #define RSA_MIN_MODULUS_BITS 128 31069 #define AES_BLOCK_SIZE 16 31070 #define DSA_Q_BITS 160 31071 #define NSS_DES_EDE3 2 31072 #define DSA_SUBPRIME_LEN 20 31073 #define NSS_FREEBL_DEFAULT_CHUNKSIZE 2048 31074 #define DH_MAX_P_BITS 2236 31075 #define NSS_DES_EDE3_CBC 3 31076 #define DSA_SIGNATURE_LEN 40 31077 #define DSA_MIN_P_BITS 512 31078 #define AES_KEY_WRAP_BLOCK_SIZE 8 31079 #define AES_KEY_WRAP_IV_BYTES 8 31080 #define DES_KEY_LENGTH 8 31081 31082 typedef struct PQGParamsStr { 31083 PLArenaPool *arena; 31084 SECItem prime; 31085 SECItem subPrime; 31086 SECItem base; 31087 } PQGParams; 31088 typedef struct PQGVerifyStr { 31089 PLArenaPool *arena; 31090 unsigned int counter; 31091 SECItem seed; 31092 SECItem h; 31093 } PQGVerify; 31094 __________________________________________________________ 31095 31096 14.4.2. nss3/cert.h 31097 31098 #define _CERT_H_ 31099 31100 extern SECCertTimeValidity CERT_CheckCertValidTimes(CERTCertificate * cert, 31101 PRTime t, 31102 PRBool allowOverride); 31103 extern void CERT_DestroyCertificate(CERTCertificate * cert); 31104 extern CERTCertificate *CERT_DupCertificate(CERTCertificate * c); 31105 extern void CERT_FreeNicknames(CERTCertNicknames * nicknames); 31106 extern CERTCertNicknames *CERT_GetCertNicknames(CERTCertDBHandle * handle, 31107 int what, void *wincx); 31108 extern CERTCertDBHandle *CERT_GetDefaultCertDB(void); 31109 extern SECStatus CERT_VerifyCertName(CERTCertificate * cert, 31110 const char *hostname); 31111 extern SECStatus CERT_VerifyCertNow(CERTCertDBHandle * handle, 31112 CERTCertificate * cert, 31113 PRBool checkSig, 31114 SECCertUsage certUsage, void *wincx); 31115 __________________________________________________________ 31116 31117 14.4.3. nss3/certt.h 31118 31119 #define _CERTT_H_ 31120 #define NS_CERT_TYPE_CA \ 31121 ( NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA | \ 31122 NS_CERT_TYPE_OBJECT_SIGNING_CA | EXT_KEY_USAGE_STATUS_RESPONDER) 31123 #define NS_CERT_TYPE_APP \ 31124 ( NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER | \ 31125 NS_CERT_TYPE_EMAIL | NS_CERT_TYPE_OBJECT_SIGNING ) 31126 #define SEC_GET_TRUST_FLAGS(trust,type) \ 31127 (((type)==trustSSL)?((trust)->sslFlags): \ 31128 (((type)==trustEmail)?((trust)->emailFlags): \ 31129 (((type)==trustObjectSigning)?((trust)->objectSigningFlags):0))) 31130 #define KU_ALL \ 31131 (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \ 31132 KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN | \ 31133 KU_CRL_SIGN) 31134 #define CERT_LIST_END(n,l) (((void *)n) == ((void *)&l->list)) 31135 #define CERT_LIST_NEXT(n) ((CERTCertListNode *)n->links.next) 31136 #define CERT_LIST_HEAD(l) ((CERTCertListNode *)PR_LIST_HEAD(&l->list)) 31137 #define certificateUsageSSLClient (0x0001) 31138 #define certificateUsageSSLServer (0x0002) 31139 #define certificateUsageSSLServerWithStepUp (0x0004) 31140 #define certificateUsageSSLCA (0x0008) 31141 #define certificateUsageEmailSigner (0x0010) 31142 #define certificateUsageEmailRecipient (0x0020) 31143 #define certificateUsageObjectSigner (0x0040) 31144 #define certificateUsageUserCertImport (0x0080) 31145 #define NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) 31146 #define certificateUsageVerifyCA (0x0100) 31147 #define KU_CRL_SIGN (0x02) 31148 #define NS_CERT_TYPE_EMAIL_CA (0x02) 31149 #define RF_CERTIFICATE_HOLD (0x02) 31150 #define certificateUsageProtectedObjectSigner (0x0200) 31151 #define KU_KEY_CERT_SIGN (0x04) 31152 #define NS_CERT_TYPE_SSL_CA (0x04) 31153 #define RF_CESSATION_OF_OPERATION (0x04) 31154 #define certificateUsageStatusResponder (0x0400) 31155 #define KU_KEY_AGREEMENT (0x08) 31156 #define NS_CERT_TYPE_RESERVED (0x08) 31157 #define RF_SUPERSEDED (0x08) 31158 #define certificateUsageAnyCA (0x0800) 31159 #define KU_DATA_ENCIPHERMENT (0x10) 31160 #define NS_CERT_TYPE_OBJECT_SIGNING (0x10) 31161 #define RF_AFFILIATION_CHANGED (0x10) 31162 #define KU_KEY_ENCIPHERMENT (0x20) 31163 #define NS_CERT_TYPE_EMAIL (0x20) 31164 #define RF_CA_COMPROMISE (0x20) 31165 #define KU_NON_REPUDIATION (0x40) 31166 #define NS_CERT_TYPE_SSL_SERVER (0x40) 31167 #define RF_KEY_COMPROMISE (0x40) 31168 #define EXT_KEY_USAGE_STATUS_RESPONDER (0x4000) 31169 #define KU_KEY_AGREEMENT_OR_ENCIPHERMENT (0x4000) 31170 #define KU_DIGITAL_SIGNATURE (0x80) 31171 #define NS_CERT_TYPE_SSL_CLIENT (0x80) 31172 #define RF_UNUSED (0x80) 31173 #define EXT_KEY_USAGE_TIME_STAMP (0x8000) 31174 #define KU_NS_GOVT_APPROVED (0x8000) 31175 #define CERT_UNLIMITED_PATH_CONSTRAINT -2 31176 #define SEC_CERTIFICATE_REQUEST_VERSION 0 31177 #define SEC_CERTIFICATE_VERSION_1 0 31178 #define SEC_CRL_VERSION_1 0 31179 #define SEC_CERTIFICATE_VERSION_2 1 31180 #define SEC_CERT_CLASS_CA 1 31181 #define SEC_CERT_NICKNAMES_ALL 1 31182 #define SEC_CRL_VERSION_2 1 31183 #define SEC_CERTIFICATE_VERSION_3 2 31184 #define SEC_CERT_CLASS_SERVER 2 31185 #define SEC_CERT_NICKNAMES_USER 2 31186 #define CERT_MAX_CERT_CHAIN 20 31187 #define SEC_CERT_CLASS_USER 3 31188 #define SEC_CERT_NICKNAMES_SERVER 3 31189 #define SEC_CERT_CLASS_EMAIL 4 31190 #define SEC_CERT_NICKNAMES_CA 4 31191 #define certificateUsageHighest certificateUsageAnyCA 31192 #define CERT_LIST_EMPTY(l) CERT_LIST_END(CERT_LIST_HEAD(l), l) 31193 31194 typedef struct CERTAVAStr { 31195 SECItem type; 31196 SECItem value; 31197 } CERTAVA; 31198 typedef struct CERTAttributeStr { 31199 SECItem attrType; 31200 SECItem **attrValue; 31201 } CERTAttribute; 31202 typedef struct CERTAuthInfoAccessStr { 31203 SECItem method; 31204 SECItem derLocation; 31205 CERTGeneralName *location; 31206 } CERTAuthInfoAccess; 31207 typedef struct CERTAuthKeyIDStr { 31208 SECItem keyID; 31209 CERTGeneralName *authCertIssuer; 31210 SECItem authCertSerialNumber; 31211 SECItem **DERAuthCertIssuer; 31212 } CERTAuthKeyID; 31213 typedef struct CERTBasicConstraintsStr { 31214 PRBool isCA; 31215 int pathLenConstraint; 31216 } CERTBasicConstraints; 31217 typedef struct NSSTrustDomainStr CERTCertDBHandle; 31218 typedef struct CERTCertExtensionStr { 31219 SECItem id; 31220 SECItem critical; 31221 SECItem value; 31222 } CERTCertExtension; 31223 typedef struct CERTCertListStr { 31224 PRCList list; 31225 PLArenaPool *arena; 31226 } CERTCertList; 31227 typedef struct CERTCertListNodeStr { 31228 PRCList links; 31229 CERTCertificate *cert; 31230 void *appData; 31231 } CERTCertListNode; 31232 typedef struct CERTCertNicknamesStr { 31233 PLArenaPool *arena; 31234 void *head; 31235 int numnicknames; 31236 char **nicknames; 31237 int what; 31238 int totallen; 31239 } CERTCertNicknames; 31240 typedef struct CERTCertTrustStr { 31241 unsigned int sslFlags; 31242 unsigned int emailFlags; 31243 unsigned int objectSigningFlags; 31244 } CERTCertTrust; 31245 typedef struct CERTSignedDataStr { 31246 SECItem data; 31247 SECAlgorithmID signatureAlgorithm; 31248 SECItem signature; 31249 } CERTSignedData; 31250 typedef struct CERTCertificateListStr { 31251 SECItem *certs; 31252 int len; 31253 PLArenaPool *arena; 31254 } CERTCertificateList; 31255 typedef struct CERTNameStr { 31256 PLArenaPool *arena; 31257 CERTRDN **rdns; 31258 } CERTName; 31259 typedef struct CERTCrlStr { 31260 PLArenaPool *arena; 31261 SECItem version; 31262 SECAlgorithmID signatureAlg; 31263 SECItem derName; 31264 CERTName name; 31265 SECItem lastUpdate; 31266 SECItem nextUpdate; 31267 CERTCrlEntry **entries; 31268 CERTCertExtension **extensions; 31269 } CERTCrl; 31270 typedef struct CERTCrlDistributionPointsStr { 31271 CRLDistributionPoint **distPoints; 31272 } CERTCrlDistributionPoints; 31273 typedef struct CERTCrlEntryStr { 31274 SECItem serialNumber; 31275 SECItem revocationDate; 31276 CERTCertExtension **extensions; 31277 } CERTCrlEntry; 31278 typedef struct CERTCrlHeadNodeStr { 31279 PLArenaPool *arena; 31280 CERTCertDBHandle *dbhandle; 31281 CERTCrlNode *first; 31282 CERTCrlNode *last; 31283 } CERTCrlHeadNode; 31284 typedef struct CERTCrlNodeStr { 31285 CERTCrlNode *next; 31286 int type; 31287 CERTSignedCrl *crl; 31288 } CERTCrlNode; 31289 typedef struct CERTDistNamesStr { 31290 PLArenaPool *arena; 31291 int nnames; 31292 SECItem *names; 31293 void *head; 31294 } CERTDistNames; 31295 typedef struct OtherNameStr { 31296 SECItem name; 31297 SECItem oid; 31298 } OtherName; 31299 typedef struct CERTGeneralNameListStr { 31300 PLArenaPool *arena; 31301 CERTGeneralName *name; 31302 int refCount; 31303 int len; 31304 PRLock *lock; 31305 } CERTGeneralNameList; 31306 typedef struct CERTIssuerAndSNStr { 31307 SECItem derIssuer; 31308 CERTName issuer; 31309 SECItem serialNumber; 31310 } CERTIssuerAndSN; 31311 typedef struct CERTSubjectPublicKeyInfoStr { 31312 PLArenaPool *arena; 31313 SECAlgorithmID algorithm; 31314 SECItem subjectPublicKey; 31315 } CERTSubjectPublicKeyInfo; 31316 typedef struct CERTGeneralNameStr { 31317 CERTGeneralNameType type; 31318 union { 31319 CERTName directoryName; 31320 OtherName OthName; 31321 SECItem other; 31322 } name; 31323 SECItem derDirectoryName; 31324 PRCList l; 31325 } CERTGeneralName; 31326 typedef struct CERTNameConstraintsStr { 31327 CERTNameConstraint *permited; 31328 CERTNameConstraint *excluded; 31329 SECItem **DERPermited; 31330 SECItem **DERExcluded; 31331 } CERTNameConstraints; 31332 typedef struct CERTOKDomainNameStr { 31333 CERTOKDomainName *next; 31334 char name[1]; 31335 } CERTOKDomainName; 31336 typedef struct CERTPrivKeyUsagePeriodStr { 31337 SECItem notBefore; 31338 SECItem notAfter; 31339 PLArenaPool *arena; 31340 } CERTPrivKeyUsagePeriod; 31341 typedef struct CERTRDNStr { 31342 CERTAVA **avas; 31343 } CERTRDN; 31344 typedef struct CERTSignedCrlStr { 31345 PLArenaPool *arena; 31346 CERTCrl crl; 31347 void *reserved1; 31348 PRBool reserved2; 31349 PRBool isperm; 31350 PRBool istemp; 31351 int referenceCount; 31352 CERTCertDBHandle *dbhandle; 31353 CERTSignedData signatureWrap; 31354 char *url; 31355 SECItem *derCrl; 31356 PK11SlotInfo *slot; 31357 CK_OBJECT_HANDLE pkcs11ID; 31358 void *opaque; 31359 } CERTSignedCrl; 31360 typedef struct CERTValidityStr { 31361 PLArenaPool *arena; 31362 SECItem notBefore; 31363 SECItem notAfter; 31364 } CERTValidity; 31365 typedef struct CERTStatusConfigStr { 31366 CERTStatusChecker statusChecker; 31367 CERTStatusDestroy statusDestroy; 31368 void *statusContext; 31369 } CERTStatusConfig; 31370 typedef struct CERTSubjectListStr { 31371 PLArenaPool *arena; 31372 int ncerts; 31373 char *emailAddr; 31374 CERTSubjectNode *head; 31375 CERTSubjectNode *tail; 31376 void *entry; 31377 } CERTSubjectList; 31378 typedef struct CERTSubjectNodeStr { 31379 struct CERTSubjectNodeStr *next; 31380 struct CERTSubjectNodeStr *prev; 31381 SECItem certKey; 31382 SECItem keyID; 31383 } CERTSubjectNode; 31384 typedef struct CERTCertificateRequestStr { 31385 PLArenaPool *arena; 31386 SECItem version; 31387 CERTName subject; 31388 CERTSubjectPublicKeyInfo subjectPublicKeyInfo; 31389 CERTAttribute **attributes; 31390 } CERTCertificateRequest; 31391 typedef struct CERTCertificateStr { 31392 PLArenaPool *arena; 31393 char *subjectName; 31394 char *issuerName; 31395 CERTSignedData signatureWrap; 31396 SECItem derCert; 31397 SECItem derIssuer; 31398 SECItem derSubject; 31399 SECItem derPublicKey; 31400 SECItem certKey; 31401 SECItem version; 31402 SECItem serialNumber; 31403 SECAlgorithmID signature; 31404 CERTName issuer; 31405 CERTValidity validity; 31406 CERTName subject; 31407 CERTSubjectPublicKeyInfo subjectPublicKeyInfo; 31408 SECItem issuerID; 31409 SECItem subjectID; 31410 CERTCertExtension **extensions; 31411 char *emailAddr; 31412 CERTCertDBHandle *dbhandle; 31413 SECItem subjectKeyID; 31414 PRBool keyIDGenerated; 31415 unsigned int keyUsage; 31416 unsigned int rawKeyUsage; 31417 PRBool keyUsagePresent; 31418 PRUint32 nsCertType; 31419 PRBool keepSession; 31420 PRBool timeOK; 31421 CERTOKDomainName *domainOK; 31422 PRBool isperm; 31423 PRBool istemp; 31424 char *nickname; 31425 char *dbnickname; 31426 struct NSSCertificateStr *nssCertificate; 31427 CERTCertTrust *trust; 31428 int referenceCount; 31429 CERTSubjectList *subjectList; 31430 CERTAuthKeyID *authKeyID; 31431 PRBool isRoot; 31432 union { 31433 void *apointer; 31434 struct { 31435 unsigned int hasUnsupportedCriticalExt; 31436 } bits; 31437 } options; 31438 int series; 31439 PK11SlotInfo *slot; 31440 CK_OBJECT_HANDLE pkcs11ID; 31441 PRBool ownSlot; 31442 } CERTCertificate; 31443 typedef struct CERTVerifyLogStr { 31444 PLArenaPool *arena; 31445 unsigned int count; 31446 struct CERTVerifyLogNodeStr *head; 31447 struct CERTVerifyLogNodeStr *tail; 31448 } CERTVerifyLog; 31449 typedef struct CRLDistributionPointStr { 31450 DistributionPointTypes distPointType; 31451 union { 31452 CERTGeneralName *fullName; 31453 CERTRDN relativeName; 31454 } distPoint; 31455 SECItem reasons; 31456 CERTGeneralName *crlIssuer; 31457 SECItem derDistPoint; 31458 SECItem derRelativeName; 31459 SECItem **derCrlIssuer; 31460 SECItem **derFullName; 31461 SECItem bitsmap; 31462 } CRLDistributionPoint; 31463 typedef enum SECCertUsageEnum { 31464 certUsageSSLClient, 31465 certUsageSSLServer = 1, 31466 certUsageSSLServerWithStepUp = 2, 31467 certUsageSSLCA = 3, 31468 certUsageEmailSigner = 4, 31469 certUsageEmailRecipient = 5, 31470 certUsageObjectSigner = 6, 31471 certUsageUserCertImport = 7, 31472 certUsageVerifyCA = 8, 31473 certUsageProtectedObjectSigner = 9, 31474 certUsageStatusResponder = 10, 31475 certUsageAnyCA = 11 31476 } SECCertUsage; 31477 typedef PRInt64 SECCertificateUsage; 31478 typedef enum SECCertTimeValidityEnum { 31479 secCertTimeValid, 31480 secCertTimeExpired = 1, 31481 secCertTimeNotValidYet = 2, 31482 secCertTimeUndetermined = 3 31483 } SECCertTimeValidity; 31484 typedef enum CERTCompareValidityStatusEnum { 31485 certValidityUndetermined, 31486 certValidityChooseB = 1, 31487 certValidityEqual = 2, 31488 certValidityChooseA = 3 31489 } CERTCompareValidityStatus; 31490 typedef enum CERTGeneralNameTypeEnum { 31491 certOtherName = 1, 31492 certRFC822Name = 2, 31493 certDNSName = 3, 31494 certX400Address = 4, 31495 certDirectoryName = 5, 31496 certEDIPartyName = 6, 31497 certURI = 7, 31498 certIPAddress = 8, 31499 certRegisterID = 9 31500 } CERTGeneralNameType; 31501 typedef struct CERTNameConstraintStr { 31502 CERTGeneralName name; 31503 SECItem DERName; 31504 SECItem min; 31505 SECItem max; 31506 PRCList l; 31507 } CERTNameConstraint; 31508 typedef enum DistributionPointTypesEnum { 31509 generalName = 1, 31510 relativeDistinguishedName = 2 31511 } DistributionPointTypes; 31512 struct CERTVerifyLogNodeStr { 31513 CERTCertificate *cert; 31514 long int error; 31515 unsigned int depth; 31516 void *arg; 31517 struct CERTVerifyLogNodeStr *next; 31518 struct CERTVerifyLogNodeStr *prev; 31519 }; 31520 typedef SECStatus(*CERTStatusChecker) (CERTCertDBHandle *, 31521 CERTCertificate *, PRInt64, void*); 31522 typedef SECStatus(*CERTStatusDestroy) (CERTStatusConfig *); 31523 typedef struct { 31524 SECOidTag oid; 31525 SECItem qualifierID; 31526 SECItem qualifierValue; 31527 } CERTPolicyQualifier; 31528 typedef struct { 31529 SECOidTag oid; 31530 SECItem policyID; 31531 CERTPolicyQualifier **policyQualifiers; 31532 } CERTPolicyInfo; 31533 typedef struct { 31534 PLArenaPool *arena; 31535 CERTPolicyInfo **policyInfos; 31536 } CERTCertificatePolicies; 31537 typedef struct { 31538 SECItem organization; 31539 SECItem **noticeNumbers; 31540 } CERTNoticeReference; 31541 typedef struct { 31542 PLArenaPool *arena; 31543 CERTNoticeReference noticeReference; 31544 SECItem derNoticeReference; 31545 SECItem displayText; 31546 } CERTUserNotice; 31547 typedef struct { 31548 PLArenaPool *arena; 31549 SECItem **oids; 31550 } CERTOidSequence; 31551 __________________________________________________________ 31552 31553 14.4.4. nss3/cmsreclist.h 31554 31555 #define _CMSRECLIST_H 31556 31557 typedef struct NSSCMSRecipientStr { 31558 int riIndex; 31559 int subIndex; 31560 enum { 31561 RLIssuerSN, 31562 RLSubjKeyID = 1 31563 } kind; 31564 union { 31565 CERTIssuerAndSN *issuerAndSN; 31566 SECItem *subjectKeyID; 31567 } id; 31568 CERTCertificate *cert; 31569 SECKEYPrivateKey *privkey; 31570 PK11SlotInfo *slot; 31571 } NSSCMSRecipient; 31572 __________________________________________________________ 31573 31574 14.4.5. nss3/cryptoht.h 31575 31576 #define _CRYPTOHT_H_ 31577 31578 typedef struct SGNContextStr SGNContext; 31579 typedef struct VFYContextStr VFYContext; 31580 __________________________________________________________ 31581 31582 14.4.6. nss3/hasht.h 31583 31584 #define _HASHT_H_ 31585 #define MD2_LENGTH 16 31586 #define MD5_LENGTH 16 31587 #define SHA1_LENGTH 20 31588 #define SHA256_LENGTH 32 31589 #define SHA384_LENGTH 48 31590 #define SHA512_LENGTH 64 31591 #define HASH_LENGTH_MAX SHA512_LENGTH 31592 31593 typedef struct SECHashObjectStr { 31594 unsigned int length; 31595 void *(*create) (void); 31596 void *(*clone) (void *); 31597 void (*destroy) (void *, PRBool); 31598 void (*begin) (void *); 31599 void (*update) (void *, const unsigned char *, unsigned int); 31600 void (*end) (void *, unsigned char *, unsigned int *, unsigned int); 31601 unsigned int blocklength; 31602 HASH_HashType type; 31603 } SECHashObject; 31604 typedef struct HASHContextStr { 31605 const struct SECHashObjectStr *hashobj; 31606 void *hash_context; 31607 } HASHContext; 31608 typedef enum { 31609 HASH_AlgNULL, 31610 HASH_AlgMD2 = 1, 31611 HASH_AlgMD5 = 2, 31612 HASH_AlgSHA1 = 3, 31613 HASH_AlgSHA256 = 4, 31614 HASH_AlgSHA384 = 5, 31615 HASH_AlgSHA512 = 6, 31616 HASH_AlgTOTAL = 7 31617 } HASH_HashType; 31618 __________________________________________________________ 31619 31620 14.4.7. nss3/key.h 31621 31622 #define _KEY_H_ 31623 __________________________________________________________ 31624 31625 14.4.8. nss3/keyhi.h 31626 31627 #define _KEYHI_H_ 31628 31629 extern void SECKEY_DestroyPrivateKey(SECKEYPrivateKey * key); 31630 __________________________________________________________ 31631 31632 14.4.9. nss3/keyt.h 31633 31634 #define _KEYT_H_ 31635 __________________________________________________________ 31636 31637 14.4.10. nss3/keythi.h 31638 31639 #define _KEYTHI_H_ 31640 31641 typedef enum { 31642 nullKey, 31643 rsaKey = 1, 31644 dsaKey = 2, 31645 fortezzaKey = 3, 31646 dhKey = 4, 31647 keaKey = 5, 31648 ecKey = 6 31649 } KeyType; 31650 typedef struct SECKEYRSAPublicKeyStr { 31651 PLArenaPool *arena; 31652 SECItem modulus; 31653 SECItem publicExponent; 31654 } SECKEYRSAPublicKey; 31655 typedef struct SECKEYPQGParamsStr { 31656 PLArenaPool *arena; 31657 SECItem prime; 31658 SECItem subPrime; 31659 SECItem base; 31660 } SECKEYPQGParams; 31661 typedef struct SECKEYDSAPublicKeyStr { 31662 SECKEYPQGParams params; 31663 SECItem publicValue; 31664 } SECKEYDSAPublicKey; 31665 typedef struct SECKEYDHParamsStr { 31666 PLArenaPool *arena; 31667 SECItem prime; 31668 SECItem base; 31669 } SECKEYDHParams; 31670 typedef struct SECKEYDHPublicKeyStr { 31671 PLArenaPool *arena; 31672 SECItem prime; 31673 SECItem base; 31674 SECItem publicValue; 31675 } SECKEYDHPublicKey; 31676 typedef SECItem SECKEYECParams; 31677 typedef struct SECKEYECPublicKeyStr { 31678 SECKEYECParams DEREncodedParams; 31679 int size; 31680 SECItem publicValue; 31681 } SECKEYECPublicKey; 31682 typedef struct SECKEYFortezzaPublicKeyStr { 31683 int KEAversion; 31684 int DSSversion; 31685 unsigned char KMID[8]; 31686 SECItem clearance; 31687 SECItem KEApriviledge; 31688 SECItem DSSpriviledge; 31689 SECItem KEAKey; 31690 SECItem DSSKey; 31691 SECKEYPQGParams params; 31692 SECKEYPQGParams keaParams; 31693 } SECKEYFortezzaPublicKey; 31694 typedef struct SECKEYKEAParamsStr { 31695 PLArenaPool *arena; 31696 SECItem hash; 31697 } SECKEYKEAParams; 31698 typedef struct SECKEYKEAPublicKeyStr { 31699 SECKEYKEAParams params; 31700 SECItem publicValue; 31701 } SECKEYKEAPublicKey; 31702 typedef struct SECKEYPublicKeyStr { 31703 PLArenaPool *arena; 31704 KeyType keyType; 31705 PK11SlotInfo *pkcs11Slot; 31706 CK_OBJECT_HANDLE pkcs11ID; 31707 union { 31708 SECKEYRSAPublicKey rsa; 31709 SECKEYDSAPublicKey dsa; 31710 SECKEYDHPublicKey dh; 31711 SECKEYKEAPublicKey kea; 31712 SECKEYFortezzaPublicKey fortezza; 31713 SECKEYECPublicKey ec; 31714 } u; 31715 } SECKEYPublicKey; 31716 typedef struct SECKEYPrivateKeyStr { 31717 PLArenaPool *arena; 31718 KeyType keyType; 31719 PK11SlotInfo *pkcs11Slot; 31720 CK_OBJECT_HANDLE pkcs11ID; 31721 PRBool pkcs11IsTemp; 31722 void *wincx; 31723 PRUint32 staticflags; 31724 } SECKEYPrivateKey; 31725 typedef struct { 31726 PRCList links; 31727 SECKEYPrivateKey *key; 31728 } SECKEYPrivateKeyListNode; 31729 typedef struct { 31730 PRCList list; 31731 PLArenaPool *arena; 31732 } SECKEYPrivateKeyList; 31733 typedef struct { 31734 PRCList list; 31735 PLArenaPool *arena; 31736 } SECKEYPublicKeyList; 31737 __________________________________________________________ 31738 31739 14.4.11. nss3/nss.h 31740 31741 #define __nss_h_ 31742 #define NSS_INIT_READONLY 0x1 31743 #define NSS_INIT_NOROOTINIT 0x10 31744 #define NSS_INIT_NOPK11FINALIZE 0x100 31745 #define NSS_INIT_NOCERTDB 0x2 31746 #define NSS_INIT_OPTIMIZESPACE 0x20 31747 #define NSS_INIT_RESERVED 0x200 31748 #define NSS_INIT_NOMODDB 0x4 31749 #define NSS_INIT_PK11THREADSAFE 0x40 31750 #define NSS_INIT_FORCEOPEN 0x8 31751 #define NSS_INIT_PK11RELOAD 0x80 31752 #define NSS_VMINOR 11 31753 #define NSS_VMAJOR 3 31754 #define NSS_VERSION "3.11.4" 31755 #define NSS_VPATCH 4 31756 #define NSS_INIT_COOPERATE NSS_INIT_PK11THREADSAFE | NSS_INIT_PK11RELOAD | NSS_INIT_NOPK11FINALIZE | NSS_INIT_RESERVED 31757 #define SECMOD_DB "secmod.db" 31758 31759 extern SECStatus NSS_Init(const char *configdir); 31760 extern SECStatus NSS_InitReadWrite(const char *configdir); 31761 extern SECStatus NSS_NoDB_Init(const char *configdir); 31762 extern SECStatus NSS_Shutdown(void); 31763 __________________________________________________________ 31764 31765 14.4.12. nss3/nssb64.h 31766 31767 #define _NSSB64_H_ 31768 __________________________________________________________ 31769 31770 14.4.13. nss3/nssb64t.h 31771 31772 #define _NSSB64T_H_ 31773 31774 typedef struct NSSBase64DecoderStr NSSBase64Decoder; 31775 typedef struct NSSBase64EncoderStr NSSBase64Encoder; 31776 __________________________________________________________ 31777 31778 14.4.14. nss3/nssilckt.h 31779 31780 #define _NSSILCKT_H_ 31781 31782 typedef enum { 31783 nssILockArena, 31784 nssILockSession = 1, 31785 nssILockObject = 2, 31786 nssILockRefLock = 3, 31787 nssILockCert = 4, 31788 nssILockCertDB = 5, 31789 nssILockDBM = 6, 31790 nssILockCache = 7, 31791 nssILockSSL = 8, 31792 nssILockList = 9, 31793 nssILockSlot = 10, 31794 nssILockFreelist = 11, 31795 nssILockOID = 12, 31796 nssILockAttribute = 13, 31797 nssILockPK11cxt = 14, 31798 nssILockRWLock = 15, 31799 nssILockOther = 16, 31800 nssILockSelfServ = 17, 31801 nssILockKeyDB = 18, 31802 nssILockLast = 19 31803 } nssILockType; 31804 __________________________________________________________ 31805 31806 14.4.15. nss3/nssrwlkt.h 31807 31808 #define nssrwlkt_h___ 31809 31810 typedef struct nssRWLockStr NSSRWLock; 31811 __________________________________________________________ 31812 31813 14.4.16. nss3/ocspt.h 31814 31815 #define _OCSPT_H_ 31816 31817 typedef struct CERTOCSPRequestStr CERTOCSPRequest; 31818 typedef struct CERTOCSPResponseStr CERTOCSPResponse; 31819 typedef struct CERTOCSPCertIDStr CERTOCSPCertID; 31820 typedef struct CERTOCSPSingleResponseStr CERTOCSPSingleResponse; 31821 __________________________________________________________ 31822 31823 14.4.17. nss3/pk11pub.h 31824 31825 #define _PK11PUB_H_ 31826 31827 extern CERTCertificate *PK11_FindCertFromNickname(const char *nickname, 31828 void *wincx); 31829 extern SECKEYPrivateKey *PK11_FindKeyByAnyCert(CERTCertificate * cert, 31830 void *wincx); 31831 extern char *PK11_GetSlotName(PK11SlotInfo * slot); 31832 extern char *PK11_GetTokenName(PK11SlotInfo * slot); 31833 extern PRBool PK11_IsHW(PK11SlotInfo * slot); 31834 extern PRBool PK11_IsPresent(PK11SlotInfo * slot); 31835 extern PRBool PK11_IsReadOnly(PK11SlotInfo * slot); 31836 extern void PK11_SetPasswordFunc(PK11PasswordFunc func); 31837 __________________________________________________________ 31838 31839 14.4.18. nss3/pkcs11t.h 31840 31841 #define _PKCS11T_H_ 31842 31843 typedef unsigned char CK_BYTE; 31844 typedef CK_BYTE CK_CHAR; 31845 typedef CK_BYTE CK_UTF8CHAR; 31846 typedef unsigned long int CK_ULONG; 31847 typedef CK_ULONG CK_FLAGS; 31848 typedef void *CK_VOID_PTR; 31849 typedef struct CK_VERSION { 31850 CK_BYTE major; 31851 CK_BYTE minor; 31852 } CK_VERSION; 31853 typedef struct CK_INFO { 31854 CK_VERSION cryptokiVersion; 31855 CK_UTF8CHAR manufacturerID[31]; 31856 CK_FLAGS flags; 31857 CK_UTF8CHAR libraryDescription[31]; 31858 CK_VERSION libraryVersion; 31859 } CK_INFO; 31860 typedef CK_ULONG CK_SLOT_ID; 31861 typedef struct CK_SLOT_INFO { 31862 CK_UTF8CHAR slotDescription[63]; 31863 CK_UTF8CHAR manufacturerID[31]; 31864 CK_FLAGS flags; 31865 CK_VERSION hardwareVersion; 31866 CK_VERSION firmwareVersion; 31867 } CK_SLOT_INFO; 31868 typedef struct CK_TOKEN_INFO { 31869 CK_UTF8CHAR label[31]; 31870 CK_UTF8CHAR manufacturerID[31]; 31871 CK_UTF8CHAR model[15]; 31872 CK_CHAR serialNumber[15]; 31873 CK_FLAGS flags; 31874 CK_ULONG ulMaxSessionCount; 31875 CK_ULONG ulSessionCount; 31876 CK_ULONG ulMaxRwSessionCount; 31877 CK_ULONG ulRwSessionCount; 31878 CK_ULONG ulMaxPinLen; 31879 CK_ULONG ulMinPinLen; 31880 CK_ULONG ulTotalPublicMemory; 31881 CK_ULONG ulFreePublicMemory; 31882 CK_ULONG ulTotalPrivateMemory; 31883 CK_ULONG ulFreePrivateMemory; 31884 CK_VERSION hardwareVersion; 31885 CK_VERSION firmwareVersion; 31886 CK_CHAR utcTime[15]; 31887 } CK_TOKEN_INFO; 31888 typedef CK_ULONG CK_SESSION_HANDLE; 31889 typedef CK_ULONG CK_OBJECT_HANDLE; 31890 typedef CK_ULONG CK_OBJECT_CLASS; 31891 typedef CK_ULONG CK_KEY_TYPE; 31892 typedef CK_ULONG CK_ATTRIBUTE_TYPE; 31893 typedef struct CK_ATTRIBUTE { 31894 CK_ATTRIBUTE_TYPE type; 31895 CK_VOID_PTR pValue; 31896 CK_ULONG ulValueLen; 31897 } CK_ATTRIBUTE; 31898 typedef CK_ATTRIBUTE *CK_ATTRIBUTE_PTR; 31899 typedef CK_ULONG CK_MECHANISM_TYPE; 31900 typedef struct CK_MECHANISM { 31901 CK_MECHANISM_TYPE mechanism; 31902 CK_VOID_PTR pParameter; 31903 CK_ULONG ulParameterLen; 31904 } CK_MECHANISM; 31905 typedef CK_MECHANISM *CK_MECHANISM_PTR; 31906 typedef CK_ULONG CK_RV; 31907 __________________________________________________________ 31908 31909 14.4.19. nss3/pkcs7t.h 31910 31911 #define _PKCS7T_H_ 31912 31913 typedef struct SEC_PKCS7RecipientInfoStr { 31914 SECItem version; 31915 CERTIssuerAndSN *issuerAndSN; 31916 SECAlgorithmID keyEncAlg; 31917 SECItem encKey; 31918 CERTCertificate *cert; 31919 } SEC_PKCS7RecipientInfo; 31920 __________________________________________________________ 31921 31922 14.4.20. nss3/secasn1t.h 31923 31924 #define _SECASN1T_H_ 31925 31926 typedef struct sec_ASN1Template_struct { 31927 unsigned long int kind; 31928 unsigned long int offset; 31929 const void *sub; 31930 unsigned int size; 31931 } SEC_ASN1Template; 31932 typedef struct sec_DecoderContext_struct SEC_ASN1DecoderContext; 31933 typedef struct sec_EncoderContext_struct SEC_ASN1EncoderContext; 31934 typedef enum { 31935 SEC_ASN1_Identifier, 31936 SEC_ASN1_Length = 1, 31937 SEC_ASN1_Contents = 2, 31938 SEC_ASN1_EndOfContents = 3 31939 } SEC_ASN1EncodingPart; 31940 typedef void (*SEC_ASN1NotifyProc) (void *, PRBool, void *, int); 31941 typedef void (*SEC_ASN1WriteProc) (void *, const char *, unsigned long int, 31942 int, SEC_ASN1EncodingPart); 31943 __________________________________________________________ 31944 31945 14.4.21. nss3/seccomon.h 31946 31947 #define _SECCOMMON_H_ 31948 31949 typedef enum { 31950 siBuffer, 31951 siClearDataBuffer = 1, 31952 siCipherDataBuffer = 2, 31953 siDERCertBuffer = 3, 31954 siEncodedCertBuffer = 4, 31955 siDERNameBuffer = 5, 31956 siEncodedNameBuffer = 6, 31957 siAsciiNameString = 7, 31958 siAsciiString = 8, 31959 siDEROID = 9, 31960 siUnsignedInteger = 10, 31961 siUTCTime = 11, 31962 siGeneralizedTime = 12, 31963 siVisibleString = 13, 31964 siUTF8String = 14, 31965 siBMPString = 15 31966 } SECItemType; 31967 typedef struct SECItemStr { 31968 SECItemType type; 31969 unsigned char *data; 31970 unsigned int len; 31971 } SECItem; 31972 typedef enum _SECStatus { 31973 SECWouldBlock = -2, 31974 SECFailure = -1, 31975 SECSuccess 31976 } SECStatus; 31977 typedef enum _SECComparison { 31978 SECLessThan = -1, 31979 SECEqual, 31980 SECGreaterThan = 1 31981 } SECComparison; 31982 __________________________________________________________ 31983 31984 14.4.22. nss3/secdert.h 31985 31986 #define _SECDERT_H_ 31987 31988 typedef struct DERTemplateStr { 31989 unsigned long int kind; 31990 unsigned int offset; 31991 DERTemplate *sub; 31992 unsigned long int arg; 31993 } DERTemplate; 31994 __________________________________________________________ 31995 31996 14.4.23. nss3/secdigt.h 31997 31998 #define _SECDIGT_H_ 31999 32000 typedef struct SGNDigestInfoStr { 32001 PLArenaPool *arena; 32002 SECAlgorithmID digestAlgorithm; 32003 SECItem digest; 32004 } SGNDigestInfo; 32005 __________________________________________________________ 32006 32007 14.4.24. nss3/secmodt.h 32008 32009 #define _SECMODT_H_ 32010 #define SECMOD_MAKE_NSS_FLAGS(fips,slot) \ 32011 "Flags=internal,critical"fips" \ 32012 slotparams=("#slot"={"SECMOD_SLOT_FLAGS"})" 32013 #define SECMOD_FIPS_NAME "NSS Internal FIPS PKCS #11 Module" 32014 #define SECMOD_INT_NAME "NSS Internal PKCS #11 Module" 32015 #define SECMOD_SLOT_FLAGS "slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,SHA256,SHA512]" 32016 #define SECMOD_EXTERNAL 0 32017 #define CRL_IMPORT_DEFAULT_OPTIONS 0x00000000 32018 #define CRL_IMPORT_BYPASS_CHECKS 0x00000001 32019 #define PK11_ATTR_TOKEN 0x00000001L 32020 #define SECMOD_RSA_FLAG 0x00000001L 32021 #define PK11_ATTR_SESSION 0x00000002L 32022 #define SECMOD_DSA_FLAG 0x00000002L 32023 #define PK11_ATTR_PRIVATE 0x00000004L 32024 #define SECMOD_RC2_FLAG 0x00000004L 32025 #define PK11_ATTR_PUBLIC 0x00000008L 32026 #define SECMOD_RC4_FLAG 0x00000008L 32027 #define PK11_ATTR_MODIFIABLE 0x00000010L 32028 #define SECMOD_DES_FLAG 0x00000010L 32029 #define PK11_ATTR_UNMODIFIABLE 0x00000020L 32030 #define SECMOD_DH_FLAG 0x00000020L 32031 #define PK11_ATTR_SENSITIVE 0x00000040L 32032 #define SECMOD_FORTEZZA_FLAG 0x00000040L 32033 #define PK11_ATTR_INSENSITIVE 0x00000080L 32034 #define SECMOD_RC5_FLAG 0x00000080L 32035 #define PK11_ATTR_EXTRACTABLE 0x00000100L 32036 #define SECMOD_SHA1_FLAG 0x00000100L 32037 #define PK11_ATTR_UNEXTRACTABLE 0x00000200L 32038 #define SECMOD_MD5_FLAG 0x00000200L 32039 #define SECMOD_MD2_FLAG 0x00000400L 32040 #define SECMOD_SSL_FLAG 0x00000800L 32041 #define SECMOD_TLS_FLAG 0x00001000L 32042 #define SECMOD_AES_FLAG 0x00002000L 32043 #define SECMOD_SHA256_FLAG 0x00004000L 32044 #define SECMOD_SHA512_FLAG 0x00008000L 32045 #define SECMOD_END_WAIT 0x01 32046 #define SECMOD_WAIT_SIMULATED_EVENT 0x02 32047 #define SECMOD_WAIT_PKCS11_EVENT 0x04 32048 #define SECMOD_RESERVED_FLAG 0X08000000L 32049 #define SECMOD_FRIENDLY_FLAG 0x10000000L 32050 #define PK11_OWN_PW_DEFAULTS 0x20000000L 32051 #define PK11_DISABLE_FLAG 0x40000000L 32052 #define SECMOD_RANDOM_FLAG 0x80000000L 32053 #define CKM_FAKE_RANDOM 0x80000efeL 32054 #define CKM_INVALID_MECHANISM 0xffffffffL 32055 #define SECMOD_INTERNAL 1 32056 #define SECMOD_FIPS 2 32057 #define PK11_PW_AUTHENTICATED "AUTH" 32058 #define PK11_PW_RETRY "RETRY" 32059 #define SECMOD_INT_FLAGS SECMOD_MAKE_NSS_FLAGS("",1) 32060 #define SECMOD_FIPS_FLAGS SECMOD_MAKE_NSS_FLAGS(",fips",3) 32061 #define PK11_PW_TRY "TRY" 32062 32063 typedef struct SECMODModuleStr { 32064 PLArenaPool *arena; 32065 PRBool internal; 32066 PRBool loaded; 32067 PRBool isFIPS; 32068 char *dllName; 32069 char *commonName; 32070 void *library; 32071 void *functionList; 32072 PRLock *refLock; 32073 int refCount; 32074 PK11SlotInfo **slots; 32075 int slotCount; 32076 PK11PreSlotInfo *slotInfo; 32077 int slotInfoCount; 32078 SECMODModuleID moduleID; 32079 PRBool isThreadSafe; 32080 unsigned long int ssl[1]; 32081 char *libraryParams; 32082 void *moduleDBFunc; 32083 SECMODModule *parent; 32084 PRBool isCritical; 32085 PRBool isModuleDB; 32086 PRBool moduleDBOnly; 32087 int trustOrder; 32088 int cipherOrder; 32089 unsigned long int evControlMask; 32090 CK_VERSION cryptokiVersion; 32091 } SECMODModule; 32092 typedef struct SECMODModuleListStr { 32093 SECMODModuleList *next; 32094 SECMODModule *module; 32095 } SECMODModuleList; 32096 typedef NSSRWLock SECMODListLock; 32097 typedef struct PK11SlotInfoStr PK11SlotInfo; 32098 typedef struct PK11PreSlotInfoStr PK11PreSlotInfo; 32099 typedef struct PK11SymKeyStr PK11SymKey; 32100 typedef struct PK11ContextStr PK11Context; 32101 typedef struct PK11SlotListStr PK11SlotList; 32102 typedef struct PK11SlotListElementStr PK11SlotListElement; 32103 typedef unsigned long int SECMODModuleID; 32104 typedef struct PK11DefaultArrayEntryStr PK11DefaultArrayEntry; 32105 typedef struct PK11GenericObjectStr PK11GenericObject; 32106 typedef void (*PK11FreeDataFunc) (void *); 32107 typedef enum { 32108 PK11CertListUnique, 32109 PK11CertListUser = 1, 32110 PK11CertListRootUnique = 2, 32111 PK11CertListCA = 3, 32112 PK11CertListCAUnique = 4, 32113 PK11CertListUserUnique = 5, 32114 PK11CertListAll = 6 32115 } PK11CertListType; 32116 typedef PRUint32 PK11AttrFlags; 32117 typedef enum { 32118 PK11_OriginNULL, 32119 PK11_OriginDerive = 1, 32120 PK11_OriginGenerated = 2, 32121 PK11_OriginFortezzaHack = 3, 32122 PK11_OriginUnwrap = 4 32123 } PK11Origin; 32124 typedef enum { 32125 PK11_DIS_NONE, 32126 PK11_DIS_USER_SELECTED = 1, 32127 PK11_DIS_COULD_NOT_INIT_TOKEN = 2, 32128 PK11_DIS_TOKEN_VERIFY_FAILED = 3, 32129 PK11_DIS_TOKEN_NOT_PRESENT = 4 32130 } PK11DisableReasons; 32131 typedef enum { 32132 PK11_TypeGeneric, 32133 PK11_TypePrivKey = 1, 32134 PK11_TypePubKey = 2, 32135 PK11_TypeCert = 3, 32136 PK11_TypeSymKey = 4 32137 } PK11ObjectType; 32138 typedef char *(*PK11PasswordFunc) (PK11SlotInfo *, PRBool, void *); 32139 typedef struct SECKEYAttributeStr { 32140 SECItem attrType; 32141 SECItem **attrValue; 32142 } SECKEYAttribute; 32143 typedef struct SECKEYPrivateKeyInfoStr { 32144 PLArenaPool *arena; 32145 SECItem version; 32146 SECAlgorithmID algorithm; 32147 SECItem privateKey; 32148 SECKEYAttribute **attributes; 32149 } SECKEYPrivateKeyInfo; 32150 typedef struct SECKEYEncryptedPrivateKeyInfoStr { 32151 PLArenaPool *arena; 32152 SECAlgorithmID algorithm; 32153 SECItem encryptedData; 32154 } SECKEYEncryptedPrivateKeyInfo; 32155 typedef enum { 32156 PK11TokenNotRemovable, 32157 PK11TokenPresent = 1, 32158 PK11TokenChanged = 2, 32159 PK11TokenRemoved = 3 32160 } PK11TokenStatus; 32161 typedef enum { 32162 PK11TokenRemovedOrChangedEvent, 32163 PK11TokenPresentEvent = 1 32164 } PK11TokenEvent; 32165 __________________________________________________________ 32166 32167 14.4.25. nss3/secoidt.h 32168 32169 #define _SECOIDT_H_ 32170 32171 typedef struct SECOidDataStr { 32172 SECItem oid; 32173 SECOidTag offset; 32174 const char *desc; 32175 unsigned long int mechanism; 32176 SECSupportExtenTag supportedExtension; 32177 } SECOidData; 32178 typedef struct SECAlgorithmIDStr { 32179 SECItem algorithm; 32180 SECItem parameters; 32181 } SECAlgorithmID; 32182 typedef enum { 32183 SEC_OID_UNKNOWN, 32184 SEC_OID_MD2 = 1, 32185 SEC_OID_MD4 = 2, 32186 SEC_OID_MD5 = 3, 32187 SEC_OID_SHA1 = 4, 32188 SEC_OID_RC2_CBC = 5, 32189 SEC_OID_RC4 = 6, 32190 SEC_OID_DES_EDE3_CBC = 7, 32191 SEC_OID_RC5_CBC_PAD = 8, 32192 SEC_OID_DES_ECB = 9, 32193 SEC_OID_DES_CBC = 10, 32194 SEC_OID_DES_OFB = 11, 32195 SEC_OID_DES_CFB = 12, 32196 SEC_OID_DES_MAC = 13, 32197 SEC_OID_DES_EDE = 14, 32198 SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE = 15, 32199 SEC_OID_PKCS1_RSA_ENCRYPTION = 16, 32200 SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION = 17, 32201 SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION = 18, 32202 SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION = 19, 32203 SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION = 20, 32204 SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC = 21, 32205 SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC = 22, 32206 SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC = 23, 32207 SEC_OID_PKCS7 = 24, 32208 SEC_OID_PKCS7_DATA = 25, 32209 SEC_OID_PKCS7_SIGNED_DATA = 26, 32210 SEC_OID_PKCS7_ENVELOPED_DATA = 27, 32211 SEC_OID_PKCS7_SIGNED_ENVELOPED_DATA = 28, 32212 SEC_OID_PKCS7_DIGESTED_DATA = 29, 32213 SEC_OID_PKCS7_ENCRYPTED_DATA = 30, 32214 SEC_OID_PKCS9_EMAIL_ADDRESS = 31, 32215 SEC_OID_PKCS9_UNSTRUCTURED_NAME = 32, 32216 SEC_OID_PKCS9_CONTENT_TYPE = 33, 32217 SEC_OID_PKCS9_MESSAGE_DIGEST = 34, 32218 SEC_OID_PKCS9_SIGNING_TIME = 35, 32219 SEC_OID_PKCS9_COUNTER_SIGNATURE = 36, 32220 SEC_OID_PKCS9_CHALLENGE_PASSWORD = 37, 32221 SEC_OID_PKCS9_UNSTRUCTURED_ADDRESS = 38, 32222 SEC_OID_PKCS9_EXTENDED_CERTIFICATE_ATTRIBUTES = 39, 32223 SEC_OID_PKCS9_SMIME_CAPABILITIES = 40, 32224 SEC_OID_AVA_COMMON_NAME = 41, 32225 SEC_OID_AVA_COUNTRY_NAME = 42, 32226 SEC_OID_AVA_LOCALITY = 43, 32227 SEC_OID_AVA_STATE_OR_PROVINCE = 44, 32228 SEC_OID_AVA_ORGANIZATION_NAME = 45, 32229 SEC_OID_AVA_ORGANIZATIONAL_UNIT_NAME = 46, 32230 SEC_OID_AVA_DN_QUALIFIER = 47, 32231 SEC_OID_AVA_DC = 48, 32232 SEC_OID_NS_TYPE_GIF = 49, 32233 SEC_OID_NS_TYPE_JPEG = 50, 32234 SEC_OID_NS_TYPE_URL = 51, 32235 SEC_OID_NS_TYPE_HTML = 52, 32236 SEC_OID_NS_TYPE_CERT_SEQUENCE = 53, 32237 SEC_OID_MISSI_KEA_DSS_OLD = 54, 32238 SEC_OID_MISSI_DSS_OLD = 55, 32239 SEC_OID_MISSI_KEA_DSS = 56, 32240 SEC_OID_MISSI_DSS = 57, 32241 SEC_OID_MISSI_KEA = 58, 32242 SEC_OID_MISSI_ALT_KEA = 59, 32243 SEC_OID_NS_CERT_EXT_NETSCAPE_OK = 60, 32244 SEC_OID_NS_CERT_EXT_ISSUER_LOGO = 61, 32245 SEC_OID_NS_CERT_EXT_SUBJECT_LOGO = 62, 32246 SEC_OID_NS_CERT_EXT_CERT_TYPE = 63, 32247 SEC_OID_NS_CERT_EXT_BASE_URL = 64, 32248 SEC_OID_NS_CERT_EXT_REVOCATION_URL = 65, 32249 SEC_OID_NS_CERT_EXT_CA_REVOCATION_URL = 66, 32250 SEC_OID_NS_CERT_EXT_CA_CRL_URL = 67, 32251 SEC_OID_NS_CERT_EXT_CA_CERT_URL = 68, 32252 SEC_OID_NS_CERT_EXT_CERT_RENEWAL_URL = 69, 32253 SEC_OID_NS_CERT_EXT_CA_POLICY_URL = 70, 32254 SEC_OID_NS_CERT_EXT_HOMEPAGE_URL = 71, 32255 SEC_OID_NS_CERT_EXT_ENTITY_LOGO = 72, 32256 SEC_OID_NS_CERT_EXT_USER_PICTURE = 73, 32257 SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME = 74, 32258 SEC_OID_NS_CERT_EXT_COMMENT = 75, 32259 SEC_OID_NS_CERT_EXT_LOST_PASSWORD_URL = 76, 32260 SEC_OID_NS_CERT_EXT_CERT_RENEWAL_TIME = 77, 32261 SEC_OID_NS_KEY_USAGE_GOVT_APPROVED = 78, 32262 SEC_OID_X509_SUBJECT_DIRECTORY_ATTR = 79, 32263 SEC_OID_X509_SUBJECT_KEY_ID = 80, 32264 SEC_OID_X509_KEY_USAGE = 81, 32265 SEC_OID_X509_PRIVATE_KEY_USAGE_PERIOD = 82, 32266 SEC_OID_X509_SUBJECT_ALT_NAME = 83, 32267 SEC_OID_X509_ISSUER_ALT_NAME = 84, 32268 SEC_OID_X509_BASIC_CONSTRAINTS = 85, 32269 SEC_OID_X509_NAME_CONSTRAINTS = 86, 32270 SEC_OID_X509_CRL_DIST_POINTS = 87, 32271 SEC_OID_X509_CERTIFICATE_POLICIES = 88, 32272 SEC_OID_X509_POLICY_MAPPINGS = 89, 32273 SEC_OID_X509_POLICY_CONSTRAINTS = 90, 32274 SEC_OID_X509_AUTH_KEY_ID = 91, 32275 SEC_OID_X509_EXT_KEY_USAGE = 92, 32276 SEC_OID_X509_AUTH_INFO_ACCESS = 93, 32277 SEC_OID_X509_CRL_NUMBER = 94, 32278 SEC_OID_X509_REASON_CODE = 95, 32279 SEC_OID_X509_INVALID_DATE = 96, 32280 SEC_OID_X500_RSA_ENCRYPTION = 97, 32281 SEC_OID_RFC1274_UID = 98, 32282 SEC_OID_RFC1274_MAIL = 99, 32283 SEC_OID_PKCS12 = 100, 32284 SEC_OID_PKCS12_MODE_IDS = 101, 32285 SEC_OID_PKCS12_ESPVK_IDS = 102, 32286 SEC_OID_PKCS12_BAG_IDS = 103, 32287 SEC_OID_PKCS12_CERT_BAG_IDS = 104, 32288 SEC_OID_PKCS12_OIDS = 105, 32289 SEC_OID_PKCS12_PBE_IDS = 106, 32290 SEC_OID_PKCS12_SIGNATURE_IDS = 107, 32291 SEC_OID_PKCS12_ENVELOPING_IDS = 108, 32292 SEC_OID_PKCS12_PKCS8_KEY_SHROUDING = 109, 32293 SEC_OID_PKCS12_KEY_BAG_ID = 110, 32294 SEC_OID_PKCS12_CERT_AND_CRL_BAG_ID = 111, 32295 SEC_OID_PKCS12_SECRET_BAG_ID = 112, 32296 SEC_OID_PKCS12_X509_CERT_CRL_BAG = 113, 32297 SEC_OID_PKCS12_SDSI_CERT_BAG = 114, 32298 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC4 = 115, 32299 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC4 = 116, 32300 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_TRIPLE_DES_CBC = 117, 32301 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 118, 32302 SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 119, 32303 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_128_BIT_RC4 = 120, 32304 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_40_BIT_RC4 = 121, 32305 SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_TRIPLE_DES = 122, 32306 SEC_OID_PKCS12_RSA_SIGNATURE_WITH_SHA1_DIGEST = 123, 32307 SEC_OID_ANSIX9_DSA_SIGNATURE = 124, 32308 SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST = 125, 32309 SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST = 126, 32310 SEC_OID_VERISIGN_USER_NOTICES = 127, 32311 SEC_OID_PKIX_CPS_POINTER_QUALIFIER = 128, 32312 SEC_OID_PKIX_USER_NOTICE_QUALIFIER = 129, 32313 SEC_OID_PKIX_OCSP = 130, 32314 SEC_OID_PKIX_OCSP_BASIC_RESPONSE = 131, 32315 SEC_OID_PKIX_OCSP_NONCE = 132, 32316 SEC_OID_PKIX_OCSP_CRL = 133, 32317 SEC_OID_PKIX_OCSP_RESPONSE = 134, 32318 SEC_OID_PKIX_OCSP_NO_CHECK = 135, 32319 SEC_OID_PKIX_OCSP_ARCHIVE_CUTOFF = 136, 32320 SEC_OID_PKIX_OCSP_SERVICE_LOCATOR = 137, 32321 SEC_OID_PKIX_REGCTRL_REGTOKEN = 138, 32322 SEC_OID_PKIX_REGCTRL_AUTHENTICATOR = 139, 32323 SEC_OID_PKIX_REGCTRL_PKIPUBINFO = 140, 32324 SEC_OID_PKIX_REGCTRL_PKI_ARCH_OPTIONS = 141, 32325 SEC_OID_PKIX_REGCTRL_OLD_CERT_ID = 142, 32326 SEC_OID_PKIX_REGCTRL_PROTOCOL_ENC_KEY = 143, 32327 SEC_OID_PKIX_REGINFO_UTF8_PAIRS = 144, 32328 SEC_OID_PKIX_REGINFO_CERT_REQUEST = 145, 32329 SEC_OID_EXT_KEY_USAGE_SERVER_AUTH = 146, 32330 SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH = 147, 32331 SEC_OID_EXT_KEY_USAGE_CODE_SIGN = 148, 32332 SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT = 149, 32333 SEC_OID_EXT_KEY_USAGE_TIME_STAMP = 150, 32334 SEC_OID_OCSP_RESPONDER = 151, 32335 SEC_OID_NETSCAPE_SMIME_KEA = 152, 32336 SEC_OID_FORTEZZA_SKIPJACK = 153, 32337 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4 = 154, 32338 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4 = 155, 32339 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC = 156, 32340 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_2KEY_TRIPLE_DES_CBC = 157, 32341 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 158, 32342 SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 159, 32343 SEC_OID_PKCS12_SAFE_CONTENTS_ID = 160, 32344 SEC_OID_PKCS12_PKCS8_SHROUDED_KEY_BAG_ID = 161, 32345 SEC_OID_PKCS12_V1_KEY_BAG_ID = 162, 32346 SEC_OID_PKCS12_V1_PKCS8_SHROUDED_KEY_BAG_ID = 163, 32347 SEC_OID_PKCS12_V1_CERT_BAG_ID = 164, 32348 SEC_OID_PKCS12_V1_CRL_BAG_ID = 165, 32349 SEC_OID_PKCS12_V1_SECRET_BAG_ID = 166, 32350 SEC_OID_PKCS12_V1_SAFE_CONTENTS_BAG_ID = 167, 32351 SEC_OID_PKCS9_X509_CERT = 168, 32352 SEC_OID_PKCS9_SDSI_CERT = 169, 32353 SEC_OID_PKCS9_X509_CRL = 170, 32354 SEC_OID_PKCS9_FRIENDLY_NAME = 171, 32355 SEC_OID_PKCS9_LOCAL_KEY_ID = 172, 32356 SEC_OID_BOGUS_KEY_USAGE = 173, 32357 SEC_OID_X942_DIFFIE_HELMAN_KEY = 174, 32358 SEC_OID_NETSCAPE_NICKNAME = 175, 32359 SEC_OID_NETSCAPE_RECOVERY_REQUEST = 176, 32360 SEC_OID_CERT_RENEWAL_LOCATOR = 177, 32361 SEC_OID_NS_CERT_EXT_SCOPE_OF_USE = 178, 32362 SEC_OID_CMS_EPHEMERAL_STATIC_DIFFIE_HELLMAN = 179, 32363 SEC_OID_CMS_3DES_KEY_WRAP = 180, 32364 SEC_OID_CMS_RC2_KEY_WRAP = 181, 32365 SEC_OID_SMIME_ENCRYPTION_KEY_PREFERENCE = 182, 32366 SEC_OID_AES_128_ECB = 183, 32367 SEC_OID_AES_128_CBC = 184, 32368 SEC_OID_AES_192_ECB = 185, 32369 SEC_OID_AES_192_CBC = 186, 32370 SEC_OID_AES_256_ECB = 187, 32371 SEC_OID_AES_256_CBC = 188, 32372 SEC_OID_SDN702_DSA_SIGNATURE = 189, 32373 SEC_OID_MS_SMIME_ENCRYPTION_KEY_PREFERENCE = 190, 32374 SEC_OID_SHA256 = 191, 32375 SEC_OID_SHA384 = 192, 32376 SEC_OID_SHA512 = 193, 32377 SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION = 194, 32378 SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION = 195, 32379 SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION = 196, 32380 SEC_OID_AES_128_KEY_WRAP = 197, 32381 SEC_OID_AES_192_KEY_WRAP = 198, 32382 SEC_OID_AES_256_KEY_WRAP = 199, 32383 SEC_OID_ANSIX962_EC_PUBLIC_KEY = 200, 32384 SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE = 201, 32385 SEC_OID_ANSIX962_EC_PRIME192V1 = 202, 32386 SEC_OID_ANSIX962_EC_PRIME192V2 = 203, 32387 SEC_OID_ANSIX962_EC_PRIME192V3 = 204, 32388 SEC_OID_ANSIX962_EC_PRIME239V1 = 205, 32389 SEC_OID_ANSIX962_EC_PRIME239V2 = 206, 32390 SEC_OID_ANSIX962_EC_PRIME239V3 = 207, 32391 SEC_OID_ANSIX962_EC_PRIME256V1 = 208, 32392 SEC_OID_SECG_EC_SECP112R1 = 209, 32393 SEC_OID_SECG_EC_SECP112R2 = 210, 32394 SEC_OID_SECG_EC_SECP128R1 = 211, 32395 SEC_OID_SECG_EC_SECP128R2 = 212, 32396 SEC_OID_SECG_EC_SECP160K1 = 213, 32397 SEC_OID_SECG_EC_SECP160R1 = 214, 32398 SEC_OID_SECG_EC_SECP160R2 = 215, 32399 SEC_OID_SECG_EC_SECP192K1 = 216, 32400 SEC_OID_SECG_EC_SECP224K1 = 217, 32401 SEC_OID_SECG_EC_SECP224R1 = 218, 32402 SEC_OID_SECG_EC_SECP256K1 = 219, 32403 SEC_OID_SECG_EC_SECP384R1 = 220, 32404 SEC_OID_SECG_EC_SECP521R1 = 221, 32405 SEC_OID_ANSIX962_EC_C2PNB163V1 = 222, 32406 SEC_OID_ANSIX962_EC_C2PNB163V2 = 223, 32407 SEC_OID_ANSIX962_EC_C2PNB163V3 = 224, 32408 SEC_OID_ANSIX962_EC_C2PNB176V1 = 225, 32409 SEC_OID_ANSIX962_EC_C2TNB191V1 = 226, 32410 SEC_OID_ANSIX962_EC_C2TNB191V2 = 227, 32411 SEC_OID_ANSIX962_EC_C2TNB191V3 = 228, 32412 SEC_OID_ANSIX962_EC_C2ONB191V4 = 229, 32413 SEC_OID_ANSIX962_EC_C2ONB191V5 = 230, 32414 SEC_OID_ANSIX962_EC_C2PNB208W1 = 231, 32415 SEC_OID_ANSIX962_EC_C2TNB239V1 = 232, 32416 SEC_OID_ANSIX962_EC_C2TNB239V2 = 233, 32417 SEC_OID_ANSIX962_EC_C2TNB239V3 = 234, 32418 SEC_OID_ANSIX962_EC_C2ONB239V4 = 235, 32419 SEC_OID_ANSIX962_EC_C2ONB239V5 = 236, 32420 SEC_OID_ANSIX962_EC_C2PNB272W1 = 237, 32421 SEC_OID_ANSIX962_EC_C2PNB304W1 = 238, 32422 SEC_OID_ANSIX962_EC_C2TNB359V1 = 239, 32423 SEC_OID_ANSIX962_EC_C2PNB368W1 = 240, 32424 SEC_OID_ANSIX962_EC_C2TNB431R1 = 241, 32425 SEC_OID_SECG_EC_SECT113R1 = 242, 32426 SEC_OID_SECG_EC_SECT113R2 = 243, 32427 SEC_OID_SECG_EC_SECT131R1 = 244, 32428 SEC_OID_SECG_EC_SECT131R2 = 245, 32429 SEC_OID_SECG_EC_SECT163K1 = 246, 32430 SEC_OID_SECG_EC_SECT163R1 = 247, 32431 SEC_OID_SECG_EC_SECT163R2 = 248, 32432 SEC_OID_SECG_EC_SECT193R1 = 249, 32433 SEC_OID_SECG_EC_SECT193R2 = 250, 32434 SEC_OID_SECG_EC_SECT233K1 = 251, 32435 SEC_OID_SECG_EC_SECT233R1 = 252, 32436 SEC_OID_SECG_EC_SECT239K1 = 253, 32437 SEC_OID_SECG_EC_SECT283K1 = 254, 32438 SEC_OID_SECG_EC_SECT283R1 = 255, 32439 SEC_OID_SECG_EC_SECT409K1 = 256, 32440 SEC_OID_SECG_EC_SECT409R1 = 257, 32441 SEC_OID_SECG_EC_SECT571K1 = 258, 32442 SEC_OID_SECG_EC_SECT571R1 = 259, 32443 SEC_OID_NETSCAPE_AOLSCREENNAME = 260, 32444 SEC_OID_AVA_SURNAME = 261, 32445 SEC_OID_AVA_SERIAL_NUMBER = 262, 32446 SEC_OID_AVA_STREET_ADDRESS = 263, 32447 SEC_OID_AVA_TITLE = 264, 32448 SEC_OID_AVA_POSTAL_ADDRESS = 265, 32449 SEC_OID_AVA_POSTAL_CODE = 266, 32450 SEC_OID_AVA_POST_OFFICE_BOX = 267, 32451 SEC_OID_AVA_GIVEN_NAME = 268, 32452 SEC_OID_AVA_INITIALS = 269, 32453 SEC_OID_AVA_GENERATION_QUALIFIER = 270, 32454 SEC_OID_AVA_HOUSE_IDENTIFIER = 271, 32455 SEC_OID_AVA_PSEUDONYM = 272, 32456 SEC_OID_PKIX_CA_ISSUERS = 273, 32457 SEC_OID_PKCS9_EXTENSION_REQUEST = 274, 32458 SEC_OID_ANSIX962_ECDSA_SIGNATURE_RECOMMENDED_DIGEST = 275, 32459 SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST = 276, 32460 SEC_OID_ANSIX962_ECDSA_SHA224_SIGNATURE = 277, 32461 SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE = 278, 32462 SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE = 279, 32463 SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE = 280, 32464 SEC_OID_X509_HOLD_INSTRUCTION_CODE = 281, 32465 SEC_OID_X509_DELTA_CRL_INDICATOR = 282, 32466 SEC_OID_X509_ISSUING_DISTRIBUTION_POINT = 283, 32467 SEC_OID_X509_CERT_ISSUER = 284, 32468 SEC_OID_X509_FRESHEST_CRL = 285, 32469 SEC_OID_X509_INHIBIT_ANY_POLICY = 286, 32470 SEC_OID_X509_SUBJECT_INFO_ACCESS = 287, 32471 SEC_OID_CAMELLIA_128_CBC = 288, 32472 SEC_OID_CAMELLIA_192_CBC = 289, 32473 SEC_OID_CAMELLIA_256_CBC = 290, 32474 SEC_OID_PKCS5_PBKDF2 = 291, 32475 SEC_OID_PKCS5_PBES2 = 292, 32476 SEC_OID_PKCS5_PBMAC1 = 293, 32477 SEC_OID_HMAC_SHA1 = 294, 32478 SEC_OID_HMAC_SHA224 = 295, 32479 SEC_OID_HMAC_SHA256 = 296, 32480 SEC_OID_HMAC_SHA384 = 297, 32481 SEC_OID_HMAC_SHA512 = 298, 32482 SEC_OID_PKIX_TIMESTAMPING = 299, 32483 SEC_OID_PKIX_CA_REPOSITORY = 300, 32484 SEC_OID_ISO_SHA1_WITH_RSA_SIGNATURE = 301, 32485 SEC_OID_TOTAL = 302 32486 } SECOidTag; 32487 typedef enum { 32488 INVALID_CERT_EXTENSION, 32489 UNSUPPORTED_CERT_EXTENSION = 1, 32490 SUPPORTED_CERT_EXTENSION = 2 32491 } SECSupportExtenTag; 32492 __________________________________________________________ 32493 32494 14.4.26. nss3/secpkcs5.h 32495 32496 #define _SECPKCS5_H_ 32497 32498 typedef enum { 32499 pbeBitGenIDNull, 32500 pbeBitGenCipherKey = 1, 32501 pbeBitGenCipherIV = 2, 32502 pbeBitGenIntegrityKey = 3 32503 } PBEBitGenID; 32504 typedef struct PBEBitGenContextStr PBEBitGenContext; 32505 __________________________________________________________ 32506 32507 14.4.27. nss3/secport.h 32508 32509 #define _SECPORT_H_ 32510 32511 typedef PRBool(*PORTCharConversionWSwapFunc) (PRBool, unsigned char *, 32512 unsigned int, 32513 unsigned char *, 32514 unsigned int, unsigned int *, 32515 PRBool); 32516 typedef PRBool(*PORTCharConversionFunc) (PRBool, unsigned char *, 32517 unsigned int, unsigned char *, 32518 unsigned int, unsigned int *); 32519 __________________________________________________________ 32520 32521 14.5. Interfaces for libssl3 32522 32523 Table 14-5 defines the library name and shared object name for 32524 the libssl3 library 32525 32526 Table 14-5. libssl3 Definition 32527 Library: libssl3 32528 SONAME: libssl3.so 32529 32530 The behavior of the interfaces in this library is specified by 32531 the following specifications: 32532 32533 [NSS SSL] Mozilla's NSS SSL Reference 32534 __________________________________________________________ 32535 32536 14.5.1. NSS SSL 32537 __________________________________________________________ 32538 32539 14.5.1.1. Interfaces for NSS SSL 32540 32541 An LSB conforming implementation shall provide the generic 32542 functions for NSS SSL specified in Table 14-6, with the full 32543 mandatory functionality as described in the referenced 32544 underlying specification. 32545 32546 Table 14-6. libssl3 - NSS SSL Function Interfaces 32547 NSS_CmpCertChainWCANames(NSS_3.2) [NSS SSL] 32548 NSS_FindCertKEAType(NSS_3.2) [NSS SSL] 32549 NSS_GetClientAuthData(NSS_3.2) [NSS SSL] 32550 SSL_AuthCertificate(NSS_3.2) [NSS SSL] 32551 SSL_AuthCertificateHook(NSS_3.2) [NSS SSL] 32552 SSL_BadCertHook(NSS_3.2) [NSS SSL] 32553 SSL_CipherPolicyGet(NSS_3.2) [NSS SSL] 32554 SSL_CipherPolicySet(NSS_3.2) [NSS SSL] 32555 SSL_CipherPrefGet(NSS_3.2) [NSS SSL] 32556 SSL_CipherPrefGetDefault(NSS_3.2) [NSS SSL] 32557 SSL_CipherPrefSet(NSS_3.2) [NSS SSL] 32558 SSL_CipherPrefSetDefault(NSS_3.2) [NSS SSL] 32559 SSL_ClearSessionCache(NSS_3.2) [NSS SSL] 32560 SSL_ConfigMPServerSIDCache(NSS_3.2) [NSS SSL] 32561 SSL_ConfigSecureServer(NSS_3.2) [NSS SSL] 32562 SSL_ConfigServerSessionIDCache(NSS_3.2) [NSS SSL] 32563 SSL_DataPending(NSS_3.2) [NSS SSL] SSL_ForceHandshake(NSS_3.2) 32564 [NSS SSL] 32565 SSL_GetClientAuthDataHook(NSS_3.2) [NSS SSL] 32566 SSL_GetSessionID(NSS_3.2) [NSS SSL] 32567 SSL_HandshakeCallback(NSS_3.2) [NSS SSL] 32568 SSL_ImportFD(NSS_3.2) [NSS SSL] 32569 SSL_InheritMPServerSIDCache(NSS_3.2) [NSS SSL] 32570 SSL_InvalidateSession(NSS_3.2) [NSS SSL] 32571 SSL_OptionGet(NSS_3.2) [NSS SSL] SSL_OptionGetDefault(NSS_3.2) 32572 [NSS SSL] SSL_OptionSet(NSS_3.2) [NSS SSL] 32573 SSL_OptionSetDefault(NSS_3.2) [NSS SSL] 32574 SSL_PeerCertificate(NSS_3.2) [NSS SSL] SSL_ReHandshake(NSS_3.2) 32575 [NSS SSL] 32576 SSL_ResetHandshake(NSS_3.2) [NSS SSL] SSL_RevealPinArg(NSS_3.2) 32577 [NSS SSL] SSL_RevealURL(NSS_3.2) [NSS SSL] 32578 SSL_SecurityStatus(NSS_3.2) [NSS SSL] 32579 SSL_SetPKCS11PinArg(NSS_3.2) [NSS SSL] 32580 SSL_SetSockPeerID(NSS_3.2) [NSS SSL] 32581 SSL_SetURL(NSS_3.2) [NSS SSL] 32582 __________________________________________________________ 32583 32584 14.6. Data Definitions for libssl3 32585 32586 This section defines global identifiers and their values that 32587 are associated with interfaces contained in libssl3. These 32588 definitions are organized into groups that correspond to system 32589 headers. This convention is used as a convenience for the 32590 reader, and does not imply the existence of these headers, or 32591 their content. Where an interface is defined as requiring a 32592 particular system header file all of the data definitions for 32593 that system header file presented here shall be in effect. 32594 32595 This section gives data definitions to promote binary 32596 application portability, not to repeat source interface 32597 definitions available elsewhere. System providers and 32598 application developers should use this ABI to supplement - not 32599 to replace - source interface definition specifications. 32600 32601 This specification uses the ISO C (1999) C Language as the 32602 reference programming language, and data definitions are 32603 specified in ISO C format. The C language is used here as a 32604 convenient notation. Using a C language description of these 32605 data objects does not preclude their use by other programming 32606 languages. 32607 __________________________________________________________ 32608 32609 14.6.1. nss3/ecl-exp.h 32610 32611 #define __ecl_exp_h_ 32612 #define ECCurve_SECG_CHAR2_163R2 ECCurve_NIST_B163 32613 #define ECCurve_SECG_CHAR2_233R1 ECCurve_NIST_B233 32614 #define ECCurve_WTLS_11 ECCurve_NIST_B233 32615 #define ECCurve_SECG_CHAR2_283R1 ECCurve_NIST_B283 32616 #define ECCurve_SECG_CHAR2_409R1 ECCurve_NIST_B409 32617 #define ECCurve_SECG_CHAR2_571R1 ECCurve_NIST_B571 32618 #define ECCurve_SECG_CHAR2_163K1 ECCurve_NIST_K163 32619 #define ECCurve_WTLS_3 ECCurve_NIST_K163 32620 #define ECCurve_SECG_CHAR2_233K1 ECCurve_NIST_K233 32621 #define ECCurve_WTLS_10 ECCurve_NIST_K233 32622 #define ECCurve_SECG_CHAR2_283K1 ECCurve_NIST_K283 32623 #define ECCurve_SECG_CHAR2_409K1 ECCurve_NIST_K409 32624 #define ECCurve_SECG_CHAR2_571K1 ECCurve_NIST_K571 32625 #define ECCurve_SECG_PRIME_192R1 ECCurve_NIST_P192 32626 #define ECCurve_X9_62_PRIME_192V1 ECCurve_NIST_P192 32627 #define ECCurve_SECG_PRIME_224R1 ECCurve_NIST_P224 32628 #define ECCurve_WTLS_12 ECCurve_NIST_P224 32629 #define ECCurve_SECG_PRIME_256R1 ECCurve_NIST_P256 32630 #define ECCurve_X9_62_PRIME_256V1 ECCurve_NIST_P256 32631 #define ECCurve_SECG_PRIME_384R1 ECCurve_NIST_P384 32632 #define ECCurve_SECG_PRIME_521R1 ECCurve_NIST_P521 32633 #define ECCurve_WTLS_4 ECCurve_SECG_CHAR2_113R1 32634 #define ECCurve_WTLS_6 ECCurve_SECG_PRIME_112R1 32635 #define ECCurve_WTLS_7 ECCurve_SECG_PRIME_160R1 32636 #define ECCurve_WTLS_5 ECCurve_X9_62_CHAR2_PNB163V1 32637 32638 enum ECField { 32639 ECField_GFp = 0, 32640 ECField_GF2m = 1 32641 }; 32642 typedef struct ECCurveParamsStr { 32643 char *text; 32644 enum ECField field; 32645 unsigned int size; 32646 char *irr; 32647 char *curvea; 32648 char *curveb; 32649 char *genx; 32650 char *geny; 32651 char *order; 32652 int cofactor; 32653 } ECCurveParams; 32654 enum ECCurveName { 32655 ECCurve_noName = 0, 32656 ECCurve_NIST_P192 = 1, 32657 ECCurve_NIST_P224 = 2, 32658 ECCurve_NIST_P256 = 3, 32659 ECCurve_NIST_P384 = 4, 32660 ECCurve_NIST_P521 = 5, 32661 ECCurve_NIST_K163 = 6, 32662 ECCurve_NIST_B163 = 7, 32663 ECCurve_NIST_K233 = 8, 32664 ECCurve_NIST_B233 = 9, 32665 ECCurve_NIST_K283 = 10, 32666 ECCurve_NIST_B283 = 11, 32667 ECCurve_NIST_K409 = 12, 32668 ECCurve_NIST_B409 = 13, 32669 ECCurve_NIST_K571 = 14, 32670 ECCurve_NIST_B571 = 15, 32671 ECCurve_X9_62_PRIME_192V2 = 16, 32672 ECCurve_X9_62_PRIME_192V3 = 17, 32673 ECCurve_X9_62_PRIME_239V1 = 18, 32674 ECCurve_X9_62_PRIME_239V2 = 19, 32675 ECCurve_X9_62_PRIME_239V3 = 20, 32676 ECCurve_X9_62_CHAR2_PNB163V1 = 21, 32677 ECCurve_X9_62_CHAR2_PNB163V2 = 22, 32678 ECCurve_X9_62_CHAR2_PNB163V3 = 23, 32679 ECCurve_X9_62_CHAR2_PNB176V1 = 24, 32680 ECCurve_X9_62_CHAR2_TNB191V1 = 25, 32681 ECCurve_X9_62_CHAR2_TNB191V2 = 26, 32682 ECCurve_X9_62_CHAR2_TNB191V3 = 27, 32683 ECCurve_X9_62_CHAR2_PNB208W1 = 28, 32684 ECCurve_X9_62_CHAR2_TNB239V1 = 29, 32685 ECCurve_X9_62_CHAR2_TNB239V2 = 30, 32686 ECCurve_X9_62_CHAR2_TNB239V3 = 31, 32687 ECCurve_X9_62_CHAR2_PNB272W1 = 32, 32688 ECCurve_X9_62_CHAR2_PNB304W1 = 33, 32689 ECCurve_X9_62_CHAR2_TNB359V1 = 34, 32690 ECCurve_X9_62_CHAR2_PNB368W1 = 35, 32691 ECCurve_X9_62_CHAR2_TNB431R1 = 36, 32692 ECCurve_SECG_PRIME_112R1 = 37, 32693 ECCurve_SECG_PRIME_112R2 = 38, 32694 ECCurve_SECG_PRIME_128R1 = 39, 32695 ECCurve_SECG_PRIME_128R2 = 40, 32696 ECCurve_SECG_PRIME_160K1 = 41, 32697 ECCurve_SECG_PRIME_160R1 = 42, 32698 ECCurve_SECG_PRIME_160R2 = 43, 32699 ECCurve_SECG_PRIME_192K1 = 44, 32700 ECCurve_SECG_PRIME_224K1 = 45, 32701 ECCurve_SECG_PRIME_256K1 = 46, 32702 ECCurve_SECG_CHAR2_113R1 = 47, 32703 ECCurve_SECG_CHAR2_113R2 = 48, 32704 ECCurve_SECG_CHAR2_131R1 = 49, 32705 ECCurve_SECG_CHAR2_131R2 = 50, 32706 ECCurve_SECG_CHAR2_163R1 = 51, 32707 ECCurve_SECG_CHAR2_193R1 = 52, 32708 ECCurve_SECG_CHAR2_193R2 = 53, 32709 ECCurve_SECG_CHAR2_239K1 = 54, 32710 ECCurve_WTLS_1 = 55, 32711 ECCurve_WTLS_8 = 56, 32712 ECCurve_WTLS_9 = 57, 32713 ECCurve_pastLastCurve = 58 32714 }; 32715 __________________________________________________________ 32716 32717 14.6.2. nss3/ssl.h 32718 32719 #define __ssl_h_ 32720 #define SSL_IS_SSL2_CIPHER(which) (((which) & 0xfff0) == 0xff00) 32721 #define SSL_REQUIRE_NEVER ((PRBool)0) 32722 #define SSL_REQUIRE_ALWAYS ((PRBool)1) 32723 #define SSL_REQUIRE_FIRST_HANDSHAKE ((PRBool)2) 32724 #define SSL_REQUIRE_NO_ERROR ((PRBool)3) 32725 #define SSL_SECURITY_STATUS_NOOPT -1 32726 #define SSL_NOT_ALLOWED 0 32727 #define SSL_SECURITY_STATUS_OFF 0 32728 #define SSL_ALLOWED 1 32729 #define SSL_SECURITY 1 32730 #define SSL_SECURITY_STATUS_ON_HIGH 1 32731 #define SSL_REQUIRE_CERTIFICATE 10 32732 #define SSL_ENABLE_FDX 11 32733 #define SSL_V2_COMPATIBLE_HELLO 12 32734 #define SSL_ENABLE_TLS 13 32735 #define SSL_ROLLBACK_DETECTION 14 32736 #define SSL_NO_STEP_DOWN 15 32737 #define SSL_BYPASS_PKCS11 16 32738 #define SSL_NO_LOCKS 17 32739 #define SSL_RESTRICTED 2 32740 #define SSL_SECURITY_STATUS_ON_LOW 2 32741 #define SSL_SOCKS 2 32742 #define SSL_REQUEST_CERTIFICATE 3 32743 #define SSL_HANDSHAKE_AS_CLIENT 5 32744 #define SSL_HANDSHAKE_AS_SERVER 6 32745 #define SSL_ENABLE_SSL2 7 32746 #define SSL_ENABLE_SSL3 8 32747 #define SSL_NO_CACHE 9 32748 #define SSL_ENV_VAR_NAME "SSL_INHERITANCE" 32749 32750 typedef SECStatus(*SSLAuthCertificate) (void *, PRFileDesc *, PRBool, 32751 PRBool); 32752 typedef SECStatus(*SSLGetClientAuthData) (void *, PRFileDesc *, 32753 CERTDistNames *, 32754 CERTCertificate * *, 32755 SECKEYPrivateKey * *); 32756 typedef SECStatus(*SSLBadCertHandler) (void *, PRFileDesc *); 32757 typedef void (*SSLHandshakeCallback) (PRFileDesc *, void *); 32758 extern SECStatus NSS_CmpCertChainWCANames(CERTCertificate * cert, 32759 CERTDistNames * caNames); 32760 extern SSLKEAType NSS_FindCertKEAType(CERTCertificate * cert); 32761 extern SECStatus NSS_GetClientAuthData(void *arg, PRFileDesc * socket, 32762 struct CERTDistNamesStr *caNames, 32763 struct CERTCertificateStr 32764 **pRetCert, 32765 struct SECKEYPrivateKeyStr 32766 **pRetKey); 32767 extern SECStatus SSL_AuthCertificate(void *arg, PRFileDesc * fd, 32768 PRBool checkSig, PRBool isServer); 32769 extern SECStatus SSL_AuthCertificateHook(PRFileDesc * fd, 32770 SSLAuthCertificate f, void *arg); 32771 extern SECStatus SSL_BadCertHook(PRFileDesc * fd, SSLBadCertHandler f, 32772 void *arg); 32773 extern SECStatus SSL_CipherPolicyGet(PRInt32 cipher, PRInt32 * policy); 32774 extern SECStatus SSL_CipherPolicySet(PRInt32 cipher, PRInt32 policy); 32775 extern SECStatus SSL_CipherPrefGet(PRFileDesc * fd, PRInt32 cipher, 32776 PRBool * enabled); 32777 extern SECStatus SSL_CipherPrefGetDefault(PRInt32 cipher, 32778 PRBool * enabled); 32779 extern SECStatus SSL_CipherPrefSet(PRFileDesc * fd, PRInt32 cipher, 32780 PRBool enabled); 32781 extern SECStatus SSL_CipherPrefSetDefault(PRInt32 cipher, PRBool enabled); 32782 extern void SSL_ClearSessionCache(void); 32783 extern SECStatus SSL_ConfigMPServerSIDCache(int maxCacheEntries, 32784 PRUint32 timeout, 32785 PRUint32 ssl3_timeout, 32786 const char *directory); 32787 extern SECStatus SSL_ConfigSecureServer(PRFileDesc * fd, 32788 CERTCertificate * cert, 32789 SECKEYPrivateKey * key, 32790 SSLKEAType kea); 32791 extern SECStatus SSL_ConfigServerSessionIDCache(int maxCacheEntries, 32792 PRUint32 timeout, 32793 PRUint32 ssl3_timeout, 32794 const char *directory); 32795 extern int SSL_DataPending(PRFileDesc * fd); 32796 extern SECStatus SSL_ForceHandshake(PRFileDesc * fd); 32797 extern SECStatus SSL_GetClientAuthDataHook(PRFileDesc * fd, 32798 SSLGetClientAuthData f, 32799 void *a); 32800 extern SECItem *SSL_GetSessionID(PRFileDesc * fd); 32801 extern SECStatus SSL_HandshakeCallback(PRFileDesc * fd, 32802 SSLHandshakeCallback cb, 32803 void *client_data); 32804 extern PRFileDesc *SSL_ImportFD(PRFileDesc * model, PRFileDesc * fd); 32805 extern SECStatus SSL_InheritMPServerSIDCache(const char *envString); 32806 extern SECStatus SSL_InvalidateSession(PRFileDesc * fd); 32807 extern SECStatus SSL_OptionGet(PRFileDesc * fd, PRInt32 option, 32808 PRBool * on); 32809 extern SECStatus SSL_OptionGetDefault(PRInt32 option, PRBool * on); 32810 extern SECStatus SSL_OptionSet(PRFileDesc * fd, PRInt32 option, PRBool on); 32811 extern SECStatus SSL_OptionSetDefault(PRInt32 option, PRBool on); 32812 extern CERTCertificate *SSL_PeerCertificate(PRFileDesc * fd); 32813 extern SECStatus SSL_ReHandshake(PRFileDesc * fd, PRBool flushCache); 32814 extern SECStatus SSL_ResetHandshake(PRFileDesc * fd, PRBool asServer); 32815 extern void *SSL_RevealPinArg(PRFileDesc * socket); 32816 extern char *SSL_RevealURL(PRFileDesc * socket); 32817 extern SECStatus SSL_SecurityStatus(PRFileDesc * fd, int *on, 32818 char **cipher, int *keySize, 32819 int *secretKeySize, char **issuer, 32820 char **subject); 32821 extern SECStatus SSL_SetPKCS11PinArg(PRFileDesc * fd, void *a); 32822 extern SECStatus SSL_SetSockPeerID(PRFileDesc * fd, const char *peerID); 32823 extern SECStatus SSL_SetURL(PRFileDesc * fd, const char *url); 32824 __________________________________________________________ 32825 32826 14.6.3. nss3/sslerr.h 32827 32828 #define __SSL_ERR_H_ 32829 #define IS_SSL_ERROR(code) \ 32830 (((code) >= SSL_ERROR_BASE) && ((code) < SSL_ERROR_LIMIT)) 32831 #define SSL_ERROR_BASE (-0x3000) 32832 #define SSL_ERROR_LIMIT (SSL_ERROR_BASE + 1000) 32833 32834 typedef enum { 32835 SSL_ERROR_EXPORT_ONLY_SERVER = (SSL_ERROR_BASE + 0), 32836 SSL_ERROR_US_ONLY_SERVER = (SSL_ERROR_BASE + 1), 32837 SSL_ERROR_NO_CYPHER_OVERLAP = (SSL_ERROR_BASE + 2), 32838 SSL_ERROR_NO_CERTIFICATE = (SSL_ERROR_BASE + 3), 32839 SSL_ERROR_BAD_CERTIFICATE = (SSL_ERROR_BASE + 4), 32840 SSL_ERROR_BAD_CLIENT = (SSL_ERROR_BASE + 6), 32841 SSL_ERROR_BAD_SERVER = (SSL_ERROR_BASE + 7), 32842 SSL_ERROR_UNSUPPORTED_CERTIFICATE_TYPE = (SSL_ERROR_BASE + 8), 32843 SSL_ERROR_UNSUPPORTED_VERSION = (SSL_ERROR_BASE + 9), 32844 SSL_ERROR_WRONG_CERTIFICATE = (SSL_ERROR_BASE + 11), 32845 SSL_ERROR_BAD_CERT_DOMAIN = (SSL_ERROR_BASE + 12), 32846 SSL_ERROR_POST_WARNING = (SSL_ERROR_BASE + 13), 32847 SSL_ERROR_SSL2_DISABLED = (SSL_ERROR_BASE + 14), 32848 SSL_ERROR_BAD_MAC_READ = (SSL_ERROR_BASE + 15), 32849 SSL_ERROR_BAD_MAC_ALERT = (SSL_ERROR_BASE + 16), 32850 SSL_ERROR_BAD_CERT_ALERT = (SSL_ERROR_BASE + 17), 32851 SSL_ERROR_REVOKED_CERT_ALERT = (SSL_ERROR_BASE + 18), 32852 SSL_ERROR_EXPIRED_CERT_ALERT = (SSL_ERROR_BASE + 19), 32853 SSL_ERROR_SSL_DISABLED = (SSL_ERROR_BASE + 20), 32854 SSL_ERROR_FORTEZZA_PQG = (SSL_ERROR_BASE + 21), 32855 SSL_ERROR_UNKNOWN_CIPHER_SUITE = (SSL_ERROR_BASE + 22), 32856 SSL_ERROR_NO_CIPHERS_SUPPORTED = (SSL_ERROR_BASE + 23), 32857 SSL_ERROR_BAD_BLOCK_PADDING = (SSL_ERROR_BASE + 24), 32858 SSL_ERROR_RX_RECORD_TOO_LONG = (SSL_ERROR_BASE + 25), 32859 SSL_ERROR_TX_RECORD_TOO_LONG = (SSL_ERROR_BASE + 26), 32860 SSL_ERROR_RX_MALFORMED_HELLO_REQUEST = (SSL_ERROR_BASE + 27), 32861 SSL_ERROR_RX_MALFORMED_CLIENT_HELLO = (SSL_ERROR_BASE + 28), 32862 SSL_ERROR_RX_MALFORMED_SERVER_HELLO = (SSL_ERROR_BASE + 29), 32863 SSL_ERROR_RX_MALFORMED_CERTIFICATE = (SSL_ERROR_BASE + 30), 32864 SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH = (SSL_ERROR_BASE + 31), 32865 SSL_ERROR_RX_MALFORMED_CERT_REQUEST = (SSL_ERROR_BASE + 32), 32866 SSL_ERROR_RX_MALFORMED_HELLO_DONE = (SSL_ERROR_BASE + 33), 32867 SSL_ERROR_RX_MALFORMED_CERT_VERIFY = (SSL_ERROR_BASE + 34), 32868 SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH = (SSL_ERROR_BASE + 35), 32869 SSL_ERROR_RX_MALFORMED_FINISHED = (SSL_ERROR_BASE + 36), 32870 SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER = (SSL_ERROR_BASE + 37), 32871 SSL_ERROR_RX_MALFORMED_ALERT = (SSL_ERROR_BASE + 38), 32872 SSL_ERROR_RX_MALFORMED_HANDSHAKE = (SSL_ERROR_BASE + 39), 32873 SSL_ERROR_RX_MALFORMED_APPLICATION_DATA = (SSL_ERROR_BASE + 40), 32874 SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST = (SSL_ERROR_BASE + 41), 32875 SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO = (SSL_ERROR_BASE + 42), 32876 SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO = (SSL_ERROR_BASE + 43), 32877 SSL_ERROR_RX_UNEXPECTED_CERTIFICATE = (SSL_ERROR_BASE + 44), 32878 SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH = (SSL_ERROR_BASE + 45), 32879 SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST = (SSL_ERROR_BASE + 46), 32880 SSL_ERROR_RX_UNEXPECTED_HELLO_DONE = (SSL_ERROR_BASE + 47), 32881 SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY = (SSL_ERROR_BASE + 48), 32882 SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH = (SSL_ERROR_BASE + 49), 32883 SSL_ERROR_RX_UNEXPECTED_FINISHED = (SSL_ERROR_BASE + 50), 32884 SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER = (SSL_ERROR_BASE + 51), 32885 SSL_ERROR_RX_UNEXPECTED_ALERT = (SSL_ERROR_BASE + 52), 32886 SSL_ERROR_RX_UNEXPECTED_HANDSHAKE = (SSL_ERROR_BASE + 53), 32887 SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA = (SSL_ERROR_BASE + 54), 32888 SSL_ERROR_RX_UNKNOWN_RECORD_TYPE = (SSL_ERROR_BASE + 55), 32889 SSL_ERROR_RX_UNKNOWN_HANDSHAKE = (SSL_ERROR_BASE + 56), 32890 SSL_ERROR_RX_UNKNOWN_ALERT = (SSL_ERROR_BASE + 57), 32891 SSL_ERROR_CLOSE_NOTIFY_ALERT = (SSL_ERROR_BASE + 58), 32892 SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT = (SSL_ERROR_BASE + 59), 32893 SSL_ERROR_DECOMPRESSION_FAILURE_ALERT = (SSL_ERROR_BASE + 60), 32894 SSL_ERROR_HANDSHAKE_FAILURE_ALERT = (SSL_ERROR_BASE + 61), 32895 SSL_ERROR_ILLEGAL_PARAMETER_ALERT = (SSL_ERROR_BASE + 62), 32896 SSL_ERROR_UNSUPPORTED_CERT_ALERT = (SSL_ERROR_BASE + 63), 32897 SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT = (SSL_ERROR_BASE + 64), 32898 SSL_ERROR_GENERATE_RANDOM_FAILURE = (SSL_ERROR_BASE + 65), 32899 SSL_ERROR_SIGN_HASHES_FAILURE = (SSL_ERROR_BASE + 66), 32900 SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE = (SSL_ERROR_BASE + 67), 32901 SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE = (SSL_ERROR_BASE + 68), 32902 SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE = (SSL_ERROR_BASE + 69), 32903 SSL_ERROR_ENCRYPTION_FAILURE = (SSL_ERROR_BASE + 70), 32904 SSL_ERROR_DECRYPTION_FAILURE = (SSL_ERROR_BASE + 71), 32905 SSL_ERROR_SOCKET_WRITE_FAILURE = (SSL_ERROR_BASE + 72), 32906 SSL_ERROR_MD5_DIGEST_FAILURE = (SSL_ERROR_BASE + 73), 32907 SSL_ERROR_SHA_DIGEST_FAILURE = (SSL_ERROR_BASE + 74), 32908 SSL_ERROR_MAC_COMPUTATION_FAILURE = (SSL_ERROR_BASE + 75), 32909 SSL_ERROR_SYM_KEY_CONTEXT_FAILURE = (SSL_ERROR_BASE + 76), 32910 SSL_ERROR_SYM_KEY_UNWRAP_FAILURE = (SSL_ERROR_BASE + 77), 32911 SSL_ERROR_PUB_KEY_SIZE_LIMIT_EXCEEDED = (SSL_ERROR_BASE + 78), 32912 SSL_ERROR_IV_PARAM_FAILURE = (SSL_ERROR_BASE + 79), 32913 SSL_ERROR_INIT_CIPHER_SUITE_FAILURE = (SSL_ERROR_BASE + 80), 32914 SSL_ERROR_SESSION_KEY_GEN_FAILURE = (SSL_ERROR_BASE + 81), 32915 SSL_ERROR_NO_SERVER_KEY_FOR_ALG = (SSL_ERROR_BASE + 82), 32916 SSL_ERROR_TOKEN_INSERTION_REMOVAL = (SSL_ERROR_BASE + 83), 32917 SSL_ERROR_TOKEN_SLOT_NOT_FOUND = (SSL_ERROR_BASE + 84), 32918 SSL_ERROR_NO_COMPRESSION_OVERLAP = (SSL_ERROR_BASE + 85), 32919 SSL_ERROR_HANDSHAKE_NOT_COMPLETED = (SSL_ERROR_BASE + 86), 32920 SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE = (SSL_ERROR_BASE + 87), 32921 SSL_ERROR_CERT_KEA_MISMATCH = (SSL_ERROR_BASE + 88), 32922 SSL_ERROR_NO_TRUSTED_SSL_CLIENT_CA = (SSL_ERROR_BASE + 89), 32923 SSL_ERROR_SESSION_NOT_FOUND = (SSL_ERROR_BASE + 90), 32924 SSL_ERROR_DECRYPTION_FAILED_ALERT = (SSL_ERROR_BASE + 91), 32925 SSL_ERROR_RECORD_OVERFLOW_ALERT = (SSL_ERROR_BASE + 92), 32926 SSL_ERROR_UNKNOWN_CA_ALERT = (SSL_ERROR_BASE + 93), 32927 SSL_ERROR_ACCESS_DENIED_ALERT = (SSL_ERROR_BASE + 94), 32928 SSL_ERROR_DECODE_ERROR_ALERT = (SSL_ERROR_BASE + 95), 32929 SSL_ERROR_DECRYPT_ERROR_ALERT = (SSL_ERROR_BASE + 96), 32930 SSL_ERROR_EXPORT_RESTRICTION_ALERT = (SSL_ERROR_BASE + 97), 32931 SSL_ERROR_PROTOCOL_VERSION_ALERT = (SSL_ERROR_BASE + 98), 32932 SSL_ERROR_INSUFFICIENT_SECURITY_ALERT = (SSL_ERROR_BASE + 99), 32933 SSL_ERROR_INTERNAL_ERROR_ALERT = (SSL_ERROR_BASE + 100), 32934 SSL_ERROR_USER_CANCELED_ALERT = (SSL_ERROR_BASE + 101), 32935 SSL_ERROR_NO_RENEGOTIATION_ALERT = (SSL_ERROR_BASE + 102), 32936 SSL_ERROR_SERVER_CACHE_NOT_CONFIGURED = (SSL_ERROR_BASE + 103), 32937 SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT = (SSL_ERROR_BASE + 104), 32938 SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT = (SSL_ERROR_BASE + 105), 32939 SSL_ERROR_UNRECOGNIZED_NAME_ALERT = (SSL_ERROR_BASE + 106), 32940 SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT = (SSL_ERROR_BASE + 107), 32941 SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT = (SSL_ERROR_BASE + 108) 32942 } SSLErrorCodes; 32943 __________________________________________________________ 32944 32945 14.6.4. nss3/sslproto.h 32946 32947 #define __sslproto_h_ 32948 #define SSL_MT_ERROR 0 32949 #define SSL_NULL_WITH_NULL_NULL 0x0000 32950 #define SSL_PE_NO_CYPHERS 0x0001 32951 #define SSL_RSA_WITH_NULL_MD5 0x0001 32952 #define SSL_LIBRARY_VERSION_2 0x0002 32953 #define SSL_PE_NO_CERTIFICATE 0x0002 32954 #define SSL_RSA_WITH_NULL_SHA 0x0002 32955 #define SSL_RSA_EXPORT_WITH_RC4_40_MD5 0x0003 32956 #define SSL_PE_BAD_CERTIFICATE 0x0004 32957 #define SSL_RSA_WITH_RC4_128_MD5 0x0004 32958 #define SSL_RSA_WITH_RC4_128_SHA 0x0005 32959 #define SSL_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 32960 #define SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 0x0006 32961 #define SSL_RSA_WITH_IDEA_CBC_SHA 0x0007 32962 #define SSL_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0008 32963 #define SSL_RSA_WITH_DES_CBC_SHA 0x0009 32964 #define SSL_RSA_WITH_3DES_EDE_CBC_SHA 0x000a 32965 #define SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA 0x000b 32966 #define SSL_DH_DSS_WITH_DES_CBC_SHA 0x000c 32967 #define SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA 0x000d 32968 #define SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA 0x000e 32969 #define SSL_DH_RSA_WITH_DES_CBC_SHA 0x000f 32970 #define SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA 0x0010 32971 #define SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA 0x0011 32972 #define SSL_DHE_DSS_WITH_DES_CBC_SHA 0x0012 32973 #define SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA 0x0013 32974 #define SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA 0x0014 32975 #define SSL_DHE_RSA_WITH_DES_CBC_SHA 0x0015 32976 #define SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x0016 32977 #define SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5 0x0017 32978 #define SSL_DH_ANON_WITH_RC4_128_MD5 0x0018 32979 #define SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA 0x0019 32980 #define SSL_DH_ANON_WITH_DES_CBC_SHA 0x001a 32981 #define SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA 0x001b 32982 #define SSL_FORTEZZA_DMS_WITH_NULL_SHA 0x001c 32983 #define SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA 0x001d 32984 #define SSL_FORTEZZA_DMS_WITH_RC4_128_SHA 0x001e 32985 #define TLS_RSA_WITH_AES_128_CBC_SHA 0x002F 32986 #define TLS_DH_DSS_WITH_AES_128_CBC_SHA 0x0030 32987 #define TLS_DH_RSA_WITH_AES_128_CBC_SHA 0x0031 32988 #define TLS_DHE_DSS_WITH_AES_128_CBC_SHA 0x0032 32989 #define TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x0033 32990 #define TLS_DH_ANON_WITH_AES_128_CBC_SHA 0x0034 32991 #define TLS_RSA_WITH_AES_256_CBC_SHA 0x0035 32992 #define TLS_DH_DSS_WITH_AES_256_CBC_SHA 0x0036 32993 #define TLS_DH_RSA_WITH_AES_256_CBC_SHA 0x0037 32994 #define TLS_DHE_DSS_WITH_AES_256_CBC_SHA 0x0038 32995 #define TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x0039 32996 #define TLS_DH_ANON_WITH_AES_256_CBC_SHA 0x003A 32997 #define TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x0062 32998 #define TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x0063 32999 #define TLS_RSA_EXPORT1024_WITH_RC4_56_SHA 0x0064 33000 #define TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x0065 33001 #define TLS_DHE_DSS_WITH_RC4_128_SHA 0x0066 33002 #define SSL_AT_MD5_WITH_RSA_ENCRYPTION 0x01 33003 #define SSL_CK_RC4_128_WITH_MD5 0x01 33004 #define SSL_CT_X509_CERTIFICATE 0x01 33005 #define SSL_CK_RC4_128_EXPORT40_WITH_MD5 0x02 33006 #define SSL_CK_RC2_128_CBC_WITH_MD5 0x03 33007 #define SSL_LIBRARY_VERSION_3_0 0x0300 33008 #define SSL_LIBRARY_VERSION_3_1_TLS 0x0301 33009 #define SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x04 33010 #define SSL_CK_IDEA_128_CBC_WITH_MD5 0x05 33011 #define SSL_CK_DES_64_CBC_WITH_MD5 0x06 33012 #define SSL_CK_DES_192_EDE3_CBC_WITH_MD5 0x07 33013 #define TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 33014 #define TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 33015 #define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 33016 #define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 33017 #define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005 33018 #define TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 33019 #define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 33020 #define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 33021 #define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 33022 #define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A 33023 #define TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B 33024 #define TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C 33025 #define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D 33026 #define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E 33027 #define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F 33028 #define TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 33029 #define TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 33030 #define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 33031 #define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 33032 #define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014 33033 #define TLS_ECDH_anon_WITH_NULL_SHA 0xC015 33034 #define TLS_ECDH_anon_WITH_RC4_128_SHA 0xC016 33035 #define TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA 0xC017 33036 #define TLS_ECDH_anon_WITH_AES_128_CBC_SHA 0xC018 33037 #define TLS_ECDH_anon_WITH_AES_256_CBC_SHA 0xC019 33038 #define SSL_RSA_FIPS_WITH_DES_CBC_SHA 0xfefe 33039 #define SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA 0xfeff 33040 #define SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA 0xffe0 33041 #define SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA 0xffe1 33042 #define SSL_HL_CLIENT_FINISHED_HBYTES 1 33043 #define SSL_HL_SERVER_FINISHED_HBYTES 1 33044 #define SSL_HL_SERVER_VERIFY_HBYTES 1 33045 #define SSL_MT_CLIENT_HELLO 1 33046 #define SSL_HL_CLIENT_MASTER_KEY_HBYTES 10 33047 #define SSL_HL_SERVER_HELLO_HBYTES 11 33048 #define SSL_HL_REQUEST_CERTIFICATE_HBYTES 2 33049 #define SSL_MT_CLIENT_MASTER_KEY 2 33050 #define SSL_HL_ERROR_HBYTES 3 33051 #define SSL_MT_CLIENT_FINISHED 3 33052 #define SSL_MT_SERVER_HELLO 4 33053 #define SSL_MT_SERVER_VERIFY 5 33054 #define SSL_HL_CLIENT_CERTIFICATE_HBYTES 6 33055 #define SSL_MT_SERVER_FINISHED 6 33056 #define SSL_MT_REQUEST_CERTIFICATE 7 33057 #define SSL_MT_CLIENT_CERTIFICATE 8 33058 #define SSL_HL_CLIENT_HELLO_HBYTES 9 33059 __________________________________________________________ 33060 33061 14.6.5. nss3/sslt.h 33062 33063 #define __sslt_h_ 33064 33065 typedef enum { 33066 ssl_kea_null, 33067 ssl_kea_rsa = 1, 33068 ssl_kea_dh = 2, 33069 ssl_kea_fortezza = 3, 33070 ssl_kea_ecdh = 4, 33071 ssl_kea_size = 5 33072 } SSLKEAType; 33073 typedef enum { 33074 ssl_sign_null, 33075 ssl_sign_rsa = 1, 33076 ssl_sign_dsa = 2, 33077 ssl_sign_ecdsa = 3 33078 } SSLSignType; 33079 typedef enum { 33080 ssl_auth_null, 33081 ssl_auth_rsa = 1, 33082 ssl_auth_dsa = 2, 33083 ssl_auth_kea = 3, 33084 ssl_auth_ecdsa = 4 33085 } SSLAuthType; 33086 typedef enum { 33087 ssl_calg_null, 33088 ssl_calg_rc4 = 1, 33089 ssl_calg_rc2 = 2, 33090 ssl_calg_des = 3, 33091 ssl_calg_3des = 4, 33092 ssl_calg_idea = 5, 33093 ssl_calg_fortezza = 6, 33094 ssl_calg_aes = 7, 33095 ssl_calg_camellia = 8 33096 } SSLCipherAlgorithm; 33097 typedef enum { 33098 ssl_mac_null, 33099 ssl_mac_md5 = 1, 33100 ssl_mac_sha = 2, 33101 ssl_hmac_md5 = 3, 33102 ssl_hmac_sha = 4 33103 } SSLMACAlgorithm; 33104 typedef struct SSLChannelInfoStr { 33105 PRUint32 length; 33106 PRUint16 protocolVersion; 33107 PRUint16 cipherSuite; 33108 PRUint32 authKeyBits; 33109 PRUint32 keaKeyBits; 33110 PRUint32 creationTime; 33111 PRUint32 lastAccessTime; 33112 PRUint32 expirationTime; 33113 PRUint32 sessionIDLength; 33114 PRUint8 sessionID[31]; 33115 } SSLChannelInfo; 33116 typedef struct SSLCipherSuiteInfoStr { 33117 PRUint16 length; 33118 PRUint16 cipherSuite; 33119 const char *cipherSuiteName; 33120 const char *authAlgorithmName; 33121 SSLAuthType authAlgorithm; 33122 const char *keaTypeName; 33123 SSLKEAType keaType; 33124 const char *symCipherName; 33125 SSLCipherAlgorithm symCipher; 33126 PRUint16 symKeyBits; 33127 PRUint16 symKeySpace; 33128 PRUint16 effectiveKeyBits; 33129 const char *macAlgorithmName; 33130 SSLMACAlgorithm macAlgorithm; 33131 PRUint16 macBits; 33132 PRUintn isFIPS:1; 33133 PRUintn isExportable:1; 33134 PRUintn nonStandard:1; 33135 PRUintn reservedBits:29; 33136 } SSLCipherSuiteInfo; 33137 33138 VI. Commands and Utilities 33139 33140 Table of Contents 33141 15. Commands and Utilities 33142 33143 15.1. Commands and Utilities 33144 15.2. Command Behavior 33145 33146 ar -- create and maintain library archives 33147 (DEPRECATED) 33148 33149 at -- examine or delete jobs for later execution 33150 awk -- pattern scanning and processing language 33151 batch -- schedule commands to be executed in a batch 33152 queue 33153 33154 bc -- an arbitrary precision calculator language 33155 chfn -- change user name and information 33156 chsh -- change login shell 33157 col -- filter reverse line feeds from input 33158 cpio -- copy file archives in and out 33159 crontab -- maintain crontab files for individual 33160 users 33161 33162 df -- report file system disk space usage 33163 dmesg -- print or control the system message buffer 33164 du -- estimate file space usage 33165 echo -- write arguments to standard output 33166 egrep -- search a file with an Extended Regular 33167 Expression pattern 33168 33169 fgrep -- search a file with a fixed pattern 33170 file -- determine file type 33171 fuser -- identify processes using files or sockets 33172 gettext -- retrieve text string from message catalog 33173 grep -- print lines matching a pattern 33174 groupadd -- create a new group 33175 groupdel -- delete a group 33176 groupmod -- modify a group 33177 groups -- display a group 33178 gunzip -- uncompress files 33179 gzip -- compress or expand files 33180 hostname -- show or set the system's host name 33181 install -- copy files and set attributes 33182 install_initd -- activate an init script 33183 ipcrm -- remove IPC Resources 33184 ipcs -- provide information on ipc facilities 33185 killall -- kill processes by name 33186 lpr -- off line print 33187 ls -- list directory contents 33188 lsb_release -- print distribution specific 33189 information 33190 33191 m4 -- macro processor 33192 md5sum -- generate or check MD5 message digests 33193 mknod -- make special files 33194 mktemp -- make temporary file name (unique) 33195 more -- display files on a page-by-page basis 33196 mount -- mount a file system 33197 msgfmt -- create a message object from a message 33198 file 33199 33200 newgrp -- change group ID 33201 od -- dump files in octal and other formats 33202 passwd -- change user password 33203 patch -- apply a diff file to an original 33204 pidof -- find the process ID of a running program 33205 remove_initd -- clean up init script system 33206 modifications introduced by install_initd 33207 33208 renice -- alter priority of running processes 33209 sed -- stream editor 33210 sendmail -- an electronic mail transport agent 33211 seq -- generate a sequence of numbers 33212 sh -- shell, the standard command language 33213 interpreter 33214 33215 shutdown -- shut the system down 33216 su -- change user ID 33217 sync -- flush file system buffers 33218 tar -- file archiver 33219 umount -- unmount file systems 33220 useradd -- create a new user or update default new 33221 user information 33222 33223 userdel -- delete a user account and related files 33224 usermod -- modify a user account 33225 xargs -- build and execute command lines from 33226 standard input 33227 33228 zcat -- uncompress files to standard output 33229 __________________________________________________________ 33230 33231 Chapter 15. Commands and Utilities 33232 33233 15.1. Commands and Utilities 33234 33235 An LSB conforming implementation shall provide the commands and 33236 utilities as described in Table 15-1, with at least the 33237 behavior described as mandatory in the referenced underlying 33238 specification, with the following exceptions: 33239 33240 1. If any operand (except one which follows --) starts with a 33241 hyphen, the behavior is unspecified. 33242 33243 Rationale (Informative): Applications should place options 33244 before operands, or use --, as needed. This text is needed 33245 because, by default, GNU option parsing differs from POSIX, 33246 unless the environment variable POSIXLY_CORRECT is set. For 33247 example, ls . -a in GNU ls means to list the current 33248 directory, showing all files (that is, "." is an operand and 33249 -a is an option). In POSIX, "." and -a are both operands, 33250 and the command means to list the current directory, and 33251 also the file named -a. Suggesting that applications rely on 33252 the setting of the POSIXLY_CORRECT environment variable, or 33253 try to set it, seems worse than just asking the applications 33254 to invoke commands in ways which work with either the POSIX 33255 or GNU behaviors. 33256 33257 Table 15-1. Commands And Utilities 33258 [ [1] dmesg [2] id [1] msgfmt [2] split [1] 33259 ar [2] du [2] install [2] mv [1] strings [1] 33260 at [2] echo [2] install_initd [2] newgrp [2] strip [1] 33261 awk [2] ed [1] ipcrm [2] nice [1] stty [1] 33262 basename [1] egrep [2] ipcs [2] nl [1] su [2] 33263 batch [2] env [1] join [1] nohup [1] sync [2] 33264 bc [2] expand [1] kill [1] od [2] tail [1] 33265 cat [1] expr [1] killall [2] passwd [2] tar [2] 33266 chfn [2] false [1] ln [1] paste [1] tee [1] 33267 chgrp [1] fgrep [2] locale [1] patch [2] test [1] 33268 chmod [1] file [2] localedef [1] pathchk [1] time [1] 33269 chown [1] find [2] logger [1] pax [1] touch [1] 33270 chsh [2] find [1] logname [1] pidof [2] tr [1] 33271 cksum [1] fold [1] lp [1] pr [1] true [1] 33272 cmp [1] fuser [2] lpr [2] printf [1] tsort [1] 33273 col [2] gencat [1] ls [2] ps [1] tty [1] 33274 comm [1] getconf [1] lsb_release [2] pwd [1] umount [2] 33275 cp [1] gettext [2] m4 [2] remove_initd [2] uname [1] 33276 cpio [2] grep [2] mailx [1] renice [2] unexpand [1] 33277 crontab [2] groupadd [2] make [1] rm [1] uniq [1] 33278 csplit [1] groupdel [2] man [1] rmdir [1] useradd [2] 33279 cut [2] groupmod [2] md5sum [2] sed [2] userdel [2] 33280 cut [1] groups [2] mkdir [1] sendmail [2] usermod [2] 33281 date [1] gunzip [2] mkfifo [1] seq [2] wc [1] 33282 dd [1] gzip [2] mknod [2] sh [2] xargs [2] 33283 df [2] head [1] mktemp [2] shutdown [2] zcat [2] 33284 diff [1] hostname [2] more [2] sleep [1] 33285 dirname [1] iconv [1] mount [2] sort [1] 33286 33287 Referenced Specification(s) 33288 33289 [1]. POSIX 1003.1-2001 (ISO/IEC 9945-2003) 33290 33291 [2]. This Specification 33292 33293 An LSB conforming implementation shall provide the shell built 33294 in utilities as described in Table 15-2, with at least the 33295 behavior described as mandatory in the referenced underlying 33296 specification, with the following exceptions: 33297 33298 1. The built in commands and utilities shall be provided by 33299 the sh utility itself, and need not be implemented in a 33300 manner so that they can be accessed via the exec family of 33301 functions as defined in POSIX 1003.1-2001 (ISO/IEC 33302 9945-2003) and should not be invoked directly by those 33303 standard utilities that execute other utilities ( env, 33304 find, nice, nohup, time, xargs). 33305 33306 Rationale (Informative): Since the built in utilities must 33307 affect the environment of the calling process, they have no 33308 effect when executed as a file. 33309 33310 Table 15-2. Built In Utilities 33311 alias [1] command [1] getopts [1] read [1] umask [1] 33312 bg [1] fc [1] hash [1] type [1] unalias [1] 33313 cd [1] fg [1] jobs [1] ulimit [1] wait [1] 33314 33315 Referenced Specification(s) 33316 33317 [1]. POSIX 1003.1-2001 (ISO/IEC 9945-2003) 33318 __________________________________________________________ 33319 33320 15.2. Command Behavior 33321 33322 Table of Contents 33323 ar -- create and maintain library archives (DEPRECATED) 33324 at -- examine or delete jobs for later execution 33325 awk -- pattern scanning and processing language 33326 batch -- schedule commands to be executed in a batch queue 33327 bc -- an arbitrary precision calculator language 33328 chfn -- change user name and information 33329 chsh -- change login shell 33330 col -- filter reverse line feeds from input 33331 cpio -- copy file archives in and out 33332 crontab -- maintain crontab files for individual users 33333 df -- report file system disk space usage 33334 dmesg -- print or control the system message buffer 33335 du -- estimate file space usage 33336 echo -- write arguments to standard output 33337 egrep -- search a file with an Extended Regular Expression 33338 pattern 33339 33340 fgrep -- search a file with a fixed pattern 33341 file -- determine file type 33342 fuser -- identify processes using files or sockets 33343 gettext -- retrieve text string from message catalog 33344 grep -- print lines matching a pattern 33345 groupadd -- create a new group 33346 groupdel -- delete a group 33347 groupmod -- modify a group 33348 groups -- display a group 33349 gunzip -- uncompress files 33350 gzip -- compress or expand files 33351 hostname -- show or set the system's host name 33352 install -- copy files and set attributes 33353 install_initd -- activate an init script 33354 ipcrm -- remove IPC Resources 33355 ipcs -- provide information on ipc facilities 33356 killall -- kill processes by name 33357 lpr -- off line print 33358 ls -- list directory contents 33359 lsb_release -- print distribution specific information 33360 m4 -- macro processor 33361 md5sum -- generate or check MD5 message digests 33362 mknod -- make special files 33363 mktemp -- make temporary file name (unique) 33364 more -- display files on a page-by-page basis 33365 mount -- mount a file system 33366 msgfmt -- create a message object from a message file 33367 newgrp -- change group ID 33368 od -- dump files in octal and other formats 33369 passwd -- change user password 33370 patch -- apply a diff file to an original 33371 pidof -- find the process ID of a running program 33372 remove_initd -- clean up init script system modifications 33373 introduced by install_initd 33374 33375 renice -- alter priority of running processes 33376 sed -- stream editor 33377 sendmail -- an electronic mail transport agent 33378 seq -- generate a sequence of numbers 33379 sh -- shell, the standard command language interpreter 33380 shutdown -- shut the system down 33381 su -- change user ID 33382 sync -- flush file system buffers 33383 tar -- file archiver 33384 umount -- unmount file systems 33385 useradd -- create a new user or update default new user 33386 information 33387 33388 userdel -- delete a user account and related files 33389 usermod -- modify a user account 33390 xargs -- build and execute command lines from standard input 33391 zcat -- uncompress files to standard output 33392 33393 This section contains descriptions for commands and utilities 33394 whose specified behavior in the LSB contradicts or extends the 33395 standards referenced. It also contains commands and utilities 33396 only required by the LSB and not specified by other standards. 33397 33398 ar 33399 33400 Name 33401 33402 ar -- create and maintain library archives (DEPRECATED) 33403 33404 Description 33405 33406 ar is deprecated from the LSB and is expected to disappear from 33407 a future version of the LSB. 33408 33409 Rationale: The LSB generally does not include software 33410 development utilities nor does it specify .o and .a file 33411 formats. 33412 33413 ar is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003) but 33414 with differences as listed below. 33415 33416 Differences 33417 33418 -T, -C 33419 33420 need not be accepted. 33421 -l 33422 33423 has unspecified behavior. 33424 -q 33425 33426 has unspecified behavior; using -r is suggested. 33427 33428 at 33429 33430 Name 33431 33432 at -- examine or delete jobs for later execution 33433 33434 Description 33435 33436 at is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003) but 33437 with differences as listed below. 33438 33439 Differences 33440 33441 Options 33442 33443 -d 33444 33445 is functionally equivalent to the -r option specified in POSIX 33446 1003.1-2001 (ISO/IEC 9945-2003). 33447 -r 33448 33449 need not be supported, but the '-d' option is equivalent. 33450 -t time 33451 33452 need not be supported. 33453 33454 Optional Control Files 33455 33456 The implementation shall support the XSI optional behavior for 33457 access control; however the files at.allow and at.deny may 33458 reside in /etc rather than /usr/lib/cron. 33459 33460 awk 33461 33462 Name 33463 33464 awk -- pattern scanning and processing language 33465 33466 Description 33467 33468 awk is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003) 33469 but with differences as listed below. 33470 33471 Differences 33472 33473 Certain aspects of internationalized regular expressions are 33474 optional; see Regular Expressions. 33475 33476 batch 33477 33478 Name 33479 33480 batch -- schedule commands to be executed in a batch queue 33481 33482 Description 33483 33484 The specification for batch is as specified in POSIX 33485 1003.1-2001 (ISO/IEC 9945-2003), but with differences as listed 33486 below. 33487 33488 Optional Control Files 33489 33490 The implementation shall support the XSI optional behavior for 33491 access control; however the files at.allow and at.deny may 33492 reside in /etc rather than /usr/lib/cron. 33493 33494 bc 33495 33496 Name 33497 33498 bc -- an arbitrary precision calculator language 33499 33500 Description 33501 33502 bc is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003) but 33503 with extensions as listed below. 33504 33505 Extensions 33506 33507 The bc language may be extended in an implementation defined 33508 manner. If an implementation supports extensions, it shall also 33509 support the additional options: 33510 33511 -s|--standard 33512 33513 processes exactly the POSIX bc language. 33514 -w|--warn 33515 33516 gives warnings for extensions to POSIX bc. 33517 33518 chfn 33519 33520 Name 33521 33522 chfn -- change user name and information 33523 33524 Synopsis 33525 33526 chfn [-f full_name] [-h home_phone] [user] 33527 33528 Description 33529 33530 chfn shall update the user database. An unprivileged user may 33531 only change the fields for their own account, a user with 33532 appropriate privileges may change the fields for any account. 33533 33534 The fields full_name and home_phone may contain any character 33535 except: 33536 33537 any control character 33538 comma 33539 colon 33540 equal sign 33541 33542 If none of the options are selected, chfn operates in an 33543 interactive fashion. The prompts and expected input in 33544 interactive mode are unspecified and should not be relied upon. 33545 33546 As it is possible for the system to be configured to restrict 33547 which fields a non-privileged user is permitted to change, 33548 applications should be written to gracefully handle these 33549 situations. 33550 33551 Standard Options 33552 33553 -f full_name 33554 33555 sets the user's full name. 33556 -h home_phone 33557 33558 sets the user's home phone number. 33559 33560 Future Directions 33561 33562 The following two options are expected to be added in a future 33563 version of the LSB: 33564 33565 -o office 33566 33567 sets the user's office room number. 33568 -p office_phone 33569 33570 sets the user's office phone number. 33571 33572 Note that some implementations contain a "-o other" option 33573 which specifies an additional field called "other". 33574 Traditionally, this field is not subject to the constraints 33575 about legitimate characters in fields. Also, one traditionally 33576 shall have appropriate privileges to change the other field. At 33577 this point there is no consensus about whether it is desirable 33578 to specify the other field; applications may wish to avoid 33579 using it. 33580 33581 The "-w work_phone" field found in some implementations should 33582 be replaced by the "-p office_phone" field. The "-r 33583 room_number" field found in some implementations is the 33584 equivalent of the "-o office" option mentioned above; which one 33585 of these two options to specify will depend on implementation 33586 experience and the decision regarding the other field. 33587 33588 chsh 33589 33590 Name 33591 33592 chsh -- change login shell 33593 33594 Synopsis 33595 33596 chsh [-s login_shell] [user] 33597 33598 Description 33599 33600 chsh changes the user login shell. This determines the name of 33601 the user's initial login command. An unprivileged user may only 33602 change the login shell for their own account, a user with 33603 appropriate privilege may change the login shell for any 33604 account specified by user. 33605 33606 Unless the user has appropriate privilege, the initial login 33607 command name shall be one of those listed in /etc/shells. The 33608 login_shell shall be the absolute path (i.e. it must start with 33609 '/') to an executable file. Accounts which are restricted (in 33610 an implementation-defined manner) may not change their login 33611 shell. 33612 33613 If the -s option is not selected, chsh operates in an 33614 interactive mode. The prompts and expected input in this mode 33615 are unspecified. 33616 33617 Standard Options 33618 33619 -s login_shell 33620 33621 sets the login shell. 33622 33623 col 33624 33625 Name 33626 33627 col -- filter reverse line feeds from input 33628 33629 Description 33630 33631 col is as specified in SUSv2 but with differences as listed 33632 below. 33633 33634 Differences 33635 33636 The -p option has unspecified behavior. 33637 33638 Note: Although col is shown as legacy in SUSv2, it is not 33639 (yet) deprecated in the LSB. 33640 33641 cpio 33642 33643 Name 33644 33645 cpio -- copy file archives in and out 33646 33647 Description 33648 33649 cpio is as specified in SUSv2, but with differences as listed 33650 below. 33651 33652 Differences 33653 33654 Some elements of the Pattern Matching Notation are optional; 33655 see Pattern Matching Notation. 33656 33657 crontab 33658 33659 Name 33660 33661 crontab -- maintain crontab files for individual users 33662 33663 Synopsis 33664 33665 crontab [-u user] file 33666 crontab [-u user] {-l | -r | -e} 33667 33668 Description 33669 33670 crontab is as specified in POSIX 1003.1-2001 (ISO/IEC 33671 9945-2003), but with differences as listed below. 33672 33673 Optional Control Files 33674 33675 The implementation shall support the XSI optional behavior for 33676 access control; however the files cron.allow and cron.deny may 33677 reside in /etc rather than /usr/lib/cron. 33678 33679 df 33680 33681 Name 33682 33683 df -- report file system disk space usage 33684 33685 Description 33686 33687 The df command shall behave as specified in POSIX 1003.1-2001 33688 (ISO/IEC 9945-2003), but with differences as listed below. 33689 33690 Differences 33691 33692 Options 33693 33694 If the -k option is not specified, disk space is shown in 33695 unspecified units. If the -P option is specified, the size of 33696 the unit shall be printed on the header line in the format 33697 "%4s-blocks". Applications should specify -k. 33698 33699 The XSI option -t has unspecified behavior. Applications should 33700 not specify -t. 33701 33702 Rationale: The most common implementation of df uses the -t 33703 option for a different purpose (restricting output to a 33704 particular file system type), and use of -t is therefore 33705 non-portable. 33706 33707 Operand May Identify Special File 33708 33709 If an argument is the absolute file name of a special file 33710 containing a mounted file system, df shall show the space 33711 available on that file system rather than on the file system 33712 containing the special file (which is typically the root file 33713 system). 33714 33715 Note: In POSIX 1003.1-2001 (ISO/IEC 9945-2003) the XSI 33716 optional behavior permits an operand to name a special file, 33717 but appears to require the operation be performed on the 33718 file system containing the special file. A defect report has 33719 been submitted for this case. 33720 33721 dmesg 33722 33723 Name 33724 33725 dmesg -- print or control the system message buffer 33726 33727 Synopsis 33728 33729 dmesg [-c | -n level | -s bufsize] 33730 33731 Description 33732 33733 dmesg examines or controls the system message buffer. Only a 33734 user with appropriate privileges may modify the system message 33735 buffer parameters or contents. 33736 33737 Standard Options 33738 33739 -c 33740 33741 If the user has appropriate privilege, clears the system 33742 message buffer contents after printing. 33743 -n level 33744 33745 If the user has appropriate privilege, sets the level at which 33746 logging of messages is done to the console. 33747 -s bufsize 33748 33749 uses a buffer of bufsize to query the system message buffer. 33750 This is 16392 by default. 33751 33752 du 33753 33754 Name 33755 33756 du -- estimate file space usage 33757 33758 Description 33759 33760 du is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 33761 but with differences as listed below. 33762 33763 Differences 33764 33765 If the -k option is not specified, disk space is shown in 33766 unspecified units. Applications should specify -k. 33767 33768 echo 33769 33770 Name 33771 33772 echo -- write arguments to standard output 33773 33774 Synopsis 33775 33776 echo [string...] 33777 33778 Description 33779 33780 The echo command is as specified in POSIX 1003.1-2001 (ISO/IEC 33781 9945-2003), but with the following differences. 33782 33783 Implementations may support implementation-defined options to 33784 echo. The behavior of echo if any arguments contain backslashes 33785 is also implementation defined. 33786 33787 Application Usage 33788 33789 Conforming applications should not run echo with a first 33790 argument starting with a hyphen, or with any arguments 33791 containing backslashes; they should use printf in those cases. 33792 33793 Note: The behavior specified here is similar to that 33794 specified by POSIX 1003.1-2001 (ISO/IEC 9945-2003) without 33795 the XSI option. However, the LSB strongly recommends 33796 conforming applications not use any options (even if the 33797 implementation provides them) while POSIX 1003.1-2001 33798 (ISO/IEC 9945-2003) specifies behavior if the first operand 33799 is the string -n. 33800 33801 egrep 33802 33803 Name 33804 33805 egrep -- search a file with an Extended Regular Expression 33806 pattern 33807 33808 Description 33809 33810 egrep is equivalent to grep -E. For further details, see the 33811 specification for grep. 33812 33813 fgrep 33814 33815 Name 33816 33817 fgrep -- search a file with a fixed pattern 33818 33819 Description 33820 33821 fgrep is equivalent to grep -F. For further details, see the 33822 specification for grep. 33823 33824 file 33825 33826 Name 33827 33828 file -- determine file type 33829 33830 Description 33831 33832 file is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 33833 but with differences as listed below. 33834 33835 Differences 33836 33837 The -M, -h, -d, and -i options need not be supported. 33838 33839 fuser 33840 33841 Name 33842 33843 fuser -- identify processes using files or sockets 33844 33845 Description 33846 33847 fuser is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 33848 but with differences as listed below. 33849 33850 Differences 33851 33852 The fuser command is a system administration utility, see Path 33853 For System Administration Utilities. 33854 33855 Option Differences 33856 33857 -c 33858 33859 has unspecified behavior. 33860 -f 33861 33862 has unspecified behavior. 33863 33864 gettext 33865 33866 Name 33867 33868 gettext -- retrieve text string from message catalog 33869 33870 Synopsis 33871 33872 gettext [options] [textdomain] msgid 33873 gettext -s [options] msgid... 33874 33875 Description 33876 33877 The gettext utility retrieves a translated text string 33878 corresponding to string msgid from a message object generated 33879 with msgfmt utility. 33880 33881 The message object name is derived from the optional argument 33882 textdomain if present, otherwise from the TEXTDOMAIN 33883 environment variable. If no domain is specified, or if a 33884 corresponding string cannot be found, gettext prints msgid. 33885 33886 Ordinarily gettext looks for its message object in 33887 dirname/lang/LC_MESSAGES where dirname is the 33888 implementation-defined default directory and lang is the locale 33889 name. If present, the TEXTDOMAINDIR environment variable 33890 replaces the dirname. 33891 33892 This utility interprets C escape sequences such as \t for tab. 33893 Use \\ to print a backslash. To produce a message on a line of 33894 its own, either put a \n at the end of msgid, or use this 33895 command in conjunction with the printf utility. 33896 33897 When used with the -s option the gettext utility behaves like 33898 the echo utility, except that the message corresponding to 33899 msgid in the selected catalog provides the arguments. 33900 33901 Options 33902 33903 -d domainname, --domain=domainname 33904 33905 PARAMETER translated messages from domainname. 33906 -e 33907 33908 Enable expansion of some escape sequences. 33909 -n 33910 33911 Suppress trailing newline. 33912 33913 Operands 33914 33915 The following operands are supported: 33916 33917 textdomain 33918 33919 A domain name used to retrieve the messages. 33920 msgid 33921 33922 A key to retrieve the localized message. 33923 33924 Environment Variables 33925 33926 LANGUAGE 33927 33928 Specifies one or more locale names. 33929 LANG 33930 33931 Specifies locale name. 33932 LC_MESSAGES 33933 33934 Specifies messaging locale, and if present overrides LANG for 33935 messages. 33936 TEXTDOMAIN 33937 33938 Specifies the text domain name, which is identical to the 33939 message object filename without .mo suffix. 33940 TEXTDOMAINDIR 33941 33942 Specifies the pathname to the message catalog, and if present 33943 replaces the implementation-defined default directory. 33944 33945 Exit Status 33946 33947 The following exit values are returned: 33948 33949 0 33950 33951 Successful completion. 33952 >0 33953 33954 An error occurred. 33955 33956 grep 33957 33958 Name 33959 33960 grep -- print lines matching a pattern 33961 33962 Description 33963 33964 grep is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 33965 but with differences as listed below. 33966 33967 LSB Differences 33968 33969 Certain aspects of regular expression matching are optional; 33970 see Regular Expressions. 33971 33972 groupadd 33973 33974 Name 33975 33976 groupadd -- create a new group 33977 33978 Synopsis 33979 33980 groupadd [-g gid [-o]] group 33981 33982 Description 33983 33984 If the caller has appropriate privilege, the groupadd command 33985 shall create a new group named group. The group name shall be 33986 unique in the group database. If no gid is specified, groupadd 33987 shall create the new group with a unique group ID. 33988 33989 The groupadd command is a system administration utility, see 33990 Path For System Administration Utilities. 33991 33992 Options 33993 33994 -g gid [-o] 33995 33996 The new group shall have group ID gid. If the -o option is not 33997 used, no other group shall have this group ID. The value of gid 33998 shall be non-negative. 33999 34000 groupdel 34001 34002 Name 34003 34004 groupdel -- delete a group 34005 34006 Synopsis 34007 34008 groupdel group 34009 34010 Description 34011 34012 If the caller has sufficient privilege, the groupdel command 34013 shall modify the system group database, deleting the group 34014 named group. If the group named group does not exist, groupdel 34015 shall issue a diagnostic message and exit with a non-zero exit 34016 status. 34017 34018 The groupdel command is a system administration utility, see 34019 Path For System Administration Utilities. 34020 34021 groupmod 34022 34023 Name 34024 34025 groupmod -- modify a group 34026 34027 Synopsis 34028 34029 groupmod [-g gid [-o]] [-n group_name] group 34030 34031 Description 34032 34033 If the caller has appropriate privilege, the groupmod command 34034 shall modify the entry in the system group database 34035 corresponding to a group named group. 34036 34037 The groupmod command is a system administration utility, see 34038 Path For System Administration Utilities. 34039 34040 Options 34041 34042 -g gid [-o] 34043 34044 Modify the group's group ID, setting it to gid. If the -o 34045 option is not used, no other group shall have this group ID. 34046 The value of gidshall be non-negative. 34047 34048 Note: Only the group ID in the database is altered; any 34049 files with group ownership set to the original group ID are 34050 unchanged by this modification. 34051 34052 -n group_name 34053 34054 changes the name of the group from group to group_name. 34055 34056 groups 34057 34058 Name 34059 34060 groups -- display a group 34061 34062 Synopsis 34063 34064 groups [user] 34065 34066 Description 34067 34068 The groups command shall behave as id -Gn [user], as specified 34069 in POSIX 1003.1-2001 (ISO/IEC 9945-2003). The optional user 34070 parameter will display the groups for the named user. 34071 34072 gunzip 34073 34074 Name 34075 34076 gunzip -- uncompress files 34077 34078 Description 34079 34080 gunzip is equivalent to gzip -d. See the specification for gzip 34081 for further details. 34082 34083 Filesystem Hierarchy Standard requires that if gunzip exists, 34084 it must be a symbolic or hard link to /bin/gzip. This 34085 specification additionally allows gunzip to be a wrapper script 34086 which calls gzip -d. 34087 34088 gzip 34089 34090 Name 34091 34092 gzip -- compress or expand files 34093 34094 Synopsis 34095 34096 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 34097 34098 Description 34099 34100 The gzip command shall attempt to reduce the size of the named 34101 files. Whenever possible, each file is replaced by one with the 34102 extension .gz, while keeping the same ownership, modes, access 34103 and modification times. If no files are specified, or if a file 34104 name is -, the standard input is compressed to the standard 34105 output. gzip shall only attempt to compress regular files. In 34106 particular, it will ignore symbolic links. 34107 34108 When compressing, gzip uses the deflate algorithm specified in 34109 RFC 1951: DEFLATE Compressed Data Format Specification and 34110 stores the result in a file using the gzip file format 34111 specified in RFC 1952: GZIP File Format Specification. 34112 34113 Options 34114 34115 -c, --stdout, --to-stdout 34116 writes output on standard output, leaving the original 34117 files unchanged. If there are several input files, the 34118 output consists of a sequence of independently 34119 compressed members. To obtain better compression, 34120 concatenate all input files before compressing them. 34121 34122 -d, --decompress, --uncompress 34123 the name operands are compressed files, and gzip shall 34124 decompress them. 34125 34126 -f, --force 34127 forces compression or decompression even if the file has 34128 multiple links or the corresponding file already exists, 34129 or if the compressed data is read from or written to a 34130 terminal. If the input data is not in a format 34131 recognized by gzip, and if the option --stdout is also 34132 given, copy the input data without change to the 34133 standard ouput: let gzip behave as cat. If -f is not 34134 given, and when not running in the background, gzip 34135 prompts to verify whether an existing file should be 34136 overwritten. 34137 34138 -l, --list 34139 lists the compressed size, uncompressed size, ratio and 34140 uncompressed name for each compressed file. For files 34141 that are not in gzip format, the uncompressed size shall 34142 be given as -1. If the --verbose or -v option is also 34143 specified, the crc and timestamp for the uncompressed 34144 file shall also be displayed. 34145 34146 For decompression, gzip shall support at least the 34147 following compression methods: 34148 34149 + deflate (RFC 1951: DEFLATE Compressed Data Format 34150 Specification) 34151 + compress (POSIX 1003.1-2001 (ISO/IEC 9945-2003)) 34152 34153 The crc shall be given as ffffffff for a file not in 34154 gzip format. 34155 34156 If the --name or -N option is also specified, the 34157 uncompressed name, date and time are those stored within 34158 the compressed file, if present. 34159 34160 If the --quiet or -q option is also specified, the title 34161 and totals lines are not displayed. 34162 34163 -L, --license 34164 displays the gzip license and quit. 34165 34166 -n, --no-name 34167 does not save the original file name and time stamp by 34168 default when compressing. (The original name is always 34169 saved if the name had to be truncated.) When 34170 decompressing, do not restore the original file name if 34171 present (remove only the gzip suffix from the compressed 34172 file name) and do not restore the original time stamp if 34173 present (copy it from the compressed file). This option 34174 is the default when decompressing. 34175 34176 -N, --name 34177 always saves the original file name and time stamp when 34178 compressing; this is the default. When decompressing, 34179 restore the original file name and time stamp if 34180 present. This option is useful on systems which have a 34181 limit on file name length or when the time stamp has 34182 been lost after a file transfer. 34183 34184 -q, --quiet 34185 suppresses all warnings. 34186 34187 -r, --recursive 34188 travels the directory structure recursively. If any of 34189 the file names specified on the command line are 34190 directories, gzip will descend into the directory and 34191 compress all the files it finds there (or decompress 34192 them in the case of gunzip). 34193 34194 -S .suf, --sufix .suf 34195 uses suffix .suf instead of .gz. 34196 34197 -t, --test 34198 checks the compressed file integrity. 34199 34200 -v, --verbose 34201 displays the name and percentage reduction for each file 34202 compressed or decompressed. 34203 34204 -#, --fast, --best 34205 regulates the speed of compression using the specified 34206 digit #, where -1 or --fast indicates the fastest 34207 compression method (less compression) and -9 or --best 34208 indicates the slowest compression method (best 34209 compression). The default compression level is -6 (that 34210 is, biased towards high compression at expense of 34211 speed). 34212 34213 LSB Deprecated Options 34214 34215 The behaviors specified in this section are expected to 34216 disappear from a future version of the LSB; applications should 34217 only use the non-LSB-deprecated behaviors. 34218 34219 -V, --version 34220 34221 displays the version number and compilation options, then 34222 quits. 34223 34224 hostname 34225 34226 Name 34227 34228 hostname -- show or set the system's host name 34229 34230 Synopsis 34231 34232 hostname [name] 34233 34234 Description 34235 34236 hostname is used to either display or, with appropriate 34237 privileges, set the current host name of the system. The host 34238 name is used by many applications to identify the machine. 34239 34240 When called without any arguments, the program displays the 34241 name of the system as returned by the gethostname() function. 34242 34243 When called with a name argument, and the user has appropriate 34244 privilege, the command sets the host name. 34245 34246 Note: It is not specified if the hostname displayed will be 34247 a fully qualified domain name. Applications requiring a 34248 particular format of hostname should check the output and 34249 take appropriate action. 34250 34251 install 34252 34253 Name 34254 34255 install -- copy files and set attributes 34256 34257 Synopsis 34258 34259 install [option...] SOURCE DEST 34260 install [option...] SOURCE... DEST 34261 install [-d | --directory] [option...] DIRECTORY... 34262 34263 Description 34264 34265 In the first two formats, copy SOURCE to DEST or multiple 34266 SOURCE(s) to the existing DEST directory, optionally setting 34267 permission modes and file ownership. In the third format, each 34268 DIRECTORY and any missing parent directories shall be created. 34269 34270 Standard Options 34271 34272 --backup[=METHOD] 34273 makes a backup of each existing destination file. METHOD 34274 may be one of the following: 34275 34276 none or off 34277 34278 never make backups. 34279 numbered or t 34280 34281 make numbered backups. A numbered backup has the form 34282 "%s.~%d~", target_name, version_number. Each backup shall 34283 increment the version number by 1. 34284 existing or nil 34285 34286 behave as numbered if numbered backups exist, or simple 34287 otherwise. 34288 simple or never 34289 34290 append a suffix to the name. The default suffix is '~', but can 34291 be overriden by setting SIMPLE_BACKUP_SUFFIX in the 34292 environment, or via the -S or --suffix option. 34293 34294 If no METHOD is specified, the environment variable 34295 VERSION_CONTROL shall be examined for one of the above. 34296 Unambiguous abbreviations of METHOD shall be accepted. 34297 If no METHOD is specified, or if METHOD is empty, the 34298 backup method shall default to existing. 34299 34300 If METHOD is invalid or ambiguous, install shall fail 34301 and issue a diagnostic message. 34302 34303 -b 34304 is equivalent to --backup=existing. 34305 34306 -d, --directory 34307 treats all arguments as directory names; creates all 34308 components of the specified directories. 34309 34310 -D 34311 creates all leading components of DEST except the last, 34312 then copies SOURCE to DEST; useful in the 1st format. 34313 34314 -g GROUP, --group=GROUP 34315 if the user has appropriate privilege, sets group 34316 ownership, instead of process' current group. GROUP is 34317 either a name in the user group database, or a positive 34318 integer, which shall be used as a group-id. 34319 34320 -m MODE, --mode=MODE 34321 sets permission mode (specified as in chmod), instead of 34322 the default rwxr-xr-x. 34323 34324 -o OWNER, --owner=OWNER 34325 if the user has appropriate privilege, sets ownership. 34326 OWNER is either a name in the user login database, or a 34327 positive integer, which shall be used as a user-id. 34328 34329 -p, --preserve-timestamps 34330 copies the access and modification times of SOURCE files 34331 to corresponding destination files. 34332 34333 -s, --strip 34334 strips symbol tables, only for 1st and 2nd formats. 34335 34336 -S SUFFIX, --suffix=SUFFIX 34337 equivalent to --backup=existing, except if a simple 34338 suffix is required, use SUFFIX. 34339 34340 --verbose 34341 prints the name of each directory as it is created. 34342 34343 -v, --verbose 34344 print the name of each file before copying it to stdout. 34345 34346 install_initd 34347 34348 Name 34349 34350 install_initd -- activate an init script 34351 34352 Synopsis 34353 34354 /usr/lib/lsb/install_initd initd_file 34355 34356 Description 34357 34358 install_initd shall activate a system initialization file that 34359 has been copied to an implementation defined location such that 34360 this file shall be run at the appropriate point during system 34361 initialization. The install_initd command is typically called 34362 in the postinstall script of a package, after the script has 34363 been copied to /etc/init.d. See also Installation and Removal 34364 of Init Scripts. 34365 34366 ipcrm 34367 34368 Name 34369 34370 ipcrm -- remove IPC Resources 34371 34372 Synopsis 34373 34374 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | 34375 -M shmkey]... 34376 ipcrm [shm | msg | msg] id... 34377 34378 Description 34379 34380 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 34381 the ipcrm shall behave as described in POSIX 1003.1-2001 34382 (ISO/IEC 9945-2003). 34383 34384 Otherwise, ipcrm shall remove the resource of the specified 34385 type identified by id. 34386 34387 Future Directions 34388 34389 A future revision of this specification may deprecate the 34390 second synopsis form. 34391 34392 Rationale: In its first Linux implementation, ipcrm used the 34393 second syntax shown in the SYNOPSIS. Functionality present 34394 in other implementations of ipcrm has since been added, 34395 namely the ability to delete resources by key (not just 34396 identifier), and to respect the same command line syntax. 34397 The previous syntax is still supported for backwards 34398 compatibility only. 34399 34400 ipcs 34401 34402 Name 34403 34404 ipcs -- provide information on ipc facilities 34405 34406 Synopsis 34407 34408 ipcs [-smq] [-tcp] 34409 34410 Description 34411 34412 ipcs provides information on the ipc facilities for which the 34413 calling process has read access. 34414 34415 Note: Although this command has many similarities with the 34416 optional ipcs utility described in POSIX 1003.1-2001 34417 (ISO/IEC 9945-2003), it has substantial differences and is 34418 therefore described separately. The options specified here 34419 have similar meaning to those in POSIX 1003.1-2001 (ISO/IEC 34420 9945-2003); other options specified there have unspecified 34421 behavior on an LSB conforming implementation. See 34422 Application Usage below. The output format is not specified. 34423 34424 Resource display options 34425 34426 -m 34427 34428 shared memory segments. 34429 -q 34430 34431 message queues. 34432 -s 34433 34434 semaphore arrays. 34435 34436 Output format options 34437 34438 -t 34439 34440 time. 34441 -p 34442 34443 pid. 34444 -c 34445 34446 creator. 34447 34448 Application Usage 34449 34450 In some implementations of ipcs the -a option will print all 34451 information available. In other implementations the -a option 34452 will print all resource types. Therefore, applications shall 34453 not use the -a option. 34454 34455 Some implementations of ipcs provide more output formats than 34456 are specified here. These options are not consistent between 34457 differing implementations of ipcs. Therefore, only the -t, -c 34458 and -p option formatting flags may be used. At least one of the 34459 -t, -c and -p options and at least one of -m, -q and -s options 34460 shall be specified. If no options are specified, the output is 34461 unspecified. 34462 34463 killall 34464 34465 Name 34466 34467 killall -- kill processes by name 34468 34469 Synopsis 34470 34471 killall [-egiqvw] [-signal] name... 34472 killall -l 34473 killall -V 34474 34475 Description 34476 34477 killall sends a signal to all processes running any of the 34478 specified commands. If no signal name is specified, SIGTERM is 34479 sent. 34480 34481 Signals can be specified either by name (e.g. -HUP) or by 34482 number (e.g. -1). Signal 0 (check if a process exists) can only 34483 be specified by number. 34484 34485 If the command name contains a slash (/), processes executing 34486 that particular file will be selected for killing, independent 34487 of their name. 34488 34489 killall returns a non-zero return code if no process has been 34490 killed for any of the listed commands. If at least one process 34491 has been killed for each command, killall returns zero. 34492 34493 A killall process never kills itself (but may kill other 34494 killall processes). 34495 34496 Standard Options 34497 34498 -e 34499 34500 requires an exact match for very long names. If a command name 34501 is longer than 15 characters, the full name may be unavailable 34502 (i.e. it is swapped out). In this case, killall will kill 34503 everything that matches within the first 15 characters. With 34504 -e, such entries are skipped. killall prints a message for each 34505 skipped entry if -v is specified in addition to -e. 34506 -g 34507 34508 kills the process group to which the process belongs. The kill 34509 signal is only sent once per group, even if multiple processes 34510 belonging to the same process group were found. 34511 -i 34512 34513 asks interactively for confirmation before killing. 34514 -l 34515 34516 lists all known signal names. 34517 -q 34518 34519 does not complain if no processes were killed. 34520 -v 34521 34522 reports if the signal was successfully sent. 34523 34524 LSB Deprecated Options 34525 34526 The behaviors specified in this section are expected to 34527 disappear from a future version of the LSB; applications should 34528 only use the non-LSB-deprecated behaviors. 34529 34530 -V 34531 34532 displays version information. 34533 34534 lpr 34535 34536 Name 34537 34538 lpr -- off line print 34539 34540 Synopsis 34541 34542 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 34543 title] [name ......] 34544 34545 Description 34546 34547 lpr uses a spooling daemon to print the named files when 34548 facilities become available. If no names appear, the standard 34549 input is assumed. 34550 34551 Standard Options 34552 34553 -l 34554 34555 identifies binary data that is not to be filtered but sent as 34556 raw input to printer. 34557 -p 34558 34559 formats with "pr" before sending to printer. 34560 -Pprinter 34561 34562 sends output to the printer named printer instead of the 34563 default printer. 34564 -h 34565 34566 suppresses header page. 34567 -s 34568 34569 uses symbolic links. 34570 -#copies 34571 34572 specifies copies as the number of copies to print. 34573 -J name 34574 34575 specifies name as the job name for the header page. 34576 -T title 34577 34578 specifies title as the title used for "pr". 34579 34580 ls 34581 34582 Name 34583 34584 ls -- list directory contents 34585 34586 Description 34587 34588 ls shall behave as specified in POSIX 1003.1-2001 (ISO/IEC 34589 9945-2003), but with extensions listed below. 34590 34591 Extensions 34592 34593 -l 34594 34595 If the file is a character special or block special file, the 34596 size of the file shall be replaced with two unsigned numbers in 34597 the format "%u, %u", representing the major and minor device 34598 numbers associated with the special file. 34599 34600 Note: The LSB does not specify the meaning of the major and 34601 minor devices numbers. 34602 34603 -p 34604 34605 in addition to POSIX 1003.1-2001 (ISO/IEC 9945-2003) XSI 34606 optional behavior of printing a slash for a directory, ls -p 34607 may display other characters for other file types. 34608 34609 lsb_release 34610 34611 Name 34612 34613 lsb_release -- print distribution specific information 34614 34615 Synopsis 34616 34617 lsb_release [OPTION...] 34618 34619 Description 34620 34621 The lsb_release command prints certain LSB (Linux Standard 34622 Base) and Distribution information. 34623 34624 If no options are given, the -v option is assumed. 34625 34626 Options 34627 34628 -v, --version 34629 34630 displays version of LSB against which distribution is 34631 compliant. The version is expressed as a colon separated list 34632 of LSB module descriptions. LSB module descriptions are dash 34633 separated tuples containing the module name, version, and 34634 architecture name. The output is a single line of text of the 34635 following format: 34636 34637 LSB Version:\tListAsDescribedAbove 34638 34639 Note: An implementation may support multiple releases of the 34640 same module. Version specific library interfaces, if any, 34641 will be selected by the program interpreter, which changes 34642 from release to release. Version specific commands and 34643 utilities, if any, will be described in the relevant 34644 specification. 34645 34646 -i, --id 34647 34648 displays string id of distributor. The output is a single line 34649 of text of the following format: 34650 34651 Distributor ID:\tDistributorID 34652 -d, --description 34653 34654 displays single line text description of distribution. The 34655 output is of the following format: 34656 34657 Description:\tDescription 34658 -r, --release 34659 34660 displays release number of distribution. The output is a single 34661 line of text of the following format: 34662 34663 Release:\tRelease 34664 -c, --codename 34665 34666 displays codename according to distribution release. The output 34667 is a single line of text of the following format. 34668 34669 Codename:\tCodename 34670 -a, --all 34671 34672 displays all of the above information. 34673 -s, --short 34674 34675 displays all of the above information in short output format. 34676 -h, --help 34677 34678 displays a human-readable help message. 34679 34680 Example 34681 34682 The following command will list the LSB Profiles which are 34683 currently supported on this platform. 34684 example% lsb_release -v 34685 LSB Version: core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch 34686 34687 m4 34688 34689 Name 34690 34691 m4 -- macro processor 34692 34693 Description 34694 34695 m4 is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 34696 but with extensions as listed below. 34697 34698 Extensions 34699 34700 -P 34701 34702 forces all builtins to be prefixed with m4_. For example, 34703 define becomes m4_define. 34704 -I directory 34705 34706 Add directory to the end of the search path for includes. 34707 34708 md5sum 34709 34710 Name 34711 34712 md5sum -- generate or check MD5 message digests 34713 34714 Synopsis 34715 34716 md5sum [-c [file] | file...] 34717 34718 Description 34719 34720 For each file, write to standard output a line containing the 34721 MD5 message digest of that file, followed by one or more blank 34722 characters, followed by the name of the file. The MD5 message 34723 digest shall be calculated according to RFC 1321: The MD5 34724 Message-Digest Algorithm and output as 32 hexadecimal digits. 34725 34726 If no file names are specified as operands, read from standard 34727 input and use "-" as the file name in the output. 34728 34729 Options 34730 34731 -c [file] 34732 34733 checks the MD5 message digest of all files named in file 34734 against the message digest listed in the same file. The actual 34735 format of file is the same as the output of md5sum. That is, 34736 each line in the file describes a file. If file is not 34737 specified, read message digests from stdin. 34738 34739 Exit Status 34740 34741 md5sum shall exit with status 0 if the sum was generated 34742 successfully, or, in check mode, if the check matched. 34743 Otherwise, md5sum shall exit with a non-zero status. 34744 34745 mknod 34746 34747 Name 34748 34749 mknod -- make special files 34750 34751 Synopsis 34752 34753 mknod [-m mode | --mode=mode] name type [major minor] 34754 mknod [--version] 34755 34756 Description 34757 34758 The mknod command shall create a special file named name of the 34759 given type. 34760 34761 The type shall be one of the following: 34762 34763 b 34764 34765 creates a block (buffered) special file with the specified 34766 major and minor device numbers. 34767 c, u 34768 34769 creates a character (unbuffered) special file with the 34770 specified major and minor device numbers. 34771 p 34772 34773 creates a FIFO. 34774 34775 Options 34776 34777 -m mode, --mode=mode 34778 34779 create the special file with file access permissions set as 34780 described in mode. The permissions may be any absolute value 34781 (i.e. one not containing '+' or '-') acceptable to the chmod 34782 command. 34783 --version 34784 34785 output version information and exit. 34786 34787 Note: This option may be deprecated in a future release of 34788 this specification. 34789 34790 If type is p, major and minor shall not be specified. 34791 Otherwise, these parameters are mandatory. 34792 34793 Future Directions 34794 34795 This command may be deprecated in a future version of this 34796 specification. The major and minor operands are insufficently 34797 portable to be specified usefully here. Only a FIFO can be 34798 portably created by this command, and the mkfifo command is a 34799 simpler interface for that purpose. 34800 34801 mktemp 34802 34803 Name 34804 34805 mktemp -- make temporary file name (unique) 34806 34807 Synopsis 34808 34809 mktemp [-q] [-u] template 34810 34811 Description 34812 34813 The mktemp command takes the given file name template and 34814 overwrites a portion of it to create a file name. This file 34815 name shall be unique and suitable for use by the application. 34816 34817 The template should have at least six trailing 'X' characters. 34818 These characters are replaced with characters from the portable 34819 filename character set in order to generate a unique name. 34820 34821 If mktemp can successfully generate a unique file name, and the 34822 -u option is not present, the file shall be created with read 34823 and write permission only for the current user. The mktemp 34824 command shall write the filename generated to the standard 34825 output. 34826 34827 Options 34828 34829 -q 34830 34831 fail silently if an error occurs. Diagnostic messages to stderr 34832 are suppressed, but the command shall still exit with a 34833 non-zero exit status if an error occurs. 34834 -u 34835 34836 operates in `unsafe' mode. A unique name is generated, but the 34837 temporary file shall be unlinked before mktemp exits. Use of 34838 this option is not encouraged. 34839 34840 more 34841 34842 Name 34843 34844 more -- display files on a page-by-page basis 34845 34846 Description 34847 34848 more is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 34849 but with differences as listed below. 34850 34851 Differences 34852 34853 The more command need not respect the LINES and COLUMNS 34854 environment variables. 34855 34856 The following additional options may be supported: 34857 34858 -num 34859 34860 specifies an integer which is the screen size (in lines). 34861 +num 34862 34863 starts at line number num. 34864 +/pattern 34865 34866 Start at the first line matching the pattern, equivalent to 34867 executing the search forward (/) command with the given pattern 34868 immediately after opening each file. 34869 34870 The following options from POSIX 1003.1-2001 (ISO/IEC 34871 9945-2003) may behave differently: 34872 34873 -e 34874 34875 has unspecified behavior. 34876 -i 34877 34878 has unspecified behavior. 34879 -n 34880 34881 has unspecified behavior. 34882 -p 34883 34884 Either clear the whole screen before displaying any text 34885 (instead of the usual scrolling behavior), or provide the 34886 behavior specified by POSIX 1003.1-2001 (ISO/IEC 9945-2003). In 34887 the latter case, the syntax is "-p command". 34888 -t 34889 34890 has unspecified behavior. 34891 34892 The more command need not support the following interactive 34893 commands: 34894 34895 g 34896 G 34897 u 34898 control u 34899 control f 34900 newline 34901 j 34902 k 34903 r 34904 R 34905 m 34906 ' (return to mark) 34907 /! 34908 ? 34909 N 34910 :e 34911 :t 34912 control g 34913 ZZ 34914 34915 Rationale 34916 34917 The +num and +/string options are deprecated in SUSv2, and have 34918 been removed in POSIX 1003.1-2001 (ISO/IEC 9945-2003); however 34919 this specification continues to specify them because the 34920 publicly available util-linux package does not support the 34921 replacement (-p command). The +command option as found in SUSv2 34922 is more general than is specified here, but the util-linux 34923 package appears to only support the more specific +num and 34924 +/string forms. 34925 34926 mount 34927 34928 Name 34929 34930 mount -- mount a file system 34931 34932 Synopsis 34933 34934 mount [-hV] 34935 mount [-a] [-fFnrsvw] [-t vfstype] 34936 mount [-fnrsvw] [-o options [,...]] [device | dir] 34937 mount [-fnrsvw] [-t vfstype] [-o options] device dir 34938 34939 Description 34940 34941 As described in POSIX 1003.1-2001 (ISO/IEC 9945-2003), all 34942 files in the system are organized in a directed graph, known as 34943 the file hierarchy, rooted at /. These files can be spread out 34944 over several underlying devices. The mount command shall attach 34945 the file system found on some underlying device to the file 34946 hierarchy. 34947 34948 Options 34949 34950 -v 34951 34952 invoke verbose mode. The mount command shall provide diagnostic 34953 messages on stdout. 34954 -a 34955 34956 mount all file systems (of the given types) mentioned in 34957 /etc/fstab. 34958 -F 34959 34960 If the -a option is also present, fork a new incarnation of 34961 mount for each device to be mounted. This will do the mounts on 34962 different devices or different NFS servers in parallel. 34963 -f 34964 34965 cause everything to be done except for the actual system call; 34966 if it's not obvious, this `fakes' mounting the file system. 34967 -n 34968 34969 mount without writing in /etc/mtab. This is necessary for 34970 example when /etc is on a read-only file system. 34971 -s 34972 34973 ignore mount options not supported by a file system type. Not 34974 all file systems support this option. 34975 -r 34976 34977 mount the file system read-only. A synonym is -o ro. 34978 -w 34979 34980 mount the file system read/write. (default) A synonym is -o rw. 34981 -L label 34982 34983 If the file /proc/partitions is supported, mount the partition 34984 that has the specified label. 34985 -U uuid 34986 34987 If the file /proc/partitions is supported, mount the partition 34988 that has the specified uuid. 34989 -t vfstype 34990 34991 indicate a file system type of vfstype. 34992 34993 More than one type may be specified in a comma separated list. 34994 The list of file system types can be prefixed with no to 34995 specify the file system types on which no action should be 34996 taken. 34997 -o 34998 34999 options are specified with a -o flag followed by a 35000 comma-separated string of options. Some of these options are 35001 only useful when they appear in the /etc/fstab file. The 35002 following options apply to any file system that is being 35003 mounted: 35004 35005 async 35006 35007 perform all I/O to the file system asynchronously. 35008 atime 35009 35010 update inode access time for each access. (default) 35011 auto 35012 35013 in /etc/fstab, indicate the device is mountable with -a. 35014 defaults 35015 35016 use default options: rw, suid, dev, exec, auto, nouser, async. 35017 dev 35018 35019 interpret character or block special devices on the file 35020 system. 35021 exec 35022 35023 permit execution of binaries. 35024 noatime 35025 35026 do not update file access times on this file system. 35027 noauto 35028 35029 in /etc/fstab, indicates the device is only explicitly 35030 mountable. 35031 nodev 35032 35033 do not interpret character or block special devices on the file 35034 system. 35035 noexec 35036 35037 do not allow execution of any binaries on the mounted file 35038 system. 35039 nosuid 35040 35041 do not allow set-user-identifier or set-group-identifier bits 35042 to take effect. 35043 nouser 35044 35045 forbid an unprivileged user to mount the file system. (default) 35046 remount 35047 35048 remount an already-mounted file system. This is commonly used 35049 to change the mount options for a file system, especially to 35050 make a read-only file system writable. 35051 ro 35052 35053 mount the file system read-only. 35054 rw 35055 35056 mount the file system read-write. 35057 suid 35058 35059 allow set-user-identifier or set-group-identifier bits to take 35060 effect. 35061 sync 35062 35063 do all I/O to the file system synchronously. 35064 user 35065 35066 allow an unprivilieged user to mount the file system. This 35067 option implies the options noexec, nosuid, nodev unless 35068 overridden by subsequent options. 35069 35070 LSB Deprecated Options 35071 35072 The behaviors specified in this section are expected to 35073 disappear from a future version of the LSB; applications should 35074 only use the non-LSB-deprecated behaviors. 35075 35076 -V 35077 35078 output version and exit. 35079 35080 msgfmt 35081 35082 Name 35083 35084 msgfmt -- create a message object from a message file 35085 35086 Synopsis 35087 35088 msgfmt [options...] filename... 35089 35090 Description 35091 35092 The msgfmt command generates a binary message catalog from a 35093 textual translation description. Message catalogs, or message 35094 object files, are stored in files with a .mo extension. 35095 35096 Note: The format of message object files is not guaranteed 35097 to be portable. Message catalogs should always be generated 35098 on the target architecture using the msgfmt command. 35099 35100 The source message files, otherwise known as portable object 35101 files, have a .po extension. 35102 35103 The filename operands shall be portable object files. The .po 35104 file contains messages to be displayed to users by system 35105 utilities or by application programs. The portable object files 35106 are text files, and the messages in them can be rewritten in 35107 any language supported by the system. 35108 35109 If any filename is -, a portable object file shall be read from 35110 the standard input. 35111 35112 The msgfmt command interprets data as characters according to 35113 the current setting of the LC_CTYPE locale category. 35114 35115 Options 35116 35117 -c, --check 35118 Detect and diagnose input file anomalies which might 35119 represent translation errors. The msgid and msgstr 35120 strings are studied and compared. It is considered 35121 abnormal that one string starts or ends with a newline 35122 while the other does not. 35123 35124 If the message is flagged as c-format (see Comment 35125 Handling), check that the msgid string and the msgstr 35126 translation have the same number of % format specifiers, 35127 with matching types. 35128 35129 -D directory, --directory=directory 35130 Add directory to list for input files search. If 35131 filename is not an absolute pathname and filename cannot 35132 be opened, search for it in directory. This option may 35133 be repeated. Directories shall be searched in order, 35134 with the leftmost directory searched first. 35135 35136 -f, --use-fuzzy 35137 Use entries marked as fuzzy in output. If this option is 35138 not specified, such entries are not included into the 35139 output. See Comment Handling below. 35140 35141 -o output-file, --output-file=output-file 35142 Specify the output file name as output-file. If multiple 35143 domains or duplicate msgids in the .po file are present, 35144 the behavior is unspecified. If output-file is -, output 35145 is written to standard output. 35146 35147 --strict 35148 Ensure that all output files have a .mo extension. 35149 Output files are named either by the -o (or 35150 --output-file) option, or by domains found in the input 35151 files. 35152 35153 -v, --verbose 35154 Print additional information to the standard error, 35155 including the number of translated strings processed. 35156 35157 Operands 35158 35159 The filename operands are treated as portable object files. The 35160 format of portable object files is defined in EXTENDED 35161 DESCRIPTION. 35162 35163 Standard Input 35164 35165 The standard input is not used unless a filename operand is 35166 specified as "-". 35167 35168 Environment Variables 35169 35170 LANGUAGE 35171 35172 Specifies one or more locale names. 35173 LANG 35174 35175 Specifies locale name. 35176 LC_ALL 35177 35178 Specifies locale name for all categories. If defined, overrides 35179 LANG, LC_CTYPE and LC_MESSAGES. 35180 LC_CTYPE 35181 35182 Determine the locale for the interpretation of sequences of 35183 bytes of text data as characters (for example, single-byte as 35184 opposed to multi-byte characters in arguments and input files). 35185 LC_MESSAGES 35186 35187 Specifies messaging locale, and if present overrides LANG for 35188 messages. 35189 35190 Standard Output 35191 35192 The standard output is not used unless the option-argument of 35193 the -o option is specified as -. 35194 35195 Extended Description 35196 35197 The format of portable object files (.po files) is defined as 35198 follows. Each .po file contains one or more lines, with each 35199 line containing either a comment or a statement. Comments start 35200 the line with a hash mark (#) and end with the newline 35201 character. Empty lines, or lines containing only white-space, 35202 shall be ignored. Comments can in certain circumstances alter 35203 the behavior of msgfmt. See Comment Handling below for details 35204 on comment processing. The format of a statement is: 35205 35206 directive value 35207 35208 Each directive starts at the beginning of the line and is 35209 separated from value by white space (such as one or more space 35210 or tab characters). The value consists of one or more quoted 35211 strings separated by white space. If two or more strings are 35212 specified as value, they are normalized into single string 35213 using the string normalization syntax specified in ISO C 35214 (1999). The following directives are supported: 35215 35216 domain domainname 35217 35218 msgid message_identifier 35219 35220 msgid_plural untranslated_string_plural 35221 35222 msgstr message_string 35223 35224 msgstr[n] message_string 35225 35226 The behavior of the domain directive is affected by the options 35227 used. See OPTIONS for the behavior when the -o option is 35228 specified. If the -o option is not specified, the behavior of 35229 the domain directive is as follows: 35230 35231 1. All msgids from the beginning of each .po file to the first 35232 domain directive are put into a default message object 35233 file, messages (or messages.mo if the --strict option is 35234 specified). 35235 2. When msgfmt encounters a domain domainname directive in the 35236 .po file, all following msgids until the next domain 35237 directive are put into the message object file domainname 35238 (or domainname.mo if --strict option is specified). 35239 3. Duplicate msgids are defined in the scope of each domain. 35240 That is, a msgid is considered a duplicate only if the 35241 identical msgid exists in the same domain. 35242 4. All duplicate msgids are ignored. 35243 35244 The msgid directive specifies the value of a message identifier 35245 associated with the directive that follows it. The msgid_plural 35246 directive specifies the plural form message specified to the 35247 plural message handling functions ngettext(), dngettext() or 35248 dcngettext(). The message_identifier string identifies a target 35249 string to be used at retrieval time. Each statement containing 35250 a msgid directive shall be followed by a statement containing a 35251 msgstr directive or msgstr[n] directives. 35252 35253 The msgstr directive specifies the target string associated 35254 with the message_identifier string declared in the immediately 35255 preceding msgid directive. 35256 35257 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 35258 target string to be used with plural form handling functions 35259 ngettext(), dngettext() and dcngettext(). 35260 35261 Message strings can contain the following escape sequences: 35262 35263 Table 15-1. Escape Sequences 35264 \n newline 35265 \t tab 35266 \v vertical tab 35267 \b backspace 35268 \r carriage return 35269 \f formfeed 35270 \\ backslash 35271 \" double quote 35272 \ddd octal bit pattern 35273 \xHH hexadecimal bit pattern 35274 35275 Comment Handling 35276 35277 Comments are introduced by a #, and continue to the end of the 35278 line. The second character (i.e. the character following the #) 35279 has special meaning. Regular comments should follow a space 35280 character. Other comment types include: 35281 35282 # normal-comments 35283 35284 #. automatic-comments 35285 35286 #: reference... 35287 35288 #, flag 35289 35290 Automatic and reference comments are typically generated by 35291 external utilities, and are not specified by the LSB. The 35292 msgfmt command shall ignore such comments. 35293 35294 Note: Portable object files may be produced by unspecified 35295 tools. Some of the comment types described here may arise 35296 from the use of such tools. It is beyond the scope of this 35297 specification to describe these tools. 35298 35299 The #, comments require one or more flags separated by the 35300 comma (,) character. The following flags can be specified: 35301 35302 fuzzy 35303 35304 This flag shows that the following msgstr string might not be a 35305 correct translation. Only the translator (i.e. the individual 35306 undertaking the translation) can judge if the translation 35307 requires further modification, or is acceptable as is. Once 35308 satisfied with the translation, the translator then removes 35309 this fuzzy flag. 35310 35311 If this flag is specified, the msgfmt utility will not generate 35312 the entry for the immediately following msgid in the output 35313 message catalog, unless the --use-fuzzy is specified. 35314 c-format, no-c-format 35315 35316 The c-format flag indicates that the msgid string is used as 35317 format string by printf()-like functions. If the c-format flag 35318 is given for a string the msgfmt utility may perform additional 35319 tests to check the validity of the translation. 35320 35321 Plurals 35322 35323 The msgid entry with empty string ("") is called the header 35324 entry and is treated specially. If the message string for the 35325 header entry contains nplurals=value, the value indicates the 35326 number of plural forms. For example, if nplurals=4, there are 4 35327 plural forms. If nplurals is defined, there should be a 35328 plural=expression on the same line, separated by a semicolon 35329 (;) character. The expression is a C language expression to 35330 determine which version of msgstr[n] to be used based on the 35331 value of n, the last argument of ngettext(), dngettext() or 35332 dcngettext(). For example: 35333 nplurals=2; plural=n == 1 ? 0 : 1 35334 35335 indicates that there are 2 plural forms in the language; 35336 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 35337 Another example: 35338 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 35339 35340 indicates that there are 3 plural forms in the language; 35341 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 35342 otherwise msgstr[2] is used. 35343 35344 If the header entry contains charset=codeset string, the 35345 codeset is used to indicate the codeset to be used to encode 35346 the message strings. If the output string's codeset is 35347 different from the message string's codeset, codeset conversion 35348 from the message strings's codeset to the output string's 35349 codeset will be performed upon the call of gettext(), 35350 dgettext(), dcgettext(), ngettext(), dngettext(), and 35351 dcngettext(). The output string's codeset is determined by the 35352 current locale's codeset (the return value of 35353 nl_langinfo(CODESET)) by default, and can be changed by the 35354 call of bind_textdomain_codeset(). 35355 35356 Exit Status 35357 35358 The following exit values are returned: 35359 35360 0 35361 35362 Successful completion. 35363 >0 35364 35365 An error occurred. 35366 35367 Application Usage 35368 35369 Neither msgfmt nor any gettext() function imposes a limit on 35370 the total length of a message. Installing message catalogs 35371 under the C locale is pointless, since they are ignored for the 35372 sake of efficiency. 35373 35374 Examples 35375 35376 Example 1: Examples of creating message objects from message 35377 files. 35378 35379 In this example module1.po, module2.po and module3.po are 35380 portable message object files. 35381 example% cat module1.po 35382 35383 # default domain "messages" 35384 35385 msgid "message one" 35386 35387 msgstr "mensaje número uno" 35388 35389 # 35390 35391 domain "help_domain" 35392 35393 msgid "help two" 35394 35395 msgstr "ayuda número dos" 35396 35397 # 35398 35399 domain "error_domain" 35400 35401 msgid "error three" 35402 35403 msgstr "error número tres" 35404 35405 example% cat module2.po 35406 35407 # default domain "messages" 35408 35409 msgid "message four" 35410 35411 msgstr "mensaje número cuatro" 35412 35413 # 35414 35415 domain "error_domain" 35416 35417 msgid "error five" 35418 35419 msgstr "error número cinco" 35420 35421 # 35422 35423 domain "window_domain" 35424 35425 msgid "window six" 35426 35427 msgstr "ventana número seises" 35428 35429 example% cat module3.po 35430 35431 # default domain "messages" 35432 35433 msgid "message seven" 35434 35435 msgstr "mensaje número siete" 35436 35437 The following command will produce the output files messages, 35438 help_domain, and error_domain. 35439 example% msgfmt module1.po 35440 35441 The following command will produce the output files 35442 messages.mo, help_domain.mo, error_domain.mo, and 35443 window_domain.mo. 35444 example% msgfmt module1.po module2.po 35445 35446 The following example will produce the output file hello.mo. 35447 example% msgfmt -o hello.mo module3.po 35448 35449 newgrp 35450 35451 Name 35452 35453 newgrp -- change group ID 35454 35455 Synopsis 35456 35457 newgrp [group] 35458 35459 Description 35460 35461 The newgrp command is as specified in POSIX 1003.1-2001 35462 (ISO/IEC 9945-2003), but with differences as listed below. 35463 35464 Differences 35465 35466 The -l option specified in POSIX 1003.1-2001 (ISO/IEC 35467 9945-2003) need not be supported. 35468 35469 od 35470 35471 Name 35472 35473 od -- dump files in octal and other formats 35474 35475 Synopsis 35476 35477 od [-abcdfilox] [-w width | --width-width] [-v] [-A 35478 address_base] [-j skip] [-n count] [-t type_string] [file...] 35479 od --traditional [options] [file] [[+]offset [.] [b]] [[+]label 35480 [.] [b]] 35481 35482 Description 35483 35484 The od command shall provide all of the madatory functionality 35485 specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), but with 35486 extensions and differences to the XSI optional behavior as 35487 listed below. 35488 35489 Extensions and Differences 35490 35491 -s 35492 unspecified behavior. 35493 35494 Note: Applications wishing to achieve the POSIX 1003.1-2001 35495 (ISO/IEC 9945-2003) behavior for -s should instead use -t 35496 d2. 35497 35498 -wwidth, --width[=width] 35499 each output line is limited to width bytes from the 35500 input. 35501 35502 --traditional 35503 accepts arguments in traditional form, see Traditional 35504 Usage below. 35505 35506 Note: The XSI optional behavior for offset handling 35507 described in POSIX 1003.1-2001 (ISO/IEC 9945-2003) is not 35508 supported unless the --traditional option is also specified. 35509 35510 Pre-POSIX and XSI Specifications 35511 35512 The LSB supports mixing options between the mandatory and XSI 35513 optional synopsis forms in POSIX 1003.1-2001 (ISO/IEC 35514 9945-2003). The LSB shall support the following options: 35515 35516 -a 35517 35518 is equivalent to -t a, selects named characters. 35519 -b 35520 35521 is equivalent to -t o1, selects octal bytes. 35522 -c 35523 35524 is equivalent to -t c, selects characters. 35525 -d 35526 35527 is equivalent to -t u2, selects unsigned decimal two byte 35528 units. 35529 -f 35530 35531 is equivalent to -t fF, selects floats. 35532 -i 35533 35534 is equivalent to -t d2, selects decimal two byte units. 35535 35536 Note: This usage may change in future releases; portable 35537 applications should use -t d2. 35538 35539 -l 35540 35541 is equivalent to -t d4, selects decimal longs. 35542 -o 35543 35544 is equivalent to -t o2, selects octal two byte units. 35545 -x 35546 35547 is equivalent to -t x2, selects hexadecimal two byte units. 35548 35549 Note that the XSI option -s need not be supported. 35550 35551 Traditional Usage 35552 35553 If the --traditional option is specified, there may be between 35554 zero and three operands specified. 35555 35556 If no operands are specified, then od shall read the standard 35557 input. 35558 35559 If there is exactly one operand, and it is an offset of the 35560 form [+]offset[.][b], then it shall be interpreted as specified 35561 in POSIX 1003.1-2001 (ISO/IEC 9945-2003). The file to be dumped 35562 shall be the standard input. 35563 35564 If there are exactly two operands, and they are both of the 35565 form [+]offset[.][b], then the first shall be treated as an 35566 offset (as above), and the second shall be a label, in the same 35567 format as the offset. If a label is specified, then the first 35568 output line produced for each input block shall be preceded by 35569 the input offset, cumulative across input files, of the next 35570 byte to be written, followed by the label, in parentheses. The 35571 label shall increment in the same manner as the offset. 35572 35573 If there are three operands, then the first shall be the file 35574 to dump, the second the offset, and the third the label. 35575 35576 Note: Recent versions of coreutils contain an od utility 35577 that conforms to POSIX 1003.1-2001 (ISO/IEC 9945-2003). 35578 However, in April 2005, this version was not in widespread 35579 use. A future version of this specification may remove the 35580 differences. 35581 35582 passwd 35583 35584 Name 35585 35586 passwd -- change user password 35587 35588 Synopsis 35589 35590 passwd [-x max] [-n min] [-w warn] [-i inact] name 35591 passwd {-l | -u} name 35592 35593 Description 35594 35595 passwd changes authentication information for user and group 35596 accounts, including passwords and password expiry details, and 35597 may be used to enable and disable accounts. Only a user with 35598 appropriate privilege may change the password for other users 35599 or modify the expiry information. 35600 35601 Options 35602 35603 -x max 35604 35605 sets the maximum number of days a password remains valid. 35606 -n min 35607 35608 sets the minimum number of days before a password may be 35609 changed. 35610 -w warn 35611 35612 sets the number of days warning the user will receive before 35613 their password will expire. 35614 -i inactive 35615 35616 disables an account after the password has been expired for the 35617 given number of days. 35618 -l 35619 35620 disables an account by changing the password to a value which 35621 matches no possible encrypted value. 35622 -u 35623 35624 re-enables an account by changing the password back to its 35625 previous value. 35626 35627 patch 35628 35629 Name 35630 35631 patch -- apply a diff file to an original 35632 35633 Description 35634 35635 patch is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 35636 but with extensions as listed below. 35637 35638 Extensions 35639 35640 --binary 35641 35642 reads and write all files in binary mode, except for standard 35643 output and /dev/tty. This option has no effect on 35644 POSIX-compliant systems. 35645 -u, --unified 35646 35647 interprets the patch file as a unified context diff. 35648 35649 pidof 35650 35651 Name 35652 35653 pidof -- find the process ID of a running program 35654 35655 Synopsis 35656 35657 pidof [-s] [-x] [-o omitpid...] program... 35658 35659 Description 35660 35661 Return the process ID of a process which is running the program 35662 named on the command line. 35663 35664 The pidof command is a system administration utility, see Path 35665 For System Administration Utilities. 35666 35667 Options 35668 35669 -s 35670 35671 instructs the program to only return one pid. 35672 -x 35673 35674 causes the program to also return process id's of shells 35675 running the named scripts. 35676 -o 35677 35678 omits processes with specified process id. 35679 35680 remove_initd 35681 35682 Name 35683 35684 remove_initd -- clean up init script system modifications 35685 introduced by install_initd 35686 35687 Synopsis 35688 35689 /usr/lib/lsb/remove_initd initd_file 35690 35691 Description 35692 35693 remove_initd processes the removal of the modifications made to 35694 a distribution's init script system by the install_initd 35695 program. This cleanup is performed in the preuninstall script 35696 of a package; however, the package manager is still responsible 35697 for removing the script from the repository. See also 35698 Installation and Removal of Init Scripts. 35699 35700 renice 35701 35702 Name 35703 35704 renice -- alter priority of running processes 35705 35706 Description 35707 35708 renice is as specified in POSIX 1003.1-2001 (ISO/IEC 35709 9945-2003), but with differences as listed below. 35710 35711 Differences 35712 35713 -n increment 35714 35715 has unspecified behavior. 35716 35717 sed 35718 35719 Name 35720 35721 sed -- stream editor 35722 35723 Description 35724 35725 sed is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 35726 but with differences as listed below. 35727 35728 LSB Differences 35729 35730 Certain aspects of internationalized regular expressions are 35731 optional; see Regular Expressions. 35732 35733 sendmail 35734 35735 Name 35736 35737 sendmail -- an electronic mail transport agent 35738 35739 Synopsis 35740 35741 /usr/sbin/sendmail [options] [address...] 35742 35743 Description 35744 35745 To deliver electronic mail (email), applications shall support 35746 the interface provided by sendmail (described here). This 35747 interface shall be the default delivery method for 35748 applications. 35749 35750 This program sends an email message to one or more recipients, 35751 routing the message as necessary. This program is not intended 35752 as a user interface routine. 35753 35754 With no options, sendmail reads its standard input up to an 35755 end-of-file or a line consisting only of a single dot and sends 35756 a copy of the message found there to all of the addresses 35757 listed. It determines the network(s) to use based on the syntax 35758 and contents of the addresses. 35759 35760 If an address is preceded by a backslash, '\', it is 35761 unspecified if the address is subject to local alias expansion. 35762 35763 The format of messages shall be as defined in RFC 2822:Internet 35764 Message Format. 35765 35766 Note: The name sendmail was chosen for historical reasons, 35767 but the sendmail command specified here is intended to 35768 reflect functionality provided by smail, exim and other 35769 implementations, not just the sendmail implementation. 35770 35771 Options 35772 35773 -bm 35774 35775 read mail from standard input and deliver it to the recipient 35776 addresses. This is the default mode of operation. 35777 -bp 35778 35779 If the user has sufficient privilege, list information about 35780 messages currently in the mail queue. 35781 -bs 35782 35783 use the SMTP protocol as described in RFC 2821:Simple Mail 35784 Transfer Protocol; read SMTP commands on standard input and 35785 write SMTP responses on standard output. 35786 35787 In this mode, sendmail shall accept \r\n (CR-LF), as required 35788 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 35789 terminators. 35790 -F fullname 35791 35792 explicitly set the full name of the sender for incoming mail 35793 unless the message already contains a From: message header. 35794 35795 If the user running sendmail is not sufficiently trusted, then 35796 the actual sender may be indicated in the message, depending on 35797 the configuration of the agent. 35798 -f name 35799 35800 explicitly set the envelope sender address for incoming mail. 35801 If there is no From: header, the address specified in the From: 35802 header will also be set. 35803 35804 If the user running sendmail is not sufficiently trusted, then 35805 the actual sender shall be indicated in the message. 35806 -i 35807 35808 ignore dots alone on lines by themselves in incoming messages. 35809 If this options is not specified, a line consisting of a single 35810 dot shall terminate the input. If -bs is also used, the 35811 behavior is unspecified. 35812 -odb 35813 35814 deliver any mail in background, if supported; otherwise 35815 ignored. 35816 -odf 35817 35818 deliver any mail in foreground, if supported; otherwise 35819 ignored. 35820 -oem or -em 35821 35822 mail errors back to the sender. (default) 35823 -oep or -ep 35824 35825 write errors to the standard error output. 35826 -oeq or -eq 35827 35828 do not send notification of errors to the sender. This only 35829 works for mail delivered locally. 35830 -oi 35831 35832 is equivalent to -i. 35833 -om 35834 35835 indicate that the sender of a message should receive a copy of 35836 the message if the sender appears in an alias expansion. 35837 Ignored if aliases are not supported. 35838 -t 35839 35840 read the message to obtain recipients from the To:, Cc:, and 35841 Bcc: headers in the message instead of from the command 35842 arguments. If a Bcc: header is present, it is removed from the 35843 message unless there is no To: or Cc: header, in which case a 35844 Bcc: header with no data is created, in accordance with RFC 35845 2822:Internet Message Format. 35846 35847 If there are any operands, the recipients list is unspecified. 35848 35849 This option may be ignored when not in -bm mode (the default). 35850 35851 Note: It is recommended that applications use as few options 35852 as necessary, none if possible. 35853 35854 Exit status 35855 35856 0 35857 35858 successful completion on all addresses. This does not indicate 35859 successful delivery. 35860 >0 35861 35862 there was an error. 35863 35864 seq 35865 35866 Name 35867 35868 seq -- generate a sequence of numbers 35869 35870 Synopsis 35871 35872 /usr/bin/seq [-f fmt_str] [-s sep_str] [first_num] [inc_num] 35873 last_num 35874 35875 Description 35876 35877 The seq command shall output a sequence of numbers from 35878 first_num to last_num, stepping by the increment inc_num. The 35879 first_num and last_num parameters may be omitted, and default 35880 to 1 even when first_num is greater than last_num. 35881 Floating-point values may be specified for first_num, inc_num, 35882 and last_num. 35883 35884 The fmt_str parameter is a floating point format string like 35885 the one used for the printf() function in C. 35886 35887 The sep_str parameter string separates the values that are 35888 output. The default is a newline character (/n). 35889 35890 Note: If first_num is less than last_num and inc_num is 35891 negative, or first_num is greater than last_num and inc_num 35892 is positive, seq shall not generate any output. 35893 35894 Standard Options 35895 35896 -f fmt_str 35897 35898 Format the numbers in the output sequence according to fmt_str, 35899 a floating point format string like the one used for the 35900 printf() function in C. 35901 -s sep_str 35902 35903 Separate the numbers in the output sequence with sep_str. The 35904 default separator string is a newline character (\n). 35905 first_num 35906 35907 The first number in the output sequence. Defaults to 1. May be 35908 a floating point value. 35909 inc_num 35910 35911 The increment for the output sequence. Defaults to 1. May be a 35912 floating point value. 35913 last_num 35914 35915 The last number in the output sequence. May be a floating point 35916 value. 35917 35918 sh 35919 35920 Name 35921 35922 sh -- shell, the standard command language interpreter 35923 35924 Description 35925 35926 The sh utility shall behave as specified in POSIX 1003.1-2001 35927 (ISO/IEC 9945-2003), but with extensions listed below. 35928 35929 Shell Invocation 35930 35931 The shell shall support an additional option, -l (the letter 35932 ell). If the -l option is specified, or if the first character 35933 of argument zero (the command name) is a '-', this invokation 35934 of the shell is a login shell. 35935 35936 An interactive shell, as specified in POSIX 1003.1-2001 35937 (ISO/IEC 9945-2003), that is also a login shell, or any shell 35938 if invoked with the -l option, shall, prior to reading from the 35939 input file, first read and execute commands from the file 35940 /etc/profile, if that file exists, and then from a file called 35941 ~/.profile, if such a file exists. 35942 35943 Note: This specification requires that the sh utility shall 35944 also read and execute commands in its current execution 35945 environment from all the shell scripts in the directory 35946 /etc/profile.d. Such scripts are read and executed as a part 35947 of reading and executing /etc/profile. 35948 35949 shutdown 35950 35951 Name 35952 35953 shutdown -- shut the system down 35954 35955 Synopsis 35956 35957 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 35958 [warning-message] 35959 /sbin/shutdown -c [warning-message] 35960 35961 Description 35962 35963 The shutdown command shall shut the system down in a secure way 35964 (first synopsis), or cancel a pending shutdown (second 35965 synopsis). When the shutdown is initiated, all logged-in users 35966 shall be notified immediately that the system is going down, 35967 and users shall be prevented from logging in to the system. The 35968 time specifies when the actual shutdown shall commence. See 35969 below for details. At the specified time all processes are 35970 first notified that the system is going down by the signal 35971 SIGTERM. After an interval (see -t) all processes shall be sent 35972 the signal SIGKILL. If neither the -h or the -r argument is 35973 specified, then the default behavior shall be to take the 35974 system to a runlevel where administrative tasks can be run. See 35975 also Run Levels. 35976 35977 Note: This is sometimes referred to as "single user mode". 35978 35979 The -h and -r options are mutually exclusive. If either the -h 35980 or -r options are specified, the system shall be halted or 35981 rebooted respectively. 35982 35983 Standard Options 35984 35985 -a 35986 35987 use access control. See below. 35988 -t sec 35989 35990 tell the system to wait sec seconds between sending processes 35991 the warning and the kill signal, before changing to another 35992 runlevel. The default period is unspecified. 35993 -k 35994 35995 do not really shutdown; only send the warning messages to 35996 everybody. 35997 -r 35998 35999 reboot after shutdown. 36000 -h 36001 36002 halt after shutdown. Actions after halting are unspecified 36003 (e.g. power off). 36004 -f 36005 36006 advise the system to skip file system consistency checks on 36007 reboot. 36008 -F 36009 36010 advise the system to force file system consistency checks on 36011 reboot. 36012 -c 36013 36014 cancel an already running shutdown. 36015 time 36016 36017 specify when to shut down. 36018 36019 The time argument shall have the following format: [now | 36020 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 36021 hour (1 or 2 digits) and mm is the minute of the hour (exactly 36022 two digits), and the shutdown shall commence at the next 36023 occurence of the specified time. If the format is mins (or 36024 +mins), where mins is a decimal number, shutdown shall commence 36025 in the specified number of minutes. The word now is an alias 36026 for +0. 36027 warning-message 36028 36029 specify a message to send to all users. 36030 36031 Access Control 36032 36033 If the shutdown utility is invoked with the -a option, it shall 36034 check that an authorized user is currently logged in on the 36035 system console. Authorized users are listed, one per line, in 36036 the file /etc/shutdown.allow. Lines in this file that begin 36037 with a '#' or are blank shall be ignored. 36038 36039 Note: The intent of this scheme is to allow a keyboard 36040 sequence entered on the system console (e.g. CTRL-ALT-DEL, 36041 or STOP-A) to automatically invoke shutdown -a, and can be 36042 used to prevent unauthorized users from shutting the system 36043 down in this fashion. 36044 36045 su 36046 36047 Name 36048 36049 su -- change user ID 36050 36051 Synopsis 36052 36053 su [options] [-] [username [ARGS]] 36054 36055 Description 36056 36057 The su command shall start a shell running with the real and 36058 effective user and group IDs of the user username. If username 36059 is not specified, su shall default to an unspecified user with 36060 all appropriate privileges. If the -s or --shell is not 36061 specified, the shell to be invoked shall be that specified for 36062 username in the user database (see getpwnam()), or /bin/sh if 36063 there is no shell specified in the user database. 36064 36065 If the - option is specified, or if the first operand is -, the 36066 environment for the shell shall be initialized as if the new 36067 shell was a login shell (see Shell Invocation). 36068 36069 If the invoking user does not have appropriate privileges, the 36070 su command shall prompt for a password and validate this before 36071 continuing. Invalid passwords shall produce an error message. 36072 The su command shall log in an unspecified manner all 36073 invokations, whether successful or unsuccessful. 36074 36075 Any operands specified after the username shall be passed to 36076 the invoked shell. 36077 36078 If the option - is not specified, and if the first operand is 36079 not -, the environemnt for the new shell shall be intialized 36080 from the current environment. If none of the -m, -p, or 36081 --preserve-environment options are specified, the environment 36082 may be modified in unspecified ways before invoking the shell. 36083 If any of the -m, -p, or --preserve-environment options are 36084 specified, the environment shall not be altered. 36085 36086 Note: Although the su command shall not alter the 36087 environment, the invoked shell may still alter it before it 36088 is ready to intepret any commands. 36089 36090 Standard Options 36091 36092 - 36093 the invoked shell shall be a login shell. 36094 36095 -c command, --command=command 36096 Invoke the shell with the option -c command. 36097 36098 -m, -p, --preserve-environment 36099 The current environment shall be passed to the invoked 36100 shell. If the environment variable SHELL is set, it 36101 shall specify the shell to invoke, if it matches an 36102 entry in /etc/shells. If there is no matching entry in 36103 /etc/shells, this option shall be ignored if the - 36104 option is also specified, or if the first operand is -. 36105 36106 -s shell, --shell=shell 36107 Invoke shell as the comamnd interpreter. The shell 36108 specified shall be present in /etc/shells. 36109 36110 sync 36111 36112 Name 36113 36114 sync -- flush file system buffers 36115 36116 Synopsis 36117 36118 sync 36119 36120 Description 36121 36122 Force changed blocks to disk, update the super block. 36123 36124 tar 36125 36126 Name 36127 36128 tar -- file archiver 36129 36130 Description 36131 36132 tar is as specified in SUSv2, but with differences as listed 36133 below. 36134 36135 Differences 36136 36137 Some elements of the Pattern Matching Notation are optional; 36138 see Pattern Matching Notation. 36139 36140 -h 36141 36142 doesn't dump symlinks; dumps the files they point to. 36143 -z 36144 36145 filters the archive through gzip. 36146 36147 umount 36148 36149 Name 36150 36151 umount -- unmount file systems 36152 36153 Synopsis 36154 36155 umount [-hV] 36156 umount -a [-nrv] [-t vfstype] 36157 umount [-nrv] device | dir... 36158 36159 Description 36160 36161 umount detaches the file system(s) mentioned from the file 36162 hierarchy. A file system is specified by giving the directory 36163 where it has been mounted. 36164 36165 Standard Options 36166 36167 -v 36168 36169 invokes verbose mode. 36170 -n 36171 36172 unmounts without writing in /etc/mtab. 36173 -r 36174 36175 tries to remount read-only if unmounting fails. 36176 -a 36177 36178 unmounts all of the file systems described in /etc/mtab except 36179 for the proc file system. 36180 -t vfstype 36181 36182 indicates that the actions should only be taken on file systems 36183 of the specified type. More than one type may be specified in a 36184 comma separated list. The list of file system types can be 36185 prefixed with no to specify the file system types on which no 36186 action should be taken. 36187 -f 36188 36189 forces unmount (in case of an unreachable NFS system). 36190 36191 LSB Deprecated Options 36192 36193 The behaviors specified in this section are expected to 36194 disappear from a future version of the LSB; applications should 36195 only use the non-LSB-deprecated behaviors. 36196 36197 -V 36198 36199 print version and exits. 36200 36201 useradd 36202 36203 Name 36204 36205 useradd -- create a new user or update default new user 36206 information 36207 36208 Synopsis 36209 36210 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 36211 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 36212 [-u uid [-o]] login 36213 useradd -D [-g default_group] [-b default_home] [-s 36214 default_shell] 36215 36216 Description 36217 36218 When invoked without the -D option, and with appropriate 36219 privilege, useradd creates a new user account using the values 36220 specified on the command line and the default values from the 36221 system. The new user account will be entered into the system 36222 files as needed, the home directory will be created, and 36223 initial files copied, depending on the command line options. 36224 36225 When invoked with the -D option, useradd will either display 36226 the current default values, or, with appropriate privilege, 36227 update the default values from the command line. If no options 36228 are specified, useradd displays the current default values. 36229 36230 The useradd command is a system administration utility, see 36231 Path For System Administration Utilities. 36232 36233 Standard Options 36234 36235 -c comment 36236 36237 specifies the new user's password file comment field value. 36238 -d home_dir 36239 36240 creates the new user using home_dir as the value for the user's 36241 login directory. The default is to append the login name to 36242 default_home and use that as the login directory name. 36243 -g initial_group 36244 36245 specifies the group name or number of the user's initial login 36246 group. The group name shall exist. A group number shall refer 36247 to an already existing group. If -g is not specified, the 36248 implementation will follow the normal user default for that 36249 system. This may create a new group or choose a default group 36250 that normal users are placed in. Applications which require 36251 control of the groups into which a user is placed should 36252 specify -g. 36253 -G group[,...] 36254 36255 specifies a list of supplementary groups which the user is also 36256 a member of. Each group is separated from the next by a comma, 36257 with no intervening whitespace. The groups are subject to the 36258 same restrictions as the group given with the -g option. The 36259 default is for the user to belong only to the initial group. 36260 -m [-k skeleton_dir] 36261 36262 specifies the user's home directory will be created if it does 36263 not exist. The files contained in skeleton_dir will be copied 36264 to the home directory if the -k option is used, otherwise the 36265 files contained in /etc/skel will be used instead. Any 36266 directories contained in skeleton_dir or /etc/skel will be 36267 created in the user's home directory as well. The -k option is 36268 only valid in conjunction with the -m option. The default is to 36269 not create the directory and to not copy any files. 36270 -p passwd 36271 36272 is the encrypted password, as returned by crypt(). The default 36273 is to disable the account. 36274 -r 36275 36276 creates a system account, that is, a user with a User ID in the 36277 range reserved for system account users. If there is not a User 36278 ID free in the reserved range the command will fail. 36279 -s shell 36280 36281 specifies the name of the user's login shell. The default is to 36282 leave this field blank, which causes the system to select the 36283 default login shell. 36284 -u uid [-o] 36285 36286 specifies the numerical value of the user's ID. This value 36287 shall be unique, unless the -o option is used. The value shall 36288 be non-negative. The default is the smallest ID value greater 36289 than 499 which is not yet used. 36290 36291 Change Default Options 36292 36293 -b default_home 36294 36295 specifies the initial path prefix for a new user's home 36296 directory. The user's name will be affixed to the end of 36297 default_home to create the new directory name if the -d option 36298 is not used when creating a new account. 36299 -g default_group 36300 36301 specifies the group name or ID for a new user's initial group. 36302 The named group shall exist, and a numerical group ID shall 36303 have an existing entry. 36304 -s default_shell 36305 36306 specifies the name of the new user's login shell. The named 36307 program will be used for all future new user accounts. 36308 -c comment 36309 36310 specifies the new user's password file comment field value. 36311 36312 Application Usage 36313 36314 The -D option will typically be used by system administration 36315 packages. Most applications should not change defaults which 36316 will affect other applications and users. 36317 36318 userdel 36319 36320 Name 36321 36322 userdel -- delete a user account and related files 36323 36324 Synopsis 36325 36326 userdel [-r] login 36327 36328 Description 36329 36330 Delete the user account named login. If there is also a group 36331 named login, this command may delete the group as well, or may 36332 leave it alone. 36333 36334 The userdel command is a system administration utility, see 36335 Path For System Administration Utilities. 36336 36337 Options 36338 36339 -r 36340 36341 removes files in the user's home directory along with the home 36342 directory itself. Files located in other file system will have 36343 to be searched for and deleted manually. 36344 36345 usermod 36346 36347 Name 36348 36349 usermod -- modify a user account 36350 36351 Synopsis 36352 36353 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] [-G 36354 group [,...]] [-l login_name] [-p passwd] [-s shell] [-u uid [ 36355 -o]] login 36356 36357 Description 36358 36359 The usermod command shall modify an entry in the user account 36360 database. 36361 36362 The usermod command is a system administration utility, see 36363 Path For System Administration Utilities. 36364 36365 Options 36366 36367 -c comment 36368 36369 specifies the new value of the user's password file comment 36370 field. 36371 -d home_dir 36372 36373 specifies the user's new login directory. If the -m option is 36374 given the contents of the current home directory will be moved 36375 to the new home directory, which is created if it does not 36376 already exist. 36377 -g initial_group 36378 36379 specifies the group name or number of the user's new initial 36380 login group. The group name shall exist. A group number shall 36381 refer to an already existing group. 36382 -G group,[...] 36383 36384 specifies a list of supplementary groups which the user is also 36385 a member of. Each group is separated from the next by a comma, 36386 with no intervening whitespace. The groups are subject to the 36387 same restrictions as the group given with the -g option. If the 36388 user is currently a member of a group which is not listed, the 36389 user will be removed from the group. 36390 -l login_name 36391 36392 changes the name of the user from login to login_name. Nothing 36393 else is changed. In particular, the user's home directory name 36394 should probably be changed to reflect the new login name. 36395 -p passwd 36396 36397 is the encrypted password, as returned by crypt(3). 36398 -s shell 36399 36400 specifies the name of the user's new login shell. Setting this 36401 field to blank causes the system to select the default login 36402 shell. 36403 -u uid [-o] 36404 36405 specifies the numerical value of the user's ID. This value 36406 shall be unique, unless the -o option is used. The value shall 36407 be non-negative. Any files which the user owns and which are 36408 located in the directory tree rooted at the user's home 36409 directory will have the file user ID changed automatically. 36410 Files outside of the user's home directory shall be altered 36411 manually. 36412 36413 xargs 36414 36415 Name 36416 36417 xargs -- build and execute command lines from standard input 36418 36419 Description 36420 36421 xargs is as specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), 36422 but with differences as listed below. 36423 36424 Differences 36425 36426 -E 36427 36428 has unspecified behavior. 36429 -I 36430 36431 has unspecified behavior. 36432 -L 36433 36434 has unspecified behavior. 36435 36436 Note: These options have been implemented in 36437 findutils-4.2.9, but this version of the utilities is not in 36438 widespread use as of April 2005. However, future versions of 36439 this specification will require support for these arguments. 36440 36441 zcat 36442 36443 Name 36444 36445 zcat -- uncompress files to standard output 36446 36447 Description 36448 36449 The zcat utility shall behave as described in POSIX 1003.1-2001 36450 (ISO/IEC 9945-2003), with differences listed below. 36451 36452 The Filesystem Hierarchy Standard requires that if zcat exists, 36453 it must be a symbolic or hard link to /bin/gzip. This 36454 specification additionally allows zcat to be a wrapper script 36455 which calls gzip -c -d. 36456 36457 Differences 36458 36459 The zcat utility shall write to standard output the 36460 uncompressed form of files that have been compressed using any 36461 of the compression methods supported by the gzip utility. It is 36462 the equivalent of gzip -c -d. Input files are not affected. 36463 36464 VII. Execution Environment 36465 36466 Table of Contents 36467 16. File System Hierarchy 36468 36469 16.1. /dev: Device Files 36470 16.2. /etc: Host-specific system configuration 36471 36472 16.2.1. File Naming Conventions 36473 36474 16.3. User Accounting Databases 36475 16.4. Path For System Administration Utilities 36476 36477 17. Additional Recommendations 36478 36479 17.1. Recommendations for applications on ownership and 36480 permissions 36481 36482 17.1.1. Directory Write Permissions 36483 17.1.2. File Write Permissions 36484 17.1.3. File Read and execute Permissions 36485 17.1.4. SUID and SGID Permissions 36486 17.1.5. Privileged users 36487 17.1.6. Changing permissions 36488 17.1.7. Removable Media (Cdrom, Floppy, etc.) 36489 17.1.8. Installable applications 36490 36491 18. Additional Behaviors 36492 36493 18.1. Mandatory Optional Behaviors 36494 36495 18.1.1. Special Requirements 36496 36497 18.2. Optional Mandatory Behaviors 36498 18.3. Executable Scripts 36499 36500 19. Localization 36501 36502 19.1. Introduction 36503 19.2. Regular Expressions 36504 19.3. Pattern Matching Notation 36505 __________________________________________________________ 36506 36507 Chapter 16. File System Hierarchy 36508 36509 An LSB conforming implementation shall provide the mandatory 36510 portions of the file system hierarchy specified in the 36511 Filesystem Hierarchy Standard (FHS), together with any 36512 additional requirements made in this specification. 36513 36514 An LSB conforming application shall conform to the Filesystem 36515 Hierarchy Standard. 36516 36517 The FHS allows many components or subsystems to be optional. An 36518 application shall check for the existence of an optional 36519 component before using it, and should behave in a reasonable 36520 manner if the optional component is not present. 36521 36522 The FHS requirement to locate the operating system kernel in 36523 either / or /boot does not apply if the operating system kernel 36524 does not exist as a file in the file system. 36525 36526 The FHS specifies certain behaviors for a variety of commands 36527 if they are present (for example, ping or python). However, LSB 36528 conforming applications shall not rely on any commands beyond 36529 those specified by the LSB. The mere existence of a command may 36530 not be used as an indication that the command behaves in any 36531 particular way. 36532 36533 The following directories or links need not be present: 36534 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 36535 __________________________________________________________ 36536 36537 16.1. /dev: Device Files 36538 36539 The devices described in Chapter 6. "Operating System Specific 36540 Annex", Section 6.1. "Linux", subsection 6.1.3. "/dev: Devices 36541 and special files" in the Filesystem Hierarchy Standard are 36542 required on an LSB conforming system. Other devices may also 36543 exist in /dev. Device names may exist as symbolic links to 36544 other device nodes located in /dev or subdirectories of /dev. 36545 There is no requirement concerning major/minor number values. 36546 __________________________________________________________ 36547 36548 16.2. /etc: Host-specific system configuration 36549 36550 In addition to the requirements for /etc in the Filesystem 36551 Hierarchy Standard, an LSB conforming system shall also provide 36552 the following directories or symbolic links to directories: 36553 36554 /etc/cron.d 36555 36556 A directory containing extended crontab files; see Cron Jobs. 36557 /etc/cron.daily 36558 36559 A directory containing shell scripts to be executed once a day; 36560 see Cron Jobs. 36561 /etc/cron.hourly 36562 36563 A directory containing shell scripts to be executed once per 36564 hour; see Cron Jobs. 36565 /etc/cron.monthly 36566 36567 A directory containing shell scripts to be executed once per 36568 month; see Cron Jobs. 36569 /etc/cron.weekly 36570 36571 A directory containing shell scripts to be executed once a 36572 week; see Cron Jobs. 36573 /etc/init.d 36574 36575 A directory containing system initialization scripts; see 36576 Installation and Removal of Init Scripts. 36577 /etc/profile.d 36578 36579 A directory containing shell scripts. Script names should 36580 follow the same conventions as specified for cron jobs (see 36581 Cron Jobs, but should have the suffix .sh. The behavior is 36582 unspecified if a script is installed in this directory that 36583 does not have the suffix .sh. 36584 36585 The sh utility shall read and execute commands in its current 36586 execution environment from all the shell scripts in this 36587 directory that have the suffix .sh when invoked as an 36588 interactive login shell, or if the -l (the letter ell) is 36589 specified (see Shell Invocation). 36590 36591 Future Directions: These directories are required at this 36592 version of the LSB since there is not yet an agreed method 36593 for abstracting the implementation so that applications need 36594 not be aware of these locations during installation. 36595 __________________________________________________________ 36596 36597 16.2.1. File Naming Conventions 36598 36599 Conforming implementations and applications installing files 36600 into any of the above locations under /etc may only use 36601 filenames from the following managed namespaces: 36602 36603 * Assigned names. Such names must be chosen from the 36604 character set [a-z0-9]. In order to avoid conflicts these 36605 names shall be reserved through the Linux Assigned Names 36606 and Numbers Authority (LANANA). Information about the 36607 LANANA may be found at www.lanana.org. 36608 36609 Note: Commonly used names should be reserved in advance; 36610 developers for projects are encouraged to reserve names from 36611 LANANA, so that each distribution can use the same name, and 36612 to avoid conflicts with other projects. 36613 * Hierarchical names. Script names in this category take the 36614 form: --...-, where name is taken from 36615 the character set [a-z0-9], and where there may be one or 36616 more components. may either be an LSB 36617 provider name assigned by the LANANA, or it may be owners' 36618 DNS name in lower case, with at least one '.'. e.g. 36619 "debian.org", "staroffice.sun.com", etc. The LSB provider 36620 name assigned by LANANA shall only consist of the ASCII 36621 characters [a-z0-9]. 36622 * Reserved names. Names that begin with the character '_' are 36623 reserved for distribution use only. These names should be 36624 used for essential system packages only. 36625 36626 Note: A non-conforming application may still have polluted 36627 these managed namespaces with unregistered filenames; a 36628 conforming application should check for namespace collisions 36629 and take appropriate steps if they occur. 36630 36631 In general, if a package or some system function is likely 36632 to be used on multiple systems, the package developers or 36633 the distribution should get a registered name through 36634 LANANA, and distributions should strive to use the same name 36635 whenever possible. For applications which may not be 36636 essential or may not be commonly installed, the hierarchical 36637 namespace may be more appropriate. An advantage to the 36638 hierarchical namespace is that there is no need to consult 36639 with the LANANA before obtaining an assigned name. 36640 36641 Short names are highly desirable, since system 36642 administrators may need to manually start and stop services. 36643 Given this, they should be standardized on a per-package 36644 basis. This is the rationale behind having the LANANA 36645 organization assign these names. The LANANA may be called 36646 upon to handle other namespace issues, such as 36647 package/prerequisites naming. 36648 __________________________________________________________ 36649 36650 16.3. User Accounting Databases 36651 36652 The Filesystem Hierarchy Standard specifies two optional 36653 locations for user accounting databases used by the getutent(), 36654 getutent_r(), getutxent(), getutxid(), getutxline(), and 36655 pututxline() functions. These are /var/run/utmp and 36656 /var/run/wtmp. 36657 36658 The LSB does not specify the format or structure of these 36659 files, or even if they are files at all. They should be used 36660 only as "magic cookies" to the utmpname() function. 36661 __________________________________________________________ 36662 36663 16.4. Path For System Administration Utilities 36664 36665 Certain utilities used for system administration (and other 36666 privileged commands) may be stored in /sbin, /usr/sbin, and 36667 /usr/local/sbin. Applications requiring to use commands 36668 identified as system administration utilities should add these 36669 directories to their PATH. By default, as described in POSIX 36670 1003.1-2001 (ISO/IEC 9945-2003), standard utilities shall be 36671 found on the PATH returned by getconf PATH (or command -p 36672 getconf PATH to be guaranteed to invoke the correct version of 36673 getconf). 36674 __________________________________________________________ 36675 36676 Chapter 17. Additional Recommendations 36677 36678 17.1. Recommendations for applications on ownership and permissions 36679 36680 17.1.1. Directory Write Permissions 36681 36682 The application should not depend on having directory write 36683 permission in any directory except /tmp, /var/tmp, and the 36684 invoking user's home directory. 36685 36686 In addition, the application may store variable data in 36687 /var/opt/package, (where package is the name of the application 36688 package), if such a directory is created with appropriate 36689 permissions during the package installation. 36690 36691 For these directories the application should be able to work 36692 with directory write permissions restricted by the S_ISVTXT 36693 bit, implementing the restricted deletion mode as described for 36694 the XSI option for POSIX 1003.1-2001 (ISO/IEC 9945-2003).. 36695 __________________________________________________________ 36696 36697 17.1.2. File Write Permissions 36698 36699 The application should not depend on file write permission to 36700 any file that it does not itself create. 36701 __________________________________________________________ 36702 36703 17.1.3. File Read and execute Permissions 36704 36705 The application should not depend on having read permission to 36706 every file and directory. 36707 __________________________________________________________ 36708 36709 17.1.4. SUID and SGID Permissions 36710 36711 The application should not depend on the set user ID or set 36712 group ID (the S_ISUID or S_ISGID permission bits) permissions 36713 of a file not packaged with the application. Instead, the 36714 distribution is responsible for assuming that all system 36715 commands have the required permissions and work correctly. 36716 36717 Rationale: In order to implement common security policies it 36718 is strongly advisable for applications to use the minimum 36719 set of security attributes necessary for correct operation. 36720 Applications that require substantial appropriate privilege 36721 are likely to cause problems with such security policies. 36722 __________________________________________________________ 36723 36724 17.1.5. Privileged users 36725 36726 In general, applications should not depend on running as a 36727 privileged user. This specification uses the term "appropriate 36728 privilege" throughout to identify operations that cannot be 36729 achieved without some special granting of additional privilege. 36730 36731 Applications that have a reason to run with appropriate 36732 privilege should outline this reason clearly in their 36733 documentation. Users of the application should be informed, 36734 that "this application demands security privileges, which could 36735 interfere with system security". 36736 36737 The application should not contain binary-only software that 36738 requires being run with appropriate privilege, as this makes 36739 security auditing harder or even impossible. 36740 __________________________________________________________ 36741 36742 17.1.6. Changing permissions 36743 36744 The application shall not change permissions of files and 36745 directories that do not belong to its own package. Should an 36746 application require that certain files and directories not 36747 directly belonging to the package have a particular ownership, 36748 the application shall document this requirement, and may fail 36749 during installation if the permissions on these files is 36750 inappropriate. 36751 __________________________________________________________ 36752 36753 17.1.7. Removable Media (Cdrom, Floppy, etc.) 36754 36755 Applications that expect to be runnable from removable media 36756 should not depend on logging in as a privileged user, and 36757 should be prepared to deal with a restrictive environment. 36758 Examples of such restrictions could be default mount options 36759 that disable set-user/group-ID attributes, disabling block or 36760 character-special files on the medium, or remapping the user 36761 and group IDs of files away from any privileged value. 36762 36763 Rationale: System vendors and local system administrators 36764 want to run applications from removable media, but want the 36765 possibility to control what the application can do. 36766 __________________________________________________________ 36767 36768 17.1.8. Installable applications 36769 36770 Where the installation of an application needs additional 36771 privileges, it must clearly document all files and system 36772 databases that are modified outside of those in /opt/pkg-name 36773 and /var/opt/pkg-name, other than those that may be updated by 36774 system logging or auditing activities. 36775 36776 Without this, the local system administrator would have to 36777 blindly trust a piece of software, particularly with respect to 36778 its security. 36779 __________________________________________________________ 36780 36781 Chapter 18. Additional Behaviors 36782 36783 18.1. Mandatory Optional Behaviors 36784 36785 This section specifies behaviors in which there is optional 36786 behavior in one of the standards on which this specification 36787 relies, and where this specification requires a specific 36788 behavior. 36789 36790 Note: This specification does not require the kernel to be 36791 Linux; the set of mandated options reflects current existing 36792 practice, but may be modified in future releases. 36793 36794 LSB conforming implementations shall support the following 36795 options defined within the POSIX 1003.1-2001 (ISO/IEC 36796 9945-2003): 36797 36798 _POSIX_FSYNC 36799 _POSIX_MAPPED_FILES 36800 _POSIX_MEMLOCK 36801 _POSIX_MEMLOCK_RANGE 36802 _POSIX_MEMORY_PROTECTION 36803 _POSIX_PRIORITY_SCHEDULING 36804 _POSIX_REALTIME_SIGNALS 36805 _POSIX_THREAD_ATTR_STACKADDR 36806 _POSIX_THREAD_ATTR_STACKSIZE 36807 _POSIX_THREAD_PROCESS_SHARED 36808 _POSIX_THREAD_SAFE_FUNCTIONS 36809 _POSIX_THREADS 36810 36811 The opendir() function shall consume a file descriptor in the 36812 same fashion as open(), and therefore may fail with EMFILE or 36813 ENFILE. 36814 36815 The START and STOP termios characters shall be changeable, as 36816 described as optional behavior in the "General Terminal 36817 Interface" section of the POSIX 1003.1-2001 (ISO/IEC 36818 9945-2003). 36819 36820 The access() function function shall fail with errno set to 36821 EINVAL if the amode argument contains bits other than those set 36822 by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 36823 36824 The link() function shall require access to the existing file 36825 in order to succeed, as described as optional behavior in the 36826 POSIX 1003.1-2001 (ISO/IEC 9945-2003). 36827 36828 Calling unlink() on a directory shall fail. Calling link() 36829 specifying a directory as the first argument shall fail. See 36830 also unlink. 36831 36832 Note: Linux allows rename() on a directory without having 36833 write access, but this specification does not require this 36834 behavior. 36835 __________________________________________________________ 36836 36837 18.1.1. Special Requirements 36838 36839 LSB conforming systems shall enforce certain special additional 36840 restrictions above and beyond those required by POSIX 36841 1003.1-2001 (ISO/IEC 9945-2003). 36842 36843 Note: These additional restrictions are required in order to 36844 support the testing and certification programs associated 36845 with the LSB. In each case, these are values that defined 36846 macros must not have; conforming applications that use these 36847 values shall trigger a failure in the interface that is 36848 otherwise described as a "may fail". 36849 36850 The fcntl() function shall treat the "cmd" value -1 as invalid. 36851 36852 The whence value -1 shall be an invalid value for the lseek(), 36853 fseek() and fcntl() functions. 36854 36855 The value -5 shall be an invalid signal number. 36856 36857 If the sigaddset() or sigdelset() functions are passed an 36858 invalid signal number, they shall return with EINVAL. 36859 Implementations are only required to enforce this requirement 36860 for signal numbers which are specified to be invalid by this 36861 specification (such as the -5 mentioned above). 36862 36863 The mode value -1 to the access() function shall be treated as 36864 invalid. 36865 36866 A value of -1 shall be an invalid "_PC_..." value for 36867 pathconf(). 36868 36869 A value of -1 shall be an invalid "_SC..." value for sysconf(). 36870 36871 The nl_item value -1 shall be invalid for nl_langinfo(). 36872 36873 The value -1 shall be an invalid "_CS_..." value for confstr(). 36874 36875 The value "a" shall be an invalid mode argument to popen(). 36876 36877 The fcntl() function shall fail and set errno to EDEADLK if the 36878 cmd argument is F_SETLKW, and the lock is blocked by a lock 36879 from another process already blocked by the current process. 36880 36881 The opendir() function shall consume a file descriptor; the 36882 readdir() function shall fail and set errno to EBADF if the 36883 underlying file descriptor is closed. 36884 36885 The link() function shall not work across file systems, and 36886 shall fail and set errno to EXDEV as described as optional 36887 behavior in POSIX 1003.1-2001 (ISO/IEC 9945-2003). 36888 __________________________________________________________ 36889 36890 18.2. Optional Mandatory Behaviors 36891 36892 This section specifies behaviors that are mandatory in one of 36893 the standards on which this specification relies, but which are 36894 optional in this specification. 36895 36896 POSIX 1003.1-2001 (ISO/IEC 9945-2003) describes the behavior of 36897 the file access time, available as the st_atime field of the 36898 stat and stat64 structures. An LSB conforming implementation 36899 need not update this information every time a file is accessed. 36900 36901 Note: A subsequent edition of the POSIX standard no longer 36902 mandates updating of st_atime but the older edition is still 36903 the guiding standard for this specification, thus this 36904 exception is needed. 36905 __________________________________________________________ 36906 36907 18.3. Executable Scripts 36908 36909 An executable script is an executable file of which the first 36910 two characters are #! as defined in the portable character set. 36911 In POSIX 1003.1-2001 (ISO/IEC 9945-2003), this construct is 36912 undefined, but reserved for implementations which wish to 36913 provide this functionality. LSB conforming implementations 36914 shall support executable scripts. 36915 36916 A successful call to a function of the exec family with an 36917 executable script as the first parameter shall result in a new 36918 process, where the process image started is that of the 36919 interpreter. The path name of the interpreter follows the #! 36920 characters. 36921 36922 If the executable script has a first line 36923 36924 #! interpreter [arg] 36925 36926 then interpreter shall be called with an argument array 36927 consisting of an unspecified zeroth argument, followed by arg 36928 (if present), followed by a path name for the script, followed 36929 by the arguments following the zeroth argument in the exec call 36930 of the script. 36931 36932 The interpreter shall not perform any operations on the first 36933 line of an executable script. 36934 36935 The first line of the executable script shall meet all of the 36936 following criteria otherwise the results are unspecified: 36937 36938 1. Is of one of the forms: 36939 36940 #!interpreter 36941 #! interpreter 36942 #!interpreter arg 36943 #! interpreter arg 36944 36945 2. The interpreter argument is an absolute pathname of an 36946 executable file other than an executable script. 36947 3. Neither the interpreter argument nor the arg argument, if 36948 present, contain any quoting characters. 36949 4. Neither the interpreter argument nor the arg argument, if 36950 present, contain any whitespace characters. 36951 5. The length of the entire line is no longer than 80 bytes. 36952 36953 If the interpreter is required by this specification to be in a 36954 specfic named directory, a conforming application must use that 36955 path for interpreter, as implementations are not prohibited 36956 from having other, possibly non-conforming, versions of the 36957 same interpreter installed on the system. If the interpreter is 36958 a required command in this specification, but does not have a 36959 required path, the application should take special measures to 36960 insure the appropriate version is selected. If the interpreter 36961 is not a required command in this specification, the 36962 application must make appropriate provisions that the 36963 interpreter is available at the appropriate path. 36964 36965 Note: In case the path is not specified, it is recommended 36966 that an installation script for executable scripts use the 36967 standard PATH returned by a call to the getconf command with 36968 the argument PATH, combined with the command command to 36969 determine the location of a standard command. 36970 36971 For example to determine the location of the standard awk 36972 command: 36973 36974 PATH=`getconf PATH` command -v awk 36975 36976 The installation script should ensure that the returned 36977 pathname is an absolute pathname prior to use, since a shell 36978 builtin might be returned for some utilities. 36979 36980 Use of the common form #!/usr/bin/env interpreter is not 36981 recommended as the PATH will be unknown at execution time 36982 and an alternative version of interpreter might be selected. 36983 __________________________________________________________ 36984 36985 Chapter 19. Localization 36986 36987 19.1. Introduction 36988 36989 In order to install a message catalog, the installation 36990 procedure shall supply the message catalog in a format readable 36991 by the msgfmt command, which shall be invoked to compile the 36992 message catalog into an appropriate binary format on the target 36993 system. 36994 36995 Rationale: The original intent was to allow an application 36996 to contain the binary GNU MO format files. However, the 36997 format of these files is not officially stable, hence it is 36998 necessary to compile these catalogs on the target system. 36999 These binary catalogs may differ from architecture to 37000 architecture as well. 37001 37002 The resulting binary message catalog shall be located in the 37003 package's private area under /opt, and the application may use 37004 bindtextdomain() to specify this location. 37005 37006 Implementations shall support the POSIX and C locales as 37007 specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003). Other 37008 locales may be supported. 37009 37010 Implementations may define additional locale categories not 37011 defined by that standard. 37012 37013 Note: Implementations choosing additional locale categories 37014 should be aware of ISO/IEC TR14652 and are advised not to 37015 choose names that conflict with that specification. If 37016 implementations provide locale categories whose names are 37017 part of the FDCC set of ISO/IEC TR14652, they should behave 37018 as defined by that specification. 37019 __________________________________________________________ 37020 37021 19.2. Regular Expressions 37022 37023 Utilities that process regular expressions shall support Basic 37024 Regular Expressions and Extended Regular Expressions as 37025 specified in POSIX 1003.1-2001 (ISO/IEC 9945-2003), with the 37026 following exceptions: 37027 37028 Range expression (such as [a-z]) can be based on code point 37029 order instead of collating element order. 37030 37031 Equivalence class expression (such as [=a=]) and 37032 multi-character collating element expression (such as [.ch.]) 37033 are optional. 37034 37035 Handling of a multi-character collating element is optional. 37036 37037 This affects at least the following utilities: 37038 37039 * awk (see awk) 37040 * grep (see grep) (including egrep , see egrep) 37041 * sed (see sed) 37042 37043 It also affects the behavior of interfaces in the base 37044 libraries, including at least 37045 37046 * regexec() (see regexec) 37047 __________________________________________________________ 37048 37049 19.3. Pattern Matching Notation 37050 37051 Utilities that perform filename pattern matching (also known as 37052 Filename Globbing) shall do it as specified in POSIX 37053 1003.1-2001 (ISO/IEC 9945-2003), Pattern Matching Notation, 37054 with the following exceptions: 37055 37056 Pattern bracket expressions (such as [a-z]) can be based on 37057 code point order instead of collating element order. 37058 37059 Equivalence class expression (such as [=a=]) and 37060 multi-character collating element expression (such as [.ch.]) 37061 are optional. 37062 37063 Handling of a multi-character collating element is optional. 37064 37065 This affects at least the following utilities: cpio (cpio), 37066 find and tar (tar). 37067 37068 VIII. System Initialization 37069 37070 Table of Contents 37071 20. System Initialization 37072 37073 20.1. Cron Jobs 37074 20.2. Init Script Actions 37075 20.3. Comment Conventions for Init Scripts 37076 20.4. Installation and Removal of Init Scripts 37077 20.5. Run Levels 37078 20.6. Facility Names 37079 20.7. Script Names 37080 20.8. Init Script Functions 37081 __________________________________________________________ 37082 37083 Chapter 20. System Initialization 37084 37085 20.1. Cron Jobs 37086 37087 In addition to the individual user crontab files specified by 37088 POSIX 1003.1-2001 (ISO/IEC 9945-2003), which are located in 37089 /var/spool/cron as specified by the Filesystem Hierarchy 37090 Standard (FHS), the process that executes scheduled commands 37091 shall also process the following additional crontab files, 37092 which are in a different format (see below). /etc/crontab, 37093 /etc/cron.d/*. The installation of a package shall not modify 37094 the crontab file /etc/crontab, and shall not directly modify 37095 the user crontab files in /var/spool/cron/crontabs. but may use 37096 the crontab command to modify the latter. 37097 37098 If a package wishes to install a job that has to be executed 37099 periodically, it shall place an executable cron script in one 37100 of the following directories: 37101 37102 /etc/cron.hourly 37103 /etc/cron.daily 37104 /etc/cron.weekly 37105 /etc/cron.monthly 37106 37107 As these directory names suggest, the files within them are 37108 executed on a hourly, daily, weekly, or monthly basis, 37109 respectively, under the control of an entry in one of the 37110 system crontab files, at an unspecified time of day. See below 37111 for the rules concerning the names of cron scripts. 37112 37113 Note: It is recommended that cron scripts installed in any 37114 of these directories be script files rather than compiled 37115 binaries so that they may be modified by the local system 37116 administrator. Conforming applications may only install cron 37117 scripts which use an interpreter required by this 37118 specification or provided by this or another conforming 37119 application. 37120 37121 This specification does not define the concept of a package 37122 upgrade. Implementations may do different things when 37123 packages are upgraded, including not replacing a cron script 37124 if it marked as a configuration file, particularly if the 37125 cron script appears to have been modified since 37126 installation. In some circumstances, the cron script may not 37127 be removed when the package is uninstalled. Applications 37128 should design their installation procedure and cron scripts 37129 to be robust in the face of such behavior. In particular, 37130 cron scripts should not fail obscurely if run in unexpected 37131 circumstances. Testing for the existence of application 37132 binaries before executing them is suggested. 37133 37134 If a certain task has to be executed at other than the 37135 predefined frequencies, the package shall install a file 37136 /etc/cron.d/cron-name. The file shall have the same format as 37137 that described for the crontab command in POSIX 1003.1-2001 37138 (ISO/IEC 9945-2003), except that there shall be an additional 37139 field, username, before the name of the command to execute. For 37140 completeness, the seven fields shall be: 37141 37142 1. Minute [0,59] 37143 2. Hour [0,23] 37144 3. Day of the month [1,31] 37145 4. Month of the year [1,12] 37146 5. Day of the week [0,6] (with 0=Sunday) 37147 6. Username 37148 7. command [args ...] 37149 37150 This file shall be processed by the system automatically, with 37151 the named command being run at the specified time, as the 37152 specified username. 37153 37154 Applications installing files in these directories shall use 37155 the LSB naming conventions (see File Naming Conventions). 37156 __________________________________________________________ 37157 37158 20.2. Init Script Actions 37159 37160 Conforming applications which need to execute commands on 37161 changes to the system run level (including boot and shutdown), 37162 may install one or more init scripts. Init scripts provided by 37163 conforming applications shall accept a single argument which 37164 selects the action: 37165 37166 start start the service 37167 stop stop the service 37168 restart stop and restart the service if the service is already 37169 running, otherwise start the service 37170 try-restart restart the service if the service is already 37171 running 37172 reload cause the configuration of the service to be reloaded 37173 without actually stopping and restarting the service 37174 force-reload cause the configuration to be reloaded if the 37175 service supports this, otherwise restart the service if it is 37176 running 37177 status print the current status of the service 37178 37179 The start, stop, restart, force-reload, and status actions 37180 shall be supported by all init scripts; the reload and the 37181 try-restart actions are optional. Other init-script actions may 37182 be defined by the init script. 37183 37184 Init scripts shall ensure that they will behave sensibly if 37185 invoked with start when the service is already running, or with 37186 stop when not running, and that they do not kill 37187 similarly-named user processes. The best way to achieve this is 37188 to use the init-script functions provided by 37189 /lib/lsb/init-functions (see Init Script Functions) 37190 37191 If a service reloads its configuration automatically (as in the 37192 case of cron, for example), the reload action of the init 37193 script shall behave as if the configuration was reloaded 37194 successfully. The restart, try-restart, reload and force-reload 37195 actions may be atomic; that is if a service is known not to be 37196 operational after a restart or reload, the script may return an 37197 error without any further action. 37198 37199 Note: This specification does not define the concept of a 37200 package upgrade. Implementations may do different things 37201 when packages are upgraded, including not replacing an init 37202 script if it is marked as a configuration file, particularly 37203 if the file appears to have been modified since 37204 installation. In some circumstances, the init script may not 37205 be removed when the package is uninstalled. Applications 37206 should design their installation procedure and init scripts 37207 to be robust in the face of such behavior. In particular, 37208 init scripts should not fail obscurely if run in unexpected 37209 circumstances. Testing for the existence of application 37210 binaries before executing them is suggested. 37211 37212 If the status action is requested, the init script will return 37213 the following exit status codes. 37214 37215 0 program is running or service is OK 37216 1 program is dead and /var/run pid file exists 37217 2 program is dead and /var/lock lock file exists 37218 3 program is not running 37219 4 program or service status is unknown 37220 5-99 reserved for future LSB use 37221 100-149 reserved for distribution use 37222 150-199 reserved for application use 37223 200-254 reserved 37224 37225 For all other init-script actions, the init script shall return 37226 an exit status of zero if the action was successful. Otherwise, 37227 the exit status shall be non-zero, as defined below. In 37228 addition to straightforward success, the following situations 37229 are also to be considered successful: 37230 37231 * restarting a service (instead of reloading it) with the 37232 force-reload argument 37233 * running start on a service already running 37234 * running stop on a service already stopped or not running 37235 * running restart on a service already stopped or not running 37236 * running try-restart on a service already stopped or not 37237 running 37238 37239 In case of an error while processing any init-script action 37240 except for status, the init script shall print an error message 37241 and exit with a non-zero status code: 37242 37243 1 generic or unspecified error (current practice) 37244 2 invalid or excess argument(s) 37245 3 unimplemented feature (for example, "reload") 37246 4 user had insufficient privilege 37247 5 program is not installed 37248 6 program is not configured 37249 7 program is not running 37250 8-99 reserved for future LSB use 37251 100-149 reserved for distribution use 37252 150-199 reserved for application use 37253 200-254 reserved 37254 37255 Error and status messages should be printed with the logging 37256 functions (see Init Script Functions) log_success_msg(), 37257 log_failure_msg() and log_warning_msg(). Scripts may write to 37258 standard error or standard output, but implementations need not 37259 present text written to standard error/output to the user or do 37260 anything else with it. 37261 37262 Note: Since init scripts may be run manually by a system 37263 administrator with non-standard environment variable values 37264 for PATH, USER, LOGNAME, etc., init scripts should not 37265 depend on the values of these environment variables. They 37266 should set them to some known/default values if they are 37267 needed. 37268 __________________________________________________________ 37269 37270 20.3. Comment Conventions for Init Scripts 37271 37272 Conforming applications may install one or more init scripts. 37273 These init scripts must be activated by invoking the 37274 install_initd command. Prior to package removal, the changes 37275 applied by install_initd must be undone by invoking 37276 remove_initd. See Installation and Removal of Init Scripts for 37277 more details. 37278 37279 install_initd and remove_initd determine actions to take by 37280 decoding a specially formatted block of lines in the script. 37281 This block shall be delimited by the lines 37282 ### BEGIN INIT INFO 37283 ### END INIT INFO 37284 37285 The delimiter lines may contain trailing whitespace, which 37286 shall be ignored. All lines inside the block shall begin with a 37287 hash character '#' in the first column, so the shell interprets 37288 them as comment lines which do not affect operation of the 37289 script. The lines shall be of the form: 37290 # {keyword}: arg1 [arg2...] 37291 37292 with exactly one space character between the '#' and the 37293 keyword, with a single exception. In lines following a line 37294 containing the Description keyword, and until the next keyword 37295 or block ending delimiter is seen, a line where the '#' is 37296 followed by more than one space or a tab character shall be 37297 treated as a continuation of the previous line. 37298 37299 The information extracted from the block is used by the 37300 installation tool or the init-script system to assure that init 37301 scripts are run in the correct order. It is unspecified whether 37302 the information is evaluated only when install_initd runs, when 37303 the init scripts are executed, or both. The information 37304 extracted includes run levels, defined in Run Levels, and boot 37305 facilities, defined in Facility Names. 37306 37307 The following keywords, with their arguments, are defined: 37308 37309 Provides: boot_facility_1 [boot_facility_2...] 37310 boot facilities provided by this init script. When an 37311 init script is run with a start argument, the boot 37312 facility or facilities specified by the Provides keyword 37313 shall be deemed present and hence init scripts which 37314 require those boot facilities should be started later. 37315 When an init script is run with a stop argument, the 37316 boot facilities specified by the Provides keyword are 37317 deemed no longer present. 37318 37319 Required-Start: boot_facility_1 [boot_facility_2...] 37320 facilities which must be available during startup of 37321 this service. The init-script system should insure init 37322 scripts which provide the Required-Start facilities are 37323 started before starting this script. 37324 37325 Required-Stop: boot_facility_1 [boot_facility_2...] 37326 facilities which must be available during the shutdown 37327 of this service. The init-script system should avoid 37328 stopping init scripts which provide the Required-Stop 37329 facilities until this script is stopped. 37330 37331 Should-Start: boot_facility_1 [boot_facility_2...] 37332 facilities which, if present, should be available during 37333 startup of this service. This allows for weak 37334 dependencies which do not cause the service to fail if a 37335 facility is not available. The service may provide 37336 reduced functionality in this situation. Conforming 37337 applications should not rely on the existence of this 37338 feature. 37339 37340 Should-Stop: boot_facility_1 [boot_facility_2...] 37341 facilities which should be available during shutdown of 37342 this service. 37343 37344 Default-Start: run_level_1 [run_level_2...], Default-Stop: 37345 run_level_1 [run_level_2...] 37346 which run levels should by default run the init script 37347 with a start (stop) argument to start (stop) the 37348 services controlled by the init script. 37349 37350 For example, if a service should run in runlevels 3, 4, 37351 and 5 only, specify "Default-Start: 3 4 5" and 37352 "Default-Stop: 0 1 2 6". 37353 37354 Short-Description: short_description 37355 provide a brief description of the actions of the init 37356 script. Limited to a single line of text. 37357 37358 Description: multiline_description 37359 provide a more complete description of the actions of 37360 the init script. May span mulitple lines. In a multiline 37361 description, each continuation line shall begin with a 37362 '#' followed by tab character or a '#' followed by at 37363 least two space characters. The multiline description is 37364 terminated by the first line that does not match this 37365 criteria. 37366 37367 Additional keywords may be defined in future versions of this 37368 specification. Also, implementations may define local 37369 extensions by using the prefix X-implementor. For example, 37370 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 37371 37372 Example: 37373 37374 ### BEGIN INIT INFO 37375 # Provides: lsb-ourdb 37376 # Required-Start: $local_fs $network $remote_fs 37377 # Required-Stop: $local_fs $network $remote_fs 37378 # Default-Start: 2 3 4 5 37379 # Default-Stop: 0 1 6 37380 # Short-Description: start and stop OurDB 37381 # Description: OurDB is a very fast and reliable database 37382 # engine used for illustrating init scripts 37383 ### END INIT INFO 37384 37385 The comment conventions described in this section are only 37386 required for init scripts installed by conforming applications. 37387 Conforming runtime implementations are not required to use this 37388 scheme in their system provided init scripts. 37389 37390 Note: This specification does not require, but is designed 37391 to allow, the development of a system which runs init 37392 scripts in parallel. Hence, enforced-serialization of 37393 scripts is avoided unless it is explicitly necessary. 37394 __________________________________________________________ 37395 37396 20.4. Installation and Removal of Init Scripts 37397 37398 Conforming applications may install one or more initialization 37399 scripts (or init scripts). An init script shall be installed in 37400 /etc/init.d (which may be a symbolic link to another location), 37401 by the package installer. 37402 37403 During the installer's post-install processing phase the 37404 program /usr/lib/lsb/install_initd must be called to activate 37405 the init script. Activation consists of arranging for the init 37406 script to be called in the correct order on system run-level 37407 changes (including system boot and shutdown), based on 37408 dependencies supplied in the init script (see Comment 37409 Conventions for Init Scripts). The install_initd command should 37410 be thought of as a wrapper which hides the implementation 37411 details; how any given implementation arranges for the init 37412 script to be called at the appropriate time is not specified. 37413 37414 Example: if an init script specified "Default-Start: 3 4 5" 37415 and "Default-Stop: 0 1 2 6", install_initd might create 37416 "start" symbolic links with names starting with 'S' in 37417 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 37418 links with names starting with 'K' in /etc/rc0.d, 37419 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 37420 be similar to the System V Init mechanism, but is by no 37421 means the only way this specification could be implemented. 37422 37423 The install_initd command takes a single argument, the full 37424 pathname of the installed init script. The init script must 37425 already be installed in /etc/init.d. The install_initd command 37426 will not copy it there, only activate it once it has been 37427 installed. For example: 37428 37429 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 37430 37431 The install_initd command shall return an exit status of zero 37432 if the init-script activation was successful or if the init 37433 script was already activated. If the dependencies in the init 37434 script (see Comment Conventions for Init Scripts) cannot be 37435 met, an exit status of one shall be returned and the init 37436 script shall not be activated. 37437 37438 When a software package is removed, /usr/lib/lsb/remove_initd 37439 must be called to deactivate the init script. This must occur 37440 before the init script itself is removed, as the dependency 37441 information in the script may be required for successful 37442 completion. Thus the installer's pre-remove processing phase 37443 must call remove_initd, and pass the full pathname of the 37444 installed init script. The package installer is still 37445 responsible for removing the init script. For example: 37446 37447 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 37448 37449 The remove_initd program shall return an exit status of zero if 37450 the init script has been successfully deactivated or if the 37451 init script is not activated. If another init script which 37452 depends on a boot facility provided by this init script is 37453 activated, an exit status of one shall be returned and the init 37454 script shall remain activated. The installer must fail on such 37455 an exit code so it does not subsequently remove the init 37456 script. 37457 37458 Note: This specification does not describe a mechanism for 37459 the system administrator to manipulate the run levels at 37460 which an init script is started or stopped. There is no 37461 assurance that modifying the comment block for this purpose 37462 will have the desired effect. 37463 __________________________________________________________ 37464 37465 20.5. Run Levels 37466 37467 The following run levels are specified for use by the 37468 Default-Start and Default-Stop actions defined in Comment 37469 Conventions for Init Scripts as hints to the install_initd 37470 command. Conforming implementations are not required to provide 37471 these exact run levels or give them the meanings described 37472 here, and may map any level described here to a different level 37473 which provides the equivalent functionality. Applications may 37474 not depend on specific run-level numbers. 37475 37476 0 halt 37477 1 single user mode 37478 2 multiuser with no network services exported 37479 3 normal/full multiuser 37480 4 reserved for local use, default is normal/full multiuser 37481 5 multiuser with a display manager or equivalent 37482 6 reboot 37483 37484 Note: These run levels were chosen as reflecting the most 37485 frequent existing practice, and in the absence of other 37486 considerations, implementors are strongly encouraged to 37487 follow this convention to provide consistency for system 37488 administrators who need to work with multiple distributions. 37489 __________________________________________________________ 37490 37491 20.6. Facility Names 37492 37493 Boot facilities are used to indicate dependencies in 37494 initialization scripts, as defined in Comment Conventions for 37495 Init Scripts. Facility names are assigned to scripts by the 37496 Provides: keyword. Facility names that begin with a dollar sign 37497 ('$') are reserved system facility names. 37498 37499 Note: Facility names are only recognized in the context of 37500 the init script comment block and are not available in the 37501 body of the init script. In particular, the use of the 37502 leading '$' character does not imply system facility names 37503 are subject to shell variable expansion, since they appear 37504 inside comments. 37505 37506 Conforming applications shall not provide facilities that begin 37507 with a dollar sign. Implementations shall provide the following 37508 facility names: 37509 37510 $local_fs 37511 37512 all local file systems are mounted 37513 $network 37514 37515 basic networking support is available. Example: a server 37516 program could listen on a socket. 37517 $named 37518 37519 IP name-to-address translation, using the interfaces described 37520 in this specification, are available to the level the system 37521 normally provides them. Example: if a DNS query daemon normally 37522 provides this facility, then that daemon has been started. 37523 $portmap 37524 37525 daemons providing SunRPC/ONCRPC portmapping service as defined 37526 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 37527 present) are running. 37528 $remote_fs 37529 37530 all remote file systems are available. In some configurations, 37531 file systems such as /usr may be remote. Many applications that 37532 require $local_fs will probably also require $remote_fs. 37533 $syslog 37534 37535 system logger is operational. 37536 $time 37537 37538 the system time has been set, for example by using a 37539 network-based time program such as ntp or rdate, or via the 37540 hardware Real Time Clock. 37541 37542 Other (non-system) facilities may be defined by other 37543 conforming applications. These facilities shall be named using 37544 the same conventions defined for naming init scripts (see 37545 Script Names). Commonly, the facility provided by a conforming 37546 init script will have the same name as the name assigned to the 37547 init script. 37548 __________________________________________________________ 37549 37550 20.7. Script Names 37551 37552 Since init scripts live in a single directory, they must share 37553 a single namespace. To avoid conflicts, applications installing 37554 files in this directories shall use the LSB naming conventions 37555 (see File Naming Conventions). 37556 __________________________________________________________ 37557 37558 20.8. Init Script Functions 37559 37560 Each conforming init script shall execute the commands in the 37561 file /lib/lsb/init-functions in the current environment (see 37562 shell special built-in command dot). This file shall cause the 37563 following shell script commands to be defined in an unspecified 37564 manner. 37565 37566 Note: This can be done either by adding a directory to the 37567 PATH variable which defines these commands, or by defining 37568 shell aliases or functions. 37569 37570 Although the commands made available via this mechanism need 37571 not be conforming applications in their own right, 37572 applications that use them should only depend on features 37573 described in this specification. 37574 37575 Conforming scripts shall not specify the "exit on error" option 37576 (i.e. set -e) when sourcing this file, or calling any of the 37577 commands thus made available. 37578 37579 The start_daemon, killproc and pidofproc functions shall use 37580 the following algorithm for determining the status and the 37581 process identifiers of the specified program. 37582 37583 1. If the -p pidfile option is specified, and the named 37584 pidfile exists, a single line at the start of the pidfile 37585 shall be read. If this line contains one or more numeric 37586 values, separated by spaces, these values shall be used. If 37587 the -p pidfile option is specified and the named pidfile 37588 does not exist, the functions shall assume that the daemon 37589 is not running. 37590 2. Otherwise, /var/run/basename.pid shall be read in a similar 37591 fashion. If this contains one or more numeric values on the 37592 first line, these values shall be used. Optionally, 37593 implementations may use unspecified additional methods to 37594 locate the process identifiers required. 37595 37596 The method used to determine the status is implementation 37597 defined, but should allow for non-binary programs. 37598 37599 Note: Commonly used methods check either for the existence 37600 of the /proc/pid directory or use /proc/pid/exe and 37601 /proc/pid/cmdline. Relying only on /proc/pid/exe is 37602 discouraged since this specification does not specify the 37603 existence of, or semantics for, /proc. Additionally, using 37604 /proc/pid/exe may result in a not-running status for daemons 37605 that are written in a script language. 37606 37607 Conforming implementations may use other mechanisms besides 37608 those based on pidfiles, unless the -p pidfile option has been 37609 used. Conforming applications should not rely on such 37610 mechanisms and should always use a pidfile. When a program is 37611 stopped, it should delete its pidfile. Multiple process 37612 identifiers shall be separated by a single space in the pidfile 37613 and in the output of pidofproc. 37614 37615 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 37616 [args...] 37617 runs the specified program as a daemon. The start_daemon 37618 function shall check if the program is already running 37619 using the algorithm given above. If so, it shall not 37620 start another copy of the daemon unless the -f option is 37621 given. The -n option specifies a nice level. See nice. 37622 start_daemon shall return the LSB defined exit status 37623 codes. It shall return 0 if the program has been 37624 successfully started or is running and not 0 otherwise. 37625 37626 killproc [-p pidfile] pathname [signal] 37627 The killproc function shall stop the specified program. 37628 The program is found using the algorithm given above. If 37629 a signal is specified, using the -signal_name or 37630 -signal_number syntaxes as specified by the kill 37631 command, the program is sent that signal. Otherwise, a 37632 SIGTERM followed by a SIGKILL after an unspecified 37633 number of seconds shall be sent. If a program has been 37634 terminated, the pidfile should be removed if the 37635 terminated process has not already done so. The killproc 37636 function shall return the LSB defined exit status codes. 37637 If called without a signal, it shall return 0 if the 37638 program has been stopped or is not running and not 0 37639 otherwise. If a signal is given, it shall return 0 only 37640 if the program is running. 37641 37642 pidofproc [-p pidfile] pathname 37643 The pidofproc function shall return one or more process 37644 identifiers for a particular daemon using the algorithm 37645 given above. Only process identifiers of running 37646 processes should be returned. Multiple process 37647 identifiers shall be separated by a single space. 37648 37649 Note: A process may exit between pidofproc discovering its 37650 identity and the caller of pidofproc being able to act on 37651 that identity. As a result, no test assertion can be made 37652 that the process identifiers returned by pidofproc shall be 37653 running processes. 37654 37655 The pidofproc function shall return the LSB defined exit 37656 status codes for "status". It shall return 0 if the 37657 program is running and not 0 otherwise. 37658 37659 log_success_msg message 37660 The log_success_msg function shall cause the system to 37661 write a success message to an unspecified log file. The 37662 format of the message is unspecified. The 37663 log_success_msg function may also write a message to the 37664 standard output. 37665 37666 Note: The message should be relatively short; no more than 37667 60 characters is highly desirable. 37668 37669 log_failure_msg message 37670 The log_failure_msg function shall cause the system to 37671 write a failure message to an unspecified log file. The 37672 format of the message is unspecified. The 37673 log_failure_msg function may also write a message to the 37674 standard output. 37675 37676 Note: The message should be relatively short; no more than 37677 60 characters is highly desirable. 37678 37679 log_warning_msg message 37680 The log_warning_msg function shall cause the system to 37681 write a warning message to an unspecified log file. The 37682 format of the message is unspecified. The 37683 log_warning_msg function may also write a message to the 37684 standard output. 37685 37686 Note: The message should be relatively short; no more than 37687 60 characters is highly desirable. 37688 37689 IX. Users & Groups 37690 37691 Table of Contents 37692 21. Users & Groups 37693 37694 21.1. User and Group Database 37695 21.2. User & Group Names 37696 21.3. User ID Ranges 37697 21.4. Rationale 37698 __________________________________________________________ 37699 37700 Chapter 21. Users & Groups 37701 37702 21.1. User and Group Database 37703 37704 The format of the User and Group databases is not specified. 37705 Programs may only read these databases using the provided API. 37706 Changes to these databases should be made using the provided 37707 commands. 37708 __________________________________________________________ 37709 37710 21.2. User & Group Names 37711 37712 Table 21-1 describes required mnemonic user and group names. 37713 This specification makes no attempt to numerically assign user 37714 or group identity numbers, with the exception that both the 37715 User ID and Group ID for the user root shall be equal to 0. 37716 37717 Table 21-1. Required User & Group Names 37718 User Group Comments 37719 root root Administrative user with all appropriate privileges 37720 bin bin Legacy User ID/Group ID[a] 37721 daemon daemon Legacy User ID/Group ID[b] 37722 Notes: 37723 a. The bin User ID/Group ID is included for compatibility with 37724 legacy applications. New applications should no longer use the 37725 bin User ID/Group ID. 37726 b. The daemon User ID/Group ID was used as an unprivileged User 37727 ID/Group ID for daemons to execute under in order to limit 37728 their access to the system. Generally daemons should now run 37729 under individual User ID/Group IDs in order to further 37730 partition daemons from one another. 37731 37732 Table 21-2 is a table of optional mnemonic user and group 37733 names. This specification makes no attempt to numerically 37734 assign uid or gid numbers. If the username exists on a system, 37735 then they should be in the suggested corresponding group. These 37736 user and group names are for use by distributions, not by 37737 applications. 37738 37739 Table 21-2. Optional User & Group Names 37740 User Group Comments 37741 adm adm Administrative special privileges 37742 lp lp Printer special privileges 37743 sync sync Login to sync the system 37744 shutdown shutdown Login to shutdown the system 37745 halt halt Login to halt the system 37746 mail mail Mail special privileges 37747 news news News special privileges 37748 uucp uucp UUCP special privileges 37749 operator root Operator special privileges 37750 man man Man special privileges 37751 nobody nobody Used by NFS 37752 37753 Only a minimum working set of "user names" and their 37754 corresponding "user groups" are required. Applications cannot 37755 assume non system user or group names will be defined. 37756 37757 Applications cannot assume any policy for the default file 37758 creation mask (umask) or the default directory permissions a 37759 user may have. Applications should enforce user only file 37760 permissions on private files such as mailboxes. The location of 37761 the users home directory is also not defined by policy other 37762 than the recommendations of the Filesystem Hierarchy Standard 37763 and should be obtained by the getpwnam(), getpwnam_r(), 37764 getpwent(), getpwuid(), and getpwuid_r() functions. 37765 __________________________________________________________ 37766 37767 21.3. User ID Ranges 37768 37769 The system User IDs from 0 to 99 should be statically allocated 37770 by the system, and shall not be created by applications. 37771 37772 The system User IDs from 100 to 499 should be reserved for 37773 dynamic allocation by system administrators and post install 37774 scripts using useradd. 37775 __________________________________________________________ 37776 37777 21.4. Rationale 37778 37779 The purpose of specifying optional users and groups is to 37780 reduce the potential for name conflicts between applications 37781 and distributions. 37782 37783 X. Package Format and Installation 37784 37785 Table of Contents 37786 22. Software Installation 37787 37788 22.1. Introduction 37789 22.2. Package File Format 37790 37791 22.2.1. Lead Section 37792 22.2.2. Header Structure 37793 22.2.3. Signature Section 37794 22.2.4. Header Section 37795 22.2.5. Payload Section 37796 37797 22.3. Package Script Restrictions 37798 22.4. Package Tools 37799 22.5. Package Naming 37800 22.6. Package Dependencies 37801 22.7. Package Architecture Considerations 37802 __________________________________________________________ 37803 37804 Chapter 22. Software Installation 37805 37806 22.1. Introduction 37807 37808 Applications shall either be packaged in the RPM packaging 37809 format as defined in this specification, or supply an installer 37810 which is LSB conforming (for example, calls LSB commands and 37811 utilities). 37812 37813 Note: Supplying an RPM format package is encouraged because 37814 it makes systems easier to manage. This specification does 37815 not require the implementation to use RPM as the package 37816 manager; it only specifies the format of the package file. 37817 37818 Applications are also encouraged to uninstall cleanly. 37819 37820 A package in RPM format may include a dependency on the LSB 37821 Core and other LSB specifications, as described in Section 37822 22.6. Packages that are not in RPM format may test for the 37823 presence of a conforming implementation by means of the 37824 lsb_release utility. 37825 37826 Implementations shall provide a mechanism for installing 37827 applications in this packaging format with some restrictions 37828 listed below. 37829 37830 Note: The implementation itself may use a different 37831 packaging format for its own packages, and of course it may 37832 use any available mechanism for installing the 37833 LSB-conformant packages. 37834 __________________________________________________________ 37835 37836 22.2. Package File Format 37837 37838 An RPM format file consists of 4 sections, the Lead, Signature, 37839 Header, and the Payload. All values are stored in network byte 37840 order. 37841 37842 Table 22-1. RPM File Format 37843 Lead 37844 Signature 37845 Header 37846 Payload 37847 37848 These 4 sections shall exist in the order specified. 37849 37850 The lead section is used to identify the package file. 37851 37852 The signature section is used to verify the integrity, and 37853 optionally, the authenticity of the majority of the package 37854 file. 37855 37856 The header section contains all available information about the 37857 package. Entries such as the package's name, version, and file 37858 list, are contained in the header. 37859 37860 The payload section holds the files to be installed. 37861 __________________________________________________________ 37862 37863 22.2.1. Lead Section 37864 37865 struct rpmlead { 37866 unsigned char magic[4]; 37867 unsigned char major, minor; 37868 short type; 37869 short archnum; 37870 char name[66]; 37871 short osnum; 37872 short signature_type; 37873 char reserved[16]; 37874 } ; 37875 37876 magic 37877 37878 Value identifying this file as an RPM format file. This value 37879 shall be "\355\253\356\333". 37880 major 37881 37882 Value indicating the major version number of the file format 37883 version. This value shall be 3. 37884 minor 37885 37886 Value indicating the minor revision number of file format 37887 version. This value shall be 0. 37888 type 37889 37890 Value indicating whether this is a source or binary package. 37891 This value shall be 0 to indicate a binary package. 37892 archnum 37893 37894 Value indicating the architecture for which this package is 37895 valid. This value is specified in the relevant architecture 37896 specific part of ISO/IEC 23360. 37897 name 37898 37899 A NUL terminated string that provides the package name. This 37900 name shall conform with the Package Naming section of this 37901 specification. 37902 osnum 37903 37904 Value indicating the Operating System for which this package is 37905 valid. This value shall be 1. 37906 signature_type 37907 37908 Value indicating the type of the signature used in the 37909 Signature part of the file. This value shall be 5. 37910 reserved 37911 37912 Reserved space. The value is undefined. 37913 __________________________________________________________ 37914 37915 22.2.2. Header Structure 37916 37917 The Header structure is used for both the Signature and Header 37918 Sections. A Header Structure consists of 3 parts, a Header 37919 record, followed by 1 or more Index records, followed by 0 or 37920 more bytes of data associated with the Index records. A Header 37921 structure shall be aligned to an 8 byte boundary. 37922 37923 Table 22-2. Signature Format 37924 Header Record 37925 Array of Index Records 37926 Store of Index Values 37927 __________________________________________________________ 37928 37929 22.2.2.1. Header Record 37930 37931 struct rpmheader { 37932 unsigned char magic[4]; 37933 unsigned char reserved[4]; 37934 int nindex; 37935 int hsize; 37936 } ; 37937 37938 magic 37939 37940 Value identifying this record as an RPM header record. This 37941 value shall be "\216\255\350\001". 37942 reserved 37943 37944 Reserved space. This value shall be "\000\000\000\000". 37945 nindex 37946 37947 The number of Index Records that follow this Header Record. 37948 There should be at least 1 Index Record. 37949 hsize 37950 37951 The size in bytes of the storage area for the data pointed to 37952 by the Index Records. 37953 __________________________________________________________ 37954 37955 22.2.2.2. Index Record 37956 37957 struct rpmhdrindex { 37958 int tag; 37959 int type; 37960 int offset; 37961 int count; 37962 } ; 37963 37964 tag 37965 37966 Value identifying the purpose of the data associated with this 37967 Index Record. The value of this field is dependent on the 37968 context in which the Index Record is used, and is defined below 37969 and in later sections. 37970 type 37971 37972 Value identifying the type of the data associated with this 37973 Index Record. The possible type values are defined below. 37974 offset 37975 37976 Location in the Store of the data associated with this Index 37977 Record. This value should between 0 and the value contained in 37978 the hsize of the Header Structure. 37979 count 37980 37981 Size of the data associated with this Index Record. The count 37982 is the number of elements whose size is defined by the type of 37983 this Record. 37984 __________________________________________________________ 37985 37986 22.2.2.2.1. Index Type Values 37987 37988 The possible values for the type field are defined in this 37989 table. 37990 37991 Table 22-3. Index Type values 37992 Type Value Size (in bytes) Alignment 37993 RPM_NULL_TYPE 0 Not Implemented. 37994 RPM_CHAR_TYPE 1 1 1 37995 RPM_INT8_TYPE 2 1 1 37996 RPM_INT16_TYPE 3 2 2 37997 RPM_INT32_TYPE 4 4 4 37998 RPM_INT64_TYPE 5 Reserved. 37999 RPM_STRING_TYPE 6 variable, NUL terminated 1 38000 RPM_BIN_TYPE 7 1 1 38001 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 38002 strings 1 38003 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 38004 strings 1 38005 38006 The string arrays specified for entries of type 38007 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 38008 strings in a contiguous block of memory, each element separated 38009 from its neighbors by a NUL character. 38010 38011 Index records with type RPM_I18NSTRING_TYPE shall always have a 38012 count of 1. The array entries in an index of type 38013 RPM_I18NSTRING_TYPE correspond to the locale names contained in 38014 the RPMTAG_HDRI18NTABLE index. 38015 __________________________________________________________ 38016 38017 22.2.2.2.2. Index Tag Values 38018 38019 Some values are designated as header private, and may appear in 38020 any header structure. These are defined here. Additional values 38021 are defined in later sections. 38022 38023 Table 22-4. Header Private Tag Values 38024 Name Tag Value Type Count Status 38025 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 38026 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 38027 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Optional 38028 38029 RPMTAG_HEADERSIGNATURES 38030 The signature tag differentiates a signature header from 38031 a metadata header, and identifies the original contents 38032 of the signature header. 38033 38034 RPMTAG_HEADERIMMUTABLE 38035 This tag contains an index record which specifies the 38036 portion of the Header Record which was used for the 38037 calculation of a signature. This data shall be preserved 38038 or any header-only signature will be invalidated. 38039 38040 RPMTAG_HEADERI18NTABLE 38041 Contains a list of locales for which strings are 38042 provided in other parts of the package. 38043 38044 Not all Index records defined here will be present in all 38045 packages. Each tag value has a status which is defined here. 38046 38047 Required 38048 38049 This Index Record shall be present. 38050 Optional 38051 38052 This Index Record may be present. 38053 Informational 38054 38055 This Index Record may be present, but does not contribute to 38056 the processing of the package. 38057 Deprecated 38058 38059 This Index Record should not be present. 38060 Obsolete 38061 38062 This Index Record shall not be present. 38063 Reserved 38064 38065 This Index Record shall not be present. 38066 __________________________________________________________ 38067 38068 22.2.2.3. Header Store 38069 38070 The header store contains the values specified by the Index 38071 structures. These values are aligned according to their type 38072 and padding is used if needed. The store is located immediately 38073 following the Index structures. 38074 __________________________________________________________ 38075 38076 22.2.3. Signature Section 38077 38078 The Signature section is implemented using the Header 38079 structure. The signature section defines the following 38080 additional tag values which may be used in the Index 38081 structures. 38082 38083 These values exist to provide additional information about the 38084 rest of the package. 38085 38086 Table 22-5. Signature Tag Values 38087 Name Tag Value Type Count Status 38088 RPMSIGTAG_SIZE 1000 INT32 1 Required 38089 RPMSIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 38090 38091 RPMSIGTAG_SIZE 38092 This tag specifies the combined size of the Header and 38093 Payload sections. 38094 38095 RPMSIGTAG_PAYLOADSIZE 38096 This tag specifies the uncompressed size of the Payload 38097 archive, including the cpio headers. 38098 38099 These values exist to ensure the integrity of the rest of the 38100 package. 38101 38102 Table 22-6. Signature Digest Tag Values 38103 Name Tag Value Type Count Status 38104 RPMSIGTAG_SHA1 269 STRING 1 Optional 38105 RPMSIGTAG_MD5 1004 BIN 16 Required 38106 38107 RPMSIGTAG_SHA1 38108 38109 This index contains the SHA1 checksum of the entire Header 38110 Section, including the Header Record, Index Records and Header 38111 store. 38112 RPMSIGTAG_MD5 38113 38114 This tag specifies the 128-bit MD5 checksum of the combined 38115 Header and Archive sections. 38116 38117 These values exist to provide authentication of the package. 38118 38119 Table 22-7. Signature Signing Tag Values 38120 Name Tag Value Type Count Status 38121 RPMSIGTAG_DSA 267 BIN 65 Optional 38122 RPMSIGTAG_RSA 268 BIN 1 Optional 38123 RPMSIGTAG_PGP 1002 BIN 1 Optional 38124 RPMSIGTAG_GPG 1005 BIN 65 Optional 38125 38126 RPMSIGTAG_DSA 38127 38128 The tag contains the DSA signature of the Header section. The 38129 data is formatted as a Version 3 Signature Packet as specified 38130 in RFC 2440: OpenPGP Message Format. If this tag is present, 38131 then the SIGTAG_GPG tag shall also be present. 38132 RPMSIGTAG_RSA 38133 38134 The tag contains the RSA signature of the Header section.The 38135 data is formatted as a Version 3 Signature Packet as specified 38136 in RFC 2440: OpenPGP Message Format. If this tag is present, 38137 then the SIGTAG_PGP shall also be present. 38138 RPMSIGTAG_PGP 38139 38140 This tag specifies the RSA signature of the combined Header and 38141 Payload sections. The data is formatted as a Version 3 38142 Signature Packet as specified in RFC 2440: OpenPGP Message 38143 Format. 38144 RPMSIGTAG_GPG 38145 38146 The tag contains the DSA signature of the combined Header and 38147 Payload sections. The data is formatted as a Version 3 38148 Signature Packet as specified in RFC 2440: OpenPGP Message 38149 Format. 38150 __________________________________________________________ 38151 38152 22.2.4. Header Section 38153 38154 The Header section is implemented using the Header structure. 38155 The Header section defines the following additional tag values 38156 which may be used in the Index structures. 38157 __________________________________________________________ 38158 38159 22.2.4.1. Package Information 38160 38161 The following tag values are used to indicate information that 38162 describes the package as a whole. 38163 38164 Table 22-8. Package Info Tag Values 38165 Name Tag Value Type Count Status 38166 RPMTAG_NAME 1000 STRING 1 Required 38167 RPMTAG_VERSION 1001 STRING 1 Required 38168 RPMTAG_RELEASE 1002 STRING 1 Required 38169 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 38170 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 38171 RPMTAG_SIZE 1009 INT32 1 Required 38172 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 38173 RPMTAG_VENDOR 1011 STRING 1 Informational 38174 RPMTAG_LICENSE 1014 STRING 1 Required 38175 RPMTAG_PACKAGER 1015 STRING 1 Informational 38176 RPMTAG_GROUP 1016 I18NSTRING 1 Required 38177 RPMTAG_URL 1020 STRING 1 Informational 38178 RPMTAG_OS 1021 STRING 1 Required 38179 RPMTAG_ARCH 1022 STRING 1 Required 38180 RPMTAG_SOURCERPM 1044 STRING 1 Informational 38181 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 38182 RPMTAG_RPMVERSION 1064 STRING 1 Informational 38183 RPMTAG_COOKIE 1094 STRING 1 Optional 38184 RPMTAG_DISTURL 1123 STRING 1 Informational 38185 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 38186 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 38187 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 38188 38189 RPMTAG_NAME 38190 This tag specifies the name of the package. 38191 38192 RPMTAG_VERSION 38193 This tag specifies the version of the package. 38194 38195 RPMTAG_RELEASE 38196 This tag specifies the release of the package. 38197 38198 RPMTAG_SUMMARY 38199 This tag specifies the summary description of the 38200 package. The summary value pointed to by this index 38201 record contains a one line description of the package. 38202 38203 RPMTAG_DESCRIPTION 38204 This tag specifies the description of the package. The 38205 description value pointed to by this index record 38206 contains a full desription of the package. 38207 38208 RPMTAG_SIZE 38209 This tag specifies the sum of the sizes of the regular 38210 files in the archive. 38211 38212 RPMTAG_DISTRIBUTION 38213 A string containing the name of the distribution on 38214 which the package was built. 38215 38216 RPMTAG_VENDOR 38217 A string containing the name of the organization that 38218 produced the package. 38219 38220 RPMTAG_LICENSE 38221 This tag specifies the license which applies to this 38222 package. 38223 38224 RPMTAG_PACKAGER 38225 A string identifying the tool used to build the package. 38226 38227 RPMTAG_GROUP 38228 This tag specifies the administrative group to which 38229 this package belongs. 38230 38231 RPMTAG_URL 38232 Generic package information URL. 38233 38234 RPMTAG_OS 38235 This tag specifies the OS of the package. The OS value 38236 pointed to by this index record shall be "linux". 38237 38238 RPMTAG_ARCH 38239 This tag specifies the architecture of the package. The 38240 architecture value pointed to by this index record is 38241 defined in architecture specific LSB specification. 38242 38243 RPMTAG_SOURCERPM 38244 This tag specifies the name of the source RPM. 38245 38246 RPMTAG_ARCHIVESIZE 38247 This tag specifies the uncompressed size of the Payload 38248 archive, including the cpio headers. 38249 38250 RPMTAG_RPMVERSION 38251 This tag indicates the version of RPM tool used to build 38252 this package. The value is unused. 38253 38254 RPMTAG_COOKIE 38255 This tag contains an opaque string whose contents are 38256 undefined. 38257 38258 RPMTAG_DISTURL 38259 URL for package. 38260 38261 RPMTAG_PAYLOADFORMAT 38262 This tag specifies the format of the Archive section. 38263 The format value pointed to by this index record shall 38264 be 'cpio'. 38265 38266 RPMTAG_PAYLOADCOMPRESSOR 38267 This tag specifies the compression used on the Archive 38268 section. The compression value pointed to by this index 38269 record shall be 'gzip'. 38270 38271 RPMTAG_PAYLOADFLAGS 38272 This tag indicates the compression level used for the 38273 Payload. This value shall always be '9'. 38274 __________________________________________________________ 38275 38276 22.2.4.2. Installation Information 38277 38278 The following tag values are used to provide information needed 38279 during the installation of the package. 38280 38281 Table 22-9. Installation Tag Values 38282 Name Tag Value Type Count Status 38283 RPMTAG_PREIN 1023 STRING 1 Optional 38284 RPMTAG_POSTIN 1024 STRING 1 Optional 38285 RPMTAG_PREUN 1025 STRING 1 Optional 38286 RPMTAG_POSTUN 1026 STRING 1 Optional 38287 RPMTAG_PREINPROG 1085 STRING 1 Optional 38288 RPMTAG_POSTINPROG 1086 STRING 1 Optional 38289 RPMTAG_PREUNPROG 1087 STRING 1 Optional 38290 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 38291 38292 RPMTAG_PREIN 38293 38294 This tag specifies the preinstall scriptlet. If present, then 38295 RPMTAG_PREINPROG shall also be present. 38296 RPMTAG_POSTIN 38297 38298 This tag specifies the postinstall scriptlet. If present, then 38299 RPMTAG_POSTINPROG shall also be present. 38300 RPMTAG_PREUN 38301 38302 his tag specifies the preuninstall scriptlet. If present, then 38303 RPMTAG_PREUNPROG shall also be present. 38304 RPMTAG_POSTUN 38305 38306 This tag specified the postuninstall scriptlet. If present, 38307 then RPMTAG_POSTUNPROG shall also be present. 38308 RPMTAG_PREINPROG 38309 38310 This tag specifies the name of the intepreter to which the 38311 preinstall scriptlet will be passed. The intepreter pointed to 38312 by this index record shall be /bin/sh. 38313 RPMTAG_POSTINPROG 38314 38315 This tag specifies the name of the intepreter to which the 38316 postinstall scriptlet will be passed. The intepreter pointed to 38317 by this index record shall be /bin/sh. 38318 RPMTAG_PREUNPROG 38319 38320 This tag specifies the name of the intepreter to which the 38321 preuninstall scriptlet will be passed. The intepreter pointed 38322 to by this index record shall be /bin/sh. 38323 RPMTAG_POSTUNPROG 38324 38325 This program specifies the name of the intepreter to which the 38326 postuninstall scriptlet will be passed. The intepreter pointed 38327 to by this index record shall be /bin/sh. 38328 __________________________________________________________ 38329 38330 22.2.4.3. File Information 38331 38332 The following tag values are used to provide information about 38333 the files in the payload. This information is provided in the 38334 header to allow more efficient access of the information. 38335 38336 Table 22-10. File Info Tag Values 38337 Name Tag Value Type Count Status 38338 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 38339 RPMTAG_FILESIZES 1028 INT32 Required 38340 RPMTAG_FILEMODES 1030 INT16 Required 38341 RPMTAG_FILERDEVS 1033 INT16 Required 38342 RPMTAG_FILEMTIMES 1034 INT32 Required 38343 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 38344 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 38345 RPMTAG_FILEFLAGS 1037 INT32 Required 38346 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 38347 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 38348 RPMTAG_FILEDEVICES 1095 INT32 Required 38349 RPMTAG_FILEINODES 1096 INT32 Required 38350 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 38351 RPMTAG_DIRINDEXES 1116 INT32 Optional 38352 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 38353 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 38354 38355 RPMTAG_OLDFILENAMES 38356 38357 This tag specifies the filenames when not in a compressed 38358 format as determined by the absence of 38359 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME index. 38360 RPMTAG_FILESIZES 38361 38362 This tag specifies the size of each file in the archive. 38363 RPMTAG_FILEMODES 38364 38365 This tag specifies the mode of each file in the archive. 38366 RPMTAG_FILERDEVS 38367 38368 This tag specifies the device number from which the file was 38369 copied. 38370 RPMTAG_FILEMTIMES 38371 38372 This tag specifies the modification time in seconds since the 38373 epoch of each file in the archive. 38374 RPMTAG_FILEMD5S 38375 38376 This tag specifies the ASCII representation of the MD5 sum of 38377 the corresponding file contents. This value is empty if the 38378 corresponding archive entry is not a regular file. 38379 RPMTAG_FILELINKTOS 38380 38381 The target for a symlink, otherwise NULL. 38382 RPMTAG_FILEFLAGS 38383 38384 This tag specifies the bit(s) to classify and control how files 38385 are to be installed. See below. 38386 RPMTAG_FILEUSERNAME 38387 38388 This tag specifies the owner of the corresponding file. 38389 RPMTAG_FILEGROUPNAME 38390 38391 This tag specifies the group of the corresponding file. 38392 RPMTAG_FILEDEVICES 38393 38394 This tag specifies the 16 bit device number from which the file 38395 was copied. 38396 RPMTAG_FILEINODES 38397 38398 This tag specifies the inode value from the original file 38399 system on the the system on which it was built. 38400 RPMTAG_FILELANGS 38401 38402 This tag specifies a per-file locale marker used to install 38403 only locale specific subsets of files when the package is 38404 installed. 38405 RPMTAG_DIRINDEXES 38406 38407 This tag specifies the index into the array provided by the 38408 RPMTAG_DIRNAMES Index which contains the directory name for the 38409 corresponding filename. 38410 RPMTAG_BASENAMES 38411 38412 This tag specifies the base portion of the corresponding 38413 filename. 38414 RPMTAG_DIRNAMES 38415 38416 One of RPMTAG_OLDFILENAMES or the tuple 38417 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 38418 present, but not both. 38419 __________________________________________________________ 38420 38421 22.2.4.3.1. File Flags 38422 38423 The RPMTAG_FILEFLAGS tag value shall identify various 38424 characteristics of the file in the payload that it describes. 38425 It shall be an INT32 value consisting of either the value 38426 RPMFILE_NONE (0) or the bitwise inclusive or of one or more of 38427 the following values: 38428 38429 Table 22-11. File Flags 38430 Name Value 38431 RPMFILE_CONFIG (1 << 0) 38432 RPMFILE_DOC (1 << 1) 38433 RPMFILE_DONOTUSE (1 << 2) 38434 RPMFILE_MISSINGOK (1 << 3) 38435 RPMFILE_NOREPLACE (1 << 4) 38436 RPMFILE_SPECFILE (1 << 5) 38437 RPMFILE_GHOST (1 << 6) 38438 RPMFILE_LICENSE (1 << 7) 38439 RPMFILE_README (1 << 8) 38440 RPMFILE_EXCLUDE (1 << 9) 38441 38442 These bits have the following meaning: 38443 38444 RPMFILE_CONFIG 38445 38446 The file is a configuration file, and an existing file should 38447 be saved during a package upgrade operation and not removed 38448 during a pakage removal operation. 38449 RPMFILE_DOC 38450 38451 The file contains documentation. 38452 RPMFILE_DONOTUSE 38453 38454 This value is reserved for future use; conforming packages may 38455 not use this flag. 38456 RPMFILE_MISSINGOK 38457 38458 The file need not exist on the installed system. 38459 RPMFILE_NOREPLACE 38460 38461 Similar to the RPMFILE_CONFIG, this flag indicates that during 38462 an upgrade operation the original file on the system should not 38463 be altered. 38464 RPMFILE_SPECFILE 38465 38466 The file is a package specification. 38467 RPMFILE_GHOST 38468 38469 The file is not actually included in the payload, but should 38470 still be considered as a part of the package. For example, a 38471 log file generated by the application at run time. 38472 RPMFILE_LICENSE 38473 38474 The file contains the license conditions. 38475 RPMFILE_README 38476 38477 The file contains high level notes about the package. 38478 RPMFILE_EXCLUDE 38479 38480 The corresponding file is not a part of the package, and should 38481 not be installed. 38482 __________________________________________________________ 38483 38484 22.2.4.4. Dependency Information 38485 38486 The following tag values are used to provide information about 38487 interdependencies between packages. 38488 38489 Table 22-12. Package Dependency Tag Values 38490 Name Tag Value Type Count Status 38491 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 38492 RPMTAG_REQUIREFLAGS 1048 INT32 Required 38493 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 38494 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 38495 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 38496 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 38497 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 38498 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 38499 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 38500 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 38501 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 38502 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 38503 38504 RPMTAG_PROVIDENAME 38505 This tag indicates the name of the dependency provided 38506 by this package. 38507 38508 RPMTAG_REQUIREFLAGS 38509 Bits(s) to specify the dependency range and context. 38510 38511 RPMTAG_REQUIRENAME 38512 This tag indicates the dependencies for this package. 38513 38514 RPMTAG_REQUIREVERSION 38515 This tag indicates the versions associated with the 38516 values found in the RPMTAG_REQUIRENAME Index. 38517 38518 RPMTAG_CONFLICTFLAGS 38519 Bits(s) to specify the conflict range and context. 38520 38521 RPMTAG_CONFLICTNAME 38522 This tag indicates the conflicting dependencies for this 38523 package. 38524 38525 RPMTAG_CONFLICTVERSION 38526 This tag indicates the versions associated with the 38527 values found in the RPMTAG_CONFLICTNAME Index. 38528 38529 RPMTAG_OBSOLETENAME 38530 This tag indicates the obsoleted dependencies for this 38531 package. 38532 38533 RPMTAG_PROVIDEFLAGS 38534 Bits(s) to specify the conflict range and context. 38535 38536 RPMTAG_PROVIDEVERSION 38537 This tag indicates the versions associated with the 38538 values found in the RPMTAG_PROVIDENAME Index. 38539 38540 RPMTAG_OBSOLETEFLAGS 38541 Bits(s) to specify the conflict range and context. 38542 38543 RPMTAG_OBSOLETEVERSION 38544 This tag indicates the versions associated with the 38545 values found in the RPMTAG_OBSOLETENAME Index. 38546 __________________________________________________________ 38547 38548 22.2.4.4.1. Package Dependency Values 38549 38550 The package dependencies are stored in the RPMTAG_REQUIRENAME 38551 and RPMTAG_REQUIREVERSION index records. The following values 38552 may be used. 38553 38554 Table 22-13. Index Type values 38555 Name Version Meaning Status 38556 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 38557 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 38558 RPMTAG_PREREQ records that have a version associated with them. 38559 Optional 38560 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames in 38561 the Archive have had "." prepended to them. Optional 38562 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 38563 filenames in the Payload are represented in the 38564 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES indexes. 38565 Optional 38566 /bin/sh Interpreter usually required for installation 38567 scripts. Optional 38568 38569 Additional dependencies are specified in the Package 38570 Dependencies section of this specification, and in the relevant 38571 architecture specific part of ISO/IEC 23360. 38572 __________________________________________________________ 38573 38574 22.2.4.4.2. Package Dependencies Attributes 38575 38576 The package dependency attributes are stored in the 38577 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 38578 RPMTAG_OBSOLETEFLAGS index records. The following values may be 38579 used. 38580 38581 Table 22-14. Package Dependency Attributes 38582 Name Value Meaning 38583 RPMSENSE_LESS 0x02 38584 RPMSENSE_GREATER 0x04 38585 RPMSENSE_EQUAL 0x08 38586 RPMSENSE_PREREQ 0x40 38587 RPMSENSE_INTERP 0x100 38588 RPMSENSE_SCRIPT_PRE 0x200 38589 RPMSENSE_SCRIPT_POST 0x400 38590 RPMSENSE_SCRIPT_PREUN 0x800 38591 RPMSENSE_SCRIPT_POSTUN 0x1000 38592 RPMSENSE_RPMLIB 0x1000000 38593 __________________________________________________________ 38594 38595 22.2.4.5. Other Information 38596 38597 The following tag values are also found in the Header section. 38598 38599 Table 22-15. Other Tag Values 38600 Name Tag Value Type Count Status 38601 RPMTAG_BUILDTIME 1006 INT32 1 Informational 38602 RPMTAG_BUILDHOST 1007 STRING 1 Informational 38603 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 38604 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 38605 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 38606 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 38607 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 38608 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 38609 RPMTAG_PLATFORM 1132 STRING 1 Informational 38610 38611 RPMTAG_BUILDTIME 38612 This tag specifies the time as seconds since the epoch 38613 at which the package was built. 38614 38615 RPMTAG_BUILDHOST 38616 This tag specifies the hostname of the system on which 38617 which the package was built. 38618 38619 RPMTAG_FILEVERIFYFLAGS 38620 This tag specifies the bit(s) to control how files are 38621 to be verified after install, specifying which checks 38622 should be performed. 38623 38624 RPMTAG_CHANGELOGTIME 38625 This tag specifies the Unix time in seconds since the 38626 epoch associated with each entry in the Changelog file. 38627 38628 RPMTAG_CHANGELOGNAME 38629 This tag specifies the name of who made a change to this 38630 package. 38631 38632 RPMTAG_CHANGELOGTEXT 38633 This tag specifies the changes asssociated with a 38634 changelog entry. 38635 38636 RPMTAG_OPTFLAGS 38637 This tag indicates additional flags which may have been 38638 passed to the compiler when building this package. 38639 38640 RPMTAG_RHNPLATFORM 38641 This tag contains an opaque string whose contents are 38642 undefined. 38643 38644 RPMTAG_PLATFORM 38645 This tag contains an opaque string whose contents are 38646 undefined. 38647 __________________________________________________________ 38648 38649 22.2.5. Payload Section 38650 38651 The Payload section contains a compressed cpio archive. The 38652 format of this section is defined by RFC 1952: GZIP File Format 38653 Specification. 38654 38655 When uncompressed, the cpio archive contains a sequence of 38656 records for each file. Each record contains a CPIO Header, 38657 Filename, Padding, and File Data. 38658 38659 Table 22-16. CPIO File Format 38660 CPIO Header Header structure as defined below. 38661 Filename NUL terminated ASCII string containing the name of the 38662 file. 38663 Padding 0-3 bytes as needed to align the file stream to a 4 38664 byte boundary. 38665 File data The contents of the file. 38666 Padding 0-3 bytes as needed to align the file stream to a 4 38667 byte boundary. 38668 38669 The CPIO Header uses the following header structure (sometimes 38670 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 38671 stored as ASCII representations of their hexadecimal value with 38672 leading zeros as needed to fill the field. With the exception 38673 of c_namesize and the corresponding name string, and 38674 c_checksum, all information contained in the CPIO Header is 38675 also represented in the Header Section. The values in the CPIO 38676 Header shall match the values contained in the Header Section. 38677 struct { 38678 char c_magic[6]; 38679 char c_ino[8]; 38680 char c_mode[8]; 38681 char c_uid[8]; 38682 char c_gid[8]; 38683 char c_nlink[8]; 38684 char c_mtime[8]; 38685 char c_filesize[8]; 38686 char c_devmajor[8]; 38687 char c_devminor[8]; 38688 char c_rdevmajor[8]; 38689 char c_rdevminor[8]; 38690 char c_namesize[8]; 38691 char c_checksum[8]; 38692 }; 38693 38694 c_magic 38695 38696 Value identifying this cpio format. This value shall be 38697 "070701". 38698 c_ino 38699 38700 This field contains the inode number from the filesystem from 38701 which the file was read. This field is ignored when installing 38702 a package. This field shall match the corresponding value in 38703 the RPMTAG_FILEINODES index in the Header section. 38704 c_mode 38705 38706 Permission bits of the file. This is an ascii representation of 38707 the hexadecimal number representing the bit as defined for the 38708 st_mode field of the stat structure defined for the stat 38709 function. This field shall match the corresponding value in the 38710 RPMTAG_FILEMODES index in the Header section. 38711 c_uid 38712 38713 Value identifying this owner of this file. This value matches 38714 the uid value of the corresponding user in the 38715 RPMTAG_FILEUSERNAME as found on the system where this package 38716 was built. The username specified in RPMTAG_FILEUSERNAME should 38717 take precedence when installing the package. 38718 c_gid 38719 38720 Value identifying this group of this file. This value matches 38721 the gid value of the corresponding user in the 38722 RPMTAG_FILEGROUPNAME as found on the system where this package 38723 was built. The groupname specified in RPMTAG_FILEGROUPNAME 38724 should take precedence when installing the package. 38725 c_nlink 38726 38727 Value identifying the number of links associated with this 38728 file. If the value is greater than 1, then this filename will 38729 be linked to 1 or more files in this archive that has a 38730 matching value for the c_ino, c_devmajor and c_devminor fields. 38731 c_mtime 38732 38733 Value identifying the modification time of the file when it was 38734 read. This field shall match the corresponding value in the 38735 RPMTAG_FILEMTIMES index in the Header section. 38736 c_filesize 38737 38738 Value identifying the size of the file. This field shall match 38739 the corresponding value in the RPMTAG_FILESIZES index in the 38740 Header section. 38741 c_devmajor 38742 38743 The major number of the device containing the file system from 38744 which the file was read. With the exception of processing files 38745 with c_nlink >1, this field is ignored when installing a 38746 package. This field shall match the corresponding value in the 38747 RPMTAG_FILEDEVICES index in the Header section. 38748 c_devminor 38749 38750 The minor number of the device containing the file system from 38751 which the file was read. With the exception of processing files 38752 with c_nlink >1, this field is ignored when installing a 38753 package. This field shall match the corresponding value in the 38754 RPMTAG_FILEDEVICES index in the Header section. 38755 c_rdevmajor 38756 38757 The major number of the raw device containing the file system 38758 from which the file was read. This field is ignored when 38759 installing a package. This field shall match the corresponding 38760 value in the RPMTAG_RDEVS index in the Header section. 38761 c_rdevminor 38762 38763 The minor number of the raw device containing the file system 38764 from which the file was read. This field is ignored when 38765 installing a package. This field shall match the corresponding 38766 value in the RPMTAG_RDEVS index in the Header section. 38767 c_namesize 38768 38769 Value identifying the length of the filename, which is located 38770 immediately following the CPIO Header structure. 38771 c_checksum 38772 38773 Value containing the CRC checksum of the file data. This field 38774 is not used, and shall contain the value "00000000". This field 38775 is ignored when installing a package. 38776 38777 A record with the filename "TRAILER!!!" indicates the last 38778 record in the archive. 38779 __________________________________________________________ 38780 38781 22.3. Package Script Restrictions 38782 38783 Scripts used as part of the package install and uninstall shall 38784 only use commands and interfaces that are specified by the LSB. 38785 All other commands are not guaranteed to be present, or to 38786 behave in expected ways. 38787 38788 Packages shall not use RPM triggers. 38789 38790 Packages shall not depend on the order in which scripts are 38791 executed (pre-install, pre-uninstall, etc), when doing an 38792 upgrade. 38793 __________________________________________________________ 38794 38795 22.4. Package Tools 38796 38797 The LSB does not specify the interface to the tools used to 38798 manipulate LSB-conformant packages. Each conforming 38799 implementation shall provide documentation for installing LSB 38800 packages. 38801 __________________________________________________________ 38802 38803 22.5. Package Naming 38804 38805 Packages supplied by implementations and applications shall 38806 follow the following rules for the name field within the 38807 package. These rules are not required for the filename of the 38808 package file itself. 38809 38810 Note: There are discrepancies among implementations 38811 concerning whether the name might be 38812 frobnicator-1.7-21-ppc32.rpm or 38813 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 38814 recommended practice is for the filename of the package file 38815 to match the name within the package. 38816 38817 The following rules apply to the name field alone, not 38818 including any release or version. 38819 38820 Note: If the name with the release and version is 38821 frobnicator-1.7-21, the name part is frobnicator and falls 38822 under the rules for a name with no hyphens. 38823 38824 * If the name begins with lsb- and contains no other hyphens, 38825 the name shall be assigned by the Linux Assigned Names and 38826 Numbers Authority (LANANA), which shall maintain a registry 38827 of LSB names. The name may be registered by either an 38828 implementation or an application. 38829 * If the package name begins with lsb- and contains more than 38830 one hyphen (for example lsb-distro.example.com-database or 38831 lsb-gnome-gnumeric), then the portion of the package name 38832 between first and second hyphens shall either be an LSB 38833 provider name assigned by the LANANA, or it may be one of 38834 the owners' fully-qualified domain names in lower case 38835 (e.g., debian.org, staroffice.sun.com). The LSB provider 38836 name assigned by LANANA shall only consist of the ASCII 38837 characters [a-z0-9]. The provider name or domain name may 38838 be either that of an implementation or an application. 38839 * Package names containing no hyphens are reserved for use by 38840 implementations. Applications shall not use such names. 38841 * Package names which do not start with lsb- and which 38842 contain a hyphen are open to both implementations and 38843 applications. Implementations may name packages in any part 38844 of this namespace. They are encouraged to use names from 38845 one of the other namespaces available to them, but this is 38846 not required due to the large amount of current practice to 38847 the contrary. 38848 38849 Note: Widespread existing practice includes such names as 38850 ssh-common, ssh-client, kernel-pcmcia, and the like. 38851 Possible alternative names include sshcommon, 38852 foolinux-ssh-common (where foolinux is registered to the 38853 implementation), or lsb-foolinux-ssh-common. 38854 Applications may name their packages this way, but only if 38855 the portion of the name before the first hyphen is a 38856 provider name or registered domain name as described above. 38857 38858 Note: If an application vendor has domain name such as 38859 visicalc.example.com and has registered visicalc as a 38860 provider name, they might name packages visicalc-base, 38861 visicalc.example.com-charting, and the like. 38862 Package names in this namespace are available to both the 38863 implementation and an application. Implementations and 38864 applications will need to consider this potential for 38865 conflicts when deciding to use these names rather than the 38866 alternatives (such as names starting with lsb-). 38867 __________________________________________________________ 38868 38869 22.6. Package Dependencies 38870 38871 Packages shall have a dependency that indicates which LSB 38872 modules are required. LSB module descriptions are dash 38873 seperated tuples containing the name 'lsb', the module name, 38874 and the architecture name. The following dependencies may be 38875 used. 38876 38877 lsb-core-arch 38878 38879 This dependency is used to indicate that the application is 38880 dependent on features contained in the LSB-Core specification. 38881 lsb-core-noarch 38882 38883 This dependency is used to indicate that the application is 38884 dependent on features contained in the LSB-Core specification 38885 and that the package does not contain any architecture specific 38886 files. 38887 38888 These dependencies shall have a version of 3.0. 38889 38890 Packages shall not depend on other system-provided 38891 dependencies. They shall not depend on non-system-provided 38892 dependencies unless the package provider also makes available 38893 the LSB conforming packages needed to satisfy such 38894 dependencies. 38895 38896 Other modules in the LSB may supplement this list. The 38897 architecture specific dependencies are described in the 38898 relevant architecture specific LSB. 38899 __________________________________________________________ 38900 38901 22.7. Package Architecture Considerations 38902 38903 Packages which do not contain any architecture specific files 38904 should specify an architecture of noarch. An LSB runtime 38905 environment shall accept values noarch, or the value specified 38906 in the relevant architecture specific part of ISO/IEC 23360. 38907 38908 Additional specifications or restrictions may be found in the 38909 architecture specific LSB specification. 38910 __________________________________________________________ 38911 38912 Appendix A. Alphabetical Listing of Interfaces 38913 __________________________________________________________ 38914 38915 A.1. libc 38916 38917 The behavior of the interfaces in this library is specified by 38918 the following Standards. 38919 38920 Large File Support [LFS] 38921 This Specification [LSB] 38922 RFC 1831/1832 RPC & XDR [RPC & XDR] 38923 SUSv2 [SUSv2] 38924 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 38925 POSIX 1003.1-2008 (ISO/IEC 9945-2009) [SUSv4] 38926 SVID Issue 4 [SVID.4] 38927 38928 Table A-1. libc Function Interfaces 38929 _Exit[SUSv3] getdate[SUSv3] sched_getaffinity(GLIBC_2.3.4)[LSB] 38930 _IO_feof[LSB] getdelim[SUSv4] sched_getparam[SUSv3] 38931 _IO_getc[LSB] getdomainname[LSB] sched_getscheduler[SUSv3] 38932 _IO_putc[LSB] getdtablesize[LSB] sched_rr_get_interval[SUSv3] 38933 _IO_puts[LSB] getegid[SUSv3] 38934 sched_setaffinity(GLIBC_2.3.4)[LSB] 38935 __assert_fail[LSB] getenv[SUSv3] sched_setparam[SUSv3] 38936 __chk_fail(GLIBC_2.3.4)[LSB] geteuid[SUSv3] 38937 sched_setscheduler[LSB] 38938 __confstr_chk(GLIBC_2.4)[LSB] getgid[SUSv3] sched_yield[SUSv3] 38939 __ctype_b_loc(GLIBC_2.3)[LSB] getgrent[SUSv3] seed48[SUSv3] 38940 __ctype_get_mb_cur_max[LSB] getgrent_r[LSB] seed48_r[LSB] 38941 __ctype_tolower_loc(GLIBC_2.3)[LSB] getgrgid[SUSv3] 38942 seekdir[SUSv3] 38943 __ctype_toupper_loc(GLIBC_2.3)[LSB] getgrgid_r[SUSv3] 38944 select[SUSv3] 38945 __cxa_atexit[LSB] getgrnam[SUSv3] semctl[SUSv3] 38946 __cxa_finalize[LSB] getgrnam_r[SUSv3] semget[SUSv3] 38947 __errno_location[LSB] getgrouplist[LSB] semop[SUSv3] 38948 __fgets_chk(GLIBC_2.4)[LSB] getgroups[SUSv3] send[SUSv4] 38949 __fgets_unlocked_chk(GLIBC_2.4)[LSB] gethostbyaddr[SUSv3] 38950 sendfile[LSB] 38951 __fgetws_chk(GLIBC_2.4)[LSB] gethostbyaddr_r[LSB] 38952 sendfile64(GLIBC_2.3)[LSB] 38953 __fgetws_unlocked_chk(GLIBC_2.4)[LSB] gethostbyname[SUSv3] 38954 sendmsg[SUSv4] 38955 __fpending[LSB] gethostbyname2[LSB] sendto[SUSv4] 38956 __fprintf_chk[LSB] gethostbyname2_r[LSB] setbuf[SUSv3] 38957 __fwprintf_chk(GLIBC_2.4)[LSB] gethostbyname_r[LSB] 38958 setbuffer[LSB] 38959 __fxstat[LSB] gethostid[SUSv3] setcontext[SUSv3] 38960 __fxstat64[LSB] gethostname[SUSv3] setegid[SUSv3] 38961 __fxstatat(GLIBC_2.4)[LSB] getitimer[SUSv3] setenv[SUSv3] 38962 __fxstatat64(GLIBC_2.4)[LSB] getline[SUSv4] seteuid[SUSv3] 38963 __getcwd_chk(GLIBC_2.4)[LSB] getloadavg[LSB] setgid[SUSv3] 38964 __getgroups_chk(GLIBC_2.4)[LSB] getlogin[SUSv3] setgrent[SUSv3] 38965 __gethostname_chk(GLIBC_2.4)[LSB] getlogin_r[SUSv3] 38966 setgroups[LSB] 38967 __getlogin_r_chk(GLIBC_2.4)[LSB] getnameinfo[SUSv3] 38968 sethostname[LSB] 38969 __getpagesize[LSB] getopt[LSB] setitimer[SUSv3] 38970 __getpgid[LSB] getopt_long[LSB] setlocale[SUSv3] 38971 __h_errno_location[LSB] getopt_long_only[LSB] setlogmask[SUSv3] 38972 __isinf[LSB] getpagesize[LSB] setpgid[SUSv3] 38973 __isinff[LSB] getpeername[SUSv3] setpgrp[SUSv3] 38974 __isinfl[LSB] getpgid[SUSv3] setpriority[SUSv3] 38975 __isnan[LSB] getpgrp[SUSv3] setprotoent[SUSv3] 38976 __isnanf[LSB] getpid[SUSv3] setpwent[SUSv3] 38977 __isnanl[LSB] getppid[SUSv3] setregid[SUSv3] 38978 __libc_current_sigrtmax[LSB] getpriority[SUSv3] setreuid[SUSv3] 38979 __libc_current_sigrtmin[LSB] getprotobyname[SUSv3] 38980 setrlimit[SUSv3] 38981 __libc_start_main[LSB] getprotobyname_r[LSB] setrlimit64[LFS] 38982 __lxstat[LSB] getprotobynumber[SUSv3] setservent[SUSv3] 38983 __lxstat64[LSB] getprotobynumber_r[LSB] setsid[SUSv3] 38984 __mbsnrtowcs_chk(GLIBC_2.4)[LSB] getprotoent[SUSv3] 38985 setsockopt[LSB] 38986 __mbsrtowcs_chk(GLIBC_2.4)[LSB] getprotoent_r[LSB] 38987 setstate[SUSv3] 38988 __mbstowcs_chk(GLIBC_2.4)[LSB] getpwent[SUSv3] setstate_r[LSB] 38989 __memcpy_chk(GLIBC_2.3.4)[LSB] getpwent_r[LSB] setuid[SUSv3] 38990 __memmove_chk(GLIBC_2.3.4)[LSB] getpwnam[SUSv3] setutent[LSB] 38991 __mempcpy[LSB] getpwnam_r[SUSv3] setutxent[SUSv3] 38992 __mempcpy_chk(GLIBC_2.3.4)[LSB] getpwuid[SUSv3] setvbuf[SUSv3] 38993 __memset_chk(GLIBC_2.3.4)[LSB] getpwuid_r[SUSv3] shmat[SUSv3] 38994 __pread64_chk(GLIBC_2.4)[LSB] getrlimit[SUSv3] shmctl[SUSv3] 38995 __pread_chk(GLIBC_2.4)[LSB] getrlimit64[LFS] shmdt[SUSv3] 38996 __printf_chk[LSB] getrusage[SUSv3] shmget[SUSv3] 38997 __rawmemchr[LSB] getservbyname[SUSv3] shutdown[SUSv3] 38998 __read_chk(GLIBC_2.4)[LSB] getservbyname_r[LSB] 38999 sigaction[SUSv3] 39000 __readlink_chk(GLIBC_2.4)[LSB] getservbyport[SUSv3] 39001 sigaddset[SUSv3] 39002 __realpath_chk(GLIBC_2.4)[LSB] getservbyport_r[LSB] 39003 sigaltstack[SUSv3] 39004 __recv_chk(GLIBC_2.4)[LSB] getservent[SUSv3] sigandset[LSB] 39005 __recvfrom_chk(GLIBC_2.4)[LSB] getservent_r[LSB] 39006 sigdelset[SUSv3] 39007 __register_atfork(GLIBC_2.3.2)[LSB] getsid[SUSv3] 39008 sigemptyset[SUSv3] 39009 __sigsetjmp[LSB] getsockname[SUSv3] sigfillset[SUSv3] 39010 __snprintf_chk[LSB] getsockopt[LSB] sighold[SUSv3] 39011 __sprintf_chk[LSB] getsubopt[SUSv3] sigignore[SUSv3] 39012 __stack_chk_fail(GLIBC_2.4)[LSB] gettext[LSB] 39013 siginterrupt[SUSv3] 39014 __stpcpy[LSB] gettimeofday[SUSv3] sigisemptyset[LSB] 39015 __stpcpy_chk(GLIBC_2.3.4)[LSB] getuid[SUSv3] sigismember[SUSv3] 39016 __stpncpy_chk(GLIBC_2.4)[LSB] getutent[LSB] siglongjmp[SUSv3] 39017 __strcat_chk(GLIBC_2.3.4)[LSB] getutent_r[LSB] signal[SUSv3] 39018 __strcpy_chk(GLIBC_2.3.4)[LSB] getutxent[SUSv3] sigorset[LSB] 39019 __strdup[LSB] getutxid[SUSv3] sigpause[LSB] 39020 __strncat_chk(GLIBC_2.3.4)[LSB] getutxline[SUSv3] 39021 sigpending[SUSv3] 39022 __strncpy_chk(GLIBC_2.3.4)[LSB] getw[SUSv2] sigprocmask[SUSv3] 39023 __strtod_internal[LSB] getwc[SUSv3] sigqueue[SUSv3] 39024 __strtof_internal[LSB] getwc_unlocked[LSB] sigrelse[SUSv3] 39025 __strtok_r[LSB] getwchar[SUSv3] sigreturn[LSB] 39026 __strtol_internal[LSB] getwchar_unlocked[LSB] sigset[SUSv3] 39027 __strtold_internal[LSB] getwd[SUSv3] sigsuspend[SUSv3] 39028 __strtoll_internal[LSB] glob[SUSv3] sigtimedwait[SUSv3] 39029 __strtoul_internal[LSB] glob64[LSB] sigwait[SUSv3] 39030 __strtoull_internal[LSB] globfree[SUSv3] sigwaitinfo[SUSv3] 39031 __swprintf_chk(GLIBC_2.4)[LSB] globfree64[LSB] sleep[SUSv3] 39032 __sysconf[LSB] gmtime[SUSv3] snprintf[SUSv3] 39033 __syslog_chk(GLIBC_2.4)[LSB] gmtime_r[SUSv3] sockatmark[SUSv3] 39034 __sysv_signal[LSB] gnu_get_libc_release[LSB] socket[SUSv3] 39035 __ttyname_r_chk(GLIBC_2.4)[LSB] gnu_get_libc_version[LSB] 39036 socketpair[SUSv3] 39037 __vfprintf_chk[LSB] grantpt[SUSv3] sprintf[SUSv3] 39038 __vfwprintf_chk(GLIBC_2.4)[LSB] hcreate[SUSv3] srand[SUSv3] 39039 __vprintf_chk[LSB] hcreate_r[LSB] srand48[SUSv3] 39040 __vsnprintf_chk[LSB] hdestroy[SUSv3] srand48_r[LSB] 39041 __vsprintf_chk[LSB] hdestroy_r[LSB] srandom[SUSv3] 39042 __vswprintf_chk(GLIBC_2.4)[LSB] hsearch[SUSv3] srandom_r[LSB] 39043 __vsyslog_chk(GLIBC_2.4)[LSB] hsearch_r[LSB] sscanf[LSB] 39044 __vwprintf_chk(GLIBC_2.4)[LSB] htonl[SUSv3] statfs[LSB] 39045 __wcpcpy_chk(GLIBC_2.4)[LSB] htons[SUSv3] statfs64[LSB] 39046 __wcpncpy_chk(GLIBC_2.4)[LSB] iconv[SUSv3] statvfs[SUSv3] 39047 __wcrtomb_chk(GLIBC_2.4)[LSB] iconv_close[SUSv3] statvfs64[LFS] 39048 __wcscat_chk(GLIBC_2.4)[LSB] iconv_open[SUSv3] stime[LSB] 39049 __wcscpy_chk(GLIBC_2.4)[LSB] if_freenameindex[SUSv3] 39050 stpcpy[LSB] 39051 __wcsncat_chk(GLIBC_2.4)[LSB] if_indextoname[SUSv3] 39052 stpncpy[LSB] 39053 __wcsncpy_chk(GLIBC_2.4)[LSB] if_nameindex[SUSv3] 39054 strcasecmp[SUSv3] 39055 __wcsnrtombs_chk(GLIBC_2.4)[LSB] if_nametoindex[SUSv3] 39056 strcasestr[LSB] 39057 __wcsrtombs_chk(GLIBC_2.4)[LSB] imaxabs[SUSv3] strcat[SUSv3] 39058 __wcstod_internal[LSB] imaxdiv[SUSv3] strchr[SUSv3] 39059 __wcstof_internal[LSB] index[SUSv3] strcmp[SUSv3] 39060 __wcstol_internal[LSB] inet_addr[SUSv3] strcoll[SUSv3] 39061 __wcstold_internal[LSB] inet_aton[LSB] strcpy[SUSv3] 39062 __wcstombs_chk(GLIBC_2.4)[LSB] inet_ntoa[SUSv3] strcspn[SUSv3] 39063 __wcstoul_internal[LSB] inet_ntop[SUSv3] strdup[SUSv3] 39064 __wctomb_chk(GLIBC_2.4)[LSB] inet_pton[SUSv3] strerror[SUSv3] 39065 __wmemcpy_chk(GLIBC_2.4)[LSB] initgroups[LSB] strerror_r[LSB] 39066 __wmemmove_chk(GLIBC_2.4)[LSB] initstate[SUSv3] strfmon[SUSv3] 39067 __wmempcpy_chk(GLIBC_2.4)[LSB] initstate_r[LSB] strftime[SUSv3] 39068 __wmemset_chk(GLIBC_2.4)[LSB] inotify_add_watch(GLIBC_2.4)[LSB] 39069 strlen[SUSv3] 39070 __wprintf_chk(GLIBC_2.4)[LSB] inotify_init(GLIBC_2.4)[LSB] 39071 strncasecmp[SUSv3] 39072 __xmknod[LSB] inotify_rm_watch(GLIBC_2.4)[LSB] strncat[SUSv3] 39073 __xmknodat(GLIBC_2.4)[LSB] insque[SUSv3] strncmp[SUSv3] 39074 __xpg_basename[LSB] ioctl[LSB] strncpy[SUSv3] 39075 __xpg_sigpause[LSB] isalnum[SUSv3] strndup[LSB] 39076 __xpg_strerror_r(GLIBC_2.3.4)[LSB] isalpha[SUSv3] strnlen[LSB] 39077 __xstat[LSB] isascii[SUSv3] strpbrk[SUSv3] 39078 __xstat64[LSB] isatty[SUSv3] strptime[LSB] 39079 _exit[SUSv3] isblank[SUSv3] strrchr[SUSv3] 39080 _longjmp[SUSv3] iscntrl[SUSv3] strsep[LSB] 39081 _setjmp[SUSv3] isdigit[SUSv3] strsignal[LSB] 39082 _tolower[SUSv3] isgraph[SUSv3] strspn[SUSv3] 39083 _toupper[SUSv3] islower[SUSv3] strstr[SUSv3] 39084 a64l[SUSv3] isprint[SUSv3] strtod[SUSv3] 39085 abort[SUSv3] ispunct[SUSv3] strtof[SUSv3] 39086 abs[SUSv3] isspace[SUSv3] strtoimax[SUSv3] 39087 accept[SUSv3] isupper[SUSv3] strtok[SUSv3] 39088 access[SUSv3] iswalnum[SUSv3] strtok_r[SUSv3] 39089 acct[LSB] iswalpha[SUSv3] strtol[SUSv3] 39090 adjtime[LSB] iswblank[SUSv3] strtold[SUSv3] 39091 alarm[SUSv3] iswcntrl[SUSv3] strtoll[SUSv3] 39092 alphasort[SUSv4] iswctype[SUSv3] strtoq[LSB] 39093 alphasort64[LSB] iswdigit[SUSv3] strtoul[SUSv3] 39094 asctime[SUSv3] iswgraph[SUSv3] strtoull[SUSv3] 39095 asctime_r[SUSv3] iswlower[SUSv3] strtoumax[SUSv3] 39096 asprintf[LSB] iswprint[SUSv3] strtouq[LSB] 39097 atof[SUSv3] iswpunct[SUSv3] strxfrm[SUSv3] 39098 atoi[SUSv3] iswspace[SUSv3] svc_getreqset[SVID.4] 39099 atol[SUSv3] iswupper[SUSv3] svc_register[LSB] 39100 atoll[SUSv3] iswxdigit[SUSv3] svc_run[LSB] 39101 authnone_create[SVID.4] isxdigit[SUSv3] svc_sendreply[LSB] 39102 backtrace[LSB] jrand48[SUSv3] svcerr_auth[SVID.4] 39103 backtrace_symbols[LSB] jrand48_r[LSB] svcerr_decode[SVID.4] 39104 backtrace_symbols_fd[LSB] key_decryptsession[SVID.4] 39105 svcerr_noproc[SVID.4] 39106 basename[LSB] kill[LSB] svcerr_noprog[SVID.4] 39107 bcmp[SUSv3] killpg[SUSv3] svcerr_progvers[SVID.4] 39108 bcopy[SUSv3] l64a[SUSv3] svcerr_systemerr[SVID.4] 39109 bind[SUSv3] labs[SUSv3] svcerr_weakauth[SVID.4] 39110 bind_textdomain_codeset[LSB] lchown[SUSv3] svcfd_create[RPC & 39111 XDR] 39112 bindresvport[LSB] lcong48[SUSv3] svcraw_create[RPC & XDR] 39113 bindtextdomain[LSB] lcong48_r[LSB] svctcp_create[LSB] 39114 brk[SUSv2] ldiv[SUSv3] svcudp_create[LSB] 39115 bsd_signal[SUSv3] lfind[SUSv3] swab[SUSv3] 39116 bsearch[SUSv3] link[LSB] swapcontext[SUSv3] 39117 btowc[SUSv3] linkat(GLIBC_2.4)[SUSv4] swprintf[SUSv3] 39118 bzero[SUSv3] listen[SUSv3] swscanf[LSB] 39119 calloc[SUSv3] llabs[SUSv3] symlink[SUSv3] 39120 callrpc[RPC & XDR] lldiv[SUSv3] symlinkat(GLIBC_2.4)[SUSv4] 39121 catclose[SUSv3] localeconv[SUSv3] sync[SUSv3] 39122 catgets[SUSv3] localtime[SUSv3] sysconf[LSB] 39123 catopen[SUSv3] localtime_r[SUSv3] sysinfo[LSB] 39124 cfgetispeed[SUSv3] lockf[SUSv3] syslog[SUSv3] 39125 cfgetospeed[SUSv3] lockf64[LFS] system[LSB] 39126 cfmakeraw[LSB] longjmp[SUSv3] tcdrain[SUSv3] 39127 cfsetispeed[SUSv3] lrand48[SUSv3] tcflow[SUSv3] 39128 cfsetospeed[SUSv3] lrand48_r[LSB] tcflush[SUSv3] 39129 cfsetspeed[LSB] lsearch[SUSv3] tcgetattr[SUSv3] 39130 chdir[SUSv3] lseek[SUSv3] tcgetpgrp[SUSv3] 39131 chmod[SUSv3] lseek64[LFS] tcgetsid[SUSv3] 39132 chown[SUSv3] makecontext[SUSv3] tcsendbreak[SUSv3] 39133 chroot[SUSv2] malloc[SUSv3] tcsetattr[SUSv3] 39134 clearerr[SUSv3] mblen[SUSv3] tcsetpgrp[SUSv3] 39135 clearerr_unlocked[LSB] mbrlen[SUSv3] tdelete[SUSv3] 39136 clnt_create[SVID.4] mbrtowc[SUSv3] telldir[SUSv3] 39137 clnt_pcreateerror[SVID.4] mbsinit[SUSv3] tempnam[SUSv3] 39138 clnt_perrno[SVID.4] mbsnrtowcs[LSB] textdomain[LSB] 39139 clnt_perror[SVID.4] mbsrtowcs[SUSv3] tfind[SUSv3] 39140 clnt_spcreateerror[SVID.4] mbstowcs[SUSv3] time[SUSv3] 39141 clnt_sperrno[SVID.4] mbtowc[SUSv3] times[SUSv3] 39142 clnt_sperror[SVID.4] memccpy[SUSv3] tmpfile[SUSv3] 39143 clntraw_create[RPC & XDR] memchr[SUSv3] tmpfile64[LFS] 39144 clnttcp_create[RPC & XDR] memcmp[SUSv3] tmpnam[SUSv3] 39145 clntudp_bufcreate[RPC & XDR] memcpy[SUSv3] toascii[SUSv3] 39146 clntudp_create[RPC & XDR] memmem[LSB] tolower[SUSv3] 39147 clock[SUSv3] memmove[SUSv3] toupper[SUSv3] 39148 close[SUSv3] memrchr[LSB] towctrans[SUSv3] 39149 closedir[SUSv3] memset[SUSv3] towlower[SUSv3] 39150 closelog[SUSv3] mkdir[SUSv3] towupper[SUSv3] 39151 confstr[SUSv3] mkdirat(GLIBC_2.4)[SUSv4] truncate[SUSv3] 39152 connect[SUSv3] mkdtemp[SUSv4] truncate64[LFS] 39153 creat[SUSv3] mkfifo[SUSv3] tsearch[SUSv3] 39154 creat64[LFS] mkfifoat(GLIBC_2.4)[SUSv4] ttyname[SUSv3] 39155 ctermid[SUSv3] mkstemp[SUSv3] ttyname_r[SUSv3] 39156 ctime[SUSv3] mkstemp64[LSB] twalk[SUSv3] 39157 ctime_r[SUSv3] mktemp[SUSv3] tzset[SUSv3] 39158 cuserid[SUSv2] mktime[SUSv3] ualarm[SUSv3] 39159 daemon[LSB] mlock[SUSv3] ulimit[SUSv3] 39160 dcgettext[LSB] mlockall[SUSv3] umask[SUSv3] 39161 dcngettext[LSB] mmap[SUSv3] uname[SUSv3] 39162 dgettext[LSB] mmap64[LFS] ungetc[SUSv3] 39163 difftime[SUSv3] mprotect[SUSv3] ungetwc[SUSv3] 39164 dirfd[SUSv4] mrand48[SUSv3] unlink[LSB] 39165 dirname[SUSv3] mrand48_r[LSB] unlinkat(GLIBC_2.4)[SUSv4] 39166 div[SUSv3] mremap[LSB] unlockpt[SUSv3] 39167 dl_iterate_phdr[LSB] msgctl[SUSv3] unsetenv[SUSv3] 39168 dngettext[LSB] msgget[SUSv3] uselocale(GLIBC_2.3)[LSB] 39169 dprintf[SUSv4] msgrcv[SUSv3] usleep[SUSv3] 39170 drand48[SUSv3] msgsnd[SUSv3] utime[SUSv3] 39171 drand48_r[LSB] msync[SUSv3] utimes[SUSv3] 39172 dup[SUSv3] munlock[SUSv3] utmpname[LSB] 39173 dup2[SUSv3] munlockall[SUSv3] vasprintf[LSB] 39174 duplocale(GLIBC_2.3)[LSB] munmap[SUSv3] vdprintf[LSB] 39175 ecvt[SUSv3] nanosleep[SUSv3] verrx[LSB] 39176 endgrent[SUSv3] newlocale(GLIBC_2.3)[LSB] vfork[SUSv3] 39177 endprotoent[SUSv3] nftw[SUSv3] vfprintf[SUSv3] 39178 endpwent[SUSv3] nftw64[LFS] vfscanf[LSB] 39179 endservent[SUSv3] ngettext[LSB] vfwprintf[SUSv3] 39180 endutent[LSB] nice[SUSv3] vfwscanf[LSB] 39181 endutxent[SUSv3] nl_langinfo[SUSv3] vprintf[SUSv3] 39182 epoll_create(GLIBC_2.3.2)[LSB] nrand48[SUSv3] vscanf[LSB] 39183 epoll_ctl(GLIBC_2.3.2)[LSB] nrand48_r[LSB] vsnprintf[SUSv3] 39184 epoll_wait(GLIBC_2.3.2)[LSB] ntohl[SUSv3] vsprintf[SUSv3] 39185 erand48[SUSv3] ntohs[SUSv3] vsscanf[LSB] 39186 erand48_r[LSB] open[SUSv3] vswprintf[SUSv3] 39187 err[LSB] open64[LFS] vswscanf[LSB] 39188 error[LSB] open_memstream[SUSv4] vsyslog[LSB] 39189 errx[LSB] open_wmemstream(GLIBC_2.4)[SUSv4] vwprintf[SUSv3] 39190 execl[SUSv3] openat(GLIBC_2.4)[SUSv4] vwscanf[LSB] 39191 execle[SUSv3] openat64(GLIBC_2.4)[LSB] wait[SUSv3] 39192 execlp[SUSv3] opendir[SUSv3] wait4[LSB] 39193 execv[SUSv3] openlog[SUSv3] waitid[SUSv3] 39194 execve[SUSv3] pathconf[SUSv3] waitpid[SUSv3] 39195 execvp[SUSv3] pause[SUSv3] warn[LSB] 39196 exit[SUSv3] pclose[SUSv3] warnx[LSB] 39197 faccessat(GLIBC_2.4)[SUSv4] perror[SUSv3] wcpcpy[LSB] 39198 fchdir[SUSv3] pipe[SUSv3] wcpncpy[LSB] 39199 fchmod[SUSv3] pmap_getport[LSB] wcrtomb[SUSv3] 39200 fchmodat(GLIBC_2.4)[SUSv4] pmap_set[LSB] wcscasecmp[LSB] 39201 fchown[SUSv3] pmap_unset[LSB] wcscat[SUSv3] 39202 fchownat(GLIBC_2.4)[SUSv4] poll[SUSv3] wcschr[SUSv3] 39203 fclose[SUSv3] popen[SUSv3] wcscmp[SUSv3] 39204 fcntl[LSB] posix_fadvise[SUSv3] wcscoll[SUSv3] 39205 fcvt[SUSv3] posix_fadvise64[LSB] wcscpy[SUSv3] 39206 fdatasync[SUSv3] posix_fallocate[SUSv3] wcscspn[SUSv3] 39207 fdopen[SUSv3] posix_fallocate64[LSB] wcsdup[LSB] 39208 fdopendir(GLIBC_2.4)[SUSv4] posix_madvise[SUSv3] 39209 wcsftime[SUSv3] 39210 feof[SUSv3] posix_memalign[SUSv3] wcslen[SUSv3] 39211 feof_unlocked[LSB] posix_openpt[SUSv3] wcsncasecmp[LSB] 39212 ferror[SUSv3] posix_spawn[SUSv3] wcsncat[SUSv3] 39213 ferror_unlocked[LSB] posix_spawn_file_actions_addclose[SUSv3] 39214 wcsncmp[SUSv3] 39215 fexecve[SUSv4] posix_spawn_file_actions_adddup2[SUSv3] 39216 wcsncpy[SUSv3] 39217 fflush[SUSv3] posix_spawn_file_actions_addopen[SUSv3] 39218 wcsnlen[LSB] 39219 fflush_unlocked[LSB] posix_spawn_file_actions_destroy[SUSv3] 39220 wcsnrtombs[LSB] 39221 ffs[SUSv3] posix_spawn_file_actions_init[SUSv3] wcspbrk[SUSv3] 39222 fgetc[SUSv3] posix_spawnattr_destroy[SUSv3] wcsrchr[SUSv3] 39223 fgetc_unlocked[LSB] posix_spawnattr_getflags[SUSv3] 39224 wcsrtombs[SUSv3] 39225 fgetpos[SUSv3] posix_spawnattr_getpgroup[SUSv3] wcsspn[SUSv3] 39226 fgetpos64[LFS] posix_spawnattr_getschedparam[SUSv3] 39227 wcsstr[SUSv3] 39228 fgets[SUSv3] posix_spawnattr_getschedpolicy[SUSv3] 39229 wcstod[SUSv3] 39230 fgets_unlocked[LSB] posix_spawnattr_getsigdefault[SUSv3] 39231 wcstof[SUSv3] 39232 fgetwc[SUSv3] posix_spawnattr_getsigmask[SUSv3] 39233 wcstoimax[SUSv3] 39234 fgetwc_unlocked[LSB] posix_spawnattr_init[SUSv3] wcstok[SUSv3] 39235 fgetws[SUSv3] posix_spawnattr_setflags[SUSv3] wcstol[SUSv3] 39236 fgetws_unlocked[LSB] posix_spawnattr_setpgroup[SUSv3] 39237 wcstold[SUSv3] 39238 fileno[SUSv3] posix_spawnattr_setschedparam[SUSv3] 39239 wcstoll[SUSv3] 39240 fileno_unlocked[LSB] posix_spawnattr_setschedpolicy[SUSv3] 39241 wcstombs[SUSv3] 39242 flock[LSB] posix_spawnattr_setsigdefault[SUSv3] wcstoq[LSB] 39243 flockfile[SUSv3] posix_spawnattr_setsigmask[SUSv3] 39244 wcstoul[SUSv3] 39245 fmemopen[SUSv4] posix_spawnp[SUSv3] wcstoull[SUSv3] 39246 fmtmsg[SUSv3] pread[SUSv3] wcstoumax[SUSv3] 39247 fnmatch[SUSv3] pread64[LSB] wcstouq[LSB] 39248 fopen[SUSv3] printf[SUSv3] wcswcs[SUSv3] 39249 fopen64[LFS] pselect[SUSv3] wcswidth[SUSv3] 39250 fork[SUSv3] psignal[LSB] wcsxfrm[SUSv3] 39251 fpathconf[SUSv3] ptrace[LSB] wctob[SUSv3] 39252 fprintf[SUSv3] ptsname[SUSv3] wctomb[SUSv3] 39253 fputc[SUSv3] putc[SUSv3] wctrans[SUSv3] 39254 fputc_unlocked[LSB] putc_unlocked[SUSv3] wctype[SUSv3] 39255 fputs[SUSv3] putchar[SUSv3] wcwidth[SUSv3] 39256 fputs_unlocked[LSB] putchar_unlocked[SUSv3] wmemchr[SUSv3] 39257 fputwc[SUSv3] putenv[SUSv3] wmemcmp[SUSv3] 39258 fputwc_unlocked[LSB] puts[SUSv3] wmemcpy[SUSv3] 39259 fputws[SUSv3] pututxline[SUSv3] wmemmove[SUSv3] 39260 fputws_unlocked[LSB] putw[SUSv2] wmemset[SUSv3] 39261 fread[SUSv3] putwc[SUSv3] wordexp[SUSv3] 39262 fread_unlocked[LSB] putwc_unlocked[LSB] wordfree[SUSv3] 39263 free[SUSv3] putwchar[SUSv3] wprintf[SUSv3] 39264 freeaddrinfo[SUSv3] putwchar_unlocked[LSB] write[SUSv3] 39265 freelocale(GLIBC_2.3)[LSB] pwrite[SUSv3] writev[SUSv3] 39266 freopen[SUSv3] pwrite64[LSB] wscanf[LSB] 39267 freopen64[LFS] qsort[SUSv3] xdr_accepted_reply[SVID.4] 39268 fscanf[LSB] raise[SUSv3] xdr_array[SVID.4] 39269 fseek[SUSv3] rand[SUSv3] xdr_bool[SVID.4] 39270 fseeko[SUSv3] rand_r[SUSv3] xdr_bytes[SVID.4] 39271 fseeko64[LFS] random[SUSv3] xdr_callhdr[SVID.4] 39272 fsetpos[SUSv3] random_r[LSB] xdr_callmsg[SVID.4] 39273 fsetpos64[LFS] read[SUSv3] xdr_char[SVID.4] 39274 fstatfs[LSB] readdir[SUSv3] xdr_double[SVID.4] 39275 fstatfs64[LSB] readdir64[LFS] xdr_enum[SVID.4] 39276 fstatvfs[SUSv3] readdir64_r[LSB] xdr_float[SVID.4] 39277 fstatvfs64[LFS] readdir_r[SUSv3] xdr_free[SVID.4] 39278 fsync[SUSv3] readlink[SUSv3] xdr_int[SVID.4] 39279 ftell[SUSv3] readlinkat(GLIBC_2.4)[SUSv4] xdr_long[SVID.4] 39280 ftello[SUSv3] readv[SUSv3] xdr_opaque[SVID.4] 39281 ftello64[LFS] realloc[SUSv3] xdr_opaque_auth[SVID.4] 39282 ftime[SUSv3] realpath[SUSv3] xdr_pointer[SVID.4] 39283 ftok[SUSv3] recv[SUSv3] xdr_reference[SVID.4] 39284 ftruncate[SUSv3] recvfrom[SUSv3] xdr_rejected_reply[SVID.4] 39285 ftruncate64[LFS] recvmsg[SUSv3] xdr_replymsg[SVID.4] 39286 ftrylockfile[SUSv3] regcomp[SUSv3] xdr_short[SVID.4] 39287 ftw[SUSv3] regerror[SUSv3] xdr_string[SVID.4] 39288 ftw64[LFS] regexec[LSB] xdr_u_char[SVID.4] 39289 funlockfile[SUSv3] regfree[SUSv3] xdr_u_int[LSB] 39290 fwide[SUSv3] remove[SUSv3] xdr_u_long[SVID.4] 39291 fwprintf[SUSv3] remque[SUSv3] xdr_u_short[SVID.4] 39292 fwrite[SUSv3] rename[SUSv3] xdr_union[SVID.4] 39293 fwrite_unlocked[LSB] renameat(GLIBC_2.4)[SUSv4] 39294 xdr_vector[SVID.4] 39295 fwscanf[LSB] rewind[SUSv3] xdr_void[SVID.4] 39296 gai_strerror[SUSv3] rewinddir[SUSv3] xdr_wrapstring[SVID.4] 39297 gcvt[SUSv3] rindex[SUSv3] xdrmem_create[SVID.4] 39298 getaddrinfo[SUSv3] rmdir[SUSv3] xdrrec_create[SVID.4] 39299 getc[SUSv3] sbrk[SUSv2] xdrrec_endofrecord[RPC & XDR] 39300 getc_unlocked[SUSv3] scandir[SUSv4] xdrrec_eof[SVID.4] 39301 getchar[SUSv3] scandir64[LSB] xdrrec_skiprecord[RPC & XDR] 39302 getchar_unlocked[SUSv3] scanf[LSB] xdrstdio_create[LSB] 39303 getcontext[SUSv3] sched_get_priority_max[SUSv3] 39304 getcwd[SUSv3] sched_get_priority_min[SUSv3] 39305 39306 Table A-2. libc Data Interfaces 39307 __daylight[LSB] __tzname[LSB] in6addr_loopback[SUSv3] 39308 __environ[LSB] _sys_errlist[LSB] 39309 __timezone[LSB] in6addr_any[SUSv3] 39310 __________________________________________________________ 39311 39312 A.2. libcrypt 39313 39314 The behavior of the interfaces in this library is specified by 39315 the following Standards. 39316 39317 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 39318 39319 Table A-3. libcrypt Function Interfaces 39320 crypt[SUSv3] encrypt[SUSv3] setkey[SUSv3] 39321 __________________________________________________________ 39322 39323 A.3. libdl 39324 39325 The behavior of the interfaces in this library is specified by 39326 the following Standards. 39327 39328 This Specification [LSB] 39329 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 39330 39331 Table A-4. libdl Function Interfaces 39332 dladdr[LSB] dlerror[SUSv3] dlsym[LSB] 39333 dlclose[SUSv3] dlopen[LSB] dlvsym[LSB] 39334 __________________________________________________________ 39335 39336 A.4. libgcc_s 39337 39338 The behavior of the interfaces in this library is specified by 39339 the following Standards. 39340 39341 This Specification [LSB] 39342 39343 Table A-5. libgcc_s Function Interfaces 39344 _Unwind_Backtrace[LSB] _Unwind_GetGR[LSB] 39345 _Unwind_RaiseException[LSB] 39346 _Unwind_DeleteException[LSB] _Unwind_GetIP[LSB] 39347 _Unwind_Resume[LSB] 39348 _Unwind_FindEnclosingFunction[LSB] 39349 _Unwind_GetIPInfo(GCC_4.2.0)[LSB] 39350 _Unwind_Resume_or_Rethrow[LSB] 39351 _Unwind_ForcedUnwind[LSB] _Unwind_GetLanguageSpecificData[LSB] 39352 _Unwind_SetGR[LSB] 39353 _Unwind_GetCFA[LSB] _Unwind_GetRegionStart[LSB] 39354 _Unwind_SetIP[LSB] 39355 __________________________________________________________ 39356 39357 A.5. libm 39358 39359 The behavior of the interfaces in this library is specified by 39360 the following Standards. 39361 39362 This Specification [LSB] 39363 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 39364 39365 Table A-6. libm Function Interfaces 39366 __finite[LSB] csinl[SUSv3] llroundf[SUSv3] 39367 __finitef[LSB] csqrt[SUSv3] llroundl[SUSv3] 39368 __finitel[LSB] csqrtf[SUSv3] log[SUSv3] 39369 __fpclassify[LSB] csqrtl[SUSv3] log10[SUSv3] 39370 __fpclassifyf[LSB] ctan[SUSv3] log10f[SUSv3] 39371 __signbit[LSB] ctanf[SUSv3] log10l[SUSv3] 39372 __signbitf[LSB] ctanh[SUSv3] log1p[SUSv3] 39373 acos[SUSv3] ctanhf[SUSv3] log1pf[SUSv3] 39374 acosf[SUSv3] ctanhl[SUSv3] log1pl[SUSv3] 39375 acosh[SUSv3] ctanl[SUSv3] log2[SUSv3] 39376 acoshf[SUSv3] drem[LSB] log2f[SUSv3] 39377 acoshl[SUSv3] dremf[LSB] log2l[SUSv3] 39378 acosl[SUSv3] dreml[LSB] logb[SUSv3] 39379 asin[SUSv3] erf[SUSv3] logbf[SUSv3] 39380 asinf[SUSv3] erfc[SUSv3] logbl[SUSv3] 39381 asinh[SUSv3] erfcf[SUSv3] logf[SUSv3] 39382 asinhf[SUSv3] erfcl[SUSv3] logl[SUSv3] 39383 asinhl[SUSv3] erff[SUSv3] lrint[SUSv3] 39384 asinl[SUSv3] erfl[SUSv3] lrintf[SUSv3] 39385 atan[SUSv3] exp[SUSv3] lrintl[SUSv3] 39386 atan2[SUSv3] exp10[LSB] lround[SUSv3] 39387 atan2f[SUSv3] exp10f[LSB] lroundf[SUSv3] 39388 atan2l[SUSv3] exp10l[LSB] lroundl[SUSv3] 39389 atanf[SUSv3] exp2[SUSv3] matherr[LSB] 39390 atanh[SUSv3] exp2f[SUSv3] modf[SUSv3] 39391 atanhf[SUSv3] expf[SUSv3] modff[SUSv3] 39392 atanhl[SUSv3] expl[SUSv3] modfl[SUSv3] 39393 atanl[SUSv3] expm1[SUSv3] nan[SUSv3] 39394 cabs[SUSv3] expm1f[SUSv3] nanf[SUSv3] 39395 cabsf[SUSv3] expm1l[SUSv3] nanl[SUSv3] 39396 cabsl[SUSv3] fabs[SUSv3] nearbyint[SUSv3] 39397 cacos[SUSv3] fabsf[SUSv3] nearbyintf[SUSv3] 39398 cacosf[SUSv3] fabsl[SUSv3] nearbyintl[SUSv3] 39399 cacosh[SUSv3] fdim[SUSv3] nextafter[SUSv3] 39400 cacoshf[SUSv3] fdimf[SUSv3] nextafterf[SUSv3] 39401 cacoshl[SUSv3] fdiml[SUSv3] nextafterl[SUSv3] 39402 cacosl[SUSv3] feclearexcept[SUSv3] nexttoward[SUSv3] 39403 carg[SUSv3] fedisableexcept[LSB] nexttowardf[SUSv3] 39404 cargf[SUSv3] feenableexcept[LSB] nexttowardl[SUSv3] 39405 cargl[SUSv3] fegetenv[SUSv3] pow[SUSv3] 39406 casin[SUSv3] fegetexcept[LSB] pow10[LSB] 39407 casinf[SUSv3] fegetexceptflag[SUSv3] pow10f[LSB] 39408 casinh[SUSv3] fegetround[SUSv3] pow10l[LSB] 39409 casinhf[SUSv3] feholdexcept[SUSv3] powf[SUSv3] 39410 casinhl[SUSv3] feraiseexcept[SUSv3] powl[SUSv3] 39411 casinl[SUSv3] fesetenv[SUSv3] remainder[SUSv3] 39412 catan[SUSv3] fesetexceptflag[SUSv3] remainderf[SUSv3] 39413 catanf[SUSv3] fesetround[SUSv3] remainderl[SUSv3] 39414 catanh[SUSv3] fetestexcept[SUSv3] remquo[SUSv3] 39415 catanhf[SUSv3] feupdateenv[SUSv3] remquof[SUSv3] 39416 catanhl[SUSv3] finite[LSB] remquol[SUSv3] 39417 catanl[SUSv3] finitef[LSB] rint[SUSv3] 39418 cbrt[SUSv3] finitel[LSB] rintf[SUSv3] 39419 cbrtf[SUSv3] floor[SUSv3] rintl[SUSv3] 39420 cbrtl[SUSv3] floorf[SUSv3] round[SUSv3] 39421 ccos[SUSv3] floorl[SUSv3] roundf[SUSv3] 39422 ccosf[SUSv3] fma[SUSv3] roundl[SUSv3] 39423 ccosh[SUSv3] fmaf[SUSv3] scalb[SUSv3] 39424 ccoshf[SUSv3] fmal[SUSv3] scalbf[LSB] 39425 ccoshl[SUSv3] fmax[SUSv3] scalbl[LSB] 39426 ccosl[SUSv3] fmaxf[SUSv3] scalbln[SUSv3] 39427 ceil[SUSv3] fmaxl[SUSv3] scalblnf[SUSv3] 39428 ceilf[SUSv3] fmin[SUSv3] scalblnl[SUSv3] 39429 ceill[SUSv3] fminf[SUSv3] scalbn[SUSv3] 39430 cexp[SUSv3] fminl[SUSv3] scalbnf[SUSv3] 39431 cexpf[SUSv3] fmod[SUSv3] scalbnl[SUSv3] 39432 cexpl[SUSv3] fmodf[SUSv3] significand[LSB] 39433 cimag[SUSv3] fmodl[SUSv3] significandf[LSB] 39434 cimagf[SUSv3] frexp[SUSv3] significandl[LSB] 39435 cimagl[SUSv3] frexpf[SUSv3] sin[SUSv3] 39436 clog[SUSv3] frexpl[SUSv3] sincos[LSB] 39437 clog10[LSB] gamma[LSB] sincosf[LSB] 39438 clog10f[LSB] gammaf[LSB] sincosl[LSB] 39439 clog10l[LSB] gammal[LSB] sinf[SUSv3] 39440 clogf[SUSv3] hypot[SUSv3] sinh[SUSv3] 39441 clogl[SUSv3] hypotf[SUSv3] sinhf[SUSv3] 39442 conj[SUSv3] hypotl[SUSv3] sinhl[SUSv3] 39443 conjf[SUSv3] ilogb[SUSv3] sinl[SUSv3] 39444 conjl[SUSv3] ilogbf[SUSv3] sqrt[SUSv3] 39445 copysign[SUSv3] ilogbl[SUSv3] sqrtf[SUSv3] 39446 copysignf[SUSv3] j0[SUSv3] sqrtl[SUSv3] 39447 copysignl[SUSv3] j0f[LSB] tan[SUSv3] 39448 cos[SUSv3] j0l[LSB] tanf[SUSv3] 39449 cosf[SUSv3] j1[SUSv3] tanh[SUSv3] 39450 cosh[SUSv3] j1f[LSB] tanhf[SUSv3] 39451 coshf[SUSv3] j1l[LSB] tanhl[SUSv3] 39452 coshl[SUSv3] jn[SUSv3] tanl[SUSv3] 39453 cosl[SUSv3] jnf[LSB] tgamma[SUSv3] 39454 cpow[SUSv3] jnl[LSB] tgammaf[SUSv3] 39455 cpowf[SUSv3] ldexp[SUSv3] tgammal[SUSv3] 39456 cpowl[SUSv3] ldexpf[SUSv3] trunc[SUSv3] 39457 cproj[SUSv3] ldexpl[SUSv3] truncf[SUSv3] 39458 cprojf[SUSv3] lgamma[SUSv3] truncl[SUSv3] 39459 cprojl[SUSv3] lgamma_r[LSB] y0[SUSv3] 39460 creal[SUSv3] lgammaf[SUSv3] y0f[LSB] 39461 crealf[SUSv3] lgammaf_r[LSB] y0l[LSB] 39462 creall[SUSv3] lgammal[SUSv3] y1[SUSv3] 39463 csin[SUSv3] lgammal_r[LSB] y1f[LSB] 39464 csinf[SUSv3] llrint[SUSv3] y1l[LSB] 39465 csinh[SUSv3] llrintf[SUSv3] yn[SUSv3] 39466 csinhf[SUSv3] llrintl[SUSv3] ynf[LSB] 39467 csinhl[SUSv3] llround[SUSv3] ynl[LSB] 39468 39469 Table A-7. libm Data Interfaces 39470 signgam[SUSv3] 39471 __________________________________________________________ 39472 39473 A.6. libncurses 39474 39475 The behavior of the interfaces in this library is specified by 39476 the following Standards. 39477 39478 This Specification [LSB] 39479 X/Open Curses [SUS-CURSES] 39480 39481 Table A-8. libncurses Function Interfaces 39482 addch[SUS-CURSES] mvdelch[SUS-CURSES] slk_refresh[SUS-CURSES] 39483 addchnstr[SUS-CURSES] mvderwin[SUS-CURSES] 39484 slk_restore[SUS-CURSES] 39485 addchstr[SUS-CURSES] mvgetch[SUS-CURSES] slk_set[SUS-CURSES] 39486 addnstr[SUS-CURSES] mvgetnstr[SUS-CURSES] slk_touch[SUS-CURSES] 39487 addstr[SUS-CURSES] mvgetstr[SUS-CURSES] standend[SUS-CURSES] 39488 attr_get[SUS-CURSES] mvhline[SUS-CURSES] standout[SUS-CURSES] 39489 attr_off[SUS-CURSES] mvinch[SUS-CURSES] start_color[SUS-CURSES] 39490 attr_on[SUS-CURSES] mvinchnstr[LSB] subpad[SUS-CURSES] 39491 attr_set[SUS-CURSES] mvinchstr[LSB] subwin[SUS-CURSES] 39492 attroff[SUS-CURSES] mvinnstr[SUS-CURSES] syncok[SUS-CURSES] 39493 attron[SUS-CURSES] mvinsch[SUS-CURSES] termattrs[SUS-CURSES] 39494 attrset[SUS-CURSES] mvinsnstr[SUS-CURSES] termname[SUS-CURSES] 39495 baudrate[SUS-CURSES] mvinsstr[SUS-CURSES] tgetent[SUS-CURSES] 39496 beep[SUS-CURSES] mvinstr[LSB] tgetflag[SUS-CURSES] 39497 bkgd[SUS-CURSES] mvprintw[SUS-CURSES] tgetnum[SUS-CURSES] 39498 bkgdset[SUS-CURSES] mvscanw[LSB] tgetstr[SUS-CURSES] 39499 border[SUS-CURSES] mvvline[SUS-CURSES] tgoto[SUS-CURSES] 39500 box[SUS-CURSES] mvwaddch[SUS-CURSES] tigetflag[SUS-CURSES] 39501 can_change_color[SUS-CURSES] mvwaddchnstr[SUS-CURSES] 39502 tigetnum[SUS-CURSES] 39503 cbreak[SUS-CURSES] mvwaddchstr[SUS-CURSES] tigetstr[SUS-CURSES] 39504 chgat[SUS-CURSES] mvwaddnstr[SUS-CURSES] timeout[SUS-CURSES] 39505 clear[SUS-CURSES] mvwaddstr[SUS-CURSES] touchline[SUS-CURSES] 39506 clearok[SUS-CURSES] mvwchgat[SUS-CURSES] touchwin[SUS-CURSES] 39507 clrtobot[SUS-CURSES] mvwdelch[SUS-CURSES] tparm[SUS-CURSES] 39508 clrtoeol[SUS-CURSES] mvwgetch[SUS-CURSES] tputs[SUS-CURSES] 39509 color_content[SUS-CURSES] mvwgetnstr[SUS-CURSES] 39510 typeahead[SUS-CURSES] 39511 color_set[SUS-CURSES] mvwgetstr[SUS-CURSES] unctrl[SUS-CURSES] 39512 copywin[SUS-CURSES] mvwhline[SUS-CURSES] ungetch[SUS-CURSES] 39513 curs_set[SUS-CURSES] mvwin[SUS-CURSES] untouchwin[SUS-CURSES] 39514 def_prog_mode[SUS-CURSES] mvwinch[SUS-CURSES] 39515 use_env[SUS-CURSES] 39516 def_shell_mode[SUS-CURSES] mvwinchnstr[LSB] vidattr[SUS-CURSES] 39517 del_curterm[SUS-CURSES] mvwinchstr[LSB] vidputs[SUS-CURSES] 39518 delay_output[SUS-CURSES] mvwinnstr[SUS-CURSES] 39519 vline[SUS-CURSES] 39520 delch[SUS-CURSES] mvwinsch[SUS-CURSES] vw_printw[SUS-CURSES] 39521 deleteln[SUS-CURSES] mvwinsnstr[SUS-CURSES] vw_scanw[LSB] 39522 delscreen[SUS-CURSES] mvwinsstr[SUS-CURSES] 39523 vwprintw[SUS-CURSES] 39524 delwin[SUS-CURSES] mvwinstr[LSB] vwscanw[LSB] 39525 derwin[SUS-CURSES] mvwprintw[SUS-CURSES] waddch[SUS-CURSES] 39526 doupdate[SUS-CURSES] mvwscanw[LSB] waddchnstr[SUS-CURSES] 39527 dupwin[SUS-CURSES] mvwvline[SUS-CURSES] waddchstr[SUS-CURSES] 39528 echo[SUS-CURSES] napms[SUS-CURSES] waddnstr[SUS-CURSES] 39529 echochar[SUS-CURSES] newpad[SUS-CURSES] waddstr[SUS-CURSES] 39530 endwin[SUS-CURSES] newterm[SUS-CURSES] wattr_get[SUS-CURSES] 39531 erase[SUS-CURSES] newwin[SUS-CURSES] wattr_off[SUS-CURSES] 39532 erasechar[SUS-CURSES] nl[SUS-CURSES] wattr_on[SUS-CURSES] 39533 filter[SUS-CURSES] nocbreak[SUS-CURSES] wattr_set[SUS-CURSES] 39534 flash[SUS-CURSES] nodelay[SUS-CURSES] wattroff[SUS-CURSES] 39535 flushinp[SUS-CURSES] noecho[SUS-CURSES] wattron[SUS-CURSES] 39536 getbkgd[SUS-CURSES] nonl[SUS-CURSES] wattrset[SUS-CURSES] 39537 getch[SUS-CURSES] noqiflush[SUS-CURSES] wbkgd[SUS-CURSES] 39538 getnstr[SUS-CURSES] noraw[SUS-CURSES] wbkgdset[SUS-CURSES] 39539 getstr[SUS-CURSES] notimeout[SUS-CURSES] wborder[SUS-CURSES] 39540 getwin[SUS-CURSES] overlay[SUS-CURSES] wchgat[SUS-CURSES] 39541 halfdelay[SUS-CURSES] overwrite[SUS-CURSES] wclear[SUS-CURSES] 39542 has_colors[SUS-CURSES] pair_content[SUS-CURSES] 39543 wclrtobot[SUS-CURSES] 39544 has_ic[SUS-CURSES] pechochar[SUS-CURSES] wclrtoeol[SUS-CURSES] 39545 has_il[SUS-CURSES] pnoutrefresh[SUS-CURSES] 39546 wcolor_set[SUS-CURSES] 39547 hline[SUS-CURSES] prefresh[SUS-CURSES] wcursyncup[SUS-CURSES] 39548 idcok[SUS-CURSES] printw[SUS-CURSES] wdelch[SUS-CURSES] 39549 idlok[SUS-CURSES] putp[SUS-CURSES] wdeleteln[SUS-CURSES] 39550 immedok[SUS-CURSES] putwin[SUS-CURSES] wechochar[SUS-CURSES] 39551 inch[SUS-CURSES] qiflush[SUS-CURSES] werase[SUS-CURSES] 39552 inchnstr[LSB] raw[SUS-CURSES] wgetch[SUS-CURSES] 39553 inchstr[LSB] redrawwin[SUS-CURSES] wgetnstr[SUS-CURSES] 39554 init_color[SUS-CURSES] refresh[SUS-CURSES] wgetstr[SUS-CURSES] 39555 init_pair[SUS-CURSES] reset_prog_mode[SUS-CURSES] 39556 whline[SUS-CURSES] 39557 initscr[SUS-CURSES] reset_shell_mode[SUS-CURSES] 39558 winch[SUS-CURSES] 39559 innstr[SUS-CURSES] resetty[SUS-CURSES] winchnstr[LSB] 39560 insch[SUS-CURSES] restartterm[SUS-CURSES] winchstr[LSB] 39561 insdelln[SUS-CURSES] ripoffline[LSB] winnstr[SUS-CURSES] 39562 insertln[SUS-CURSES] savetty[SUS-CURSES] winsch[SUS-CURSES] 39563 insnstr[SUS-CURSES] scanw[LSB] winsdelln[SUS-CURSES] 39564 insstr[SUS-CURSES] scr_dump[SUS-CURSES] winsertln[SUS-CURSES] 39565 instr[LSB] scr_init[SUS-CURSES] winsnstr[SUS-CURSES] 39566 intrflush[SUS-CURSES] scr_restore[SUS-CURSES] 39567 winsstr[SUS-CURSES] 39568 is_linetouched[SUS-CURSES] scr_set[SUS-CURSES] winstr[LSB] 39569 is_wintouched[SUS-CURSES] scrl[SUS-CURSES] wmove[SUS-CURSES] 39570 isendwin[SUS-CURSES] scroll[SUS-CURSES] 39571 wnoutrefresh[SUS-CURSES] 39572 keyname[SUS-CURSES] scrollok[SUS-CURSES] wprintw[SUS-CURSES] 39573 keypad[SUS-CURSES] set_curterm[SUS-CURSES] 39574 wredrawln[SUS-CURSES] 39575 killchar[SUS-CURSES] set_term[SUS-CURSES] wrefresh[SUS-CURSES] 39576 leaveok[SUS-CURSES] setscrreg[SUS-CURSES] wscanw[LSB] 39577 longname[SUS-CURSES] setupterm[SUS-CURSES] wscrl[SUS-CURSES] 39578 meta[SUS-CURSES] slk_attr_set[SUS-CURSES] 39579 wsetscrreg[SUS-CURSES] 39580 move[SUS-CURSES] slk_attroff[SUS-CURSES] wstandend[SUS-CURSES] 39581 mvaddch[SUS-CURSES] slk_attron[SUS-CURSES] 39582 wstandout[SUS-CURSES] 39583 mvaddchnstr[SUS-CURSES] slk_attrset[SUS-CURSES] 39584 wsyncdown[SUS-CURSES] 39585 mvaddchstr[SUS-CURSES] slk_clear[SUS-CURSES] 39586 wsyncup[SUS-CURSES] 39587 mvaddnstr[SUS-CURSES] slk_color[SUS-CURSES] 39588 wtimeout[SUS-CURSES] 39589 mvaddstr[SUS-CURSES] slk_init[SUS-CURSES] wtouchln[SUS-CURSES] 39590 mvchgat[SUS-CURSES] slk_label[SUS-CURSES] wvline[SUS-CURSES] 39591 mvcur[LSB] slk_noutrefresh[SUS-CURSES] 39592 39593 Table A-9. libncurses Data Interfaces 39594 COLORS[SUS-CURSES] LINES[SUS-CURSES] curscr[SUS-CURSES] 39595 COLOR_PAIRS[SUS-CURSES] acs_map[SUS-CURSES] stdscr[SUS-CURSES] 39596 COLS[SUS-CURSES] cur_term[SUS-CURSES] 39597 __________________________________________________________ 39598 39599 A.7. libpam 39600 39601 The behavior of the interfaces in this library is specified by 39602 the following Standards. 39603 39604 This Specification [LSB] 39605 39606 Table A-10. libpam Function Interfaces 39607 pam_acct_mgmt(LIBPAM_1.0)[LSB] pam_fail_delay(LIBPAM_1.0)[LSB] 39608 pam_putenv(LIBPAM_1.0)[LSB] 39609 pam_authenticate(LIBPAM_1.0)[LSB] pam_get_item(LIBPAM_1.0)[LSB] 39610 pam_set_item(LIBPAM_1.0)[LSB] 39611 pam_chauthtok(LIBPAM_1.0)[LSB] pam_getenv(LIBPAM_1.0)[LSB] 39612 pam_setcred(LIBPAM_1.0)[LSB] 39613 pam_close_session(LIBPAM_1.0)[LSB] 39614 pam_getenvlist(LIBPAM_1.0)[LSB] pam_start(LIBPAM_1.0)[LSB] 39615 pam_end(LIBPAM_1.0)[LSB] pam_open_session(LIBPAM_1.0)[LSB] 39616 pam_strerror(LIBPAM_1.0)[LSB] 39617 __________________________________________________________ 39618 39619 A.8. libpthread 39620 39621 The behavior of the interfaces in this library is specified by 39622 the following Standards. 39623 39624 Large File Support [LFS] 39625 This Specification [LSB] 39626 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 39627 POSIX 1003.1-2008 (ISO/IEC 9945-2009) [SUSv4] 39628 39629 Table A-11. libpthread Function Interfaces 39630 _pthread_cleanup_pop[LSB] pthread_condattr_destroy[SUSv3] 39631 pthread_rwlock_init[SUSv3] 39632 _pthread_cleanup_push[LSB] pthread_condattr_getpshared[SUSv3] 39633 pthread_rwlock_rdlock[SUSv3] 39634 lseek64[LFS] pthread_condattr_init[SUSv3] 39635 pthread_rwlock_timedrdlock[SUSv3] 39636 open64[LFS] pthread_condattr_setpshared[SUSv3] 39637 pthread_rwlock_timedwrlock[SUSv3] 39638 pread[SUSv3] pthread_create[SUSv3] 39639 pthread_rwlock_tryrdlock[SUSv3] 39640 pread64[LSB] pthread_detach[SUSv3] 39641 pthread_rwlock_trywrlock[SUSv3] 39642 pthread_attr_destroy[SUSv3] pthread_equal[SUSv3] 39643 pthread_rwlock_unlock[SUSv3] 39644 pthread_attr_getdetachstate[SUSv3] pthread_exit[SUSv3] 39645 pthread_rwlock_wrlock[SUSv3] 39646 pthread_attr_getguardsize[SUSv3] pthread_getattr_np[LSB] 39647 pthread_rwlockattr_destroy[SUSv3] 39648 pthread_attr_getinheritsched[SUSv3] 39649 pthread_getconcurrency[SUSv3] 39650 pthread_rwlockattr_getkind_np[LSB] 39651 pthread_attr_getschedparam[SUSv3] pthread_getcpuclockid[SUSv3] 39652 pthread_rwlockattr_getpshared[SUSv3] 39653 pthread_attr_getschedpolicy[SUSv3] pthread_getschedparam[SUSv3] 39654 pthread_rwlockattr_init[SUSv3] 39655 pthread_attr_getscope[SUSv3] pthread_getspecific[SUSv3] 39656 pthread_rwlockattr_setkind_np[LSB] 39657 pthread_attr_getstack[SUSv3] pthread_join[SUSv3] 39658 pthread_rwlockattr_setpshared[SUSv3] 39659 pthread_attr_getstackaddr[SUSv3] pthread_key_create[SUSv3] 39660 pthread_self[SUSv3] 39661 pthread_attr_getstacksize[SUSv3] pthread_key_delete[SUSv3] 39662 pthread_setcancelstate[SUSv3] 39663 pthread_attr_init[SUSv3] pthread_kill[SUSv3] 39664 pthread_setcanceltype[SUSv3] 39665 pthread_attr_setdetachstate[SUSv3] 39666 pthread_mutex_consistent_np[LSB] pthread_setconcurrency[SUSv3] 39667 pthread_attr_setguardsize[SUSv3] pthread_mutex_destroy[SUSv3] 39668 pthread_setschedparam[SUSv3] 39669 pthread_attr_setinheritsched[SUSv3] 39670 pthread_mutex_getprioceiling(GLIBC_2.4)[SUSv4] 39671 pthread_setschedprio(GLIBC_2.3.4)[SUSv3] 39672 pthread_attr_setschedparam[SUSv3] pthread_mutex_init[SUSv3] 39673 pthread_setspecific[SUSv3] 39674 pthread_attr_setschedpolicy[SUSv3] pthread_mutex_lock[SUSv3] 39675 pthread_sigmask[SUSv3] 39676 pthread_attr_setscope[SUSv3] 39677 pthread_mutex_setprioceiling(GLIBC_2.4)[SUSv4] 39678 pthread_spin_destroy[SUSv3] 39679 pthread_attr_setstack[SUSv3] pthread_mutex_timedlock[SUSv3] 39680 pthread_spin_init[SUSv3] 39681 pthread_attr_setstackaddr[SUSv3] pthread_mutex_trylock[SUSv3] 39682 pthread_spin_lock[SUSv3] 39683 pthread_attr_setstacksize[SUSv3] pthread_mutex_unlock[SUSv3] 39684 pthread_spin_trylock[SUSv3] 39685 pthread_barrier_destroy[SUSv3] pthread_mutexattr_destroy[SUSv3] 39686 pthread_spin_unlock[SUSv3] 39687 pthread_barrier_init[SUSv3] 39688 pthread_mutexattr_getprioceiling(GLIBC_2.4)[SUSv4] 39689 pthread_testcancel[SUSv3] 39690 pthread_barrier_wait[SUSv3] 39691 pthread_mutexattr_getprotocol(GLIBC_2.4)[SUSv4] pwrite[SUSv3] 39692 pthread_barrierattr_destroy[SUSv3] 39693 pthread_mutexattr_getpshared[SUSv3] pwrite64[LSB] 39694 pthread_barrierattr_getpshared(GLIBC_2.3.3)[SUSv3] 39695 pthread_mutexattr_getrobust_np[LSB] sem_close[SUSv3] 39696 pthread_barrierattr_init[SUSv3] 39697 pthread_mutexattr_gettype[SUSv3] sem_destroy[SUSv3] 39698 pthread_barrierattr_setpshared[SUSv3] 39699 pthread_mutexattr_init[SUSv3] sem_getvalue[SUSv3] 39700 pthread_cancel[SUSv3] 39701 pthread_mutexattr_setprioceiling(GLIBC_2.4)[SUSv4] 39702 sem_init[SUSv3] 39703 pthread_cond_broadcast[SUSv3] 39704 pthread_mutexattr_setprotocol(GLIBC_2.4)[SUSv4] sem_open[SUSv3] 39705 pthread_cond_destroy[SUSv3] pthread_mutexattr_setpshared[SUSv3] 39706 sem_post[SUSv3] 39707 pthread_cond_init[SUSv3] pthread_mutexattr_setrobust_np[LSB] 39708 sem_timedwait[SUSv3] 39709 pthread_cond_signal[SUSv3] pthread_mutexattr_settype[SUSv3] 39710 sem_trywait[SUSv3] 39711 pthread_cond_timedwait[SUSv3] pthread_once[SUSv3] 39712 sem_unlink[SUSv3] 39713 pthread_cond_wait[SUSv3] pthread_rwlock_destroy[SUSv3] 39714 sem_wait[SUSv3] 39715 __________________________________________________________ 39716 39717 A.9. librt 39718 39719 The behavior of the interfaces in this library is specified by 39720 the following Standards. 39721 39722 POSIX 1003.1-2001 (ISO/IEC 9945-2003) [SUSv3] 39723 39724 Table A-12. librt Function Interfaces 39725 clock_getcpuclockid[SUSv3] mq_open(GLIBC_2.3.4)[SUSv3] 39726 shm_unlink[SUSv3] 39727 clock_getres[SUSv3] mq_receive(GLIBC_2.3.4)[SUSv3] 39728 timer_create[SUSv3] 39729 clock_gettime[SUSv3] mq_send(GLIBC_2.3.4)[SUSv3] 39730 timer_delete[SUSv3] 39731 clock_nanosleep[SUSv3] mq_setattr(GLIBC_2.3.4)[SUSv3] 39732 timer_getoverrun[SUSv3] 39733 clock_settime[SUSv3] mq_timedreceive(GLIBC_2.3.4)[SUSv3] 39734 timer_gettime[SUSv3] 39735 mq_close(GLIBC_2.3.4)[SUSv3] mq_timedsend(GLIBC_2.3.4)[SUSv3] 39736 timer_settime[SUSv3] 39737 mq_getattr(GLIBC_2.3.4)[SUSv3] mq_unlink(GLIBC_2.3.4)[SUSv3] 39738 mq_notify(GLIBC_2.3.4)[SUSv3] shm_open[SUSv3] 39739 __________________________________________________________ 39740 39741 A.10. libutil 39742 39743 The behavior of the interfaces in this library is specified by 39744 the following Standards. 39745 39746 This Specification [LSB] 39747 39748 Table A-13. libutil Function Interfaces 39749 forkpty[LSB] login_tty[LSB] logwtmp[LSB] 39750 login[LSB] logout[LSB] openpty[LSB] 39751 __________________________________________________________ 39752 39753 A.11. libz 39754 39755 The behavior of the interfaces in this library is specified by 39756 the following Standards. 39757 39758 This Specification [LSB] 39759 39760 Table A-14. libz Function Interfaces 39761 adler32[LSB] gzclose[LSB] gztell[LSB] 39762 compress[LSB] gzdopen[LSB] gzwrite[LSB] 39763 compress2[LSB] gzeof[LSB] inflate[LSB] 39764 compressBound[LSB] gzerror[LSB] inflateEnd[LSB] 39765 crc32[LSB] gzflush[LSB] inflateInit2_[LSB] 39766 deflate[LSB] gzgetc[LSB] inflateInit_[LSB] 39767 deflateBound[LSB] gzgets[LSB] inflateReset[LSB] 39768 deflateCopy[LSB] gzopen[LSB] inflateSetDictionary[LSB] 39769 deflateEnd[LSB] gzprintf[LSB] inflateSync[LSB] 39770 deflateInit2_[LSB] gzputc[LSB] inflateSyncPoint[LSB] 39771 deflateInit_[LSB] gzputs[LSB] uncompress[LSB] 39772 deflateParams[LSB] gzread[LSB] zError[LSB] 39773 deflateReset[LSB] gzrewind[LSB] zlibVersion[LSB] 39774 deflateSetDictionary[LSB] gzseek[LSB] 39775 get_crc_table[LSB] gzsetparams[LSB] 39776 __________________________________________________________ 39777 39778 Appendix B. GNU Free Documentation License (Informative) 39779 39780 This specification is published under the terms of the GNU Free 39781 Documentation License, Version 1.1, March 2000 39782 39783 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 39784 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 39785 permitted to copy and distribute verbatim copies of this 39786 license document, but changing it is not allowed. 39787 __________________________________________________________ 39788 39789 B.1. PREAMBLE 39790 39791 The purpose of this License is to make a manual, textbook, or 39792 other written document "free" in the sense of freedom: to 39793 assure everyone the effective freedom to copy and redistribute 39794 it, with or without modifying it, either commercially or 39795 noncommercially. Secondarily, this License preserves for the 39796 author and publisher a way to get credit for their work, while 39797 not being considered responsible for modifications made by 39798 others. 39799 39800 This License is a kind of "copyleft", which means that 39801 derivative works of the document must themselves be free in the 39802 same sense. It complements the GNU General Public License, 39803 which is a copyleft license designed for free software. 39804 39805 We have designed this License in order to use it for manuals 39806 for free software, because free software needs free 39807 documentation: a free program should come with manuals 39808 providing the same freedoms that the software does. But this 39809 License is not limited to software manuals; it can be used for 39810 any textual work, regardless of subject matter or whether it is 39811 published as a printed book. We recommend this License 39812 principally for works whose purpose is instruction or 39813 reference. 39814 __________________________________________________________ 39815 39816 B.2. APPLICABILITY AND DEFINITIONS 39817 39818 This License applies to any manual or other work that contains 39819 a notice placed by the copyright holder saying it can be 39820 distributed under the terms of this License. The "Document", 39821 below, refers to any such manual or work. Any member of the 39822 public is a licensee, and is addressed as "you". 39823 39824 A "Modified Version" of the Document means any work containing 39825 the Document or a portion of it, either copied verbatim, or 39826 with modifications and/or translated into another language. 39827 39828 A "Secondary Section" is a named appendix or a front-matter 39829 section of the Document that deals exclusively with the 39830 relationship of the publishers or authors of the Document to 39831 the Document's overall subject (or to related matters) and 39832 contains nothing that could fall directly within that overall 39833 subject. (For example, if the Document is in part a textbook of 39834 mathematics, a Secondary Section may not explain any 39835 mathematics.) The relationship could be a matter of historical 39836 connection with the subject or with related matters, or of 39837 legal, commercial, philosophical, ethical or political position 39838 regarding them. 39839 39840 The "Invariant Sections" are certain Secondary Sections whose 39841 titles are designated, as being those of Invariant Sections, in 39842 the notice that says that the Document is released under this 39843 License. 39844 39845 The "Cover Texts" are certain short passages of text that are 39846 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 39847 that says that the Document is released under this License. 39848 39849 A "Transparent" copy of the Document means a machine-readable 39850 copy, represented in a format whose specification is available 39851 to the general public, whose contents can be viewed and edited 39852 directly and straightforwardly with generic text editors or 39853 (for images composed of pixels) generic paint programs or (for 39854 drawings) some widely available drawing editor, and that is 39855 suitable for input to text formatters or for automatic 39856 translation to a variety of formats suitable for input to text 39857 formatters. A copy made in an otherwise Transparent file format 39858 whose markup has been designed to thwart or discourage 39859 subsequent modification by readers is not Transparent. A copy 39860 that is not "Transparent" is called "Opaque". 39861 39862 Examples of suitable formats for Transparent copies include 39863 plain ASCII without markup, Texinfo input format, LaTeX input 39864 format, SGML or XML using a publicly available DTD, and 39865 standard-conforming simple HTML designed for human 39866 modification. Opaque formats include PostScript, PDF, 39867 proprietary formats that can be read and edited only by 39868 proprietary word processors, SGML or XML for which the DTD 39869 and/or processing tools are not generally available, and the 39870 machine-generated HTML produced by some word processors for 39871 output purposes only. 39872 39873 The "Title Page" means, for a printed book, the title page 39874 itself, plus such following pages as are needed to hold, 39875 legibly, the material this License requires to appear in the 39876 title page. For works in formats which do not have any title 39877 page as such, "Title Page" means the text near the most 39878 prominent appearance of the work's title, preceding the 39879 beginning of the body of the text. 39880 __________________________________________________________ 39881 39882 B.3. VERBATIM COPYING 39883 39884 You may copy and distribute the Document in any medium, either 39885 commercially or noncommercially, provided that this License, 39886 the copyright notices, and the license notice saying this 39887 License applies to the Document are reproduced in all copies, 39888 and that you add no other conditions whatsoever to those of 39889 this License. You may not use technical measures to obstruct or 39890 control the reading or further copying of the copies you make 39891 or distribute. However, you may accept compensation in exchange 39892 for copies. If you distribute a large enough number of copies 39893 you must also follow the conditions in section 3. 39894 39895 You may also lend copies, under the same conditions stated 39896 above, and you may publicly display copies. 39897 __________________________________________________________ 39898 39899 B.4. COPYING IN QUANTITY 39900 39901 If you publish printed copies of the Document numbering more 39902 than 100, and the Document's license notice requires Cover 39903 Texts, you must enclose the copies in covers that carry, 39904 clearly and legibly, all these Cover Texts: Front-Cover Texts 39905 on the front cover, and Back-Cover Texts on the back cover. 39906 Both covers must also clearly and legibly identify you as the 39907 publisher of these copies. The front cover must present the 39908 full title with all words of the title equally prominent and 39909 visible. You may add other material on the covers in addition. 39910 Copying with changes limited to the covers, as long as they 39911 preserve the title of the Document and satisfy these 39912 conditions, can be treated as verbatim copying in other 39913 respects. 39914 39915 If the required texts for either cover are too voluminous to 39916 fit legibly, you should put the first ones listed (as many as 39917 fit reasonably) on the actual cover, and continue the rest onto 39918 adjacent pages. 39919 39920 If you publish or distribute Opaque copies of the Document 39921 numbering more than 100, you must either include a 39922 machine-readable Transparent copy along with each Opaque copy, 39923 or state in or with each Opaque copy a publicly-accessible 39924 computer-network location containing a complete Transparent 39925 copy of the Document, free of added material, which the general 39926 network-using public has access to download anonymously at no 39927 charge using public-standard network protocols. If you use the 39928 latter option, you must take reasonably prudent steps, when you 39929 begin distribution of Opaque copies in quantity, to ensure that 39930 this Transparent copy will remain thus accessible at the stated 39931 location until at least one year after the last time you 39932 distribute an Opaque copy (directly or through your agents or 39933 retailers) of that edition to the public. 39934 39935 It is requested, but not required, that you contact the authors 39936 of the Document well before redistributing any large number of 39937 copies, to give them a chance to provide you with an updated 39938 version of the Document. 39939 __________________________________________________________ 39940 39941 B.5. MODIFICATIONS 39942 39943 You may copy and distribute a Modified Version of the Document 39944 under the conditions of sections 2 and 3 above, provided that 39945 you release the Modified Version under precisely this License, 39946 with the Modified Version filling the role of the Document, 39947 thus licensing distribution and modification of the Modified 39948 Version to whoever possesses a copy of it. In addition, you 39949 must do these things in the Modified Version: 39950 39951 A. Use in the Title Page (and on the covers, if any) a title 39952 distinct from that of the Document, and from those of 39953 previous versions (which should, if there were any, be 39954 listed in the History section of the Document). You may use 39955 the same title as a previous version if the original 39956 publisher of that version gives permission. 39957 B. List on the Title Page, as authors, one or more persons or 39958 entities responsible for authorship of the modifications in 39959 the Modified Version, together with at least five of the 39960 principal authors of the Document (all of its principal 39961 authors, if it has less than five). 39962 C. State on the Title page the name of the publisher of the 39963 Modified Version, as the publisher. 39964 D. Preserve all the copyright notices of the Document. 39965 E. Add an appropriate copyright notice for your modifications 39966 adjacent to the other copyright notices. 39967 F. Include, immediately after the copyright notices, a license 39968 notice giving the public permission to use the Modified 39969 Version under the terms of this License, in the form shown 39970 in the Addendum below. 39971 G. Preserve in that license notice the full lists of Invariant 39972 Sections and required Cover Texts given in the Document's 39973 license notice. 39974 H. Include an unaltered copy of this License. 39975 I. Preserve the section entitled "History", and its title, and 39976 add to it an item stating at least the title, year, new 39977 authors, and publisher of the Modified Version as given on 39978 the Title Page. If there is no section entitled "History" 39979 in the Document, create one stating the title, year, 39980 authors, and publisher of the Document as given on its 39981 Title Page, then add an item describing the Modified 39982 Version as stated in the previous sentence. 39983 J. Preserve the network location, if any, given in the 39984 Document for public access to a Transparent copy of the 39985 Document, and likewise the network locations given in the 39986 Document for previous versions it was based on. These may 39987 be placed in the "History" section. You may omit a network 39988 location for a work that was published at least four years 39989 before the Document itself, or if the original publisher of 39990 the version it refers to gives permission. 39991 K. In any section entitled "Acknowledgements" or 39992 "Dedications", preserve the section's title, and preserve 39993 in the section all the substance and tone of each of the 39994 contributor acknowledgements and/or dedications given 39995 therein. 39996 L. Preserve all the Invariant Sections of the Document, 39997 unaltered in their text and in their titles. Section 39998 numbers or the equivalent are not considered part of the 39999 section titles. 40000 M. Delete any section entitled "Endorsements". Such a section 40001 may not be included in the Modified Version. 40002 N. Do not retitle any existing section as "Endorsements" or to 40003 conflict in title with any Invariant Section. 40004 40005 If the Modified Version includes new front-matter sections or 40006 appendices that qualify as Secondary Sections and contain no 40007 material copied from the Document, you may at your option 40008 designate some or all of these sections as invariant. To do 40009 this, add their titles to the list of Invariant Sections in the 40010 Modified Version's license notice. These titles must be 40011 distinct from any other section titles. 40012 40013 You may add a section entitled "Endorsements", provided it 40014 contains nothing but endorsements of your Modified Version by 40015 various parties--for example, statements of peer review or that 40016 the text has been approved by an organization as the 40017 authoritative definition of a standard. 40018 40019 You may add a passage of up to five words as a Front-Cover 40020 Text, and a passage of up to 25 words as a Back-Cover Text, to 40021 the end of the list of Cover Texts in the Modified Version. 40022 Only one passage of Front-Cover Text and one of Back-Cover Text 40023 may be added by (or through arrangements made by) any one 40024 entity. If the Document already includes a cover text for the 40025 same cover, previously added by you or by arrangement made by 40026 the same entity you are acting on behalf of, you may not add 40027 another; but you may replace the old one, on explicit 40028 permission from the previous publisher that added the old one. 40029 40030 The author(s) and publisher(s) of the Document do not by this 40031 License give permission to use their names for publicity for or 40032 to assert or imply endorsement of any Modified Version. 40033 __________________________________________________________ 40034 40035 B.6. COMBINING DOCUMENTS 40036 40037 You may combine the Document with other documents released 40038 under this License, under the terms defined in section 4 above 40039 for modified versions, provided that you include in the 40040 combination all of the Invariant Sections of all of the 40041 original documents, unmodified, and list them all as Invariant 40042 Sections of your combined work in its license notice. 40043 40044 The combined work need only contain one copy of this License, 40045 and multiple identical Invariant Sections may be replaced with 40046 a single copy. If there are multiple Invariant Sections with 40047 the same name but different contents, make the title of each 40048 such section unique by adding at the end of it, in parentheses, 40049 the name of the original author or publisher of that section if 40050 known, or else a unique number. Make the same adjustment to the 40051 section titles in the list of Invariant Sections in the license 40052 notice of the combined work. 40053 40054 In the combination, you must combine any sections entitled 40055 "History" in the various original documents, forming one 40056 section entitled "History"; likewise combine any sections 40057 entitled "Acknowledgements", and any sections entitled 40058 "Dedications". You must delete all sections entitled 40059 "Endorsements." 40060 __________________________________________________________ 40061 40062 B.7. COLLECTIONS OF DOCUMENTS 40063 40064 You may make a collection consisting of the Document and other 40065 documents released under this License, and replace the 40066 individual copies of this License in the various documents with 40067 a single copy that is included in the collection, provided that 40068 you follow the rules of this License for verbatim copying of 40069 each of the documents in all other respects. 40070 40071 You may extract a single document from such a collection, and 40072 distribute it individually under this License, provided you 40073 insert a copy of this License into the extracted document, and 40074 follow this License in all other respects regarding verbatim 40075 copying of that document. 40076 __________________________________________________________ 40077 40078 B.8. AGGREGATION WITH INDEPENDENT WORKS 40079 40080 A compilation of the Document or its derivatives with other 40081 separate and independent documents or works, in or on a volume 40082 of a storage or distribution medium, does not as a whole count 40083 as a Modified Version of the Document, provided no compilation 40084 copyright is claimed for the compilation. Such a compilation is 40085 called an "aggregate", and this License does not apply to the 40086 other self-contained works thus compiled with the Document, on 40087 account of their being thus compiled, if they are not 40088 themselves derivative works of the Document. 40089 40090 If the Cover Text requirement of section 3 is applicable to 40091 these copies of the Document, then if the Document is less than 40092 one quarter of the entire aggregate, the Document's Cover Texts 40093 may be placed on covers that surround only the Document within 40094 the aggregate. Otherwise they must appear on covers around the 40095 whole aggregate. 40096 __________________________________________________________ 40097 40098 B.9. TRANSLATION 40099 40100 Translation is considered a kind of modification, so you may 40101 distribute translations of the Document under the terms of 40102 section 4. Replacing Invariant Sections with translations 40103 requires special permission from their copyright holders, but 40104 you may include translations of some or all Invariant Sections 40105 in addition to the original versions of these Invariant 40106 Sections. You may include a translation of this License 40107 provided that you also include the original English version of 40108 this License. In case of a disagreement between the translation 40109 and the original English version of this License, the original 40110 English version will prevail. 40111 __________________________________________________________ 40112 40113 B.10. TERMINATION 40114 40115 You may not copy, modify, sublicense, or distribute the 40116 Document except as expressly provided for under this License. 40117 Any other attempt to copy, modify, sublicense or distribute the 40118 Document is void, and will automatically terminate your rights 40119 under this License. However, parties who have received copies, 40120 or rights, from you under this License will not have their 40121 licenses terminated so long as such parties remain in full 40122 compliance. 40123 __________________________________________________________ 40124 40125 B.11. FUTURE REVISIONS OF THIS LICENSE 40126 40127 The Free Software Foundation may publish new, revised versions 40128 of the GNU Free Documentation License from time to time. Such 40129 new versions will be similar in spirit to the present version, 40130 but may differ in detail to address new problems or concerns. 40131 See http://www.gnu.org/copyleft/. 40132 40133 Each version of the License is given a distinguishing version 40134 number. If the Document specifies that a particular numbered 40135 version of this License "or any later version" applies to it, 40136 you have the option of following the terms and conditions 40137 either of that specified version or of any later version that 40138 has been published (not as a draft) by the Free Software 40139 Foundation. If the Document does not specify a version number 40140 of this License, you may choose any version ever published (not 40141 as a draft) by the Free Software Foundation. 40142 __________________________________________________________ 40143 40144 B.12. How to use this License for your documents 40145 40146 To use this License in a document you have written, include a 40147 copy of the License in the document and put the following 40148 copyright and license notices just after the title page: 40149 40150 Copyright (c) YEAR YOUR NAME. Permission is granted to copy, 40151 distribute and/or modify this document under the terms of 40152 the GNU Free Documentation License, Version 1.1 or any later 40153 version published by the Free Software Foundation; with the 40154 Invariant Sections being LIST THEIR TITLES, with the 40155 Front-Cover Texts being LIST, and with the Back-Cover Texts 40156 being LIST. A copy of the license is included in the section 40157 entitled "GNU Free Documentation License". 40158 40159 If you have no Invariant Sections, write "with no Invariant 40160 Sections" instead of saying which ones are invariant. If you 40161 have no Front-Cover Texts, write "no Front-Cover Texts" instead 40162 of "Front-Cover Texts being LIST"; likewise for Back-Cover 40163 Texts. 40164 40165 If your document contains nontrivial examples of program code, 40166 we recommend releasing these examples in parallel under your 40167 choice of free software license, such as the GNU General Public 40168 License, to permit their use in free software.