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 compress