1 2 Linux Standard Base Specification 3.1 3 4 Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Free Standards 5 Group 6 7 Permission is granted to copy, distribute and/or modify this 8 document under the terms of the GNU Free Documentation 9 License, Version 1.1; with no Invariant Sections, with no 10 Front-Cover Texts, and with no Back-Cover Texts. A copy of the 11 license is included in the section entitled "GNU Free 12 Documentation License". 13 14 Portions of the text are copyrighted by the following parties: 15 16 * The Regents of the University of California 17 * Free Software Foundation 18 * Ian F. Darwin 19 * Paul Vixie 20 * BSDI (now Wind River) 21 * Andrew G Morgan 22 * Jean-loup Gailly and Mark Adler 23 * Massachusetts Institute of Technology 24 25 These excerpts are being used in accordance with their 26 respective licenses. 27 28 Linux is a trademark of Linus Torvalds. 29 30 UNIX a registered trademark of the Open Group in the United 31 States and other countries. 32 33 LSB is a trademark of the Free Standards Group in the USA and 34 other countries. 35 36 AMD is a trademark of Advanced Micro Devices, Inc. 37 38 Intel and Itanium are registered trademarks and Intel386 is a 39 trademarks of Intel Corporation. 40 41 PowerPC and PowerPC Architecture are trademarks of the IBM 42 Corporation. 43 44 OpenGL is a registered trademark of Silicon Graphics, Inc. 45 _________________________________________________________ 46 47 Table of Contents 48 Foreword 49 Introduction 50 I. Introductory Elements 51 52 1. Scope 53 54 1.1. General 55 1.2. Module Specific Scope 56 57 2. References 58 59 2.1. Normative References 60 2.2. Informative References/Bibliography 61 62 3. Requirements 63 64 3.1. Relevant Libraries 65 3.2. LSB Implementation Conformance 66 3.3. LSB Application Conformance 67 68 4. Definitions 69 5. Terminology 70 6. Documentation Conventions 71 7. Relationship To ISO/IEC 9945 POSIX 72 8. Relationship To Other Free Standards Group 73 Specifications 74 75 II. Base Libraries 76 77 9. Base Libraries 78 79 9.1. Introduction 80 9.2. Program Interpreter 81 9.3. Interfaces for libc 82 9.4. Data Definitions for libc 83 9.5. Interface Definitions for libc 84 9.6. Interfaces for libm 85 9.7. Data Definitions for libm 86 9.8. Interface Definitions for libm 87 9.9. Interfaces for libpthread 88 9.10. Data Definitions for libpthread 89 9.11. Interface Definitions for libpthread 90 9.12. Interfaces for libgcc_s 91 9.13. Data Definitions for libgcc_s 92 9.14. Interfaces for libdl 93 9.15. Data Definitions for libdl 94 9.16. Interface Definitions for libdl 95 9.17. Interfaces for librt 96 9.18. Interfaces for libcrypt 97 9.19. Interfaces for libpam 98 9.20. Data Definitions for libpam 99 9.21. Interface Definitions for libpam 100 101 III. Utility Libraries 102 103 10. Utility Libraries 104 105 10.1. Introduction 106 10.2. Interfaces for libz 107 10.3. Data Definitions for libz 108 10.4. Interface Definitions for libz 109 10.5. Interfaces for libncurses 110 10.6. Data Definitions for libncurses 111 10.7. Interfaces for libutil 112 10.8. Interface Definitions for libutil 113 114 IV. Commands and Utilities 115 116 11. Commands and Utilities 117 118 11.1. Commands and Utilities 119 11.2. Command Behavior 120 121 V. Execution Environment 122 123 12. File System Hierarchy 124 125 12.1. /dev: Device Files 126 12.2. /etc: Host-specific system configuration 127 12.3. User Accounting Databases 128 12.4. Path For System Administration Utilities 129 130 13. Additional Recommendations 131 132 13.1. Recommendations for applications on ownership 133 and permissions 134 135 14. Additional Behaviors 136 137 14.1. Mandatory Optional Behaviors 138 139 15. Localization 140 141 15.1. Introduction 142 15.2. Regular Expressions 143 15.3. Pattern Matching Notation 144 145 VI. System Initialization 146 147 16. System Initialization 148 149 16.1. Cron Jobs 150 16.2. Init Script Actions 151 16.3. Comment Conventions for Init Scripts 152 16.4. Installation and Removal of Init Scripts 153 16.5. Run Levels 154 16.6. Facility Names 155 16.7. Script Names 156 16.8. Init Script Functions 157 158 VII. Users & Groups 159 160 17. Users & Groups 161 162 17.1. User and Group Database 163 17.2. User & Group Names 164 17.3. User ID Ranges 165 17.4. Rationale 166 167 A. Alphabetical Listing of Interfaces 168 169 A.1. libc 170 A.2. libcrypt 171 A.3. libdl 172 A.4. libm 173 A.5. libncurses 174 A.6. libpam 175 A.7. libpthread 176 A.8. librt 177 A.9. libutil 178 A.10. libz 179 180 B. Future Directions (Informative) 181 182 B.1. Introduction 183 B.2. Commands And Utilities 184 185 lsbinstall -- installation tool for various types 186 of data 187 188 C. GNU Free Documentation License (Informative) 189 190 C.1. PREAMBLE 191 C.2. APPLICABILITY AND DEFINITIONS 192 C.3. VERBATIM COPYING 193 C.4. COPYING IN QUANTITY 194 C.5. MODIFICATIONS 195 C.6. COMBINING DOCUMENTS 196 C.7. COLLECTIONS OF DOCUMENTS 197 C.8. AGGREGATION WITH INDEPENDENT WORKS 198 C.9. TRANSLATION 199 C.10. TERMINATION 200 C.11. FUTURE REVISIONS OF THIS LICENSE 201 C.12. How to use this License for your documents 202 203 List of Tables 204 2-1. Normative References 205 2-2. Other References 206 3-1. Standard Library Names 207 3-2. Standard Library Names defined in the Architecture 208 Specific Supplement 209 210 9-1. libc Definition 211 9-2. libc - RPC Function Interfaces 212 9-3. libc - System Calls Function Interfaces 213 9-4. libc - Standard I/O Function Interfaces 214 9-5. libc - Standard I/O Data Interfaces 215 9-6. libc - Signal Handling Function Interfaces 216 9-7. libc - Signal Handling Data Interfaces 217 9-8. libc - Localization Functions Function Interfaces 218 9-9. libc - Localization Functions Data Interfaces 219 9-10. libc - Socket Interface Function Interfaces 220 9-11. libc - Wide Characters Function Interfaces 221 9-12. libc - String Functions Function Interfaces 222 9-13. libc - IPC Functions Function Interfaces 223 9-14. libc - Regular Expressions Function Interfaces 224 9-15. libc - Character Type Functions Function Interfaces 225 9-16. libc - Time Manipulation Function Interfaces 226 9-17. libc - Time Manipulation Data Interfaces 227 9-18. libc - Terminal Interface Functions Function Interfaces 228 9-19. libc - System Database Interface Function Interfaces 229 9-20. libc - Language Support Function Interfaces 230 9-21. libc - Large File Support Function Interfaces 231 9-22. libc - Standard Library Function Interfaces 232 9-23. libc - Standard Library Data Interfaces 233 9-24. libm Definition 234 9-25. libm - Math Function Interfaces 235 9-26. libm - Math Data Interfaces 236 9-27. libpthread Definition 237 9-28. libpthread - Realtime Threads Function Interfaces 238 9-29. libpthread - Posix Threads Function Interfaces 239 9-30. libpthread - Thread aware versions of libc interfaces 240 Function Interfaces 241 242 9-31. libgcc_s Definition 243 9-32. libdl Definition 244 9-33. libdl - Dynamic Loader Function Interfaces 245 9-34. librt Definition 246 9-35. librt - Shared Memory Objects Function Interfaces 247 9-36. librt - Clock Function Interfaces 248 9-37. librt - Timers Function Interfaces 249 9-38. libcrypt Definition 250 9-39. libcrypt - Encryption Function Interfaces 251 9-40. libpam Definition 252 9-41. libpam - Pluggable Authentication API Function 253 Interfaces 254 255 10-1. libz Definition 256 10-2. libz - Compression Library Function Interfaces 257 10-3. libncurses Definition 258 10-4. libncurses - Curses Function Interfaces 259 10-5. libncurses - Curses Data Interfaces 260 10-6. libutil Definition 261 10-7. libutil - Utility Functions Function Interfaces 262 11-1. Commands And Utilities 263 11-2. Built In Utilities 264 11-1. Escape Sequences 265 17-1. Required User & Group Names 266 17-2. Optional User & Group Names 267 A-1. libc Function Interfaces 268 A-2. libc Data Interfaces 269 A-3. libcrypt Function Interfaces 270 A-4. libdl Function Interfaces 271 A-5. libm Function Interfaces 272 A-6. libm Data Interfaces 273 A-7. libncurses Function Interfaces 274 A-8. libncurses Data Interfaces 275 A-9. libpam Function Interfaces 276 A-10. libpthread Function Interfaces 277 A-11. librt Function Interfaces 278 A-12. libutil Function Interfaces 279 A-13. libz Function Interfaces 280 _________________________________________________________ 281 282 Foreword 283 284 This is version 3.1 of the Linux Standard Base Specification. 285 This specification is part of a family of specifications under 286 the general title "Linux Standard Base". Developers of 287 applications or implementations interested in using the LSB 288 trademark should see the Free Standards Group Certification 289 Policy for details. 290 _________________________________________________________ 291 292 Introduction 293 294 The LSB defines a binary interface for application programs 295 that are compiled and packaged for LSB-conforming 296 implementations on many different hardware architectures. 297 Since a binary specification shall include information 298 specific to the computer processor architecture for which it 299 is intended, it is not possible for a single document to 300 specify the interface for all possible LSB-conforming 301 implementations. Therefore, the LSB is a family of 302 specifications, rather than a single one. 303 304 This document should be used in conjunction with the documents 305 it references. This document enumerates the system components 306 it includes, but descriptions of those components may be 307 included entirely or partly in this document, partly in other 308 documents, or entirely in other reference documents. For 309 example, the section that describes system service routines 310 includes a list of the system routines supported in this 311 interface, formal declarations of the data structures they use 312 that are visible to applications, and a pointer to the 313 underlying referenced specification for information about the 314 syntax and semantics of each call. Only those routines not 315 described in standards referenced by this document, or 316 extensions to those standards, are described in the detail. 317 Information referenced in this way is as much a part of this 318 document as is the information explicitly included here. 319 320 The specification carries a version number of either the form 321 x.y or x.y.z. This version number carries the following 322 meaning: 323 324 * The first number (x) is the major version number. All 325 versions with the same major version number should share 326 binary compatibility. Any addition or deletion of a new 327 library results in a new version number. Interfaces marked 328 as deprecated may be removed from the specification at a 329 major version change. 330 * The second number (y) is the minor version number. 331 Individual interfaces may be added if all certified 332 implementations already had that (previously undocumented) 333 interface. Interfaces may be marked as deprecated at a 334 minor version change. Other minor changes may be permitted 335 at the discretion of the LSB workgroup. 336 * The third number (z), if present, is the editorial level. 337 Only editorial changes should be included in such 338 versions. 339 340 Since this specification is a descriptive Application Binary 341 Interface, and not a source level API specification, it is not 342 possible to make a guarantee of 100% backward compatibility 343 between major releases. However, it is the intent that those 344 parts of the binary interface that are visible in the source 345 level API will remain backward compatible from version to 346 version, except where a feature marked as "Deprecated" in one 347 release may be removed from a future release. 348 349 Implementors are strongly encouraged to make use of symbol 350 versioning to permit simultaneous support of applications 351 conforming to different releases of this specification. 352 353 I. Introductory Elements 354 355 Table of Contents 356 1. Scope 357 358 1.1. General 359 1.2. Module Specific Scope 360 361 2. References 362 363 2.1. Normative References 364 2.2. Informative References/Bibliography 365 366 3. Requirements 367 368 3.1. Relevant Libraries 369 3.2. LSB Implementation Conformance 370 3.3. LSB Application Conformance 371 372 4. Definitions 373 5. Terminology 374 6. Documentation Conventions 375 7. Relationship To ISO/IEC 9945 POSIX 376 8. Relationship To Other Free Standards Group Specifications 377 _________________________________________________________ 378 379 Chapter 1. Scope 380 381 1.1. General 382 383 The Linux Standard Base (LSB) defines a system interface for 384 compiled applications and a minimal environment for support of 385 installation scripts. Its purpose is to enable a uniform 386 industry standard environment for high-volume applications 387 conforming to the LSB. 388 389 These specifications are composed of two basic parts: A common 390 specification ("LSB-generic" or "generic LSB") describing 391 those parts of the interface that remain constant across all 392 implementations of the LSB, and an architecture-specific 393 supplement ("LSB-arch" or "archLSB") describing the parts of 394 the interface that vary by processor architecture. Together, 395 the LSB-generic and the architecture-specific supplement for a 396 single hardware architecture provide a complete interface 397 specification for compiled application programs on systems 398 that share a common hardware architecture. 399 400 The LSB-generic document shall be used in conjunction with an 401 architecture-specific supplement. Whenever a section of the 402 LSB-generic specification shall be supplemented by 403 architecture-specific information, the LSB-generic document 404 includes a reference to the architecture supplement. 405 Architecture supplements may also contain additional 406 information that is not referenced in the LSB-generic 407 document. 408 409 The LSB contains both a set of Application Program Interfaces 410 (APIs) and Application Binary Interfaces (ABIs). APIs may 411 appear in the source code of portable applications, while the 412 compiled binary of that application may use the larger set of 413 ABIs. A conforming implementation shall provide all of the 414 ABIs listed here. The compilation system may replace (e.g. by 415 macro definition) certain APIs with calls to one or more of 416 the underlying binary interfaces, and may insert calls to 417 binary interfaces as needed. 418 419 The LSB is primarily a binary interface definition. Not all of 420 the source level APIs available to applications may be 421 contained in this specification. 422 _________________________________________________________ 423 424 1.2. Module Specific Scope 425 426 This is the Core module of the Linux Standards Base (LSB). 427 This module provides the fundamental system interfaces, 428 libraries, and runtime environment upon which all conforming 429 applications and libraries depend. 430 431 Interfaces described in this module are mandatory except where 432 explicitly listed otherwise. Core interfaces may be 433 supplemented by other modules; all modules are built upon the 434 core. 435 _________________________________________________________ 436 437 Chapter 2. References 438 439 2.1. Normative References 440 441 The following referenced documents are indispensable for the 442 application of this document. For dated references, only the 443 edition cited applies. For undated references, the latest 444 edition of the referenced document (including any amendments) 445 applies. 446 447 Note: Where copies of a document are available on the World 448 Wide Web, a Uniform Resource Locator (URL) is given for 449 informative purposes only. This may point to a more recent 450 copy of the referenced specification, or may be out of 451 date. Reference copies of specifications at the revision 452 level indicated may be found at the Free Standards Group's 453 Reference Specifications site. 454 455 Table 2-1. Normative References 456 Name Title URL 457 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 458 (FHS) 2.3 http://www.pathname.com/fhs/ 459 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 460 floating-point arithmetic for microprocessor systems 461 http://www.ieee.org/ 462 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 463 ISO POSIX (2003) 464 465 ISO/IEC 9945-1:2003 Information technology -- Portable 466 Operating System Interface (POSIX) -- Part 1: Base Definitions 467 468 ISO/IEC 9945-2:2003 Information technology -- Portable 469 Operating System Interface (POSIX) -- Part 2: System 470 Interfaces 471 472 ISO/IEC 9945-3:2003 Information technology -- Portable 473 Operating System Interface (POSIX) -- Part 3: Shell and 474 Utilities 475 476 ISO/IEC 9945-4:2003 Information technology -- Portable 477 Operating System Interface (POSIX) -- Part 4: Rationale 478 479 Including Technical Cor. 1: 2004 480 http://www.unix.org/version3/ 481 Itanium C++ ABI Itanium C++ ABI (Revision 1.83) 482 http://refspecs.freestandards.org/cxxabi-1.83.html 483 Large File Support Large File Support 484 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 485 SUSv2 CAE Specification, January 1997, System Interfaces and 486 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 487 http://www.opengroup.org/publications/catalog/un.htm 488 SUSv2 Commands and Utilities The Single UNIX® 489 Specification(SUS) Version 2, Commands and Utilities (XCU), 490 Issue 5 (ISBN: 1-85912-191-8, C604) 491 http://www.opengroup.org/publications/catalog/un.htm 492 SVID Issue 3 American Telephone and Telegraph Company, System 493 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 494 1989.(ISBN 0201566524) 495 SVID Issue 4 System V Interface Definition,Fourth Edition 496 System V ABI System V Application Binary Interface, Edition 497 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 498 System V ABI Update System V Application Binary Interface - 499 DRAFT - 17 December 2003 500 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 501 l 502 X/Open Curses CAE Specification, May 1996, X/Open Curses, 503 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 504 Corrigendum U018 505 http://www.opengroup.org/publications/catalog/un.htm 506 _________________________________________________________ 507 508 2.2. Informative References/Bibliography 509 510 In addition, the specifications listed below provide essential 511 background information to implementors of this specification. 512 These references are included for information only. 513 514 Table 2-2. Other References 515 Name Title URL 516 DWARF Debugging Information Format, Revision 2.0.0 DWARF 517 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 518 http://refspecs.freestandards.org/dwarf/dwarf-2.0.0.pdf 519 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 520 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 521 http://refspecs.freestandards.org/dwarf/ 522 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 523 Specification method for cultural conventions 524 ITU-T V.42 International Telecommunication Union 525 Recommendation V.42 (2002): Error-correcting procedures for 526 DCEs using asynchronous-to-synchronous conversionITUV 527 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 528 parent=T-REC-V.42 529 Li18nux Globalization Specification LI18NUX 2000 Globalization 530 Specification, Version 1.0 with Amendment 4 531 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 532 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 533 http://www.lanana.org/docs/device-list/devices.txt 534 PAM Open Software Foundation, Request For Comments: 86.0 , 535 October 1995, V. Samar & R.Schemers (SunSoft) 536 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 537 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 538 MD5 Message-Digest Algorithm 539 http://www.ietf.org/rfc/rfc1321.txt 540 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 541 http://www.ietf.org/ 542 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 543 1833: Binding Protocols for ONC RPC Version 2 544 http://www.ietf.org/rfc/rfc1833.txt 545 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 546 1950: ZLIB Compressed Data Format Specification 547 http://www.ietf.org/rfc/rfc1950.txt 548 RFC 1951: DEFLATE Compressed Data Format Specification IETF 549 RFC 1951: DEFLATE Compressed Data Format Specification version 550 1.3 http://www.ietf.org/rfc/rfc1951.txt 551 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 552 file format specification version 4.3 553 http://www.ietf.org/rfc/rfc1952.txt 554 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 555 Message Format http://www.ietf.org/rfc/rfc2440.txt 556 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 557 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 558 RFC 2822:Internet Message Format IETF RFC 2822: Internet 559 Message Format http://www.ietf.org/rfc/rfc2822.txt 560 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 561 Specification http://www.ietf.org/rfc/rfc791.txt 562 RPM Package Format RPM Package Format V3.0 563 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format. 564 html 565 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 566 _________________________________________________________ 567 568 Chapter 3. Requirements 569 570 3.1. Relevant Libraries 571 572 The libraries listed in Table 3-1 shall be available on a 573 Linux Standard Base system, with the specified runtime names. 574 The libraries listed in Table 3-2 are architecture specific, 575 but shall be available on all LSB conforming systems. This 576 list may be supplemented or amended by the architecture 577 specific supplement. 578 579 Table 3-1. Standard Library Names 580 Library Runtime Name 581 libdl libdl.so.2 582 libcrypt libcrypt.so.1 583 libz libz.so.1 584 libncurses libncurses.so.5 585 libutil libutil.so.1 586 libpthread libpthread.so.0 587 librt librt.so.1 588 libpam libpam.so.0 589 libgcc_s libgcc_s.so.1 590 591 Table 3-2. Standard Library Names defined in the Architecture 592 Specific Supplement 593 Library Runtime Name 594 libm See archLSB 595 libc See archLSB 596 proginterp See archLSB 597 598 These libraries will be in an implementation-defined directory 599 which the dynamic linker shall search by default. 600 _________________________________________________________ 601 602 3.2. LSB Implementation Conformance 603 604 A conforming implementation is necessarily architecture 605 specific, and must provide the interfaces specified by both 606 the generic LSB Core specification and its relevant 607 architecture specific supplement. 608 609 Rationale: An implementation must provide at least the 610 interfaces specified in these specifications. It may also 611 provide additional interfaces. 612 613 A conforming implementation shall satisfy the following 614 requirements: 615 616 * A processor architecture represents a family of related 617 processors which may not have identical feature sets. The 618 architecture specific supplement to this specification for 619 a given target processor architecture describes a minimum 620 acceptable processor. The implementation shall provide all 621 features of this processor, whether in hardware or through 622 emulation transparent to the application. 623 * The implementation shall be capable of executing compiled 624 applications having the format and using the system 625 interfaces described in this document. 626 * The implementation shall provide libraries containing the 627 interfaces specified by this document, and shall provide a 628 dynamic linking mechanism that allows these interfaces to 629 be attached to applications at runtime. All the interfaces 630 shall behave as specified in this document. 631 * The map of virtual memory provided by the implementation 632 shall conform to the requirements of this document. 633 * The implementation's low-level behavior with respect to 634 function call linkage, system traps, signals, and other 635 such activities shall conform to the formats described in 636 this document. 637 * The implementation shall provide all of the mandatory 638 interfaces in their entirety. 639 * The implementation may provide one or more of the optional 640 interfaces. Each optional interface that is provided shall 641 be provided in its entirety. The product documentation 642 shall state which optional interfaces are provided. 643 * The implementation shall provide all files and utilities 644 specified as part of this document in the format defined 645 here and in other referenced documents. All commands and 646 utilities shall behave as required by this document. The 647 implementation shall also provide all mandatory components 648 of an application's runtime environment that are included 649 or referenced in this document. 650 * The implementation, when provided with standard data 651 formats and values at a named interface, shall provide the 652 behavior defined for those values and data formats at that 653 interface. However, a conforming implementation may 654 consist of components which are separately packaged and/or 655 sold. For example, a vendor of a conforming implementation 656 might sell the hardware, operating system, and windowing 657 system as separately packaged items. 658 * The implementation may provide additional interfaces with 659 different names. It may also provide additional behavior 660 corresponding to data values outside the standard ranges, 661 for standard named interfaces. 662 _________________________________________________________ 663 664 3.3. LSB Application Conformance 665 666 A conforming application is necessarily architecture specific, 667 and must conform to both the generic LSB Core specification 668 and its relevant architecture specific supplement. 669 670 A conforming application shall satisfy the following 671 requirements: 672 673 * Its executable files shall be either shell scripts or 674 object files in the format defined for the Object File 675 Format system interface. 676 * Its object files shall participate in dynamic linking as 677 defined in the Program Loading and Linking System 678 interface. 679 * It shall employ only the instructions, traps, and other 680 low-level facilities defined in the Low-Level System 681 interface as being for use by applications. 682 * If it requires any optional interface defined in this 683 document in order to be installed or to execute 684 successfully, the requirement for that optional interface 685 shall be stated in the application's documentation. 686 * It shall not use any interface or data format that is not 687 required to be provided by a conforming implementation, 688 unless: 689 + If such an interface or data format is supplied by 690 another application through direct invocation of that 691 application during execution, that application shall 692 be in turn an LSB conforming application. 693 + The use of that interface or data format, as well as 694 its source, shall be identified in the documentation 695 of the application. 696 * It shall not use any values for a named interface that are 697 reserved for vendor extensions. 698 699 A strictly conforming application shall not require or use any 700 interface, facility, or implementation-defined extension that 701 is not defined in this document in order to be installed or to 702 execute successfully. 703 _________________________________________________________ 704 705 Chapter 4. Definitions 706 707 For the purposes of this document, the following definitions, 708 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 709 Edition, apply: 710 711 can 712 713 be able to; there is a possibility of; it is possible to 714 cannot 715 716 be unable to; there is no possibilty of; it is not possible to 717 may 718 719 is permitted; is allowed; is permissible 720 need not 721 722 it is not required that; no...is required 723 shall 724 725 is to; is required to; it is required that; has to; only...is 726 permitted; it is necessary 727 shall not 728 729 is not allowed [permitted] [acceptable] [permissible]; is 730 required to be not; is required that...be not; is not to be 731 should 732 733 it is recommended that; ought to 734 should not 735 736 it is not recommended that; ought not to 737 _________________________________________________________ 738 739 Chapter 5. Terminology 740 741 For the purposes of this document, the following terms apply: 742 743 archLSB 744 The architectural part of the LSB Specification which 745 describes the specific parts of the interface that are 746 platform specific. The archLSB is complementary to the 747 gLSB. 748 749 Binary Standard 750 The total set of interfaces that are available to be 751 used in the compiled binary code of a conforming 752 application. 753 754 gLSB 755 The common part of the LSB Specification that describes 756 those parts of the interface that remain constant 757 across all hardware implementations of the LSB. 758 759 implementation-defined 760 Describes a value or behavior that is not defined by 761 this document but is selected by an implementor. The 762 value or behavior may vary among implementations that 763 conform to this document. An application should not 764 rely on the existence of the value or behavior. An 765 application that relies on such a value or behavior 766 cannot be assured to be portable across conforming 767 implementations. The implementor shall document such a 768 value or behavior so that it can be used correctly by 769 an application. 770 771 Shell Script 772 A file that is read by an interpreter (e.g., awk). The 773 first line of the shell script includes a reference to 774 its interpreter binary. 775 776 Source Standard 777 The set of interfaces that are available to be used in 778 the source code of a conforming application. 779 780 undefined 781 Describes the nature of a value or behavior not defined 782 by this document which results from use of an invalid 783 program construct or invalid data input. The value or 784 behavior may vary among implementations that conform to 785 this document. An application should not rely on the 786 existence or validity of the value or behavior. An 787 application that relies on any particular value or 788 behavior cannot be assured to be portable across 789 conforming implementations. 790 791 unspecified 792 Describes the nature of a value or behavior not 793 specified by this document which results from use of a 794 valid program construct or valid data input. The value 795 or behavior may vary among implementations that conform 796 to this document. An application should not rely on the 797 existence or validity of the value or behavior. An 798 application that relies on any particular value or 799 behavior cannot be assured to be portable across 800 conforming implementations. 801 802 Other terms and definitions used in this document shall have 803 the same meaning as defined in Chapter 3 of the Base 804 Definitions volume of ISO POSIX (2003). 805 _________________________________________________________ 806 807 Chapter 6. Documentation Conventions 808 809 Throughout this document, the following typographic 810 conventions are used: 811 812 function() 813 814 the name of a function 815 command 816 817 the name of a command or utility 818 CONSTANT 819 820 a constant value 821 parameter 822 823 a parameter 824 variable 825 826 a variable 827 828 Throughout this specification, several tables of interfaces 829 are presented. Each entry in these tables has the following 830 format: 831 832 name 833 834 the name of the interface 835 (symver) 836 837 An optional symbol version identifier, if required. 838 [refno] 839 840 A reference number indexing the table of referenced 841 specifications that follows this table. 842 843 For example, 844 845 forkpty(GLIBC_2.0) [SUSv3] 846 847 refers to the interface named forkpty() with symbol version 848 GLIBC_2.0 that is defined in the SUSv3 reference. 849 850 Note: Symbol versions are defined in the architecture 851 specific supplements only. 852 _________________________________________________________ 853 854 Chapter 7. Relationship To ISO/IEC 9945 POSIX 855 856 This specification includes many interfaces described in ISO 857 POSIX (2003). Unless otherwise specified, such interfaces 858 should behave exactly as described in that specification. Any 859 conflict between the requirements described here and the ISO 860 POSIX (2003) standard is unintentional, except as explicitly 861 noted otherwise. 862 863 Note: In addition to the differences noted inline in this 864 specification, PDTR 24715 has extracted the differences 865 between this specification and ISO POSIX (2003) into a 866 single place. It is the long term plan of the Free 867 Standards Group to converge the LSB Core Specification with 868 ISO/IEC 9945 POSIX. 869 870 The LSB Specification Authority is responsible for deciding 871 the meaning of conformance to normative referenced standards 872 in the LSB context. Problem Reports regarding underlying or 873 referenced standards in any other context will be referred to 874 the relevant maintenance body for that standard. 875 _________________________________________________________ 876 877 Chapter 8. Relationship To Other Free Standards Group Specifications 878 879 The LSB is the base for several other specification projects 880 under the umbrella of the Free Standards Group (FSG). This 881 specification is the foundation, and other specifications 882 build on the interfaces defined here. However, beyond those 883 specifications listed as Normative References, this 884 specification has no dependencies on other FSG projects. 885 886 II. Base Libraries 887 888 Table of Contents 889 9. Base Libraries 890 891 9.1. Introduction 892 9.2. Program Interpreter 893 9.3. Interfaces for libc 894 895 9.3.1. RPC 896 9.3.2. System Calls 897 9.3.3. Standard I/O 898 9.3.4. Signal Handling 899 9.3.5. Localization Functions 900 9.3.6. Socket Interface 901 9.3.7. Wide Characters 902 9.3.8. String Functions 903 9.3.9. IPC Functions 904 9.3.10. Regular Expressions 905 9.3.11. Character Type Functions 906 9.3.12. Time Manipulation 907 9.3.13. Terminal Interface Functions 908 9.3.14. System Database Interface 909 9.3.15. Language Support 910 9.3.16. Large File Support 911 9.3.17. Standard Library 912 913 9.4. Data Definitions for libc 914 915 9.4.1. arpa/inet.h 916 9.4.2. assert.h 917 9.4.3. ctype.h 918 9.4.4. dirent.h 919 9.4.5. err.h 920 9.4.6. errno.h 921 9.4.7. fcntl.h 922 9.4.8. fmtmsg.h 923 9.4.9. fnmatch.h 924 9.4.10. ftw.h 925 9.4.11. getopt.h 926 9.4.12. glob.h 927 9.4.13. grp.h 928 9.4.14. iconv.h 929 9.4.15. inttypes.h 930 9.4.16. langinfo.h 931 9.4.17. libgen.h 932 9.4.18. libintl.h 933 9.4.19. limits.h 934 9.4.20. locale.h 935 9.4.21. monetary.h 936 9.4.22. net/if.h 937 9.4.23. netdb.h 938 9.4.24. netinet/in.h 939 9.4.25. netinet/ip.h 940 9.4.26. netinet/tcp.h 941 9.4.27. netinet/udp.h 942 9.4.28. nl_types.h 943 9.4.29. poll.h 944 9.4.30. pty.h 945 9.4.31. pwd.h 946 9.4.32. regex.h 947 9.4.33. rpc/auth.h 948 9.4.34. rpc/clnt.h 949 9.4.35. rpc/pmap_clnt.h 950 9.4.36. rpc/rpc_msg.h 951 9.4.37. rpc/svc.h 952 9.4.38. rpc/types.h 953 9.4.39. rpc/xdr.h 954 9.4.40. sched.h 955 9.4.41. search.h 956 9.4.42. setjmp.h 957 9.4.43. signal.h 958 9.4.44. stddef.h 959 9.4.45. stdio.h 960 9.4.46. stdlib.h 961 9.4.47. string.h 962 9.4.48. sys/file.h 963 9.4.49. sys/ioctl.h 964 9.4.50. sys/ipc.h 965 9.4.51. sys/mman.h 966 9.4.52. sys/msg.h 967 9.4.53. sys/param.h 968 9.4.54. sys/poll.h 969 9.4.55. sys/resource.h 970 9.4.56. sys/sem.h 971 9.4.57. sys/shm.h 972 9.4.58. sys/socket.h 973 9.4.59. sys/stat.h 974 9.4.60. sys/statvfs.h 975 9.4.61. sys/time.h 976 9.4.62. sys/timeb.h 977 9.4.63. sys/times.h 978 9.4.64. sys/types.h 979 9.4.65. sys/uio.h 980 9.4.66. sys/un.h 981 9.4.67. sys/utsname.h 982 9.4.68. sys/wait.h 983 9.4.69. syslog.h 984 9.4.70. termios.h 985 9.4.71. time.h 986 9.4.72. ucontext.h 987 9.4.73. ulimit.h 988 9.4.74. unistd.h 989 9.4.75. utime.h 990 9.4.76. utmp.h 991 9.4.77. utmpx.h 992 9.4.78. wchar.h 993 9.4.79. wctype.h 994 9.4.80. wordexp.h 995 996 9.5. Interface Definitions for libc 997 998 _IO_feof -- alias for feof 999 _IO_getc -- alias for getc 1000 _IO_putc -- alias for putc 1001 _IO_puts -- alias for puts 1002 __assert_fail -- abort the program after false 1003 assertion 1004 1005 __ctype_b_loc -- accessor function for __ctype_b 1006 array for ctype functions 1007 1008 __ctype_get_mb_cur_max -- maximum length of a 1009 multibyte character in the current locale 1010 1011 __ctype_tolower_loc -- accessor function for 1012 __ctype_b_tolower array for ctype tolower() 1013 function 1014 1015 __ctype_toupper_loc -- accessor function for 1016 __ctype_b_toupper() array for ctype 1017 toupper() function 1018 1019 __cxa_atexit -- register a function to be called by 1020 exit or when a shared library is unloaded 1021 1022 __daylight -- daylight savings time flag 1023 __environ -- alias for environ - user environment 1024 __errno_location -- address of errno variable 1025 __fpending -- returns in bytes the amount of output 1026 pending on a stream 1027 1028 __getpagesize -- alias for getpagesize - get 1029 current page size 1030 1031 __getpgid -- get the process group id 1032 __h_errno_location -- address of h_errno variable 1033 __isinf -- test for infinity 1034 __isinff -- test for infinity 1035 __isinfl -- test for infinity 1036 __isnan -- test for infinity 1037 __isnanf -- test for infinity 1038 __isnanl -- test for infinity 1039 __libc_current_sigrtmax -- return number of 1040 available real-time signal with lowest 1041 priority 1042 1043 __libc_current_sigrtmin -- return number of 1044 available real-time signal with highest 1045 priority 1046 1047 __libc_start_main -- initialization routine 1048 __lxstat -- inline wrapper around call to lxstat 1049 __mempcpy -- copy given number of bytes of source 1050 to destination 1051 1052 __rawmemchr -- scan memory 1053 __register_atfork -- alias for register_atfork 1054 __sigsetjmp -- save stack context for non-local 1055 goto 1056 1057 __stpcpy -- alias for stpcpy 1058 __strdup -- alias for strdup 1059 __strtod_internal -- underlying function for strtod 1060 __strtof_internal -- underlying function for strtof 1061 __strtok_r -- alias for strtok_r 1062 __strtol_internal -- alias for strtol 1063 __strtold_internal -- underlying function for 1064 strtold 1065 1066 __strtoll_internal -- underlying function for 1067 strtoll 1068 1069 __strtoul_internal -- underlying function for 1070 strtoul 1071 1072 __strtoull_internal -- underlying function for 1073 strtoull 1074 1075 __sysconf -- get configuration information at 1076 runtime 1077 1078 __sysv_signal -- signal handling 1079 __timezone -- global variable containing timezone 1080 __tzname -- global variable containing the timezone 1081 __wcstod_internal -- underlying function for wcstod 1082 __wcstof_internal -- underlying function for wcstof 1083 __wcstol_internal -- underlying function for wcstol 1084 __wcstold_internal -- underlying function for 1085 wcstold 1086 1087 __wcstoul_internal -- underlying function for 1088 wcstoul 1089 1090 __xmknod -- make block or character special file 1091 __xstat -- get File Status 1092 __xstat64 -- get File Status 1093 _environ -- alias for environ - user environment 1094 _nl_msg_cat_cntr -- new catalog load counter 1095 _sys_errlist -- array containing the "C" locale 1096 strings used by strerror() 1097 1098 _sys_siglist -- array containing the names of the 1099 signal names 1100 1101 acct -- switch process accounting on or off 1102 adjtime -- correct the time to allow 1103 synchronization of the system clock 1104 1105 asprintf -- write formatted output to a dynamically 1106 allocated string 1107 1108 bind_textdomain_codeset -- specify encoding for 1109 message retrieval 1110 1111 bindresvport -- bind socket to privileged IP port 1112 bindtextdomain -- specify the location of a message 1113 catalog 1114 1115 cfmakeraw -- get and set terminal attributes 1116 cfsetspeed -- set terminal input and output data 1117 rate 1118 1119 daemon -- run in the background 1120 dcgettext -- perform domain and category specific 1121 lookup in message catalog 1122 1123 dcngettext -- perform domain and category specific 1124 lookup in message catalog with plural 1125 1126 dgettext -- perform lookup in message catalog for 1127 the current LC_MESSAGES locale 1128 1129 dngettext -- perform lookup in message catalog for 1130 the current locale 1131 1132 duplocale -- provide new handle for selection of 1133 locale 1134 1135 err -- display formatted error messages 1136 error -- print error message 1137 errx -- display formatted error message and exit 1138 fcntl -- file control 1139 fflush_unlocked -- non thread safe fflush 1140 fgetwc_unlocked -- non thread safe fgetwc 1141 flock -- apply or remove an advisory lock on an 1142 open file 1143 1144 freelocale -- free a locale object 1145 fscanf -- convert formatted input 1146 fwscanf -- convert formatted input 1147 getgrouplist -- get network group entry 1148 getloadavg -- get system load averages 1149 getopt -- parse command line options 1150 getopt_long -- parse command line options 1151 getopt_long_only -- parse command line options 1152 getsockopt -- get socket options 1153 gettext -- search message catalogs for a string 1154 getutent -- access user accounting database entries 1155 1156 getutent_r -- access user accounting database 1157 entries 1158 1159 glob64 -- find pathnames matching a pattern (Large 1160 File Support) 1161 1162 globfree64 -- free memory from glob64() (Large File 1163 Support) 1164 1165 initgroups -- initialize the supplementary group 1166 access list 1167 1168 ioctl -- control device 1169 sockio -- socket ioctl commands 1170 ttyio -- tty ioctl commands 1171 kill -- send a signal 1172 link -- create a link to a file 1173 mbsnrtowcs -- convert a multibyte string to a wide 1174 character string 1175 1176 memmem -- locate bytes 1177 memrchr -- scan memory for a character 1178 newlocale -- allocate a locale object 1179 ngettext -- search message catalogs for plural 1180 string 1181 1182 pmap_getport -- find the port number assigned to a 1183 service registered with a portmapper. 1184 1185 pmap_set -- establishes mapping to machine's RPC 1186 Bind service. 1187 1188 pmap_unset -- destroys RPC Binding 1189 psignal -- print signal message 1190 regexec -- regular expression matching 1191 scanf -- convert formatted input 1192 setbuffer -- stream buffering operation 1193 setgroups -- set list of supplementary group IDs 1194 sethostname -- set host name 1195 setsockopt -- set socket options 1196 setutent -- access user accounting database entries 1197 sigandset -- build a new signal set by combining 1198 the two input sets using logical AND 1199 1200 sigisemptyset -- check for empty signal set 1201 sigorset -- build a new signal set by combining the 1202 two input sets using logical OR 1203 1204 sigreturn -- return from signal handler and cleanup 1205 stack frame 1206 1207 sscanf -- convert formatted input 1208 stime -- set time 1209 stpcpy -- copy a string returning a pointer to its 1210 end 1211 1212 stpncpy -- copy a fixed-size string, returning a 1213 pointer to its end 1214 1215 strcasestr -- locate a substring ignoring case 1216 strerror_r -- reentrant version of strerror 1217 strndup -- return a malloc'd copy of at most the 1218 specified number of bytes of a string 1219 1220 strnlen -- determine the length of a fixed-size 1221 string 1222 1223 strptime -- parse a time string 1224 strsep -- extract token from string 1225 strsignal -- return string describing signal 1226 strtoq -- convert string value to a long or quad_t 1227 integer 1228 1229 strtouq -- convert a string to an unsigned long 1230 long 1231 1232 svc_register -- register Remote Procedure Call 1233 interface 1234 1235 svc_run -- waits for RPC requests to arrive and 1236 calls service procedure 1237 1238 svc_sendreply -- called by RPC service's dispatch 1239 routine 1240 1241 svctcp_create -- create a TCP/IP-based RPC service 1242 transport 1243 1244 svcudp_create -- create a UDP-based RPC service 1245 transport 1246 1247 swscanf -- convert formatted input 1248 system -- execute a shell command 1249 textdomain -- set the current default message 1250 domain 1251 1252 unlink -- remove a directory entry 1253 uselocale -- set locale for thread 1254 utmpname -- set user accounting database 1255 vasprintf -- write formatted output to a 1256 dynamically allocated string 1257 1258 vdprintf -- write formatted output to a file 1259 descriptor 1260 1261 verrx -- display formatted error message and exit 1262 vfscanf -- convert formatted input 1263 vfwscanf -- convert formatted input 1264 vscanf -- convert formatted input 1265 vsscanf -- convert formatted input 1266 vswscanf -- convert formatted input 1267 vsyslog -- log to system log 1268 vwscanf -- convert formatted input 1269 wait4 -- wait for process termination, BSD style 1270 waitpid -- wait for child process 1271 warn -- formatted error messages 1272 warnx -- formatted error messages 1273 wcpcpy -- copy a wide character string, returning a 1274 pointer to its end 1275 1276 wcpncpy -- copy a fixed-size string of wide 1277 characters, returning a pointer to its end 1278 1279 wcscasecmp -- compare two wide-character strings, 1280 ignoring case 1281 1282 wcsdup -- duplicate a wide-character string 1283 wcsncasecmp -- compare two fixed-size 1284 wide-character strings, ignoring case 1285 1286 wcsnlen -- determine the length of a fixed-size 1287 wide-character string 1288 1289 wcsnrtombs -- convert a wide character string to a 1290 multi-byte string 1291 1292 wcstoq -- convert wide string to long long int 1293 representation 1294 1295 wcstouq -- convert wide string to unsigned long 1296 long int representation 1297 1298 wscanf -- convert formatted input 1299 xdr_u_int -- library routines for external data 1300 representation 1301 1302 9.6. Interfaces for libm 1303 1304 9.6.1. Math 1305 1306 9.7. Data Definitions for libm 1307 1308 9.7.1. complex.h 1309 9.7.2. fenv.h 1310 9.7.3. math.h 1311 1312 9.8. Interface Definitions for libm 1313 1314 __fpclassify -- Classify real floating type 1315 __fpclassifyf -- Classify real floating type 1316 1317 9.9. Interfaces for libpthread 1318 1319 9.9.1. Realtime Threads 1320 9.9.2. Advanced Realtime Threads 1321 9.9.3. Posix Threads 1322 9.9.4. Thread aware versions of libc interfaces 1323 1324 9.10. Data Definitions for libpthread 1325 1326 9.10.1. pthread.h 1327 9.10.2. semaphore.h 1328 1329 9.11. Interface Definitions for libpthread 1330 1331 _pthread_cleanup_pop -- establish cancellation 1332 handlers 1333 1334 _pthread_cleanup_push -- establish cancellation 1335 handlers 1336 1337 9.12. Interfaces for libgcc_s 1338 1339 9.12.1. Unwind Library 1340 1341 9.13. Data Definitions for libgcc_s 1342 1343 9.13.1. unwind.h 1344 1345 9.14. Interfaces for libdl 1346 1347 9.14.1. Dynamic Loader 1348 1349 9.15. Data Definitions for libdl 1350 1351 9.15.1. dlfcn.h 1352 1353 9.16. Interface Definitions for libdl 1354 1355 dladdr -- find the shared object containing a given 1356 address 1357 1358 dlopen -- open dynamic object 1359 dlsym -- obtain the address of a symbol from a 1360 dlopen object 1361 1362 9.17. Interfaces for librt 1363 1364 9.17.1. Shared Memory Objects 1365 9.17.2. Clock 1366 9.17.3. Timers 1367 1368 9.18. Interfaces for libcrypt 1369 1370 9.18.1. Encryption 1371 1372 9.19. Interfaces for libpam 1373 1374 9.19.1. Pluggable Authentication API 1375 1376 9.20. Data Definitions for libpam 1377 1378 9.20.1. security/pam_appl.h 1379 1380 9.21. Interface Definitions for libpam 1381 1382 pam_acct_mgmt -- establish the status of a user's 1383 account 1384 1385 pam_authenticate -- authenticate the user 1386 pam_chauthtok -- change the authentication token 1387 for a given user 1388 1389 pam_close_session -- indicate that an authenticated 1390 session has ended 1391 1392 pam_end -- terminate the use of the PAM library 1393 pam_fail_delay -- specify delay time to use on 1394 authentication error 1395 1396 pam_get_item -- obtain the value of the indicated 1397 item. 1398 1399 pam_getenvlist -- returns a pointer to the complete 1400 PAM environment. 1401 1402 pam_open_session -- indicate session has started 1403 pam_set_item -- (re)set the value of an item. 1404 pam_setcred -- set the module-specific credentials 1405 of the user 1406 1407 pam_start -- initialize the PAM library 1408 pam_strerror -- returns a string describing the PAM 1409 error 1410 _________________________________________________________ 1411 1412 Chapter 9. Base Libraries 1413 1414 9.1. Introduction 1415 1416 An LSB-conforming implementation shall support the following 1417 base libraries which provide interfaces for accessing the 1418 operating system, processor and other hardware in the system. 1419 1420 * libc 1421 * libm 1422 * libgcc_s 1423 * libdl 1424 * librt 1425 * libcrypt 1426 * libpam 1427 1428 There are three main parts to the definition of each of these 1429 libraries. 1430 1431 The "Interfaces" section defines the required library name and 1432 version, and the required public symbols (interfaces and 1433 global data), as well as symbol versions, if any. 1434 1435 The "Interface Definitions" section provides complete or 1436 partial definitions of certain interfaces where either this 1437 specification is the source specification, or where there are 1438 variations from the source specification. If an interface 1439 definition requires one or more header files, one of those 1440 headers shall include the function prototype for the 1441 interface. 1442 1443 For source definitions of interfaces which include a reference 1444 to a header file, the contents of such header files form a 1445 part of the specification. The "Data Definitions" section 1446 provides the binary-level details for the header files from 1447 the source specifications, such as values for macros and 1448 enumerated types, as well as structure layouts, sizes and 1449 padding, etc. These data definitions, although presented in 1450 the form of header files for convenience, should not be taken 1451 a representing complete header files, as they are a supplement 1452 to the source specifications. Application developers should 1453 follow the guidelines of the source specifications when 1454 determining which header files need to be included to 1455 completely resolve all references. 1456 1457 Note: While the Data Definitions supplement the source 1458 specifications, this specification itself does not require 1459 conforming implementations to supply any header files. 1460 _________________________________________________________ 1461 1462 9.2. Program Interpreter 1463 1464 The Program Interpreter is specified in the appropriate 1465 architecture specific supplement. 1466 _________________________________________________________ 1467 1468 9.3. Interfaces for libc 1469 1470 Table 9-1 defines the library name and shared object name for 1471 the libc library 1472 1473 Table 9-1. libc Definition 1474 Library: libc 1475 SONAME: See archLSB. 1476 1477 The behavior of the interfaces in this library is specified by 1478 the following specifications: 1479 1480 [LFS] Large File Support 1481 [LSB] This Specification 1482 [SUSv2] SUSv2 1483 [SUSv3] ISO POSIX (2003) 1484 [SVID.3] SVID Issue 3 1485 [SVID.4] SVID Issue 4 1486 _________________________________________________________ 1487 1488 9.3.1. RPC 1489 _________________________________________________________ 1490 1491 9.3.1.1. Interfaces for RPC 1492 1493 An LSB conforming implementation shall provide the generic 1494 functions for RPC specified in Table 9-2, with the full 1495 mandatory functionality as described in the referenced 1496 underlying specification. 1497 1498 Table 9-2. libc - RPC Function Interfaces 1499 authnone_create [SVID.4] clnt_create [SVID.4] 1500 clnt_pcreateerror [SVID.4] clnt_perrno [SVID.4] 1501 clnt_perror [SVID.4] clnt_spcreateerror [SVID.4] clnt_sperrno 1502 [SVID.4] clnt_sperror [SVID.4] 1503 key_decryptsession [SVID.3] pmap_getport [LSB] pmap_set [LSB] 1504 pmap_unset [LSB] 1505 svc_getreqset [SVID.3] svc_register [LSB] svc_run [LSB] 1506 svc_sendreply [LSB] 1507 svcerr_auth [SVID.3] svcerr_decode [SVID.3] svcerr_noproc 1508 [SVID.3] svcerr_noprog [SVID.3] 1509 svcerr_progvers [SVID.3] svcerr_systemerr [SVID.3] 1510 svcerr_weakauth [SVID.3] svctcp_create [LSB] 1511 svcudp_create [LSB] xdr_accepted_reply [SVID.3] xdr_array 1512 [SVID.3] xdr_bool [SVID.3] 1513 xdr_bytes [SVID.3] xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] 1514 xdr_char [SVID.3] 1515 xdr_double [SVID.3] xdr_enum [SVID.3] xdr_float [SVID.3] 1516 xdr_free [SVID.3] 1517 xdr_int [SVID.3] xdr_long [SVID.3] xdr_opaque [SVID.3] 1518 xdr_opaque_auth [SVID.3] 1519 xdr_pointer [SVID.3] xdr_reference [SVID.3] xdr_rejected_reply 1520 [SVID.3] xdr_replymsg [SVID.3] 1521 xdr_short [SVID.3] xdr_string [SVID.3] xdr_u_char [SVID.3] 1522 xdr_u_int [LSB] 1523 xdr_u_long [SVID.3] xdr_u_short [SVID.3] xdr_union [SVID.3] 1524 xdr_vector [SVID.3] 1525 xdr_void [SVID.3] xdr_wrapstring [SVID.3] xdrmem_create 1526 [SVID.3] xdrrec_create [SVID.3] 1527 xdrrec_eof [SVID.3] 1528 _________________________________________________________ 1529 1530 9.3.2. System Calls 1531 _________________________________________________________ 1532 1533 9.3.2.1. Interfaces for System Calls 1534 1535 An LSB conforming implementation shall provide the generic 1536 functions for System Calls specified in Table 9-3, with the 1537 full mandatory functionality as described in the referenced 1538 underlying specification. 1539 1540 Table 9-3. libc - System Calls Function Interfaces 1541 __fxstat [LSB] __getpgid [LSB] __lxstat [LSB] __xmknod [LSB] 1542 __xstat [LSB] access [SUSv3] acct [LSB] alarm [SUSv3] 1543 brk [SUSv2] chdir [SUSv3] chmod [SUSv3] chown [SUSv3] 1544 chroot [SUSv2] clock [SUSv3] close [SUSv3] closedir [SUSv3] 1545 creat [SUSv3] dup [SUSv3] dup2 [SUSv3] execl [SUSv3] 1546 execle [SUSv3] execlp [SUSv3] execv [SUSv3] execve [SUSv3] 1547 execvp [SUSv3] exit [SUSv3] fchdir [SUSv3] fchmod [SUSv3] 1548 fchown [SUSv3] fcntl [LSB] fdatasync [SUSv3] flock [LSB] 1549 fork [SUSv3] fstatvfs [SUSv3] fsync [SUSv3] ftime [SUSv3] 1550 ftruncate [SUSv3] getcontext [SUSv3] getegid [SUSv3] geteuid 1551 [SUSv3] 1552 getgid [SUSv3] getgroups [SUSv3] getitimer [SUSv3] getloadavg 1553 [LSB] 1554 getpagesize [SUSv2] getpgid [SUSv3] getpgrp [SUSv3] getpid 1555 [SUSv3] 1556 getppid [SUSv3] getpriority [SUSv3] getrlimit [SUSv3] 1557 getrusage [SUSv3] 1558 getsid [SUSv3] getuid [SUSv3] getwd [SUSv3] initgroups [LSB] 1559 ioctl [LSB] kill [LSB] killpg [SUSv3] lchown [SUSv3] 1560 link [LSB] lockf [SUSv3] lseek [SUSv3] mkdir [SUSv3] 1561 mkfifo [SUSv3] mlock [SUSv3] mlockall [SUSv3] mmap [SUSv3] 1562 mprotect [SUSv3] msync [SUSv3] munlock [SUSv3] munlockall 1563 [SUSv3] 1564 munmap [SUSv3] nanosleep [SUSv3] nice [SUSv3] open [SUSv3] 1565 opendir [SUSv3] pathconf [SUSv3] pause [SUSv3] pipe [SUSv3] 1566 poll [SUSv3] read [SUSv3] readdir [SUSv3] readdir_r [SUSv3] 1567 readlink [SUSv3] readv [SUSv3] rename [SUSv3] rmdir [SUSv3] 1568 sbrk [SUSv2] sched_get_priority_max [SUSv3] 1569 sched_get_priority_min [SUSv3] sched_getparam [SUSv3] 1570 sched_getscheduler [SUSv3] sched_rr_get_interval [SUSv3] 1571 sched_setparam [SUSv3] sched_setscheduler [SUSv3] 1572 sched_yield [SUSv3] select [SUSv3] setcontext [SUSv3] setegid 1573 [SUSv3] 1574 seteuid [SUSv3] setgid [SUSv3] setitimer [SUSv3] setpgid 1575 [SUSv3] 1576 setpgrp [SUSv3] setpriority [SUSv3] setregid [SUSv3] setreuid 1577 [SUSv3] 1578 setrlimit [SUSv3] setrlimit64 [LFS] setsid [SUSv3] setuid 1579 [SUSv3] 1580 sleep [SUSv3] statvfs [SUSv3] stime [LSB] symlink [SUSv3] 1581 sync [SUSv3] sysconf [SUSv3] time [SUSv3] times [SUSv3] 1582 truncate [SUSv3] ulimit [SUSv3] umask [SUSv3] uname [SUSv3] 1583 unlink [LSB] utime [SUSv3] utimes [SUSv3] vfork [SUSv3] 1584 wait [SUSv3] wait4 [LSB] waitpid [LSB] write [SUSv3] 1585 writev [SUSv3] 1586 _________________________________________________________ 1587 1588 9.3.3. Standard I/O 1589 _________________________________________________________ 1590 1591 9.3.3.1. Interfaces for Standard I/O 1592 1593 An LSB conforming implementation shall provide the generic 1594 functions for Standard I/O specified in Table 9-4, with the 1595 full mandatory functionality as described in the referenced 1596 underlying specification. 1597 1598 Table 9-4. libc - Standard I/O Function Interfaces 1599 _IO_feof [LSB] _IO_getc [LSB] _IO_putc [LSB] _IO_puts [LSB] 1600 asprintf [LSB] clearerr [SUSv3] ctermid [SUSv3] fclose [SUSv3] 1601 fdopen [SUSv3] feof [SUSv3] ferror [SUSv3] fflush [SUSv3] 1602 fflush_unlocked [LSB] fgetc [SUSv3] fgetpos [SUSv3] fgets 1603 [SUSv3] 1604 fgetwc_unlocked [LSB] fileno [SUSv3] flockfile [SUSv3] fopen 1605 [SUSv3] 1606 fprintf [SUSv3] fputc [SUSv3] fputs [SUSv3] fread [SUSv3] 1607 freopen [SUSv3] fscanf [LSB] fseek [SUSv3] fseeko [SUSv3] 1608 fsetpos [SUSv3] ftell [SUSv3] ftello [SUSv3] fwrite [SUSv3] 1609 getc [SUSv3] getc_unlocked [SUSv3] getchar [SUSv3] 1610 getchar_unlocked [SUSv3] 1611 getw [SUSv2] pclose [SUSv3] popen [SUSv3] printf [SUSv3] 1612 putc [SUSv3] putc_unlocked [SUSv3] putchar [SUSv3] 1613 putchar_unlocked [SUSv3] 1614 puts [SUSv3] putw [SUSv2] remove [SUSv3] rewind [SUSv3] 1615 rewinddir [SUSv3] scanf [LSB] seekdir [SUSv3] setbuf [SUSv3] 1616 setbuffer [LSB] setvbuf [SUSv3] snprintf [SUSv3] sprintf 1617 [SUSv3] 1618 sscanf [LSB] telldir [SUSv3] tempnam [SUSv3] ungetc [SUSv3] 1619 vasprintf [LSB] vdprintf [LSB] vfprintf [SUSv3] vprintf 1620 [SUSv3] 1621 vsnprintf [SUSv3] vsprintf [SUSv3] 1622 1623 An LSB conforming implementation shall provide the generic 1624 data interfaces for Standard I/O specified in Table 9-5, with 1625 the full mandatory functionality as described in the 1626 referenced underlying specification. 1627 1628 Table 9-5. libc - Standard I/O Data Interfaces 1629 stderr [SUSv3] stdin [SUSv3] stdout [SUSv3] 1630 _________________________________________________________ 1631 1632 9.3.4. Signal Handling 1633 _________________________________________________________ 1634 1635 9.3.4.1. Interfaces for Signal Handling 1636 1637 An LSB conforming implementation shall provide the generic 1638 functions for Signal Handling specified in Table 9-6, with the 1639 full mandatory functionality as described in the referenced 1640 underlying specification. 1641 1642 Table 9-6. libc - Signal Handling Function Interfaces 1643 __libc_current_sigrtmax [LSB] __libc_current_sigrtmin [LSB] 1644 __sigsetjmp [LSB] __sysv_signal [LSB] 1645 bsd_signal [SUSv3] psignal [LSB] raise [SUSv3] sigaction 1646 [SUSv3] 1647 sigaddset [SUSv3] sigaltstack [SUSv3] sigandset [LSB] 1648 sigdelset [SUSv3] 1649 sigemptyset [SUSv3] sigfillset [SUSv3] sighold [SUSv3] 1650 sigignore [SUSv3] 1651 siginterrupt [SUSv3] sigisemptyset [LSB] sigismember [SUSv3] 1652 siglongjmp [SUSv3] 1653 signal [SUSv3] sigorset [LSB] sigpause [SUSv3] sigpending 1654 [SUSv3] 1655 sigprocmask [SUSv3] sigqueue [SUSv3] sigrelse [SUSv3] 1656 sigreturn [LSB] 1657 sigset [SUSv3] sigsuspend [SUSv3] sigtimedwait [SUSv3] sigwait 1658 [SUSv3] 1659 sigwaitinfo [SUSv3] 1660 1661 An LSB conforming implementation shall provide the generic 1662 data interfaces for Signal Handling specified in Table 9-7, 1663 with the full mandatory functionality as described in the 1664 referenced underlying specification. 1665 1666 Table 9-7. libc - Signal Handling Data Interfaces 1667 _sys_siglist [LSB] 1668 _________________________________________________________ 1669 1670 9.3.5. Localization Functions 1671 _________________________________________________________ 1672 1673 9.3.5.1. Interfaces for Localization Functions 1674 1675 An LSB conforming implementation shall provide the generic 1676 functions for Localization Functions specified in Table 9-8, 1677 with the full mandatory functionality as described in the 1678 referenced underlying specification. 1679 1680 Table 9-8. libc - Localization Functions Function Interfaces 1681 bind_textdomain_codeset [LSB] bindtextdomain [LSB] catclose 1682 [SUSv3] catgets [SUSv3] 1683 catopen [SUSv3] dcgettext [LSB] dcngettext [LSB] dgettext 1684 [LSB] 1685 dngettext [LSB] duplocale(GLIBC_2.3) [LSB] 1686 freelocale(GLIBC_2.3) [LSB] gettext [LSB] 1687 iconv [SUSv3] iconv_close [SUSv3] iconv_open [SUSv3] 1688 localeconv [SUSv3] 1689 newlocale(GLIBC_2.3) [LSB] ngettext [LSB] nl_langinfo [SUSv3] 1690 setlocale [SUSv3] 1691 textdomain [LSB] uselocale(GLIBC_2.3) [LSB] 1692 1693 An LSB conforming implementation shall provide the generic 1694 data interfaces for Localization Functions specified in Table 1695 9-9, with the full mandatory functionality as described in the 1696 referenced underlying specification. 1697 1698 Table 9-9. libc - Localization Functions Data Interfaces 1699 _nl_msg_cat_cntr [LSB] 1700 _________________________________________________________ 1701 1702 9.3.6. Socket Interface 1703 _________________________________________________________ 1704 1705 9.3.6.1. Interfaces for Socket Interface 1706 1707 An LSB conforming implementation shall provide the generic 1708 functions for Socket Interface specified in Table 9-10, with 1709 the full mandatory functionality as described in the 1710 referenced underlying specification. 1711 1712 Table 9-10. libc - Socket Interface Function Interfaces 1713 __h_errno_location [LSB] accept [SUSv3] bind [SUSv3] 1714 bindresvport [LSB] 1715 connect [SUSv3] gethostid [SUSv3] gethostname [SUSv3] 1716 getpeername [SUSv3] 1717 getsockname [SUSv3] getsockopt [LSB] if_freenameindex [SUSv3] 1718 if_indextoname [SUSv3] 1719 if_nameindex [SUSv3] if_nametoindex [SUSv3] listen [SUSv3] 1720 recv [SUSv3] 1721 recvfrom [SUSv3] recvmsg [SUSv3] send [SUSv3] sendmsg [SUSv3] 1722 sendto [SUSv3] setsockopt [LSB] shutdown [SUSv3] sockatmark 1723 [SUSv3] 1724 socket [SUSv3] socketpair [SUSv3] 1725 _________________________________________________________ 1726 1727 9.3.7. Wide Characters 1728 _________________________________________________________ 1729 1730 9.3.7.1. Interfaces for Wide Characters 1731 1732 An LSB conforming implementation shall provide the generic 1733 functions for Wide Characters specified in Table 9-11, with 1734 the full mandatory functionality as described in the 1735 referenced underlying specification. 1736 1737 Table 9-11. libc - Wide Characters Function Interfaces 1738 __wcstod_internal [LSB] __wcstof_internal [LSB] 1739 __wcstol_internal [LSB] __wcstold_internal [LSB] 1740 __wcstoul_internal [LSB] btowc [SUSv3] fgetwc [SUSv3] fgetws 1741 [SUSv3] 1742 fputwc [SUSv3] fputws [SUSv3] fwide [SUSv3] fwprintf [SUSv3] 1743 fwscanf [LSB] getwc [SUSv3] getwchar [SUSv3] mblen [SUSv3] 1744 mbrlen [SUSv3] mbrtowc [SUSv3] mbsinit [SUSv3] mbsnrtowcs 1745 [LSB] 1746 mbsrtowcs [SUSv3] mbstowcs [SUSv3] mbtowc [SUSv3] putwc 1747 [SUSv3] 1748 putwchar [SUSv3] swprintf [SUSv3] swscanf [LSB] towctrans 1749 [SUSv3] 1750 towlower [SUSv3] towupper [SUSv3] ungetwc [SUSv3] vfwprintf 1751 [SUSv3] 1752 vfwscanf [LSB] vswprintf [SUSv3] vswscanf [LSB] vwprintf 1753 [SUSv3] 1754 vwscanf [LSB] wcpcpy [LSB] wcpncpy [LSB] wcrtomb [SUSv3] 1755 wcscasecmp [LSB] wcscat [SUSv3] wcschr [SUSv3] wcscmp [SUSv3] 1756 wcscoll [SUSv3] wcscpy [SUSv3] wcscspn [SUSv3] wcsdup [LSB] 1757 wcsftime [SUSv3] wcslen [SUSv3] wcsncasecmp [LSB] wcsncat 1758 [SUSv3] 1759 wcsncmp [SUSv3] wcsncpy [SUSv3] wcsnlen [LSB] wcsnrtombs [LSB] 1760 wcspbrk [SUSv3] wcsrchr [SUSv3] wcsrtombs [SUSv3] wcsspn 1761 [SUSv3] 1762 wcsstr [SUSv3] wcstod [SUSv3] wcstof [SUSv3] wcstoimax [SUSv3] 1763 wcstok [SUSv3] wcstol [SUSv3] wcstold [SUSv3] wcstoll [SUSv3] 1764 wcstombs [SUSv3] wcstoq [LSB] wcstoul [SUSv3] wcstoull [SUSv3] 1765 wcstoumax [SUSv3] wcstouq [LSB] wcswcs [SUSv3] wcswidth 1766 [SUSv3] 1767 wcsxfrm [SUSv3] wctob [SUSv3] wctomb [SUSv3] wctrans [SUSv3] 1768 wctype [SUSv3] wcwidth [SUSv3] wmemchr [SUSv3] wmemcmp [SUSv3] 1769 wmemcpy [SUSv3] wmemmove [SUSv3] wmemset [SUSv3] wprintf 1770 [SUSv3] 1771 wscanf [LSB] 1772 _________________________________________________________ 1773 1774 9.3.8. String Functions 1775 _________________________________________________________ 1776 1777 9.3.8.1. Interfaces for String Functions 1778 1779 An LSB conforming implementation shall provide the generic 1780 functions for String Functions specified in Table 9-12, with 1781 the full mandatory functionality as described in the 1782 referenced underlying specification. 1783 1784 Table 9-12. libc - String Functions Function Interfaces 1785 __mempcpy [LSB] __rawmemchr [LSB] __stpcpy [LSB] __strdup 1786 [LSB] 1787 __strtod_internal [LSB] __strtof_internal [LSB] __strtok_r 1788 [LSB] __strtol_internal [LSB] 1789 __strtold_internal [LSB] __strtoll_internal [LSB] 1790 __strtoul_internal [LSB] __strtoull_internal [LSB] 1791 bcmp [SUSv3] bcopy [SUSv3] bzero [SUSv3] ffs [SUSv3] 1792 index [SUSv3] memccpy [SUSv3] memchr [SUSv3] memcmp [SUSv3] 1793 memcpy [SUSv3] memmove [SUSv3] memrchr [LSB] memset [SUSv3] 1794 rindex [SUSv3] stpcpy [LSB] stpncpy [LSB] strcasecmp [SUSv3] 1795 strcasestr [LSB] strcat [SUSv3] strchr [SUSv3] strcmp [SUSv3] 1796 strcoll [SUSv3] strcpy [SUSv3] strcspn [SUSv3] strdup [SUSv3] 1797 strerror [SUSv3] strerror_r [LSB] strfmon [SUSv3] strftime 1798 [SUSv3] 1799 strlen [SUSv3] strncasecmp [SUSv3] strncat [SUSv3] strncmp 1800 [SUSv3] 1801 strncpy [SUSv3] strndup [LSB] strnlen [LSB] strpbrk [SUSv3] 1802 strptime [LSB] strrchr [SUSv3] strsep [LSB] strsignal [LSB] 1803 strspn [SUSv3] strstr [SUSv3] strtof [SUSv3] strtoimax [SUSv3] 1804 strtok [SUSv3] strtok_r [SUSv3] strtold [SUSv3] strtoll 1805 [SUSv3] 1806 strtoq [LSB] strtoull [SUSv3] strtoumax [SUSv3] strtouq [LSB] 1807 strxfrm [SUSv3] swab [SUSv3] 1808 _________________________________________________________ 1809 1810 9.3.9. IPC Functions 1811 _________________________________________________________ 1812 1813 9.3.9.1. Interfaces for IPC Functions 1814 1815 An LSB conforming implementation shall provide the generic 1816 functions for IPC Functions specified in Table 9-13, with the 1817 full mandatory functionality as described in the referenced 1818 underlying specification. 1819 1820 Table 9-13. libc - IPC Functions Function Interfaces 1821 ftok [SUSv3] msgctl [SUSv3] msgget [SUSv3] msgrcv [SUSv3] 1822 msgsnd [SUSv3] semctl [SUSv3] semget [SUSv3] semop [SUSv3] 1823 shmat [SUSv3] shmctl [SUSv3] shmdt [SUSv3] shmget [SUSv3] 1824 _________________________________________________________ 1825 1826 9.3.10. Regular Expressions 1827 _________________________________________________________ 1828 1829 9.3.10.1. Interfaces for Regular Expressions 1830 1831 An LSB conforming implementation shall provide the generic 1832 functions for Regular Expressions specified in Table 9-14, 1833 with the full mandatory functionality as described in the 1834 referenced underlying specification. 1835 1836 Table 9-14. libc - Regular Expressions Function Interfaces 1837 regcomp [SUSv3] regerror [SUSv3] regexec [LSB] regfree [SUSv3] 1838 _________________________________________________________ 1839 1840 9.3.11. Character Type Functions 1841 _________________________________________________________ 1842 1843 9.3.11.1. Interfaces for Character Type Functions 1844 1845 An LSB conforming implementation shall provide the generic 1846 functions for Character Type Functions specified in Table 1847 9-15, with the full mandatory functionality as described in 1848 the referenced underlying specification. 1849 1850 Table 9-15. libc - Character Type Functions Function 1851 Interfaces 1852 __ctype_b_loc(GLIBC_2.3) [LSB] __ctype_get_mb_cur_max [LSB] 1853 __ctype_tolower_loc(GLIBC_2.3) [LSB] 1854 __ctype_toupper_loc(GLIBC_2.3) [LSB] 1855 _tolower [SUSv3] _toupper [SUSv3] isalnum [SUSv3] isalpha 1856 [SUSv3] 1857 isascii [SUSv3] iscntrl [SUSv3] isdigit [SUSv3] isgraph 1858 [SUSv3] 1859 islower [SUSv3] isprint [SUSv3] ispunct [SUSv3] isspace 1860 [SUSv3] 1861 isupper [SUSv3] iswalnum [SUSv3] iswalpha [SUSv3] iswblank 1862 [SUSv3] 1863 iswcntrl [SUSv3] iswctype [SUSv3] iswdigit [SUSv3] iswgraph 1864 [SUSv3] 1865 iswlower [SUSv3] iswprint [SUSv3] iswpunct [SUSv3] iswspace 1866 [SUSv3] 1867 iswupper [SUSv3] iswxdigit [SUSv3] isxdigit [SUSv3] toascii 1868 [SUSv3] 1869 tolower [SUSv3] toupper [SUSv3] 1870 _________________________________________________________ 1871 1872 9.3.12. Time Manipulation 1873 _________________________________________________________ 1874 1875 9.3.12.1. Interfaces for Time Manipulation 1876 1877 An LSB conforming implementation shall provide the generic 1878 functions for Time Manipulation specified in Table 9-16, with 1879 the full mandatory functionality as described in the 1880 referenced underlying specification. 1881 1882 Table 9-16. libc - Time Manipulation Function Interfaces 1883 adjtime [LSB] asctime [SUSv3] asctime_r [SUSv3] ctime [SUSv3] 1884 ctime_r [SUSv3] difftime [SUSv3] gmtime [SUSv3] gmtime_r 1885 [SUSv3] 1886 localtime [SUSv3] localtime_r [SUSv3] mktime [SUSv3] tzset 1887 [SUSv3] 1888 ualarm [SUSv3] 1889 1890 An LSB conforming implementation shall provide the generic 1891 data interfaces for Time Manipulation specified in Table 9-17, 1892 with the full mandatory functionality as described in the 1893 referenced underlying specification. 1894 1895 Table 9-17. libc - Time Manipulation Data Interfaces 1896 __daylight [LSB] __timezone [LSB] __tzname [LSB] daylight 1897 [SUSv3] 1898 timezone [SUSv3] tzname [SUSv3] 1899 _________________________________________________________ 1900 1901 9.3.13. Terminal Interface Functions 1902 _________________________________________________________ 1903 1904 9.3.13.1. Interfaces for Terminal Interface Functions 1905 1906 An LSB conforming implementation shall provide the generic 1907 functions for Terminal Interface Functions specified in Table 1908 9-18, with the full mandatory functionality as described in 1909 the referenced underlying specification. 1910 1911 Table 9-18. libc - Terminal Interface Functions Function 1912 Interfaces 1913 cfgetispeed [SUSv3] cfgetospeed [SUSv3] cfmakeraw [LSB] 1914 cfsetispeed [SUSv3] 1915 cfsetospeed [SUSv3] cfsetspeed [LSB] tcdrain [SUSv3] tcflow 1916 [SUSv3] 1917 tcflush [SUSv3] tcgetattr [SUSv3] tcgetpgrp [SUSv3] tcgetsid 1918 [SUSv3] 1919 tcsendbreak [SUSv3] tcsetattr [SUSv3] tcsetpgrp [SUSv3] 1920 _________________________________________________________ 1921 1922 9.3.14. System Database Interface 1923 _________________________________________________________ 1924 1925 9.3.14.1. Interfaces for System Database Interface 1926 1927 An LSB conforming implementation shall provide the generic 1928 functions for System Database Interface specified in Table 1929 9-19, with the full mandatory functionality as described in 1930 the referenced underlying specification. 1931 1932 Table 9-19. libc - System Database Interface Function 1933 Interfaces 1934 endgrent [SUSv3] endprotoent [SUSv3] endpwent [SUSv3] 1935 endservent [SUSv3] 1936 endutent [SUSv2] endutxent [SUSv3] getgrent [SUSv3] getgrgid 1937 [SUSv3] 1938 getgrgid_r [SUSv3] getgrnam [SUSv3] getgrnam_r [SUSv3] 1939 getgrouplist [LSB] 1940 gethostbyaddr [SUSv3] gethostbyname [SUSv3] getprotobyname 1941 [SUSv3] getprotobynumber [SUSv3] 1942 getprotoent [SUSv3] getpwent [SUSv3] getpwnam [SUSv3] 1943 getpwnam_r [SUSv3] 1944 getpwuid [SUSv3] getpwuid_r [SUSv3] getservbyname [SUSv3] 1945 getservbyport [SUSv3] 1946 getservent [SUSv3] getutent [LSB] getutent_r [LSB] getutxent 1947 [SUSv3] 1948 getutxid [SUSv3] getutxline [SUSv3] pututxline [SUSv3] 1949 setgrent [SUSv3] 1950 setgroups [LSB] setprotoent [SUSv3] setpwent [SUSv3] 1951 setservent [SUSv3] 1952 setutent [LSB] setutxent [SUSv3] utmpname [LSB] 1953 _________________________________________________________ 1954 1955 9.3.15. Language Support 1956 _________________________________________________________ 1957 1958 9.3.15.1. Interfaces for Language Support 1959 1960 An LSB conforming implementation shall provide the generic 1961 functions for Language Support specified in Table 9-20, with 1962 the full mandatory functionality as described in the 1963 referenced underlying specification. 1964 1965 Table 9-20. libc - Language Support Function Interfaces 1966 __libc_start_main [LSB] __register_atfork(GLIBC_2.3.2) [LSB] 1967 _________________________________________________________ 1968 1969 9.3.16. Large File Support 1970 _________________________________________________________ 1971 1972 9.3.16.1. Interfaces for Large File Support 1973 1974 An LSB conforming implementation shall provide the generic 1975 functions for Large File Support specified in Table 9-21, with 1976 the full mandatory functionality as described in the 1977 referenced underlying specification. 1978 1979 Table 9-21. libc - Large File Support Function Interfaces 1980 __fxstat64 [LSB] __lxstat64 [LSB] __xstat64 [LSB] creat64 1981 [LFS] 1982 fgetpos64 [LFS] fopen64 [LFS] freopen64 [LFS] fseeko64 [LFS] 1983 fsetpos64 [LFS] fstatvfs64 [LFS] ftello64 [LFS] ftruncate64 1984 [LFS] 1985 ftw64 [LFS] getrlimit64 [LFS] lockf64 [LFS] mkstemp64 [LFS] 1986 mmap64 [LFS] nftw64 [LFS] readdir64 [LFS] statvfs64 [LFS] 1987 tmpfile64 [LFS] truncate64 [LFS] 1988 _________________________________________________________ 1989 1990 9.3.17. Standard Library 1991 _________________________________________________________ 1992 1993 9.3.17.1. Interfaces for Standard Library 1994 1995 An LSB conforming implementation shall provide the generic 1996 functions for Standard Library specified in Table 9-22, with 1997 the full mandatory functionality as described in the 1998 referenced underlying specification. 1999 2000 Table 9-22. libc - Standard Library Function Interfaces 2001 _Exit [SUSv3] __assert_fail [LSB] __cxa_atexit [LSB] 2002 __errno_location [LSB] 2003 __fpending [LSB] __getpagesize [LSB] __isinf [LSB] __isinff 2004 [LSB] 2005 __isinfl [LSB] __isnan [LSB] __isnanf [LSB] __isnanl [LSB] 2006 __sysconf [LSB] _exit [SUSv3] _longjmp [SUSv3] _setjmp [SUSv3] 2007 a64l [SUSv3] abort [SUSv3] abs [SUSv3] atof [SUSv3] 2008 atoi [SUSv3] atol [SUSv3] atoll [SUSv3] basename [SUSv3] 2009 bsearch [SUSv3] calloc [SUSv3] closelog [SUSv3] confstr 2010 [SUSv3] 2011 cuserid [SUSv2] daemon [LSB] dirname [SUSv3] div [SUSv3] 2012 drand48 [SUSv3] ecvt [SUSv3] erand48 [SUSv3] err [LSB] 2013 error [LSB] errx [LSB] fcvt [SUSv3] fmtmsg [SUSv3] 2014 fnmatch [SUSv3] fpathconf [SUSv3] free [SUSv3] freeaddrinfo 2015 [SUSv3] 2016 ftrylockfile [SUSv3] ftw [SUSv3] funlockfile [SUSv3] 2017 gai_strerror [SUSv3] 2018 gcvt [SUSv3] getaddrinfo [SUSv3] getcwd [SUSv3] getdate 2019 [SUSv3] 2020 getenv [SUSv3] getlogin [SUSv3] getlogin_r [SUSv3] getnameinfo 2021 [SUSv3] 2022 getopt [LSB] getopt_long [LSB] getopt_long_only [LSB] 2023 getsubopt [SUSv3] 2024 gettimeofday [SUSv3] glob [SUSv3] glob64 [LSB] globfree 2025 [SUSv3] 2026 globfree64 [LSB] grantpt [SUSv3] hcreate [SUSv3] hdestroy 2027 [SUSv3] 2028 hsearch [SUSv3] htonl [SUSv3] htons [SUSv3] imaxabs [SUSv3] 2029 imaxdiv [SUSv3] inet_addr [SUSv3] inet_ntoa [SUSv3] inet_ntop 2030 [SUSv3] 2031 inet_pton [SUSv3] initstate [SUSv3] insque [SUSv3] isatty 2032 [SUSv3] 2033 isblank [SUSv3] jrand48 [SUSv3] l64a [SUSv3] labs [SUSv3] 2034 lcong48 [SUSv3] ldiv [SUSv3] lfind [SUSv3] llabs [SUSv3] 2035 lldiv [SUSv3] longjmp [SUSv3] lrand48 [SUSv3] lsearch [SUSv3] 2036 makecontext [SUSv3] malloc [SUSv3] memmem [LSB] mkstemp 2037 [SUSv3] 2038 mktemp [SUSv3] mrand48 [SUSv3] nftw [SUSv3] nrand48 [SUSv3] 2039 ntohl [SUSv3] ntohs [SUSv3] openlog [SUSv3] perror [SUSv3] 2040 posix_memalign [SUSv3] posix_openpt [SUSv3] ptsname [SUSv3] 2041 putenv [SUSv3] 2042 qsort [SUSv3] rand [SUSv3] rand_r [SUSv3] random [SUSv3] 2043 realloc [SUSv3] realpath [SUSv3] remque [SUSv3] seed48 [SUSv3] 2044 setenv [SUSv3] sethostname [LSB] setlogmask [SUSv3] setstate 2045 [SUSv3] 2046 srand [SUSv3] srand48 [SUSv3] srandom [SUSv3] strtod [SUSv3] 2047 strtol [SUSv3] strtoul [SUSv3] swapcontext [SUSv3] syslog 2048 [SUSv3] 2049 system [LSB] tdelete [SUSv3] tfind [SUSv3] tmpfile [SUSv3] 2050 tmpnam [SUSv3] tsearch [SUSv3] ttyname [SUSv3] ttyname_r 2051 [SUSv3] 2052 twalk [SUSv3] unlockpt [SUSv3] unsetenv [SUSv3] usleep [SUSv3] 2053 verrx [LSB] vfscanf [LSB] vscanf [LSB] vsscanf [LSB] 2054 vsyslog [LSB] warn [LSB] warnx [LSB] wordexp [SUSv3] 2055 wordfree [SUSv3] 2056 2057 An LSB conforming implementation shall provide the generic 2058 data interfaces for Standard Library specified in Table 9-23, 2059 with the full mandatory functionality as described in the 2060 referenced underlying specification. 2061 2062 Table 9-23. libc - Standard Library Data Interfaces 2063 __environ [LSB] _environ [LSB] _sys_errlist [LSB] environ 2064 [SUSv3] 2065 getdate_err [SUSv3] optarg [SUSv3] opterr [SUSv3] optind 2066 [SUSv3] 2067 optopt [SUSv3] 2068 _________________________________________________________ 2069 2070 9.4. Data Definitions for libc 2071 2072 This section defines global identifiers and their values that 2073 are associated with interfaces contained in libc. These 2074 definitions are organized into groups that correspond to 2075 system headers. This convention is used as a convenience for 2076 the reader, and does not imply the existence of these headers, 2077 or their content. Where an interface is defined as requiring a 2078 particular system header file all of the data definitions for 2079 that system header file presented here shall be in effect. 2080 2081 This section gives data definitions to promote binary 2082 application portability, not to repeat source interface 2083 definitions available elsewhere. System providers and 2084 application developers should use this ABI to supplement - not 2085 to replace - source interface definition specifications. 2086 2087 This specification uses the ISO C (1999) C Language as the 2088 reference programming language, and data definitions are 2089 specified in ISO C format. The C language is used here as a 2090 convenient notation. Using a C language description of these 2091 data objects does not preclude their use by other programming 2092 languages. 2093 _________________________________________________________ 2094 2095 9.4.1. arpa/inet.h 2096 2097 extern uint32_t htonl(uint32_t); 2098 extern uint16_t htons(uint16_t); 2099 extern in_addr_t inet_addr(const char *); 2100 extern char *inet_ntoa(struct in_addr); 2101 extern const char *inet_ntop(int, const void *, char *, socklen_t); 2102 extern int inet_pton(int, const char *, void *); 2103 extern uint32_t ntohl(uint32_t); 2104 extern uint16_t ntohs(uint16_t); 2105 _________________________________________________________ 2106 2107 9.4.2. assert.h 2108 2109 The assert.h header shall define the assert() macro. It refers 2110 to the macro NDEBUG, which is not defined in this header. If 2111 NDEBUG is defined before the inclusion of this header, the 2112 assert() macro shall be defined as described below, otherwise 2113 the macro shall behave as described in assert() in ISO/IEC 2114 9945 POSIX. 2115 extern void __assert_fail(const char *, const char *, unsigned int, 2116 const char *); 2117 _________________________________________________________ 2118 2119 9.4.3. ctype.h 2120 2121 enum { 2122 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint, 2123 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 2124 }; 2125 extern int _tolower(int); 2126 extern int _toupper(int); 2127 extern int isalnum(int); 2128 extern int isalpha(int); 2129 extern int isascii(int); 2130 extern int iscntrl(int); 2131 extern int isdigit(int); 2132 extern int isgraph(int); 2133 extern int islower(int); 2134 extern int isprint(int); 2135 extern int ispunct(int); 2136 extern int isspace(int); 2137 extern int isupper(int); 2138 extern int isxdigit(int); 2139 extern int toascii(int); 2140 extern int tolower(int); 2141 extern int toupper(int); 2142 extern int isblank(int); 2143 extern const unsigned short **__ctype_b_loc(void); 2144 extern const int32_t **__ctype_toupper_loc(void); 2145 extern const int32_t **__ctype_tolower_loc(void); 2146 _________________________________________________________ 2147 2148 9.4.4. dirent.h 2149 2150 typedef struct __dirstream DIR; 2151 2152 struct dirent { 2153 long int d_ino; 2154 off_t d_off; 2155 unsigned short d_reclen; 2156 unsigned char d_type; 2157 char d_name[256]; 2158 }; 2159 struct dirent64 { 2160 uint64_t d_ino; 2161 int64_t d_off; 2162 unsigned short d_reclen; 2163 unsigned char d_type; 2164 char d_name[256]; 2165 }; 2166 extern void rewinddir(DIR *); 2167 extern void seekdir(DIR *, long int); 2168 extern long int telldir(DIR *); 2169 extern int closedir(DIR *); 2170 extern DIR *opendir(const char *); 2171 extern struct dirent *readdir(DIR *); 2172 extern struct dirent64 *readdir64(DIR *); 2173 extern int readdir_r(DIR *, struct dirent *, struct dirent **); 2174 _________________________________________________________ 2175 2176 9.4.5. err.h 2177 2178 extern void err(int, const char *, ...); 2179 extern void errx(int, const char *, ...); 2180 extern void warn(const char *, ...); 2181 extern void warnx(const char *, ...); 2182 extern void error(int, int, const char *, ...); 2183 _________________________________________________________ 2184 2185 9.4.6. errno.h 2186 2187 ISO POSIX (2003) requires that each error value shall be 2188 unique, with permission for EAGAIN and EWOULDBLOCK possibly 2189 having the same value. This specification also requires that 2190 ENOTSUP and EOPNOTSUPP have the same value. 2191 2192 Note: A defect report against ISO POSIX (2003) has been 2193 filed to request that specification also permit these two 2194 symbols to have the same value. 2195 2196 #define errno (*__errno_location()) 2197 2198 #define EPERM 1 2199 #define ECHILD 10 2200 #define ENETDOWN 100 2201 #define ENETUNREACH 101 2202 #define ENETRESET 102 2203 #define ECONNABORTED 103 2204 #define ECONNRESET 104 2205 #define ENOBUFS 105 2206 #define EISCONN 106 2207 #define ENOTCONN 107 2208 #define ESHUTDOWN 108 2209 #define ETOOMANYREFS 109 2210 #define EAGAIN 11 2211 #define ETIMEDOUT 110 2212 #define ECONNREFUSED 111 2213 #define EHOSTDOWN 112 2214 #define EHOSTUNREACH 113 2215 #define EALREADY 114 2216 #define EINPROGRESS 115 2217 #define ESTALE 116 2218 #define EUCLEAN 117 2219 #define ENOTNAM 118 2220 #define ENAVAIL 119 2221 #define ENOMEM 12 2222 #define EISNAM 120 2223 #define EREMOTEIO 121 2224 #define EDQUOT 122 2225 #define ENOMEDIUM 123 2226 #define EMEDIUMTYPE 124 2227 #define ECANCELED 125 2228 #define EACCES 13 2229 #define EFAULT 14 2230 #define ENOTBLK 15 2231 #define EBUSY 16 2232 #define EEXIST 17 2233 #define EXDEV 18 2234 #define ENODEV 19 2235 #define ENOENT 2 2236 #define ENOTDIR 20 2237 #define EISDIR 21 2238 #define EINVAL 22 2239 #define ENFILE 23 2240 #define EMFILE 24 2241 #define ENOTTY 25 2242 #define ETXTBSY 26 2243 #define EFBIG 27 2244 #define ENOSPC 28 2245 #define ESPIPE 29 2246 #define ESRCH 3 2247 #define EROFS 30 2248 #define EMLINK 31 2249 #define EPIPE 32 2250 #define EDOM 33 2251 #define ERANGE 34 2252 #define EDEADLK 35 2253 #define ENAMETOOLONG 36 2254 #define ENOLCK 37 2255 #define ENOSYS 38 2256 #define ENOTEMPTY 39 2257 #define EINTR 4 2258 #define ELOOP 40 2259 #define ENOMSG 42 2260 #define EIDRM 43 2261 #define ECHRNG 44 2262 #define EL2NSYNC 45 2263 #define EL3HLT 46 2264 #define EL3RST 47 2265 #define ELNRNG 48 2266 #define EUNATCH 49 2267 #define EIO 5 2268 #define ENOANO 55 2269 #define EBADRQC 56 2270 #define EBADSLT 57 2271 #define EBFONT 59 2272 #define ENXIO 6 2273 #define ENOSTR 60 2274 #define ENODATA 61 2275 #define ETIME 62 2276 #define ENOSR 63 2277 #define ENONET 64 2278 #define ENOPKG 65 2279 #define EREMOTE 66 2280 #define ENOLINK 67 2281 #define EADV 68 2282 #define ESRMNT 69 2283 #define E2BIG 7 2284 #define ECOMM 70 2285 #define EPROTO 71 2286 #define EMULTIHOP 72 2287 #define EDOTDOT 73 2288 #define EBADMSG 74 2289 #define EOVERFLOW 75 2290 #define ENOTUNIQ 76 2291 #define EBADFD 77 2292 #define EREMCHG 78 2293 #define ELIBACC 79 2294 #define ENOEXEC 8 2295 #define ELIBBAD 80 2296 #define ELIBSCN 81 2297 #define ELIBMAX 82 2298 #define ELIBEXEC 83 2299 #define EILSEQ 84 2300 #define ERESTART 85 2301 #define ESTRPIPE 86 2302 #define EUSERS 87 2303 #define ENOTSOCK 88 2304 #define EDESTADDRREQ 89 2305 #define EBADF 9 2306 #define EMSGSIZE 90 2307 #define EPROTOTYPE 91 2308 #define ENOPROTOOPT 92 2309 #define EPROTONOSUPPORT 93 2310 #define ESOCKTNOSUPPORT 94 2311 #define EOPNOTSUPP 95 2312 #define EPFNOSUPPORT 96 2313 #define EAFNOSUPPORT 97 2314 #define EADDRINUSE 98 2315 #define EADDRNOTAVAIL 99 2316 #define EWOULDBLOCK EAGAIN 2317 #define ENOTSUP EOPNOTSUPP 2318 2319 extern int *__errno_location(void); 2320 _________________________________________________________ 2321 2322 9.4.7. fcntl.h 2323 2324 #define O_RDONLY 00 2325 #define O_ACCMODE 0003 2326 #define O_WRONLY 01 2327 #define O_CREAT 0100 2328 #define O_TRUNC 01000 2329 #define O_SYNC 010000 2330 #define O_RDWR 02 2331 #define O_EXCL 0200 2332 #define O_APPEND 02000 2333 #define O_ASYNC 020000 2334 #define O_NOCTTY 0400 2335 #define O_NDELAY 04000 2336 #define O_NONBLOCK 04000 2337 #define FD_CLOEXEC 1 2338 2339 struct flock { 2340 short l_type; 2341 short l_whence; 2342 off_t l_start; 2343 off_t l_len; 2344 pid_t l_pid; 2345 }; 2346 struct flock64 { 2347 short l_type; 2348 short l_whence; 2349 loff_t l_start; 2350 loff_t l_len; 2351 pid_t l_pid; 2352 }; 2353 2354 #define F_DUPFD 0 2355 #define F_RDLCK 0 2356 #define F_GETFD 1 2357 #define F_WRLCK 1 2358 #define F_SETFD 2 2359 #define F_UNLCK 2 2360 #define F_GETFL 3 2361 #define F_SETFL 4 2362 #define F_GETLK 5 2363 #define F_SETLK 6 2364 #define F_SETLKW 7 2365 #define F_SETOWN 8 2366 #define F_GETOWN 9 2367 2368 extern int lockf64(int, int, off64_t); 2369 extern int fcntl(int, int, ...); 2370 _________________________________________________________ 2371 2372 9.4.8. fmtmsg.h 2373 2374 #define MM_HARD 1 2375 #define MM_NRECOV 128 2376 #define MM_UTIL 16 2377 #define MM_SOFT 2 2378 #define MM_OPSYS 32 2379 #define MM_FIRM 4 2380 #define MM_RECOVER 64 2381 #define MM_APPL 8 2382 2383 #define MM_NOSEV 0 2384 #define MM_HALT 1 2385 #define MM_ERROR 2 2386 2387 #define MM_NULLLBL ((char *) 0) 2388 2389 extern int fmtmsg(long int, const char *, int, const char *, const char *, 2390 const char *); 2391 _________________________________________________________ 2392 2393 9.4.9. fnmatch.h 2394 2395 #define FNM_PATHNAME (1<<0) 2396 #define FNM_NOESCAPE (1<<1) 2397 #define FNM_PERIOD (1<<2) 2398 #define FNM_NOMATCH 1 2399 2400 extern int fnmatch(const char *, const char *, int); 2401 _________________________________________________________ 2402 2403 9.4.10. ftw.h 2404 2405 #define FTW_D FTW_D 2406 #define FTW_DNR FTW_DNR 2407 #define FTW_DP FTW_DP 2408 #define FTW_F FTW_F 2409 #define FTW_NS FTW_NS 2410 #define FTW_SL FTW_SL 2411 #define FTW_SLN FTW_SLN 2412 2413 enum { 2414 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 2415 }; 2416 2417 enum { 2418 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 2419 }; 2420 2421 struct FTW { 2422 int base; 2423 int level; 2424 }; 2425 2426 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 2427 int __flag); 2428 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 2429 int __flag); 2430 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 2431 int __flag, struct FTW * __info); 2432 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 2433 int __flag, struct FTW * __info); 2434 extern int ftw(const char *, __ftw_func_t, int); 2435 extern int ftw64(const char *, __ftw64_func_t, int); 2436 extern int nftw(const char *, __nftw_func_t, int, int); 2437 extern int nftw64(const char *, __nftw64_func_t, int, int); 2438 _________________________________________________________ 2439 2440 9.4.11. getopt.h 2441 2442 #define no_argument 0 2443 #define required_argument 1 2444 #define optional_argument 2 2445 2446 struct option { 2447 char *name; 2448 int has_arg; 2449 int *flag; 2450 int val; 2451 }; 2452 extern int getopt_long(int, char *const, const char *, 2453 const struct option *, int *); 2454 extern int getopt_long_only(int, char *const, const char *, 2455 const struct option *, int *); 2456 _________________________________________________________ 2457 2458 9.4.12. glob.h 2459 2460 #define GLOB_ERR (1<<0) 2461 #define GLOB_MARK (1<<1) 2462 #define GLOB_BRACE (1<<10) 2463 #define GLOB_NOMAGIC (1<<11) 2464 #define GLOB_TILDE (1<<12) 2465 #define GLOB_ONLYDIR (1<<13) 2466 #define GLOB_TILDE_CHECK (1<<14) 2467 #define GLOB_NOSORT (1<<2) 2468 #define GLOB_DOOFFS (1<<3) 2469 #define GLOB_NOCHECK (1<<4) 2470 #define GLOB_APPEND (1<<5) 2471 #define GLOB_NOESCAPE (1<<6) 2472 #define GLOB_PERIOD (1<<7) 2473 #define GLOB_MAGCHAR (1<<8) 2474 #define GLOB_ALTDIRFUNC (1<<9) 2475 2476 #define GLOB_NOSPACE 1 2477 #define GLOB_ABORTED 2 2478 #define GLOB_NOMATCH 3 2479 #define GLOB_NOSYS 4 2480 2481 typedef struct { 2482 size_t gl_pathc; 2483 char **gl_pathv; 2484 size_t gl_offs; 2485 int gl_flags; 2486 void (*gl_closedir) (void *); 2487 struct dirent *(*gl_readdir) (void *); 2488 void *(*gl_opendir) (const char *); 2489 int (*gl_lstat) (const char *, struct stat *); 2490 int (*gl_stat) (const char *, struct stat *); 2491 } glob_t; 2492 2493 typedef struct { 2494 size_t gl_pathc; 2495 char **gl_pathv; 2496 size_t gl_offs; 2497 int gl_flags; 2498 void (*gl_closedir) (void *); 2499 struct dirent64 *(*gl_readdir64) (void *); 2500 void *(*gl_opendir) (const char *); 2501 int (*gl_lstat) (const char *, struct stat *); 2502 int (*gl_stat) (const char *, struct stat *); 2503 } glob64_t; 2504 extern int glob(const char *, int, 2505 int (*__errfunc) (const char *p1, int p2) 2506 , glob_t *); 2507 extern int glob64(const char *, int, 2508 int (*__errfunc) (const char *p1, int p2) 2509 , glob64_t *); 2510 extern void globfree(glob_t *); 2511 extern void globfree64(glob64_t *); 2512 _________________________________________________________ 2513 2514 9.4.13. grp.h 2515 2516 struct group { 2517 char *gr_name; 2518 char *gr_passwd; 2519 gid_t gr_gid; 2520 char **gr_mem; 2521 }; 2522 2523 extern void endgrent(void); 2524 extern struct group *getgrent(void); 2525 extern struct group *getgrgid(gid_t); 2526 extern struct group *getgrnam(char *); 2527 extern int initgroups(const char *, gid_t); 2528 extern void setgrent(void); 2529 extern int setgroups(size_t, const gid_t *); 2530 extern int getgrgid_r(gid_t, struct group *, char *, size_t, 2531 struct group **); 2532 extern int getgrnam_r(const char *, struct group *, char *, size_t, 2533 struct group **); 2534 extern int getgrouplist(const char *, gid_t, gid_t *, int *); 2535 _________________________________________________________ 2536 2537 9.4.14. iconv.h 2538 2539 typedef void *iconv_t; 2540 extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); 2541 extern int iconv_close(iconv_t); 2542 extern iconv_t iconv_open(char *, char *); 2543 _________________________________________________________ 2544 2545 9.4.15. inttypes.h 2546 2547 typedef lldiv_t imaxdiv_t; 2548 typedef unsigned char uint8_t; 2549 typedef unsigned short uint16_t; 2550 typedef unsigned int uint32_t; 2551 2552 extern intmax_t strtoimax(const char *, char **, int); 2553 extern uintmax_t strtoumax(const char *, char **, int); 2554 extern intmax_t wcstoimax(const wchar_t *, wchar_t * *, int); 2555 extern uintmax_t wcstoumax(const wchar_t *, wchar_t * *, int); 2556 extern intmax_t imaxabs(intmax_t); 2557 extern imaxdiv_t imaxdiv(intmax_t, intmax_t); 2558 _________________________________________________________ 2559 2560 9.4.16. langinfo.h 2561 2562 #define ABDAY_1 0x20000 2563 #define ABDAY_2 0x20001 2564 #define ABDAY_3 0x20002 2565 #define ABDAY_4 0x20003 2566 #define ABDAY_5 0x20004 2567 #define ABDAY_6 0x20005 2568 #define ABDAY_7 0x20006 2569 2570 #define DAY_1 0x20007 2571 #define DAY_2 0x20008 2572 #define DAY_3 0x20009 2573 #define DAY_4 0x2000A 2574 #define DAY_5 0x2000B 2575 #define DAY_6 0x2000C 2576 #define DAY_7 0x2000D 2577 2578 #define ABMON_1 0x2000E 2579 #define ABMON_2 0x2000F 2580 #define ABMON_3 0x20010 2581 #define ABMON_4 0x20011 2582 #define ABMON_5 0x20012 2583 #define ABMON_6 0x20013 2584 #define ABMON_7 0x20014 2585 #define ABMON_8 0x20015 2586 #define ABMON_9 0x20016 2587 #define ABMON_10 0x20017 2588 #define ABMON_11 0x20018 2589 #define ABMON_12 0x20019 2590 2591 #define MON_1 0x2001A 2592 #define MON_2 0x2001B 2593 #define MON_3 0x2001C 2594 #define MON_4 0x2001D 2595 #define MON_5 0x2001E 2596 #define MON_6 0x2001F 2597 #define MON_7 0x20020 2598 #define MON_8 0x20021 2599 #define MON_9 0x20022 2600 #define MON_10 0x20023 2601 #define MON_11 0x20024 2602 #define MON_12 0x20025 2603 2604 #define AM_STR 0x20026 2605 #define PM_STR 0x20027 2606 2607 #define D_T_FMT 0x20028 2608 #define D_FMT 0x20029 2609 #define T_FMT 0x2002A 2610 #define T_FMT_AMPM 0x2002B 2611 2612 #define ERA 0x2002C 2613 #define ERA_D_FMT 0x2002E 2614 #define ALT_DIGITS 0x2002F 2615 #define ERA_D_T_FMT 0x20030 2616 #define ERA_T_FMT 0x20031 2617 2618 #define CODESET 14 2619 2620 #define CRNCYSTR 0x4000F 2621 2622 #define RADIXCHAR 0x10000 2623 #define THOUSEP 0x10001 2624 #define YESEXPR 0x50000 2625 #define NOEXPR 0x50001 2626 #define YESSTR 0x50002 2627 #define NOSTR 0x50003 2628 2629 extern char *nl_langinfo(nl_item); 2630 _________________________________________________________ 2631 2632 9.4.17. libgen.h 2633 2634 extern char *basename(const char *); 2635 extern char *dirname(char *); 2636 _________________________________________________________ 2637 2638 9.4.18. libintl.h 2639 2640 extern char *bindtextdomain(const char *, const char *); 2641 extern char *dcgettext(const char *, const char *, int); 2642 extern char *dgettext(const char *, const char *); 2643 extern char *gettext(const char *); 2644 extern char *textdomain(const char *); 2645 extern char *bind_textdomain_codeset(const char *, const char *); 2646 extern char *dcngettext(const char *, const char *, const char *, 2647 unsigned long int, int); 2648 extern char *dngettext(const char *, const char *, const char *, 2649 unsigned long int); 2650 extern char *ngettext(const char *, const char *, unsigned long int); 2651 _________________________________________________________ 2652 2653 9.4.19. limits.h 2654 2655 #define LLONG_MIN (-LLONG_MAX-1LL) 2656 #define ULLONG_MAX 18446744073709551615ULL 2657 #define OPEN_MAX 256 2658 #define PATH_MAX 4096 2659 #define LLONG_MAX 9223372036854775807LL 2660 #define SSIZE_MAX LONG_MAX 2661 2662 #define MB_LEN_MAX 16 2663 2664 #define SCHAR_MIN (-128) 2665 #define SCHAR_MAX 127 2666 #define UCHAR_MAX 255 2667 #define CHAR_BIT 8 2668 2669 #define SHRT_MIN (-32768) 2670 #define SHRT_MAX 32767 2671 #define USHRT_MAX 65535 2672 2673 #define INT_MIN (-INT_MAX-1) 2674 #define INT_MAX 2147483647 2675 #define __INT_MAX__ 2147483647 2676 #define UINT_MAX 4294967295U 2677 2678 #define LONG_MIN (-LONG_MAX-1L) 2679 2680 #define PTHREAD_KEYS_MAX 1024 2681 #define PTHREAD_THREADS_MAX 16384 2682 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 2683 _________________________________________________________ 2684 2685 9.4.20. locale.h 2686 2687 struct lconv { 2688 char *decimal_point; 2689 char *thousands_sep; 2690 char *grouping; 2691 char *int_curr_symbol; 2692 char *currency_symbol; 2693 char *mon_decimal_point; 2694 char *mon_thousands_sep; 2695 char *mon_grouping; 2696 char *positive_sign; 2697 char *negative_sign; 2698 char int_frac_digits; 2699 char frac_digits; 2700 char p_cs_precedes; 2701 char p_sep_by_space; 2702 char n_cs_precedes; 2703 char n_sep_by_space; 2704 char p_sign_posn; 2705 char n_sign_posn; 2706 char int_p_cs_precedes; 2707 char int_p_sep_by_space; 2708 char int_n_cs_precedes; 2709 char int_n_sep_by_space; 2710 char int_p_sign_posn; 2711 char int_n_sign_posn; 2712 }; 2713 2714 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 2715 #define LC_CTYPE 0 2716 #define LC_NUMERIC 1 2717 #define LC_TELEPHONE 10 2718 #define LC_MEASUREMENT 11 2719 #define LC_IDENTIFICATION 12 2720 #define LC_TIME 2 2721 #define LC_COLLATE 3 2722 #define LC_MONETARY 4 2723 #define LC_MESSAGES 5 2724 #define LC_ALL 6 2725 #define LC_PAPER 7 2726 #define LC_NAME 8 2727 #define LC_ADDRESS 9 2728 2729 typedef struct __locale_struct { 2730 struct locale_data *__locales[13]; 2731 const unsigned short *__ctype_b; 2732 const int *__ctype_tolower; 2733 const int *__ctype_toupper; 2734 const char *__names[13]; 2735 } *__locale_t; 2736 2737 typedef struct __locale_struct *locale_t; 2738 2739 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 2740 #define LC_COLLATE_MASK (1 << LC_COLLATE) 2741 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 2742 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 2743 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 2744 #define LC_MONETARY_MASK (1 << LC_MONETARY) 2745 #define LC_NAME_MASK (1 << LC_NAME) 2746 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 2747 #define LC_PAPER_MASK (1 << LC_PAPER) 2748 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 2749 #define LC_TIME_MASK (1 << LC_TIME) 2750 #define LC_CTYPE_MASK (1<cl_ops->cl_control)(cl,rq,in)) 3166 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 3167 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 3168 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 3169 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 3170 #define NULLPROC ((u_long)0) 3171 #define CLSET_TIMEOUT 1 3172 #define CLGET_XID 10 3173 #define CLSET_XID 11 3174 #define CLGET_VERS 12 3175 #define CLSET_VERS 13 3176 #define CLGET_PROG 14 3177 #define CLSET_PROG 15 3178 #define CLGET_TIMEOUT 2 3179 #define CLGET_SERVER_ADDR 3 3180 #define CLSET_RETRY_TIMEOUT 4 3181 #define CLGET_RETRY_TIMEOUT 5 3182 #define CLGET_FD 6 3183 #define CLGET_SVC_ADDR 7 3184 #define CLSET_FD_CLOSE 8 3185 #define CLSET_FD_NCLOSE 9 3186 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 3187 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 3188 3189 enum clnt_stat { 3190 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 3191 2, RPC_CANTSEND = 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 3192 5, RPC_VERSMISMATCH = 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 3193 8, RPC_PROGVERSMISMATCH = 9, RPC_PROCUNAVAIL = 3194 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 3195 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 3196 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 3197 14, RPC_PROGNOTREGISTERED = 15, RPC_N2AXLATEFAILURE = 3198 22, RPC_FAILED = 16, RPC_INTR = 18, RPC_TLIERROR = 3199 20, RPC_UDERROR = 23, RPC_INPROGRESS = 24, RPC_STALERACHANDLE = 25 3200 }; 3201 struct rpc_err { 3202 enum clnt_stat re_status; 3203 union { 3204 int RE_errno; 3205 enum auth_stat RE_why; 3206 struct { 3207 u_long low; 3208 u_long high; 3209 } RE_vers; 3210 struct { 3211 long int s1; 3212 long int s2; 3213 } RE_lb; 3214 } ru; 3215 }; 3216 3217 typedef struct CLIENT { 3218 struct AUTH *cl_auth; 3219 struct clnt_ops *cl_ops; 3220 caddr_t cl_private; 3221 } CLIENT; 3222 3223 struct clnt_ops { 3224 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 3225 xdrproc_t, caddr_t, struct timeval); 3226 void (*cl_abort) (void); 3227 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 3228 bool_t(*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 3229 void (*cl_destroy) (struct CLIENT *); 3230 bool_t(*cl_control) (struct CLIENT *, int, char *); 3231 }; 3232 extern struct CLIENT *clnt_create(const char *, const u_long, const u_long, 3233 const char *); 3234 extern void clnt_pcreateerror(const char *); 3235 extern void clnt_perrno(enum clnt_stat); 3236 extern void clnt_perror(struct CLIENT *, const char *); 3237 extern char *clnt_spcreateerror(const char *); 3238 extern char *clnt_sperrno(enum clnt_stat); 3239 extern char *clnt_sperror(struct CLIENT *, const char *); 3240 _________________________________________________________ 3241 3242 9.4.35. rpc/pmap_clnt.h 3243 3244 extern u_short pmap_getport(struct sockaddr_in *, const u_long, 3245 const u_long, u_int); 3246 extern bool_t pmap_set(const u_long, const u_long, int, u_short); 3247 extern bool_t pmap_unset(u_long, u_long); 3248 _________________________________________________________ 3249 3250 9.4.36. rpc/rpc_msg.h 3251 3252 enum msg_type { 3253 CALL, REPLY = 1 3254 }; 3255 enum reply_stat { 3256 MSG_ACCEPTED, MSG_DENIED = 1 3257 }; 3258 enum accept_stat { 3259 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 3260 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 3261 }; 3262 enum reject_stat { 3263 RPC_MISMATCH, AUTH_ERROR = 1 3264 }; 3265 3266 struct accepted_reply { 3267 struct opaque_auth ar_verf; 3268 enum accept_stat ar_stat; 3269 union { 3270 struct { 3271 unsigned long int low; 3272 unsigned long int high; 3273 } AR_versions; 3274 struct { 3275 caddr_t where; 3276 xdrproc_t proc; 3277 } AR_results; 3278 } ru; 3279 }; 3280 3281 struct rejected_reply { 3282 enum reject_stat rj_stat; 3283 union { 3284 struct { 3285 unsigned long int low; 3286 unsigned long int high; 3287 } RJ_versions; 3288 enum auth_stat RJ_why; 3289 } ru; 3290 }; 3291 3292 struct reply_body { 3293 enum reply_stat rp_stat; 3294 union { 3295 struct accepted_reply RP_ar; 3296 struct rejected_reply RP_dr; 3297 } ru; 3298 }; 3299 3300 struct call_body { 3301 unsigned long int cb_rpcvers; 3302 unsigned long int cb_prog; 3303 unsigned long int cb_vers; 3304 unsigned long int cb_proc; 3305 struct opaque_auth cb_cred; 3306 struct opaque_auth cb_verf; 3307 }; 3308 3309 struct rpc_msg { 3310 unsigned long int rm_xid; 3311 enum msg_type rm_direction; 3312 union { 3313 struct call_body RM_cmb; 3314 struct reply_body RM_rmb; 3315 } ru; 3316 }; 3317 extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); 3318 _________________________________________________________ 3319 3320 9.4.37. rpc/svc.h 3321 3322 #define RPC_ANYSOCK -1 3323 #define svc_freeargs(xprt,xargs, argsp) \ 3324 (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 3325 #define svc_getargs(xprt,xargs, argsp) \ 3326 (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 3327 3328 enum xprt_stat { 3329 XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE 3330 }; 3331 3332 typedef struct SVCXPRT { 3333 int xp_sock; 3334 u_short xp_port; 3335 struct xp_ops *xp_ops; 3336 int xp_addrlen; 3337 struct sockaddr_in xp_raddr; 3338 struct opaque_auth xp_verf; 3339 caddr_t xp_p1; 3340 caddr_t xp_p2; 3341 char xp_pad[256]; 3342 } SVCXPRT; 3343 3344 struct svc_req { 3345 rpcprog_t rq_prog; 3346 rpcvers_t rq_vers; 3347 rpcproc_t rq_proc; 3348 struct opaque_auth rq_cred; 3349 caddr_t rq_clntcred; 3350 SVCXPRT *rq_xprt; 3351 }; 3352 3353 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 3354 3355 struct xp_ops { 3356 bool_t(*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3357 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 3358 bool_t(*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3359 caddr_t args_ptr); 3360 bool_t(*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3361 bool_t(*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3362 caddr_t args_ptr); 3363 void (*xp_destroy) (SVCXPRT * __xprt); 3364 }; 3365 extern void svc_getreqset(fd_set *); 3366 extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, 3367 __dispatch_fn_t, rpcprot_t); 3368 extern void svc_run(void); 3369 extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); 3370 extern void svcerr_auth(SVCXPRT *, enum auth_stat); 3371 extern void svcerr_decode(SVCXPRT *); 3372 extern void svcerr_noproc(SVCXPRT *); 3373 extern void svcerr_noprog(SVCXPRT *); 3374 extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); 3375 extern void svcerr_systemerr(SVCXPRT *); 3376 extern void svcerr_weakauth(SVCXPRT *); 3377 extern SVCXPRT *svctcp_create(int, u_int, u_int); 3378 extern SVCXPRT *svcudp_create(int); 3379 _________________________________________________________ 3380 3381 9.4.38. rpc/types.h 3382 3383 typedef int bool_t; 3384 typedef int enum_t; 3385 typedef unsigned long int rpcprog_t; 3386 typedef unsigned long int rpcvers_t; 3387 typedef unsigned long int rpcproc_t; 3388 typedef unsigned long int rpcprot_t; 3389 _________________________________________________________ 3390 3391 9.4.39. rpc/xdr.h 3392 3393 enum xdr_op { 3394 XDR_ENCODE, XDR_DECODE, XDR_FREE 3395 }; 3396 typedef struct XDR { 3397 enum xdr_op x_op; 3398 struct xdr_ops *x_ops; 3399 caddr_t x_public; 3400 caddr_t x_private; 3401 caddr_t x_base; 3402 int x_handy; 3403 } XDR; 3404 3405 struct xdr_ops { 3406 bool_t(*x_getlong) (XDR * __xdrs, long int *__lp); 3407 bool_t(*x_putlong) (XDR * __xdrs, long int *__lp); 3408 bool_t(*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 3409 bool_t(*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 3410 u_int(*x_getpostn) (XDR * __xdrs); 3411 bool_t(*x_setpostn) (XDR * __xdrs, u_int __pos); 3412 int32_t *(*x_inline) (XDR * __xdrs, int __len); 3413 void (*x_destroy) (XDR * __xdrs); 3414 bool_t(*x_getint32) (XDR * __xdrs, int32_t * __ip); 3415 bool_t(*x_putint32) (XDR * __xdrs, int32_t * __ip); 3416 }; 3417 3418 typedef bool_t(*xdrproc_t) (XDR *, void *, ...); 3419 3420 struct xdr_discrim { 3421 int value; 3422 xdrproc_t proc; 3423 }; 3424 extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, 3425 xdrproc_t); 3426 extern bool_t xdr_bool(XDR *, bool_t *); 3427 extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); 3428 extern bool_t xdr_char(XDR *, char *); 3429 extern bool_t xdr_double(XDR *, double *); 3430 extern bool_t xdr_enum(XDR *, enum_t *); 3431 extern bool_t xdr_float(XDR *, float *); 3432 extern void xdr_free(xdrproc_t, char *); 3433 extern bool_t xdr_int(XDR *, int *); 3434 extern bool_t xdr_long(XDR *, long int *); 3435 extern bool_t xdr_opaque(XDR *, caddr_t, u_int); 3436 extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); 3437 extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); 3438 extern bool_t xdr_short(XDR *, short *); 3439 extern bool_t xdr_string(XDR *, char **, u_int); 3440 extern bool_t xdr_u_char(XDR *, u_char *); 3441 extern bool_t xdr_u_int(XDR *, u_int *); 3442 extern bool_t xdr_u_long(XDR *, u_long *); 3443 extern bool_t xdr_u_short(XDR *, u_short *); 3444 extern bool_t xdr_union(XDR *, enum_t *, char *, 3445 const struct xdr_discrim *, xdrproc_t); 3446 extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); 3447 extern bool_t xdr_void(void); 3448 extern bool_t xdr_wrapstring(XDR *, char **); 3449 extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); 3450 extern void xdrrec_create(XDR *, u_int, u_int, caddr_t, 3451 int (*__readit) (char *p1, char *p2, int p3) 3452 , int (*__writeit) (char *p1, char *p2, int p3) 3453 ); 3454 extern typedef int bool_t xdrrec_eof(XDR *); 3455 _________________________________________________________ 3456 3457 9.4.40. sched.h 3458 3459 #define SCHED_OTHER 0 3460 #define SCHED_FIFO 1 3461 #define SCHED_RR 2 3462 3463 struct sched_param { 3464 int sched_priority; 3465 }; 3466 extern int sched_get_priority_max(int); 3467 extern int sched_get_priority_min(int); 3468 extern int sched_getparam(pid_t, struct sched_param *); 3469 extern int sched_getscheduler(pid_t); 3470 extern int sched_rr_get_interval(pid_t, struct timespec *); 3471 extern int sched_setparam(pid_t, const struct sched_param *); 3472 extern int sched_setscheduler(pid_t, int, const struct sched_param *); 3473 extern int sched_yield(void); 3474 _________________________________________________________ 3475 3476 9.4.41. search.h 3477 3478 typedef struct entry { 3479 char *key; 3480 void *data; 3481 } ENTRY; 3482 typedef enum { 3483 FIND, ENTER 3484 } ACTION; 3485 typedef enum { 3486 preorder, postorder, endorder, leaf 3487 } VISIT; 3488 3489 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 3490 extern int hcreate(size_t); 3491 extern ENTRY *hsearch(ENTRY, ACTION); 3492 extern void insque(void *, void *); 3493 extern void *lfind(const void *, const void *, size_t *, size_t, 3494 __compar_fn_t); 3495 extern void *lsearch(const void *, void *, size_t *, size_t, 3496 __compar_fn_t); 3497 extern void remque(void *); 3498 extern void hdestroy(void); 3499 extern void *tdelete(const void *, void **, __compar_fn_t); 3500 extern void *tfind(const void *, void *const *, __compar_fn_t); 3501 extern void *tsearch(const void *, void **, __compar_fn_t); 3502 extern void twalk(const void *, __action_fn_t); 3503 _________________________________________________________ 3504 3505 9.4.42. setjmp.h 3506 3507 #define setjmp(env) _setjmp(env) 3508 #define sigsetjmp(a,b) __sigsetjmp(a,b) 3509 3510 struct __jmp_buf_tag { 3511 __jmp_buf __jmpbuf; 3512 int __mask_was_saved; 3513 sigset_t __saved_mask; 3514 }; 3515 3516 typedef struct __jmp_buf_tag jmp_buf[1]; 3517 typedef jmp_buf sigjmp_buf; 3518 extern int __sigsetjmp(jmp_buf, int); 3519 extern void longjmp(jmp_buf, int); 3520 extern void siglongjmp(sigjmp_buf, int); 3521 extern void _longjmp(jmp_buf, int); 3522 extern int _setjmp(jmp_buf); 3523 _________________________________________________________ 3524 3525 9.4.43. signal.h 3526 3527 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 3528 #define SIGRTMAX (__libc_current_sigrtmax ()) 3529 #define SIGRTMIN (__libc_current_sigrtmin ()) 3530 #define SIG_BLOCK 0 3531 #define SIG_UNBLOCK 1 3532 #define SIG_SETMASK 2 3533 #define NSIG 65 3534 3535 typedef int sig_atomic_t; 3536 3537 typedef void (*sighandler_t) (int); 3538 3539 #define SIG_HOLD ((sighandler_t) 2) 3540 #define SIG_ERR ((sighandler_t)-1) 3541 #define SIG_DFL ((sighandler_t)0) 3542 #define SIG_IGN ((sighandler_t)1) 3543 3544 #define SIGHUP 1 3545 #define SIGUSR1 10 3546 #define SIGSEGV 11 3547 #define SIGUSR2 12 3548 #define SIGPIPE 13 3549 #define SIGALRM 14 3550 #define SIGTERM 15 3551 #define SIGSTKFLT 16 3552 #define SIGCHLD 17 3553 #define SIGCONT 18 3554 #define SIGSTOP 19 3555 #define SIGINT 2 3556 #define SIGTSTP 20 3557 #define SIGTTIN 21 3558 #define SIGTTOU 22 3559 #define SIGURG 23 3560 #define SIGXCPU 24 3561 #define SIGXFSZ 25 3562 #define SIGVTALRM 26 3563 #define SIGPROF 27 3564 #define SIGWINCH 28 3565 #define SIGIO 29 3566 #define SIGQUIT 3 3567 #define SIGPWR 30 3568 #define SIGSYS 31 3569 #define SIGUNUSED 31 3570 #define SIGILL 4 3571 #define SIGTRAP 5 3572 #define SIGABRT 6 3573 #define SIGIOT 6 3574 #define SIGBUS 7 3575 #define SIGFPE 8 3576 #define SIGKILL 9 3577 #define SIGCLD SIGCHLD 3578 #define SIGPOLL SIGIO 3579 3580 #define SV_ONSTACK (1<<0) 3581 #define SV_INTERRUPT (1<<1) 3582 #define SV_RESETHAND (1<<2) 3583 3584 typedef union sigval { 3585 int sival_int; 3586 void *sival_ptr; 3587 } sigval_t; 3588 3589 #define SIGEV_SIGNAL 0 3590 #define SIGEV_NONE 1 3591 #define SIGEV_THREAD 2 3592 #define SIGEV_MAX_SIZE 64 3593 3594 typedef struct sigevent { 3595 sigval_t sigev_value; 3596 int sigev_signo; 3597 int sigev_notify; 3598 union { 3599 int _pad[SIGEV_PAD_SIZE]; 3600 struct { 3601 void (*sigev_thread_func) (sigval_t); 3602 void *_attribute; 3603 } _sigev_thread; 3604 } _sigev_un; 3605 } sigevent_t; 3606 3607 #define SI_MAX_SIZE 128 3608 #define si_pid _sifields._kill._pid 3609 #define si_uid _sifields._kill._uid 3610 #define si_value _sifields._rt._sigval 3611 #define si_int _sifields._rt._sigval.sival_int 3612 #define si_ptr _sifields._rt._sigval.sival_ptr 3613 #define si_status _sifields._sigchld._status 3614 #define si_stime _sifields._sigchld._stime 3615 #define si_utime _sifields._sigchld._utime 3616 #define si_addr _sifields._sigfault._addr 3617 #define si_band _sifields._sigpoll._band 3618 #define si_fd _sifields._sigpoll._fd 3619 #define si_timer1 _sifields._timer._timer1 3620 #define si_timer2 _sifields._timer._timer2 3621 3622 typedef struct siginfo { 3623 int si_signo; 3624 int si_errno; 3625 int si_code; 3626 union { 3627 int _pad[SI_PAD_SIZE]; 3628 struct { 3629 pid_t _pid; 3630 uid_t _uid; 3631 } _kill; 3632 struct { 3633 unsigned int _timer1; 3634 unsigned int _timer2; 3635 } _timer; 3636 struct { 3637 pid_t _pid; 3638 uid_t _uid; 3639 sigval_t _sigval; 3640 } _rt; 3641 struct { 3642 pid_t _pid; 3643 uid_t _uid; 3644 int _status; 3645 clock_t _utime; 3646 clock_t _stime; 3647 } _sigchld; 3648 struct { 3649 void *_addr; 3650 } _sigfault; 3651 struct { 3652 int _band; 3653 int _fd; 3654 } _sigpoll; 3655 } _sifields; 3656 } siginfo_t; 3657 3658 #define SI_QUEUE -1 3659 #define SI_TIMER -2 3660 #define SI_MESGQ -3 3661 #define SI_ASYNCIO -4 3662 #define SI_SIGIO -5 3663 #define SI_TKILL -6 3664 #define SI_ASYNCNL -60 3665 #define SI_USER 0 3666 #define SI_KERNEL 0x80 3667 3668 #define ILL_ILLOPC 1 3669 #define ILL_ILLOPN 2 3670 #define ILL_ILLADR 3 3671 #define ILL_ILLTRP 4 3672 #define ILL_PRVOPC 5 3673 #define ILL_PRVREG 6 3674 #define ILL_COPROC 7 3675 #define ILL_BADSTK 8 3676 3677 #define FPE_INTDIV 1 3678 #define FPE_INTOVF 2 3679 #define FPE_FLTDIV 3 3680 #define FPE_FLTOVF 4 3681 #define FPE_FLTUND 5 3682 #define FPE_FLTRES 6 3683 #define FPE_FLTINV 7 3684 #define FPE_FLTSUB 8 3685 3686 #define SEGV_MAPERR 1 3687 #define SEGV_ACCERR 2 3688 3689 #define BUS_ADRALN 1 3690 #define BUS_ADRERR 2 3691 #define BUS_OBJERR 3 3692 3693 #define TRAP_BRKPT 1 3694 #define TRAP_TRACE 2 3695 3696 #define CLD_EXITED 1 3697 #define CLD_KILLED 2 3698 #define CLD_DUMPED 3 3699 #define CLD_TRAPPED 4 3700 #define CLD_STOPPED 5 3701 #define CLD_CONTINUED 6 3702 3703 #define POLL_IN 1 3704 #define POLL_OUT 2 3705 #define POLL_MSG 3 3706 #define POLL_ERR 4 3707 #define POLL_PRI 5 3708 #define POLL_HUP 6 3709 3710 typedef struct { 3711 unsigned long int sig[_SIGSET_NWORDS]; 3712 } sigset_t; 3713 3714 #define SA_NOCLDSTOP 0x00000001 3715 #define SA_NOCLDWAIT 0x00000002 3716 #define SA_SIGINFO 0x00000004 3717 #define SA_ONSTACK 0x08000000 3718 #define SA_RESTART 0x10000000 3719 #define SA_INTERRUPT 0x20000000 3720 #define SA_NODEFER 0x40000000 3721 #define SA_RESETHAND 0x80000000 3722 #define SA_NOMASK SA_NODEFER 3723 #define SA_ONESHOT SA_RESETHAND 3724 3725 typedef struct sigaltstack { 3726 void *ss_sp; 3727 int ss_flags; 3728 size_t ss_size; 3729 } stack_t; 3730 3731 #define SS_ONSTACK 1 3732 #define SS_DISABLE 2 3733 3734 extern int __libc_current_sigrtmax(void); 3735 extern int __libc_current_sigrtmin(void); 3736 extern sighandler_t __sysv_signal(int, sighandler_t); 3737 extern char *const _sys_siglist(void); 3738 extern int killpg(pid_t, int); 3739 extern void psignal(int, const char *); 3740 extern int raise(int); 3741 extern int sigaddset(sigset_t *, int); 3742 extern int sigandset(sigset_t *, const sigset_t *, const sigset_t *); 3743 extern int sigdelset(sigset_t *, int); 3744 extern int sigemptyset(sigset_t *); 3745 extern int sigfillset(sigset_t *); 3746 extern int sighold(int); 3747 extern int sigignore(int); 3748 extern int siginterrupt(int, int); 3749 extern int sigisemptyset(const sigset_t *); 3750 extern int sigismember(const sigset_t *, int); 3751 extern int sigorset(sigset_t *, const sigset_t *, const sigset_t *); 3752 extern int sigpending(sigset_t *); 3753 extern int sigrelse(int); 3754 extern sighandler_t sigset(int, sighandler_t); 3755 extern int pthread_kill(pthread_t, int); 3756 extern int pthread_sigmask(int, sigset_t *, sigset_t *); 3757 extern int sigaction(int, const struct sigaction *, struct sigaction *); 3758 extern int sigwait(sigset_t *, int *); 3759 extern int kill(pid_t, int); 3760 extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); 3761 extern sighandler_t signal(int, sighandler_t); 3762 extern int sigpause(int); 3763 extern int sigprocmask(int, const sigset_t *, sigset_t *); 3764 extern int sigreturn(struct sigcontext *); 3765 extern int sigsuspend(const sigset_t *); 3766 extern int sigqueue(pid_t, int, const union sigval); 3767 extern int sigwaitinfo(const sigset_t *, siginfo_t *); 3768 extern int sigtimedwait(const sigset_t *, siginfo_t *, 3769 const struct timespec *); 3770 extern sighandler_t bsd_signal(int, sighandler_t); 3771 _________________________________________________________ 3772 3773 9.4.44. stddef.h 3774 3775 #define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER) 3776 #define NULL (0L) 3777 3778 typedef int wchar_t; 3779 _________________________________________________________ 3780 3781 9.4.45. stdio.h 3782 3783 #define EOF (-1) 3784 #define P_tmpdir "/tmp" 3785 #define FOPEN_MAX 16 3786 #define L_tmpnam 20 3787 #define FILENAME_MAX 4096 3788 #define BUFSIZ 8192 3789 #define L_ctermid 9 3790 #define L_cuserid 9 3791 3792 typedef struct { 3793 off_t __pos; 3794 mbstate_t __state; 3795 } fpos_t; 3796 typedef struct { 3797 off64_t __pos; 3798 mbstate_t __state; 3799 } fpos64_t; 3800 3801 typedef struct _IO_FILE FILE; 3802 3803 #define _IOFBF 0 3804 #define _IOLBF 1 3805 #define _IONBF 2 3806 3807 extern char *const _sys_errlist(void); 3808 extern void clearerr(FILE *); 3809 extern int fclose(FILE *); 3810 extern FILE *fdopen(int, const char *); 3811 extern int fflush_unlocked(FILE *); 3812 extern int fileno(FILE *); 3813 extern FILE *fopen(const char *, const char *); 3814 extern int fprintf(FILE *, const char *, ...); 3815 extern int fputc(int, FILE *); 3816 extern FILE *freopen(const char *, const char *, FILE *); 3817 extern FILE *freopen64(const char *, const char *, FILE *); 3818 extern int fscanf(FILE *, const char *, ...); 3819 extern int fseek(FILE *, long int, int); 3820 extern int fseeko(FILE *, off_t, int); 3821 extern int fseeko64(FILE *, loff_t, int); 3822 extern off_t ftello(FILE *); 3823 extern loff_t ftello64(FILE *); 3824 extern int getchar(void); 3825 extern int getchar_unlocked(void); 3826 extern int getw(FILE *); 3827 extern int pclose(FILE *); 3828 extern void perror(const char *); 3829 extern FILE *popen(const char *, const char *); 3830 extern int printf(const char *, ...); 3831 extern int putc_unlocked(int, FILE *); 3832 extern int putchar(int); 3833 extern int putchar_unlocked(int); 3834 extern int putw(int, FILE *); 3835 extern int remove(const char *); 3836 extern void rewind(FILE *); 3837 extern int scanf(const char *, ...); 3838 extern void setbuf(FILE *, char *); 3839 extern int sprintf(char *, const char *, ...); 3840 extern int sscanf(const char *, const char *, ...); 3841 extern FILE *stderr(void); 3842 extern FILE *stdin(void); 3843 extern FILE *stdout(void); 3844 extern char *tempnam(const char *, const char *); 3845 extern FILE *tmpfile64(void); 3846 extern FILE *tmpfile(void); 3847 extern char *tmpnam(char *); 3848 extern int vfprintf(FILE *, const char *, va_list); 3849 extern int vprintf(const char *, va_list); 3850 extern int feof(FILE *); 3851 extern int ferror(FILE *); 3852 extern int fflush(FILE *); 3853 extern int fgetc(FILE *); 3854 extern int fgetpos(FILE *, fpos_t *); 3855 extern char *fgets(char *, int, FILE *); 3856 extern int fputs(const char *, FILE *); 3857 extern size_t fread(void *, size_t, size_t, FILE *); 3858 extern int fsetpos(FILE *, const fpos_t *); 3859 extern long int ftell(FILE *); 3860 extern size_t fwrite(const void *, size_t, size_t, FILE *); 3861 extern int getc(FILE *); 3862 extern int putc(int, FILE *); 3863 extern int puts(const char *); 3864 extern int setvbuf(FILE *, char *, int, size_t); 3865 extern int snprintf(char *, size_t, const char *, ...); 3866 extern int ungetc(int, FILE *); 3867 extern int vsnprintf(char *, size_t, const char *, va_list); 3868 extern int vsprintf(char *, const char *, va_list); 3869 extern void flockfile(FILE *); 3870 extern int asprintf(char **, const char *, ...); 3871 extern int fgetpos64(FILE *, fpos64_t *); 3872 extern FILE *fopen64(const char *, const char *); 3873 extern int fsetpos64(FILE *, const fpos64_t *); 3874 extern int ftrylockfile(FILE *); 3875 extern void funlockfile(FILE *); 3876 extern int getc_unlocked(FILE *); 3877 extern void setbuffer(FILE *, char *, size_t); 3878 extern int vasprintf(char **, const char *, va_list); 3879 extern int vdprintf(int, const char *, va_list); 3880 extern int vfscanf(FILE *, const char *, va_list); 3881 extern int vscanf(const char *, va_list); 3882 extern int vsscanf(const char *, const char *, va_list); 3883 extern size_t __fpending(FILE *); 3884 _________________________________________________________ 3885 3886 9.4.46. stdlib.h 3887 3888 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 3889 #define EXIT_SUCCESS 0 3890 #define EXIT_FAILURE 1 3891 #define RAND_MAX 2147483647 3892 3893 typedef int (*__compar_fn_t) (const void *, const void *); 3894 struct random_data { 3895 int32_t *fptr; 3896 int32_t *rptr; 3897 int32_t *state; 3898 int rand_type; 3899 int rand_deg; 3900 int rand_sep; 3901 int32_t *end_ptr; 3902 }; 3903 3904 typedef struct { 3905 int quot; 3906 int rem; 3907 } div_t; 3908 3909 typedef struct { 3910 long int quot; 3911 long int rem; 3912 } ldiv_t; 3913 3914 typedef struct { 3915 long long int quot; 3916 long long int rem; 3917 } lldiv_t; 3918 extern double __strtod_internal(const char *, char **, int); 3919 extern float __strtof_internal(const char *, char **, int); 3920 extern long int __strtol_internal(const char *, char **, int, int); 3921 extern long double __strtold_internal(const char *, char **, int); 3922 extern long long int __strtoll_internal(const char *, char **, int, int); 3923 extern unsigned long int __strtoul_internal(const char *, char **, int, 3924 int); 3925 extern unsigned long long int __strtoull_internal(const char *, char **, 3926 int, int); 3927 extern long int a64l(const char *); 3928 extern void abort(void); 3929 extern int abs(int); 3930 extern double atof(const char *); 3931 extern int atoi(char *); 3932 extern long int atol(char *); 3933 extern long long int atoll(const char *); 3934 extern void *bsearch(const void *, const void *, size_t, size_t, 3935 __compar_fn_t); 3936 extern div_t div(int, int); 3937 extern double drand48(void); 3938 extern char *ecvt(double, int, int *, int *); 3939 extern double erand48(unsigned short); 3940 extern void exit(int); 3941 extern char *fcvt(double, int, int *, int *); 3942 extern char *gcvt(double, int, char *); 3943 extern char *getenv(const char *); 3944 extern int getsubopt(char **, char *const *, char **); 3945 extern int grantpt(int); 3946 extern long int jrand48(unsigned short); 3947 extern char *l64a(long int); 3948 extern long int labs(long int); 3949 extern void lcong48(unsigned short); 3950 extern ldiv_t ldiv(long int, long int); 3951 extern long long int llabs(long long int); 3952 extern lldiv_t lldiv(long long int, long long int); 3953 extern long int lrand48(void); 3954 extern int mblen(const char *, size_t); 3955 extern size_t mbstowcs(wchar_t *, const char *, size_t); 3956 extern int mbtowc(wchar_t *, const char *, size_t); 3957 extern char *mktemp(char *); 3958 extern long int mrand48(void); 3959 extern long int nrand48(unsigned short); 3960 extern char *ptsname(int); 3961 extern int putenv(char *); 3962 extern void qsort(void *, size_t, size_t, __compar_fn_t); 3963 extern int rand(void); 3964 extern int rand_r(unsigned int *); 3965 extern unsigned short *seed48(unsigned short); 3966 extern void srand48(long int); 3967 extern int unlockpt(int); 3968 extern size_t wcstombs(char *, const wchar_t *, size_t); 3969 extern int wctomb(char *, wchar_t); 3970 extern int system(const char *); 3971 extern void *calloc(size_t, size_t); 3972 extern void free(void *); 3973 extern char *initstate(unsigned int, char *, size_t); 3974 extern void *malloc(size_t); 3975 extern long int random(void); 3976 extern void *realloc(void *, size_t); 3977 extern char *setstate(char *); 3978 extern void srand(unsigned int); 3979 extern void srandom(unsigned int); 3980 extern double strtod(char *, char **); 3981 extern float strtof(const char *, char **); 3982 extern long int strtol(char *, char **, int); 3983 extern long double strtold(const char *, char **); 3984 extern long long int strtoll(const char *, char **, int); 3985 extern long long int strtoq(const char *, char **, int); 3986 extern unsigned long int strtoul(const char *, char **, int); 3987 extern unsigned long long int strtoull(const char *, char **, int); 3988 extern unsigned long long int strtouq(const char *, char **, int); 3989 extern void _Exit(int); 3990 extern size_t __ctype_get_mb_cur_max(void); 3991 extern char **environ(void); 3992 extern char *realpath(const char *, char *); 3993 extern int setenv(const char *, const char *, int); 3994 extern int unsetenv(const char *); 3995 extern int getloadavg(double, int); 3996 extern int mkstemp64(char *); 3997 extern int posix_memalign(void **, size_t, size_t); 3998 extern int posix_openpt(int); 3999 _________________________________________________________ 4000 4001 9.4.47. string.h 4002 4003 extern void *__mempcpy(void *, const void *, size_t); 4004 extern char *__stpcpy(char *, const char *); 4005 extern char *__strtok_r(char *, const char *, char **); 4006 extern void bcopy(void *, void *, size_t); 4007 extern void *memchr(void *, int, size_t); 4008 extern int memcmp(void *, void *, size_t); 4009 extern void *memcpy(void *, void *, size_t); 4010 extern void *memmem(const void *, size_t, const void *, size_t); 4011 extern void *memmove(void *, const void *, size_t); 4012 extern void *memset(void *, int, size_t); 4013 extern char *strcat(char *, const char *); 4014 extern char *strchr(char *, int); 4015 extern int strcmp(char *, char *); 4016 extern int strcoll(const char *, const char *); 4017 extern char *strcpy(char *, char *); 4018 extern size_t strcspn(const char *, const char *); 4019 extern char *strerror(int); 4020 extern size_t strlen(char *); 4021 extern char *strncat(char *, char *, size_t); 4022 extern int strncmp(char *, char *, size_t); 4023 extern char *strncpy(char *, char *, size_t); 4024 extern char *strpbrk(const char *, const char *); 4025 extern char *strrchr(char *, int); 4026 extern char *strsignal(int); 4027 extern size_t strspn(const char *, const char *); 4028 extern char *strstr(char *, char *); 4029 extern char *strtok(char *, const char *); 4030 extern size_t strxfrm(char *, const char *, size_t); 4031 extern int bcmp(void *, void *, size_t); 4032 extern void bzero(void *, size_t); 4033 extern int ffs(int); 4034 extern char *index(char *, int); 4035 extern void *memccpy(void *, const void *, int, size_t); 4036 extern char *rindex(char *, int); 4037 extern int strcasecmp(char *, char *); 4038 extern char *strdup(char *); 4039 extern int strncasecmp(char *, char *, size_t); 4040 extern char *strndup(const char *, size_t); 4041 extern size_t strnlen(const char *, size_t); 4042 extern char *strsep(char **, const char *); 4043 extern char *strerror_r(int, char *, size_t); 4044 extern char *strtok_r(char *, const char *, char **); 4045 extern char *strcasestr(const char *, const char *); 4046 extern char *stpcpy(char *, const char *); 4047 extern char *stpncpy(char *, const char *, size_t); 4048 extern void *memrchr(const void *, int, size_t); 4049 _________________________________________________________ 4050 4051 9.4.48. sys/file.h 4052 4053 #define LOCK_SH 1 4054 #define LOCK_EX 2 4055 #define LOCK_NB 4 4056 #define LOCK_UN 8 4057 4058 extern int flock(int, int); 4059 _________________________________________________________ 4060 4061 9.4.49. sys/ioctl.h 4062 4063 struct winsize { 4064 unsigned short ws_row; 4065 unsigned short ws_col; 4066 unsigned short ws_xpixel; 4067 unsigned short ws_ypixel; 4068 }; 4069 extern int ioctl(int, unsigned long int, ...); 4070 _________________________________________________________ 4071 4072 9.4.50. sys/ipc.h 4073 4074 #define IPC_PRIVATE ((key_t)0) 4075 #define IPC_RMID 0 4076 #define IPC_CREAT 00001000 4077 #define IPC_EXCL 00002000 4078 #define IPC_NOWAIT 00004000 4079 #define IPC_SET 1 4080 #define IPC_STAT 2 4081 4082 extern key_t ftok(char *, int); 4083 _________________________________________________________ 4084 4085 9.4.51. sys/mman.h 4086 4087 #define MAP_FAILED ((void*)-1) 4088 #define PROT_NONE 0x0 4089 #define MAP_SHARED 0x01 4090 #define MAP_PRIVATE 0x02 4091 #define PROT_READ 0x1 4092 #define MAP_FIXED 0x10 4093 #define PROT_WRITE 0x2 4094 #define MAP_ANONYMOUS 0x20 4095 #define PROT_EXEC 0x4 4096 #define MS_ASYNC 1 4097 #define MS_INVALIDATE 2 4098 #define MS_SYNC 4 4099 #define MAP_ANON MAP_ANONYMOUS 4100 4101 extern int msync(void *, size_t, int); 4102 extern int mlock(const void *, size_t); 4103 extern int mlockall(int); 4104 extern void *mmap(void *, size_t, int, int, int, off_t); 4105 extern int mprotect(void *, size_t, int); 4106 extern int munlock(const void *, size_t); 4107 extern int munlockall(void); 4108 extern int munmap(void *, size_t); 4109 extern void *mmap64(void *, size_t, int, int, int, off64_t); 4110 extern int shm_open(const char *, int, mode_t); 4111 extern int shm_unlink(const char *); 4112 _________________________________________________________ 4113 4114 9.4.52. sys/msg.h 4115 4116 #define MSG_NOERROR 010000 4117 4118 extern int msgctl(int, int, struct msqid_ds *); 4119 extern int msgget(key_t, int); 4120 extern int msgrcv(int, void *, size_t, long int, int); 4121 extern int msgsnd(int, const void *, size_t, int); 4122 _________________________________________________________ 4123 4124 9.4.53. sys/param.h 4125 4126 #define NOFILE 256 4127 #define MAXPATHLEN 4096 4128 _________________________________________________________ 4129 4130 9.4.54. sys/poll.h 4131 4132 #define POLLIN 0x0001 4133 #define POLLPRI 0x0002 4134 #define POLLOUT 0x0004 4135 #define POLLERR 0x0008 4136 #define POLLHUP 0x0010 4137 #define POLLNVAL 0x0020 4138 4139 struct pollfd { 4140 int fd; 4141 short events; 4142 short revents; 4143 }; 4144 typedef unsigned long int nfds_t; 4145 _________________________________________________________ 4146 4147 9.4.55. sys/resource.h 4148 4149 #define RUSAGE_CHILDREN (-1) 4150 #define RUSAGE_BOTH (-2) 4151 #define RLIM_INFINITY (~0UL) 4152 #define RLIM_SAVED_CUR -1 4153 #define RLIM_SAVED_MAX -1 4154 #define RLIMIT_CPU 0 4155 #define RUSAGE_SELF 0 4156 #define RLIMIT_FSIZE 1 4157 #define RLIMIT_DATA 2 4158 #define RLIMIT_STACK 3 4159 #define RLIMIT_CORE 4 4160 #define RLIMIT_NOFILE 7 4161 #define RLIMIT_AS 9 4162 4163 typedef unsigned long int rlim_t; 4164 typedef unsigned long long int rlim64_t; 4165 typedef int __rlimit_resource_t; 4166 4167 struct rlimit { 4168 rlim_t rlim_cur; 4169 rlim_t rlim_max; 4170 }; 4171 struct rlimit64 { 4172 rlim64_t rlim_cur; 4173 rlim64_t rlim_max; 4174 }; 4175 4176 struct rusage { 4177 struct timeval ru_utime; 4178 struct timeval ru_stime; 4179 long int ru_maxrss; 4180 long int ru_ixrss; 4181 long int ru_idrss; 4182 long int ru_isrss; 4183 long int ru_minflt; 4184 long int ru_majflt; 4185 long int ru_nswap; 4186 long int ru_inblock; 4187 long int ru_oublock; 4188 long int ru_msgsnd; 4189 long int ru_msgrcv; 4190 long int ru_nsignals; 4191 long int ru_nvcsw; 4192 long int ru_nivcsw; 4193 }; 4194 4195 enum __priority_which { 4196 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 4197 }; 4198 4199 #define PRIO_PGRP PRIO_PGRP 4200 #define PRIO_PROCESS PRIO_PROCESS 4201 #define PRIO_USER PRIO_USER 4202 4203 typedef enum __priority_which __priority_which_t; 4204 extern int getpriority(__priority_which_t, id_t); 4205 extern int getrlimit64(id_t, struct rlimit64 *); 4206 extern int setpriority(__priority_which_t, id_t, int); 4207 extern int setrlimit(__rlimit_resource_t, const struct rlimit *); 4208 extern int setrlimit64(__rlimit_resource_t, const struct rlimit64 *); 4209 extern int getrlimit(__rlimit_resource_t, struct rlimit *); 4210 extern int getrusage(int, struct rusage *); 4211 _________________________________________________________ 4212 4213 9.4.56. sys/sem.h 4214 4215 #define SEM_UNDO 0x1000 4216 #define GETPID 11 4217 #define GETVAL 12 4218 #define GETALL 13 4219 #define GETNCNT 14 4220 #define GETZCNT 15 4221 #define SETVAL 16 4222 #define SETALL 17 4223 4224 struct sembuf { 4225 short sem_num; 4226 short sem_op; 4227 short sem_flg; 4228 }; 4229 extern int semctl(int, int, int, ...); 4230 extern int semget(key_t, int, int); 4231 extern int semop(int, struct sembuf *, size_t); 4232 _________________________________________________________ 4233 4234 9.4.57. sys/shm.h 4235 4236 #define SHM_RDONLY 010000 4237 #define SHM_W 0200 4238 #define SHM_RND 020000 4239 #define SHM_R 0400 4240 #define SHM_REMAP 040000 4241 #define SHM_LOCK 11 4242 #define SHM_UNLOCK 12 4243 4244 extern int __getpagesize(void); 4245 extern void *shmat(int, const void *, int); 4246 extern int shmctl(int, int, struct shmid_ds *); 4247 extern int shmdt(const void *); 4248 extern int shmget(key_t, size_t, int); 4249 _________________________________________________________ 4250 4251 9.4.58. sys/socket.h 4252 4253 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 4254 #define SCM_RIGHTS 0x01 4255 #define SOL_SOCKET 1 4256 #define SOMAXCONN 128 4257 #define SOL_RAW 255 4258 #define CMSG_ALIGN(len) \ 4259 (((len)+sizeof(size_t)-1)&(size_t)~(sizeof(size_t)-1)) 4260 #define CMSG_DATA(cmsg) \ 4261 ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) 4262 #define CMSG_SPACE(len) \ 4263 (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len)) 4264 #define CMSG_FIRSTHDR(msg) \ 4265 ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ 4266 (struct cmsghdr *)(msg)->msg_control : \ 4267 (struct cmsghdr *)NULL) 4268 #define CMSG_NXTHDR(mhdr,cmsg) \ 4269 (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \ 4270 (((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) \ 4271 + CMSG_ALIGN(sizeof(struct cmsghdr)) > \ 4272 (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ?\ 4273 (struct cmsghdr *)NULL : \ 4274 (struct cmsghdr *)((u_char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len)))) 4275 4276 struct linger { 4277 int l_onoff; 4278 int l_linger; 4279 }; 4280 struct cmsghdr { 4281 size_t cmsg_len; 4282 int cmsg_level; 4283 int cmsg_type; 4284 }; 4285 struct iovec { 4286 void *iov_base; 4287 size_t iov_len; 4288 }; 4289 4290 typedef unsigned short sa_family_t; 4291 typedef unsigned int socklen_t; 4292 4293 struct sockaddr { 4294 sa_family_t sa_family; 4295 char sa_data[14]; 4296 }; 4297 struct sockaddr_storage { 4298 sa_family_t ss_family; 4299 __ss_aligntype __ss_align; 4300 char __ss_padding[(128 - (2 * sizeof(__ss_aligntype)))]; 4301 }; 4302 4303 struct msghdr { 4304 void *msg_name; 4305 int msg_namelen; 4306 struct iovec *msg_iov; 4307 size_t msg_iovlen; 4308 void *msg_control; 4309 size_t msg_controllen; 4310 unsigned int msg_flags; 4311 }; 4312 4313 #define AF_UNSPEC 0 4314 #define AF_UNIX 1 4315 #define AF_INET6 10 4316 #define AF_INET 2 4317 4318 #define PF_INET AF_INET 4319 #define PF_INET6 AF_INET6 4320 #define PF_UNIX AF_UNIX 4321 #define PF_UNSPEC AF_UNSPEC 4322 4323 #define SOCK_STREAM 1 4324 #define SOCK_PACKET 10 4325 #define SOCK_DGRAM 2 4326 #define SOCK_RAW 3 4327 #define SOCK_RDM 4 4328 #define SOCK_SEQPACKET 5 4329 4330 #define SO_DEBUG 1 4331 #define SO_OOBINLINE 10 4332 #define SO_NO_CHECK 11 4333 #define SO_PRIORITY 12 4334 #define SO_LINGER 13 4335 #define SO_REUSEADDR 2 4336 #define SO_TYPE 3 4337 #define SO_ACCEPTCONN 30 4338 #define SO_ERROR 4 4339 #define SO_DONTROUTE 5 4340 #define SO_BROADCAST 6 4341 #define SO_SNDBUF 7 4342 #define SO_RCVBUF 8 4343 #define SO_KEEPALIVE 9 4344 4345 #define SIOCGIFCONF 0x8912 4346 #define SIOCGIFFLAGS 0x8913 4347 #define SIOCGIFADDR 0x8915 4348 #define SIOCGIFNETMASK 0x891b 4349 4350 #define SHUT_RD 0 4351 #define SHUT_WR 1 4352 #define SHUT_RDWR 2 4353 #define MSG_DONTROUTE 4 4354 4355 #define MSG_WAITALL 0x100 4356 #define MSG_TRUNC 0x20 4357 #define MSG_EOR 0x80 4358 #define MSG_OOB 1 4359 #define MSG_PEEK 2 4360 #define MSG_CTRUNC 8 4361 4362 extern int bind(int, const struct sockaddr *, socklen_t); 4363 extern int getnameinfo(const struct sockaddr *, socklen_t, char *, 4364 socklen_t, char *, socklen_t, unsigned int); 4365 extern int getsockname(int, struct sockaddr *, socklen_t *); 4366 extern int listen(int, int); 4367 extern int setsockopt(int, int, int, const void *, socklen_t); 4368 extern int accept(int, struct sockaddr *, socklen_t *); 4369 extern int connect(int, const struct sockaddr *, socklen_t); 4370 extern ssize_t recv(int, void *, size_t, int); 4371 extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, 4372 socklen_t *); 4373 extern ssize_t recvmsg(int, struct msghdr *, int); 4374 extern ssize_t send(int, const void *, size_t, int); 4375 extern ssize_t sendmsg(int, const struct msghdr *, int); 4376 extern ssize_t sendto(int, const void *, size_t, int, 4377 const struct sockaddr *, socklen_t); 4378 extern int getpeername(int, struct sockaddr *, socklen_t *); 4379 extern int getsockopt(int, int, int, void *, socklen_t *); 4380 extern int shutdown(int, int); 4381 extern int socket(int, int, int); 4382 extern int socketpair(int, int, int, int); 4383 extern int sockatmark(int); 4384 _________________________________________________________ 4385 4386 9.4.59. sys/stat.h 4387 4388 #define S_ISBLK(m) (((m)&S_IFMT)==S_IFBLK) 4389 #define S_ISCHR(m) (((m)&S_IFMT)==S_IFCHR) 4390 #define S_ISDIR(m) (((m)&S_IFMT)==S_IFDIR) 4391 #define S_ISFIFO(m) (((m)&S_IFMT)==S_IFIFO) 4392 #define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) 4393 #define S_ISREG(m) (((m)&S_IFMT)==S_IFREG) 4394 #define S_ISSOCK(m) (((m)&S_IFMT)==S_IFSOCK) 4395 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 4396 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 4397 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 4398 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 4399 #define S_IROTH (S_IRGRP>>3) 4400 #define S_IRGRP (S_IRUSR>>3) 4401 #define S_IRWXO (S_IRWXG>>3) 4402 #define S_IRWXG (S_IRWXU>>3) 4403 #define S_IWOTH (S_IWGRP>>3) 4404 #define S_IWGRP (S_IWUSR>>3) 4405 #define S_IXOTH (S_IXGRP>>3) 4406 #define S_IXGRP (S_IXUSR>>3) 4407 #define S_ISVTX 01000 4408 #define S_IXUSR 0x0040 4409 #define S_IWUSR 0x0080 4410 #define S_IRUSR 0x0100 4411 #define S_ISGID 0x0400 4412 #define S_ISUID 0x0800 4413 #define S_IFIFO 0x1000 4414 #define S_IFCHR 0x2000 4415 #define S_IFDIR 0x4000 4416 #define S_IFBLK 0x6000 4417 #define S_IFREG 0x8000 4418 #define S_IFLNK 0xa000 4419 #define S_IFSOCK 0xc000 4420 #define S_IFMT 0xf000 4421 #define st_atime st_atim.tv_sec 4422 #define st_ctime st_ctim.tv_sec 4423 #define st_mtime st_mtim.tv_sec 4424 #define S_IREAD S_IRUSR 4425 #define S_IWRITE S_IWUSR 4426 #define S_IEXEC S_IXUSR 4427 4428 extern int __fxstat(int, int, struct stat *); 4429 extern int __fxstat64(int, int, struct stat64 *); 4430 extern int __lxstat(int, char *, struct stat *); 4431 extern int __lxstat64(int, const char *, struct stat64 *); 4432 extern int __xmknod(int, const char *, mode_t, dev_t *); 4433 extern int __xstat(int, const char *, struct stat *); 4434 extern int __xstat64(int, const char *, struct stat64 *); 4435 extern int mkfifo(const char *, mode_t); 4436 extern int chmod(const char *, mode_t); 4437 extern int fchmod(int, mode_t); 4438 extern mode_t umask(mode_t); 4439 _________________________________________________________ 4440 4441 9.4.60. sys/statvfs.h 4442 4443 extern int fstatvfs(int, struct statvfs *); 4444 extern int fstatvfs64(int, struct statvfs64 *); 4445 extern int statvfs(const char *, struct statvfs *); 4446 extern int statvfs64(const char *, struct statvfs64 *); 4447 _________________________________________________________ 4448 4449 9.4.61. sys/time.h 4450 4451 #define ITIMER_REAL 0 4452 #define ITIMER_VIRTUAL 1 4453 #define ITIMER_PROF 2 4454 4455 struct timezone { 4456 int tz_minuteswest; 4457 int tz_dsttime; 4458 }; 4459 4460 typedef int __itimer_which_t; 4461 4462 struct timespec { 4463 time_t tv_sec; 4464 long int tv_nsec; 4465 }; 4466 4467 struct timeval { 4468 time_t tv_sec; 4469 suseconds_t tv_usec; 4470 }; 4471 4472 struct itimerval { 4473 struct timeval it_interval; 4474 struct timeval it_value; 4475 }; 4476 extern int getitimer(__itimer_which_t, struct itimerval *); 4477 extern int setitimer(__itimer_which_t, const struct itimerval *, 4478 struct itimerval *); 4479 extern int adjtime(const struct timeval *, struct timeval *); 4480 extern int gettimeofday(struct timeval *, struct timezone *); 4481 extern int utimes(const char *, const struct timeval *); 4482 _________________________________________________________ 4483 4484 9.4.62. sys/timeb.h 4485 4486 struct timeb { 4487 time_t time; 4488 unsigned short millitm; 4489 short timezone; 4490 short dstflag; 4491 }; 4492 extern int ftime(struct timeb *); 4493 _________________________________________________________ 4494 4495 9.4.63. sys/times.h 4496 4497 struct tms { 4498 clock_t tms_utime; 4499 clock_t tms_stime; 4500 clock_t tms_cutime; 4501 clock_t tms_cstime; 4502 }; 4503 extern clock_t times(struct tms *); 4504 _________________________________________________________ 4505 4506 9.4.64. sys/types.h 4507 4508 #define FALSE 0 4509 #define TRUE 1 4510 #define FD_SETSIZE 1024 4511 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 4512 #define FD_ISSET(d,set) \ 4513 ((set)->fds_bits[((d)/(8*sizeof(long)))]&(1<<((d)%(8*sizeof(long))))) 4514 #define FD_CLR(d,set) \ 4515 ((set)->fds_bits[((d)/(8*sizeof(long)))]&=~(1<<((d)%(8*sizeof(long))))) 4516 #define FD_SET(d,set) \ 4517 ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 4518 4519 typedef signed char int8_t; 4520 typedef short int16_t; 4521 typedef int int32_t; 4522 typedef unsigned char u_int8_t; 4523 typedef unsigned short u_int16_t; 4524 typedef unsigned int u_int32_t; 4525 typedef unsigned int uid_t; 4526 typedef int pid_t; 4527 typedef long int off_t; 4528 typedef int key_t; 4529 typedef long int suseconds_t; 4530 typedef unsigned int u_int; 4531 typedef struct { 4532 int __val[2]; 4533 } fsid_t; 4534 typedef unsigned int useconds_t; 4535 typedef unsigned long int blksize_t; 4536 typedef long int fd_mask; 4537 typedef int timer_t; 4538 typedef int clockid_t; 4539 4540 typedef unsigned int id_t; 4541 4542 typedef unsigned long long int ino64_t; 4543 typedef long long int loff_t; 4544 typedef unsigned long int blkcnt_t; 4545 typedef unsigned long int fsblkcnt_t; 4546 typedef unsigned long int fsfilcnt_t; 4547 typedef unsigned long long int blkcnt64_t; 4548 typedef unsigned long long int fsblkcnt64_t; 4549 typedef unsigned long long int fsfilcnt64_t; 4550 typedef unsigned char u_char; 4551 typedef unsigned short u_short; 4552 typedef unsigned long int u_long; 4553 4554 typedef unsigned long int ino_t; 4555 typedef unsigned int gid_t; 4556 typedef unsigned long long int dev_t; 4557 typedef unsigned int mode_t; 4558 typedef unsigned long int nlink_t; 4559 typedef char *caddr_t; 4560 4561 typedef struct { 4562 unsigned long int fds_bits[__FDSET_LONGS]; 4563 } fd_set; 4564 4565 typedef long int clock_t; 4566 typedef long int time_t; 4567 _________________________________________________________ 4568 4569 9.4.65. sys/uio.h 4570 4571 extern ssize_t readv(int, const struct iovec *, int); 4572 extern ssize_t writev(int, const struct iovec *, int); 4573 _________________________________________________________ 4574 4575 9.4.66. sys/un.h 4576 4577 #define UNIX_PATH_MAX 108 4578 4579 struct sockaddr_un { 4580 sa_family_t sun_family; 4581 char sun_path[UNIX_PATH_MAX]; 4582 }; 4583 _________________________________________________________ 4584 4585 9.4.67. sys/utsname.h 4586 4587 #define SYS_NMLN 65 4588 4589 struct utsname { 4590 char sysname[65]; 4591 char nodename[65]; 4592 char release[65]; 4593 char version[65]; 4594 char machine[65]; 4595 char domainname[65]; 4596 }; 4597 extern int uname(struct utsname *); 4598 _________________________________________________________ 4599 4600 9.4.68. sys/wait.h 4601 4602 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) 4603 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 4604 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 4605 #define WTERMSIG(status) ((status) & 0x7f) 4606 #define WCOREDUMP(status) ((status) & 0x80) 4607 #define WIFEXITED(status) (WTERMSIG(status) == 0) 4608 #define WNOHANG 0x00000001 4609 #define WUNTRACED 0x00000002 4610 #define WCOREFLAG 0x80 4611 #define WSTOPSIG(status) WEXITSTATUS(status) 4612 4613 typedef enum { 4614 P_ALL, P_PID, P_PGID 4615 } idtype_t; 4616 extern pid_t wait(int *); 4617 extern pid_t waitpid(pid_t, int *, int); 4618 extern pid_t wait4(pid_t, int *, int, struct rusage *); 4619 _________________________________________________________ 4620 4621 9.4.69. syslog.h 4622 4623 #define LOG_EMERG 0 4624 #define LOG_PRIMASK 0x07 4625 #define LOG_ALERT 1 4626 #define LOG_CRIT 2 4627 #define LOG_ERR 3 4628 #define LOG_WARNING 4 4629 #define LOG_NOTICE 5 4630 #define LOG_INFO 6 4631 #define LOG_DEBUG 7 4632 4633 #define LOG_KERN (0<<3) 4634 #define LOG_AUTHPRIV (10<<3) 4635 #define LOG_FTP (11<<3) 4636 #define LOG_USER (1<<3) 4637 #define LOG_MAIL (2<<3) 4638 #define LOG_DAEMON (3<<3) 4639 #define LOG_AUTH (4<<3) 4640 #define LOG_SYSLOG (5<<3) 4641 #define LOG_LPR (6<<3) 4642 #define LOG_NEWS (7<<3) 4643 #define LOG_UUCP (8<<3) 4644 #define LOG_CRON (9<<3) 4645 #define LOG_FACMASK 0x03f8 4646 4647 #define LOG_LOCAL0 (16<<3) 4648 #define LOG_LOCAL1 (17<<3) 4649 #define LOG_LOCAL2 (18<<3) 4650 #define LOG_LOCAL3 (19<<3) 4651 #define LOG_LOCAL4 (20<<3) 4652 #define LOG_LOCAL5 (21<<3) 4653 #define LOG_LOCAL6 (22<<3) 4654 #define LOG_LOCAL7 (23<<3) 4655 4656 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 4657 #define LOG_MASK(pri) (1 << (pri)) 4658 4659 #define LOG_PID 0x01 4660 #define LOG_CONS 0x02 4661 #define LOG_ODELAY 0x04 4662 #define LOG_NDELAY 0x08 4663 #define LOG_NOWAIT 0x10 4664 #define LOG_PERROR 0x20 4665 4666 extern void closelog(void); 4667 extern void openlog(const char *, int, int); 4668 extern int setlogmask(int); 4669 extern void syslog(int, const char *, ...); 4670 extern void vsyslog(int, const char *, va_list); 4671 _________________________________________________________ 4672 4673 9.4.70. termios.h 4674 4675 #define TCIFLUSH 0 4676 #define TCOOFF 0 4677 #define TCSANOW 0 4678 #define BS0 0000000 4679 #define CR0 0000000 4680 #define FF0 0000000 4681 #define NL0 0000000 4682 #define TAB0 0000000 4683 #define VT0 0000000 4684 #define OPOST 0000001 4685 #define OCRNL 0000010 4686 #define ONOCR 0000020 4687 #define ONLRET 0000040 4688 #define OFILL 0000100 4689 #define OFDEL 0000200 4690 #define NL1 0000400 4691 #define TCOFLUSH 1 4692 #define TCOON 1 4693 #define TCSADRAIN 1 4694 #define TCIOFF 2 4695 #define TCIOFLUSH 2 4696 #define TCSAFLUSH 2 4697 #define TCION 3 4698 4699 typedef unsigned int speed_t; 4700 typedef unsigned char cc_t; 4701 typedef unsigned int tcflag_t; 4702 4703 #define NCCS 32 4704 4705 struct termios { 4706 tcflag_t c_iflag; 4707 tcflag_t c_oflag; 4708 tcflag_t c_cflag; 4709 tcflag_t c_lflag; 4710 cc_t c_line; 4711 cc_t c_cc[NCCS]; 4712 speed_t c_ispeed; 4713 speed_t c_ospeed; 4714 }; 4715 4716 #define VINTR 0 4717 #define VQUIT 1 4718 #define VLNEXT 15 4719 #define VERASE 2 4720 #define VKILL 3 4721 #define VEOF 4 4722 4723 #define IGNBRK 0000001 4724 #define BRKINT 0000002 4725 #define IGNPAR 0000004 4726 #define PARMRK 0000010 4727 #define INPCK 0000020 4728 #define ISTRIP 0000040 4729 #define INLCR 0000100 4730 #define IGNCR 0000200 4731 #define ICRNL 0000400 4732 #define IXANY 0004000 4733 #define IMAXBEL 0020000 4734 4735 #define CS5 0000000 4736 4737 #define ECHO 0000010 4738 4739 #define B0 0000000 4740 #define B50 0000001 4741 #define B75 0000002 4742 #define B110 0000003 4743 #define B134 0000004 4744 #define B150 0000005 4745 #define B200 0000006 4746 #define B300 0000007 4747 #define B600 0000010 4748 #define B1200 0000011 4749 #define B1800 0000012 4750 #define B2400 0000013 4751 #define B4800 0000014 4752 #define B9600 0000015 4753 #define B19200 0000016 4754 #define B38400 0000017 4755 4756 extern speed_t cfgetispeed(const struct termios *); 4757 extern speed_t cfgetospeed(const struct termios *); 4758 extern void cfmakeraw(struct termios *); 4759 extern int cfsetispeed(struct termios *, speed_t); 4760 extern int cfsetospeed(struct termios *, speed_t); 4761 extern int cfsetspeed(struct termios *, speed_t); 4762 extern int tcflow(int, int); 4763 extern int tcflush(int, int); 4764 extern pid_t tcgetsid(int); 4765 extern int tcsendbreak(int, int); 4766 extern int tcsetattr(int, int, const struct termios *); 4767 extern int tcdrain(int); 4768 extern int tcgetattr(int, struct termios *); 4769 _________________________________________________________ 4770 4771 9.4.71. time.h 4772 4773 #define CLK_TCK ((clock_t)__sysconf(2)) 4774 #define CLOCK_REALTIME 0 4775 #define TIMER_ABSTIME 1 4776 #define CLOCKS_PER_SEC 1000000l 4777 4778 struct tm { 4779 int tm_sec; 4780 int tm_min; 4781 int tm_hour; 4782 int tm_mday; 4783 int tm_mon; 4784 int tm_year; 4785 int tm_wday; 4786 int tm_yday; 4787 int tm_isdst; 4788 long int tm_gmtoff; 4789 char *tm_zone; 4790 }; 4791 struct itimerspec { 4792 struct timespec it_interval; 4793 struct timespec it_value; 4794 }; 4795 4796 extern int __daylight(void); 4797 extern long int __timezone(void); 4798 extern char *__tzname(void); 4799 extern char *asctime(const struct tm *); 4800 extern clock_t clock(void); 4801 extern char *ctime(const time_t *); 4802 extern char *ctime_r(const time_t *, char *); 4803 extern double difftime(time_t, time_t); 4804 extern struct tm *getdate(const char *); 4805 extern int getdate_err(void); 4806 extern struct tm *gmtime(const time_t *); 4807 extern struct tm *localtime(const time_t *); 4808 extern time_t mktime(struct tm *); 4809 extern int stime(const time_t *); 4810 extern size_t strftime(char *, size_t, const char *, const struct tm *); 4811 extern char *strptime(const char *, const char *, struct tm *); 4812 extern time_t time(time_t *); 4813 extern int nanosleep(const struct timespec *, struct timespec *); 4814 extern int daylight(void); 4815 extern long int timezone(void); 4816 extern char *tzname(void); 4817 extern void tzset(void); 4818 extern char *asctime_r(const struct tm *, char *); 4819 extern struct tm *gmtime_r(const time_t *, struct tm *); 4820 extern struct tm *localtime_r(const time_t *, struct tm *); 4821 extern int clock_getcpuclockid(pid_t, clockid_t *); 4822 extern int clock_getres(clockid_t, struct timespec *); 4823 extern int clock_gettime(clockid_t, struct timespec *); 4824 extern int clock_nanosleep(clockid_t, int, const struct timespec *, 4825 struct timespec *); 4826 extern int clock_settime(clockid_t, const struct timespec *); 4827 extern int timer_create(clockid_t, struct sigevent *, timer_t *); 4828 extern int timer_delete(timer_t); 4829 extern int timer_getoverrun(timer_t); 4830 extern int timer_gettime(timer_t, struct itimerspec *); 4831 extern int timer_settime(timer_t, int, const struct itimerspec *, 4832 struct itimerspec *); 4833 _________________________________________________________ 4834 4835 9.4.72. ucontext.h 4836 4837 extern int getcontext(ucontext_t *); 4838 extern int makecontext(ucontext_t *, void (*func) (void) 4839 , int, ...); 4840 extern int setcontext(const struct ucontext *); 4841 extern int swapcontext(ucontext_t *, const struct ucontext *); 4842 _________________________________________________________ 4843 4844 9.4.73. ulimit.h 4845 4846 #define UL_GETFSIZE 1 4847 #define UL_SETFSIZE 2 4848 4849 extern long int ulimit(int, ...); 4850 _________________________________________________________ 4851 4852 9.4.74. unistd.h 4853 4854 #define SEEK_SET 0 4855 #define STDIN_FILENO 0 4856 #define SEEK_CUR 1 4857 #define STDOUT_FILENO 1 4858 #define SEEK_END 2 4859 #define STDERR_FILENO 2 4860 4861 typedef long long int off64_t; 4862 4863 #define F_OK 0 4864 #define X_OK 1 4865 #define W_OK 2 4866 #define R_OK 4 4867 4868 #define _POSIX_VDISABLE '\0' 4869 #define _POSIX_CHOWN_RESTRICTED 1 4870 #define _POSIX_JOB_CONTROL 1 4871 #define _POSIX_NO_TRUNC 1 4872 #define _POSIX_SHELL 1 4873 #define _POSIX_FSYNC 200112 4874 #define _POSIX_MAPPED_FILES 200112 4875 #define _POSIX_MEMLOCK 200112 4876 #define _POSIX_MEMLOCK_RANGE 200112 4877 #define _POSIX_MEMORY_PROTECTION 200112 4878 #define _POSIX_SEMAPHORES 200112 4879 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 4880 #define _POSIX_TIMERS 200112 4881 #define _POSIX2_C_BIND 200112L 4882 #define _POSIX_THREADS 200112L 4883 4884 #define _PC_LINK_MAX 0 4885 #define _PC_MAX_CANON 1 4886 #define _PC_ASYNC_IO 10 4887 #define _PC_PRIO_IO 11 4888 #define _PC_FILESIZEBITS 13 4889 #define _PC_REC_INCR_XFER_SIZE 14 4890 #define _PC_REC_MIN_XFER_SIZE 16 4891 #define _PC_REC_XFER_ALIGN 17 4892 #define _PC_ALLOC_SIZE_MIN 18 4893 #define _PC_MAX_INPUT 2 4894 #define _PC_2_SYMLINKS 20 4895 #define _PC_NAME_MAX 3 4896 #define _PC_PATH_MAX 4 4897 #define _PC_PIPE_BUF 5 4898 #define _PC_CHOWN_RESTRICTED 6 4899 #define _PC_NO_TRUNC 7 4900 #define _PC_VDISABLE 8 4901 #define _PC_SYNC_IO 9 4902 4903 #define _SC_ARG_MAX 0 4904 #define _SC_CHILD_MAX 1 4905 #define _SC_PRIORITY_SCHEDULING 10 4906 #define _SC_TIMERS 11 4907 #define _SC_ASYNCHRONOUS_IO 12 4908 #define _SC_XBS5_ILP32_OFF32 125 4909 #define _SC_XBS5_ILP32_OFFBIG 126 4910 #define _SC_XBS5_LP64_OFF64 127 4911 #define _SC_XBS5_LPBIG_OFFBIG 128 4912 #define _SC_XOPEN_LEGACY 129 4913 #define _SC_PRIORITIZED_IO 13 4914 #define _SC_XOPEN_REALTIME 130 4915 #define _SC_XOPEN_REALTIME_THREADS 131 4916 #define _SC_ADVISORY_INFO 132 4917 #define _SC_BARRIERS 133 4918 #define _SC_CLOCK_SELECTION 137 4919 #define _SC_CPUTIME 138 4920 #define _SC_THREAD_CPUTIME 139 4921 #define _SC_SYNCHRONIZED_IO 14 4922 #define _SC_MONOTONIC_CLOCK 149 4923 #define _SC_FSYNC 15 4924 #define _SC_READER_WRITER_LOCKS 153 4925 #define _SC_SPIN_LOCKS 154 4926 #define _SC_REGEXP 155 4927 #define _SC_SHELL 157 4928 #define _SC_SPAWN 159 4929 #define _SC_MAPPED_FILES 16 4930 #define _SC_SPORADIC_SERVER 160 4931 #define _SC_THREAD_SPORADIC_SERVER 161 4932 #define _SC_TIMEOUTS 164 4933 #define _SC_TYPED_MEMORY_OBJECTS 165 4934 #define _SC_2_PBS_ACCOUNTING 169 4935 #define _SC_MEMLOCK 17 4936 #define _SC_2_PBS_LOCATE 170 4937 #define _SC_2_PBS_MESSAGE 171 4938 #define _SC_2_PBS_TRACK 172 4939 #define _SC_SYMLOOP_MAX 173 4940 #define _SC_2_PBS_CHECKPOINT 175 4941 #define _SC_V6_ILP32_OFF32 176 4942 #define _SC_V6_ILP32_OFFBIG 177 4943 #define _SC_V6_LP64_OFF64 178 4944 #define _SC_V6_LPBIG_OFFBIG 179 4945 #define _SC_MEMLOCK_RANGE 18 4946 #define _SC_HOST_NAME_MAX 180 4947 #define _SC_TRACE 181 4948 #define _SC_TRACE_EVENT_FILTER 182 4949 #define _SC_TRACE_INHERIT 183 4950 #define _SC_TRACE_LOG 184 4951 #define _SC_MEMORY_PROTECTION 19 4952 #define _SC_CLK_TCK 2 4953 #define _SC_MESSAGE_PASSING 20 4954 #define _SC_SEMAPHORES 21 4955 #define _SC_SHARED_MEMORY_OBJECTS 22 4956 #define _SC_AIO_LISTIO_MAX 23 4957 #define _SC_AIO_MAX 24 4958 #define _SC_AIO_PRIO_DELTA_MAX 25 4959 #define _SC_DELAYTIMER_MAX 26 4960 #define _SC_MQ_OPEN_MAX 27 4961 #define _SC_MQ_PRIO_MAX 28 4962 #define _SC_VERSION 29 4963 #define _SC_NGROUPS_MAX 3 4964 #define _SC_PAGESIZE 30 4965 #define _SC_PAGE_SIZE 30 4966 #define _SC_RTSIG_MAX 31 4967 #define _SC_SEM_NSEMS_MAX 32 4968 #define _SC_SEM_VALUE_MAX 33 4969 #define _SC_SIGQUEUE_MAX 34 4970 #define _SC_TIMER_MAX 35 4971 #define _SC_BC_BASE_MAX 36 4972 #define _SC_BC_DIM_MAX 37 4973 #define _SC_BC_SCALE_MAX 38 4974 #define _SC_BC_STRING_MAX 39 4975 #define _SC_OPEN_MAX 4 4976 #define _SC_COLL_WEIGHTS_MAX 40 4977 #define _SC_EXPR_NEST_MAX 42 4978 #define _SC_LINE_MAX 43 4979 #define _SC_RE_DUP_MAX 44 4980 #define _SC_2_VERSION 46 4981 #define _SC_2_C_BIND 47 4982 #define _SC_2_C_DEV 48 4983 #define _SC_2_FORT_DEV 49 4984 #define _SC_STREAM_MAX 5 4985 #define _SC_2_FORT_RUN 50 4986 #define _SC_2_SW_DEV 51 4987 #define _SC_2_LOCALEDEF 52 4988 #define _SC_TZNAME_MAX 6 4989 #define _SC_IOV_MAX 60 4990 #define _SC_THREADS 67 4991 #define _SC_THREAD_SAFE_FUNCTIONS 68 4992 #define _SC_GETGR_R_SIZE_MAX 69 4993 #define _SC_JOB_CONTROL 7 4994 #define _SC_GETPW_R_SIZE_MAX 70 4995 #define _SC_LOGIN_NAME_MAX 71 4996 #define _SC_TTY_NAME_MAX 72 4997 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 4998 #define _SC_THREAD_KEYS_MAX 74 4999 #define _SC_THREAD_STACK_MIN 75 5000 #define _SC_THREAD_THREADS_MAX 76 5001 #define _SC_THREAD_ATTR_STACKADDR 77 5002 #define _SC_THREAD_ATTR_STACKSIZE 78 5003 #define _SC_THREAD_PRIORITY_SCHEDULING 79 5004 #define _SC_SAVED_IDS 8 5005 #define _SC_THREAD_PRIO_INHERIT 80 5006 #define _SC_THREAD_PRIO_PROTECT 81 5007 #define _SC_THREAD_PROCESS_SHARED 82 5008 #define _SC_ATEXIT_MAX 87 5009 #define _SC_PASS_MAX 88 5010 #define _SC_XOPEN_VERSION 89 5011 #define _SC_REALTIME_SIGNALS 9 5012 #define _SC_XOPEN_UNIX 91 5013 #define _SC_XOPEN_CRYPT 92 5014 #define _SC_XOPEN_ENH_I18N 93 5015 #define _SC_XOPEN_SHM 94 5016 #define _SC_2_CHAR_TERM 95 5017 #define _SC_2_C_VERSION 96 5018 #define _SC_2_UPE 97 5019 5020 #define _CS_PATH 0 5021 #define _POSIX_REGEXP 1 5022 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 5023 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 5024 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 5025 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 5026 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 5027 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 5028 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 5029 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 5030 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 5031 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 5032 #define _CS_XBS5_LP64_OFF64_LIBS 1110 5033 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 5034 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 5035 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 5036 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 5037 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 5038 5039 #define _XOPEN_XPG4 1 5040 5041 #define F_ULOCK 0 5042 #define F_LOCK 1 5043 #define F_TLOCK 2 5044 #define F_TEST 3 5045 5046 extern char **__environ(void); 5047 extern pid_t __getpgid(pid_t); 5048 extern void _exit(int); 5049 extern int acct(const char *); 5050 extern unsigned int alarm(unsigned int); 5051 extern int chown(const char *, uid_t, gid_t); 5052 extern int chroot(const char *); 5053 extern size_t confstr(int, char *, size_t); 5054 extern int creat(const char *, mode_t); 5055 extern int creat64(const char *, mode_t); 5056 extern char *ctermid(char *); 5057 extern char *cuserid(char *); 5058 extern int daemon(int, int); 5059 extern int execl(const char *, const char *, ...); 5060 extern int execle(const char *, const char *, ...); 5061 extern int execlp(const char *, const char *, ...); 5062 extern int execv(const char *, char *const); 5063 extern int execvp(const char *, char *const); 5064 extern int fdatasync(int); 5065 extern int ftruncate64(int, off64_t); 5066 extern long int gethostid(void); 5067 extern char *getlogin(void); 5068 extern int getlogin_r(char *, size_t); 5069 extern int getopt(int, char *const, const char *); 5070 extern pid_t getpgrp(void); 5071 extern pid_t getsid(pid_t); 5072 extern char *getwd(char *); 5073 extern int lockf(int, int, off_t); 5074 extern int mkstemp(char *); 5075 extern int nice(int); 5076 extern char *optarg(void); 5077 extern int opterr(void); 5078 extern int optind(void); 5079 extern int optopt(void); 5080 extern int rename(const char *, const char *); 5081 extern int setegid(gid_t); 5082 extern int seteuid(uid_t); 5083 extern int sethostname(const char *, size_t); 5084 extern int setpgrp(void); 5085 extern void swab(const void *, void *, ssize_t); 5086 extern void sync(void); 5087 extern pid_t tcgetpgrp(int); 5088 extern int tcsetpgrp(int, pid_t); 5089 extern int truncate(const char *, off_t); 5090 extern int truncate64(const char *, off64_t); 5091 extern char *ttyname(int); 5092 extern unsigned int ualarm(useconds_t, useconds_t); 5093 extern int usleep(useconds_t); 5094 extern int close(int); 5095 extern int fsync(int); 5096 extern off_t lseek(int, off_t, int); 5097 extern int open(const char *, int, ...); 5098 extern int pause(void); 5099 extern ssize_t read(int, void *, size_t); 5100 extern ssize_t write(int, const void *, size_t); 5101 extern char *crypt(char *, char *); 5102 extern void encrypt(char *, int); 5103 extern void setkey(const char *); 5104 extern int access(const char *, int); 5105 extern int brk(void *); 5106 extern int chdir(const char *); 5107 extern int dup(int); 5108 extern int dup2(int, int); 5109 extern int execve(const char *, char *const, char *const); 5110 extern int fchdir(int); 5111 extern int fchown(int, uid_t, gid_t); 5112 extern pid_t fork(void); 5113 extern gid_t getegid(void); 5114 extern uid_t geteuid(void); 5115 extern gid_t getgid(void); 5116 extern int getgroups(int, gid_t); 5117 extern int gethostname(char *, size_t); 5118 extern pid_t getpgid(pid_t); 5119 extern pid_t getpid(void); 5120 extern uid_t getuid(void); 5121 extern int lchown(const char *, uid_t, gid_t); 5122 extern int link(const char *, const char *); 5123 extern int mkdir(const char *, mode_t); 5124 extern long int pathconf(const char *, int); 5125 extern int pipe(int); 5126 extern int readlink(const char *, char *, size_t); 5127 extern int rmdir(const char *); 5128 extern void *sbrk(ptrdiff_t); 5129 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 5130 extern int setgid(gid_t); 5131 extern int setpgid(pid_t, pid_t); 5132 extern int setregid(gid_t, gid_t); 5133 extern int setreuid(uid_t, uid_t); 5134 extern pid_t setsid(void); 5135 extern int setuid(uid_t); 5136 extern unsigned int sleep(unsigned int); 5137 extern int symlink(const char *, const char *); 5138 extern long int sysconf(int); 5139 extern int unlink(const char *); 5140 extern pid_t vfork(void); 5141 extern ssize_t pread(int, void *, size_t, off_t); 5142 extern ssize_t pwrite(int, const void *, size_t, off_t); 5143 extern char **_environ(void); 5144 extern long int fpathconf(int, int); 5145 extern int ftruncate(int, off_t); 5146 extern char *getcwd(char *, size_t); 5147 extern int getpagesize(void); 5148 extern pid_t getppid(void); 5149 extern int isatty(int); 5150 extern loff_t lseek64(int, loff_t, int); 5151 extern int open64(const char *, int, ...); 5152 extern ssize_t pread64(int, void *, size_t, off64_t); 5153 extern ssize_t pwrite64(int, const void *, size_t, off64_t); 5154 extern int ttyname_r(int, char *, size_t); 5155 _________________________________________________________ 5156 5157 9.4.75. utime.h 5158 5159 struct utimbuf { 5160 time_t actime; 5161 time_t modtime; 5162 }; 5163 extern int utime(const char *, const struct utimbuf *); 5164 _________________________________________________________ 5165 5166 9.4.76. utmp.h 5167 5168 #define UT_HOSTSIZE 256 5169 #define UT_LINESIZE 32 5170 #define UT_NAMESIZE 32 5171 5172 struct exit_status { 5173 short e_termination; 5174 short e_exit; 5175 }; 5176 5177 #define EMPTY 0 5178 #define RUN_LVL 1 5179 #define BOOT_TIME 2 5180 #define NEW_TIME 3 5181 #define OLD_TIME 4 5182 #define INIT_PROCESS 5 5183 #define LOGIN_PROCESS 6 5184 #define USER_PROCESS 7 5185 #define DEAD_PROCESS 8 5186 #define ACCOUNTING 9 5187 5188 extern void endutent(void); 5189 extern struct utmp *getutent(void); 5190 extern void setutent(void); 5191 extern int getutent_r(struct utmp *, struct utmp **); 5192 extern int utmpname(const char *); 5193 extern int login_tty(int); 5194 extern void login(const struct utmp *); 5195 extern int logout(const char *); 5196 extern void logwtmp(const char *, const char *, const char *); 5197 _________________________________________________________ 5198 5199 9.4.77. utmpx.h 5200 5201 extern void endutxent(void); 5202 extern struct utmpx *getutxent(void); 5203 extern struct utmpx *getutxid(const struct utmpx *); 5204 extern struct utmpx *getutxline(const struct utmpx *); 5205 extern struct utmpx *pututxline(const struct utmpx *); 5206 extern void setutxent(void); 5207 _________________________________________________________ 5208 5209 9.4.78. wchar.h 5210 5211 #define WEOF (0xffffffffu) 5212 #define WCHAR_MAX 0x7FFFFFFF 5213 #define WCHAR_MIN 0x80000000 5214 5215 extern double __wcstod_internal(const wchar_t *, wchar_t * *, int); 5216 extern float __wcstof_internal(const wchar_t *, wchar_t * *, int); 5217 extern long int __wcstol_internal(const wchar_t *, wchar_t * *, int, int); 5218 extern long double __wcstold_internal(const wchar_t *, wchar_t * *, int); 5219 extern unsigned long int __wcstoul_internal(const wchar_t *, wchar_t **, 5220 int, int); 5221 extern wchar_t *wcscat(wchar_t *, const wchar_t *); 5222 extern wchar_t *wcschr(const wchar_t *, wchar_t); 5223 extern int wcscmp(const wchar_t *, const wchar_t *); 5224 extern int wcscoll(const wchar_t *, const wchar_t *); 5225 extern wchar_t *wcscpy(wchar_t *, const wchar_t *); 5226 extern size_t wcscspn(const wchar_t *, const wchar_t *); 5227 extern wchar_t *wcsdup(const wchar_t *); 5228 extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); 5229 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); 5230 extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); 5231 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *); 5232 extern wchar_t *wcsrchr(const wchar_t *, wchar_t); 5233 extern size_t wcsspn(const wchar_t *, const wchar_t *); 5234 extern wchar_t *wcsstr(const wchar_t *, const wchar_t *); 5235 extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t * *); 5236 extern int wcswidth(const wchar_t *, size_t); 5237 extern size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); 5238 extern int wctob(wint_t); 5239 extern int wcwidth(wchar_t); 5240 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); 5241 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t); 5242 extern wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); 5243 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 5244 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); 5245 extern size_t mbrlen(const char *, size_t, mbstate_t *); 5246 extern size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); 5247 extern int mbsinit(const mbstate_t *); 5248 extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, 5249 mbstate_t *); 5250 extern size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); 5251 extern wchar_t *wcpcpy(wchar_t *, const wchar_t *); 5252 extern wchar_t *wcpncpy(wchar_t *, const wchar_t *, size_t); 5253 extern size_t wcrtomb(char *, wchar_t, mbstate_t *); 5254 extern size_t wcslen(const wchar_t *); 5255 extern size_t wcsnrtombs(char *, const wchar_t * *, size_t, size_t, 5256 mbstate_t *); 5257 extern size_t wcsrtombs(char *, const wchar_t * *, size_t, mbstate_t *); 5258 extern double wcstod(const wchar_t *, wchar_t * *); 5259 extern float wcstof(const wchar_t *, wchar_t * *); 5260 extern long int wcstol(const wchar_t *, wchar_t * *, int); 5261 extern long double wcstold(const wchar_t *, wchar_t * *); 5262 extern long long int wcstoq(const wchar_t *, wchar_t * *, int); 5263 extern unsigned long int wcstoul(const wchar_t *, wchar_t * *, int); 5264 extern unsigned long long int wcstouq(const wchar_t *, wchar_t * *, int); 5265 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *); 5266 extern int wcscasecmp(const wchar_t *, const wchar_t *); 5267 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); 5268 extern size_t wcsnlen(const wchar_t *, size_t); 5269 extern long long int wcstoll(const wchar_t *, wchar_t * *, int); 5270 extern unsigned long long int wcstoull(const wchar_t *, wchar_t * *, int); 5271 extern wint_t btowc(int); 5272 extern wint_t fgetwc(FILE *); 5273 extern wint_t fgetwc_unlocked(FILE *); 5274 extern wchar_t *fgetws(wchar_t *, int, FILE *); 5275 extern wint_t fputwc(wchar_t, FILE *); 5276 extern int fputws(const wchar_t *, FILE *); 5277 extern int fwide(FILE *, int); 5278 extern int fwprintf(FILE *, const wchar_t *, ...); 5279 extern int fwscanf(FILE *, const wchar_t *, ...); 5280 extern wint_t getwc(FILE *); 5281 extern wint_t getwchar(void); 5282 extern wint_t putwc(wchar_t, FILE *); 5283 extern wint_t putwchar(wchar_t); 5284 extern int swprintf(wchar_t *, size_t, const wchar_t *, ...); 5285 extern int swscanf(const wchar_t *, const wchar_t *, ...); 5286 extern wint_t ungetwc(wint_t, FILE *); 5287 extern int vfwprintf(FILE *, const wchar_t *, va_list); 5288 extern int vfwscanf(FILE *, const wchar_t *, va_list); 5289 extern int vswprintf(wchar_t *, size_t, const wchar_t *, va_list); 5290 extern int vswscanf(const wchar_t *, const wchar_t *, va_list); 5291 extern int vwprintf(const wchar_t *, va_list); 5292 extern int vwscanf(const wchar_t *, va_list); 5293 extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, 5294 const struct tm *); 5295 extern int wprintf(const wchar_t *, ...); 5296 extern int wscanf(const wchar_t *, ...); 5297 _________________________________________________________ 5298 5299 9.4.79. wctype.h 5300 5301 typedef unsigned long int wctype_t; 5302 typedef unsigned int wint_t; 5303 typedef const int32_t *wctrans_t; 5304 typedef struct { 5305 int count; 5306 wint_t value; 5307 } __mbstate_t; 5308 5309 typedef __mbstate_t mbstate_t; 5310 extern int iswblank(wint_t); 5311 extern wint_t towlower(wint_t); 5312 extern wint_t towupper(wint_t); 5313 extern wctrans_t wctrans(const char *); 5314 extern int iswalnum(wint_t); 5315 extern int iswalpha(wint_t); 5316 extern int iswcntrl(wint_t); 5317 extern int iswctype(wint_t, wctype_t); 5318 extern int iswdigit(wint_t); 5319 extern int iswgraph(wint_t); 5320 extern int iswlower(wint_t); 5321 extern int iswprint(wint_t); 5322 extern int iswpunct(wint_t); 5323 extern int iswspace(wint_t); 5324 extern int iswupper(wint_t); 5325 extern int iswxdigit(wint_t); 5326 extern wctype_t wctype(const char *); 5327 extern wint_t towctrans(wint_t, wctrans_t); 5328 _________________________________________________________ 5329 5330 9.4.80. wordexp.h 5331 5332 enum { 5333 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, 5334 WRDE_UNDEF, __WRDE_FLAGS 5335 }; 5336 5337 typedef struct { 5338 int we_wordc; 5339 char **we_wordv; 5340 int we_offs; 5341 } wordexp_t; 5342 5343 enum { 5344 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 5345 WRDE_SYNTAX 5346 }; 5347 extern int wordexp(const char *, wordexp_t *, int); 5348 extern void wordfree(wordexp_t *); 5349 _________________________________________________________ 5350 5351 9.5. Interface Definitions for libc 5352 5353 Table of Contents 5354 _IO_feof -- alias for feof 5355 _IO_getc -- alias for getc 5356 _IO_putc -- alias for putc 5357 _IO_puts -- alias for puts 5358 __assert_fail -- abort the program after false assertion 5359 __ctype_b_loc -- accessor function for __ctype_b array for 5360 ctype functions 5361 5362 __ctype_get_mb_cur_max -- maximum length of a multibyte 5363 character in the current locale 5364 5365 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5366 array for ctype tolower() function 5367 5368 __ctype_toupper_loc -- accessor function for 5369 __ctype_b_toupper() array for ctype toupper() function 5370 5371 __cxa_atexit -- register a function to be called by exit or 5372 when a shared library is unloaded 5373 5374 __daylight -- daylight savings time flag 5375 __environ -- alias for environ - user environment 5376 __errno_location -- address of errno variable 5377 __fpending -- returns in bytes the amount of output pending on 5378 a stream 5379 5380 __getpagesize -- alias for getpagesize - get current page size 5381 5382 __getpgid -- get the process group id 5383 __h_errno_location -- address of h_errno variable 5384 __isinf -- test for infinity 5385 __isinff -- test for infinity 5386 __isinfl -- test for infinity 5387 __isnan -- test for infinity 5388 __isnanf -- test for infinity 5389 __isnanl -- test for infinity 5390 __libc_current_sigrtmax -- return number of available 5391 real-time signal with lowest priority 5392 5393 __libc_current_sigrtmin -- return number of available 5394 real-time signal with highest priority 5395 5396 __libc_start_main -- initialization routine 5397 __lxstat -- inline wrapper around call to lxstat 5398 __mempcpy -- copy given number of bytes of source to 5399 destination 5400 5401 __rawmemchr -- scan memory 5402 __register_atfork -- alias for register_atfork 5403 __sigsetjmp -- save stack context for non-local goto 5404 __stpcpy -- alias for stpcpy 5405 __strdup -- alias for strdup 5406 __strtod_internal -- underlying function for strtod 5407 __strtof_internal -- underlying function for strtof 5408 __strtok_r -- alias for strtok_r 5409 __strtol_internal -- alias for strtol 5410 __strtold_internal -- underlying function for strtold 5411 __strtoll_internal -- underlying function for strtoll 5412 __strtoul_internal -- underlying function for strtoul 5413 __strtoull_internal -- underlying function for strtoull 5414 __sysconf -- get configuration information at runtime 5415 __sysv_signal -- signal handling 5416 __timezone -- global variable containing timezone 5417 __tzname -- global variable containing the timezone 5418 __wcstod_internal -- underlying function for wcstod 5419 __wcstof_internal -- underlying function for wcstof 5420 __wcstol_internal -- underlying function for wcstol 5421 __wcstold_internal -- underlying function for wcstold 5422 __wcstoul_internal -- underlying function for wcstoul 5423 __xmknod -- make block or character special file 5424 __xstat -- get File Status 5425 __xstat64 -- get File Status 5426 _environ -- alias for environ - user environment 5427 _nl_msg_cat_cntr -- new catalog load counter 5428 _sys_errlist -- array containing the "C" locale strings used 5429 by strerror() 5430 5431 _sys_siglist -- array containing the names of the signal names 5432 acct -- switch process accounting on or off 5433 adjtime -- correct the time to allow synchronization of the 5434 system clock 5435 5436 asprintf -- write formatted output to a dynamically allocated 5437 string 5438 5439 bind_textdomain_codeset -- specify encoding for message 5440 retrieval 5441 5442 bindresvport -- bind socket to privileged IP port 5443 bindtextdomain -- specify the location of a message catalog 5444 cfmakeraw -- get and set terminal attributes 5445 cfsetspeed -- set terminal input and output data rate 5446 daemon -- run in the background 5447 dcgettext -- perform domain and category specific lookup in 5448 message catalog 5449 5450 dcngettext -- perform domain and category specific lookup in 5451 message catalog with plural 5452 5453 dgettext -- perform lookup in message catalog for the current 5454 LC_MESSAGES locale 5455 5456 dngettext -- perform lookup in message catalog for the current 5457 locale 5458 5459 duplocale -- provide new handle for selection of locale 5460 err -- display formatted error messages 5461 error -- print error message 5462 errx -- display formatted error message and exit 5463 fcntl -- file control 5464 fflush_unlocked -- non thread safe fflush 5465 fgetwc_unlocked -- non thread safe fgetwc 5466 flock -- apply or remove an advisory lock on an open file 5467 freelocale -- free a locale object 5468 fscanf -- convert formatted input 5469 fwscanf -- convert formatted input 5470 getgrouplist -- get network group entry 5471 getloadavg -- get system load averages 5472 getopt -- parse command line options 5473 getopt_long -- parse command line options 5474 getopt_long_only -- parse command line options 5475 getsockopt -- get socket options 5476 gettext -- search message catalogs for a string 5477 getutent -- access user accounting database entries 5478 getutent_r -- access user accounting database entries 5479 glob64 -- find pathnames matching a pattern (Large File 5480 Support) 5481 5482 globfree64 -- free memory from glob64() (Large File Support) 5483 initgroups -- initialize the supplementary group access list 5484 ioctl -- control device 5485 sockio -- socket ioctl commands 5486 ttyio -- tty ioctl commands 5487 kill -- send a signal 5488 link -- create a link to a file 5489 mbsnrtowcs -- convert a multibyte string to a wide character 5490 string 5491 5492 memmem -- locate bytes 5493 memrchr -- scan memory for a character 5494 newlocale -- allocate a locale object 5495 ngettext -- search message catalogs for plural string 5496 pmap_getport -- find the port number assigned to a service 5497 registered with a portmapper. 5498 5499 pmap_set -- establishes mapping to machine's RPC Bind service. 5500 pmap_unset -- destroys RPC Binding 5501 psignal -- print signal message 5502 regexec -- regular expression matching 5503 scanf -- convert formatted input 5504 setbuffer -- stream buffering operation 5505 setgroups -- set list of supplementary group IDs 5506 sethostname -- set host name 5507 setsockopt -- set socket options 5508 setutent -- access user accounting database entries 5509 sigandset -- build a new signal set by combining the two input 5510 sets using logical AND 5511 5512 sigisemptyset -- check for empty signal set 5513 sigorset -- build a new signal set by combining the two input 5514 sets using logical OR 5515 5516 sigreturn -- return from signal handler and cleanup stack 5517 frame 5518 5519 sscanf -- convert formatted input 5520 stime -- set time 5521 stpcpy -- copy a string returning a pointer to its end 5522 stpncpy -- copy a fixed-size string, returning a pointer to 5523 its end 5524 5525 strcasestr -- locate a substring ignoring case 5526 strerror_r -- reentrant version of strerror 5527 strndup -- return a malloc'd copy of at most the specified 5528 number of bytes of a string 5529 5530 strnlen -- determine the length of a fixed-size string 5531 strptime -- parse a time string 5532 strsep -- extract token from string 5533 strsignal -- return string describing signal 5534 strtoq -- convert string value to a long or quad_t integer 5535 strtouq -- convert a string to an unsigned long long 5536 svc_register -- register Remote Procedure Call interface 5537 svc_run -- waits for RPC requests to arrive and calls service 5538 procedure 5539 5540 svc_sendreply -- called by RPC service's dispatch routine 5541 svctcp_create -- create a TCP/IP-based RPC service transport 5542 svcudp_create -- create a UDP-based RPC service transport 5543 swscanf -- convert formatted input 5544 system -- execute a shell command 5545 textdomain -- set the current default message domain 5546 unlink -- remove a directory entry 5547 uselocale -- set locale for thread 5548 utmpname -- set user accounting database 5549 vasprintf -- write formatted output to a dynamically allocated 5550 string 5551 5552 vdprintf -- write formatted output to a file descriptor 5553 verrx -- display formatted error message and exit 5554 vfscanf -- convert formatted input 5555 vfwscanf -- convert formatted input 5556 vscanf -- convert formatted input 5557 vsscanf -- convert formatted input 5558 vswscanf -- convert formatted input 5559 vsyslog -- log to system log 5560 vwscanf -- convert formatted input 5561 wait4 -- wait for process termination, BSD style 5562 waitpid -- wait for child process 5563 warn -- formatted error messages 5564 warnx -- formatted error messages 5565 wcpcpy -- copy a wide character string, returning a pointer to 5566 its end 5567 5568 wcpncpy -- copy a fixed-size string of wide characters, 5569 returning a pointer to its end 5570 5571 wcscasecmp -- compare two wide-character strings, ignoring 5572 case 5573 5574 wcsdup -- duplicate a wide-character string 5575 wcsncasecmp -- compare two fixed-size wide-character strings, 5576 ignoring case 5577 5578 wcsnlen -- determine the length of a fixed-size wide-character 5579 string 5580 5581 wcsnrtombs -- convert a wide character string to a multi-byte 5582 string 5583 5584 wcstoq -- convert wide string to long long int representation 5585 wcstouq -- convert wide string to unsigned long long int 5586 representation 5587 5588 wscanf -- convert formatted input 5589 xdr_u_int -- library routines for external data representation 5590 5591 The interfaces defined on the following pages are included in 5592 libc and are defined by this specification. Unless otherwise 5593 noted, these interfaces shall be included in the source 5594 standard. 5595 5596 Other interfaces listed in Section 9.3 shall behave as 5597 described in the referenced base document. 5598 5599 _IO_feof 5600 5601 Name 5602 5603 _IO_feof -- alias for feof 5604 5605 Synopsis 5606 5607 int _IO_feof(_IO_FILE * __fp); 5608 5609 Description 5610 5611 _IO_feof() tests the end-of-file indicator for the stream 5612 pointed to by __fp, returning a non-zero value if it is set. 5613 5614 _IO_feof() is not in the source standard; it is only in the 5615 binary standard. 5616 5617 _IO_getc 5618 5619 Name 5620 5621 _IO_getc -- alias for getc 5622 5623 Synopsis 5624 5625 int _IO_getc(_IO_FILE * __fp); 5626 5627 Description 5628 5629 _IO_getc() reads the next character from __fp and returns it 5630 as an unsigned char cast to an int, or EOF on end-of-file or 5631 error. 5632 5633 _IO_getc() is not in the source standard; it is only in the 5634 binary standard. 5635 5636 _IO_putc 5637 5638 Name 5639 5640 _IO_putc -- alias for putc 5641 5642 Synopsis 5643 5644 int _IO_putc(int __c, _IO_FILE * __fp); 5645 5646 Description 5647 5648 _IO_putc() writes the character __c, cast to an unsigned char, 5649 to __fp. 5650 5651 _IO_putc() is not in the source standard; it is only in the 5652 binary standard. 5653 5654 _IO_puts 5655 5656 Name 5657 5658 _IO_puts -- alias for puts 5659 5660 Synopsis 5661 5662 int _IO_puts(const char * __c); 5663 5664 Description 5665 5666 _IO_puts() writes the string __s and a trailing newline to 5667 stdout. 5668 5669 _IO_puts() is not in the source standard; it is only in the 5670 binary standard. 5671 5672 __assert_fail 5673 5674 Name 5675 5676 __assert_fail -- abort the program after false assertion 5677 5678 Synopsis 5679 5680 void __assert_fail(const char * assertion, const char * file, 5681 unsigned int line, const char * function); 5682 5683 Description 5684 5685 The __assert_fail() function is used to implement the assert() 5686 interface of ISO POSIX (2003). The __assert_fail() function 5687 shall print the given file filename, line line number, 5688 function function name and a message on the standard error 5689 stream in an unspecified format, and abort program execution 5690 via the abort() function. For example: 5691 5692 a.c:10: foobar: Assertion a == b failed. 5693 5694 If function is NULL, __assert_fail() shall omit information 5695 about the function. 5696 5697 assertion, file, and line shall be non-NULL. 5698 5699 The __assert_fail() function is not in the source standard; it 5700 is only in the binary standard. The assert() interface is not 5701 in the binary standard; it is only in the source standard. The 5702 assert() may be implemented as a macro. 5703 5704 __ctype_b_loc 5705 5706 Name 5707 5708 __ctype_b_loc -- accessor function for __ctype_b array for 5709 ctype functions 5710 5711 Synopsis 5712 5713 #include 5714 5715 const unsigned short * * __ctype_b_loc (void); 5716 5717 Description 5718 5719 The __ctype_b_loc() function shall return a pointer into an 5720 array of characters in the current locale that contains 5721 characteristics for each character in the current character 5722 set. The array shall contain a total of 384 characters, and 5723 can be indexed with any signed or unsigned char (i.e. with an 5724 index value between -128 and 255). If the application is 5725 multithreaded, the array shall be local to the current thread. 5726 5727 This interface is not in the source standard; it is only in 5728 the binary standard. 5729 5730 Return Value 5731 5732 The __ctype_b_loc() function shall return a pointer to the 5733 array of characters to be used for the ctype() family of 5734 functions (see ). 5735 5736 __ctype_get_mb_cur_max 5737 5738 Name 5739 5740 __ctype_get_mb_cur_max -- maximum length of a multibyte 5741 character in the current locale 5742 5743 Synopsis 5744 5745 size_t __ctype_get_mb_cur_max(void); 5746 5747 Description 5748 5749 __ctype_get_mb_cur_max() returns the maximum length of a 5750 multibyte character in the current locale. 5751 5752 __ctype_get_mb_cur_max() is not in the source standard; it is 5753 only in the binary standard. 5754 5755 __ctype_tolower_loc 5756 5757 Name 5758 5759 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5760 array for ctype tolower() function 5761 5762 Synopsis 5763 5764 #include 5765 5766 int32_t * * __ctype_tolower_loc(void); 5767 5768 Description 5769 5770 The __ctype_tolower_loc() function shall return a pointer into 5771 an array of characters in the current locale that contains 5772 lower case equivalents for each character in the current 5773 character set. The array shall contain a total of 384 5774 characters, and can be indexed with any signed or unsigned 5775 char (i.e. with an index value between -128 and 255). If the 5776 application is multithreaded, the array shall be local to the 5777 current thread. 5778 5779 This interface is not in the source standard; it is only in 5780 the binary standard. 5781 5782 Return Value 5783 5784 The __ctype_tolower_loc() function shall return a pointer to 5785 the array of characters to be used for the ctype() family of 5786 functions (see ). 5787 5788 __ctype_toupper_loc 5789 5790 Name 5791 5792 __ctype_toupper_loc -- accessor function for 5793 __ctype_b_toupper() array for ctype toupper() function 5794 5795 Synopsis 5796 5797 #include 5798 5799 int32_t * * __ctype_toupper_loc(void); 5800 5801 Description 5802 5803 The __ctype_toupper_loc() function shall return a pointer into 5804 an array of characters in the current locale that contains 5805 upper case equivalents for each character in the current 5806 character set. The array shall contain a total of 384 5807 characters, and can be indexed with any signed or unsigned 5808 char (i.e. with an index value between -128 and 255). If the 5809 application is multithreaded, the array shall be local to the 5810 current thread. 5811 5812 This interface is not in the source standard; it is only in 5813 the binary standard. 5814 5815 Return Value 5816 5817 The __ctype_toupper_loc() function shall return a pointer to 5818 the array of characters to be used for the ctype() family of 5819 functions (see ). 5820 5821 __cxa_atexit 5822 5823 Name 5824 5825 __cxa_atexit -- register a function to be called by exit or 5826 when a shared library is unloaded 5827 5828 Synopsis 5829 5830 int __cxa_atexit(void (*func) (void *), void * arg, void * 5831 dso_handle); 5832 5833 Description 5834 5835 As described in the Itanium C++ ABI, __cxa_atexit() registers 5836 a destructor function to be called by exit() or when a shared 5837 library is unloaded. When a shared library is unloaded, any 5838 destructor function associated with that shared library, 5839 identified by dso_handle, shall be called with the single 5840 argument arg, and then that function shall be removed, or 5841 marked as complete, from the list of functions to run at 5842 exit(). On a call to exit(), any remaining functions 5843 registered shall be called with the single argument arg. 5844 Destructor functions shall always be called in the reverse 5845 order to their registration (i.e. the most recently registered 5846 function shall be called first), 5847 5848 The __cxa_atexit() function is used to implement atexit(), as 5849 described in ISO POSIX (2003). Calling atexit(func) from the 5850 statically linked part of an application shall be equivalent 5851 to __cxa_atexit(func, NULL, NULL). 5852 5853 __cxa_atexit() is not in the source standard; it is only in 5854 the binary standard. 5855 5856 Note: atexit() is not in the binary standard; it is only in 5857 the source standard. 5858 5859 __daylight 5860 5861 Name 5862 5863 __daylight -- daylight savings time flag 5864 5865 Synopsis 5866 5867 int __daylight; 5868 5869 Description 5870 5871 The integer variable __daylight shall implement the daylight 5872 savings time flag daylight as specified in the ISO POSIX 5873 (2003) header file . 5874 5875 __daylight is not in the source standard; it is only in the 5876 binary standard. daylight is not in the binary standard; it is 5877 only in the source standard. 5878 5879 __environ 5880 5881 Name 5882 5883 __environ -- alias for environ - user environment 5884 5885 Synopsis 5886 5887 extern char * *__environ; 5888 5889 Description 5890 5891 __environ is an alias for environ - user environment. 5892 5893 __environ has the same specification as environ. 5894 5895 __environ is not in the source standard; it is only in the 5896 binary standard. 5897 5898 __errno_location 5899 5900 Name 5901 5902 __errno_location -- address of errno variable 5903 5904 Synopsis 5905 5906 int * __errno_location(void); 5907 5908 Description 5909 5910 The __errno_location() function shall return the address of 5911 the errno variable for the current thread. 5912 5913 __errno_location() is not in the source standard; it is only 5914 in the binary standard. 5915 5916 __fpending 5917 5918 Name 5919 5920 __fpending -- returns in bytes the amount of output pending on 5921 a stream 5922 5923 Synopsis 5924 5925 size_t __fpending(FILE * stream); 5926 5927 Description 5928 5929 __fpending() returns the amount of output in bytes pending on 5930 a stream. 5931 5932 __fpending() is not in the source standard; it is only in the 5933 binary standard. 5934 5935 __getpagesize 5936 5937 Name 5938 5939 __getpagesize -- alias for getpagesize - get current page size 5940 5941 Synopsis 5942 5943 int __getpagesize(void); 5944 5945 Description 5946 5947 __getpagesize() is an alias for getpagesize() - get current 5948 page size. 5949 5950 __getpagesize() has the same specification as getpagesize(). 5951 5952 __getpagesize() is not in the source standard; it is only in 5953 the binary standard. 5954 5955 __getpgid 5956 5957 Name 5958 5959 __getpgid -- get the process group id 5960 5961 Synopsis 5962 5963 pid_t __getpgid(pid_t pid); 5964 5965 Description 5966 5967 __getpgid() has the same specification as getpgid(). 5968 5969 __getpgid() is not in the source standard; it is only in the 5970 binary standard. 5971 5972 __h_errno_location 5973 5974 Name 5975 5976 __h_errno_location -- address of h_errno variable 5977 5978 Synopsis 5979 5980 int * __h_errno_location(void); 5981 5982 Description 5983 5984 __h_errno_location() returns the address of the h_errno 5985 variable, where h_errno is as specified in ISO POSIX (2003). 5986 5987 __h_errno_location() is not in the source standard; it is only 5988 in the binary standard. Note that h_errno itself is only in 5989 the source standard; it is not in the binary standard. 5990 5991 __isinf 5992 5993 Name 5994 5995 __isinf -- test for infinity 5996 5997 Synopsis 5998 5999 int __isinf(double arg); 6000 6001 Description 6002 6003 __isinf() has the same specification as isinf() in ISO POSIX 6004 (2003), except that the argument type for __isinf() is known 6005 to be double. 6006 6007 __isinf() is not in the source standard; it is only in the 6008 binary standard. 6009 6010 __isinff 6011 6012 Name 6013 6014 __isinff -- test for infinity 6015 6016 Synopsis 6017 6018 int __isinff(float arg); 6019 6020 Description 6021 6022 __isinff() has the same specification as isinf() in ISO POSIX 6023 (2003) except that the argument type for __isinff() is known 6024 to be float. 6025 6026 __isinff() is not in the source standard; it is only in the 6027 binary standard. 6028 6029 __isinfl 6030 6031 Name 6032 6033 __isinfl -- test for infinity 6034 6035 Synopsis 6036 6037 int __isinfl(long double arg); 6038 6039 Description 6040 6041 __isinfl() has the same specification as isinf() in the ISO 6042 POSIX (2003), except that the argument type for __isinfl() is 6043 known to be long double. 6044 6045 __isinfl() is not in the source standard; it is only in the 6046 binary standard. 6047 6048 __isnan 6049 6050 Name 6051 6052 __isnan -- test for infinity 6053 6054 Synopsis 6055 6056 int __isnan(double arg); 6057 6058 Description 6059 6060 __isnan() has the same specification as isnan() in ISO POSIX 6061 (2003), except that the argument type for __isnan() is known 6062 to be double. 6063 6064 __isnan() is not in the source standard; it is only in the 6065 binary standard. 6066 6067 __isnanf 6068 6069 Name 6070 6071 __isnanf -- test for infinity 6072 6073 Synopsis 6074 6075 int __isnanf(float arg); 6076 6077 Description 6078 6079 __isnanf() has the same specification as isnan() in ISO POSIX 6080 (2003), except that the argument type for __isnanf() is known 6081 to be float. 6082 6083 __isnanf() is not in the source standard; it is only in the 6084 binary standard. 6085 6086 __isnanl 6087 6088 Name 6089 6090 __isnanl -- test for infinity 6091 6092 Synopsis 6093 6094 int __isnanl(long double arg); 6095 6096 Description 6097 6098 __isnanl() has the same specification as isnan() in ISO POSIX 6099 (2003), except that the argument type for __isnanl() is known 6100 to be long double. 6101 6102 __isnanl() is not in the source standard; it is only in the 6103 binary standard. 6104 6105 __libc_current_sigrtmax 6106 6107 Name 6108 6109 __libc_current_sigrtmax -- return number of available 6110 real-time signal with lowest priority 6111 6112 Synopsis 6113 6114 int __libc_current_sigrtmax(void); 6115 6116 Description 6117 6118 __libc_current_sigrtmax() returns the number of an available 6119 real-time signal with the lowest priority. 6120 6121 __libc_current_sigrtmax() is not in the source standard; it is 6122 only in the binary standard. 6123 6124 __libc_current_sigrtmin 6125 6126 Name 6127 6128 __libc_current_sigrtmin -- return number of available 6129 real-time signal with highest priority 6130 6131 Synopsis 6132 6133 int __libc_current_sigrtmin(void); 6134 6135 Description 6136 6137 __libc_current_sigrtmin() returns the number of an available 6138 real-time signal with the highest priority. 6139 6140 __libc_current_sigrtmin() is not in the source standard; it is 6141 only in the binary standard. 6142 6143 __libc_start_main 6144 6145 Name 6146 6147 __libc_start_main -- initialization routine 6148 6149 Synopsis 6150 6151 int __libc_start_main(int *(main) (int, char * *, char * *), 6152 int argc, char * * ubp_av, void (*init) (void), void (*fini) 6153 (void), void (*rtld_fini) (void), void (* stack_end)); 6154 6155 Description 6156 6157 The __libc_start_main() function shall perform any necessary 6158 initialization of the execution environment, call the main 6159 function with appropriate arguments, and handle the return 6160 from main(). If the main() function returns, the return value 6161 shall be passed to the exit() function. 6162 6163 Note: While this specification is intended to be 6164 implementation independent, process and library 6165 initialization may include: 6166 6167 * performing any necessary security checks if the effective 6168 user ID is not the same as the real user ID. 6169 * initialize the threading subsystem. 6170 * registering the rtld_fini to release resources when this 6171 dynamic shared object exits (or is unloaded). 6172 * registering the fini handler to run at program exit. 6173 * calling the initializer function (*init)(). 6174 * calling main() with appropriate arguments. 6175 * calling exit() with the return value from main(). 6176 6177 This list is an example only. 6178 6179 __libc_start_main() is not in the source standard; it is only 6180 in the binary standard. 6181 6182 See Also 6183 6184 The section on Process Initialization in each of the 6185 architecture specific supplements. 6186 6187 __lxstat 6188 6189 Name 6190 6191 __lxstat -- inline wrapper around call to lxstat 6192 6193 Synopsis 6194 6195 #include 6196 6197 int __lxstat(int version, char * __path, struct stat 6198 __statbuf); 6199 6200 Description 6201 6202 __lxstat() is an inline wrapper around call to lxstat(). 6203 6204 __lxstat() is not in the source standard; it is only in the 6205 binary standard. 6206 6207 __mempcpy 6208 6209 Name 6210 6211 __mempcpy -- copy given number of bytes of source to 6212 destination 6213 6214 Synopsis 6215 6216 #include 6217 6218 ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, 6219 size_t n); 6220 6221 Description 6222 6223 __mempcpy() copies n bytes of source to destination, returning 6224 pointer to bytes after the last written byte. 6225 6226 __mempcpy() is not in the source standard; it is only in the 6227 binary standard. 6228 6229 __rawmemchr 6230 6231 Name 6232 6233 __rawmemchr -- scan memory 6234 6235 Synopsis 6236 6237 #include 6238 6239 ptr_t __rawmemchr(const ptr_t s, int c); 6240 6241 Description 6242 6243 __rawmemchr() searches in s for c. 6244 6245 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 6246 memchr(), but it has no length limit. 6247 6248 __rawmemchr() is not in the source standard; it is only in the 6249 binary standard. 6250 6251 __register_atfork 6252 6253 Name 6254 6255 __register_atfork -- alias for register_atfork 6256 6257 Synopsis 6258 6259 int __register_atfork(void (*prepare) (void), void (*parent) 6260 (void), void (*child) (void), void * __dso_handle); 6261 6262 Description 6263 6264 __register_atfork() implements pthread_atfork() as specified 6265 in ISO POSIX (2003). The additional parameter __dso_handle 6266 allows a shared object to pass in it's handle so that 6267 functions registered by __register_atfork() can be 6268 unregistered by the runtime when the shared object is 6269 unloaded. 6270 6271 __sigsetjmp 6272 6273 Name 6274 6275 __sigsetjmp -- save stack context for non-local goto 6276 6277 Synopsis 6278 6279 int __sigsetjmp(jmp_buf env, int savemask); 6280 6281 Description 6282 6283 __sigsetjmp() has the same behavior as sigsetjmp() as 6284 specified by ISO POSIX (2003). 6285 6286 __sigsetjmp() is not in the source standard; it is only in the 6287 binary standard. 6288 6289 __stpcpy 6290 6291 Name 6292 6293 __stpcpy -- alias for stpcpy 6294 6295 Synopsis 6296 6297 #include 6298 6299 char * __stpcpy(char * dest, const char * src); 6300 6301 Description 6302 6303 The __stpcpy() function has the same specification as the 6304 stpcpy(). 6305 6306 __stpcpy() is not in the source standard; it is only in the 6307 binary standard. 6308 6309 __strdup 6310 6311 Name 6312 6313 __strdup -- alias for strdup 6314 6315 Synopsis 6316 6317 char * __strdup(const char string); 6318 6319 Description 6320 6321 __strdup() has the same specification as strdup(). 6322 6323 __strdup() is not in the source standard; it is only in the 6324 binary standard. 6325 6326 __strtod_internal 6327 6328 Name 6329 6330 __strtod_internal -- underlying function for strtod 6331 6332 Synopsis 6333 6334 double __strtod_internal(const char * __nptr, char * * 6335 __endptr, int __group); 6336 6337 Description 6338 6339 __group shall be 0 or the behavior of __strtod_internal() is 6340 undefined. 6341 6342 __strtod_internal(__nptr, __endptr, 0)() has the same 6343 specification as strtod(__nptr, __endptr)(). 6344 6345 __strtod_internal() is not in the source standard; it is only 6346 in the binary standard. 6347 6348 __strtof_internal 6349 6350 Name 6351 6352 __strtof_internal -- underlying function for strtof 6353 6354 Synopsis 6355 6356 float __strtof_internal(const char * __nptr, char * * 6357 __endptr, int __group); 6358 6359 Description 6360 6361 __group shall be 0 or the behavior of __strtof_internal() is 6362 undefined. 6363 6364 __strtof_internal(__nptr, __endptr, 0)() has the same 6365 specification as strtof(__nptr, __endptr)(). 6366 6367 __strtof_internal() is not in the source standard; it is only 6368 in the binary standard. 6369 6370 __strtok_r 6371 6372 Name 6373 6374 __strtok_r -- alias for strtok_r 6375 6376 Synopsis 6377 6378 char * __strtok_r(char * restrict s, const char * restrict 6379 delim, char * * restrict save_ptr); 6380 6381 Description 6382 6383 __strtok_r() has the same specification as strtok_r(). 6384 6385 __strtok_r() is not in the source standard; it is only in the 6386 binary standard. 6387 6388 __strtol_internal 6389 6390 Name 6391 6392 __strtol_internal -- alias for strtol 6393 6394 Synopsis 6395 6396 long int __strtol_internal(const char * __nptr, char * * 6397 __endptr, int __base, int __group); 6398 6399 Description 6400 6401 __group shall be 0 or the behavior of __strtol_internal() is 6402 undefined. 6403 6404 __strtol_internal(__nptr, __endptr, __base, 0) has the same 6405 specification as strtol(__nptr, __endptr, __base). 6406 6407 __strtol_internal() is not in the source standard; it is only 6408 in the binary standard. 6409 6410 __strtold_internal 6411 6412 Name 6413 6414 __strtold_internal -- underlying function for strtold 6415 6416 Synopsis 6417 6418 long double __strtold_internal(const char * __nptr, char * * 6419 __endptr, int __group); 6420 6421 Description 6422 6423 __group shall be 0 or the behavior of __strtold_internal() is 6424 undefined. 6425 6426 __strtold_internal(__nptr, __endptr, 0) has the same 6427 specification as strtold(__nptr, __endptr). 6428 6429 __strtold_internal() is not in the source standard; it is only 6430 in the binary standard. 6431 6432 __strtoll_internal 6433 6434 Name 6435 6436 __strtoll_internal -- underlying function for strtoll 6437 6438 Synopsis 6439 6440 long long __strtoll_internal(const char * __nptr, char * * 6441 __endptr, int __base, int __group); 6442 6443 Description 6444 6445 __group shall be 0 or the behavior of __strtoll_internal() is 6446 undefined. 6447 6448 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 6449 specification as strtoll(__nptr, __endptr, __base). 6450 6451 __strtoll_internal() is not in the source standard; it is only 6452 in the binary standard. 6453 6454 __strtoul_internal 6455 6456 Name 6457 6458 __strtoul_internal -- underlying function for strtoul 6459 6460 Synopsis 6461 6462 unsigned long int __strtoul_internal(const char * __nptr, char 6463 * * __endptr, int __base, int __group); 6464 6465 Description 6466 6467 __group shall be 0 or the behavior of __strtoul_internal() is 6468 undefined. 6469 6470 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 6471 specification as strtoul(__nptr, __endptr, __base). 6472 6473 __strtoul_internal() is not in the source standard; it is only 6474 in the binary standard. 6475 6476 __strtoull_internal 6477 6478 Name 6479 6480 __strtoull_internal -- underlying function for strtoull 6481 6482 Synopsis 6483 6484 unsigned long long __strtoull_internal(const char * __nptr, 6485 char * * __endptr, int __base, int __group); 6486 6487 Description 6488 6489 __group shall be 0 or the behavior of __strtoull_internal() is 6490 undefined. 6491 6492 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 6493 specification as strtoull(__nptr, __endptr, __base). 6494 6495 __strtoull_internal() is not in the source standard; it is 6496 only in the binary standard. 6497 6498 __sysconf 6499 6500 Name 6501 6502 __sysconf -- get configuration information at runtime 6503 6504 Synopsis 6505 6506 #include 6507 6508 long __sysconf(int name); 6509 6510 Description 6511 6512 __sysconf() gets configuration information at runtime. 6513 6514 __sysconf() is weak alias to sysconf(). 6515 6516 __sysconf() has the same specification as sysconf(). 6517 6518 __sysconf() is not in the source standard; it is only in the 6519 binary standard. 6520 6521 __sysv_signal 6522 6523 Name 6524 6525 __sysv_signal -- signal handling 6526 6527 Synopsis 6528 6529 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 6530 6531 Description 6532 6533 __sysv_signal() has the same behavior as signal() as specified 6534 by ISO POSIX (2003). 6535 6536 __sysv_signal() is not in the source standard; it is only in 6537 the binary standard. 6538 6539 __timezone 6540 6541 Name 6542 6543 -- global variable containing timezone 6544 6545 Synopsis 6546 6547 long int __timezone; 6548 6549 Description 6550 6551 __timezone() has the same specification as timezone() in the 6552 ISO POSIX (2003) 6553 6554 __tzname 6555 6556 Name 6557 6558 -- global variable containing the timezone 6559 6560 Synopsis 6561 6562 char * __tzname[2]; 6563 6564 Description 6565 6566 __tzname has the same specification as tzname in the ISO POSIX 6567 (2003). 6568 6569 Note that the array size of 2 is explicit in the ISO POSIX 6570 (2003), but not in the SUSv2. 6571 6572 __wcstod_internal 6573 6574 Name 6575 6576 __wcstod_internal -- underlying function for wcstod 6577 6578 Synopsis 6579 6580 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 6581 endptr, int group); 6582 6583 Description 6584 6585 group shall be 0 or the behavior of __wcstod_internal() is 6586 undefined. 6587 6588 __wcstod_internal(nptr, endptr, 0) shall behave as 6589 wcstod(nptr, endptr) as specified by ISO POSIX (2003). 6590 6591 __wcstod_internal() is not in the source standard; it is only 6592 in the binary standard. 6593 6594 __wcstof_internal 6595 6596 Name 6597 6598 __wcstof_internal -- underlying function for wcstof 6599 6600 Synopsis 6601 6602 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 6603 endptr, int group); 6604 6605 Description 6606 6607 group shall be 0 or the behavior of __wcstof_internal() is 6608 undefined. 6609 6610 __wcstof_internal(nptr, endptr, 0) shall behave as 6611 wcstof(nptr, endptr) as specified in ISO POSIX (2003). 6612 6613 __wcstof_internal() is not in the source standard; it is only 6614 in the binary standard. 6615 6616 __wcstol_internal 6617 6618 Name 6619 6620 __wcstol_internal -- underlying function for wcstol 6621 6622 Synopsis 6623 6624 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 6625 endptr, int base, int group); 6626 6627 Description 6628 6629 group shall be 0 or the behavior of __wcstol_internal() is 6630 undefined. 6631 6632 __wcstol_internal(nptr, endptr, base, 0) shall behave as 6633 wcstol(nptr, endptr, base) as specified by ISO POSIX (2003). 6634 6635 __wcstol_internal() is not in the source standard; it is only 6636 in the binary standard. 6637 6638 __wcstold_internal 6639 6640 Name 6641 6642 __wcstold_internal -- underlying function for wcstold 6643 6644 Synopsis 6645 6646 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 6647 * endptr, int group); 6648 6649 Description 6650 6651 group shall be 0 or the behavior of __wcstold_internal() is 6652 undefined. 6653 6654 __wcstold_internal(nptr, endptr, 0) shall behave as 6655 wcstold(nptr, endptr) as specified by ISO POSIX (2003). 6656 6657 __wcstold_internal() is not in the source standard; it is only 6658 in the binary standard. 6659 6660 __wcstoul_internal 6661 6662 Name 6663 6664 __wcstoul_internal -- underlying function for wcstoul 6665 6666 Synopsis 6667 6668 unsigned long __wcstoul_internal(const wchar_t * restrict 6669 nptr, wchar_t * * restrict endptr, int base, int group); 6670 6671 Description 6672 6673 group shall be 0 or the behavior of __wcstoul_internal() is 6674 undefined. 6675 6676 __wcstoul_internal(nptr, endptr, base, 0)() shall behave as 6677 wcstoul(nptr, endptr, base)() as specified by ISO POSIX 6678 (2003). 6679 6680 __wcstoul_internal() is not in the source standard; it is only 6681 in the binary standard. 6682 6683 __xmknod 6684 6685 Name 6686 6687 __xmknod -- make block or character special file 6688 6689 Synopsis 6690 6691 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 6692 dev); 6693 6694 Description 6695 6696 The __xmknod() function shall implement the mknod() interface 6697 from ISO POSIX (2003). 6698 6699 The value of ver shall be 1 or the behavior of __xmknod() is 6700 undefined. 6701 6702 __xmknod(1, path, mode, dev) shall behave as mknod(path, mode, 6703 dev) as specified by ISO POSIX (2003). 6704 6705 The __xmknod() function is not in the source standard; it is 6706 only in the binary standard. 6707 6708 Note: The mknod() function is not in the binary standard; 6709 it is only in the source standard. 6710 6711 __xstat 6712 6713 Name 6714 6715 __xstat -- get File Status 6716 6717 Synopsis 6718 6719 #include 6720 #include 6721 6722 int __xstat(int ver, const char * path, struct stat * 6723 stat_buf); 6724 6725 int __lxstat(int ver, const char * path, struct stat * 6726 stat_buf); 6727 6728 int __fxstat(int ver, int fildes, struct stat * stat_buf); 6729 6730 Description 6731 6732 The functions __xstat(), __lxstat(), and __fxstat() shall 6733 implement the ISO POSIX (2003) functions stat(), lstat(), and 6734 fstat() respectively. 6735 6736 ver shall be 3 or the behavior of these functions is 6737 undefined. 6738 6739 __xstat(3, path, stat_buf) shall implement stat(path, 6740 stat_buf) as specified by ISO POSIX (2003). 6741 6742 __lxstat(3, path, stat_buf) shall implement lstat(path, 6743 stat_buf) as specified by ISO POSIX (2003). 6744 6745 __fxstat(3, fildes, stat_buf) shall implement fstat(fildes, 6746 stat_buf) as specified by ISO POSIX (2003). 6747 6748 __xstat(), __lxstat(), and __fxstat() are not in the source 6749 standard; they are only in the binary standard. 6750 6751 stat(), lstat(), and fstat() are not in the binary standard; 6752 they are only in the source standard. 6753 6754 __xstat64 6755 6756 Name 6757 6758 __xstat64 -- get File Status 6759 6760 Synopsis 6761 6762 #define _LARGEFILE_SOURCE 1 6763 #include 6764 #include 6765 6766 int __xstat64(int ver, const char * path, struct stat64 * 6767 stat_buf); 6768 6769 int __lxstat64(int ver, const char * path, struct stat64 * 6770 stat_buf); 6771 6772 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 6773 6774 Description 6775 6776 The functions __xstat64(), __lxstat64(), and __fxstat64() 6777 shall implement the Large File Support functions stat64(), 6778 lstat64(), and fstat64() respectively. 6779 6780 ver shall be 3 or the behavior of these functions is 6781 undefined. 6782 6783 __xstat64(3, path, stat_buf) shall behave as stat(path, 6784 stat_buf) as specified by Large File Support. 6785 6786 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 6787 stat_buf) as specified by Large File Support. 6788 6789 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 6790 stat_buf) as specified by Large File Support. 6791 6792 __xstat64(), __lxstat64(), and __fxstat64() are not in the 6793 source standard; they are only in the binary standard. 6794 6795 stat64(), lstat64(), and fstat64() are not in the binary 6796 standard; they are only in the source standard. 6797 6798 _environ 6799 6800 Name 6801 6802 _environ -- alias for environ - user environment 6803 6804 Synopsis 6805 6806 extern char * *_environ; 6807 6808 Description 6809 6810 _environ is an alias for environ - user environment. 6811 6812 _nl_msg_cat_cntr 6813 6814 Name 6815 6816 _nl_msg_cat_cntr -- new catalog load counter 6817 6818 Synopsis 6819 6820 #include 6821 6822 extern int _nl_msg_cat_cntr; 6823 6824 Description 6825 6826 The global variable _nl_msg_cat_cntr is incremented each time 6827 a new catalog is loaded. This variable is only in the binary 6828 standard; it is not in the source standard. 6829 6830 _sys_errlist 6831 6832 Name 6833 6834 _sys_errlist -- array containing the "C" locale strings used 6835 by strerror() 6836 6837 Synopsis 6838 6839 #include 6840 6841 extern const char *const _sys_errlist[]; 6842 6843 Description 6844 6845 _sys_errlist is an array containing the "C" locale strings 6846 used by strerror(). This normally should not be used directly. 6847 strerror() provides all of the needed functionality. 6848 6849 _sys_siglist 6850 6851 Name 6852 6853 _sys_siglist -- array containing the names of the signal names 6854 6855 Synopsis 6856 6857 #include 6858 6859 extern const char *const _sys_siglist[NSIG]; 6860 6861 Description 6862 6863 _sys_siglist is an array containing the names of the signal 6864 names. 6865 6866 The _sys_siglist array is only in the binary standard; it is 6867 not in the source standard. Applications wishing to access the 6868 names of signals should use the strsignal() function. 6869 6870 acct 6871 6872 Name 6873 6874 acct -- switch process accounting on or off 6875 6876 Synopsis 6877 6878 #include 6879 6880 int acct(const char * filename); 6881 6882 Description 6883 6884 When filename is the name of an existing file, acct() turns 6885 accounting on and appends a record to filename for each 6886 terminating process. When filename is NULL, acct() turns 6887 accounting off. 6888 6889 Return Value 6890 6891 On success, 0 is returned. On error, -1 is returned and the 6892 global variable errno is set appropriately. 6893 6894 Errors 6895 6896 ENOSYS 6897 6898 BSD process accounting has not been enabled when the operating 6899 system kernel was compiled. The kernel configuration parameter 6900 controlling this feature is CONFIG_BSD_PROCESS_ACCT. 6901 ENOMEM 6902 6903 Out of memory. 6904 EPERM 6905 6906 The calling process has no permission to enable process 6907 accounting. 6908 EACCES 6909 6910 filename is not a regular file. 6911 EIO 6912 6913 Error writing to the filename. 6914 EUSERS 6915 6916 There are no more free file structures or we run out of 6917 memory. 6918 6919 adjtime 6920 6921 Name 6922 6923 adjtime -- correct the time to allow synchronization of the 6924 system clock 6925 6926 Synopsis 6927 6928 #include 6929 6930 int adjtime(const struct timeval * delta, struct timeval * 6931 olddelta); 6932 6933 Description 6934 6935 adjtime() makes small adjustments to the system time as 6936 returned by gettimeofday()(2), advancing or retarding it by 6937 the time specified by the timeval delta. If delta is negative, 6938 the clock is slowed down by incrementing it more slowly than 6939 normal until the correction is complete. If delta is positive, 6940 a larger increment than normal is used. The skew used to 6941 perform the correction is generally a fraction of one percent. 6942 Thus, the time is always a monotonically increasing function. 6943 A time correction from an earlier call to adjtime() may not be 6944 finished when adjtime() is called again. If olddelta is 6945 non-NULL, the structure pointed to will contain, upon return, 6946 the number of microseconds still to be corrected from the 6947 earlier call. 6948 6949 adjtime() may be used by time servers that synchronize the 6950 clocks of computers in a local area network. Such time servers 6951 would slow down the clocks of some machines and speed up the 6952 clocks of others to bring them to the average network time. 6953 6954 Appropriate privilege is required to adjust the system time. 6955 6956 Return Value 6957 6958 On success, 0 is returned. On error, -1 is returned and the 6959 global variable errno is set appropriately. 6960 6961 Errors 6962 6963 EFAULT 6964 6965 An argument points outside the process's allocated address 6966 space. 6967 EPERM 6968 6969 The process does not have appropriate privilege. 6970 6971 asprintf 6972 6973 Name 6974 6975 asprintf -- write formatted output to a dynamically allocated 6976 string 6977 6978 Synopsis 6979 6980 #include 6981 6982 int asprintf(char ** restrict ptr, const char * restrict 6983 format, ...); 6984 6985 Description 6986 6987 The asprintf() function shall behave as sprintf(), except that 6988 the output string shall be dynamically allocated space of 6989 sufficient length to hold the resulting string. The address of 6990 this dynamically allocated string shall be stored in the 6991 location referenced by ptr. 6992 6993 Return Value 6994 6995 Refer to fprintf(). 6996 6997 Errors 6998 6999 Refer to fprintf(). 7000 7001 bind_textdomain_codeset 7002 7003 Name 7004 7005 bind_textdomain_codeset -- specify encoding for message 7006 retrieval 7007 7008 Synopsis 7009 7010 #include 7011 7012 char * bind_textdomain_codeset (const char * domainname , 7013 const char * codeset ); 7014 7015 Description 7016 7017 The bind_textdomain_codeset() function can be used to specify 7018 the output codeset for message catalogs for domain domainname. 7019 The codeset argument shall be a valid codeset name which can 7020 be used tor the iconv_open function, or a null pointer. If the 7021 codeset argument is the null pointer, then function returns 7022 the currently selected codeset for the domain with the name 7023 domainname. It shall return a null pointer if no codeset has 7024 yet been selected. 7025 7026 Each successive call to bind_textdomain_codeset() function 7027 overrrides the settings made by the preceding call with the 7028 same domainname. 7029 7030 The bind_textdomain_codeset() function shall return a pointer 7031 to a string containing the name of the selected codeset. The 7032 string shall be allocated internally in the function and shall 7033 not be changed or freed by the user. 7034 7035 The bind_textdomain_codeset() function returns a pointer to a 7036 string containing the name of the selected codeset. The string 7037 is allocated internally in the function and shall not be 7038 changed by the user. 7039 7040 Parameters 7041 7042 domainname 7043 7044 The domainname argument is applied to the currently active 7045 LC_MESSAGE locale. It is equivalent in syntax and meaning to 7046 the domainname argument to textdomain, except that the 7047 selection of the domain is valid only for the duration of the 7048 call. 7049 codeset 7050 7051 The name of the output codeset for the selected domain, or 7052 NULL to select the current codeset. 7053 7054 If domainname is the null pointer, or is an empty string, 7055 bind_textdomain_codeset() shall fail, but need not set errno. 7056 7057 Return Value 7058 7059 Returns the currently selected codeset name. It returns a null 7060 pointer if no codeset has yet been selected. 7061 7062 Errors 7063 7064 ENOMEM 7065 7066 Insufficient memory available to allocate return value. 7067 7068 See Also 7069 7070 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7071 textdomain, bindtextdomain 7072 7073 bindresvport 7074 7075 Name 7076 7077 bindresvport -- bind socket to privileged IP port 7078 7079 Synopsis 7080 7081 #include 7082 #include 7083 7084 int bindresvport(int sd, struct sockaddr_in * sin); 7085 7086 Description 7087 7088 If the process has appropriate privilege, the bindresvport() 7089 function shall bind a socket to a privileged IP port. 7090 7091 Return Value 7092 7093 On success, 0 is returned. On error, -1 is returned and the 7094 global variable errno is set appropriately. 7095 7096 Errors 7097 7098 EPERM 7099 7100 The process did not have appropriate privilege. 7101 EPFNOSUPPORT 7102 7103 Address of sin did not match address family of sd. 7104 7105 bindtextdomain 7106 7107 Name 7108 7109 bindtextdomain -- specify the location of a message catalog 7110 7111 Synopsis 7112 7113 #include 7114 7115 char * bindtextdomain(const char * domainname, const char * 7116 dirname); 7117 7118 Description 7119 7120 The bindtextdomain() shall set the the base directory of the 7121 hierarchy containing message catalogs for a given message 7122 domain. 7123 7124 The bindtextdomain() function specifies that the domainname 7125 message catalog can be found in the dirname directory 7126 hierarchy, rather than in the system default locale data base. 7127 7128 If dirname is not NULL, the base directory for message 7129 catalogs belonging to domain domainname shall be set to 7130 dirname. If dirname is NULL, the base directory for message 7131 catalogs shall not be altered. 7132 7133 The function shall make copies of the argument strings as 7134 needed. 7135 7136 dirname can be an absolute or relative pathname. 7137 7138 Note: Applications that wish to use chdir() should always 7139 use absolute pathnames to avoid misadvertently selecting 7140 the wrong or non-existant directory. 7141 7142 If domainname is the null pointer, or is an empty string, 7143 bindtextdomain() shall fail, but need not set errno. 7144 7145 The bindtextdomain() function shall return a pointer to a 7146 string containing the name of the selected directory. The 7147 string shall be allocated internally in the function and shall 7148 not be changed or freed by the user. 7149 7150 Return Value 7151 7152 On success, bindtextdomain() shall return a pointer to a 7153 string containing the directory pathname currently bound to 7154 the domain. On failure, a NULL pointer is returned, and the 7155 global variable errno may be set to indicate the error. 7156 7157 Errors 7158 7159 ENOMEM 7160 7161 Insufficient memory was available. 7162 7163 See Also 7164 7165 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7166 textdomain, bind_textdomain_codeset 7167 7168 cfmakeraw 7169 7170 Name 7171 7172 cfmakeraw -- get and set terminal attributes 7173 7174 Synopsis 7175 7176 #include 7177 7178 void cfmakeraw(struct termios * termios_p); 7179 7180 Description 7181 7182 The cfmakeraw() function shall set the attributes of the 7183 termios structure referenced by termios_p as follows: 7184 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 7185 |INLCR|IGNCR|ICRNL|IXON); 7186 7187 termios_p->c_oflag &= ~OPOST; 7188 7189 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 7190 7191 termios_p->c_cflag &= ~(CSIZE|PARENB); 7192 7193 termios_p->c_cflag |= CS8; 7194 7195 termios_p shall point to a termios structure that contains the 7196 following members: 7197 tcflag_t c_iflag; /* input modes */ 7198 tcflag_t c_oflag; /* output modes */ 7199 tcflag_t c_cflag; /* control modes */ 7200 tcflag_t c_lflag; /* local modes */ 7201 cc_t c_cc[NCCS]; /* control chars */ 7202 7203 cfsetspeed 7204 7205 Name 7206 7207 cfsetspeed -- set terminal input and output data rate 7208 7209 Synopsis 7210 7211 #include 7212 7213 int cfsetspeed(struct termios *t, speed_t speed); 7214 7215 Description 7216 7217 cfsetspeed() sets the baud rate values in the termios 7218 structure. The effects of the function on the terminal as 7219 described below do not become effective, nor are all errors 7220 detected, until the tcsetattr() function is called. Certain 7221 values for baud rates set in termios and passed to tcsetattr() 7222 have special meanings. 7223 7224 Getting and Setting the Baud Rate 7225 7226 Input and output baud rates are found in the termios 7227 structure. The unsigned integer speed_t is typdef'd in the 7228 include file termios.h. The value of the integer corresponds 7229 directly to the baud rate being represented; however, the 7230 following symbolic values are defined. 7231 #define B0 0 7232 #define B50 50 7233 #define B75 75 7234 #define B110 110 7235 #define B134 134 7236 #define B150 150 7237 #define B200 200 7238 #define B300 300 7239 #define B600 600 7240 #define B1200 1200 7241 #define B1800 1800 7242 #define B2400 2400 7243 #define B4800 4800 7244 #define B9600 9600 7245 #define B19200 19200 7246 #define B38400 38400 7247 #ifndef _POSIX_SOURCE 7248 #define EXTA 19200 7249 #define EXTB 38400 7250 #endif /*_POSIX_SOURCE */ 7251 7252 cfsetspeed() sets both the input and output baud rates in the 7253 termios structure referenced by t to speed. 7254 7255 Return Value 7256 7257 On success, 0 is returned. On error, -1 is returned and the 7258 global variable errno is set appropriately. 7259 7260 Errors 7261 7262 EINVAL 7263 7264 Invalid speed argument 7265 7266 daemon 7267 7268 Name 7269 7270 daemon -- run in the background 7271 7272 Synopsis 7273 7274 #include 7275 7276 int daemon(int nochdir, int noclose); 7277 7278 Description 7279 7280 The daemon() function shall create a new process, detached 7281 from the controlling terminal. If successful, the calling 7282 process shall exit and the new process shall continue to 7283 execute the application in the background. If nochdir 7284 evaluates to true, the current directory shall not be changed. 7285 Otherwise, daemon() shall change the current working directory 7286 to the root (`/'). If noclose evaluates to true the standard 7287 input, standard output, and standard error file descriptors 7288 shall not be altered. Otherwise, daemon() shall close the 7289 standard input, standard output and standard error file 7290 descriptors and reopen them attached to /dev/null. 7291 7292 Return Value 7293 7294 On error, -1 is returned, and the global variable errno is set 7295 to any of the errors specified for the library functions 7296 fork() and setsid(). 7297 7298 dcgettext 7299 7300 Name 7301 7302 dcgettext -- perform domain and category specific lookup in 7303 message catalog 7304 7305 Synopsis 7306 7307 #include 7308 #include 7309 7310 char * dcgettext(const char * domainname, const char * msgid, 7311 int category); 7312 7313 Description 7314 7315 The dcgettext() function is a domain specified version of 7316 gettext(). 7317 7318 The dcgettext() function shall lookup the translation in the 7319 current locale of the message identified by msgid in the 7320 domain specified by domainname and in the locale category 7321 specified by category. If domainname is NULL, the current 7322 default domain shall be used. The msgid argument shall be a 7323 NULL-terminated string to be matched in the catalogue. 7324 category shall specify the locale category to be used for 7325 retrieving message strings. The category parameter shall be 7326 one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, 7327 LC_NUMERIC, or LC_TIME. The default domain shall not be 7328 changed by a call to dcgettext(). 7329 7330 Return Value 7331 7332 If a translation was found in one of the specified catalogs, 7333 it shall be converted to the current locale's codeset and 7334 returned. The resulting NULL-terminated string shall be 7335 allocated by the dcgettext function, and must not be modified 7336 or freed. If no translation was found, or category was 7337 invalid, msgid shall be returned. 7338 7339 Errors 7340 7341 dcgettext() shall not modify the errno global variable. 7342 7343 See Also 7344 7345 gettext, dgettext, ngettext, dngettext, dcngettext, 7346 textdomain, bindtextdomain, bind_textdomain_codeset 7347 7348 dcngettext 7349 7350 Name 7351 7352 dcngettext -- perform domain and category specific lookup in 7353 message catalog with plural 7354 7355 Synopsis 7356 7357 #include 7358 #include 7359 7360 char * dcngettext(const char * domainname, const char * 7361 msgid1, const char * msgid2, unsigned long int n, int 7362 category); 7363 7364 Description 7365 7366 The dcngettext() function is a domain specific version of 7367 gettext, capable of returning either a singular or plural form 7368 of the message. The dcngettext() function shall lookup the 7369 translation in the current locale of the message identified by 7370 msgid1 in the domain specified by domainname and in the locale 7371 category specified by category. If domainname is NULL, the 7372 current default domain shall be used. The msgid1 argument 7373 shall be a NULL-terminated string to be matched in the 7374 catalogue. category shall specify the locale category to be 7375 used for retrieving message strings. The category parameter 7376 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, 7377 LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall 7378 not be changed by a call to dcngettext(). If n is 1 then the 7379 singular version of the message is returned, otherwise one of 7380 the plural forms is returned, depending on the value of n and 7381 the current locale settings. 7382 7383 Return Value 7384 7385 If a translation corresponding to the value of n was found in 7386 one of the specified catalogs for msgid1, it shall be 7387 converted to the current locale's codeset and returned. The 7388 resulting NULL-terminated string shall be allocated by the 7389 dcngettext() function, and must not be modified or freed. If 7390 no translation was found, or category was invalid, msgid1 7391 shall be returned if n has the value 1, otherwise msgid2 shall 7392 be returned. 7393 7394 Errors 7395 7396 dcngettext() shall not modify the errno global variable. 7397 7398 See Also 7399 7400 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 7401 bindtextdomain, bind_textdomain_codeset 7402 7403 dgettext 7404 7405 Name 7406 7407 dgettext -- perform lookup in message catalog for the current 7408 LC_MESSAGES locale 7409 7410 Synopsis 7411 7412 #include 7413 7414 char * dgettext(const char * domainname, const char * msgid); 7415 7416 Description 7417 7418 dgettext() is a domain specified version of gettext(). 7419 7420 The dgettext() function shall search the currently selected 7421 message catalogs in the domain domainname for a string 7422 identified by the string msgid. If a string is located, that 7423 string shall be returned. The domain specified by domainname 7424 applies to the currently active LC_MESSAGE locale. The default 7425 domain shall not be changed by a call to dgettext(). 7426 7427 Note: The usage of domainanme is equivalent in syntax and 7428 meaning to the textdomain() function's application of 7429 domainname, except that the selection of the domain in 7430 dgettext() is valid only for the duration of the call. 7431 7432 The dgettext() function is equivalent to dcgettext(domainname, 7433 msgid, LC_MESSAGES). 7434 7435 Return Value 7436 7437 On success of a msgid query, the translated NULL-terminated 7438 string is returned. On error, the original msgid is returned. 7439 The length of the string returned is undetermined until 7440 dgettext() is called. 7441 7442 Errors 7443 7444 dgettext() shall not modify the errno global variable. 7445 7446 See Also 7447 7448 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7449 textdomain, bindtextdomain, bind_textdomain_codeset 7450 7451 dngettext 7452 7453 Name 7454 7455 dngettext -- perform lookup in message catalog for the current 7456 locale 7457 7458 Synopsis 7459 7460 #include 7461 7462 char * dngettext(const char * domainname, const char * msgid1, 7463 const char * msgid2, unsigned long int n); 7464 7465 Description 7466 7467 dngettext() shall be equivalent to a call to 7468 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 7469 7470 See dcngettext() for more information. 7471 7472 See Also 7473 7474 gettext, dgettext, ngettext, dcgettext, dcngettext, 7475 textdomain, bindtextdomain, bind_textdomain_codeset 7476 7477 duplocale 7478 7479 Name 7480 7481 duplocale -- provide new handle for selection of locale 7482 7483 Synopsis 7484 7485 #include 7486 7487 locale_t duplocale(locale_t locale); 7488 7489 Description 7490 7491 The duplocale() function shall provide a new locale object 7492 based on the locale object provided in locale, suitable for 7493 use in the newlocale() or uselocale() functions. The new 7494 object may be released by calling freelocale(). 7495 7496 Return Value 7497 7498 On success, the duplocale() function shall return a locale 7499 object. Otherwise, it shall return NULL, and set errno to 7500 indicate the error. 7501 7502 Errors 7503 7504 The duplocale() function shall fail if: 7505 7506 ENOMEM 7507 7508 Insufficient memory. 7509 7510 See Also 7511 7512 setlocale(), freelocale(), newlocale(), uselocale() 7513 7514 err 7515 7516 Name 7517 7518 err -- display formatted error messages 7519 7520 Synopsis 7521 7522 #include 7523 7524 void err(int eval, const char * fmt, ...); 7525 7526 Description 7527 7528 The err() function shall display a formatted error message on 7529 the standard error stream. First, err() shall write the last 7530 component of the program name, a colon character, and a space 7531 character. If fmt is non-NULL, it shall be used as a format 7532 string for the printf() family of functions, and err() shall 7533 write the formatted message, a colon character, and a space. 7534 Finally, the error message string affiliated with the current 7535 value of the global variable errno shall be written, followed 7536 by a newline character. 7537 7538 The err() function shall not return, the program shall 7539 terminate with the exit value of eval. 7540 7541 See Also 7542 7543 error(), errx() 7544 7545 Return Value 7546 7547 None. 7548 7549 Errors 7550 7551 None. 7552 7553 error 7554 7555 Name 7556 7557 error -- print error message 7558 7559 Synopsis 7560 7561 #include 7562 7563 void error(int exitstatus, int errnum, const char * format, 7564 ...); 7565 7566 Description 7567 7568 error() shall print a message to standard error. 7569 7570 error() shall build the message from the following elements in 7571 their specified order: 7572 7573 1. the program name. If the application has provided a 7574 function named error_print_progname(), error() shall call 7575 this to supply the program name; otherwise, error() uses 7576 the content of the global variable program_name. 7577 2. the colon and space characters, then the result of using 7578 the printf-style format and the optional arguments. 7579 3. if errnum is nonzero, error() shall add the colon and 7580 space characters, then the result of strerror(errnum). 7581 4. a newline. 7582 7583 If exitstatus is nonzero, error() shall call exit(exitstatus). 7584 7585 See Also 7586 7587 err(), errx() 7588 7589 errx 7590 7591 Name 7592 7593 errx -- display formatted error message and exit 7594 7595 Synopsis 7596 7597 #include 7598 7599 void errx(int eval, const char * fmt, ...); 7600 7601 Description 7602 7603 The errx() function shall display a formatted error message on 7604 the standard error stream. The last component of the program 7605 name, a colon character, and a space shall be output. If fmt 7606 is non-NULL, it shall be used as the format string for the 7607 printf() family of functions, and the formatted error message, 7608 a colon character, and a space shall be output. The output 7609 shall be followed by a newline character. 7610 7611 errx() does not return, but shall exit with the value of eval. 7612 7613 Return Value 7614 7615 None. 7616 7617 Errors 7618 7619 None. 7620 7621 See Also 7622 7623 error(), err() 7624 7625 fcntl 7626 7627 Name 7628 7629 fcntl -- file control 7630 7631 Description 7632 7633 fcntl() is as specified in ISO POSIX (2003), but with 7634 differences as listed below. 7635 7636 Implementation may set O_LARGEFILE 7637 7638 According to ISO POSIX (2003), only an application sets 7639 fcntl() flags, for example O_LARGEFILE. However, this 7640 specification also allows an implementation to set the 7641 O_LARGEFILE flag in the case where the programming environment 7642 is one of _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 7643 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX 7644 (2003) for a description of these environments. Thus, calling 7645 fcntl() with the F_GETFL command may return O_LARGEFILE as 7646 well as flags explicitly set by the application in the case 7647 that both the implementation and the application support an 7648 off_t of at least 64 bits. 7649 7650 fflush_unlocked 7651 7652 Name 7653 7654 fflush_unlocked -- non thread safe fflush 7655 7656 Description 7657 7658 fflush_unlocked() is the same as fflush() except that it need 7659 not be thread safe. That is, it may only be invoked in the 7660 ways which are legal for getc_unlocked(). 7661 7662 fgetwc_unlocked 7663 7664 Name 7665 7666 fgetwc_unlocked -- non thread safe fgetwc 7667 7668 Description 7669 7670 fgetwc_unlocked() is the same as fgetwc() except that it need 7671 not be thread safe. That is, it may only be invoked in the 7672 ways which are legal for getc_unlocked(). 7673 7674 flock 7675 7676 Name 7677 7678 flock -- apply or remove an advisory lock on an open file 7679 7680 Synopsis 7681 7682 int flock(int fd, int operation); 7683 7684 Description 7685 7686 flock() applies or removes an advisory lock on the open file 7687 fd. Valid operation types are: 7688 7689 LOCK_SH 7690 7691 Shared lock. More than one process may hold a shared lock for 7692 a given file at a given time. 7693 LOCK_EX 7694 7695 Exclusive lock. Only one process may hold an exclusive lock 7696 for a given file at a given time. 7697 LOCK_UN 7698 7699 Unlock. 7700 LOCK_NB 7701 7702 Don't block when locking. May be specified (by oring) along 7703 with one of the other operations. 7704 7705 A single file may not simultaneously have both shared and 7706 exclusive locks. 7707 7708 Return Value 7709 7710 On success, 0 is returned. On error, -1 is returned and the 7711 global variable errno is set appropriately. 7712 7713 Errors 7714 7715 EWOULDBLOCK 7716 7717 The file is locked and the LOCK_NB flag was selected. 7718 7719 freelocale 7720 7721 Name 7722 7723 freelocale -- free a locale object 7724 7725 Synopsis 7726 7727 #include 7728 7729 void freelocale(locale_t locale); 7730 7731 Description 7732 7733 The freelocale() function shall free the locale object locale, 7734 and release any resources associated with it. 7735 7736 Return Value 7737 7738 None. 7739 7740 Errors 7741 7742 None defined. 7743 7744 See Also 7745 7746 setlocale(), newlocale(), duplocale(), uselocale() 7747 7748 fscanf 7749 7750 Name 7751 7752 fscanf -- convert formatted input 7753 7754 Description 7755 7756 The scanf() family of functions shall behave as described in 7757 ISO POSIX (2003), except as noted below. 7758 7759 Differences 7760 7761 The %s, %S and %[ conversion specifiers shall accept an option 7762 length modifier a, which shall cause a memory buffer to be 7763 allocated to hold the string converted. In such a case, the 7764 argument corresponding to the conversion specifier should be a 7765 reference to a pointer value that will receive a pointer to 7766 the allocated buffer. If there is insufficient memory to 7767 allocate a buffer, the function may set errno to ENOMEM and a 7768 conversion error results. 7769 7770 Note: This directly conflicts with the ISO C (1999) usage 7771 of %a as a conversion specifier for hexadecimal float 7772 values. While this conversion specifier should be 7773 supported, a format specifier such as "%aseconds" will have 7774 a different meaning on an LSB conforming system. 7775 7776 fwscanf 7777 7778 Name 7779 7780 fwscanf -- convert formatted input 7781 7782 Description 7783 7784 The scanf() family of functions shall behave as described in 7785 ISO POSIX (2003), except as noted below. 7786 7787 Differences 7788 7789 The %s, %S and %[ conversion specifiers shall accept an option 7790 length modifier a, which shall cause a memory buffer to be 7791 allocated to hold the string converted. In such a case, the 7792 argument corresponding to the conversion specifier should be a 7793 reference to a pointer value that will receive a pointer to 7794 the allocated buffer. If there is insufficient memory to 7795 allocate a buffer, the function may set errno to ENOMEM and a 7796 conversion error results. 7797 7798 Note: This directly conflicts with the ISO C (1999) usage 7799 of %a as a conversion specifier for hexadecimal float 7800 values. While this conversion specifier should be 7801 supported, a format specifier such as "%aseconds" will have 7802 a different meaning on an LSB conforming system. 7803 7804 getgrouplist 7805 7806 Name 7807 7808 getgrouplist -- get network group entry 7809 7810 Synopsis 7811 7812 #include 7813 7814 int getgrouplist(const char * user, gid_t group, gid_t * 7815 groups, int * ngroups); 7816 7817 Description 7818 7819 The getgrouplist() function shall fill in the array groups 7820 with the supplementary groups for the user specified by user. 7821 On entry, ngroups shall refer to an integer containing the 7822 maximum number of gid_t members in the groups array. The group 7823 group shall also be included. On success, the value referred 7824 to by ngroups shall be updated to contain the number of gid_t 7825 objects copied. 7826 7827 Return Value 7828 7829 On success, if there was sufficient room to copy all the 7830 supplementatry group identifiers to the array identified by 7831 groups, getgrouplist() shall return the number of gid_t 7832 objects copied, and the value referenced by ngroups shall be 7833 updated. If there was not sufficient room to copy all the 7834 supplementary group identifiers, grouplist() shall return -1, 7835 and update the value referenced by ngroups to the number 7836 actually copied. 7837 7838 If user does not refer to a valid user on the system, 7839 getgrouplist() shall return 0, and set the value referenced by 7840 ngroups to 0. 7841 7842 Errors 7843 7844 None defined. 7845 7846 See Also 7847 7848 getgroups() 7849 7850 getloadavg 7851 7852 Name 7853 7854 getloadavg -- get system load averages 7855 7856 Synopsis 7857 7858 #include 7859 7860 int getloadavg(double loadavg[], int nelem); 7861 7862 Description 7863 7864 getloadavg() returns the number of processes in the system run 7865 queue averaged over various periods of time. Up to nelem 7866 samples are retrieved and assigned to successive elements of 7867 loadavg[]. The system imposes a maximum of 3 samples, 7868 representing averages over the last 1, 5, and 15 minutes, 7869 respectively. 7870 7871 getopt 7872 7873 Name 7874 7875 getopt -- parse command line options 7876 7877 Synopsis 7878 7879 #include 7880 7881 int getopt(int argc, char * const argv[], const char * 7882 optstring); 7883 7884 extern char *optarg; 7885 extern int optind, opterr, optopt; 7886 7887 Description 7888 7889 The getopt() function shall parse command line arguments as 7890 described in ISO POSIX (2003), with the following exceptions, 7891 where LSB and POSIX specifications vary. LSB systems shall 7892 implement the modified behaviors described below. 7893 7894 Argument Ordering 7895 7896 The getopt() function can process command line arguments 7897 referenced by argv in one of three ways: 7898 7899 PERMUTE 7900 7901 the order of arguments in argv is altered so that all options 7902 (and their arguments) are moved in front of all of the 7903 operands. This is the default behavior. 7904 7905 Note: This behavior has undefined results if argv is not 7906 modifiable. This is to support historic behavior predating 7907 the use of const and ISO C (1999). The function prototype 7908 was aligned with ISO POSIX (2003) despite the fact that it 7909 modifies argv, and the library maintainers are unwilling to 7910 change this. 7911 7912 REQUIRE_ORDER 7913 7914 The arguments in argv are processed in exactly the order 7915 given, and option processing stops when the first non-option 7916 argument is reached, or when the element of argv is "--". This 7917 ordering can be enforced either by setting the environment 7918 variable POSIXLY_CORRECT, or by setting the first character of 7919 optstring to '+'. 7920 RETURN_IN_ORDER 7921 7922 The order of arguments is not altered, and all arguments are 7923 processed. Non-option arguments (operands) are handled as if 7924 they were the argument to an option with the value 1 ('\001'). 7925 This ordering is selected by setting the first character of 7926 optstring to '-'; 7927 7928 Option Characteristics 7929 7930 LSB specifies that: 7931 7932 * an element of argv that starts with "-" (and is not 7933 exactly "-" or "--") is an option element. 7934 * characters of an option element, aside from the initial 7935 "-", are option characters. 7936 7937 POSIX specifies that: 7938 7939 * applications using getopt() shall obey the following 7940 syntax guidelines: 7941 + option name is a single alphanumeric character from 7942 the portable character set 7943 + option is preceded by the '-' delimiter character 7944 + options without option-arguments should be accepted 7945 when grouped behind one '-' delimiter 7946 + each option and option-argument is a separate 7947 argument 7948 + option-arguments are not optional 7949 + all options should precede operands on the command 7950 line 7951 + the argument "--" is accepted as a delimiter 7952 indicating the end of options and the consideration 7953 of subsequent arguments, if any, as operands 7954 * historical implementations of getopt() support other 7955 characters as options as an allowed extension, but 7956 applications that use extensions are not maximally 7957 portable. 7958 * support for multi-byte option characters is only possible 7959 when such characters can be represented as type int. 7960 * applications that call any utility with a first operand 7961 starting with '-' should usually specify "--" to mark the 7962 end of the options. Standard utilities that do not support 7963 this guideline indicate that fact in the OPTIONS section 7964 of the utility description. 7965 7966 Extensions 7967 7968 LSB specifies that: 7969 7970 * if a character is followed by two colons, the option takes 7971 an optional argument; if there is text in the current argv 7972 element, it is returned in optarg, otherwise optarg is set 7973 to 0. 7974 * if optstring contains W followed by a semi-colon (;), then 7975 -W foo is treated as the long option --foo. 7976 7977 Note: See getopt_long() for a description of long options. 7978 * The first character of optstring shall modify the behavior 7979 of getopt() as follows: 7980 + if the first character is '+', then REQUIRE_ORDER 7981 processing shall be in effect (see above) 7982 + if the first character is '-', then RETURN_IN_ORDER 7983 processing shall be in effect (see above) 7984 + if the first character is ':', then getopt() shall 7985 return ':' instead of '?' to indicate a missing 7986 option argument, and shall not print any diagnostic 7987 message to stderr. 7988 7989 POSIX specifies that: 7990 7991 * the -W option is reserved for implementation extensions. 7992 7993 Return Values 7994 7995 LSB specifies the following additional getopt() return values: 7996 7997 * '\001' is returned if RETURN_IN_ORDER argument ordering is 7998 in effect, and the next argument is an operand, not an 7999 option. The argument is available in optarg. 8000 8001 Any other return value has the same meaning as for POSIX. 8002 8003 POSIX specifies the following getopt() return values: 8004 8005 * the next option character is returned, if found 8006 successfully. 8007 * ':' is returned if a parameter is missing for one of the 8008 options and the first character of optstring is ':'. 8009 * '?' is returned if an unknown option character not in 8010 optstring is encountered, or if getopt() detects a missing 8011 argument and the first character of optstring is not ':'. 8012 * -1 is returned for the end of the option list. 8013 8014 Environment Variables 8015 8016 LSB specifies that: 8017 8018 * if the variable POSIXLY_CORRECT is set, option processing 8019 stops as soon as a non-option argument is encountered. 8020 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 8021 is the process ID for the current process), contains a 8022 space separated list of arguments that should not be 8023 treated as arguments even though they appear to be so. 8024 8025 Rationale: This was used by bash 2.0 to communicate to GNU 8026 libc which arguments resulted from wildcard expansion and 8027 so should not be considered as options. This behavior was 8028 removed in bash version 2.01, but the support remains in 8029 GNU libc. 8030 This behavior is DEPRECATED in this version of the LSB; 8031 future revisions of this specification may not include 8032 this requirement. 8033 8034 getopt_long 8035 8036 Name 8037 8038 getopt_long -- parse command line options 8039 8040 Synopsis 8041 8042 #define _GNU_SOURCE 8043 #include 8044 8045 int getopt_long(int argc, char * const argv[], const char * 8046 opstring, const struct option * longopts, int * longindex); 8047 8048 Description 8049 8050 getopt_long() works like getopt() except that it also accepts 8051 long options, started out by two dashes. Long option names may 8052 be abbreviated if the abbreviation is unique or is an exact 8053 match for some defined option. A long option may take a 8054 parameter, of the form --arg=param or --arg param. 8055 8056 longopts is a pointer to the first element of an array of 8057 struct option declared in getopt.h as: 8058 struct option { 8059 const char *name; 8060 int has_arg; 8061 int *flag; 8062 int val; 8063 }; 8064 8065 The fields in this structure have the following meaning: 8066 8067 name 8068 8069 The name of the long option. 8070 has_arg 8071 8072 One of: 8073 8074 no_argument (or 0) if the option does not take an argument, 8075 required_argument (or 1) if the option requires an argument, 8076 or 8077 optional_argument (or 2) if the option takes an optional 8078 argument. 8079 8080 flag 8081 8082 specifies how results are returned for a long option. If flag 8083 is NULL, then getopt_long() shall return val. (For example, 8084 the calling program may set val to the equivalent short option 8085 character.) Otherwise, getopt_long() returns 0, and flag shall 8086 point to a variable which shall be set to val if the option is 8087 found, but left unchanged if the option is not found. 8088 val 8089 8090 The value to return, or to load into the variable pointed to 8091 by flag. 8092 8093 Return Value 8094 8095 getopt_long() returns the option character if a short option 8096 was found successfully, or ":" if there was a missing 8097 parameter for one of the options, or "?" for an unknown option 8098 character, or -1 for the end of the option list. 8099 8100 For a long option, getopt_long() returns val if flag is NULL, 8101 and 0 otherwise. Error and -1 returns are the same as for 8102 getopt(), plus "?" for an ambiguous match or an extraneous 8103 parameter. 8104 8105 getopt_long_only 8106 8107 Name 8108 8109 getopt_long_only -- parse command line options 8110 8111 Synopsis 8112 8113 #define _GNU_SOURCE 8114 #include 8115 8116 int getopt_long_only(int argc, char * const argv[], const char 8117 * optstring, const struct option * longopts, int * longindex); 8118 8119 Description 8120 8121 getopt_long_only() is like getopt_long(), but "-" as well as 8122 "--" can indicate a long option. If an option that starts with 8123 "-" (not "--") doesn't match a long option, but does match a 8124 short option, it is parsed as a short option instead. 8125 8126 Note: The getopt_long_only() function is intended only for 8127 supporting certain programs whose command line syntax was 8128 designed before the Utility Syntax Guidelines of ISO POSIX 8129 (2003) were developed. New programs should generally call 8130 getopt_long() instead, which provides the --option syntax 8131 for long options, which is preferred by GNU and consistent 8132 with ISO POSIX (2003). 8133 8134 Return Value 8135 8136 getopt_long_only() returns the option character if the option 8137 was found successfully, or ":" if there was a missing 8138 parameter for one of the options, or "?" for an unknown option 8139 character, or -1 for the end of the option list. 8140 8141 getopt_long_only() also returns the option character when a 8142 short option is recognized. For a long option, they return val 8143 if flag is NULL, and 0 otherwise. Error and -1 returns are the 8144 same as for getopt(), plus "?" for an ambiguous match or an 8145 extraneous parameter. 8146 8147 getsockopt 8148 8149 Name 8150 8151 getsockopt -- get socket options 8152 8153 Synopsis 8154 8155 #include 8156 #include 8157 8158 int getsockopt(int socket, int level, int option_name, void * 8159 restrict option_value, socklen_t * restrict option_len); 8160 8161 Description 8162 8163 The getsockopt() function shall behave as specified in ISO 8164 POSIX (2003), with the following extensions. 8165 8166 IP Protocol Level Options 8167 8168 If the level parameter is IPPROTO_IP, the following values 8169 shall be supported for option_name (see RFC 791:Internet 8170 Protocol for further details): 8171 8172 IP_OPTIONS 8173 8174 Get the Internet Protocol options sent with every packet from 8175 this socket. The option_value shall point to a memory buffer 8176 in which the options shall be placed; on entry option_len 8177 shall point to an integer value indicating the maximum size of 8178 the memory buffer, in bytes. On successful return, the value 8179 referenced by option_len shall be updated to the size of data 8180 copied to the buffer. For IPv4, the maximum length of options 8181 is 40 bytes. 8182 IP_TTL 8183 8184 Get the current unicast Internet Protocol Time To Live value 8185 used when sending packets with this socket. The option_value 8186 shall point to a buffer large enough to hold the time to live 8187 value (at least 1 byte), and option_len shall point to an 8188 integer value holding the maximum size of that buffer. On 8189 successful return, the value referenced by option_len shall be 8190 updated to contain the number of bytes copied into the buffer, 8191 which shall be no larger than the initial value, and 8192 option_value shall point to an integer containing the time to 8193 live value. 8194 IP_TOS 8195 8196 Get the Internet Protocol type of service indicator used when 8197 sending packets with this socket. The option_value shall point 8198 to a buffer large enough to hold the type of service indicator 8199 (at least 1 byte), and option_len shall point to an integer 8200 value holding the maximum size of that buffer. On successful 8201 return, the value referenced by option_len shall be updated to 8202 contain the number of bytes copied into the buffer, which 8203 shall be no larger than the initial value, and option_value 8204 shall point to an integer containing the time to live value. 8205 8206 gettext 8207 8208 Name 8209 8210 gettext -- search message catalogs for a string 8211 8212 Synopsis 8213 8214 #include 8215 8216 char * gettext(const char * msgid); 8217 8218 Description 8219 8220 The gettext() function shall search the currently selected 8221 message catalogs for a string identified by the string msgid. 8222 If a string is located, that string shall be returned. 8223 8224 The gettext() function is equivalent to dcgettext(NULL, msgid, 8225 LC_MESSAGES). 8226 8227 Return Value 8228 8229 If a string is found in the currently selected message 8230 catalogs for msgid, then a pointer to that string shall be 8231 returned. Otherwise, a pointer to msgid shall be returned. 8232 8233 Applications shall not modify the string returned by 8234 gettext(). 8235 8236 Errors 8237 8238 None. 8239 8240 The gettext() function shall not modify errno. 8241 8242 See Also 8243 8244 dgettext, ngettext, dngettext, dcgettext, dcngettext, 8245 textdomain, bindtextdomain, bind_textdomain_codeset 8246 8247 getutent 8248 8249 Name 8250 8251 getutent -- access user accounting database entries 8252 8253 Synopsis 8254 8255 #include 8256 8257 struct utmp *getutent(void); 8258 8259 Description 8260 8261 The getutent() function shall read the next entry from the 8262 user accounting database. 8263 8264 Return Value 8265 8266 Upon successful completion, getutent() shall return a pointer 8267 to a utmp structure containing a copy of the requested entry 8268 in the user accounting database. Otherwise, a null pointer 8269 shall be returned. The return value may point to a static area 8270 which is overwritten by a subsequent call to getutent(). 8271 8272 Errors 8273 8274 None defined. 8275 8276 getutent_r 8277 8278 Name 8279 8280 getutent_r -- access user accounting database entries 8281 8282 Synopsis 8283 8284 int getutent_r(struct utmp * buffer, struct utmp ** result); 8285 8286 Description 8287 8288 The getutent_r() function is a reentrant version of the 8289 getutent() function. On entry, buffer should point to a user 8290 supplied buffer to which the next entry in the database will 8291 be copied, and result should point to a location where the 8292 result will be stored. 8293 8294 Return Value 8295 8296 On success, getutent_r() shall return 0 and set the location 8297 referenced by result to a pointer to buffer. Otherwise, 8298 getutent_r() shall return -1 and set the location referenced 8299 by result to NULL. 8300 8301 glob64 8302 8303 Name 8304 8305 glob64 -- find pathnames matching a pattern (Large File 8306 Support) 8307 8308 Synopsis 8309 8310 #include 8311 8312 int glob64(const char * pattern, int flags, int (*errfunc) 8313 (const char *, int), glob64_t * pglob); 8314 8315 Description 8316 8317 The glob64() function is a large-file version of the glob() 8318 defined in ISO POSIX (2003). It shall search for pathnames 8319 matching pattern according to the rules used by the shell, 8320 /bin/sh. No tilde expansion or parameter substitution is done; 8321 see wordexp(). 8322 8323 The results of a glob64() call are stored in the structure 8324 pointed to by pglob, which is a glob64_t declared in glob.h 8325 with the following members: 8326 typedef struct 8327 { 8328 size_t gl_pathc; 8329 char **gl_pathv; 8330 size_t gl_offs; 8331 int gl_flags; 8332 void (*gl_closedir) (void *); 8333 struct dirent64 *(*gl_readdir64) (void *); 8334 void *(*gl_opendir) (const char *); 8335 int (*gl_lstat) (const char *, struct stat *); 8336 int (*gl_stat) (const char *, struct stat *); 8337 } 8338 glob64_t; 8339 8340 Structure members with the same name as corresponding members 8341 of a glob_t as defined in ISO POSIX (2003) shall have the same 8342 purpose. 8343 8344 Other members are defined as follows: 8345 8346 gl_flags 8347 8348 reserved for internal use 8349 gl_closedir 8350 8351 pointer to a function capable of closing a directory opened by 8352 gl_opendir 8353 gl_readdir64 8354 8355 pointer to a function capable of reading entries in a large 8356 directory 8357 gl_opendir 8358 8359 pointer to a function capable of opening a large directory 8360 gl_stat 8361 8362 pointer to a function capable of returning file status for a 8363 large file 8364 gl_lstat 8365 8366 pointer to a function capable of returning file status 8367 information for a large file or symbolic link 8368 8369 A large file or large directory is one with a size which 8370 cannot be represented by a variable of type off_t. 8371 8372 Return Value 8373 8374 On success, 0 is returned. Other possible returns are: 8375 8376 GLOB_NOSPACE 8377 8378 out of memory 8379 GLOB_ABORTED 8380 8381 read error 8382 GLOB_NOMATCH 8383 8384 no match found 8385 8386 globfree64 8387 8388 Name 8389 8390 globfree64 -- free memory from glob64() (Large File Support) 8391 8392 Synopsis 8393 8394 #include 8395 8396 void globfree64(glob64_t * pglob); 8397 8398 Description 8399 8400 globfree64() frees the dynamically allocated storage from an 8401 earlier call to glob64(). 8402 8403 globfree64() is a 64-bit version of globfree(). 8404 8405 initgroups 8406 8407 Name 8408 8409 initgroups -- initialize the supplementary group access list 8410 8411 Synopsis 8412 8413 #include 8414 #include 8415 8416 int initgroups(const char * user, gid_t group); 8417 8418 Description 8419 8420 If the process has appropriate privilege, the initgroups() 8421 function shall initialize the Supplementary Group IDs for the 8422 current process by reading the group database and using all 8423 groups of which user is a member. The additional group group 8424 is also added to the list. 8425 8426 Return Value 8427 8428 On success, 0 is returned. On error, -1 is returned and the 8429 global variable errno is set appropriately. 8430 8431 Errors 8432 8433 EPERM 8434 8435 The calling process does not have sufficient privileges. 8436 ENOMEM 8437 8438 Insufficient memory to allocate group information structure. 8439 8440 See Also 8441 8442 setgroups() 8443 8444 ioctl 8445 8446 Name 8447 8448 ioctl -- control device 8449 8450 Synopsis 8451 8452 #include 8453 8454 int ioctl (int fildes , int request , ...); 8455 8456 Description 8457 8458 The ioctl() function shall manipulate the underlying device 8459 parameters of special files. fildes shall be an open file 8460 descriptor referring to a special file. The ioctl() function 8461 shall take three parameters; the type and value of the third 8462 parameter is dependent on the device and request. 8463 8464 Conforming LSB applications shall not call ioctl() except in 8465 situations explicitly stated in this specification. 8466 8467 Return Value 8468 8469 On success, 0 is returned. An ioctl() may use the return value 8470 as an output parameter and return a non-negative value on 8471 success. On error, -1 is returned and the global variable 8472 errno is set appropriately. 8473 8474 Errors 8475 8476 EBADF 8477 8478 fildes is not a valid descriptor. 8479 EFAULT 8480 8481 The third parameter references an inaccessible memory area. 8482 ENOTTY 8483 8484 fildes is not associated with a character special device. 8485 ENOTTY 8486 8487 The specified request does not apply to the kind of object 8488 that fildes references. 8489 EINVAL 8490 8491 request or the third parameter is not valid. 8492 8493 Relationship to POSIX (Informative) 8494 8495 It should be noted that ISO POSIX (2003) contains an interface 8496 named ioctl(). The LSB only defines behavior when fildes 8497 refers to a socket (see sockio) or terminal device (see 8498 ttyio), while ISO POSIX (2003) only defines behavior when 8499 fildes refers to a STREAMS device. An implementation may 8500 support both behaviors; the LSB does not require any STREAMS 8501 support. 8502 8503 sockio 8504 8505 Name 8506 8507 sockio -- socket ioctl commands 8508 8509 Synopsis 8510 8511 #include 8512 #include 8513 #include 8514 #include 8515 8516 int ioctl(int sockfd, int request, void * argp); 8517 8518 Description 8519 8520 Socket ioctl() commands are a subset of the ioctl() calls, 8521 which can perform a variety of functions on sockets. sockfd 8522 shall be an open file descriptor referring to a socket (see 8523 the socket() or accept() functions). 8524 8525 Socket ioctl() commands apply to the underlying network 8526 interfaces, and affect the entire system, not just the file 8527 descriptor used to issue the ioctl(). 8528 8529 The following values for request are accepted: 8530 8531 SIOCGIFCONF (Deprecated) 8532 Get the interface configuration list for the system. 8533 8534 Note: The SIOCGIFCONF interface is superceded by the 8535 if_nameindex() family of functions (see ISO POSIX (2003)). 8536 A future version of this specification may withdraw this 8537 value for request. 8538 8539 argp shall point to a ifconf structure, as described in 8540 . Before calling, the caller shall set the 8541 ifc_ifcu.ifcu_req field to point to an array of ifreq 8542 structures, and set ifc_len to the size in bytes of 8543 this allocated array. Upon return, ifc_len will contain 8544 the size in bytes of the array which was actually used. 8545 If it is the same as the length upon calling, the 8546 caller should assume that the array was too small and 8547 try again with a larger array. 8548 8549 On success, SIOCGIFCONF shall return a nonnegative 8550 value. 8551 8552 Rationale: Historical UNIX systems disagree on the meaning 8553 of the return value. 8554 8555 SIOCGIFFLAGS 8556 Get the interface flags for the indicated interface. 8557 argp shall point to a ifreq structure. Before calling, 8558 the caller should fill in the ifr_name field with the 8559 interface name, and upon return, the 8560 ifr_ifru.ifru_flags field is set with the interface 8561 flags. 8562 8563 SIOCGIFADDR 8564 Get the interface address for the given interface. argp 8565 shall point to a ifreq structure. Before calling, the 8566 caller should fill in the ifr_name field with the 8567 interface name, and upon return, the ifr_ifru.ifru_addr 8568 field is set with the interface address. 8569 8570 SIOCGIFBRDADDR 8571 Get the interface broadcast address for the given 8572 interface. argp shall point to a ifreq structure. 8573 Before calling, the caller should fill in the ifr_name 8574 field with the interface name, and upon return, the 8575 ifr_ifru.ifru_broadcast field is set with the interface 8576 broadcast address. 8577 8578 SIOCGIFNETMASK 8579 Get the network mask for the given interface. argp 8580 shall point to a ifreq structure. Before calling, the 8581 caller should fill in the ifr_name field with the 8582 interface name, and upon return, the 8583 ifr_ifru.ifru_netmask field is set with the network 8584 mask. 8585 8586 SIOCGIFMTU 8587 Get the Maximum Transmission Unit (MTU) size for the 8588 given interface. argp shall point to a ifreq structure. 8589 Before calling, the caller should fill in the ifr_name 8590 field with the interface name, and upon return, the 8591 ifr_ifru.ifru_mtu field is set with the MTU. 8592 8593 FIONREAD 8594 Get the amount of queued unread data in the receive 8595 buffer. argp shall point to an integer where the result 8596 is to be placed. 8597 8598 Note: Some implementations may also support the use of 8599 FIONREAD on other types of file descriptor. However, the 8600 LSB only specifies its behavior for a socket related file 8601 descriptor. 8602 8603 Return Value 8604 8605 On success, if request is SIOCGIFCONF, a non-negative integer 8606 shall be returned. If request is not SIOCGIFCONF, on success 0 8607 is returned. On error, -1 is returned and the global variable 8608 errno is set appropriately. 8609 8610 Errors 8611 8612 EBADF 8613 8614 sockfd is not a valid descriptor. 8615 EFAULT 8616 8617 argp references an inaccessible memory area. 8618 ENOTTY 8619 8620 The specified request does not apply to the kind of object 8621 that the descriptor sockfd references. 8622 EINVAL 8623 8624 Either request or argp is invalid. 8625 ENOTCONN 8626 8627 The operation is only defined on a connected socket, but the 8628 socket wasn't connected. 8629 8630 ttyio 8631 8632 Name 8633 8634 ttyio -- tty ioctl commands 8635 8636 Synopsis 8637 8638 #include 8639 #include 8640 8641 int ioctl(int fd, unsigned long request, int * argp); 8642 8643 Description 8644 8645 Tty ioctl commands are a subset of the ioctl() calls, which 8646 can perform a variety of functions on tty devices. fd shall be 8647 an open file descriptor referring to a terminal device. 8648 8649 The following ioctl()s are provided: 8650 8651 TIOCGWINSZ 8652 8653 Get the size attributes of the terminal or pseudo-terminal 8654 identified by fd. On entry, argp shall reference a winsize 8655 structure. On return, the structure will have ws_row set to 8656 the number of rows of text (i.e. lines of text) that can be 8657 viewed on the device, and ws_col set to the number of columns 8658 (i.e. text width). 8659 8660 Note: The number of columns stored in ws_col assumes that 8661 the terminal device is using a mono-spaced font. 8662 8663 Return Value 8664 8665 On success, 0 is returned. On error, -1 is returned and the 8666 global variable errno is set appropriately. 8667 8668 Errors 8669 8670 EBADF 8671 8672 fd is not a valid descriptor. 8673 EFAULT 8674 8675 argp references an inaccessible memory area. 8676 EINVAL 8677 8678 request and argp are not valid. 8679 8680 kill 8681 8682 Name 8683 8684 kill -- send a signal 8685 8686 Synopsis 8687 8688 #include 8689 8690 int kill(pid_t pid, int sig); 8691 8692 Description 8693 8694 kill() is as specified in the ISO POSIX (2003), but with 8695 differences as listed below. 8696 8697 Process ID -1 doesn't affect calling process 8698 8699 If pid is specified as -1, sig shall not be sent to the 8700 calling process. Other than this, the rules in the ISO POSIX 8701 (2003) apply. 8702 8703 Rationale: This was a deliberate Linus decision after an 8704 unpopular experiment in including the calling process in 8705 the 2.5.1 kernel. See "What does it mean to signal 8706 everybody?", Linux Weekly News, 20 December 2001, 8707 http://lwn.net/2001/1220/kernel.php3 8708 8709 link 8710 8711 Name 8712 8713 link -- create a link to a file 8714 8715 Synopsis 8716 8717 #include 8718 8719 int link(const char * path1, const char * path2); 8720 8721 Description 8722 8723 The link() function shall behave as specified in ISO POSIX 8724 (2003), except with differences as listed below. 8725 8726 Need Not Follow Symlinks 8727 8728 ISO POSIX (2003) specifies that pathname resolution shall 8729 follow symbolic links during pathname resolution unless the 8730 function is required to act on the symbolic link itself, or 8731 certain arguments direct that the function act on the symbolic 8732 link itself. The link() function in ISO POSIX (2003) contains 8733 no such requirement to operate on a symbolic link. However, a 8734 conforming LSB implementation need not follow a symbolic link 8735 for the path1 argument. 8736 8737 mbsnrtowcs 8738 8739 Name 8740 8741 mbsnrtowcs -- convert a multibyte string to a wide character 8742 string 8743 8744 Synopsis 8745 8746 #include 8747 8748 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 8749 nms, size_t len, mbstate_t * ps); 8750 8751 Description 8752 8753 mbsnrtowcs() is like mbsrtowcs(), except that the number of 8754 bytes to be converted, starting at src, is limited to nms. 8755 8756 If dest is not a NULL pointer, mbsnrtowcs() converts at most 8757 nms bytes from the multibyte string src to a wide-character 8758 string starting at dest. At most, len wide characters are 8759 written to dest. The state ps is updated. 8760 8761 The conversion is effectively performed by repeatedly calling: 8762 8763 mbrtowc(dest, *src, n, ps) 8764 8765 where n is some positive number, as long as this call 8766 succeeds, and then incrementing dest by one and src by the 8767 number of bytes consumed. 8768 8769 The conversion can stop for three reasons: 8770 8771 * An invalid multibyte sequence has been encountered. In 8772 this case src is left pointing to the invalid multibyte 8773 sequence, (size_t)(-1) is returned, and errno is set to 8774 EILSEQ. 8775 * The nms limit forces a stop, or len non-L'\0' wide 8776 characters have been stored at dest. In this case, src is 8777 left pointing to the next multibyte sequence to be 8778 converted, and the number of wide characters written to 8779 dest is returned. 8780 * The multibyte string has been completely converted, 8781 including the terminating '\0' (which has the side effect 8782 of bringing back ps to the initial state). In this case, 8783 src is set to NULL, and the number of wide characters 8784 written to dest, excluding the terminating L'\0' 8785 character, is returned. 8786 8787 If dest is NULL, len is ignored, and the conversion proceeds 8788 as above, except that the converted wide characters are not 8789 written out to memory, and that no destination length limit 8790 exists. 8791 8792 In both of the above cases, if ps is a NULL pointer, a static 8793 anonymous state only known to mbsnrtowcs() is used instead. 8794 8795 The programmer shall ensure that there is room for at least 8796 len wide characters at dest. 8797 8798 Return Value 8799 8800 mbsnrtowcs() returns the number of wide characters that make 8801 up the converted part of the wide character string, not 8802 including the terminating null wide character. If an invalid 8803 multibyte sequence was encountered, (size_t)(-1) is returned, 8804 and the global variable errno is set to EILSEQ. 8805 8806 Notes 8807 8808 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 8809 of the current locale. 8810 8811 Passing NULL as ps is not multi-thread safe. 8812 8813 memmem 8814 8815 Name 8816 8817 memmem -- locate bytes 8818 8819 Synopsis 8820 8821 #define _GNU_SOURCE 8822 #include 8823 8824 void * memmem(const void * haystack, size_t haystacklen, const 8825 void * needle, size_t needlelen); 8826 8827 Description 8828 8829 memmem() finds the start of the first occurrence of the byte 8830 array referenced by needle of length needlelen in the memory 8831 area haystack of length haystacklen. 8832 8833 Return Value 8834 8835 memmem() returns a pointer to the beginning of the byte array, 8836 or NULL if the byte array is not found. 8837 8838 Notes 8839 8840 Earlier versions of the C library (prior to glibc 2.1) 8841 contained a memmem() with various problems, and application 8842 developers should treat this function with care. 8843 8844 memrchr 8845 8846 Name 8847 8848 memrchr -- scan memory for a character 8849 8850 Synopsis 8851 8852 #include 8853 8854 void * memrchr(const void * s, int c, size_t n); 8855 8856 Description 8857 8858 The memrchr() function shall locate the last occurence of c 8859 (converted to an unsigned char) in the initial n bytes (each 8860 interpreted as an unsigned char) of the object pointed to by 8861 s. 8862 8863 Return Value 8864 8865 The memrchr() shall return a pointer to the located byte, or a 8866 null pointer if the byte does not occur in the object. 8867 8868 Errors 8869 8870 No errors are defined. 8871 8872 See Also 8873 8874 memchr() 8875 8876 newlocale 8877 8878 Name 8879 8880 newlocale -- allocate a locale object 8881 8882 Synopsis 8883 8884 #include 8885 8886 locale_t newlocale(int category_mask, const char * locale, 8887 locale_t base); 8888 8889 Description 8890 8891 The newlocale() function shall initialize a locale object. If 8892 base is NULL, then newlocale() shall first allocate the 8893 object; otherwise it shall use the locale object referenced by 8894 base. 8895 8896 The object shall be initialized for the locale named by 8897 locale, and for the categories selected in category_mask. The 8898 category_mask value is a bitwise inclusive OR of the required 8899 LC_name_MASK values, or the value LC_ALL_MASK. 8900 8901 Return Value 8902 8903 On success, the newlocale() function shall return the 8904 initialized locale object. Otherwise, it shall return NULL, 8905 and set errno to indicate the error. 8906 8907 Errors 8908 8909 The newlocale() function shall fail if: 8910 8911 ENOMEM 8912 8913 Insufficient memory. 8914 EINVAL 8915 8916 An invalid category_mask was provided, or the locale was NULL. 8917 8918 Application Usage (Informative) 8919 8920 The only portable way to allocate a locale object is to call 8921 newlocale() with a NULL base. The allocated object may be 8922 reinitialized to a new locale by passing it back to 8923 newlocale(). The new object may be released by calling 8924 freelocale(). 8925 8926 See Also 8927 8928 setlocale(), freelocale(), duplocale(), uselocale() 8929 8930 ngettext 8931 8932 Name 8933 8934 ngettext -- search message catalogs for plural string 8935 8936 Synopsis 8937 8938 #include 8939 8940 char * ngettext(const char * msgid1, const char * msgid2, 8941 unsigned long int n); 8942 8943 Description 8944 8945 The ngettext() function shall search the currently selected 8946 message catalogs for a string matching the singular string 8947 msgid1. If a string is located, and if n is 1, that string 8948 shall be returned. If n is not 1, a pluralized version 8949 (dependent on n) of the string shall be returned. 8950 8951 The ngettext() function is equivalent to dcngettext(NULL, 8952 msgid1, msgid2, n, LC_MESSAGES)(). 8953 8954 Return Value 8955 8956 If a string is found in the currently selected message 8957 catalogs for msgid1, then if n is 1 a pointer to the located 8958 string shall be returned. If n is not 1, a pointer to an 8959 appropriately pluralized version of the string shall be 8960 returned. If no message could be found in the currently 8961 selected mesage catalogs, then if n is 1, a pointer to msgid1 8962 shall be returned, otherwise a pointer to msgid2 shall be 8963 returned. 8964 8965 Applications shall not modify the string returned by 8966 ngettext(). 8967 8968 Errors 8969 8970 None. 8971 8972 The ngettext() function shall not modify errno. 8973 8974 See Also 8975 8976 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8977 textdomain, bindtextdomain, bind_textdomain_codeset 8978 8979 pmap_getport 8980 8981 Name 8982 8983 pmap_getport -- find the port number assigned to a service 8984 registered with a portmapper. 8985 8986 Synopsis 8987 8988 #include 8989 8990 u_short * pmap_getport(struct sockaddr_in * address, const 8991 u_long program, const u_long * version, u_int protocol); 8992 8993 Description 8994 8995 The pmap_getport() function shall return the port number 8996 assigned to a service registered with a RPC Binding service 8997 running on a given target system, using the protocol described 8998 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 8999 pmap_getport() function shall be called given the RPC program 9000 number program, the program version version, and transport 9001 protocol protocol. Conforming implementations shall support 9002 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 9003 shall specify the address of the system on which the 9004 portmapper to be contacted resides. The value of 9005 address->sin_port shall be ignored, and the standard value for 9006 the portmapper port shall always be used. 9007 9008 Note: Security and network restrictions may prevent a 9009 conforming application from contacting a remote RPC Binding 9010 Service. 9011 9012 Return Value 9013 9014 On success, the pmap_getport() function shall return the port 9015 number in host byte order of the RPC application registered 9016 with the remote portmapper. On failure, if either the program 9017 was not registered or the remote portmapper service could not 9018 be reached, the pmap_getport() function shall return 0. If the 9019 remote portmap service could not be reached, the status is 9020 left in the global variable rpc_createerr. 9021 9022 pmap_set 9023 9024 Name 9025 9026 pmap_set -- establishes mapping to machine's RPC Bind service. 9027 9028 Synopsis 9029 9030 #include 9031 9032 bool_t pmap_set(const u_long program, const u_long version, 9033 int protocol, u_short port); 9034 9035 Description 9036 9037 pmap_set() establishes a mapping between the triple 9038 [program,version,protocol] and port on the machine's RPC Bind 9039 service. The value of protocol is most likely IPPROTO_UDP or 9040 IPPROTO_TCP. Automatically done by svc_register(). 9041 9042 Return Value 9043 9044 pmap_set() returns non-zero if it suceeds, 0 otherwise. 9045 9046 pmap_unset 9047 9048 Name 9049 9050 pmap_unset -- destroys RPC Binding 9051 9052 Synopsis 9053 9054 #include 9055 9056 bool_t pmap_unset(u_long prognum, u_long versnum); 9057 9058 Description 9059 9060 As a user interface to the RPC Bind service, pmap_unset() 9061 destroys all mapping between the triple [prognum,versnum, *] 9062 and ports on the machine's RPC Bind service. 9063 9064 Return Value 9065 9066 pmap_unset() returns non-zero if it succeeds, zero otherwise. 9067 9068 psignal 9069 9070 Name 9071 9072 psignal -- print signal message 9073 9074 Synopsis 9075 9076 #include 9077 9078 void psignal(int sig, const char * s); 9079 9080 extern const char *const sys_siglist[] 9081 9082 Description 9083 9084 The psignal() function shall display a message on the stderr 9085 stream. If s is not the null pointer, and does not point to an 9086 empty string (e.g. "\0"), the message shall consist of the 9087 string s, a colon, a space, and a string describing the signal 9088 number sig; otherwise psignal() shall display only a message 9089 describing the signal number sig. If sig is invalid, the 9090 message displayed shall indicate an unknown signal. 9091 9092 The array sys_siglist holds the signal description strings 9093 indexed by signal number. 9094 9095 Return Value 9096 9097 psignal() returns no value. 9098 9099 regexec 9100 9101 Name 9102 9103 regexec -- regular expression matching 9104 9105 Description 9106 9107 The regexec() function shall behave as specified in ISO POSIX 9108 (2003), except with differences as listed below. 9109 9110 Differences 9111 9112 Certain aspects of regular expression matching are optional; 9113 see Internationalization and Regular Expressions. 9114 9115 scanf 9116 9117 Name 9118 9119 scanf -- convert formatted input 9120 9121 Description 9122 9123 The scanf() family of functions shall behave as described in 9124 ISO POSIX (2003), except as noted below. 9125 9126 Differences 9127 9128 The %s, %S and %[ conversion specifiers shall accept an option 9129 length modifier a, which shall cause a memory buffer to be 9130 allocated to hold the string converted. In such a case, the 9131 argument corresponding to the conversion specifier should be a 9132 reference to a pointer value that will receive a pointer to 9133 the allocated buffer. If there is insufficient memory to 9134 allocate a buffer, the function may set errno to ENOMEM and a 9135 conversion error results. 9136 9137 Note: This directly conflicts with the ISO C (1999) usage 9138 of %a as a conversion specifier for hexadecimal float 9139 values. While this conversion specifier should be 9140 supported, a format specifier such as "%aseconds" will have 9141 a different meaning on an LSB conforming system. 9142 9143 setbuffer 9144 9145 Name 9146 9147 setbuffer -- stream buffering operation 9148 9149 Synopsis 9150 9151 #include 9152 9153 void setbuffer(FILE * stream, char * buf, size_t size); 9154 9155 Description 9156 9157 setbuffer() is an alias for the call to setvbuf(). It works 9158 the same, except that the size of the buffer in setbuffer() is 9159 up to the caller, rather than being determined by the default 9160 BUFSIZ. 9161 9162 setgroups 9163 9164 Name 9165 9166 setgroups -- set list of supplementary group IDs 9167 9168 Synopsis 9169 9170 #include 9171 9172 int setgroups(size_t size, const gid_t * list); 9173 9174 Description 9175 9176 If the process has appropriate privilege, the setgroups() 9177 function shall set the supplementary group IDs for the current 9178 process. list shall reference an array of size group IDs. A 9179 process may have at most NGROUPS_MAX supplementary group IDs. 9180 9181 Return Value 9182 9183 On successful completion, 0 is returned. On error, -1 is 9184 returned and the errno is set to indicate the error. 9185 9186 Errors 9187 9188 EFAULT 9189 9190 list has an invalid address. 9191 EPERM 9192 9193 The process does not have appropriate privileges. 9194 EINVAL 9195 9196 size is greater than NGROUPS_MAX. 9197 9198 sethostname 9199 9200 Name 9201 9202 sethostname -- set host name 9203 9204 Synopsis 9205 9206 #include 9207 #include 9208 #include 9209 9210 int sethostname(const char * name, size_t len); 9211 9212 Description 9213 9214 If the process has appropriate privileges, the sethostname() 9215 function shall change the host name for the current macine. 9216 The name shall point to a null-terminated string of at most 9217 len bytes that holds the new hostname. 9218 9219 If the symbol HOST_NAME_MAX is defined, or if 9220 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 9221 this value shall represent the maximum length of the new 9222 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 9223 value shall represent the maximum length for the new hostname. 9224 If none of these values are defined, the maximum length shall 9225 be the size of the nodename field of the utsname structure. 9226 9227 Return Value 9228 9229 On success, 0 is returned. On error, -1 is returned and the 9230 global variable errno is set appropriately. 9231 9232 Errors 9233 9234 EINVAL 9235 9236 len is negative or larger than the maximum allowed size. 9237 EPERM 9238 9239 the process did not have appropriate privilege. 9240 EFAULT 9241 9242 name is an invalid address. 9243 9244 Rationale 9245 9246 ISO POSIX (2003) guarantees that: 9247 9248 Maximum length of a host name (not including the 9249 terminating null) as returned from the gethostname() 9250 function shall be at least 255 bytes. 9251 9252 The glibc C library does not currently define HOST_NAME_MAX, 9253 and although it provides the name _SC_HOST_NAME_MAX a call to 9254 sysconf() returns -1 and does not alter errno in this case 9255 (indicating that there is no restriction on the hostname 9256 length). However, the glibc manual idicates that some 9257 implementations may have MAXHOSTNAMELEN as a means of 9258 detecting the maximum length, while the Linux kernel at 9259 release 2.4 and 2.6 stores this hostname in the utsname 9260 structure. While the glibc manual suggests simply shortening 9261 the name until sethostname() succeeds, the LSB requires that 9262 one of the first four mechanisms works. Future versions of 9263 glibc may provide a more reasonable result from 9264 sysconf(_SC_HOST_NAME_MAX). 9265 9266 setsockopt 9267 9268 Name 9269 9270 setsockopt -- set socket options 9271 9272 Synopsis 9273 9274 #include 9275 #include 9276 9277 int setsockopt(int socket, int level, int option_name, const 9278 void * option_value, socklen_t option_len); 9279 9280 Description 9281 9282 The setsockopt() function shall behave as specified in ISO 9283 POSIX (2003), with the following extensions. 9284 9285 IP Protocol Level Options 9286 9287 If the level parameter is IPPROTO_IP, the following values 9288 shall be supported for option_name (see RFC 791:Internet 9289 Protocol for further details): 9290 9291 IP_OPTIONS 9292 9293 Set the Internet Protocol options sent with every packet from 9294 this socket. The option_value shall point to a memory buffer 9295 containing the options and option_len shall contain the size 9296 in bytes of that buffer. For IPv4, the maximum length of 9297 options is 40 bytes. 9298 IP_TOS 9299 9300 Set the Type of Service flags to use when sending packets with 9301 this socket. The option_value shall point to a value 9302 containing the type of service value. The least significant 9303 two bits of the value shall contain the new Type of Service 9304 indicator. Use of other bits in the value is unspecified. The 9305 option_len parameter shall hold the size, in bytes, of the 9306 buffer referred to by option_value. 9307 IP_TTL 9308 9309 Set the current unicast Internet Protocol Time To Live value 9310 used when sending packets with this socket. The option_value 9311 shall point to a value containing the time to live value, 9312 which shall be between 1 and 255. The option_len parameter 9313 shall hold the size, in bytes, of the buffer referred to by 9314 option_value. 9315 IP_MULTICAST_TTL 9316 9317 Sets the Time To Live value of outgoing multicast packets for 9318 this socket. optval shall point to an integer which contains 9319 the new TTL value. If the new TTL value is -1, the 9320 implementation should use an unspecified default TTL value. If 9321 the new TTL value is out of the range of acceptable values 9322 (0-255), setsockopt() shall return -1 and set errno to 9323 indicate the error. 9324 IP_MULTICAST_LOOP 9325 9326 Sets a boolean flag indicating whether multicast packets 9327 originating locally should be looped back to the local 9328 sockets. optval shall point to an integer which contains the 9329 new flag value. 9330 IP_ADD_MEMBERSHIP 9331 9332 Join a multicast group. optval shall point to a ip_mreq 9333 structure. Before calling, the caller should fill in the 9334 imr_multiaddr field with the multicast group address and the 9335 imr_address field with the address of the local interface. If 9336 imr_address is set to INADDR_ANY, then an appropriate 9337 interface is chosen by the system. 9338 IP_DROP_MEMBERSHIP 9339 9340 Leave a multicast group. optval shall point to a ip_mreq 9341 structure containing the same values as were used with 9342 IP_ADD_MEMBERSHIP. 9343 IP_MULTICAST_IF 9344 9345 Set the local device for a multicast socket. optval shall 9346 point to a ip_mreq structure initialized in the same manner as 9347 with IP_ADD_MEMBERSHIP. 9348 9349 The ip_mreq structure contains two struct in_addr fields: 9350 imr_multiaddr and imr_address. 9351 9352 Return Value 9353 9354 On success, 0 is returned. On error, -1 is returned and the 9355 global variable errno is set appropriately. 9356 9357 Errors 9358 9359 As defined in ISO POSIX (2003). 9360 9361 setutent 9362 9363 Name 9364 9365 setutent -- access user accounting database entries 9366 9367 Synopsis 9368 9369 #include 9370 9371 void setutent(void); 9372 9373 Description 9374 9375 The setutent() function shall reset the user accounting 9376 database such that the next call to getutent() shall return 9377 the first record in the database. It is recommended to call it 9378 before any of the other functions that operate on the user 9379 accounting databases (e.g. getutent()) 9380 9381 Return Value 9382 9383 None. 9384 9385 sigandset 9386 9387 Name 9388 9389 sigandset -- build a new signal set by combining the two input 9390 sets using logical AND 9391 9392 Synopsis 9393 9394 #include 9395 9396 int sigandset(sigset_t * set, const sigset_t * left, const 9397 sigset_t * right); 9398 9399 Description 9400 9401 The sigandset() shall combine the two signal sets referenced 9402 by left and right, using a logical AND operation, and shall 9403 place the result in the location referenced by set, The 9404 resulting signal set shall contain only signals that are in 9405 both the set referenced by left and the set referenced by 9406 right. 9407 9408 Return Value 9409 9410 On success, sigandset() shall return 0. Otherise, sigandset() 9411 shall return -1 and set errno to indicate the error. 9412 9413 Errors 9414 9415 EINVAL 9416 9417 One or more of set, left, or right was a null pointer. 9418 9419 See Also 9420 9421 sigorset() 9422 9423 sigisemptyset 9424 9425 Name 9426 9427 sigisemptyset -- check for empty signal set 9428 9429 Synopsis 9430 9431 #include 9432 9433 int sigisemptyset(const sigset_t * set); 9434 9435 Description 9436 9437 The sigisemptyset() function shall check for empty signal set 9438 referenced by set. 9439 9440 Return Value 9441 9442 The sigisemptyset() function shall return a positive non-zero 9443 value if the signal set referenced by set is empty, or zero if 9444 this set is empty. On error, sigisemptyset() shall return -1 9445 and set errno to indicate the error. 9446 9447 Errors 9448 9449 EINVAL 9450 9451 set is a null pointer. 9452 9453 sigorset 9454 9455 Name 9456 9457 sigorset -- build a new signal set by combining the two input 9458 sets using logical OR 9459 9460 Synopsis 9461 9462 #include 9463 9464 int sigorset(sigset_t * set, const sigset_t * left, const 9465 sigset_t * right); 9466 9467 Description 9468 9469 The sigorset() shall combine the two signal sets referenced by 9470 left and right, using a logical OR operation, and shall place 9471 the result in the location referenced by set, The resulting 9472 signal set shall contain only signals that are in either the 9473 set referenced by left or the set referenced by right. 9474 9475 Return Value 9476 9477 On success, sigorset() shall return 0. Otherise, sigorset() 9478 shall return -1 and set errno to indicate the error. 9479 9480 Errors 9481 9482 EINVAL 9483 9484 One or more of set, left, or right was a null pointer. 9485 9486 See Also 9487 9488 sigandset() 9489 9490 sigreturn 9491 9492 Name 9493 9494 sigreturn -- return from signal handler and cleanup stack 9495 frame 9496 9497 Synopsis 9498 9499 int sigreturn(struct sigcontext * scp); 9500 9501 Description 9502 9503 The sigreturn() function is used by the system to cleanup 9504 after a signal handler has returned. This function is not in 9505 the source standard; it is only in the binary standard. 9506 9507 Return Value 9508 9509 sigreturn() never returns. 9510 9511 sscanf 9512 9513 Name 9514 9515 sscanf -- convert formatted input 9516 9517 Description 9518 9519 The scanf() family of functions shall behave as described in 9520 ISO POSIX (2003), except as noted below. 9521 9522 Differences 9523 9524 The %s, %S and %[ conversion specifiers shall accept an option 9525 length modifier a, which shall cause a memory buffer to be 9526 allocated to hold the string converted. In such a case, the 9527 argument corresponding to the conversion specifier should be a 9528 reference to a pointer value that will receive a pointer to 9529 the allocated buffer. If there is insufficient memory to 9530 allocate a buffer, the function may set errno to ENOMEM and a 9531 conversion error results. 9532 9533 Note: This directly conflicts with the ISO C (1999) usage 9534 of %a as a conversion specifier for hexadecimal float 9535 values. While this conversion specifier should be 9536 supported, a format specifier such as "%aseconds" will have 9537 a different meaning on an LSB conforming system. 9538 9539 stime 9540 9541 Name 9542 9543 stime -- set time 9544 9545 Synopsis 9546 9547 #define _SVID_SOURCE 9548 #include 9549 9550 int stime(const time_t * t); 9551 9552 Description 9553 9554 If the process has appropriate privilege, the stime() function 9555 shall set the system's idea of the time and date. Time, 9556 referenced by t, is measured in seconds from the epoch 9557 (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 9558 9559 Return Value 9560 9561 On success, stime() shall return 0. Otherwise, stime() shall 9562 return -1 and errno shall be set to indicate the error. 9563 9564 Errors 9565 9566 EPERM 9567 9568 The process does not have appropriate privilege. 9569 EINVAL 9570 9571 t is a null pointer. 9572 9573 stpcpy 9574 9575 Name 9576 9577 stpcpy -- copy a string returning a pointer to its end 9578 9579 Synopsis 9580 9581 #include 9582 9583 char * stpcpy(char * restrict dest, const char * restrict 9584 src); 9585 9586 Description 9587 9588 The stpcpy() function shall copy the string pointed to by src 9589 (including the terminating null character) to the array 9590 pointed to by dest. The strings may not overlap, and the 9591 destination string dest shall be large enough to receive the 9592 copy. 9593 9594 Return Value 9595 9596 stpcpy() returns a pointer to the end of the string dest (that 9597 is, the address of the terminating null character) rather than 9598 the beginning. 9599 9600 Example 9601 9602 This program uses stpcpy() to concatenate foo and bar to 9603 produce foobar, which it then prints. 9604 #include 9605 9606 int 9607 main (void) 9608 { 9609 char buffer[256]; 9610 char *to = buffer; 9611 to = stpcpy (to, "foo"); 9612 to = stpcpy (to, "bar"); 9613 printf ("%s\n", buffer); 9614 } 9615 9616 stpncpy 9617 9618 Name 9619 9620 stpncpy -- copy a fixed-size string, returning a pointer to 9621 its end 9622 9623 Synopsis 9624 9625 #include 9626 9627 char * stpncpy(char * restrict dest, const char * restrict 9628 src, size_t n); 9629 9630 Description 9631 9632 The stpncpy() function shall copy at most n characters from 9633 the string pointed to by src, including the terminating null 9634 character, to the array pointed to by dest. Exactly n 9635 characters are written at dest. If the length strlen()(src) is 9636 smaller than n, the remaining characters in dest are filled 9637 with '\0' characters. If the length strlen(src) is greater 9638 than or equal to n, dest will not be null terminated. 9639 9640 The strings may not overlap. 9641 9642 The programmer shall ensure that there is room for at least n 9643 characters at dest. 9644 9645 Return Value 9646 9647 The stpncpy() function shall return a pointer to the 9648 terminating NULL in dest, or, if dest is not NULL-terminated, 9649 dest + n. 9650 9651 strcasestr 9652 9653 Name 9654 9655 strcasestr -- locate a substring ignoring case 9656 9657 Synopsis 9658 9659 #include 9660 9661 char * strcasestr(const char * s1, const char * s2); 9662 9663 Description 9664 9665 The strcasestr() shall behave as strstr(), except that it 9666 shall ignore the case of both strings. The strcasestr() 9667 function shall be locale aware; that is strcasestr() shall 9668 behave as if both strings had been converted to lower case in 9669 the current locale before the comparison is performed. 9670 9671 Return Value 9672 9673 Upon successful completion, strcasestr() shall return a 9674 pointer to the located string or a null pointer if the string 9675 is not found. If s2 points to a string with zero length, the 9676 function shall return s1. 9677 9678 strerror_r 9679 9680 Name 9681 9682 strerror_r -- reentrant version of strerror 9683 9684 Synopsis 9685 9686 #include 9687 9688 char * strerror_r(int errnum, char * buf, size_t buflen); 9689 9690 Description 9691 9692 The strerror_r() shall behave as specified in ISO POSIX 9693 (2003), except as described below. 9694 9695 Returns String, not Error Value 9696 9697 The strerror_r() function shall return a pointer to the string 9698 corresponding to errno. The returned pointer may point within 9699 the buffer buf (at most buflen bytes). 9700 9701 Return Value 9702 9703 On success, strerror_r() shall return a pointer to the 9704 generated message string (determined by the setting of the 9705 LC_MESSAGES category in the current locale). Otherwise, 9706 strerror_r() shall return the string corresponding to "Unknown 9707 error". 9708 9709 strndup 9710 9711 Name 9712 9713 strndup -- return a malloc'd copy of at most the specified 9714 number of bytes of a string 9715 9716 Synopsis 9717 9718 #include 9719 9720 char * strndup(const char * string, size_t n); 9721 9722 Description 9723 9724 The strndup() function shall return a malloc()'d copy of at 9725 most n bytes of string. The resultant string shall be 9726 terminated even if no NULL terminator appears before string+n. 9727 9728 Return Value 9729 9730 On success, strndup() shall return a pointer to a newly 9731 allocated block of memory containing a copy of at most n bytes 9732 of string. Otherwise, strndup() shall return NULL and set 9733 errno to indicate the error. 9734 9735 Errors 9736 9737 ENOMEM 9738 9739 Insufficient memory available. 9740 9741 strnlen 9742 9743 Name 9744 9745 strnlen -- determine the length of a fixed-size string 9746 9747 Synopsis 9748 9749 #include 9750 9751 size_t strnlen(const char * s, size_t maxlen); 9752 9753 Description 9754 9755 strnlen() returns the number of characters in the string s, 9756 not including the terminating \0 character, but at most 9757 maxlen. In doing this, strnlen() looks only at the first 9758 maxlen characters at s and never beyond s + maxlen. 9759 9760 Return Value 9761 9762 strnlen() returns strlen(s), if that is less than maxlen, or 9763 maxlen if there is no \0 character among the first maxlen 9764 characters pointed to by s. 9765 9766 strptime 9767 9768 Name 9769 9770 strptime -- parse a time string 9771 9772 Description 9773 9774 The strptime() shall behave as specified in the ISO POSIX 9775 (2003) with differences as listed below. 9776 9777 Number of leading zeroes may be limited 9778 9779 The ISO POSIX (2003) specifies fields for which "leading zeros 9780 are permitted but not required"; however, applications shall 9781 not expect to be able to supply more leading zeroes for these 9782 fields than would be implied by the range of the field. 9783 Implementations may choose to either match an input with 9784 excess leading zeroes, or treat this as a non-matching input. 9785 For example, %j has a range of 001 to 366, so 0, 00, 000, 001, 9786 and 045 are acceptable inputs, but inputs such as 0000, 0366 9787 and the like are not. 9788 9789 Rationale 9790 9791 glibc developers consider it appropriate behavior to forbid 9792 excess leading zeroes. When trying to parse a given input 9793 against several format strings, forbidding excess leading 9794 zeroes could be helpful. For example, if one matches 9795 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it 9796 seems useful for the first match to fail, as it would be 9797 perverse to parse that date as November 12, year 26. The 9798 second pattern parses it as December 26, year 11. 9799 9800 The ISO POSIX (2003) is not explicit that an unlimited number 9801 of leading zeroes are required, although it may imply this. 9802 The LSB explicitly allows implementations to have either 9803 behavior. Future versions of this standard may require 9804 implementations to forbid excess leading zeroes. 9805 9806 An Interpretation Request is currently pending against ISO 9807 POSIX (2003) for this matter. 9808 9809 strsep 9810 9811 Name 9812 9813 strsep -- extract token from string 9814 9815 Synopsis 9816 9817 #include 9818 9819 char * strsep(char * * stringp, const char * delim); 9820 9821 Description 9822 9823 The strsep() function shall find the first token in the string 9824 referenced by the pointer stringp, using the characters in 9825 delim as delimiters. 9826 9827 If stringp is NULL, strsep() shall return NULL and do nothing 9828 else. 9829 9830 If stringp is non-NULL, strsep() shall find the first token in 9831 the string referenced by stringp, where tokens are delimited 9832 by characters in the string delim. This token shall be 9833 terminated with a \0 character by overwriting the delimiter, 9834 and stringp shall be updated to point past the token. In case 9835 no delimiter was found, the token is taken to be the entire 9836 string referenced by stringp, and the location referenced by 9837 stringp is made NULL. 9838 9839 Return Value 9840 9841 strsep() shall return a pointer to the beginning of the token. 9842 9843 Notes 9844 9845 The strsep() function was introduced as a replacement for 9846 strtok(), since the latter cannot handle empty fields. 9847 However, strtok() conforms to ISO C (1999) and to ISO POSIX 9848 (2003) and hence is more portable. 9849 9850 See Also 9851 9852 strtok(), strtok_r(). 9853 9854 strsignal 9855 9856 Name 9857 9858 strsignal -- return string describing signal 9859 9860 Synopsis 9861 9862 #define _GNU_SOURCE 9863 #include 9864 9865 char * strsignal(int sig); 9866 9867 extern const char * const sys_siglist[]; 9868 9869 Description 9870 9871 The strsignal() function shall return a pointer to a string 9872 describing the signal number sig. The string can only be used 9873 until the next call to strsignal(). 9874 9875 The array sys_siglist holds the signal description strings 9876 indexed by signal number. This array should not be accessed 9877 directly by applications. 9878 9879 Return Value 9880 9881 If sig is a valid signal number, strsignal() shall return a 9882 pointer to the appropriate description string. Otherwise, 9883 strsignal() shall return either a pointer to the string 9884 "unknown signal", or a null pointer. 9885 9886 Although the function is not declared as returning a pointer 9887 to a constant character string, applications shall not modify 9888 the returned string. 9889 9890 strtoq 9891 9892 Name 9893 9894 strtoq -- convert string value to a long or quad_t integer 9895 9896 Synopsis 9897 9898 #include 9899 #include 9900 #include 9901 9902 long long strtoq(const char * nptr, char * * endptr, int 9903 base); 9904 9905 Description 9906 9907 strtoq() converts the string nptr to a quadt value. The 9908 conversion is done according to the given base, which shall be 9909 between 2 and 36 inclusive, or be the special value 0. 9910 9911 nptr may begin with an arbitrary amount of white space (as 9912 determined by isspace()), followed by a single optional + or - 9913 sign character. If base is 0 or 16, the string may then 9914 include a 0x prefix, and the number will be read in base 16; 9915 otherwise, a 0 base is taken as 10 (decimal), unless the next 9916 character is 0, in which case it is taken as 8 (octal). 9917 9918 The remainder of the string is converted to a long value in 9919 the obvious manner, stopping at the first character which is 9920 not a valid digit in the given base. (In bases above 10, the 9921 letter A in either upper or lower case represents 10, B 9922 represents 11, and so forth, with Z representing 35.) 9923 9924 Return Value 9925 9926 strtoq() returns the result of the conversion, unless the 9927 value would underflow or overflow. If an underflow occurs, 9928 strtoq() returns QUAD_MIN. If an overflow occurs, strtoq() 9929 returns QUAD_MAX. In both cases, the global variable errno is 9930 set to ERANGE. 9931 9932 Errors 9933 9934 ERANGE 9935 9936 The given string was out of range; the value converted has 9937 been clamped. 9938 9939 strtouq 9940 9941 Name 9942 9943 strtouq -- convert a string to an unsigned long long 9944 9945 Synopsis 9946 9947 #include 9948 #include 9949 #include 9950 9951 unsigned long long strtouq(const char * nptr, char * * endptr, 9952 int base); 9953 9954 Description 9955 9956 strtouq() converts the string nptr to an unsigned long long 9957 value. The conversion is done according to the given base, 9958 which shall be between 2 and 36 inclusive, or be the special 9959 value 0. 9960 9961 nptr may begin with an arbitrary amount of white space (as 9962 determined by isspace()), followed by a single optional + or - 9963 sign character. If base is 0 or 16, the string may then 9964 include a 0x prefix, and the number will be read in base 16; 9965 otherwise, a 0 base is taken as 10 (decimal), unless the next 9966 character is 0, in which case it is taken as 8 (octal). 9967 9968 The remainder of the string is converted to an unsigned long 9969 value in the obvious manner, stopping at the end of the string 9970 or at the first character that does not produce a valid digit 9971 in the given base. (In bases above 10, the letter A in either 9972 upper or lower case represents 10, B represents 11, and so 9973 forth, with Z representing 35.) 9974 9975 Return Value 9976 9977 On success, strtouq() returns either the result of the 9978 conversion or, if there was a leading minus sign, the negation 9979 of the result of the conversion, unless the original 9980 (non-negated) value would overflow. In the case of an overflow 9981 the function returns UQUAD_MAX and the global variable errno 9982 is set to ERANGE. 9983 9984 Errors 9985 9986 ERANGE 9987 9988 The given string was out of range; the value converted has 9989 been clamped. 9990 9991 svc_register 9992 9993 Name 9994 9995 svc_register -- register Remote Procedure Call interface 9996 9997 Synopsis 9998 9999 #include 10000 10001 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 10002 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 10003 protocol); 10004 10005 Description 10006 10007 The svc_register() function shall associate the program 10008 identified by prognum at version versnum with the service 10009 dispatch procedure, dispatch. If protocol is zero, the service 10010 is not registered with the portmap service. If protocol is 10011 non-zero, then a mapping of the triple [prognum, versnum, 10012 protocol] to xprt->xp_port is established with the local 10013 portmap service. The procedure dispatch has the following 10014 form: 10015 10016 int dispatch(struct svc_req * request, SVCXPRT * xprt); 10017 10018 Return Value 10019 10020 svc_register() returns 1 if it succeeds, and zero otherwise. 10021 10022 svc_run 10023 10024 Name 10025 10026 svc_run -- waits for RPC requests to arrive and calls service 10027 procedure 10028 10029 Synopsis 10030 10031 #include 10032 10033 void svc_run(void); 10034 10035 Description 10036 10037 The svc_run() function shall wait for RPC requests to arrive, 10038 read and unpack each request, and dispatch it to the 10039 appropriate registered handler. Under normal conditions, 10040 svc_run() shall not return; it shall only return if serious 10041 errors occur that prevent further processing. 10042 10043 svc_sendreply 10044 10045 Name 10046 10047 svc_sendreply -- called by RPC service's dispatch routine 10048 10049 Synopsis 10050 10051 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 10052 out); 10053 10054 Description 10055 10056 Called by an RPC service's dispatch routine to send the 10057 results of a remote procedure call. The parameter xprt is the 10058 request's associated transport handle; outproc is the XDR 10059 routine which is used to encode the results; and out is the 10060 address of the results. This routine returns one if it 10061 succeeds, zero other-wise. 10062 10063 svctcp_create 10064 10065 Name 10066 10067 svctcp_create -- create a TCP/IP-based RPC service transport 10068 10069 Synopsis 10070 10071 #include 10072 10073 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 10074 recv_buf_size); 10075 10076 Description 10077 10078 svctcp_create() cretes a TCP/IP-based RPC service transport, 10079 to which it returns a pointer. The transport is associated 10080 with the socket sock, which may be RPC_ANYSOCK, in which case 10081 a new socket is created. If the socket is not bound to a local 10082 TCP port, then this routine binds it to an arbitrary port. 10083 Upon completion, xprt->xp_sock is the transport's socket 10084 descriptor, and xprt->xp_port is the transport's port number. 10085 Since TCP-based RPC uses buffered I/O, users may specify the 10086 size of buffers; values of zero choose suitable defaults. 10087 10088 Return Value 10089 10090 svctcp_create() returns NULL if it fails, or a pointer to the 10091 RPC service transport otherwise. 10092 10093 svcudp_create 10094 10095 Name 10096 10097 svcudp_create -- create a UDP-based RPC service transport 10098 10099 Synopsis 10100 10101 SVCXPRT * 10102 10103 svcudp_create(int sock); 10104 10105 Description 10106 10107 This call is equivalent to svcudp_bufcreate( sock, SZ, SZ) for 10108 some default size SZ. 10109 10110 swscanf 10111 10112 Name 10113 10114 swscanf -- convert formatted input 10115 10116 Description 10117 10118 The scanf() family of functions shall behave as described in 10119 ISO POSIX (2003), except as noted below. 10120 10121 Differences 10122 10123 The %s, %S and %[ conversion specifiers shall accept an option 10124 length modifier a, which shall cause a memory buffer to be 10125 allocated to hold the string converted. In such a case, the 10126 argument corresponding to the conversion specifier should be a 10127 reference to a pointer value that will receive a pointer to 10128 the allocated buffer. If there is insufficient memory to 10129 allocate a buffer, the function may set errno to ENOMEM and a 10130 conversion error results. 10131 10132 Note: This directly conflicts with the ISO C (1999) usage 10133 of %a as a conversion specifier for hexadecimal float 10134 values. While this conversion specifier should be 10135 supported, a format specifier such as "%aseconds" will have 10136 a different meaning on an LSB conforming system. 10137 10138 system 10139 10140 Name 10141 10142 system -- execute a shell command 10143 10144 Synopsis 10145 10146 #include 10147 10148 int system(const char * string); 10149 10150 Description 10151 10152 The system() function shall behave as described in ISO POSIX 10153 (2003). 10154 10155 Notes 10156 10157 The fact that system() ignores interrupts is often not what a 10158 program wants. ISO POSIX (2003) describes some of the 10159 consequences; an additional consequence is that a program 10160 calling system() from a loop cannot be reliably interrupted. 10161 Many programs will want to use the exec() family of functions 10162 instead. 10163 10164 Do not use system() from a program with suid or sgid 10165 privileges, because unexpected values for some environment 10166 variables might be used to subvert system integrity. Use the 10167 exec() family of functions instead, but not execlp() or 10168 execvp(). system() will not, in fact, work properly from 10169 programs with suid or sgid privileges on systems on which 10170 /bin/sh is bash version 2, since bash 2 drops privileges on 10171 startup. (Debian uses a modified bash which does not do this 10172 when invoked as sh.) 10173 10174 The check for the availability of /bin/sh is not actually 10175 performed; it is always assumed to be available. ISO C (1999) 10176 specifies the check, but ISO POSIX (2003) specifies that the 10177 return shall always be nonzero, since a system without the 10178 shell is not conforming, and it is this that is implemented. 10179 10180 It is possible for the shell command to return 127, so that 10181 code is not a sure indication that the execve() call failed; 10182 check the global variable errno to make sure. 10183 10184 textdomain 10185 10186 Name 10187 10188 textdomain -- set the current default message domain 10189 10190 Synopsis 10191 10192 #include 10193 10194 char * textdomain(const char * domainname); 10195 10196 Description 10197 10198 The textdomain() function shall set the current default 10199 message domain to domainname. Subsequent calls to gettext() 10200 and ngettext() use the default message domain. 10201 10202 If domainname is NULL, the default message domain shall not be 10203 altered. 10204 10205 If domainname is "", textdomain() shall reset the default 10206 domain to the system default of "messages". 10207 10208 Return 10209 10210 On success, textdomain() shall return the currently selected 10211 domain. Otherwise, a null pointer shall be returned, and errno 10212 is set to indicate the error. 10213 10214 Errors 10215 10216 ENOMEM 10217 10218 Insufficent memory available. 10219 10220 unlink 10221 10222 Name 10223 10224 unlink -- remove a directory entry 10225 10226 Synopsis 10227 10228 int unlink(const char * path); 10229 10230 Description 10231 10232 unlink() is as specified in ISO POSIX (2003), but with 10233 differences as listed below. 10234 10235 See also Section 18.1, Additional behaviors: unlink/link on 10236 directory. 10237 10238 May return EISDIR on directories 10239 10240 If path specifies a directory, the implementation may return 10241 EISDIR instead of EPERM as specified by ISO POSIX (2003). 10242 10243 Rationale: The Linux kernel has deliberately chosen EISDIR 10244 for this case and does not expect to change. 10245 10246 uselocale 10247 10248 Name 10249 10250 uselocale -- set locale for thread 10251 10252 Synopsis 10253 10254 #include 10255 10256 locale_t uselocale(locale_t newloc); 10257 10258 Description 10259 10260 The uselocale() function shall set the locale for the calling 10261 thread to the locale specified by newloc. 10262 10263 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 10264 shall be set to the process current global locale, as set by 10265 setlocale(). If newloc is NULL, the thread's locale is not 10266 altered. 10267 10268 Return Value 10269 10270 The uselocale() function shall return the previous locale, or 10271 LC_GLOBAL_LOCALE if the thread local locale has not been 10272 previously set. 10273 10274 Errors 10275 10276 None defined. 10277 10278 See Also 10279 10280 setlocale(), freelocale(), duplocale(), newlocale() 10281 10282 utmpname 10283 10284 Name 10285 10286 utmpname -- set user accounting database 10287 10288 Synopsis 10289 10290 #include 10291 10292 int utmpname(const char * dbname); 10293 10294 Description 10295 10296 The utmpname() function shall cause the user accounting 10297 database used by the getutent(), getutent_r(), getutxent(), 10298 getutxid(), getutxline(), and pututxline() functions to be 10299 that named by dbname, instead of the system default database. 10300 See Section 12.3 for further information. 10301 10302 Note: The LSB does not specify the format of the user 10303 accounting database, nor the names of the file or files 10304 that may contain it. 10305 10306 Return Value 10307 10308 None. 10309 10310 Errors 10311 10312 None defined. 10313 10314 vasprintf 10315 10316 Name 10317 10318 vasprintf -- write formatted output to a dynamically allocated 10319 string 10320 10321 Synopsis 10322 10323 #include 10324 #include 10325 10326 int vasprintf(char * * restrict ptr, const char * restrict 10327 format, va_list arg); 10328 10329 Description 10330 10331 The vasprintf() function shall write formatted output to a 10332 dynamically allocated string, and store the address of that 10333 string in the location referenced by ptr. It shall behave as 10334 asprintf(), except that instead of being called with a 10335 variable number of arguments, it is called with an argument 10336 list as defined by . 10337 10338 Return Value 10339 10340 Refer to fprintf(). 10341 10342 Errors 10343 10344 Refer to fprintf(). 10345 10346 vdprintf 10347 10348 Name 10349 10350 vdprintf -- write formatted output to a file descriptor 10351 10352 Synopsis 10353 10354 #include 10355 10356 int vdprintf(int fd, const char * restrict format, va_list 10357 arg); 10358 10359 Description 10360 10361 The vdprintf() function shall behave as vfprintf(), except 10362 that vdprintf() shall write output to the file associated with 10363 the file descriptor specified by the fd argument, rather than 10364 place output on a stream (as defined by ISO POSIX (2003)). 10365 10366 Return Value 10367 10368 Refer to fprintf(). 10369 10370 Errors 10371 10372 Refer to fprintf(). 10373 10374 verrx 10375 10376 Name 10377 10378 verrx -- display formatted error message and exit 10379 10380 Synopsis 10381 10382 #include 10383 #include 10384 10385 void verrx(int eval, const char * fmt, va_list args); 10386 10387 Description 10388 10389 The verrx() shall behave as errx() except that instead of 10390 being called with a variable number of arguments, it is called 10391 with an argument list as defined by . 10392 10393 verrx() does not return, but exits with the value of eval. 10394 10395 Return Value 10396 10397 None. 10398 10399 Errors 10400 10401 None. 10402 10403 vfscanf 10404 10405 Name 10406 10407 vfscanf -- convert formatted input 10408 10409 Description 10410 10411 The scanf() family of functions shall behave as described in 10412 ISO POSIX (2003), except as noted below. 10413 10414 Differences 10415 10416 The %s, %S and %[ conversion specifiers shall accept an option 10417 length modifier a, which shall cause a memory buffer to be 10418 allocated to hold the string converted. In such a case, the 10419 argument corresponding to the conversion specifier should be a 10420 reference to a pointer value that will receive a pointer to 10421 the allocated buffer. If there is insufficient memory to 10422 allocate a buffer, the function may set errno to ENOMEM and a 10423 conversion error results. 10424 10425 Note: This directly conflicts with the ISO C (1999) usage 10426 of %a as a conversion specifier for hexadecimal float 10427 values. While this conversion specifier should be 10428 supported, a format specifier such as "%aseconds" will have 10429 a different meaning on an LSB conforming system. 10430 10431 vfwscanf 10432 10433 Name 10434 10435 vfwscanf -- convert formatted input 10436 10437 Description 10438 10439 The scanf() family of functions shall behave as described in 10440 ISO POSIX (2003), except as noted below. 10441 10442 Differences 10443 10444 The %s, %S and %[ conversion specifiers shall accept an option 10445 length modifier a, which shall cause a memory buffer to be 10446 allocated to hold the string converted. In such a case, the 10447 argument corresponding to the conversion specifier should be a 10448 reference to a pointer value that will receive a pointer to 10449 the allocated buffer. If there is insufficient memory to 10450 allocate a buffer, the function may set errno to ENOMEM and a 10451 conversion error results. 10452 10453 Note: This directly conflicts with the ISO C (1999) usage 10454 of %a as a conversion specifier for hexadecimal float 10455 values. While this conversion specifier should be 10456 supported, a format specifier such as "%aseconds" will have 10457 a different meaning on an LSB conforming system. 10458 10459 vscanf 10460 10461 Name 10462 10463 vscanf -- convert formatted input 10464 10465 Description 10466 10467 The scanf() family of functions shall behave as described in 10468 ISO POSIX (2003), except as noted below. 10469 10470 Differences 10471 10472 The %s, %S and %[ conversion specifiers shall accept an option 10473 length modifier a, which shall cause a memory buffer to be 10474 allocated to hold the string converted. In such a case, the 10475 argument corresponding to the conversion specifier should be a 10476 reference to a pointer value that will receive a pointer to 10477 the allocated buffer. If there is insufficient memory to 10478 allocate a buffer, the function may set errno to ENOMEM and a 10479 conversion error results. 10480 10481 Note: This directly conflicts with the ISO C (1999) usage 10482 of %a as a conversion specifier for hexadecimal float 10483 values. While this conversion specifier should be 10484 supported, a format specifier such as "%aseconds" will have 10485 a different meaning on an LSB conforming system. 10486 10487 vsscanf 10488 10489 Name 10490 10491 vsscanf -- convert formatted input 10492 10493 Description 10494 10495 The scanf() family of functions shall behave as described in 10496 ISO POSIX (2003), except as noted below. 10497 10498 Differences 10499 10500 The %s, %S and %[ conversion specifiers shall accept an option 10501 length modifier a, which shall cause a memory buffer to be 10502 allocated to hold the string converted. In such a case, the 10503 argument corresponding to the conversion specifier should be a 10504 reference to a pointer value that will receive a pointer to 10505 the allocated buffer. If there is insufficient memory to 10506 allocate a buffer, the function may set errno to ENOMEM and a 10507 conversion error results. 10508 10509 Note: This directly conflicts with the ISO C (1999) usage 10510 of %a as a conversion specifier for hexadecimal float 10511 values. While this conversion specifier should be 10512 supported, a format specifier such as "%aseconds" will have 10513 a different meaning on an LSB conforming system. 10514 10515 vswscanf 10516 10517 Name 10518 10519 vswscanf -- convert formatted input 10520 10521 Description 10522 10523 The scanf() family of functions shall behave as described in 10524 ISO POSIX (2003), except as noted below. 10525 10526 Differences 10527 10528 The %s, %S and %[ conversion specifiers shall accept an option 10529 length modifier a, which shall cause a memory buffer to be 10530 allocated to hold the string converted. In such a case, the 10531 argument corresponding to the conversion specifier should be a 10532 reference to a pointer value that will receive a pointer to 10533 the allocated buffer. If there is insufficient memory to 10534 allocate a buffer, the function may set errno to ENOMEM and a 10535 conversion error results. 10536 10537 Note: This directly conflicts with the ISO C (1999) usage 10538 of %a as a conversion specifier for hexadecimal float 10539 values. While this conversion specifier should be 10540 supported, a format specifier such as "%aseconds" will have 10541 a different meaning on an LSB conforming system. 10542 10543 vsyslog 10544 10545 Name 10546 10547 vsyslog -- log to system log 10548 10549 Synopsis 10550 10551 #include 10552 #include 10553 10554 void vsyslog(int priority, char * message, va_list arglist); 10555 10556 Description 10557 10558 The vsyslog() function is identical to syslog() as specified 10559 in ISO POSIX (2003), except that arglist (as defined by 10560 stdarg.h) replaces the variable number of arguments. 10561 10562 vwscanf 10563 10564 Name 10565 10566 vwscanf -- convert formatted input 10567 10568 Description 10569 10570 The scanf() family of functions shall behave as described in 10571 ISO POSIX (2003), except as noted below. 10572 10573 Differences 10574 10575 The %s, %S and %[ conversion specifiers shall accept an option 10576 length modifier a, which shall cause a memory buffer to be 10577 allocated to hold the string converted. In such a case, the 10578 argument corresponding to the conversion specifier should be a 10579 reference to a pointer value that will receive a pointer to 10580 the allocated buffer. If there is insufficient memory to 10581 allocate a buffer, the function may set errno to ENOMEM and a 10582 conversion error results. 10583 10584 Note: This directly conflicts with the ISO C (1999) usage 10585 of %a as a conversion specifier for hexadecimal float 10586 values. While this conversion specifier should be 10587 supported, a format specifier such as "%aseconds" will have 10588 a different meaning on an LSB conforming system. 10589 10590 wait4 10591 10592 Name 10593 10594 wait4 -- wait for process termination, BSD style 10595 10596 Synopsis 10597 10598 #include 10599 #include 10600 #include 10601 10602 pid_t wait4(pid_t pid, int * status, int options, struct 10603 rusage * rusage); 10604 10605 Description 10606 10607 wait4() suspends execution of the current process until a 10608 child (as specified by pid) has exited, or until a signal is 10609 delivered whose action is to terminate the current process or 10610 to call a signal handling function. If a child (as requested 10611 by pid) has already exited by the time of the call (a 10612 so-called "zombie" process), the function returns immediately. 10613 Any system resources used by the child are freed. 10614 10615 The value of pid can be one of: 10616 10617 < -1 10618 10619 wait for any child process whose process group ID is equal to 10620 the absolute value of pid. 10621 -1 10622 10623 wait for any child process; this is equivalent to calling 10624 wait3(). 10625 0 10626 10627 wait for any child process whose process group ID is equal to 10628 that of the calling process. 10629 > 0 10630 10631 wait for the child whose process ID is equal to the value of 10632 pid. 10633 10634 The value of options is a bitwise or of zero or more of the 10635 following constants: 10636 10637 WNOHANG 10638 10639 return immediately if no child is there to be waited for. 10640 WUNTRACED 10641 10642 return for children that are stopped, and whose status has not 10643 been reported. 10644 10645 If status is not NULL, wait4() stores status information in 10646 the location status. This status can be evaluated with the 10647 following macros: 10648 10649 Note: These macros take the status value (an int) as an 10650 argument -- not a pointer to the value! 10651 10652 WIFEXITED(status) 10653 10654 is nonzero if the child exited normally. 10655 WEXITSTATUS(status) 10656 10657 evaluates to the least significant eight bits of the return 10658 code of the child that terminated, which may have been set as 10659 the argument to a call to exit() or as the argument for a 10660 return statement in the main program. This macro can only be 10661 evaluated if WIFEXITED() returned nonzero. 10662 WIFSIGNALED(status) 10663 10664 returns true if the child process exited because of a signal 10665 that was not caught. 10666 WTERMSIG(status) 10667 10668 returns the number of the signal that caused the child process 10669 to terminate. This macro can only be evaluated if 10670 WIFSIGNALED() returned nonzero. 10671 WIFSTOPPED(status) 10672 10673 returns true if the child process that caused the return is 10674 currently stopped; this is only possible if the call was done 10675 using WUNTRACED(). 10676 WSTOPSIG(status) 10677 10678 returns the number of the signal that caused the child to 10679 stop. This macro can only be evaluated if WIFSTOPPED() 10680 returned nonzero. 10681 10682 If rusage is not NULL, the struct rusage (as defined in 10683 sys/resource.h) that it points to will be filled with 10684 accounting information. See getrusage() for details. 10685 10686 Return Value 10687 10688 On success, the process ID of the child that exited is 10689 returned. On error, -1 is returned (in particular, when no 10690 unwaited-for child processes of the specified kind exist), or 10691 0 if WNOHANG() was used and no child was available yet. In the 10692 latter two cases, the global variable errno is set 10693 appropriately. 10694 10695 Errors 10696 10697 ECHILD 10698 10699 No unwaited-for child process as specified does exist. 10700 ERESTARTSYS 10701 10702 A WNOHANG() was not set and an unblocked signal or a SIGCHILD 10703 was caught. This error is returned by the system call. The 10704 library interface is not allowed to return ERESTARTSYS, but 10705 will return EINTR. 10706 10707 waitpid 10708 10709 Name 10710 10711 waitpid -- wait for child process 10712 10713 Description 10714 10715 waitpid() is as specified in ISO POSIX (2003), but with 10716 differences as listed below. 10717 10718 Need not support WCONTINUED or WIFCONTINUED 10719 10720 Implementations need not support the XSI optional 10721 functionality of WCONTINUED() or WIFCONTINUED(). 10722 10723 warn 10724 10725 Name 10726 10727 warn -- formatted error messages 10728 10729 Synopsis 10730 10731 #include 10732 10733 void warn(const char * fmt, ...); 10734 10735 Description 10736 10737 The warn() function shall display a formatted error message on 10738 the standard error stream. The output shall consist of the 10739 last component of the program name, a colon character, and a 10740 space character. If fmt is non-NULL, it shall be used as a 10741 format string for the printf() family of functions, and the 10742 formatted message, a colon character, and a space are written 10743 to stderr. Finally, the error message string affiliated with 10744 the current value of the global variable errno shall be 10745 written to stderr, followed by a newline character. 10746 10747 Return Value 10748 10749 None. 10750 10751 Errors 10752 10753 None. 10754 10755 warnx 10756 10757 Name 10758 10759 warnx -- formatted error messages 10760 10761 Synopsis 10762 10763 #include 10764 10765 void warnx(const char * fmt, ...); 10766 10767 Description 10768 10769 The warnx() function shall display a formatted error message 10770 on the standard error stream. The last component of the 10771 program name, a colon character, and a space shall be output. 10772 If fmt is non-NULL, it shall be used as the format string for 10773 the printf() family of functions, and the formatted error 10774 message, a colon character, and a space shall be output. The 10775 output shall be followed by a newline character. 10776 10777 Return Value 10778 10779 None. 10780 10781 Errors 10782 10783 None. 10784 10785 wcpcpy 10786 10787 Name 10788 10789 wcpcpy -- copy a wide character string, returning a pointer to 10790 its end 10791 10792 Synopsis 10793 10794 #include 10795 10796 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 10797 10798 Description 10799 10800 wcpcpy() is the wide-character equivalent of stpcpy(). It 10801 copies the wide character string src, including the 10802 terminating null wide character code, to the array dest. 10803 10804 The strings may not overlap. 10805 10806 The programmer shall ensure that there is room for at least 10807 wcslen()(src)+1 wide characters at dest. 10808 10809 Return Value 10810 10811 wcpcpy() returns a pointer to the end of the wide-character 10812 string dest, that is, a pointer to the terminating null wide 10813 character code. 10814 10815 wcpncpy 10816 10817 Name 10818 10819 wcpncpy -- copy a fixed-size string of wide characters, 10820 returning a pointer to its end 10821 10822 Synopsis 10823 10824 #include 10825 10826 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 10827 n); 10828 10829 Description 10830 10831 wcpncpy() is the wide-character equivalent of stpncpy(). It 10832 copies at most n wide characters from the wide-character 10833 string src, including the terminating null wide character 10834 code, to the array dest. Exactly n wide characters are written 10835 at dest. If the length wcslen()(src) is smaller than n, the 10836 remaining wide characters in the array dest are filled with 10837 null wide character codes. If the length wcslen()(src) is 10838 greater than or equal to n, the string dest will not be 10839 terminated with a null wide character code. 10840 10841 The strings may not overlap. 10842 10843 The programmer shall ensure that there is room for at least n 10844 wide characters at dest. 10845 10846 Return Value 10847 10848 wcpncpy() returns a pointer to the wide character one past the 10849 last non-null wide character written. 10850 10851 wcscasecmp 10852 10853 Name 10854 10855 wcscasecmp -- compare two wide-character strings, ignoring 10856 case 10857 10858 Synopsis 10859 10860 #include 10861 10862 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 10863 10864 Description 10865 10866 wcscasecmp() is the wide-character equivalent of strcasecmp(). 10867 It compares the wide-character string s1 and the 10868 wide-character string s2, ignoring case differences (towupper, 10869 towlower). 10870 10871 Return Value 10872 10873 The wcscasecmp() function shall return 0 if the wide-character 10874 strings s1 and s2 are equal except for case distinctions. It 10875 shall return a positive integer if s1 is greater than s2, 10876 ignoring case. It shall return a negative integer if s1 is 10877 less than s2, ignoring case. 10878 10879 Notes 10880 10881 The behavior of wcscasecmp() depends upon the LC_CTYPE 10882 category of the current locale. 10883 10884 wcsdup 10885 10886 Name 10887 10888 wcsdup -- duplicate a wide-character string 10889 10890 Synopsis 10891 10892 #include 10893 10894 wchar_t * wcsdup(const wchar_t * s); 10895 10896 Description 10897 10898 wcsdup() is the wide-character equivalent of strdup(). It 10899 allocates and returns a new wide-character string whose 10900 initial contents is a duplicate of the wide-character string 10901 s. 10902 10903 Memory for the new wide-character string is obtained with 10904 malloc(), and can be freed with free(). 10905 10906 Return Value 10907 10908 wcsdup() returns a pointer to the new wide-character string, 10909 or NULL if sufficient memory was not available. 10910 10911 wcsncasecmp 10912 10913 Name 10914 10915 wcsncasecmp -- compare two fixed-size wide-character strings, 10916 ignoring case 10917 10918 Synopsis 10919 10920 #include 10921 10922 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 10923 n); 10924 10925 Description 10926 10927 wcsncasecmp() is the wide-character equivalent of 10928 strncasecmp(). It compares the wide-character string s1 and 10929 the wide-character string s2, but at most n wide characters 10930 from each string, ignoring case differences (towupper, 10931 towlower). 10932 10933 Return Value 10934 10935 wcscasecmp() returns 0 if the wide-character strings s1 and 10936 s2, truncated to at most length n, are equal except for case 10937 distinctions. It returns a positive integer if truncated s1 is 10938 greater than truncated s2, ignoring case. It returns a 10939 negative integer if truncated s1 is smaller than truncated s2, 10940 ignoring case. 10941 10942 Notes 10943 10944 The behavior of wcsncasecmp() depends upon the LC_CTYPE 10945 category of the current locale. 10946 10947 wcsnlen 10948 10949 Name 10950 10951 wcsnlen -- determine the length of a fixed-size wide-character 10952 string 10953 10954 Synopsis 10955 10956 #include 10957 10958 size_t wcsnlen(const wchar_t * s, size_t maxlen); 10959 10960 Description 10961 10962 wcsnlen() is the wide-character equivalent of strnlen(). It 10963 returns the number of wide-characters in the string s, not 10964 including the terminating null wide character code, but at 10965 most maxlen. In doing this, wcsnlen() looks only at the first 10966 maxlen wide-characters at s and never beyond s + maxlen. 10967 10968 Return Value 10969 10970 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 10971 maxlen if there is no null wide character code among the first 10972 maxlen wide characters pointed to by s. 10973 10974 wcsnrtombs 10975 10976 Name 10977 10978 wcsnrtombs -- convert a wide character string to a multi-byte 10979 string 10980 10981 Synopsis 10982 10983 #include 10984 10985 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 10986 nwc, size_t len, mbstate_t * ps); 10987 10988 Description 10989 10990 wcsnrtombs() is like wcsrtombs(), except that the number of 10991 wide characters to be converted, starting at src, is limited 10992 to nwc. 10993 10994 If dest is not a NULL pointer, wcsnrtombs() converts at most 10995 nwc wide characters from the wide-character string src to a 10996 multibyte string starting at dest. At most len bytes are 10997 written to dest. The state ps is updated. 10998 10999 The conversion is effectively performed by repeatedly calling: 11000 wcrtomb(dest, *src, ps) 11001 11002 as long as this call succeeds, and then incrementing dest by 11003 the number of bytes written and src by 1. 11004 11005 The conversion can stop for three reasons: 11006 11007 * A wide character has been encountered that cannot be 11008 represented as a multibyte sequence (according to the 11009 current locale). In this case src is left pointing to the 11010 invalid wide character, (size_t)(-1) is returned, and 11011 errno is set to EILSEQ. 11012 * nws wide characters have been converted without 11013 encountering a null wide character code, or the length 11014 limit forces a stop. In this case, src is left pointing to 11015 the next wide character to be converted, and the number 11016 bytes written to dest is returned. 11017 * The wide-character string has been completely converted, 11018 including the terminating null wide character code (which 11019 has the side effect of bringing back ps to the initial 11020 state). In this case, src is set to NULL, and the number 11021 of bytes written to dest, excluding the terminating null 11022 wide character code, is returned. 11023 11024 If dest is NULL, len is ignored, and the conversion proceeds 11025 as above, except that the converted bytes are not written out 11026 to memory, and that no destination length limit exists. 11027 11028 In both of the above cases, if ps is a NULL pointer, a static 11029 anonymous state only known to wcsnrtombs() is used instead. 11030 11031 The programmer shall ensure that there is room for at least 11032 len bytes at dest. 11033 11034 Return Value 11035 11036 wcsnrtombs() returns the number of bytes that make up the 11037 converted part of multibyte sequence, not including the 11038 terminating null wide character code. If a wide character was 11039 encountered which could not be converted, (size_t)(-1) is 11040 returned, and the global variable errno set to EILSEQ. 11041 11042 Notes 11043 11044 The behavior of wcsnrtombs() depends on the LC_CTYPE category 11045 of the current locale. 11046 11047 Passing NULL as ps is not multi-thread safe. 11048 11049 wcstoq 11050 11051 Name 11052 11053 wcstoq -- convert wide string to long long int representation 11054 11055 Synopsis 11056 11057 #include 11058 11059 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 11060 restrict endptr, int base); 11061 11062 Description 11063 11064 The wcstoq() function shall convert the initial portion of the 11065 wide string nptr to long long int representation. It is 11066 identical to wcstoll(). 11067 11068 Return Value 11069 11070 Refer to wcstoll(). 11071 11072 Errors 11073 11074 Refer to wcstoll(). 11075 11076 wcstouq 11077 11078 Name 11079 11080 wcstouq -- convert wide string to unsigned long long int 11081 representation 11082 11083 Synopsis 11084 11085 #include 11086 11087 unsigned long long wcstouq(const wchar_t * restrict nptr, 11088 wchar_t ** restrict endptr, int base); 11089 11090 Description 11091 11092 The wcstouq() function shall convert the initial portion of 11093 the wide string nptr to unsigned long long int representation. 11094 It is identical to wcstoull(). 11095 11096 Return Value 11097 11098 Refer to wcstoull(). 11099 11100 Errors 11101 11102 Refer to wcstoull(). 11103 11104 wscanf 11105 11106 Name 11107 11108 wscanf -- convert formatted input 11109 11110 Description 11111 11112 The scanf() family of functions shall behave as described in 11113 ISO POSIX (2003), except as noted below. 11114 11115 Differences 11116 11117 The %s, %S and %[ conversion specifiers shall accept an option 11118 length modifier a, which shall cause a memory buffer to be 11119 allocated to hold the string converted. In such a case, the 11120 argument corresponding to the conversion specifier should be a 11121 reference to a pointer value that will receive a pointer to 11122 the allocated buffer. If there is insufficient memory to 11123 allocate a buffer, the function may set errno to ENOMEM and a 11124 conversion error results. 11125 11126 Note: This directly conflicts with the ISO C (1999) usage 11127 of %a as a conversion specifier for hexadecimal float 11128 values. While this conversion specifier should be 11129 supported, a format specifier such as "%aseconds" will have 11130 a different meaning on an LSB conforming system. 11131 11132 xdr_u_int 11133 11134 Name 11135 11136 xdr_u_int -- library routines for external data representation 11137 11138 Synopsis 11139 11140 int xdr_u_int(XDR * xdrs, unsigned int * up); 11141 11142 Description 11143 11144 xdr_u_int() is a filter primitive that translates between C 11145 unsigned integers and their external representations. 11146 11147 Return Value 11148 11149 On success, 1 is returned. On error, 0 is returned. 11150 _________________________________________________________ 11151 11152 9.6. Interfaces for libm 11153 11154 Table 9-24 defines the library name and shared object name for 11155 the libm library 11156 11157 Table 9-24. libm Definition 11158 Library: libm 11159 SONAME: See archLSB. 11160 11161 The behavior of the interfaces in this library is specified by 11162 the following specifications: 11163 11164 [ISOC99] ISO C (1999) 11165 [LSB] This Specification 11166 [SUSv2] SUSv2 11167 [SUSv3] ISO POSIX (2003) 11168 _________________________________________________________ 11169 11170 9.6.1. Math 11171 _________________________________________________________ 11172 11173 9.6.1.1. Interfaces for Math 11174 11175 An LSB conforming implementation shall provide the generic 11176 functions for Math specified in Table 9-25, with the full 11177 mandatory functionality as described in the referenced 11178 underlying specification. 11179 11180 Table 9-25. libm - Math Function Interfaces 11181 __finite [ISOC99] __finitef [ISOC99] __finitel [ISOC99] 11182 __fpclassify [LSB] 11183 __fpclassifyf [LSB] __signbit [ISOC99] __signbitf [ISOC99] 11184 acos [SUSv3] 11185 acosf [SUSv3] acosh [SUSv3] acoshf [SUSv3] acoshl [SUSv3] 11186 acosl [SUSv3] asin [SUSv3] asinf [SUSv3] asinh [SUSv3] 11187 asinhf [SUSv3] asinhl [SUSv3] asinl [SUSv3] atan [SUSv3] 11188 atan2 [SUSv3] atan2f [SUSv3] atan2l [SUSv3] atanf [SUSv3] 11189 atanh [SUSv3] atanhf [SUSv3] atanhl [SUSv3] atanl [SUSv3] 11190 cabs [SUSv3] cabsf [SUSv3] cabsl [SUSv3] cacos [SUSv3] 11191 cacosf [SUSv3] cacosh [SUSv3] cacoshf [SUSv3] cacoshl [SUSv3] 11192 cacosl [SUSv3] carg [SUSv3] cargf [SUSv3] cargl [SUSv3] 11193 casin [SUSv3] casinf [SUSv3] casinh [SUSv3] casinhf [SUSv3] 11194 casinhl [SUSv3] casinl [SUSv3] catan [SUSv3] catanf [SUSv3] 11195 catanh [SUSv3] catanhf [SUSv3] catanhl [SUSv3] catanl [SUSv3] 11196 cbrt [SUSv3] cbrtf [SUSv3] cbrtl [SUSv3] ccos [SUSv3] 11197 ccosf [SUSv3] ccosh [SUSv3] ccoshf [SUSv3] ccoshl [SUSv3] 11198 ccosl [SUSv3] ceil [SUSv3] ceilf [SUSv3] ceill [SUSv3] 11199 cexp [SUSv3] cexpf [SUSv3] cexpl [SUSv3] cimag [SUSv3] 11200 cimagf [SUSv3] cimagl [SUSv3] clog [SUSv3] clog10 [ISOC99] 11201 clog10f [ISOC99] clog10l [ISOC99] clogf [SUSv3] clogl [SUSv3] 11202 conj [SUSv3] conjf [SUSv3] conjl [SUSv3] copysign [SUSv3] 11203 copysignf [SUSv3] copysignl [SUSv3] cos [SUSv3] cosf [SUSv3] 11204 cosh [SUSv3] coshf [SUSv3] coshl [SUSv3] cosl [SUSv3] 11205 cpow [SUSv3] cpowf [SUSv3] cpowl [SUSv3] cproj [SUSv3] 11206 cprojf [SUSv3] cprojl [SUSv3] creal [SUSv3] crealf [SUSv3] 11207 creall [SUSv3] csin [SUSv3] csinf [SUSv3] csinh [SUSv3] 11208 csinhf [SUSv3] csinhl [SUSv3] csinl [SUSv3] csqrt [SUSv3] 11209 csqrtf [SUSv3] csqrtl [SUSv3] ctan [SUSv3] ctanf [SUSv3] 11210 ctanh [SUSv3] ctanhf [SUSv3] ctanhl [SUSv3] ctanl [SUSv3] 11211 dremf [ISOC99] dreml [ISOC99] erf [SUSv3] erfc [SUSv3] 11212 erfcf [SUSv3] erfcl [SUSv3] erff [SUSv3] erfl [SUSv3] 11213 exp [SUSv3] exp2 [SUSv3] exp2f [SUSv3] expf [SUSv3] 11214 expl [SUSv3] expm1 [SUSv3] expm1f [SUSv3] expm1l [SUSv3] 11215 fabs [SUSv3] fabsf [SUSv3] fabsl [SUSv3] fdim [SUSv3] 11216 fdimf [SUSv3] fdiml [SUSv3] feclearexcept [SUSv3] fegetenv 11217 [SUSv3] 11218 fegetexceptflag [SUSv3] fegetround [SUSv3] feholdexcept 11219 [SUSv3] feraiseexcept [SUSv3] 11220 fesetenv [SUSv3] fesetexceptflag [SUSv3] fesetround [SUSv3] 11221 fetestexcept [SUSv3] 11222 feupdateenv [SUSv3] finite [SUSv2] finitef [ISOC99] finitel 11223 [ISOC99] 11224 floor [SUSv3] floorf [SUSv3] floorl [SUSv3] fma [SUSv3] 11225 fmaf [SUSv3] fmal [SUSv3] fmax [SUSv3] fmaxf [SUSv3] 11226 fmaxl [SUSv3] fmin [SUSv3] fminf [SUSv3] fminl [SUSv3] 11227 fmod [SUSv3] fmodf [SUSv3] fmodl [SUSv3] frexp [SUSv3] 11228 frexpf [SUSv3] frexpl [SUSv3] gamma [SUSv2] gammaf [ISOC99] 11229 gammal [ISOC99] hypot [SUSv3] hypotf [SUSv3] hypotl [SUSv3] 11230 ilogb [SUSv3] ilogbf [SUSv3] ilogbl [SUSv3] j0 [SUSv3] 11231 j0f [ISOC99] j0l [ISOC99] j1 [SUSv3] j1f [ISOC99] 11232 j1l [ISOC99] jn [SUSv3] jnf [ISOC99] jnl [ISOC99] 11233 ldexp [SUSv3] ldexpf [SUSv3] ldexpl [SUSv3] lgamma [SUSv3] 11234 lgamma_r [ISOC99] lgammaf [SUSv3] lgammaf_r [ISOC99] lgammal 11235 [SUSv3] 11236 lgammal_r [ISOC99] llrint [SUSv3] llrintf [SUSv3] llrintl 11237 [SUSv3] 11238 llround [SUSv3] llroundf [SUSv3] llroundl [SUSv3] log [SUSv3] 11239 log10 [SUSv3] log10f [SUSv3] log10l [SUSv3] log1p [SUSv3] 11240 log1pf [SUSv3] log1pl [SUSv3] log2 [SUSv3] log2f [SUSv3] 11241 log2l [SUSv3] logb [SUSv3] logbf [SUSv3] logbl [SUSv3] 11242 logf [SUSv3] logl [SUSv3] lrint [SUSv3] lrintf [SUSv3] 11243 lrintl [SUSv3] lround [SUSv3] lroundf [SUSv3] lroundl [SUSv3] 11244 matherr [ISOC99] modf [SUSv3] modff [SUSv3] modfl [SUSv3] 11245 nan [SUSv3] nanf [SUSv3] nanl [SUSv3] nearbyint [SUSv3] 11246 nearbyintf [SUSv3] nearbyintl [SUSv3] nextafter [SUSv3] 11247 nextafterf [SUSv3] 11248 nextafterl [SUSv3] nexttoward [SUSv3] nexttowardf [SUSv3] 11249 nexttowardl [SUSv3] 11250 pow [SUSv3] pow10 [ISOC99] pow10f [ISOC99] pow10l [ISOC99] 11251 powf [SUSv3] powl [SUSv3] remainder [SUSv3] remainderf [SUSv3] 11252 remainderl [SUSv3] remquo [SUSv3] remquof [SUSv3] remquol 11253 [SUSv3] 11254 rint [SUSv3] rintf [SUSv3] rintl [SUSv3] round [SUSv3] 11255 roundf [SUSv3] roundl [SUSv3] scalb [SUSv3] scalbf [ISOC99] 11256 scalbl [ISOC99] scalbln [SUSv3] scalblnf [SUSv3] scalblnl 11257 [SUSv3] 11258 scalbn [SUSv3] scalbnf [SUSv3] scalbnl [SUSv3] significand 11259 [ISOC99] 11260 significandf [ISOC99] significandl [ISOC99] sin [SUSv3] sincos 11261 [ISOC99] 11262 sincosf [ISOC99] sincosl [ISOC99] sinf [SUSv3] sinh [SUSv3] 11263 sinhf [SUSv3] sinhl [SUSv3] sinl [SUSv3] sqrt [SUSv3] 11264 sqrtf [SUSv3] sqrtl [SUSv3] tan [SUSv3] tanf [SUSv3] 11265 tanh [SUSv3] tanhf [SUSv3] tanhl [SUSv3] tanl [SUSv3] 11266 tgamma [SUSv3] tgammaf [SUSv3] tgammal [SUSv3] trunc [SUSv3] 11267 truncf [SUSv3] truncl [SUSv3] y0 [SUSv3] y0f [ISOC99] 11268 y0l [ISOC99] y1 [SUSv3] y1f [ISOC99] y1l [ISOC99] 11269 yn [SUSv3] ynf [ISOC99] ynl [ISOC99] 11270 11271 An LSB conforming implementation shall provide the generic 11272 data interfaces for Math specified in Table 9-26, with the 11273 full mandatory functionality as described in the referenced 11274 underlying specification. 11275 11276 Table 9-26. libm - Math Data Interfaces 11277 signgam [SUSv3] 11278 _________________________________________________________ 11279 11280 9.7. Data Definitions for libm 11281 11282 This section defines global identifiers and their values that 11283 are associated with interfaces contained in libm. These 11284 definitions are organized into groups that correspond to 11285 system headers. This convention is used as a convenience for 11286 the reader, and does not imply the existence of these headers, 11287 or their content. Where an interface is defined as requiring a 11288 particular system header file all of the data definitions for 11289 that system header file presented here shall be in effect. 11290 11291 This section gives data definitions to promote binary 11292 application portability, not to repeat source interface 11293 definitions available elsewhere. System providers and 11294 application developers should use this ABI to supplement - not 11295 to replace - source interface definition specifications. 11296 11297 This specification uses the ISO C (1999) C Language as the 11298 reference programming language, and data definitions are 11299 specified in ISO C format. The C language is used here as a 11300 convenient notation. Using a C language description of these 11301 data objects does not preclude their use by other programming 11302 languages. 11303 _________________________________________________________ 11304 11305 9.7.1. complex.h 11306 11307 #define complex _Complex 11308 11309 extern double cabs(double complex); 11310 extern float cabsf(float complex); 11311 extern long double cabsl(long double complex); 11312 extern double complex cacos(double complex); 11313 extern float complex cacosf(float complex); 11314 extern double complex cacosh(double complex); 11315 extern float complex cacoshf(float complex); 11316 extern long double complex cacoshl(long double complex); 11317 extern long double complex cacosl(long double complex); 11318 extern double carg(double complex); 11319 extern float cargf(float complex); 11320 extern long double cargl(long double complex); 11321 extern double complex casin(double complex); 11322 extern float complex casinf(float complex); 11323 extern double complex casinh(double complex); 11324 extern float complex casinhf(float complex); 11325 extern long double complex casinhl(long double complex); 11326 extern long double complex casinl(long double complex); 11327 extern double complex catan(double complex); 11328 extern float complex catanf(float complex); 11329 extern double complex catanh(double complex); 11330 extern float complex catanhf(float complex); 11331 extern long double complex catanhl(long double complex); 11332 extern long double complex catanl(long double complex); 11333 extern double complex ccos(double complex); 11334 extern float complex ccosf(float complex); 11335 extern double complex ccosh(double complex); 11336 extern float complex ccoshf(float complex); 11337 extern long double complex ccoshl(long double complex); 11338 extern long double complex ccosl(long double complex); 11339 extern double complex cexp(double complex); 11340 extern float complex cexpf(float complex); 11341 extern long double complex cexpl(long double complex); 11342 extern double cimag(double complex); 11343 extern float cimagf(float complex); 11344 extern long double cimagl(long double complex); 11345 extern double complex clog(double complex); 11346 extern float complex clog10f(float complex); 11347 extern long double complex clog10l(long double complex); 11348 extern float complex clogf(float complex); 11349 extern long double complex clogl(long double complex); 11350 extern double complex conj(double complex); 11351 extern float complex conjf(float complex); 11352 extern long double complex conjl(long double complex); 11353 extern double complex cpow(double complex, double complex); 11354 extern float complex cpowf(float complex, float complex); 11355 extern long double complex cpowl(long double complex, long double complex); 11356 extern double complex cproj(double complex); 11357 extern float complex cprojf(float complex); 11358 extern long double complex cprojl(long double complex); 11359 extern double creal(double complex); 11360 extern float crealf(float complex); 11361 extern long double creall(long double complex); 11362 extern double complex csin(double complex); 11363 extern float complex csinf(float complex); 11364 extern double complex csinh(double complex); 11365 extern float complex csinhf(float complex); 11366 extern long double complex csinhl(long double complex); 11367 extern long double complex csinl(long double complex); 11368 extern double complex csqrt(double complex); 11369 extern float complex csqrtf(float complex); 11370 extern long double complex csqrtl(long double complex); 11371 extern double complex ctan(double complex); 11372 extern float complex ctanf(float complex); 11373 extern double complex ctanh(double complex); 11374 extern float complex ctanhf(float complex); 11375 extern long double complex ctanhl(long double complex); 11376 extern long double complex ctanl(long double complex); 11377 _________________________________________________________ 11378 11379 9.7.2. fenv.h 11380 11381 extern int feclearexcept(int); 11382 extern int fegetenv(fenv_t *); 11383 extern int fegetexceptflag(fexcept_t *, int); 11384 extern int fegetround(void); 11385 extern int feholdexcept(fenv_t *); 11386 extern int feraiseexcept(int); 11387 extern int fesetenv(const fenv_t *); 11388 extern int fesetexceptflag(const fexcept_t *, int); 11389 extern int fesetround(int); 11390 extern int fetestexcept(int); 11391 extern int feupdateenv(const fenv_t *); 11392 _________________________________________________________ 11393 11394 9.7.3. math.h 11395 11396 #define DOMAIN 1 11397 #define SING 2 11398 11399 struct exception { 11400 int type; 11401 char *name; 11402 double arg1; 11403 double arg2; 11404 double retval; 11405 }; 11406 11407 #define FP_NAN 0 11408 #define FP_INFINITE 1 11409 #define FP_ZERO 2 11410 #define FP_SUBNORMAL 3 11411 #define FP_NORMAL 4 11412 11413 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 11414 #define isfinite(x) \ 11415 (sizeof (x) == sizeof (float) ? __finitef (x) : sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) 11416 #define isinf(x) \ 11417 (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 11418 #define isnan(x) \ 11419 (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 11420 11421 #define HUGE_VAL 0x1.0p2047 11422 #define HUGE_VALF 0x1.0p255f 11423 #define HUGE_VALL 0x1.0p32767L 11424 11425 #define NAN ((float)0x7fc00000UL) 11426 #define M_1_PI 0.31830988618379067154 11427 #define M_LOG10E 0.43429448190325182765 11428 #define M_2_PI 0.63661977236758134308 11429 #define M_LN2 0.69314718055994530942 11430 #define M_SQRT1_2 0.70710678118654752440 11431 #define M_PI_4 0.78539816339744830962 11432 #define M_2_SQRTPI 1.12837916709551257390 11433 #define M_SQRT2 1.41421356237309504880 11434 #define M_LOG2E 1.4426950408889634074 11435 #define M_PI_2 1.57079632679489661923 11436 #define M_LN10 2.30258509299404568402 11437 #define M_E 2.7182818284590452354 11438 #define M_PI 3.14159265358979323846 11439 #define INFINITY HUGE_VALF 11440 11441 #define MATH_ERRNO 1 11442 #define MATH_ERREXCEPT 2 11443 11444 #define isunordered(u, v) \ 11445 (__extension__({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) 11446 #define islessgreater(x, y) \ 11447 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && (__x < __y || __y < __x); })) 11448 #define isless(x,y) \ 11449 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x < __y; })) 11450 #define islessequal(x, y) \ 11451 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x <= __y; })) 11452 #define isgreater(x,y) \ 11453 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x > __y; })) 11454 #define isgreaterequal(x,y) \ 11455 (__extension__({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);!isunordered (__x, __y) && __x >= __y; })) 11456 11457 extern int __finite(double); 11458 extern int __finitef(float); 11459 extern int __finitel(long double); 11460 extern int __isinf(double); 11461 extern int __isinff(float); 11462 extern int __isinfl(long double); 11463 extern int __isnan(double); 11464 extern int __isnanf(float); 11465 extern int __isnanl(long double); 11466 extern int __signbit(double); 11467 extern int __signbitf(float); 11468 extern int __fpclassify(double); 11469 extern int __fpclassifyf(float); 11470 extern int __fpclassifyl(long double); 11471 extern int signgam(void); 11472 extern double copysign(double, double); 11473 extern int finite(double); 11474 extern double frexp(double, int *); 11475 extern double ldexp(double, int); 11476 extern double modf(double, double *); 11477 extern double acos(double); 11478 extern double acosh(double); 11479 extern double asinh(double); 11480 extern double atanh(double); 11481 extern double asin(double); 11482 extern double atan(double); 11483 extern double atan2(double, double); 11484 extern double cbrt(double); 11485 extern double ceil(double); 11486 extern double cos(double); 11487 extern double cosh(double); 11488 extern double erf(double); 11489 extern double erfc(double); 11490 extern double exp(double); 11491 extern double expm1(double); 11492 extern double fabs(double); 11493 extern double floor(double); 11494 extern double fmod(double, double); 11495 extern double gamma(double); 11496 extern double hypot(double, double); 11497 extern int ilogb(double); 11498 extern double j0(double); 11499 extern double j1(double); 11500 extern double jn(int, double); 11501 extern double lgamma(double); 11502 extern double log(double); 11503 extern double log10(double); 11504 extern double log1p(double); 11505 extern double logb(double); 11506 extern double nextafter(double, double); 11507 extern double pow(double, double); 11508 extern double remainder(double, double); 11509 extern double rint(double); 11510 extern double scalb(double, double); 11511 extern double sin(double); 11512 extern double sinh(double); 11513 extern double sqrt(double); 11514 extern double tan(double); 11515 extern double tanh(double); 11516 extern double y0(double); 11517 extern double y1(double); 11518 extern double yn(int, double); 11519 extern float copysignf(float, float); 11520 extern long double copysignl(long double, long double); 11521 extern int finitef(float); 11522 extern int finitel(long double); 11523 extern float frexpf(float, int *); 11524 extern long double frexpl(long double, int *); 11525 extern float ldexpf(float, int); 11526 extern long double ldexpl(long double, int); 11527 extern float modff(float, float *); 11528 extern long double modfl(long double, long double *); 11529 extern double scalbln(double, long int); 11530 extern float scalblnf(float, long int); 11531 extern long double scalblnl(long double, long int); 11532 extern double scalbn(double, int); 11533 extern float scalbnf(float, int); 11534 extern long double scalbnl(long double, int); 11535 extern float acosf(float); 11536 extern float acoshf(float); 11537 extern long double acoshl(long double); 11538 extern long double acosl(long double); 11539 extern float asinf(float); 11540 extern float asinhf(float); 11541 extern long double asinhl(long double); 11542 extern long double asinl(long double); 11543 extern float atan2f(float, float); 11544 extern long double atan2l(long double, long double); 11545 extern float atanf(float); 11546 extern float atanhf(float); 11547 extern long double atanhl(long double); 11548 extern long double atanl(long double); 11549 extern float cbrtf(float); 11550 extern long double cbrtl(long double); 11551 extern float ceilf(float); 11552 extern long double ceill(long double); 11553 extern float cosf(float); 11554 extern float coshf(float); 11555 extern long double coshl(long double); 11556 extern long double cosl(long double); 11557 extern float dremf(float, float); 11558 extern long double dreml(long double, long double); 11559 extern float erfcf(float); 11560 extern long double erfcl(long double); 11561 extern float erff(float); 11562 extern long double erfl(long double); 11563 extern double exp2(double); 11564 extern float exp2f(float); 11565 extern long double exp2l(long double); 11566 extern float expf(float); 11567 extern long double expl(long double); 11568 extern float expm1f(float); 11569 extern long double expm1l(long double); 11570 extern float fabsf(float); 11571 extern long double fabsl(long double); 11572 extern double fdim(double, double); 11573 extern float fdimf(float, float); 11574 extern long double fdiml(long double, long double); 11575 extern float floorf(float); 11576 extern long double floorl(long double); 11577 extern double fma(double, double, double); 11578 extern float fmaf(float, float, float); 11579 extern long double fmal(long double, long double, long double); 11580 extern double fmax(double, double); 11581 extern float fmaxf(float, float); 11582 extern long double fmaxl(long double, long double); 11583 extern double fmin(double, double); 11584 extern float fminf(float, float); 11585 extern long double fminl(long double, long double); 11586 extern float fmodf(float, float); 11587 extern long double fmodl(long double, long double); 11588 extern float gammaf(float); 11589 extern long double gammal(long double); 11590 extern float hypotf(float, float); 11591 extern long double hypotl(long double, long double); 11592 extern int ilogbf(float); 11593 extern int ilogbl(long double); 11594 extern float j0f(float); 11595 extern long double j0l(long double); 11596 extern float j1f(float); 11597 extern long double j1l(long double); 11598 extern float jnf(int, float); 11599 extern long double jnl(int, long double); 11600 extern double lgamma_r(double, int *); 11601 extern float lgammaf(float); 11602 extern float lgammaf_r(float, int *); 11603 extern long double lgammal(long double); 11604 extern long double lgammal_r(long double, int *); 11605 extern long long int llrint(double); 11606 extern long long int llrintf(float); 11607 extern long long int llrintl(long double); 11608 extern long long int llround(double); 11609 extern long long int llroundf(float); 11610 extern long long int llroundl(long double); 11611 extern float log10f(float); 11612 extern long double log10l(long double); 11613 extern float log1pf(float); 11614 extern long double log1pl(long double); 11615 extern double log2(double); 11616 extern float log2f(float); 11617 extern long double log2l(long double); 11618 extern float logbf(float); 11619 extern long double logbl(long double); 11620 extern float logf(float); 11621 extern long double logl(long double); 11622 extern long int lrint(double); 11623 extern long int lrintf(float); 11624 extern long int lrintl(long double); 11625 extern long int lround(double); 11626 extern long int lroundf(float); 11627 extern long int lroundl(long double); 11628 extern int matherr(struct exception *); 11629 extern double nan(const char *); 11630 extern float nanf(const char *); 11631 extern long double nanl(const char *); 11632 extern double nearbyint(double); 11633 extern float nearbyintf(float); 11634 extern long double nearbyintl(long double); 11635 extern float nextafterf(float, float); 11636 extern long double nextafterl(long double, long double); 11637 extern double nexttoward(double, long double); 11638 extern float nexttowardf(float, long double); 11639 extern long double nexttowardl(long double, long double); 11640 extern double pow10(double); 11641 extern float pow10f(float); 11642 extern long double pow10l(long double); 11643 extern float powf(float, float); 11644 extern long double powl(long double, long double); 11645 extern float remainderf(float, float); 11646 extern long double remainderl(long double, long double); 11647 extern double remquo(double, double, int *); 11648 extern float remquof(float, float, int *); 11649 extern long double remquol(long double, long double, int *); 11650 extern float rintf(float); 11651 extern long double rintl(long double); 11652 extern double round(double); 11653 extern float roundf(float); 11654 extern long double roundl(long double); 11655 extern float scalbf(float, float); 11656 extern long double scalbl(long double, long double); 11657 extern double significand(double); 11658 extern float significandf(float); 11659 extern long double significandl(long double); 11660 extern void sincos(double, double *, double *); 11661 extern void sincosf(float, float *, float *); 11662 extern void sincosl(long double, long double *, long double *); 11663 extern float sinf(float); 11664 extern float sinhf(float); 11665 extern long double sinhl(long double); 11666 extern long double sinl(long double); 11667 extern float sqrtf(float); 11668 extern long double sqrtl(long double); 11669 extern float tanf(float); 11670 extern float tanhf(float); 11671 extern long double tanhl(long double); 11672 extern long double tanl(long double); 11673 extern double tgamma(double); 11674 extern float tgammaf(float); 11675 extern long double tgammal(long double); 11676 extern double trunc(double); 11677 extern float truncf(float); 11678 extern long double truncl(long double); 11679 extern float y0f(float); 11680 extern long double y0l(long double); 11681 extern float y1f(float); 11682 extern long double y1l(long double); 11683 extern float ynf(int, float); 11684 extern long double ynl(int, long double); 11685 extern int __fpclassifyl(long double); 11686 extern int __fpclassifyl(long double); 11687 extern int __signbitl(long double); 11688 extern int __signbitl(long double); 11689 extern int __signbitl(long double); 11690 extern long double exp2l(long double); 11691 extern long double exp2l(long double); 11692 _________________________________________________________ 11693 11694 9.8. Interface Definitions for libm 11695 11696 Table of Contents 11697 __fpclassify -- Classify real floating type 11698 __fpclassifyf -- Classify real floating type 11699 11700 The interfaces defined on the following pages are included in 11701 libm and are defined by this specification. Unless otherwise 11702 noted, these interfaces shall be included in the source 11703 standard. 11704 11705 Other interfaces listed in Section 9.6 shall behave as 11706 described in the referenced base document. 11707 11708 __fpclassify 11709 11710 Name 11711 11712 __fpclassify -- Classify real floating type 11713 11714 Synopsis 11715 11716 int __fpclassify(double arg); 11717 11718 Description 11719 11720 __fpclassify() has the same specification as fpclassify() in 11721 ISO POSIX (2003), except that the argument type for 11722 __fpclassify() is known to be double. 11723 11724 __fpclassify() is not in the source standard; it is only in 11725 the binary standard. 11726 11727 __fpclassifyf 11728 11729 Name 11730 11731 __fpclassifyf -- Classify real floating type 11732 11733 Synopsis 11734 11735 int __fpclassifyf(float arg); 11736 11737 Description 11738 11739 __fpclassifyf() has the same specification as fpclassifyf() in 11740 ISO POSIX (2003), except that the argument type for 11741 __fpclassifyf() is known to be float. 11742 11743 __fpclassifyf() is not in the source standard; it is only in 11744 the binary standard. 11745 _________________________________________________________ 11746 11747 9.9. Interfaces for libpthread 11748 11749 Table 9-27 defines the library name and shared object name for 11750 the libpthread library 11751 11752 Table 9-27. libpthread Definition 11753 Library: libpthread 11754 SONAME: libpthread.so.0 11755 11756 The behavior of the interfaces in this library is specified by 11757 the following specifications: 11758 11759 [LFS] Large File Support 11760 [LSB] This Specification 11761 [SUSv3] ISO POSIX (2003) 11762 _________________________________________________________ 11763 11764 9.9.1. Realtime Threads 11765 _________________________________________________________ 11766 11767 9.9.1.1. Interfaces for Realtime Threads 11768 11769 An LSB conforming implementation shall provide the generic 11770 functions for Realtime Threads specified in Table 9-28, with 11771 the full mandatory functionality as described in the 11772 referenced underlying specification. 11773 11774 Table 9-28. libpthread - Realtime Threads Function Interfaces 11775 pthread_attr_getinheritsched [SUSv3] 11776 pthread_attr_getschedpolicy [SUSv3] pthread_attr_getscope 11777 [SUSv3] pthread_attr_setinheritsched [SUSv3] 11778 pthread_attr_setschedpolicy [SUSv3] pthread_attr_setscope 11779 [SUSv3] pthread_getschedparam [SUSv3] pthread_setschedparam 11780 [SUSv3] 11781 pthread_setschedprio(GLIBC_2.3.4) [SUSv3] 11782 _________________________________________________________ 11783 11784 9.9.2. Advanced Realtime Threads 11785 _________________________________________________________ 11786 11787 9.9.2.1. Interfaces for Advanced Realtime Threads 11788 11789 No external functions are defined for libpthread - Advanced 11790 Realtime Threads in this part of the specification. See also 11791 the relevant architecture specific supplement. 11792 _________________________________________________________ 11793 11794 9.9.3. Posix Threads 11795 _________________________________________________________ 11796 11797 9.9.3.1. Interfaces for Posix Threads 11798 11799 An LSB conforming implementation shall provide the generic 11800 functions for Posix Threads specified in Table 9-29, with the 11801 full mandatory functionality as described in the referenced 11802 underlying specification. 11803 11804 Table 9-29. libpthread - Posix Threads Function Interfaces 11805 _pthread_cleanup_pop [LSB] _pthread_cleanup_push [LSB] 11806 pthread_attr_destroy [SUSv3] pthread_attr_getdetachstate 11807 [SUSv3] 11808 pthread_attr_getguardsize [SUSv3] pthread_attr_getschedparam 11809 [SUSv3] pthread_attr_getstack [SUSv3] 11810 pthread_attr_getstackaddr [SUSv3] 11811 pthread_attr_getstacksize [SUSv3] pthread_attr_init [SUSv3] 11812 pthread_attr_setdetachstate [SUSv3] pthread_attr_setguardsize 11813 [SUSv3] 11814 pthread_attr_setschedparam [SUSv3] pthread_attr_setstack 11815 [SUSv3] pthread_attr_setstackaddr [SUSv3] 11816 pthread_attr_setstacksize [SUSv3] 11817 pthread_cancel [SUSv3] pthread_cond_broadcast [SUSv3] 11818 pthread_cond_destroy [SUSv3] pthread_cond_init [SUSv3] 11819 pthread_cond_signal [SUSv3] pthread_cond_timedwait [SUSv3] 11820 pthread_cond_wait [SUSv3] pthread_condattr_destroy [SUSv3] 11821 pthread_condattr_getpshared [SUSv3] pthread_condattr_init 11822 [SUSv3] pthread_condattr_setpshared [SUSv3] pthread_create 11823 [SUSv3] 11824 pthread_detach [SUSv3] pthread_equal [SUSv3] pthread_exit 11825 [SUSv3] pthread_getconcurrency [SUSv3] 11826 pthread_getspecific [SUSv3] pthread_join [SUSv3] 11827 pthread_key_create [SUSv3] pthread_key_delete [SUSv3] 11828 pthread_kill [SUSv3] pthread_mutex_destroy [SUSv3] 11829 pthread_mutex_init [SUSv3] pthread_mutex_lock [SUSv3] 11830 pthread_mutex_trylock [SUSv3] pthread_mutex_unlock [SUSv3] 11831 pthread_mutexattr_destroy [SUSv3] pthread_mutexattr_getpshared 11832 [SUSv3] 11833 pthread_mutexattr_gettype [SUSv3] pthread_mutexattr_init 11834 [SUSv3] pthread_mutexattr_setpshared [SUSv3] 11835 pthread_mutexattr_settype [SUSv3] 11836 pthread_once [SUSv3] pthread_rwlock_destroy [SUSv3] 11837 pthread_rwlock_init [SUSv3] pthread_rwlock_rdlock [SUSv3] 11838 pthread_rwlock_timedrdlock [SUSv3] pthread_rwlock_timedwrlock 11839 [SUSv3] pthread_rwlock_tryrdlock [SUSv3] 11840 pthread_rwlock_trywrlock [SUSv3] 11841 pthread_rwlock_unlock [SUSv3] pthread_rwlock_wrlock [SUSv3] 11842 pthread_rwlockattr_destroy [SUSv3] 11843 pthread_rwlockattr_getpshared [SUSv3] 11844 pthread_rwlockattr_init [SUSv3] pthread_rwlockattr_setpshared 11845 [SUSv3] pthread_self [SUSv3] pthread_setcancelstate [SUSv3] 11846 pthread_setcanceltype [SUSv3] pthread_setconcurrency [SUSv3] 11847 pthread_setspecific [SUSv3] pthread_sigmask [SUSv3] 11848 pthread_testcancel [SUSv3] sem_close [SUSv3] sem_destroy 11849 [SUSv3] sem_getvalue [SUSv3] 11850 sem_init [SUSv3] sem_open [SUSv3] sem_post [SUSv3] 11851 sem_timedwait [SUSv3] 11852 sem_trywait [SUSv3] sem_unlink [SUSv3] sem_wait [SUSv3] 11853 _________________________________________________________ 11854 11855 9.9.4. Thread aware versions of libc interfaces 11856 _________________________________________________________ 11857 11858 9.9.4.1. Interfaces for Thread aware versions of libc interfaces 11859 11860 An LSB conforming implementation shall provide the generic 11861 functions for Thread aware versions of libc interfaces 11862 specified in Table 9-30, with the full mandatory functionality 11863 as described in the referenced underlying specification. 11864 11865 Table 9-30. libpthread - Thread aware versions of libc 11866 interfaces Function Interfaces 11867 lseek64 [LFS] open64 [LFS] pread [SUSv3] pread64 [LFS] 11868 pwrite [SUSv3] pwrite64 [LFS] 11869 _________________________________________________________ 11870 11871 9.10. Data Definitions for libpthread 11872 11873 This section defines global identifiers and their values that 11874 are associated with interfaces contained in libpthread. These 11875 definitions are organized into groups that correspond to 11876 system headers. This convention is used as a convenience for 11877 the reader, and does not imply the existence of these headers, 11878 or their content. Where an interface is defined as requiring a 11879 particular system header file all of the data definitions for 11880 that system header file presented here shall be in effect. 11881 11882 This section gives data definitions to promote binary 11883 application portability, not to repeat source interface 11884 definitions available elsewhere. System providers and 11885 application developers should use this ABI to supplement - not 11886 to replace - source interface definition specifications. 11887 11888 This specification uses the ISO C (1999) C Language as the 11889 reference programming language, and data definitions are 11890 specified in ISO C format. The C language is used here as a 11891 convenient notation. Using a C language description of these 11892 data objects does not preclude their use by other programming 11893 languages. 11894 _________________________________________________________ 11895 11896 9.10.1. pthread.h 11897 11898 #define PTHREAD_SCOPE_SYSTEM 0 11899 #define PTHREAD_MUTEX_DEFAULT 1 11900 #define PTHREAD_MUTEX_NORMAL 1 11901 #define PTHREAD_SCOPE_PROCESS 1 11902 #define PTHREAD_MUTEX_RECURSIVE 2 11903 #define PTHREAD_RWLOCK_DEFAULT_NP 2 11904 #define PTHREAD_MUTEX_ERRORCHECK 3 11905 #define PTHREAD_MUTEX_INITIALIZER \ 11906 {0,0,0,PTHREAD_MUTEX_NORMAL,__LOCK_INITIALIZER} 11907 #define PTHREAD_RWLOCK_INITIALIZER \ 11908 { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP,\ 11909 PTHREAD_PROCESS_PRIVATE } 11910 #define pthread_cleanup_push(routine,arg) \ 11911 {struct _pthread_cleanup_buffer _buffer;\ 11912 _pthread_cleanup_push(&_buffer,(routine),(arg)); 11913 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(&_buffer,(execute));} 11914 #define __LOCK_INITIALIZER { 0, 0 } 11915 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 11916 11917 struct _pthread_cleanup_buffer { 11918 void (*__routine) (void *); 11919 void *__arg; 11920 int __canceltype; 11921 struct _pthread_cleanup_buffer *__prev; 11922 }; 11923 typedef unsigned int pthread_key_t; 11924 typedef int pthread_once_t; 11925 typedef long long int __pthread_cond_align_t; 11926 11927 typedef unsigned long int pthread_t; 11928 struct _pthread_fastlock { 11929 long int __status; 11930 int __spinlock; 11931 }; 11932 11933 typedef struct _pthread_descr_struct *_pthread_descr; 11934 11935 typedef struct { 11936 int __m_reserved; 11937 int __m_count; 11938 _pthread_descr __m_owner; 11939 int __m_kind; 11940 struct _pthread_fastlock __m_lock; 11941 } pthread_mutex_t; 11942 typedef struct { 11943 int __mutexkind; 11944 } pthread_mutexattr_t; 11945 11946 typedef struct { 11947 int __detachstate; 11948 int __schedpolicy; 11949 struct sched_param __schedparam; 11950 int __inheritsched; 11951 int __scope; 11952 size_t __guardsize; 11953 int __stackaddr_set; 11954 void *__stackaddr; 11955 unsigned long int __stacksize; 11956 } pthread_attr_t; 11957 11958 typedef struct { 11959 struct _pthread_fastlock __c_lock; 11960 _pthread_descr __c_waiting; 11961 char __padding[48 - sizeof(struct _pthread_fastlock) - 11962 sizeof(_pthread_descr) - 11963 sizeof(__pthread_cond_align_t)]; 11964 __pthread_cond_align_t __align; 11965 } pthread_cond_t; 11966 typedef struct { 11967 int __dummy; 11968 } pthread_condattr_t; 11969 11970 typedef struct _pthread_rwlock_t { 11971 struct _pthread_fastlock __rw_lock; 11972 int __rw_readers; 11973 _pthread_descr __rw_writer; 11974 _pthread_descr __rw_read_waiting; 11975 _pthread_descr __rw_write_waiting; 11976 int __rw_kind; 11977 int __rw_pshared; 11978 } pthread_rwlock_t; 11979 typedef struct { 11980 int __lockkind; 11981 int __pshared; 11982 } pthread_rwlockattr_t; 11983 11984 #define PTHREAD_CREATE_JOINABLE 0 11985 #define PTHREAD_INHERIT_SCHED 0 11986 #define PTHREAD_ONCE_INIT 0 11987 #define PTHREAD_PROCESS_PRIVATE 0 11988 #define PTHREAD_CREATE_DETACHED 1 11989 #define PTHREAD_EXPLICIT_SCHED 1 11990 #define PTHREAD_PROCESS_SHARED 1 11991 11992 #define PTHREAD_CANCELED ((void*)-1) 11993 #define PTHREAD_CANCEL_DEFERRED 0 11994 #define PTHREAD_CANCEL_ENABLE 0 11995 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 11996 #define PTHREAD_CANCEL_DISABLE 1 11997 11998 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 11999 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 12000 void (*__routine) (void *) 12001 , void *); 12002 extern int pthread_attr_destroy(pthread_attr_t *); 12003 extern int pthread_attr_getdetachstate(const typedef struct { 12004 int __detachstate; 12005 int __schedpolicy; 12006 struct sched_param __schedparam; 12007 int __inheritsched; 12008 int __scope; 12009 size_t __guardsize; 12010 int __stackaddr_set; 12011 void *__stackaddr; 12012 unsigned long int __stacksize;} 12013 pthread_attr_t *, int *); 12014 extern int pthread_attr_getinheritsched(const typedef struct { 12015 int __detachstate; 12016 int __schedpolicy; 12017 struct sched_param __schedparam; 12018 int __inheritsched; 12019 int __scope; 12020 size_t __guardsize; 12021 int __stackaddr_set; 12022 void *__stackaddr; 12023 unsigned long int __stacksize;} 12024 pthread_attr_t *, int *); 12025 extern int pthread_attr_getschedparam(const typedef struct { 12026 int __detachstate; 12027 int __schedpolicy; 12028 struct sched_param __schedparam; 12029 int __inheritsched; 12030 int __scope; 12031 size_t __guardsize; 12032 int __stackaddr_set; 12033 void *__stackaddr; 12034 unsigned long int __stacksize;} 12035 pthread_attr_t *, struct sched_param { 12036 int sched_priority;} 12037 12038 *); 12039 extern int pthread_attr_getschedpolicy(const typedef struct { 12040 int __detachstate; 12041 int __schedpolicy; 12042 struct sched_param __schedparam; 12043 int __inheritsched; 12044 int __scope; 12045 size_t __guardsize; 12046 int __stackaddr_set; 12047 void *__stackaddr; 12048 unsigned long int __stacksize;} 12049 pthread_attr_t *, int *); 12050 extern int pthread_attr_getscope(const typedef struct { 12051 int __detachstate; 12052 int __schedpolicy; 12053 struct sched_param __schedparam; 12054 int __inheritsched; 12055 int __scope; 12056 size_t __guardsize; 12057 int __stackaddr_set; 12058 void *__stackaddr; 12059 unsigned long int __stacksize;} 12060 pthread_attr_t *, int *); 12061 extern int pthread_attr_init(pthread_attr_t *); 12062 extern int pthread_attr_setdetachstate(pthread_attr_t *, int); 12063 extern int pthread_attr_setinheritsched(pthread_attr_t *, int); 12064 extern int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param { 12065 int sched_priority;} 12066 12067 *); 12068 extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); 12069 extern int pthread_attr_setscope(pthread_attr_t *, int); 12070 extern int pthread_cancel(typedef unsigned long int pthread_t); 12071 extern int pthread_cond_broadcast(pthread_cond_t *); 12072 extern int pthread_cond_destroy(pthread_cond_t *); 12073 extern int pthread_cond_init(pthread_cond_t *, const typedef struct { 12074 int __dummy;} 12075 12076 pthread_condattr_t *); 12077 extern int pthread_cond_signal(pthread_cond_t *); 12078 extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *,const struct timespec { 12079 time_t tv_sec; long int tv_nsec;} 12080 12081 *); 12082 extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); 12083 extern int pthread_condattr_destroy(pthread_condattr_t *); 12084 extern int pthread_condattr_init(pthread_condattr_t *); 12085 extern int pthread_create(pthread_t *, const typedef struct { 12086 int __detachstate; 12087 int __schedpolicy; 12088 struct sched_param __schedparam; 12089 int __inheritsched; 12090 int __scope; 12091 size_t __guardsize; 12092 int __stackaddr_set; 12093 void *__stackaddr; 12094 unsigned long int __stacksize;} 12095 pthread_attr_t *, 12096 void *(*__start_routine) (void *p1) 12097 , void *); 12098 extern int pthread_detach(typedef unsigned long int pthread_t); 12099 extern int pthread_equal(typedef unsigned long int pthread_t, 12100 typedef unsigned long int pthread_t); 12101 extern void pthread_exit(void *); 12102 extern int pthread_getschedparam(typedef unsigned long int pthread_t, 12103 int *, struct sched_param { 12104 int sched_priority;} 12105 12106 *); 12107 extern void *pthread_getspecific(typedef unsigned int pthread_key_t); 12108 extern int pthread_join(typedef unsigned long int pthread_t, void **); 12109 extern int pthread_key_create(pthread_key_t *, void (*destr_func) (void *) 12110 ); 12111 extern int pthread_key_delete(typedef unsigned int pthread_key_t); 12112 extern int pthread_mutex_destroy(pthread_mutex_t *); 12113 extern int pthread_mutex_init(pthread_mutex_t *, const typedef struct { 12114 int __mutexkind;} 12115 12116 pthread_mutexattr_t *); 12117 extern int pthread_mutex_lock(pthread_mutex_t *); 12118 extern int pthread_mutex_trylock(pthread_mutex_t *); 12119 extern int pthread_mutex_unlock(pthread_mutex_t *); 12120 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); 12121 extern int pthread_mutexattr_init(pthread_mutexattr_t *); 12122 extern int pthread_once(pthread_once_t *, void (*init_routine) (void) 12123 ); 12124 extern int pthread_rwlock_destroy(pthread_rwlock_t *); 12125 extern int pthread_rwlock_init(pthread_rwlock_t *, pthread_rwlockattr_t *); 12126 extern int pthread_rwlock_rdlock(pthread_rwlock_t *); 12127 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); 12128 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); 12129 extern int pthread_rwlock_unlock(pthread_rwlock_t *); 12130 extern int pthread_rwlock_wrlock(pthread_rwlock_t *); 12131 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); 12132 extern int pthread_rwlockattr_getpshared(const typedef struct { 12133 int __lockkind; int __pshared;} 12134 pthread_rwlockattr_t *, int *); 12135 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); 12136 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); 12137 extern typedef unsigned long int pthread_t pthread_self(void); 12138 extern int pthread_setcancelstate(int, int *); 12139 extern int pthread_setcanceltype(int, int *); 12140 extern int pthread_setschedparam(typedef unsigned long int pthread_t, int, const struct sched_param { 12141 int sched_priority;} 12142 12143 *); 12144 extern int pthread_setspecific(typedef unsigned int pthread_key_t, 12145 const void *); 12146 extern void pthread_testcancel(void); 12147 extern int pthread_attr_getguardsize(const typedef struct { 12148 int __detachstate; 12149 int __schedpolicy; 12150 struct sched_param __schedparam; 12151 int __inheritsched; 12152 int __scope; 12153 size_t __guardsize; 12154 int __stackaddr_set; 12155 void *__stackaddr; 12156 unsigned long int __stacksize;} 12157 pthread_attr_t *, size_t *); 12158 extern int pthread_attr_setguardsize(pthread_attr_t *, 12159 typedef unsigned long int size_t); 12160 extern int pthread_attr_setstackaddr(pthread_attr_t *, void *); 12161 extern int pthread_attr_getstackaddr(const typedef struct { 12162 int __detachstate; 12163 int __schedpolicy; 12164 struct sched_param __schedparam; 12165 int __inheritsched; 12166 int __scope; 12167 size_t __guardsize; 12168 int __stackaddr_set; 12169 void *__stackaddr; 12170 unsigned long int __stacksize;} 12171 pthread_attr_t *, void **); 12172 extern int pthread_attr_setstacksize(pthread_attr_t *, 12173 typedef unsigned long int size_t); 12174 extern int pthread_attr_getstacksize(const typedef struct { 12175 int __detachstate; 12176 int __schedpolicy; 12177 struct sched_param __schedparam; 12178 int __inheritsched; 12179 int __scope; 12180 size_t __guardsize; 12181 int __stackaddr_set; 12182 void *__stackaddr; 12183 unsigned long int __stacksize;} 12184 pthread_attr_t *, size_t *); 12185 extern int pthread_mutexattr_gettype(const typedef struct { 12186 int __mutexkind;} 12187 pthread_mutexattr_t *, int *); 12188 extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); 12189 extern int pthread_getconcurrency(void); 12190 extern int pthread_setconcurrency(int); 12191 extern int pthread_attr_getstack(const typedef struct { 12192 int __detachstate; 12193 int __schedpolicy; 12194 struct sched_param __schedparam; 12195 int __inheritsched; 12196 int __scope; 12197 size_t __guardsize; 12198 int __stackaddr_set; 12199 void *__stackaddr; 12200 unsigned long int __stacksize;} 12201 pthread_attr_t *, void **, size_t *); 12202 extern int pthread_attr_setstack(pthread_attr_t *, void *, 12203 typedef unsigned long int size_t); 12204 extern int pthread_condattr_getpshared(const typedef struct { 12205 int __dummy;} 12206 pthread_condattr_t *, int *); 12207 extern int pthread_condattr_setpshared(pthread_condattr_t *, int); 12208 extern int pthread_mutexattr_getpshared(const typedef struct { 12209 int __mutexkind;} 12210 pthread_mutexattr_t *, int *); 12211 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); 12212 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *, const structtimespec { 12213 time_t tv_sec; long int tv_nsec;} 12214 12215 *); 12216 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *, const structtimespec { 12217 time_t tv_sec; long int tv_nsec;} 12218 12219 *); 12220 extern int __register_atfork(void (*prepare) (void) 12221 , void (*parent) (void) 12222 , void (*child) (void) 12223 , void *); 12224 extern int pthread_setschedprio(typedef unsigned long int pthread_t, int); 12225 _________________________________________________________ 12226 12227 9.10.2. semaphore.h 12228 12229 typedef struct { 12230 struct _pthread_fastlock __sem_lock; 12231 int __sem_value; 12232 _pthread_descr __sem_waiting; 12233 } sem_t; 12234 12235 #define SEM_FAILED ((sem_t*)0) 12236 12237 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 12238 12239 extern int sem_close(sem_t *); 12240 extern int sem_destroy(sem_t *); 12241 extern int sem_getvalue(sem_t *, int *); 12242 extern int sem_init(sem_t *, int, unsigned int); 12243 extern sem_t *sem_open(const char *, int, ...); 12244 extern int sem_post(sem_t *); 12245 extern int sem_trywait(sem_t *); 12246 extern int sem_unlink(const char *); 12247 extern int sem_wait(sem_t *); 12248 extern int sem_timedwait(sem_t *, const struct timespec *); 12249 _________________________________________________________ 12250 12251 9.11. Interface Definitions for libpthread 12252 12253 Table of Contents 12254 _pthread_cleanup_pop -- establish cancellation handlers 12255 _pthread_cleanup_push -- establish cancellation handlers 12256 12257 The interfaces defined on the following pages are included in 12258 libpthread and are defined by this specification. Unless 12259 otherwise noted, these interfaces shall be included in the 12260 source standard. 12261 12262 Other interfaces listed in Section 9.9 shall behave as 12263 described in the referenced base document. 12264 12265 _pthread_cleanup_pop 12266 12267 Name 12268 12269 _pthread_cleanup_pop -- establish cancellation handlers 12270 12271 Synopsis 12272 12273 #include 12274 12275 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 12276 int); 12277 12278 Description 12279 12280 The _pthread_cleanup_pop() function provides an implementation 12281 of the pthread_cleanup_pop() macro described in ISO POSIX 12282 (2003). 12283 12284 The _pthread_cleanup_pop() function is not in the source 12285 standard; it is only in the binary standard. 12286 12287 _pthread_cleanup_push 12288 12289 Name 12290 12291 _pthread_cleanup_push -- establish cancellation handlers 12292 12293 Synopsis 12294 12295 #include 12296 12297 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 12298 void (*) (void *), void *); 12299 12300 Description 12301 12302 The _pthread_cleanup_push() function provides an 12303 implementation of the pthread_cleanup_push() macro described 12304 in ISO POSIX (2003). 12305 12306 The _pthread_cleanup_push() function is not in the source 12307 standard; it is only in the binary standard. 12308 _________________________________________________________ 12309 12310 9.12. Interfaces for libgcc_s 12311 12312 Table 9-31 defines the library name and shared object name for 12313 the libgcc_s library 12314 12315 Table 9-31. libgcc_s Definition 12316 Library: libgcc_s 12317 SONAME: libgcc_s.so.1 12318 _________________________________________________________ 12319 12320 9.12.1. Unwind Library 12321 _________________________________________________________ 12322 12323 9.12.1.1. Interfaces for Unwind Library 12324 12325 No external functions are defined for libgcc_s - Unwind 12326 Library in this part of the specification. See also the 12327 relevant architecture specific supplement. 12328 _________________________________________________________ 12329 12330 9.13. Data Definitions for libgcc_s 12331 12332 This section defines global identifiers and their values that 12333 are associated with interfaces contained in libgcc_s. These 12334 definitions are organized into groups that correspond to 12335 system headers. This convention is used as a convenience for 12336 the reader, and does not imply the existence of these headers, 12337 or their content. Where an interface is defined as requiring a 12338 particular system header file all of the data definitions for 12339 that system header file presented here shall be in effect. 12340 12341 This section gives data definitions to promote binary 12342 application portability, not to repeat source interface 12343 definitions available elsewhere. System providers and 12344 application developers should use this ABI to supplement - not 12345 to replace - source interface definition specifications. 12346 12347 This specification uses the ISO C (1999) C Language as the 12348 reference programming language, and data definitions are 12349 specified in ISO C format. The C language is used here as a 12350 convenient notation. Using a C language description of these 12351 data objects does not preclude their use by other programming 12352 languages. 12353 _________________________________________________________ 12354 12355 9.13.1. unwind.h 12356 12357 struct _Unwind_Context; 12358 12359 typedef void *_Unwind_Ptr; 12360 typedef unsigned int _Unwind_Word; 12361 12362 typedef enum { 12363 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 12364 1, _URC_FATAL_PHASE2_ERROR = 2, _URC_FATAL_PHASE1_ERROR = 12365 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 12366 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 12367 7, _URC_CONTINUE_UNWIND = 8 12368 } _Unwind_Reason_Code; 12369 12370 struct _Unwind_Exception { 12371 u_int64_t exception_class; 12372 _Unwind_Exception_Cleanup_Fn exception_cleanup; 12373 u_int64_t private_1; 12374 u_int64_t private_2; 12375 }; 12376 12377 #define _UA_SEARCH_PHASE 1 12378 #define _UA_END_OF_STACK 16 12379 #define _UA_CLEANUP_PHASE 2 12380 #define _UA_HANDLER_FRAME 4 12381 #define _UA_FORCE_UNWIND 8 12382 12383 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12384 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12385 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12386 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12387 _Unwind_Stop_Fn, void *); 12388 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12389 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12390 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 12391 *); 12392 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12393 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12394 *); 12395 extern void _Unwind_Resume(struct _Unwind_Exception *); 12396 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12397 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12398 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12399 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12400 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12401 _Unwind_Stop_Fn, void *); 12402 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12403 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12404 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12405 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 12406 *); 12407 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12408 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12409 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12410 *); 12411 extern void _Unwind_Resume(struct _Unwind_Exception *); 12412 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12413 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12414 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12415 _Unwind_Stop_Fn, void *); 12416 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12417 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12418 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12419 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 12420 *); 12421 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12422 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12423 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12424 *); 12425 extern void _Unwind_Resume(struct _Unwind_Exception *); 12426 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12427 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12428 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12429 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12430 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12431 _Unwind_Stop_Fn, void *); 12432 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12433 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12434 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12435 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 12436 *); 12437 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12438 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12439 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12440 *); 12441 extern void _Unwind_Resume(struct _Unwind_Exception *); 12442 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12443 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12444 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12445 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12446 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12447 _Unwind_Stop_Fn, void *); 12448 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12449 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12450 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12451 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(struct _Unwind_Context 12452 *); 12453 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12454 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12455 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12456 *); 12457 extern void _Unwind_Resume(struct _Unwind_Exception *); 12458 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12459 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12460 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12461 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12462 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12463 _Unwind_Stop_Fn, void *); 12464 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12465 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12466 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12467 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); 12468 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12469 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12470 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12471 *); 12472 extern void _Unwind_Resume(struct _Unwind_Exception *); 12473 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12474 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12475 extern void _Unwind_DeleteException(struct _Unwind_Exception *); 12476 extern fde *_Unwind_Find_FDE(void *, struct dwarf_eh_base *); 12477 extern _Unwind_Ptr _Unwind_ForcedUnwind(struct _Unwind_Exception *, 12478 _Unwind_Stop_Fn, void *); 12479 extern _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); 12480 extern _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); 12481 extern _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); 12482 extern _Unwind_Ptr _Unwind_GetLanguageSpecificData(void); 12483 extern _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); 12484 extern _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); 12485 extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception 12486 *); 12487 extern void _Unwind_Resume(struct _Unwind_Exception *); 12488 extern void _Unwind_SetGR(struct _Unwind_Context *, int, u_int64_t); 12489 extern void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); 12490 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12491 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12492 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12493 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12494 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12495 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12496 extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); 12497 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12498 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12499 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12500 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12501 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12502 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12503 extern _Unwind_Reason_Code _Unwind_GetCFA(struct _Unwind_Context *); 12504 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12505 _Unwind_Exception*); 12506 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12507 _Unwind_Exception*); 12508 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12509 _Unwind_Exception*); 12510 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12511 _Unwind_Exception*); 12512 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12513 _Unwind_Exception*); 12514 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12515 _Unwind_Exception*); 12516 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct 12517 _Unwind_Exception*); 12518 extern void *_Unwind_FindEnclosingFunction(void *); 12519 extern void *_Unwind_FindEnclosingFunction(void *); 12520 extern void *_Unwind_FindEnclosingFunction(void *); 12521 extern void *_Unwind_FindEnclosingFunction(void *); 12522 extern void *_Unwind_FindEnclosingFunction(void *); 12523 extern void *_Unwind_FindEnclosingFunction(void *); 12524 extern void *_Unwind_FindEnclosingFunction(void *); 12525 extern _Unwind_Word _Unwind_GetBSP(struct _Unwind_Context *); 12526 _________________________________________________________ 12527 12528 9.14. Interfaces for libdl 12529 12530 Table 9-32 defines the library name and shared object name for 12531 the libdl library 12532 12533 Table 9-32. libdl Definition 12534 Library: libdl 12535 SONAME: libdl.so.2 12536 12537 The behavior of the interfaces in this library is specified by 12538 the following specifications: 12539 12540 [LSB] This Specification 12541 [SUSv3] ISO POSIX (2003) 12542 _________________________________________________________ 12543 12544 9.14.1. Dynamic Loader 12545 _________________________________________________________ 12546 12547 9.14.1.1. Interfaces for Dynamic Loader 12548 12549 An LSB conforming implementation shall provide the generic 12550 functions for Dynamic Loader specified in Table 9-33, with the 12551 full mandatory functionality as described in the referenced 12552 underlying specification. 12553 12554 Table 9-33. libdl - Dynamic Loader Function Interfaces 12555 dladdr [LSB] dlclose [SUSv3] dlerror [SUSv3] dlopen [LSB] 12556 dlsym [LSB] 12557 _________________________________________________________ 12558 12559 9.15. Data Definitions for libdl 12560 12561 This section defines global identifiers and their values that 12562 are associated with interfaces contained in libdl. These 12563 definitions are organized into groups that correspond to 12564 system headers. This convention is used as a convenience for 12565 the reader, and does not imply the existence of these headers, 12566 or their content. Where an interface is defined as requiring a 12567 particular system header file all of the data definitions for 12568 that system header file presented here shall be in effect. 12569 12570 This section gives data definitions to promote binary 12571 application portability, not to repeat source interface 12572 definitions available elsewhere. System providers and 12573 application developers should use this ABI to supplement - not 12574 to replace - source interface definition specifications. 12575 12576 This specification uses the ISO C (1999) C Language as the 12577 reference programming language, and data definitions are 12578 specified in ISO C format. The C language is used here as a 12579 convenient notation. Using a C language description of these 12580 data objects does not preclude their use by other programming 12581 languages. 12582 _________________________________________________________ 12583 12584 9.15.1. dlfcn.h 12585 12586 #define RTLD_NEXT ((void *) -1l) 12587 #define RTLD_LOCAL 0 12588 #define RTLD_LAZY 0x00001 12589 #define RTLD_NOW 0x00002 12590 #define RTLD_GLOBAL 0x00100 12591 12592 typedef struct { 12593 char *dli_fname; 12594 void *dli_fbase; 12595 char *dli_sname; 12596 void *dli_saddr; 12597 } Dl_info; 12598 extern int dladdr(const void *, Dl_info *); 12599 extern int dlclose(void *); 12600 extern char *dlerror(void); 12601 extern void *dlopen(char *, int); 12602 extern void *dlsym(void *, char *); 12603 _________________________________________________________ 12604 12605 9.16. Interface Definitions for libdl 12606 12607 Table of Contents 12608 dladdr -- find the shared object containing a given address 12609 dlopen -- open dynamic object 12610 dlsym -- obtain the address of a symbol from a dlopen object 12611 12612 The interfaces defined on the following pages are included in 12613 libdl and are defined by this specification. Unless otherwise 12614 noted, these interfaces shall be included in the source 12615 standard. 12616 12617 Other interfaces listed in Section 9.14 shall behave as 12618 described in the referenced base document. 12619 12620 dladdr 12621 12622 Name 12623 12624 dladdr -- find the shared object containing a given address 12625 12626 Synopsis 12627 12628 #include 12629 12630 typedef struct { 12631 const char *dli_fname; 12632 void *dli_fbase; 12633 const char *dli_sname; 12634 void *dli_saddr; 12635 } Dl_info; 12636 12637 int dladdr(const void * addr, Dl_info * dlip); 12638 12639 Description 12640 12641 The dladdr() function shall query the dynamic linker for 12642 information about the shared object containing the address 12643 addr. The information shall be returned in the user supplied 12644 data structure referenced by dlip. 12645 12646 The structure shall contain at least the following members: 12647 12648 dli_fname 12649 12650 The pathname of the shared object containing the address 12651 dli_fbase 12652 12653 The base address at which the shared object is mapped into the 12654 address space of the calling process. 12655 dli_sname 12656 12657 The name of the nearest runtime symbol with value less than or 12658 equal to addr. Where possible, the symbol name shall be 12659 returned as it would appear in C source code. 12660 12661 If no symbol with a suitable value is found, both this field 12662 and dli_saddr shall be set to NULL. 12663 dli_saddr 12664 12665 The address of the symbol returned in dli_sname. This address 12666 has type "pointer to type", where type is the type of the 12667 symbol dli_sname. 12668 12669 Example: If the symbol in dli_sname is a function, then the 12670 type of dli_saddr is of type "pointer to function". 12671 12672 The behavior of dladdr() is only specified in dynamically 12673 linked programs. 12674 12675 Return Value 12676 12677 On success, dladdr() shall return non-zero, and the structure 12678 referenced by dlip shall be filled in as described. Otherwise, 12679 dladdr() shall return zero, and the cause of the error can be 12680 fetched with dlerror(). 12681 12682 Errors 12683 12684 See dlerror(). 12685 12686 Environment 12687 12688 LD_LIBRARY_PATH 12689 12690 directory search-path for object files 12691 12692 dlopen 12693 12694 Name 12695 12696 dlopen -- open dynamic object 12697 12698 Synopsis 12699 12700 #include 12701 12702 void * dlopen(const char * filename, int flag); 12703 12704 Description 12705 12706 The dlopen() function shall behave as specified in ISO POSIX 12707 (2003), but with additional behaviors listed below. 12708 12709 If the file argument does not contain a slash character, then 12710 the system shall look for a library of that name in at least 12711 the following directories, and use the first one which is 12712 found: 12713 12714 * The directories specified by the DT_RPATH dynamic entry. 12715 * The directories specified in the LD_LIBRARY_PATH 12716 environment variable (which is a colon separated list of 12717 pathnames). This step shall be skipped for setuid and 12718 setgid executables. 12719 * A set of directories sufficient to contain the libraries 12720 specified in this standard. 12721 12722 Note: Traditionally, /lib and /usr/lib. This case would 12723 also cover cases in which the system used the mechanism of 12724 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 12725 Example: An application which is not linked against libm 12726 may choose to dlopen libm. 12727 12728 dlsym 12729 12730 Name 12731 12732 dlsym -- obtain the address of a symbol from a dlopen object 12733 12734 Description 12735 12736 dlsym() is as specified in the ISO POSIX (2003), but with 12737 differences as listed below. 12738 12739 The special purpose value for handle RTLD_NEXT 12740 12741 The value RTLD_NEXT, which is reserved for future use shall be 12742 available, with the behavior as described in ISO POSIX (2003). 12743 _________________________________________________________ 12744 12745 9.17. Interfaces for librt 12746 12747 Table 9-34 defines the library name and shared object name for 12748 the librt library 12749 12750 Table 9-34. librt Definition 12751 Library: librt 12752 SONAME: librt.so.1 12753 12754 The behavior of the interfaces in this library is specified by 12755 the following specifications: 12756 12757 [SUSv3] ISO POSIX (2003) 12758 _________________________________________________________ 12759 12760 9.17.1. Shared Memory Objects 12761 _________________________________________________________ 12762 12763 9.17.1.1. Interfaces for Shared Memory Objects 12764 12765 An LSB conforming implementation shall provide the generic 12766 functions for Shared Memory Objects specified in Table 9-35, 12767 with the full mandatory functionality as described in the 12768 referenced underlying specification. 12769 12770 Table 9-35. librt - Shared Memory Objects Function Interfaces 12771 shm_open [SUSv3] shm_unlink [SUSv3] 12772 _________________________________________________________ 12773 12774 9.17.2. Clock 12775 _________________________________________________________ 12776 12777 9.17.2.1. Interfaces for Clock 12778 12779 An LSB conforming implementation shall provide the generic 12780 functions for Clock specified in Table 9-36, with the full 12781 mandatory functionality as described in the referenced 12782 underlying specification. 12783 12784 Table 9-36. librt - Clock Function Interfaces 12785 clock_getcpuclockid [SUSv3] clock_getres [SUSv3] clock_gettime 12786 [SUSv3] clock_nanosleep [SUSv3] 12787 clock_settime [SUSv3] 12788 _________________________________________________________ 12789 12790 9.17.3. Timers 12791 _________________________________________________________ 12792 12793 9.17.3.1. Interfaces for Timers 12794 12795 An LSB conforming implementation shall provide the generic 12796 functions for Timers specified in Table 9-37, with the full 12797 mandatory functionality as described in the referenced 12798 underlying specification. 12799 12800 Table 9-37. librt - Timers Function Interfaces 12801 timer_create [SUSv3] timer_delete [SUSv3] timer_getoverrun 12802 [SUSv3] timer_gettime [SUSv3] 12803 timer_settime [SUSv3] 12804 _________________________________________________________ 12805 12806 9.18. Interfaces for libcrypt 12807 12808 Table 9-38 defines the library name and shared object name for 12809 the libcrypt library 12810 12811 Table 9-38. libcrypt Definition 12812 Library: libcrypt 12813 SONAME: libcrypt.so.1 12814 12815 The behavior of the interfaces in this library is specified by 12816 the following specifications: 12817 12818 [SUSv3] ISO POSIX (2003) 12819 _________________________________________________________ 12820 12821 9.18.1. Encryption 12822 _________________________________________________________ 12823 12824 9.18.1.1. Interfaces for Encryption 12825 12826 An LSB conforming implementation shall provide the generic 12827 functions for Encryption specified in Table 9-39, with the 12828 full mandatory functionality as described in the referenced 12829 underlying specification. 12830 12831 Table 9-39. libcrypt - Encryption Function Interfaces 12832 crypt [SUSv3] encrypt [SUSv3] setkey [SUSv3] 12833 _________________________________________________________ 12834 12835 9.19. Interfaces for libpam 12836 12837 Table 9-40 defines the library name and shared object name for 12838 the libpam library 12839 12840 Table 9-40. libpam Definition 12841 Library: libpam 12842 SONAME: libpam.so.0 12843 12844 The Pluggable Authentication Module (PAM) interfaces allow 12845 applications to request authentication via a system 12846 administrator defined mechanism, known as a service. 12847 12848 A single service name, other, shall always be present. The 12849 behavior of this service shall be determined by the system 12850 administrator. Additional service names may also exist. 12851 12852 Note: Future versions of this specification might define 12853 additional service names. 12854 12855 The behavior of the interfaces in this library is specified by 12856 the following specifications: 12857 12858 [LSB] This Specification 12859 _________________________________________________________ 12860 12861 9.19.1. Pluggable Authentication API 12862 _________________________________________________________ 12863 12864 9.19.1.1. Interfaces for Pluggable Authentication API 12865 12866 An LSB conforming implementation shall provide the generic 12867 functions for Pluggable Authentication API specified in Table 12868 9-41, with the full mandatory functionality as described in 12869 the referenced underlying specification. 12870 12871 Table 9-41. libpam - Pluggable Authentication API Function 12872 Interfaces 12873 pam_acct_mgmt [LSB] pam_authenticate [LSB] pam_chauthtok [LSB] 12874 pam_close_session [LSB] 12875 pam_end [LSB] pam_fail_delay [LSB] pam_get_item [LSB] 12876 pam_getenvlist [LSB] 12877 pam_open_session [LSB] pam_set_item [LSB] pam_setcred [LSB] 12878 pam_start [LSB] 12879 pam_strerror [LSB] 12880 _________________________________________________________ 12881 12882 9.20. Data Definitions for libpam 12883 12884 This section defines global identifiers and their values that 12885 are associated with interfaces contained in libpam. These 12886 definitions are organized into groups that correspond to 12887 system headers. This convention is used as a convenience for 12888 the reader, and does not imply the existence of these headers, 12889 or their content. Where an interface is defined as requiring a 12890 particular system header file all of the data definitions for 12891 that system header file presented here shall be in effect. 12892 12893 This section gives data definitions to promote binary 12894 application portability, not to repeat source interface 12895 definitions available elsewhere. System providers and 12896 application developers should use this ABI to supplement - not 12897 to replace - source interface definition specifications. 12898 12899 This specification uses the ISO C (1999) C Language as the 12900 reference programming language, and data definitions are 12901 specified in ISO C format. The C language is used here as a 12902 convenient notation. Using a C language description of these 12903 data objects does not preclude their use by other programming 12904 languages. 12905 _________________________________________________________ 12906 12907 9.20.1. security/pam_appl.h 12908 12909 typedef struct pam_handle pam_handle_t; 12910 struct pam_message { 12911 int msg_style; 12912 const char *msg; 12913 }; 12914 struct pam_response { 12915 char *resp; 12916 int resp_retcode; 12917 }; 12918 12919 struct pam_conv { 12920 int (*conv) (int num_msg, const struct pam_message * *msg, 12921 struct pam_response * *resp, void *appdata_ptr); 12922 void *appdata_ptr; 12923 }; 12924 12925 #define PAM_PROMPT_ECHO_OFF 1 12926 #define PAM_PROMPT_ECHO_ON 2 12927 #define PAM_ERROR_MSG 3 12928 #define PAM_TEXT_INFO 4 12929 12930 #define PAM_SERVICE 1 12931 #define PAM_USER 2 12932 #define PAM_TTY 3 12933 #define PAM_RHOST 4 12934 #define PAM_CONV 5 12935 #define PAM_RUSER 8 12936 #define PAM_USER_PROMPT 9 12937 12938 #define PAM_SUCCESS 0 12939 #define PAM_OPEN_ERR 1 12940 #define PAM_USER_UNKNOWN 10 12941 #define PAM_MAXTRIES 11 12942 #define PAM_NEW_AUTHTOK_REQD 12 12943 #define PAM_ACCT_EXPIRED 13 12944 #define PAM_SESSION_ERR 14 12945 #define PAM_CRED_UNAVAIL 15 12946 #define PAM_CRED_EXPIRED 16 12947 #define PAM_CRED_ERR 17 12948 #define PAM_CONV_ERR 19 12949 #define PAM_SYMBOL_ERR 2 12950 #define PAM_AUTHTOK_ERR 20 12951 #define PAM_AUTHTOK_RECOVER_ERR 21 12952 #define PAM_AUTHTOK_LOCK_BUSY 22 12953 #define PAM_AUTHTOK_DISABLE_AGING 23 12954 #define PAM_TRY_AGAIN 24 12955 #define PAM_ABORT 26 12956 #define PAM_AUTHTOK_EXPIRED 27 12957 #define PAM_BAD_ITEM 29 12958 #define PAM_SERVICE_ERR 3 12959 #define PAM_SYSTEM_ERR 4 12960 #define PAM_BUF_ERR 5 12961 #define PAM_PERM_DENIED 6 12962 #define PAM_AUTH_ERR 7 12963 #define PAM_CRED_INSUFFICIENT 8 12964 #define PAM_AUTHINFO_UNAVAIL 9 12965 12966 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 12967 #define PAM_ESTABLISH_CRED 0x0002U 12968 #define PAM_DELETE_CRED 0x0004U 12969 #define PAM_REINITIALIZE_CRED 0x0008U 12970 #define PAM_REFRESH_CRED 0x0010U 12971 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 12972 #define PAM_SILENT 0x8000U 12973 12974 extern int pam_set_item(pam_handle_t *, int, const void *); 12975 extern int pam_get_item(const pam_handle_t *, int, const void **); 12976 extern const char *pam_strerror(pam_handle_t *, int); 12977 extern char **pam_getenvlist(pam_handle_t *); 12978 extern int pam_fail_delay(pam_handle_t *, unsigned int); 12979 extern int pam_start(const char *, const char *, const struct pam_conv*, 12980 pam_handle_t * *); 12981 extern int pam_end(pam_handle_t *, int); 12982 extern int pam_authenticate(pam_handle_t *, int); 12983 extern int pam_setcred(pam_handle_t *, int); 12984 extern int pam_acct_mgmt(pam_handle_t *, int); 12985 extern int pam_open_session(pam_handle_t *, int); 12986 extern int pam_close_session(pam_handle_t *, int); 12987 extern int pam_chauthtok(pam_handle_t *, int); 12988 _________________________________________________________ 12989 12990 9.21. Interface Definitions for libpam 12991 12992 Table of Contents 12993 pam_acct_mgmt -- establish the status of a user's account 12994 pam_authenticate -- authenticate the user 12995 pam_chauthtok -- change the authentication token for a given 12996 user 12997 12998 pam_close_session -- indicate that an authenticated session 12999 has ended 13000 13001 pam_end -- terminate the use of the PAM library 13002 pam_fail_delay -- specify delay time to use on authentication 13003 error 13004 13005 pam_get_item -- obtain the value of the indicated item. 13006 pam_getenvlist -- returns a pointer to the complete PAM 13007 environment. 13008 13009 pam_open_session -- indicate session has started 13010 pam_set_item -- (re)set the value of an item. 13011 pam_setcred -- set the module-specific credentials of the user 13012 pam_start -- initialize the PAM library 13013 pam_strerror -- returns a string describing the PAM error 13014 13015 The interfaces defined on the following pages are included in 13016 libpam and are defined by this specification. Unless otherwise 13017 noted, these interfaces shall be included in the source 13018 standard. 13019 13020 Other interfaces listed in Section 9.19 shall behave as 13021 described in the referenced base document. 13022 13023 pam_acct_mgmt 13024 13025 Name 13026 13027 pam_acct_mgmt -- establish the status of a user's account 13028 13029 Synopsis 13030 13031 #include 13032 13033 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 13034 13035 Description 13036 13037 pam_acct_mgmt() establishes the account's usability and the 13038 user's accessibility to the system. It is typically called 13039 after the user has been authenticated. 13040 13041 flags may be specified as any valid flag (namely, one of those 13042 applicable to the flags argument of pam_authenticate()). 13043 Additionally, the value of flags may be logically or'd with 13044 PAM_SILENT. 13045 13046 Return Value 13047 13048 PAM_SUCCESS 13049 13050 Success. 13051 PAM_NEW_AUTHTOK_REQD 13052 13053 User is valid, but user's authentication token has expired. 13054 The correct response to this return-value is to require that 13055 the user satisfy the pam_chauthtok() function before obtaining 13056 service. It may not be possible for an application to do this. 13057 In such a case, the user should be denied access until the 13058 account password is updated. 13059 PAM_ACCT_EXPIRED 13060 13061 User is no longer permitted access to the system. 13062 PAM_AUTH_ERR 13063 13064 Authentication error. 13065 PAM_PERM_DENIED 13066 13067 User is not permitted to gain access at this time. 13068 PAM_USER_UNKNOWN 13069 13070 User is not known to a module's account management component. 13071 13072 Note: Errors may be translated to text with pam_strerror(). 13073 13074 pam_authenticate 13075 13076 Name 13077 13078 pam_authenticate -- authenticate the user 13079 13080 Synopsis 13081 13082 #include 13083 13084 int pam_authenticate(pam_handle_t * pamh, int flags); 13085 13086 Description 13087 13088 pam_authenticate() serves as an interface to the 13089 authentication mechanisms of the loaded modules. 13090 13091 flags is an optional parameter that may be specified by the 13092 following value: 13093 13094 PAM_DISALLOW_NULL_AUTHTOK 13095 Instruct the authentication modules to return 13096 PAM_AUTH_ERR if the user does not have a registered 13097 authorization token. 13098 13099 Additionally, the value of flags may be logically or'd with 13100 PAM_SILENT. 13101 13102 The process may need to be privileged in order to successfully 13103 call this function. 13104 13105 Return Value 13106 13107 PAM_SUCCESS 13108 Success. 13109 13110 PAM_AUTH_ERR 13111 User was not authenticated or process did not have 13112 sufficient privileges to perform authentication. 13113 13114 PAM_CRED_INSUFFICIENT 13115 Application does not have sufficient credentials to 13116 authenticate the user. 13117 13118 PAM_AUTHINFO_UNAVAIL 13119 Modules were not able to access the authentication 13120 information. This might be due to a network or hardware 13121 failure, etc. 13122 13123 PAM_USER_UNKNOWN 13124 Supplied username is not known to the authentication 13125 service. 13126 13127 PAM_MAXTRIES 13128 One or more authentication modules has reached its 13129 limit of tries authenticating the user. Do not try 13130 again. 13131 13132 PAM_ABORT 13133 One or more authentication modules failed to load. 13134 13135 Note: Errors may be translated to text with pam_strerror(). 13136 13137 pam_chauthtok 13138 13139 Name 13140 13141 pam_chauthtok -- change the authentication token for a given 13142 user 13143 13144 Synopsis 13145 13146 #include 13147 13148 int pam_chauthtok(pam_handle_t * pamh, const int flags); 13149 13150 Description 13151 13152 pam_chauthtok() is used to change the authentication token for 13153 a given user as indicated by the state associated with the 13154 handle pamh. 13155 13156 flags is an optional parameter that may be specified by the 13157 following value: 13158 13159 PAM_CHANGE_EXPIRED_AUTHTOK 13160 User's authentication token should only be changed if 13161 it has expired. 13162 13163 Additionally, the value of flags may be logically or'd with 13164 PAM_SILENT. 13165 13166 RETURN VALUE 13167 13168 PAM_SUCCESS 13169 Success. 13170 13171 PAM_AUTHTOK_ERR 13172 A module was unable to obtain the new authentication 13173 token. 13174 13175 PAM_AUTHTOK_RECOVER_ERR 13176 A module was unable to obtain the old authentication 13177 token. 13178 13179 PAM_AUTHTOK_LOCK_BUSY 13180 One or more modules were unable to change the 13181 authentication token since it is currently locked. 13182 13183 PAM_AUTHTOK_DISABLE_AGING 13184 Authentication token aging has been disabled for at 13185 least one of the modules. 13186 13187 PAM_PERM_DENIED 13188 Permission denied. 13189 13190 PAM_TRY_AGAIN 13191 Not all modules were in a position to update the 13192 authentication token(s). In such a case, none of the 13193 user's authentication tokens are updated. 13194 13195 PAM_USER_UNKNOWN 13196 User is not known to the authentication token changing 13197 service. 13198 13199 Note: Errors may be translated to text with pam_strerror(). 13200 13201 pam_close_session 13202 13203 Name 13204 13205 pam_close_session -- indicate that an authenticated session 13206 has ended 13207 13208 Synopsis 13209 13210 #include 13211 13212 int pam_close_session(pam_handle_t * pamh, int flags); 13213 13214 Description 13215 13216 pam_close_session() is used to indicate that an authenticated 13217 session has ended. It is used to inform the module that the 13218 user is exiting a session. It should be possible for the PAM 13219 library to open a session and close the same session from 13220 different applications. 13221 13222 flags may have the value PAM_SILENT to indicate that no output 13223 should be generated as a result of this function call. 13224 13225 Return Value 13226 13227 PAM_SUCCESS 13228 13229 Success. 13230 PAM_SESSION_ERR 13231 13232 One of the required loaded modules was unable to close a 13233 session for the user. 13234 13235 Note: Errors may be translated to text with pam_strerror(). 13236 13237 pam_end 13238 13239 Name 13240 13241 pam_end -- terminate the use of the PAM library 13242 13243 Synopsis 13244 13245 #include 13246 13247 int pam_end(pam_handle_t * pamh, int pam_status); 13248 13249 Description 13250 13251 pam_end() terminates use of the PAM library. On success, the 13252 contents of *pamh are no longer valid, and all memory 13253 associated with it is invalid. 13254 13255 Normally, pam_status is passed the value PAM_SUCCESS, but in 13256 the event of an unsuccessful service application, the 13257 appropriate PAM error return value should be used. 13258 13259 Return Value 13260 13261 PAM_SUCCESS 13262 13263 Success. 13264 13265 Note: Errors may be translated to text with pam_strerror(). 13266 13267 pam_fail_delay 13268 13269 Name 13270 13271 pam_fail_delay -- specify delay time to use on authentication 13272 error 13273 13274 Synopsis 13275 13276 #include 13277 13278 int pam_fail_delay(pam_handle_t * pamh, unsigned int 13279 micro_sec); 13280 13281 Description 13282 13283 pam_fail_delay() specifies the minimum delay for the PAM 13284 library to use when an authentication error occurs. The actual 13285 delay can vary by as much at 25%. If this function is called 13286 multiple times, the longest time specified by any of the call 13287 will be used. 13288 13289 The delay is invoked if an authentication error occurs during 13290 the pam_authenticate() or pam_chauthtok() function calls. 13291 13292 Independent of the success of pam_authenticate() or 13293 pam_chauthtok(), the delay time is reset to its default value 13294 of 0 when the PAM library returns control to the application 13295 from these two functions. 13296 13297 Return Value 13298 13299 PAM_SUCCESS 13300 13301 Success. 13302 13303 Note: Errors may be translated to text with pam_strerror(). 13304 13305 pam_get_item 13306 13307 Name 13308 13309 pam_get_item -- obtain the value of the indicated item. 13310 13311 Synopsis 13312 13313 #include 13314 13315 int pam_get_item(const pam_handle_t * pamh, int item_type, 13316 const void * * item); 13317 13318 Description 13319 13320 pam_get_item() obtains the value of the indicated item_type. 13321 The possible values of item_type are the same as listed for 13322 pam_set_item(). 13323 13324 On success, item contains a pointer to the value of the 13325 corresponding item. Note that this is a pointer to the actual 13326 data and should not be free()'d or over-written. 13327 13328 Return Value 13329 13330 PAM_SUCCESS 13331 13332 Success. 13333 PAM_PERM_DENIED 13334 13335 Application passed a NULL pointer for item. 13336 PAM_BAD_ITEM 13337 13338 Application attempted to get an undefined item. 13339 13340 Note: Errors may be translated to text with pam_strerror(). 13341 13342 pam_getenvlist 13343 13344 Name 13345 13346 pam_getenvlist -- returns a pointer to the complete PAM 13347 environment. 13348 13349 Synopsis 13350 13351 #include 13352 13353 char * const * pam_getenvlist(pam_handle_t * pamh); 13354 13355 Description 13356 13357 pam_getenvlist() returns a pointer to the complete PAM 13358 environment. This pointer points to an array of pointers to 13359 NUL-terminated strings and must be terminated by a NULL 13360 pointer. Each string has the form "name=value". 13361 13362 The PAM library module allocates memory for the returned value 13363 and the associated strings. The calling application is 13364 responsible for freeing this memory. 13365 13366 Return Value 13367 13368 pam_getenvlist() returns an array of string pointers 13369 containing the PAM environment. On error, NULL is returned. 13370 13371 pam_open_session 13372 13373 Name 13374 13375 pam_open_session -- indicate session has started 13376 13377 Synopsis 13378 13379 #include 13380 13381 int pam_open_session(pam_handle_t * pamh, int flags); 13382 13383 Description 13384 13385 The pam_open_session() function is used to indicate that an 13386 authenticated session has begun, after the user has been 13387 identified (see pam_authenticate()) and, if necessary, granted 13388 credentials (see pam_setcred()). It is used to inform the 13389 module that the user is currently in a session. It should be 13390 possible for the PAM library to open a session and close the 13391 same session from different applications. 13392 13393 flags may have the value PAM_SILENT to indicate that no output 13394 be generated as a result of this function call. 13395 13396 Return Value 13397 13398 PAM_SUCCESS 13399 13400 Success. 13401 PAM_SESSION_ERR 13402 13403 One of the loaded modules was unable to open a session for the 13404 user. 13405 13406 Note: Errors may be translated to text with pam_strerror(). 13407 13408 pam_set_item 13409 13410 Name 13411 13412 pam_set_item -- (re)set the value of an item. 13413 13414 Synopsis 13415 13416 #include 13417 13418 int pam_set_item(pam_handle_t * pamh, int item_type, const 13419 void * item); 13420 13421 Description 13422 13423 pam_set_item() (re)sets the value of one of the following 13424 item_types: 13425 13426 PAM_SERVICE 13427 13428 service name 13429 PAM_USER 13430 13431 user name 13432 PAM_TTY 13433 13434 terminal name 13435 13436 The value for a device file should include the /dev/ prefix. 13437 The value for graphical, X-based, applications should be the 13438 $DISPLAY variable. 13439 PAM_RHOST 13440 13441 remote host name 13442 PAM_CONV 13443 13444 conversation structure 13445 PAM_RUSER 13446 13447 remote user name 13448 PAM_USER_PROMPT 13449 13450 string to be used when prompting for a user's name 13451 13452 The default value for this string is Please enter username: . 13453 13454 For all item_types other than PAM_CONV, item is a pointer to a 13455 NULL-terminated character string. In the case of PAM_CONV, 13456 item points to an initialized pam_conv structure. 13457 13458 Return Value 13459 13460 PAM_SUCCESS 13461 13462 Success. 13463 PAM_PERM_DENIED 13464 13465 An attempt was made to replace the conversation structure with 13466 a NULL value. 13467 PAM_BUF_ERR 13468 13469 Function ran out of memory making a copy of the item. 13470 PAM_BAD_ITEM 13471 13472 Application attempted to set an undefined item. 13473 13474 Note: Errors may be translated to text with pam_strerror(). 13475 13476 pam_setcred 13477 13478 Name 13479 13480 pam_setcred -- set the module-specific credentials of the user 13481 13482 Synopsis 13483 13484 #include 13485 13486 extern int pam_setcred(pam_handle_t * pamh, int flags); 13487 13488 Description 13489 13490 pam_setcred() sets the module-specific credentials of the 13491 user. It is usually called after the user has been 13492 authenticated, after the account management function has been 13493 called and after a session has been opened for the user. 13494 13495 flags maybe specified from among the following values: 13496 13497 PAM_ESTABLISH_CRED 13498 set credentials for the authentication service 13499 13500 PAM_DELETE_CRED 13501 delete credentials associated with the authentication 13502 service 13503 13504 PAM_REINITIALIZE_CRED 13505 reinitialize the user credentials 13506 13507 PAM_REFRESH_CRED 13508 extend lifetime of the user credentials 13509 13510 Additionally, the value of flags may be logically or'd with 13511 PAM_SILENT. 13512 13513 Return Value 13514 13515 PAM_SUCCESS 13516 13517 Success. 13518 PAM_CRED_UNAVAIL 13519 13520 Module cannot retrieve the user's credentials. 13521 PAM_CRED_EXPIRED 13522 13523 User's credentials have expired. 13524 PAM_USER_UNKNOWN 13525 13526 User is not known to an authentication module. 13527 PAM_CRED_ERR 13528 13529 Module was unable to set the credentials of the user. 13530 13531 Note: Errors may be translated to text with pam_strerror(). 13532 13533 pam_start 13534 13535 Name 13536 13537 pam_start -- initialize the PAM library 13538 13539 Synopsis 13540 13541 #include 13542 13543 int pam_start(const char * service_name, const char * user, 13544 const struct pam_conv * pam_conversation, pam_handle_t * * 13545 pamh); 13546 13547 Description 13548 13549 pam_start() is used to initialize the PAM library. It must be 13550 called prior to any other usage of the PAM library. On 13551 success, *pamh becomes a handle that provides continuity for 13552 successive calls to the PAM library. pam_start() expects 13553 arguments as follows: the service_name of the program, the 13554 username of the individual to be authenticated, a pointer to 13555 an application-supplied pam_conv structure, and a pointer to a 13556 pam_handle_t pointer. 13557 13558 An application must provide the conversation function used for 13559 direct communication between a loaded module and the 13560 application. The application also typically provides a means 13561 for the module to prompt the user for a password, etc. 13562 13563 The structure, pam_conv, is defined to be, 13564 struct pam_conv { 13565 int (*conv) (int num_msg, 13566 const struct pam_message * *msg, 13567 struct pam_response * *resp, 13568 void *appdata_ptr); 13569 void *appdata_ptr; 13570 }; 13571 13572 It is initialized by the application before it is passed to 13573 the library. The contents of this structure are attached to 13574 the *pamh handle. The point of this argument is to provide a 13575 mechanism for any loaded module to interact directly with the 13576 application program; this is why it is called a conversation 13577 structure. 13578 13579 When a module calls the referenced conv() function, 13580 appdata_ptr is set to the second element of this structure. 13581 13582 The other arguments of a call to conv() concern the 13583 information exchanged by module and application. num_msg holds 13584 the length of the array of pointers passed via msg. On 13585 success, the pointer resp points to an array of num_msg 13586 pam_response structures, holding the application-supplied 13587 text. Note that resp is a struct pam_response array and not an 13588 array of pointers. 13589 13590 Return Value 13591 13592 PAM_SUCCESS 13593 13594 Success. 13595 PAM_BUF_ERR 13596 13597 Memory allocation error. 13598 PAM_ABORT 13599 13600 Internal failure. 13601 13602 ERRORS 13603 13604 May be translated to text with pam_strerror(). 13605 13606 pam_strerror 13607 13608 Name 13609 13610 pam_strerror -- returns a string describing the PAM error 13611 13612 Synopsis 13613 13614 #include 13615 13616 const char * pam_strerror(pam_handle_t * pamh, int errnum); 13617 13618 Description 13619 13620 pam_strerror() returns a string describing the PAM error 13621 associated with errnum. 13622 13623 Return Value 13624 13625 On success, this function returns a description of the 13626 indicated error. The application should not free or modify 13627 this string. Otherwise, a string indicating that the error is 13628 unknown shall be returned. It is unspecified whether or not 13629 the string returned is translated according to the setting of 13630 LC_MESSAGES. 13631 13632 III. Utility Libraries 13633 13634 Table of Contents 13635 10. Utility Libraries 13636 13637 10.1. Introduction 13638 10.2. Interfaces for libz 13639 13640 10.2.1. Compression Library 13641 13642 10.3. Data Definitions for libz 13643 13644 10.3.1. zlib.h 13645 13646 10.4. Interface Definitions for libz 13647 13648 adler32 -- compute Adler 32 Checksum 13649 compress -- compress data 13650 compress2 -- compress data at a specified level 13651 compressBound -- compute compressed data size 13652 crc32 -- compute CRC-32 Checksum 13653 deflate -- compress data 13654 deflateBound -- compute compressed data size 13655 deflateCopy -- copy compression stream 13656 deflateEnd -- free compression stream state 13657 deflateInit2_ -- initialize compression system 13658 deflateInit_ -- initialize compression system 13659 deflateParams -- set compression parameters 13660 deflateReset -- reset compression stream state 13661 deflateSetDictionary -- initialize compression 13662 dictionary 13663 13664 get_crc_table -- generate a table for crc 13665 calculations 13666 13667 gzclose -- close a compressed file stream 13668 gzdopen -- open a compressed file 13669 gzeof -- check for end-of-file on a compressed file 13670 stream 13671 13672 gzerror -- decode an error on a compressed file 13673 stream 13674 13675 gzflush -- flush a compressed file stream 13676 gzgetc -- read a character from a compressed file 13677 gzgets -- read a string from a compressed file 13678 gzopen -- open a compressed file 13679 gzprintf -- format data and compress 13680 gzputc -- write character to a compressed file 13681 gzputs -- string write to a compressed file 13682 gzread -- read from a compressed file 13683 gzrewind -- reset the file-position indicator on a 13684 compressed file stream 13685 13686 gzseek -- reposition a file-position indicator in a 13687 compressed file stream 13688 13689 gzsetparams -- dynamically set compression 13690 parameters 13691 13692 gztell -- find position on a compressed file stream 13693 gzwrite -- write to a compressed file 13694 inflate -- decompress data 13695 inflateEnd -- free decompression stream state 13696 inflateInit2_ -- initialize decompression system 13697 inflateInit_ -- initialize decompression system 13698 inflateReset -- reset decompression stream state 13699 inflateSetDictionary -- initialize decompression 13700 dictionary 13701 13702 inflateSync -- advance compression stream to next 13703 sync point 13704 13705 inflateSyncPoint -- test for synchronization point 13706 uncompress -- uncompress data 13707 zError -- translate error number to string 13708 zlibVersion -- discover library version at run time 13709 13710 10.5. Interfaces for libncurses 13711 13712 10.5.1. Curses 13713 13714 10.6. Data Definitions for libncurses 13715 13716 10.6.1. curses.h 13717 10.6.2. term.h 13718 13719 10.7. Interfaces for libutil 13720 13721 10.7.1. Utility Functions 13722 13723 10.8. Interface Definitions for libutil 13724 13725 forkpty -- Create a new process attached to an 13726 available pseudo-terminal 13727 13728 login -- login utility function 13729 login_tty -- Prepare a terminal for login 13730 logout -- logout utility function 13731 logwtmp -- append an entry to the wtmp file 13732 openpty -- find and open an available 13733 pseudo-terminal 13734 _________________________________________________________ 13735 13736 Chapter 10. Utility Libraries 13737 13738 10.1. Introduction 13739 13740 An LSB-conforming implementation shall also support the 13741 following utility libraries which are built on top of the 13742 interfaces provided by the base libraries. These libraries 13743 implement common functionality, and hide additional system 13744 dependent information such as file formats and device names. 13745 13746 * libz 13747 * libcurses 13748 * libutil 13749 13750 The structure of the definitions for these libraries follows 13751 the same model as used for Base Libraries. 13752 _________________________________________________________ 13753 13754 10.2. Interfaces for libz 13755 13756 Table 10-1 defines the library name and shared object name for 13757 the libz library 13758 13759 Table 10-1. libz Definition 13760 Library: libz 13761 SONAME: libz.so.1 13762 13763 The behavior of the interfaces in this library is specified by 13764 the following specifications: 13765 13766 [LSB] This Specification 13767 _________________________________________________________ 13768 13769 10.2.1. Compression Library 13770 _________________________________________________________ 13771 13772 10.2.1.1. Interfaces for Compression Library 13773 13774 An LSB conforming implementation shall provide the generic 13775 functions for Compression Library specified in Table 10-2, 13776 with the full mandatory functionality as described in the 13777 referenced underlying specification. 13778 13779 Table 10-2. libz - Compression Library Function Interfaces 13780 adler32 [LSB] compress [LSB] compress2 [LSB] compressBound 13781 [LSB] 13782 crc32 [LSB] deflate [LSB] deflateBound [LSB] deflateCopy [LSB] 13783 deflateEnd [LSB] deflateInit2_ [LSB] deflateInit_ [LSB] 13784 deflateParams [LSB] 13785 deflateReset [LSB] deflateSetDictionary [LSB] get_crc_table 13786 [LSB] gzclose [LSB] 13787 gzdopen [LSB] gzeof [LSB] gzerror [LSB] gzflush [LSB] 13788 gzgetc [LSB] gzgets [LSB] gzopen [LSB] gzprintf [LSB] 13789 gzputc [LSB] gzputs [LSB] gzread [LSB] gzrewind [LSB] 13790 gzseek [LSB] gzsetparams [LSB] gztell [LSB] gzwrite [LSB] 13791 inflate [LSB] inflateEnd [LSB] inflateInit2_ [LSB] 13792 inflateInit_ [LSB] 13793 inflateReset [LSB] inflateSetDictionary [LSB] inflateSync 13794 [LSB] inflateSyncPoint [LSB] 13795 uncompress [LSB] zError [LSB] zlibVersion [LSB] 13796 _________________________________________________________ 13797 13798 10.3. Data Definitions for libz 13799 13800 This section defines global identifiers and their values that 13801 are associated with interfaces contained in libz. These 13802 definitions are organized into groups that correspond to 13803 system headers. This convention is used as a convenience for 13804 the reader, and does not imply the existence of these headers, 13805 or their content. Where an interface is defined as requiring a 13806 particular system header file all of the data definitions for 13807 that system header file presented here shall be in effect. 13808 13809 This section gives data definitions to promote binary 13810 application portability, not to repeat source interface 13811 definitions available elsewhere. System providers and 13812 application developers should use this ABI to supplement - not 13813 to replace - source interface definition specifications. 13814 13815 This specification uses the ISO C (1999) C Language as the 13816 reference programming language, and data definitions are 13817 specified in ISO C format. The C language is used here as a 13818 convenient notation. Using a C language description of these 13819 data objects does not preclude their use by other programming 13820 languages. 13821 _________________________________________________________ 13822 13823 10.3.1. zlib.h 13824 13825 In addition to the values below, the zlib.h header shall 13826 define the ZLIB_VERSION macro. This macro may be used to check 13827 that the version of the library at run time matches that at 13828 compile time. 13829 13830 See also the zlibVersion() function, which returns the library 13831 version at run time. The first character of the version at 13832 compile time should always match the first character at run 13833 time. 13834 #define Z_NULL 0 13835 #define MAX_WBITS 15 13836 #define MAX_MEM_LEVEL 9 13837 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) 13838 \ 13839 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 13840 #define deflateInit(strm,level) \ 13841 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 13842 #define inflateInit2(strm,windowBits) \ 13843 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 13844 #define inflateInit(strm) \ 13845 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 13846 13847 typedef char charf; 13848 typedef int intf; 13849 13850 typedef void *voidpf; 13851 typedef unsigned int uInt; 13852 typedef unsigned long int uLong; 13853 typedef uLong uLongf; 13854 typedef void *voidp; 13855 typedef unsigned char Byte; 13856 typedef off_t z_off_t; 13857 typedef void *const voidpc; 13858 13859 typedef voidpf(*alloc_func) (voidpf opaque, uInt items, uInt size); 13860 typedef void (*free_func) (voidpf opaque, voidpf address); 13861 struct internal_state { 13862 int dummy; 13863 }; 13864 typedef Byte Bytef; 13865 typedef uInt uIntf; 13866 13867 typedef struct z_stream_s { 13868 Bytef *next_in; 13869 uInt avail_in; 13870 uLong total_in; 13871 Bytef *next_out; 13872 uInt avail_out; 13873 uLong total_out; 13874 char *msg; 13875 struct internal_state *state; 13876 alloc_func zalloc; 13877 free_func zfree; 13878 voidpf opaque; 13879 int data_type; 13880 uLong adler; 13881 uLong reserved; 13882 } z_stream; 13883 13884 typedef z_stream *z_streamp; 13885 typedef voidp gzFile; 13886 13887 #define Z_NO_FLUSH 0 13888 #define Z_PARTIAL_FLUSH 1 13889 #define Z_SYNC_FLUSH 2 13890 #define Z_FULL_FLUSH 3 13891 #define Z_FINISH 4 13892 13893 #define Z_ERRNO (-1) 13894 #define Z_STREAM_ERROR (-2) 13895 #define Z_DATA_ERROR (-3) 13896 #define Z_MEM_ERROR (-4) 13897 #define Z_BUF_ERROR (-5) 13898 #define Z_VERSION_ERROR (-6) 13899 #define Z_OK 0 13900 #define Z_STREAM_END 1 13901 #define Z_NEED_DICT 2 13902 13903 #define Z_DEFAULT_COMPRESSION (-1) 13904 #define Z_NO_COMPRESSION 0 13905 #define Z_BEST_SPEED 1 13906 #define Z_BEST_COMPRESSION 9 13907 13908 #define Z_DEFAULT_STRATEGY 0 13909 #define Z_FILTERED 1 13910 #define Z_HUFFMAN_ONLY 2 13911 13912 #define Z_BINARY 0 13913 #define Z_ASCII 1 13914 #define Z_UNKNOWN 2 13915 13916 #define Z_DEFLATED 8 13917 13918 extern int gzread(gzFile, voidp, unsigned int); 13919 extern int gzclose(gzFile); 13920 extern gzFile gzopen(const char *, const char *); 13921 extern gzFile gzdopen(int, const char *); 13922 extern int gzwrite(gzFile, voidpc, unsigned int); 13923 extern int gzflush(gzFile, int); 13924 extern const char *gzerror(gzFile, int *); 13925 extern uLong adler32(uLong, const Bytef *, uInt); 13926 extern int compress(Bytef *, uLongf *, const Bytef *, uLong); 13927 extern int compress2(Bytef *, uLongf *, const Bytef *, uLong, int); 13928 extern uLong crc32(uLong, const Bytef *, uInt); 13929 extern int deflate(z_streamp, int); 13930 extern int deflateCopy(z_streamp, z_streamp); 13931 extern int deflateEnd(z_streamp); 13932 extern int deflateInit2_(z_streamp, int, int, int, int, int, const char *, 13933 int); 13934 extern int deflateInit_(z_streamp, int, const char *, int); 13935 extern int deflateParams(z_streamp, int, int); 13936 extern int deflateReset(z_streamp); 13937 extern int deflateSetDictionary(z_streamp, const Bytef *, uInt); 13938 extern const uLongf *get_crc_table(void); 13939 extern int gzeof(gzFile); 13940 extern int gzgetc(gzFile); 13941 extern char *gzgets(gzFile, char *, int); 13942 extern int gzprintf(gzFile, const char *, ...); 13943 extern int gzputc(gzFile, int); 13944 extern int gzputs(gzFile, const char *); 13945 extern int gzrewind(gzFile); 13946 extern z_off_t gzseek(gzFile, z_off_t, int); 13947 extern int gzsetparams(gzFile, int, int); 13948 extern z_off_t gztell(gzFile); 13949 extern int inflate(z_streamp, int); 13950 extern int inflateEnd(z_streamp); 13951 extern int inflateInit2_(z_streamp, int, const char *, int); 13952 extern int inflateInit_(z_streamp, const char *, int); 13953 extern int inflateReset(z_streamp); 13954 extern int inflateSetDictionary(z_streamp, const Bytef *, uInt); 13955 extern int inflateSync(z_streamp); 13956 extern int inflateSyncPoint(z_streamp); 13957 extern int uncompress(Bytef *, uLongf *, const Bytef *, uLong); 13958 extern const char *zError(int); 13959 extern const char *zlibVersion(void); 13960 extern uLong deflateBound(z_streamp, uLong); 13961 extern uLong compressBound(uLong); 13962 _________________________________________________________ 13963 13964 10.4. Interface Definitions for libz 13965 13966 Table of Contents 13967 adler32 -- compute Adler 32 Checksum 13968 compress -- compress data 13969 compress2 -- compress data at a specified level 13970 compressBound -- compute compressed data size 13971 crc32 -- compute CRC-32 Checksum 13972 deflate -- compress data 13973 deflateBound -- compute compressed data size 13974 deflateCopy -- copy compression stream 13975 deflateEnd -- free compression stream state 13976 deflateInit2_ -- initialize compression system 13977 deflateInit_ -- initialize compression system 13978 deflateParams -- set compression parameters 13979 deflateReset -- reset compression stream state 13980 deflateSetDictionary -- initialize compression dictionary 13981 get_crc_table -- generate a table for crc calculations 13982 gzclose -- close a compressed file stream 13983 gzdopen -- open a compressed file 13984 gzeof -- check for end-of-file on a compressed file stream 13985 gzerror -- decode an error on a compressed file stream 13986 gzflush -- flush a compressed file stream 13987 gzgetc -- read a character from a compressed file 13988 gzgets -- read a string from a compressed file 13989 gzopen -- open a compressed file 13990 gzprintf -- format data and compress 13991 gzputc -- write character to a compressed file 13992 gzputs -- string write to a compressed file 13993 gzread -- read from a compressed file 13994 gzrewind -- reset the file-position indicator on a compressed 13995 file stream 13996 13997 gzseek -- reposition a file-position indicator in a compressed 13998 file stream 13999 14000 gzsetparams -- dynamically set compression parameters 14001 gztell -- find position on a compressed file stream 14002 gzwrite -- write to a compressed file 14003 inflate -- decompress data 14004 inflateEnd -- free decompression stream state 14005 inflateInit2_ -- initialize decompression system 14006 inflateInit_ -- initialize decompression system 14007 inflateReset -- reset decompression stream state 14008 inflateSetDictionary -- initialize decompression dictionary 14009 inflateSync -- advance compression stream to next sync point 14010 inflateSyncPoint -- test for synchronization point 14011 uncompress -- uncompress data 14012 zError -- translate error number to string 14013 zlibVersion -- discover library version at run time 14014 14015 The interfaces defined on the following pages are included in 14016 libz and are defined by this specification. Unless otherwise 14017 noted, these interfaces shall be included in the source 14018 standard. 14019 14020 Other interfaces listed in Section 10.2 shall behave as 14021 described in the referenced base document. 14022 14023 adler32 14024 14025 Name 14026 14027 adler32 -- compute Adler 32 Checksum 14028 14029 Synopsis 14030 14031 #include 14032 14033 uLong adler32(uLong adler, const Bytef * buf, uInt len); 14034 14035 Description 14036 14037 The adler32() function shall compute a running Adler-32 14038 checksum (as described in RFC 1950: ZLIB Compressed Data 14039 Format Specication). On entry, adler is the previous value for 14040 the checksum, and buf shall point to an array of len bytes of 14041 data to be added to this checksum. The adler32() function 14042 shall return the new checksum. 14043 14044 If buf is NULL (or Z_NULL), adler32() shall return the initial 14045 checksum. 14046 14047 Return Value 14048 14049 The adler32() function shall return the new checksum value. 14050 14051 Errors 14052 14053 None defined. 14054 14055 Application Usage (informative) 14056 14057 The following code fragment demonstrates typical usage of the 14058 adler32() function: 14059 uLong adler = adler32(0L, Z_NULL, 0); 14060 14061 while (read_buffer(buffer, length) != EOF) { 14062 adler = adler32(adler, buffer, length); 14063 } 14064 if (adler != original_adler) error(); 14065 14066 compress 14067 14068 Name 14069 14070 compress -- compress data 14071 14072 Synopsis 14073 14074 #include 14075 14076 int compress(Bytef * dest, uLongf * destLen, const Bytef * 14077 source, uLong sourceLen); 14078 14079 Description 14080 14081 The compress() function shall attempt to compress sourceLen 14082 bytes of data in the buffer source, placing the result in the 14083 buffer dest. 14084 14085 On entry, destLen should point to a value describing the size 14086 of the dest buffer. The application should ensure that this 14087 value be at least (sourceLen × 1.001) + 12. On successful 14088 exit, the variable referenced by destLen shall be updated to 14089 hold the length of compressed data in dest. 14090 14091 The compress() function is equivalent to compress2() with a 14092 level of Z_DEFAULT_LEVEL. 14093 14094 Return Value 14095 14096 On success, compress() shall return Z_OK. Otherwise, 14097 compress() shall return a value to indicate the error. 14098 14099 Errors 14100 14101 On error, compress() shall return a value as described below: 14102 14103 Z_BUF_ERROR 14104 14105 The buffer dest was not large enough to hold the compressed 14106 data. 14107 Z_MEM_ERROR 14108 14109 Insufficient memory. 14110 14111 compress2 14112 14113 Name 14114 14115 compress2 -- compress data at a specified level 14116 14117 Synopsis 14118 14119 #include 14120 14121 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 14122 source, uLong sourceLen, int level); 14123 14124 Description 14125 14126 The compress2() function shall attempt to compress sourceLen 14127 bytes of data in the buffer source, placing the result in the 14128 buffer dest, at the level described by level. The level 14129 supplied shall be a value between 0 and 9, or the value 14130 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 14131 speed, while a level of 9 requests the highest compression. A 14132 level of 0 indicates that no compression should be used, and 14133 the output shall be the same as the input. 14134 14135 On entry, destLen should point to a value describing the size 14136 of the dest buffer. The application should ensure that this 14137 value be at least (sourceLen × 1.001) + 12. On successful 14138 exit, the variable referenced by destLen shall be updated to 14139 hold the length of compressed data in dest. 14140 14141 The compress() function is equivalent to compress2() with a 14142 level of Z_DEFAULT_LEVEL. 14143 14144 Return Value 14145 14146 On success, compress2() shall return Z_OK. Otherwise, 14147 compress2() shall return a value to indicate the error. 14148 14149 Errors 14150 14151 On error, compress2() shall return a value as described below: 14152 14153 Z_BUF_ERROR 14154 14155 The buffer dest was not large enough to hold the compressed 14156 data. 14157 Z_MEM_ERROR 14158 14159 Insufficient memory. 14160 Z_STREAM_ERROR 14161 14162 The level was not Z_DEFAULT_LEVEL, or was not between 0 and 9. 14163 14164 compressBound 14165 14166 Name 14167 14168 compressBound -- compute compressed data size 14169 14170 Synopsis 14171 14172 #include 14173 14174 int compressBound(uLong sourceLen); 14175 14176 Description 14177 14178 The compressBound() function shall estimate the size of buffer 14179 required to compress sourceLen bytes of data using the 14180 compress() or compress2() functions. If successful, the value 14181 returned shall be an upper bound for the size of buffer 14182 required to compress sourceLen bytes of data, using the 14183 parameters stored in stream, in a single call to compress() or 14184 compress2(). 14185 14186 Return Value 14187 14188 The compressBound() shall return a value representing the 14189 upper bound of an array to allocate to hold the compressed 14190 data in a single call to compress() or compress2(). This 14191 function may return a conservative value that may be larger 14192 than sourceLen. 14193 14194 Errors 14195 14196 None defined. 14197 14198 crc32 14199 14200 Name 14201 14202 crc32 -- compute CRC-32 Checksum 14203 14204 Synopsis 14205 14206 #include 14207 14208 uLong crc32(uLong crc, const Bytef * buf, uInt len); 14209 14210 Description 14211 14212 The crc32() function shall compute a running Cyclic Redundancy 14213 Check checksum, as defined in ITU-T V.42. On entry, crc is the 14214 previous value for the checksum, and buf shall point to an 14215 array of len bytes of data to be added to this checksum. The 14216 crc32() function shall return the new checksum. 14217 14218 If buf is NULL (or Z_NULL), crc32() shall return the initial 14219 checksum. 14220 14221 Return Value 14222 14223 The crc32() function shall return the new checksum value. 14224 14225 Errors 14226 14227 None defined. 14228 14229 Application Usage (informative) 14230 14231 The following code fragment demonstrates typical usage of the 14232 crc32() function: 14233 uLong crc = crc32(0L, Z_NULL, 0); 14234 14235 while (read_buffer(buffer, length) != EOF) { 14236 crc = crc32(crc, buffer, length); 14237 } 14238 if (crc != original_crc) error(); 14239 14240 deflate 14241 14242 Name 14243 14244 deflate -- compress data 14245 14246 Synopsis 14247 14248 #include 14249 14250 int deflate(z_streamp stream, int flush); 14251 14252 Description 14253 14254 The deflate() function shall attempt to compress data until 14255 either the input buffer is empty or the output buffer is full. 14256 The stream references a z_stream structure. Before the first 14257 call to deflate(), this structure should have been initialized 14258 by a call to deflateInit2_(). 14259 14260 Note: deflateInit2_() is only in the binary standard; 14261 source level applications should initialize stream via a 14262 call to deflateInit() or deflateInit2(). 14263 14264 In addition, the stream input and output buffers should have 14265 been initialized as follows: 14266 14267 next_in 14268 14269 should point to the data to be compressed. 14270 avail_in 14271 14272 should contain the number of bytes of data in the buffer 14273 referenced by next_in. 14274 next_out 14275 14276 should point to a buffer where compressed data may be placed. 14277 avail_out 14278 14279 should contain the size in bytes of the buffer referenced by 14280 next_out 14281 14282 The deflate() function shall perform one or both of the 14283 following actions: 14284 14285 1. Compress input data from next_in and update next_in, 14286 avail_in and total_in to reflect the data that has been 14287 compressed. 14288 2. Fill the output buffer referenced by next_out, and update 14289 next_out, avail_out and total_out to reflect the 14290 compressed data that has been placed there. If flush is 14291 not Z_NO_FLUSH, and avail_out indicates that there is 14292 still space in output buffer, this action shall always 14293 occur (see below for further details). 14294 14295 The deflate() function shall return when either avail_in 14296 reaches zero (indicating that all the input data has been 14297 compressed), or avail_out reaches zero (indicating that the 14298 output buffer is full). 14299 14300 On success, the deflate() function shall set the adler field 14301 of the stream to the adler32() checksum of all the input data 14302 compressed so far (represented by total_in). 14303 14304 If the deflate() function shall attempt to determine the type 14305 of input data, and set field data_type in stream to Z_ASCII if 14306 the majority of the data bytes fall within the ASCII (ISO 646) 14307 printable character range. Otherwise, it shall set data_type 14308 to Z_BINARY. This data type is informational only, and does 14309 not affect the compression algorithm. 14310 14311 Note: Future versions of the LSB may remove this 14312 requirement, since it is based on an outdated character set 14313 that does not support Internationalization, and does not 14314 affect the algorithm. It is included for information only 14315 at this release. Applications should not depend on this 14316 field. 14317 14318 Flush Operation 14319 14320 The parameter flush determines when compressed bits are added 14321 to the output buffer in next_out. If flush is Z_NO_FLUSH, 14322 deflate() may return with some data pending output, and not 14323 yet added to the output buffer. 14324 14325 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 14326 output to next_out and align the output to a byte boundary. A 14327 synchronization point is generated in the output. 14328 14329 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 14330 Z_SYNC_FLUSH, and the compression state shall be reset. A 14331 synchronization point is generated in the output. 14332 14333 Rationale: Z_SYNC_FLUSH is intended to ensure that the 14334 compressed data contains all the data compressed so far, 14335 and allows a decompressor to reconstruct all of the input 14336 data. Z_FULL_FLUSH allows decompression to restart from 14337 this point if the previous compressed data has been lost or 14338 damaged. Flushing is likely to degrade the performance of 14339 the compression system, and should only be used where 14340 necessary. 14341 14342 If flush is set to Z_FINISH, all pending input shall be 14343 processed and deflate() shall return with Z_STREAM_END if 14344 there is sufficient space in the output buffer at next_out, as 14345 indicated by avail_out. If deflate() is called with flush set 14346 to Z_FINISH and there is insufficient space to store the 14347 compressed data, and no other error has occurred during 14348 compression, deflate() shall return Z_OK, and the application 14349 should call deflate() again with flush unchanged, and having 14350 updated next_out and avail_out. 14351 14352 If all the compression is to be done in a single step, 14353 deflate() may be called with flush set to Z_FINISH immediately 14354 after the stream has been initialized if avail_out is set to 14355 at least the value returned by deflateBound(). 14356 14357 Return Value 14358 14359 On success, deflate() shall return Z_OK, unless flush was set 14360 to Z_FINISH and there was sufficient space in the output 14361 buffer to compress all of the input data. In this case, 14362 deflate() shall return Z_STREAM_END. On error, deflate() shall 14363 return a value to indicate the error. 14364 14365 Note: If deflate() returns Z_OK and has set avail_out to 14366 zero, the function should be called again with the same 14367 value for flush, and with updated next_out and avail_out 14368 until deflate() returns with Z_OK (or Z_STREAM_END if flush 14369 is set to Z_FINISH) and a non-zero avail_out. 14370 14371 Errors 14372 14373 On error, deflate() shall return a value as described below, 14374 and set the msg field of stream to point to a string 14375 describing the error: 14376 14377 Z_BUF_ERROR 14378 14379 No progress is possible; either avail_in or avail_out was 14380 zero. 14381 Z_MEM_ERROR 14382 14383 Insufficient memory. 14384 Z_STREAM_ERROR 14385 14386 The state (as represented in stream) is inconsistent, or 14387 stream was NULL. 14388 14389 deflateBound 14390 14391 Name 14392 14393 deflateBound -- compute compressed data size 14394 14395 Synopsis 14396 14397 #include 14398 14399 int deflateBound(z_streamp stream, uLong sourceLen); 14400 14401 Description 14402 14403 The deflateBound() function shall estimate the size of buffer 14404 required to compress sourceLen bytes of data. If successful, 14405 the value returned shall be an upper bound for the size of 14406 buffer required to compress sourceLen bytes of data, using the 14407 parameters stored in stream, in a single call to deflate() 14408 with flush set to Z_FINISH. 14409 14410 On entry, stream should have been initialized via a call to 14411 deflateInit_() or deflateInit2_(). 14412 14413 Return Value 14414 14415 The deflateBound() shall return a value representing the upper 14416 bound of an array to allocate to hold the compressed data in a 14417 single call to deflate(). If the stream is not correctly 14418 initialized, or is NULL, then deflateBound() may return a 14419 conservative value that may be larger than sourceLen. 14420 14421 Errors 14422 14423 None defined. 14424 14425 deflateCopy 14426 14427 Name 14428 14429 deflateCopy -- copy compression stream 14430 14431 Synopsis 14432 14433 #include 14434 14435 int deflateCopy(z_streamp dest, z_streamp source); 14436 14437 Description 14438 14439 The deflateCopy() function shall copy the compression state 14440 information in source to the uninitialized z_stream structure 14441 referenced by dest. 14442 14443 On successful return, dest will be an exact copy of the stream 14444 referenced by source. The input and output buffer pointers in 14445 next_in and next_out will reference the same data. 14446 14447 Return Value 14448 14449 On success, deflateCopy() shall return Z_OK. Otherwise it 14450 shall return a value less than zero to indicate the error. 14451 14452 Errors 14453 14454 On error, deflateCopy() shall return a value as described 14455 below: 14456 14457 Z_STREAM_ERROR 14458 14459 The state in source is inconsistent, or either source or dest 14460 was NULL. 14461 Z_MEM_ERROR 14462 14463 Insufficient memory available. 14464 14465 Application Usage (informative) 14466 14467 This function can be useful when several compression 14468 strategies will be tried, for example when there are several 14469 ways of pre-processing the input data with a filter. The 14470 streams that will be discarded should then be freed by calling 14471 deflateEnd(). Note that deflateCopy() duplicates the internal 14472 compression state which can be quite large, so this strategy 14473 may be slow and can consume lots of memory. 14474 14475 deflateEnd 14476 14477 Name 14478 14479 deflateEnd -- free compression stream state 14480 14481 Synopsis 14482 14483 #include 14484 14485 int deflateEnd(z_streamp stream); 14486 14487 Description 14488 14489 The deflateEnd() function shall free all allocated state 14490 information referenced by stream. All pending output is 14491 discarded, and unprocessed input is ignored. 14492 14493 Return Value 14494 14495 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 14496 there was pending output discarded or input unprocessed. 14497 Otherwise it shall return Z_STREAM_ERROR to indicate the 14498 error. 14499 14500 Errors 14501 14502 On error, deflateEnd() shall return Z_STREAM_ERROR. The 14503 following conditions shall be treated as an error: 14504 14505 * The state in stream is inconsistent or inappropriate. 14506 * stream is NULL. 14507 14508 deflateInit2_ 14509 14510 Name 14511 14512 deflateInit2_ -- initialize compression system 14513 14514 Synopsis 14515 14516 #include 14517 14518 int deflateInit2_ (z_streamp strm, int level, int method, int 14519 windowBits, int memLevel, int strategy, char * version, int 14520 stream_size); 14521 14522 Description 14523 14524 The deflateInit2_() function shall initialize the compression 14525 system. On entry, strm shall refer to a user supplied z_stream 14526 object (a z_stream_s structure). The following fields shall be 14527 set on entry: 14528 14529 zalloc 14530 14531 a pointer to an alloc_func function, used to allocate state 14532 information. If this is NULL, a default allocation function 14533 will be used. 14534 zfree 14535 14536 a pointer to a free_func function, used to free memory 14537 allocated by the zalloc function. If this is NULL a default 14538 free function will be used. 14539 opaque 14540 14541 If alloc_func is not NULL, opaque is a user supplied pointer 14542 to data that will be passed to the alloc_func and free_func 14543 functions. 14544 14545 If the version requested is not compatible with the version 14546 implemented, or if the size of the z_stream_s structure 14547 provided in stream_size does not match the size in the library 14548 implementation, deflateInit2_() shall fail, and return 14549 Z_VERSION_ERROR. 14550 14551 The level supplied shall be a value between 0 and 9, or the 14552 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 14553 speed, while a level of 9 requests the highest compression. A 14554 level of 0 indicates that no compression should be used, and 14555 the output shall be the same as the input. 14556 14557 The method selects the compression algorithm to use. LSB 14558 conforming implementation shall support the Z_DEFLATED method, 14559 and may support other implementation defined methods. 14560 14561 The windowBits parameter shall be a base 2 logarithm of the 14562 window size to use, and shall be a value between 8 and 15. A 14563 smaller value will use less memory, but will result in a 14564 poorer compression ratio, while a higher value will give 14565 better compression but utilize more memory. 14566 14567 The memLevel parameter specifies how much memory to use for 14568 the internal state. The value of memLevel shall be between 1 14569 and MAX_MEM_LEVEL. Smaller values use less memory but are 14570 slower, while higher values use more memory to gain 14571 compression speed. 14572 14573 The strategy parameter selects the compression strategy to 14574 use: 14575 14576 Z_DEFAULT_STRATEGY 14577 14578 use the system default compression strategy. 14579 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 14580 Z_FILTERED 14581 14582 use a compression strategy tuned for data consisting largely 14583 of small values with a fairly random distribution. Z_FILTERED 14584 uses more Huffman encoding and less string matching than 14585 Z_DEFAULT_STRATEGY. 14586 Z_HUFFMAN_ONLY 14587 14588 force Huffman encoding only, with no string match. 14589 14590 The deflateInit2_() function is not in the source standard; it 14591 is only in the binary standard. Source applications should use 14592 the deflateInit2() macro. 14593 14594 Return Value 14595 14596 On success, the deflateInit2_() function shall return Z_OK. 14597 Otherwise, deflateInit2_() shall return a value as described 14598 below to indicate the error. 14599 14600 Errors 14601 14602 On error, deflateInit2_() shall return one of the following 14603 error indicators: 14604 14605 Z_STREAM_ERROR 14606 14607 Invalid parameter. 14608 Z_MEM_ERROR 14609 14610 Insufficient memory available. 14611 Z_VERSION_ERROR 14612 14613 The version requested is not compatible with the library 14614 version, or the z_stream size differs from that used by the 14615 library. 14616 14617 In addition, the msg field of the strm may be set to an error 14618 message. 14619 14620 deflateInit_ 14621 14622 Name 14623 14624 deflateInit_ -- initialize compression system 14625 14626 Synopsis 14627 14628 #include 14629 14630 int deflateInit_(z_streamp stream, int level, const char * 14631 version, int stream_size); 14632 14633 Description 14634 14635 The deflateInit_() function shall initialize the compression 14636 system. On entry, stream shall refer to a user supplied 14637 z_stream object (a z_stream_s structure). The following fields 14638 shall be set on entry: 14639 14640 zalloc 14641 14642 a pointer to an alloc_func function, used to allocate state 14643 information. If this is NULL, a default allocation function 14644 will be used. 14645 zfree 14646 14647 a pointer to a free_func function, used to free memory 14648 allocated by the zalloc function. If this is NULL a default 14649 free function will be used. 14650 opaque 14651 14652 If alloc_func is not NULL, opaque is a user supplied pointer 14653 to data that will be passed to the alloc_func and free_func 14654 functions. 14655 14656 If the version requested is not compatible with the version 14657 implemented, or if the size of the z_stream_s structure 14658 provided in stream_size does not match the size in the library 14659 implementation, deflateInit_() shall fail, and return 14660 Z_VERSION_ERROR. 14661 14662 The level supplied shall be a value between 0 and 9, or the 14663 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 14664 speed, while a level of 9 requests the highest compression. A 14665 level of 0 indicates that no compression should be used, and 14666 the output shall be the same as the input. 14667 14668 The deflateInit_() function is not in the source standard; it 14669 is only in the binary standard. Source applications should use 14670 the deflateInit() macro. 14671 14672 The deflateInit_() function is equivalent to 14673 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, 14674 Z_DEFAULT_STRATEGY, version, stream_size); 14675 14676 Return Value 14677 14678 On success, the deflateInit_() function shall return Z_OK. 14679 Otherwise, deflateInit_() shall return a value as described 14680 below to indicate the error. 14681 14682 Errors 14683 14684 On error, deflateInit_() shall return one of the following 14685 error indicators: 14686 14687 Z_STREAM_ERROR 14688 14689 Invalid parameter. 14690 Z_MEM_ERROR 14691 14692 Insufficient memory available. 14693 Z_VERSION_ERROR 14694 14695 The version requested is not compatible with the library 14696 version, or the z_stream size differs from that used by the 14697 library. 14698 14699 In addition, the msg field of the stream may be set to an 14700 error message. 14701 14702 deflateParams 14703 14704 Name 14705 14706 deflateParams -- set compression parameters 14707 14708 Synopsis 14709 14710 #include 14711 14712 int deflateParams(z_streamp stream, int level, int strategy); 14713 14714 Description 14715 14716 The deflateParams() function shall dynamically alter the 14717 compression parameters for the compression stream object 14718 stream. On entry, stream shall refer to a user supplied 14719 z_stream object (a z_stream_s structure), already initialized 14720 via a call to deflateInit_() or deflateInit2_(). 14721 14722 The level supplied shall be a value between 0 and 9, or the 14723 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 14724 speed, while a level of 9 requests the highest compression. A 14725 level of 0 indicates that no compression should be used, and 14726 the output shall be the same as the input. If the compression 14727 level is altered by deflateParams(), and some data has already 14728 been compressed with this stream (i.e. total_in is not zero), 14729 and the new level requires a different underlying compression 14730 method, then stream shall be flushed by a call to deflate(). 14731 14732 The strategy parameter selects the compression strategy to 14733 use: 14734 14735 Z_DEFAULT_STRATEGY 14736 14737 use the system default compression strategy. 14738 Z_DEFAULT_STRATEGY is particularly appropriate for text data. 14739 Z_FILTERED 14740 14741 use a compression strategy tuned for data consisting largely 14742 of small values with a fairly random distribution. Z_FILTERED 14743 uses more Huffman encoding and less string matching than 14744 Z_DEFAULT_STRATEGY. 14745 Z_HUFFMAN_ONLY 14746 14747 force Huffman encoding only, with no string match. 14748 14749 Return Value 14750 14751 On success, the deflateParams() function shall return Z_OK. 14752 Otherwise, deflateParams() shall return a value as described 14753 below to indicate the error. 14754 14755 Errors 14756 14757 On error, deflateParams() shall return one of the following 14758 error indicators: 14759 14760 Z_STREAM_ERROR 14761 14762 Invalid parameter. 14763 Z_MEM_ERROR 14764 14765 Insufficient memory available. 14766 Z_BUF_ERROR 14767 14768 Insufficient space in stream to flush the current output. 14769 14770 In addition, the msg field of the strm may be set to an error 14771 message. 14772 14773 Application Usage (Informative) 14774 14775 Applications should ensure that the stream is flushed, e.g. by 14776 a call to deflate(stream, Z_SYNC_FLUSH) before calling 14777 deflateParams(), or ensure that there is sufficient space in 14778 next_out (as identified by avail_out) to ensure that all 14779 pending output and all uncompressed input can be flushed in a 14780 single call to deflate(). 14781 14782 Rationale: Although the deflateParams() function should 14783 flush pending output and compress all pending input, the 14784 result is unspecified if there is insufficient space in the 14785 output buffer. Applications should only call 14786 deflateParams() when the stream is effectively empty 14787 (flushed). 14788 14789 The deflateParams() can be used to switch between 14790 compression and straight copy of the input data, or to 14791 switch to a different kind of input data requiring a 14792 different strategy. 14793 14794 deflateReset 14795 14796 Name 14797 14798 deflateReset -- reset compression stream state 14799 14800 Synopsis 14801 14802 #include 14803 14804 int deflateReset(z_streamp stream); 14805 14806 Description 14807 14808 The deflateReset() function shall reset all state associated 14809 with stream. All pending output shall be discarded, and the 14810 counts of processed bytes (total_in and total_out) shall be 14811 reset to zero. 14812 14813 Return Value 14814 14815 On success, deflateReset() shall return Z_OK. Otherwise it 14816 shall return Z_STREAM_ERROR to indicate the error. 14817 14818 Errors 14819 14820 On error, deflateReset() shall return Z_STREAM_ERROR. The 14821 following conditions shall be treated as an error: 14822 14823 * The state in stream is inconsistent or inappropriate. 14824 * stream is NULL. 14825 14826 deflateSetDictionary 14827 14828 Name 14829 14830 deflateSetDictionary -- initialize compression dictionary 14831 14832 Synopsis 14833 14834 #include 14835 14836 int deflateSetDictionary(z_streamp stream, const Bytef * 14837 dictionary, uInt dictlen); 14838 14839 Description 14840 14841 The deflateSetDictionary() function shall initialize the 14842 compression dictionary associated with stream using the 14843 dictlen bytes referenced by dictionary. 14844 14845 The implementation may silently use a subset of the provided 14846 dictionary if the dictionary cannot fit in the current window 14847 associated with stream (see deflateInit2_()). The application 14848 should ensure that the dictionary is sorted such that the most 14849 commonly used strings occur at the end of the dictionary. 14850 14851 If the dictionary is successfully set, the Adler32 checksum of 14852 the entire provided dictionary shall be stored in the adler 14853 member of stream. This value may be used by the decompression 14854 system to select the correct dictionary. The compression and 14855 decompression systems must use the same dictionary. 14856 14857 stream shall reference an initialized compression stream, with 14858 total_in zero (i.e. no data has been compressed since the 14859 stream was initialized). 14860 14861 Return Value 14862 14863 On success, deflateSetDictionary() shall return Z_OK. 14864 Otherwise it shall return Z_STREAM_ERROR to indicate an error. 14865 14866 Errors 14867 14868 On error, deflateSetDictionary() shall return a value as 14869 described below: 14870 14871 Z_STREAM_ERROR 14872 14873 The state in stream is inconsistent, or stream was NULL. 14874 14875 Application Usage (informative) 14876 14877 The application should provide a dictionary consisting of 14878 strings {{{ed note: do we really mean "strings"? Null 14879 terminated?}}} that are likely to be encountered in the data 14880 to be compressed. The application should ensure that the 14881 dictionary is sorted such that the most commonly used strings 14882 occur at the end of the dictionary. 14883 14884 The use of a dictionary is optional; however if the data to be 14885 compressed is relatively short and has a predictable 14886 structure, the use of a dictionary can substantially improve 14887 the compression ratio. 14888 14889 get_crc_table 14890 14891 Name 14892 14893 get_crc_table -- generate a table for crc calculations 14894 14895 Synopsis 14896 14897 #include 14898 14899 const uLongf * get_crc_table(void); 14900 14901 Description 14902 14903 Generate tables for a byte-wise 32-bit CRC calculation based 14904 on the polynomial: 14905 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+ 14906 1 14907 14908 In a multi-threaded application, get_crc_table() should be 14909 called by one thread to initialize the tables before any other 14910 thread calls any libz function. 14911 14912 Return Value 14913 14914 The get_crc_table() function shall return a pointer to the 14915 first of a set of tables used internally to calculate CRC-32 14916 values (see crc32()). 14917 14918 Errors 14919 14920 None defined. 14921 14922 gzclose 14923 14924 Name 14925 14926 gzclose -- close a compressed file stream 14927 14928 Synopsis 14929 14930 #include 14931 14932 int gzclose (gzFile file ); 14933 14934 Description 14935 14936 The gzclose() function shall close the compressed file stream 14937 file. If file was open for writing, gzclose() shall first 14938 flush any pending output. Any state information allocated 14939 shall be freed. 14940 14941 Return Value 14942 14943 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 14944 shall return an error value as described below. 14945 14946 Errors 14947 14948 On error, gzclose() may set the global variable errno to 14949 indicate the error. The gzclose() shall return a value other 14950 than Z_OK on error. 14951 14952 Z_STREAM_ERROR 14953 14954 file was NULL (or Z_NULL), or did not refer to an open 14955 compressed file stream. 14956 Z_ERRNO 14957 14958 An error occurred in the underlying base libraries, and the 14959 application should check errno for further information. 14960 Z_BUF_ERROR 14961 14962 no compression progress is possible during buffer flush (see 14963 deflate()). 14964 14965 gzdopen 14966 14967 Name 14968 14969 gzdopen -- open a compressed file 14970 14971 Synopsis 14972 14973 #include 14974 14975 gzFile gzdopen ( int fd, const char *mode ); 14976 14977 Description 14978 14979 The gzdopen() function shall attempt to associate the open 14980 file referenced by fd with a gzFile object. The mode argument 14981 is based on that of fopen(), but the mode parameter may also 14982 contain the following characters: 14983 14984 digit 14985 14986 set the compression level to digit. A low value (e.g. 1) means 14987 high speed, while a high value (e.g. 9) means high 14988 compression. A compression level of 0 (zero) means no 14989 compression. See defaultInit2_() for further details. 14990 [fhR] 14991 14992 set the compression strategy to [fhR]. The letter f 14993 corresponds to filtered data, the letter h corresponds to 14994 Huffman only compression, and the letter R corresponds to Run 14995 Length Encoding. See defaultInit2_() for further details. 14996 14997 If fd refers to an uncompressed file, and mode refers to a 14998 read mode, gzdopen() shall attempt to open the file and return 14999 a gzFile object suitable for reading directly from the file 15000 without any decompression. 15001 15002 If mode is NULL, or if mode does not contain one of r, w, or 15003 a, gzdopen() shall return Z_NULL, and need not set any other 15004 error condition. 15005 15006 Example 15007 15008 gzdopen(fileno(stdin), "r"); 15009 15010 Attempt to associate the standard input with a gzFile object. 15011 15012 Return Value 15013 15014 On success, gzdopen() shall return a gzFile object. On 15015 failure, gzdopen() shall return Z_NULL and may set errno 15016 accordingly. 15017 15018 Note: At version 1.2.2, zlib does not set errno for several 15019 error conditions. Applications may not be able to determine 15020 the cause of an error. 15021 15022 Errors 15023 15024 On error, gzdopen() may set the global variable errno to 15025 indicate the error. 15026 15027 gzeof 15028 15029 Name 15030 15031 gzeof -- check for end-of-file on a compressed file stream 15032 15033 Synopsis 15034 15035 #include 15036 15037 int gzeof (gzFile file ); 15038 15039 Description 15040 15041 The gzeof() function shall test the compressed file stream 15042 file for end of file. 15043 15044 Return Value 15045 15046 If file was open for reading and end of file has been reached, 15047 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 15048 15049 Errors 15050 15051 None defined. 15052 15053 gzerror 15054 15055 Name 15056 15057 gzerror -- decode an error on a compressed file stream 15058 15059 Synopsis 15060 15061 #include 15062 15063 const char * gzerror (gzFile file, int * errnum); 15064 15065 Description 15066 15067 The gzerror() function shall return a string describing the 15068 last error to have occurred associated with the open 15069 compressed file stream referred to by file. It shall also set 15070 the location referenced by errnum to an integer value that 15071 further identifies the error. 15072 15073 Return Value 15074 15075 The gzerror() function shall return a string that describes 15076 the last error associated with the given file compressed file 15077 stream. This string shall have the format "%s: %s", with the 15078 name of the file, followed by a colon, a space, and the 15079 description of the error. If the compressed file stream was 15080 opened by a call to gzdopen(), the format of the filename is 15081 unspecified. 15082 15083 Rationale: Although in all current implementations of libz 15084 file descriptors are named "", the code suggests 15085 that this is for debugging purposes only, and may change in 15086 a future release. 15087 15088 It is unspecified if the string returned is determined by the 15089 setting of the LC_MESSAGES category in the current locale. 15090 15091 Errors 15092 15093 None defined. 15094 15095 gzflush 15096 15097 Name 15098 15099 gzflush -- flush a compressed file stream 15100 15101 Synopsis 15102 15103 #include 15104 15105 int gzflush(gzFile file, int flush); 15106 15107 Description 15108 15109 The gzflush() function shall flush pending output to the 15110 compressed file stream identified by file, which must be open 15111 for writing. 15112 15113 Flush Operation 15114 15115 The parameter flush determines which compressed bits are added 15116 to the output file. If flush is Z_NO_FLUSH, gzflush() may 15117 return with some data pending output, and not yet written to 15118 the file. 15119 15120 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 15121 output to file and align the output to a byte boundary. There 15122 may still be data pending compression that is not flushed. 15123 15124 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 15125 Z_SYNC_FLUSH, and the compression state shall be reset. There 15126 may still be data pending compression that is not flushed. 15127 15128 Rationale: Z_SYNC_FLUSH is intended to ensure that the 15129 compressed data contains all the data compressed so far, 15130 and allows a decompressor to reconstruct all of the input 15131 data. Z_FULL_FLUSH allows decompression to restart from 15132 this point if the previous compressed data has been lost or 15133 damaged. Flushing is likely to degrade the performance of 15134 the compression system, and should only be used where 15135 necessary. 15136 15137 If flush is set to Z_FINISH, all pending uncompressed data 15138 shall be compressed and all output shall be flushed. 15139 15140 Return Value 15141 15142 On success, gzflush() shall return the value Z_OK. Otherwise 15143 gzflush() shall return a value to indicate the error, and may 15144 set the error number associated with the compressed file 15145 stream file. 15146 15147 Note: If flush is set to Z_FINISH and the flush operation 15148 is successful, gzflush() will return Z_OK, but the 15149 compressed file stream error value may be set to 15150 Z_STREAM_END. 15151 15152 Errors 15153 15154 On error, gzwrite() shall return an error value, and may set 15155 the error number associated with the stream identified by file 15156 to indicate the error. Applications may use gzerror() to 15157 access this error value. 15158 15159 Z_ERRNO 15160 15161 An underlying base library function has indicated an error. 15162 The global variable errno may be examined for further 15163 information. 15164 Z_STREAM_ERROR 15165 15166 The stream is invalid, is not open for writing, or is in an 15167 invalid state. 15168 Z_BUF_ERROR 15169 15170 no compression progress is possible (see deflate()). 15171 Z_MEM_ERROR 15172 15173 Insufficient memory available to compress. 15174 15175 gzgetc 15176 15177 Name 15178 15179 gzgetc -- read a character from a compressed file 15180 15181 Synopsis 15182 15183 #include 15184 15185 int gzgetc (gzFile file); 15186 15187 Description 15188 15189 The gzgetc() function shall read the next single character 15190 from the compressed file stream referenced by file, which 15191 shall have been opened in a read mode (see gzopen() and 15192 gzdopen()). 15193 15194 Return Value 15195 15196 On success, gzgetc() shall return the uncompressed character 15197 read, otherwise, on end of file or error, gzgetc() shall 15198 return -1. 15199 15200 Errors 15201 15202 On end of file or error, gzgetc() shall return -1. Further 15203 information can be found by calling gzerror() with a pointer 15204 to the compressed file stream. 15205 15206 gzgets 15207 15208 Name 15209 15210 gzgets -- read a string from a compressed file 15211 15212 Synopsis 15213 15214 #include 15215 15216 char * gzgets (gzFile file, char * buf, int len); 15217 15218 Description 15219 15220 The gzgets() function shall attempt to read data from the 15221 compressed file stream file, uncompressing it into buf until 15222 either len-1 bytes have been inserted into buf, or until a 15223 newline character has been uncompressed into buf. A null byte 15224 shall be appended to the uncompressed data. The file shall 15225 have been opened in for reading (see gzopen() and gzdopen()). 15226 15227 Return Value 15228 15229 On success, gzgets() shall return a pointer to buf. Otherwise, 15230 gzgets() shall return Z_NULL. Applications may examine the 15231 cause using gzerror(). 15232 15233 Errors 15234 15235 On error, gzgets() shall return Z_NULL. The following 15236 conditions shall always be treated as an error: 15237 15238 file is NULL, or does not refer to a file open for reading; 15239 buf is NULL; 15240 len is less than or equal to zero. 15241 15242 gzopen 15243 15244 Name 15245 15246 gzopen -- open a compressed file 15247 15248 Synopsis 15249 15250 #include 15251 15252 gzFile gzopen (const char *path , const char *mode ); 15253 15254 Description 15255 15256 The gzopen() function shall open the compressed file named by 15257 path. The mode argument is based on that of fopen(), but the 15258 mode parameter may also contain the following characters: 15259 15260 digit 15261 15262 set the compression level to digit. A low value (e.g. 1) means 15263 high speed, while a high value (e.g. 9) means high 15264 compression. A compression level of 0 (zero) means no 15265 compression. See defaultInit2_() for further details. 15266 [fhR] 15267 15268 set the compression strategy to [fhR]. The letter f 15269 corresponds to filtered data, the letter h corresponds to 15270 Huffman only compression, and the letter R corresponds to Run 15271 Length Encoding. See defaultInit2_() for further details. 15272 15273 If path refers to an uncompressed file, and mode refers to a 15274 read mode, gzopen() shall attempt to open the file and return 15275 a gzFile object suitable for reading directly from the file 15276 without any decompression. 15277 15278 If path or mode is NULL, or if mode does not contain one of r, 15279 w, or a, gzopen() shall return Z_NULL, and need not set any 15280 other error condition. 15281 15282 The gzFile object is also referred to as a compressed file 15283 stream. 15284 15285 Example 15286 15287 gzopen("file.gz", "w6h"); 15288 15289 Attempt to create a new compressed file, file.gz, at 15290 compression level 6 using Huffman only compression. 15291 15292 Return Value 15293 15294 On success, gzopen() shall return a gzFile object (also known 15295 as a compressed file stream). On failure, gzopen() shall 15296 return Z_NULL and may set errno accordingly. 15297 15298 Note: At version 1.2.2, zlib does not set errno for several 15299 error conditions. Applications may not be able to determine 15300 the cause of an error. 15301 15302 Errors 15303 15304 On error, gzopen() may set the global variable errno to 15305 indicate the error. 15306 15307 gzprintf 15308 15309 Name 15310 15311 gzprintf -- format data and compress 15312 15313 Synopsis 15314 15315 #include 15316 15317 int gzprintf (gzFile file, const char * fmt, ...); 15318 15319 Description 15320 15321 The gzprintf() function shall format data as for fprintf(), 15322 and write the resulting string to the compressed file stream 15323 file. 15324 15325 Return Value 15326 15327 The gzprintf() function shall return the number of 15328 uncompressed bytes actually written, or a value less than or 15329 equal to 0 in the event of an error. 15330 15331 Errors 15332 15333 If file is NULL, or refers to a compressed file stream that 15334 has not been opened for writing, gzprintf() shall return 15335 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 15336 15337 gzputc 15338 15339 Name 15340 15341 gzputc -- write character to a compressed file 15342 15343 Synopsis 15344 15345 #include 15346 15347 int gzputc (gzFile file, int c); 15348 15349 Description 15350 15351 The gzputc() function shall write the single character c, 15352 converted from integer to unsigned character, to the 15353 compressed file referenced by file, which shall have been 15354 opened in a write mode (see gzopen() and gzdopen()). 15355 15356 Return Value 15357 15358 On success, gzputc() shall return the value written, otherwise 15359 gzputc() shall return -1. 15360 15361 Errors 15362 15363 On error, gzputc() shall return -1. 15364 15365 gzputs 15366 15367 Name 15368 15369 gzputs -- string write to a compressed file 15370 15371 Synopsis 15372 15373 #include 15374 15375 int gzputs (gzFile file, const char * s); 15376 15377 Description 15378 15379 The gzputs() function shall write the null terminated string s 15380 to the compressed file referenced by file, which shall have 15381 been opened in a write mode (see gzopen() and gzdopen()). The 15382 terminating null character shall not be written. The gzputs() 15383 function shall return the number of uncompressed bytes 15384 actually written. 15385 15386 Return Value 15387 15388 On success, gzputs() shall return the number of uncompressed 15389 bytes actually written to file. On error gzputs() shall return 15390 a value less than or equal to 0. Applications may examine the 15391 cause using gzerror(). 15392 15393 Errors 15394 15395 On error, gzputs() shall set the error number associated with 15396 the stream identified by file to indicate the error. 15397 Applications should use gzerror() to access this error value. 15398 If file is NULL, gzputs() shall return Z_STREAM_ERR. 15399 15400 Z_ERRNO 15401 15402 An underlying base library function has indicated an error. 15403 The global variable errno may be examined for further 15404 information. 15405 Z_STREAM_ERROR 15406 15407 The stream is invalid, is not open for writing, or is in an 15408 invalid state. 15409 Z_BUF_ERROR 15410 15411 no compression progress is possible (see deflate()). 15412 Z_MEM_ERROR 15413 15414 Insufficient memory available to compress. 15415 15416 gzread 15417 15418 Name 15419 15420 gzread -- read from a compressed file 15421 15422 Synopsis 15423 15424 #include 15425 15426 int gzread (gzFile file, voidp buf, unsigned int len); 15427 15428 Description 15429 15430 The gzread() function shall read data from the compressed file 15431 referenced by file, which shall have been opened in a read 15432 mode (see gzopen() and gzdopen()). The gzread() function shall 15433 read data from file, and uncompress it into buf. At most, len 15434 bytes of uncompressed data shall be copied to buf. If the file 15435 is not compressed, gzread() shall simply copy data from file 15436 to buf without alteration. 15437 15438 Return Value 15439 15440 On success, gzread() shall return the number of bytes 15441 decompressed into buf. If gzread() returns 0, either the 15442 end-of-file has been reached or an underlying read error has 15443 occurred. Applications should use gzerror() or gzeof() to 15444 determine which occurred. On other errors, gzread() shall 15445 return a value less than 0 and and applications may examine 15446 the cause using gzerror(). 15447 15448 Errors 15449 15450 On error, gzread() shall set the error number associated with 15451 the stream identified by file to indicate the error. 15452 Applications should use gzerror() to access this error value. 15453 15454 Z_ERRNO 15455 15456 An underlying base library function has indicated an error. 15457 The global variable errno may be examined for further 15458 information. 15459 Z_STREAM_END 15460 15461 End of file has been reached on input. 15462 Z_DATA_ERROR 15463 15464 A CRC error occurred when reading data; the file is corrupt. 15465 Z_STREAM_ERROR 15466 15467 The stream is invalid, or is in an invalid state. 15468 Z_NEED_DICT 15469 15470 A dictionary is needed (see inflateSetDictionary()). 15471 Z_MEM_ERROR 15472 15473 Insufficient memory available to decompress. 15474 15475 gzrewind 15476 15477 Name 15478 15479 gzrewind -- reset the file-position indicator on a compressed 15480 file stream 15481 15482 Synopsis 15483 15484 #include 15485 15486 int gzrewind(gzFile file); 15487 15488 Description 15489 15490 The gzrewind() function shall set the starting position for 15491 the next read on compressed file stream file to the beginning 15492 of file. file must be open for reading. 15493 15494 gzrewind() is equivalent to 15495 (int)gzseek(file, 0L, SEEK_SET) 15496 15497 . 15498 15499 Return Value 15500 15501 On success, gzrewind() shall return 0. On error, gzrewind() 15502 shall return -1, and may set the error value for file 15503 accordingly. 15504 15505 Errors 15506 15507 On error, gzrewind() shall return -1, indicating that file is 15508 NULL, or does not represent an open compressed file stream, or 15509 represents a compressed file stream that is open for writing 15510 and is not currently at the beginning of file. 15511 15512 gzseek 15513 15514 Name 15515 15516 gzseek -- reposition a file-position indicator in a compressed 15517 file stream 15518 15519 Synopsis 15520 15521 #include 15522 15523 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 15524 15525 Description 15526 15527 The gzseek() function shall set the file-position indicator 15528 for the compressed file stream file. The file-position 15529 indicator controls where the next read or write operation on 15530 the compressed file stream shall take place. The offset 15531 indicates a byte offset in the uncompressed data. The whence 15532 parameter may be one of: 15533 15534 SEEK_SET 15535 15536 the offset is relative to the start of the uncompressed data. 15537 SEEK_CUR 15538 15539 the offset is relative to the current positition in the 15540 uncompressed data. 15541 15542 Note: The value SEEK_END need not be supported. 15543 15544 If the file is open for writing, the new offset must be 15545 greater than or equal to the current offset. In this case, 15546 gzseek() shall compress a sequence of null bytes to fill the 15547 gap from the previous offset to the new offset. 15548 15549 Return Value 15550 15551 On success, gzseek() shall return the resulting offset in the 15552 file expressed as a byte position in the uncompressed data 15553 stream. On error, gzseek() shall return -1, and may set the 15554 error value for file accordingly. 15555 15556 Errors 15557 15558 On error, gzseek() shall return -1. The following conditions 15559 shall always result in an error: 15560 15561 * file is NULL 15562 * file does not represent an open compressed file stream. 15563 * file refers to a compressed file stream that is open for 15564 writing, and the newly computed offset is less than the 15565 current offset. 15566 * The newly computed offset is less than zero. 15567 * whence is not one of the supported values. 15568 15569 Application Usage (informative) 15570 15571 If file is open for reading, the implementation may still need 15572 to uncompress all of the data up to the new offset. As a 15573 result, gzseek() may be extremely slow in some circumstances. 15574 15575 gzsetparams 15576 15577 Name 15578 15579 gzsetparams -- dynamically set compression parameters 15580 15581 Synopsis 15582 15583 #include 15584 15585 int gzsetparams (gzFile file, int level, int strategy); 15586 15587 Description 15588 15589 The gzsetparams() function shall set the compression level and 15590 compression strategy on the compressed file stream referenced 15591 by file. The compressed file stream shall have been opened in 15592 a write mode. The level and strategy are as defined in 15593 deflateInit2_. If there is any data pending writing, it shall 15594 be flushed before the parameters are updated. 15595 15596 Return Value 15597 15598 On success, the gzsetparams() function shall return Z_OK. 15599 15600 Errors 15601 15602 On error, gzsetparams() shall return one of the following 15603 error indications: 15604 15605 Z_STREAM_ERROR 15606 15607 Invalid parameter, or file not open for writing. 15608 Z_BUF_ERROR 15609 15610 An internal inconsistency was detected while flushing the 15611 previous buffer. 15612 15613 gztell 15614 15615 Name 15616 15617 gztell -- find position on a compressed file stream 15618 15619 Synopsis 15620 15621 #include 15622 15623 z_off_t gztell (gzFile file ); 15624 15625 Description 15626 15627 The gztell() function shall return the starting position for 15628 the next read or write operation on compressed file stream 15629 file. This position represents the number of bytes from the 15630 beginning of file in the uncompressed data. 15631 15632 gztell() is equivalent to 15633 gzseek(file, 0L, SEEK_SET) 15634 15635 . 15636 15637 Return Value 15638 15639 gztell() shall return the current offset in the file expressed 15640 as a byte position in the uncompressed data stream. On error, 15641 gztell() shall return -1, and may set the error value for file 15642 accordingly. 15643 15644 Errors 15645 15646 On error, gztell() shall return -1, indicating that file is 15647 NULL, or does not represent an open compressed file stream. 15648 15649 gzwrite 15650 15651 Name 15652 15653 gzwrite -- write to a compressed file 15654 15655 Synopsis 15656 15657 #include 15658 15659 int gzwrite (gzFile file, voidpc buf, unsigned int len); 15660 15661 Description 15662 15663 The gzwrite() function shall write data to the compressed file 15664 referenced by file, which shall have been opened in a write 15665 mode (see gzopen() and gzdopen()). On entry, buf shall point 15666 to a buffer containing lenbytes of uncompressed data. The 15667 gzwrite() function shall compress this data and write it to 15668 file. The gzwrite() function shall return the number of 15669 uncompressed bytes actually written. 15670 15671 Return Value 15672 15673 On success, gzwrite() shall return the number of uncompressed 15674 bytes actually written to file. On error gzwrite() shall 15675 return a value less than or equal to 0. Applications may 15676 examine the cause using gzerror(). 15677 15678 Errors 15679 15680 On error, gzwrite() shall set the error number associated with 15681 the stream identified by file to indicate the error. 15682 Applications should use gzerror() to access this error value. 15683 15684 Z_ERRNO 15685 15686 An underlying base library function has indicated an error. 15687 The global variable errno may be examined for further 15688 information. 15689 Z_STREAM_ERROR 15690 15691 The stream is invalid, is not open for writing, or is in an 15692 invalid state. 15693 Z_BUF_ERROR 15694 15695 no compression progress is possible (see deflate()). 15696 Z_MEM_ERROR 15697 15698 Insufficient memory available to compress. 15699 15700 inflate 15701 15702 Name 15703 15704 inflate -- decompress data 15705 15706 Synopsis 15707 15708 #include 15709 15710 int inflate(z_streamp stream, int flush); 15711 15712 Description 15713 15714 The inflate() function shall attempt to decompress data until 15715 either the input buffer is empty or the output buffer is full. 15716 The stream references a z_stream structure. Before the first 15717 call to inflate(), this structure should have been initialized 15718 by a call to inflateInit2_(). 15719 15720 Note: inflateInit2_() is only in the binary standard; 15721 source level applications should initialize stream via a 15722 call to inflateInit() or inflateInit2(). 15723 15724 In addition, the stream input and output buffers should have 15725 been initialized as follows: 15726 15727 next_in 15728 15729 should point to the data to be decompressed. 15730 avail_in 15731 15732 should contain the number of bytes of data in the buffer 15733 referenced by next_in. 15734 next_out 15735 15736 should point to a buffer where decompressed data may be 15737 placed. 15738 avail_out 15739 15740 should contain the size in bytes of the buffer referenced by 15741 next_out 15742 15743 The inflate() function shall perform one or both of the 15744 following actions: 15745 15746 1. Decompress input data from next_in and update next_in, 15747 avail_in and total_in to reflect the data that has been 15748 decompressed. 15749 2. Fill the output buffer referenced by next_out, and update 15750 next_out, avail_out, and total_out to reflect the 15751 decompressed data that has been placed there. If flush is 15752 not Z_NO_FLUSH, and avail_out indicates that there is 15753 still space in output buffer, this action shall always 15754 occur (see below for further details). 15755 15756 The inflate() function shall return when either avail_in 15757 reaches zero (indicating that all the input data has been 15758 compressed), or avail_out reaches zero (indicating that the 15759 output buffer is full). 15760 15761 On success, the inflate() function shall set the adler field 15762 of the stream to the Adler-32 checksum of all the input data 15763 compressed so far (represented by total_in). 15764 15765 Flush Operation 15766 15767 The parameter flush determines when uncompressed bytes are 15768 added to the output buffer in next_out. If flush is 15769 Z_NO_FLUSH, inflate() may return with some data pending 15770 output, and not yet added to the output buffer. 15771 15772 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 15773 output to next_out, and update next_out and avail_out 15774 accordingly. 15775 15776 If flush is set to Z_BLOCK, inflate() shall stop adding data 15777 to the output buffer if and when the next compressed block 15778 boundary is reached (see RFC 1951: DEFLATE Compressed Data 15779 Format Specification). 15780 15781 If flush is set to Z_FINISH, all of the compressed input shall 15782 be decompressed and added to the output. If there is 15783 insufficient output space (i.e. the compressed input data 15784 uncompresses to more than avail_out bytes), then inflate() 15785 shall fail and return Z_BUF_ERROR. 15786 15787 Return Value 15788 15789 On success, inflate() shall return Z_OK if decompression 15790 progress has been made, or Z_STREAM_END if all of the input 15791 data has been decompressed and there was sufficient space in 15792 the output buffer to store the uncompressed result. On error, 15793 inflate() shall return a value to indicate the error. 15794 15795 Note: If inflate() returns Z_OK and has set avail_out to 15796 zero, the function should be called again with the same 15797 value for flush, and with updated next_out and avail_out 15798 until inflate() returns with either Z_OK or Z_STREAM_END 15799 and a non-zero avail_out. 15800 15801 On success, inflate() shall set the adler to the Adler-32 15802 checksum of the output produced so far (i.e. total_out bytes). 15803 15804 Errors 15805 15806 On error, inflate() shall return a value as described below, 15807 and may set the msg field of stream to point to a string 15808 describing the error: 15809 15810 Z_BUF_ERROR 15811 15812 No progress is possible; either avail_in or avail_out was 15813 zero. 15814 Z_MEM_ERROR 15815 15816 Insufficient memory. 15817 Z_STREAM_ERROR 15818 15819 The state (as represented in stream) is inconsistent, or 15820 stream was NULL. 15821 Z_NEED_DICT 15822 15823 A preset dictionary is required. The adler field shall be set 15824 to the Adler-32 checksum of the dictionary chosen by the 15825 compressor. 15826 15827 inflateEnd 15828 15829 Name 15830 15831 inflateEnd -- free decompression stream state 15832 15833 Synopsis 15834 15835 #include 15836 15837 int inflateEnd(z_streamp stream); 15838 15839 Description 15840 15841 The inflateEnd() function shall free all allocated state 15842 information referenced by stream. All pending output is 15843 discarded, and unprocessed input is ignored. 15844 15845 Return Value 15846 15847 On success, inflateEnd() shall return Z_OK. Otherwise it shall 15848 return Z_STREAM_ERROR to indicate the error. 15849 15850 Errors 15851 15852 On error, inflateEnd() shall return Z_STREAM_ERROR. The 15853 following conditions shall be treated as an error: 15854 15855 * The state in stream is inconsistent. 15856 * stream is NULL. 15857 * The zfree function pointer is NULL. 15858 15859 inflateInit2_ 15860 15861 Name 15862 15863 inflateInit2_ -- initialize decompression system 15864 15865 Synopsis 15866 15867 #include 15868 15869 int inflateInit2_ (z_streamp strm, int windowBits, char * 15870 version, int stream_size); 15871 15872 Description 15873 15874 The inflateInit2_() function shall initialize the 15875 decompression system. On entry, strm shall refer to a user 15876 supplied z_stream object (a z_stream_s structure). The 15877 following fields shall be set on entry: 15878 15879 zalloc 15880 15881 a pointer to an alloc_func function, used to allocate state 15882 information. If this is NULL, a default allocation function 15883 will be used. 15884 zfree 15885 15886 a pointer to a free_func function, used to free memory 15887 allocated by the zalloc function. If this is NULL a default 15888 free function will be used. 15889 opaque 15890 15891 If alloc_func is not NULL, opaque is a user supplied pointer 15892 to data that will be passed to the alloc_func and free_func 15893 functions. 15894 15895 If the version requested is not compatible with the version 15896 implemented, or if the size of the z_stream_s structure 15897 provided in stream_size does not match the size in the library 15898 implementation, inflateInit2_() shall fail, and return 15899 Z_VERSION_ERROR. 15900 15901 The windowBits parameter shall be a base 2 logarithm of the 15902 maximum window size to use, and shall be a value between 8 and 15903 15. If the input data was compressed with a larger window 15904 size, subsequent attempts to decompress this data will fail 15905 with Z_DATA_ERROR, rather than try to allocate a larger 15906 window. 15907 15908 The inflateInit2_() function is not in the source standard; it 15909 is only in the binary standard. Source applications should use 15910 the inflateInit2() macro. 15911 15912 Return Value 15913 15914 On success, the inflateInit2_() function shall return Z_OK. 15915 Otherwise, inflateInit2_() shall return a value as described 15916 below to indicate the error. 15917 15918 Errors 15919 15920 On error, inflateInit2_() shall return one of the following 15921 error indicators: 15922 15923 Z_STREAM_ERROR 15924 15925 Invalid parameter. 15926 Z_MEM_ERROR 15927 15928 Insufficient memory available. 15929 Z_VERSION_ERROR 15930 15931 The version requested is not compatible with the library 15932 version, or the z_stream size differs from that used by the 15933 library. 15934 15935 In addition, the msg field of the strm may be set to an error 15936 message. 15937 15938 inflateInit_ 15939 15940 Name 15941 15942 inflateInit_ -- initialize decompression system 15943 15944 Synopsis 15945 15946 #include 15947 15948 int inflateInit_(z_streamp stream, const char * version, int 15949 stream_size); 15950 15951 Description 15952 15953 The inflateInit_() function shall initialize the decompression 15954 system. On entry, stream shall refer to a user supplied 15955 z_stream object (a z_stream_s structure). The following fields 15956 shall be set on entry: 15957 15958 zalloc 15959 15960 a pointer to an alloc_func function, used to allocate state 15961 information. If this is NULL, a default allocation function 15962 will be used. 15963 zfree 15964 15965 a pointer to a free_func function, used to free memory 15966 allocated by the zalloc function. If this is NULL a default 15967 free function will be used. 15968 opaque 15969 15970 If alloc_func is not NULL, opaque is a user supplied pointer 15971 to data that will be passed to the alloc_func and free_func 15972 functions. 15973 15974 If the version requested is not compatible with the version 15975 implemented, or if the size of the z_stream_s structure 15976 provided in stream_size does not match the size in the library 15977 implementation, inflateInit_() shall fail, and return 15978 Z_VERSION_ERROR. 15979 15980 The inflateInit_() function is not in the source standard; it 15981 is only in the binary standard. Source applications should use 15982 the inflateInit() macro. 15983 15984 The inflateInit_() shall be equivalent to 15985 inflateInit2_(strm, DEF_WBITS, version, stream_size); 15986 15987 Return Value 15988 15989 On success, the inflateInit_() function shall return Z_OK. 15990 Otherwise, inflateInit_() shall return a value as described 15991 below to indicate the error. 15992 15993 Errors 15994 15995 On error, inflateInit_() shall return one of the following 15996 error indicators: 15997 15998 Z_STREAM_ERROR 15999 16000 Invalid parameter. 16001 Z_MEM_ERROR 16002 16003 Insufficient memory available. 16004 Z_VERSION_ERROR 16005 16006 The version requested is not compatible with the library 16007 version, or the z_stream size differs from that used by the 16008 library. 16009 16010 In addition, the msg field of the strm may be set to an error 16011 message. 16012 16013 inflateReset 16014 16015 Name 16016 16017 inflateReset -- reset decompression stream state 16018 16019 Synopsis 16020 16021 #include 16022 16023 int inflateReset(z_streamp stream); 16024 16025 Description 16026 16027 The inflateReset() function shall reset all state associated 16028 with stream. All pending output shall be discarded, and the 16029 counts of processed bytes (total_in and total_out) shall be 16030 reset to zero. 16031 16032 Return Value 16033 16034 On success, inflateReset() shall return Z_OK. Otherwise it 16035 shall return Z_STREAM_ERROR to indicate the error. 16036 16037 Errors 16038 16039 On error, inflateReset() shall return Z_STREAM_ERROR. The 16040 following conditions shall be treated as an error: 16041 16042 * The state in stream is inconsistent or inappropriate. 16043 * stream is NULL. 16044 16045 inflateSetDictionary 16046 16047 Name 16048 16049 inflateSetDictionary -- initialize decompression dictionary 16050 16051 Synopsis 16052 16053 #include 16054 16055 int inflateSetDictionary(z_streamp stream, const Bytef * 16056 dictionary, uInt dictlen); 16057 16058 Description 16059 16060 The inflateSetDictionary() function shall initialize the 16061 decompression dictionary associated with stream using the 16062 dictlen bytes referenced by dictionary. 16063 16064 The inflateSetDictionary() function should be called 16065 immediately after a call to inflate() has failed with return 16066 value Z_NEED_DICT. The dictionary must have the same Adler-32 16067 checksum as the dictionary used for the compression (see 16068 deflateSetDictionary()). 16069 16070 stream shall reference an initialized decompression stream, 16071 with total_in zero (i.e. no data has been decompressed since 16072 the stream was initialized). 16073 16074 Return Value 16075 16076 On success, inflateSetDictionary() shall return Z_OK. 16077 Otherwise it shall return a value as indicated below. 16078 16079 Errors 16080 16081 On error, inflateSetDictionary() shall return a value as 16082 described below: 16083 16084 Z_STREAM_ERROR 16085 16086 The state in stream is inconsistent, or stream was NULL. 16087 Z_DATA_ERROR 16088 16089 The Adler-32 checksum of the supplied dictionary does not 16090 match that used for the compression. 16091 16092 Application Usage (informative) 16093 16094 The application should provide a dictionary consisting of 16095 strings {{{ed note: do we really mean "strings"? Null 16096 terminated?}}} that are likely to be encountered in the data 16097 to be compressed. The application should ensure that the 16098 dictionary is sorted such that the most commonly used strings 16099 occur at the end of the dictionary. 16100 16101 The use of a dictionary is optional; however if the data to be 16102 compressed is relatively short and has a predictable 16103 structure, the use of a dictionary can substantially improve 16104 the compression ratio. 16105 16106 inflateSync 16107 16108 Name 16109 16110 inflateSync -- advance compression stream to next sync point 16111 16112 Synopsis 16113 16114 #include 16115 16116 int inflateSync(z_streamp stream); 16117 16118 Description 16119 16120 The inflateSync() function shall advance through the 16121 compressed data in stream, skipping any invalid compressed 16122 data, until the next full flush point is reached, or all input 16123 is exhausted. See the description for deflate() with flush 16124 level Z_FULL_FLUSH. No output is placed in next_out. 16125 16126 Return Value 16127 16128 On success, inflateSync() shall return Z_OK, and update the 16129 next_in,, avail_in, and, total_in fields of stream to reflect 16130 the number of bytes of compressed data that have been skipped. 16131 Otherwise, inflateSync() shall return a value as described 16132 below to indicate the error. 16133 16134 Errors 16135 16136 On error, inflateSync() shall return a value as described 16137 below: 16138 16139 Z_STREAM_ERROR 16140 16141 The state (as represented in stream) is inconsistent, or 16142 stream was NULL. 16143 Z_BUF_ERROR 16144 16145 There is no data available to skip over. 16146 Z_DATA_ERROR 16147 16148 No sync point was found. 16149 16150 inflateSyncPoint 16151 16152 Name 16153 16154 inflateSyncPoint -- test for synchronization point 16155 16156 Synopsis 16157 16158 #include 16159 16160 int inflateSyncPoint(z_streamp stream); 16161 16162 Description 16163 16164 The inflateSyncPoint() function shall return a non-zero calue 16165 if the compressed data stream referenced by stream is at a 16166 synchronization point. 16167 16168 Return Value 16169 16170 If the compressed data in stream is at a synchronization point 16171 (see deflate() with a flush level of Z_SYNC_FLUSH or 16172 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 16173 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 16174 valid, inflateSyncPoint() shall return 0. If stream is 16175 invalid, or in an invalid state, inflateSyncPoint() shall 16176 return Z_STREAM_ERROR to indicate the error. 16177 16178 Errors 16179 16180 On error, inflateSyncPoint() shall return a value as described 16181 below: 16182 16183 Z_STREAM_ERROR 16184 16185 The state (as represented in stream) is inconsistent, or 16186 stream was NULL. 16187 16188 uncompress 16189 16190 Name 16191 16192 uncompress -- uncompress data 16193 16194 Synopsis 16195 16196 #include 16197 16198 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 16199 source, uLong sourceLen); 16200 16201 Description 16202 16203 The uncompress() function shall attempt to uncompress 16204 sourceLen bytes of data in the buffer source, placing the 16205 result in the buffer dest. 16206 16207 On entry, destLen should point to a value describing the size 16208 of the dest buffer. The application should ensure that this 16209 value is large enough to hold the entire uncompressed data. 16210 16211 Note: The LSB does not describe any mechanism by which a 16212 compressor can communicate the size required to the 16213 uncompressor. 16214 16215 On successful exit, the variable referenced by destLen shall 16216 be updated to hold the length of uncompressed data in dest. 16217 16218 Return Value 16219 16220 On success, uncompress() shall return Z_OK. Otherwise, 16221 uncompress() shall return a value to indicate the error. 16222 16223 Errors 16224 16225 On error, uncompress() shall return a value as described 16226 below: 16227 16228 Z_BUF_ERROR 16229 16230 The buffer dest was not large enough to hold the uncompressed 16231 data. 16232 Z_MEM_ERROR 16233 16234 Insufficient memory. 16235 Z_DATA_ERROR 16236 16237 The compressed data (referenced by source) was corrupted. 16238 16239 zError 16240 16241 Name 16242 16243 zError -- translate error number to string 16244 16245 Synopsis 16246 16247 #include 16248 16249 const char * zError(int err); 16250 16251 Description 16252 16253 The zError() function shall return the string identifying the 16254 error associated with err. This allows for conversion from 16255 error code to string for functions such as compress() and 16256 uncompress(), that do not always set the string version of an 16257 error. 16258 16259 Return Value 16260 16261 The zError() function shall return a the string identifying 16262 the error associated with err, or NULL if err is not a valid 16263 error code. 16264 16265 It is unspecified if the string returned is determined by the 16266 setting of the LC_MESSAGES category in the current locale. 16267 16268 Errors 16269 16270 None defined. 16271 16272 zlibVersion 16273 16274 Name 16275 16276 zlibVersion -- discover library version at run time 16277 16278 Synopsis 16279 16280 #include 16281 16282 const char * zlibVersion (void); 16283 16284 Description 16285 16286 The zlibVersion() function shall return the string identifying 16287 the interface version at the time the library was built. 16288 16289 Applications should compare the value returned from 16290 zlibVersion() with the macro constant ZLIB_VERSION for 16291 compatibility. 16292 16293 Return Value 16294 16295 The zlibVersion() function shall return a the string 16296 identifying the version of the library currently implemented. 16297 16298 Errors 16299 16300 None defined. 16301 _________________________________________________________ 16302 16303 10.5. Interfaces for libncurses 16304 16305 Table 10-3 defines the library name and shared object name for 16306 the libncurses library 16307 16308 Table 10-3. libncurses Definition 16309 Library: libncurses 16310 SONAME: libncurses.so.5 16311 16312 The Parameters or return value of the following interface have 16313 had the const qualifier added as shown here. 16314 extern const char *keyname (int); 16315 extern int mvscanw (int, int, const char *, ...); 16316 extern int mvwscanw (WINDOW *, int, int, const char *, ...); 16317 extern SCREEN *newterm (const char *, FILE *, FILE *); 16318 extern int scanw (const char *, ...); 16319 extern int vwscanw (WINDOW *, const char *, va_list); 16320 extern int vw_scanw (WINDOW *, const char *, va_list); 16321 extern int wscanw (WINDOW *, const char *, ...); 16322 16323 The behavior of the interfaces in this library is specified by 16324 the following specifications: 16325 16326 [SUS-CURSES] X/Open Curses 16327 _________________________________________________________ 16328 16329 10.5.1. Curses 16330 _________________________________________________________ 16331 16332 10.5.1.1. Interfaces for Curses 16333 16334 An LSB conforming implementation shall provide the generic 16335 functions for Curses specified in Table 10-4, with the full 16336 mandatory functionality as described in the referenced 16337 underlying specification. 16338 16339 Table 10-4. libncurses - Curses Function Interfaces 16340 addch [SUS-CURSES] addchnstr [SUS-CURSES] addchstr 16341 [SUS-CURSES] addnstr [SUS-CURSES] 16342 addstr [SUS-CURSES] attr_get [SUS-CURSES] attr_off 16343 [SUS-CURSES] attr_on [SUS-CURSES] 16344 attr_set [SUS-CURSES] attroff [SUS-CURSES] attron [SUS-CURSES] 16345 attrset [SUS-CURSES] 16346 baudrate [SUS-CURSES] beep [SUS-CURSES] bkgd [SUS-CURSES] 16347 bkgdset [SUS-CURSES] 16348 border [SUS-CURSES] box [SUS-CURSES] can_change_color 16349 [SUS-CURSES] cbreak [SUS-CURSES] 16350 chgat [SUS-CURSES] clear [SUS-CURSES] clearok [SUS-CURSES] 16351 clrtobot [SUS-CURSES] 16352 clrtoeol [SUS-CURSES] color_content [SUS-CURSES] color_set 16353 [SUS-CURSES] copywin [SUS-CURSES] 16354 curs_set [SUS-CURSES] def_prog_mode [SUS-CURSES] 16355 def_shell_mode [SUS-CURSES] del_curterm [SUS-CURSES] 16356 delay_output [SUS-CURSES] delch [SUS-CURSES] deleteln 16357 [SUS-CURSES] delscreen [SUS-CURSES] 16358 delwin [SUS-CURSES] derwin [SUS-CURSES] doupdate [SUS-CURSES] 16359 dupwin [SUS-CURSES] 16360 echo [SUS-CURSES] echochar [SUS-CURSES] endwin [SUS-CURSES] 16361 erase [SUS-CURSES] 16362 erasechar [SUS-CURSES] filter [SUS-CURSES] flash [SUS-CURSES] 16363 flushinp [SUS-CURSES] 16364 getbkgd [SUS-CURSES] getch [SUS-CURSES] getnstr [SUS-CURSES] 16365 getstr [SUS-CURSES] 16366 getwin [SUS-CURSES] halfdelay [SUS-CURSES] has_colors 16367 [SUS-CURSES] has_ic [SUS-CURSES] 16368 has_il [SUS-CURSES] hline [SUS-CURSES] idcok [SUS-CURSES] 16369 idlok [SUS-CURSES] 16370 immedok [SUS-CURSES] inch [SUS-CURSES] inchnstr [SUS-CURSES] 16371 inchstr [SUS-CURSES] 16372 init_color [SUS-CURSES] init_pair [SUS-CURSES] initscr 16373 [SUS-CURSES] innstr [SUS-CURSES] 16374 insch [SUS-CURSES] insdelln [SUS-CURSES] insertln [SUS-CURSES] 16375 insnstr [SUS-CURSES] 16376 insstr [SUS-CURSES] instr [SUS-CURSES] intrflush [SUS-CURSES] 16377 is_linetouched [SUS-CURSES] 16378 is_wintouched [SUS-CURSES] isendwin [SUS-CURSES] keyname 16379 [SUS-CURSES] keypad [SUS-CURSES] 16380 killchar [SUS-CURSES] leaveok [SUS-CURSES] longname 16381 [SUS-CURSES] meta [SUS-CURSES] 16382 move [SUS-CURSES] mvaddch [SUS-CURSES] mvaddchnstr 16383 [SUS-CURSES] mvaddchstr [SUS-CURSES] 16384 mvaddnstr [SUS-CURSES] mvaddstr [SUS-CURSES] mvchgat 16385 [SUS-CURSES] mvcur [SUS-CURSES] 16386 mvdelch [SUS-CURSES] mvderwin [SUS-CURSES] mvgetch 16387 [SUS-CURSES] mvgetnstr [SUS-CURSES] 16388 mvgetstr [SUS-CURSES] mvhline [SUS-CURSES] mvinch [SUS-CURSES] 16389 mvinchnstr [SUS-CURSES] 16390 mvinchstr [SUS-CURSES] mvinnstr [SUS-CURSES] mvinsch 16391 [SUS-CURSES] mvinsnstr [SUS-CURSES] 16392 mvinsstr [SUS-CURSES] mvinstr [SUS-CURSES] mvprintw 16393 [SUS-CURSES] mvscanw [SUS-CURSES] 16394 mvvline [SUS-CURSES] mvwaddch [SUS-CURSES] mvwaddchnstr 16395 [SUS-CURSES] mvwaddchstr [SUS-CURSES] 16396 mvwaddnstr [SUS-CURSES] mvwaddstr [SUS-CURSES] mvwchgat 16397 [SUS-CURSES] mvwdelch [SUS-CURSES] 16398 mvwgetch [SUS-CURSES] mvwgetnstr [SUS-CURSES] mvwgetstr 16399 [SUS-CURSES] mvwhline [SUS-CURSES] 16400 mvwin [SUS-CURSES] mvwinch [SUS-CURSES] mvwinchnstr 16401 [SUS-CURSES] mvwinchstr [SUS-CURSES] 16402 mvwinnstr [SUS-CURSES] mvwinsch [SUS-CURSES] mvwinsnstr 16403 [SUS-CURSES] mvwinsstr [SUS-CURSES] 16404 mvwinstr [SUS-CURSES] mvwprintw [SUS-CURSES] mvwscanw 16405 [SUS-CURSES] mvwvline [SUS-CURSES] 16406 napms [SUS-CURSES] newpad [SUS-CURSES] newterm [SUS-CURSES] 16407 newwin [SUS-CURSES] 16408 nl [SUS-CURSES] nocbreak [SUS-CURSES] nodelay [SUS-CURSES] 16409 noecho [SUS-CURSES] 16410 nonl [SUS-CURSES] noqiflush [SUS-CURSES] noraw [SUS-CURSES] 16411 notimeout [SUS-CURSES] 16412 overlay [SUS-CURSES] overwrite [SUS-CURSES] pair_content 16413 [SUS-CURSES] pechochar [SUS-CURSES] 16414 pnoutrefresh [SUS-CURSES] prefresh [SUS-CURSES] printw 16415 [SUS-CURSES] putp [SUS-CURSES] 16416 putwin [SUS-CURSES] qiflush [SUS-CURSES] raw [SUS-CURSES] 16417 redrawwin [SUS-CURSES] 16418 refresh [SUS-CURSES] reset_prog_mode [SUS-CURSES] 16419 reset_shell_mode [SUS-CURSES] resetty [SUS-CURSES] 16420 restartterm [SUS-CURSES] ripoffline [SUS-CURSES] savetty 16421 [SUS-CURSES] scanw [SUS-CURSES] 16422 scr_dump [SUS-CURSES] scr_init [SUS-CURSES] scr_restore 16423 [SUS-CURSES] scr_set [SUS-CURSES] 16424 scrl [SUS-CURSES] scroll [SUS-CURSES] scrollok [SUS-CURSES] 16425 set_curterm [SUS-CURSES] 16426 set_term [SUS-CURSES] setscrreg [SUS-CURSES] setupterm 16427 [SUS-CURSES] slk_attr_set [SUS-CURSES] 16428 slk_attroff [SUS-CURSES] slk_attron [SUS-CURSES] slk_attrset 16429 [SUS-CURSES] slk_clear [SUS-CURSES] 16430 slk_color [SUS-CURSES] slk_init [SUS-CURSES] slk_label 16431 [SUS-CURSES] slk_noutrefresh [SUS-CURSES] 16432 slk_refresh [SUS-CURSES] slk_restore [SUS-CURSES] slk_set 16433 [SUS-CURSES] slk_touch [SUS-CURSES] 16434 standend [SUS-CURSES] standout [SUS-CURSES] start_color 16435 [SUS-CURSES] subpad [SUS-CURSES] 16436 subwin [SUS-CURSES] syncok [SUS-CURSES] termattrs [SUS-CURSES] 16437 termname [SUS-CURSES] 16438 tgetent [SUS-CURSES] tgetflag [SUS-CURSES] tgetnum 16439 [SUS-CURSES] tgetstr [SUS-CURSES] 16440 tgoto [SUS-CURSES] tigetflag [SUS-CURSES] tigetnum 16441 [SUS-CURSES] tigetstr [SUS-CURSES] 16442 timeout [SUS-CURSES] touchline [SUS-CURSES] touchwin 16443 [SUS-CURSES] tparm [SUS-CURSES] 16444 tputs [SUS-CURSES] typeahead [SUS-CURSES] unctrl [SUS-CURSES] 16445 ungetch [SUS-CURSES] 16446 untouchwin [SUS-CURSES] use_env [SUS-CURSES] vidattr 16447 [SUS-CURSES] vidputs [SUS-CURSES] 16448 vline [SUS-CURSES] vw_printw [SUS-CURSES] vw_scanw 16449 [SUS-CURSES] vwprintw [SUS-CURSES] 16450 vwscanw [SUS-CURSES] waddch [SUS-CURSES] waddchnstr 16451 [SUS-CURSES] waddchstr [SUS-CURSES] 16452 waddnstr [SUS-CURSES] waddstr [SUS-CURSES] wattr_get 16453 [SUS-CURSES] wattr_off [SUS-CURSES] 16454 wattr_on [SUS-CURSES] wattr_set [SUS-CURSES] wattroff 16455 [SUS-CURSES] wattron [SUS-CURSES] 16456 wattrset [SUS-CURSES] wbkgd [SUS-CURSES] wbkgdset [SUS-CURSES] 16457 wborder [SUS-CURSES] 16458 wchgat [SUS-CURSES] wclear [SUS-CURSES] wclrtobot [SUS-CURSES] 16459 wclrtoeol [SUS-CURSES] 16460 wcolor_set [SUS-CURSES] wcursyncup [SUS-CURSES] wdelch 16461 [SUS-CURSES] wdeleteln [SUS-CURSES] 16462 wechochar [SUS-CURSES] werase [SUS-CURSES] wgetch [SUS-CURSES] 16463 wgetnstr [SUS-CURSES] 16464 wgetstr [SUS-CURSES] whline [SUS-CURSES] winch [SUS-CURSES] 16465 winchnstr [SUS-CURSES] 16466 winchstr [SUS-CURSES] winnstr [SUS-CURSES] winsch [SUS-CURSES] 16467 winsdelln [SUS-CURSES] 16468 winsertln [SUS-CURSES] winsnstr [SUS-CURSES] winsstr 16469 [SUS-CURSES] winstr [SUS-CURSES] 16470 wmove [SUS-CURSES] wnoutrefresh [SUS-CURSES] wprintw 16471 [SUS-CURSES] wredrawln [SUS-CURSES] 16472 wrefresh [SUS-CURSES] wscanw [SUS-CURSES] wscrl [SUS-CURSES] 16473 wsetscrreg [SUS-CURSES] 16474 wstandend [SUS-CURSES] wstandout [SUS-CURSES] wsyncdown 16475 [SUS-CURSES] wsyncup [SUS-CURSES] 16476 wtimeout [SUS-CURSES] wtouchln [SUS-CURSES] wvline 16477 [SUS-CURSES] 16478 16479 An LSB conforming implementation shall provide the generic 16480 data interfaces for Curses specified in Table 10-5, with the 16481 full mandatory functionality as described in the referenced 16482 underlying specification. 16483 16484 Table 10-5. libncurses - Curses Data Interfaces 16485 COLORS [SUS-CURSES] COLOR_PAIRS [SUS-CURSES] COLS [SUS-CURSES] 16486 LINES [SUS-CURSES] 16487 acs_map [SUS-CURSES] cur_term [SUS-CURSES] curscr [SUS-CURSES] 16488 stdscr [SUS-CURSES] 16489 _________________________________________________________ 16490 16491 10.6. Data Definitions for libncurses 16492 16493 This section defines global identifiers and their values that 16494 are associated with interfaces contained in libncurses. These 16495 definitions are organized into groups that correspond to 16496 system headers. This convention is used as a convenience for 16497 the reader, and does not imply the existence of these headers, 16498 or their content. Where an interface is defined as requiring a 16499 particular system header file all of the data definitions for 16500 that system header file presented here shall be in effect. 16501 16502 This section gives data definitions to promote binary 16503 application portability, not to repeat source interface 16504 definitions available elsewhere. System providers and 16505 application developers should use this ABI to supplement - not 16506 to replace - source interface definition specifications. 16507 16508 This specification uses the ISO C (1999) C Language as the 16509 reference programming language, and data definitions are 16510 specified in ISO C format. The C language is used here as a 16511 convenient notation. Using a C language description of these 16512 data objects does not preclude their use by other programming 16513 languages. 16514 _________________________________________________________ 16515 16516 10.6.1. curses.h 16517 16518 #define ERR (-1) 16519 #define OK (0) 16520 #define ACS_RARROW (acs_map['+']) 16521 #define ACS_LARROW (acs_map[',']) 16522 #define ACS_UARROW (acs_map['-']) 16523 #define ACS_DARROW (acs_map['.']) 16524 #define ACS_BLOCK (acs_map['0']) 16525 #define ACS_CKBOARD (acs_map['a']) 16526 #define ACS_DEGREE (acs_map['f']) 16527 #define ACS_PLMINUS (acs_map['g']) 16528 #define ACS_BOARD (acs_map['h']) 16529 #define ACS_LANTERN (acs_map['i']) 16530 #define ACS_LRCORNER (acs_map['j']) 16531 #define ACS_URCORNER (acs_map['k']) 16532 #define ACS_ULCORNER (acs_map['l']) 16533 #define ACS_LLCORNER (acs_map['m']) 16534 #define ACS_PLUS (acs_map['n']) 16535 #define ACS_S1 (acs_map['o']) 16536 #define ACS_HLINE (acs_map['q']) 16537 #define ACS_S9 (acs_map['s']) 16538 #define ACS_LTEE (acs_map['t']) 16539 #define ACS_RTEE (acs_map['u']) 16540 #define ACS_BTEE (acs_map['v']) 16541 #define ACS_TTEE (acs_map['w']) 16542 #define ACS_VLINE (acs_map['x']) 16543 #define ACS_DIAMOND (acs_map['`']) 16544 #define ACS_BULLET (acs_map['~']) 16545 #define getmaxyx(win,y,x) \ 16546 (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 16547 #define getbegyx(win,y,x) \ 16548 (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 16549 #define getyx(win,y,x) \ 16550 (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 16551 #define getparyx(win,y,x) \ 16552 (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 16553 16554 #define WA_ALTCHARSET A_ALTCHARSET 16555 #define WA_ATTRIBUTES A_ATTRIBUTES 16556 #define WA_BLINK A_BLINK 16557 #define WA_BOLD A_BOLD 16558 #define WA_DIM A_DIM 16559 #define WA_HORIZONTAL A_HORIZONTAL 16560 #define WA_INVIS A_INVIS 16561 #define WA_LEFT A_LEFT 16562 #define WA_LOW A_LOW 16563 #define WA_NORMAL A_NORMAL 16564 #define WA_PROTECT A_PROTECT 16565 #define WA_REVERSE A_REVERSE 16566 #define WA_RIGHT A_RIGHT 16567 #define WA_STANDOUT A_STANDOUT 16568 #define WA_TOP A_TOP 16569 #define WA_UNDERLINE A_UNDERLINE 16570 #define WA_VERTICAL A_VERTICAL 16571 #define A_REVERSE NCURSES_BITS(1UL,10) 16572 16573 #define COLOR_BLACK 0 16574 #define COLOR_RED 1 16575 #define COLOR_GREEN 2 16576 #define COLOR_YELLOW 3 16577 #define COLOR_BLUE 4 16578 #define COLOR_MAGENTA 5 16579 #define COLOR_CYAN 6 16580 #define COLOR_WHITE 7 16581 16582 #define _SUBWIN 0x01 16583 #define _ENDLINE 0x02 16584 #define _FULLWIN 0x04 16585 #define _ISPAD 0x10 16586 #define _HASMOVED 0x20 16587 16588 typedef unsigned char bool; 16589 16590 typedef unsigned long int chtype; 16591 typedef struct screen SCREEN; 16592 typedef struct _win_st WINDOW; 16593 typedef chtype attr_t; 16594 typedef struct { 16595 attr_t attr; 16596 wchar_t chars[5]; 16597 } cchar_t; 16598 struct pdat { 16599 short _pad_y; 16600 short _pad_x; 16601 short _pad_top; 16602 short _pad_left; 16603 short _pad_bottom; 16604 short _pad_right; 16605 }; 16606 16607 struct _win_st { 16608 short _cury; 16609 short _curx; 16610 short _maxy; 16611 short _maxx; 16612 short _begy; 16613 short _begx; 16614 short _flags; 16615 attr_t _attrs; 16616 chtype _bkgd; 16617 bool _notimeout; 16618 bool _clear; 16619 bool _leaveok; 16620 bool _scroll; 16621 bool _idlok; 16622 bool _idcok; 16623 bool _immed; 16624 bool _sync; 16625 bool _use_keypad; 16626 int _delay; 16627 struct ldat *_line; 16628 short _regtop; 16629 short _regbottom; 16630 int _parx; 16631 int _pary; 16632 WINDOW *_parent; 16633 struct pdat _pad; 16634 short _yoffset; 16635 cchar_t _bkgrnd; 16636 }; 16637 16638 #define KEY_CODE_YES 0400 16639 #define KEY_BREAK 0401 16640 #define KEY_MIN 0401 16641 #define KEY_DOWN 0402 16642 #define KEY_UP 0403 16643 #define KEY_LEFT 0404 16644 #define KEY_RIGHT 0405 16645 #define KEY_HOME 0406 16646 #define KEY_BACKSPACE 0407 16647 #define KEY_F0 0410 16648 #define KEY_DL 0510 16649 #define KEY_IL 0511 16650 #define KEY_DC 0512 16651 #define KEY_IC 0513 16652 #define KEY_EIC 0514 16653 #define KEY_CLEAR 0515 16654 #define KEY_EOS 0516 16655 #define KEY_EOL 0517 16656 #define KEY_SF 0520 16657 #define KEY_SR 0521 16658 #define KEY_NPAGE 0522 16659 #define KEY_PPAGE 0523 16660 #define KEY_STAB 0524 16661 #define KEY_CTAB 0525 16662 #define KEY_CATAB 0526 16663 #define KEY_ENTER 0527 16664 #define KEY_SRESET 0530 16665 #define KEY_RESET 0531 16666 #define KEY_PRINT 0532 16667 #define KEY_LL 0533 16668 #define KEY_A1 0534 16669 #define KEY_A3 0535 16670 #define KEY_B2 0536 16671 #define KEY_C1 0537 16672 #define KEY_C3 0540 16673 #define KEY_BTAB 0541 16674 #define KEY_BEG 0542 16675 #define KEY_CANCEL 0543 16676 #define KEY_CLOSE 0544 16677 #define KEY_COMMAND 0545 16678 #define KEY_COPY 0546 16679 #define KEY_CREATE 0547 16680 #define KEY_END 0550 16681 #define KEY_EXIT 0551 16682 #define KEY_FIND 0552 16683 #define KEY_HELP 0553 16684 #define KEY_MARK 0554 16685 #define KEY_MESSAGE 0555 16686 #define KEY_MOVE 0556 16687 #define KEY_NEXT 0557 16688 #define KEY_OPEN 0560 16689 #define KEY_OPTIONS 0561 16690 #define KEY_PREVIOUS 0562 16691 #define KEY_REDO 0563 16692 #define KEY_REFERENCE 0564 16693 #define KEY_REFRESH 0565 16694 #define KEY_REPLACE 0566 16695 #define KEY_RESTART 0567 16696 #define KEY_RESUME 0570 16697 #define KEY_SAVE 0571 16698 #define KEY_SBEG 0572 16699 #define KEY_SCANCEL 0573 16700 #define KEY_SCOMMAND 0574 16701 #define KEY_SCOPY 0575 16702 #define KEY_SCREATE 0576 16703 #define KEY_SDC 0577 16704 #define KEY_SDL 0600 16705 #define KEY_SELECT 0601 16706 #define KEY_SEND 0602 16707 #define KEY_SEOL 0603 16708 #define KEY_SEXIT 0604 16709 #define KEY_SFIND 0605 16710 #define KEY_SHELP 0606 16711 #define KEY_SHOME 0607 16712 #define KEY_SIC 0610 16713 #define KEY_SLEFT 0611 16714 #define KEY_SMESSAGE 0612 16715 #define KEY_SMOVE 0613 16716 #define KEY_SNEXT 0614 16717 #define KEY_SOPTIONS 0615 16718 #define KEY_SPREVIOUS 0616 16719 #define KEY_SPRINT 0617 16720 #define KEY_SREDO 0620 16721 #define KEY_SREPLACE 0621 16722 #define KEY_SRIGHT 0622 16723 #define KEY_SRSUME 0623 16724 #define KEY_SSAVE 0624 16725 #define KEY_SSUSPEND 0625 16726 #define KEY_SUNDO 0626 16727 #define KEY_SUSPEND 0627 16728 #define KEY_UNDO 0630 16729 #define KEY_MOUSE 0631 16730 #define KEY_RESIZE 0632 16731 #define KEY_MAX 0777 16732 16733 #define PAIR_NUMBER(a) (((a)&A_COLOR)>>8) 16734 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 16735 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 16736 #define A_NORMAL 0L 16737 #define NCURSES_ATTR_SHIFT 8 16738 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 16739 #define A_BLINK NCURSES_BITS(1UL,11) 16740 #define A_DIM NCURSES_BITS(1UL,12) 16741 #define A_BOLD NCURSES_BITS(1UL,13) 16742 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 16743 #define A_INVIS NCURSES_BITS(1UL,15) 16744 #define A_PROTECT NCURSES_BITS(1UL,16) 16745 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 16746 #define A_LEFT NCURSES_BITS(1UL,18) 16747 #define A_LOW NCURSES_BITS(1UL,19) 16748 #define A_RIGHT NCURSES_BITS(1UL,20) 16749 #define A_TOP NCURSES_BITS(1UL,21) 16750 #define A_VERTICAL NCURSES_BITS(1UL,22) 16751 #define A_STANDOUT NCURSES_BITS(1UL,8) 16752 #define A_UNDERLINE NCURSES_BITS(1UL,9) 16753 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 16754 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 16755 16756 extern int addch(const chtype); 16757 extern int addchnstr(const chtype *, int); 16758 extern int addchstr(const chtype *); 16759 extern int addnstr(const char *, int); 16760 extern int addstr(const char *); 16761 extern int attroff(int); 16762 extern int attron(int); 16763 extern int attrset(int); 16764 extern int attr_get(attr_t *, short *, void *); 16765 extern int attr_off(attr_t, void *); 16766 extern int attr_on(attr_t, void *); 16767 extern int attr_set(attr_t, short, void *); 16768 extern int baudrate(void); 16769 extern int beep(void); 16770 extern int bkgd(chtype); 16771 extern void bkgdset(chtype); 16772 extern int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, 16773 chtype); 16774 extern int box(WINDOW *, chtype, chtype); 16775 extern bool can_change_color(void); 16776 extern int cbreak(void); 16777 extern int chgat(int, attr_t, short, const void *); 16778 extern int clear(void); 16779 extern int clearok(WINDOW *, bool); 16780 extern int clrtobot(void); 16781 extern int clrtoeol(void); 16782 extern int color_content(short, short *, short *, short *); 16783 extern int color_set(short, void *); 16784 extern int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, 16785 int); 16786 extern int curs_set(int); 16787 extern int def_prog_mode(void); 16788 extern int def_shell_mode(void); 16789 extern int delay_output(int); 16790 extern int delch(void); 16791 extern void delscreen(SCREEN *); 16792 extern int delwin(WINDOW *); 16793 extern int deleteln(void); 16794 extern WINDOW *derwin(WINDOW *, int, int, int, int); 16795 extern int doupdate(void); 16796 extern WINDOW *dupwin(WINDOW *); 16797 extern int echo(void); 16798 extern int echochar(const chtype); 16799 extern int erase(void); 16800 extern int endwin(void); 16801 extern char erasechar(void); 16802 extern void filter(void); 16803 extern int flash(void); 16804 extern int flushinp(void); 16805 extern chtype getbkgd(WINDOW *); 16806 extern int getch(void); 16807 extern int getnstr(char *, int); 16808 extern int getstr(char *); 16809 extern WINDOW *getwin(FILE *); 16810 extern int halfdelay(int); 16811 extern bool has_colors(void); 16812 extern bool has_ic(void); 16813 extern bool has_il(void); 16814 extern int hline(chtype, int); 16815 extern void idcok(WINDOW *, bool); 16816 extern int idlok(WINDOW *, bool); 16817 extern void immedok(WINDOW *, bool); 16818 extern chtype inch(void); 16819 extern int inchnstr(chtype *, int); 16820 extern int inchstr(chtype *); 16821 extern WINDOW *initscr(void); 16822 extern int init_color(short, short, short, short); 16823 extern int init_pair(short, short, short); 16824 extern int innstr(char *, int); 16825 extern int insch(chtype); 16826 extern int insdelln(int); 16827 extern int insertln(void); 16828 extern int insnstr(const char *, int); 16829 extern int insstr(const char *); 16830 extern int instr(char *); 16831 extern int intrflush(WINDOW *, bool); 16832 extern bool isendwin(void); 16833 extern bool is_linetouched(WINDOW *, int); 16834 extern bool is_wintouched(WINDOW *); 16835 extern const char *keyname(int); 16836 extern int keypad(WINDOW *, bool); 16837 extern char killchar(void); 16838 extern int leaveok(WINDOW *, bool); 16839 extern char *longname(void); 16840 extern int meta(WINDOW *, bool); 16841 extern int move(int, int); 16842 extern int mvaddch(int, int, const chtype); 16843 extern int mvaddchnstr(int, int, const chtype *, int); 16844 extern int mvaddchstr(int, int, const chtype *); 16845 extern int mvaddnstr(int, int, const char *, int); 16846 extern int mvaddstr(int, int, const char *); 16847 extern int mvchgat(int, int, int, attr_t, short, const void *); 16848 extern int mvcur(int, int, int, int); 16849 extern int mvdelch(int, int); 16850 extern int mvderwin(WINDOW *, int, int); 16851 extern int mvgetch(int, int); 16852 extern int mvgetnstr(int, int, char *, int); 16853 extern int mvgetstr(int, int, char *); 16854 extern int mvhline(int, int, chtype, int); 16855 extern chtype mvinch(int, int); 16856 extern int mvinchnstr(int, int, chtype *, int); 16857 extern int mvinchstr(int, int, chtype *); 16858 extern int mvinnstr(int, int, char *, int); 16859 extern int mvinsch(int, int, chtype); 16860 extern int mvinsnstr(int, int, const char *, int); 16861 extern int mvinsstr(int, int, const char *); 16862 extern int mvinstr(int, int, char *); 16863 extern int mvprintw(int, int, char *, ...); 16864 extern int mvscanw(int, int, const char *, ...); 16865 extern int mvvline(int, int, chtype, int); 16866 extern int mvwaddch(WINDOW *, int, int, const chtype); 16867 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int); 16868 extern int mvwaddchstr(WINDOW *, int, int, const chtype *); 16869 extern int mvwaddnstr(WINDOW *, int, int, const char *, int); 16870 extern int mvwaddstr(WINDOW *, int, int, const char *); 16871 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void*); 16872 extern int mvwdelch(WINDOW *, int, int); 16873 extern int mvwgetch(WINDOW *, int, int); 16874 extern int mvwgetnstr(WINDOW *, int, int, char *, int); 16875 extern int mvwgetstr(WINDOW *, int, int, char *); 16876 extern int mvwhline(WINDOW *, int, int, chtype, int); 16877 extern int mvwin(WINDOW *, int, int); 16878 extern chtype mvwinch(WINDOW *, int, int); 16879 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); 16880 extern int mvwinchstr(WINDOW *, int, int, chtype *); 16881 extern int mvwinnstr(WINDOW *, int, int, char *, int); 16882 extern int mvwinsch(WINDOW *, int, int, chtype); 16883 extern int mvwinsnstr(WINDOW *, int, int, const char *, int); 16884 extern int mvwinsstr(WINDOW *, int, int, const char *); 16885 extern int mvwinstr(WINDOW *, int, int, char *); 16886 extern int mvwprintw(WINDOW *, int, int, char *, ...); 16887 extern int mvwscanw(WINDOW *, int, int, const char *, ...); 16888 extern int mvwvline(WINDOW *, int, int, chtype, int); 16889 extern int napms(int); 16890 extern WINDOW *newpad(int, int); 16891 extern SCREEN *newterm(const char *, FILE *, FILE *); 16892 extern WINDOW *newwin(int, int, int, int); 16893 extern int nl(void); 16894 extern int nocbreak(void); 16895 extern int nodelay(WINDOW *, bool); 16896 extern int noecho(void); 16897 extern int nonl(void); 16898 extern void noqiflush(void); 16899 extern int noraw(void); 16900 extern int notimeout(WINDOW *, bool); 16901 extern int overlay(const WINDOW *, WINDOW *); 16902 extern int overwrite(const WINDOW *, WINDOW *); 16903 extern int pair_content(short, short *, short *); 16904 extern int pechochar(WINDOW *, chtype); 16905 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int); 16906 extern int prefresh(WINDOW *, int, int, int, int, int, int); 16907 extern int printw(char *, ...); 16908 extern int putwin(WINDOW *, FILE *); 16909 extern void qiflush(void); 16910 extern int raw(void); 16911 extern int redrawwin(WINDOW *); 16912 extern int refresh(void); 16913 extern int resetty(void); 16914 extern int reset_prog_mode(void); 16915 extern int reset_shell_mode(void); 16916 extern int ripoffline(int, int (*init) (WINDOW *, int) 16917 ); 16918 extern int savetty(void); 16919 extern int scanw(const char *, ...); 16920 extern int scr_dump(const char *); 16921 extern int scr_init(const char *); 16922 extern int scrl(int); 16923 extern int scroll(WINDOW *); 16924 extern int scrollok(WINDOW *, typedef unsigned char bool); 16925 extern int scr_restore(const char *); 16926 extern int scr_set(const char *); 16927 extern int setscrreg(int, int); 16928 extern SCREEN *set_term(SCREEN *); 16929 extern int slk_attroff(const typedef unsigned long int chtype); 16930 extern int slk_attron(const typedef unsigned long int chtype); 16931 extern int slk_attrset(const typedef unsigned long int chtype); 16932 extern int slk_attr_set(const typedef chtype attr_t, short, void *); 16933 extern int slk_clear(void); 16934 extern int slk_color(short); 16935 extern int slk_init(int); 16936 extern char *slk_label(int); 16937 extern int slk_noutrefresh(void); 16938 extern int slk_refresh(void); 16939 extern int slk_restore(void); 16940 extern int slk_set(int, const char *, int); 16941 extern int slk_touch(void); 16942 extern int standout(void); 16943 extern int standend(void); 16944 extern int start_color(void); 16945 extern WINDOW *subpad(WINDOW *, int, int, int, int); 16946 extern WINDOW *subwin(WINDOW *, int, int, int, int); 16947 extern int syncok(WINDOW *, typedef unsigned char bool); 16948 extern typedef unsigned long int chtype termattrs(void); 16949 extern char *termname(void); 16950 extern void timeout(int); 16951 extern int typeahead(int); 16952 extern int ungetch(int); 16953 extern int untouchwin(WINDOW *); 16954 extern void use_env(typedef unsigned char bool); 16955 extern int vidattr(typedef unsigned long int chtype); 16956 extern int vidputs(typedef unsigned long int chtype, 16957 int (*vidputs_int) (int) 16958 ); 16959 extern int vline(typedef unsigned long int chtype, int); 16960 extern int vwprintw(WINDOW *, char *, typedef void *va_list); 16961 extern int vw_printw(WINDOW *, const char *, typedef void *va_list); 16962 extern int vwscanw(WINDOW *, const char *, typedef void *va_list); 16963 extern int vw_scanw(WINDOW *, const char *, typedef void *va_list); 16964 extern int waddch(WINDOW *, const typedef unsigned long int chtype); 16965 extern int waddchnstr(WINDOW *, const typedef unsigned long int chtype*, 16966 int); 16967 extern int waddchstr(WINDOW *, const typedef unsigned long int chtype *); 16968 extern int waddnstr(WINDOW *, const char *, int); 16969 extern int waddstr(WINDOW *, const char *); 16970 extern int wattron(WINDOW *, int); 16971 extern int wattroff(WINDOW *, int); 16972 extern int wattrset(WINDOW *, int); 16973 extern int wattr_get(WINDOW *, attr_t *, short *, void *); 16974 extern int wattr_on(WINDOW *, typedef chtype attr_t, void *); 16975 extern int wattr_off(WINDOW *, typedef chtype attr_t, void *); 16976 extern int wattr_set(WINDOW *, typedef chtype attr_t, short, void *); 16977 extern int wbkgd(WINDOW *, typedef unsigned long int chtype); 16978 extern void wbkgdset(WINDOW *, typedef unsigned long int chtype); 16979 extern int wborder(WINDOW *, typedef unsigned long int chtype, 16980 typedef unsigned long int chtype, 16981 typedef unsigned long int chtype, 16982 typedef unsigned long int chtype, 16983 typedef unsigned long int chtype, 16984 typedef unsigned long int chtype, 16985 typedef unsigned long int chtype, 16986 typedef unsigned long int chtype); 16987 extern int wchgat(WINDOW *, int, typedef chtype attr_t, short, 16988 const void *); 16989 extern int wclear(WINDOW *); 16990 extern int wclrtobot(WINDOW *); 16991 extern int wclrtoeol(WINDOW *); 16992 extern int wcolor_set(WINDOW *, short, void *); 16993 extern void wcursyncup(WINDOW *); 16994 extern int wdelch(WINDOW *); 16995 extern int wdeleteln(WINDOW *); 16996 extern int wechochar(WINDOW *, const typedef unsigned long int chtype); 16997 extern int werase(WINDOW *); 16998 extern int wgetch(WINDOW *); 16999 extern int wgetnstr(WINDOW *, char *, int); 17000 extern int wgetstr(WINDOW *, char *); 17001 extern int whline(WINDOW *, typedef unsigned long int chtype, int); 17002 extern typedef unsigned long int chtype winch(WINDOW *); 17003 extern int winchnstr(WINDOW *, chtype *, int); 17004 extern int winchstr(WINDOW *, chtype *); 17005 extern int winnstr(WINDOW *, char *, int); 17006 extern int winsch(WINDOW *, typedef unsigned long int chtype); 17007 extern int winsdelln(WINDOW *, int); 17008 extern int winsertln(WINDOW *); 17009 extern int winsnstr(WINDOW *, const char *, int); 17010 extern int winsstr(WINDOW *, const char *); 17011 extern int winstr(WINDOW *, char *); 17012 extern int wmove(WINDOW *, int, int); 17013 extern int wnoutrefresh(WINDOW *); 17014 extern int wprintw(WINDOW *, char *, ...); 17015 extern int wredrawln(WINDOW *, int, int); 17016 extern int wrefresh(WINDOW *); 17017 extern int wscanw(WINDOW *, const char *, ...); 17018 extern int wscrl(WINDOW *, int); 17019 extern int wsetscrreg(WINDOW *, int, int); 17020 extern int wstandout(WINDOW *); 17021 extern int wstandend(WINDOW *); 17022 extern void wsyncdown(WINDOW *); 17023 extern void wsyncup(WINDOW *); 17024 extern void wtimeout(WINDOW *, int); 17025 extern int wtouchln(WINDOW *, int, int, int); 17026 extern int wvline(WINDOW *, typedef unsigned long int chtype, int); 17027 extern char *unctrl(typedef unsigned long int chtype); 17028 extern int COLORS(void); 17029 extern int COLOR_PAIRS(void); 17030 extern chtype acs_map(void); 17031 extern WINDOW *curscr(void); 17032 extern WINDOW *stdscr(void); 17033 extern int COLS(void); 17034 extern int LINES(void); 17035 extern int touchline(WINDOW *, int, int); 17036 extern int touchwin(WINDOW *); 17037 _________________________________________________________ 17038 17039 10.6.2. term.h 17040 17041 extern int putp(const char *); 17042 extern int tigetflag(const char *); 17043 extern int tigetnum(const char *); 17044 extern char *tigetstr(const char *); 17045 extern char *tparm(const char *, ...); 17046 extern TERMINAL *set_curterm(TERMINAL *); 17047 extern int del_curterm(TERMINAL *); 17048 extern int restartterm(char *, int, int *); 17049 extern int setupterm(char *, int, int *); 17050 extern char *tgetstr(char *, char **); 17051 extern char *tgoto(const char *, int, int); 17052 extern int tgetent(char *, const char *); 17053 extern int tgetflag(char *); 17054 extern int tgetnum(char *); 17055 extern int tputs(const char *, int, int (*putcproc) (int) 17056 ); 17057 extern TERMINAL *cur_term(void); 17058 _________________________________________________________ 17059 17060 10.7. Interfaces for libutil 17061 17062 Table 10-6 defines the library name and shared object name for 17063 the libutil library 17064 17065 Table 10-6. libutil Definition 17066 Library: libutil 17067 SONAME: libutil.so.1 17068 17069 The behavior of the interfaces in this library is specified by 17070 the following specifications: 17071 17072 [LSB] This Specification 17073 _________________________________________________________ 17074 17075 10.7.1. Utility Functions 17076 _________________________________________________________ 17077 17078 10.7.1.1. Interfaces for Utility Functions 17079 17080 An LSB conforming implementation shall provide the generic 17081 functions for Utility Functions specified in Table 10-7, with 17082 the full mandatory functionality as described in the 17083 referenced underlying specification. 17084 17085 Table 10-7. libutil - Utility Functions Function Interfaces 17086 forkpty [LSB] login [LSB] login_tty [LSB] logout [LSB] 17087 logwtmp [LSB] openpty [LSB] 17088 _________________________________________________________ 17089 17090 10.8. Interface Definitions for libutil 17091 17092 Table of Contents 17093 forkpty -- Create a new process attached to an available 17094 pseudo-terminal 17095 17096 login -- login utility function 17097 login_tty -- Prepare a terminal for login 17098 logout -- logout utility function 17099 logwtmp -- append an entry to the wtmp file 17100 openpty -- find and open an available pseudo-terminal 17101 17102 The interfaces defined on the following pages are included in 17103 libutil and are defined by this specification. Unless 17104 otherwise noted, these interfaces shall be included in the 17105 source standard. 17106 17107 Other interfaces listed in Section 10.7 shall behave as 17108 described in the referenced base document. 17109 17110 forkpty 17111 17112 Name 17113 17114 forkpty -- Create a new process attached to an available 17115 pseudo-terminal 17116 17117 Synopsis 17118 17119 #include 17120 17121 int forkpty(int * amaster, char * name, struct termios * 17122 termp, struct winsize * winp); 17123 17124 Description 17125 17126 The forkpty() function shall find and open a pseudo-terminal 17127 device pair in the same manner as the openpty() function. If a 17128 pseudo-terminal is available, forkpty() shall create a new 17129 process in the same manner as the fork() function, and 17130 prepares the new process for login in the same manner as 17131 login_tty(). 17132 17133 If termp is not null, it shall refer to a termios structure 17134 that shall be used to initialize the characteristics of the 17135 slave device. If winp is not null, it shall refer to a winsize 17136 structure used to initialize the window size of the slave 17137 device. 17138 17139 Return Value 17140 17141 On success, the parent process shall return the process id of 17142 the child, and the child shall return 0. On error, no new 17143 process shall be created, -1 shall be returned, and errno 17144 shall be set appropriately. On success, the parent process 17145 shall receive the file descriptor of the master side of the 17146 pseudo-terminal in the location referenced by amaster, and, if 17147 name is not NULL, the filename of the slave device in name. 17148 17149 Errors 17150 17151 EAGAIN 17152 17153 Unable to create a new process. 17154 ENOENT 17155 17156 There are no available pseudo-terminals. 17157 ENOMEM 17158 17159 Insufficient memory was available. 17160 17161 login 17162 17163 Name 17164 17165 login -- login utility function 17166 17167 Synopsis 17168 17169 #include 17170 17171 void login (struct utmp * ut ); 17172 17173 Description 17174 17175 The login() function shall update the user accounting 17176 databases. The ut parameter shall reference a utmp structure 17177 for all fields except the following: 17178 17179 1. The ut_type field shall be set to USER_PROCESS. 17180 2. The ut_pid field shall be set to the process identifier 17181 for the current process. 17182 3. The ut_line field shall be set to the name of the 17183 controlling terminal device. The name shall be found by 17184 examining the device associated with the standard input, 17185 output and error streams in sequence, until one associated 17186 with a terminal device is found. If none of these streams 17187 refers to a terminal device, the ut_line field shall be 17188 set to "???". If the terminal device is in the /dev 17189 directory hierarchy, the ut_line field shall not contain 17190 the leading "/dev/", otherwise it shall be set to the 17191 final component of the pathname of the device. If the user 17192 accounting database imposes a limit on the size of the 17193 ut_line field, it shall truncate the name, but any such 17194 limit shall not be smaller than UT_LINESIZE (including a 17195 terminating null character). 17196 17197 Return Value 17198 17199 None 17200 17201 Errors 17202 17203 None 17204 17205 login_tty 17206 17207 Name 17208 17209 login_tty -- Prepare a terminal for login 17210 17211 Synopsis 17212 17213 #include 17214 17215 int login_tty (int fdr); 17216 17217 Description 17218 17219 The login_tty() function shall prepare the terminal device 17220 referenced by the file descriptor fdr. This function shall 17221 create a new session, make the terminal the controlling 17222 terminal for the current process, and set the standard input, 17223 output, and error streams of the current process to the 17224 terminal. If fdr is not the standard input, output or error 17225 stream, then login_tty() shall close fdr. 17226 17227 Return Value 17228 17229 On success, login_tty() shall return zero; otherwise -1 is 17230 returned, and errno shall be set appropriately. 17231 17232 Errors 17233 17234 ENOTTY 17235 17236 fdr does not refer to a terminal device. 17237 17238 logout 17239 17240 Name 17241 17242 logout -- logout utility function 17243 17244 Synopsis 17245 17246 #include 17247 17248 int logout (const char * line ); 17249 17250 Description 17251 17252 Given the device line, the logout() function shall search the 17253 user accounting database which is read by getutent() for an 17254 entry with the corresponding line, and with the type of 17255 USER_PROCESS. If a corresponding entry is located, it shall be 17256 updated as follows: 17257 17258 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 17259 bytes). 17260 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 17261 bytes). 17262 3. The ut_tv shall be set to the current time of day. 17263 4. The ut_type field shall be set to DEAD_PROCESS. 17264 17265 Return Value 17266 17267 On success, the logout() function shall return non-zero. Zero 17268 is returned if there was no entry to remove, or if the utmp 17269 file could not be opened or updated. 17270 17271 logwtmp 17272 17273 Name 17274 17275 logwtmp -- append an entry to the wtmp file 17276 17277 Synopsis 17278 17279 #include 17280 17281 void logwtmp (const char * line , const char * name , const 17282 char * host ); 17283 17284 Description 17285 17286 If the process has permission to update the user accounting 17287 databases, the logwtmp() function shall append a record to the 17288 user accounting database that records all logins and logouts. 17289 The record to be appended shall be constructed as follows: 17290 17291 1. The ut_line field shall be initialized from line. If the 17292 user accounting database imposes a limit on the size of 17293 the ut_line field, it shall truncate the value, but any 17294 such limit shall not be smaller than UT_LINESIZE 17295 (including a terminating null character). 17296 2. The ut_name field shall be initialized from name. If the 17297 user accounting database imposes a limit on the size of 17298 the ut_name field, it shall truncate the value, but any 17299 such limit shall not be smaller than UT_NAMESIZE 17300 (including a terminating null character). 17301 3. The ut_host field shall be initialized from host. If the 17302 user accounting database imposes a limit on the size of 17303 the ut_host field, it shall truncate the value, but any 17304 such limit shall not be smaller than UT_HOSTSIZE 17305 (including a terminating null character). 17306 4. If the name parameter does not refer to an empty string 17307 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 17308 otherwise the ut_type field shall be set to DEAD_PROCESS. 17309 5. The ut_id field shall be set to the process identifier for 17310 the current process. 17311 6. The ut_tv field shall be set to the current time of day. 17312 17313 Note: If a process does not have write access to the the 17314 user accounting database, the logwtmp() function will not 17315 update it. Since the function does not return any value, an 17316 application has no way of knowing whether it succeeded or 17317 failed. 17318 17319 Return Value 17320 17321 None. 17322 17323 openpty 17324 17325 Name 17326 17327 openpty -- find and open an available pseudo-terminal 17328 17329 Synopsis 17330 17331 #include 17332 17333 int openpty(int *amaster, int *aslave, char *name, struct 17334 termios *termp, struct winsize *winp); 17335 17336 Description 17337 17338 The openpty() function shall find an available pseudo-terminal 17339 and return file descriptors for the master and slave devices 17340 in the locations referenced by amaster and aslave 17341 respectively. If name is not NULL, the filename of the slave 17342 shall be placed in the user supplied buffer referenced by 17343 name. If termp is not NULL, it shall point to a termios 17344 structure used to initialize the terminal parameters of the 17345 slave pseudo-terminal device. If winp is not NULL, it shall 17346 point to a winsize structure used to initialize the window 17347 size parameters of the slave pseudo-terminal device. 17348 17349 Return Value 17350 17351 On success, zero is returned. On error, -1 is returned, and 17352 errno is set appropriately. 17353 17354 Errors 17355 17356 ENOENT 17357 17358 There are no available pseudo-terminals. 17359 17360 IV. Commands and Utilities 17361 17362 Table of Contents 17363 11. Commands and Utilities 17364 17365 11.1. Commands and Utilities 17366 11.2. Command Behavior 17367 17368 ar -- create and maintain library archives 17369 (DEPRECATED) 17370 17371 at -- examine or delete jobs for later execution 17372 awk -- pattern scanning and processing language 17373 batch -- schedule commands to be executed in a 17374 batch queue 17375 17376 bc -- an arbitrary precision calculator language 17377 chfn -- change user name and information 17378 chsh -- change login shell 17379 col -- filter reverse line feeds from input 17380 cpio -- copy file archives in and out 17381 crontab -- maintain crontab files for individual 17382 users 17383 17384 cut -- split a file into sections determined by 17385 context lines 17386 17387 df -- report file system disk space usage 17388 dmesg -- print or control the system message buffer 17389 du -- estimate file space usage 17390 echo -- write arguments to standard output 17391 egrep -- search a file with an Extended Regular 17392 Expression pattern 17393 17394 fgrep -- search a file with a fixed pattern 17395 file -- determine file type 17396 find -- search for files in a directory hierarchy 17397 fuser -- identify processes using files or sockets 17398 gettext -- retrieve text string from message 17399 catalog 17400 17401 grep -- print lines matching a pattern 17402 groupadd -- create a new group 17403 groupdel -- delete a group 17404 groupmod -- modify a group 17405 groups -- display a group 17406 gunzip -- uncompress files 17407 gzip -- compress or expand files 17408 hostname -- show or set the system's host name 17409 install -- copy files and set attributes 17410 install_initd -- activate an init script 17411 ipcrm -- remove IPC Resources 17412 ipcs -- provide information on ipc facilities 17413 killall -- kill processes by name 17414 lpr -- off line print 17415 ls -- list directory contents 17416 lsb_release -- print distribution specific 17417 information 17418 17419 m4 -- macro processor 17420 md5sum -- generate or check MD5 message digests 17421 mknod -- make special files 17422 mktemp -- make temporary file name (unique) 17423 more -- display files on a page-by-page basis 17424 mount -- mount a file system 17425 msgfmt -- create a message object from a message 17426 file 17427 17428 newgrp -- change group ID 17429 od -- dump files in octal and other formats 17430 passwd -- change user password 17431 patch -- apply a diff file to an original 17432 pidof -- find the process ID of a running program 17433 remove_initd -- clean up init script system 17434 modifications introduced by install_initd 17435 17436 renice -- alter priority of running processes 17437 sed -- stream editor 17438 sendmail -- an electronic mail transport agent 17439 sh -- shell, the standard command language 17440 interpreter 17441 17442 shutdown -- shut the system down 17443 su -- change user ID 17444 sync -- flush file system buffers 17445 tar -- file archiver 17446 umount -- unmount file systems 17447 useradd -- create a new user or update default new 17448 user information 17449 17450 userdel -- delete a user account and related files 17451 usermod -- modify a user account 17452 xargs -- build and execute command lines from 17453 standard input 17454 _________________________________________________________ 17455 17456 Chapter 11. Commands and Utilities 17457 17458 11.1. Commands and Utilities 17459 17460 An LSB conforming implementation shall provide the commands 17461 and utilities as described in Table 11-1, with at least the 17462 behavior described as mandatory in the referenced underlying 17463 specification, with the following exceptions: 17464 17465 1. If any operand (except one which follows --) starts with a 17466 hyphen, the behavior is unspecified. 17467 17468 Rationale (Informative): Applications should place options 17469 before operands, or use --, as needed. This text is needed 17470 because, by default, GNU option parsing differs from POSIX, 17471 unless the environment variable POSIXLY_CORRECT is set. For 17472 example, ls . -a in GNU ls means to list the current 17473 directory, showing all files (that is, "." is an operand 17474 and -a is an option). In POSIX, "." and -a are both 17475 operands, and the command means to list the current 17476 directory, and also the file named -a. Suggesting that 17477 applications rely on the setting of the POSIXLY_CORRECT 17478 environment variable, or try to set it, seems worse than 17479 just asking the applictions to invoke commands in ways 17480 which work with either the POSIX or GNU behaviors. 17481 17482 Table 11-1. Commands And Utilities 17483 [ [1] dmesg [2] id [1] mount [2] sort [1] 17484 ar [2] du [2] install [2] msgfmt [2] split [1] 17485 at [2] echo [2] install_initd [2] mv [1] strip [1] 17486 awk [2] ed [1] ipcrm [2] newgrp [2] stty [1] 17487 basename [1] egrep [2] ipcs [2] nice [1] su [2] 17488 batch [2] env [1] join [1] nl [1] sync [2] 17489 bc [2] expand [1] kill [1] nohup [1] tail [1] 17490 cat [1] expr [1] killall [2] od [2] tar [2] 17491 chfn [2] false [1] ln [1] passwd [2] tee [1] 17492 chgrp [1] fgrep [2] locale [1] paste [1] test [1] 17493 chmod [1] file [2] localedef [1] patch [2] time [1] 17494 chown [1] find [2] logger [1] pathchk [1] touch [1] 17495 chsh [2] fold [1] logname [1] pax [1] tr [1] 17496 cksum [1] fuser [2] lp [1] pidof [2] true [1] 17497 cmp [1] gencat [1] lpr [2] pr [1] tsort [1] 17498 col [2] getconf [1] ls [2] printf [1] tty [1] 17499 comm [1] gettext [2] lsb_release [2] ps [1] umount [2] 17500 cp [1] grep [2] m4 [2] pwd [1] uname [1] 17501 cpio [2] groupadd [2] mailx [1] remove_initd [2] unexpand [1] 17502 crontab [2] groupdel [2] make [1] renice [2] uniq [1] 17503 csplit [1] groupmod [2] man [1] rm [1] useradd [2] 17504 cut [2] groups [2] md5sum [2] rmdir [1] userdel [2] 17505 date [1] gunzip [2] mkdir [1] sed [2] usermod [2] 17506 dd [1] gzip [2] mkfifo [1] sendmail [2] wc [1] 17507 df [2] head [1] mknod [2] sh [2] xargs [2] 17508 diff [1] hostname [2] mktemp [2] shutdown [2] 17509 dirname [1] iconv [1] more [2] sleep [1] 17510 17511 Referenced Specification(s) 17512 17513 [1]. ISO POSIX (2003) 17514 17515 [2]. This Specification 17516 17517 An LSB conforming implementation shall provide the shell built 17518 in utilities as described in Table 11-2, with at least the 17519 behavior described as mandatory in the referenced underlying 17520 specification, with the following exceptions: 17521 17522 1. The built in commands and utilities shall be provided by 17523 the sh utility itself, and need not be implemented in a 17524 manner so that they can be accessed via the exec family of 17525 functions as defined in ISO POSIX (2003) and should not be 17526 invoked directly by those standard utilities that execute 17527 other utilities ( env, find, nice, nohup, time, xargs). 17528 17529 Rationale (Informative): Since the built in utilities must 17530 affect the environment of the calling process, they have no 17531 effect when executed as a file. 17532 17533 Table 11-2. Built In Utilities 17534 cd [1] getopts [1] read [1] umask [1] wait [1] 17535 17536 Referenced Specification(s) 17537 17538 [1]. ISO POSIX (2003) 17539 _________________________________________________________ 17540 17541 11.2. Command Behavior 17542 17543 Table of Contents 17544 ar -- create and maintain library archives (DEPRECATED) 17545 at -- examine or delete jobs for later execution 17546 awk -- pattern scanning and processing language 17547 batch -- schedule commands to be executed in a batch queue 17548 bc -- an arbitrary precision calculator language 17549 chfn -- change user name and information 17550 chsh -- change login shell 17551 col -- filter reverse line feeds from input 17552 cpio -- copy file archives in and out 17553 crontab -- maintain crontab files for individual users 17554 cut -- split a file into sections determined by context lines 17555 df -- report file system disk space usage 17556 dmesg -- print or control the system message buffer 17557 du -- estimate file space usage 17558 echo -- write arguments to standard output 17559 egrep -- search a file with an Extended Regular Expression 17560 pattern 17561 17562 fgrep -- search a file with a fixed pattern 17563 file -- determine file type 17564 find -- search for files in a directory hierarchy 17565 fuser -- identify processes using files or sockets 17566 gettext -- retrieve text string from message catalog 17567 grep -- print lines matching a pattern 17568 groupadd -- create a new group 17569 groupdel -- delete a group 17570 groupmod -- modify a group 17571 groups -- display a group 17572 gunzip -- uncompress files 17573 gzip -- compress or expand files 17574 hostname -- show or set the system's host name 17575 install -- copy files and set attributes 17576 install_initd -- activate an init script 17577 ipcrm -- remove IPC Resources 17578 ipcs -- provide information on ipc facilities 17579 killall -- kill processes by name 17580 lpr -- off line print 17581 ls -- list directory contents 17582 lsb_release -- print distribution specific information 17583 m4 -- macro processor 17584 md5sum -- generate or check MD5 message digests 17585 mknod -- make special files 17586 mktemp -- make temporary file name (unique) 17587 more -- display files on a page-by-page basis 17588 mount -- mount a file system 17589 msgfmt -- create a message object from a message file 17590 newgrp -- change group ID 17591 od -- dump files in octal and other formats 17592 passwd -- change user password 17593 patch -- apply a diff file to an original 17594 pidof -- find the process ID of a running program 17595 remove_initd -- clean up init script system modifications 17596 introduced by install_initd 17597 17598 renice -- alter priority of running processes 17599 sed -- stream editor 17600 sendmail -- an electronic mail transport agent 17601 sh -- shell, the standard command language interpreter 17602 shutdown -- shut the system down 17603 su -- change user ID 17604 sync -- flush file system buffers 17605 tar -- file archiver 17606 umount -- unmount file systems 17607 useradd -- create a new user or update default new user 17608 information 17609 17610 userdel -- delete a user account and related files 17611 usermod -- modify a user account 17612 xargs -- build and execute command lines from standard input 17613 17614 This section contains descriptions for commands and utilities 17615 whose specified behavior in the LSB contradicts or extends the 17616 standards referenced. It also contains commands and utilities 17617 only required by the LSB and not specified by other standards. 17618 17619 ar 17620 17621 Name 17622 17623 ar -- create and maintain library archives (DEPRECATED) 17624 17625 Description 17626 17627 ar is deprecated from the LSB and is expected to disappear 17628 from a future version of the LSB. 17629 17630 Rationale: The LSB generally does not include software 17631 development utilities nor does it specify .o and .a file 17632 formats. 17633 17634 ar is as specified in ISO POSIX (2003) but with differences as 17635 listed below. 17636 17637 Differences 17638 17639 -T, -C 17640 17641 need not be accepted. 17642 -l 17643 17644 has unspecified behavior. 17645 -q 17646 17647 has unspecified behavior; using -r is suggested. 17648 17649 at 17650 17651 Name 17652 17653 at -- examine or delete jobs for later execution 17654 17655 Description 17656 17657 at is as specified in ISO POSIX (2003) but with differences as 17658 listed below. 17659 17660 Differences 17661 17662 Options 17663 17664 -d 17665 17666 is functionally equivalent to the -r option specified in ISO 17667 POSIX (2003). 17668 -r 17669 17670 need not be supported, but the '-d' option is equivalent. 17671 -t time 17672 17673 need not be supported. 17674 17675 Optional Control Files 17676 17677 The implementation shall support the XSI optional behavior for 17678 access control; however the files at.allow and at.deny may 17679 reside in /etc rather than /usr/lib/cron. 17680 17681 awk 17682 17683 Name 17684 17685 awk -- pattern scanning and processing language 17686 17687 Description 17688 17689 awk is as specified in ISO POSIX (2003) but with differences 17690 as listed below. 17691 17692 Differences 17693 17694 Certain aspects of internationalized regular expressions are 17695 optional; see Internationalization and Regular Expressions. 17696 17697 batch 17698 17699 Name 17700 17701 batch -- schedule commands to be executed in a batch queue 17702 17703 Description 17704 17705 The specification for batch is as specified in ISO POSIX 17706 (2003), but with differences as listed below. 17707 17708 Optional Control Files 17709 17710 The implementation shall support the XSI optional behavior for 17711 access control; however the files at.allow and at.deny may 17712 reside in /etc rather than /usr/lib/cron. 17713 17714 bc 17715 17716 Name 17717 17718 bc -- an arbitrary precision calculator language 17719 17720 Description 17721 17722 bc is as specified in ISO POSIX (2003) but with extensions as 17723 listed below. 17724 17725 Extensions 17726 17727 The bc language may be extended in an implementation defined 17728 manner. If an implementation supports extensions, it shall 17729 also support the additional options: 17730 17731 -s|--standard 17732 17733 processes exactly the POSIX bc language. 17734 -w|--warn 17735 17736 gives warnings for extensions to POSIX bc. 17737 17738 chfn 17739 17740 Name 17741 17742 chfn -- change user name and information 17743 17744 Synopsis 17745 17746 chfn [-f full_name] [-h home_phone] [user] 17747 17748 Description 17749 17750 chfn shall update the user database. An unprivileged user may 17751 only change the fields for their own account, a user with 17752 appropriate privileges may change the fields for any account. 17753 17754 The fields full_name and home_phone may contain any character 17755 except: 17756 17757 any control character 17758 comma 17759 colon 17760 equal sign 17761 17762 If none of the options are selected, chfn operates in an 17763 interactive fashion. The prompts and expected input in 17764 interactive mode are unspecified and should not be relied 17765 upon. 17766 17767 As it is possible for the system to be configured to restrict 17768 which fields a non-privileged user is permitted to change, 17769 applications should be written to gracefully handle these 17770 situations. 17771 17772 Standard Options 17773 17774 -f full_name 17775 17776 sets the user's full name. 17777 -h home_phone 17778 17779 sets the user's home phone number. 17780 17781 Future Directions 17782 17783 The following two options are expected to be added in a future 17784 version of the LSB: 17785 17786 -o office 17787 17788 sets the user's office room number. 17789 -p office_phone 17790 17791 sets the user's office phone number. 17792 17793 Note that some implementations contain a "-o other" option 17794 which specifies an additional field called "other". 17795 Traditionally, this field is not subject to the constraints 17796 about legitimate characters in fields. Also, one traditionally 17797 shall have appropriate privileges to change the other field. 17798 At this point there is no consensus about whether it is 17799 desirable to specify the other field; applications may wish to 17800 avoid using it. 17801 17802 The "-w work_phone" field found in some implementations should 17803 be replaced by the "-p office_phone" field. The "-r 17804 room_number" field found in some implementations is the 17805 equivalent of the "-o office" option mentioned above; which 17806 one of these two options to specify will depend on 17807 implementation experience and the decision regarding the other 17808 field. 17809 17810 chsh 17811 17812 Name 17813 17814 chsh -- change login shell 17815 17816 Synopsis 17817 17818 chsh [-s login_shell] [user] 17819 17820 Description 17821 17822 chsh changes the user login shell. This determines the name of 17823 the user's initial login command. An unprivileged user may 17824 only change the login shell for their own account, a user with 17825 appropriate privilege may change the login shell for any 17826 account specified by user. 17827 17828 Unless the user has appropriate privilege, the initial login 17829 command name shall be one of those listed in /etc/shells. The 17830 login_shell shall be the absolute path (i.e. it must start 17831 with '/') to an executable file. Accounts which are restricted 17832 (in an implementation-defined manner) may not change their 17833 login shell. 17834 17835 If the -s option is not selected, chsh operates in an 17836 interactive mode. The prompts and expected input in this mode 17837 are unspecified. 17838 17839 Standard Options 17840 17841 -s login_shell 17842 17843 sets the login shell. 17844 17845 col 17846 17847 Name 17848 17849 col -- filter reverse line feeds from input 17850 17851 Description 17852 17853 col is as specified in SUSv2 but with differences as listed 17854 below. 17855 17856 Differences 17857 17858 The -p option has unspecified behavior. 17859 17860 Note: Although col is shown as legacy in SUSv2, it is not 17861 (yet) deprecated in the LSB. 17862 17863 cpio 17864 17865 Name 17866 17867 cpio -- copy file archives in and out 17868 17869 Description 17870 17871 cpio is as specified in ISO POSIX (2003), but with differences 17872 as listed below. 17873 17874 Differences 17875 17876 Some elements of the Pattern Matching Notation are optional; 17877 see Internationalization and Pattern Matching Notation. 17878 17879 crontab 17880 17881 Name 17882 17883 crontab -- maintain crontab files for individual users 17884 17885 Synopsis 17886 17887 crontab [-u user] file 17888 crontab [-u user] {-l | -r | -e} 17889 17890 Description 17891 17892 crontab is as specified in ISO POSIX (2003), but with 17893 differences as listed below. 17894 17895 Optional Control Files 17896 17897 The implementation shall support the XSI optional behavior for 17898 access control; however the files cron.allow and cron.deny may 17899 reside in /etc rather than /usr/lib/cron. 17900 17901 cut 17902 17903 Name 17904 17905 cut -- split a file into sections determined by context lines 17906 17907 Description 17908 17909 cut is as specified in ISO POSIX (2003), but with differences 17910 as listed below. 17911 17912 Differences 17913 17914 -n 17915 17916 has unspecified behavior. 17917 17918 df 17919 17920 Name 17921 17922 df -- report file system disk space usage 17923 17924 Description 17925 17926 The df command shall behave as specified in ISO POSIX (2003), 17927 but with differences as listed below. 17928 17929 Differences 17930 17931 Options 17932 17933 If the -k option is not specified, disk space is shown in 17934 unspecified units. If the -P option is specified, the size of 17935 the unit shall be printed on the header line in the format 17936 "%4s-blocks". Applications should specify -k. 17937 17938 The XSI option -t has unspecified behavior. Applications 17939 should not specify -t. 17940 17941 Rationale: The most common implementation of df uses the -t 17942 option for a different purpose (restricting output to a 17943 particular file system type), and use of -t is therefore 17944 non-portable. 17945 17946 Operand May Identify Special File 17947 17948 If an argument is the absolute file name of a special file 17949 containing a mounted file system, df shall show the space 17950 available on that file system rather than on the file system 17951 containing the special file (which is typically the root file 17952 system). 17953 17954 Note: In ISO POSIX (2003) the XSI optional behavior permits 17955 an operand to name a special file, but appears to require 17956 the operation be performed on the file system containing 17957 the special file. A defect report has been submitted for 17958 this case. 17959 17960 dmesg 17961 17962 Name 17963 17964 dmesg -- print or control the system message buffer 17965 17966 Synopsis 17967 17968 dmesg [-c | -n level | -s bufsize] 17969 17970 Description 17971 17972 dmesg examines or controls the system message buffer. Only a 17973 user with appropriate privileges may modify the system message 17974 buffer parameters or contents. 17975 17976 Standard Options 17977 17978 -c 17979 17980 If the user has appropriate privilege, clears the system 17981 message buffer contents after printing. 17982 -n level 17983 17984 If the user has appropriate privilege, sets the level at which 17985 logging of messages is done to the console. 17986 -s bufsize 17987 17988 uses a buffer of bufsize to query the system message buffer. 17989 This is 16392 by default. 17990 17991 du 17992 17993 Name 17994 17995 du -- estimate file space usage 17996 17997 Description 17998 17999 du is as specified in ISO POSIX (2003), but with differences 18000 as listed below. 18001 18002 Differences 18003 18004 If the -k option is not specified, disk space is shown in 18005 unspecified units. Applications should specify -k. 18006 18007 echo 18008 18009 Name 18010 18011 echo -- write arguments to standard output 18012 18013 Synopsis 18014 18015 echo [string...] 18016 18017 Description 18018 18019 The echo command is as specified in ISO POSIX (2003), but with 18020 the following differences. 18021 18022 Implementations may support implementation-defined options to 18023 echo. The behavior of echo if any arguments contain 18024 backslashes is also implementation defined. 18025 18026 Application Usage 18027 18028 Conforming applications should not run echo with a first 18029 argument starting with a hyphen, or with any arguments 18030 containing backslashes; they should use printf in those cases. 18031 18032 Note: The behavior specified here is similar to that 18033 specified by ISO POSIX (2003) without the XSI option. 18034 However, the LSB strongly recommends conforming 18035 applications not use any options (even if the 18036 implementation provides them) while ISO POSIX (2003) 18037 specifies behavior if the first operand is the string -n. 18038 18039 egrep 18040 18041 Name 18042 18043 egrep -- search a file with an Extended Regular Expression 18044 pattern 18045 18046 Description 18047 18048 egrep is equivalent to grep -E. For further details, see the 18049 specification for grep. 18050 18051 fgrep 18052 18053 Name 18054 18055 fgrep -- search a file with a fixed pattern 18056 18057 Description 18058 18059 fgrep is equivalent to grep -F. For further details, see the 18060 specification for grep. 18061 18062 file 18063 18064 Name 18065 18066 file -- determine file type 18067 18068 Description 18069 18070 file is as specified in ISO POSIX (2003), but with differences 18071 as listed below. 18072 18073 Differences 18074 18075 The -M, -h, -d, and -i options need not be supported. 18076 18077 find 18078 18079 Name 18080 18081 find -- search for files in a directory hierarchy 18082 18083 Description 18084 18085 find shall behave as specified in ISO POSIX (2003), except as 18086 described below. 18087 18088 Differences 18089 18090 Pattern Matching 18091 18092 Some elements of the Pattern Matching Notation are optional; 18093 see Internationalization and Pattern Matching Notation. 18094 18095 Option and Operand Handling 18096 18097 Options and operands to find shall behave as described in ISO 18098 POSIX (2003), except as follows: 18099 18100 -H 18101 18102 need not be supported 18103 -L 18104 18105 need not be supported 18106 -exec ... + 18107 18108 argument aggregation need not be supported 18109 18110 Rationale: The -H and -L options are not yet widely 18111 available in implementations of the find command, nor is 18112 argument aggregation. A future version of this 18113 specification will require these features be supported. 18114 18115 fuser 18116 18117 Name 18118 18119 fuser -- identify processes using files or sockets 18120 18121 Description 18122 18123 fuser is as specified in ISO POSIX (2003), but with 18124 differences as listed below. 18125 18126 Differences 18127 18128 The fuser command is a system administration utility, see Path 18129 For System Administration Utilities. 18130 18131 Option Differences 18132 18133 -c 18134 18135 has unspecified behavior. 18136 -f 18137 18138 has unspecified behavior. 18139 18140 gettext 18141 18142 Name 18143 18144 gettext -- retrieve text string from message catalog 18145 18146 Synopsis 18147 18148 gettext [options] [textdomain] msgid 18149 gettext -s [options] msgid... 18150 18151 Description 18152 18153 The gettext utility retrieves a translated text string 18154 corresponding to string msgid from a message object generated 18155 with msgfmt utility. 18156 18157 The message object name is derived from the optional argument 18158 textdomain if present, otherwise from the TEXTDOMAIN 18159 environment variable. If no domain is specified, or if a 18160 corresponding string cannot be found, gettext prints msgid. 18161 18162 Ordinarily gettext looks for its message object in 18163 dirname/lang/LC_MESSAGES where dirname is the 18164 implementation-defined default directory and lang is the 18165 locale name. If present, the TEXTDOMAINDIR environment 18166 variable replaces the dirname. 18167 18168 This utility interprets C escape sequences such as \t for tab. 18169 Use \\ to print a backslash. To produce a message on a line of 18170 its own, either put a \n at the end of msgid, or use this 18171 command in conjunction with the printf utility. 18172 18173 When used with the -s option the gettext utility behaves like 18174 the echo utility, except that the message corresponding to 18175 msgid in the selected catalog provides the arguments. 18176 18177 Options 18178 18179 -d domainname, --domain=domainname 18180 18181 PARAMETER translated messages from domainname. 18182 -e 18183 18184 Enable expansion of some escape sequences. 18185 -n 18186 18187 Suppress trailing newline. 18188 18189 Operands 18190 18191 The following operands are supported: 18192 18193 textdomain 18194 18195 A domain name used to retrieve the messages. 18196 msgid 18197 18198 A key to retrieve the localized message. 18199 18200 Environment Variables 18201 18202 LANGUAGE 18203 18204 Specifies one or more locale names. 18205 LANG 18206 18207 Specifies locale name. 18208 LC_MESSAGES 18209 18210 Specifies messaging locale, and if present overrides LANG for 18211 messages. 18212 TEXTDOMAIN 18213 18214 Specifies the text domain name, which is identical to the 18215 message object filename without .mo suffix. 18216 TEXTDOMAINDIR 18217 18218 Specifies the pathname to the message catalog, and if present 18219 replaces the implementation-defined default directory. 18220 18221 Exit Status 18222 18223 The following exit values are returned: 18224 18225 0 18226 18227 Successful completion. 18228 >0 18229 18230 An error occurred. 18231 18232 grep 18233 18234 Name 18235 18236 grep -- print lines matching a pattern 18237 18238 Description 18239 18240 grep is as specified in ISO POSIX (2003), but with differences 18241 as listed below. 18242 18243 LSB Differences 18244 18245 Certain aspects of regular expression matching are optional; 18246 see Internationalization and Regular Expressions. 18247 18248 groupadd 18249 18250 Name 18251 18252 groupadd -- create a new group 18253 18254 Synopsis 18255 18256 groupadd [-g gid [-o]] group 18257 18258 Description 18259 18260 If the caller has appropriate privilege, the groupadd command 18261 shall create a new group named group. The group name shall be 18262 unique in the group database. If no gid is specified, groupadd 18263 shall create the new group with a unique group ID. 18264 18265 The groupadd command is a system administration utility, see 18266 Path For System Administration Utilities. 18267 18268 Options 18269 18270 -g gid [-o] 18271 18272 The new group shall have group ID gid. If the -o option is not 18273 used, no other group shall have this group ID. The value of 18274 gid shall be non-negative. 18275 18276 groupdel 18277 18278 Name 18279 18280 groupdel -- delete a group 18281 18282 Synopsis 18283 18284 groupdel group 18285 18286 Description 18287 18288 If the caller has sufficient privilege, the groupdel command 18289 shall modify the system group database, deleting the group 18290 named group. If the group named group does not exist, groupdel 18291 shall issue a diagnostic message and exit with a non-zero exit 18292 status. 18293 18294 The groupdel command is a system administration utility, see 18295 Path For System Administration Utilities. 18296 18297 groupmod 18298 18299 Name 18300 18301 groupmod -- modify a group 18302 18303 Synopsis 18304 18305 groupmod [-g gid [-o]] [-n group_name] group 18306 18307 Description 18308 18309 If the caller has appropriate privilege, the groupmod command 18310 shall modify the entry in the system group database 18311 corresponding to a group named group. 18312 18313 The groupmod command is a system administration utility, see 18314 Path For System Administration Utilities. 18315 18316 Options 18317 18318 -g gid [-o] 18319 18320 Modify the group's group ID, setting it to gid. If the -o 18321 option is not used, no other group shall have this group ID. 18322 The value of gidshall be non-negative. 18323 18324 Note: Only the group ID in the database is altered; any 18325 files with group ownership set to the original group ID are 18326 unchanged by this modification. 18327 18328 -n group_name 18329 18330 changes the name of the group from group to group_name. 18331 18332 groups 18333 18334 Name 18335 18336 groups -- display a group 18337 18338 Synopsis 18339 18340 groups [user] 18341 18342 Description 18343 18344 The groups command shall behave as id -Gn [user], as specified 18345 in ISO POSIX (2003). The optional user parameter will display 18346 the groups for the named user. 18347 18348 gunzip 18349 18350 Name 18351 18352 gunzip -- uncompress files 18353 18354 Description 18355 18356 gunzip is equivalent to gzip -d. See the specification for 18357 gzip for further details. 18358 18359 gzip 18360 18361 Name 18362 18363 gzip -- compress or expand files 18364 18365 Synopsis 18366 18367 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 18368 18369 Description 18370 18371 The gzip command shall attempt to reduce the size of the named 18372 files. Whenever possible, each file is replaced by one with 18373 the extension .gz, while keeping the same ownership, modes, 18374 access and modification times. If no files are specified, or 18375 if a file name is -, the standard input is compressed to the 18376 standard output. gzip shall only attempt to compress regular 18377 files. In particular, it will ignore symbolic links. 18378 18379 When compressing, gzip uses the deflate algorithm specified in 18380 RFC 1951: DEFLATE Compressed Data Format Specification and 18381 stores the result in a file using the gzip file format 18382 specified in RFC 1952: GZIP File Format Specification. 18383 18384 Options 18385 18386 -c, --stdout, --to-stdout 18387 writes output on standard output, leaving the original 18388 files unchanged. If there are several input files, the 18389 output consists of a sequence of independently 18390 compressed members. To obtain better compression, 18391 concatenate all input files before compressing them. 18392 18393 -d, --decompress, --uncompress 18394 the name operands are compressed files, and gzip shall 18395 decompress them. 18396 18397 -f, --force 18398 forces compression or decompression even if the file 18399 has multiple links or the corresponding file already 18400 exists, or if the compressed data is read from or 18401 written to a terminal. If the input data is not in a 18402 format recognized by gzip, and if the option --stdout 18403 is also given, copy the input data without change to 18404 the standard ouput: let gzip behave as cat. If -f is 18405 not given, and when not running in the background, gzip 18406 prompts to verify whether an existing file should be 18407 overwritten. 18408 18409 -l, --list 18410 lists the compressed size, uncompressed size, ratio and 18411 uncompressed name for each compressed file. For files 18412 that are not in gzip format, the uncompressed size 18413 shall be given as -1. If the --verbose or -v option is 18414 also specified, the crc and timestamp for the 18415 uncompressed file shall also be displayed. 18416 18417 For decompression, gzip shall support at least the 18418 following compression methods: 18419 18420 + deflate (RFC 1951: DEFLATE Compressed Data Format 18421 Specification) 18422 + compress (ISO POSIX (2003)) 18423 18424 The crc shall be given as ffffffff for a file not in 18425 gzip format. 18426 18427 If the --name or -N option is also specified, the 18428 uncompressed name, date and time are those stored 18429 within the compressed file, if present. 18430 18431 If the --quiet or -q option is also specified, the 18432 title and totals lines are not displayed. 18433 18434 -L, --license 18435 displays the gzip license and quit. 18436 18437 -n, --no-name 18438 does not save the original file name and time stamp by 18439 default when compressing. (The original name is always 18440 saved if the name had to be truncated.) When 18441 decompressing, do not restore the original file name if 18442 present (remove only the gzip suffix from the 18443 compressed file name) and do not restore the original 18444 time stamp if present (copy it from the compressed 18445 file). This option is the default when decompressing. 18446 18447 -N, --name 18448 always saves the original file name and time stamp when 18449 compressing; this is the default. When decompressing, 18450 restore the original file name and time stamp if 18451 present. This option is useful on systems which have a 18452 limit on file name length or when the time stamp has 18453 been lost after a file transfer. 18454 18455 -q, --quiet 18456 suppresses all warnings. 18457 18458 -r, --recursive 18459 travels the directory structure recursively. If any of 18460 the file names specified on the command line are 18461 directories, gzip will descend into the directory and 18462 compress all the files it finds there (or decompress 18463 them in the case of gunzip). 18464 18465 -S .suf, --sufix .suf 18466 uses suffix .suf instead of .gz. 18467 18468 -t, --test 18469 checks the compressed file integrity. 18470 18471 -v, --verbose 18472 displays the name and percentage reduction for each 18473 file compressed or decompressed. 18474 18475 -#, --fast, --best 18476 regulates the speed of compression using the specified 18477 digit #, where -1 or --fast indicates the fastest 18478 compression method (less compression) and -9 or --best 18479 indicates the slowest compression method (best 18480 compression). The default compression level is -6 (that 18481 is, biased towards high compression at expense of 18482 speed). 18483 18484 LSB Deprecated Options 18485 18486 The behaviors specified in this section are expected to 18487 disappear from a future version of the LSB; applications 18488 should only use the non-LSB-deprecated behaviors. 18489 18490 -V, --version 18491 18492 displays the version number and compilation options, then 18493 quits. 18494 18495 hostname 18496 18497 Name 18498 18499 hostname -- show or set the system's host name 18500 18501 Synopsis 18502 18503 hostname [name] 18504 18505 Description 18506 18507 hostname is used to either display or, with appropriate 18508 privileges, set the current host name of the system. The host 18509 name is used by many applications to identify the machine. 18510 18511 When called without any arguments, the program displays the 18512 name of the system as returned by the gethostname() function. 18513 18514 When called with a name argument, and the user has appropriate 18515 privilege, the command sets the host name. 18516 18517 Note: It is not specified if the hostname displayed will be 18518 a fully qualified domain name. Applications requiring a 18519 particular format of hostname should check the output and 18520 take appropriate action. 18521 18522 install 18523 18524 Name 18525 18526 install -- copy files and set attributes 18527 18528 Synopsis 18529 18530 install [option...] SOURCE DEST 18531 install [option...] SOURCE... DEST 18532 install [-d | --directory] [option...] DIRECTORY... 18533 18534 Description 18535 18536 In the first two formats, copy SOURCE to DEST or multiple 18537 SOURCE(s) to the existing DEST directory, optionally setting 18538 permission modes and file ownership. In the third format, each 18539 DIRECTORY and any missing parent directories shall be created. 18540 18541 Standard Options 18542 18543 --backup[=METHOD] 18544 makes a backup of each existing destination file. 18545 METHOD may be one of the following: 18546 18547 none or off 18548 18549 never make backups. 18550 numbered or t 18551 18552 make numbered backups. A numbered backup has the form 18553 "%s.~%d~", target_name, version_number. Each backup shall 18554 increment the version number by 1. 18555 existing or nil 18556 18557 behave as numbered if numbered backups exist, or simple 18558 otherwise. 18559 simple or never 18560 18561 append a suffix to the name. The default suffix is '~', but 18562 can be overriden by setting SIMPLE_BACKUP_SUFFIX in the 18563 environment, or via the -S or --suffix option. 18564 18565 If no METHOD is specified, the environment variable 18566 VERSION_CONTROL shall be examined for one of the above. 18567 Unambiguous abbreviations of METHOD shall be accepted. 18568 If no METHOD is specified, or if METHOD is empty, the 18569 backup method shall default to existing. 18570 18571 If METHOD is invalid or ambiguous, install shall fail 18572 and issue a diagnostic message. 18573 18574 -b 18575 is equivalent to --backup=existing. 18576 18577 -d, --directory 18578 treats all arguments as directory names; creates all 18579 components of the specified directories. 18580 18581 -D 18582 creates all leading components of DEST except the last, 18583 then copies SOURCE to DEST; useful in the 1st format. 18584 18585 -g GROUP, --group=GROUP 18586 if the user has appropriate privilege, sets group 18587 ownership, instead of process' current group. GROUP is 18588 either a name in the user group database, or a positive 18589 integer, which shall be used as a group-id. 18590 18591 -m MODE, --mode=MODE 18592 sets permission mode (specified as in chmod), instead 18593 of the default rwxr-xr-x. 18594 18595 -o OWNER, --owner=OWNER 18596 if the user has appropriate privilege, sets ownership. 18597 OWNER is either a name in the user login database, or a 18598 positive integer, which shall be used as a user-id. 18599 18600 -p, --preserve-timestamps 18601 copies the access and modification times of SOURCE 18602 files to corresponding destination files. 18603 18604 -s, --strip 18605 strips symbol tables, only for 1st and 2nd formats. 18606 18607 -S SUFFIX, --suffix=SUFFIX 18608 equivalent to --backup=existing, except if a simple 18609 suffix is required, use SUFFIX. 18610 18611 --verbose 18612 prints the name of each directory as it is created. 18613 18614 -v, --verbose 18615 print the name of each file before copying it to 18616 stdout. 18617 18618 install_initd 18619 18620 Name 18621 18622 install_initd -- activate an init script 18623 18624 Synopsis 18625 18626 /usr/lib/lsb/install_initd initd_file 18627 18628 Description 18629 18630 install_initd shall activate a system initialization file that 18631 has been copied to an implementation defined location such 18632 that this file shall be run at the appropriate point during 18633 system initialization. The install_initd command is typically 18634 called in the postinstall script of a package, after the 18635 script has been copied to /etc/init.d. See also Installation 18636 and Removal of Init Scripts. 18637 18638 ipcrm 18639 18640 Name 18641 18642 ipcrm -- remove IPC Resources 18643 18644 Synopsis 18645 18646 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid 18647 | -M shmkey]... 18648 ipcrm [shm | msg | msg] id... 18649 18650 Description 18651 18652 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 18653 the ipcrm shall behave as described in ISO POSIX (2003). 18654 18655 Otherwise, ipcrm shall remove the resource of the specified 18656 type identified by id. 18657 18658 Future Directions 18659 18660 A future revision of this specification may deprecate the 18661 second synopsis form. 18662 18663 Rationale: In its first Linux implementation, ipcrm used 18664 the second syntax shown in the SYNOPSIS. Functionality 18665 present in other implementations of ipcrm has since been 18666 added, namely the ability to delete resources by key (not 18667 just identifier), and to respect the same command line 18668 syntax. The previous syntax is still supported for 18669 backwards compatibility only. 18670 18671 ipcs 18672 18673 Name 18674 18675 ipcs -- provide information on ipc facilities 18676 18677 Synopsis 18678 18679 ipcs [-smq] [-tcp] 18680 18681 Description 18682 18683 ipcs provides information on the ipc facilities for which the 18684 calling process has read access. 18685 18686 Note: Although this command has many similarities with the 18687 optional ipcs utility described in ISO POSIX (2003), it has 18688 substantial differences and is therefore described 18689 separately. The options specified here have similar meaning 18690 to those in ISO POSIX (2003); other options specified there 18691 have unspecified behavior on an LSB conforming 18692 implementation. See Application Usage below. The output 18693 format is not specified. 18694 18695 Resource display options 18696 18697 -m 18698 18699 shared memory segments. 18700 -q 18701 18702 message queues. 18703 -s 18704 18705 semaphore arrays. 18706 18707 Output format options 18708 18709 -t 18710 18711 time. 18712 -p 18713 18714 pid. 18715 -c 18716 18717 creator. 18718 18719 Application Usage 18720 18721 In some implementations of ipcs the -a option will print all 18722 information available. In other implementations the -a option 18723 will print all resource types. Therefore, applications shall 18724 not use the -a option. 18725 18726 Some implementations of ipcs provide more output formats than 18727 are specified here. These options are not consistent between 18728 differing implementations of ipcs. Therefore, only the -t, -c 18729 and -p option formatting flags may be used. At least one of 18730 the -t, -c and -p options and at least one of -m, -q and -s 18731 options shall be specified. If no options are specified, the 18732 output is unspecified. 18733 18734 killall 18735 18736 Name 18737 18738 killall -- kill processes by name 18739 18740 Synopsis 18741 18742 killall [-egiqvw] [-signal] name... 18743 killall -l 18744 killall -V 18745 18746 Description 18747 18748 killall sends a signal to all processes running any of the 18749 specified commands. If no signal name is specified, SIGTERM is 18750 sent. 18751 18752 Signals can be specified either by name (e.g. -HUP) or by 18753 number (e.g. -1). Signal 0 (check if a process exists) can 18754 only be specified by number. 18755 18756 If the command name contains a slash (/), processes executing 18757 that particular file will be selected for killing, independent 18758 of their name. 18759 18760 killall returns a non-zero return code if no process has been 18761 killed for any of the listed commands. If at least one process 18762 has been killed for each command, killall returns zero. 18763 18764 A killall process never kills itself (but may kill other 18765 killall processes). 18766 18767 Standard Options 18768 18769 -e 18770 18771 requires an exact match for very long names. If a command name 18772 is longer than 15 characters, the full name may be unavailable 18773 (i.e. it is swapped out). In this case, killall will kill 18774 everything that matches within the first 15 characters. With 18775 -e, such entries are skipped. killall prints a message for 18776 each skipped entry if -v is specified in addition to -e. 18777 -g 18778 18779 kills the process group to which the process belongs. The kill 18780 signal is only sent once per group, even if multiple processes 18781 belonging to the same process group were found. 18782 -i 18783 18784 asks interactively for confirmation before killing. 18785 -l 18786 18787 lists all known signal names. 18788 -q 18789 18790 does not complain if no processes were killed. 18791 -v 18792 18793 reports if the signal was successfully sent. 18794 18795 LSB Deprecated Options 18796 18797 The behaviors specified in this section are expected to 18798 disappear from a future version of the LSB; applications 18799 should only use the non-LSB-deprecated behaviors. 18800 18801 -V 18802 18803 displays version information. 18804 18805 lpr 18806 18807 Name 18808 18809 lpr -- off line print 18810 18811 Synopsis 18812 18813 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 18814 title] [name ......] 18815 18816 Description 18817 18818 lpr uses a spooling daemon to print the named files when 18819 facilities become available. If no names appear, the standard 18820 input is assumed. 18821 18822 Standard Options 18823 18824 -l 18825 18826 identifies binary data that is not to be filtered but sent as 18827 raw input to printer. 18828 -p 18829 18830 formats with "pr" before sending to printer. 18831 -Pprinter 18832 18833 sends output to the printer named printer instead of the 18834 default printer. 18835 -h 18836 18837 suppresses header page. 18838 -s 18839 18840 uses symbolic links. 18841 -#copies 18842 18843 specifies copies as the number of copies to print. 18844 -J name 18845 18846 specifies name as the job name for the header page. 18847 -T title 18848 18849 specifies title as the title used for "pr". 18850 18851 ls 18852 18853 Name 18854 18855 ls -- list directory contents 18856 18857 Description 18858 18859 ls shall behave as specified in ISO POSIX (2003), but with 18860 extensions listed below. 18861 18862 Extensions 18863 18864 -l 18865 18866 If the file is a character special or block special file, the 18867 size of the file shall be replaced with two unsigned numbers 18868 in the format "%u, %u", representing the major and minor 18869 device numbers associated with the special file. 18870 18871 Note: The LSB does not specify the meaning of the major and 18872 minor devices numbers. 18873 18874 -p 18875 18876 in addition to ISO POSIX (2003) XSI optional behavior of 18877 printing a slash for a directory, ls -p may display other 18878 characters for other file types. 18879 18880 lsb_release 18881 18882 Name 18883 18884 lsb_release -- print distribution specific information 18885 18886 Synopsis 18887 18888 lsb_release [OPTION...] 18889 18890 Description 18891 18892 The lsb_release command prints certain LSB (Linux Standard 18893 Base) and Distribution information. 18894 18895 If no options are given, the -v option is assumed. 18896 18897 Options 18898 18899 -v, --version 18900 18901 displays version of LSB against which distribution is 18902 compliant. The version is expressed as a colon separated list 18903 of LSB module descriptions. LSB module descriptions are dash 18904 separated tuples containing the module name, version, and 18905 architecture name. The output is a single line of text of the 18906 following format: 18907 18908 LSB Version:\tListAsDescribedAbove 18909 18910 Note: An implementation may support multiple releases of 18911 the same module. Version specific library interfaces, if 18912 any, will be selected by the program interpreter, which 18913 changes from release to release. Version specific commands 18914 and utilities, if any, will be described in the relevant 18915 specification. 18916 18917 -i, --id 18918 18919 displays string id of distributor. The output is a single line 18920 of text of the following format: 18921 18922 Distributor ID:\tDistributorID 18923 -d, --description 18924 18925 displays single line text description of distribution. The 18926 output is of the following format: 18927 18928 Description:\tDescription 18929 -r, --release 18930 18931 displays release number of distribution. The output is a 18932 single line of text of the following format: 18933 18934 Release:\tRelease 18935 -c, --codename 18936 18937 displays codename according to distribution release. The 18938 output is a single line of text of the following format. 18939 18940 Codename:\tCodename 18941 -a, --all 18942 18943 displays all of the above information. 18944 -s, --short 18945 18946 displays all of the above information in short output format. 18947 -h, --help 18948 18949 displays a human-readable help message. 18950 18951 Examples 18952 18953 The following command will list the LSB Profiles which are 18954 currently supported on this platform. 18955 example% lsb_release -v 18956 LSB Version: core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch 18957 18958 m4 18959 18960 Name 18961 18962 m4 -- macro processor 18963 18964 Description 18965 18966 m4 is as specified in ISO POSIX (2003), but with extensions as 18967 listed below. 18968 18969 Extensions 18970 18971 -P 18972 18973 forces all builtins to be prefixed with m4_. For example, 18974 define becomes m4_define. 18975 -I directory 18976 18977 Add directory to the end of the search path for includes. 18978 18979 md5sum 18980 18981 Name 18982 18983 md5sum -- generate or check MD5 message digests 18984 18985 Synopsis 18986 18987 md5sum [-c [file] | file...] 18988 18989 Description 18990 18991 For each file, write to standard output a line containing the 18992 MD5 message digest of that file, followed by one or more blank 18993 characters, followed by the name of the file. The MD5 message 18994 digest shall be calculated according to RFC 1321: The MD5 18995 Message-Digest Algorithm and output as 32 hexadecimal digits. 18996 18997 If no file names are specified as operands, read from standard 18998 input and use "-" as the file name in the output. 18999 19000 Options 19001 19002 -c [file] 19003 19004 checks the MD5 message digest of all files named in file 19005 against the message digest listed in the same file. The actual 19006 format of file is the same as the output of md5sum. That is, 19007 each line in the file describes a file. If file is not 19008 specified, read message digests from stdin. 19009 19010 Exit Status 19011 19012 md5sum shall exit with status 0 if the sum was generated 19013 successfully, or, in check mode, if the check matched. 19014 Otherwise, md5sum shall exit with a non-zero status. 19015 19016 mknod 19017 19018 Name 19019 19020 mknod -- make special files 19021 19022 Synopsis 19023 19024 mknod [-m mode | --mode=mode] name type [major minor] 19025 mknod [--version] 19026 19027 Description 19028 19029 The mknod command shall create a special file named name of 19030 the given type. 19031 19032 The type shall be one of the following: 19033 19034 b 19035 19036 creates a block (buffered) special file with the specified 19037 major and minor device numbers. 19038 c, u 19039 19040 creates a character (unbuffered) special file with the 19041 specified major and minor device numbers. 19042 p 19043 19044 creates a FIFO. 19045 19046 Options 19047 19048 -m mode, --mode=mode 19049 19050 create the special file with file access permissions set as 19051 described in mode. The permissions may be any absolute value 19052 (i.e. one not containing '+' or '-') acceptable to the chmod 19053 command. 19054 --version 19055 19056 output version information and exit. 19057 19058 Note: This option may be deprecated in a future release of 19059 this specification. 19060 19061 If type is p, major and minor shall not be specified. 19062 Otherwise, these parameters are mandatory. 19063 19064 Future Directions 19065 19066 This command may be deprecated in a future version of this 19067 specification. The major and minor operands are insufficently 19068 portable to be specified usefully here. Only a FIFO can be 19069 portably created by this command, and the mkfifo command is a 19070 simpler interface for that purpose. 19071 19072 mktemp 19073 19074 Name 19075 19076 mktemp -- make temporary file name (unique) 19077 19078 Synopsis 19079 19080 mktemp [-q] [-u] template 19081 19082 Description 19083 19084 The mktemp command takes the given file name template and 19085 overwrites a portion of it to create a file name. This file 19086 name shall be unique and suitable for use by the application. 19087 19088 The template should have at least six trailing 'X' characters. 19089 These characters are replaced with characters from the 19090 portable filename character set in order to generate a unique 19091 name. 19092 19093 If mktemp can successfully generate a unique file name, and 19094 the -u option is not present, the file shall be created with 19095 read and write permission only for the current user. The 19096 mktemp command shall write the filename generated to the 19097 standard output. 19098 19099 Options 19100 19101 -q 19102 19103 fail silently if an error occurs. Diagnostic messages to 19104 stderr are suppressed, but the command shall still exit with a 19105 non-zero exit status if an error occurs. 19106 -u 19107 19108 operates in `unsafe' mode. A unique name is generated, but the 19109 temporary file shall be unlinked before mktemp exits. Use of 19110 this option is not encouraged. 19111 19112 more 19113 19114 Name 19115 19116 more -- display files on a page-by-page basis 19117 19118 Description 19119 19120 more is as specified in ISO POSIX (2003), but with differences 19121 as listed below. 19122 19123 Differences 19124 19125 The more command need not respect the LINES and COLUMNS 19126 environment variables. 19127 19128 The following additional options may be supported: 19129 19130 -num 19131 19132 specifies an integer which is the screen size (in lines). 19133 +num 19134 19135 starts at line number num. 19136 +/pattern 19137 19138 Start at the first line matching the pattern, equivalent to 19139 executing the search forward (/) command with the given 19140 pattern immediately after opening each file. 19141 19142 The following options from ISO POSIX (2003) may behave 19143 differently: 19144 19145 -e 19146 19147 has unspecified behavior. 19148 -i 19149 19150 has unspecified behavior. 19151 -n 19152 19153 has unspecified behavior. 19154 -p 19155 19156 Either clear the whole screen before displaying any text 19157 (instead of the usual scrolling behavior), or provide the 19158 behavior specified by ISO POSIX (2003). In the latter case, 19159 the syntax is "-p command". 19160 -t 19161 19162 has unspecified behavior. 19163 19164 The more command need not support the following interactive 19165 commands: 19166 19167 g 19168 G 19169 u 19170 control u 19171 control f 19172 newline 19173 j 19174 k 19175 r 19176 R 19177 m 19178 ' (return to mark) 19179 /! 19180 ? 19181 N 19182 :e 19183 :t 19184 control g 19185 ZZ 19186 19187 Rationale 19188 19189 The +num and +/string options are deprecated in SUSv2, and 19190 have been removed in ISO POSIX (2003); however this 19191 specification continues to specify them because the publicly 19192 available util-linux package does not support the replacement 19193 (-p command). The +command option as found in SUSv2 is more 19194 general than is specified here, but the util-linux package 19195 appears to only support the more specific +num and +/string 19196 forms. 19197 19198 mount 19199 19200 Name 19201 19202 mount -- mount a file system 19203 19204 Synopsis 19205 19206 mount [-hV] 19207 mount [-a] [-fFnrsvw] [-t vfstype] 19208 mount [-fnrsvw] [-o options [,...]] [device | dir] 19209 mount [-fnrsvw] [-t vfstype] [-o options] device dir 19210 19211 Description 19212 19213 As described in ISO POSIX (2003), all files in the system are 19214 organized in a directed graph, known as the file hierarchy, 19215 rooted at /. These files can be spread out over several 19216 underlying devices. The mount command shall attach the file 19217 system found on some underlying device to the file hierarchy. 19218 19219 Options 19220 19221 -v 19222 19223 invoke verbose mode. The mount command shall provide 19224 diagnostic messages on stdout. 19225 -a 19226 19227 mount all file systems (of the given types) mentioned in 19228 /etc/fstab. 19229 -F 19230 19231 If the -a option is also present, fork a new incarnation of 19232 mount for each device to be mounted. This will do the mounts 19233 on different devices or different NFS servers in parallel. 19234 -f 19235 19236 cause everything to be done except for the actual system call; 19237 if it's not obvious, this `fakes' mounting the file system. 19238 -n 19239 19240 mount without writing in /etc/mtab. This is necessary for 19241 example when /etc is on a read-only file system. 19242 -s 19243 19244 ignore mount options not supported by a file system type. Not 19245 all file systems support this option. 19246 -r 19247 19248 mount the file system read-only. A synonym is -o ro. 19249 -w 19250 19251 mount the file system read/write. (default) A synonym is -o 19252 rw. 19253 -L label 19254 19255 If the file /proc/partitions is supported, mount the partition 19256 that has the specified label. 19257 -U uuid 19258 19259 If the file /proc/partitions is supported, mount the partition 19260 that has the specified uuid. 19261 -t vfstype 19262 19263 indicate a file system type of vfstype. 19264 19265 More than one type may be specified in a comma separated list. 19266 The list of file system types can be prefixed with no to 19267 specify the file system types on which no action should be 19268 taken. 19269 -o 19270 19271 options are specified with a -o flag followed by a 19272 comma-separated string of options. Some of these options are 19273 only useful when they appear in the /etc/fstab file. The 19274 following options apply to any file system that is being 19275 mounted: 19276 19277 async 19278 19279 perform all I/O to the file system asynchronously. 19280 atime 19281 19282 update inode access time for each access. (default) 19283 auto 19284 19285 in /etc/fstab, indicate the device is mountable with -a. 19286 defaults 19287 19288 use default options: rw, suid, dev, exec, auto, nouser, async. 19289 dev 19290 19291 interpret character or block special devices on the file 19292 system. 19293 exec 19294 19295 permit execution of binaries. 19296 noatime 19297 19298 do not update file access times on this file system. 19299 noauto 19300 19301 in /etc/fstab, indicates the device is only explicitly 19302 mountable. 19303 nodev 19304 19305 do not interpret character or block special devices on the 19306 file system. 19307 noexec 19308 19309 do not allow execution of any binaries on the mounted file 19310 system. 19311 nosuid 19312 19313 do not allow set-user-identifier or set-group-identifier bits 19314 to take effect. 19315 nouser 19316 19317 forbid an unprivileged user to mount the file system. 19318 (default) 19319 remount 19320 19321 remount an already-mounted file system. This is commonly used 19322 to change the mount options for a file system, especially to 19323 make a read-only file system writable. 19324 ro 19325 19326 mount the file system read-only. 19327 rw 19328 19329 mount the file system read-write. 19330 suid 19331 19332 allow set-user-identifier or set-group-identifier bits to take 19333 effect. 19334 sync 19335 19336 do all I/O to the file system synchronously. 19337 user 19338 19339 allow an unprivilieged user to mount the file system. This 19340 option implies the options noexec, nosuid, nodev unless 19341 overridden by subsequent options. 19342 19343 LSB Deprecated Options 19344 19345 The behaviors specified in this section are expected to 19346 disappear from a future version of the LSB; applications 19347 should only use the non-LSB-deprecated behaviors. 19348 19349 -V 19350 19351 output version and exit. 19352 19353 msgfmt 19354 19355 Name 19356 19357 msgfmt -- create a message object from a message file 19358 19359 Synopsis 19360 19361 msgfmt [options...] filename... 19362 19363 Description 19364 19365 The msgfmt command generates a binary message catalog from a 19366 textual translation description. Message catalogs, or message 19367 object files, are stored in files with a .mo extension. 19368 19369 Note: The format of message object files is not guaranteed 19370 to be portable. Message catalogs should always be generated 19371 on the target architecture using the msgfmt command. 19372 19373 The source message files, otherwise known as portable object 19374 files, have a .po extension. 19375 19376 The filename operands shall be portable object files. The .po 19377 file contains messages to be displayed to users by system 19378 utilities or by application programs. The portable object 19379 files are text files, and the messages in them can be 19380 rewritten in any language supported by the system. 19381 19382 If any filename is -, a portable object file shall be read 19383 from the standard input. 19384 19385 The msgfmt command interprets data as characters according to 19386 the current setting of the LC_CTYPE locale category. 19387 19388 Options 19389 19390 -c, --check 19391 Detect and diagnose input file anomalies which might 19392 represent translation errors. The msgid and msgstr 19393 strings are studied and compared. It is considered 19394 abnormal that one string starts or ends with a newline 19395 while the other does not. 19396 19397 If the message is flagged as c-format (see Comment 19398 Handling), check that the msgid string and the msgstr 19399 translation have the same number of % format 19400 specifiers, with matching types. 19401 19402 -D directory, --directory=directory 19403 Add directory to list for input files search. If 19404 filename is not an absolute pathname and filename 19405 cannot be opened, search for it in directory. This 19406 option may be repeated. Directories shall be searched 19407 in order, with the leftmost directory searched first. 19408 19409 -f, --use-fuzzy 19410 Use entries marked as fuzzy in output. If this option 19411 is not specified, such entries are not included into 19412 the output. See Comment Handling below. 19413 19414 -o output-file, --output-file=output-file 19415 Specify the output file name as output-file. If 19416 multiple domains or duplicate msgids in the .po file 19417 are present, the behavior is unspecified. If 19418 output-file is -, output is written to standard output. 19419 19420 --strict 19421 Ensure that all output files have a .mo extension. 19422 Output files are named either by the -o (or 19423 --output-file) option, or by domains found in the input 19424 files. 19425 19426 -v, --verbose 19427 Print additional information to the standard error, 19428 including the number of translated strings processed. 19429 19430 Operands 19431 19432 The filename operands are treated as portable object files. 19433 The format of portable object files is defined in EXTENDED 19434 DESCRIPTION. 19435 19436 Standard Input 19437 19438 The standard input is not used unless a filename operand is 19439 specified as "-". 19440 19441 Environment Variables 19442 19443 LANGUAGE 19444 19445 Specifies one or more locale names. 19446 LANG 19447 19448 Specifies locale name. 19449 LC_ALL 19450 19451 Specifies locale name for all categories. If defined, 19452 overrides LANG, LC_CTYPE and LC_MESSAGES. 19453 LC_CTYPE 19454 19455 Determine the locale for the interpretation of sequences of 19456 bytes of text data as characters (for example, single-byte as 19457 opposed to multi-byte characters in arguments and input 19458 files). 19459 LC_MESSAGES 19460 19461 Specifies messaging locale, and if present overrides LANG for 19462 messages. 19463 19464 Standard Output 19465 19466 The standard output is not used unless the option-argument of 19467 the -o option is specified as -. 19468 19469 Extended Description 19470 19471 The format of portable object files (.po files) is defined as 19472 follows. Each .po file contains one or more lines, with each 19473 line containing either a comment or a statement. Comments 19474 start the line with a hash mark (#) and end with the newline 19475 character. Empty lines, or lines containing only white-space, 19476 shall be ignored. Comments can in certain circumstances alter 19477 the behavior of msgfmt. See Comment Handling below for details 19478 on comment processing. The format of a statement is: 19479 19480 directive value 19481 19482 Each directive starts at the beginning of the line and is 19483 separated from value by white space (such as one or more space 19484 or tab characters). The value consists of one or more quoted 19485 strings separated by white space. If two or more strings are 19486 specified as value, they are normalized into single string 19487 using the string normalization syntax specified in ISO C 19488 (1999). The following directives are supported: 19489 19490 domain domainname 19491 19492 msgid message_identifier 19493 19494 msgid_plural untranslated_string_plural 19495 19496 msgstr message_string 19497 19498 msgstr[n] message_string 19499 19500 The behavior of the domain directive is affected by the 19501 options used. See OPTIONS for the behavior when the -o option 19502 is specified. If the -o option is not specified, the behavior 19503 of the domain directive is as follows: 19504 19505 1. All msgids from the beginning of each .po file to the 19506 first domain directive are put into a default message 19507 object file, messages (or messages.mo if the --strict 19508 option is specified). 19509 2. When msgfmt encounters a domain domainname directive in 19510 the .po file, all following msgids until the next domain 19511 directive are put into the message object file domainname 19512 (or domainname.mo if --strict option is specified). 19513 3. Duplicate msgids are defined in the scope of each domain. 19514 That is, a msgid is considered a duplicate only if the 19515 identical msgid exists in the same domain. 19516 4. All duplicate msgids are ignored. 19517 19518 The msgid directive specifies the value of a message 19519 identifier associated with the directive that follows it. The 19520 msgid_plural directive specifies the plural form message 19521 specified to the plural message handling functions ngettext(), 19522 dngettext() or dcngettext(). The message_identifier string 19523 identifies a target string to be used at retrieval time. Each 19524 statement containing a msgid directive shall be followed by a 19525 statement containing a msgstr directive or msgstr[n] 19526 directives. 19527 19528 The msgstr directive specifies the target string associated 19529 with the message_identifier string declared in the immediately 19530 preceding msgid directive. 19531 19532 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 19533 target string to be used with plural form handling functions 19534 ngettext(), dngettext() and dcngettext(). 19535 19536 Message strings can contain the following escape sequences: 19537 19538 Table 11-1. Escape Sequences 19539 \n newline 19540 \t tab 19541 \v vertical tab 19542 \b backspace 19543 \r carriage return 19544 \f formfeed 19545 \\ backslash 19546 \" double quote 19547 \ddd octal bit pattern 19548 \xHH hexadecimal bit pattern 19549 19550 Comment Handling 19551 19552 Comments are introduced by a #, and continue to the end of the 19553 line. The second character (i.e. the character following the 19554 #) has special meaning. Regular comments should follow a space 19555 character. Other comment types include: 19556 19557 # normal-comments 19558 19559 #. automatic-comments 19560 19561 #: reference... 19562 19563 #, flag 19564 19565 Automatic and reference comments are typically generated by 19566 external utilities, and are not specified by the LSB. The 19567 msgfmt command shall ignore such comments. 19568 19569 Note: Portable object files may be produced by unspecified 19570 tools. Some of the comment types described here may arise 19571 from the use of such tools. It is beyond the scope of this 19572 specification to describe these tools. 19573 19574 The #, comments require one or more flags separated by the 19575 comma (,) character. The following flags can be specified: 19576 19577 fuzzy 19578 19579 This flag shows that the following msgstr string might not be 19580 a correct translation. Only the translator (i.e. the 19581 individual undertaking the translation) can judge if the 19582 translation requires further modification, or is acceptable as 19583 is. Once satisfied with the translation, the translator then 19584 removes this fuzzy flag. 19585 19586 If this flag is specified, the msgfmt utility will not 19587 generate the entry for the immediately following msgid in the 19588 output message catalog, unless the --use-fuzzy is specified. 19589 c-format, no-c-format 19590 19591 The c-format flag indicates that the msgid string is used as 19592 format string by printf()-like functions. If the c-format flag 19593 is given for a string the msgfmt utility may perform 19594 additional tests to check the validity of the translation. 19595 19596 Plurals 19597 19598 The msgid entry with empty string ("") is called the header 19599 entry and is treated specially. If the message string for the 19600 header entry contains nplurals=value, the value indicates the 19601 number of plural forms. For example, if nplurals=4, there are 19602 4 plural forms. If nplurals is defined, there should be a 19603 plural=expression on the same line, separated by a semicolon 19604 (;) character. The expression is a C language expression to 19605 determine which version of msgstr[n] to be used based on the 19606 value of n, the last argument of ngettext(), dngettext() or 19607 dcngettext(). For example: 19608 nplurals=2; plural=n == 1 ? 0 : 1 19609 19610 indicates that there are 2 plural forms in the language; 19611 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 19612 Another example: 19613 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 19614 19615 indicates that there are 3 plural forms in the language; 19616 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 19617 otherwise msgstr[2] is used. 19618 19619 If the header entry contains charset=codeset string, the 19620 codeset is used to indicate the codeset to be used to encode 19621 the message strings. If the output string's codeset is 19622 different from the message string's codeset, codeset 19623 conversion from the message strings's codeset to the output 19624 string's codeset will be performed upon the call of gettext(), 19625 dgettext(), dcgettext(), ngettext(), dngettext(), and 19626 dcngettext(). The output string's codeset is determined by the 19627 current locale's codeset (the return value of 19628 nl_langinfo(CODESET)) by default, and can be changed by the 19629 call of bind_textdomain_codeset(). 19630 19631 Exit Status 19632 19633 The following exit values are returned: 19634 19635 0 19636 19637 Successful completion. 19638 >0 19639 19640 An error occurred. 19641 19642 Application Usage 19643 19644 Neither msgfmt nor any gettext() function imposes a limit on 19645 the total length of a message. Installing message catalogs 19646 under the C locale is pointless, since they are ignored for 19647 the sake of efficiency. 19648 19649 Examples 19650 19651 Example 1: Examples of creating message objects from message 19652 files. 19653 19654 In this example module1.po, module2.po and module3.po are 19655 portable message object files. 19656 example% cat module1.po 19657 19658 # default domain "messages" 19659 19660 msgid "message one" 19661 19662 msgstr "mensaje nśmero uno" 19663 19664 # 19665 19666 domain "help_domain" 19667 19668 msgid "help two" 19669 19670 msgstr "ayuda nśmero dos" 19671 19672 # 19673 19674 domain "error_domain" 19675 19676 msgid "error three" 19677 19678 msgstr "error nśmero tres" 19679 19680 example% cat module2.po 19681 19682 # default domain "messages" 19683 19684 msgid "message four" 19685 19686 msgstr "mensaje nśmero cuatro" 19687 19688 # 19689 19690 domain "error_domain" 19691 19692 msgid "error five" 19693 19694 msgstr "error nśmero cinco" 19695 19696 # 19697 19698 domain "window_domain" 19699 19700 msgid "window six" 19701 19702 msgstr "ventana nśmero seises" 19703 19704 example% cat module3.po 19705 19706 # default domain "messages" 19707 19708 msgid "message seven" 19709 19710 msgstr "mensaje nśmero siete" 19711 19712 The following command will produce the output files messages, 19713 help_domain, and error_domain. 19714 example% msgfmt module1.po 19715 19716 The following command will produce the output files 19717 messages.mo, help_domain.mo, error_domain.mo, and 19718 window_domain.mo. 19719 example% msgfmt module1.po module2.po 19720 19721 The following example will produce the output file hello.mo. 19722 example% msgfmt -o hello.mo module3.po 19723 19724 newgrp 19725 19726 Name 19727 19728 newgrp -- change group ID 19729 19730 Synopsis 19731 19732 newgrp [group] 19733 19734 Description 19735 19736 The newgrp command is as specified in ISO POSIX (2003), but 19737 with differences as listed below. 19738 19739 Differences 19740 19741 The -l option specified in ISO POSIX (2003) need not be 19742 supported. 19743 19744 od 19745 19746 Name 19747 19748 od -- dump files in octal and other formats 19749 19750 Synopsis 19751 19752 od [-abcdfilox] [-w width | --width-width] [-v] [-A 19753 address_base] [-j skip] [-n count] [-t type_string] [file...] 19754 od --traditional [options] [file] [[+]offset [.] [b]] 19755 [[+]label [.] [b]] 19756 19757 Description 19758 19759 The od command shall provide all of the madatory functionality 19760 specified in ISO POSIX (2003), but with extensions and 19761 differences to the XSI optional behavior as listed below. 19762 19763 Extensions and Differences 19764 19765 -s 19766 unspecified behavior. 19767 19768 Note: Applications wishing to achieve the ISO POSIX (2003) 19769 behavior for -s should instead use -t d2. 19770 19771 -wwidth, --width[=width] 19772 each output line is limited to width bytes from the 19773 input. 19774 19775 --traditional 19776 accepts arguments in traditional form, see Traditional 19777 Usage below. 19778 19779 Note: The XSI optional behavior for offset handling 19780 described in ISO POSIX (2003) is not supported unless the 19781 --traditional option is also specified. 19782 19783 Pre-POSIX and XSI Specifications 19784 19785 The LSB supports mixing options between the mandatory and XSI 19786 optional synopsis forms in ISO POSIX (2003). The LSB shall 19787 support the following options: 19788 19789 -a 19790 19791 is equivalent to -t a, selects named characters. 19792 -b 19793 19794 is equivalent to -t o1, selects octal bytes. 19795 -c 19796 19797 is equivalent to -t c, selects characters. 19798 -d 19799 19800 is equivalent to -t u2, selects unsigned decimal two byte 19801 units. 19802 -f 19803 19804 is equivalent to -t fF, selects floats. 19805 -i 19806 19807 is equivalent to -t d2, selects decimal two byte units. 19808 19809 Note: This usage may change in future releases; portable 19810 applications should use -t d2. 19811 19812 -l 19813 19814 is equivalent to -t d4, selects decimal longs. 19815 -o 19816 19817 is equivalent to -t o2, selects octal two byte units. 19818 -x 19819 19820 is equivalent to -t x2, selects hexadecimal two byte units. 19821 19822 Note that the XSI option -s need not be supported. 19823 19824 Traditional Usage 19825 19826 If the --traditional option is specified, there may be between 19827 zero and three operands specified. 19828 19829 If no operands are specified, then od shall read the standard 19830 input. 19831 19832 If there is exactly one operand, and it is an offset of the 19833 form [+]offset[.][b], then it shall be interpreted as 19834 specified in ISO POSIX (2003). The file to be dumped shall be 19835 the standard input. 19836 19837 If there are exactly two operands, and they are both of the 19838 form [+]offset[.][b], then the first shall be treated as an 19839 offset (as above), and the second shall be a label, in the 19840 same format as the offset. If a label is specified, then the 19841 first output line produced for each input block shall be 19842 preceded by the input offset, cumulative across input files, 19843 of the next byte to be written, followed by the label, in 19844 parentheses. The label shall increment in the same manner as 19845 the offset. 19846 19847 If there are three operands, then the first shall be the file 19848 to dump, the second the offset, and the third the label. 19849 19850 Note: Recent versions of coreutils contain an od utility 19851 that conforms to ISO POSIX (2003). However, in April 2005, 19852 this version was not in widespread use. A future version of 19853 this specification may remove the differences. 19854 19855 passwd 19856 19857 Name 19858 19859 passwd -- change user password 19860 19861 Synopsis 19862 19863 passwd [-x max] [-n min] [-w warn] [-i inact] name 19864 passwd {-l | -u} name 19865 19866 Description 19867 19868 passwd changes authentication information for user and group 19869 accounts, including passwords and password expiry details, and 19870 may be used to enable and disable accounts. Only a user with 19871 appropriate privilege may change the password for other users 19872 or modify the expiry information. 19873 19874 Options 19875 19876 -x max 19877 19878 sets the maximum number of days a password remains valid. 19879 -n min 19880 19881 sets the minimum number of days before a password may be 19882 changed. 19883 -w warn 19884 19885 sets the number of days warning the user will receive before 19886 their password will expire. 19887 -i inactive 19888 19889 disables an account after the password has been expired for 19890 the given number of days. 19891 -l 19892 19893 disables an account by changing the password to a value which 19894 matches no possible encrypted value. 19895 -u 19896 19897 re-enables an account by changing the password back to its 19898 previous value. 19899 19900 patch 19901 19902 Name 19903 19904 patch -- apply a diff file to an original 19905 19906 Description 19907 19908 patch is as specified in ISO POSIX (2003), but with extensions 19909 as listed below. 19910 19911 Extensions 19912 19913 --binary 19914 19915 reads and write all files in binary mode, except for standard 19916 output and /dev/tty. This option has no effect on 19917 POSIX-compliant systems. 19918 -u, --unified 19919 19920 interprets the patch file as a unified context diff. 19921 19922 pidof 19923 19924 Name 19925 19926 pidof -- find the process ID of a running program 19927 19928 Synopsis 19929 19930 pidof [-s] [-x] [-o omitpid...] program... 19931 19932 Description 19933 19934 Return the process ID of a process which is running the 19935 program named on the command line. 19936 19937 The pidof command is a system administration utility, see Path 19938 For System Administration Utilities. 19939 19940 Options 19941 19942 -s 19943 19944 instructs the program to only return one pid. 19945 -x 19946 19947 causes the program to also return process id's of shells 19948 running the named scripts. 19949 -o 19950 19951 omits processes with specified process id. 19952 19953 remove_initd 19954 19955 Name 19956 19957 remove_initd -- clean up init script system modifications 19958 introduced by install_initd 19959 19960 Synopsis 19961 19962 /usr/lib/lsb/remove_initd initd_file 19963 19964 Description 19965 19966 remove_initd processes the removal of the modifications made 19967 to a distribution's init script system by the install_initd 19968 program. This cleanup is performed in the preuninstall script 19969 of a package; however, the package manager is still 19970 responsible for removing the script from the repository. See 19971 also Installation and Removal of Init Scripts. 19972 19973 renice 19974 19975 Name 19976 19977 renice -- alter priority of running processes 19978 19979 Description 19980 19981 renice is as specified in ISO POSIX (2003), but with 19982 differences as listed below. 19983 19984 Differences 19985 19986 -n increment 19987 19988 has unspecified behavior. 19989 19990 sed 19991 19992 Name 19993 19994 sed -- stream editor 19995 19996 Description 19997 19998 sed is as specified in ISO POSIX (2003), but with differences 19999 as listed below. 20000 20001 LSB Differences 20002 20003 Certain aspects of internationalized regular expressions are 20004 optional; see Internationalization and Regular Expressions. 20005 20006 sendmail 20007 20008 Name 20009 20010 sendmail -- an electronic mail transport agent 20011 20012 Synopsis 20013 20014 /usr/sbin/sendmail [options] [address...] 20015 20016 Description 20017 20018 To deliver electronic mail (email), applications shall support 20019 the interface provided by sendmail (described here). This 20020 interface shall be the default delivery method for 20021 applications. 20022 20023 This program sends an email message to one or more recipients, 20024 routing the message as necessary. This program is not intended 20025 as a user interface routine. 20026 20027 With no options, sendmail reads its standard input up to an 20028 end-of-file or a line consisting only of a single dot and 20029 sends a copy of the message found there to all of the 20030 addresses listed. It determines the network(s) to use based on 20031 the syntax and contents of the addresses. 20032 20033 If an address is preceded by a backslash, '\', it is 20034 unspecified if the address is subject to local alias 20035 expansion. 20036 20037 The format of messages shall be as defined in RFC 20038 2822:Internet Message Format. 20039 20040 Note: The name sendmail was chosen for historical reasons, 20041 but the sendmail command specified here is intended to 20042 reflect functionality provided by smail, exim and other 20043 implementations, not just the sendmail implementation. 20044 20045 Options 20046 20047 -bm 20048 20049 read mail from standard input and deliver it to the recipient 20050 addresses. This is the default mode of operation. 20051 -bp 20052 20053 If the user has sufficient privilege, list information about 20054 messages currently in the mail queue. 20055 -bs 20056 20057 use the SMTP protocol as described in RFC 2821:Simple Mail 20058 Transfer Protocol; read SMTP commands on standard input and 20059 write SMTP responses on standard output. 20060 20061 In this mode, sendmail shall accept \r\n (CR-LF), as required 20062 by RFC 2821:Simple Mail Transfer Protocol, and \n (LF) line 20063 terminators. 20064 -F fullname 20065 20066 explicitly set the full name of the sender for incoming mail 20067 unless the message already contains a From: message header. 20068 20069 If the user running sendmail is not sufficiently trusted, then 20070 the actual sender may be indicated in the message, depending 20071 on the configuration of the agent. 20072 -f name 20073 20074 explicitly set the envelope sender address for incoming mail. 20075 If there is no From: header, the address specified in the 20076 From: header will also be set. 20077 20078 If the user running sendmail is not sufficiently trusted, then 20079 the actual sender shall be indicated in the message. 20080 -i 20081 20082 ignore dots alone on lines by themselves in incoming messages. 20083 If this options is not specified, a line consisting of a 20084 single dot shall terminate the input. If -bs is also used, the 20085 behavior is unspecified. 20086 -odb 20087 20088 deliver any mail in background, if supported; otherwise 20089 ignored. 20090 -odf 20091 20092 deliver any mail in foreground, if supported; otherwise 20093 ignored. 20094 -oem or -em 20095 20096 mail errors back to the sender. (default) 20097 -oep or -ep 20098 20099 write errors to the standard error output. 20100 -oeq or -eq 20101 20102 do not send notification of errors to the sender. This only 20103 works for mail delivered locally. 20104 -oi 20105 20106 is equivalent to -i. 20107 -om 20108 20109 indicate that the sender of a message should receive a copy of 20110 the message if the sender appears in an alias expansion. 20111 Ignored if aliases are not supported. 20112 -t 20113 20114 read the message to obtain recipients from the To:, Cc:, and 20115 Bcc: headers in the message instead of from the command 20116 arguments. If a Bcc: header is present, it is removed from the 20117 message unless there is no To: or Cc: header, in which case a 20118 Bcc: header with no data is created, in accordance with RFC 20119 2822:Internet Message Format. 20120 20121 If there are any operands, the recipients list is unspecified. 20122 20123 This option may be ignored when not in -bm mode (the default). 20124 20125 Note: It is recommended that applications use as few 20126 options as necessary, none if possible. 20127 20128 Exit status 20129 20130 0 20131 20132 successful completion on all addresses. This does not indicate 20133 successful delivery. 20134 >0 20135 20136 there was an error. 20137 20138 sh 20139 20140 Name 20141 20142 sh -- shell, the standard command language interpreter 20143 20144 Description 20145 20146 The sh utility shall behave as specified in ISO POSIX (2003), 20147 but with extensions listed below. 20148 20149 Shell Invocation 20150 20151 The shell shall support an additional option, -l (the letter 20152 ell). If the -l option is specified, or if the first character 20153 of argument zero (the command name) is a '-', this invokation 20154 of the shell is a login shell. 20155 20156 An interactive shell, as specified in ISO POSIX (2003), that 20157 is also a login shell, or any shell if invoked with the -l 20158 option, shall, prior to reading from the input file, first 20159 read and execute commands from the file /etc/profile, if that 20160 file exists, and then from a file called ~/.profile, if such a 20161 file exists. 20162 20163 Note: This specification requires that the sh utility shall 20164 also read and execute commands in its current execution 20165 environment from all the shell scripts in the directory 20166 /etc/profile.d. Such scripts are read and executed as a 20167 part of reading and executing /etc/profile. 20168 20169 shutdown 20170 20171 Name 20172 20173 shutdown -- shut the system down 20174 20175 Synopsis 20176 20177 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 20178 [warning-message] 20179 /sbin/shutdown -c [warning-message] 20180 20181 Description 20182 20183 The shutdown command shall shut the system down in a secure 20184 way (first synopsis), or cancel a pending shutdown (second 20185 synopsis). When the shutdown is initiated, all logged-in users 20186 shall be notified immediately that the system is going down, 20187 and users shall be prevented from logging in to the system. 20188 The time specifies when the actual shutdown shall commence. 20189 See below for details. At the specified time all processes are 20190 first notified that the system is going down by the signal 20191 SIGTERM. After an interval (see -t) all processes shall be 20192 sent the signal SIGKILL. If neither the -h or the -r argument 20193 is specified, then the default behavior shall be to take the 20194 system to a runlevel where administrative tasks can be run. 20195 See also Run Levels. 20196 20197 Note: This is sometimes referred to as "single user mode". 20198 20199 The -h and -r options are mutually exclusive. If either the -h 20200 or -r options are specified, the system shall be halted or 20201 rebooted respectively. 20202 20203 Standard Options 20204 20205 -a 20206 20207 use access control. See below. 20208 -t sec 20209 20210 tell the system to wait sec seconds between sending processes 20211 the warning and the kill signal, before changing to another 20212 runlevel. The default period is unspecified. 20213 -k 20214 20215 do not really shutdown; only send the warning messages to 20216 everybody. 20217 -r 20218 20219 reboot after shutdown. 20220 -h 20221 20222 halt after shutdown. Actions after halting are unspecified 20223 (e.g. power off). 20224 -f 20225 20226 advise the system to skip file system consistency checks on 20227 reboot. 20228 -F 20229 20230 advise the system to force file system consistency checks on 20231 reboot. 20232 -c 20233 20234 cancel an already running shutdown. 20235 time 20236 20237 specify when to shut down. 20238 20239 The time argument shall have the following format: [now | 20240 [+]mins | hh:mm] If the format is hh:mm, hh shall specify the 20241 hour (1 or 2 digits) and mm is the minute of the hour (exactly 20242 two digits), and the shutdown shall commence at the next 20243 occurence of the specified time. If the format is mins (or 20244 +mins), where mins is a decimal number, shutdown shall 20245 commence in the specified number of minutes. The word now is 20246 an alias for +0. 20247 warning-message 20248 20249 specify a message to send to all users. 20250 20251 Access Control 20252 20253 If the shutdown utility is invoked with the -a option, it 20254 shall check that an authorized user is currently logged in on 20255 the system console. Authorized users are listed, one per line, 20256 in the file /etc/shutdown.allow. Lines in this file that begin 20257 with a '#' or are blank shall be ignored. 20258 20259 Note: The intent of this scheme is to allow a keyboard 20260 sequence entered on the system console (e.g. CTRL-ALT-DEL, 20261 or STOP-A) to automatically invoke shutdown -a, and can be 20262 used to prevent unauthorized users from shutting the system 20263 down in this fashion. 20264 20265 su 20266 20267 Name 20268 20269 su -- change user ID 20270 20271 Synopsis 20272 20273 su [options] [-] [username [ARGS]] 20274 20275 Description 20276 20277 The su command shall start a shell running with the real and 20278 effective user and group IDs of the user username. If username 20279 is not specified, su shall default to an unspecified user with 20280 all appropriate privileges. If the -s or --shell is not 20281 specified, the shell to be invoked shall be that specified for 20282 username in the user database (see getpwnam()), or /bin/sh if 20283 there is no shell specified in the user database. 20284 20285 If the - option is specified, or if the first operand is -, 20286 the environment for the shell shall be initialized as if the 20287 new shell was a login shell (see Shell Invocation). 20288 20289 If the invoking user does not have appropriate privileges, the 20290 su command shall prompt for a password and validate this 20291 before continuing. Invalid passwords shall produce an error 20292 message. The su command shall log in an unspecified manner all 20293 invokations, whether successful or unsuccessful. 20294 20295 Any operands specified after the username shall be passed to 20296 the invoked shell. 20297 20298 If the option - is not specified, and if the first operand is 20299 not -, the environemnt for the new shell shall be intialized 20300 from the current environment. If none of the -m, -p, or 20301 --preserve-environment options are specified, the environment 20302 may be modified in unspecified ways before invoking the shell. 20303 If any of the -m, -p, or --preserve-environment options are 20304 specified, the environment shall not be altered. 20305 20306 Note: Although the su command shall not alter the 20307 environment, the invoked shell may still alter it before it 20308 is ready to intepret any commands. 20309 20310 Standard Options 20311 20312 - 20313 the invoked shell shall be a login shell. 20314 20315 -c command, --command=command 20316 Invoke the shell with the option -c command. 20317 20318 -m, -p, --preserve-environment 20319 The current environment shall be passed to the invoked 20320 shell. If the environment variable SHELL is set, it 20321 shall specify the shell to invoke, if it matches an 20322 entry in /etc/shells. If there is no matching entry in 20323 /etc/shells, this option shall be ignored if the - 20324 option is also specified, or if the first operand is -. 20325 20326 -s shell, --shell=shell 20327 Invoke shell as the comamnd interpreter. The shell 20328 specified shall be present in /etc/shells. 20329 20330 sync 20331 20332 Name 20333 20334 sync -- flush file system buffers 20335 20336 Synopsis 20337 20338 sync 20339 20340 Description 20341 20342 Force changed blocks to disk, update the super block. 20343 20344 tar 20345 20346 Name 20347 20348 tar -- file archiver 20349 20350 Description 20351 20352 tar is as specified in SUSv2, but with differences as listed 20353 below. 20354 20355 Differences 20356 20357 Some elements of the Pattern Matching Notation are optional; 20358 see Internationalization and Pattern Matching Notation. 20359 20360 -h 20361 20362 doesn't dump symlinks; dumps the files they point to. 20363 -z 20364 20365 filters the archive through gzip. 20366 20367 umount 20368 20369 Name 20370 20371 umount -- unmount file systems 20372 20373 Synopsis 20374 20375 umount [-hV] 20376 umount -a [-nrv] [-t vfstype] 20377 umount [-nrv] device | dir... 20378 20379 Description 20380 20381 umount detaches the file system(s) mentioned from the file 20382 hierarchy. A file system is specified by giving the directory 20383 where it has been mounted. 20384 20385 Standard Options 20386 20387 -v 20388 20389 invokes verbose mode. 20390 -n 20391 20392 unmounts without writing in /etc/mtab. 20393 -r 20394 20395 tries to remount read-only if unmounting fails. 20396 -a 20397 20398 unmounts all of the file systems described in /etc/mtab except 20399 for the proc file system. 20400 -t vfstype 20401 20402 indicates that the actions should only be taken on file 20403 systems of the specified type. More than one type may be 20404 specified in a comma separated list. The list of file system 20405 types can be prefixed with no to specify the file system types 20406 on which no action should be taken. 20407 -f 20408 20409 forces unmount (in case of an unreachable NFS system). 20410 20411 LSB Deprecated Options 20412 20413 The behaviors specified in this section are expected to 20414 disappear from a future version of the LSB; applications 20415 should only use the non-LSB-deprecated behaviors. 20416 20417 -V 20418 20419 print version and exits. 20420 20421 useradd 20422 20423 Name 20424 20425 useradd -- create a new user or update default new user 20426 information 20427 20428 Synopsis 20429 20430 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 20431 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 20432 [-u uid [-o]] login 20433 useradd -D [-g default_group] [-b default_home] [-s 20434 default_shell] 20435 20436 Description 20437 20438 When invoked without the -D option, and with appropriate 20439 privilege, useradd creates a new user account using the values 20440 specified on the command line and the default values from the 20441 system. The new user account will be entered into the system 20442 files as needed, the home directory will be created, and 20443 initial files copied, depending on the command line options. 20444 20445 When invoked with the -D option, useradd will either display 20446 the current default values, or, with appropriate privilege, 20447 update the default values from the command line. If no options 20448 are specified, useradd displays the current default values. 20449 20450 The useradd command is a system administration utility, see 20451 Path For System Administration Utilities. 20452 20453 Standard Options 20454 20455 -c comment 20456 20457 specifies the new user's password file comment field value. 20458 -d home_dir 20459 20460 creates the new user using home_dir as the value for the 20461 user's login directory. The default is to append the login 20462 name to default_home and use that as the login directory name. 20463 -g initial_group 20464 20465 specifies the group name or number of the user's initial login 20466 group. The group name shall exist. A group number shall refer 20467 to an already existing group. If -g is not specified, the 20468 implementation will follow the normal user default for that 20469 system. This may create a new group or choose a default group 20470 that normal users are placed in. Applications which require 20471 control of the groups into which a user is placed should 20472 specify -g. 20473 -G group[,...] 20474 20475 specifies a list of supplementary groups which the user is 20476 also a member of. Each group is separated from the next by a 20477 comma, with no intervening whitespace. The groups are subject 20478 to the same restrictions as the group given with the -g 20479 option. The default is for the user to belong only to the 20480 initial group. 20481 -m [-k skeleton_dir] 20482 20483 specifies the user's home directory will be created if it does 20484 not exist. The files contained in skeleton_dir will be copied 20485 to the home directory if the -k option is used, otherwise the 20486 files contained in /etc/skel will be used instead. Any 20487 directories contained in skeleton_dir or /etc/skel will be 20488 created in the user's home directory as well. The -k option is 20489 only valid in conjunction with the -m option. The default is 20490 to not create the directory and to not copy any files. 20491 -p passwd 20492 20493 is the encrypted password, as returned by crypt(). The default 20494 is to disable the account. 20495 -r 20496 20497 creates a system account, that is, a user with a User ID in 20498 the range reserved for system account users. If there is not a 20499 User ID free in the reserved range the command will fail. 20500 -s shell 20501 20502 specifies the name of the user's login shell. The default is 20503 to leave this field blank, which causes the system to select 20504 the default login shell. 20505 -u uid [-o] 20506 20507 specifies the numerical value of the user's ID. This value 20508 shall be unique, unless the -o option is used. The value shall 20509 be non-negative. The default is the smallest ID value greater 20510 than 499 which is not yet used. 20511 20512 Change Default Options 20513 20514 -b default_home 20515 20516 specifies the initial path prefix for a new user's home 20517 directory. The user's name will be affixed to the end of 20518 default_home to create the new directory name if the -d option 20519 is not used when creating a new account. 20520 -g default_group 20521 20522 specifies the group name or ID for a new user's initial group. 20523 The named group shall exist, and a numerical group ID shall 20524 have an existing entry. 20525 -s default_shell 20526 20527 specifies the name of the new user's login shell. The named 20528 program will be used for all future new user accounts. 20529 -c comment 20530 20531 specifies the new user's password file comment field value. 20532 20533 Application Usage 20534 20535 The -D option will typically be used by system administration 20536 packages. Most applications should not change defaults which 20537 will affect other applications and users. 20538 20539 userdel 20540 20541 Name 20542 20543 userdel -- delete a user account and related files 20544 20545 Synopsis 20546 20547 userdel [-r] login 20548 20549 Description 20550 20551 Delete the user account named login. If there is also a group 20552 named login, this command may delete the group as well, or may 20553 leave it alone. 20554 20555 The userdel command is a system administration utility, see 20556 Path For System Administration Utilities. 20557 20558 Options 20559 20560 -r 20561 20562 removes files in the user's home directory along with the home 20563 directory itself. Files located in other file system will have 20564 to be searched for and deleted manually. 20565 20566 usermod 20567 20568 Name 20569 20570 usermod -- modify a user account 20571 20572 Synopsis 20573 20574 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] 20575 [-G group [,...]] [-l login_name] [-p passwd] [-s shell] [-u 20576 uid [ -o]] login 20577 20578 Description 20579 20580 The usermod command shall modify an entry in the user account 20581 database. 20582 20583 The usermod command is a system administration utility, see 20584 Path For System Administration Utilities. 20585 20586 Options 20587 20588 -c comment 20589 20590 specifies the new value of the user's password file comment 20591 field. 20592 -d home_dir 20593 20594 specifies the user's new login directory. If the -m option is 20595 given the contents of the current home directory will be moved 20596 to the new home directory, which is created if it does not 20597 already exist. 20598 -g initial_group 20599 20600 specifies the group name or number of the user's new initial 20601 login group. The group name shall exist. A group number shall 20602 refer to an already existing group. 20603 -G group,[...] 20604 20605 specifies a list of supplementary groups which the user is 20606 also a member of. Each group is separated from the next by a 20607 comma, with no intervening whitespace. The groups are subject 20608 to the same restrictions as the group given with the -g 20609 option. If the user is currently a member of a group which is 20610 not listed, the user will be removed from the group. 20611 -l login_name 20612 20613 changes the name of the user from login to login_name. Nothing 20614 else is changed. In particular, the user's home directory name 20615 should probably be changed to reflect the new login name. 20616 -p passwd 20617 20618 is the encrypted password, as returned by crypt(3). 20619 -s shell 20620 20621 specifies the name of the user's new login shell. Setting this 20622 field to blank causes the system to select the default login 20623 shell. 20624 -u uid [-o] 20625 20626 specifies the numerical value of the user's ID. This value 20627 shall be unique, unless the -o option is used. The value shall 20628 be non-negative. Any files which the user owns and which are 20629 located in the directory tree rooted at the user's home 20630 directory will have the file user ID changed automatically. 20631 Files outside of the user's home directory shall be altered 20632 manually. 20633 20634 xargs 20635 20636 Name 20637 20638 xargs -- build and execute command lines from standard input 20639 20640 Description 20641 20642 xargs is as specified in ISO POSIX (2003), but with 20643 differences as listed below. 20644 20645 Differences 20646 20647 -E 20648 20649 has unspecified behavior. 20650 -I 20651 20652 has unspecified behavior. 20653 -L 20654 20655 has unspecified behavior. 20656 20657 Note: These options have been implemented in 20658 findutils-4.2.9, but this version of the utilities is not 20659 in widespread use as of April 2005. However, future 20660 versions of this specification will require support for 20661 these arguments. 20662 20663 V. Execution Environment 20664 20665 Table of Contents 20666 12. File System Hierarchy 20667 20668 12.1. /dev: Device Files 20669 12.2. /etc: Host-specific system configuration 20670 20671 12.2.1. File Naming Conventions 20672 20673 12.3. User Accounting Databases 20674 12.4. Path For System Administration Utilities 20675 20676 13. Additional Recommendations 20677 20678 13.1. Recommendations for applications on ownership and 20679 permissions 20680 20681 13.1.1. Directory Write Permissions 20682 13.1.2. File Write Permissions 20683 13.1.3. File Read and execute Permissions 20684 13.1.4. SUID and SGID Permissions 20685 13.1.5. Privileged users 20686 13.1.6. Changing permissions 20687 13.1.7. Removable Media (Cdrom, Floppy, etc.) 20688 13.1.8. Installable applications 20689 20690 14. Additional Behaviors 20691 20692 14.1. Mandatory Optional Behaviors 20693 20694 14.1.1. Special Requirements 20695 20696 15. Localization 20697 20698 15.1. Introduction 20699 15.2. Regular Expressions 20700 15.3. Pattern Matching Notation 20701 _________________________________________________________ 20702 20703 Chapter 12. File System Hierarchy 20704 20705 An LSB conforming implementation shall provide the mandatory 20706 portions of the file system hierarchy specified in the 20707 Filesystem Hierarchy Standard (FHS), together with any 20708 additional requirements made in this specification. 20709 20710 An LSB conforming application shall conform to the Filesystem 20711 Hierarchy Standard. 20712 20713 The FHS allows many components or subsystems to be optional. 20714 An application shall check for the existence of an optional 20715 component before using it, and should behave in a reasonable 20716 manner if the optional component is not present. 20717 20718 The FHS requirement to locate the operating system kernel in 20719 either / or /boot does not apply if the operating system 20720 kernel does not exist as a file in the file system. 20721 20722 The FHS specifies certain behaviors for a variety of commands 20723 if they are present (for example, ping or python). However, 20724 LSB conforming applications shall not rely on any commands 20725 beyond those specified by the LSB. The mere existence of a 20726 command may not be used as an indication that the command 20727 behaves in any particular way. 20728 20729 The following directories or links need not be present: 20730 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 20731 _________________________________________________________ 20732 20733 12.1. /dev: Device Files 20734 20735 The following shall exist under /dev. Other devices may also 20736 exist in /dev. Device names may exist as symbolic links to 20737 other device nodes located in /dev or subdirectories of /dev. 20738 There is no requirement concerning major/minor number values. 20739 20740 /dev/null 20741 20742 An infinite data source and data sink. Data written to this 20743 device shall be discarded. Reads from this device shall always 20744 return end-of-file (EOF). 20745 /dev/zero 20746 20747 This device is a source of zeroed out data. All data written 20748 to this device shall be discarded. A read from this device 20749 shall always return the requested number of bytes, each 20750 initialized to the value '\0'. 20751 /dev/tty 20752 20753 In each process, a synonym for the controlling terminal 20754 associated with the process group of that process, if any. All 20755 reads and writes to this device shall behave as if the actual 20756 controlling terminal device had been opened. 20757 _________________________________________________________ 20758 20759 12.2. /etc: Host-specific system configuration 20760 20761 In addition to the requirements for /etc in the Filesystem 20762 Hierarchy Standard, an LSB conforming system shall also 20763 provide the following directories or symbolic links to 20764 directories: 20765 20766 /etc/cron.d 20767 20768 A directory containing extended crontab files; see Cron Jobs. 20769 /etc/cron.daily 20770 20771 A directory containing shell scripts to be executed once a 20772 day; see Cron Jobs. 20773 /etc/cron.hourly 20774 20775 A directory containing shell scripts to be executed once per 20776 hour; see Cron Jobs. 20777 /etc/cron.monthly 20778 20779 A directory containing shell scripts to be executed once per 20780 month; see Cron Jobs. 20781 /etc/cron.weekly 20782 20783 A directory containing shell scripts to be executed once a 20784 week; see Cron Jobs. 20785 /etc/init.d 20786 20787 A directory containing system initialization scripts; see 20788 Installation and Removal of Init Scripts. 20789 /etc/profile.d 20790 20791 A directory containing shell scripts. Script names should 20792 follow the same conventions as specified for cron jobs (see 20793 Cron Jobs, but should have the suffix .sh. The behavior is 20794 unspecified if a script is installed in this directory that 20795 does not have the suffix .sh. 20796 20797 The sh utility shall read and execute commands in its current 20798 execution environment from all the shell scripts in this 20799 directory that have the suffix .sh when invoked as an 20800 interactive login shell, or if the -l (the letter ell) is 20801 specified (see Shell Invocation). 20802 20803 Future Directions: These directories are required at this 20804 version of the LSB since there is not yet an agreed method 20805 for abstracting the implementation so that applications 20806 need not be aware of these locations during installation. 20807 However, Future Directions describes a tool, lsbinstall, 20808 that will make these directories implementation specific 20809 and no longer required. 20810 _________________________________________________________ 20811 20812 12.2.1. File Naming Conventions 20813 20814 Conforming implemetnations and applications installing files 20815 into any of the above locations under /etc may only use 20816 filenames from the following managed namespaces: 20817 20818 * Assigned names. Such names must be chosen from the 20819 character set [a-z0-9]. In order to avoid conflicts these 20820 names shall be reserved through the Linux Assigned Names 20821 and Numbers Authority (LANANA). Information about the 20822 LANANA may be found at www.lanana.org. 20823 20824 Note: Commonly used names should be reserved in advance; 20825 developers for projects are encouraged to reserve names 20826 from LANANA, so that each distribution can use the same 20827 name, and to avoid conflicts with other projects. 20828 * Hierarchical names. Script names in this category take the 20829 form: --...-, where name is taken from 20830 the character set [a-z0-9], and where there may be one or 20831 more components. may either be an LSB 20832 provider name assigned by the LANANA, or it may be owners' 20833 DNS name in lower case, with at least one '.'. e.g. 20834 "debian.org", "staroffice.sun.com", etc. The LSB provider 20835 name assigned by LANANA shall only consist of the ASCII 20836 characters [a-z0-9]. 20837 * Reserved names. Names that begin with the character '_' 20838 are reserved for distribution use only. These names should 20839 be used for essential system packages only. 20840 20841 Note: A non-conforming application may still have polluted 20842 these managed namespaces with unregistered filenames; a 20843 conforming application should check for namespace 20844 collisions and take appropriate steps if they occur. 20845 20846 In general, if a package or some system function is likely 20847 to be used on multiple systems, the package developers or 20848 the distribution should get a registered name through 20849 LANANA, and distributions should strive to use the same 20850 name whenever possible. For applications which may not be 20851 essential or may not be commonly installed, the 20852 hierarchical namespace may be more appropriate. An 20853 advantage to the hierarchical namespace is that there is no 20854 need to consult with the LANANA before obtaining an 20855 assigned name. 20856 20857 Short names are highly desirable, since system 20858 administrators may need to manually start and stop 20859 services. Given this, they should be standardized on a 20860 per-package basis. This is the rationale behind having the 20861 LANANA organization assign these names. The LANANA may be 20862 called upon to handle other namespace issues, such as 20863 package/prerequisites naming. 20864 _________________________________________________________ 20865 20866 12.3. User Accounting Databases 20867 20868 The Filesystem Hierarchy Standard specifies two optional 20869 locations for user accounting databases used by the 20870 getutent(), getutent_r(), getutxent(), getutxid(), 20871 getutxline(), and pututxline() functions. These are 20872 /var/run/utmp and /var/run/wtmp. 20873 20874 The LSB does not specify the format or structure of these 20875 files, or even if they are files at all. They should be used 20876 only as "magic cookies" to the utmpname() function. 20877 _________________________________________________________ 20878 20879 12.4. Path For System Administration Utilities 20880 20881 Certain utilities used for system administration (and other 20882 privileged commands) may be stored in /sbin, /usr/sbin, and 20883 /usr/local/sbin. Applications requiring to use commands 20884 identified as system administration utilities should add these 20885 directories to their PATH. By default, as described in ISO 20886 POSIX (2003), standard utilities shall be found on the PATH 20887 returned by getconf PATH (or command -p getconf PATH to be 20888 guaranteed to invoke the correct version of getconf). 20889 _________________________________________________________ 20890 20891 Chapter 13. Additional Recommendations 20892 20893 13.1. Recommendations for applications on ownership and permissions 20894 20895 13.1.1. Directory Write Permissions 20896 20897 The application should not depend on having directory write 20898 permission in any directory except /tmp, /var/tmp, and the 20899 invoking user's home directory. 20900 20901 In addition, the application may store variable data in 20902 /var/opt/package, (where package is the name of the 20903 application package), if such a directory is created with 20904 appropriate permissions during the package installation. 20905 20906 For these directories the application should be able to work 20907 with directory write permissions restricted by the S_ISVTXT 20908 bit, implementing the restricted deletion mode as described 20909 for the XSI option for ISO POSIX (2003).. 20910 _________________________________________________________ 20911 20912 13.1.2. File Write Permissions 20913 20914 The application should not depend on file write permission to 20915 any file that it does not itself create. 20916 _________________________________________________________ 20917 20918 13.1.3. File Read and execute Permissions 20919 20920 The application should not depend on having read permission to 20921 every file and directory. 20922 _________________________________________________________ 20923 20924 13.1.4. SUID and SGID Permissions 20925 20926 The application should not depend on the set user ID or set 20927 group ID (the S_ISUID or S_ISGID permission bits) permissions 20928 of a file not packaged with the application. Instead, the 20929 distribution is responsible for assuming that all system 20930 commands have the required permissions and work correctly. 20931 20932 Rationale: In order to implement common security policies 20933 it is strongly advisable for applications to use the 20934 minimum set of security attributes necessary for correct 20935 operation. Applications that require substantial 20936 appropriate privilege are likely to cause problems with 20937 such security policies. 20938 _________________________________________________________ 20939 20940 13.1.5. Privileged users 20941 20942 In general, applications should not depend on running as a 20943 privileged user. This specification uses the term "appropriate 20944 privilege" throughout to identify operations that cannot be 20945 achieved without some special granting of additional 20946 privilege. 20947 20948 Applications that have a reason to run with appropriate 20949 privilege should outline this reason clearly in their 20950 documentation. Users of the application should be informed, 20951 that "this application demands security privileges, which 20952 could interfere with system security". 20953 20954 The application should not contain binary-only software that 20955 requires being run with appropriate privilege, as this makes 20956 security auditing harder or even impossible. 20957 _________________________________________________________ 20958 20959 13.1.6. Changing permissions 20960 20961 The application shall not change permissions of files and 20962 directories that do not belong to its own package. Should an 20963 application require that certain files and directories not 20964 directly belonging to the package have a particular ownership, 20965 the application shall document this requirement, and may fail 20966 during installation if the permissions on these files is 20967 inappropriate. 20968 _________________________________________________________ 20969 20970 13.1.7. Removable Media (Cdrom, Floppy, etc.) 20971 20972 Applications that expect to be runnable from removable media 20973 should not depend on logging in as a privileged user, and 20974 should be prepared to deal with a restrictive environment. 20975 Examples of such restrictions could be default mount options 20976 that disable set-user/group-ID attributes, disabling block or 20977 character-special files on the medium, or remapping the user 20978 and group IDs of files away from any privileged value. 20979 20980 Rationale: System vendors and local system administrators 20981 want to run applications from removable media, but want the 20982 possibility to control what the application can do. 20983 _________________________________________________________ 20984 20985 13.1.8. Installable applications 20986 20987 Where the installation of an application needs additional 20988 privileges, it must clearly document all files and system 20989 databases that are modified outside of those in /opt/pkg-name 20990 and /var/opt/pkg-name, other than those that may be updated by 20991 system logging or auditing activities. 20992 20993 Without this, the local system administrator would have to 20994 blindly trust a piece of software, particularly with respect 20995 to its security. 20996 _________________________________________________________ 20997 20998 Chapter 14. Additional Behaviors 20999 21000 14.1. Mandatory Optional Behaviors 21001 21002 This section specifies behaviors in which there is optional 21003 behavior in one of the standards on which the LSB relies, and 21004 where the LSB requires a specific behavior. 21005 21006 Note: The LSB does not require the kernel to be Linux; the 21007 set of mandated options reflects current existing practice, 21008 but may be modified in future releases. 21009 21010 LSB conforming implementations shall support the following 21011 options defined within the ISO POSIX (2003): 21012 21013 _POSIX_FSYNC 21014 _POSIX_MAPPED_FILES 21015 _POSIX_MEMLOCK 21016 _POSIX_MEMLOCK_RANGE 21017 _POSIX_MEMORY_PROTECTION 21018 _POSIX_PRIORITY_SCHEDULING 21019 _POSIX_REALTIME_SIGNALS 21020 _POSIX_THREAD_ATTR_STACKADDR 21021 _POSIX_THREAD_ATTR_STACKSIZE 21022 _POSIX_THREAD_PROCESS_SHARED 21023 _POSIX_THREAD_SAFE_FUNCTIONS 21024 _POSIX_THREADS 21025 21026 The opendir() function shall consume a file descriptor in the 21027 same fashion as open(), and therefore may fail with EMFILE or 21028 ENFILE. 21029 21030 The START and STOP termios characters shall be changeable, as 21031 described as optional behavior in the "General Terminal 21032 Interface" section of the ISO POSIX (2003). 21033 21034 The access() function function shall fail with errno set to 21035 EINVAL if the amode argument contains bits other than those 21036 set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 21037 21038 The link() function shall require access to the existing file 21039 in order to succeed, as described as optional behavior in the 21040 ISO POSIX (2003). 21041 21042 Calling unlink() on a directory shall fail. Calling link() 21043 specifying a directory as the first argument shall fail. See 21044 also unlink. 21045 21046 Note: Linux allows rename() on a directory without having 21047 write access, but the LSB does not require this. 21048 _________________________________________________________ 21049 21050 14.1.1. Special Requirements 21051 21052 LSB conforming systems shall enforce certain special 21053 additional restrictions above and beyond those required by ISO 21054 POSIX (2003). 21055 21056 Note: These additional restrictions are required in order 21057 to support the testing and certification programs 21058 associated with the LSB. In each case, these are values 21059 that defined macros must not have; conforming applications 21060 that use these values shall trigger a failure in the 21061 interface that is otherwise described as a "may fail". 21062 21063 The fcntl() function shall treat the "cmd" value -1 as 21064 invalid. 21065 21066 The whence value -1 shall be an invalid value for the lseek(), 21067 fseek() and fcntl() functions. 21068 21069 The value -5 shall be an invalid signal number. 21070 21071 If the sigaddset() or sigdelset() functions are passed an 21072 invalid signal number, they shall return with EINVAL. 21073 Implementations are only required to enforce this requirement 21074 for signal numbers which are specified to be invalid by this 21075 specification (such as the -5 mentioned above). 21076 21077 The mode value -1 to the access() function shall be treated as 21078 invalid. 21079 21080 A value of -1 shall be an invalid "_PC_..." value for 21081 pathconf(). 21082 21083 A value of -1 shall be an invalid "_SC..." value for 21084 sysconf(). 21085 21086 The nl_item value -1 shall be invalid for nl_langinfo(). 21087 21088 The value -1 shall be an invalid "_CS_..." value for 21089 confstr(). 21090 21091 The value "a" shall be an invalid mode argument to popen(). 21092 21093 The fcntl() function shall fail and set errno to EDEADLK if 21094 the cmd argument is F_SETLKW, and the lock is blocked by a 21095 lock from another process already blocked by the current 21096 process. 21097 21098 The opendir() function shall consume a file descriptor; the 21099 readdir() function shall fail and set errno to EBADF if the 21100 underlying file descriptor is closed. 21101 21102 The link() function shall not work across file systems, and 21103 shall fail and set errno to EXDEV as described as optional 21104 behavior in ISO POSIX (2003). 21105 _________________________________________________________ 21106 21107 Chapter 15. Localization 21108 21109 15.1. Introduction 21110 21111 In order to install a message catalog, the installation 21112 procedure shall supply the message catalog in a format 21113 readable by the msgfmt utility, which shall be invoked to 21114 compile the message catalog into an appropriate binary format 21115 on the target system. 21116 21117 Rationale: The original intent was to allow an application 21118 to contain the binary GNU MO format files. However, the 21119 format of these files is not officially stable, hence it is 21120 necessary to compile these catalogs on the target system. 21121 These binary catalogs may differ from architecture to 21122 architecture as well. 21123 21124 The resulting binary message catalog shall be located in the 21125 package's private area under /opt, and the application may use 21126 bindtextdomain() to specify this location. 21127 21128 Implementations shall support the POSIX and C locales as 21129 specified in ISO POSIX (2003). Other locales may be supported. 21130 21131 Implementations may define additional locale categories not 21132 defined by that standard. 21133 21134 Note: Implementations choosing additional locale categories 21135 should be aware of ISO/IEC TR14652 and are advised not to 21136 choose names that conflict with that specification. If 21137 implementations provide locale categories whose names are 21138 part of the FDCC set of ISO/IEC TR14652, they should behave 21139 as defined by that specification. 21140 _________________________________________________________ 21141 21142 15.2. Regular Expressions 21143 21144 Utilities that process regular expressions shall support Basic 21145 Regular Expressions and Extended Regular Expressions as 21146 specified in ISO POSIX (2003), with the following exceptions: 21147 21148 Range expression (such as [a-z]) can be based on code point 21149 order instead of collating element order. 21150 21151 Equivalence class expression (such as [=a=]) and 21152 multi-character collating element expression (such as [.ch.]) 21153 are optional. 21154 21155 Handling of a multi-character collating element is optional. 21156 21157 This affects at least the following utilities: 21158 21159 * awk (see awk) 21160 * grep (see grep) (including egrep, see egrep) 21161 * sed (see sed) 21162 21163 It also affects the behavior of interfaces in the base 21164 libraries, including at least 21165 21166 * regexec() (see regexec) 21167 _________________________________________________________ 21168 21169 15.3. Pattern Matching Notation 21170 21171 Utilities that perform filename pattern matching (also known 21172 as Filename Globbing) shall do it as specified in ISO POSIX 21173 (2003), Pattern Matching Notation, with the following 21174 exceptions: 21175 21176 Pattern bracket expressions (such as [a-z]) can be based on 21177 code point order instead of collating element order. 21178 21179 Equivalence class expression (such as [=a=]) and 21180 multi-character collating element expression (such as [.ch.]) 21181 are optional. 21182 21183 Handling of a multi-character collating element is optional. 21184 21185 This affects at least the following utilities: cpio (cpio), 21186 find (find) and tar (tar). 21187 21188 VI. System Initialization 21189 21190 Table of Contents 21191 16. System Initialization 21192 21193 16.1. Cron Jobs 21194 16.2. Init Script Actions 21195 16.3. Comment Conventions for Init Scripts 21196 16.4. Installation and Removal of Init Scripts 21197 16.5. Run Levels 21198 16.6. Facility Names 21199 16.7. Script Names 21200 16.8. Init Script Functions 21201 _________________________________________________________ 21202 21203 Chapter 16. System Initialization 21204 21205 16.1. Cron Jobs 21206 21207 In addition to the individual user crontab files specified by 21208 ISO POSIX (2003) stored under /var/spool/cron, the process 21209 that executes scheduled commands shall also process the 21210 following additional crontab files: /etc/crontab, 21211 /etc/cron.d/*. The installation of a package shall not modify 21212 the configuration file /etc/crontab. 21213 21214 If a package wishes to install a job that has to be executed 21215 periodically, it shall place an executable cron script in one 21216 of the following directories: 21217 21218 /etc/cron.hourly 21219 /etc/cron.daily 21220 /etc/cron.weekly 21221 /etc/cron.monthly 21222 21223 As these directory names suggest, the files within them are 21224 executed on a hourly, daily, weekly, or monthly basis, 21225 respectively, under the control of an entry in one of the 21226 system crontab files, at an unspecified time of day. See below 21227 for the rules concerning the names of cron scripts. 21228 21229 Note: It is recommended that cron scripts installed in any 21230 of these directories be script files rather than compiled 21231 binaries so that they may be modified by the local system 21232 administrator. Conforming applications may only install 21233 cron scripts which use an interpreter required by this 21234 specification or provided by this or another conforming 21235 application. 21236 21237 This specification does not define the concept of a package 21238 upgrade. Implementations may do different things when 21239 packages are upgraded, including not replacing a cron 21240 script if it marked as a configuration file, particularly 21241 if the cron script appears to have been modified since 21242 installation. In some circumstances, the cron script may 21243 not be removed when the package is uninstalled. 21244 Applications should design their installation procedure and 21245 cron scripts to be robust in the face of such behavior. In 21246 particular, cron scripts should not fail obscurely if run 21247 in unexpected circumstances. Testing for the existence of 21248 application binaries before executing them is suggested. 21249 21250 Future versions of this specification may remove the need 21251 to install file directly into these directories, and 21252 instead abstract the interface to the cron utility in such 21253 a way as to hide the implementation. Please see Future 21254 Directions. 21255 21256 If a certain task has to be executed at other than the 21257 predefined frequencies, the package shall install a file 21258 /etc/cron.d/cron-name. The file shall have the same format as 21259 that described for the crontab command in ISO POSIX (2003), 21260 except that there shall be an additional field, username, 21261 before the name of the command to execute. For completeness, 21262 the seven fields shall be: 21263 21264 1. Minute [0,59] 21265 2. Hour [0,23] 21266 3. Day of the month [1,31] 21267 4. Month of the year [1,12] 21268 5. Day of the week [0,6] (with 0=Sunday) 21269 6. Username 21270 7. command [args ...] 21271 21272 This file shall be processed by the system automatically, with 21273 the named command being run at the specified time, as the 21274 specified username. 21275 21276 Applications installing files in these directories shall use 21277 the LSB naming conventions (see File Naming Conventions). 21278 _________________________________________________________ 21279 21280 16.2. Init Script Actions 21281 21282 Conforming applications which need to execute commands on 21283 changes to the system run level (including boot and shutdown), 21284 may install one or more init scripts. Init scripts provided by 21285 conforming applications shall accept a single argument which 21286 selects the action: 21287 21288 start start the service 21289 stop stop the service 21290 restart stop and restart the service if the service is already 21291 running, otherwise start the service 21292 try-restart restart the service if the service is already 21293 running 21294 reload cause the configuration of the service to be reloaded 21295 without actually stopping and restarting the service 21296 force-reload cause the configuration to be reloaded if the 21297 service supports this, otherwise restart the service if it is 21298 running 21299 status print the current status of the service 21300 21301 The start, stop, restart, force-reload, and status actions 21302 shall be supported by all init scripts; the reload and the 21303 try-restart actions are optional. Other init-script actions 21304 may be defined by the init script. 21305 21306 Init scripts shall ensure that they will behave sensibly if 21307 invoked with start when the service is already running, or 21308 with stop when not running, and that they do not kill 21309 similarly-named user processes. The best way to achieve this 21310 is to use the init-script functions provided by 21311 /lib/lsb/init-functions (see Init Script Functions) 21312 21313 If a service reloads its configuration automatically (as in 21314 the case of cron, for example), the reload action of the init 21315 script shall behave as if the configuration was reloaded 21316 successfully. The restart, try-restart, reload and 21317 force-reload actions may be atomic; that is if a service is 21318 known not to be operational after a restart or reload, the 21319 script may return an error without any further action. 21320 21321 Note: This specification does not define the concept of a 21322 package upgrade. Implementations may do different things 21323 when packages are upgraded, including not replacing an init 21324 script if it is marked as a configuration file, 21325 particularly if the file appears to have been modified 21326 since installation. In some circumstances, the init script 21327 may not be removed when the package is uninstalled. 21328 Applications should design their installation procedure and 21329 init scripts to be robust in the face of such behavior. In 21330 particular, init scripts should not fail obscurely if run 21331 in unexpected circumstances. Testing for the existence of 21332 application binaries before executing them is suggested. 21333 21334 If the status action is requested, the init script will return 21335 the following exit status codes. 21336 21337 0 program is running or service is OK 21338 1 program is dead and /var/run pid file exists 21339 2 program is dead and /var/lock lock file exists 21340 3 program is not running 21341 4 program or service status is unknown 21342 5-99 reserved for future LSB use 21343 100-149 reserved for distribution use 21344 150-199 reserved for application use 21345 200-254 reserved 21346 21347 For all other init-script actions, the init script shall 21348 return an exit status of zero if the action was successful. 21349 Otherwise, the exit status shall be non-zero, as defined 21350 below. In addition to straightforward success, the following 21351 situations are also to be considered successful: 21352 21353 * restarting a service (instead of reloading it) with the 21354 force-reload argument 21355 * running start on a service already running 21356 * running stop on a service already stopped or not running 21357 * running restart on a service already stopped or not 21358 running 21359 * running try-restart on a service already stopped or not 21360 running 21361 21362 In case of an error while processing any init-script action 21363 except for status, the init script shall print an error 21364 message and exit with a non-zero status code: 21365 21366 1 generic or unspecified error (current practice) 21367 2 invalid or excess argument(s) 21368 3 unimplemented feature (for example, "reload") 21369 4 user had insufficient privilege 21370 5 program is not installed 21371 6 program is not configured 21372 7 program is not running 21373 8-99 reserved for future LSB use 21374 100-149 reserved for distribution use 21375 150-199 reserved for application use 21376 200-254 reserved 21377 21378 Error and status messages should be printed with the logging 21379 functions (see Init Script Functions) log_success_msg(), 21380 log_failure_msg() and log_warning_msg(). Scripts may write to 21381 standard error or standard output, but implementations need 21382 not present text written to standard error/output to the user 21383 or do anything else with it. 21384 21385 Note: Since init scripts may be run manually by a system 21386 administrator with non-standard environment variable values 21387 for PATH, USER, LOGNAME, etc., init scripts should not 21388 depend on the values of these environment variables. They 21389 should set them to some known/default values if they are 21390 needed. 21391 _________________________________________________________ 21392 21393 16.3. Comment Conventions for Init Scripts 21394 21395 Conforming applications may install one or more init scripts. 21396 These init scripts must be activated by invoking the 21397 install_initd command. Prior to package removal, the changes 21398 applied by install_initd must be undone by invoking 21399 remove_initd. See Installation and Removal of Init Scripts for 21400 more details. 21401 21402 install_initd and remove_initd determine actions to take by 21403 decoding a specially formatted block of lines in the script. 21404 This block shall be delimited by the lines 21405 ### BEGIN INIT INFO 21406 ### END INIT INFO 21407 21408 The delimiter lines may contain trailing whitespace, which 21409 shall be ignored. All lines inside the block shall begin with 21410 a hash character '#' in the first column, so the shell 21411 interprets them as comment lines which do not affect operation 21412 of the script. The lines shall be of the form: 21413 # {keyword}: arg1 [arg2...] 21414 21415 with exactly one space character between the '#' and the 21416 keyword, with a single exception. In lines following a line 21417 containing the Description keyword, and until the next keyword 21418 or block ending delimiter is seen, a line where the '#' is 21419 followed by more than one space or a tab character shall be 21420 treated as a continuation of the previous line. 21421 21422 The information extracted from the block is used by the 21423 installation tool or the init-script system to assure that 21424 init scripts are run in the correct order. It is unspecified 21425 whether the information is evaluated only when install_initd 21426 runs, when the init scripts are executed, or both. The 21427 information extracted includes run levels, defined in Run 21428 Levels, and boot facilities, defined in Facility Names. 21429 21430 The following keywords, with their arguments, are defined: 21431 21432 Provides: boot_facility_1 [boot_facility_2...] 21433 boot facilities provided by this init script. When an 21434 init script is run with a start argument, the boot 21435 facility or facilities specified by the Provides 21436 keyword shall be deemed present and hence init scripts 21437 which require those boot facilities should be started 21438 later. When an init script is run with a stop argument, 21439 the boot facilities specified by the Provides keyword 21440 are deemed no longer present. 21441 21442 Required-Start: boot_facility_1 [boot_facility_2...] 21443 facilities which must be available during startup of 21444 this service. The init-script system should insure init 21445 scripts which provide the Required-Start facilities are 21446 started before starting this script. 21447 21448 Required-Stop: boot_facility_1 [boot_facility_2...] 21449 facilities which must be available during the shutdown 21450 of this service. The init-script system should avoid 21451 stopping init scripts which provide the Required-Stop 21452 facilities until this script is stopped. 21453 21454 Should-Start: boot_facility_1 [boot_facility_2...] 21455 facilities which, if present, should be available 21456 during startup of this service. This allows for weak 21457 dependencies which do not cause the service to fail if 21458 a facility is not available. The service may provide 21459 reduced functionality in this situation. Conforming 21460 applications should not rely on the existence of this 21461 feature. 21462 21463 Should-Stop: boot_facility_1 [boot_facility_2...] 21464 facilities which should be available during shutdown of 21465 this service. 21466 21467 Default-Start: run_level_1 [run_level_2...], Default-Stop: 21468 run_level_1 [run_level_2...] 21469 which run levels should by default run the init script 21470 with a start (stop) argument to start (stop) the 21471 services controlled by the init script. 21472 21473 For example, if a service should run in runlevels 3, 4, 21474 and 5 only, specify "Default-Start: 3 4 5" and 21475 "Default-Stop: 0 1 2 6". 21476 21477 Short-Description: short_description 21478 provide a brief description of the actions of the init 21479 script. Limited to a single line of text. 21480 21481 Description: multiline_description 21482 provide a more complete description of the actions of 21483 the init script. May span mulitple lines. In a 21484 multiline description, each continuation line shall 21485 begin with a '#' followed by tab character or a '#' 21486 followed by at least two space characters. The 21487 multiline description is terminated by the first line 21488 that does not match this criteria. 21489 21490 Additional keywords may be defined in future versions of this 21491 specification. Also, implementations may define local 21492 extensions by using the prefix X-implementor. For example, 21493 X-RedHat-foobardecl, or X-Debian-xyzzydecl. 21494 21495 Example: 21496 21497 ### BEGIN INIT INFO 21498 # Provides: lsb-ourdb 21499 # Required-Start: $local_fs $network $remote_fs 21500 # Required-Stop: $local_fs $network $remote_fs 21501 # Default-Start: 2 3 4 5 21502 # Default-Stop: 0 1 6 21503 # Short-Description: start and stop OurDB 21504 # Description: OurDB is a very fast and reliable database 21505 # engine used for illustrating init scripts 21506 ### END INIT INFO 21507 21508 The comment conventions described in this section are only 21509 required for init scripts installed by conforming 21510 applications. Conforming runtime implementations are not 21511 required to use this scheme in their system provided init 21512 scripts. 21513 21514 Note: This specification does not require, but is designed 21515 to allow, the development of a system which runs init 21516 scripts in parallel. Hence, enforced-serialization of 21517 scripts is avoided unless it is explicitly necessary. 21518 _________________________________________________________ 21519 21520 16.4. Installation and Removal of Init Scripts 21521 21522 Conforming applications may install one or more initialization 21523 scripts (or init scripts). An init script shall be installed 21524 in /etc/init.d (which may be a symbolic link to another 21525 location), by the package installer. 21526 21527 Note: The requirement to install scripts in /etc/init.d may 21528 be removed in future versions of this specification. See 21529 Host-specific system configuration and Future Directions 21530 for further details. 21531 21532 During the installer's post-install processing phase the 21533 program /usr/lib/lsb/install_initd must be called to activate 21534 the init script. Activation consists of arranging for the init 21535 script to be called in the correct order on system run-level 21536 changes (including system boot and shutdown), based on 21537 dependencies supplied in the init script (see Comment 21538 Conventions for Init Scripts). The install_initd command 21539 should be thought of as a wrapper which hides the 21540 implementation details; how any given implementation arranges 21541 for the init script to be called at the appropriate time is 21542 not specified. 21543 21544 Example: if an init script specified "Default-Start: 3 4 5" 21545 and "Default-Stop: 0 1 2 6", install_initd might create 21546 "start" symbolic links with names starting with 'S' in 21547 /etc/rc3.d, /etc/rc4.d and /etc/rc5.d and "stop" symbolic 21548 links with names starting with 'K' in /etc/rc0.d, 21549 /etc/rc1.d, /etc/rc2.d and /etc/rc6.d. Such a scheme would 21550 be similar to the System V Init mechanism, but is by no 21551 means the only way this specification could be implemented. 21552 21553 The install_initd command takes a single argument, the full 21554 pathname of the installed init script. The init script must 21555 already be installed in /etc/init.d. The install_initd command 21556 will not copy it there, only activate it once it has been 21557 installed. For example: 21558 21559 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 21560 21561 The install_initd command shall return an exit status of zero 21562 if the init-script activation was successful or if the init 21563 script was already activated. If the dependencies in the init 21564 script (see Comment Conventions for Init Scripts) cannot be 21565 met, an exit status of one shall be returned and the init 21566 script shall not be activated. 21567 21568 When a software package is removed, /usr/lib/lsb/remove_initd 21569 must be called to deactivate the init script. This must occur 21570 before the init script itself is removed, as the dependency 21571 information in the script may be required for successful 21572 completion. Thus the installer's pre-remove processing phase 21573 must call remove_initd, and pass the full pathname of the 21574 installed init script. The package installer is still 21575 responsible for removing the init script. For example: 21576 21577 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 21578 21579 The remove_initd program shall return an exit status of zero 21580 if the init script has been successfully deactivated or if the 21581 init script is not activated. If another init script which 21582 depends on a boot facility provided by this init script is 21583 activated, an exit status of one shall be returned and the 21584 init script shall remain activated. The installer must fail on 21585 such an exit code so it does not subsequently remove the init 21586 script. 21587 21588 Note: This specification does not describe a mechanism for 21589 the system administrator to manipulate the run levels at 21590 which an init script is started or stopped. There is no 21591 assurance that modifying the comment block for this purpose 21592 will have the desired effect. 21593 _________________________________________________________ 21594 21595 16.5. Run Levels 21596 21597 The following run levels are specified for use by the 21598 Default-Start and Default-Stop actions defined in Comment 21599 Conventions for Init Scripts as hints to the install_initd 21600 command. Conforming implementations are not required to 21601 provide these exact run levels or give them the meanings 21602 described here, and may map any level described here to a 21603 different level which provides the equivalent functionality. 21604 Applications may not depend on specific run-level numbers. 21605 21606 0 halt 21607 1 single user mode 21608 2 multiuser with no network services exported 21609 3 normal/full multiuser 21610 4 reserved for local use, default is normal/full multiuser 21611 5 multiuser with a display manager or equivalent 21612 6 reboot 21613 21614 Note: These run levels were chosen as reflecting the most 21615 frequent existing practice, and in the absence of other 21616 considerations, implementors are strongly encouraged to 21617 follow this convention to provide consistency for system 21618 administrators who need to work with multiple 21619 distributions. 21620 _________________________________________________________ 21621 21622 16.6. Facility Names 21623 21624 Boot facilities are used to indicate dependencies in 21625 initialization scripts, as defined in Comment Conventions for 21626 Init Scripts. Facility names are assigned to scripts by the 21627 Provides: keyword. Facility names that begin with a dollar 21628 sign ('$') are reserved system facility names. 21629 21630 Note: Facility names are only recognized in the context of 21631 the init script comment block and are not available in the 21632 body of the init script. In particular, the use of the 21633 leading '$' character does not imply system facility names 21634 are subject to shell variable expansion, since they appear 21635 inside comments. 21636 21637 Conforming applications shall not provide facilities that 21638 begin with a dollar sign. Implementations shall provide the 21639 following facility names: 21640 21641 $local_fs 21642 21643 all local file systems are mounted 21644 $network 21645 21646 basic networking support is available. Example: a server 21647 program could listen on a socket. 21648 $named 21649 21650 IP name-to-address translation, using the interfaces described 21651 in this specification, are available to the level the system 21652 normally provides them. Example: if a DNS query daemon 21653 normally provides this facility, then that daemon has been 21654 started. 21655 $portmap 21656 21657 daemons providing SunRPC/ONCRPC portmapping service as defined 21658 in RFC 1833: Binding Protocols for ONC RPC Version 2 (if 21659 present) are running. 21660 $remote_fs 21661 21662 all remote file systems are available. In some configurations, 21663 file systems such as /usr may be remote. Many applications 21664 that require $local_fs will probably also require $remote_fs. 21665 $syslog 21666 21667 system logger is operational. 21668 $time 21669 21670 the system time has been set, for example by using a 21671 network-based time program such as ntp or rdate, or via the 21672 hardware Real Time Clock. 21673 21674 Other (non-system) facilities may be defined by other 21675 conforming applications. These facilities shall be named using 21676 the same conventions defined for naming init scripts (see 21677 Script Names). Commonly, the facility provided by a conforming 21678 init script will have the same name as the name assigned to 21679 the init script. 21680 _________________________________________________________ 21681 21682 16.7. Script Names 21683 21684 Since init scripts live in a single directory, they must share 21685 a single namespace. To avoid conflicts, applications 21686 installing files in this directories shall use the LSB naming 21687 conventions (see File Naming Conventions). 21688 _________________________________________________________ 21689 21690 16.8. Init Script Functions 21691 21692 Each conforming init script shall execute the commands in the 21693 file /lib/lsb/init-functions in the current environment (see 21694 shell special built-in command dot). This file shall cause the 21695 following shell script commands to be defined in an 21696 unspecified manner. 21697 21698 Note: This can be done either by adding a directory to the 21699 PATH variable which defines these commands, or by defining 21700 shell aliases or functions. 21701 21702 Although the commands made available via this mechanism 21703 need not be conforming applications in their own right, 21704 applications that use them should only depend on features 21705 described in this specification. 21706 21707 Conforming scripts shall not specify the "exit on error" 21708 option (i.e. set -e) when sourcing this file, or calling any 21709 of the commands thus made available. 21710 21711 The start_daemon, killproc and pidofproc functions shall use 21712 the following algorithm for determining the status and the 21713 process identifiers of the specified program. 21714 21715 1. If the -p pidfile option is specified, and the named 21716 pidfile exists, a single line at the start of the pidfile 21717 shall be read. If this line contains one or more numeric 21718 values, separated by spaces, these values shall be used. 21719 If the -p pidfile option is specified and the named 21720 pidfile does not exist, the functions shall assume that 21721 the daemon is not running. 21722 2. Otherwise, /var/run/basename.pid shall be read in a 21723 similar fashion. If this contains one or more numeric 21724 values on the first line, these values shall be used. 21725 Optionally, implementations may use unspecified additional 21726 methods to locate the process identifiers required. 21727 21728 The method used to determine the status is implementation 21729 defined, but should allow for non-binary programs. 21730 21731 Note: Commonly used methods check either for the existence 21732 of the /proc/pid directory or use /proc/pid/exe and 21733 /proc/pid/cmdline. Relying only on /proc/pid/exe is 21734 discouraged since this specification does not specify the 21735 existence of, or semantics for, /proc. Additionally, using 21736 /proc/pid/exe may result in a not-running status for 21737 daemons that are written in a script language. 21738 21739 Conforming implementations may use other mechanisms besides 21740 those based on pidfiles, unless the -p pidfile option has been 21741 used. Conforming applications should not rely on such 21742 mechanisms and should always use a pidfile. When a program is 21743 stopped, it should delete its pidfile. Multiple process 21744 identifiers shall be separated by a single space in the 21745 pidfile and in the output of pidofproc. 21746 21747 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 21748 [args...] 21749 runs the specified program as a daemon. The 21750 start_daemon function shall check if the program is 21751 already running using the algorithm given above. If so, 21752 it shall not start another copy of the daemon unless 21753 the -f option is given. The -n option specifies a nice 21754 level. See nice. start_daemon shall return the LSB 21755 defined exit status codes. It shall return 0 if the 21756 program has been successfully started or is running and 21757 not 0 otherwise. 21758 21759 killproc [-p pidfile] pathname [signal] 21760 The killproc function shall stop the specified program. 21761 The program is found using the algorithm given above. 21762 If a signal is specified, using the -signal_name or 21763 -signal_number syntaxes as specified by the kill 21764 command, the program is sent that signal. Otherwise, a 21765 SIGTERM followed by a SIGKILL after an unspecified 21766 number of seconds shall be sent. If a program has been 21767 terminated, the pidfile should be removed if the 21768 terminated process has not already done so. The 21769 killproc function shall return the LSB defined exit 21770 status codes. If called without a signal, it shall 21771 return 0 if the program has been stopped or is not 21772 running and not 0 otherwise. If a signal is given, it 21773 shall return 0 only if the program is running. 21774 21775 pidofproc [-p pidfile] pathname 21776 The pidofproc function shall return one or more process 21777 identifiers for a particular daemon using the algorithm 21778 given above. Only process identifiers of running 21779 processes should be returned. Multiple process 21780 identifiers shall be separated by a single space. 21781 21782 Note: A process may exit between pidofproc discovering its 21783 identity and the caller of pidofproc being able to act on 21784 that identity. As a result, no test assertion can be made 21785 that the process identifiers returned by pidofproc shall be 21786 running processes. 21787 21788 The pidofproc function shall return the LSB defined 21789 exit status codes for "status". It shall return 0 if 21790 the program is running and not 0 otherwise. 21791 21792 log_success_msg message 21793 The log_success_msg function shall cause the system to 21794 write a success message to an unspecified log file. The 21795 format of the message is unspecified. The 21796 log_success_msg function may also write a message to 21797 the standard output. 21798 21799 Note: The message should be relatively short; no more than 21800 60 characters is highly desirable. 21801 21802 log_failure_msg message 21803 The log_failure_msg function shall cause the system to 21804 write a failure message to an unspecified log file. The 21805 format of the message is unspecified. The 21806 log_failure_msg function may also write a message to 21807 the standard output. 21808 21809 Note: The message should be relatively short; no more than 21810 60 characters is highly desirable. 21811 21812 log_warning_msg message 21813 The log_warning_msg function shall cause the system to 21814 write a warning message to an unspecified log file. The 21815 format of the message is unspecified. The 21816 log_warning_msg function may also write a message to 21817 the standard output. 21818 21819 Note: The message should be relatively short; no more than 21820 60 characters is highly desirable. 21821 21822 VII. Users & Groups 21823 21824 Table of Contents 21825 17. Users & Groups 21826 21827 17.1. User and Group Database 21828 17.2. User & Group Names 21829 17.3. User ID Ranges 21830 17.4. Rationale 21831 _________________________________________________________ 21832 21833 Chapter 17. Users & Groups 21834 21835 17.1. User and Group Database 21836 21837 The format of the User and Group databases is not specified. 21838 Programs may only read these databases using the provided API. 21839 Changes to these databases should be made using the provided 21840 commands. 21841 _________________________________________________________ 21842 21843 17.2. User & Group Names 21844 21845 Table 17-1 describes required mnemonic user and group names. 21846 This specification makes no attempt to numerically assign user 21847 or group identity numbers, with the exception that both the 21848 User ID and Group ID for the user root shall be equal to 0. 21849 21850 Table 17-1. Required User & Group Names 21851 User Group Comments 21852 root root Administrative user with all appropriate privileges 21853 bin bin Legacy User ID/Group ID[a] 21854 daemon daemon Legacy User ID/Group ID[b] 21855 Notes: 21856 a. The bin User ID/Group ID is included for compatibility with 21857 legacy applications. New applications should no longer use the 21858 bin User ID/Group ID. 21859 b. The daemon User ID/Group ID was used as an unprivileged 21860 User ID/Group ID for daemons to execute under in order to 21861 limit their access to the system. Generally daemons should now 21862 run under individual User ID/Group IDs in order to further 21863 partition daemons from one another. 21864 21865 Table 17-2 is a table of optional mnemonic user and group 21866 names. This specification makes no attempt to numerically 21867 assign uid or gid numbers. If the username exists on a system, 21868 then they should be in the suggested corresponding group. 21869 These user and group names are for use by distributions, not 21870 by applications. 21871 21872 Table 17-2. Optional User & Group Names 21873 User Group Comments 21874 adm adm Administrative special privileges 21875 lp lp Printer special privileges 21876 sync sync Login to sync the system 21877 shutdown shutdown Login to shutdown the system 21878 halt halt Login to halt the system 21879 mail mail Mail special privileges 21880 news news News special privileges 21881 uucp uucp UUCP special privileges 21882 operator root Operator special privileges 21883 man man Man special privileges 21884 nobody nobody Used by NFS 21885 21886 Only a minimum working set of "user names" and their 21887 corresponding "user groups" are required. Applications cannot 21888 assume non system user or group names will be defined. 21889 21890 Applications cannot assume any policy for the default file 21891 creation mask (umask) or the default directory permissions a 21892 user may have. Applications should enforce user only file 21893 permissions on private files such as mailboxes. The location 21894 of the users home directory is also not defined by policy 21895 other than the recommendations of the Filesystem Hierarchy 21896 Standard and should be obtained by the getpwnam(), 21897 getpwnam_r(), getpwent(), getpwuid(), and getpwuid_r() 21898 functions. 21899 _________________________________________________________ 21900 21901 17.3. User ID Ranges 21902 21903 The system User IDs from 0 to 99 should be statically 21904 allocated by the system, and shall not be created by 21905 applications. 21906 21907 The system User IDs from 100 to 499 should be reserved for 21908 dynamic allocation by system administrators and post install 21909 scripts using useradd. 21910 _________________________________________________________ 21911 21912 17.4. Rationale 21913 21914 The purpose of specifying optional users and groups is to 21915 reduce the potential for name conflicts between applications 21916 and distributions. 21917 _________________________________________________________ 21918 21919 Appendix A. Alphabetical Listing of Interfaces 21920 _________________________________________________________ 21921 21922 A.1. libc 21923 21924 The behavior of the interfaces in this library is specified by 21925 the following Standards. 21926 21927 Large File Support [LFS] 21928 This Specification [LSB] 21929 SUSv2 [SUSv2] 21930 ISO POSIX (2003) [SUSv3] 21931 SVID Issue 3 [SVID.3] 21932 SVID Issue 4 [SVID.4] 21933 21934 Table A-1. libc Function Interfaces 21935 _Exit(GLIBC_2.1.1)[SUSv3] getpwuid_r(GLIBC_2.1.1)[SUSv3] 21936 sigaddset(GLIBC_2.1.1)[SUSv3] 21937 _IO_feof(GLIBC_2.0)[LSB] getrlimit(GLIBC_2.0)[SUSv3] 21938 sigaltstack(GLIBC_2.0)[SUSv3] 21939 _IO_getc(GLIBC_2.0)[LSB] getrlimit64(GLIBC_2.0)[LFS] 21940 sigandset(GLIBC_2.0)[LSB] 21941 _IO_putc(GLIBC_2.0)[LSB] getrusage(GLIBC_2.0)[SUSv3] 21942 sigdelset(GLIBC_2.0)[SUSv3] 21943 _IO_puts(GLIBC_2.0)[LSB] getservbyname(GLIBC_2.0)[SUSv3] 21944 sigemptyset(GLIBC_2.0)[SUSv3] 21945 __assert_fail(GLIBC_2.0)[LSB] getservbyport(GLIBC_2.0)[SUSv3] 21946 sigfillset(GLIBC_2.0)[SUSv3] 21947 __ctype_b_loc[LSB] getservent()[SUSv3] sighold()[SUSv3] 21948 __ctype_get_mb_cur_max(GLIBC_2.0)[LSB] 21949 getsid(GLIBC_2.0)[SUSv3] sigignore(GLIBC_2.0)[SUSv3] 21950 __ctype_tolower_loc[LSB] getsockname()[SUSv3] 21951 siginterrupt()[SUSv3] 21952 __ctype_toupper_loc[LSB] getsockopt()[LSB] 21953 sigisemptyset()[LSB] 21954 __cxa_atexit(GLIBC_2.1.3)[LSB] getsubopt(GLIBC_2.1.3)[SUSv3] 21955 sigismember(GLIBC_2.1.3)[SUSv3] 21956 __errno_location(GLIBC_2.0)[LSB] gettext(GLIBC_2.0)[LSB] 21957 siglongjmp(GLIBC_2.0)[SUSv3] 21958 __fpending(GLIBC_2.2)[LSB] gettimeofday(GLIBC_2.2)[SUSv3] 21959 signal(GLIBC_2.2)[SUSv3] 21960 __fxstat(GLIBC_2.0)[LSB] getuid(GLIBC_2.0)[SUSv3] 21961 sigorset(GLIBC_2.0)[LSB] 21962 __fxstat64(GLIBC_2.2)[LSB] getutent(GLIBC_2.2)[LSB] 21963 sigpause(GLIBC_2.2)[SUSv3] 21964 __getpagesize(GLIBC_2.0)[LSB] getutent_r(GLIBC_2.0)[LSB] 21965 sigpending(GLIBC_2.0)[SUSv3] 21966 __getpgid(GLIBC_2.0)[LSB] getutxent(GLIBC_2.0)[SUSv3] 21967 sigprocmask(GLIBC_2.0)[SUSv3] 21968 __h_errno_location[LSB] getutxid()[SUSv3] sigqueue()[SUSv3] 21969 __isinf[LSB] getutxline()[SUSv3] sigrelse()[SUSv3] 21970 __isinff[LSB] getw()[SUSv2] sigreturn()[LSB] 21971 __isinfl[LSB] getwc()[SUSv3] sigset()[SUSv3] 21972 __isnan[LSB] getwchar()[SUSv3] sigsuspend()[SUSv3] 21973 __isnanf[LSB] getwd()[SUSv3] sigtimedwait()[SUSv3] 21974 __isnanl[LSB] glob()[SUSv3] sigwait()[SUSv3] 21975 __libc_current_sigrtmax(GLIBC_2.1)[LSB] glob64(GLIBC_2.1)[LSB] 21976 sigwaitinfo(GLIBC_2.1)[SUSv3] 21977 __libc_current_sigrtmin(GLIBC_2.1)[LSB] 21978 globfree(GLIBC_2.1)[SUSv3] sleep(GLIBC_2.1)[SUSv3] 21979 __libc_start_main(GLIBC_2.0)[LSB] globfree64(GLIBC_2.0)[LSB] 21980 snprintf(GLIBC_2.0)[SUSv3] 21981 __lxstat(GLIBC_2.0)[LSB] gmtime(GLIBC_2.0)[SUSv3] 21982 sockatmark[SUSv3] 21983 __lxstat64(GLIBC_2.2)[LSB] gmtime_r(GLIBC_2.2)[SUSv3] 21984 socket(GLIBC_2.2)[SUSv3] 21985 __mempcpy(GLIBC_2.0)[LSB] grantpt(GLIBC_2.0)[SUSv3] 21986 socketpair(GLIBC_2.0)[SUSv3] 21987 __rawmemchr(GLIBC_2.1)[LSB] hcreate(GLIBC_2.1)[SUSv3] 21988 sprintf(GLIBC_2.1)[SUSv3] 21989 __register_atfork[LSB] hdestroy()[SUSv3] srand()[SUSv3] 21990 __sigsetjmp(GLIBC_2.0)[LSB] hsearch(GLIBC_2.0)[SUSv3] 21991 srand48(GLIBC_2.0)[SUSv3] 21992 __stpcpy(GLIBC_2.0)[LSB] htonl(GLIBC_2.0)[SUSv3] 21993 srandom(GLIBC_2.0)[SUSv3] 21994 __strdup(GLIBC_2.0)[LSB] htons(GLIBC_2.0)[SUSv3] 21995 sscanf(GLIBC_2.0)[LSB] 21996 __strtod_internal(GLIBC_2.0)[LSB] iconv(GLIBC_2.0)[SUSv3] 21997 statvfs(GLIBC_2.0)[SUSv3] 21998 __strtof_internal(GLIBC_2.0)[LSB] 21999 iconv_close(GLIBC_2.0)[SUSv3] statvfs64[LFS] 22000 __strtok_r(GLIBC_2.0)[LSB] iconv_open(GLIBC_2.0)[SUSv3] 22001 stime(GLIBC_2.0)[LSB] 22002 __strtol_internal(GLIBC_2.0)[LSB] if_freenameindex[SUSv3] 22003 stpcpy(GLIBC_2.0)[LSB] 22004 __strtold_internal(GLIBC_2.0)[LSB] if_indextoname[SUSv3] 22005 stpncpy(GLIBC_2.0)[LSB] 22006 __strtoll_internal(GLIBC_2.0)[LSB] if_nameindex[SUSv3] 22007 strcasecmp(GLIBC_2.0)[SUSv3] 22008 __strtoul_internal(GLIBC_2.0)[LSB] if_nametoindex[SUSv3] 22009 strcasestr(GLIBC_2.0)[LSB] 22010 __strtoull_internal(GLIBC_2.0)[LSB] imaxabs(GLIBC_2.0)[SUSv3] 22011 strcat(GLIBC_2.0)[SUSv3] 22012 __sysconf(GLIBC_2.2)[LSB] imaxdiv(GLIBC_2.2)[SUSv3] 22013 strchr(GLIBC_2.2)[SUSv3] 22014 __sysv_signal(GLIBC_2.0)[LSB] index(GLIBC_2.0)[SUSv3] 22015 strcmp(GLIBC_2.0)[SUSv3] 22016 __wcstod_internal(GLIBC_2.0)[LSB] inet_addr(GLIBC_2.0)[SUSv3] 22017 strcoll(GLIBC_2.0)[SUSv3] 22018 __wcstof_internal(GLIBC_2.0)[LSB] inet_ntoa(GLIBC_2.0)[SUSv3] 22019 strcpy(GLIBC_2.0)[SUSv3] 22020 __wcstol_internal(GLIBC_2.0)[LSB] inet_ntop[SUSv3] 22021 strcspn(GLIBC_2.0)[SUSv3] 22022 __wcstold_internal(GLIBC_2.0)[LSB] inet_pton[SUSv3] 22023 strdup(GLIBC_2.0)[SUSv3] 22024 __wcstoul_internal(GLIBC_2.0)[LSB] initgroups(GLIBC_2.0)[LSB] 22025 strerror(GLIBC_2.0)[SUSv3] 22026 __xmknod(GLIBC_2.0)[LSB] initstate(GLIBC_2.0)[SUSv3] 22027 strerror_r(GLIBC_2.0)[LSB] 22028 __xstat(GLIBC_2.0)[LSB] insque(GLIBC_2.0)[SUSv3] 22029 strfmon(GLIBC_2.0)[SUSv3] 22030 __xstat64(GLIBC_2.2)[LSB] ioctl(GLIBC_2.2)[LSB] 22031 strftime(GLIBC_2.2)[SUSv3] 22032 _exit(GLIBC_2.0)[SUSv3] isalnum(GLIBC_2.0)[SUSv3] 22033 strlen(GLIBC_2.0)[SUSv3] 22034 _longjmp(GLIBC_2.0)[SUSv3] isalpha(GLIBC_2.0)[SUSv3] 22035 strncasecmp(GLIBC_2.0)[SUSv3] 22036 _setjmp(GLIBC_2.0)[SUSv3] isascii(GLIBC_2.0)[SUSv3] 22037 strncat(GLIBC_2.0)[SUSv3] 22038 _tolower(GLIBC_2.0)[SUSv3] isatty(GLIBC_2.0)[SUSv3] 22039 strncmp(GLIBC_2.0)[SUSv3] 22040 _toupper(GLIBC_2.0)[SUSv3] isblank(GLIBC_2.0)[SUSv3] 22041 strncpy(GLIBC_2.0)[SUSv3] 22042 a64l(GLIBC_2.0)[SUSv3] iscntrl(GLIBC_2.0)[SUSv3] 22043 strndup(GLIBC_2.0)[LSB] 22044 abort(GLIBC_2.0)[SUSv3] isdigit(GLIBC_2.0)[SUSv3] 22045 strnlen(GLIBC_2.0)[LSB] 22046 abs(GLIBC_2.0)[SUSv3] isgraph(GLIBC_2.0)[SUSv3] 22047 strpbrk(GLIBC_2.0)[SUSv3] 22048 accept(GLIBC_2.0)[SUSv3] islower(GLIBC_2.0)[SUSv3] 22049 strptime(GLIBC_2.0)[LSB] 22050 access(GLIBC_2.0)[SUSv3] isprint(GLIBC_2.0)[SUSv3] 22051 strrchr(GLIBC_2.0)[SUSv3] 22052 acct(GLIBC_2.0)[LSB] ispunct(GLIBC_2.0)[SUSv3] 22053 strsep(GLIBC_2.0)[LSB] 22054 adjtime(GLIBC_2.0)[LSB] isspace(GLIBC_2.0)[SUSv3] 22055 strsignal(GLIBC_2.0)[LSB] 22056 alarm(GLIBC_2.0)[SUSv3] isupper(GLIBC_2.0)[SUSv3] 22057 strspn(GLIBC_2.0)[SUSv3] 22058 asctime(GLIBC_2.0)[SUSv3] iswalnum(GLIBC_2.0)[SUSv3] 22059 strstr(GLIBC_2.0)[SUSv3] 22060 asctime_r(GLIBC_2.0)[SUSv3] iswalpha(GLIBC_2.0)[SUSv3] 22061 strtod(GLIBC_2.0)[SUSv3] 22062 asprintf(GLIBC_2.0)[LSB] iswblank(GLIBC_2.0)[SUSv3] 22063 strtof(GLIBC_2.0)[SUSv3] 22064 atof(GLIBC_2.0)[SUSv3] iswcntrl(GLIBC_2.0)[SUSv3] 22065 strtoimax(GLIBC_2.0)[SUSv3] 22066 atoi(GLIBC_2.0)[SUSv3] iswctype(GLIBC_2.0)[SUSv3] 22067 strtok(GLIBC_2.0)[SUSv3] 22068 atol(GLIBC_2.0)[SUSv3] iswdigit(GLIBC_2.0)[SUSv3] 22069 strtok_r(GLIBC_2.0)[SUSv3] 22070 atoll[SUSv3] iswgraph()[SUSv3] strtol()[SUSv3] 22071 authnone_create(GLIBC_2.0)[SVID.4] iswlower(GLIBC_2.0)[SUSv3] 22072 strtold(GLIBC_2.0)[SUSv3] 22073 basename(GLIBC_2.0)[SUSv3] iswprint(GLIBC_2.0)[SUSv3] 22074 strtoll(GLIBC_2.0)[SUSv3] 22075 bcmp(GLIBC_2.0)[SUSv3] iswpunct(GLIBC_2.0)[SUSv3] 22076 strtoq(GLIBC_2.0)[LSB] 22077 bcopy(GLIBC_2.0)[SUSv3] iswspace(GLIBC_2.0)[SUSv3] 22078 strtoul(GLIBC_2.0)[SUSv3] 22079 bind(GLIBC_2.0)[SUSv3] iswupper(GLIBC_2.0)[SUSv3] 22080 strtoull(GLIBC_2.0)[SUSv3] 22081 bind_textdomain_codeset[LSB] iswxdigit()[SUSv3] 22082 strtoumax()[SUSv3] 22083 bindresvport(GLIBC_2.0)[LSB] isxdigit(GLIBC_2.0)[SUSv3] 22084 strtouq(GLIBC_2.0)[LSB] 22085 bindtextdomain(GLIBC_2.0)[LSB] jrand48(GLIBC_2.0)[SUSv3] 22086 strxfrm(GLIBC_2.0)[SUSv3] 22087 brk(GLIBC_2.0)[SUSv2] key_decryptsession(GLIBC_2.0)[SVID.3] 22088 svc_getreqset(GLIBC_2.0)[SVID.3] 22089 bsd_signal(GLIBC_2.0)[SUSv3] kill(GLIBC_2.0)[LSB] 22090 svc_register(GLIBC_2.0)[LSB] 22091 bsearch(GLIBC_2.0)[SUSv3] killpg(GLIBC_2.0)[SUSv3] 22092 svc_run(GLIBC_2.0)[LSB] 22093 btowc(GLIBC_2.0)[SUSv3] l64a(GLIBC_2.0)[SUSv3] 22094 svc_sendreply(GLIBC_2.0)[LSB] 22095 bzero(GLIBC_2.0)[SUSv3] labs(GLIBC_2.0)[SUSv3] 22096 svcerr_auth(GLIBC_2.0)[SVID.3] 22097 calloc(GLIBC_2.0)[SUSv3] lchown(GLIBC_2.0)[SUSv3] 22098 svcerr_decode(GLIBC_2.0)[SVID.3] 22099 catclose(GLIBC_2.0)[SUSv3] lcong48(GLIBC_2.0)[SUSv3] 22100 svcerr_noproc(GLIBC_2.0)[SVID.3] 22101 catgets(GLIBC_2.0)[SUSv3] ldiv(GLIBC_2.0)[SUSv3] 22102 svcerr_noprog(GLIBC_2.0)[SVID.3] 22103 catopen(GLIBC_2.0)[SUSv3] lfind(GLIBC_2.0)[SUSv3] 22104 svcerr_progvers(GLIBC_2.0)[SVID.3] 22105 cfgetispeed(GLIBC_2.0)[SUSv3] link(GLIBC_2.0)[LSB] 22106 svcerr_systemerr(GLIBC_2.0)[SVID.3] 22107 cfgetospeed(GLIBC_2.0)[SUSv3] listen(GLIBC_2.0)[SUSv3] 22108 svcerr_weakauth(GLIBC_2.0)[SVID.3] 22109 cfmakeraw(GLIBC_2.0)[LSB] llabs(GLIBC_2.0)[SUSv3] 22110 svctcp_create(GLIBC_2.0)[LSB] 22111 cfsetispeed(GLIBC_2.0)[SUSv3] lldiv(GLIBC_2.0)[SUSv3] 22112 svcudp_create(GLIBC_2.0)[LSB] 22113 cfsetospeed(GLIBC_2.0)[SUSv3] localeconv(GLIBC_2.0)[SUSv3] 22114 swab(GLIBC_2.0)[SUSv3] 22115 cfsetspeed(GLIBC_2.0)[LSB] localtime(GLIBC_2.0)[SUSv3] 22116 swapcontext(GLIBC_2.0)[SUSv3] 22117 chdir(GLIBC_2.0)[SUSv3] localtime_r(GLIBC_2.0)[SUSv3] 22118 swprintf(GLIBC_2.0)[SUSv3] 22119 chmod(GLIBC_2.0)[SUSv3] lockf(GLIBC_2.0)[SUSv3] 22120 swscanf(GLIBC_2.0)[LSB] 22121 chown(GLIBC_2.1)[SUSv3] lockf64(GLIBC_2.1)[LFS] 22122 symlink(GLIBC_2.1)[SUSv3] 22123 chroot(GLIBC_2.0)[SUSv2] longjmp(GLIBC_2.0)[SUSv3] 22124 sync(GLIBC_2.0)[SUSv3] 22125 clearerr(GLIBC_2.0)[SUSv3] lrand48(GLIBC_2.0)[SUSv3] 22126 sysconf(GLIBC_2.0)[SUSv3] 22127 clnt_create(GLIBC_2.0)[SVID.4] lsearch(GLIBC_2.0)[SUSv3] 22128 syslog(GLIBC_2.0)[SUSv3] 22129 clnt_pcreateerror(GLIBC_2.0)[SVID.4] lseek(GLIBC_2.0)[SUSv3] 22130 system(GLIBC_2.0)[LSB] 22131 clnt_perrno(GLIBC_2.0)[SVID.4] makecontext(GLIBC_2.0)[SUSv3] 22132 tcdrain(GLIBC_2.0)[SUSv3] 22133 clnt_perror(GLIBC_2.0)[SVID.4] malloc(GLIBC_2.0)[SUSv3] 22134 tcflow(GLIBC_2.0)[SUSv3] 22135 clnt_spcreateerror(GLIBC_2.0)[SVID.4] mblen(GLIBC_2.0)[SUSv3] 22136 tcflush(GLIBC_2.0)[SUSv3] 22137 clnt_sperrno(GLIBC_2.0)[SVID.4] mbrlen(GLIBC_2.0)[SUSv3] 22138 tcgetattr(GLIBC_2.0)[SUSv3] 22139 clnt_sperror(GLIBC_2.0)[SVID.4] mbrtowc(GLIBC_2.0)[SUSv3] 22140 tcgetpgrp(GLIBC_2.0)[SUSv3] 22141 clock(GLIBC_2.0)[SUSv3] mbsinit(GLIBC_2.0)[SUSv3] 22142 tcgetsid(GLIBC_2.0)[SUSv3] 22143 close(GLIBC_2.0)[SUSv3] mbsnrtowcs(GLIBC_2.0)[LSB] 22144 tcsendbreak(GLIBC_2.0)[SUSv3] 22145 closedir(GLIBC_2.0)[SUSv3] mbsrtowcs(GLIBC_2.0)[SUSv3] 22146 tcsetattr(GLIBC_2.0)[SUSv3] 22147 closelog(GLIBC_2.0)[SUSv3] mbstowcs(GLIBC_2.0)[SUSv3] 22148 tcsetpgrp(GLIBC_2.0)[SUSv3] 22149 confstr(GLIBC_2.0)[SUSv3] mbtowc(GLIBC_2.0)[SUSv3] 22150 tdelete[SUSv3] 22151 connect(GLIBC_2.0)[SUSv3] memccpy(GLIBC_2.0)[SUSv3] 22152 telldir(GLIBC_2.0)[SUSv3] 22153 creat(GLIBC_2.0)[SUSv3] memchr(GLIBC_2.0)[SUSv3] 22154 tempnam(GLIBC_2.0)[SUSv3] 22155 creat64(GLIBC_2.1)[LFS] memcmp(GLIBC_2.1)[SUSv3] 22156 textdomain(GLIBC_2.1)[LSB] 22157 ctermid(GLIBC_2.0)[SUSv3] memcpy(GLIBC_2.0)[SUSv3] 22158 tfind(GLIBC_2.0)[SUSv3] 22159 ctime(GLIBC_2.0)[SUSv3] memmem(GLIBC_2.0)[LSB] 22160 time(GLIBC_2.0)[SUSv3] 22161 ctime_r(GLIBC_2.0)[SUSv3] memmove(GLIBC_2.0)[SUSv3] 22162 times(GLIBC_2.0)[SUSv3] 22163 cuserid(GLIBC_2.0)[SUSv2] memrchr(GLIBC_2.0)[LSB] 22164 tmpfile(GLIBC_2.0)[SUSv3] 22165 daemon(GLIBC_2.0)[LSB] memset(GLIBC_2.0)[SUSv3] 22166 tmpfile64(GLIBC_2.0)[LFS] 22167 dcgettext(GLIBC_2.0)[LSB] mkdir(GLIBC_2.0)[SUSv3] 22168 tmpnam(GLIBC_2.0)[SUSv3] 22169 dcngettext[LSB] mkfifo()[SUSv3] toascii()[SUSv3] 22170 dgettext[LSB] mkstemp()[SUSv3] tolower()[SUSv3] 22171 difftime(GLIBC_2.0)[SUSv3] mkstemp64(GLIBC_2.0)[LFS] 22172 toupper(GLIBC_2.0)[SUSv3] 22173 dirname(GLIBC_2.0)[SUSv3] mktemp(GLIBC_2.0)[SUSv3] 22174 towctrans(GLIBC_2.0)[SUSv3] 22175 div(GLIBC_2.0)[SUSv3] mktime(GLIBC_2.0)[SUSv3] 22176 towlower(GLIBC_2.0)[SUSv3] 22177 dngettext[LSB] mlock()[SUSv3] towupper()[SUSv3] 22178 drand48(GLIBC_2.0)[SUSv3] mlockall(GLIBC_2.0)[SUSv3] 22179 truncate(GLIBC_2.0)[SUSv3] 22180 dup(GLIBC_2.0)[SUSv3] mmap(GLIBC_2.0)[SUSv3] 22181 truncate64(GLIBC_2.0)[LFS] 22182 dup2(GLIBC_2.0)[SUSv3] mmap64(GLIBC_2.0)[LFS] 22183 tsearch(GLIBC_2.0)[SUSv3] 22184 duplocale[LSB] mprotect()[SUSv3] ttyname()[SUSv3] 22185 ecvt(GLIBC_2.0)[SUSv3] mrand48(GLIBC_2.0)[SUSv3] 22186 ttyname_r(GLIBC_2.0)[SUSv3] 22187 endgrent(GLIBC_2.0)[SUSv3] msgctl(GLIBC_2.0)[SUSv3] 22188 twalk(GLIBC_2.0)[SUSv3] 22189 endprotoent(GLIBC_2.0)[SUSv3] msgget(GLIBC_2.0)[SUSv3] 22190 tzset(GLIBC_2.0)[SUSv3] 22191 endpwent(GLIBC_2.0)[SUSv3] msgrcv(GLIBC_2.0)[SUSv3] 22192 ualarm(GLIBC_2.0)[SUSv3] 22193 endservent(GLIBC_2.0)[SUSv3] msgsnd(GLIBC_2.0)[SUSv3] 22194 ulimit(GLIBC_2.0)[SUSv3] 22195 endutent(GLIBC_2.0)[SUSv2] msync(GLIBC_2.0)[SUSv3] 22196 umask(GLIBC_2.0)[SUSv3] 22197 endutxent(GLIBC_2.1)[SUSv3] munlock(GLIBC_2.1)[SUSv3] 22198 uname(GLIBC_2.1)[SUSv3] 22199 erand48(GLIBC_2.0)[SUSv3] munlockall(GLIBC_2.0)[SUSv3] 22200 ungetc(GLIBC_2.0)[SUSv3] 22201 err(GLIBC_2.0)[LSB] munmap(GLIBC_2.0)[SUSv3] 22202 ungetwc(GLIBC_2.0)[SUSv3] 22203 error(GLIBC_2.0)[LSB] nanosleep(GLIBC_2.0)[SUSv3] 22204 unlink(GLIBC_2.0)[LSB] 22205 errx(GLIBC_2.0)[LSB] newlocale[LSB] unlockpt(GLIBC_2.0)[SUSv3] 22206 execl(GLIBC_2.0)[SUSv3] nftw(GLIBC_2.0)[SUSv3] unsetenv[SUSv3] 22207 execle(GLIBC_2.0)[SUSv3] nftw64(GLIBC_2.0)[LFS] uselocale[LSB] 22208 execlp(GLIBC_2.0)[SUSv3] ngettext[LSB] 22209 usleep(GLIBC_2.0)[SUSv3] 22210 execv(GLIBC_2.0)[SUSv3] nice(GLIBC_2.0)[SUSv3] 22211 utime(GLIBC_2.0)[SUSv3] 22212 execve(GLIBC_2.0)[SUSv3] nl_langinfo(GLIBC_2.0)[SUSv3] 22213 utimes(GLIBC_2.0)[SUSv3] 22214 execvp(GLIBC_2.0)[SUSv3] nrand48(GLIBC_2.0)[SUSv3] 22215 utmpname[LSB] 22216 exit(GLIBC_2.0)[SUSv3] ntohl(GLIBC_2.0)[SUSv3] 22217 vasprintf(GLIBC_2.0)[LSB] 22218 fchdir(GLIBC_2.0)[SUSv3] ntohs(GLIBC_2.0)[SUSv3] 22219 vdprintf(GLIBC_2.0)[LSB] 22220 fchmod(GLIBC_2.0)[SUSv3] open(GLIBC_2.0)[SUSv3] 22221 verrx(GLIBC_2.0)[LSB] 22222 fchown(GLIBC_2.0)[SUSv3] opendir(GLIBC_2.0)[SUSv3] 22223 vfork(GLIBC_2.0)[SUSv3] 22224 fclose(GLIBC_2.1)[SUSv3] openlog(GLIBC_2.1)[SUSv3] 22225 vfprintf(GLIBC_2.1)[SUSv3] 22226 fcntl(GLIBC_2.0)[LSB] pathconf(GLIBC_2.0)[SUSv3] vfscanf[LSB] 22227 fcvt(GLIBC_2.0)[SUSv3] pause(GLIBC_2.0)[SUSv3] 22228 vfwprintf(GLIBC_2.0)[SUSv3] 22229 fdatasync(GLIBC_2.0)[SUSv3] pclose(GLIBC_2.0)[SUSv3] 22230 vfwscanf(GLIBC_2.0)[LSB] 22231 fdopen(GLIBC_2.1)[SUSv3] perror(GLIBC_2.1)[SUSv3] 22232 vprintf(GLIBC_2.1)[SUSv3] 22233 feof(GLIBC_2.0)[SUSv3] pipe(GLIBC_2.0)[SUSv3] vscanf[LSB] 22234 ferror(GLIBC_2.0)[SUSv3] pmap_getport(GLIBC_2.0)[LSB] 22235 vsnprintf(GLIBC_2.0)[SUSv3] 22236 fflush(GLIBC_2.0)[SUSv3] pmap_set(GLIBC_2.0)[LSB] 22237 vsprintf(GLIBC_2.0)[SUSv3] 22238 fflush_unlocked(GLIBC_2.0)[LSB] pmap_unset(GLIBC_2.0)[LSB] 22239 vsscanf[LSB] 22240 ffs(GLIBC_2.0)[SUSv3] poll(GLIBC_2.0)[SUSv3] 22241 vswprintf(GLIBC_2.0)[SUSv3] 22242 fgetc(GLIBC_2.0)[SUSv3] popen(GLIBC_2.0)[SUSv3] 22243 vswscanf(GLIBC_2.0)[LSB] 22244 fgetpos(GLIBC_2.0)[SUSv3] posix_memalign(GLIBC_2.0)[SUSv3] 22245 vsyslog[LSB] 22246 fgetpos64(GLIBC_2.1)[LFS] posix_openpt[SUSv3] 22247 vwprintf(GLIBC_2.1)[SUSv3] 22248 fgets(GLIBC_2.0)[SUSv3] printf(GLIBC_2.0)[SUSv3] 22249 vwscanf(GLIBC_2.0)[LSB] 22250 fgetwc(GLIBC_2.2)[SUSv3] psignal(GLIBC_2.2)[LSB] 22251 wait(GLIBC_2.2)[SUSv3] 22252 fgetwc_unlocked(GLIBC_2.2)[LSB] ptsname(GLIBC_2.2)[SUSv3] 22253 wait4(GLIBC_2.2)[LSB] 22254 fgetws(GLIBC_2.2)[SUSv3] putc(GLIBC_2.2)[SUSv3] 22255 waitpid(GLIBC_2.2)[LSB] 22256 fileno(GLIBC_2.0)[SUSv3] putc_unlocked(GLIBC_2.0)[SUSv3] 22257 warn(GLIBC_2.0)[LSB] 22258 flock(GLIBC_2.0)[LSB] putchar(GLIBC_2.0)[SUSv3] 22259 warnx(GLIBC_2.0)[LSB] 22260 flockfile(GLIBC_2.0)[SUSv3] putchar_unlocked(GLIBC_2.0)[SUSv3] 22261 wcpcpy(GLIBC_2.0)[LSB] 22262 fmtmsg(GLIBC_2.1)[SUSv3] putenv(GLIBC_2.1)[SUSv3] 22263 wcpncpy(GLIBC_2.1)[LSB] 22264 fnmatch(GLIBC_2.2.3)[SUSv3] puts(GLIBC_2.2.3)[SUSv3] 22265 wcrtomb(GLIBC_2.2.3)[SUSv3] 22266 fopen(GLIBC_2.1)[SUSv3] pututxline(GLIBC_2.1)[SUSv3] 22267 wcscasecmp(GLIBC_2.1)[LSB] 22268 fopen64(GLIBC_2.1)[LFS] putw(GLIBC_2.1)[SUSv2] 22269 wcscat(GLIBC_2.1)[SUSv3] 22270 fork(GLIBC_2.0)[SUSv3] putwc(GLIBC_2.0)[SUSv3] 22271 wcschr(GLIBC_2.0)[SUSv3] 22272 fpathconf(GLIBC_2.0)[SUSv3] putwchar(GLIBC_2.0)[SUSv3] 22273 wcscmp(GLIBC_2.0)[SUSv3] 22274 fprintf(GLIBC_2.0)[SUSv3] qsort(GLIBC_2.0)[SUSv3] 22275 wcscoll(GLIBC_2.0)[SUSv3] 22276 fputc(GLIBC_2.0)[SUSv3] raise(GLIBC_2.0)[SUSv3] 22277 wcscpy(GLIBC_2.0)[SUSv3] 22278 fputs(GLIBC_2.0)[SUSv3] rand(GLIBC_2.0)[SUSv3] 22279 wcscspn(GLIBC_2.0)[SUSv3] 22280 fputwc(GLIBC_2.2)[SUSv3] rand_r(GLIBC_2.2)[SUSv3] 22281 wcsdup(GLIBC_2.2)[LSB] 22282 fputws(GLIBC_2.2)[SUSv3] random(GLIBC_2.2)[SUSv3] 22283 wcsftime(GLIBC_2.2)[SUSv3] 22284 fread(GLIBC_2.0)[SUSv3] read(GLIBC_2.0)[SUSv3] 22285 wcslen(GLIBC_2.0)[SUSv3] 22286 free(GLIBC_2.0)[SUSv3] readdir(GLIBC_2.0)[SUSv3] 22287 wcsncasecmp(GLIBC_2.0)[LSB] 22288 freeaddrinfo[SUSv3] readdir64()[LFS] wcsncat()[SUSv3] 22289 freelocale[LSB] readdir_r[SUSv3] wcsncmp()[SUSv3] 22290 freopen(GLIBC_2.0)[SUSv3] readlink(GLIBC_2.0)[SUSv3] 22291 wcsncpy(GLIBC_2.0)[SUSv3] 22292 freopen64(GLIBC_2.1)[LFS] readv(GLIBC_2.1)[SUSv3] 22293 wcsnlen(GLIBC_2.1)[LSB] 22294 fscanf(GLIBC_2.0)[LSB] realloc(GLIBC_2.0)[SUSv3] 22295 wcsnrtombs(GLIBC_2.0)[LSB] 22296 fseek(GLIBC_2.0)[SUSv3] realpath(GLIBC_2.0)[SUSv3] 22297 wcspbrk(GLIBC_2.0)[SUSv3] 22298 fseeko(GLIBC_2.1)[SUSv3] recv(GLIBC_2.1)[SUSv3] 22299 wcsrchr(GLIBC_2.1)[SUSv3] 22300 fseeko64(GLIBC_2.1)[LFS] recvfrom(GLIBC_2.1)[SUSv3] 22301 wcsrtombs(GLIBC_2.1)[SUSv3] 22302 fsetpos(GLIBC_2.0)[SUSv3] recvmsg(GLIBC_2.0)[SUSv3] 22303 wcsspn(GLIBC_2.0)[SUSv3] 22304 fsetpos64(GLIBC_2.1)[LFS] regcomp(GLIBC_2.1)[SUSv3] 22305 wcsstr(GLIBC_2.1)[SUSv3] 22306 fstatvfs(GLIBC_2.1)[SUSv3] regerror(GLIBC_2.1)[SUSv3] 22307 wcstod(GLIBC_2.1)[SUSv3] 22308 fstatvfs64(GLIBC_2.1)[LFS] regexec(GLIBC_2.1)[LSB] 22309 wcstof(GLIBC_2.1)[SUSv3] 22310 fsync(GLIBC_2.0)[SUSv3] regfree(GLIBC_2.0)[SUSv3] 22311 wcstoimax(GLIBC_2.0)[SUSv3] 22312 ftell(GLIBC_2.0)[SUSv3] remove(GLIBC_2.0)[SUSv3] 22313 wcstok(GLIBC_2.0)[SUSv3] 22314 ftello(GLIBC_2.1)[SUSv3] remque(GLIBC_2.1)[SUSv3] 22315 wcstol(GLIBC_2.1)[SUSv3] 22316 ftello64(GLIBC_2.1)[LFS] rename(GLIBC_2.1)[SUSv3] 22317 wcstold(GLIBC_2.1)[SUSv3] 22318 ftime(GLIBC_2.0)[SUSv3] rewind(GLIBC_2.0)[SUSv3] 22319 wcstoll(GLIBC_2.0)[SUSv3] 22320 ftok(GLIBC_2.0)[SUSv3] rewinddir(GLIBC_2.0)[SUSv3] 22321 wcstombs(GLIBC_2.0)[SUSv3] 22322 ftruncate(GLIBC_2.0)[SUSv3] rindex(GLIBC_2.0)[SUSv3] 22323 wcstoq(GLIBC_2.0)[LSB] 22324 ftruncate64(GLIBC_2.1)[LFS] rmdir(GLIBC_2.1)[SUSv3] 22325 wcstoul(GLIBC_2.1)[SUSv3] 22326 ftrylockfile(GLIBC_2.0)[SUSv3] sbrk(GLIBC_2.0)[SUSv2] 22327 wcstoull(GLIBC_2.0)[SUSv3] 22328 ftw(GLIBC_2.0)[SUSv3] scanf(GLIBC_2.0)[LSB] 22329 wcstoumax(GLIBC_2.0)[SUSv3] 22330 ftw64(GLIBC_2.1)[LFS] sched_get_priority_max(GLIBC_2.1)[SUSv3] 22331 wcstouq(GLIBC_2.1)[LSB] 22332 funlockfile(GLIBC_2.0)[SUSv3] 22333 sched_get_priority_min(GLIBC_2.0)[SUSv3] 22334 wcswcs(GLIBC_2.0)[SUSv3] 22335 fwide(GLIBC_2.2)[SUSv3] sched_getparam(GLIBC_2.2)[SUSv3] 22336 wcswidth(GLIBC_2.2)[SUSv3] 22337 fwprintf(GLIBC_2.2)[SUSv3] 22338 sched_getscheduler(GLIBC_2.2)[SUSv3] wcsxfrm(GLIBC_2.2)[SUSv3] 22339 fwrite(GLIBC_2.0)[SUSv3] 22340 sched_rr_get_interval(GLIBC_2.0)[SUSv3] 22341 wctob(GLIBC_2.0)[SUSv3] 22342 fwscanf(GLIBC_2.2)[LSB] sched_setparam(GLIBC_2.2)[SUSv3] 22343 wctomb(GLIBC_2.2)[SUSv3] 22344 gai_strerror[SUSv3] sched_setscheduler()[SUSv3] 22345 wctrans()[SUSv3] 22346 gcvt(GLIBC_2.0)[SUSv3] sched_yield(GLIBC_2.0)[SUSv3] 22347 wctype(GLIBC_2.0)[SUSv3] 22348 getaddrinfo[SUSv3] seed48()[SUSv3] wcwidth()[SUSv3] 22349 getc(GLIBC_2.0)[SUSv3] seekdir(GLIBC_2.0)[SUSv3] 22350 wmemchr(GLIBC_2.0)[SUSv3] 22351 getc_unlocked(GLIBC_2.0)[SUSv3] select(GLIBC_2.0)[SUSv3] 22352 wmemcmp(GLIBC_2.0)[SUSv3] 22353 getchar(GLIBC_2.0)[SUSv3] semctl(GLIBC_2.0)[SUSv3] 22354 wmemcpy(GLIBC_2.0)[SUSv3] 22355 getchar_unlocked(GLIBC_2.0)[SUSv3] semget(GLIBC_2.0)[SUSv3] 22356 wmemmove(GLIBC_2.0)[SUSv3] 22357 getcontext(GLIBC_2.1)[SUSv3] semop(GLIBC_2.1)[SUSv3] 22358 wmemset(GLIBC_2.1)[SUSv3] 22359 getcwd(GLIBC_2.0)[SUSv3] send(GLIBC_2.0)[SUSv3] 22360 wordexp(GLIBC_2.0)[SUSv3] 22361 getdate(GLIBC_2.1)[SUSv3] sendmsg(GLIBC_2.1)[SUSv3] 22362 wordfree(GLIBC_2.1)[SUSv3] 22363 getegid(GLIBC_2.0)[SUSv3] sendto(GLIBC_2.0)[SUSv3] 22364 wprintf(GLIBC_2.0)[SUSv3] 22365 getenv(GLIBC_2.0)[SUSv3] setbuf(GLIBC_2.0)[SUSv3] 22366 write(GLIBC_2.0)[SUSv3] 22367 geteuid(GLIBC_2.0)[SUSv3] setbuffer(GLIBC_2.0)[LSB] 22368 writev(GLIBC_2.0)[SUSv3] 22369 getgid(GLIBC_2.0)[SUSv3] setcontext(GLIBC_2.0)[SUSv3] 22370 wscanf(GLIBC_2.0)[LSB] 22371 getgrent(GLIBC_2.0)[SUSv3] setegid(GLIBC_2.0)[SUSv3] 22372 xdr_accepted_reply(GLIBC_2.0)[SVID.3] 22373 getgrgid(GLIBC_2.0)[SUSv3] setenv[SUSv3] 22374 xdr_array(GLIBC_2.0)[SVID.3] 22375 getgrgid_r(GLIBC_2.0)[SUSv3] seteuid(GLIBC_2.0)[SUSv3] 22376 xdr_bool(GLIBC_2.0)[SVID.3] 22377 getgrnam(GLIBC_2.0)[SUSv3] setgid(GLIBC_2.0)[SUSv3] 22378 xdr_bytes(GLIBC_2.0)[SVID.3] 22379 getgrnam_r(GLIBC_2.0)[SUSv3] setgrent(GLIBC_2.0)[SUSv3] 22380 xdr_callhdr(GLIBC_2.0)[SVID.3] 22381 getgrouplist[LSB] setgroups()[LSB] xdr_callmsg()[SVID.3] 22382 getgroups(GLIBC_2.0)[SUSv3] sethostname(GLIBC_2.0)[LSB] 22383 xdr_char(GLIBC_2.0)[SVID.3] 22384 gethostbyaddr(GLIBC_2.0)[SUSv3] setitimer(GLIBC_2.0)[SUSv3] 22385 xdr_double(GLIBC_2.0)[SVID.3] 22386 gethostbyname(GLIBC_2.0)[SUSv3] setlocale(GLIBC_2.0)[SUSv3] 22387 xdr_enum(GLIBC_2.0)[SVID.3] 22388 gethostid(GLIBC_2.0)[SUSv3] setlogmask(GLIBC_2.0)[SUSv3] 22389 xdr_float(GLIBC_2.0)[SVID.3] 22390 gethostname(GLIBC_2.0)[SUSv3] setpgid(GLIBC_2.0)[SUSv3] 22391 xdr_free(GLIBC_2.0)[SVID.3] 22392 getitimer(GLIBC_2.0)[SUSv3] setpgrp(GLIBC_2.0)[SUSv3] 22393 xdr_int(GLIBC_2.0)[SVID.3] 22394 getloadavg(GLIBC_2.2)[LSB] setpriority(GLIBC_2.2)[SUSv3] 22395 xdr_long(GLIBC_2.2)[SVID.3] 22396 getlogin(GLIBC_2.0)[SUSv3] setprotoent(GLIBC_2.0)[SUSv3] 22397 xdr_opaque(GLIBC_2.0)[SVID.3] 22398 getlogin_r[SUSv3] setpwent()[SUSv3] xdr_opaque_auth()[SVID.3] 22399 getnameinfo[SUSv3] setregid()[SUSv3] xdr_pointer()[SVID.3] 22400 getopt(GLIBC_2.0)[LSB] setreuid(GLIBC_2.0)[SUSv3] 22401 xdr_reference(GLIBC_2.0)[SVID.3] 22402 getopt_long(GLIBC_2.0)[LSB] setrlimit(GLIBC_2.0)[SUSv3] 22403 xdr_rejected_reply(GLIBC_2.0)[SVID.3] 22404 getopt_long_only(GLIBC_2.0)[LSB] setrlimit64[LFS] 22405 xdr_replymsg(GLIBC_2.0)[SVID.3] 22406 getpagesize(GLIBC_2.0)[SUSv2] setservent(GLIBC_2.0)[SUSv3] 22407 xdr_short(GLIBC_2.0)[SVID.3] 22408 getpeername(GLIBC_2.0)[SUSv3] setsid(GLIBC_2.0)[SUSv3] 22409 xdr_string(GLIBC_2.0)[SVID.3] 22410 getpgid(GLIBC_2.0)[SUSv3] setsockopt(GLIBC_2.0)[LSB] 22411 xdr_u_char(GLIBC_2.0)[SVID.3] 22412 getpgrp(GLIBC_2.0)[SUSv3] setstate(GLIBC_2.0)[SUSv3] 22413 xdr_u_int(GLIBC_2.0)[LSB] 22414 getpid(GLIBC_2.0)[SUSv3] setuid(GLIBC_2.0)[SUSv3] 22415 xdr_u_long(GLIBC_2.0)[SVID.3] 22416 getppid(GLIBC_2.0)[SUSv3] setutent(GLIBC_2.0)[LSB] 22417 xdr_u_short(GLIBC_2.0)[SVID.3] 22418 getpriority(GLIBC_2.0)[SUSv3] setutxent(GLIBC_2.0)[SUSv3] 22419 xdr_union(GLIBC_2.0)[SVID.3] 22420 getprotobyname(GLIBC_2.0)[SUSv3] setvbuf(GLIBC_2.0)[SUSv3] 22421 xdr_vector(GLIBC_2.0)[SVID.3] 22422 getprotobynumber(GLIBC_2.0)[SUSv3] shmat(GLIBC_2.0)[SUSv3] 22423 xdr_void(GLIBC_2.0)[SVID.3] 22424 getprotoent(GLIBC_2.0)[SUSv3] shmctl(GLIBC_2.0)[SUSv3] 22425 xdr_wrapstring(GLIBC_2.0)[SVID.3] 22426 getpwent(GLIBC_2.0)[SUSv3] shmdt(GLIBC_2.0)[SUSv3] 22427 xdrmem_create(GLIBC_2.0)[SVID.3] 22428 getpwnam(GLIBC_2.0)[SUSv3] shmget(GLIBC_2.0)[SUSv3] 22429 xdrrec_create(GLIBC_2.0)[SVID.3] 22430 getpwnam_r(GLIBC_2.0)[SUSv3] shutdown(GLIBC_2.0)[SUSv3] 22431 xdrrec_eof(GLIBC_2.0)[SVID.3] 22432 getpwuid(GLIBC_2.0)[SUSv3] sigaction(GLIBC_2.0)[SUSv3] 22433 22434 Table A-2. libc Data Interfaces 22435 __daylight __timezone _sys_errlist 22436 __environ __tzname 22437 _________________________________________________________ 22438 22439 A.2. libcrypt 22440 22441 The behavior of the interfaces in this library is specified by 22442 the following Standards. 22443 22444 ISO POSIX (2003) [SUSv3] 22445 22446 Table A-3. libcrypt Function Interfaces 22447 crypt(GLIBC_2.0)[SUSv3] encrypt(GLIBC_2.0)[SUSv3] 22448 setkey(GLIBC_2.0)[SUSv3] 22449 _________________________________________________________ 22450 22451 A.3. libdl 22452 22453 The behavior of the interfaces in this library is specified by 22454 the following Standards. 22455 22456 This Specification [LSB] 22457 ISO POSIX (2003) [SUSv3] 22458 22459 Table A-4. libdl Function Interfaces 22460 dladdr(GLIBC_2.0)[LSB] dlerror(GLIBC_2.0)[SUSv3] 22461 dlsym(GLIBC_2.0)[LSB] 22462 dlclose(GLIBC_2.0)[SUSv3] dlopen(GLIBC_2.0)[LSB] 22463 _________________________________________________________ 22464 22465 A.4. libm 22466 22467 The behavior of the interfaces in this library is specified by 22468 the following Standards. 22469 22470 ISO C (1999) [ISOC99] 22471 This Specification [LSB] 22472 SUSv2 [SUSv2] 22473 ISO POSIX (2003) [SUSv3] 22474 22475 Table A-5. libm Function Interfaces 22476 __finite[ISOC99] csinhf()[SUSv3] log10()[SUSv3] 22477 __finitef[ISOC99] csinhl()[SUSv3] log10f[SUSv3] 22478 __finitel[ISOC99] csinl()[SUSv3] log10l[SUSv3] 22479 __fpclassify[LSB] csqrt()[SUSv3] log1p()[SUSv3] 22480 __fpclassifyf[LSB] csqrtf()[SUSv3] log1pf[SUSv3] 22481 __signbit[ISOC99] csqrtl()[SUSv3] log1pl[SUSv3] 22482 __signbitf[ISOC99] ctan()[SUSv3] log2[SUSv3] 22483 acos(GLIBC_2.0)[SUSv3] ctanf(GLIBC_2.0)[SUSv3] log2f[SUSv3] 22484 acosf(GLIBC_2.0)[SUSv3] ctanh(GLIBC_2.0)[SUSv3] log2l[SUSv3] 22485 acosh(GLIBC_2.0)[SUSv3] ctanhf(GLIBC_2.0)[SUSv3] 22486 logb(GLIBC_2.0)[SUSv3] 22487 acoshf(GLIBC_2.0)[SUSv3] ctanhl(GLIBC_2.0)[SUSv3] logbf[SUSv3] 22488 acoshl(GLIBC_2.0)[SUSv3] ctanl(GLIBC_2.0)[SUSv3] logbl[SUSv3] 22489 acosl(GLIBC_2.0)[SUSv3] dremf(GLIBC_2.0)[ISOC99] logf[SUSv3] 22490 asin(GLIBC_2.0)[SUSv3] dreml(GLIBC_2.0)[ISOC99] logl[SUSv3] 22491 asinf(GLIBC_2.0)[SUSv3] erf(GLIBC_2.0)[SUSv3] 22492 lrint(GLIBC_2.0)[SUSv3] 22493 asinh(GLIBC_2.0)[SUSv3] erfc(GLIBC_2.0)[SUSv3] 22494 lrintf(GLIBC_2.0)[SUSv3] 22495 asinhf(GLIBC_2.0)[SUSv3] erfcf(GLIBC_2.0)[SUSv3] 22496 lrintl(GLIBC_2.0)[SUSv3] 22497 asinhl(GLIBC_2.0)[SUSv3] erfcl(GLIBC_2.0)[SUSv3] 22498 lround(GLIBC_2.0)[SUSv3] 22499 asinl(GLIBC_2.0)[SUSv3] erff(GLIBC_2.0)[SUSv3] 22500 lroundf(GLIBC_2.0)[SUSv3] 22501 atan(GLIBC_2.0)[SUSv3] erfl(GLIBC_2.0)[SUSv3] 22502 lroundl(GLIBC_2.0)[SUSv3] 22503 atan2(GLIBC_2.0)[SUSv3] exp(GLIBC_2.0)[SUSv3] 22504 matherr(GLIBC_2.0)[ISOC99] 22505 atan2f(GLIBC_2.0)[SUSv3] exp2[SUSv3] modf(GLIBC_2.0)[SUSv3] 22506 atan2l(GLIBC_2.0)[SUSv3] exp2f[SUSv3] modff(GLIBC_2.0)[SUSv3] 22507 atanf(GLIBC_2.0)[SUSv3] expf[SUSv3] modfl(GLIBC_2.0)[SUSv3] 22508 atanh(GLIBC_2.0)[SUSv3] expl[SUSv3] nan(GLIBC_2.0)[SUSv3] 22509 atanhf(GLIBC_2.0)[SUSv3] expm1(GLIBC_2.0)[SUSv3] 22510 nanf(GLIBC_2.0)[SUSv3] 22511 atanhl(GLIBC_2.0)[SUSv3] expm1f[SUSv3] nanl(GLIBC_2.0)[SUSv3] 22512 atanl(GLIBC_2.0)[SUSv3] expm1l[SUSv3] 22513 nearbyint(GLIBC_2.0)[SUSv3] 22514 cabs(GLIBC_2.1)[SUSv3] fabs(GLIBC_2.1)[SUSv3] 22515 nearbyintf(GLIBC_2.1)[SUSv3] 22516 cabsf(GLIBC_2.1)[SUSv3] fabsf(GLIBC_2.1)[SUSv3] 22517 nearbyintl(GLIBC_2.1)[SUSv3] 22518 cabsl(GLIBC_2.1)[SUSv3] fabsl(GLIBC_2.1)[SUSv3] 22519 nextafter(GLIBC_2.1)[SUSv3] 22520 cacos(GLIBC_2.1)[SUSv3] fdim(GLIBC_2.1)[SUSv3] 22521 nextafterf(GLIBC_2.1)[SUSv3] 22522 cacosf(GLIBC_2.1)[SUSv3] fdimf(GLIBC_2.1)[SUSv3] 22523 nextafterl(GLIBC_2.1)[SUSv3] 22524 cacosh(GLIBC_2.1)[SUSv3] fdiml(GLIBC_2.1)[SUSv3] 22525 nexttoward(GLIBC_2.1)[SUSv3] 22526 cacoshf(GLIBC_2.1)[SUSv3] feclearexcept(GLIBC_2.1)[SUSv3] 22527 nexttowardf(GLIBC_2.1)[SUSv3] 22528 cacoshl(GLIBC_2.1)[SUSv3] fegetenv(GLIBC_2.1)[SUSv3] 22529 nexttowardl(GLIBC_2.1)[SUSv3] 22530 cacosl(GLIBC_2.1)[SUSv3] fegetexceptflag(GLIBC_2.1)[SUSv3] 22531 pow(GLIBC_2.1)[SUSv3] 22532 carg(GLIBC_2.1)[SUSv3] fegetround(GLIBC_2.1)[SUSv3] 22533 pow10(GLIBC_2.1)[ISOC99] 22534 cargf(GLIBC_2.1)[SUSv3] feholdexcept(GLIBC_2.1)[SUSv3] 22535 pow10f(GLIBC_2.1)[ISOC99] 22536 cargl(GLIBC_2.1)[SUSv3] feraiseexcept(GLIBC_2.1)[SUSv3] 22537 pow10l(GLIBC_2.1)[ISOC99] 22538 casin(GLIBC_2.1)[SUSv3] fesetenv(GLIBC_2.1)[SUSv3] 22539 powf(GLIBC_2.1)[SUSv3] 22540 casinf(GLIBC_2.1)[SUSv3] fesetexceptflag(GLIBC_2.1)[SUSv3] 22541 powl(GLIBC_2.1)[SUSv3] 22542 casinh(GLIBC_2.1)[SUSv3] fesetround(GLIBC_2.1)[SUSv3] 22543 remainder(GLIBC_2.1)[SUSv3] 22544 casinhf(GLIBC_2.1)[SUSv3] fetestexcept(GLIBC_2.1)[SUSv3] 22545 remainderf(GLIBC_2.1)[SUSv3] 22546 casinhl(GLIBC_2.1)[SUSv3] feupdateenv(GLIBC_2.1)[SUSv3] 22547 remainderl(GLIBC_2.1)[SUSv3] 22548 casinl(GLIBC_2.1)[SUSv3] finite(GLIBC_2.1)[SUSv2] 22549 remquo(GLIBC_2.1)[SUSv3] 22550 catan(GLIBC_2.1)[SUSv3] finitef(GLIBC_2.1)[ISOC99] 22551 remquof(GLIBC_2.1)[SUSv3] 22552 catanf(GLIBC_2.1)[SUSv3] finitel(GLIBC_2.1)[ISOC99] 22553 remquol(GLIBC_2.1)[SUSv3] 22554 catanh(GLIBC_2.1)[SUSv3] floor(GLIBC_2.1)[SUSv3] 22555 rint(GLIBC_2.1)[SUSv3] 22556 catanhf(GLIBC_2.1)[SUSv3] floorf(GLIBC_2.1)[SUSv3] 22557 rintf(GLIBC_2.1)[SUSv3] 22558 catanhl(GLIBC_2.1)[SUSv3] floorl(GLIBC_2.1)[SUSv3] 22559 rintl(GLIBC_2.1)[SUSv3] 22560 catanl(GLIBC_2.1)[SUSv3] fma(GLIBC_2.1)[SUSv3] 22561 round(GLIBC_2.1)[SUSv3] 22562 cbrt(GLIBC_2.0)[SUSv3] fmaf(GLIBC_2.0)[SUSv3] 22563 roundf(GLIBC_2.0)[SUSv3] 22564 cbrtf(GLIBC_2.0)[SUSv3] fmal(GLIBC_2.0)[SUSv3] 22565 roundl(GLIBC_2.0)[SUSv3] 22566 cbrtl(GLIBC_2.0)[SUSv3] fmax(GLIBC_2.0)[SUSv3] 22567 scalb(GLIBC_2.0)[SUSv3] 22568 ccos(GLIBC_2.1)[SUSv3] fmaxf(GLIBC_2.1)[SUSv3] 22569 scalbf(GLIBC_2.1)[ISOC99] 22570 ccosf(GLIBC_2.1)[SUSv3] fmaxl(GLIBC_2.1)[SUSv3] 22571 scalbl(GLIBC_2.1)[ISOC99] 22572 ccosh(GLIBC_2.1)[SUSv3] fmin(GLIBC_2.1)[SUSv3] 22573 scalbln(GLIBC_2.1)[SUSv3] 22574 ccoshf(GLIBC_2.1)[SUSv3] fminf(GLIBC_2.1)[SUSv3] 22575 scalblnf(GLIBC_2.1)[SUSv3] 22576 ccoshl(GLIBC_2.1)[SUSv3] fminl(GLIBC_2.1)[SUSv3] 22577 scalblnl(GLIBC_2.1)[SUSv3] 22578 ccosl(GLIBC_2.1)[SUSv3] fmod(GLIBC_2.1)[SUSv3] 22579 scalbn(GLIBC_2.1)[SUSv3] 22580 ceil(GLIBC_2.0)[SUSv3] fmodf(GLIBC_2.0)[SUSv3] 22581 scalbnf(GLIBC_2.0)[SUSv3] 22582 ceilf(GLIBC_2.0)[SUSv3] fmodl(GLIBC_2.0)[SUSv3] 22583 scalbnl(GLIBC_2.0)[SUSv3] 22584 ceill(GLIBC_2.0)[SUSv3] frexp(GLIBC_2.0)[SUSv3] 22585 significand(GLIBC_2.0)[ISOC99] 22586 cexp(GLIBC_2.1)[SUSv3] frexpf(GLIBC_2.1)[SUSv3] 22587 significandf(GLIBC_2.1)[ISOC99] 22588 cexpf(GLIBC_2.1)[SUSv3] frexpl(GLIBC_2.1)[SUSv3] 22589 significandl(GLIBC_2.1)[ISOC99] 22590 cexpl(GLIBC_2.1)[SUSv3] gamma(GLIBC_2.1)[SUSv2] 22591 sin(GLIBC_2.1)[SUSv3] 22592 cimag(GLIBC_2.1)[SUSv3] gammaf(GLIBC_2.1)[ISOC99] 22593 sincos(GLIBC_2.1)[ISOC99] 22594 cimagf(GLIBC_2.1)[SUSv3] gammal(GLIBC_2.1)[ISOC99] 22595 sincosf(GLIBC_2.1)[ISOC99] 22596 cimagl(GLIBC_2.1)[SUSv3] hypot(GLIBC_2.1)[SUSv3] 22597 sincosl(GLIBC_2.1)[ISOC99] 22598 clog(GLIBC_2.1)[SUSv3] hypotf(GLIBC_2.1)[SUSv3] 22599 sinf(GLIBC_2.1)[SUSv3] 22600 clog10(GLIBC_2.1)[ISOC99] hypotl(GLIBC_2.1)[SUSv3] 22601 sinh(GLIBC_2.1)[SUSv3] 22602 clog10f(GLIBC_2.1)[ISOC99] ilogb(GLIBC_2.1)[SUSv3] 22603 sinhf(GLIBC_2.1)[SUSv3] 22604 clog10l(GLIBC_2.1)[ISOC99] ilogbf(GLIBC_2.1)[SUSv3] 22605 sinhl(GLIBC_2.1)[SUSv3] 22606 clogf(GLIBC_2.1)[SUSv3] ilogbl(GLIBC_2.1)[SUSv3] 22607 sinl(GLIBC_2.1)[SUSv3] 22608 clogl(GLIBC_2.1)[SUSv3] j0(GLIBC_2.1)[SUSv3] 22609 sqrt(GLIBC_2.1)[SUSv3] 22610 conj(GLIBC_2.1)[SUSv3] j0f(GLIBC_2.1)[ISOC99] 22611 sqrtf(GLIBC_2.1)[SUSv3] 22612 conjf(GLIBC_2.1)[SUSv3] j0l(GLIBC_2.1)[ISOC99] 22613 sqrtl(GLIBC_2.1)[SUSv3] 22614 conjl(GLIBC_2.1)[SUSv3] j1(GLIBC_2.1)[SUSv3] 22615 tan(GLIBC_2.1)[SUSv3] 22616 copysign(GLIBC_2.0)[SUSv3] j1f(GLIBC_2.0)[ISOC99] 22617 tanf(GLIBC_2.0)[SUSv3] 22618 copysignf(GLIBC_2.0)[SUSv3] j1l(GLIBC_2.0)[ISOC99] 22619 tanh(GLIBC_2.0)[SUSv3] 22620 copysignl(GLIBC_2.0)[SUSv3] jn(GLIBC_2.0)[SUSv3] 22621 tanhf(GLIBC_2.0)[SUSv3] 22622 cos(GLIBC_2.0)[SUSv3] jnf(GLIBC_2.0)[ISOC99] 22623 tanhl(GLIBC_2.0)[SUSv3] 22624 cosf(GLIBC_2.0)[SUSv3] jnl(GLIBC_2.0)[ISOC99] 22625 tanl(GLIBC_2.0)[SUSv3] 22626 cosh(GLIBC_2.0)[SUSv3] ldexp(GLIBC_2.0)[SUSv3] 22627 tgamma(GLIBC_2.0)[SUSv3] 22628 coshf(GLIBC_2.0)[SUSv3] ldexpf(GLIBC_2.0)[SUSv3] 22629 tgammaf(GLIBC_2.0)[SUSv3] 22630 coshl(GLIBC_2.0)[SUSv3] ldexpl(GLIBC_2.0)[SUSv3] 22631 tgammal(GLIBC_2.0)[SUSv3] 22632 cosl(GLIBC_2.0)[SUSv3] lgamma(GLIBC_2.0)[SUSv3] 22633 trunc(GLIBC_2.0)[SUSv3] 22634 cpow(GLIBC_2.1)[SUSv3] lgamma_r(GLIBC_2.1)[ISOC99] 22635 truncf(GLIBC_2.1)[SUSv3] 22636 cpowf(GLIBC_2.1)[SUSv3] lgammaf(GLIBC_2.1)[SUSv3] 22637 truncl(GLIBC_2.1)[SUSv3] 22638 cpowl(GLIBC_2.1)[SUSv3] lgammaf_r(GLIBC_2.1)[ISOC99] 22639 y0(GLIBC_2.1)[SUSv3] 22640 cproj(GLIBC_2.1)[SUSv3] lgammal(GLIBC_2.1)[SUSv3] 22641 y0f(GLIBC_2.1)[ISOC99] 22642 cprojf(GLIBC_2.1)[SUSv3] lgammal_r(GLIBC_2.1)[ISOC99] 22643 y0l(GLIBC_2.1)[ISOC99] 22644 cprojl(GLIBC_2.1)[SUSv3] llrint(GLIBC_2.1)[SUSv3] 22645 y1(GLIBC_2.1)[SUSv3] 22646 creal(GLIBC_2.1)[SUSv3] llrintf(GLIBC_2.1)[SUSv3] 22647 y1f(GLIBC_2.1)[ISOC99] 22648 crealf(GLIBC_2.1)[SUSv3] llrintl(GLIBC_2.1)[SUSv3] 22649 y1l(GLIBC_2.1)[ISOC99] 22650 creall(GLIBC_2.1)[SUSv3] llround(GLIBC_2.1)[SUSv3] 22651 yn(GLIBC_2.1)[SUSv3] 22652 csin(GLIBC_2.1)[SUSv3] llroundf(GLIBC_2.1)[SUSv3] 22653 ynf(GLIBC_2.1)[ISOC99] 22654 csinf(GLIBC_2.1)[SUSv3] llroundl(GLIBC_2.1)[SUSv3] 22655 ynl(GLIBC_2.1)[ISOC99] 22656 csinh(GLIBC_2.1)[SUSv3] log(GLIBC_2.1)[SUSv3] 22657 22658 Table A-6. libm Data Interfaces 22659 signgam 22660 _________________________________________________________ 22661 22662 A.5. libncurses 22663 22664 The behavior of the interfaces in this library is specified by 22665 the following Standards. 22666 22667 X/Open Curses [SUS-CURSES] 22668 22669 Table A-7. libncurses Function Interfaces 22670 addch[SUS-CURSES] mvdelch[SUS-CURSES] slk_refresh[SUS-CURSES] 22671 addchnstr[SUS-CURSES] mvderwin[SUS-CURSES] 22672 slk_restore[SUS-CURSES] 22673 addchstr[SUS-CURSES] mvgetch[SUS-CURSES] slk_set[SUS-CURSES] 22674 addnstr[SUS-CURSES] mvgetnstr[SUS-CURSES] 22675 slk_touch[SUS-CURSES] 22676 addstr[SUS-CURSES] mvgetstr[SUS-CURSES] standend[SUS-CURSES] 22677 attr_get[SUS-CURSES] mvhline[SUS-CURSES] standout[SUS-CURSES] 22678 attr_off[SUS-CURSES] mvinch[SUS-CURSES] 22679 start_color[SUS-CURSES] 22680 attr_on[SUS-CURSES] mvinchnstr[SUS-CURSES] subpad[SUS-CURSES] 22681 attr_set[SUS-CURSES] mvinchstr[SUS-CURSES] subwin[SUS-CURSES] 22682 attroff[SUS-CURSES] mvinnstr[SUS-CURSES] syncok[SUS-CURSES] 22683 attron[SUS-CURSES] mvinsch[SUS-CURSES] termattrs[SUS-CURSES] 22684 attrset[SUS-CURSES] mvinsnstr[SUS-CURSES] termname[SUS-CURSES] 22685 baudrate[SUS-CURSES] mvinsstr[SUS-CURSES] tgetent[SUS-CURSES] 22686 beep[SUS-CURSES] mvinstr[SUS-CURSES] tgetflag[SUS-CURSES] 22687 bkgd[SUS-CURSES] mvprintw[SUS-CURSES] tgetnum[SUS-CURSES] 22688 bkgdset[SUS-CURSES] mvscanw[SUS-CURSES] tgetstr[SUS-CURSES] 22689 border[SUS-CURSES] mvvline[SUS-CURSES] tgoto[SUS-CURSES] 22690 box[SUS-CURSES] mvwaddch[SUS-CURSES] tigetflag[SUS-CURSES] 22691 can_change_color[SUS-CURSES] mvwaddchnstr[SUS-CURSES] 22692 tigetnum[SUS-CURSES] 22693 cbreak[SUS-CURSES] mvwaddchstr[SUS-CURSES] 22694 tigetstr[SUS-CURSES] 22695 chgat[SUS-CURSES] mvwaddnstr[SUS-CURSES] timeout[SUS-CURSES] 22696 clear[SUS-CURSES] mvwaddstr[SUS-CURSES] touchline[SUS-CURSES] 22697 clearok[SUS-CURSES] mvwchgat[SUS-CURSES] touchwin[SUS-CURSES] 22698 clrtobot[SUS-CURSES] mvwdelch[SUS-CURSES] tparm[SUS-CURSES] 22699 clrtoeol[SUS-CURSES] mvwgetch[SUS-CURSES] tputs[SUS-CURSES] 22700 color_content[SUS-CURSES] mvwgetnstr[SUS-CURSES] 22701 typeahead[SUS-CURSES] 22702 color_set[SUS-CURSES] mvwgetstr[SUS-CURSES] unctrl[SUS-CURSES] 22703 copywin[SUS-CURSES] mvwhline[SUS-CURSES] ungetch[SUS-CURSES] 22704 curs_set[SUS-CURSES] mvwin[SUS-CURSES] untouchwin[SUS-CURSES] 22705 def_prog_mode[SUS-CURSES] mvwinch[SUS-CURSES] 22706 use_env[SUS-CURSES] 22707 def_shell_mode[SUS-CURSES] mvwinchnstr[SUS-CURSES] 22708 vidattr[SUS-CURSES] 22709 del_curterm[SUS-CURSES] mvwinchstr[SUS-CURSES] 22710 vidputs[SUS-CURSES] 22711 delay_output[SUS-CURSES] mvwinnstr[SUS-CURSES] 22712 vline[SUS-CURSES] 22713 delch[SUS-CURSES] mvwinsch[SUS-CURSES] vw_printw[SUS-CURSES] 22714 deleteln[SUS-CURSES] mvwinsnstr[SUS-CURSES] 22715 vw_scanw[SUS-CURSES] 22716 delscreen[SUS-CURSES] mvwinsstr[SUS-CURSES] 22717 vwprintw[SUS-CURSES] 22718 delwin[SUS-CURSES] mvwinstr[SUS-CURSES] vwscanw[SUS-CURSES] 22719 derwin[SUS-CURSES] mvwprintw[SUS-CURSES] waddch[SUS-CURSES] 22720 doupdate[SUS-CURSES] mvwscanw[SUS-CURSES] 22721 waddchnstr[SUS-CURSES] 22722 dupwin[SUS-CURSES] mvwvline[SUS-CURSES] waddchstr[SUS-CURSES] 22723 echo[SUS-CURSES] napms[SUS-CURSES] waddnstr[SUS-CURSES] 22724 echochar[SUS-CURSES] newpad[SUS-CURSES] waddstr[SUS-CURSES] 22725 endwin[SUS-CURSES] newterm[SUS-CURSES] wattr_get[SUS-CURSES] 22726 erase[SUS-CURSES] newwin[SUS-CURSES] wattr_off[SUS-CURSES] 22727 erasechar[SUS-CURSES] nl[SUS-CURSES] wattr_on[SUS-CURSES] 22728 filter[SUS-CURSES] nocbreak[SUS-CURSES] wattr_set[SUS-CURSES] 22729 flash[SUS-CURSES] nodelay[SUS-CURSES] wattroff[SUS-CURSES] 22730 flushinp[SUS-CURSES] noecho[SUS-CURSES] wattron[SUS-CURSES] 22731 getbkgd[SUS-CURSES] nonl[SUS-CURSES] wattrset[SUS-CURSES] 22732 getch[SUS-CURSES] noqiflush[SUS-CURSES] wbkgd[SUS-CURSES] 22733 getnstr[SUS-CURSES] noraw[SUS-CURSES] wbkgdset[SUS-CURSES] 22734 getstr[SUS-CURSES] notimeout[SUS-CURSES] wborder[SUS-CURSES] 22735 getwin[SUS-CURSES] overlay[SUS-CURSES] wchgat[SUS-CURSES] 22736 halfdelay[SUS-CURSES] overwrite[SUS-CURSES] wclear[SUS-CURSES] 22737 has_colors[SUS-CURSES] pair_content[SUS-CURSES] 22738 wclrtobot[SUS-CURSES] 22739 has_ic[SUS-CURSES] pechochar[SUS-CURSES] wclrtoeol[SUS-CURSES] 22740 has_il[SUS-CURSES] pnoutrefresh[SUS-CURSES] 22741 wcolor_set[SUS-CURSES] 22742 hline[SUS-CURSES] prefresh[SUS-CURSES] wcursyncup[SUS-CURSES] 22743 idcok[SUS-CURSES] printw[SUS-CURSES] wdelch[SUS-CURSES] 22744 idlok[SUS-CURSES] putp[SUS-CURSES] wdeleteln[SUS-CURSES] 22745 immedok[SUS-CURSES] putwin[SUS-CURSES] wechochar[SUS-CURSES] 22746 inch[SUS-CURSES] qiflush[SUS-CURSES] werase[SUS-CURSES] 22747 inchnstr[SUS-CURSES] raw[SUS-CURSES] wgetch[SUS-CURSES] 22748 inchstr[SUS-CURSES] redrawwin[SUS-CURSES] wgetnstr[SUS-CURSES] 22749 init_color[SUS-CURSES] refresh[SUS-CURSES] wgetstr[SUS-CURSES] 22750 init_pair[SUS-CURSES] reset_prog_mode[SUS-CURSES] 22751 whline[SUS-CURSES] 22752 initscr[SUS-CURSES] reset_shell_mode[SUS-CURSES] 22753 winch[SUS-CURSES] 22754 innstr[SUS-CURSES] resetty[SUS-CURSES] winchnstr[SUS-CURSES] 22755 insch[SUS-CURSES] restartterm[SUS-CURSES] winchstr[SUS-CURSES] 22756 insdelln[SUS-CURSES] ripoffline[SUS-CURSES] 22757 winnstr[SUS-CURSES] 22758 insertln[SUS-CURSES] savetty[SUS-CURSES] winsch[SUS-CURSES] 22759 insnstr[SUS-CURSES] scanw[SUS-CURSES] winsdelln[SUS-CURSES] 22760 insstr[SUS-CURSES] scr_dump[SUS-CURSES] winsertln[SUS-CURSES] 22761 instr[SUS-CURSES] scr_init[SUS-CURSES] winsnstr[SUS-CURSES] 22762 intrflush[SUS-CURSES] scr_restore[SUS-CURSES] 22763 winsstr[SUS-CURSES] 22764 is_linetouched[SUS-CURSES] scr_set[SUS-CURSES] 22765 winstr[SUS-CURSES] 22766 is_wintouched[SUS-CURSES] scrl[SUS-CURSES] wmove[SUS-CURSES] 22767 isendwin[SUS-CURSES] scroll[SUS-CURSES] 22768 wnoutrefresh[SUS-CURSES] 22769 keyname[SUS-CURSES] scrollok[SUS-CURSES] wprintw[SUS-CURSES] 22770 keypad[SUS-CURSES] set_curterm[SUS-CURSES] 22771 wredrawln[SUS-CURSES] 22772 killchar[SUS-CURSES] set_term[SUS-CURSES] wrefresh[SUS-CURSES] 22773 leaveok[SUS-CURSES] setscrreg[SUS-CURSES] wscanw[SUS-CURSES] 22774 longname[SUS-CURSES] setupterm[SUS-CURSES] wscrl[SUS-CURSES] 22775 meta[SUS-CURSES] slk_attr_set[SUS-CURSES] 22776 wsetscrreg[SUS-CURSES] 22777 move[SUS-CURSES] slk_attroff[SUS-CURSES] wstandend[SUS-CURSES] 22778 mvaddch[SUS-CURSES] slk_attron[SUS-CURSES] 22779 wstandout[SUS-CURSES] 22780 mvaddchnstr[SUS-CURSES] slk_attrset[SUS-CURSES] 22781 wsyncdown[SUS-CURSES] 22782 mvaddchstr[SUS-CURSES] slk_clear[SUS-CURSES] 22783 wsyncup[SUS-CURSES] 22784 mvaddnstr[SUS-CURSES] slk_color[SUS-CURSES] 22785 wtimeout[SUS-CURSES] 22786 mvaddstr[SUS-CURSES] slk_init[SUS-CURSES] wtouchln[SUS-CURSES] 22787 mvchgat[SUS-CURSES] slk_label[SUS-CURSES] wvline[SUS-CURSES] 22788 mvcur[SUS-CURSES] slk_noutrefresh[SUS-CURSES] 22789 22790 Table A-8. libncurses Data Interfaces 22791 COLORS LINES curscr 22792 COLOR_PAIRS acs_map stdscr 22793 COLS cur_term 22794 _________________________________________________________ 22795 22796 A.6. libpam 22797 22798 The behavior of the interfaces in this library is specified by 22799 the following Standards. 22800 22801 This Specification [LSB] 22802 22803 Table A-9. libpam Function Interfaces 22804 pam_acct_mgmt[LSB] pam_fail_delay[LSB] pam_setcred[LSB] 22805 pam_authenticate[LSB] pam_get_item[LSB] pam_start[LSB] 22806 pam_chauthtok[LSB] pam_getenvlist[LSB] pam_strerror[LSB] 22807 pam_close_session[LSB] pam_open_session[LSB] 22808 pam_end[LSB] pam_set_item[LSB] 22809 _________________________________________________________ 22810 22811 A.7. libpthread 22812 22813 The behavior of the interfaces in this library is specified by 22814 the following Standards. 22815 22816 Large File Support [LFS] 22817 This Specification [LSB] 22818 ISO POSIX (2003) [SUSv3] 22819 22820 Table A-10. libpthread Function Interfaces 22821 _pthread_cleanup_pop[LSB] pthread_cond_wait()[SUSv3] 22822 pthread_rwlock_timedwrlock[SUSv3] 22823 _pthread_cleanup_push[LSB] pthread_condattr_destroy()[SUSv3] 22824 pthread_rwlock_tryrdlock()[SUSv3] 22825 lseek64(GLIBC_2.1)[LFS] pthread_condattr_getpshared[SUSv3] 22826 pthread_rwlock_trywrlock(GLIBC_2.1)[SUSv3] 22827 open64(GLIBC_2.1)[LFS] pthread_condattr_init(GLIBC_2.1)[SUSv3] 22828 pthread_rwlock_unlock(GLIBC_2.1)[SUSv3] 22829 pread(GLIBC_2.1)[SUSv3] pthread_condattr_setpshared[SUSv3] 22830 pthread_rwlock_wrlock(GLIBC_2.1)[SUSv3] 22831 pread64(GLIBC_2.1)[LFS] pthread_create(GLIBC_2.1)[SUSv3] 22832 pthread_rwlockattr_destroy(GLIBC_2.1)[SUSv3] 22833 pthread_attr_destroy(GLIBC_2.0)[SUSv3] 22834 pthread_detach(GLIBC_2.0)[SUSv3] 22835 pthread_rwlockattr_getpshared(GLIBC_2.0)[SUSv3] 22836 pthread_attr_getdetachstate(GLIBC_2.0)[SUSv3] 22837 pthread_equal(GLIBC_2.0)[SUSv3] 22838 pthread_rwlockattr_init(GLIBC_2.0)[SUSv3] 22839 pthread_attr_getguardsize(GLIBC_2.1)[SUSv3] 22840 pthread_exit(GLIBC_2.1)[SUSv3] 22841 pthread_rwlockattr_setpshared(GLIBC_2.1)[SUSv3] 22842 pthread_attr_getinheritsched(GLIBC_2.0)[SUSv3] 22843 pthread_getconcurrency[SUSv3] pthread_self(GLIBC_2.0)[SUSv3] 22844 pthread_attr_getschedparam(GLIBC_2.0)[SUSv3] 22845 pthread_getschedparam(GLIBC_2.0)[SUSv3] 22846 pthread_setcancelstate(GLIBC_2.0)[SUSv3] 22847 pthread_attr_getschedpolicy(GLIBC_2.0)[SUSv3] 22848 pthread_getspecific(GLIBC_2.0)[SUSv3] 22849 pthread_setcanceltype(GLIBC_2.0)[SUSv3] 22850 pthread_attr_getscope(GLIBC_2.0)[SUSv3] 22851 pthread_join(GLIBC_2.0)[SUSv3] pthread_setconcurrency[SUSv3] 22852 pthread_attr_getstack[SUSv3] pthread_key_create()[SUSv3] 22853 pthread_setschedparam()[SUSv3] 22854 pthread_attr_getstackaddr(GLIBC_2.1)[SUSv3] 22855 pthread_key_delete(GLIBC_2.1)[SUSv3] 22856 pthread_setschedprio[SUSv3] 22857 pthread_attr_getstacksize(GLIBC_2.1)[SUSv3] 22858 pthread_kill(GLIBC_2.1)[SUSv3] 22859 pthread_setspecific(GLIBC_2.1)[SUSv3] 22860 pthread_attr_init(GLIBC_2.1)[SUSv3] 22861 pthread_mutex_destroy(GLIBC_2.1)[SUSv3] 22862 pthread_sigmask(GLIBC_2.1)[SUSv3] 22863 pthread_attr_setdetachstate(GLIBC_2.0)[SUSv3] 22864 pthread_mutex_init(GLIBC_2.0)[SUSv3] 22865 pthread_testcancel(GLIBC_2.0)[SUSv3] 22866 pthread_attr_setguardsize(GLIBC_2.1)[SUSv3] 22867 pthread_mutex_lock(GLIBC_2.1)[SUSv3] pwrite(GLIBC_2.1)[SUSv3] 22868 pthread_attr_setinheritsched(GLIBC_2.0)[SUSv3] 22869 pthread_mutex_trylock(GLIBC_2.0)[SUSv3] 22870 pwrite64(GLIBC_2.0)[LFS] 22871 pthread_attr_setschedparam(GLIBC_2.0)[SUSv3] 22872 pthread_mutex_unlock(GLIBC_2.0)[SUSv3] 22873 sem_close(GLIBC_2.0)[SUSv3] 22874 pthread_attr_setschedpolicy(GLIBC_2.0)[SUSv3] 22875 pthread_mutexattr_destroy(GLIBC_2.0)[SUSv3] 22876 sem_destroy(GLIBC_2.0)[SUSv3] 22877 pthread_attr_setscope(GLIBC_2.0)[SUSv3] 22878 pthread_mutexattr_getpshared(GLIBC_2.0)[SUSv3] 22879 sem_getvalue(GLIBC_2.0)[SUSv3] 22880 pthread_attr_setstack[SUSv3] 22881 pthread_mutexattr_gettype()[SUSv3] sem_init()[SUSv3] 22882 pthread_attr_setstackaddr(GLIBC_2.1)[SUSv3] 22883 pthread_mutexattr_init(GLIBC_2.1)[SUSv3] 22884 sem_open(GLIBC_2.1)[SUSv3] 22885 pthread_attr_setstacksize(GLIBC_2.1)[SUSv3] 22886 pthread_mutexattr_setpshared(GLIBC_2.1)[SUSv3] 22887 sem_post(GLIBC_2.1)[SUSv3] 22888 pthread_cancel(GLIBC_2.0)[SUSv3] 22889 pthread_mutexattr_settype(GLIBC_2.0)[SUSv3] 22890 sem_timedwait(GLIBC_2.0)[SUSv3] 22891 pthread_cond_broadcast(GLIBC_2.0)[SUSv3] 22892 pthread_once(GLIBC_2.0)[SUSv3] sem_trywait(GLIBC_2.0)[SUSv3] 22893 pthread_cond_destroy(GLIBC_2.0)[SUSv3] 22894 pthread_rwlock_destroy(GLIBC_2.0)[SUSv3] 22895 sem_unlink(GLIBC_2.0)[SUSv3] 22896 pthread_cond_init(GLIBC_2.0)[SUSv3] 22897 pthread_rwlock_init(GLIBC_2.0)[SUSv3] 22898 sem_wait(GLIBC_2.0)[SUSv3] 22899 pthread_cond_signal(GLIBC_2.0)[SUSv3] 22900 pthread_rwlock_rdlock(GLIBC_2.0)[SUSv3] 22901 pthread_cond_timedwait(GLIBC_2.0)[SUSv3] 22902 pthread_rwlock_timedrdlock[SUSv3] 22903 _________________________________________________________ 22904 22905 A.8. librt 22906 22907 The behavior of the interfaces in this library is specified by 22908 the following Standards. 22909 22910 ISO POSIX (2003) [SUSv3] 22911 22912 Table A-11. librt Function Interfaces 22913 clock_getcpuclockid(GLIBC_2.2)[SUSv3] 22914 clock_settime(GLIBC_2.2)[SUSv3] timer_delete(GLIBC_2.2)[SUSv3] 22915 clock_getres(GLIBC_2.2)[SUSv3] shm_open(GLIBC_2.2)[SUSv3] 22916 timer_getoverrun(GLIBC_2.2)[SUSv3] 22917 clock_gettime(GLIBC_2.2)[SUSv3] shm_unlink(GLIBC_2.2)[SUSv3] 22918 timer_gettime(GLIBC_2.2)[SUSv3] 22919 clock_nanosleep(GLIBC_2.2)[SUSv3] 22920 timer_create(GLIBC_2.2)[SUSv3] timer_settime(GLIBC_2.2)[SUSv3] 22921 _________________________________________________________ 22922 22923 A.9. libutil 22924 22925 The behavior of the interfaces in this library is specified by 22926 the following Standards. 22927 22928 This Specification [LSB] 22929 22930 Table A-12. libutil Function Interfaces 22931 forkpty(GLIBC_2.0)[LSB] login_tty(GLIBC_2.0)[LSB] 22932 logwtmp(GLIBC_2.0)[LSB] 22933 login(GLIBC_2.0)[LSB] logout(GLIBC_2.0)[LSB] 22934 openpty(GLIBC_2.0)[LSB] 22935 _________________________________________________________ 22936 22937 A.10. libz 22938 22939 The behavior of the interfaces in this library is specified by 22940 the following Standards. 22941 22942 This Specification [LSB] 22943 22944 Table A-13. libz Function Interfaces 22945 adler32[LSB] gzclose[LSB] gztell[LSB] 22946 compress[LSB] gzdopen[LSB] gzwrite[LSB] 22947 compress2[LSB] gzeof[LSB] inflate[LSB] 22948 compressBound[LSB] gzerror[LSB] inflateEnd[LSB] 22949 crc32[LSB] gzflush[LSB] inflateInit2_[LSB] 22950 deflate[LSB] gzgetc[LSB] inflateInit_[LSB] 22951 deflateBound[LSB] gzgets[LSB] inflateReset[LSB] 22952 deflateCopy[LSB] gzopen[LSB] inflateSetDictionary[LSB] 22953 deflateEnd[LSB] gzprintf[LSB] inflateSync[LSB] 22954 deflateInit2_[LSB] gzputc[LSB] inflateSyncPoint[LSB] 22955 deflateInit_[LSB] gzputs[LSB] uncompress[LSB] 22956 deflateParams[LSB] gzread[LSB] zError[LSB] 22957 deflateReset[LSB] gzrewind[LSB] zlibVersion[LSB] 22958 deflateSetDictionary[LSB] gzseek[LSB] 22959 get_crc_table[LSB] gzsetparams[LSB] 22960 _________________________________________________________ 22961 22962 Appendix B. Future Directions (Informative) 22963 22964 B.1. Introduction 22965 22966 This appendix describes interfaces that are under development 22967 and aimed at future releases of this specification. At this 22968 stage, such interfaces are at best recommended practice, and 22969 do not constitute normative requirements of this 22970 specification. Applications may not assume that any system 22971 provides these interfaces. 22972 22973 We encourage system implementors and ISVs to provide these 22974 interfaces, and to provide feedback on their specification to 22975 lsbspec@freestandards.org. These interfaces may well be 22976 further modified during the development process, and may be 22977 withdrawn if concensus cannot be reached. 22978 _________________________________________________________ 22979 22980 B.2. Commands And Utilities 22981 22982 Table of Contents 22983 lsbinstall -- installation tool for various types of data 22984 22985 lsbinstall 22986 22987 Name 22988 22989 lsbinstall -- installation tool for various types of data 22990 22991 Synopsis 22992 22993 /usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] { -t 22994 type | --type=type } [-p package | --package=package] 22995 operand... 22996 22997 Description 22998 22999 The lsbinstall utility may be used to install certain types of 23000 files into system specific locations, repositories, or 23001 databases. This command may be used during a package post 23002 installation script to add package specific data to system 23003 wide repositories. A user may need appropriate privilege to 23004 invoke lsbinstall. 23005 23006 The operand (or operands) name an object of type type (see 23007 below) that belongs to a package named package. The 23008 combination of package name, object type and object name 23009 should be unique amongst all objects installed by lsbinstall. 23010 The lsbinstall utility may rename an object if another package 23011 already owns an object of the same type with the same name. 23012 23013 Note: If a namespace collision is detected by lsbinstall, 23014 it is unspecified how the object is renamed, although 23015 typical implementations may prepend the package name to the 23016 object in some way (e.g. package.obj-name). The lsbinstall 23017 utility may maintain a database of the mappings it has 23018 performed during installation in order to ensure that the 23019 correct object is removed during a subsequent removal 23020 operation. 23021 23022 Scripts installed by lsbinstall should not make use of the 23023 script name in order to decide on their functionality. 23024 23025 Note: It is appropriate for such a script to use the script 23026 name in error messages, usage statements, etc. The only 23027 guarantee made by lsbinstall is the effect that an 23028 installation (or removal) should have, not where a script 23029 is installed, or how it is named. 23030 23031 The -p pkg or --package=pkg is required for all object types 23032 unless explicitly noted below. 23033 23034 If the -c or --check option is specified, lsbinstall should 23035 test to see if there is an existing object of the type 23036 specified already installed. If there is, lsbinstall should 23037 print a message to its standard output and immediately exit 23038 with a status of zero. If there is no object of the type and 23039 name specified already installed, lsbinstall should exit with 23040 a non-zero status and take no further action. 23041 23042 If the -r or --remove is specified, the named object of the 23043 specified type should be removed or disabled from the system, 23044 except as noted below. The behavior is unspecified if the 23045 named object was not previously installed by lsbinstall. 23046 23047 Note: lsbinstall may rename objects during installation in 23048 order to prevent name collisions where another package has 23049 already installed an object with the given name. Using 23050 lsbinstall --remove will remove only the object belonging 23051 to the named package, and not the object belonging to 23052 another package. 23053 23054 Also note that the intent of the --remove option is to 23055 prevent the effect of the installed object; it should be 23056 sufficient to disable or comment out the addition in some 23057 way, while leaving the content behind. It is not intended 23058 that --remove be required to be the exact reverse of 23059 installation. 23060 23061 Object Types 23062 23063 The -t type or --type=type option should support at least the 23064 following types: 23065 23066 profile 23067 23068 install a profile script into a system specific location. 23069 There should be one operand, that names a profile shell 23070 script. The behavior is unspecified if this name does not have 23071 the suffix .sh. 23072 23073 The sh utility should read and execute commands in its current 23074 execution environment from all such installed profile shell 23075 scripts when invoked as an interactive login shell, or if the 23076 -l (the letter ell) is specified (see Shell Invocation). 23077 service 23078 23079 ensure a service name and number pair is known to the system 23080 service database. When installing, there must be at least two 23081 operands. The first operand should have the format %d/%s with 23082 the port number and protocol values (e.g. 22/tcp), and the 23083 second operand should be the name of the service. Any 23084 subsequent operands provide aliases for this service. The -p 23085 pkg or --package=pkg option is not required for service 23086 objects, and is ignored if specified. If any of the -r, 23087 --remove, -c or --check options are specified, there should be 23088 a single operand identifying the port and protocol values 23089 (with the same format as above). 23090 23091 It should not be an error to attempt to add a service name to 23092 the system service database if that service name already 23093 exists for the same port and protocol combination. If the port 23094 and protocol combination was already present, but the name 23095 unknown, the name should be added as an alias to the existing 23096 entry. It should be an error to attempt to add a second entry 23097 for a given service name and protocol, but where the port 23098 number differs from an existing entry. 23099 23100 If the -r or --remove is specified, the system service 23101 database need not be updated to remove or disable the named 23102 service. 23103 inet 23104 23105 add an entry to the system's network super daemon 23106 configuration. If none of the -r, --remove, -c or --check 23107 options are specified, the first operand should have the 23108 format: 23109 "%s:%s:%s:%s:%s:%s" 23110 23111 Otherwise, the first operand should have the format 23112 "%s:%s" 23113 23114 The fields in the first operand have the following meaning, in 23115 order: 23116 23117 svc_name 23118 23119 The name of this service. If the name does not contain a /, 23120 this should match the name of an already installed service 23121 (see also getservbyname()). If the name contains a / 23122 character, the behavior is unspecified. 23123 23124 Rationale: This version of the LSB does not specify 23125 getrpcbyname() nor the existence or format of the /etc/rpc 23126 file. Therefore, installation of RPC based services is not 23127 specified at this point. A future version of this 23128 specification may require names containing a / character to 23129 be Remote Procedure Call based services. 23130 23131 protocol 23132 23133 The name of a protocol. The name should be one of those listed 23134 in /etc/protocols. If this attribute is not specified (i.e. a 23135 null value is passed), the system should use an implementation 23136 defined default protocol. 23137 socket_type 23138 23139 One of the following values: 23140 23141 stream 23142 23143 the service will use a stream type socket. 23144 dgram 23145 23146 the service will use a datagram type socket. 23147 seqpacket 23148 23149 the service will use a sequenced packet type socket. 23150 This field is not required for the -c, --check, -r, or 23151 --remove options. 23152 wait_flag 23153 23154 If the value of this attribute is wait, once the service is 23155 started, no further requests for that service will be handled 23156 until the service exits. If the value is nowait, the network 23157 super daemon should continue to handle further requests for 23158 the given service while that service is running. 23159 23160 Note: If the service has the socket_type attribute set to 23161 dgram, the wait_flag attribute should be set to wait, since 23162 such services do not have any distinction between the 23163 socket used for listening and that used for accepting. 23164 23165 This field is not required for the -c, --check, -r, or 23166 --remove options. 23167 user[.group] 23168 23169 The name of a user from the user login database, optionally 23170 followed by the name of a group from the group database. The 23171 service started to handle this request should run with the 23172 privileges of the specified user and group. This field is not 23173 required for the -c, --check, -r, or --remove options. 23174 server [arg ...] 23175 23176 The name of a program to run to handle the request, optionally 23177 followed by any arguments required. The server name and each 23178 of its arguments is separated by whitespace. This field is not 23179 required for the -c, --check, -r, or --remove options. 23180 If the implementation supports additional controls over 23181 services started through the inet super daemon, there may be 23182 additional, implementation-defined, operands. 23183 23184 Rationale: Systems that use the xinetd super daemon may 23185 support additional controls such as IP address 23186 restrictions, logging requirements, etc. The LSB does not 23187 require these additional controls. However, it was believed 23188 to be of sufficient benefit that implementations are 23189 granted permission to extend this interface as required. 23190 23191 Examples 23192 23193 lsbinstall --package=myapp --type=profile myco.com-prod.sh 23194 23195 Install the profile shell script for myco.com-prod.sh, part of 23196 the myapp package.. 23197 lsbinstall --package=myapp --check --type=profile myco.com-prod.sh 23198 23199 Test to see if the profile shell script for myco.com-prod.sh, 23200 as part of the myapp package, is installed correctly. 23201 23202 Exit Status 23203 23204 If the -c or --check option is specified, lsbinstall should 23205 exit with a zero status if an object of the specified type and 23206 name is already installed, or non-zero otherwise. Otherwise, 23207 lsbinstall should exit with a zero status if the object with 23208 the specified type and name was successfully installed (or 23209 removed if the -r or --remove option was specified), and 23210 non-zero if the installation (or removal) failed. On failure, 23211 a diagnostic message should be printed to the standard error 23212 file descriptor. 23213 _________________________________________________________ 23214 23215 Appendix C. GNU Free Documentation License (Informative) 23216 23217 This specification is published under the terms of the GNU 23218 Free Documentation License, Version 1.1, March 2000 23219 23220 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 23221 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 23222 permitted to copy and distribute verbatim copies of this 23223 license document, but changing it is not allowed. 23224 _________________________________________________________ 23225 23226 C.1. PREAMBLE 23227 23228 The purpose of this License is to make a manual, textbook, or 23229 other written document "free" in the sense of freedom: to 23230 assure everyone the effective freedom to copy and redistribute 23231 it, with or without modifying it, either commercially or 23232 noncommercially. Secondarily, this License preserves for the 23233 author and publisher a way to get credit for their work, while 23234 not being considered responsible for modifications made by 23235 others. 23236 23237 This License is a kind of "copyleft", which means that 23238 derivative works of the document must themselves be free in 23239 the same sense. It complements the GNU General Public License, 23240 which is a copyleft license designed for free software. 23241 23242 We have designed this License in order to use it for manuals 23243 for free software, because free software needs free 23244 documentation: a free program should come with manuals 23245 providing the same freedoms that the software does. But this 23246 License is not limited to software manuals; it can be used for 23247 any textual work, regardless of subject matter or whether it 23248 is published as a printed book. We recommend this License 23249 principally for works whose purpose is instruction or 23250 reference. 23251 _________________________________________________________ 23252 23253 C.2. APPLICABILITY AND DEFINITIONS 23254 23255 This License applies to any manual or other work that contains 23256 a notice placed by the copyright holder saying it can be 23257 distributed under the terms of this License. The "Document", 23258 below, refers to any such manual or work. Any member of the 23259 public is a licensee, and is addressed as "you". 23260 23261 A "Modified Version" of the Document means any work containing 23262 the Document or a portion of it, either copied verbatim, or 23263 with modifications and/or translated into another language. 23264 23265 A "Secondary Section" is a named appendix or a front-matter 23266 section of the Document that deals exclusively with the 23267 relationship of the publishers or authors of the Document to 23268 the Document's overall subject (or to related matters) and 23269 contains nothing that could fall directly within that overall 23270 subject. (For example, if the Document is in part a textbook 23271 of mathematics, a Secondary Section may not explain any 23272 mathematics.) The relationship could be a matter of historical 23273 connection with the subject or with related matters, or of 23274 legal, commercial, philosophical, ethical or political 23275 position regarding them. 23276 23277 The "Invariant Sections" are certain Secondary Sections whose 23278 titles are designated, as being those of Invariant Sections, 23279 in the notice that says that the Document is released under 23280 this License. 23281 23282 The "Cover Texts" are certain short passages of text that are 23283 listed, as Front-Cover Texts or Back-Cover Texts, in the 23284 notice that says that the Document is released under this 23285 License. 23286 23287 A "Transparent" copy of the Document means a machine-readable 23288 copy, represented in a format whose specification is available 23289 to the general public, whose contents can be viewed and edited 23290 directly and straightforwardly with generic text editors or 23291 (for images composed of pixels) generic paint programs or (for 23292 drawings) some widely available drawing editor, and that is 23293 suitable for input to text formatters or for automatic 23294 translation to a variety of formats suitable for input to text 23295 formatters. A copy made in an otherwise Transparent file 23296 format whose markup has been designed to thwart or discourage 23297 subsequent modification by readers is not Transparent. A copy 23298 that is not "Transparent" is called "Opaque". 23299 23300 Examples of suitable formats for Transparent copies include 23301 plain ASCII without markup, Texinfo input format, LaTeX input 23302 format, SGML or XML using a publicly available DTD, and 23303 standard-conforming simple HTML designed for human 23304 modification. Opaque formats include PostScript, PDF, 23305 proprietary formats that can be read and edited only by 23306 proprietary word processors, SGML or XML for which the DTD 23307 and/or processing tools are not generally available, and the 23308 machine-generated HTML produced by some word processors for 23309 output purposes only. 23310 23311 The "Title Page" means, for a printed book, the title page 23312 itself, plus such following pages as are needed to hold, 23313 legibly, the material this License requires to appear in the 23314 title page. For works in formats which do not have any title 23315 page as such, "Title Page" means the text near the most 23316 prominent appearance of the work's title, preceding the 23317 beginning of the body of the text. 23318 _________________________________________________________ 23319 23320 C.3. VERBATIM COPYING 23321 23322 You may copy and distribute the Document in any medium, either 23323 commercially or noncommercially, provided that this License, 23324 the copyright notices, and the license notice saying this 23325 License applies to the Document are reproduced in all copies, 23326 and that you add no other conditions whatsoever to those of 23327 this License. You may not use technical measures to obstruct 23328 or control the reading or further copying of the copies you 23329 make or distribute. However, you may accept compensation in 23330 exchange for copies. If you distribute a large enough number 23331 of copies you must also follow the conditions in section 3. 23332 23333 You may also lend copies, under the same conditions stated 23334 above, and you may publicly display copies. 23335 _________________________________________________________ 23336 23337 C.4. COPYING IN QUANTITY 23338 23339 If you publish printed copies of the Document numbering more 23340 than 100, and the Document's license notice requires Cover 23341 Texts, you must enclose the copies in covers that carry, 23342 clearly and legibly, all these Cover Texts: Front-Cover Texts 23343 on the front cover, and Back-Cover Texts on the back cover. 23344 Both covers must also clearly and legibly identify you as the 23345 publisher of these copies. The front cover must present the 23346 full title with all words of the title equally prominent and 23347 visible. You may add other material on the covers in addition. 23348 Copying with changes limited to the covers, as long as they 23349 preserve the title of the Document and satisfy these 23350 conditions, can be treated as verbatim copying in other 23351 respects. 23352 23353 If the required texts for either cover are too voluminous to 23354 fit legibly, you should put the first ones listed (as many as 23355 fit reasonably) on the actual cover, and continue the rest 23356 onto adjacent pages. 23357 23358 If you publish or distribute Opaque copies of the Document 23359 numbering more than 100, you must either include a 23360 machine-readable Transparent copy along with each Opaque copy, 23361 or state in or with each Opaque copy a publicly-accessible 23362 computer-network location containing a complete Transparent 23363 copy of the Document, free of added material, which the 23364 general network-using public has access to download 23365 anonymously at no charge using public-standard network 23366 protocols. If you use the latter option, you must take 23367 reasonably prudent steps, when you begin distribution of 23368 Opaque copies in quantity, to ensure that this Transparent 23369 copy will remain thus accessible at the stated location until 23370 at least one year after the last time you distribute an Opaque 23371 copy (directly or through your agents or retailers) of that 23372 edition to the public. 23373 23374 It is requested, but not required, that you contact the 23375 authors of the Document well before redistributing any large 23376 number of copies, to give them a chance to provide you with an 23377 updated version of the Document. 23378 _________________________________________________________ 23379 23380 C.5. MODIFICATIONS 23381 23382 You may copy and distribute a Modified Version of the Document 23383 under the conditions of sections 2 and 3 above, provided that 23384 you release the Modified Version under precisely this License, 23385 with the Modified Version filling the role of the Document, 23386 thus licensing distribution and modification of the Modified 23387 Version to whoever possesses a copy of it. In addition, you 23388 must do these things in the Modified Version: 23389 23390 A. Use in the Title Page (and on the covers, if any) a title 23391 distinct from that of the Document, and from those of 23392 previous versions (which should, if there were any, be 23393 listed in the History section of the Document). You may 23394 use the same title as a previous version if the original 23395 publisher of that version gives permission. 23396 B. List on the Title Page, as authors, one or more persons or 23397 entities responsible for authorship of the modifications 23398 in the Modified Version, together with at least five of 23399 the principal authors of the Document (all of its 23400 principal authors, if it has less than five). 23401 C. State on the Title page the name of the publisher of the 23402 Modified Version, as the publisher. 23403 D. Preserve all the copyright notices of the Document. 23404 E. Add an appropriate copyright notice for your modifications 23405 adjacent to the other copyright notices. 23406 F. Include, immediately after the copyright notices, a 23407 license notice giving the public permission to use the 23408 Modified Version under the terms of this License, in the 23409 form shown in the Addendum below. 23410 G. Preserve in that license notice the full lists of 23411 Invariant Sections and required Cover Texts given in the 23412 Document's license notice. 23413 H. Include an unaltered copy of this License. 23414 I. Preserve the section entitled "History", and its title, 23415 and add to it an item stating at least the title, year, 23416 new authors, and publisher of the Modified Version as 23417 given on the Title Page. If there is no section entitled 23418 "History" in the Document, create one stating the title, 23419 year, authors, and publisher of the Document as given on 23420 its Title Page, then add an item describing the Modified 23421 Version as stated in the previous sentence. 23422 J. Preserve the network location, if any, given in the 23423 Document for public access to a Transparent copy of the 23424 Document, and likewise the network locations given in the 23425 Document for previous versions it was based on. These may 23426 be placed in the "History" section. You may omit a network 23427 location for a work that was published at least four years 23428 before the Document itself, or if the original publisher 23429 of the version it refers to gives permission. 23430 K. In any section entitled "Acknowledgements" or 23431 "Dedications", preserve the section's title, and preserve 23432 in the section all the substance and tone of each of the 23433 contributor acknowledgements and/or dedications given 23434 therein. 23435 L. Preserve all the Invariant Sections of the Document, 23436 unaltered in their text and in their titles. Section 23437 numbers or the equivalent are not considered part of the 23438 section titles. 23439 M. Delete any section entitled "Endorsements". Such a section 23440 may not be included in the Modified Version. 23441 N. Do not retitle any existing section as "Endorsements" or 23442 to conflict in title with any Invariant Section. 23443 23444 If the Modified Version includes new front-matter sections or 23445 appendices that qualify as Secondary Sections and contain no 23446 material copied from the Document, you may at your option 23447 designate some or all of these sections as invariant. To do 23448 this, add their titles to the list of Invariant Sections in 23449 the Modified Version's license notice. These titles must be 23450 distinct from any other section titles. 23451 23452 You may add a section entitled "Endorsements", provided it 23453 contains nothing but endorsements of your Modified Version by 23454 various parties--for example, statements of peer review or 23455 that the text has been approved by an organization as the 23456 authoritative definition of a standard. 23457 23458 You may add a passage of up to five words as a Front-Cover 23459 Text, and a passage of up to 25 words as a Back-Cover Text, to 23460 the end of the list of Cover Texts in the Modified Version. 23461 Only one passage of Front-Cover Text and one of Back-Cover 23462 Text may be added by (or through arrangements made by) any one 23463 entity. If the Document already includes a cover text for the 23464 same cover, previously added by you or by arrangement made by 23465 the same entity you are acting on behalf of, you may not add 23466 another; but you may replace the old one, on explicit 23467 permission from the previous publisher that added the old one. 23468 23469 The author(s) and publisher(s) of the Document do not by this 23470 License give permission to use their names for publicity for 23471 or to assert or imply endorsement of any Modified Version. 23472 _________________________________________________________ 23473 23474 C.6. COMBINING DOCUMENTS 23475 23476 You may combine the Document with other documents released 23477 under this License, under the terms defined in section 4 above 23478 for modified versions, provided that you include in the 23479 combination all of the Invariant Sections of all of the 23480 original documents, unmodified, and list them all as Invariant 23481 Sections of your combined work in its license notice. 23482 23483 The combined work need only contain one copy of this License, 23484 and multiple identical Invariant Sections may be replaced with 23485 a single copy. If there are multiple Invariant Sections with 23486 the same name but different contents, make the title of each 23487 such section unique by adding at the end of it, in 23488 parentheses, the name of the original author or publisher of 23489 that section if known, or else a unique number. Make the same 23490 adjustment to the section titles in the list of Invariant 23491 Sections in the license notice of the combined work. 23492 23493 In the combination, you must combine any sections entitled 23494 "History" in the various original documents, forming one 23495 section entitled "History"; likewise combine any sections 23496 entitled "Acknowledgements", and any sections entitled 23497 "Dedications". You must delete all sections entitled 23498 "Endorsements." 23499 _________________________________________________________ 23500 23501 C.7. COLLECTIONS OF DOCUMENTS 23502 23503 You may make a collection consisting of the Document and other 23504 documents released under this License, and replace the 23505 individual copies of this License in the various documents 23506 with a single copy that is included in the collection, 23507 provided that you follow the rules of this License for 23508 verbatim copying of each of the documents in all other 23509 respects. 23510 23511 You may extract a single document from such a collection, and 23512 distribute it individually under this License, provided you 23513 insert a copy of this License into the extracted document, and 23514 follow this License in all other respects regarding verbatim 23515 copying of that document. 23516 _________________________________________________________ 23517 23518 C.8. AGGREGATION WITH INDEPENDENT WORKS 23519 23520 A compilation of the Document or its derivatives with other 23521 separate and independent documents or works, in or on a volume 23522 of a storage or distribution medium, does not as a whole count 23523 as a Modified Version of the Document, provided no compilation 23524 copyright is claimed for the compilation. Such a compilation 23525 is called an "aggregate", and this License does not apply to 23526 the other self-contained works thus compiled with the 23527 Document, on account of their being thus compiled, if they are 23528 not themselves derivative works of the Document. 23529 23530 If the Cover Text requirement of section 3 is applicable to 23531 these copies of the Document, then if the Document is less 23532 than one quarter of the entire aggregate, the Document's Cover 23533 Texts may be placed on covers that surround only the Document 23534 within the aggregate. Otherwise they must appear on covers 23535 around the whole aggregate. 23536 _________________________________________________________ 23537 23538 C.9. TRANSLATION 23539 23540 Translation is considered a kind of modification, so you may 23541 distribute translations of the Document under the terms of 23542 section 4. Replacing Invariant Sections with translations 23543 requires special permission from their copyright holders, but 23544 you may include translations of some or all Invariant Sections 23545 in addition to the original versions of these Invariant 23546 Sections. You may include a translation of this License 23547 provided that you also include the original English version of 23548 this License. In case of a disagreement between the 23549 translation and the original English version of this License, 23550 the original English version will prevail. 23551 _________________________________________________________ 23552 23553 C.10. TERMINATION 23554 23555 You may not copy, modify, sublicense, or distribute the 23556 Document except as expressly provided for under this License. 23557 Any other attempt to copy, modify, sublicense or distribute 23558 the Document is void, and will automatically terminate your 23559 rights under this License. However, parties who have received 23560 copies, or rights, from you under this License will not have 23561 their licenses terminated so long as such parties remain in 23562 full compliance. 23563 _________________________________________________________ 23564 23565 C.11. FUTURE REVISIONS OF THIS LICENSE 23566 23567 The Free Software Foundation may publish new, revised versions 23568 of the GNU Free Documentation License from time to time. Such 23569 new versions will be similar in spirit to the present version, 23570 but may differ in detail to address new problems or concerns. 23571 See http://www.gnu.org/copyleft/. 23572 23573 Each version of the License is given a distinguishing version 23574 number. If the Document specifies that a particular numbered 23575 version of this License "or any later version" applies to it, 23576 you have the option of following the terms and conditions 23577 either of that specified version or of any later version that 23578 has been published (not as a draft) by the Free Software 23579 Foundation. If the Document does not specify a version number 23580 of this License, you may choose any version ever published 23581 (not as a draft) by the Free Software Foundation. 23582 _________________________________________________________ 23583 23584 C.12. How to use this License for your documents 23585 23586 To use this License in a document you have written, include a 23587 copy of the License in the document and put the following 23588 copyright and license notices just after the title page: 23589 23590 Copyright (c) YEAR YOUR NAME. Permission is granted to 23591 copy, distribute and/or modify this document under the 23592 terms of the GNU Free Documentation License, Version 1.1 or 23593 any later version published by the Free Software 23594 Foundation; with the Invariant Sections being LIST THEIR 23595 TITLES, with the Front-Cover Texts being LIST, and with the 23596 Back-Cover Texts being LIST. A copy of the license is 23597 included in the section entitled "GNU Free Documentation 23598 License". 23599 23600 If you have no Invariant Sections, write "with no Invariant 23601 Sections" instead of saying which ones are invariant. If you 23602 have no Front-Cover Texts, write "no Front-Cover Texts" 23603 instead of "Front-Cover Texts being LIST"; likewise for 23604 Back-Cover Texts. 23605 23606 If your document contains nontrivial examples of program code, 23607 we recommend releasing these examples in parallel under your 23608 choice of free software license, such as the GNU General 23609 Public License, to permit their use in free software.