1 Linux Standard Base Specification 2.0.1 2 3 Copyright ? 2000, 2001, 2002, 2003, 2004 Free Standards Group 4 5 Permission is granted to copy, distribute and/or modify this document under the 6 terms of the GNU Free Documentation License, Version 1.1; with no Invariant 7 Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of 8 the license is included in the section entitled "GNU Free Documentation 9 License". 10 11 Portions of the text are copyrighted by the following parties: 12 13 * The Regents of the University of California 14 15 * Free Software Foundation 16 17 * Ian F. Darwin 18 19 * Paul Vixie 20 21 * BSDI (now Wind River) 22 23 * Andrew G Morgan 24 25 * Jean-loup Gailly and Mark Adler 26 27 * Massachusetts Institute of Technology 28 29 These excerpts are being used in accordance with their respective licenses. 30 31 Linux is a trademark of Linus Torvalds. 32 33 UNIX a registered trademark of the Open Group in the United States and other 34 countries. 35 36 LSB is a trademark of the Free Standards Group in the USA and other countries. 37 38 AMD is a trademark of Advanced Micro Devices, Inc. 39 40 Intel and Itanium are registered trademarks and Intel386 is a trademarks of 41 Intel Corporation. 42 43 OpenGL is a registered trademark of Silicon Graphics, Inc. 44 45 ------------------------------------------------------------------------------- 46 47 Table of Contents 48 Foreword 49 Introduction 50 I. Introductory Elements 51 52 1. Scope 53 54 General 55 Module Specific Scope 56 57 2. Normative References 58 3. Requirements 59 60 Relevant Libraries 61 LSB Implementation Conformance 62 LSB Application Conformance 63 64 4. Definitions 65 5. Terminology 66 6. Documentation Conventions 67 68 II. Base Libraries 69 70 7. Libraries 71 72 Program Interpreter 73 Interfaces for libc 74 Data Definitions for libc 75 Interface Definitions for libc 76 Interfaces for libm 77 Data Definitions for libm 78 Interfaces for libpthread 79 Data Definitions for libpthread 80 Interface Definitions for libpthread 81 Interfaces for libgcc_s 82 Data Definitions for libgcc_s 83 Interfaces for libdl 84 Data Definitions for libdl 85 Interface Definitions for libdl 86 Interfaces for libcrypt 87 Interfaces for libpam 88 Data Definitions for libpam 89 Interface Definitions for libpam 90 91 III. Utility Libraries 92 93 8. utility Libraries 94 95 Interfaces for libz 96 Data Definitions for libz 97 Interfaces for libncurses 98 Data Definitions for libncurses 99 Interfaces for libutil 100 Interface Definitions for libutil 101 102 IV. Commands and Utilities 103 104 9. Commands and Utilities 105 106 Commands and Utilities 107 Command Behavior 108 109 V. Execution Environment 110 111 10. File System Hierarchy 112 113 /dev 114 115 11. Additional Recommendations 116 117 Minimal granted Directory and File permissions 118 Recommendations for applications on ownership and permissions 119 120 12. Additional Behaviors 121 122 Mandatory Optional Behaviors 123 124 13. Localization 125 126 Regular Expressions 127 Pattern Matching Notation 128 129 VI. System Initialization 130 131 14. System Initialization 132 133 Cron Jobs 134 Init Script Actions 135 Comment Conventions for Init Scripts 136 Installation and Removal of init.d Files 137 Run Levels 138 Facility Names 139 Script Names 140 Init Script Functions 141 142 VII. Users & Groups 143 144 15. Users & Groups 145 146 User and Group Database 147 User & Group Names 148 UID Ranges 149 Rationale 150 151 A. GNU Free Documentation License 152 153 PREAMBLE 154 APPLICABILITY AND DEFINITIONS 155 VERBATIM COPYING 156 COPYING IN QUANTITY 157 MODIFICATIONS 158 COMBINING DOCUMENTS 159 COLLECTIONS OF DOCUMENTS 160 AGGREGATION WITH INDEPENDENT WORKS 161 TRANSLATION 162 TERMINATION 163 FUTURE REVISIONS OF THIS LICENSE 164 How to use this License for your documents 165 166 List of Tables 167 2-1. Normative References 168 3-1. Standard Library Names 169 3-2. Standard Library Names defined in the Architecture Specific Supplement 170 7-1. libc Definition 171 7-2. libc - RPC Function Interfaces 172 7-3. libc - System Calls Function Interfaces 173 7-4. libc - Standard I/O Function Interfaces 174 7-5. libc - Standard I/O Data Interfaces 175 7-6. libc - Signal Handling Function Interfaces 176 7-7. libc - Signal Handling Data Interfaces 177 7-8. libc - Localization Functions Function Interfaces 178 7-9. libc - Localization Functions Data Interfaces 179 7-10. libc - Socket Interface Function Interfaces 180 7-11. libc - Socket Interface Deprecated Function Interfaces 181 7-12. libc - Wide Characters Function Interfaces 182 7-13. libc - String Functions Function Interfaces 183 7-14. libc - IPC Functions Function Interfaces 184 7-15. libc - Regular Expressions Function Interfaces 185 7-16. libc - Regular Expressions Deprecated Function Interfaces 186 7-17. libc - Regular Expressions Deprecated Data Interfaces 187 7-18. libc - Character Type Functions Function Interfaces 188 7-19. libc - Time Manipulation Function Interfaces 189 7-20. libc - Time Manipulation Deprecated Function Interfaces 190 7-21. libc - Time Manipulation Data Interfaces 191 7-22. libc - Terminal Interface Functions Function Interfaces 192 7-23. libc - System Database Interface Function Interfaces 193 7-24. libc - Language Support Function Interfaces 194 7-25. libc - Large File Support Function Interfaces 195 7-26. libc - Standard Library Function Interfaces 196 7-27. libc - Standard Library Data Interfaces 197 7-1. Examples 198 7-29. libm Definition 199 7-30. libm - Math Function Interfaces 200 7-31. libm - Math Data Interfaces 201 7-32. libpthread Definition 202 7-33. libpthread - Posix Threads Function Interfaces 203 7-34. libgcc_s Definition 204 7-35. libdl Definition 205 7-36. libdl - Dynamic Loader Function Interfaces 206 7-37. libcrypt Definition 207 7-38. libcrypt - Encryption Function Interfaces 208 7-39. libpam Definition 209 7-40. libpam - Pluggable Authentication API Function Interfaces 210 8-1. libz Definition 211 8-2. libz - Compression Library Function Interfaces 212 8-3. libncurses Definition 213 8-4. libncurses - Curses Function Interfaces 214 8-5. libncurses - Curses Data Interfaces 215 8-6. libutil Definition 216 8-7. libutil - Utility Functions Function Interfaces 217 9-1. Commands and Utilities 218 9-1. Escape Sequences 219 15-1. Required User & Group Names 220 15-2. Optional User & Group Names 221 222 ------------------------------------------------------------------------------- 223 224 Foreword 225 226 This is version 2.0.1 of the Linux Standard Base Specification. An 227 implementation of this version of the specification may not claim to be an 228 implementation of the Linux Standard Base unless it has successfully completed 229 the compliance process as defined by the Free Standards Group. 230 231 ------------------------------------------------------------------------------- 232 233 Introduction 234 235 The LSB defines a binary interface for application programs that are compiled 236 and packaged for LSB-conforming implementations on many different hardware 237 architectures. Since a binary specification shall include information specific 238 to the computer processor architecture for which it is intended, it is not 239 possible for a single document to specify the interface for all possible 240 LSB-conforming implementations. Therefore, the LSB is a family of 241 specifications, rather than a single one. 242 243 This document should be used in conjunction with the documents it references. 244 This document enumerates the system components it includes, but descriptions of 245 those components may be included entirely or partly in this document, partly in 246 other documents, or entirely in other reference documents. For example, the 247 section that describes system service routines includes a list of the system 248 routines supported in this interface, formal declarations of the data 249 structures they use that are visible to applications, and a pointer to the 250 underlying referenced specification for information about the syntax and 251 semantics of each call. Only those routines not described in standards 252 referenced by this document, or extensions to those standards, are described in 253 the detail. Information referenced in this way is as much a part of this 254 document as is the information explicitly included here. 255 256 I. Introductory Elements 257 258 Table of Contents 259 1. Scope 260 2. Normative References 261 3. Requirements 262 4. Definitions 263 5. Terminology 264 6. Documentation Conventions 265 266 ------------------------------------------------------------------------------- 267 268 Chapter 1. Scope 269 270 General 271 272 The Linux Standard Base (LSB) defines a system interface for compiled 273 applications and a minimal environment for support of installation scripts. Its 274 purpose is to enable a uniform industry standard environment for high-volume 275 applications conforming to the LSB. 276 277 These specifications are composed of two basic parts: A common specification 278 ("LSB-generic") describing those parts of the interface that remain constant 279 across all implementations of the LSB, and an architecture-specific 280 specification ("LSB-arch") describing the parts of the interface that vary by 281 processor architecture. Together, the LSB-generic and the architecture-specific 282 supplement for a single hardware architecture provide a complete interface 283 specification for compiled application programs on systems that share a common 284 hardware architecture. 285 286 The LSB-generic document shall be used in conjunction with an 287 architecture-specific supplement. Whenever a section of the LSB-generic 288 specification shall be supplemented by architecture-specific information, the 289 LSB-generic document includes a reference to the architecture supplement. 290 Architecture supplements may also contain additional information that is not 291 referenced in the LSB-generic document. 292 293 The LSB contains both a set of Application Program Interfaces (APIs) and 294 Application Binary Interfaces (ABIs). APIs may appear in the source code of 295 portable applications, while the compiled binary of that application may use 296 the larger set of ABIs. A conforming implementation shall provide all of the 297 ABIs listed here. The compilation system may replace (e.g. by macro definition) 298 certain APIs with calls to one or more of the underlying binary interfaces, and 299 may insert calls to binary interfaces as needed. 300 301 The LSB is primarily a binary interface definition. Not all of the source level 302 APIs available to applications may be contained in this specification. 303 304 ------------------------------------------------------------------------------- 305 306 Module Specific Scope 307 308 This is the Core module of the Linux Standards Base (LSB). This module provides 309 the fundemental system interfaces, libraries, and runtime environment upon 310 which all conforming applications and libraries depend. 311 312 Interfaces described in this module are mandatory except where explicitly 313 listed otherwise. Core interfaces may be supplemented by other modules; all 314 modules are built upon the core. 315 316 ------------------------------------------------------------------------------- 317 318 Chapter 2. Normative References 319 320 The specifications listed below are referenced in whole or in part by the Linux 321 Standard Base. In this specification, where only a particular section of one of 322 these references is identified, then the normative reference is to that section 323 alone, and the rest of the referenced document is informative. 324 325 Table 2-1. Normative References 326 327 +-----------------------------------------------------------------------------+ 328 | Name | Title | URL | 329 |-----------------+-------------------------------------+---------------------| 330 |DWARF Debugging |DWARF Debugging Information Format, |http:// | 331 |Information |Revision 2.0.0 (July 27, 1993) |www.eagercon.com/ | 332 |Format | |dwarf/dwarf-2.0.0.pdf| 333 |-----------------+-------------------------------------+---------------------| 334 |Filesystem |Filesystem Hierarchy Standard (FHS) |http:// | 335 |Hierarchy |2.3 |www.pathname.com/fhs/| 336 |Standard | | | 337 |-----------------+-------------------------------------+---------------------| 338 |IEEE Std 754-1985|IEEE Standard 754 for Binary |http://www.ieee.org/ | 339 | |Floating-Point Arithmetic | | 340 |-----------------+-------------------------------------+---------------------| 341 |ISO C (1999) |ISO/IEC 9899: 1999, Programming | | 342 | |Languages --C | | 343 |-----------------+-------------------------------------+---------------------| 344 | |ISO/IEC 9945-1:2003 Information | | 345 | |technology -- Portable Operating | | 346 | |System Interface (POSIX) -- Part 1: | | 347 | |Base Definitions | | 348 | | | | 349 | |ISO/IEC 9945-2:2003 Information | | 350 | |technology -- Portable Operating | | 351 | |System Interface (POSIX) -- Part 2: | | 352 | |System Interfaces |http://www.unix.org/ | 353 |ISO POSIX (2003) | |version3/ | 354 | |ISO/IEC 9945-3:2003 Information | | 355 | |technology -- Portable Operating | | 356 | |System Interface (POSIX) -- Part 3: | | 357 | |Shell and Utilities | | 358 | | | | 359 | |ISO/IEC 9945-4:2003 Information | | 360 | |technology -- Portable Operating | | 361 | |System Interface (POSIX) -- Part 4: | | 362 | |Rationale | | 363 |-----------------+-------------------------------------+---------------------| 364 | | |http:// | 365 |Large File |Large File Support |www.UNIX-systems.org/| 366 |Support | |version2/whatsnew/ | 367 | | |lfs20mar.html | 368 |-----------------+-------------------------------------+---------------------| 369 |Li18nux |LI18NUX 2000 Globalization |http:// | 370 |Globalization |Specification, Version 1.0 with |www.li18nux.org/docs/| 371 |Specification |Amendment 4 |html/ | 372 | | |LI18NUX-2000-amd4.htm| 373 |-----------------+-------------------------------------+---------------------| 374 |Linux Allocated | |http://www.lanana.org| 375 |Device Registry |LINUX ALLOCATED DEVICES |/docs/device-list/ | 376 | | |devices.txt | 377 |-----------------+-------------------------------------+---------------------| 378 | |Open Software Foundation, Request For|http:// | 379 |PAM |Comments: 86.0 , October 1995, V. |www.opengroup.org/ | 380 | |Samar & R.Schemers (SunSoft) |tech/rfc/mirror-rfc/ | 381 | | |rfc86.0.txt | 382 |-----------------+-------------------------------------+---------------------| 383 |RFC 1321: The MD5|IETF RFC 1321: The MD5 Message-Digest|http://www.ietf.org/ | 384 |Message-Digest |Algorithm |rfc/rfc1321.txt | 385 |Algorithm | | | 386 |-----------------+-------------------------------------+---------------------| 387 |RFC 1833: Binding|IETF RFC 1833: Binding Protocols for |http://www.ietf.org/ | 388 |Protocols for ONC|ONC RPC Version 2 |rfc/rfc1833.txt | 389 |RPC Version 2 | | | 390 |-----------------+-------------------------------------+---------------------| 391 |RFC 1951: DEFLATE| | | 392 |Compressed Data |IETF RFC 1951: DEFLATE Compressed |http://www.ietf.org/ | 393 |Format |Data Format Specification version 1.3|rfc/rfc1951.txt | 394 |Specification | | | 395 |-----------------+-------------------------------------+---------------------| 396 |RFC 1952: GZIP |IETF RFC 1952: GZIP file format |http://www.ietf.org/ | 397 |File Format |specification version 4.3 |rfc/rfc1952.txt | 398 |Specification | | | 399 |-----------------+-------------------------------------+---------------------| 400 |RFC 2440: OpenPGP|IETF RFC 2440: OpenPGP Message Format|http://www.ietf.org/ | 401 |Message Format | |rfc/rfc2440.txt | 402 |-----------------+-------------------------------------+---------------------| 403 | |CAE Specification, January 1997, |http:// | 404 |SUSv2 |System Interfaces and Headers |www.opengroup.org/ | 405 | |(XSH),Issue 5 (ISBN: 1-85912-181-0, |publications/catalog/| 406 | |C606) |un.htm | 407 |-----------------+-------------------------------------+---------------------| 408 | |The Single UNIX Specification(SUS) |http:// | 409 |SUSv2 Command and|Version 2, Commands and Utilities |www.opengroup.org/ | 410 |Utilities |(XCU), Issue 5 (ISBN: 1-85912-191-8, |publications/catalog/| 411 | |C604) |un.htm | 412 |-----------------+-------------------------------------+---------------------| 413 | |American Telephone and Telegraph | | 414 |SVID Issue 3 |Company, System V Interface | | 415 | |Definition, Issue 3 ; Morristown, NJ,| | 416 | |UNIX Press, 1989.(ISBN 0201566524) | | 417 |-----------------+-------------------------------------+---------------------| 418 |SVID Issue 4 |System V Interface Definition,Fourth | | 419 | |Edition | | 420 |-----------------+-------------------------------------+---------------------| 421 | | |http:// | 422 |System V ABI |System V Application Binary |www.caldera.com/ | 423 | |Interface, Edition 4.1 |developers/devspecs/ | 424 | | |gabi41.pdf | 425 |-----------------+-------------------------------------+---------------------| 426 | | |http:// | 427 |System V ABI |System V Application Binary Interface|www.caldera.com/ | 428 |Update |- DRAFT - 17 December 2003 |developers/gabi/ | 429 | | |2003-12-17/ | 430 | | |contents.html | 431 |-----------------+-------------------------------------+---------------------| 432 |this | |http:// | 433 |specification |Linux Standard Base |www.linuxbase.org/ | 434 | | |spec/ | 435 |-----------------+-------------------------------------+---------------------| 436 | |CAE Specification, May 1996, X/Open |http:// | 437 |X/Open Curses |Curses, Issue 4, Version 2 (ISBN: |www.opengroup.org/ | 438 | |1-85912-171-3, C610), plus |publications/catalog/| 439 | |Corrigendum U018 |un.htm | 440 |-----------------+-------------------------------------+---------------------| 441 |zlib Manual |zlib 1.2 Manual |http://www.gzip.org/ | 442 | | |zlib/ | 443 +-----------------------------------------------------------------------------+ 444 ------------------------------------------------------------------------------- 445 446 Chapter 3. Requirements 447 448 Relevant Libraries 449 450 The libraries listed in Table 3-1 shall be available on a Linux Standard Base 451 system, with the specified runtime names. The libraries listed in Table 3-2 are 452 architecture specific, but shall be available on all LSB conforming systems. 453 This list may be supplemented or amended by the architecture-specific 454 specification. 455 456 Table 3-1. Standard Library Names 457 458 +---------------------------+ 459 | Library | Runtime Name | 460 |----------+----------------| 461 |libcrypt |libcrypt.so.1 | 462 |----------+----------------| 463 |libdl |libdl.so.2 | 464 |----------+----------------| 465 |libncurses|libncurses.so.5 | 466 |----------+----------------| 467 |libpthread|libpthread.so.0 | 468 |----------+----------------| 469 |libutil |libutil.so.1 | 470 |----------+----------------| 471 |libz |libz.so.1 | 472 |----------+----------------| 473 |libpam |libpam.so.0 | 474 |----------+----------------| 475 |libgcc_s |libgcc_s.so.1 | 476 +---------------------------+ 477 478 Table 3-2. Standard Library Names defined in the Architecture Specific 479 Supplement 480 481 +------------------------+ 482 | Library |Runtime Name | 483 |----------+-------------| 484 |libc |See archLSB | 485 |----------+-------------| 486 |libm |See archLSB | 487 |----------+-------------| 488 |proginterp|See archLSB | 489 +------------------------+ 490 491 These libraries will be in an implementation-defined directory which the 492 dynamic linker shall search by default. 493 494 ------------------------------------------------------------------------------- 495 496 LSB Implementation Conformance 497 498 A conforming implementation shall satisfy the following requirements: 499 500 * The implementation shall implement fully the architecture described in the 501 hardware manual for the target processor architecture. 502 503 * The implementation shall be capable of executing compiled applications 504 having the format and using the system interfaces described in this 505 document. 506 507 * The implementation shall provide libraries containing the interfaces 508 specified by this document, and shall provide a dynamic linking mechanism 509 that allows these interfaces to be attached to applications at runtime. All 510 the interfaces shall behave as specified in this document. 511 512 * The map of virtual memory provided by the implementation shall conform to 513 the requirements of this document. 514 515 * The implementation's low-level behavior with respect to function call 516 linkage, system traps, signals, and other such activities shall conform to 517 the formats described in this document. 518 519 * The implementation shall provide all of the mandatory interfaces in their 520 entirety. 521 522 * The implementation may provide one or more of the optional interfaces. Each 523 optional interface that is provided shall be provided in its entirety. The 524 product documentation shall state which optional interfaces are provided. 525 526 * The implementation shall provide all files and utilities specified as part 527 of this document in the format defined here and in other referenced 528 documents. All commands and utilities shall behave as required by this 529 document. The implementation shall also provide all mandatory components of 530 an application's runtime environment that are included or referenced in 531 this document. 532 533 * The implementation, when provided with standard data formats and values at 534 a named interface, shall provide the behavior defined for those values and 535 data formats at that interface. However, a conforming implementation may 536 consist of components which are separately packaged and/or sold. For 537 example, a vendor of a conforming implementation might sell the hardware, 538 operating system, and windowing system as separately packaged items. 539 540 * The implementation may provide additional interfaces with different names. 541 It may also provide additional behavior corresponding to data values 542 outside the standard ranges, for standard named interfaces. 543 544 545 546 ------------------------------------------------------------------------------- 547 548 LSB Application Conformance 549 550 A conforming application shall satisfy the following requirements: 551 552 553 554 * Its executable files are either shell scripts or object files in the format 555 defined for the Object File Format system interface. 556 557 * Its object files participate in dynamic linking as defined in the Program 558 Loading and Linking System interface. 559 560 * It employs only the instructions, traps, and other low-level facilities 561 defined in the Low-Level System interface as being for use by applications. 562 563 * If it requires any optional interface defined in this document in order to 564 be installed or to execute successfully, the requirement for that optional 565 interface is stated in the application's documentation. 566 567 * It does not use any interface or data format that is not required to be 568 provided by a conforming implementation, unless: 569 570 + If such an interface or data format is supplied by another application 571 through direct invocation of that application during execution, that 572 application is in turn an LSB conforming application. 573 574 + The use of that interface or data format, as well as its source, is 575 identified in the documentation of the application. 576 577 * It shall not use any values for a named interface that are reserved for 578 vendor extensions. 579 580 A strictly conforming application does not require or use any interface, 581 facility, or implementation-defined extension that is not defined in this 582 document in order to be installed or to execute successfully. 583 584 ------------------------------------------------------------------------------- 585 586 Chapter 4. Definitions 587 588 For the purposes of this document, the following definitions, as specified in 589 the ISO/IEC Directives, Part 2, 2001, 4th Edition, apply: 590 591 can 592 593 be able to; there is a possibility of; it is possible to 594 595 cannot 596 597 be unable to; there is no possibilty of; it is not possible to 598 599 may 600 601 is permitted; is allowed; is permissible 602 603 need not 604 605 it is not required that; no...is required 606 607 shall 608 609 is to; is required to; it is required that; has to; only...is permitted; it 610 is necessary 611 612 shall not 613 614 is not allowed [permitted] [acceptable] [permissible]; is required to be 615 not; is required that...be not; is not to be 616 617 should 618 619 it is recommended that; ought to 620 621 should not 622 623 it is not recommended that; ought not to 624 625 ------------------------------------------------------------------------------- 626 627 Chapter 5. Terminology 628 629 For the purposes of this document, the following terms apply: 630 631 archLSB 632 633 The architectural part of the LSB Specification which describes the 634 specific parts of the interface that are platform specific. The archLSB is 635 complementary to the gLSB. 636 637 Binary Standard 638 639 The total set of interfaces that are available to be used in the compiled 640 binary code of a conforming application. 641 642 gLSB 643 644 The common part of the LSB Specification that describes those parts of the 645 interface that remain constant across all hardware implementations of the 646 LSB. 647 648 implementation-defined 649 650 Describes a value or behavior that is not defined by this document but is 651 selected by an implementor. The value or behavior may vary among 652 implementations that conform to this document. An application should not 653 rely on the existence of the value or behavior. An application that relies 654 on such a value or behavior cannot be assured to be portable across 655 conforming implementations. The implementor shall document such a value or 656 behavior so that it can be used correctly by an application. 657 658 Shell Script 659 660 A file that is read by an interpreter (e.g., awk). The first line of the 661 shell script includes a reference to its interpreter binary. 662 663 Source Standard 664 665 The set of interfaces that are available to be used in the source code of a 666 conforming application. 667 668 undefined 669 670 Describes the nature of a value or behavior not defined by this document 671 which results from use of an invalid program construct or invalid data 672 input. The value or behavior may vary among implementations that conform to 673 this document. An application should not rely on the existence or validity 674 of the value or behavior. An application that relies on any particular 675 value or behavior cannot be assured to be portable across conforming 676 implementations. 677 678 unspecified 679 680 Describes the nature of a value or behavior not specified by this document 681 which results from use of a valid program construct or valid data input. 682 The value or behavior may vary among implementations that conform to this 683 document. An application should not rely on the existence or validity of 684 the value or behavior. An application that relies on any particular value 685 or behavior cannot be assured to be portable across conforming 686 implementations. 687 688 Other terms and definitions used in this document shall have the same meaning 689 as defined in Chapter 3 of the Base Definitions volume of ISO POSIX (2003). 690 691 ------------------------------------------------------------------------------- 692 693 Chapter 6. Documentation Conventions 694 695 Throughout this document, the following typographic conventions are used: 696 697 function() 698 699 the name of a function 700 701 command 702 703 the name of a command or utility 704 705 CONSTANT 706 707 a constant value 708 709 parameter 710 711 a parameter 712 713 variable 714 715 a variable 716 717 Throughout this specification, several tables of interfaces are presented. Each 718 entry in these tables has the following format: 719 720 name 721 722 the name of the interface 723 724 (symver) 725 726 An optional symbol version identifier, if required. 727 728 [refno] 729 730 A reference number indexing the table of referenced specifications that 731 follows this table. 732 733 For example, 734 735 +----------------------+ 736 |forkpty(GLIBC_2.0) [1]| 737 +----------------------+ 738 739 refers to the interface named forkpty with symbol version GLIBC_2.0 that is 740 defined in the first of the listed references below the table. 741 742 II. Base Libraries 743 744 Table of Contents 745 7. Libraries 746 747 ------------------------------------------------------------------------------- 748 749 Chapter 7. Libraries 750 751 An LSB-conforming implementation shall support some base libraries which 752 provide interfaces for accessing the operating system, processor and other 753 hardware in the system. 754 755 ------------------------------------------------------------------------------- 756 757 Program Interpreter 758 759 The Program Interpreter is specified in the appropriate architecture-specific 760 LSB specification. 761 762 ------------------------------------------------------------------------------- 763 764 Interfaces for libc 765 766 Table 7-1 defines the library name and shared object name for the libc library 767 768 Table 7-1. libc Definition 769 770 +----------------------+ 771 |Library:|libc | 772 |--------+-------------| 773 |SONAME: |See archLSB. | 774 +----------------------+ 775 776 The behavior of the interfaces in this library is specified by the following 777 specifications: 778 779 Large File Support 780 this specification 781 SUSv2 782 ISO POSIX (2003) 783 SVID Issue 3 784 SVID Issue 4 785 786 ------------------------------------------------------------------------------- 787 788 RPC 789 790 ------------------------------------------------------------------------------- 791 792 Interfaces for RPC 793 794 An LSB conforming implementation shall provide the generic functions for RPC 795 specified in Table 7-2, with the full functionality as described in the 796 referenced underlying specification. 797 798 Table 7-2. libc - RPC Function Interfaces 799 800 +----------------------------------------------------------------------------------------+ 801 |authnone_create |pmap_unset [2] |svcerr_weakauth |xdr_float [3] |xdr_u_char [3]| 802 |[1] | |[3] | | | 803 |------------------+----------------+------------------+------------------+--------------| 804 |clnt_create [1] |setdomainname |svctcp_create [2] |xdr_free [3] |xdr_u_int [2] | 805 | |[2] | | | | 806 |------------------+----------------+------------------+------------------+--------------| 807 |clnt_pcreateerror |svc_getreqset |svcudp_create [2] |xdr_int [3] |xdr_u_long [3]| 808 |[1] |[3] | | | | 809 |------------------+----------------+------------------+------------------+--------------| 810 |clnt_perrno [1] |svc_register [2]|xdr_accepted_reply|xdr_long [3] |xdr_u_short | 811 | | |[3] | |[3] | 812 |------------------+----------------+------------------+------------------+--------------| 813 |clnt_perror [1] |svc_run [2] |xdr_array [3] |xdr_opaque [3] |xdr_union [3] | 814 |------------------+----------------+------------------+------------------+--------------| 815 |clnt_spcreateerror|svc_sendreply |xdr_bool [3] |xdr_opaque_auth |xdr_vector [3]| 816 |[1] |[2] | |[3] | | 817 |------------------+----------------+------------------+------------------+--------------| 818 |clnt_sperrno [1] |svcerr_auth [3] |xdr_bytes [3] |xdr_pointer [3] |xdr_void [3] | 819 |------------------+----------------+------------------+------------------+--------------| 820 |clnt_sperror [1] |svcerr_decode |xdr_callhdr [3] |xdr_reference [3] |xdr_wrapstring| 821 | |[3] | | |[3] | 822 |------------------+----------------+------------------+------------------+--------------| 823 |getdomainname [2] |svcerr_noproc |xdr_callmsg [3] |xdr_rejected_reply|xdrmem_create | 824 | |[3] | |[3] |[3] | 825 |------------------+----------------+------------------+------------------+--------------| 826 |key_decryptsession|svcerr_noprog |xdr_char [3] |xdr_replymsg [3] |xdrrec_create | 827 |[3] |[3] | | |[3] | 828 |------------------+----------------+------------------+------------------+--------------| 829 |pmap_getport [2] |svcerr_progvers |xdr_double [3] |xdr_short [3] |xdrrec_eof [3]| 830 | |[3] | | | | 831 |------------------+----------------+------------------+------------------+--------------| 832 |pmap_set [2] |svcerr_systemerr|xdr_enum [3] |xdr_string [3] | | 833 | |[3] | | | | 834 +----------------------------------------------------------------------------------------+ 835 836 Referenced Specification(s) 837 838 [1]. SVID Issue 4 839 840 [2]. this specification 841 842 [3]. SVID Issue 3 843 844 ------------------------------------------------------------------------------- 845 846 System Calls 847 848 ------------------------------------------------------------------------------- 849 850 Interfaces for System Calls 851 852 An LSB conforming implementation shall provide the generic functions for System 853 Calls specified in Table 7-3, with the full functionality as described in the 854 referenced underlying specification. 855 856 Table 7-3. libc - System Calls Function Interfaces 857 858 +-----------------------------------------------------------------------------+ 859 |__fxstat [1]|fchmod [2] |getwd [2] |read [2] |setrlimit [2]| 860 |------------+-------------+------------+-----------------------+-------------| 861 |__getpgid |fchown [2] |initgroups |readdir [2] |setrlimit64 | 862 |[1] | |[1] | |[3] | 863 |------------+-------------+------------+-----------------------+-------------| 864 |__lxstat [1]|fcntl [1] |ioctl [1] |readdir_r [2] |setsid [2] | 865 |------------+-------------+------------+-----------------------+-------------| 866 |__xmknod [1]|fdatasync [2]|kill [1] |readlink [2] |setuid [2] | 867 |------------+-------------+------------+-----------------------+-------------| 868 |__xstat [1] |flock [1] |killpg [2] |readv [2] |sleep [2] | 869 |------------+-------------+------------+-----------------------+-------------| 870 |access [2] |fork [2] |lchown [2] |rename [2] |statvfs [2] | 871 |------------+-------------+------------+-----------------------+-------------| 872 |acct [1] |fstatvfs [2] |link [2] |rmdir [2] |stime [1] | 873 |------------+-------------+------------+-----------------------+-------------| 874 |alarm [2] |fsync [2] |lockf [2] |sbrk [4] |symlink [2] | 875 |------------+-------------+------------+-----------------------+-------------| 876 |brk [4] |ftime [2] |lseek [2] |sched_get_priority_max |sync [2] | 877 | | | |[2] | | 878 |------------+-------------+------------+-----------------------+-------------| 879 |chdir [2] |ftruncate [2]|mkdir [2] |sched_get_priority_min |sysconf [2] | 880 | | | |[2] | | 881 |------------+-------------+------------+-----------------------+-------------| 882 |chmod [2] |getcontext |mkfifo [2] |sched_getparam [2] |time [2] | 883 | |[2] | | | | 884 |------------+-------------+------------+-----------------------+-------------| 885 |chown [2] |getegid [2] |mlock [2] |sched_getscheduler [2] |times [2] | 886 |------------+-------------+------------+-----------------------+-------------| 887 |chroot [4] |geteuid [2] |mlockall [2]|sched_rr_get_interval |truncate [2] | 888 | | | |[2] | | 889 |------------+-------------+------------+-----------------------+-------------| 890 |clock [2] |getgid [2] |mmap [2] |sched_setparam [2] |ulimit [2] | 891 |------------+-------------+------------+-----------------------+-------------| 892 |close [2] |getgroups [2]|mprotect [2]|sched_setscheduler [2] |umask [2] | 893 |------------+-------------+------------+-----------------------+-------------| 894 |closedir [2]|getitimer [2]|msync [2] |sched_yield [2] |uname [2] | 895 |------------+-------------+------------+-----------------------+-------------| 896 |creat [1] |getloadavg |munlock [2] |select [2] |unlink [1] | 897 | |[1] | | | | 898 |------------+-------------+------------+-----------------------+-------------| 899 |dup [2] |getpagesize |munlockall |setcontext [2] |utime [2] | 900 | |[4] |[2] | | | 901 |------------+-------------+------------+-----------------------+-------------| 902 |dup2 [2] |getpgid [2] |munmap [2] |setegid [2] |utimes [2] | 903 |------------+-------------+------------+-----------------------+-------------| 904 |execl [2] |getpgrp [2] |nanosleep |seteuid [2] |vfork [2] | 905 | | |[2] | | | 906 |------------+-------------+------------+-----------------------+-------------| 907 |execle [2] |getpid [2] |nice [2] |setgid [2] |wait [2] | 908 |------------+-------------+------------+-----------------------+-------------| 909 |execlp [2] |getppid [2] |open [1] |setitimer [2] |wait3 [1] | 910 |------------+-------------+------------+-----------------------+-------------| 911 |execv [2] |getpriority |opendir [2] |setpgid [2] |wait4 [1] | 912 | |[2] | | | | 913 |------------+-------------+------------+-----------------------+-------------| 914 |execve [2] |getrlimit [2]|pathconf [2]|setpgrp [2] |waitpid [1] | 915 |------------+-------------+------------+-----------------------+-------------| 916 |execvp [2] |getrusage [2]|pause [2] |setpriority [2] |write [2] | 917 |------------+-------------+------------+-----------------------+-------------| 918 |exit [2] |getsid [2] |pipe [2] |setregid [2] |writev [2] | 919 |------------+-------------+------------+-----------------------+-------------| 920 |fchdir [2] |getuid [2] |poll [2] |setreuid [2] | | 921 +-----------------------------------------------------------------------------+ 922 923 Referenced Specification(s) 924 925 [1]. this specification 926 927 [2]. ISO POSIX (2003) 928 929 [3]. Large File Support 930 931 [4]. SUSv2 932 933 ------------------------------------------------------------------------------- 934 935 Standard I/O 936 937 ------------------------------------------------------------------------------- 938 939 Interfaces for Standard I/O 940 941 An LSB conforming implementation shall provide the generic functions for 942 Standard I/O specified in Table 7-4, with the full functionality as described 943 in the referenced underlying specification. 944 945 Table 7-4. libc - Standard I/O Function Interfaces 946 947 +-----------------------------------------------------------------------------+ 948 |_IO_feof [1] |fgetpos [2] |fsetpos [2] |putchar [2] |sscanf [2] | 949 |---------------+---------------+----------------+----------------+-----------| 950 |_IO_getc [1] |fgets [2] |ftell [2] |putchar_unlocked|telldir [2]| 951 | | | |[2] | | 952 |---------------+---------------+----------------+----------------+-----------| 953 |_IO_putc [1] |fgetwc_unlocked|ftello [2] |puts [2] |tempnam [2]| 954 | |[1] | | | | 955 |---------------+---------------+----------------+----------------+-----------| 956 |_IO_puts [1] |fileno [2] |fwrite [2] |putw [3] |ungetc [2] | 957 |---------------+---------------+----------------+----------------+-----------| 958 |asprintf [1] |flockfile [2] |getc [2] |remove [2] |vasprintf | 959 | | | | |[1] | 960 |---------------+---------------+----------------+----------------+-----------| 961 |clearerr [2] |fopen [1] |getc_unlocked |rewind [2] |vdprintf | 962 | | |[2] | |[1] | 963 |---------------+---------------+----------------+----------------+-----------| 964 |ctermid [2] |fprintf [2] |getchar [2] |rewinddir [2] |vfprintf | 965 | | | | |[2] | 966 |---------------+---------------+----------------+----------------+-----------| 967 |fclose [2] |fputc [2] |getchar_unlocked|scanf [2] |vprintf [2]| 968 | | |[2] | | | 969 |---------------+---------------+----------------+----------------+-----------| 970 |fdopen [2] |fputs [2] |getw [3] |seekdir [2] |vsnprintf | 971 | | | | |[2] | 972 |---------------+---------------+----------------+----------------+-----------| 973 |feof [2] |fread [2] |pclose [2] |setbuf [2] |vsprintf | 974 | | | | |[2] | 975 |---------------+---------------+----------------+----------------+-----------| 976 |ferror [2] |freopen [1] |popen [2] |setbuffer [1] | | 977 |---------------+---------------+----------------+----------------+-----------| 978 |fflush [2] |fscanf [2] |printf [2] |setvbuf [2] | | 979 |---------------+---------------+----------------+----------------+-----------| 980 |fflush_unlocked|fseek [2] |putc [2] |snprintf [2] | | 981 |[1] | | | | | 982 |---------------+---------------+----------------+----------------+-----------| 983 |fgetc [2] |fseeko [2] |putc_unlocked |sprintf [2] | | 984 | | |[2] | | | 985 +-----------------------------------------------------------------------------+ 986 987 Referenced Specification(s) 988 989 [1]. this specification 990 991 [2]. ISO POSIX (2003) 992 993 [3]. SUSv2 994 995 An LSB conforming implementation shall provide the generic data interfaces for 996 Standard I/O specified in Table 7-5, with the full functionality as described 997 in the referenced underlying specification. 998 999 Table 7-5. libc - Standard I/O Data Interfaces 1000 1001 +-----------------------------------+ 1002 |stderr [1]|stdin [1]|stdout [1]| | | 1003 +-----------------------------------+ 1004 1005 Referenced Specification(s) 1006 1007 [1]. ISO POSIX (2003) 1008 1009 ------------------------------------------------------------------------------- 1010 1011 Signal Handling 1012 1013 ------------------------------------------------------------------------------- 1014 1015 Interfaces for Signal Handling 1016 1017 An LSB conforming implementation shall provide the generic functions for Signal 1018 Handling specified in Table 7-6, with the full functionality as described in 1019 the referenced underlying specification. 1020 1021 Table 7-6. libc - Signal Handling Function Interfaces 1022 1023 +-----------------------------------------------------------------------------+ 1024 |__libc_current_sigrtmax|sigaddset |sighold [2] |sigpause [2]|sigsuspend | 1025 |[1] |[2] | | |[2] | 1026 |-----------------------+------------+-------------+------------+-------------| 1027 |__libc_current_sigrtmin|sigaltstack |sigignore [2]|sigpending |sigtimedwait | 1028 |[1] |[2] | |[2] |[2] | 1029 |-----------------------+------------+-------------+------------+-------------| 1030 |__sigsetjmp [1] |sigandset |siginterrupt |sigprocmask |sigwait [2] | 1031 | |[1] |[2] |[2] | | 1032 |-----------------------+------------+-------------+------------+-------------| 1033 |__sysv_signal [1] |sigblock [1]|sigisemptyset|sigqueue [2]|sigwaitinfo | 1034 | | |[1] | |[2] | 1035 |-----------------------+------------+-------------+------------+-------------| 1036 |bsd_signal [2] |sigdelset |sigismember |sigrelse [2]| | 1037 | |[2] |[2] | | | 1038 |-----------------------+------------+-------------+------------+-------------| 1039 |psignal [1] |sigemptyset |siglongjmp |sigreturn | | 1040 | |[2] |[2] |[1] | | 1041 |-----------------------+------------+-------------+------------+-------------| 1042 |raise [2] |sigfillset |signal [2] |sigset [2] | | 1043 | |[2] | | | | 1044 |-----------------------+------------+-------------+------------+-------------| 1045 |sigaction [2] |siggetmask |sigorset [1] |sigstack [3]| | 1046 | |[1] | | | | 1047 +-----------------------------------------------------------------------------+ 1048 1049 Referenced Specification(s) 1050 1051 [1]. this specification 1052 1053 [2]. ISO POSIX (2003) 1054 1055 [3]. SUSv2 1056 1057 An LSB conforming implementation shall provide the generic data interfaces for 1058 Signal Handling specified in Table 7-7, with the full functionality as 1059 described in the referenced underlying specification. 1060 1061 Table 7-7. libc - Signal Handling Data Interfaces 1062 1063 +-------------------------+ 1064 |_sys_siglist [1] | | | | | 1065 +-------------------------+ 1066 1067 Referenced Specification(s) 1068 1069 [1]. this specification 1070 1071 ------------------------------------------------------------------------------- 1072 1073 Localization Functions 1074 1075 ------------------------------------------------------------------------------- 1076 1077 Interfaces for Localization Functions 1078 1079 An LSB conforming implementation shall provide the generic functions for 1080 Localization Functions specified in Table 7-8, with the full functionality as 1081 described in the referenced underlying specification. 1082 1083 Table 7-8. libc - Localization Functions Function Interfaces 1084 1085 +-----------------------------------------------------------------------------+ 1086 |bind_textdomain_codeset|catopen [2] |dngettext [1]|iconv_open |setlocale | 1087 |[1] | | |[2] |[2] | 1088 |-----------------------+------------+-------------+-------------+------------| 1089 |bindtextdomain [1] |dcgettext |gettext [1] |localeconv |textdomain | 1090 | |[1] | |[2] |[1] | 1091 |-----------------------+------------+-------------+-------------+------------| 1092 |catclose [2] |dcngettext |iconv [2] |ngettext [1] | | 1093 | |[1] | | | | 1094 |-----------------------+------------+-------------+-------------+------------| 1095 |catgets [2] |dgettext [1]|iconv_close |nl_langinfo | | 1096 | | |[2] |[2] | | 1097 +-----------------------------------------------------------------------------+ 1098 1099 Referenced Specification(s) 1100 1101 [1]. this specification 1102 1103 [2]. ISO POSIX (2003) 1104 1105 An LSB conforming implementation shall provide the generic data interfaces for 1106 Localization Functions specified in Table 7-9, with the full functionality as 1107 described in the referenced underlying specification. 1108 1109 Table 7-9. libc - Localization Functions Data Interfaces 1110 1111 +-----------------------------+ 1112 |_nl_msg_cat_cntr [1] | | | | | 1113 +-----------------------------+ 1114 1115 Referenced Specification(s) 1116 1117 [1]. this specification 1118 1119 ------------------------------------------------------------------------------- 1120 1121 Socket Interface 1122 1123 ------------------------------------------------------------------------------- 1124 1125 Interfaces for Socket Interface 1126 1127 An LSB conforming implementation shall provide the generic functions for Socket 1128 Interface specified in Table 7-10, with the full functionality as described in 1129 the referenced underlying specification. 1130 1131 Table 7-10. libc - Socket Interface Function Interfaces 1132 1133 +-----------------------------------------------------------------------------+ 1134 |__h_errno_location |gethostid [2] |listen [2] |sendmsg [2] |socketpair | 1135 |[1] | | | |[2] | 1136 |---------------------+--------------+------------+-------------+-------------| 1137 |accept [2] |gethostname |recv [2] |sendto [2] | | 1138 | |[2] | | | | 1139 |---------------------+--------------+------------+-------------+-------------| 1140 |bind [2] |getpeername |recvfrom [2]|setsockopt | | 1141 | |[2] | |[1] | | 1142 |---------------------+--------------+------------+-------------+-------------| 1143 |bindresvport [1] |getsockname |recvmsg [2] |shutdown [2] | | 1144 | |[2] | | | | 1145 |---------------------+--------------+------------+-------------+-------------| 1146 |connect [2] |getsockopt [2]|send [2] |socket [2] | | 1147 +-----------------------------------------------------------------------------+ 1148 1149 Referenced Specification(s) 1150 1151 [1]. this specification 1152 1153 [2]. ISO POSIX (2003) 1154 1155 An LSB conforming implementation shall provide the generic deprecated functions 1156 for Socket Interface specified in Table 7-11, with the full functionality as 1157 described in the referenced underlying specification. 1158 1159 Note: These interfaces are deprecated, and applications should avoid using 1160 them. These interfaces may be withdrawn in future releases of this 1161 specification. 1162 1163 Table 7-11. libc - Socket Interface Deprecated Function Interfaces 1164 1165 +----------------------------+ 1166 |gethostbyname_r [1] | | | | | 1167 +----------------------------+ 1168 1169 Referenced Specification(s) 1170 1171 [1]. this specification 1172 1173 ------------------------------------------------------------------------------- 1174 1175 Wide Characters 1176 1177 ------------------------------------------------------------------------------- 1178 1179 Interfaces for Wide Characters 1180 1181 An LSB conforming implementation shall provide the generic functions for Wide 1182 Characters specified in Table 7-12, with the full functionality as described in 1183 the referenced underlying specification. 1184 1185 Table 7-12. libc - Wide Characters Function Interfaces 1186 1187 +-----------------------------------------------------------------------------+ 1188 |__wcstod_internal [1]|mbsinit [2] |vwscanf [2] |wcsnlen [1] |wcstoumax | 1189 | | | | |[2] | 1190 |---------------------+-------------+--------------+-------------+------------| 1191 |__wcstof_internal [1]|mbsnrtowcs |wcpcpy [1] |wcsnrtombs |wcstouq [1] | 1192 | |[1] | |[1] | | 1193 |---------------------+-------------+--------------+-------------+------------| 1194 |__wcstol_internal [1]|mbsrtowcs [2]|wcpncpy [1] |wcspbrk [2] |wcswcs [2] | 1195 |---------------------+-------------+--------------+-------------+------------| 1196 |__wcstold_internal |mbstowcs [2] |wcrtomb [2] |wcsrchr [2] |wcswidth [2]| 1197 |[1] | | | | | 1198 |---------------------+-------------+--------------+-------------+------------| 1199 |__wcstoul_internal |mbtowc [2] |wcscasecmp [1]|wcsrtombs [2]|wcsxfrm [2] | 1200 |[1] | | | | | 1201 |---------------------+-------------+--------------+-------------+------------| 1202 |btowc [2] |putwc [2] |wcscat [2] |wcsspn [2] |wctob [2] | 1203 |---------------------+-------------+--------------+-------------+------------| 1204 |fgetwc [2] |putwchar [2] |wcschr [2] |wcsstr [2] |wctomb [2] | 1205 |---------------------+-------------+--------------+-------------+------------| 1206 |fgetws [2] |swprintf [2] |wcscmp [2] |wcstod [2] |wctrans [2] | 1207 |---------------------+-------------+--------------+-------------+------------| 1208 |fputwc [2] |swscanf [2] |wcscoll [2] |wcstof [2] |wctype [2] | 1209 |---------------------+-------------+--------------+-------------+------------| 1210 |fputws [2] |towctrans [2]|wcscpy [2] |wcstoimax [2]|wcwidth [2] | 1211 |---------------------+-------------+--------------+-------------+------------| 1212 |fwide [2] |towlower [2] |wcscspn [2] |wcstok [2] |wmemchr [2] | 1213 |---------------------+-------------+--------------+-------------+------------| 1214 |fwprintf [2] |towupper [2] |wcsdup [1] |wcstol [2] |wmemcmp [2] | 1215 |---------------------+-------------+--------------+-------------+------------| 1216 |fwscanf [2] |ungetwc [2] |wcsftime [2] |wcstold [2] |wmemcpy [2] | 1217 |---------------------+-------------+--------------+-------------+------------| 1218 |getwc [2] |vfwprintf [2]|wcslen [2] |wcstoll [2] |wmemmove [2]| 1219 |---------------------+-------------+--------------+-------------+------------| 1220 |getwchar [2] |vfwscanf [2] |wcsncasecmp |wcstombs [2] |wmemset [2] | 1221 | | |[1] | | | 1222 |---------------------+-------------+--------------+-------------+------------| 1223 |mblen [2] |vswprintf [2]|wcsncat [2] |wcstoq [1] |wprintf [2] | 1224 |---------------------+-------------+--------------+-------------+------------| 1225 |mbrlen [2] |vswscanf [2] |wcsncmp [2] |wcstoul [2] |wscanf [2] | 1226 |---------------------+-------------+--------------+-------------+------------| 1227 |mbrtowc [2] |vwprintf [2] |wcsncpy [2] |wcstoull [2] | | 1228 +-----------------------------------------------------------------------------+ 1229 1230 Referenced Specification(s) 1231 1232 [1]. this specification 1233 1234 [2]. ISO POSIX (2003) 1235 1236 ------------------------------------------------------------------------------- 1237 1238 String Functions 1239 1240 ------------------------------------------------------------------------------- 1241 1242 Interfaces for String Functions 1243 1244 An LSB conforming implementation shall provide the generic functions for String 1245 Functions specified in Table 7-13, with the full functionality as described in 1246 the referenced underlying specification. 1247 1248 Table 7-13. libc - String Functions Function Interfaces 1249 1250 +-----------------------------------------------------------------------------+ 1251 |__mempcpy [1] |bzero [2] |strcasestr |strncasecmp |strtoimax [2]| 1252 | | |[1] |[2] | | 1253 |---------------------+-------------+-------------+-------------+-------------| 1254 |__rawmemchr [1] |ffs [2] |strcat [2] |strncat [2] |strtok [2] | 1255 |---------------------+-------------+-------------+-------------+-------------| 1256 |__stpcpy [1] |index [2] |strchr [2] |strncmp [2] |strtok_r [2] | 1257 |---------------------+-------------+-------------+-------------+-------------| 1258 |__strdup [1] |memccpy [2] |strcmp [2] |strncpy [2] |strtold [2] | 1259 |---------------------+-------------+-------------+-------------+-------------| 1260 |__strtod_internal [1]|memchr [2] |strcoll [2] |strndup [1] |strtoll [2] | 1261 |---------------------+-------------+-------------+-------------+-------------| 1262 |__strtof_internal [1]|memcmp [2] |strcpy [2] |strnlen [1] |strtoq [1] | 1263 |---------------------+-------------+-------------+-------------+-------------| 1264 |__strtok_r [1] |memcpy [2] |strcspn [2] |strpbrk [2] |strtoull [2] | 1265 |---------------------+-------------+-------------+-------------+-------------| 1266 |__strtol_internal [1]|memmove [2] |strdup [2] |strptime [1] |strtoumax [2]| 1267 |---------------------+-------------+-------------+-------------+-------------| 1268 |__strtold_internal |memrchr [1] |strerror [2] |strrchr [2] |strtouq [1] | 1269 |[1] | | | | | 1270 |---------------------+-------------+-------------+-------------+-------------| 1271 |__strtoll_internal |memset [2] |strerror_r |strsep [1] |strverscmp | 1272 |[1] | |[1] | |[1] | 1273 |---------------------+-------------+-------------+-------------+-------------| 1274 |__strtoul_internal |rindex [2] |strfmon [2] |strsignal [1]|strxfrm [2] | 1275 |[1] | | | | | 1276 |---------------------+-------------+-------------+-------------+-------------| 1277 |__strtoull_internal |stpcpy [1] |strfry [1] |strspn [2] |swab [2] | 1278 |[1] | | | | | 1279 |---------------------+-------------+-------------+-------------+-------------| 1280 |bcmp [2] |stpncpy [1] |strftime [2] |strstr [2] | | 1281 |---------------------+-------------+-------------+-------------+-------------| 1282 |bcopy [2] |strcasecmp |strlen [2] |strtof [2] | | 1283 | |[2] | | | | 1284 +-----------------------------------------------------------------------------+ 1285 1286 Referenced Specification(s) 1287 1288 [1]. this specification 1289 1290 [2]. ISO POSIX (2003) 1291 1292 ------------------------------------------------------------------------------- 1293 1294 IPC Functions 1295 1296 ------------------------------------------------------------------------------- 1297 1298 Interfaces for IPC Functions 1299 1300 An LSB conforming implementation shall provide the generic functions for IPC 1301 Functions specified in Table 7-14, with the full functionality as described in 1302 the referenced underlying specification. 1303 1304 Table 7-14. libc - IPC Functions Function Interfaces 1305 1306 +---------------------------------------------+ 1307 |ftok [1] |msgrcv [1]|semget [1]|shmctl [1]| | 1308 |----------+----------+----------+----------+-| 1309 |msgctl [1]|msgsnd [1]|semop [1] |shmdt [1] | | 1310 |----------+----------+----------+----------+-| 1311 |msgget [1]|semctl [1]|shmat [1] |shmget [1]| | 1312 +---------------------------------------------+ 1313 1314 Referenced Specification(s) 1315 1316 [1]. ISO POSIX (2003) 1317 1318 ------------------------------------------------------------------------------- 1319 1320 Regular Expressions 1321 1322 ------------------------------------------------------------------------------- 1323 1324 Interfaces for Regular Expressions 1325 1326 An LSB conforming implementation shall provide the generic functions for 1327 Regular Expressions specified in Table 7-15, with the full functionality as 1328 described in the referenced underlying specification. 1329 1330 Table 7-15. libc - Regular Expressions Function Interfaces 1331 1332 +--------------------------------------------------+ 1333 |regcomp [1]|regerror [1]|regexec [1]|regfree [1]| | 1334 +--------------------------------------------------+ 1335 1336 Referenced Specification(s) 1337 1338 [1]. ISO POSIX (2003) 1339 1340 An LSB conforming implementation shall provide the generic deprecated functions 1341 for Regular Expressions specified in Table 7-16, with the full functionality as 1342 described in the referenced underlying specification. 1343 1344 Note: These interfaces are deprecated, and applications should avoid using 1345 them. These interfaces may be withdrawn in future releases of this 1346 specification. 1347 1348 Table 7-16. libc - Regular Expressions Deprecated Function Interfaces 1349 1350 +----------------------------------------------+ 1351 |advance [1]|re_comp [1]|re_exec [1]|step [1]| | 1352 +----------------------------------------------+ 1353 1354 Referenced Specification(s) 1355 1356 [1]. SUSv2 1357 1358 An LSB conforming implementation shall provide the generic deprecated data 1359 interfaces for Regular Expressions specified in Table 7-17, with the full 1360 functionality as described in the referenced underlying specification. 1361 1362 Note: These interfaces are deprecated, and applications should avoid using 1363 them. These interfaces may be withdrawn in future releases of this 1364 specification. 1365 1366 Table 7-17. libc - Regular Expressions Deprecated Data Interfaces 1367 1368 +------------------------------+ 1369 |loc1 [1]|loc2 [1]|locs [1]| | | 1370 +------------------------------+ 1371 1372 Referenced Specification(s) 1373 1374 [1]. SUSv2 1375 1376 ------------------------------------------------------------------------------- 1377 1378 Character Type Functions 1379 1380 ------------------------------------------------------------------------------- 1381 1382 Interfaces for Character Type Functions 1383 1384 An LSB conforming implementation shall provide the generic functions for 1385 Character Type Functions specified in Table 7-18, with the full functionality 1386 as described in the referenced underlying specification. 1387 1388 Table 7-18. libc - Character Type Functions Function Interfaces 1389 1390 +-----------------------------------------------------------------------------+ 1391 |__ctype_b_loc(GLIBC_2.3) [1] |isalpha |ispunct [2]|iswctype |iswupper | 1392 | |[2] | |[2] |[2] | 1393 |------------------------------+----------+-----------+-----------+-----------| 1394 |__ctype_get_mb_cur_max [1] |isascii |isspace [2]|iswdigit |iswxdigit | 1395 | |[2] | |[2] |[2] | 1396 |------------------------------+----------+-----------+-----------+-----------| 1397 |__ctype_tolower_loc(GLIBC_2.3)|iscntrl |isupper [2]|iswgraph |isxdigit | 1398 |[1] |[2] | |[2] |[2] | 1399 |------------------------------+----------+-----------+-----------+-----------| 1400 |__ctype_toupper_loc(GLIBC_2.3)|isdigit |iswalnum |iswlower |toascii [2]| 1401 |[1] |[2] |[2] |[2] | | 1402 |------------------------------+----------+-----------+-----------+-----------| 1403 |_tolower [2] |isgraph |iswalpha |iswprint |tolower [2]| 1404 | |[2] |[2] |[2] | | 1405 |------------------------------+----------+-----------+-----------+-----------| 1406 |_toupper [2] |islower |iswblank |iswpunct |toupper [2]| 1407 | |[2] |[2] |[2] | | 1408 |------------------------------+----------+-----------+-----------+-----------| 1409 |isalnum [2] |isprint |iswcntrl |iswspace | | 1410 | |[2] |[2] |[2] | | 1411 +-----------------------------------------------------------------------------+ 1412 1413 Referenced Specification(s) 1414 1415 [1]. this specification 1416 1417 [2]. ISO POSIX (2003) 1418 1419 ------------------------------------------------------------------------------- 1420 1421 Time Manipulation 1422 1423 ------------------------------------------------------------------------------- 1424 1425 Interfaces for Time Manipulation 1426 1427 An LSB conforming implementation shall provide the generic functions for Time 1428 Manipulation specified in Table 7-19, with the full functionality as described 1429 in the referenced underlying specification. 1430 1431 Table 7-19. libc - Time Manipulation Function Interfaces 1432 1433 +-------------------------------------------------------------------+ 1434 |adjtime [1] |ctime [2] |gmtime [2] |localtime_r [2]|ualarm [2]| 1435 |-------------+------------+-------------+---------------+----------| 1436 |asctime [2] |ctime_r [2] |gmtime_r [2] |mktime [2] | | 1437 |-------------+------------+-------------+---------------+----------| 1438 |asctime_r [2]|difftime [2]|localtime [2]|tzset [2] | | 1439 +-------------------------------------------------------------------+ 1440 1441 Referenced Specification(s) 1442 1443 [1]. this specification 1444 1445 [2]. ISO POSIX (2003) 1446 1447 An LSB conforming implementation shall provide the generic deprecated functions 1448 for Time Manipulation specified in Table 7-20, with the full functionality as 1449 described in the referenced underlying specification. 1450 1451 Note: These interfaces are deprecated, and applications should avoid using 1452 them. These interfaces may be withdrawn in future releases of this 1453 specification. 1454 1455 Table 7-20. libc - Time Manipulation Deprecated Function Interfaces 1456 1457 +---------------------+ 1458 |adjtimex [1] | | | | | 1459 +---------------------+ 1460 1461 Referenced Specification(s) 1462 1463 [1]. this specification 1464 1465 An LSB conforming implementation shall provide the generic data interfaces for 1466 Time Manipulation specified in Table 7-21, with the full functionality as 1467 described in the referenced underlying specification. 1468 1469 Table 7-21. libc - Time Manipulation Data Interfaces 1470 1471 +--------------------------------------------+ 1472 |__daylight [1]|__tzname [1]|timezone [2]| | | 1473 |--------------+------------+------------+-+-| 1474 |__timezone [1]|daylight [2]|tzname [2] | | | 1475 +--------------------------------------------+ 1476 1477 Referenced Specification(s) 1478 1479 [1]. this specification 1480 1481 [2]. ISO POSIX (2003) 1482 1483 ------------------------------------------------------------------------------- 1484 1485 Terminal Interface Functions 1486 1487 ------------------------------------------------------------------------------- 1488 1489 Interfaces for Terminal Interface Functions 1490 1491 An LSB conforming implementation shall provide the generic functions for 1492 Terminal Interface Functions specified in Table 7-22, with the full 1493 functionality as described in the referenced underlying specification. 1494 1495 Table 7-22. libc - Terminal Interface Functions Function Interfaces 1496 1497 +-------------------------------------------------------------------------+ 1498 |cfgetispeed [1]|cfsetispeed [1]|tcdrain [1]|tcgetattr [1]|tcsendbreak [1]| 1499 |---------------+---------------+-----------+-------------+---------------| 1500 |cfgetospeed [1]|cfsetospeed [1]|tcflow [1] |tcgetpgrp [1]|tcsetattr [1] | 1501 |---------------+---------------+-----------+-------------+---------------| 1502 |cfmakeraw [2] |cfsetspeed [2] |tcflush [1]|tcgetsid [1] |tcsetpgrp [1] | 1503 +-------------------------------------------------------------------------+ 1504 1505 Referenced Specification(s) 1506 1507 [1]. ISO POSIX (2003) 1508 1509 [2]. this specification 1510 1511 ------------------------------------------------------------------------------- 1512 1513 System Database Interface 1514 1515 ------------------------------------------------------------------------------- 1516 1517 Interfaces for System Database Interface 1518 1519 An LSB conforming implementation shall provide the generic functions for System 1520 Database Interface specified in Table 7-23, with the full functionality as 1521 described in the referenced underlying specification. 1522 1523 Table 7-23. libc - System Database Interface Function Interfaces 1524 1525 +-----------------------------------------------------------------------------+ 1526 |endgrent [1] |getgrgid [1] |getprotobynumber |getservbyport |setgrent [1] | 1527 | | |[1] |[1] | | 1528 |-------------+---------------+-----------------+---------------+-------------| 1529 |endnetent [1]|getgrgid_r [1] |getprotoent [1] |getservent [1] |setgroups [2]| 1530 |-------------+---------------+-----------------+---------------+-------------| 1531 |endprotoent |getgrnam [1] |getpwent [1] |getutent [2] |setnetent [1]| 1532 |[1] | | | | | 1533 |-------------+---------------+-----------------+---------------+-------------| 1534 |endpwent [1] |getgrnam_r [1] |getpwnam [1] |getutent_r [2] |setprotoent | 1535 | | | | |[1] | 1536 |-------------+---------------+-----------------+---------------+-------------| 1537 |endservent |gethostbyaddr |getpwnam_r [1] |getutxent [1] |setpwent [1] | 1538 |[1] |[1] | | | | 1539 |-------------+---------------+-----------------+---------------+-------------| 1540 |endutent [3] |gethostbyname |getpwuid [1] |getutxid [1] |setservent | 1541 | |[1] | | |[1] | 1542 |-------------+---------------+-----------------+---------------+-------------| 1543 |endutxent [1]|getnetbyaddr |getpwuid_r [1] |getutxline [1] |setutent [2] | 1544 | |[1] | | | | 1545 |-------------+---------------+-----------------+---------------+-------------| 1546 |getgrent [1] |getprotobyname |getservbyname [1]|pututxline [1] |setutxent [1]| 1547 | |[1] | | | | 1548 +-----------------------------------------------------------------------------+ 1549 1550 Referenced Specification(s) 1551 1552 [1]. ISO POSIX (2003) 1553 1554 [2]. this specification 1555 1556 [3]. SUSv2 1557 1558 ------------------------------------------------------------------------------- 1559 1560 Language Support 1561 1562 ------------------------------------------------------------------------------- 1563 1564 Interfaces for Language Support 1565 1566 An LSB conforming implementation shall provide the generic functions for 1567 Language Support specified in Table 7-24, with the full functionality as 1568 described in the referenced underlying specification. 1569 1570 Table 7-24. libc - Language Support Function Interfaces 1571 1572 +---------------------------------------------------------------------------------+ 1573 |__libc_start_main|__register_atfork|_obstack_begin|_obstack_newchunk|obstack_free| 1574 |[1] |(GLIBC_2.3.2) [1]|[1] |[1] |[1] | 1575 +---------------------------------------------------------------------------------+ 1576 1577 Referenced Specification(s) 1578 1579 [1]. this specification 1580 1581 ------------------------------------------------------------------------------- 1582 1583 Large File Support 1584 1585 ------------------------------------------------------------------------------- 1586 1587 Interfaces for Large File Support 1588 1589 An LSB conforming implementation shall provide the generic functions for Large 1590 File Support specified in Table 7-25, with the full functionality as described 1591 in the referenced underlying specification. 1592 1593 Table 7-25. libc - Large File Support Function Interfaces 1594 1595 +--------------------------------------------------------------------------+ 1596 |__fxstat64 [1]|fopen64 [2] |ftello64 [2] |lseek64 [2] |readdir64 [2] | 1597 |--------------+--------------+---------------+-------------+--------------| 1598 |__lxstat64 [1]|freopen64 [2] |ftruncate64 [2]|mkstemp64 [2]|statvfs64 [2] | 1599 |--------------+--------------+---------------+-------------+--------------| 1600 |__xstat64 [1] |fseeko64 [2] |ftw64 [2] |mmap64 [2] |tmpfile64 [2] | 1601 |--------------+--------------+---------------+-------------+--------------| 1602 |creat64 [2] |fsetpos64 [2] |getrlimit64 [2]|nftw64 [2] |truncate64 [2]| 1603 |--------------+--------------+---------------+-------------+--------------| 1604 |fgetpos64 [2] |fstatvfs64 [2]|lockf64 [2] |open64 [2] | | 1605 +--------------------------------------------------------------------------+ 1606 1607 Referenced Specification(s) 1608 1609 [1]. this specification 1610 1611 [2]. Large File Support 1612 1613 ------------------------------------------------------------------------------- 1614 1615 Standard Library 1616 1617 ------------------------------------------------------------------------------- 1618 1619 Interfaces for Standard Library 1620 1621 An LSB conforming implementation shall provide the generic functions for 1622 Standard Library specified in Table 7-26, with the full functionality as 1623 described in the referenced underlying specification. 1624 1625 Table 7-26. libc - Standard Library Function Interfaces 1626 1627 +-----------------------------------------------------------------------------+ 1628 |_Exit [1] |dirname [1] |glob [1] |lsearch [1] |srand [1] | 1629 |-----------------+-----------------+------------+---------------+------------| 1630 |__assert_fail [2]|div [1] |glob64 [2] |makecontext [1]|srand48 [1] | 1631 |-----------------+-----------------+------------+---------------+------------| 1632 |__cxa_atexit [2] |drand48 [1] |globfree [1]|malloc [1] |srandom [1] | 1633 |-----------------+-----------------+------------+---------------+------------| 1634 |__errno_location |ecvt [1] |globfree64 |memmem [2] |strtod [1] | 1635 |[2] | |[2] | | | 1636 |-----------------+-----------------+------------+---------------+------------| 1637 |__fpending [2] |erand48 [1] |grantpt [1] |mkstemp [1] |strtol [1] | 1638 |-----------------+-----------------+------------+---------------+------------| 1639 |__getpagesize [2]|err [2] |hcreate [1] |mktemp [1] |strtoul [1] | 1640 |-----------------+-----------------+------------+---------------+------------| 1641 |__isinf [2] |error [2] |hdestroy [1]|mrand48 [1] |swapcontext | 1642 | | | | |[1] | 1643 |-----------------+-----------------+------------+---------------+------------| 1644 |__isinff [2] |errx [2] |hsearch [1] |nftw [1] |syslog [1] | 1645 |-----------------+-----------------+------------+---------------+------------| 1646 |__isinfl [2] |fcvt [1] |htonl [1] |nrand48 [1] |system [2] | 1647 |-----------------+-----------------+------------+---------------+------------| 1648 |__isnan [2] |fmtmsg [1] |htons [1] |ntohl [1] |tdelete [1] | 1649 |-----------------+-----------------+------------+---------------+------------| 1650 |__isnanf [2] |fnmatch [1] |imaxabs [1] |ntohs [1] |tfind [1] | 1651 |-----------------+-----------------+------------+---------------+------------| 1652 |__isnanl [2] |fpathconf [1] |imaxdiv [1] |openlog [1] |tmpfile [1] | 1653 |-----------------+-----------------+------------+---------------+------------| 1654 |__sysconf [2] |free [1] |inet_addr |perror [1] |tmpnam [1] | 1655 | | |[1] | | | 1656 |-----------------+-----------------+------------+---------------+------------| 1657 |_exit [1] |freeaddrinfo [1] |inet_ntoa |posix_memalign |tsearch [1] | 1658 | | |[1] |[1] | | 1659 |-----------------+-----------------+------------+---------------+------------| 1660 |_longjmp [1] |ftrylockfile [1] |inet_ntop |ptsname [1] |ttyname [1] | 1661 | | |[1] | | | 1662 |-----------------+-----------------+------------+---------------+------------| 1663 |_setjmp [1] |ftw [1] |inet_pton |putenv [1] |ttyname_r | 1664 | | |[1] | |[1] | 1665 |-----------------+-----------------+------------+---------------+------------| 1666 |a64l [1] |funlockfile [1] |initstate |qsort [1] |twalk [1] | 1667 | | |[1] | | | 1668 |-----------------+-----------------+------------+---------------+------------| 1669 |abort [1] |gai_strerror [1] |insque [1] |rand [1] |unlockpt [1]| 1670 |-----------------+-----------------+------------+---------------+------------| 1671 |abs [1] |gcvt [1] |isatty [1] |rand_r [1] |unsetenv [1]| 1672 |-----------------+-----------------+------------+---------------+------------| 1673 |atof [1] |getaddrinfo [1] |isblank [1] |random [1] |usleep [1] | 1674 |-----------------+-----------------+------------+---------------+------------| 1675 |atoi [1] |getcwd [1] |jrand48 [1] |random_r [2] |verrx [2] | 1676 |-----------------+-----------------+------------+---------------+------------| 1677 |atol [1] |getdate [1] |l64a [1] |realloc [1] |vfscanf [1] | 1678 |-----------------+-----------------+------------+---------------+------------| 1679 |atoll [1] |getenv [1] |labs [1] |realpath [1] |vscanf [1] | 1680 |-----------------+-----------------+------------+---------------+------------| 1681 |basename [1] |getlogin [1] |lcong48 [1] |remque [1] |vsscanf [1] | 1682 |-----------------+-----------------+------------+---------------+------------| 1683 |bsearch [1] |getnameinfo [1] |ldiv [1] |seed48 [1] |vsyslog [2] | 1684 |-----------------+-----------------+------------+---------------+------------| 1685 |calloc [1] |getopt [2] |lfind [1] |setenv [1] |warn [2] | 1686 |-----------------+-----------------+------------+---------------+------------| 1687 |closelog [1] |getopt_long [2] |llabs [1] |sethostid [2] |warnx [2] | 1688 |-----------------+-----------------+------------+---------------+------------| 1689 |confstr [1] |getopt_long_only |lldiv [1] |sethostname [2]|wordexp [1] | 1690 | |[2] | | | | 1691 |-----------------+-----------------+------------+---------------+------------| 1692 |cuserid [3] |getsubopt [1] |longjmp [1] |setlogmask [1] |wordfree [1]| 1693 |-----------------+-----------------+------------+---------------+------------| 1694 |daemon [2] |gettimeofday [1] |lrand48 [1] |setstate [1] | | 1695 +-----------------------------------------------------------------------------+ 1696 1697 Referenced Specification(s) 1698 1699 [1]. ISO POSIX (2003) 1700 1701 [2]. this specification 1702 1703 [3]. SUSv2 1704 1705 An LSB conforming implementation shall provide the generic data interfaces for 1706 Standard Library specified in Table 7-27, with the full functionality as 1707 described in the referenced underlying specification. 1708 1709 Table 7-27. libc - Standard Library Data Interfaces 1710 1711 +--------------------------------------------------------------------+ 1712 |__environ [1]|_sys_errlist [1]|getdate_err [2]|opterr [1]|optopt [1]| 1713 |-------------+----------------+---------------+----------+----------| 1714 |_environ [1] |environ [2] |optarg [2] |optind [1]| | 1715 +--------------------------------------------------------------------+ 1716 1717 Referenced Specification(s) 1718 1719 [1]. this specification 1720 1721 [2]. ISO POSIX (2003) 1722 1723 ------------------------------------------------------------------------------- 1724 1725 Data Definitions for libc 1726 1727 This section defines global identifiers and their values that are associated 1728 with interfaces contained in libc. These definitions are organized into groups 1729 that correspond to system headers. This convention is used as a convenience for 1730 the reader, and does not imply the existence of these headers, or their 1731 content. 1732 1733 These definitions are intended to supplement those provided in the referenced 1734 underlying specifications. 1735 1736 This specification uses ISO/IEC 9899 C Language as the reference programming 1737 language, and data definitions are specified in ISO C format. The C language is 1738 used here as a convenient notation. Using a C language description of these 1739 data objects does not preclude their use by other programming languages. 1740 1741 ------------------------------------------------------------------------------- 1742 1743 assert.h 1744 1745 The assert.h header shall define the assert macro. It refers to the macro 1746 NDEBUG, which is not defined in this header. If NDEBUG is defined before the 1747 inclusion of this header, the assert macro shall be defined as described below, 1748 otherwise the macro shall behave as described in assert in ISO/IEC 9945 POSIX. 1749 1750 #define assert(expr) ((void)0) 1751 1752 ------------------------------------------------------------------------------- 1753 1754 ctype.h 1755 1756 enum 1757 { 1758 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint, 1759 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 1760 } 1761 ; 1762 1763 ------------------------------------------------------------------------------- 1764 1765 dirent.h 1766 1767 typedef struct __dirstream DIR; 1768 1769 struct dirent 1770 { 1771 long d_ino; 1772 off_t d_off; 1773 unsigned short d_reclen; 1774 unsigned char d_type; 1775 char d_name[256]; 1776 } 1777 ; 1778 struct dirent64 1779 { 1780 uint64_t d_ino; 1781 int64_t d_off; 1782 unsigned short d_reclen; 1783 unsigned char d_type; 1784 char d_name[256]; 1785 } 1786 ; 1787 1788 ------------------------------------------------------------------------------- 1789 1790 errno.h 1791 1792 #define errno (*__errno_location()) 1793 1794 #define EPERM 1 1795 #define ECHILD 10 1796 #define ENETDOWN 100 1797 #define ENETUNREACH 101 1798 #define ENETRESET 102 1799 #define ECONNABORTED 103 1800 #define ECONNRESET 104 1801 #define ENOBUFS 105 1802 #define EISCONN 106 1803 #define ENOTCONN 107 1804 #define ESHUTDOWN 108 1805 #define ETOOMANYREFS 109 1806 #define EAGAIN 11 1807 #define ETIMEDOUT 110 1808 #define ECONNREFUSED 111 1809 #define EHOSTDOWN 112 1810 #define EHOSTUNREACH 113 1811 #define EALREADY 114 1812 #define EINPROGRESS 115 1813 #define ESTALE 116 1814 #define EUCLEAN 117 1815 #define ENOTNAM 118 1816 #define ENAVAIL 119 1817 #define ENOMEM 12 1818 #define EISNAM 120 1819 #define EREMOTEIO 121 1820 #define EDQUOT 122 1821 #define ENOMEDIUM 123 1822 #define EMEDIUMTYPE 124 1823 #define ECANCELED 125 1824 #define EACCES 13 1825 #define EFAULT 14 1826 #define ENOTBLK 15 1827 #define EBUSY 16 1828 #define EEXIST 17 1829 #define EXDEV 18 1830 #define ENODEV 19 1831 #define ENOENT 2 1832 #define ENOTDIR 20 1833 #define EISDIR 21 1834 #define EINVAL 22 1835 #define ENFILE 23 1836 #define EMFILE 24 1837 #define ENOTTY 25 1838 #define ETXTBSY 26 1839 #define EFBIG 27 1840 #define ENOSPC 28 1841 #define ESPIPE 29 1842 #define ESRCH 3 1843 #define EROFS 30 1844 #define EMLINK 31 1845 #define EPIPE 32 1846 #define EDOM 33 1847 #define ERANGE 34 1848 #define EDEADLK 35 1849 #define ENAMETOOLONG 36 1850 #define ENOLCK 37 1851 #define ENOSYS 38 1852 #define ENOTEMPTY 39 1853 #define EINTR 4 1854 #define ELOOP 40 1855 #define ENOMSG 42 1856 #define EIDRM 43 1857 #define ECHRNG 44 1858 #define EL2NSYNC 45 1859 #define EL3HLT 46 1860 #define EL3RST 47 1861 #define ELNRNG 48 1862 #define EUNATCH 49 1863 #define EIO 5 1864 #define ENOANO 55 1865 #define EBADRQC 56 1866 #define EBADSLT 57 1867 #define EBFONT 59 1868 #define ENXIO 6 1869 #define ENOSTR 60 1870 #define ENODATA 61 1871 #define ETIME 62 1872 #define ENOSR 63 1873 #define ENONET 64 1874 #define ENOPKG 65 1875 #define EREMOTE 66 1876 #define ENOLINK 67 1877 #define EADV 68 1878 #define ESRMNT 69 1879 #define E2BIG 7 1880 #define ECOMM 70 1881 #define EPROTO 71 1882 #define EMULTIHOP 72 1883 #define EDOTDOT 73 1884 #define EBADMSG 74 1885 #define EOVERFLOW 75 1886 #define ENOTUNIQ 76 1887 #define EBADFD 77 1888 #define EREMCHG 78 1889 #define ELIBACC 79 1890 #define ENOEXEC 8 1891 #define ELIBBAD 80 1892 #define ELIBSCN 81 1893 #define ELIBMAX 82 1894 #define ELIBEXEC 83 1895 #define EILSEQ 84 1896 #define ERESTART 85 1897 #define ESTRPIPE 86 1898 #define EUSERS 87 1899 #define ENOTSOCK 88 1900 #define EDESTADDRREQ 89 1901 #define EBADF 9 1902 #define EMSGSIZE 90 1903 #define EPROTOTYPE 91 1904 #define ENOPROTOOPT 92 1905 #define EPROTONOSUPPORT 93 1906 #define ESOCKTNOSUPPORT 94 1907 #define EOPNOTSUPP 95 1908 #define EPFNOSUPPORT 96 1909 #define EAFNOSUPPORT 97 1910 #define EADDRINUSE 98 1911 #define EADDRNOTAVAIL 99 1912 #define EWOULDBLOCK EAGAIN 1913 #define ENOTSUP EOPNOTSUPP 1914 1915 ------------------------------------------------------------------------------- 1916 1917 fcntl.h 1918 1919 #define O_RDONLY 00 1920 #define O_ACCMODE 0003 1921 #define O_WRONLY 01 1922 #define O_CREAT 0100 1923 #define O_TRUNC 01000 1924 #define O_SYNC 010000 1925 #define O_RDWR 02 1926 #define O_EXCL 0200 1927 #define O_APPEND 02000 1928 #define O_ASYNC 020000 1929 #define O_NOCTTY 0400 1930 #define O_NDELAY 04000 1931 #define O_NONBLOCK 04000 1932 #define FD_CLOEXEC 1 1933 1934 struct flock 1935 { 1936 short l_type; 1937 short l_whence; 1938 off_t l_start; 1939 off_t l_len; 1940 pid_t l_pid; 1941 } 1942 ; 1943 struct flock64 1944 { 1945 short l_type; 1946 short l_whence; 1947 loff_t l_start; 1948 loff_t l_len; 1949 pid_t l_pid; 1950 } 1951 ; 1952 1953 #define F_DUPFD 0 1954 #define F_RDLCK 0 1955 #define F_GETFD 1 1956 #define F_WRLCK 1 1957 #define F_SETFD 2 1958 #define F_UNLCK 2 1959 #define F_GETFL 3 1960 #define F_SETFL 4 1961 #define F_GETLK 5 1962 #define F_SETLK 6 1963 #define F_SETLKW 7 1964 #define F_SETOWN 8 1965 #define F_GETOWN 9 1966 1967 ------------------------------------------------------------------------------- 1968 1969 fmtmsg.h 1970 1971 #define MM_HARD 1 1972 #define MM_NRECOV 128 1973 #define MM_UTIL 16 1974 #define MM_SOFT 2 1975 #define MM_OPSYS 32 1976 #define MM_FIRM 4 1977 #define MM_RECOVER 64 1978 #define MM_APPL 8 1979 1980 #define MM_NOSEV 0 1981 #define MM_HALT 1 1982 #define MM_ERROR 2 1983 1984 #define MM_NULLLBL ((char *) 0) 1985 1986 ------------------------------------------------------------------------------- 1987 1988 fnmatch.h 1989 1990 #define FNM_PATHNAME (1<<0) 1991 #define FNM_NOESCAPE (1<<1) 1992 #define FNM_PERIOD (1<<2) 1993 #define FNM_NOMATCH 1 1994 1995 ------------------------------------------------------------------------------- 1996 1997 ftw.h 1998 1999 #define FTW_D FTW_D 2000 #define FTW_DNR FTW_DNR 2001 #define FTW_DP FTW_DP 2002 #define FTW_F FTW_F 2003 #define FTW_NS FTW_NS 2004 #define FTW_SL FTW_SL 2005 #define FTW_SLN FTW_SLN 2006 2007 enum 2008 { 2009 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 2010 } 2011 ; 2012 2013 enum 2014 { 2015 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 2016 } 2017 ; 2018 2019 struct FTW 2020 { 2021 int base; 2022 int level; 2023 } 2024 ; 2025 2026 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 2027 int __flag); 2028 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 2029 int __flag); 2030 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 2031 int __flag, struct FTW * __info); 2032 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 2033 int __flag, struct FTW * __info); 2034 2035 ------------------------------------------------------------------------------- 2036 2037 getopt.h 2038 2039 #define no_argument 0 2040 #define required_argument 1 2041 #define optional_argument 2 2042 2043 struct option 2044 { 2045 char *name; 2046 int has_arg; 2047 int *flag; 2048 int val; 2049 } 2050 ; 2051 2052 ------------------------------------------------------------------------------- 2053 2054 glob.h 2055 2056 #define GLOB_ERR (1<<0) 2057 #define GLOB_MARK (1<<1) 2058 #define GLOB_BRACE (1<<10) 2059 #define GLOB_NOMAGIC (1<<11) 2060 #define GLOB_TILDE (1<<12) 2061 #define GLOB_ONLYDIR (1<<13) 2062 #define GLOB_TILDE_CHECK (1<<14) 2063 #define GLOB_NOSORT (1<<2) 2064 #define GLOB_DOOFFS (1<<3) 2065 #define GLOB_NOCHECK (1<<4) 2066 #define GLOB_APPEND (1<<5) 2067 #define GLOB_NOESCAPE (1<<6) 2068 #define GLOB_PERIOD (1<<7) 2069 #define GLOB_MAGCHAR (1<<8) 2070 #define GLOB_ALTDIRFUNC (1<<9) 2071 2072 #define GLOB_NOSPACE 1 2073 #define GLOB_ABORTED 2 2074 #define GLOB_NOMATCH 3 2075 #define GLOB_NOSYS 4 2076 2077 typedef struct 2078 { 2079 size_t gl_pathc; 2080 char **gl_pathv; 2081 size_t gl_offs; 2082 int gl_flags; 2083 void (*gl_closedir) (void *); 2084 struct dirent *(*gl_readdir) (void *); 2085 void *(*gl_opendir) (const char *); 2086 int (*gl_lstat) (const char *, struct stat *); 2087 int (*gl_stat) (const char *, struct stat *); 2088 } 2089 glob_t; 2090 2091 typedef struct 2092 { 2093 size_t gl_pathc; 2094 char **gl_pathv; 2095 size_t gl_offs; 2096 int gl_flags; 2097 void (*gl_closedir) (void *); 2098 struct dirent64 *(*gl_readdir64) (void *); 2099 void *(*gl_opendir) (const char *); 2100 int (*gl_lstat) (const char *, struct stat *); 2101 int (*gl_stat) (const char *, struct stat *); 2102 } 2103 glob64_t; 2104 2105 ------------------------------------------------------------------------------- 2106 2107 grp.h 2108 2109 struct group 2110 { 2111 char *gr_name; 2112 char *gr_passwd; 2113 gid_t gr_gid; 2114 char **gr_mem; 2115 } 2116 ; 2117 2118 ------------------------------------------------------------------------------- 2119 2120 iconv.h 2121 2122 typedef void *iconv_t; 2123 2124 ------------------------------------------------------------------------------- 2125 2126 inttypes.h 2127 2128 typedef lldiv_t imaxdiv_t; 2129 typedef unsigned char uint8_t; 2130 typedef unsigned short uint16_t; 2131 typedef unsigned int uint32_t; 2132 2133 ------------------------------------------------------------------------------- 2134 2135 langinfo.h 2136 2137 #define ABDAY_1 0x20000 2138 #define ABDAY_2 0x20001 2139 #define ABDAY_3 0x20002 2140 #define ABDAY_4 0x20003 2141 #define ABDAY_5 0x20004 2142 #define ABDAY_6 0x20005 2143 #define ABDAY_7 0x20006 2144 2145 #define DAY_1 0x20007 2146 #define DAY_2 0x20008 2147 #define DAY_3 0x20009 2148 #define DAY_4 0x2000A 2149 #define DAY_5 0x2000B 2150 #define DAY_6 0x2000C 2151 #define DAY_7 0x2000D 2152 2153 #define ABMON_1 0x2000E 2154 #define ABMON_2 0x2000F 2155 #define ABMON_3 0x20010 2156 #define ABMON_4 0x20011 2157 #define ABMON_5 0x20012 2158 #define ABMON_6 0x20013 2159 #define ABMON_7 0x20014 2160 #define ABMON_8 0x20015 2161 #define ABMON_9 0x20016 2162 #define ABMON_10 0x20017 2163 #define ABMON_11 0x20018 2164 #define ABMON_12 0x20019 2165 2166 #define MON_1 0x2001A 2167 #define MON_2 0x2001B 2168 #define MON_3 0x2001C 2169 #define MON_4 0x2001D 2170 #define MON_5 0x2001E 2171 #define MON_6 0x2001F 2172 #define MON_7 0x20020 2173 #define MON_8 0x20021 2174 #define MON_9 0x20022 2175 #define MON_10 0x20023 2176 #define MON_11 0x20024 2177 #define MON_12 0x20025 2178 2179 #define AM_STR 0x20026 2180 #define PM_STR 0x20027 2181 2182 #define D_T_FMT 0x20028 2183 #define D_FMT 0x20029 2184 #define T_FMT 0x2002A 2185 #define T_FMT_AMPM 0x2002B 2186 2187 #define ERA 0x2002C 2188 #define ERA_D_FMT 0x2002E 2189 #define ALT_DIGITS 0x2002F 2190 #define ERA_D_T_FMT 0x20030 2191 #define ERA_T_FMT 0x20031 2192 2193 #define CODESET 14 2194 2195 #define CRNCYSTR 0x4000F 2196 2197 #define RADIXCHAR 0x10000 2198 #define THOUSEP 0x10001 2199 #define YESEXPR 0x50000 2200 #define NOEXPR 0x50001 2201 #define YESSTR 0x50002 2202 #define NOSTR 0x50003 2203 2204 ------------------------------------------------------------------------------- 2205 2206 limits.h 2207 2208 #define LLONG_MIN (-LLONG_MAX-1LL) 2209 #define ULLONG_MAX 18446744073709551615ULL 2210 #define OPEN_MAX 256 2211 #define PATH_MAX 4096 2212 #define LLONG_MAX 9223372036854775807LL 2213 #define SSIZE_MAX LONG_MAX 2214 2215 #define MB_LEN_MAX 16 2216 2217 #define SCHAR_MIN (-128) 2218 #define SCHAR_MAX 127 2219 #define UCHAR_MAX 255 2220 #define CHAR_BIT 8 2221 2222 #define SHRT_MIN (-32768) 2223 #define SHRT_MAX 32767 2224 #define USHRT_MAX 65535 2225 2226 #define INT_MIN (-INT_MAX-1) 2227 #define INT_MAX 2147483647 2228 #define __INT_MAX__ 2147483647 2229 #define UINT_MAX 4294967295U 2230 2231 #define LONG_MIN (-LONG_MAX-1L) 2232 2233 ------------------------------------------------------------------------------- 2234 2235 locale.h 2236 2237 #define LC_CTYPE 0 2238 #define LC_NUMERIC 1 2239 #define LC_TELEPHONE 10 2240 #define LC_MEASUREMENT 11 2241 #define LC_IDENTIFICATION 12 2242 #define LC_TIME 2 2243 #define LC_COLLATE 3 2244 #define LC_MONETARY 4 2245 #define LC_MESSAGES 5 2246 #define LC_ALL 6 2247 #define LC_PAPER 7 2248 #define LC_NAME 8 2249 #define LC_ADDRESS 9 2250 2251 struct lconv 2252 { 2253 char *decimal_point; 2254 char *thousands_sep; 2255 char *grouping; 2256 char *int_curr_symbol; 2257 char *currency_symbol; 2258 char *mon_decimal_point; 2259 char *mon_thousands_sep; 2260 char *mon_grouping; 2261 char *positive_sign; 2262 char *negative_sign; 2263 char int_frac_digits; 2264 char frac_digits; 2265 char p_cs_precedes; 2266 char p_sep_by_space; 2267 char n_cs_precedes; 2268 char n_sep_by_space; 2269 char p_sign_posn; 2270 char n_sign_posn; 2271 char int_p_cs_precedes; 2272 char int_p_sep_by_space; 2273 char int_n_cs_precedes; 2274 char int_n_sep_by_space; 2275 char int_p_sign_posn; 2276 char int_n_sign_posn; 2277 } 2278 ; 2279 2280 typedef struct __locale_struct 2281 { 2282 struct locale_data *__locales[13]; 2283 const unsigned short *__ctype_b; 2284 const int *__ctype_tolower; 2285 const int *__ctype_toupper; 2286 const char *__names[13]; 2287 } 2288 *__locale_t; 2289 2290 ------------------------------------------------------------------------------- 2291 2292 net/if.h 2293 2294 #define IF_NAMESIZE 16 2295 2296 #define IFF_UP 0x01 2297 #define IFF_BROADCAST 0x02 2298 #define IFF_DEBUG 0x04 2299 #define IFF_LOOPBACK 0x08 2300 #define IFF_POINTOPOINT 0x10 2301 #define IFF_PROMISC 0x100 2302 #define IFF_MULTICAST 0x1000 2303 #define IFF_NOTRAILERS 0x20 2304 #define IFF_RUNNING 0x40 2305 #define IFF_NOARP 0x80 2306 2307 struct ifaddr 2308 { 2309 struct sockaddr ifa_addr; 2310 union 2311 { 2312 struct sockaddr ifu_broadaddr; 2313 struct sockaddr ifu_dstaddr; 2314 } 2315 ifa_ifu; 2316 void *ifa_ifp; 2317 void *ifa_next; 2318 } 2319 ; 2320 #define IFNAMSIZ IF_NAMESIZE 2321 2322 struct ifreq 2323 { 2324 union 2325 { 2326 char ifrn_name[IFNAMSIZ]; 2327 } 2328 ifr_ifrn; 2329 union 2330 { 2331 struct sockaddr ifru_addr; 2332 struct sockaddr ifru_dstaddr; 2333 struct sockaddr ifru_broadaddr; 2334 struct sockaddr ifru_netmask; 2335 struct sockaddr ifru_hwaddr; 2336 short ifru_flags; 2337 int ifru_ivalue; 2338 int ifru_mtu; 2339 char ifru_slave[IFNAMSIZ]; 2340 char ifru_newname[IFNAMSIZ]; 2341 caddr_t ifru_data; 2342 struct ifmap ifru_map; 2343 } 2344 ifr_ifru; 2345 } 2346 ; 2347 2348 struct ifconf 2349 { 2350 int ifc_len; 2351 union 2352 { 2353 caddr_t ifcu_buf; 2354 struct ifreq *ifcu_req; 2355 } 2356 ifc_ifcu; 2357 } 2358 ; 2359 2360 ------------------------------------------------------------------------------- 2361 2362 netdb.h 2363 2364 #define h_errno (*__h_errno_location ()) 2365 #define NETDB_INTERNAL -1 2366 #define NETDB_SUCCESS 0 2367 #define HOST_NOT_FOUND 1 2368 #define IPPORT_RESERVED 1024 2369 #define NI_MAXHOST 1025 2370 #define TRY_AGAIN 2 2371 #define NO_RECOVERY 3 2372 #define NI_MAXSERV 32 2373 #define NO_DATA 4 2374 #define h_addr h_addr_list[0] 2375 #define NO_ADDRESS NO_DATA 2376 2377 struct servent 2378 { 2379 char *s_name; 2380 char **s_aliases; 2381 int s_port; 2382 char *s_proto; 2383 } 2384 ; 2385 struct hostent 2386 { 2387 char *h_name; 2388 char **h_aliases; 2389 int h_addrtype; 2390 int h_length; 2391 char **h_addr_list; 2392 } 2393 ; 2394 struct protoent 2395 { 2396 char *p_name; 2397 char **p_aliases; 2398 int p_proto; 2399 } 2400 ; 2401 struct netent 2402 { 2403 char *n_name; 2404 char **n_aliases; 2405 int n_addrtype; 2406 unsigned int n_net; 2407 } 2408 ; 2409 #define AI_PASSIVE 0x0001 2410 #define AI_CANONNAME 0x0002 2411 #define AI_NUMERICHOST 0x0004 2412 2413 struct addrinfo 2414 { 2415 int ai_flags; 2416 int ai_family; 2417 int ai_socktype; 2418 int ai_protocol; 2419 socklen_t ai_addrlen; 2420 struct sockaddr *ai_addr; 2421 char *ai_canonname; 2422 struct addrinfo *ai_next; 2423 } 2424 ; 2425 #define NI_NUMERICHOST 1 2426 #define NI_DGRAM 16 2427 #define NI_NUMERICSERV 2 2428 #define NI_NOFQDN 4 2429 #define NI_NAMEREQD 8 2430 2431 #define EAI_BADFLAGS -1 2432 #define EAI_MEMORY -10 2433 #define EAI_SYSTEM -11 2434 #define EAI_NONAME -2 2435 #define EAI_AGAIN -3 2436 #define EAI_FAIL -4 2437 #define EAI_NODATA -5 2438 #define EAI_FAMILY -6 2439 #define EAI_SOCKTYPE -7 2440 #define EAI_SERVICE -8 2441 #define EAI_ADDRFAMILY -9 2442 2443 ------------------------------------------------------------------------------- 2444 2445 netinet/in.h 2446 2447 #define IPPROTO_IP 0 2448 #define IPPROTO_ICMP 1 2449 #define IPPROTO_UDP 17 2450 #define IPPROTO_IGMP 2 2451 #define IPPROTO_RAW 255 2452 #define IPPROTO_IPV6 41 2453 #define IPPROTO_ICMPV6 58 2454 #define IPPROTO_TCP 6 2455 2456 typedef uint16_t in_port_t; 2457 2458 struct in_addr 2459 { 2460 uint32_t s_addr; 2461 } 2462 ; 2463 typedef uint32_t in_addr_t; 2464 #define INADDR_NONE ((in_addr_t) 0xffffffff) 2465 #define INADDR_BROADCAST (0xffffffff) 2466 #define INADDR_ANY 0 2467 2468 struct in6_addr 2469 { 2470 union 2471 { 2472 uint8_t u6_addr8[16]; 2473 uint16_t u6_addr16[8]; 2474 uint32_t u6_addr32[4]; 2475 } 2476 in6_u; 2477 } 2478 ; 2479 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 2480 #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } 2481 2482 #define INET_ADDRSTRLEN 16 2483 2484 struct sockaddr_in 2485 { 2486 sa_family_t sin_family; 2487 unsigned short sin_port; 2488 struct in_addr sin_addr; 2489 unsigned char sin_zero[8]; 2490 } 2491 ; 2492 #define INET6_ADDRSTRLEN 46 2493 2494 struct sockaddr_in6 2495 { 2496 unsigned short sin6_family; 2497 uint16_t sin6_port; 2498 uint32_t sin6_flowinfo; 2499 struct in6_addr sin6_addr; 2500 uint32_t sin6_scope_id; 2501 } 2502 ; 2503 #define SOL_IP 0 2504 #define IP_TOS 1 2505 #define IPV6_UNICAST_HOPS 16 2506 #define IPV6_MULTICAST_IF 17 2507 #define IPV6_MULTICAST_HOPS 18 2508 #define IPV6_MULTICAST_LOOP 19 2509 #define IPV6_JOIN_GROUP 20 2510 #define IPV6_LEAVE_GROUP 21 2511 #define IPV6_V6ONLY 26 2512 #define IP_MULTICAST_IF 32 2513 #define IP_MULTICAST_TTL 33 2514 #define IP_MULTICAST_LOOP 34 2515 #define IP_ADD_MEMBERSHIP 35 2516 #define IP_DROP_MEMBERSHIP 36 2517 2518 struct ipv6_mreq 2519 { 2520 struct in6_addr ipv6mr_multiaddr; 2521 int ipv6mr_interface; 2522 } 2523 ; 2524 struct ip_mreq 2525 { 2526 struct in_addr imr_multiaddr; 2527 struct in_addr imr_interface; 2528 } 2529 ; 2530 2531 ------------------------------------------------------------------------------- 2532 2533 netinet/tcp.h 2534 2535 #define TCP_NODELAY 1 2536 #define SOL_TCP 6 2537 2538 ------------------------------------------------------------------------------- 2539 2540 netinet/udp.h 2541 2542 #define SOL_UDP 17 2543 2544 ------------------------------------------------------------------------------- 2545 2546 nl_types.h 2547 2548 #define NL_CAT_LOCALE 1 2549 #define NL_SETD 1 2550 2551 typedef void *nl_catd; 2552 2553 typedef int nl_item; 2554 2555 ------------------------------------------------------------------------------- 2556 2557 pty.h 2558 2559 struct winsize 2560 { 2561 unsigned short ws_row; 2562 unsigned short ws_col; 2563 unsigned short ws_xpixel; 2564 unsigned short ws_ypixel; 2565 } 2566 ; 2567 2568 ------------------------------------------------------------------------------- 2569 2570 pwd.h 2571 2572 struct passwd 2573 { 2574 char *pw_name; 2575 char *pw_passwd; 2576 uid_t pw_uid; 2577 gid_t pw_gid; 2578 char *pw_gecos; 2579 char *pw_dir; 2580 char *pw_shell; 2581 } 2582 ; 2583 2584 ------------------------------------------------------------------------------- 2585 2586 regex.h 2587 2588 #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int)1) 2589 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS<<1) 2590 #define RE_SYNTAX_AWK (RE_BACKSLASH_ESCAPE_IN_LISTS|RE_DOT_NOT_NULL|RE_NO_BK_PARENS| RE_NO_BK_REFS| RE_NO_BK_VBAR| RE_NO_EMPTY_RANGES| RE_DOT_NEWLINE| RE_CONTEXT_INDEP_ANCHORS| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) 2591 #define RE_CHAR_CLASSES (RE_BK_PLUS_QM<<1) 2592 #define RE_SYNTAX_GREP (RE_BK_PLUS_QM|RE_CHAR_CLASSES|RE_HAT_LISTS_NOT_NEWLINE|RE_INTERVALS|RE_NEWLINE_ALT) 2593 #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES<<1) 2594 #define RE_SYNTAX_EGREP (RE_CHAR_CLASSES|RE_CONTEXT_INDEP_ANCHORS| RE_CONTEXT_INDEP_OPS|RE_HAT_LISTS_NOT_NEWLINE|RE_NEWLINE_ALT|RE_NO_BK_PARENS|RE_NO_BK_VBAR) 2595 #define _RE_SYNTAX_POSIX_COMMON (RE_CHAR_CLASSES|RE_DOT_NEWLINE|RE_DOT_NOT_NULL|RE_INTERVALS|RE_NO_EMPTY_RANGES) 2596 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS<<1) 2597 #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS<<1) 2598 #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS<<1) 2599 #define RE_INVALID_INTERVAL_ORD (RE_DEBUG<<1) 2600 #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE<<1) 2601 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL<<1) 2602 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE<<1) 2603 #define RE_LIMITED_OPS (RE_INTERVALS<<1) 2604 #define RE_NEWLINE_ALT (RE_LIMITED_OPS<<1) 2605 #define RE_NO_BK_BRACES (RE_NEWLINE_ALT<<1) 2606 #define RE_NO_BK_PARENS (RE_NO_BK_BRACES<<1) 2607 #define RE_NO_BK_REFS (RE_NO_BK_PARENS<<1) 2608 #define RE_NO_BK_VBAR (RE_NO_BK_REFS<<1) 2609 #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR<<1) 2610 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES<<1) 2611 #define RE_DEBUG (RE_NO_GNU_OPS<<1) 2612 #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING<<1) 2613 #define RE_SYNTAX_POSIX_EGREP (RE_SYNTAX_EGREP|RE_INTERVALS|RE_NO_BK_BRACES|RE_INVALID_INTERVAL_ORD) 2614 #define RE_SYNTAX_POSIX_AWK (RE_SYNTAX_POSIX_EXTENDED|RE_BACKSLASH_ESCAPE_IN_LISTS|RE_INTERVALS|RE_NO_GNU_OPS) 2615 #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD<<1) 2616 #define RE_SYNTAX_POSIX_BASIC (_RE_SYNTAX_POSIX_COMMON|RE_BK_PLUS_QM) 2617 #define RE_SYNTAX_POSIX_EXTENDED (_RE_SYNTAX_POSIX_COMMON|RE_CONTEXT_INDEP_ANCHORS|RE_CONTEXT_INDEP_OPS|RE_NO_BK_BRACES|RE_NO_BK_PARENS|RE_NO_BK_VBAR|RE_CONTEXT_INVALID_OPS|RE_UNMATCHED_RIGHT_PAREN_ORD) 2618 #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED (_RE_SYNTAX_POSIX_COMMON|RE_CONTEXT_INDEP_ANCHORS|RE_CONTEXT_INVALID_OPS|RE_NO_BK_BRACES|RE_NO_BK_PARENS|RE_NO_BK_REFS|RE_NO_BK_VBAR|RE_UNMATCHED_RIGHT_PAREN_ORD) 2619 #define RE_SYNTAX_POSIX_MINIMAL_BASIC (_RE_SYNTAX_POSIX_COMMON|RE_LIMITED_OPS) 2620 #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC 2621 #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC 2622 2623 typedef unsigned long reg_syntax_t; 2624 2625 typedef struct re_pattern_buffer 2626 { 2627 unsigned char *buffer; 2628 unsigned long allocated; 2629 unsigned long used; 2630 reg_syntax_t syntax; 2631 char *fastmap; 2632 char *translate; 2633 size_t re_nsub; 2634 unsigned int can_be_null:1; 2635 unsigned int regs_allocated:2; 2636 unsigned int fastmap_accurate:1; 2637 unsigned int no_sub:1; 2638 unsigned int not_bol:1; 2639 unsigned int not_eol:1; 2640 unsigned int newline_anchor:1; 2641 } 2642 regex_t; 2643 typedef int regoff_t; 2644 typedef struct 2645 { 2646 regoff_t rm_so; 2647 regoff_t rm_eo; 2648 } 2649 regmatch_t; 2650 #define REG_NOTEOL (1<<1) 2651 #define REG_ICASE (REG_EXTENDED<<1) 2652 #define REG_NEWLINE (REG_ICASE<<1) 2653 #define REG_NOSUB (REG_NEWLINE<<1) 2654 #define REG_NOMATCH -1 2655 #define REG_EXTENDED 1 2656 #define REG_NOTBOL 1 2657 2658 ------------------------------------------------------------------------------- 2659 2660 rpc/auth.h 2661 2662 enum auth_stat 2663 { 2664 AUTH_OK, AUTH_BADCRED = 1, AUTH_REJECTEDCRED = 2, AUTH_BADVERF = 2665 3, AUTH_REJECTEDVERF = 4, AUTH_TOOWEAK = 5, AUTH_INVALIDRESP = 2666 6, AUTH_FAILED = 7 2667 } 2668 ; 2669 2670 union des_block 2671 { 2672 struct 2673 { 2674 u_int32_t high; 2675 u_int32_t low; 2676 } 2677 key; 2678 char c[8]; 2679 } 2680 ; 2681 2682 struct opaque_auth 2683 { 2684 enum_t oa_flavor; 2685 caddr_t oa_base; 2686 u_int oa_length; 2687 } 2688 ; 2689 2690 typedef struct AUTH 2691 { 2692 struct opaque_auth ah_cred; 2693 struct opaque_auth ah_verf; 2694 union des_block ah_key; 2695 struct auth_ops *ah_ops; 2696 caddr_t ah_private; 2697 } 2698 AUTH; 2699 2700 struct auth_ops 2701 { 2702 void (*ah_nextverf) (struct AUTH *); 2703 int (*ah_marshal) (struct AUTH *, XDR *); 2704 int (*ah_validate) (struct AUTH *, struct opaque_auth *); 2705 int (*ah_refresh) (struct AUTH *); 2706 void (*ah_destroy) (struct AUTH *); 2707 } 2708 ; 2709 2710 ------------------------------------------------------------------------------- 2711 2712 rpc/clnt.h 2713 2714 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 2715 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 2716 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 2717 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 2718 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 2719 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 2720 #define NULLPROC ((u_long)0) 2721 #define CLSET_TIMEOUT 1 2722 #define CLGET_XID 10 2723 #define CLSET_XID 11 2724 #define CLGET_VERS 12 2725 #define CLSET_VERS 13 2726 #define CLGET_PROG 14 2727 #define CLSET_PROG 15 2728 #define CLGET_TIMEOUT 2 2729 #define CLGET_SERVER_ADDR 3 2730 #define CLSET_RETRY_TIMEOUT 4 2731 #define CLGET_RETRY_TIMEOUT 5 2732 #define CLGET_FD 6 2733 #define CLGET_SVC_ADDR 7 2734 #define CLSET_FD_CLOSE 8 2735 #define CLSET_FD_NCLOSE 9 2736 2737 enum clnt_stat 2738 { 2739 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTSEND = 2740 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 2741 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 2742 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 2743 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 2744 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTERED = 2745 15, RPC_N2AXLATEFAILURE = 22, RPC_FAILED = 16, RPC_INTR = 2746 18, RPC_TLIERROR = 20, RPC_UDERROR = 23, RPC_INPROGRESS = 2747 24, RPC_STALERACHANDLE = 25 2748 } 2749 ; 2750 struct rpc_err 2751 { 2752 enum clnt_stat re_status; 2753 union 2754 { 2755 int RE_errno; 2756 enum auth_stat RE_why; 2757 struct 2758 { 2759 u_long low; 2760 u_long high; 2761 } 2762 RE_vers; 2763 struct 2764 { 2765 long s1; 2766 long s2; 2767 } 2768 RE_lb; 2769 } 2770 ru; 2771 } 2772 ; 2773 2774 typedef struct CLIENT 2775 { 2776 struct AUTH *cl_auth; 2777 struct clnt_ops *cl_ops; 2778 caddr_t cl_private; 2779 } 2780 CLIENT; 2781 2782 struct clnt_ops 2783 { 2784 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 2785 xdrproc_t, caddr_t, struct timeval); 2786 void (*cl_abort) (void); 2787 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 2788 bool_t (*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 2789 void (*cl_destroy) (struct CLIENT *); 2790 bool_t (*cl_control) (struct CLIENT *, int, char *); 2791 } 2792 ; 2793 2794 ------------------------------------------------------------------------------- 2795 2796 rpc/rpc_msg.h 2797 2798 enum msg_type 2799 { 2800 CALL, REPLY = 1 2801 } 2802 ; 2803 enum reply_stat 2804 { 2805 MSG_ACCEPTED, MSG_DENIED = 1 2806 } 2807 ; 2808 enum accept_stat 2809 { 2810 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 2811 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 2812 } 2813 ; 2814 enum reject_stat 2815 { 2816 RPC_MISMATCH, AUTH_ERROR = 1 2817 } 2818 ; 2819 2820 struct accepted_reply 2821 { 2822 struct opaque_auth ar_verf; 2823 enum accept_stat ar_stat; 2824 union 2825 { 2826 struct 2827 { 2828 unsigned long low; 2829 unsigned long high; 2830 } 2831 AR_versions; 2832 struct 2833 { 2834 caddr_t where; 2835 xdrproc_t proc; 2836 } 2837 AR_results; 2838 } 2839 ru; 2840 } 2841 ; 2842 2843 struct rejected_reply 2844 { 2845 enum reject_stat rj_stat; 2846 union 2847 { 2848 struct 2849 { 2850 unsigned long low; 2851 unsigned long high; 2852 } 2853 RJ_versions; 2854 enum auth_stat RJ_why; 2855 } 2856 ru; 2857 } 2858 ; 2859 2860 struct reply_body 2861 { 2862 enum reply_stat rp_stat; 2863 union 2864 { 2865 struct accepted_reply RP_ar; 2866 struct rejected_reply RP_dr; 2867 } 2868 ru; 2869 } 2870 ; 2871 2872 struct call_body 2873 { 2874 unsigned long cb_rpcvers; 2875 unsigned long cb_prog; 2876 unsigned long cb_vers; 2877 unsigned long cb_proc; 2878 struct opaque_auth cb_cred; 2879 struct opaque_auth cb_verf; 2880 } 2881 ; 2882 2883 struct rpc_msg 2884 { 2885 unsigned long rm_xid; 2886 enum msg_type rm_direction; 2887 union 2888 { 2889 struct call_body RM_cmb; 2890 struct reply_body RM_rmb; 2891 } 2892 ru; 2893 } 2894 ; 2895 2896 ------------------------------------------------------------------------------- 2897 2898 rpc/svc.h 2899 2900 #define svc_freeargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 2901 #define svc_getargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 2902 #define RPC_ANYSOCK -1 2903 2904 typedef struct SVCXPRT 2905 { 2906 int xp_sock; 2907 u_short xp_port; 2908 struct xp_ops *xp_ops; 2909 int xp_addrlen; 2910 struct sockaddr_in xp_raddr; 2911 struct opaque_auth xp_verf; 2912 caddr_t xp_p1; 2913 caddr_t xp_p2; 2914 char xp_pad[256]; 2915 } 2916 SVCXPRT; 2917 2918 struct svc_req 2919 { 2920 rpcprog_t rq_prog; 2921 rpcvers_t rq_vers; 2922 rpcproc_t rq_proc; 2923 struct opaque_auth rq_cred; 2924 caddr_t rq_clntcred; 2925 SVCXPRT *rq_xprt; 2926 } 2927 ; 2928 2929 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 2930 2931 struct xp_ops 2932 { 2933 bool_t (*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 2934 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 2935 bool_t (*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 2936 caddr_t args_ptr); 2937 bool_t (*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 2938 bool_t (*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 2939 caddr_t args_ptr); 2940 void (*xp_destroy) (SVCXPRT * __xprt); 2941 } 2942 ; 2943 2944 ------------------------------------------------------------------------------- 2945 2946 rpc/types.h 2947 2948 typedef int bool_t; 2949 typedef int enum_t; 2950 typedef unsigned long rpcprog_t; 2951 typedef unsigned long rpcvers_t; 2952 typedef unsigned long rpcproc_t; 2953 typedef unsigned long rpcprot_t; 2954 2955 ------------------------------------------------------------------------------- 2956 2957 rpc/xdr.h 2958 2959 enum xdr_op 2960 { 2961 XDR_ENCODE, XDR_DECODE, XDR_FREE 2962 } 2963 ; 2964 typedef struct XDR 2965 { 2966 enum xdr_op x_op; 2967 struct xdr_ops *x_ops; 2968 caddr_t x_public; 2969 caddr_t x_private; 2970 caddr_t x_base; 2971 int x_handy; 2972 } 2973 XDR; 2974 2975 struct xdr_ops 2976 { 2977 bool_t (*x_getlong) (XDR * __xdrs, long *__lp); 2978 bool_t (*x_putlong) (XDR * __xdrs, long *__lp); 2979 bool_t (*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 2980 bool_t (*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 2981 u_int (*x_getpostn) (XDR * __xdrs); 2982 bool_t (*x_setpostn) (XDR * __xdrs, u_int __pos); 2983 int32_t *(*x_inline) (XDR * __xdrs, int __len); 2984 void (*x_destroy) (XDR * __xdrs); 2985 bool_t (*x_getint32) (XDR * __xdrs, int32_t * __ip); 2986 bool_t (*x_putint32) (XDR * __xdrs, int32_t * __ip); 2987 } 2988 ; 2989 2990 typedef bool_t (*xdrproc_t) (XDR *, void *, ...); 2991 2992 struct xdr_discrim 2993 { 2994 int value; 2995 xdrproc_t proc; 2996 } 2997 ; 2998 2999 ------------------------------------------------------------------------------- 3000 3001 sched.h 3002 3003 #define SCHED_OTHER 0 3004 #define SCHED_FIFO 1 3005 #define SCHED_RR 2 3006 3007 struct sched_param 3008 { 3009 int sched_priority; 3010 } 3011 ; 3012 3013 ------------------------------------------------------------------------------- 3014 3015 search.h 3016 3017 typedef struct entry 3018 { 3019 char *key; 3020 void *data; 3021 } 3022 ENTRY; 3023 typedef enum 3024 { 3025 FIND, ENTER 3026 } 3027 ACTION; 3028 typedef enum 3029 { 3030 preorder, postorder, endorder, leaf 3031 } 3032 VISIT; 3033 3034 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 3035 3036 ------------------------------------------------------------------------------- 3037 3038 setjmp.h 3039 3040 #define setjmp(env) _setjmp(env) 3041 #define sigsetjmp(a,b) __sigsetjmp(a,b) 3042 3043 struct __jmp_buf_tag 3044 { 3045 __jmp_buf __jmpbuf; 3046 int __mask_was_saved; 3047 sigset_t __saved_mask; 3048 } 3049 ; 3050 3051 typedef struct __jmp_buf_tag jmp_buf[1]; 3052 typedef jmp_buf sigjmp_buf; 3053 3054 ------------------------------------------------------------------------------- 3055 3056 signal.h 3057 3058 #define SIGRTMAX (__libc_current_sigrtmax ()) 3059 #define SIGRTMIN (__libc_current_sigrtmin ()) 3060 #define SIG_BLOCK 0 3061 #define SIG_UNBLOCK 1 3062 #define SIG_SETMASK 2 3063 #define NSIG 65 3064 3065 typedef int sig_atomic_t; 3066 struct sigstack 3067 { 3068 void *ss_sp; 3069 int ss_onstack; 3070 } 3071 ; 3072 3073 typedef void (*sighandler_t) (int); 3074 #define SIG_HOLD ((sighandler_t) 2) 3075 #define SIG_ERR ((sighandler_t)-1) 3076 #define SIG_DFL ((sighandler_t)0) 3077 #define SIG_IGN ((sighandler_t)1) 3078 3079 #define SIGHUP 1 3080 #define SIGUSR1 10 3081 #define SIGSEGV 11 3082 #define SIGUSR2 12 3083 #define SIGPIPE 13 3084 #define SIGALRM 14 3085 #define SIGTERM 15 3086 #define SIGSTKFLT 16 3087 #define SIGCHLD 17 3088 #define SIGCONT 18 3089 #define SIGSTOP 19 3090 #define SIGINT 2 3091 #define SIGTSTP 20 3092 #define SIGTTIN 21 3093 #define SIGTTOU 22 3094 #define SIGURG 23 3095 #define SIGXCPU 24 3096 #define SIGXFSZ 25 3097 #define SIGVTALRM 26 3098 #define SIGPROF 27 3099 #define SIGWINCH 28 3100 #define SIGIO 29 3101 #define SIGQUIT 3 3102 #define SIGPWR 30 3103 #define SIGSYS 31 3104 #define SIGUNUSED 31 3105 #define SIGILL 4 3106 #define SIGTRAP 5 3107 #define SIGABRT 6 3108 #define SIGIOT 6 3109 #define SIGBUS 7 3110 #define SIGFPE 8 3111 #define SIGKILL 9 3112 #define SIGCLD SIGCHLD 3113 #define SIGPOLL SIGIO 3114 3115 #define SV_ONSTACK (1<<0) 3116 #define SV_INTERRUPT (1<<1) 3117 #define SV_RESETHAND (1<<2) 3118 3119 typedef union sigval 3120 { 3121 int sival_int; 3122 void *sival_ptr; 3123 } 3124 sigval_t; 3125 #define SIGEV_SIGNAL 0 3126 #define SIGEV_NONE 1 3127 #define SIGEV_THREAD 2 3128 3129 typedef struct sigevent 3130 { 3131 sigval_t sigev_value; 3132 int sigev_signo; 3133 int sigev_notify; 3134 union 3135 { 3136 int _pad[SIGEV_PAD_SIZE]; 3137 struct 3138 { 3139 void (*sigev_thread_func) (sigval_t); 3140 void *_attribute; 3141 } 3142 _sigev_thread; 3143 } 3144 _sigev_un; 3145 } 3146 sigevent_t; 3147 #define si_pid _sifields._kill._pid 3148 #define si_uid _sifields._kill._uid 3149 #define si_value _sifields._rt._sigval 3150 #define si_int _sifields._rt._sigval.sival_int 3151 #define si_ptr _sifields._rt._sigval.sival_ptr 3152 #define si_status _sifields._sigchld._status 3153 #define si_stime _sifields._sigchld._stime 3154 #define si_utime _sifields._sigchld._utime 3155 #define si_addr _sifields._sigfault._addr 3156 #define si_band _sifields._sigpoll._band 3157 #define si_fd _sifields._sigpoll._fd 3158 #define si_timer1 _sifields._timer._timer1 3159 #define si_timer2 _sifields._timer._timer2 3160 3161 typedef struct siginfo 3162 { 3163 int si_signo; 3164 int si_errno; 3165 int si_code; 3166 union 3167 { 3168 int _pad[SI_PAD_SIZE]; 3169 struct 3170 { 3171 pid_t _pid; 3172 uid_t _uid; 3173 } 3174 _kill; 3175 struct 3176 { 3177 unsigned int _timer1; 3178 unsigned int _timer2; 3179 } 3180 _timer; 3181 struct 3182 { 3183 pid_t _pid; 3184 uid_t _uid; 3185 sigval_t _sigval; 3186 } 3187 _rt; 3188 struct 3189 { 3190 pid_t _pid; 3191 uid_t _uid; 3192 int _status; 3193 clock_t _utime; 3194 clock_t _stime; 3195 } 3196 _sigchld; 3197 struct 3198 { 3199 void *_addr; 3200 } 3201 _sigfault; 3202 struct 3203 { 3204 int _band; 3205 int _fd; 3206 } 3207 _sigpoll; 3208 } 3209 _sifields; 3210 } 3211 siginfo_t; 3212 #define SI_QUEUE -1 3213 #define SI_TIMER -2 3214 #define SI_MESGQ -3 3215 #define SI_ASYNCIO -4 3216 #define SI_SIGIO -5 3217 #define SI_TKILL -6 3218 #define SI_ASYNCNL -60 3219 #define SI_USER 0 3220 #define SI_KERNEL 0x80 3221 3222 #define ILL_ILLOPC 1 3223 #define ILL_ILLOPN 2 3224 #define ILL_ILLADR 3 3225 #define ILL_ILLTRP 4 3226 #define ILL_PRVOPC 5 3227 #define ILL_PRVREG 6 3228 #define ILL_COPROC 7 3229 #define ILL_BADSTK 8 3230 3231 #define FPE_INTDIV 1 3232 #define FPE_INTOVF 2 3233 #define FPE_FLTDIV 3 3234 #define FPE_FLTOVF 4 3235 #define FPE_FLTUND 5 3236 #define FPE_FLTRES 6 3237 #define FPE_FLTINV 7 3238 #define FPE_FLTSUB 8 3239 3240 #define SEGV_MAPERR 1 3241 #define SEGV_ACCERR 2 3242 3243 #define BUS_ADRALN 1 3244 #define BUS_ADRERR 2 3245 #define BUS_OBJERR 3 3246 3247 #define TRAP_BRKPT 1 3248 #define TRAP_TRACE 2 3249 3250 #define CLD_EXITED 1 3251 #define CLD_KILLED 2 3252 #define CLD_DUMPED 3 3253 #define CLD_TRAPPED 4 3254 #define CLD_STOPPED 5 3255 #define CLD_CONTINUED 6 3256 3257 #define POLL_IN 1 3258 #define POLL_OUT 2 3259 #define POLL_MSG 3 3260 #define POLL_ERR 4 3261 #define POLL_PRI 5 3262 #define POLL_HUP 6 3263 3264 typedef struct 3265 { 3266 unsigned long sig[_SIGSET_NWORDS]; 3267 } 3268 sigset_t; 3269 #define SA_NOCLDSTOP 0x00000001 3270 #define SA_NOCLDWAIT 0x00000002 3271 #define SA_SIGINFO 0x00000004 3272 #define SA_ONSTACK 0x08000000 3273 #define SA_RESTART 0x10000000 3274 #define SA_INTERRUPT 0x20000000 3275 #define SA_NODEFER 0x40000000 3276 #define SA_RESETHAND 0x80000000 3277 #define SA_NOMASK SA_NODEFER 3278 #define SA_ONESHOT SA_RESETHAND 3279 3280 typedef struct sigaltstack 3281 { 3282 void *ss_sp; 3283 int ss_flags; 3284 size_t ss_size; 3285 } 3286 stack_t; 3287 #define SS_ONSTACK 1 3288 #define SS_DISABLE 2 3289 3290 ------------------------------------------------------------------------------- 3291 3292 stddef.h 3293 3294 #define offsetof(TYPE,MEMBER) ((size_t)& ((TYPE*)0)->MEMBER) 3295 #define NULL (0L) 3296 3297 typedef int wchar_t; 3298 3299 ------------------------------------------------------------------------------- 3300 3301 stdio.h 3302 3303 #define EOF (-1) 3304 #define P_tmpdir "/tmp" 3305 #define FOPEN_MAX 16 3306 #define L_tmpnam 20 3307 #define FILENAME_MAX 4096 3308 #define BUFSIZ 8192 3309 #define L_ctermid 9 3310 #define L_cuserid 9 3311 3312 typedef struct 3313 { 3314 off_t __pos; 3315 mbstate_t __state; 3316 } 3317 fpos_t; 3318 typedef struct 3319 { 3320 off64_t __pos; 3321 mbstate_t __state; 3322 } 3323 fpos64_t; 3324 3325 typedef struct _IO_FILE FILE; 3326 #define _IOFBF 0 3327 #define _IOLBF 1 3328 #define _IONBF 2 3329 3330 ------------------------------------------------------------------------------- 3331 3332 stdlib.h 3333 3334 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 3335 #define EXIT_SUCCESS 0 3336 #define EXIT_FAILURE 1 3337 #define RAND_MAX 2147483647 3338 3339 typedef int (*__compar_fn_t) (const void *, const void *); 3340 struct random_data 3341 { 3342 int32_t *fptr; 3343 int32_t *rptr; 3344 int32_t *state; 3345 int rand_type; 3346 int rand_deg; 3347 int rand_sep; 3348 int32_t *end_ptr; 3349 } 3350 ; 3351 3352 typedef struct 3353 { 3354 int quot; 3355 int rem; 3356 } 3357 div_t; 3358 3359 typedef struct 3360 { 3361 long quot; 3362 long rem; 3363 } 3364 ldiv_t; 3365 3366 typedef struct 3367 { 3368 long long quot; 3369 long long rem; 3370 } 3371 lldiv_t; 3372 3373 ------------------------------------------------------------------------------- 3374 3375 sys/file.h 3376 3377 #define LOCK_SH 1 3378 #define LOCK_EX 2 3379 #define LOCK_NB 4 3380 #define LOCK_UN 8 3381 3382 ------------------------------------------------------------------------------- 3383 3384 sys/ipc.h 3385 3386 #define IPC_PRIVATE ((key_t)0) 3387 #define IPC_RMID 0 3388 #define IPC_CREAT 00001000 3389 #define IPC_EXCL 00002000 3390 #define IPC_NOWAIT 00004000 3391 #define IPC_SET 1 3392 #define IPC_STAT 2 3393 3394 ------------------------------------------------------------------------------- 3395 3396 sys/mman.h 3397 3398 #define MAP_FAILED ((void*)-1) 3399 #define PROT_NONE 0x0 3400 #define MAP_SHARED 0x01 3401 #define MAP_PRIVATE 0x02 3402 #define PROT_READ 0x1 3403 #define MAP_FIXED 0x10 3404 #define PROT_WRITE 0x2 3405 #define MAP_ANONYMOUS 0x20 3406 #define PROT_EXEC 0x4 3407 #define MS_ASYNC 1 3408 #define MS_INVALIDATE 2 3409 #define MS_SYNC 4 3410 #define MAP_ANON MAP_ANONYMOUS 3411 3412 ------------------------------------------------------------------------------- 3413 3414 sys/msg.h 3415 3416 #define MSG_NOERROR 010000 3417 3418 ------------------------------------------------------------------------------- 3419 3420 sys/param.h 3421 3422 #define NOFILE 256 3423 #define MAXPATHLEN 4096 3424 3425 ------------------------------------------------------------------------------- 3426 3427 sys/poll.h 3428 3429 #define POLLIN 0x0001 3430 #define POLLPRI 0x0002 3431 #define POLLOUT 0x0004 3432 #define POLLERR 0x0008 3433 #define POLLHUP 0x0010 3434 #define POLLNVAL 0x0020 3435 3436 struct pollfd 3437 { 3438 int fd; 3439 short events; 3440 short revents; 3441 } 3442 ; 3443 typedef unsigned long nfds_t; 3444 3445 ------------------------------------------------------------------------------- 3446 3447 sys/resource.h 3448 3449 #define RUSAGE_CHILDREN (-1) 3450 #define RUSAGE_BOTH (-2) 3451 #define RLIM_INFINITY (~0UL) 3452 #define RLIM_SAVED_CUR -1 3453 #define RLIM_SAVED_MAX -1 3454 #define RLIMIT_CPU 0 3455 #define RUSAGE_SELF 0 3456 #define RLIMIT_FSIZE 1 3457 #define RLIMIT_DATA 2 3458 #define RLIMIT_STACK 3 3459 #define RLIMIT_CORE 4 3460 #define RLIMIT_NOFILE 7 3461 #define RLIMIT_AS 9 3462 3463 typedef unsigned long rlim_t; 3464 typedef unsigned long long rlim64_t; 3465 typedef int __rlimit_resource_t; 3466 3467 struct rlimit 3468 { 3469 rlim_t rlim_cur; 3470 rlim_t rlim_max; 3471 } 3472 ; 3473 struct rlimit64 3474 { 3475 rlim64_t rlim_cur; 3476 rlim64_t rlim_max; 3477 } 3478 ; 3479 3480 struct rusage 3481 { 3482 struct timeval ru_utime; 3483 struct timeval ru_stime; 3484 long ru_maxrss; 3485 long ru_ixrss; 3486 long ru_idrss; 3487 long ru_isrss; 3488 long ru_minflt; 3489 long ru_majflt; 3490 long ru_nswap; 3491 long ru_inblock; 3492 long ru_oublock; 3493 long ru_msgsnd; 3494 long ru_msgrcv; 3495 long ru_nsignals; 3496 long ru_nvcsw; 3497 long ru_nivcsw; 3498 } 3499 ; 3500 3501 enum __priority_which 3502 { 3503 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 3504 } 3505 ; 3506 #define PRIO_PGRP PRIO_PGRP 3507 #define PRIO_PROCESS PRIO_PROCESS 3508 #define PRIO_USER PRIO_USER 3509 3510 typedef enum __priority_which __priority_which_t; 3511 3512 ------------------------------------------------------------------------------- 3513 3514 sys/sem.h 3515 3516 #define SEM_UNDO 0x1000 3517 #define GETPID 11 3518 #define GETVAL 12 3519 #define GETALL 13 3520 #define GETNCNT 14 3521 #define GETZCNT 15 3522 #define SETVAL 16 3523 #define SETALL 17 3524 3525 struct sembuf 3526 { 3527 short sem_num; 3528 short sem_op; 3529 short sem_flg; 3530 } 3531 ; 3532 3533 ------------------------------------------------------------------------------- 3534 3535 sys/shm.h 3536 3537 #define SHM_RDONLY 010000 3538 #define SHM_W 0200 3539 #define SHM_RND 020000 3540 #define SHM_R 0400 3541 #define SHM_REMAP 040000 3542 #define SHM_LOCK 11 3543 #define SHM_UNLOCK 12 3544 3545 ------------------------------------------------------------------------------- 3546 3547 sys/socket.h 3548 3549 #define SHUT_RD 0 3550 #define MSG_WAITALL 0x100 3551 #define MSG_TRUNC 0x20 3552 #define MSG_EOR 0x80 3553 #define SIOCGIFCONF 0x8912 3554 #define SIOCGIFFLAGS 0x8913 3555 #define SIOCGIFADDR 0x8915 3556 #define SIOCGIFNETMASK 0x891b 3557 #define MSG_OOB 1 3558 #define SHUT_WR 1 3559 #define MSG_PEEK 2 3560 #define SHUT_RDWR 2 3561 #define MSG_DONTROUTE 4 3562 #define MSG_CTRUNC 8 3563 #define PF_UNSPEC AF_UNSPEC 3564 3565 struct linger 3566 { 3567 int l_onoff; 3568 int l_linger; 3569 } 3570 ; 3571 struct cmsghdr 3572 { 3573 size_t cmsg_len; 3574 int cmsg_level; 3575 int cmsg_type; 3576 } 3577 ; 3578 struct iovec 3579 { 3580 void *iov_base; 3581 size_t iov_len; 3582 } 3583 ; 3584 3585 typedef unsigned short sa_family_t; 3586 typedef unsigned int socklen_t; 3587 3588 struct sockaddr 3589 { 3590 sa_family_t sa_family; 3591 char sa_data[14]; 3592 } 3593 ; 3594 struct sockaddr_storage 3595 { 3596 sa_family_t ss_family; 3597 __ss_aligntype __ss_align; 3598 char __ss_padding[(128 - (2 * sizeof (__ss_aligntype)))]; 3599 } 3600 ; 3601 3602 struct msghdr 3603 { 3604 void *msg_name; 3605 int msg_namelen; 3606 struct iovec *msg_iov; 3607 size_t msg_iovlen; 3608 void *msg_control; 3609 size_t msg_controllen; 3610 unsigned int msg_flags; 3611 } 3612 ; 3613 #define AF_UNSPEC 0 3614 #define AF_UNIX 1 3615 #define AF_INET6 10 3616 #define AF_INET 2 3617 3618 #define PF_INET AF_INET 3619 #define PF_INET6 AF_INET6 3620 #define PF_UNIX AF_UNIX 3621 3622 #define SOCK_STREAM 1 3623 #define SOCK_PACKET 10 3624 #define SOCK_DGRAM 2 3625 #define SOCK_RAW 3 3626 #define SOCK_RDM 4 3627 #define SOCK_SEQPACKET 5 3628 3629 #define SOL_SOCKET 1 3630 #define SO_DEBUG 1 3631 #define SO_OOBINLINE 10 3632 #define SO_NO_CHECK 11 3633 #define SO_PRIORITY 12 3634 #define SO_LINGER 13 3635 #define SO_REUSEADDR 2 3636 #define SOL_RAW 255 3637 #define SO_TYPE 3 3638 #define SO_ERROR 4 3639 #define SO_DONTROUTE 5 3640 #define SO_BROADCAST 6 3641 #define SO_SNDBUF 7 3642 #define SO_RCVBUF 8 3643 #define SO_KEEPALIVE 9 3644 3645 ------------------------------------------------------------------------------- 3646 3647 sys/stat.h 3648 3649 #define S_ISBLK(m) (((m)& S_IFMT)==S_IFBLK) 3650 #define S_ISCHR(m) (((m)& S_IFMT)==S_IFCHR) 3651 #define S_ISDIR(m) (((m)& S_IFMT)==S_IFDIR) 3652 #define S_ISFIFO(m) (((m)& S_IFMT)==S_IFIFO) 3653 #define S_ISLNK(m) (((m)& S_IFMT)==S_IFLNK) 3654 #define S_ISREG(m) (((m)& S_IFMT)==S_IFREG) 3655 #define S_ISSOCK(m) (((m)& S_IFMT)==S_IFSOCK) 3656 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 3657 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 3658 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 3659 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 3660 #define S_IROTH (S_IRGRP>>3) 3661 #define S_IRGRP (S_IRUSR>>3) 3662 #define S_IRWXO (S_IRWXG>>3) 3663 #define S_IRWXG (S_IRWXU>>3) 3664 #define S_IWOTH (S_IWGRP>>3) 3665 #define S_IWGRP (S_IWUSR>>3) 3666 #define S_IXOTH (S_IXGRP>>3) 3667 #define S_IXGRP (S_IXUSR>>3) 3668 #define S_ISVTX 01000 3669 #define S_IXUSR 0x0040 3670 #define S_IWUSR 0x0080 3671 #define S_IRUSR 0x0100 3672 #define S_ISGID 0x0400 3673 #define S_ISUID 0x0800 3674 #define S_IFIFO 0x1000 3675 #define S_IFCHR 0x2000 3676 #define S_IFDIR 0x4000 3677 #define S_IFBLK 0x6000 3678 #define S_IFREG 0x8000 3679 #define S_IFLNK 0xa000 3680 #define S_IFSOCK 0xc000 3681 #define S_IFMT 0xf000 3682 #define st_atime st_atim.tv_sec 3683 #define st_ctime st_ctim.tv_sec 3684 #define st_mtime st_mtim.tv_sec 3685 #define S_IREAD S_IRUSR 3686 #define S_IWRITE S_IWUSR 3687 #define S_IEXEC S_IXUSR 3688 3689 ------------------------------------------------------------------------------- 3690 3691 sys/time.h 3692 3693 #define ITIMER_REAL 0 3694 #define ITIMER_VIRTUAL 1 3695 #define ITIMER_PROF 2 3696 3697 struct timezone 3698 { 3699 int tz_minuteswest; 3700 int tz_dsttime; 3701 } 3702 ; 3703 3704 typedef int __itimer_which_t; 3705 3706 struct timespec 3707 { 3708 time_t tv_sec; 3709 long tv_nsec; 3710 } 3711 ; 3712 3713 struct timeval 3714 { 3715 time_t tv_sec; 3716 suseconds_t tv_usec; 3717 } 3718 ; 3719 3720 struct itimerval 3721 { 3722 struct timeval it_interval; 3723 struct timeval it_value; 3724 } 3725 ; 3726 3727 ------------------------------------------------------------------------------- 3728 3729 sys/timeb.h 3730 3731 struct timeb 3732 { 3733 time_t time; 3734 unsigned short millitm; 3735 short timezone; 3736 short dstflag; 3737 } 3738 ; 3739 3740 ------------------------------------------------------------------------------- 3741 3742 sys/times.h 3743 3744 struct tms 3745 { 3746 clock_t tms_utime; 3747 clock_t tms_stime; 3748 clock_t tms_cutime; 3749 clock_t tms_cstime; 3750 } 3751 ; 3752 3753 ------------------------------------------------------------------------------- 3754 3755 sys/types.h 3756 3757 #define FD_ISSET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& (1<<((d)%(8*sizeof(long))))) 3758 #define FD_CLR(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& =~(1<<((d)%(8*sizeof(long))))) 3759 #define FD_SET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 3760 #define FALSE 0 3761 #define TRUE 1 3762 #define FD_SETSIZE 1024 3763 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 3764 3765 typedef signed char int8_t; 3766 typedef short int16_t; 3767 typedef int int32_t; 3768 typedef unsigned char u_int8_t; 3769 typedef unsigned short u_int16_t; 3770 typedef unsigned int u_int32_t; 3771 typedef unsigned int uid_t; 3772 typedef int pid_t; 3773 typedef unsigned long off_t; 3774 typedef int key_t; 3775 typedef long suseconds_t; 3776 typedef unsigned int u_int; 3777 typedef struct 3778 { 3779 int __val[2]; 3780 } 3781 fsid_t; 3782 typedef unsigned int useconds_t; 3783 typedef unsigned long blksize_t; 3784 typedef long fd_mask; 3785 typedef int timer_t; 3786 typedef int clockid_t; 3787 3788 typedef unsigned int id_t; 3789 3790 typedef unsigned long long ino64_t; 3791 typedef long long loff_t; 3792 typedef unsigned long blkcnt_t; 3793 typedef unsigned long fsblkcnt_t; 3794 typedef unsigned long fsfilcnt_t; 3795 typedef unsigned long long blkcnt64_t; 3796 typedef unsigned long long fsblkcnt64_t; 3797 typedef unsigned long long fsfilcnt64_t; 3798 typedef unsigned char u_char; 3799 typedef unsigned short u_short; 3800 typedef unsigned long u_long; 3801 3802 typedef unsigned long ino_t; 3803 typedef unsigned int gid_t; 3804 typedef unsigned long long dev_t; 3805 typedef unsigned int mode_t; 3806 typedef unsigned long nlink_t; 3807 typedef char *caddr_t; 3808 3809 typedef struct 3810 { 3811 unsigned long fds_bits[__FDSET_LONGS]; 3812 } 3813 fd_set; 3814 3815 typedef long clock_t; 3816 typedef long time_t; 3817 3818 ------------------------------------------------------------------------------- 3819 3820 sys/un.h 3821 3822 #define UNIX_PATH_MAX 108 3823 3824 struct sockaddr_un 3825 { 3826 sa_family_t sun_family; 3827 char sun_path[UNIX_PATH_MAX]; 3828 } 3829 ; 3830 3831 ------------------------------------------------------------------------------- 3832 3833 sys/utsname.h 3834 3835 #define SYS_NMLN 65 3836 3837 struct utsname 3838 { 3839 char sysname[65]; 3840 char nodename[65]; 3841 char release[65]; 3842 char version[65]; 3843 char machine[65]; 3844 char domainname[65]; 3845 } 3846 ; 3847 3848 ------------------------------------------------------------------------------- 3849 3850 sys/wait.h 3851 3852 #define WIFSIGNALED(status) (!WIFSTOPPED(status) & & !WIFEXITED(status)) 3853 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 3854 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 3855 #define WTERMSIG(status) ((status) & 0x7f) 3856 #define WCOREDUMP(status) ((status) & 0x80) 3857 #define WIFEXITED(status) (WTERMSIG(status) == 0) 3858 #define WNOHANG 0x00000001 3859 #define WUNTRACED 0x00000002 3860 #define WCOREFLAG 0x80 3861 #define WSTOPSIG(status) WEXITSTATUS(status) 3862 3863 typedef enum 3864 { 3865 P_ALL, P_PID, P_PGID 3866 } 3867 idtype_t; 3868 3869 ------------------------------------------------------------------------------- 3870 3871 syslog.h 3872 3873 #define LOG_EMERG 0 3874 #define LOG_PRIMASK 0x07 3875 #define LOG_ALERT 1 3876 #define LOG_CRIT 2 3877 #define LOG_ERR 3 3878 #define LOG_WARNING 4 3879 #define LOG_NOTICE 5 3880 #define LOG_INFO 6 3881 #define LOG_DEBUG 7 3882 3883 #define LOG_KERN (0<<3) 3884 #define LOG_AUTHPRIV (10<<3) 3885 #define LOG_FTP (11<<3) 3886 #define LOG_USER (1<<3) 3887 #define LOG_MAIL (2<<3) 3888 #define LOG_DAEMON (3<<3) 3889 #define LOG_AUTH (4<<3) 3890 #define LOG_SYSLOG (5<<3) 3891 #define LOG_LPR (6<<3) 3892 #define LOG_NEWS (7<<3) 3893 #define LOG_UUCP (8<<3) 3894 #define LOG_CRON (9<<3) 3895 #define LOG_FACMASK 0x03f8 3896 3897 #define LOG_LOCAL0 (16<<3) 3898 #define LOG_LOCAL1 (17<<3) 3899 #define LOG_LOCAL2 (18<<3) 3900 #define LOG_LOCAL3 (19<<3) 3901 #define LOG_LOCAL4 (20<<3) 3902 #define LOG_LOCAL5 (21<<3) 3903 #define LOG_LOCAL6 (22<<3) 3904 #define LOG_LOCAL7 (23<<3) 3905 3906 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 3907 #define LOG_MASK(pri) (1 << (pri)) 3908 3909 #define LOG_PID 0x01 3910 #define LOG_CONS 0x02 3911 #define LOG_ODELAY 0x04 3912 #define LOG_NDELAY 0x08 3913 #define LOG_NOWAIT 0x10 3914 #define LOG_PERROR 0x20 3915 3916 ------------------------------------------------------------------------------- 3917 3918 termios.h 3919 3920 #define TCIFLUSH 0 3921 #define TCOOFF 0 3922 #define TCSANOW 0 3923 #define BS0 0000000 3924 #define CR0 0000000 3925 #define FF0 0000000 3926 #define NL0 0000000 3927 #define TAB0 0000000 3928 #define VT0 0000000 3929 #define OPOST 0000001 3930 #define OCRNL 0000010 3931 #define ONOCR 0000020 3932 #define ONLRET 0000040 3933 #define OFILL 0000100 3934 #define OFDEL 0000200 3935 #define NL1 0000400 3936 #define TCOFLUSH 1 3937 #define TCOON 1 3938 #define TCSADRAIN 1 3939 #define TCIOFF 2 3940 #define TCIOFLUSH 2 3941 #define TCSAFLUSH 2 3942 #define TCION 3 3943 3944 typedef unsigned int speed_t; 3945 typedef unsigned char cc_t; 3946 typedef unsigned int tcflag_t; 3947 #define NCCS 32 3948 3949 struct termios 3950 { 3951 tcflag_t c_iflag; 3952 tcflag_t c_oflag; 3953 tcflag_t c_cflag; 3954 tcflag_t c_lflag; 3955 cc_t c_line; 3956 cc_t c_cc[NCCS]; 3957 speed_t c_ispeed; 3958 speed_t c_ospeed; 3959 } 3960 ; 3961 #define VINTR 0 3962 #define VQUIT 1 3963 #define VLNEXT 15 3964 #define VERASE 2 3965 #define VKILL 3 3966 #define VEOF 4 3967 3968 #define IGNBRK 0000001 3969 #define BRKINT 0000002 3970 #define IGNPAR 0000004 3971 #define PARMRK 0000010 3972 #define INPCK 0000020 3973 #define ISTRIP 0000040 3974 #define INLCR 0000100 3975 #define IGNCR 0000200 3976 #define ICRNL 0000400 3977 #define IXANY 0004000 3978 #define IMAXBEL 0020000 3979 3980 #define CS5 0000000 3981 3982 #define ECHO 0000010 3983 3984 #define B0 0000000 3985 #define B50 0000001 3986 #define B75 0000002 3987 #define B110 0000003 3988 #define B134 0000004 3989 #define B150 0000005 3990 #define B200 0000006 3991 #define B300 0000007 3992 #define B600 0000010 3993 #define B1200 0000011 3994 #define B1800 0000012 3995 #define B2400 0000013 3996 #define B4800 0000014 3997 #define B9600 0000015 3998 #define B19200 0000016 3999 #define B38400 0000017 4000 4001 ------------------------------------------------------------------------------- 4002 4003 time.h 4004 4005 #define CLK_TCK ((clock_t)__sysconf(2)) 4006 #define CLOCK_REALTIME 0 4007 #define TIMER_ABSTIME 1 4008 #define CLOCKS_PER_SEC 1000000l 4009 4010 struct tm 4011 { 4012 int tm_sec; 4013 int tm_min; 4014 int tm_hour; 4015 int tm_mday; 4016 int tm_mon; 4017 int tm_year; 4018 int tm_wday; 4019 int tm_yday; 4020 int tm_isdst; 4021 long tm_gmtoff; 4022 char *tm_zone; 4023 } 4024 ; 4025 struct itimerspec 4026 { 4027 struct timespec it_interval; 4028 struct timespec it_value; 4029 } 4030 ; 4031 4032 ------------------------------------------------------------------------------- 4033 4034 ulimit.h 4035 4036 #define UL_GETFSIZE 1 4037 #define UL_SETFSIZE 2 4038 4039 ------------------------------------------------------------------------------- 4040 4041 unistd.h 4042 4043 #define SEEK_SET 0 4044 #define STDIN_FILENO 0 4045 #define SEEK_CUR 1 4046 #define STDOUT_FILENO 1 4047 #define SEEK_END 2 4048 #define STDERR_FILENO 2 4049 4050 typedef long long off64_t; 4051 #define F_OK 0 4052 #define X_OK 1 4053 #define W_OK 2 4054 #define R_OK 4 4055 4056 #define _POSIX_VDISABLE '\0' 4057 #define _POSIX_CHOWN_RESTRICTED 1 4058 #define _POSIX_JOB_CONTROL 1 4059 #define _POSIX_NO_TRUNC 1 4060 #define _POSIX_SHELL 1 4061 #define _POSIX_FSYNC 200112 4062 #define _POSIX_MAPPED_FILES 200112 4063 #define _POSIX_MEMLOCK 200112 4064 #define _POSIX_MEMLOCK_RANGE 200112 4065 #define _POSIX_MEMORY_PROTECTION 200112 4066 #define _POSIX_SEMAPHORES 200112 4067 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 4068 #define _POSIX_TIMERS 200112 4069 #define _POSIX2_C_BIND 200112L 4070 #define _POSIX2_VERSION 200112L 4071 #define _POSIX_THREADS 200112L 4072 #define _POSIX_VERSION 200112L 4073 4074 #define _PC_LINK_MAX 0 4075 #define _PC_MAX_CANON 1 4076 #define _PC_ASYNC_IO 10 4077 #define _PC_PRIO_IO 11 4078 #define _PC_FILESIZEBITS 13 4079 #define _PC_REC_INCR_XFER_SIZE 14 4080 #define _PC_REC_MIN_XFER_SIZE 16 4081 #define _PC_REC_XFER_ALIGN 17 4082 #define _PC_ALLOC_SIZE_MIN 18 4083 #define _PC_MAX_INPUT 2 4084 #define _PC_2_SYMLINKS 20 4085 #define _PC_NAME_MAX 3 4086 #define _PC_PATH_MAX 4 4087 #define _PC_PIPE_BUF 5 4088 #define _PC_CHOWN_RESTRICTED 6 4089 #define _PC_NO_TRUNC 7 4090 #define _PC_VDISABLE 8 4091 #define _PC_SYNC_IO 9 4092 4093 #define _SC_ARG_MAX 0 4094 #define _SC_CHILD_MAX 1 4095 #define _SC_PRIORITY_SCHEDULING 10 4096 #define _SC_TIMERS 11 4097 #define _SC_ASYNCHRONOUS_IO 12 4098 #define _SC_XBS5_ILP32_OFF32 125 4099 #define _SC_XBS5_ILP32_OFFBIG 126 4100 #define _SC_XBS5_LP64_OFF64 127 4101 #define _SC_XBS5_LPBIG_OFFBIG 128 4102 #define _SC_XOPEN_LEGACY 129 4103 #define _SC_PRIORITIZED_IO 13 4104 #define _SC_XOPEN_REALTIME 130 4105 #define _SC_XOPEN_REALTIME_THREADS 131 4106 #define _SC_ADVISORY_INFO 132 4107 #define _SC_BARRIERS 133 4108 #define _SC_CLOCK_SELECTION 137 4109 #define _SC_CPUTIME 138 4110 #define _SC_THREAD_CPUTIME 139 4111 #define _SC_SYNCHRONIZED_IO 14 4112 #define _SC_MONOTONIC_CLOCK 149 4113 #define _SC_FSYNC 15 4114 #define _SC_READER_WRITER_LOCKS 153 4115 #define _SC_SPIN_LOCKS 154 4116 #define _SC_REGEXP 155 4117 #define _SC_SHELL 157 4118 #define _SC_SPAWN 159 4119 #define _SC_MAPPED_FILES 16 4120 #define _SC_SPORADIC_SERVER 160 4121 #define _SC_THREAD_SPORADIC_SERVER 161 4122 #define _SC_TIMEOUTS 164 4123 #define _SC_TYPED_MEMORY_OBJECTS 165 4124 #define _SC_2_PBS_ACCOUNTING 169 4125 #define _SC_MEMLOCK 17 4126 #define _SC_2_PBS_LOCATE 170 4127 #define _SC_2_PBS_MESSAGE 171 4128 #define _SC_2_PBS_TRACK 172 4129 #define _SC_SYMLOOP_MAX 173 4130 #define _SC_2_PBS_CHECKPOINT 175 4131 #define _SC_V6_ILP32_OFF32 176 4132 #define _SC_V6_ILP32_OFFBIG 177 4133 #define _SC_V6_LP64_OFF64 178 4134 #define _SC_V6_LPBIG_OFFBIG 179 4135 #define _SC_MEMLOCK_RANGE 18 4136 #define _SC_HOST_NAME_MAX 180 4137 #define _SC_TRACE 181 4138 #define _SC_TRACE_EVENT_FILTER 182 4139 #define _SC_TRACE_INHERIT 183 4140 #define _SC_TRACE_LOG 184 4141 #define _SC_MEMORY_PROTECTION 19 4142 #define _SC_CLK_TCK 2 4143 #define _SC_MESSAGE_PASSING 20 4144 #define _SC_SEMAPHORES 21 4145 #define _SC_SHARED_MEMORY_OBJECTS 22 4146 #define _SC_AIO_LISTIO_MAX 23 4147 #define _SC_AIO_MAX 24 4148 #define _SC_AIO_PRIO_DELTA_MAX 25 4149 #define _SC_DELAYTIMER_MAX 26 4150 #define _SC_MQ_OPEN_MAX 27 4151 #define _SC_MQ_PRIO_MAX 28 4152 #define _SC_VERSION 29 4153 #define _SC_NGROUPS_MAX 3 4154 #define _SC_PAGESIZE 30 4155 #define _SC_PAGE_SIZE 30 4156 #define _SC_RTSIG_MAX 31 4157 #define _SC_SEM_NSEMS_MAX 32 4158 #define _SC_SEM_VALUE_MAX 33 4159 #define _SC_SIGQUEUE_MAX 34 4160 #define _SC_TIMER_MAX 35 4161 #define _SC_BC_BASE_MAX 36 4162 #define _SC_BC_DIM_MAX 37 4163 #define _SC_BC_SCALE_MAX 38 4164 #define _SC_BC_STRING_MAX 39 4165 #define _SC_OPEN_MAX 4 4166 #define _SC_COLL_WEIGHTS_MAX 40 4167 #define _SC_EXPR_NEST_MAX 42 4168 #define _SC_LINE_MAX 43 4169 #define _SC_RE_DUP_MAX 44 4170 #define _SC_2_VERSION 46 4171 #define _SC_2_C_BIND 47 4172 #define _SC_2_C_DEV 48 4173 #define _SC_2_FORT_DEV 49 4174 #define _SC_STREAM_MAX 5 4175 #define _SC_2_FORT_RUN 50 4176 #define _SC_2_SW_DEV 51 4177 #define _SC_2_LOCALEDEF 52 4178 #define _SC_TZNAME_MAX 6 4179 #define _SC_IOV_MAX 60 4180 #define _SC_THREADS 67 4181 #define _SC_THREAD_SAFE_FUNCTIONS 68 4182 #define _SC_GETGR_R_SIZE_MAX 69 4183 #define _SC_JOB_CONTROL 7 4184 #define _SC_GETPW_R_SIZE_MAX 70 4185 #define _SC_LOGIN_NAME_MAX 71 4186 #define _SC_TTY_NAME_MAX 72 4187 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 4188 #define _SC_THREAD_KEYS_MAX 74 4189 #define _SC_THREAD_STACK_MIN 75 4190 #define _SC_THREAD_THREADS_MAX 76 4191 #define _SC_THREAD_ATTR_STACKADDR 77 4192 #define _SC_THREAD_ATTR_STACKSIZE 78 4193 #define _SC_THREAD_PRIORITY_SCHEDULING 79 4194 #define _SC_SAVED_IDS 8 4195 #define _SC_THREAD_PRIO_INHERIT 80 4196 #define _SC_THREAD_PRIO_PROTECT 81 4197 #define _SC_THREAD_PROCESS_SHARED 82 4198 #define _SC_ATEXIT_MAX 87 4199 #define _SC_PASS_MAX 88 4200 #define _SC_XOPEN_VERSION 89 4201 #define _SC_REALTIME_SIGNALS 9 4202 #define _SC_XOPEN_UNIX 91 4203 #define _SC_XOPEN_CRYPT 92 4204 #define _SC_XOPEN_ENH_I18N 93 4205 #define _SC_XOPEN_SHM 94 4206 #define _SC_2_CHAR_TERM 95 4207 #define _SC_2_C_VERSION 96 4208 #define _SC_2_UPE 97 4209 4210 #define _CS_PATH 0 4211 #define _POSIX_REGEXP 1 4212 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 4213 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 4214 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 4215 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 4216 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 4217 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 4218 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 4219 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 4220 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 4221 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 4222 #define _CS_XBS5_LP64_OFF64_LIBS 1110 4223 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 4224 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 4225 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 4226 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 4227 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 4228 4229 #define _XOPEN_REALTIME 1 4230 #define _XOPEN_XPG4 1 4231 #define _XOPEN_XCU_VERSION 4 4232 #define _XOPEN_VERSION 500 4233 4234 #define F_ULOCK 0 4235 #define F_LOCK 1 4236 #define F_TLOCK 2 4237 #define F_TEST 3 4238 4239 ------------------------------------------------------------------------------- 4240 4241 utime.h 4242 4243 struct utimbuf 4244 { 4245 time_t actime; 4246 time_t modtime; 4247 } 4248 ; 4249 4250 ------------------------------------------------------------------------------- 4251 4252 utmp.h 4253 4254 #define UT_HOSTSIZE 256 4255 #define UT_LINESIZE 32 4256 #define UT_NAMESIZE 32 4257 4258 struct exit_status 4259 { 4260 short e_termination; 4261 short e_exit; 4262 } 4263 ; 4264 4265 #define EMPTY 0 4266 #define RUN_LVL 1 4267 #define BOOT_TIME 2 4268 #define NEW_TIME 3 4269 #define OLD_TIME 4 4270 #define INIT_PROCESS 5 4271 #define LOGIN_PROCESS 6 4272 #define USER_PROCESS 7 4273 #define DEAD_PROCESS 8 4274 #define ACCOUNTING 9 4275 4276 ------------------------------------------------------------------------------- 4277 4278 wchar.h 4279 4280 #define WEOF (0xffffffffu) 4281 #define WCHAR_MAX 0x7FFFFFFF 4282 #define WCHAR_MIN 0x80000000 4283 4284 ------------------------------------------------------------------------------- 4285 4286 wctype.h 4287 4288 typedef unsigned long wctype_t; 4289 typedef unsigned int wint_t; 4290 typedef const int32_t *wctrans_t; 4291 typedef struct 4292 { 4293 int count; 4294 wint_t value; 4295 } 4296 __mbstate_t; 4297 4298 typedef __mbstate_t mbstate_t; 4299 4300 ------------------------------------------------------------------------------- 4301 4302 wordexp.h 4303 4304 enum 4305 { 4306 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, WRDE_UNDEF, 4307 __WRDE_FLAGS 4308 } 4309 ; 4310 4311 typedef struct 4312 { 4313 int we_wordc; 4314 char **we_wordv; 4315 int we_offs; 4316 } 4317 wordexp_t; 4318 4319 enum 4320 { 4321 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 4322 WRDE_SYNTAX 4323 } 4324 ; 4325 4326 ------------------------------------------------------------------------------- 4327 4328 Interface Definitions for libc 4329 4330 Table of Contents 4331 _IO_feof -- alias for feof 4332 _IO_getc -- alias for getc 4333 _IO_putc -- alias for putc 4334 _IO_puts -- alias for puts 4335 __assert_fail -- abort the program after false assertion 4336 __ctype_b_loc -- accessor function for __ctype_b array for ctype functions 4337 __ctype_get_mb_cur_max -- maximum length of a multibyte character in the 4338 current locale 4339 __ctype_tolower_loc -- accessor function for __ctype_b_tolower array for ctype 4340 tolower() function 4341 __ctype_toupper_loc -- accessor function for __ctype_b_toupper array for ctype 4342 toupper() function 4343 __cxa_atexit -- register a function to be called by exit or when a shared 4344 library is unloaded 4345 __daylight -- Daylight savings time flag 4346 __environ -- alias for environ - user environment 4347 __errno_location -- address of errno variable 4348 __fpending -- returns in bytes the amount of output pending on a stream 4349 __getpagesize -- alias for getpagesize - get current page size 4350 __getpgid -- get the process group id 4351 __h_errno_location -- address of h_errno variable 4352 __isinf -- test for infinity 4353 __isinff -- test for infinity 4354 __isinfl -- test for infinity 4355 __isnan -- test for infinity 4356 __isnanf -- test for infinity 4357 __isnanl -- test for infinity 4358 __libc_current_sigrtmax -- return number of available real-time signal with 4359 lowest priority 4360 __libc_current_sigrtmin -- return number of available real-time signal with 4361 highest priority 4362 __libc_start_main -- initialization routine 4363 __lxstat -- inline wrapper around call to lxstat 4364 __mempcpy -- copy given number of bytes of source to destination 4365 __rawmemchr -- scan memory 4366 __register_atfork -- alias for register_atfork 4367 __sigsetjmp -- save stack context for non-local goto 4368 __stpcpy -- copy a string returning a pointer to its end 4369 __strdup -- alias for strdup 4370 __strtod_internal -- underlying function for strtod 4371 __strtof_internal -- underlying function for strtof 4372 __strtok_r -- alias for strtok_r 4373 __strtol_internal -- alias for strtol 4374 __strtold_internal -- underlying function for strtold 4375 __strtoll_internal -- underlying function for strtoll 4376 __strtoul_internal -- underlying function for strtoul 4377 __strtoull_internal -- underlying function for strtoull 4378 __sysconf -- get configuration information at runtime 4379 __sysv_signal -- signal handling 4380 __timezone -- global variable containing timezone 4381 __tzname -- global variable containing the timezone 4382 __wcstod_internal -- underlying function for wcstod 4383 __wcstof_internal -- underlying function for wcstof 4384 __wcstol_internal -- underlying function for wcstol 4385 __wcstold_internal -- underlying function for wcstold 4386 __wcstoul_internal -- underlying function for wcstoul 4387 __xmknod -- make block or character special file 4388 __xstat -- Get File Status 4389 __xstat64 -- Get File Status 4390 _environ -- alias for environ - user environment 4391 _nl_msg_cat_cntr -- new catalog load counter 4392 _obstack_begin -- initialize an obstack for use 4393 _obstack_newchunk -- allocate a new current chunk of memory for the obstack 4394 _sys_errlist -- array containing the "C" locale strings used by strerror() 4395 _sys_siglist -- array containing the names of the signal names 4396 acct -- switch process accounting on or off 4397 adjtime -- correct the time to allow synchronization of the system clock 4398 adjtimex -- tune kernel clock (DEPRECATED) 4399 asprintf -- write formatted output to a dynamically allocated string 4400 bind_textdomain_codeset -- specify encoding for message retrieval 4401 bindresvport -- bind socket to privileged IP port 4402 bindtextdomain -- specify the location of a message catalog 4403 cfmakeraw -- get and set terminal attributes 4404 cfsetspeed -- set terminal input and output data rate 4405 creat -- open a file 4406 daemon -- run in the background 4407 dcgettext -- perform domain and category specific lookup in message catalog 4408 dcngettext -- perform domain and category specific lookup in message catalog 4409 with plural 4410 dgettext -- perform lookup in message catalog for the current LC_MESSAGES 4411 locale 4412 dngettext -- perform lookup in message catalog for the current locale 4413 err -- display formatted error messages 4414 error -- print error message 4415 errx -- display formatted error message and exit 4416 fcntl -- file control 4417 fflush_unlocked -- non thread safe fflush 4418 fgetwc_unlocked -- non thread safe fgetwc 4419 flock -- apply or remove an advisory lock on an open file 4420 fopen -- open a file 4421 freopen -- open a file 4422 getdomainname -- get NIS domain name (DEPRECATED). 4423 gethostbyname_r -- find network host database entry matching host name 4424 (DEPRECATED) 4425 getloadavg -- get system load averages 4426 getopt -- parse command line options 4427 getopt_long -- parse command line options 4428 getopt_long_only -- parse command line options 4429 gettext -- Search message catalogs for a string 4430 getutent -- access user accounting database entries 4431 getutent_r -- access user accounting database entries 4432 glob64 -- find pathnames matching a pattern (Large File Support) 4433 globfree64 -- free memory from glob64() (Large File Support) 4434 initgroups -- initialize the supplementary group access list 4435 ioctl -- control device 4436 sockio -- socket ioctl commands 4437 kill -- send a signal 4438 mbsnrtowcs -- convert a multibyte string to a wide character string 4439 memmem -- locate bytes 4440 memrchr -- scan memory for a character 4441 ngettext -- Search message catalogs for plural string 4442 obstack_free -- free an object in the obstack 4443 open -- open a file 4444 opterr -- external variable used in getopt() 4445 optind -- external variable used in getopt() 4446 optopt -- external variable used in getopt() 4447 pmap_getport -- Find the port number assigned to a service registered with a 4448 portmapper. 4449 pmap_set -- Establishes mapping to machine's RPC Bind service. 4450 pmap_unset -- Destroys RPC Binding 4451 psignal -- print signal message 4452 random_r -- generate random number 4453 setbuffer -- stream buffering operation 4454 setdomainname -- set NIS domain name (DEPRECATED). 4455 setgroups -- set list of supplementary group IDs 4456 sethostid -- set the unique identifier of the current host 4457 sethostname -- set host name 4458 setsockopt -- set options on sockets 4459 setutent -- access user accounting database entries 4460 sigandset -- build a new signal set by combining the two input sets using 4461 logical AND 4462 sigblock -- manipulate the signal mask 4463 siggetmask -- manipulate the signal mask 4464 sigisemptyset -- check for empty signal set 4465 sigorset -- build a new signal set by combining the two input sets using 4466 logical OR 4467 sigreturn -- return from signal handler and cleanup stack frame 4468 stime -- set time 4469 stpcpy -- copy a string returning a pointer to its end 4470 stpncpy -- copy a fixed-size string, returning a pointer to its end 4471 strcasestr -- locate a substring ignoring case 4472 strerror_r -- reentrant version of strerror 4473 strfry -- randomize a string 4474 strndup -- return a malloc'd copy of at most the specified number of bytes of a 4475 string 4476 strnlen -- determine the length of a fixed-size string 4477 strptime -- parse a time string 4478 strsep -- extract token from string 4479 strsignal -- return string describing signal 4480 strtoq -- convert string value to a long or quad_t integer 4481 strtouq -- convert a string to an uquad_t 4482 strverscmp -- compare strings holding name and indices/version numbers 4483 svc_register -- Register Remote Procedure Call Interface 4484 svc_run -- Waits for RPC requests to arrive and calls service procedure. 4485 svc_sendreply -- called by RPC service's dispatch routine 4486 svctcp_create -- Creates a TCP/IP-based RPC service transport. 4487 svcudp_create -- Creates a UDP-based RPC service transport. 4488 system -- execute a shell command 4489 textdomain -- set the current default message domain 4490 unlink -- remove a directory entry 4491 vasprintf -- write formatted output to a dynamically allocated string 4492 vdprintf -- write formatted output to a file descriptor 4493 verrx -- display formatted error message and exit 4494 vsyslog -- log to system log 4495 wait3 -- wait for child process 4496 wait4 -- wait for process termination, BSD style 4497 waitpid -- wait for child process 4498 warn -- formatted error messages 4499 warnx -- formatted error messages 4500 wcpcpy -- copy a wide character string, returning a pointer to its end 4501 wcpncpy -- copy a fixed-size string of wide characters, returning a pointer to 4502 its end 4503 wcscasecmp -- compare two wide-character strings, ignoring case 4504 wcsdup -- duplicate a wide-character string 4505 wcsncasecmp -- compare two fixed-size wide-character strings, ignoring case 4506 wcsnlen -- determine the length of a fixed-size wide-character string 4507 wcsnrtombs -- convert a wide character string to a multi-byte string 4508 wcstoq -- convert wide string to long long int representation 4509 wcstouq -- convert wide string to unsigned long long int representation 4510 xdr_u_int -- library routines for external data representation 4511 4512 The following interfaces are included in libc and are defined by this 4513 specification. Unless otherwise noted, these interfaces shall be included in 4514 the source standard. 4515 4516 Other interfaces listed above for libc shall behave as described in the 4517 referenced base document. 4518 4519 _IO_feof 4520 4521 Name 4522 4523 _IO_feof -- alias for feof 4524 4525 Synopsis 4526 4527 int _IO_feof(_IO_FILE *__fp); 4528 4529 Description 4530 4531 _IO_feof tests the end-of-file indicator for the stream pointed to by __fp, 4532 returning a non-zero value if it is set. 4533 4534 _IO_feof is not in the source standard; it is only in the binary standard. 4535 4536 _IO_getc 4537 4538 Name 4539 4540 _IO_getc -- alias for getc 4541 4542 Synopsis 4543 4544 int _IO_getc(_IO_FILE *__fp); 4545 4546 Description 4547 4548 _IO_getc reads the next character from __fp and returns it as an unsigned char 4549 cast to an int, or EOF on end-of-file or error. 4550 4551 _IO_getc is not in the source standard; it is only in the binary standard. 4552 4553 _IO_putc 4554 4555 Name 4556 4557 _IO_putc -- alias for putc 4558 4559 Synopsis 4560 4561 int _IO_putc(int __c, _IO_FILE *__fp); 4562 4563 Description 4564 4565 _IO_putc writes the character __c, cast to an unsigned char, to __fp. 4566 4567 _IO_putc is not in the source standard; it is only in the binary standard. 4568 4569 _IO_puts 4570 4571 Name 4572 4573 _IO_puts -- alias for puts 4574 4575 Synopsis 4576 4577 int _IO_puts(const char *__c); 4578 4579 Description 4580 4581 _IO_puts writes the string __s and a trailing newline to stdout. 4582 4583 _IO_puts is not in the source standard; it is only in the binary standard. 4584 4585 __assert_fail 4586 4587 Name 4588 4589 __assert_fail -- abort the program after false assertion 4590 4591 Synopsis 4592 4593 void __assert_fail(const char *assertion, const char *file, unsigned int line, 4594 const char *function); 4595 4596 Description 4597 4598 The __assert_fail function is used to implement the assert interface of ISO 4599 POSIX (2003). The __assert_fail function shall print the given file filename, 4600 line line number, function function name and a message on the standard error 4601 stream in an unspecified format, and abort program execution via the abort 4602 function. For example: 4603 4604 4605 a.c:10: foobar: Assertion a == b failed. 4606 4607 If function is NULL, __assert_fail shall omit information about the function. 4608 4609 assertion, file, and line shall be non-NULL. 4610 4611 The __assert_fail function is not in the source standard; it is only in the 4612 binary standard. The assert interface is not in the binary standard; it is only 4613 in the source standard. The assert may be implemented as a macro. 4614 4615 __ctype_b_loc 4616 4617 Name 4618 4619 __ctype_b_loc -- accessor function for __ctype_b array for ctype functions 4620 4621 Synopsis 4622 4623 #include 4624 4625 const unsigned short int **ctype_b_loc (void); 4626 4627 Description 4628 4629 The __ctype_b_loc function shall return a pointer into an array of characters 4630 in the current locale that contains characteristics for each character in the 4631 current character set. The array shall contain a total of 384 characters, and 4632 can be indexed with any signed or unsigned char (i.e. with an index value 4633 between -128 and 255). If the application is multithreaded, the array shall be 4634 local to the current thread. 4635 4636 This interface is not in the source standard; it is only in the binary 4637 standard. 4638 4639 Return Value 4640 4641 The __ctype_b_loc function shall return a pointer to the array of characters to 4642 be used for the ctype family of functions (see ). 4643 4644 __ctype_get_mb_cur_max 4645 4646 Name 4647 4648 __ctype_get_mb_cur_max -- maximum length of a multibyte character in the 4649 current locale 4650 4651 Synopsis 4652 4653 size_t __ctype_get_mb_cur_max(void); 4654 4655 Description 4656 4657 __ctype_get_mb_cur_max returns the maximum length of a multibyte character in 4658 the current locale. 4659 4660 __ctype_get_mb_cur_max is not in the source standard; it is only in the binary 4661 standard. 4662 4663 __ctype_tolower_loc 4664 4665 Name 4666 4667 __ctype_tolower_loc -- accessor function for __ctype_b_tolower array for ctype 4668 tolower() function 4669 4670 Synopsis 4671 4672 #include 4673 4674 int32_t **__ctype_tolower_loc(void); 4675 4676 Description 4677 4678 The __ctype_tolower_loc function shall return a pointer into an array 4679 characters in the current locale that contains lower case equivalents for each 4680 character in the current character set. The array shall contain a total of 384 4681 characters, and can be indexed with any signed or unsigned char (i.e. with an 4682 index value between -128 and 255). If the application is multithreaded, the 4683 array shall be local to the current thread. 4684 4685 This interface is not in the source standard; it is only in the binary 4686 standard. 4687 4688 __ctype_toupper_loc 4689 4690 Name 4691 4692 __ctype_toupper_loc -- accessor function for __ctype_b_toupper array for ctype 4693 toupper() function 4694 4695 Synopsis 4696 4697 #include 4698 4699 int32_t **__ctype_toupper_loc(void); 4700 4701 Description 4702 4703 The __ctype_toupper_loc function shall return a pointer into an array 4704 characters in the current locale that contains upper case equivalents for each 4705 character in the current character set. The array shall contain a total of 384 4706 characters, and can be indexed with any signed or unsigned char (i.e. with an 4707 index value between -128 and 255). If the application is multithreaded, the 4708 array shall be local to the current thread. 4709 4710 This interface is not in the source standard; it is only in the binary 4711 standard. 4712 4713 __cxa_atexit 4714 4715 Name 4716 4717 __cxa_atexit -- register a function to be called by exit or when a shared 4718 library is unloaded 4719 4720 Synopsis 4721 4722 int __cxa_atexit(void (*func) (void *), void *arg, void *dso_handle); 4723 4724 Description 4725 4726 __cxa_atexit registers a function to be called by exit or when a shared library 4727 is unloaded. 4728 4729 The __cxa_atexit function is used to implement atexit, as described in ISO 4730 POSIX (2003). Calling 4731 4732 atexit(func) 4733 4734 from the statically linked part of an application shall be equivalent to 4735 4736 __cxa_atexit(func, NULL, NULL) 4737 4738 . 4739 4740 __cxa_atexit is not in the source standard; it is only in the binary standard. 4741 atexit is not in the binary standard; it is only in the source standard. 4742 4743 __daylight 4744 4745 Name 4746 4747 __daylight -- Daylight savings time flag 4748 4749 Synopsis 4750 4751 int __daylight; 4752 4753 Description 4754 4755 The integer variable __daylight shall implement the daylight savings time flag 4756 daylight as specified in the ISO POSIX (2003) header file . 4757 4758 __daylight is not in the source standard; it is only in the binary standard. 4759 daylight is not in the binary standard; it is only in the source standard. 4760 4761 __environ 4762 4763 Name 4764 4765 __environ -- alias for environ - user environment 4766 4767 Synopsis 4768 4769 extern char **__environ; 4770 4771 Description 4772 4773 __environ is an alias for environ - user environment. 4774 4775 __environ has the same specification as environ. 4776 4777 __environ is not in the source standard; it is only in the binary standard. 4778 4779 __errno_location 4780 4781 Name 4782 4783 __errno_location -- address of errno variable 4784 4785 Synopsis 4786 4787 int *__errno_location(void); 4788 4789 Description 4790 4791 __errno_location is not in the source standard; it is only in the binary 4792 standard. 4793 4794 __fpending 4795 4796 Name 4797 4798 __fpending -- returns in bytes the amount of output pending on a stream 4799 4800 Synopsis 4801 4802 #include 4803 4804 size_t __fpending(FILE *stream); 4805 4806 Description 4807 4808 __fpending returns the amount of output in bytes pending on a stream. 4809 4810 __fpending is not in the source standard; it is only in the binary standard. 4811 4812 __getpagesize 4813 4814 Name 4815 4816 __getpagesize -- alias for getpagesize - get current page size 4817 4818 Synopsis 4819 4820 int __getpagesize(void); 4821 4822 Description 4823 4824 __getpagesize is an alias for getpagesize - get current page size. 4825 4826 __getpagesize has the same specification as getpagesize. 4827 4828 __getpagesize is not in the source standard; it is only in the binary standard. 4829 4830 __getpgid 4831 4832 Name 4833 4834 __getpgid -- get the process group id 4835 4836 Synopsis 4837 4838 pid_t __getpgid(pid_t pid); 4839 4840 Description 4841 4842 __getpgid has the same specification as getpgid. 4843 4844 __getpgid is not in the source standard; it is only in the binary standard. 4845 4846 __h_errno_location 4847 4848 Name 4849 4850 __h_errno_location -- address of h_errno variable 4851 4852 Synopsis 4853 4854 int *__h_errno_location(void); 4855 4856 Description 4857 4858 __h_errno_location returns the address of the h_errno variable, where h_errno 4859 is as specified in the Single Unix Specification. 4860 4861 __h_errno_location is not in the source standard; it is only in the binary 4862 standard. Note that h_errno itself is only in the source standard; it is not in 4863 the binary standard. 4864 4865 __isinf 4866 4867 Name 4868 4869 __isinf -- test for infinity 4870 4871 Synopsis 4872 4873 int __isinf(double arg); 4874 4875 Description 4876 4877 __isinf has the same specification as isinf in the Single UNIX Specification, 4878 Version 3, except that the argument type for __isinf is known to be double. 4879 4880 __isinf is not in the source standard; it is only in the binary standard. 4881 4882 __isinff 4883 4884 Name 4885 4886 __isinff -- test for infinity 4887 4888 Synopsis 4889 4890 int __isinff(float arg); 4891 4892 Description 4893 4894 __isinff has the same specification as isinf in the Single UNIX Specification, 4895 Version 3, except that the argument type for __isinff is known to be float. 4896 4897 __isinff is not in the source standard; it is only in the binary standard. 4898 4899 __isinfl 4900 4901 Name 4902 4903 __isinfl -- test for infinity 4904 4905 Synopsis 4906 4907 int __isinfl(long double arg); 4908 4909 Description 4910 4911 __isinfl has the same specification as isinf in the Single UNIX Specification, 4912 Version 3, except that the argument type for __isinfl is known to be long 4913 double. 4914 4915 __isinfl is not in the source standard; it is only in the binary standard. 4916 4917 __isnan 4918 4919 Name 4920 4921 __isnan -- test for infinity 4922 4923 Synopsis 4924 4925 int __isnan(double arg); 4926 4927 Description 4928 4929 __isnan has the same specification as isnan in the Single UNIX Specification, 4930 Version 3, except that the argument type for __isnan is known to be double. 4931 4932 __isnan is not in the source standard; it is only in the binary standard. 4933 4934 __isnanf 4935 4936 Name 4937 4938 __isnanf -- test for infinity 4939 4940 Synopsis 4941 4942 int __isnanf(float arg); 4943 4944 Description 4945 4946 __isnanf has the same specification as isnan in the Single UNIX Specification, 4947 Version 3, except that the argument type for __isnanf is known to be float. 4948 4949 __isnanf is not in the source standard; it is only in the binary standard. 4950 4951 __isnanl 4952 4953 Name 4954 4955 __isnanl -- test for infinity 4956 4957 Synopsis 4958 4959 int __isnanl(long double arg); 4960 4961 Description 4962 4963 __isnanl has the same specification as isnan in the Single UNIX Specification, 4964 Version 3, except that the argument type for __isnanl is known to be long 4965 double. 4966 4967 __isnanl is not in the source standard; it is only in the binary standard. 4968 4969 __libc_current_sigrtmax 4970 4971 Name 4972 4973 __libc_current_sigrtmax -- return number of available real-time signal with 4974 lowest priority 4975 4976 Synopsis 4977 4978 int __libc_current_sigrtmax(void); 4979 4980 Description 4981 4982 __libc_current_sigrtmax returns the number of an available real-time signal 4983 with the lowest priority. 4984 4985 __libc_current_sigrtmax is not in the source standard; it is only in the binary 4986 standard. 4987 4988 __libc_current_sigrtmin 4989 4990 Name 4991 4992 __libc_current_sigrtmin -- return number of available real-time signal with 4993 highest priority 4994 4995 Synopsis 4996 4997 int __libc_current_sigrtmin(void); 4998 4999 Description 5000 5001 __libc_current_sigrtmin returns the number of an available real-time signal 5002 with the highest priority. 5003 5004 __libc_current_sigrtmin is not in the source standard; it is only in the binary 5005 standard. 5006 5007 __libc_start_main 5008 5009 Name 5010 5011 __libc_start_main -- initialization routine 5012 5013 Synopsis 5014 5015 int __libc_start_main(int (*main) (int, char**, char**), int argc, char 5016 *__unbounded *__unbounded ubp_av, void (*init) (void), void (*fini) (void), 5017 void (*rtld_fini) (void), void (*__unbounded stack_end)); 5018 5019 Description 5020 5021 The __libc_start_main function shall initialize the process, call the main 5022 function with appropriate arguments, and handle the return from main. 5023 5024 __libc_start_main is not in the source standard; it is only in the binary 5025 standard. 5026 5027 __lxstat 5028 5029 Name 5030 5031 __lxstat -- inline wrapper around call to lxstat 5032 5033 Synopsis 5034 5035 #include 5036 5037 int __lxstat(int version, char *__path, (struct stat *__statbuf)); 5038 5039 Description 5040 5041 __lxstat is an inline wrapper around call to lxstat. 5042 5043 __lxstat is not in the source standard; it is only in the binary standard. 5044 5045 __mempcpy 5046 5047 Name 5048 5049 __mempcpy -- copy given number of bytes of source to destination 5050 5051 Synopsis 5052 5053 #include 5054 5055 ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, size_t n); 5056 5057 Description 5058 5059 __mempcpy copies n bytes of source to destination, returning pointer to bytes 5060 after the last written byte. 5061 5062 __mempcpy is not in the source standard; it is only in the binary standard. 5063 5064 __rawmemchr 5065 5066 Name 5067 5068 __rawmemchr -- scan memory 5069 5070 Synopsis 5071 5072 #include 5073 5074 ptr_t __rawmemchr(const ptr_t s, int c); 5075 5076 Description 5077 5078 __rawmemchr searches in s for c. 5079 5080 __rawmemchr is a weak alias to rawmemchr. It is similar to memchr, but it has 5081 no length limit. 5082 5083 __rawmemchr is not in the source standard; it is only in the binary standard. 5084 5085 __register_atfork 5086 5087 Name 5088 5089 __register_atfork -- alias for register_atfork 5090 5091 Synopsis 5092 5093 int __register_atfork(void (*prepare)(), void (*parent)(), void (*child)(), 5094 void *__dso_handle); 5095 5096 Description 5097 5098 __register_atfork implements pthread_atfork as specified in ISO POSIX (2003). 5099 The additional parameter __dso_handle allows a shared object to pass in it's 5100 handle so that functions registered by __register_atfork can be unregistered by 5101 the runtime when the shared object is unloaded. 5102 5103 __sigsetjmp 5104 5105 Name 5106 5107 __sigsetjmp -- save stack context for non-local goto 5108 5109 Synopsis 5110 5111 int __sigsetjmp(jmp_buf env, int savemask); 5112 5113 Description 5114 5115 __sigsetjmp has the same behavior as sigsetjmp as specified by ISO POSIX (2003) 5116 . 5117 5118 __sigsetjmp is not in the source standard; it is only in the binary standard. 5119 5120 __stpcpy 5121 5122 Name 5123 5124 __stpcpy -- copy a string returning a pointer to its end 5125 5126 Synopsis 5127 5128 #include 5129 5130 char *__stpcpy(char *dest, const char *src); 5131 5132 Description 5133 5134 __stpcpy copies the string src (including the terminating /0 character) to the 5135 array dest. The strings may not overlap, and dest must be large enough to 5136 receive the copy. 5137 5138 Return Value 5139 5140 __stpcpy returns a pointer to the end of the string dest (that is, the address 5141 of the terminating NULL character) rather than the beginning. 5142 5143 __stpcpy has the same specification as stpcpy. 5144 5145 __stpcpy is not in the source standard; it is only in the binary standard. 5146 5147 __strdup 5148 5149 Name 5150 5151 __strdup -- alias for strdup 5152 5153 Synopsis 5154 5155 char *__strdup(const char string); 5156 5157 Description 5158 5159 __strdup has the same specification as strdup. 5160 5161 __strdup is not in the source standard; it is only in the binary standard. 5162 5163 __strtod_internal 5164 5165 Name 5166 5167 __strtod_internal -- underlying function for strtod 5168 5169 Synopsis 5170 5171 double __strtod_internal(const char *__nptr, char **__endptr, int __group); 5172 5173 Description 5174 5175 __group shall be 0 or the behavior of __strtod_internal is undefined. 5176 5177 __strtod_internal(__nptr, __endptr, 0) has the same specification as strtod 5178 (__nptr, __endptr). 5179 5180 __strtod_internal is not in the source standard; it is only in the binary 5181 standard. 5182 5183 __strtof_internal 5184 5185 Name 5186 5187 __strtof_internal -- underlying function for strtof 5188 5189 Synopsis 5190 5191 float __strtof_internal(const char *__nptr, char **__endptr, int __group); 5192 5193 Description 5194 5195 __group shall be 0 or the behavior of __strtof_internal is undefined. 5196 5197 __strtof_internal(__nptr, __endptr, 0) has the same specification as strtof 5198 (__nptr, __endptr). 5199 5200 __strtof_internal is not in the source standard; it is only in the binary 5201 standard. 5202 5203 __strtok_r 5204 5205 Name 5206 5207 __strtok_r -- alias for strtok_r 5208 5209 Synopsis 5210 5211 char *__strtok_r(char *__restrict s, __const char *__restrict delim, char 5212 **__restrict save_ptr); 5213 5214 Description 5215 5216 __strtok_r has the same specification as strtok_r. 5217 5218 __strtok_r is not in the source standard; it is only in the binary standard. 5219 5220 __strtol_internal 5221 5222 Name 5223 5224 __strtol_internal -- alias for strtol 5225 5226 Synopsis 5227 5228 long int __strtol_internal(const char *__nptr, char **__endptr, int __base, int 5229 __group); 5230 5231 Description 5232 5233 __group shall be 0 or the behavior of __strtol_internal is undefined. 5234 5235 __strtol_internal(__nptr, __endptr, __base, 0) has the same specification as 5236 strtol(__nptr, __endptr, __base). 5237 5238 __strtol_internal is not in the source standard; it is only in the binary 5239 standard. 5240 5241 __strtold_internal 5242 5243 Name 5244 5245 __strtold_internal -- underlying function for strtold 5246 5247 Synopsis 5248 5249 long double __strtold_internal(const char *__nptr, char **__endptr, int 5250 __group); 5251 5252 Description 5253 5254 __group shall be 0 or the behavior of __strtold_internal is undefined. 5255 5256 __strtold_internal(__nptr, __endptr, 0) has the same specification as strtold 5257 (__nptr, __endptr). 5258 5259 __strtold_internal is not in the source standard; it is only in the binary 5260 standard. 5261 5262 __strtoll_internal 5263 5264 Name 5265 5266 __strtoll_internal -- underlying function for strtoll 5267 5268 Synopsis 5269 5270 long long __strtoll_internal(const char *__nptr, char **__endptr, int __base, 5271 int __group); 5272 5273 Description 5274 5275 __group shall be 0 or the behavior of __strtoll_internal is undefined. 5276 5277 __strtoll_internal(__nptr, __endptr, __base, 0) has the same specification as 5278 strtoll(__nptr, __endptr, __base). 5279 5280 __strtoll_internal is not in the source standard; it is only in the binary 5281 standard. 5282 5283 __strtoul_internal 5284 5285 Name 5286 5287 __strtoul_internal -- underlying function for strtoul 5288 5289 Synopsis 5290 5291 unsigned long int __strtoul_internal(const char *__nptr, char **__endptr, int 5292 __base, int __group); 5293 5294 Description 5295 5296 __group shall be 0 or the behavior of __strtoul_internal is undefined. 5297 5298 __strtoul_internal(__nptr, __endptr, __base, 0) has the same specification as 5299 strtoul(__nptr, __endptr, __base). 5300 5301 __strtoul_internal is not in the source standard; it is only in the binary 5302 standard. 5303 5304 __strtoull_internal 5305 5306 Name 5307 5308 __strtoull_internal -- underlying function for strtoull 5309 5310 Synopsis 5311 5312 unsigned long long __strtoull_internal(const char *__nptr, char **__endptr, int 5313 __base, int __group); 5314 5315 Description 5316 5317 __group shall be 0 or the behavior of __strtoull_internal is undefined. 5318 5319 __strtoull_internal(__nptr, __endptr, __base, 0) has the same specification as 5320 strtoull(__nptr, __endptr, __base). 5321 5322 __strtoull_internal is not in the source standard; it is only in the binary 5323 standard. 5324 5325 __sysconf 5326 5327 Name 5328 5329 __sysconf -- get configuration information at runtime 5330 5331 Synopsis 5332 5333 #include 5334 5335 long __sysconf(int name); 5336 5337 Description 5338 5339 __sysconf gets configuration information at runtime. 5340 5341 __sysconf is weak alias to sysconf. 5342 5343 __sysconf has the same specification as sysconf. 5344 5345 __sysconf is not in the source standard; it is only in the binary standard. 5346 5347 __sysv_signal 5348 5349 Name 5350 5351 __sysv_signal -- signal handling 5352 5353 Synopsis 5354 5355 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 5356 5357 Description 5358 5359 __sysv_signal has the same behavior as signal as specified by ISO POSIX (2003). 5360 5361 __sysv_signal is not in the source standard; it is only in the binary standard. 5362 5363 __timezone 5364 5365 Name 5366 5367 -- global variable containing timezone 5368 5369 Synopsis 5370 5371 long int __timezone; 5372 5373 Description 5374 5375 __timezone has the same specification as timezone in the ISO POSIX (2003) 5376 5377 __tzname 5378 5379 Name 5380 5381 -- global variable containing the timezone 5382 5383 Synopsis 5384 5385 char *__tzname[2]; 5386 5387 Description 5388 5389 __tzname has the same specification as tzname in the ISO POSIX (2003). 5390 5391 Note that the array size of 2 is explicit in the ISO POSIX (2003), but not in 5392 the SUSv2. 5393 5394 __wcstod_internal 5395 5396 Name 5397 5398 __wcstod_internal -- underlying function for wcstod 5399 5400 Synopsis 5401 5402 double __wcstod_internal(const wchar_t *nptr, wchar_t **endptr, int group); 5403 5404 Description 5405 5406 group shall be 0 or the behavior of __wcstod_internal is undefined. 5407 5408 __wcstod_internal(nptr, endptr, 0) has the same specification as wcstod(nptr, 5409 endptr). 5410 5411 __wcstod_internal is not in the source standard; it is only in the binary 5412 standard. 5413 5414 __wcstof_internal 5415 5416 Name 5417 5418 __wcstof_internal -- underlying function for wcstof 5419 5420 Synopsis 5421 5422 float __wcstof_internal(const wchar_t *nptr, wchar_t **endptr, int group); 5423 5424 Description 5425 5426 group shall be 0 or the behavior of __wcstof_internal is undefined. 5427 5428 __wcstof_internal(nptr, endptr, 0) has the same specification as wcstof(nptr, 5429 endptr). 5430 5431 __wcstof_internal is not in the source standard; it is only in the binary 5432 standard. 5433 5434 __wcstol_internal 5435 5436 Name 5437 5438 __wcstol_internal -- underlying function for wcstol 5439 5440 Synopsis 5441 5442 long __wcstol_internal(const wchar_t *nptr, wchar_t **endptr, int base, int 5443 group); 5444 5445 Description 5446 5447 group shall be 0 or the behavior of __wcstol_internal is undefined. 5448 5449 __wcstol_internal(nptr, endptr, base, 0) has the same specification as wcstol 5450 (nptr, endptr, base). 5451 5452 __wcstol_internal is not in the source standard; it is only in the binary 5453 standard. 5454 5455 __wcstold_internal 5456 5457 Name 5458 5459 __wcstold_internal -- underlying function for wcstold 5460 5461 Synopsis 5462 5463 long double __wcstold_internal(const wchar_t *nptr, wchar_t **endptr, int 5464 group); 5465 5466 Description 5467 5468 group shall be 0 or the behavior of __wcstold_internal is undefined. 5469 5470 __wcstold_internal(nptr, endptr, 0) has the same specification as wcstold(nptr, 5471 endptr). 5472 5473 __wcstold_internal is not in the source standard; it is only in the binary 5474 standard. 5475 5476 __wcstoul_internal 5477 5478 Name 5479 5480 __wcstoul_internal -- underlying function for wcstoul 5481 5482 Synopsis 5483 5484 unsigned long __wcstoul_internal(const wchar_t *restrict nptr, wchar_t 5485 **restrict endptr, int base, int group); 5486 5487 Description 5488 5489 group shall be 0 or the behavior of __wcstoul_internal is undefined. 5490 5491 __wcstoul_internal(nptr, endptr, base, 0) has the same specification as wcstoul 5492 (nptr, endptr, base). 5493 5494 __wcstoul_internal is not in the source standard; it is only in the binary 5495 standard. 5496 5497 __xmknod 5498 5499 Name 5500 5501 __xmknod -- make block or character special file 5502 5503 Synopsis 5504 5505 int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); 5506 5507 Description 5508 5509 The __xmknod shall implement the mknod interface from ISO POSIX (2003). 5510 5511 __xmknod(1, path, mode, dev) has the same specification as mknod(path, mode, 5512 dev). 5513 5514 ver shall be 1 or the behavior of __xmknod is undefined. 5515 5516 The __xmknod function is not in the source standard; it is only in the binary 5517 standard. The mknod function is not in the binary standard; it is only in the 5518 source standard. 5519 5520 __xstat 5521 5522 Name 5523 5524 __xstat -- Get File Status 5525 5526 Synopsis 5527 5528 #include 5529 #include 5530 5531 int __xstat(int ver, const char *path, (struct stat *stat_buf)); 5532 5533 int __lxstat(int ver, const char *path, (struct stat *stat_buf)); 5534 5535 int __fxstat(int ver, int fildes, (struct stat *stat_buf)); 5536 5537 Description 5538 5539 The functions __xstat, __lxstat, and __fxstat shall implement the ISO POSIX 5540 (2003) functions stat, lstat, and fstat respectively. 5541 5542 ver shall be 3 or the behavior of these functions is undefined. 5543 5544 __xstat(3, path, stat_buf) shall behave as stat(path, stat_buf) as specified by 5545 ISO POSIX (2003). 5546 5547 __lxstat(3, path, stat_buf) shall behave as lstat(path, stat_buf) as specified 5548 by ISO POSIX (2003). 5549 5550 __fxstat(3, fildes, stat_buf) shall behave as fstat(fildes, stat_buf) as 5551 specified by ISO POSIX (2003). 5552 5553 __xstat, __lxstat, and __fxstat are not in the source standard; they are only 5554 in the binary standard. 5555 5556 stat, lstat, and fstat are not in the binary standard; they are only in the 5557 source standard. 5558 5559 __xstat64 5560 5561 Name 5562 5563 __xstat64 -- Get File Status 5564 5565 Synopsis 5566 5567 #define _LARGEFILE_SOURCE 1 5568 #include 5569 #include 5570 5571 int __xstat64(int ver, const char *path, (struct stat64 *stat_buf)); 5572 5573 int __lxstat64(int ver, const char *path, (struct stat64 *stat_buf)); 5574 5575 int __fxstat64(int ver, int fildes, (struct stat64 *stat_buf)); 5576 5577 Description 5578 5579 The functions __xstat64, __lxstat64, and __fxstat64 shall implement the Large 5580 File Support functions stat64, lstat64, and fstat64 respectively. 5581 5582 ver shall be 3 or the behavior of these functions is undefined. 5583 5584 __xstat64(3, path, stat_buf) shall behave as stat(path, stat_buf) as specified 5585 by Large File Support. 5586 5587 __lxstat64(3, path, stat_buf) shall behave as lstat(path, stat_buf) as 5588 specified by Large File Support. 5589 5590 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, stat_buf) as 5591 specified by Large File Support. 5592 5593 __xstat64, __lxstat64, and __fxstat64 are not in the source standard; they are 5594 only in the binary standard. 5595 5596 stat64, lstat64, and fstat64 are not in the binary standard; they are only in 5597 the source standard. 5598 5599 _environ 5600 5601 Name 5602 5603 _environ -- alias for environ - user environment 5604 5605 Synopsis 5606 5607 extern char **_environ; 5608 5609 Description 5610 5611 _environ is an alias for environ - user environment. 5612 5613 _nl_msg_cat_cntr 5614 5615 Name 5616 5617 _nl_msg_cat_cntr -- new catalog load counter 5618 5619 Synopsis 5620 5621 #include 5622 5623 extern int _nl_msg_cat_cntr; 5624 5625 Description 5626 5627 _nl_msg_cat_cntr is incremented each time a new catalong is loaded. It is a 5628 variable defined in loadmsgcat.c and is used by Message catalogs for 5629 internationalization. 5630 5631 _obstack_begin 5632 5633 Name 5634 5635 _obstack_begin -- initialize an obstack for use 5636 5637 Synopsis 5638 5639 #include 5640 5641 int _obstack_begin(struct obstack *, int, int, void *(*) (long), void (*) (void 5642 *)); 5643 5644 Description 5645 5646 _obstack_begin initializes an obstack for use. 5647 5648 Future Directions 5649 5650 Future versions of this specification may not include support for this 5651 interface. 5652 5653 _obstack_newchunk 5654 5655 Name 5656 5657 _obstack_newchunk -- allocate a new current chunk of memory for the obstack 5658 5659 Synopsis 5660 5661 #include 5662 5663 void _obstack_newchunk(struct obstack *, int); 5664 5665 Description 5666 5667 _obstack_newchunk allocates a new current chunk of memory for the obstack. 5668 5669 Future Directions 5670 5671 Future versions of this specification may not include support for this 5672 interface. 5673 5674 _sys_errlist 5675 5676 Name 5677 5678 _sys_errlist -- array containing the "C" locale strings used by strerror() 5679 5680 Synopsis 5681 5682 #include 5683 5684 extern const char *const _sys_errlist[]; 5685 5686 Description 5687 5688 _sys_errlist is an array containing the "C" locale strings used by strerror. 5689 This normally should not be used directly. strerror provides all of the needed 5690 functionality. 5691 5692 _sys_siglist 5693 5694 Name 5695 5696 _sys_siglist -- array containing the names of the signal names 5697 5698 Synopsis 5699 5700 #include 5701 5702 extern const char *const _sys_siglist[NSIG]; 5703 5704 Description 5705 5706 _sys_siglist is an array containing the names of the signal names. 5707 5708 The _sys_siglist array is only in the binary standard; it is not in the source 5709 standard. Applications wishing to access the names of signals should use the 5710 strsignal function. 5711 5712 acct 5713 5714 Name 5715 5716 acct -- switch process accounting on or off 5717 5718 Synopsis 5719 5720 #include 5721 5722 int acct(const char *filename); 5723 5724 Description 5725 5726 When filename is the name of an existing file, acct turns accounting on and 5727 appends a record to filename for each terminating process. When filename is 5728 NULL, acct turns accounting off. 5729 5730 Return Value 5731 5732 On success, 0 is returned. On error, -1 is returned and the global variable 5733 errno is set appropriately. 5734 5735 Errors 5736 5737 ENOSYS 5738 5739 BSD process accounting has not been enabled when the operating system 5740 kernel was compiled. The kernel configuration parameter controlling this 5741 feature is CONFIG_BSD_PROCESS_ACCT. 5742 5743 ENOMEM 5744 5745 Out of memory. 5746 5747 EPERM 5748 5749 The calling process has no permission to enable process accounting. 5750 5751 EACCES 5752 5753 filename is not a regular file. 5754 5755 EIO 5756 5757 Error writing to the filename. 5758 5759 EUSERS 5760 5761 There are no more free file structures or we run out of memory. 5762 5763 adjtime 5764 5765 Name 5766 5767 adjtime -- correct the time to allow synchronization of the system clock 5768 5769 Synopsis 5770 5771 #include 5772 5773 int adjtime((const struct timeval *delta), (struct timeval *olddelta)); 5774 5775 Description 5776 5777 adjtime makes small adjustments to the system time as returned by gettimeofday 5778 (2), advancing or retarding it by the time specified by the timeval delta. If 5779 delta is negative, the clock is slowed down by incrementing it more slowly than 5780 normal until the correction is complete. If delta is positive, a larger 5781 increment than normal is used. The skew used to perform the correction is 5782 generally a fraction of one percent. Thus, the time is always a monotonically 5783 increasing function. A time correction from an earlier call to adjtime may not 5784 be finished when adjtime is called again. If olddelta is non-NULL, the 5785 structure pointed to will contain, upon return, the number of microseconds 5786 still to be corrected from the earlier call. 5787 5788 adjtime may be used by time servers that synchronize the clocks of computers in 5789 a local area network. Such time servers would slow down the clocks of some 5790 machines and speed up the clocks of others to bring them to the average network 5791 time. 5792 5793 The adjtime is restricted to the super-user. 5794 5795 Return Value 5796 5797 On success, 0 is returned. On error, -1 is returned and the global variable 5798 errno is set appropriately. 5799 5800 Errors 5801 5802 EFAULT 5803 5804 An argument points outside the process's allocated address space. 5805 5806 EPERM 5807 5808 The process's effective user ID is not that of the super-user. 5809 5810 adjtimex 5811 5812 Name 5813 5814 adjtimex -- tune kernel clock (DEPRECATED) 5815 5816 Synopsis 5817 5818 #include 5819 5820 int adjtimex((struct timex *buf)); 5821 5822 Description 5823 5824 The adjtimex function is deprecated from the LSB and is expected to disappear 5825 from a future version of the LSB. 5826 5827 5828 Note: The LSB generally does not include interfaces unlikely to be used by 5829 software applications. 5830 5831 Linux uses David L. Mills' clock adjustment algorithm (see RFC 1305). adjtimex 5832 reads and optionally sets adjustment parameters for this algorithm. adjtimex 5833 takes a pointer to a timex structure, updates kernel parameters from field 5834 values, and returns the same structure with current kernel values. This 5835 structure is declared as follows: 5836 5837 struct timex { 5838 int modes; /* mode selector */ 5839 long offset; /* time offset (usec) */ 5840 long freq; /* frequency offset (scaled ppm) */ 5841 long maxerror; /* maximum error (usec) */ 5842 long esterror; /* estimated error (usec) */ 5843 int status; /* clock command/status */ 5844 long constant; /* pll time constant */ 5845 long precision; /* clock precision (usec) (read only) */ 5846 long tolerance; /* clock frequency tolerance (ppm) 5847 (read only) */ 5848 struct timeval time; /* current time (read only) */ 5849 long tick; /* usecs between clock ticks */ 5850 }; 5851 5852 modes determines which parameters, if any, to set. modes may contain a 5853 bitwise-or combination of zero or more of the following bits: 5854 5855 #define ADJ_OFFSET 0x0001 /* time offset */ 5856 #define ADJ_FREQUENCY 0x0002 /* frequency offset */ 5857 #define ADJ_MAXERROR 0x0004 /* maximum time error */ 5858 #define ADJ_ESTERROR 0x0008 /* estimated time error */ 5859 #define ADJ_STATUS 0x0010 /* clock status */ 5860 #define ADJ_TIMECONST 0x0020 /* pll time constant */ 5861 #define ADJ_TICK 0x4000 /* tick value */ 5862 #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ 5863 5864 Ordinary users are restricted to a 0 value for modes. Only the superuser may 5865 set any parameters. 5866 5867 Return Value 5868 5869 On success, adjtimex returns the clock state: 5870 5871 #define TIME_OK 0 /* clock synchronized */ 5872 #define TIME_INS 1 /* insert leap second */ 5873 #define TIME_DEL 2 /* delete leap second */ 5874 #define TIME_OOP 3 /* leap second in progress */ 5875 #define TIME_WAIT 4 /* leap second has occurred */ 5876 #define TIME_BAD 5 /* clock not synchronized */ 5877 5878 On error, the global variable errno is set to -1. 5879 5880 Errors 5881 5882 EFAULT 5883 5884 buf does not point to writable memory. 5885 5886 EPERM 5887 5888 buf.mode is nonzero and the user is not super-user. 5889 5890 EINVAL 5891 5892 An attempt is made to set buf.offset to a value outside of the range 5893 -131071 to +131071, or to set buf.status to a value other than those listed 5894 above, or to set buf.tick to a value outside of the range 900000/HZ to 5895 1100000/HZ, where HZ is the system timer interrupt frequency. 5896 5897 asprintf 5898 5899 Name 5900 5901 asprintf -- write formatted output to a dynamically allocated string 5902 5903 Synopsis 5904 5905 #include 5906 5907 int asprintf(char ** restrict ptr, const char * restrict format ...); 5908 5909 Description 5910 5911 The asprintf function shall behave as sprintf, except that the output string 5912 shall be dynamically allocated space of sufficient length to hold the resulting 5913 string. The address of this dynamically allocated string shall be stored in the 5914 location referenced by ptr. 5915 5916 Return Value 5917 5918 Refer to fprintf. 5919 5920 Errors 5921 5922 Refer to fprintf. 5923 5924 bind_textdomain_codeset 5925 5926 Name 5927 5928 bind_textdomain_codeset -- specify encoding for message retrieval 5929 5930 Synopsis 5931 5932 #include 5933 5934 char * bind_textdomain_codeset (const char * domainname , const char * codeset 5935 ); 5936 5937 Description 5938 5939 The bind_textdomain_codeset function can be used to specify the output codeset 5940 for message catalogs for domain domainname. The codeset argument shall be a 5941 valid codeset name which can be used tor the iconv_open function, or a null 5942 pointer. If the codeset argument is the null pointer, then function returns the 5943 currently selected codeset for the domain with the name domainname. It shall 5944 return a null pointer if no codeset has yet been selected 5945 5946 Each successive call to bind_textdomain_codeset function overrrides the 5947 settings made by the preceding call with the same domainname. 5948 5949 The bind_textdomain_codeset function shall return a pointer to a string 5950 containing the name of the selected codeset. The string shall be allocated 5951 internally in the function and shall not be changed or freed by the user. 5952 5953 The bind_textdomain_codeset function returns a pointer to a string containing 5954 the name of the selected codeset. The string is allocated internally in the 5955 function and shall not be changed by the user. 5956 5957 Parameters 5958 5959 domainname 5960 5961 The domainname argument is applied to the currently active LC_MESSAGE 5962 locale. It is equivalent in syntax and meaning to the domainname argument 5963 to textdomain, except that the selection of the domain is valid only for 5964 the duration of the call. 5965 5966 codeset 5967 5968 The name of the output codeset for the selected domain, or NULL to select 5969 the current codeset. 5970 5971 If domainname is the null pointer, or is an empty string, 5972 bind_textdomain_codeset shall fail, but need not set errno. 5973 5974 Return Value 5975 5976 Returns the currently selected codeset name. It returns a null pointer if no 5977 codeset has yet been selected. 5978 5979 Errors 5980 5981 ENOMEM 5982 5983 Insufficient memory available to allocate return value. 5984 5985 See Also 5986 5987 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 5988 bindtextdomain 5989 5990 bindresvport 5991 5992 Name 5993 5994 bindresvport -- bind socket to privileged IP port 5995 5996 Synopsis 5997 5998 #include 5999 #include 6000 6001 int bindresvport(int sd, struct sockaddr_in *sin); 6002 6003 Description 6004 6005 If the process has appropriate privilege, the bindresvport function shall bind 6006 a socket to a privileged IP port. 6007 6008 Return Value 6009 6010 On success, 0 is returned. On error, -1 is returned and the global variable 6011 errno is set appropriately. 6012 6013 Errors 6014 6015 EPERM 6016 6017 The process did not have appropriate privilege. 6018 6019 EPFNOSUPPORT 6020 6021 Address of sin did not match address family of sd. 6022 6023 bindtextdomain 6024 6025 Name 6026 6027 bindtextdomain -- specify the location of a message catalog 6028 6029 Synopsis 6030 6031 #include 6032 6033 char *bindtextdomain(const char *domainname, const char *dirname); 6034 6035 Description 6036 6037 The bindtextdomain shall set the the base directory of the hierarchy containing 6038 message catalogs for a given message domain. 6039 6040 The bindtextdomain function specifies that the domainname message catalog can 6041 be found in the dirname directory hierarchy, rather than in the system default 6042 locale data base. 6043 6044 If dirname is not NULL, the base directory for message catalogs belonging to 6045 domain domainname shall be set to dirname. If dirname is NULL, the base 6046 directory for message catalogs shall not be altered. 6047 6048 The function shall make copies of the argument strings as needed. 6049 6050 dirname can be an absolute or relative pathname. 6051 6052 6053 Note: Applications that wish to use chdir should always use absolute 6054 pathnames to avoid misadvertently selecting the wrong or non-existant 6055 directory. 6056 6057 If domainname is the null pointer, or is an empty string, bindtextdomain shall 6058 fail, but need not set errno. 6059 6060 The bindtextdomain function shall return a pointer to a string containing the 6061 name of the selected directory. The string shall be allocated internally in the 6062 function and shall not be changed or freed by the user. 6063 6064 Return Value 6065 6066 On success, bindtextdomain shall return a pointer to a string containing the 6067 directory pathname currently bound to the domain. On failure, a NULL pointer is 6068 returned, and the global variable errno may be set to indicate the error. 6069 6070 Errors 6071 6072 ENOMEM 6073 6074 Insufficient memory was available. 6075 6076 See Also 6077 6078 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6079 bind_textdomain_codeset 6080 6081 cfmakeraw 6082 6083 Name 6084 6085 cfmakeraw -- get and set terminal attributes 6086 6087 Synopsis 6088 6089 #include 6090 6091 void cfmakeraw(struct termios *termios_p); 6092 6093 Description 6094 6095 The cfmakeraw function shall set the attributes of the termios structure 6096 referenced by termios_p as follows: 6097 6098 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 6099 |INLCR|IGNCR|ICRNL|IXON); 6100 6101 termios_p->c_oflag &= ~OPOST; 6102 6103 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 6104 6105 termios_p->c_cflag &= ~(CSIZE|PARENB); 6106 6107 termios_p->c_cflag |= CS8; 6108 6109 termios_p shall point to a termios structure that contains the following 6110 members: 6111 6112 tcflag_t c_iflag; /* input modes */ 6113 tcflag_t c_oflag; /* output modes */ 6114 tcflag_t c_cflag; /* control modes */ 6115 tcflag_t c_lflag; /* local modes */ 6116 cc_t c_cc[NCCS]; /* control chars */ 6117 6118 cfsetspeed 6119 6120 Name 6121 6122 cfsetspeed -- set terminal input and output data rate 6123 6124 Synopsis 6125 6126 #include 6127 6128 int cfsetspeed(struct termios *t, speedt speed); 6129 6130 Description 6131 6132 cfsetspeed sets the baud rate values in the termios structure. The effects of 6133 the function on the terminal as described below do not become effective, nor 6134 are all errors detected, until the tcsetattr function is called. Certain values 6135 for baud rates set in termios and passed to tcsetattr have special meanings. 6136 6137 Getting and Setting the Baud Rate 6138 6139 Input and output baud rates are found in the termios structure. The unsigned 6140 integer speed_t is typdef'd in the include file termios.h. The value of the 6141 integer corresponds directly to the baud rate being represented; however, the 6142 following symbolic values are defined. 6143 6144 #define B0 0 6145 #define B50 50 6146 #define B75 75 6147 #define B110 110 6148 #define B134 134 6149 #define B150 150 6150 #define B200 200 6151 #define B300 300 6152 #define B600 600 6153 #define B1200 1200 6154 #define B1800 1800 6155 #define B2400 2400 6156 #define B4800 4800 6157 #define B9600 9600 6158 #define B19200 19200 6159 #define B38400 38400 6160 #ifndef _POSIX_SOURCE 6161 #define EXTA 19200 6162 #define EXTB 38400 6163 #endif /*_POSIX_SOURCE */ 6164 6165 cfsetspeed sets both the input and output baud rates in the termios structure 6166 referenced by t to speed. 6167 6168 Return Value 6169 6170 On success, 0 is returned. On error, -1 is returned and the global variable 6171 errno is set appropriately. 6172 6173 Errors 6174 6175 EINVAL 6176 6177 Invalid speed argument 6178 6179 creat 6180 6181 Name 6182 6183 creat -- open a file 6184 6185 Description 6186 6187 creat is as specified in ISO POSIX (2003), but with differences as listed 6188 below. 6189 6190 May return ENODEV in place of ENXIO 6191 6192 Where the ISO POSIX (2003) specifies an ENXIO return, the implementation may 6193 return either ENXIO or ENODEV. Implementations are encouraged to return ENXIO. 6194 6195 6196 Note: As of spring 2004, we don't know of any Linux kernel patches to 6197 switch to ENXIO, but we believe that such a kernel patch would be accepted 6198 if submitted. 6199 6200 daemon 6201 6202 Name 6203 6204 daemon -- run in the background 6205 6206 Synopsis 6207 6208 #include 6209 6210 int daemon(int nochdir, int noclose); 6211 6212 Description 6213 6214 The daemon function shall create a new process, detached from the controlling 6215 terminal. If successful, the calling process shall exit and the new process 6216 shall continue to execute the application in the background. If nochdir 6217 evaluates to true, the current directory shall not be changed. Otherwise, 6218 daemon shall change the current working directory to the root (`/'). If noclose 6219 evaluates to true the standard input, standard output, and standard error file 6220 descriptors shall not be altered. Otherwise, daemon shall close the standard 6221 input, standard output and standard error file descriptors and reopen them 6222 attached to /dev/null. 6223 6224 Return Value 6225 6226 On error, -1 is returned, and the global variable errno is set to any of the 6227 errors specified for the library functions fork and setsid. 6228 6229 dcgettext 6230 6231 Name 6232 6233 dcgettext -- perform domain and category specific lookup in message catalog 6234 6235 Synopsis 6236 6237 #include 6238 #include 6239 6240 char *dcgettext(const char *domainname, const char *msgid, int category); 6241 6242 Description 6243 6244 The dcgettext function is a domain specified version of gettext. 6245 6246 The dcgettext function shall lookup the translation in the current locale of 6247 the message identified by msgid in the domain specified by domainname and in 6248 the locale category specified by category. If domainname is NULL, the current 6249 default domain shall be used. The msgid argument shall be a NULL-terminated 6250 string to be matched in the catalogue. category shall specify the locale 6251 category to be used for retrieving message strings. The category parameter 6252 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or 6253 LC_TIME. The default domain shall not be changed by a call to dcgettext. 6254 6255 Return Value 6256 6257 If a translation was found in one of the specified catalogs, it shall be 6258 converted to the current locale's codeset and returned. The resulting 6259 NULL-terminated string shall be allocated by the dcgettext function, and must 6260 not be modified or freed. If no translation was found, or category was invalid, 6261 msgid shall be returned. 6262 6263 Errors 6264 6265 dcgettext shall not modify the errno global variable. 6266 6267 See Also 6268 6269 gettext, dgettext, ngettext, dngettext, dcngettext, textdomain, bindtextdomain, 6270 bind_textdomain_codeset 6271 6272 dcngettext 6273 6274 Name 6275 6276 dcngettext -- perform domain and category specific lookup in message catalog 6277 with plural 6278 6279 Synopsis 6280 6281 #include 6282 #include 6283 6284 char *dcngettext(const char *domainname, const char *msgid1, const char 6285 *msgid2, unsigned long int n, int category); 6286 6287 Description 6288 6289 The dcngettext function is a domain specific version of gettext, capable of 6290 returning either a singular or plural form of the message. The dcngettext 6291 function shall lookup the translation in the current locale of the message 6292 identified by msgid1 in the domain specified by domainname and in the locale 6293 category specified by category. If domainname is NULL, the current default 6294 domain shall be used. The msgid1 argument shall be a NULL-terminated string to 6295 be matched in the catalogue. category shall specify the locale category to be 6296 used for retrieving message strings. The category parameter shall be one of 6297 LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, or LC_TIME. The 6298 default domain shall not be changed by a call to dcgettext. If n is 1 then the 6299 singular version of the message is returned, otherwise one of the plural forms 6300 is returned, depending on the value of n and the current locale settings. 6301 6302 Return Value 6303 6304 If a translation corresponding to the value of n was found in one of the 6305 specified catalogs for msgid1, it shall be converted to the current locale's 6306 codeset and returned. The resulting NULL-terminated string shall be allocated 6307 by the dcngettext function, and must not be modified or freed. If no 6308 translation was found, or category was invalid, msgid1 shall be returned if n 6309 has the value 1, otherwise msgid2 shall be returned. 6310 6311 Errors 6312 6313 dcngettext shall not modify the errno global variable. 6314 6315 See Also 6316 6317 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, bindtextdomain, 6318 bind_textdomain_codeset 6319 6320 dgettext 6321 6322 Name 6323 6324 dgettext -- perform lookup in message catalog for the current LC_MESSAGES 6325 locale 6326 6327 Synopsis 6328 6329 #include 6330 6331 char *dgettext(const char *domainname, const char *msgid); 6332 6333 Description 6334 6335 dgettext is a domain specified version of gettext. 6336 6337 Parameters 6338 6339 domainname 6340 6341 dgettext applies domainname to the currently active LC_MESSAGE locale. This 6342 usage is equivalent in syntax and meaning to the textdomain function's 6343 application of domainname, except that the selection of the domain in 6344 dgettext is valid only for the duration of the call. 6345 6346 msgid 6347 6348 a NULL-terminated string to be matched in the catalogue with respect to a 6349 specific domain and the current locale. 6350 6351 Return Value 6352 6353 On success of a msgid query, the translated NULL-terminated string is returned. 6354 On error, the original msgid is returned. The length of the string returned is 6355 undetermined until dgettext is called. 6356 6357 Errors 6358 6359 dgettext will not modify the errno global variable. 6360 6361 See Also 6362 6363 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6364 bindtextdomain, bind_textdomain_codeset 6365 6366 dngettext 6367 6368 Name 6369 6370 dngettext -- perform lookup in message catalog for the current locale 6371 6372 Synopsis 6373 6374 #include 6375 6376 char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, 6377 unsigned long int n); 6378 6379 Description 6380 6381 dngettext shall be equivalent to a call to 6382 6383 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 6384 6385 See dgettext for more information. 6386 6387 See Also 6388 6389 gettext, dgettext, ngettext, dcgettext, dcngettext, textdomain, bindtextdomain, 6390 bind_textdomain_codeset 6391 6392 err 6393 6394 Name 6395 6396 err -- display formatted error messages 6397 6398 Synopsis 6399 6400 #include 6401 6402 void err(int eval, const char *fmt ...); 6403 6404 Description 6405 6406 The err function shall display a formatted error message on the standard error 6407 stream. First, err shall write the last component of the program name, a colon 6408 character, and a space character. If fmt is non-NULL, it shall be used as a 6409 format string for the printf family of functions, and err shall write the 6410 formatted message, a colon character, and a space. Finally, the error message 6411 string affiliated with the current value of the global variable errno shall be 6412 written, followed by a newline character. 6413 6414 The err function shall not return, the program shall terminate with the exit 6415 value of eval. 6416 6417 See Also 6418 6419 error, errx 6420 6421 Return Value 6422 6423 None. 6424 6425 Errors 6426 6427 None. 6428 6429 error 6430 6431 Name 6432 6433 error -- print error message 6434 6435 Synopsis 6436 6437 void error(int exitstatus, int errnum, const char *format ...); 6438 6439 Description 6440 6441 error shall print a message to standard error. 6442 6443 error shall build the message from the following elements in their specified 6444 order: 6445 6446 1. the program name. If the application has provided a function named 6447 error_print_progname, error shall call this to supply the program name; 6448 otherwise, error uses the content of the global variable program_name. 6449 6450 2. the colon and space characters, then the result of using the printf-style 6451 format and the optional arguments. 6452 6453 3. if errnum is nonzero, error shall add the colon and space characters, then 6454 the result of strerror(errnum). 6455 6456 4. a newline. 6457 6458 If exitstatus is nonzero, error shall call exit(exitstatus). 6459 6460 See Also 6461 6462 err, errx 6463 6464 errx 6465 6466 Name 6467 6468 errx -- display formatted error message and exit 6469 6470 Synopsis 6471 6472 #include 6473 6474 void errx(int eval, const char *fmt ...); 6475 6476 Description 6477 6478 The errx function shall display a formatted error message on the standard error 6479 stream. The last component of the program name, a colon character, and a space 6480 shall be output. If fmt is non-NULL, it shall be used as the format string for 6481 the printf family of functions, and the formatted error message, a colon 6482 character, and a space shall be output. The output shall be followed by a 6483 newline character. 6484 6485 errx does not return, but shall exit with the value of eval. 6486 6487 Return Value 6488 6489 None. 6490 6491 Errors 6492 6493 None. 6494 6495 See Also 6496 6497 error, err 6498 6499 fcntl 6500 6501 Name 6502 6503 fcntl -- file control 6504 6505 Description 6506 6507 fcntl is as specified in ISO POSIX (2003), but with differences as listed 6508 below. 6509 6510 Implementation may set O_LARGEFILE 6511 6512 According to the Single UNIX Specification, only an application sets fcntl 6513 flags, for example O_LARGEFILE. However, this specification also allows an 6514 implementation to set O_LARGEFILE in the case where the system default behavior 6515 matches the O_LARGEFILE behavior, for example if sizeof(off_t) is 8. Thus, 6516 calling fcntl with the F_GETFL command may return O_LARGEFILE as well as flags 6517 explicitly set by the application. 6518 6519 fflush_unlocked 6520 6521 Name 6522 6523 fflush_unlocked -- non thread safe fflush 6524 6525 Description 6526 6527 fflush_unlocked is the same as fflush except that it need not be thread safe. 6528 That is, it may only be invoked in the ways which are legal for getc_unlocked. 6529 6530 fgetwc_unlocked 6531 6532 Name 6533 6534 fgetwc_unlocked -- non thread safe fgetwc 6535 6536 Description 6537 6538 fgetwc_unlocked is the same as fgetwc except that it need not be thread safe. 6539 That is, it may only be invoked in the ways which are legal for getc_unlocked. 6540 6541 flock 6542 6543 Name 6544 6545 flock -- apply or remove an advisory lock on an open file 6546 6547 Synopsis 6548 6549 int flock(int fd, int operation); 6550 6551 Description 6552 6553 flock applies or removes an advisory lock on the open file fd. Valid operation 6554 types are: 6555 6556 LOCK_SH 6557 6558 Shared lock. More than one process may hold a shared lock for a given file 6559 at a given time. 6560 6561 LOCK_EX 6562 6563 Exclusive lock. Only one process may hold an exclusive lock for a given 6564 file at a given time. 6565 6566 LOCK_UN 6567 6568 Unlock. 6569 6570 LOCK_NB 6571 6572 Don't block when locking. May be specified (by oring) along with one of the 6573 other operations. 6574 6575 A single file may not simultaneously have both shared and exclusive locks. 6576 6577 Return Value 6578 6579 On success, 0 is returned. On error, -1 is returned and the global variable 6580 errno is set appropriately. 6581 6582 Errors 6583 6584 EWOULDBLOCK 6585 6586 The file is locked and the LOCK_NB flag was selected. 6587 6588 fopen 6589 6590 Name 6591 6592 fopen -- open a file 6593 6594 Description 6595 6596 fopen is as specified in ISO POSIX (2003), but with differences as listed 6597 below. 6598 6599 May return ENODEV in place of ENXIO 6600 6601 Where the ISO POSIX (2003) specifies an ENXIO return, the implementation may 6602 return either ENXIO or ENODEV. Implementations are encouraged to return ENXIO. 6603 6604 6605 Note: As of spring 2004, we don't know of any Linux kernel patches to 6606 switch to ENXIO, but we believe that such a kernel patch would be accepted 6607 if submitted. 6608 6609 freopen 6610 6611 Name 6612 6613 freopen -- open a file 6614 6615 Description 6616 6617 freopen is as specified in ISO POSIX (2003), but with differences as listed 6618 below. 6619 6620 May return ENODEV in place of ENXIO 6621 6622 Where the ISO POSIX (2003) specifies an ENXIO return, the implementation may 6623 return either ENXIO or ENODEV. Implementations are encouraged to return ENXIO. 6624 6625 6626 Note: As of spring 2004, we don't know of any Linux kernel patches to 6627 switch to ENXIO, but we believe that such a kernel patch would be accepted 6628 if submitted. 6629 6630 getdomainname 6631 6632 Name 6633 6634 getdomainname -- get NIS domain name (DEPRECATED). 6635 6636 Synopsis 6637 6638 #include 6639 6640 int getdomainname (char * name , size_t namelen ); 6641 6642 Description 6643 6644 If the Network Information System (NIS) is in use, getdomainname shall copy the 6645 NIS domain name to the supplied buffer identified by name, with maximum length 6646 namelen. If the NIS domain name is not currently set, getdomainname shall copy 6647 the string "(none)" to the name. If namelen is less the length of the string to 6648 be copied, getdomainname may either truncate the string to namelen characters 6649 and place it in name (without a terminating null character), or may fail with 6650 EINVAL. 6651 6652 Note that the NIS domain name is not the same as the domain portion of a fully 6653 qualified domain name (for example, in DNS). 6654 6655 Return Value 6656 6657 On success, getdomainname shall return 0. Otherwise, it shall return -1 and set 6658 errno to indicate the error). 6659 6660 Errors 6661 6662 EINVAL 6663 6664 name was a null pointer. 6665 6666 EINVAL 6667 6668 The buffer identified by name and namelen is of insufficient size to store 6669 the NIS domain name string, and the implementation considers this an error. 6670 6671 Future Directions 6672 6673 The LSB does not include other NIS interfaces, and a future version of this 6674 specification may deprecate this interface. Application developers should avoid 6675 using this interface where possible. 6676 6677 gethostbyname_r 6678 6679 Name 6680 6681 gethostbyname_r -- find network host database entry matching host name 6682 (DEPRECATED) 6683 6684 Synopsis 6685 6686 int gethostbyname_r(__const char *__restrict __name, (struct hostent 6687 *__restrict __result_buf), char *__restrict __buf, size_t __buflen, (struct 6688 hostent **__restrict __result), int *__restrict __h_errnop); 6689 6690 Description 6691 6692 The gethostbyname_r function is deprecated; applications should call 6693 getaddrinfo instead. 6694 6695 gethostbyname_r is a reentrant version of gethostbyname that searches the 6696 network host database for a host name match. 6697 6698 getloadavg 6699 6700 Name 6701 6702 getloadavg -- get system load averages 6703 6704 Synopsis 6705 6706 #include 6707 6708 int getloadavg(double loadavg[], int nelem); 6709 6710 Description 6711 6712 getloadavg returns the number of processes in the system run queue averaged 6713 over various periods of time. Up to nelem samples are retrieved and assigned to 6714 successive elements of loadavg[]. The system imposes a maximum of 3 samples, 6715 representing averages over the last 1, 5, and 15 minutes, respectively. 6716 6717 getopt 6718 6719 Name 6720 6721 getopt -- parse command line options 6722 6723 Synopsis 6724 6725 #include 6726 6727 int getopt(int argc, char * const argv[], const char *optstring); 6728 6729 extern char *optarg; 6730 extern int optind, opterr, optopt; 6731 6732 Description 6733 6734 The getopt function shall parse command line arguments as described in ISO 6735 POSIX (2003), with the following exceptions, where LSB and POSIX specifications 6736 vary. LSB systems shall implement the modified behaviors described below. 6737 6738 Argument Ordering 6739 6740 The getopt function can process command line arguments referenced by argv in 6741 one of three ways: 6742 6743 PERMUTE 6744 6745 the order of arguments in argv is altered so that all options (and their 6746 arguments) are moved in front of all of the operands. This is the default 6747 behavior. 6748 6749 6750 Note: This behavior has undefined results if argv is not modifiable. 6751 This is to support historic behavior predating the use of const and ISO 6752 C (1999). The function prototype was aligned with ISO POSIX (2003) 6753 despite the fact that it modifies argv, and the library maintainers are 6754 unwilling to change this. 6755 6756 REQUIRE_ORDER 6757 6758 The arguments in argv are processed in exactly the order given, and option 6759 processing stops when the first non-option argument is reached, or when the 6760 element of argv is "--". This ordering can be enforced either by setting 6761 the environment variable POSIXLY_CORRECT, or by setting the first character 6762 of optstring to '+'. 6763 6764 RETURN_IN_ORDER 6765 6766 The order of arguments is not altered, and all arguments are processed. 6767 Non-option arguments (operands) are handled as if they were the argument to 6768 an option with the value 1 ('\001'). This ordering is selected by setting 6769 the first character of optstring to '-'; 6770 6771 Option Characteristics 6772 6773 LSB specifies that: 6774 6775 * an element of argv that starts with "-" (and is not exactly "-" or "--") is 6776 an option element. 6777 6778 * characters of an option element, aside from the initial "-", are option 6779 characters. 6780 6781 POSIX specifies that: 6782 6783 * applications using getopt shall obey the following syntax guidelines: 6784 6785 + option name is a single alphanumeric character from the portable 6786 character set 6787 6788 + option is preceded by the '-' delimiter character 6789 6790 + options without option-arguments should be accepted when grouped behind 6791 one '-' delimiter 6792 6793 + each option and option-argument is a separate argument 6794 6795 + option-arguments are not optional 6796 6797 + all options should precede operands on the command line 6798 6799 + the argument "--" is accepted as a delimiter indicating the end of 6800 options and the consideration of subsequent arguments, if any, as 6801 operands 6802 6803 * historical implementations of getopt support other characters as options as 6804 an allowed extension, but applications that use extensions are not 6805 maximally portable. 6806 6807 * support for multi-byte option characters is only possible when such 6808 characters can be represented as type int. 6809 6810 * applications that call any utility with a first operand starting with '-' 6811 should usually specify "--" to mark the end of the options. Standard 6812 utilities that do not support this guideline indicate that fact in the 6813 OPTIONS section of the utility description. 6814 6815 Extensions 6816 6817 LSB specifies that: 6818 6819 * if a character is followed by two colons, the option takes an optional 6820 argument; if there is text in the current argv element, it is returned in 6821 optarg, otherwise optarg is set to 0. 6822 6823 * if optstring contains W followed by a semi-colon (;), then -W foo is 6824 treated as the long option --foo. 6825 6826 6827 Note: See getopt_long for a description of long options. 6828 6829 * The first character of optstring shall modify the behavior of getopt as 6830 follows: 6831 6832 + if the first character is '+', then REQUIRE_ORDER processing shall be 6833 in effect (see above) 6834 6835 + if the first character is '-', then RETURN_IN_ORDER processing shall be 6836 in effect (see above) 6837 6838 + if the first character is ':', then getopt shall return ':' instead of 6839 '?' to indicate a missing option argument, and shall not print any 6840 diagnostic message to stderr. 6841 6842 POSIX specifies that: 6843 6844 * the -W option is reserved for implementation extensions. 6845 6846 Return Values 6847 6848 LSB specifies the following additional getopt return values: 6849 6850 * '\001' is returned if RETURN_IN_ORDER argument ordering is in effect, and 6851 the next argument is an operand, not an option. The argument is available 6852 in optarg. 6853 6854 Any other return value has the same meaning as for POSIX. 6855 6856 POSIX specifies the following getopt return values: 6857 6858 * the next option character is returned, if found successfully. 6859 6860 * ':' is returned if a parameter is missing for one of the options and the 6861 first character of optstring is ':'. 6862 6863 * '?' is returned if an unknown option character not in optstring is 6864 encountered, or if getopt detects a missing argument and the first 6865 character of optstring is not ':'. 6866 6867 * -1 is returned for the end of the option list. 6868 6869 Environment Variables 6870 6871 LSB specifies that: 6872 6873 * if the variable POSIXLY_CORRECT is set, option processing stops as soon as 6874 a non-option argument is encountered. 6875 6876 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] is the process 6877 ID for the current process), contains a space separated list of arguments 6878 that should not be treated as arguments even though they appear to be so. 6879 6880 6881 Rationale: This was used by bash 2.0 to communicate to GNU libc which 6882 arguments resulted from wildcard expansion and so should not be 6883 considered as options. This behavior was removed in bash version 2.01, 6884 but the support remains in GNU libc. 6885 6886 This behavior is DEPRECATED in this version of the LSB; future revisions of 6887 this specification may not include this requirement. 6888 6889 getopt_long 6890 6891 Name 6892 6893 getopt_long -- parse command line options 6894 6895 Synopsis 6896 6897 #define _GNU_SOURCE 6898 #include 6899 6900 int getopt_long(int argc, char * const argv[], const char *opstring, (const 6901 struct option *longopts), int *longindex); 6902 6903 Description 6904 6905 getopt_long works like getopt except that it also accepts long options, started 6906 out by two dashes. Long option names may be abbreviated if the abbreviation is 6907 unique or is an exact match for some defined option. A long option may take a 6908 parameter, of the form --arg=param or --arg param. 6909 6910 longopts is a pointer to the first element of an array of struct option 6911 declared in getopt.h as: 6912 6913 struct option { 6914 const char *name; 6915 int has_arg; 6916 int *flag; 6917 int val; 6918 }; 6919 6920 The fields in this structure have the following meaning: 6921 6922 name 6923 6924 The name of the long option. 6925 6926 has_arg 6927 6928 One of: 6929 6930 no_argument (or 0) if the option does not take an argument, 6931 required_argument (or 1) if the option requires an argument, or 6932 optional_argument (or 2) if the option takes an optional argument. 6933 6934 flag 6935 6936 specifies how results are returned for a long option. If flag is NULL, then 6937 getopt_long shall return val. (For example, the calling program may set val 6938 to the equivalent short option character.) Otherwise, getopt_long returns 6939 0, and flag shall point to a variable which shall be set to val if the 6940 option is found, but left unchanged if the option is not found. 6941 6942 val 6943 6944 The value to return, or to load into the variable pointed to by flag. 6945 6946 Return Value 6947 6948 getopt_long returns the option character if a short option was found 6949 successfully, or ":" if there was a missing parameter for one of the options, 6950 or "?" for an unknown option character, or -1 for the end of the option list. 6951 6952 For a long option, getopt_long returns val if flag is NULL, and 0 otherwise. 6953 Error and -1 returns are the same as for getopt, plus "?" for an ambiguous 6954 match or an extraneous parameter. 6955 6956 getopt_long_only 6957 6958 Name 6959 6960 getopt_long_only -- parse command line options 6961 6962 Synopsis 6963 6964 #define _GNU_SOURCE 6965 #include 6966 6967 int getopt_long_only(int argc, char * const argv[], const char *optstring, 6968 (const struct option *longopts), int *longindex); 6969 6970 Description 6971 6972 getopt_long_only is like getopt_long, but "-" as well as "--" can indicate a 6973 long option. If an option that starts with "-" (not "--") doesn't match a long 6974 option, but does match a short option, it is parsed as a short option instead. 6975 6976 Return Value 6977 6978 getopt_long_only returns the option character if the option was found 6979 successfully, or ":" if there was a missing parameter for one of the options, 6980 or "?" for an unknown option character, or -1 for the end of the option list. 6981 6982 getopt_long_only also returns the option character when a short option is 6983 recognized. For a long option, they return val if flag is NULL, and 0 6984 otherwise. Error and -1 returns are the same as for getopt, plus "?" for an 6985 ambiguous match or an extraneous parameter. 6986 6987 gettext 6988 6989 Name 6990 6991 gettext -- Search message catalogs for a string 6992 6993 Synopsis 6994 6995 #include 6996 6997 char *gettext(const char *msgid); 6998 6999 Description 7000 7001 The gettext function shall search the currently selected message catalogs for a 7002 string identified by the string msgid. If a string is located, that string 7003 shall be returned. 7004 7005 The gettext function is equivalent to dcgettext(NULL, msgid, LC_MESSAGES). 7006 7007 Return Value 7008 7009 If a string is found in the currently selected message catalogs for msgid, then 7010 a pointer to that string shall be returned. Otherwise, a pointer to msgid shall 7011 be returned. 7012 7013 Applications shall not modify the string returned by gettext. 7014 7015 Errors 7016 7017 None. 7018 7019 The gettext function shall not modify errno. 7020 7021 See Also 7022 7023 dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 7024 bindtextdomain, bind_textdomain_codeset 7025 7026 getutent 7027 7028 Name 7029 7030 getutent -- access user accounting database entries 7031 7032 Synopsis 7033 7034 #include 7035 7036 struct utmp *getutent(void); 7037 7038 Description 7039 7040 The getutent function shall read the next entry from the user accounting 7041 database. 7042 7043 Return Value 7044 7045 Upon successful completion, getutent shall return a pointer to a utmp structure 7046 containing a copy of the requested entry in the user accounting database. 7047 Otherwise, a null pointer shall be returned. The return value may point to a 7048 static area which is overwritten by a subsequent call to getutent. 7049 7050 Errors 7051 7052 None defined. 7053 7054 getutent_r 7055 7056 Name 7057 7058 getutent_r -- access user accounting database entries 7059 7060 Synopsis 7061 7062 int getutent_r(struct utmp * buffer, struct utmp ** result); 7063 7064 Description 7065 7066 The getutent_r function is a reentrant version of the getutent function. On 7067 entry, buffer should point to a user supplied buffer to which the next entry in 7068 the database will be copied, and result should point to a location where the 7069 result will be stored. 7070 7071 Return Value 7072 7073 On success, getutent_r shall return 0 and set the location referenced by result 7074 to a pointer to buffer. Otherwise, getutent_r shall return -1 and set the 7075 location referenced by result to NULL. 7076 7077 glob64 7078 7079 Name 7080 7081 glob64 -- find pathnames matching a pattern (Large File Support) 7082 7083 Synopsis 7084 7085 #include 7086 7087 int glob64(const char *pattern, int flags, int (*errfunc) (const char *, int), 7088 glob64_t *pglob); 7089 7090 Description 7091 7092 The glob64 function is a large-file version of the glob defined in ISO POSIX 7093 (2003). It shall search for pathnames matching pattern according to the rules 7094 used by the shell, /bin/sh. No tilde expansion or parameter substitution is 7095 done; see wordexp. 7096 7097 The results of a glob64 call are stored in the structure pointed to by pglob, 7098 which is a glob64_t declared in glob.h with the following members: 7099 7100 typedef struct 7101 { 7102 size_t gl_pathc; 7103 char **gl_pathv; 7104 size_t gl_offs; 7105 int gl_flags; 7106 void (*gl_closedir) (void *); 7107 struct dirent64 *(*gl_readdir64) (void *); 7108 void *(*gl_opendir) (const char *); 7109 int (*gl_lstat) (const char *, struct stat *); 7110 int (*gl_stat) (const char *, struct stat *); 7111 } 7112 glob64_t; 7113 7114 Structure members with the same name as corresponding members of a glob_t as 7115 defined in ISO POSIX (2003) shall have the same purpose. 7116 7117 Other members are defined as follows: 7118 7119 gl_flags 7120 7121 reserved for internal use 7122 7123 gl_closedir 7124 7125 pointer to a function capable of closing a directory opened by gl_opendir 7126 7127 gl_readdir64 7128 7129 pointer to a function capable of reading entries in a large directory 7130 7131 gl_opendir 7132 7133 pointer to a function capable of opening a large directory 7134 7135 gl_stat 7136 7137 pointer to a function capable of returning file status for a large file 7138 7139 gl_lstat 7140 7141 pointer to a function capable of returning file status information for a 7142 large file or symbolic link 7143 7144 A large file or large directory is one with a size which cannot be represented 7145 by a variable of type off_t. 7146 7147 Return Value 7148 7149 On success, 0 is returned. Other possible returns are: 7150 7151 GLOB_NOSPACE 7152 7153 out of memory 7154 7155 GLOB_ABORTED 7156 7157 read error 7158 7159 GLOB_NOMATCH 7160 7161 no match found 7162 7163 globfree64 7164 7165 Name 7166 7167 globfree64 -- free memory from glob64() (Large File Support) 7168 7169 Synopsis 7170 7171 #include 7172 7173 void globfree64(glob64_t *pglob); 7174 7175 Description 7176 7177 globfree64 frees the dynamically allocated storage from an earlier call to 7178 glob64. 7179 7180 globfree64 is a 64-bit version of globfree. 7181 7182 initgroups 7183 7184 Name 7185 7186 initgroups -- initialize the supplementary group access list 7187 7188 Synopsis 7189 7190 #include 7191 #include 7192 7193 int initgroups(const char *user, gid_t group); 7194 7195 Description 7196 7197 If the process has appropriate privilege, the initgroups function shall 7198 initialize the Supplementary Group IDs for the current process by reading the 7199 group database and using all groups of which user is a member. The additional 7200 group group is also added to the list. 7201 7202 Return Value 7203 7204 On success, 0 is returned. On error, -1 is returned and the global variable 7205 errno is set appropriately. 7206 7207 Errors 7208 7209 EPERM 7210 7211 The calling process does not have sufficient privileges. 7212 7213 ENOMEM 7214 7215 Insufficient memory to allocate group information structure. 7216 7217 See Also 7218 7219 setgroups 7220 7221 ioctl 7222 7223 Name 7224 7225 ioctl -- control device 7226 7227 Synopsis 7228 7229 #include 7230 7231 int ioctl (int d , int request , ... ); 7232 7233 Description 7234 7235 The ioctl function shall manipulate the underlying device parameters of special 7236 files. d shall be an open file descriptor referring to a special file. The 7237 ioctl function shall take three parameters; the type and value of the third 7238 parameter is dependent on the device and request. 7239 7240 Conforming LSB applications shall not call ioctl except in situations 7241 explicitly stated in this specification. 7242 7243 Return Value 7244 7245 On success, 0 is returned. An ioctl may use the return value as an output 7246 parameter and return a non-negative value on success. On error, -1 is returned 7247 and the global variable errno is set appropriately. 7248 7249 Errors 7250 7251 EBADF 7252 7253 d is not a valid descriptor. 7254 7255 EFAULT 7256 7257 The third parameter references an inaccessible memory area. 7258 7259 ENOTTY 7260 7261 d is not associated with a character special device. 7262 7263 ENOTTY 7264 7265 The specified request does not apply to the kind of object that d 7266 references. 7267 7268 EINVAL 7269 7270 request or the third parameter is not valid. 7271 7272 sockio 7273 7274 Name 7275 7276 sockio -- socket ioctl commands 7277 7278 Synopsis 7279 7280 #include 7281 #include 7282 #include 7283 7284 int ioctl(int sockfd, int request, char *argp); 7285 7286 Description 7287 7288 Socket ioctl commands are a subset of the ioctl calls, which can perform a 7289 variety of functions on sockets. sockfd shall contain the value of a file 7290 descriptor that was created with the socket or accept calls. 7291 7292 Socket ioctl commands apply to the underlying network interfaces, and affect 7293 the entire system, not just the file descriptor used to issue the ioctl. 7294 7295 The following values for request are accepted: 7296 7297 SIOCGIFCONF 7298 7299 Gets the interface configuration list for the system. 7300 7301 7302 Note: SIOCGIFCONF is similar to the if_nameindex family found in the 7303 ISO POSIX (2003) or the getifaddrs family found in BSD derived systems. 7304 7305 argp shall point to a ifconf structure, as described in . Before 7306 calling, the caller shall set the ifc_ifcu.ifcu_req field to point to an 7307 array of ifreq structures, and set ifc_len to the size in bytes of this 7308 allocated array. Upon return, ifc_len will contain the size in bytes of the 7309 array which was actually used. If it is the same as the length upon 7310 calling, the caller should assume that the array was too small and try 7311 again with a larger array. 7312 7313 On success, SIOCGIFCONF can return any nonnegative value. 7314 7315 7316 Rationale: Historical UNIX systems disagree on the meaning of the 7317 return value. 7318 7319 SIOCGIFFLAGS 7320 7321 Gets the interface flags for the indicated interface. argp shall point to a 7322 ifreq structure. Before calling, the caller should fill in the ifr_name 7323 field with the interface name, and upon return, the ifr_ifru.ifru_flags 7324 field is set with the interface flags. 7325 7326 SIOCGIFADDR 7327 7328 Gets the interface address for the given interface. argp shall point to a 7329 ifreq structure. Before calling, the caller should fill in the ifr_name 7330 field with the interface name, and upon return, the ifr_ifru.ifru_addr 7331 field is set with the interface address. 7332 7333 SIOCGIFNETMASK 7334 7335 Gets the network mask for the given interface. argp shall point to a ifreq 7336 structure. Before calling, the caller should fill in the ifr_name field 7337 with the interface name, and upon return, the ifr_ifru.ifru_netmask field 7338 is set with the network mask. 7339 7340 FIONREAD 7341 7342 Returns the amount of queued unread data in the receive buffer. argp shall 7343 point to an integer where the result is to be placed. 7344 7345 Return Value 7346 7347 On success, if request is SIOCGIFCONF, a non-negative integer shall be 7348 returned. If request is not SIOCGIFCONF, on success 0 is returned. On error, -1 7349 is returned and the global variable errno is set appropriately. 7350 7351 Errors 7352 7353 EBADF 7354 7355 sockfd is not a valid descriptor. 7356 7357 EFAULT 7358 7359 argp references an inaccessible memory area. 7360 7361 ENOTTY 7362 7363 The specified request does not apply to the kind of object that the 7364 descriptor sockfd references. 7365 7366 EINVAL 7367 7368 Either request or argp is invalid. 7369 7370 ENOTCONN 7371 7372 The operation is only defined on a connected socket, but the socket wasn't 7373 connected. 7374 7375 kill 7376 7377 Name 7378 7379 kill -- send a signal 7380 7381 Synopsis 7382 7383 #include 7384 7385 int kill(pid_t pid, int sig); 7386 7387 Description 7388 7389 kill is as specified in the ISO POSIX (2003), but with differences as listed 7390 below. 7391 7392 Process ID -1 doesn't affect calling process 7393 7394 If pid is specified as -1, sig shall not be sent to the calling process. Other 7395 than this, the rules in the ISO POSIX (2003) apply. 7396 7397 7398 Rationale: This was a deliberate Linus decision after an unpopular 7399 experiment in including the calling process in the 2.5.1 kernel. See "What 7400 does it mean to signal everybody?", Linux Weekly News, 20 December 2001, 7401 http://lwn.net/2001/1220/kernel.php3 7402 7403 mbsnrtowcs 7404 7405 Name 7406 7407 mbsnrtowcs -- convert a multibyte string to a wide character string 7408 7409 Synopsis 7410 7411 #include 7412 7413 size_t mbsnrtowcs(wchar_t *dest, const char **src, size_t nms, size_t len, 7414 mbstate_t *ps); 7415 7416 Description 7417 7418 mbsnrtowcs is like mbsrtowcs, except that the number of bytes to be converted, 7419 starting at src, is limited to nms. 7420 7421 If dest is not a NULL pointer, mbsnrtowcs converts at most nms bytes from the 7422 multibyte string src to a wide-character string starting at dest. At most, len 7423 wide characters are written to dest. The state ps is updated. 7424 7425 The conversion is effectively performed by repeatedly calling: 7426 7427 7428 mbrtowc(dest, *src, n, ps) 7429 7430 where n is some positive number, as long as this call succeeds, and then 7431 incrementing dest by one and src by the number of bytes consumed. 7432 7433 The conversion can stop for three reasons: 7434 7435 * An invalid multibyte sequence has been encountered. In this case src is 7436 left pointing to the invalid multibyte sequence, (size_t)(-1) is returned, 7437 and errno is set to EILSEQ. 7438 7439 * The nms limit forces a stop, or len non-L'\0' wide characters have been 7440 stored at dest. In this case, src is left pointing to the next multibyte 7441 sequence to be converted, and the number of wide characters written to dest 7442 is returned. 7443 7444 * The multibyte string has been completely converted, including the 7445 terminating '\0' (which has the side effect of bringing back ps to the 7446 initial state). In this case, src is set to NULL, and the number of wide 7447 characters written to dest, excluding the terminating L'\0' character, is 7448 returned. 7449 7450 If dest is NULL, len is ignored, and the conversion proceeds as above, except 7451 that the converted wide characters are not written out to memory, and that no 7452 destination length limit exists. 7453 7454 In both of the above cases, if ps is a NULL pointer, a static anonymous state 7455 only known to mbsnrtowcs is used instead. 7456 7457 The programmer shall ensure that there is room for at least len wide characters 7458 at dest. 7459 7460 Return Value 7461 7462 mbsnrtowcs returns the number of wide characters that make up the converted 7463 part of the wide character string, not including the terminating null wide 7464 character. If an invalid multibyte sequence was encountered, (size_t)(-1) is 7465 returned, and the global variable errno is set to EILSEQ. 7466 7467 Notes 7468 7469 The behavior of mbsnrtowcs depends on the LC_CTYPE category of the current 7470 locale. 7471 7472 Passing NULL as ps is not multi-thread safe. 7473 7474 memmem 7475 7476 Name 7477 7478 memmem -- locate bytes 7479 7480 Synopsis 7481 7482 #define _GNU_SOURCE 7483 #include 7484 7485 void *memmem(const void *haystack, size_t haystacklen, const void *needle, 7486 size_t needlelen); 7487 7488 Description 7489 7490 memmem finds the start of the first occurrence of the byte array referenced by 7491 needle of length needlelen in the memory area haystack of length haystacklen. 7492 7493 Return Value 7494 7495 memmem returns a pointer to the beginning of the byte array, or NULL if the 7496 byte array is not found. 7497 7498 Notes 7499 7500 Earlier versions of the C library (prior to glibc 2.1) contained a memmem with 7501 various problems, and application developers should treat this function with 7502 care. 7503 7504 memrchr 7505 7506 Name 7507 7508 memrchr -- scan memory for a character 7509 7510 Synopsis 7511 7512 #include 7513 7514 void *memrchr(const void *s, int c, size_t n); 7515 7516 Description 7517 7518 The memrchr function shall locate the last occurence of c (converted to an 7519 unsigned char) in the initial n bytes (each interpreted as an unsigned char) of 7520 the object pointed to by s. 7521 7522 Return Value 7523 7524 The memrchr shall return a pointer to the located byte, or a null pointer if 7525 the byte does not occur in the object. 7526 7527 Errors 7528 7529 No errors are defined. 7530 7531 See Also 7532 7533 memchr 7534 7535 ngettext 7536 7537 Name 7538 7539 ngettext -- Search message catalogs for plural string 7540 7541 Synopsis 7542 7543 #include 7544 7545 char *ngettext(const char *msgid1, const char *msgid2, unsigned long int n); 7546 7547 Description 7548 7549 The ngettext function shall search the currently selected message catalogs for 7550 a string matching the singular string msgid1. If a string is located, and if n 7551 is 1, that string shall be returned. If n is not 1, a pluralized version 7552 (dependant on n) of the string shall be returned. 7553 7554 The ngettext function is equivalent to dcngettext(NULL, msgid1, msgid2, n, 7555 LC_MESSAGES). 7556 7557 Return Value 7558 7559 If a string is found in the currently selected message catalogs for msgid1, 7560 then if n is 1 a pointer to the located string shall be returned. If n is not 7561 1, a pointer to an appropriately pluralized version of the string shall be 7562 returned. If no message could be found in the currently selected mesage 7563 catalogs, then if n is 1, a pointer to msgid1 shall be returned, otherwise a 7564 pointer to msgid2 shall be returned. 7565 7566 Applications shall not modify the string returned by ngettext. 7567 7568 Errors 7569 7570 None. 7571 7572 The ngettext function shall not modify errno. 7573 7574 See Also 7575 7576 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 7577 bindtextdomain, bind_textdomain_codeset 7578 7579 obstack_free 7580 7581 Name 7582 7583 obstack_free -- free an object in the obstack 7584 7585 Synopsis 7586 7587 #include 7588 7589 void obstack_free((struct obstack *obstack), void *block); 7590 7591 Description 7592 7593 obstack_free frees an object in the obstack. 7594 7595 Future Directions 7596 7597 Future versions of this specification may not include support for this 7598 interface. 7599 7600 open 7601 7602 Name 7603 7604 open -- open a file 7605 7606 Synopsis 7607 7608 #include 7609 #include 7610 7611 int open(const char *path, int oflag, ...); 7612 7613 Description 7614 7615 The open function shall behave as specified in ISO POSIX (2003), except with 7616 differences as listed below. 7617 7618 May return ENODEV in place of ENXIO 7619 7620 Where ISO POSIX (2003) specifies an ENXIO return, a conforming implementation 7621 may return either ENXIO or ENODEV. Implementations are encouraged to return 7622 ENXIO. 7623 7624 7625 Rationale: As of spring 2004, no Linux kernel patches to switch to ENXIO 7626 are known, but it is believed that such a kernel patch would be accepted if 7627 submitted. 7628 7629 opterr 7630 7631 Name 7632 7633 opterr -- external variable used in getopt() 7634 7635 Synopsis 7636 7637 extern int opterr; 7638 7639 Description 7640 7641 opterr is used as a flag to suppress an error message generated by getopt. When 7642 opterr is set to 0, it suppresses the error message generated by getopt when 7643 that function does not recognize an option character. 7644 7645 optind 7646 7647 Name 7648 7649 optind -- external variable used in getopt() 7650 7651 Synopsis 7652 7653 extern int optind; 7654 7655 Description 7656 7657 optind holds the current index of the array argv[], which contains the command 7658 line options being parsed by getopt. 7659 7660 optopt 7661 7662 Name 7663 7664 optopt -- external variable used in getopt() 7665 7666 Synopsis 7667 7668 extern int optopt; 7669 7670 Description 7671 7672 optopt holds the unknown option character when that option character is not 7673 recognized by getopt. 7674 7675 pmap_getport 7676 7677 Name 7678 7679 pmap_getport -- Find the port number assigned to a service registered with a 7680 portmapper. 7681 7682 Synopsis 7683 7684 #include 7685 7686 u_short *pmap_getport(struct sockaddr_in *address, __const u_long program, 7687 __const u_long *version, u_int protocol); 7688 7689 Description 7690 7691 The pmap_getport function shall return the port number assigned to a service 7692 registered with a RPC Binding service running on a given target system, using 7693 the protocol described in RFC 1833: Binding Protocols for ONC RPC Version 2. 7694 The pmap_getport function shall be called given the RPC program number program, 7695 the program version version, and transport protocol protocol. Conforming 7696 implementations shall support both IPPROTO_UDP and IPPROTO_TCP protocols. On 7697 entry, address shall specify the address of the system on which the portmapper 7698 to be contacted resides. The value of address->sin_port shall be ignored, and 7699 the standard value for the portmapper port shall always be used. 7700 7701 Note: Security and network restrictions may prevent a conforming 7702 application from contacting a remote RPC Binding Service. 7703 7704 Return Value 7705 7706 On success, the pmap_getport function shall return the port number in host byte 7707 order of the RPC application registered with the remote portmapper. On failure, 7708 if either the program was not registered or the remote portmapper service could 7709 not be reached, the pmap_getport function shall return 0. If the remote portmap 7710 service could not be reached, the status is left in the global variable 7711 rpc_createerr. 7712 7713 pmap_set 7714 7715 Name 7716 7717 pmap_set -- Establishes mapping to machine's RPC Bind service. 7718 7719 Synopsis 7720 7721 #include 7722 7723 *pmap_set(__const u_long program, __const u_long version, int protocol, u_short 7724 port); 7725 7726 Description 7727 7728 pmap_set establishes a mapping between the triple [program,version,protocol] 7729 and port on the machine's RPC Bind service. The value of protocol is most 7730 likely IPPROTO_UDP or IPPROTO_TCP. Automatically done by svc_register. 7731 7732 Return Value 7733 7734 pmap_set returns 1 if it suceeds, 0 otherwise. 7735 7736 pmap_unset 7737 7738 Name 7739 7740 pmap_unset -- Destroys RPC Binding 7741 7742 Synopsis 7743 7744 #include 7745 7746 void pmap_unset(u_long prognum, u_long versnum); 7747 7748 Description 7749 7750 As a user interface to the RPC Bind service, pmap_unset destroys all mapping 7751 between the triple [prognum,versnum, *] and ports on the machine's RPC Bind 7752 service. 7753 7754 Return Value 7755 7756 pmap_unset returns 1 if it succeeds, zero otherwise. 7757 7758 psignal 7759 7760 Name 7761 7762 psignal -- print signal message 7763 7764 Synopsis 7765 7766 #include 7767 7768 void psignal(int sig, const char *s); 7769 7770 extern const char *const sys_siglist[] 7771 7772 Description 7773 7774 The psignal function shall display a message on the stderr stream. If s is not 7775 the null pointer, and does not point to an empty string (e.g. "\0"), the 7776 message shall consist of the string s, a colon, a space, and a string 7777 describing the signal number sig; otherwise psignal shall display only a 7778 message describing the signal number sig. If sig is invalid, the message 7779 displayed shall indicate an unknown signal. 7780 7781 The array sys_siglist holds the signal description strings indexed by signal 7782 number. 7783 7784 Return Value 7785 7786 psignal returns no value. 7787 7788 random_r 7789 7790 Name 7791 7792 random_r -- generate random number 7793 7794 Synopsis 7795 7796 int random_r((struct random_data *__restrict __buf), int32_t *__restrict 7797 __result); 7798 7799 Description 7800 7801 random_r is a reentrant version of random, which generates a pseudorandom 7802 number. 7803 7804 Future Directions 7805 7806 Since this function requires support from other functions not specified in this 7807 specification (most notably initstate_r), a future version of this 7808 specification may deprecate this interface. 7809 7810 setbuffer 7811 7812 Name 7813 7814 setbuffer -- stream buffering operation 7815 7816 Synopsis 7817 7818 #include 7819 7820 void setbuffer(FILE *stream, char *buf, size_t size); 7821 7822 Description 7823 7824 setbuffer is an alias for the call to setvbuf. It works the same, except that 7825 the size of the buffer in setbuffer is up to the caller, rather than being 7826 determined by the default BUFSIZ. 7827 7828 setdomainname 7829 7830 Name 7831 7832 setdomainname -- set NIS domain name (DEPRECATED). 7833 7834 Synopsis 7835 7836 #include 7837 7838 int setdomainname (char * name , size_t namelen ); 7839 7840 Description 7841 7842 If NIS is in use, set the NIS domain name. Note that this is not the same as 7843 the domain name which provides the domain portion of a fully qualified domain 7844 name (for example, in DNS). If NIS is not in use, this function may set the 7845 domain name anyway, or it may fail. 7846 7847 This call shall fail unless the caller has appropriate privileges. 7848 7849 namelen shall be the length of the string pointed to by name. 7850 7851 Return Value 7852 7853 On success, setdomainname shall return 0. Otherwise, it shall return -1 and set 7854 errno to indicate the error. 7855 7856 Errors 7857 7858 EPERM 7859 7860 The process did not have sufficient privilege to set the domain name. 7861 7862 EINVAL 7863 7864 name is a null pointer. 7865 7866 setgroups 7867 7868 Name 7869 7870 setgroups -- set list of supplementary group IDs 7871 7872 Synopsis 7873 7874 #include 7875 7876 int setgroups(size_t size, const gid_t *list); 7877 7878 Description 7879 7880 If the process has appropriate privilege, the setgroups function shall set the 7881 supplementary group IDs for the current process. list shall reference an array 7882 of size group IDs. A process may have at most NGROUPS_MAX supplementary group 7883 IDs. 7884 7885 Return Value 7886 7887 On successful completion, 0 is returned. On error, -1 is returned and the errno 7888 is set to indicate the error. 7889 7890 Errors 7891 7892 EFAULT 7893 7894 list has an invalid address. 7895 7896 EPERM 7897 7898 The process does not have appropriate privileges. 7899 7900 EINVAL 7901 7902 size is greater than NGROUPS_MAX. 7903 7904 sethostid 7905 7906 Name 7907 7908 sethostid -- set the unique identifier of the current host 7909 7910 Synopsis 7911 7912 #include 7913 7914 int sethostid(long int hostid); 7915 7916 Description 7917 7918 sethostid sets a unique 32-bit identifier for the current machine. The 32-bit 7919 identifier is intended to be unique among all UNIX systems in existence. This 7920 normally resembles the Internet address for the local machine as returned by 7921 gethostbyname(3), and thus usually never needs to be set. 7922 7923 The sethostid call is restricted to the superuser. 7924 7925 hostid is stored in the file /etc/hostid. 7926 7927 Return Value 7928 7929 gethostid returns the 32-bit identifier for the current host as set by 7930 sethostid(2). 7931 7932 Files 7933 7934 /etc/hostid 7935 7936 sethostname 7937 7938 Name 7939 7940 sethostname -- set host name 7941 7942 Synopsis 7943 7944 #include 7945 #include 7946 #include 7947 7948 int sethostname(const char *name, size_t len); 7949 7950 Description 7951 7952 If the process has appropriate privileges, the sethostname function shall 7953 change the host name for the current macine. The name shall point to a 7954 null-terminated string of at most len bytes that holds the new hostname. 7955 7956 If the symbol HOST_NAME_MAX is defined, or if sysconf(_SC_HOST_NAME_MAX) 7957 returns a value greater than 0, this value shall represent the maximum length 7958 of the new hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this value 7959 shall represent the maximum length for the new hostname. If none of these 7960 values are defined, the maximum length shall be the size of the nodename field 7961 of the utsname structure. 7962 7963 Return Value 7964 7965 On success, 0 is returned. On error, -1 is returned and the global variable 7966 errno is set appropriately. 7967 7968 Errors 7969 7970 EINVAL 7971 7972 len is negative or larger than the maximum allowed size. 7973 7974 EPERM 7975 7976 the process did not have appropriate privilege. 7977 7978 EFAULT 7979 7980 name is an invalid address. 7981 7982 Rationale 7983 7984 ISO POSIX (2003) guarantees that: 7985 7986 7987 Maximum length of a host name (not including the terminating null) as 7988 returned from the gethostname function shall be at least 255 bytes. 7989 7990 The glibc C library does not currently define HOST_NAME_MAX, and although it 7991 provides the name _SC_HOST_NAME_MAX a call to sysconf returns -1 and does not 7992 alter errno in this case (indicating that there is no restriction on the 7993 hostname length). However, the glibc manual idicates that some implementations 7994 may have MAXHOSTNAMELEN as a means of detecting the maximum length, while the 7995 Linux kernel at release 2.4 and 2.6 stores this hostname in the utsname 7996 structure. While the glibc manual suggests simply shortening the name until 7997 sethostname succeeds, the LSB requires that one of the first four mechanisms 7998 works. Future versions of glibc may provide a more reasonable result from 7999 sysconf(_SC_HOST_NAME_MAX). 8000 8001 setsockopt 8002 8003 Name 8004 8005 setsockopt -- set options on sockets 8006 8007 Synopsis 8008 8009 #include 8010 #include 8011 8012 int setsockopt(int sockfd, int level, int optname, void *optval, socklen_t 8013 optlen); 8014 8015 Description 8016 8017 In addition to the setsockopt options specified in SUSv3, setsockopt also 8018 supports the options specified here. 8019 8020 The following setsockopt operations are provided for level IPPROTO_IP: 8021 8022 IP_MULTICAST_TTL 8023 8024 Set or reads the time-to-live value of outgoing multicast packets for this 8025 socket. optval is a pointer to an integer which contains the new TTL value. 8026 8027 IP_MULTICAST_LOOP 8028 8029 Sets a boolean flag indicating whether multicast packets originating 8030 locally should be looped back to the local sockets. optval is a pointer to 8031 an integer which contains the new flag value. 8032 8033 IP_ADD_MEMBERSHIP 8034 8035 Join a multicast group. optval is a pointer to a ip_mreq structure. Before 8036 calling, the caller should fill in the imr_multiaddr field with the 8037 multicast group address and the imr_address field with the address of the 8038 local interface. If imr_address is set to INADDR_ANY, then an appropriate 8039 interface is chosen by the system. 8040 8041 IP_DROP_MEMBERSHIP 8042 8043 Leave a multicast group. optval is a pointer to a ip_mreq structure 8044 containing the same values as were used with IP_ADD_MEMBERSHIP. 8045 8046 IP_MULTICAST_IF 8047 8048 Set the local device for a multicast socket. optval is a pointer to a 8049 ip_mreq structure initialized in the same manner as with IP_ADD_MEMBERSHIP. 8050 8051 The ip_mreq structure contains two struct in_addr fields: imr_multiaddr and 8052 imr_address. 8053 8054 Return Value 8055 8056 On success, 0 is returned. On error, -1 is returned and the global variable 8057 errno is set appropriately. 8058 8059 setutent 8060 8061 Name 8062 8063 setutent -- access user accounting database entries 8064 8065 Synopsis 8066 8067 #include 8068 8069 void setutent(void); 8070 8071 Description 8072 8073 The setutent function shall reset the user accounting database such that the 8074 next call to getutent shall be return the first record in the database. It is 8075 recommended to call it before any of the other functions that operate on the 8076 user accounting databases (e.g. getutent) 8077 8078 Return Value 8079 8080 None. 8081 8082 sigandset 8083 8084 Name 8085 8086 sigandset -- build a new signal set by combining the two input sets using 8087 logical AND 8088 8089 Synopsis 8090 8091 #include 8092 8093 int sigandset(sigset_t *set, const sigset_t *left, const sigset_t *right); 8094 8095 Description 8096 8097 The sigandset shall combine the two signal sets referenced by left and right, 8098 using a logical AND operation, and shall place the result in the location 8099 referenced by set, The resulting signal set shall contain only signals that are 8100 in both the set referenced by left and the set referenced by right. 8101 8102 Return Value 8103 8104 On success, sigandset shall return 0. Otherise, sigandset shall return -1 and 8105 set errno to indicate the error. 8106 8107 Errors 8108 8109 EINVAL 8110 8111 One or more of set, left, or right was a null pointer. 8112 8113 See Also 8114 8115 sigorset 8116 8117 sigblock 8118 8119 Name 8120 8121 sigblock -- manipulate the signal mask 8122 8123 Synopsis 8124 8125 #include _BSD_SOURCE 8126 #include 8127 8128 int sigblock(int mask); 8129 8130 Description 8131 8132 The sigblock function shall add the signals corresponding to the bits set in 8133 mask to the set of signals currently being blocked from delivery. 8134 8135 Return Value 8136 8137 The sigblock function shall return the previous signal mask. 8138 8139 Errors 8140 8141 None. 8142 8143 Notes 8144 8145 sigblock is made obsolete by sigprocmask(2). A future version of this 8146 specification may deprecate this function. 8147 8148 siggetmask 8149 8150 Name 8151 8152 siggetmask -- manipulate the signal mask 8153 8154 Synopsis 8155 8156 #define _BSD_SOURCE 8157 #include 8158 8159 int siggetmask(void); 8160 8161 Description 8162 8163 The siggetmask function shall return the current set of masked signals. 8164 8165 Notes 8166 8167 siggetmask is made obsolete by sigprocmask(2). 8168 8169 sigisemptyset 8170 8171 Name 8172 8173 sigisemptyset -- check for empty signal set 8174 8175 Synopsis 8176 8177 #include 8178 8179 int sigisemptyset(const sigset_t *set); 8180 8181 Description 8182 8183 The sigisemptyset function shall check for empty signal set referenced by set. 8184 8185 Return Value 8186 8187 The sigisemptyset function shall return a positive non-zero value if the signal 8188 set referenced by set is empty, or zero if this set is empty. On error, 8189 sigisemptyset shall return -1 and set errno to indicate the error. 8190 8191 Errors 8192 8193 EINVAL 8194 8195 set is a null pointer. 8196 8197 sigorset 8198 8199 Name 8200 8201 sigorset -- build a new signal set by combining the two input sets using 8202 logical OR 8203 8204 Synopsis 8205 8206 #include 8207 8208 int sigorset(sigset_t *set, const sigset_t *left, const sigset_t *right); 8209 8210 Description 8211 8212 The sigorset shall combine the two signal sets referenced by left and right, 8213 using a logical OR operation, and shall place the result in the location 8214 referenced by set, The resulting signal set shall contain only signals that are 8215 in either the set referenced by left or the set referenced by right. 8216 8217 Return Value 8218 8219 On success, sigorset shall return 0. Otherise, sigorset shall return -1 and set 8220 errno to indicate the error. 8221 8222 Errors 8223 8224 EINVAL 8225 8226 One or more of set, left, or right was a null pointer. 8227 8228 See Also 8229 8230 sigorset 8231 8232 sigreturn 8233 8234 Name 8235 8236 sigreturn -- return from signal handler and cleanup stack frame 8237 8238 Synopsis 8239 8240 int sigreturn(unsigned long __unused); 8241 8242 Description 8243 8244 The sigreturn function is used by the system to cleanup after a signal handler 8245 has returned. This function is not in the source standard; it is only in the 8246 binary standard. 8247 8248 Return Value 8249 8250 sigreturn never returns. 8251 8252 stime 8253 8254 Name 8255 8256 stime -- set time 8257 8258 Synopsis 8259 8260 #define _SVID_SOURCE 8261 #include 8262 8263 int stime(time_t *t); 8264 8265 Description 8266 8267 If the process has appropriate privilege, the stime function shall set the 8268 system's idea of the time and date. Time, referenced by t, is measured in 8269 seconds from the epoch (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 8270 1970). 8271 8272 Return Value 8273 8274 On success, stime shall return 0. Otherwise, stime shall return -1 and errno 8275 shall be set to indicate the error. 8276 8277 Errors 8278 8279 EPERM 8280 8281 The process does not have appropriate privilege. 8282 8283 EINVAL 8284 8285 t is a null pointer. 8286 8287 stpcpy 8288 8289 Name 8290 8291 stpcpy -- copy a string returning a pointer to its end 8292 8293 Synopsis 8294 8295 #include 8296 8297 char *stpcpy(char * restrict dest, const char * restrict src); 8298 8299 Description 8300 8301 The stpcpy function shall copy the string pointed to by src (including the 8302 terminating '\0' character) to the array pointed to by dest. The strings may 8303 not overlap, and the destination string dest shall be large enough to receive 8304 the copy. 8305 8306 Return Value 8307 8308 stpcpy returns a pointer to the end of the string dest (that is, the address of 8309 the terminating '\0' character) rather than the beginning. 8310 8311 Example 8312 8313 This program uses stpcpy to concatenate foo and bar to produce foobar, which it 8314 then prints. 8315 8316 #include 8317 8318 int 8319 main (void) 8320 { 8321 char buffer[256]; 8322 char *to = buffer; 8323 to = stpcpy (to, "foo"); 8324 to = stpcpy (to, "bar"); 8325 printf ("%s\n", buffer); 8326 } 8327 8328 stpncpy 8329 8330 Name 8331 8332 stpncpy -- copy a fixed-size string, returning a pointer to its end 8333 8334 Synopsis 8335 8336 #include 8337 8338 char *stpncpy(char * restrict dest, const char * restrict src, size_t n); 8339 8340 Description 8341 8342 The stpncpy function shall copy at most n characters from the string pointed to 8343 by src, including the terminating \0 character, to the array pointed to by 8344 dest. Exactly n characters are written at dest. If the length strlen(src) is 8345 smaller than n, the remaining characters in dest are filled with \0 characters. 8346 If the length strlen(src) is greater than or equal to n, dest will not be \0 8347 terminated. 8348 8349 The strings may not overlap. 8350 8351 The programmer shall ensure that there is room for at least n characters at 8352 dest. 8353 8354 Return Value 8355 8356 The stpncpy function shall return a pointer to the terminating NULL in dest, 8357 or, if dest is not NULL-terminated, dest + n. 8358 8359 strcasestr 8360 8361 Name 8362 8363 strcasestr -- locate a substring ignoring case 8364 8365 Synopsis 8366 8367 #include 8368 8369 char *strcasestr(const char *s1, const char *s2); 8370 8371 Description 8372 8373 The strcasestr shall behave as strstr, except that it shall ignore the case of 8374 both strings. The strcasestr function shall be locale aware; that is strcasestr 8375 shall behave as if both strings had been converted to lower case in the current 8376 locale before the comparison is performed. 8377 8378 Return Value 8379 8380 Upon successful completion, strcasestr shall return a pointer to the located 8381 string or a null pointer if the string is not found. If s2 points to a string 8382 with zero length, the function shall return s1. 8383 8384 strerror_r 8385 8386 Name 8387 8388 strerror_r -- reentrant version of strerror 8389 8390 Synopsis 8391 8392 #include 8393 8394 char *strerror_r(int errnum, char *buf, size_t buflen); 8395 8396 Description 8397 8398 strerror_r is a reentrant version of strerror. strerror_r returns a pointer to 8399 an error message corresponding to error number errnum. The returned pointer may 8400 point within the buffer buf (at most buflen bytes). 8401 8402 8403 Note: Note the optional use of the buffer, unlike the strerror_r found in 8404 ISO POSIX (2003), in which the message is always copied into the supplied 8405 buffer. The return types also differ. 8406 8407 8408 8409 strfry 8410 8411 Name 8412 8413 strfry -- randomize a string 8414 8415 Synopsis 8416 8417 #include 8418 8419 char *strfry(char *string); 8420 8421 Description 8422 8423 strfry randomizes the contents of string by using rand(3) to randomly swap 8424 characters in the string. The result is an anagram of string. 8425 8426 Return Value 8427 8428 strfry returns a pointer to the randomized string. 8429 8430 strndup 8431 8432 Name 8433 8434 strndup -- return a malloc'd copy of at most the specified number of bytes of a 8435 string 8436 8437 Synopsis 8438 8439 #include 8440 8441 char *strndup(const char *string, size_t n); 8442 8443 Description 8444 8445 The strndup function shall return a malloc'd copy of at most n bytes of string. 8446 The resultant string shall be terminated even if no NULL terminator appears 8447 before string+n. 8448 8449 Return Value 8450 8451 On success, strndup shall return a pointer to a newly allocated block of memory 8452 containing a copy of at most n bytes of string. Otherwise, strndup shall return 8453 NULL and set errno to indicate the error. 8454 8455 Errors 8456 8457 ENOMEM 8458 8459 Insufficient memory available. 8460 8461 strnlen 8462 8463 Name 8464 8465 strnlen -- determine the length of a fixed-size string 8466 8467 Synopsis 8468 8469 #include 8470 8471 size_t strnlen(const char *s, size_t maxlen); 8472 8473 Description 8474 8475 strnlen returns the number of characters in the string s, not including the 8476 terminating \0 character, but at most maxlen. In doing this, strnlen looks only 8477 at the first maxlen characters at s and never beyond s + maxlen. 8478 8479 Return Value 8480 8481 strnlen returns strlen(s), if that is less than maxlen, or maxlen if there is 8482 no \0 character among the first maxlen characters pointed to by s. 8483 8484 strptime 8485 8486 Name 8487 8488 strptime -- parse a time string 8489 8490 Description 8491 8492 The strptime shall behave as specified in the ISO POSIX (2003) with differences 8493 as listed below. 8494 8495 Number of leading zeroes may be limited 8496 8497 The ISO POSIX (2003) specifies fields for which "leading zeros are permitted 8498 but not required"; however, applications shall not expect to be able to supply 8499 more leading zeroes for these fields than would be implied by the range of the 8500 field. Implementations may choose to either match an input with excess leading 8501 zeroes, or treat this as a non-matching input. For example, %j has a range of 8502 001 to 366, so 0, 00, 000, 001, and 045 are acceptable inputs, but inputs such 8503 as 0000, 0366 and the like are not. 8504 8505 Rationale 8506 8507 glibc developers consider it appropriate behavior to forbid excess leading 8508 zeroes. When trying to parse a given input against several format strings, 8509 forbidding excess leading zeroes could be helpful. For example, if one matches 8510 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for the 8511 first match to fail, as it would be perverse to parse that date as November 12, 8512 year 26. The second pattern parses it as December 26, year 11. 8513 8514 The ISO POSIX (2003) is not explicit that an unlimited number of leading zeroes 8515 are required, although it may imply this. The LSB explicitly allows 8516 implementations to have either behavior. Future versions of this standard may 8517 require implementations to forbid excess leading zeroes. 8518 8519 An Interpretation Request is currently pending against ISO POSIX (2003) for 8520 this matter. 8521 8522 strsep 8523 8524 Name 8525 8526 strsep -- extract token from string 8527 8528 Synopsis 8529 8530 #include 8531 8532 char *strsep(char **stringp, const char *delim); 8533 8534 Description 8535 8536 The strsep function shall find the first token in the string referenced by the 8537 pointer stringp, using the characters in delim as delimiters. 8538 8539 If stringp is NULL, strsep shall return NULL and do nothing else. 8540 8541 If stringp is non-NULL, strsep shall find the first token in the string 8542 referenced by stringp, where tokens are delimited by characters in the string 8543 delim. This token shall be terminated with a \0 character by overwriting the 8544 delimiter, and stringp shall be updated to point past the token. In case no 8545 delimiter was found, the token is taken to be the entire string referenced by 8546 stringp, and the location referenced by stringp is made NULL. 8547 8548 Return Value 8549 8550 strsep shall return a pointer to the beginning of the token. 8551 8552 Notes 8553 8554 The strsep function was introduced as a replacement for strtok, since the 8555 latter cannot handle empty fields. However, strtok conforms to ISO C (1999) and 8556 to ISO POSIX (2003) and hence is more portable. 8557 8558 See Also 8559 8560 strtok, strtok_r. 8561 8562 strsignal 8563 8564 Name 8565 8566 strsignal -- return string describing signal 8567 8568 Synopsis 8569 8570 #define _GNU_SOURCE 8571 #include 8572 8573 char *strsignal(int sig); 8574 8575 extern const char * const sys_siglist[]; 8576 8577 Description 8578 8579 The strsignal function shall return a pointer to a string describing the signal 8580 number sig. The string can only be used until the next call to strsignal. 8581 8582 The array sys_siglist holds the signal description strings indexed by signal 8583 number. This array should not be accessed directly by applications. 8584 8585 Return Value 8586 8587 If sig is a valid signal number, strsignal shall return a pointer to the 8588 appropriate description string. Otherwise, strsignal shall return either a 8589 pointer to the string "unknown signal", or a null pointer. 8590 8591 Although the function is not declared as returning a pointer to a constant 8592 character string, applications shall not modify the returned string. 8593 8594 strtoq 8595 8596 Name 8597 8598 strtoq -- convert string value to a long or quad_t integer 8599 8600 Synopsis 8601 8602 #include 8603 #include 8604 #include 8605 8606 quadt strtoq(const char *nptr, char **endptr, int base); 8607 8608 Description 8609 8610 strtoq converts the string nptr to a quadt value. The conversion is done 8611 according to the given base, which shall be between 2 and 36 inclusive, or be 8612 the special value 0. 8613 8614 nptr may begin with an arbitrary amount of white space (as determined by 8615 isspace(3)), followed by a single optional + or - sign character. If base is 0 8616 or 16, the string may then include a 0x prefix, and the number will be read in 8617 base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next 8618 character is 0, in which case it is taken as 8 (octal). 8619 8620 The remainder of the string is converted to a long value in the obvious manner, 8621 stopping at the first character which is not a valid digit in the given base. 8622 (In bases above 10, the letter A in either upper or lower case represents 10, B 8623 represents 11, and so forth, with Z representing 35.) 8624 8625 Return Value 8626 8627 strtoq returns the result of the conversion, unless the value would underflow 8628 or overflow. If an underflow occurs, strtoq returns QUAD_MIN. If an overflow 8629 occurs, strtoq returns QUAD_MAX. In both cases, the global variable errno is 8630 set to ERANGE. 8631 8632 Errors 8633 8634 ERANGE 8635 8636 The given string was out of range; the value converted has been clamped. 8637 8638 strtouq 8639 8640 Name 8641 8642 strtouq -- convert a string to an uquad_t 8643 8644 Synopsis 8645 8646 #include 8647 #include 8648 #include 8649 8650 uquadt strtouq(const char *nptr, char **endptr, int base); 8651 8652 Description 8653 8654 strtouq converts the string nptr to a uquadt value. The conversion is done 8655 according to the given base, which shall be between 2 and 36 inclusive, or be 8656 the special value 0. 8657 8658 nptr may begin with an arbitrary amount of white space (as determined by 8659 isspace(3)), followed by a single optional + or - sign character. If base is 0 8660 or 16, the string may then include a 0x prefix, and the number will be read in 8661 base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next 8662 character is 0, in which case it is taken as 8 (octal). 8663 8664 The remainder of the string is converted to an unsigned long value in the 8665 obvious manner, stopping at the end of the string or at the first character 8666 that does not produce a valid digit in the given base. (In bases above 10, the 8667 letter A in either upper or lower case represents 10, B represents 11, and so 8668 forth, with Z representing 35.) 8669 8670 Return Value 8671 8672 On success, strtouq returns either the result of the conversion or, if there 8673 was a leading minus sign, the negation of the result of the conversion, unless 8674 the original (non-negated) value would overflow. In the case of an overflow the 8675 function returns UQUAD_MAX and the global variable errno is set to ERANGE. 8676 8677 Errors 8678 8679 ERANGE 8680 8681 The given string was out of range; the value converted has been clamped. 8682 8683 strverscmp 8684 8685 Name 8686 8687 strverscmp -- compare strings holding name and indices/version numbers 8688 8689 Synopsis 8690 8691 #include 8692 8693 int strverscmp(const char *s1, const char *s2); 8694 8695 Description 8696 8697 The strversmp function shall compare two strings in a similar manner to strcmp. 8698 If s1 and s2 contain no digits, strversmp shall behave as strcmp. 8699 8700 The strings are compared by scanning from left to right. If a digit or sequence 8701 of digits is encountered in both strings at the same position, the digit 8702 sequence is specially compared, as described below. If the digit sequences 8703 compared equal, the string comparison resumes in both s1 and s2 after the digit 8704 sequence. 8705 8706 Digit sequences are classified as either "integral" or "fractional". A 8707 fractional digit sequence begins with a '0'; otherwise the digit sequence shall 8708 be treated as an integral digit sequence. 8709 8710 If two integral digit sequences are encountered, they shall be compared as 8711 integers for equality. A fractional digit sequence shall always compare less 8712 than an integral digit sequence. If two fractional digit sequences are being 8713 compared, then if the common prefix contains only leading zeroes, the longer 8714 part shall compare less than the shorter; otherwise the comparison shall be 8715 strictly numeric. 8716 8717 Examples 8718 8719 Table 7-1. Examples 8720 8721 +-----------------------------------------------------------------------------+ 8722 | Call | Return Value | 8723 |------------------------------+----------------------------------------------| 8724 |strverscmp( "no digit", "no |0 /* same behavior as strcmp */ | 8725 |digit") | | 8726 |------------------------------+----------------------------------------------| 8727 |strverscmp( "item#99", "item# |< 0 /* same prefix, but 99 < 100 */ | 8728 |100") | | 8729 |------------------------------+----------------------------------------------| 8730 |strverscmp( "alpha1", |> 0 /* fractional part inferior to integral */| 8731 |"alpha001") | | 8732 |------------------------------+----------------------------------------------| 8733 |strverscmp( "part1_f012", |> 0 /* two fractional parts */ | 8734 |"part1_f01") | | 8735 |------------------------------+----------------------------------------------| 8736 |strverscmp( "foo.009", |< 0 /* two fractional parts but with leading | 8737 |"foo.0") |zeroes only */ | 8738 +-----------------------------------------------------------------------------+ 8739 8740 svc_register 8741 8742 Name 8743 8744 svc_register -- Register Remote Procedure Call Interface 8745 8746 Synopsis 8747 8748 #include 8749 8750 void svc_register(SVCXPRT *xprt, u_long prognum, u_long versnum, void 8751 (*dispatch)(), u_long protocol); 8752 8753 Description 8754 8755 The svc_register function shall associate the program identified by prognum at 8756 version versnum with the service dispatch procedure, dispatch. If protocol is 8757 zero, the service is not registered with the portmap service. If protocol is 8758 non-zero, then a mapping of the triple [prognum, versnum, protocol] to xprt-> 8759 xp_port is established with the local portmap service. The procedure dispatch 8760 has the following form: 8761 8762 int dispatch(struct svc_req * request, SVCXPRT * xprt); 8763 8764 Return Value 8765 8766 svc_register returns 1 if it succeeds, and zero otherwise. 8767 8768 svc_run 8769 8770 Name 8771 8772 svc_run -- Waits for RPC requests to arrive and calls service procedure. 8773 8774 Synopsis 8775 8776 #include 8777 8778 void svc_run(void); 8779 8780 Description 8781 8782 The svc_run function shall wait for RPC requests to arrive, read and unpack 8783 each request, and dispatch it to the appropriate registered handler. Under 8784 normal conditions, svc_run shall not return; it shall only return if serious 8785 errors occur that prevent further processing. 8786 8787 svc_sendreply 8788 8789 Name 8790 8791 svc_sendreply -- called by RPC service's dispatch routine 8792 8793 Synopsis 8794 8795 svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, char out); 8796 8797 Description 8798 8799 Called by an RPC service's dispatch routine to send the results of a remote 8800 procedure call. The parameter xprt is the request's associated transport 8801 handle; outproc is the XDR routine which is used to encode the results; and out 8802 is the address of the results. This routine returns one if it succeeds, zero 8803 other-wise. 8804 8805 svctcp_create 8806 8807 Name 8808 8809 svctcp_create -- Creates a TCP/IP-based RPC service transport. 8810 8811 Synopsis 8812 8813 #include 8814 8815 SVCXPRT *svctcp_create(int sock, u_int send_buf_size, u_int recv_buf_size); 8816 8817 Description 8818 8819 svctcp_create cretes a TCP/IP-based RPC service transport, to which it returns 8820 a pointer. The transport is associated with the socket sock, which may be 8821 RPC_ANYSOCK, in which case a new socket is created. If the socket is not bound 8822 to a local TCP port, ten this routine binds it to an arbitrary port. Upon 8823 completion, xprt->xp_sock is the transport's socket descriptor, and xprt-> 8824 xp_port is the transport's port number. Since TCP-based RPC uses buffered I/O, 8825 users may specify the size of buffers; values of zero choose suitable defaults. 8826 8827 Return Value 8828 8829 svctcp_create returns NULL if it fails, or a pointer to the RPC service 8830 transport otherwise. 8831 8832 svcudp_create 8833 8834 Name 8835 8836 svcudp_create -- Creates a UDP-based RPC service transport. 8837 8838 Synopsis 8839 8840 SVCXPRT * 8841 8842 svcudp_create(int sock); 8843 8844 Description 8845 8846 This call is equivalent to svcudp_bufcreate (sock, SZ, SZ) for some default 8847 size SZ. 8848 8849 system 8850 8851 Name 8852 8853 system -- execute a shell command 8854 8855 Synopsis 8856 8857 #include 8858 8859 int system(const char *string); 8860 8861 Description 8862 8863 The system function shall behave as described in ISO POSIX (2003). 8864 8865 Notes 8866 8867 The fact that system ignores interrupts is often not what a program wants. ISO 8868 POSIX (2003) describes some of the consequences; an additional consequence is 8869 that a program calling system from a loop cannot be reliably interrupted. Many 8870 programs will want to use the exec family of functions instead. 8871 8872 Do not use system from a program with suid or sgid privileges, because 8873 unexpected values for some environment variables might be used to subvert 8874 system integrity. Use the exec family of functions instead, but not execlp or 8875 execvp. system will not, in fact, work properly from programs with suid or sgid 8876 privileges on systems on which /bin/sh is bash version 2, since bash 2 drops 8877 privileges on startup. (Debian uses a modified bash which does not do this when 8878 invoked as sh.) 8879 8880 The check for the availability of /bin/sh is not actually performed; it is 8881 always assumed to be available. ISO C (1999) specifies the check, but ISO POSIX 8882 (2003) specifies that the return shall always be nonzero, since a system 8883 without the shell is not conforming, and it is this that is implemented. 8884 8885 It is possible for the shell command to return 127, so that code is not a sure 8886 indication that the execve call failed; check the global variable errno to make 8887 sure. 8888 8889 textdomain 8890 8891 Name 8892 8893 textdomain -- set the current default message domain 8894 8895 Synopsis 8896 8897 #include 8898 8899 char *textdomain(const char *domainname); 8900 8901 Description 8902 8903 The textdomain function shall set the current default message domain to 8904 domainname. Subsequent calls to gettext and ngettext use the default message 8905 domain. 8906 8907 If domainname is NULL, the default message domain shall not be altered. 8908 8909 If domainname is "", textdomain shall reset the default domain to the system 8910 default of "messages". 8911 8912 Return 8913 8914 On success, textdomain shall return the currently selected domain. Otherwise, a 8915 null pointer shall be returned, and errno set to indicate the error. 8916 8917 Errors 8918 8919 ENOMEM 8920 8921 Insufficent memory available. 8922 8923 unlink 8924 8925 Name 8926 8927 unlink -- remove a directory entry 8928 8929 Synopsis 8930 8931 int unlink(const char *path); 8932 8933 Description 8934 8935 unlink is as specified in ISO POSIX (2003), but with differences as listed 8936 below. 8937 8938 See also Additional behaviors: unlink/link on directory. 8939 8940 May return EISDIR on directories 8941 8942 If path specifies a directory, the implementation may return EISDIR instead of 8943 EPERM as specified by ISO POSIX (2003). 8944 8945 8946 Rationale: The Linux kernel has deliberately chosen EISDIR for this case 8947 and does not expect to change (Al Viro, personal communication). 8948 8949 vasprintf 8950 8951 Name 8952 8953 vasprintf -- write formatted output to a dynamically allocated string 8954 8955 Synopsis 8956 8957 #include 8958 #include 8959 8960 int vasprintf(char ** restrict ptr, const char * restrict format, va_list arg); 8961 8962 Description 8963 8964 The vasprintf function shall write formatted output to a dynamically allocated 8965 string, and store the address of that string in the location referenced by ptr. 8966 It shall behave as asprintf, except that instead of being called with a 8967 variable number of arguments, it is called with an argument list as defined by 8968 . 8969 8970 Return Value 8971 8972 Refer to fprintf. 8973 8974 Errors 8975 8976 Refer to fprintf. 8977 8978 vdprintf 8979 8980 Name 8981 8982 vdprintf -- write formatted output to a file descriptor 8983 8984 Synopsis 8985 8986 #include 8987 8988 int vdprintf(int fd, const char * restrict format, va_list arg); 8989 8990 Description 8991 8992 The vdprintf shall behave as vfprintf, except that the first argument is a file 8993 descriptor rather than a STDIO stream. 8994 8995 Return Value 8996 8997 Refer to fprintf. 8998 8999 Errors 9000 9001 Refer to fprintf. 9002 9003 verrx 9004 9005 Name 9006 9007 verrx -- display formatted error message and exit 9008 9009 Synopsis 9010 9011 #include 9012 #include 9013 9014 void verrx(int eval, const char *fmt, va_list args); 9015 9016 Description 9017 9018 The verrx shall behave as errx except that instead of being called with a 9019 variable number of arguments, it is called with an argument list as defined by 9020 . 9021 9022 verrx does not return, but exits with the value of eval. 9023 9024 Return Value 9025 9026 None. 9027 9028 Errors 9029 9030 None. 9031 9032 vsyslog 9033 9034 Name 9035 9036 vsyslog -- log to system log 9037 9038 Synopsis 9039 9040 #include 9041 #include 9042 9043 void vsyslog(int priority, char *message, va_list arglist); 9044 9045 Description 9046 9047 The vsyslog function is identical to syslog as specified in ISO POSIX (2003), 9048 except that arglist (as defined by stdarg.h) replaces the variable number of 9049 arguments. 9050 9051 wait3 9052 9053 Name 9054 9055 wait3 -- wait for child process 9056 9057 Description 9058 9059 wait3 is as specified in the SUSv2 but with differences as listed below. 9060 9061 WCONTINUED and WIFCONTINUED optional 9062 9063 Implementations need not support the functionality of WCONTINUED or 9064 WIFCONTINUED. 9065 9066 wait4 9067 9068 Name 9069 9070 wait4 -- wait for process termination, BSD style 9071 9072 Synopsis 9073 9074 #include 9075 #include 9076 #include 9077 9078 pid_t wait4(pid_t pid, int *status, int options, (struct rusage *rusage)); 9079 9080 Description 9081 9082 wait4 suspends execution of the current process until a child (as specified by 9083 pid) has exited, or until a signal is delivered whose action is to terminate 9084 the current process or to call a signal handling function. If a child (as 9085 requested by pid) has already exited by the time of the call (a so-called 9086 "zombie" process), the function returns immediately. Any system resources used 9087 by the child are freed. 9088 9089 The value of pid can be one of: 9090 9091 < -1 9092 9093 wait for any child process whose process group ID is equal to the absolute 9094 value of pid. 9095 9096 -1 9097 9098 wait for any child process; this is equivalent to calling wait3. 9099 9100 0 9101 9102 wait for any child process whose process group ID is equal to that of the 9103 calling process. 9104 9105 > 0 9106 9107 wait for the child whose process ID is equal to the value of pid. 9108 9109 The value of options is a bitwise or of zero or more of the following 9110 constants: 9111 9112 WNOHANG 9113 9114 return immediately if no child is there to be waited for. 9115 9116 WUNTRACED 9117 9118 return for children that are stopped, and whose status has not been 9119 reported. 9120 9121 If status is not NULL, wait4 stores status information in the location status. 9122 This status can be evaluated with the following macros: 9123 9124 9125 Note: These macros take the status value (an int) as an argument -- not a 9126 pointer to the value! 9127 9128 WIFEXITED(status) 9129 9130 is nonzero if the child exited normally. 9131 9132 WEXITSTATUS(status) 9133 9134 evaluates to the least significant eight bits of the return code of the 9135 child that terminated, which may have been set as the argument to a call to 9136 exit or as the argument for a return statement in the main program. This 9137 macro can only be evaluated if WIFEXITED returned nonzero. 9138 9139 WIFSIGNALED(status) 9140 9141 returns true if the child process exited because of a signal that was not 9142 caught. 9143 9144 WTERMSIG(status) 9145 9146 returns the number of the signal that caused the child process to 9147 terminate. This macro can only be evaluated if WIFSIGNALED returned 9148 nonzero. 9149 9150 WIFSTOPPED(status) 9151 9152 returns true if the child process that caused the return is currently 9153 stopped; this is only possible if the call was done using WUNTRACED. 9154 9155 WSTOPSIG(status) 9156 9157 returns the number of the signal that caused the child to stop. This macro 9158 can only be evaluated if WIFSTOPPED returned nonzero. 9159 9160 If rusage is not NULL, the struct rusage (as defined in sys/resource.h) that it 9161 points to will be filled with accounting information. (See getrusage(2) for 9162 details. 9163 9164 Return Value 9165 9166 On success, the process ID of the child that exited is returned. On error, -1 9167 is returned (in particular, when no unwaited-for child processes of the 9168 specified kind exist), or 0 if WNOHANG was used and no child was available yet. 9169 In the latter two cases, the global variable errno is set appropriately. 9170 9171 Errors 9172 9173 ECHILD 9174 9175 No unwaited-for child process as specified does exist. 9176 9177 ERESTARTSYS 9178 9179 A WNOHANG was not set and an unblocked signal or a SIGCHILD was caught. 9180 This error is returned by the system call. The library interface is not 9181 allowed to return ERESTARTSYS, but will return EINTR. 9182 9183 waitpid 9184 9185 Name 9186 9187 waitpid -- wait for child process 9188 9189 Description 9190 9191 waitpid is as specified in ISO POSIX (2003), but with differences as listed 9192 below. 9193 9194 Need not support WCONTINUED or WIFCONTINUED 9195 9196 Implementations need not support the functionality of WCONTINUED or 9197 WIFCONTINUED. 9198 9199 warn 9200 9201 Name 9202 9203 warn -- formatted error messages 9204 9205 Synopsis 9206 9207 #include 9208 9209 void warn(const char *fmt ...); 9210 9211 Description 9212 9213 The warn function shall display a formatted error message on the standard error 9214 stream. The output shall consist of the last component of the program name, a 9215 colon character, and a space character. If fmt is non-NULL, it shall be used as 9216 a format string for the printf family of functions, and the formatted message, 9217 a colon character, and a space are written to stderr. Finally, the error 9218 message string affiliated with the current value of the global variable errno 9219 shall be written to stderr, followed by a newline character. 9220 9221 Return Value 9222 9223 None. 9224 9225 Errors 9226 9227 None. 9228 9229 warnx 9230 9231 Name 9232 9233 warnx -- formatted error messages 9234 9235 Synopsis 9236 9237 #include 9238 9239 void warnx(const char *fmt ...); 9240 9241 Description 9242 9243 The warnx function shall display a formatted error message on the standard 9244 error stream. The last component of the program name, a colon character, and a 9245 space shall be output. If fmt is non-NULL, it shall be used as the format 9246 string for the printf family of functions, and the formatted error message, a 9247 colon character, and a space shall be output. The output shall be followed by a 9248 newline character. 9249 9250 Return Value 9251 9252 None. 9253 9254 Errors 9255 9256 None. 9257 9258 wcpcpy 9259 9260 Name 9261 9262 wcpcpy -- copy a wide character string, returning a pointer to its end 9263 9264 Synopsis 9265 9266 #include 9267 9268 wchar_t *wcpcpy(wchar_t *dest, const wchar_t *src); 9269 9270 Description 9271 9272 wcpcpy is the wide-character equivalent of stpcpy. It copies the wide character 9273 string src, including the terminating L'\0' character, to the array dest. 9274 9275 The strings may not overlap. 9276 9277 The programmer shall ensure that there is room for at least wcslen(src)+1 wide 9278 characters at dest. 9279 9280 Return Value 9281 9282 wcpcpy returns a pointer to the end of the wide-character string dest, that is, 9283 a pointer to the terminating L'\0' character. 9284 9285 wcpncpy 9286 9287 Name 9288 9289 wcpncpy -- copy a fixed-size string of wide characters, returning a pointer to 9290 its end 9291 9292 Synopsis 9293 9294 #include 9295 9296 wchar_t *wcpncpy(wchar_t *dest, const wchar_t *src, size_t n); 9297 9298 Description 9299 9300 wcpncpy is the wide-character equivalent of stpncpy. It copies at most n wide 9301 characters from the wide-character string src, including the terminating L'\0' 9302 character, to the array dest. Exactly n wide characters are written at dest. If 9303 the length wcslen(src) is smaller than n, the remaining wide characters in the 9304 array dest are filled with L'\0' characters. If the length wcslen(src) is 9305 greater than or equal to n, the string dest will not be L'\0' terminated. 9306 9307 The strings may not overlap. 9308 9309 The programmer shall ensure that there is room for at least n wide characters 9310 at dest. 9311 9312 Return Value 9313 9314 wcpncpy returns a pointer to the wide character one past the last non-null wide 9315 character written. 9316 9317 wcscasecmp 9318 9319 Name 9320 9321 wcscasecmp -- compare two wide-character strings, ignoring case 9322 9323 Synopsis 9324 9325 #include 9326 9327 int wcscasecmp(const wchar_t *s1, const wchar_t *s2); 9328 9329 Description 9330 9331 wcscasecmp is the wide-character equivalent of strcasecmp. It compares the 9332 wide-character string s1 and the wide-character string s2, ignoring case 9333 differences (towupper, towlower). 9334 9335 Return Value 9336 9337 wcscasecmp returns 0 if the wide-character strings s1 and s2 are equal except 9338 for case distinctions. It returns a positive integer if s1 is greater than s2, 9339 ignoring case. It returns a negative integer if s1 is smaller than s2, ignoring 9340 case. 9341 9342 Notes 9343 9344 The behavior of wcscasecmp depends upon the LC_CTYPE category of the current 9345 locale. 9346 9347 wcsdup 9348 9349 Name 9350 9351 wcsdup -- duplicate a wide-character string 9352 9353 Synopsis 9354 9355 #include 9356 9357 wchar_t *wcsdup(const wchar_t *s); 9358 9359 Description 9360 9361 wcsdup is the wide-character equivalent of strdup. It allocates and returns a 9362 new wide-character string whose initial contents is a duplicate of the 9363 wide-character string s. 9364 9365 Memory for the new wide-character string is obtained with malloc(3), and can be 9366 freed with free(3). 9367 9368 Return Value 9369 9370 wcsdup returns a pointer to the new wide-character string, or NULL if 9371 sufficient memory was not available. 9372 9373 wcsncasecmp 9374 9375 Name 9376 9377 wcsncasecmp -- compare two fixed-size wide-character strings, ignoring case 9378 9379 Synopsis 9380 9381 #include 9382 9383 int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n); 9384 9385 Description 9386 9387 wcsncasecmp is the wide-character equivalent of strncasecmp. It compares the 9388 wide-character string s1 and the wide-character string s2, but at most n wide 9389 characters from each string, ignoring case differences (towupper, towlower). 9390 9391 Return Value 9392 9393 wcscasecmp returns 0 if the wide-character strings s1 and s2, truncated to at 9394 most length n, are equal except for case distinctions. It returns a positive 9395 integer if truncated s1 is greater than truncated s2, ignoring case. It returns 9396 a negative integer if truncated s1 is smaller than truncated s2, ignoring case. 9397 9398 Notes 9399 9400 The behavior of wcsncasecmp depends upon the LC_CTYPE category of the current 9401 locale. 9402 9403 wcsnlen 9404 9405 Name 9406 9407 wcsnlen -- determine the length of a fixed-size wide-character string 9408 9409 Synopsis 9410 9411 #include 9412 9413 size_t wcsnlen(const wchar_t *s, size_t maxlen); 9414 9415 Description 9416 9417 wcsnlen is the wide-character equivalent of strnlen. It returns the number of 9418 wide-characters in the string s, not including the terminating L'\0' character, 9419 but at most maxlen. In doing this, wcsnlen looks only at the first maxlen 9420 wide-characters at s and never beyond s + maxlen. 9421 9422 Return Value 9423 9424 wcsnlen returns wcslen(s) if that is less than maxlen, or maxlen if there is no 9425 L'\0' character among the first maxlen wide characters pointed to by s. 9426 9427 Notes 9428 9429 The behavior of wcsncasecmp depends on the LC_CTYPE category of the current 9430 locale. 9431 9432 wcsnrtombs 9433 9434 Name 9435 9436 wcsnrtombs -- convert a wide character string to a multi-byte string 9437 9438 Synopsis 9439 9440 #include 9441 9442 size_t wcsnrtombs(char *dest, const wchar_t **src, size_t nwc, size_t len, 9443 mbstate_t *ps); 9444 9445 Description 9446 9447 wcsnrtombs is like wcsrtombs, except that the number of wide characters to be 9448 converted, starting at src, is limited to nwc. 9449 9450 If dest is not a NULL pointer, wcsnrtombs converts at most nwc wide characters 9451 from the wide-character string src to a multibyte string starting at dest. At 9452 most len bytes are written to dest. The state ps is updated. 9453 9454 The conversion is effectively performed by repeatedly calling: 9455 9456 wcrtomb(dest, *src, ps) 9457 9458 as long as this call succeeds, and then incrementing dest by the number of 9459 bytes written and src by 1. 9460 9461 The conversion can stop for three reasons: 9462 9463 * A wide character has been encountered that cannot be represented as a 9464 multibyte sequence (according to the current locale). In this case src is 9465 left pointing to the invalid wide character, (size_t)(-1) is returned, and 9466 errno is set to EILSEQ. 9467 9468 * nws wide characters have been converted without encountering a L'\0', or 9469 the length limit forces a stop. In this case, src is left pointing to the 9470 next wide character to be converted, and the number bytes written to dest 9471 is returned. 9472 9473 * The wide-character string has been completely converted, including the 9474 terminating L'\0' (which has the side effect of bringing back ps to the 9475 initial state). In this case, src is set to NULL, and the number of bytes 9476 written to dest, excluding the terminating L'\0' byte, is returned. 9477 9478 If dest is NULL, len is ignored, and the conversion proceeds as above, except 9479 that the converted bytes are not written out to memory, and that no destination 9480 length limit exists. 9481 9482 In both of the above cases, if ps is a NULL pointer, a static anonymous state 9483 only known to wcsnrtombs is used instead. 9484 9485 The programmer shall ensure that there is room for at least len bytes at dest. 9486 9487 Return Value 9488 9489 wcsnrtombs returns the number of bytes that make up the converted part of 9490 multibyte sequence, not including the terminating L'\0' byte. If a wide 9491 character was encountered which could not be converted, (size_t)(-1) is 9492 returned, and the global variable errno set to EILSEQ. 9493 9494 Notes 9495 9496 The behavior of wcsnrtombs depends on the LC_CTYPE category of the current 9497 locale. 9498 9499 Passing NULL as ps is not multi-thread safe. 9500 9501 wcstoq 9502 9503 Name 9504 9505 wcstoq -- convert wide string to long long int representation 9506 9507 Synopsis 9508 9509 #include 9510 9511 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** restrict endptr, 9512 int base); 9513 9514 Description 9515 9516 The wcstoq function shall convert the initial portion of the wide string nptr 9517 to long long int representation. It is identical to wcstoll. 9518 9519 Return Value 9520 9521 Refer to wcstoll. 9522 9523 Errors 9524 9525 Refer to wcstoll. 9526 9527 wcstouq 9528 9529 Name 9530 9531 wcstouq -- convert wide string to unsigned long long int representation 9532 9533 Synopsis 9534 9535 #include 9536 9537 unsigned long long int wcstouq(const wchar_t * restrict nptr, wchar_t ** 9538 restrict endptr, int base); 9539 9540 Description 9541 9542 The wcstouq function shall convert the initial portion of the wide string nptr 9543 to unsigned long long int representation. It is identical to wcstoull. 9544 9545 Return Value 9546 9547 Refer to wcstoull. 9548 9549 Errors 9550 9551 Refer to wcstoull. 9552 9553 xdr_u_int 9554 9555 Name 9556 9557 xdr_u_int -- library routines for external data representation 9558 9559 Synopsis 9560 9561 int xdr_u_int(XDR * xdrs, unsigned int * up); 9562 9563 Description 9564 9565 xdr_u_int is a filter primitive that translates between C unsigned integers and 9566 their external representations. 9567 9568 Return Value 9569 9570 On success, 1 is returned. On error, 0 is returned. 9571 9572 ------------------------------------------------------------------------------- 9573 9574 Interfaces for libm 9575 9576 Table 7-29 defines the library name and shared object name for the libm library 9577 9578 Table 7-29. libm Definition 9579 9580 +----------------------+ 9581 |Library:|libm | 9582 |--------+-------------| 9583 |SONAME: |See archLSB. | 9584 +----------------------+ 9585 9586 The behavior of the interfaces in this library is specified by the following 9587 specifications: 9588 9589 ISO C (1999) 9590 SUSv2 9591 ISO POSIX (2003) 9592 9593 ------------------------------------------------------------------------------- 9594 9595 Math 9596 9597 ------------------------------------------------------------------------------- 9598 9599 Interfaces for Math 9600 9601 An LSB conforming implementation shall provide the generic functions for Math 9602 specified in Table 7-30, with the full functionality as described in the 9603 referenced underlying specification. 9604 9605 Table 7-30. libm - Math Function Interfaces 9606 9607 +-----------------------------------------------------------------------------+ 9608 |acos [1] |cexp [1] |expf [1] |jnf [2] |remquof [1] | 9609 |-----------+-------------+------------------+---------------+----------------| 9610 |acosf [1] |cexpf [1] |expl [1] |jnl [2] |remquol [1] | 9611 |-----------+-------------+------------------+---------------+----------------| 9612 |acosh [1] |cexpl [1] |expm1 [1] |ldexp [1] |rint [1] | 9613 |-----------+-------------+------------------+---------------+----------------| 9614 |acoshf [1] |cimag [1] |fabs [1] |ldexpf [1] |rintf [1] | 9615 |-----------+-------------+------------------+---------------+----------------| 9616 |acoshl [1] |cimagf [1] |fabsf [1] |ldexpl [1] |rintl [1] | 9617 |-----------+-------------+------------------+---------------+----------------| 9618 |acosl [1] |cimagl [1] |fabsl [1] |lgamma [1] |round [1] | 9619 |-----------+-------------+------------------+---------------+----------------| 9620 |asin [1] |clog [1] |fdim [1] |lgamma_r [2] |roundf [1] | 9621 |-----------+-------------+------------------+---------------+----------------| 9622 |asinf [1] |clog10 [2] |fdimf [1] |lgammaf [1] |roundl [1] | 9623 |-----------+-------------+------------------+---------------+----------------| 9624 |asinh [1] |clog10f [2] |fdiml [1] |lgammaf_r [2] |scalb [1] | 9625 |-----------+-------------+------------------+---------------+----------------| 9626 |asinhf [1] |clog10l [2] |feclearexcept [1] |lgammal [1] |scalbf [2] | 9627 |-----------+-------------+------------------+---------------+----------------| 9628 |asinhl [1] |clogf [1] |fegetenv [1] |lgammal_r [2] |scalbl [2] | 9629 |-----------+-------------+------------------+---------------+----------------| 9630 |asinl [1] |clogl [1] |fegetexceptflag |llrint [1] |scalbln [1] | 9631 | | |[1] | | | 9632 |-----------+-------------+------------------+---------------+----------------| 9633 |atan [1] |conj [1] |fegetround [1] |llrintf [1] |scalblnf [1] | 9634 |-----------+-------------+------------------+---------------+----------------| 9635 |atan2 [1] |conjf [1] |feholdexcept [1] |llrintl [1] |scalblnl [1] | 9636 |-----------+-------------+------------------+---------------+----------------| 9637 |atan2f [1] |conjl [1] |feraiseexcept [1] |llround [1] |scalbn [1] | 9638 |-----------+-------------+------------------+---------------+----------------| 9639 |atan2l [1] |copysign [1] |fesetenv [1] |llroundf [1] |scalbnf [1] | 9640 |-----------+-------------+------------------+---------------+----------------| 9641 |atanf [1] |copysignf [1]|fesetexceptflag |llroundl [1] |scalbnl [1] | 9642 | | |[1] | | | 9643 |-----------+-------------+------------------+---------------+----------------| 9644 |atanh [1] |copysignl [1]|fesetround [1] |log [1] |significand [2] | 9645 |-----------+-------------+------------------+---------------+----------------| 9646 |atanhf [1] |cos [1] |fetestexcept [1] |log10 [1] |significandf [2]| 9647 |-----------+-------------+------------------+---------------+----------------| 9648 |atanhl [1] |cosf [1] |feupdateenv [1] |log10f [1] |significandl [2]| 9649 |-----------+-------------+------------------+---------------+----------------| 9650 |atanl [1] |cosh [1] |finite [3] |log10l [1] |sin [1] | 9651 |-----------+-------------+------------------+---------------+----------------| 9652 |cabs [1] |coshf [1] |finitef [2] |log1p [1] |sincos [2] | 9653 |-----------+-------------+------------------+---------------+----------------| 9654 |cabsf [1] |coshl [1] |finitel [2] |logb [1] |sincosf [2] | 9655 |-----------+-------------+------------------+---------------+----------------| 9656 |cabsl [1] |cosl [1] |floor [1] |logf [1] |sincosl [2] | 9657 |-----------+-------------+------------------+---------------+----------------| 9658 |cacos [1] |cpow [1] |floorf [1] |logl [1] |sinf [1] | 9659 |-----------+-------------+------------------+---------------+----------------| 9660 |cacosf [1] |cpowf [1] |floorl [1] |lrint [1] |sinh [1] | 9661 |-----------+-------------+------------------+---------------+----------------| 9662 |cacosh [1] |cpowl [1] |fma [1] |lrintf [1] |sinhf [1] | 9663 |-----------+-------------+------------------+---------------+----------------| 9664 |cacoshf [1]|cproj [1] |fmaf [1] |lrintl [1] |sinhl [1] | 9665 |-----------+-------------+------------------+---------------+----------------| 9666 |cacoshl [1]|cprojf [1] |fmal [1] |lround [1] |sinl [1] | 9667 |-----------+-------------+------------------+---------------+----------------| 9668 |cacosl [1] |cprojl [1] |fmax [1] |lroundf [1] |sqrt [1] | 9669 |-----------+-------------+------------------+---------------+----------------| 9670 |carg [1] |creal [1] |fmaxf [1] |lroundl [1] |sqrtf [1] | 9671 |-----------+-------------+------------------+---------------+----------------| 9672 |cargf [1] |crealf [1] |fmaxl [1] |matherr [2] |sqrtl [1] | 9673 |-----------+-------------+------------------+---------------+----------------| 9674 |cargl [1] |creall [1] |fmin [1] |modf [1] |tan [1] | 9675 |-----------+-------------+------------------+---------------+----------------| 9676 |casin [1] |csin [1] |fminf [1] |modff [1] |tanf [1] | 9677 |-----------+-------------+------------------+---------------+----------------| 9678 |casinf [1] |csinf [1] |fminl [1] |modfl [1] |tanh [1] | 9679 |-----------+-------------+------------------+---------------+----------------| 9680 |casinh [1] |csinh [1] |fmod [1] |nan [1] |tanhf [1] | 9681 |-----------+-------------+------------------+---------------+----------------| 9682 |casinhf [1]|csinhf [1] |fmodf [1] |nanf [1] |tanhl [1] | 9683 |-----------+-------------+------------------+---------------+----------------| 9684 |casinhl [1]|csinhl [1] |fmodl [1] |nanl [1] |tanl [1] | 9685 |-----------+-------------+------------------+---------------+----------------| 9686 |casinl [1] |csinl [1] |frexp [1] |nearbyint [1] |tgamma [1] | 9687 |-----------+-------------+------------------+---------------+----------------| 9688 |catan [1] |csqrt [1] |frexpf [1] |nearbyintf [1] |tgammaf [1] | 9689 |-----------+-------------+------------------+---------------+----------------| 9690 |catanf [1] |csqrtf [1] |frexpl [1] |nearbyintl [1] |tgammal [1] | 9691 |-----------+-------------+------------------+---------------+----------------| 9692 |catanh [1] |csqrtl [1] |gamma [3] |nextafter [1] |trunc [1] | 9693 |-----------+-------------+------------------+---------------+----------------| 9694 |catanhf [1]|ctan [1] |gammaf [2] |nextafterf [1] |truncf [1] | 9695 |-----------+-------------+------------------+---------------+----------------| 9696 |catanhl [1]|ctanf [1] |gammal [2] |nextafterl [1] |truncl [1] | 9697 |-----------+-------------+------------------+---------------+----------------| 9698 |catanl [1] |ctanh [1] |hypot [1] |nexttoward [1] |y0 [1] | 9699 |-----------+-------------+------------------+---------------+----------------| 9700 |cbrt [1] |ctanhf [1] |hypotf [1] |nexttowardf [1]|y0f [2] | 9701 |-----------+-------------+------------------+---------------+----------------| 9702 |cbrtf [1] |ctanhl [1] |hypotl [1] |nexttowardl [1]|y0l [2] | 9703 |-----------+-------------+------------------+---------------+----------------| 9704 |cbrtl [1] |ctanl [1] |ilogb [1] |pow [1] |y1 [1] | 9705 |-----------+-------------+------------------+---------------+----------------| 9706 |ccos [1] |dremf [2] |ilogbf [1] |pow10 [2] |y1f [2] | 9707 |-----------+-------------+------------------+---------------+----------------| 9708 |ccosf [1] |dreml [2] |ilogbl [1] |pow10f [2] |y1l [2] | 9709 |-----------+-------------+------------------+---------------+----------------| 9710 |ccosh [1] |erf [1] |j0 [1] |pow10l [2] |yn [1] | 9711 |-----------+-------------+------------------+---------------+----------------| 9712 |ccoshf [1] |erfc [1] |j0f [2] |powf [1] |ynf [2] | 9713 |-----------+-------------+------------------+---------------+----------------| 9714 |ccoshl [1] |erfcf [1] |j0l [2] |powl [1] |ynl [2] | 9715 |-----------+-------------+------------------+---------------+----------------| 9716 |ccosl [1] |erfcl [1] |j1 [1] |remainder [1] | | 9717 |-----------+-------------+------------------+---------------+----------------| 9718 |ceil [1] |erff [1] |j1f [2] |remainderf [1] | | 9719 |-----------+-------------+------------------+---------------+----------------| 9720 |ceilf [1] |erfl [1] |j1l [2] |remainderl [1] | | 9721 |-----------+-------------+------------------+---------------+----------------| 9722 |ceill [1] |exp [1] |jn [1] |remquo [1] | | 9723 +-----------------------------------------------------------------------------+ 9724 9725 Referenced Specification(s) 9726 9727 [1]. ISO POSIX (2003) 9728 9729 [2]. ISO C (1999) 9730 9731 [3]. SUSv2 9732 9733 An LSB conforming implementation shall provide the generic data interfaces for 9734 Math specified in Table 7-31, with the full functionality as described in the 9735 referenced underlying specification. 9736 9737 Table 7-31. libm - Math Data Interfaces 9738 9739 +--------------------+ 9740 |signgam [1] | | | | | 9741 +--------------------+ 9742 9743 Referenced Specification(s) 9744 9745 [1]. ISO POSIX (2003) 9746 9747 ------------------------------------------------------------------------------- 9748 9749 Data Definitions for libm 9750 9751 This section defines global identifiers and their values that are associated 9752 with interfaces contained in libm. These definitions are organized into groups 9753 that correspond to system headers. This convention is used as a convenience for 9754 the reader, and does not imply the existence of these headers, or their 9755 content. 9756 9757 These definitions are intended to supplement those provided in the referenced 9758 underlying specifications. 9759 9760 This specification uses ISO/IEC 9899 C Language as the reference programming 9761 language, and data definitions are specified in ISO C format. The C language is 9762 used here as a convenient notation. Using a C language description of these 9763 data objects does not preclude their use by other programming languages. 9764 9765 ------------------------------------------------------------------------------- 9766 9767 complex.h 9768 9769 #define complex _Complex 9770 9771 ------------------------------------------------------------------------------- 9772 9773 math.h 9774 9775 #define DOMAIN 1 9776 #define SING 2 9777 9778 struct exception 9779 { 9780 int type; 9781 char *name; 9782 double arg1; 9783 double arg2; 9784 double retval; 9785 } 9786 ; 9787 #define isinf(x) (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 9788 #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 9789 9790 #define HUGE_VAL 0x1.0p2047 9791 #define HUGE_VALF 0x1.0p255f 9792 #define HUGE_VALL 0x1.0p32767L 9793 9794 #define NAN ((float)0x7fc00000UL) 9795 #define M_1_PI 0.31830988618379067154 9796 #define M_LOG10E 0.43429448190325182765 9797 #define M_2_PI 0.63661977236758134308 9798 #define M_LN2 0.69314718055994530942 9799 #define M_SQRT1_2 0.70710678118654752440 9800 #define M_PI_4 0.78539816339744830962 9801 #define M_2_SQRTPI 1.12837916709551257390 9802 #define M_SQRT2 1.41421356237309504880 9803 #define M_LOG2E 1.4426950408889634074 9804 #define M_PI_2 1.57079632679489661923 9805 #define M_LN10 2.30258509299404568402 9806 #define M_E 2.7182818284590452354 9807 #define M_PI 3.14159265358979323846 9808 #define INFINITY HUGE_VALF 9809 9810 #define MATH_ERRNO 1 9811 #define MATH_ERREXCEPT 2 9812 9813 ------------------------------------------------------------------------------- 9814 9815 Interfaces for libpthread 9816 9817 Table 7-32 defines the library name and shared object name for the libpthread 9818 library 9819 9820 Table 7-32. libpthread Definition 9821 9822 +-------------------------+ 9823 |Library:|libpthread | 9824 |--------+----------------| 9825 |SONAME: |libpthread.so.0 | 9826 +-------------------------+ 9827 9828 The behavior of the interfaces in this library is specified by the following 9829 specifications: 9830 9831 Large File Support 9832 this specification 9833 ISO POSIX (2003) 9834 9835 ------------------------------------------------------------------------------- 9836 9837 Realtime Threads 9838 9839 ------------------------------------------------------------------------------- 9840 9841 Interfaces for Realtime Threads 9842 9843 No external functions are defined for libpthread - Realtime Threads 9844 9845 ------------------------------------------------------------------------------- 9846 9847 Advanced Realtime Threads 9848 9849 ------------------------------------------------------------------------------- 9850 9851 Interfaces for Advanced Realtime Threads 9852 9853 No external functions are defined for libpthread - Advanced Realtime Threads 9854 9855 ------------------------------------------------------------------------------- 9856 9857 Posix Threads 9858 9859 ------------------------------------------------------------------------------- 9860 9861 Interfaces for Posix Threads 9862 9863 An LSB conforming implementation shall provide the generic functions for Posix 9864 Threads specified in Table 7-33, with the full functionality as described in 9865 the referenced underlying specification. 9866 9867 Table 7-33. libpthread - Posix Threads Function Interfaces 9868 9869 +-----------------------------------------------------------------------------------------------------------------------------------------+ 9870 |_pthread_cleanup_pop [1] |pthread_cancel [2] |pthread_join [2] |pthread_rwlock_destroy [2] |pthread_setconcurrency| 9871 | | | | |[2] | 9872 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9873 |_pthread_cleanup_push [1] |pthread_cond_broadcast [2] |pthread_key_create [2] |pthread_rwlock_init [2] |pthread_setspecific | 9874 | | | | |[2] | 9875 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9876 |pread [2] |pthread_cond_destroy [2] |pthread_key_delete [2] |pthread_rwlock_rdlock [2] |pthread_sigmask [2] | 9877 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9878 |pread64 [3] |pthread_cond_init [2] |pthread_kill [2] |pthread_rwlock_timedrdlock |pthread_testcancel [2]| 9879 | | | |[2] | | 9880 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9881 |pthread_attr_destroy [2] |pthread_cond_signal [2] |pthread_mutex_destroy [2] |pthread_rwlock_timedwrlock |pwrite [2] | 9882 | | | |[2] | | 9883 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9884 |pthread_attr_getdetachstate|pthread_cond_timedwait [2] |pthread_mutex_init [2] |pthread_rwlock_tryrdlock [2] |pwrite64 [3] | 9885 |[2] | | | | | 9886 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9887 |pthread_attr_getguardsize |pthread_cond_wait [2] |pthread_mutex_lock [2] |pthread_rwlock_trywrlock [2] |sem_close [2] | 9888 |[2] | | | | | 9889 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9890 |pthread_attr_getschedparam |pthread_condattr_destroy |pthread_mutex_trylock [2] |pthread_rwlock_unlock [2] |sem_destroy [2] | 9891 |[2] |[2] | | | | 9892 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9893 |pthread_attr_getstackaddr |pthread_condattr_getpshared|pthread_mutex_unlock [2] |pthread_rwlock_wrlock [2] |sem_getvalue [2] | 9894 |[2] |[2] | | | | 9895 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9896 |pthread_attr_getstacksize |pthread_condattr_init [2] |pthread_mutexattr_destroy |pthread_rwlockattr_destroy |sem_init [2] | 9897 |[2] | |[2] |[2] | | 9898 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9899 |pthread_attr_init [2] |pthread_condattr_setpshared|pthread_mutexattr_getpshared|pthread_rwlockattr_getpshared|sem_open [2] | 9900 | |[2] |[2] |[2] | | 9901 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9902 |pthread_attr_setdetachstate|pthread_create [2] |pthread_mutexattr_gettype |pthread_rwlockattr_init [2] |sem_post [2] | 9903 |[2] | |[2] | | | 9904 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9905 |pthread_attr_setguardsize |pthread_detach [2] |pthread_mutexattr_init [2] |pthread_rwlockattr_setpshared|sem_timedwait [2] | 9906 |[2] | | |[2] | | 9907 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9908 |pthread_attr_setschedparam |pthread_equal [2] |pthread_mutexattr_setpshared|pthread_self [2] |sem_trywait [2] | 9909 |[2] | |[2] | | | 9910 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9911 |pthread_attr_setstackaddr |pthread_exit [2] |pthread_mutexattr_settype |pthread_setcancelstate [2] |sem_unlink [2] | 9912 |[2] | |[2] | | | 9913 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9914 |pthread_attr_setstacksize |pthread_getspecific [2] |pthread_once [2] |pthread_setcanceltype [2] |sem_wait [2] | 9915 |[2] | | | | | 9916 +-----------------------------------------------------------------------------------------------------------------------------------------+ 9917 9918 Referenced Specification(s) 9919 9920 [1]. this specification 9921 9922 [2]. ISO POSIX (2003) 9923 9924 [3]. Large File Support 9925 9926 ------------------------------------------------------------------------------- 9927 9928 Data Definitions for libpthread 9929 9930 This section defines global identifiers and their values that are associated 9931 with interfaces contained in libpthread. These definitions are organized into 9932 groups that correspond to system headers. This convention is used as a 9933 convenience for the reader, and does not imply the existence of these headers, 9934 or their content. 9935 9936 These definitions are intended to supplement those provided in the referenced 9937 underlying specifications. 9938 9939 This specification uses ISO/IEC 9899 C Language as the reference programming 9940 language, and data definitions are specified in ISO C format. The C language is 9941 used here as a convenient notation. Using a C language description of these 9942 data objects does not preclude their use by other programming languages. 9943 9944 ------------------------------------------------------------------------------- 9945 9946 pthread.h 9947 9948 #define PTHREAD_MUTEX_DEFAULT 1 9949 #define PTHREAD_MUTEX_NORMAL 1 9950 #define PTHREAD_MUTEX_TIMED_NP 1 9951 #define PTHREAD_MUTEX_RECURSIVE 2 9952 #define PTHREAD_RWLOCK_DEFAULT_NP 2 9953 #define PTHREAD_MUTEX_ERRORCHECK 3 9954 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(& _buffer,(execute));} 9955 #define __LOCK_INITIALIZER { 0, 0 } 9956 #define PTHREAD_RWLOCK_INITIALIZER { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE } 9957 #define PTHREAD_MUTEX_INITIALIZER {0,0,0,PTHREAD_MUTEX_TIMED_NP,__LOCK_INITIALIZER} 9958 #define pthread_cleanup_push(routine,arg) {struct _pthread_cleanup_buffer _buffer;_pthread_cleanup_push(& _buffer,(routine),(arg)); 9959 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 9960 9961 struct _pthread_cleanup_buffer 9962 { 9963 void (*__routine) (void *); 9964 void *__arg; 9965 int __canceltype; 9966 struct _pthread_cleanup_buffer *__prev; 9967 } 9968 ; 9969 typedef unsigned int pthread_key_t; 9970 typedef int pthread_once_t; 9971 typedef long long __pthread_cond_align_t; 9972 9973 typedef unsigned long pthread_t; 9974 struct _pthread_fastlock 9975 { 9976 long __status; 9977 int __spinlock; 9978 } 9979 ; 9980 9981 typedef struct _pthread_descr_struct *_pthread_descr; 9982 9983 typedef struct 9984 { 9985 int __m_reserved; 9986 int __m_count; 9987 _pthread_descr __m_owner; 9988 int __m_kind; 9989 struct _pthread_fastlock __m_lock; 9990 } 9991 pthread_mutex_t; 9992 typedef struct 9993 { 9994 int __mutexkind; 9995 } 9996 pthread_mutexattr_t; 9997 9998 typedef struct 9999 { 10000 int __detachstate; 10001 int __schedpolicy; 10002 struct sched_param __schedparam; 10003 int __inheritsched; 10004 int __scope; 10005 size_t __guardsize; 10006 int __stackaddr_set; 10007 void *__stackaddr; 10008 unsigned long __stacksize; 10009 } 10010 pthread_attr_t; 10011 10012 typedef struct 10013 { 10014 struct _pthread_fastlock __c_lock; 10015 _pthread_descr __c_waiting; 10016 char __padding[48 - sizeof (struct _pthread_fastlock) - 10017 sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; 10018 __pthread_cond_align_t __align; 10019 } 10020 pthread_cond_t; 10021 typedef struct 10022 { 10023 int __dummy; 10024 } 10025 pthread_condattr_t; 10026 10027 typedef struct _pthread_rwlock_t 10028 { 10029 struct _pthread_fastlock __rw_lock; 10030 int __rw_readers; 10031 _pthread_descr __rw_writer; 10032 _pthread_descr __rw_read_waiting; 10033 _pthread_descr __rw_write_waiting; 10034 int __rw_kind; 10035 int __rw_pshared; 10036 } 10037 pthread_rwlock_t; 10038 typedef struct 10039 { 10040 int __lockkind; 10041 int __pshared; 10042 } 10043 pthread_rwlockattr_t; 10044 10045 #define PTHREAD_CREATE_JOINABLE 0 10046 #define PTHREAD_INHERIT_SCHED 0 10047 #define PTHREAD_ONCE_INIT 0 10048 #define PTHREAD_PROCESS_PRIVATE 0 10049 #define PTHREAD_CREATE_DETACHED 1 10050 #define PTHREAD_EXPLICIT_SCHED 1 10051 #define PTHREAD_PROCESS_SHARED 1 10052 10053 #define PTHREAD_CANCELED ((void*)-1) 10054 #define PTHREAD_CANCEL_DEFERRED 0 10055 #define PTHREAD_CANCEL_ENABLE 0 10056 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 10057 #define PTHREAD_CANCEL_DISABLE 1 10058 10059 ------------------------------------------------------------------------------- 10060 10061 semaphore.h 10062 10063 typedef struct 10064 { 10065 struct _pthread_fastlock __sem_lock; 10066 int __sem_value; 10067 _pthread_descr __sem_waiting; 10068 } 10069 sem_t; 10070 #define SEM_FAILED ((sem_t*)0) 10071 10072 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 10073 10074 ------------------------------------------------------------------------------- 10075 10076 Interface Definitions for libpthread 10077 10078 Table of Contents 10079 _pthread_cleanup_pop -- establish cancellation handlers 10080 _pthread_cleanup_push -- establish cancellation handlers 10081 10082 The following interfaces are included in libpthread and are defined by this 10083 specification. Unless otherwise noted, these interfaces shall be included in 10084 the source standard. 10085 10086 Other interfaces listed above for libpthread shall behave as described in the 10087 referenced base document. 10088 10089 _pthread_cleanup_pop 10090 10091 Name 10092 10093 _pthread_cleanup_pop -- establish cancellation handlers 10094 10095 Synopsis 10096 10097 #include 10098 10099 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 10100 10101 Description 10102 10103 The _pthread_cleanup_pop function provides an implementation of the 10104 pthread_cleanup_pop macro described in ISO POSIX (2003). 10105 10106 The _pthread_cleanup_pop function is not in the source standard; it is only in 10107 the binary standard. 10108 10109 _pthread_cleanup_push 10110 10111 Name 10112 10113 _pthread_cleanup_push -- establish cancellation handlers 10114 10115 Synopsis 10116 10117 #include 10118 10119 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, void (*) (void *), 10120 void *); 10121 10122 Description 10123 10124 The _pthread_cleanup_push function provides an implementation of the 10125 pthread_cleanup_push macro described in ISO POSIX (2003). 10126 10127 The _pthread_cleanup_push function is not in the source standard; it is only in 10128 the binary standard. 10129 10130 ------------------------------------------------------------------------------- 10131 10132 Interfaces for libgcc_s 10133 10134 Table 7-34 defines the library name and shared object name for the libgcc_s 10135 library 10136 10137 Table 7-34. libgcc_s Definition 10138 10139 +-----------------------+ 10140 |Library:|libgcc_s | 10141 |--------+--------------| 10142 |SONAME: |libgcc_s.so.1 | 10143 +-----------------------+ 10144 10145 ------------------------------------------------------------------------------- 10146 10147 Unwind Library 10148 10149 ------------------------------------------------------------------------------- 10150 10151 Interfaces for Unwind Library 10152 10153 No external functions are defined for libgcc_s - Unwind Library 10154 10155 ------------------------------------------------------------------------------- 10156 10157 Data Definitions for libgcc_s 10158 10159 This section defines global identifiers and their values that are associated 10160 with interfaces contained in libgcc_s. These definitions are organized into 10161 groups that correspond to system headers. This convention is used as a 10162 convenience for the reader, and does not imply the existence of these headers, 10163 or their content. 10164 10165 These definitions are intended to supplement those provided in the referenced 10166 underlying specifications. 10167 10168 This specification uses ISO/IEC 9899 C Language as the reference programming 10169 language, and data definitions are specified in ISO C format. The C language is 10170 used here as a convenient notation. Using a C language description of these 10171 data objects does not preclude their use by other programming languages. 10172 10173 ------------------------------------------------------------------------------- 10174 10175 unwind.h 10176 10177 struct dwarf_eh_base 10178 { 10179 void *tbase; 10180 void *dbase; 10181 void *func; 10182 } 10183 ; 10184 struct _Unwind_Context; 10185 10186 typedef unsigned int _Unwind_Ptr; 10187 typedef unsigned int _Unwind_Word; 10188 10189 typedef enum 10190 { 10191 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ERROR = 10192 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 10193 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 10194 7, _URC_CONTINUE_UNWIND = 8 10195 } 10196 _Unwind_Reason_Code; 10197 10198 struct _Unwind_Exception 10199 { 10200 _Unwind_Exception_Class; 10201 _Unwind_Exception_Cleanup_Fn; 10202 _Unwind_Word; 10203 _Unwind_Word; 10204 } 10205 ; 10206 #define _UA_SEARCH_PHASE 1 10207 #define _UA_END_OF_STACK 16 10208 #define _UA_CLEANUP_PHASE 2 10209 #define _UA_HANDLER_FRAME 4 10210 #define _UA_FORCE_UNWIND 8 10211 10212 ------------------------------------------------------------------------------- 10213 10214 Interfaces for libdl 10215 10216 Table 7-35 defines the library name and shared object name for the libdl 10217 library 10218 10219 Table 7-35. libdl Definition 10220 10221 +--------------------+ 10222 |Library:|libdl | 10223 |--------+-----------| 10224 |SONAME: |libdl.so.2 | 10225 +--------------------+ 10226 10227 The behavior of the interfaces in this library is specified by the following 10228 specifications: 10229 10230 this specification 10231 ISO POSIX (2003) 10232 10233 ------------------------------------------------------------------------------- 10234 10235 Dynamic Loader 10236 10237 ------------------------------------------------------------------------------- 10238 10239 Interfaces for Dynamic Loader 10240 10241 An LSB conforming implementation shall provide the generic functions for 10242 Dynamic Loader specified in Table 7-36, with the full functionality as 10243 described in the referenced underlying specification. 10244 10245 Table 7-36. libdl - Dynamic Loader Function Interfaces 10246 10247 +-------------------------------------------------------+ 10248 |dladdr [1]|dlclose [2]|dlerror [2]|dlopen [1]|dlsym [1]| 10249 +-------------------------------------------------------+ 10250 10251 Referenced Specification(s) 10252 10253 [1]. this specification 10254 10255 [2]. ISO POSIX (2003) 10256 10257 ------------------------------------------------------------------------------- 10258 10259 Data Definitions for libdl 10260 10261 This section defines global identifiers and their values that are associated 10262 with interfaces contained in libdl. These definitions are organized into groups 10263 that correspond to system headers. This convention is used as a convenience for 10264 the reader, and does not imply the existence of these headers, or their 10265 content. 10266 10267 These definitions are intended to supplement those provided in the referenced 10268 underlying specifications. 10269 10270 This specification uses ISO/IEC 9899 C Language as the reference programming 10271 language, and data definitions are specified in ISO C format. The C language is 10272 used here as a convenient notation. Using a C language description of these 10273 data objects does not preclude their use by other programming languages. 10274 10275 ------------------------------------------------------------------------------- 10276 10277 dlfcn.h 10278 10279 #define RTLD_NEXT ((void *) -1l) 10280 #define RTLD_LOCAL 0 10281 #define RTLD_LAZY 0x00001 10282 #define RTLD_NOW 0x00002 10283 #define RTLD_GLOBAL 0x00100 10284 10285 typedef struct 10286 { 10287 char *dli_fname; 10288 void *dli_fbase; 10289 char *dli_sname; 10290 void *dli_saddr; 10291 } 10292 Dl_info; 10293 10294 ------------------------------------------------------------------------------- 10295 10296 Interface Definitions for libdl 10297 10298 Table of Contents 10299 dladdr -- find the shared object containing a given address 10300 dlopen -- open dynamic object 10301 dlsym -- obtain the address of a symbol from a dlopen object 10302 10303 The following interfaces are included in libdl and are defined by this 10304 specification. Unless otherwise noted, these interfaces shall be included in 10305 the source standard. 10306 10307 Other interfaces listed above for libdl shall behave as described in the 10308 referenced base document. 10309 10310 dladdr 10311 10312 Name 10313 10314 dladdr -- find the shared object containing a given address 10315 10316 Synopsis 10317 10318 #include 10319 10320 typedef struct { 10321 const char *dli_fname; 10322 void *dli_fbase; 10323 const char *dli_sname; 10324 void *dli_saddr; 10325 } Dl_info; 10326 10327 int dladdr(void *addr, Dl_info *dlip); 10328 10329 Description 10330 10331 The dladdr function shall query the dynamic linker for information about the 10332 shared object containing the address addr. The information shall be returned in 10333 the user supplied data structure referenced by dlip. 10334 10335 The structure shall contain at least the following members: 10336 10337 dli_fname 10338 10339 The pathname of the shared object containing the address 10340 10341 dli_fbase 10342 10343 The base address at which the shared object is mapped into the address 10344 space of the calling process. 10345 10346 dli_sname 10347 10348 The name of the nearest runtime symbol with value less than or equal to 10349 addr. Where possible, the symbol name shall be returned as it would appear 10350 in C source code. 10351 10352 If no symbol with a suitable value is found, both this field and dli_saddr 10353 shall be set to NULL. 10354 10355 dli_saddr 10356 10357 The address of the symbol returned in dli_sname. 10358 10359 The behavior of dladdr is only specified in dynamically linked programs. 10360 10361 Return Value 10362 10363 On success, dladdr shall return non-zero, and the structure referenced by dlip 10364 shall be filled in as described. Otherwise, dladdr shall return zero, and the 10365 cause of the error can be fetched with dlerr. 10366 10367 Errors 10368 10369 See dlerr. 10370 10371 Environment 10372 10373 LD_LIBRARY_PATH 10374 10375 directory search-path for object files 10376 10377 dlopen 10378 10379 Name 10380 10381 dlopen -- open dynamic object 10382 10383 Synopsis 10384 10385 #include 10386 10387 void * dlopen(const char *filename, int flag); 10388 10389 Description 10390 10391 dlopen shall behave as specified in ISO POSIX (2003), but with additional 10392 behaviors listed below. 10393 10394 If the file argument does not contain a slash character, then the system shall 10395 look for a library of that name in at least the following directories, and use 10396 the first one which is found: 10397 10398 * The directories specified by the DT_RPATH dynamic entry. 10399 10400 * The directories specified in the LD_LIBRARY_PATH environment variable 10401 (which is a colon separated list of pathnames). This step shall be skipped 10402 for setuid and setgid executables. 10403 10404 * A set of directories sufficient to contain the libraries specified in this 10405 standard. 10406 10407 10408 Note: Traditionally, /lib and /usr/lib. This case would also cover 10409 cases in which the system used the mechanism of /etc/ld.so.conf and / 10410 etc/ld.so.cache to provide access. 10411 10412 Example: An application which is not linked against libm may choose to 10413 dlopen libm. 10414 10415 10416 10417 10418 10419 dlsym 10420 10421 Name 10422 10423 dlsym -- obtain the address of a symbol from a dlopen object 10424 10425 Description 10426 10427 dlsym is as specified in the ISO POSIX (2003), but with differences as listed 10428 below. 10429 10430 The special purpose value for handle RTLD_NEXT 10431 10432 The value RTLD_NEXT, which is reserved for future use shall be available, with 10433 the behavior as described in ISO POSIX (2003). 10434 10435 ------------------------------------------------------------------------------- 10436 10437 Interfaces for libcrypt 10438 10439 Table 7-37 defines the library name and shared object name for the libcrypt 10440 library 10441 10442 Table 7-37. libcrypt Definition 10443 10444 +-----------------------+ 10445 |Library:|libcrypt | 10446 |--------+--------------| 10447 |SONAME: |libcrypt.so.1 | 10448 +-----------------------+ 10449 10450 The behavior of the interfaces in this library is specified by the following 10451 specifications: 10452 10453 ISO POSIX (2003) 10454 10455 ------------------------------------------------------------------------------- 10456 10457 Encryption 10458 10459 ------------------------------------------------------------------------------- 10460 10461 Interfaces for Encryption 10462 10463 An LSB conforming implementation shall provide the generic functions for 10464 Encryption specified in Table 7-38, with the full functionality as described in 10465 the referenced underlying specification. 10466 10467 Table 7-38. libcrypt - Encryption Function Interfaces 10468 10469 +------------------------------------+ 10470 |crypt [1]|encrypt [1]|setkey [1]| | | 10471 +------------------------------------+ 10472 10473 Referenced Specification(s) 10474 10475 [1]. ISO POSIX (2003) 10476 10477 ------------------------------------------------------------------------------- 10478 10479 Interfaces for libpam 10480 10481 Table 7-39 defines the library name and shared object name for the libpam 10482 library 10483 10484 Table 7-39. libpam Definition 10485 10486 +---------------------+ 10487 |Library:|libpam | 10488 |--------+------------| 10489 |SONAME: |libpam.so.0 | 10490 +---------------------+ 10491 10492 A single service name, other, shall always be present. The behavior of this 10493 service shall be determined by the system administrator. Additional service 10494 names may also exist. [1] 10495 10496 The behavior of the interfaces in this library is specified by the following 10497 specifications: 10498 10499 this specification 10500 10501 ------------------------------------------------------------------------------- 10502 10503 Pluggable Authentication API 10504 10505 ------------------------------------------------------------------------------- 10506 10507 Interfaces for Pluggable Authentication API 10508 10509 An LSB conforming implementation shall provide the generic functions for 10510 Pluggable Authentication API specified in Table 7-40, with the full 10511 functionality as described in the referenced underlying specification. 10512 10513 Table 7-40. libpam - Pluggable Authentication API Function Interfaces 10514 10515 +-----------------------------------------------------------------------------+ 10516 |pam_acct_mgmt |pam_close_session|pam_get_item [1]|pam_set_item|pam_strerror| 10517 |[1] |[1] | |[1] |[1] | 10518 |----------------+-----------------+----------------+------------+------------| 10519 |pam_authenticate|pam_end [1] |pam_getenvlist |pam_setcred | | 10520 |[1] | |[1] |[1] | | 10521 |----------------+-----------------+----------------+------------+------------| 10522 |pam_chauthtok |pam_fail_delay |pam_open_session|pam_start | | 10523 |[1] |[1] |[1] |[1] | | 10524 +-----------------------------------------------------------------------------+ 10525 10526 Referenced Specification(s) 10527 10528 [1]. this specification 10529 10530 ------------------------------------------------------------------------------- 10531 10532 Data Definitions for libpam 10533 10534 This section defines global identifiers and their values that are associated 10535 with interfaces contained in libpam. These definitions are organized into 10536 groups that correspond to system headers. This convention is used as a 10537 convenience for the reader, and does not imply the existence of these headers, 10538 or their content. 10539 10540 These definitions are intended to supplement those provided in the referenced 10541 underlying specifications. 10542 10543 This specification uses ISO/IEC 9899 C Language as the reference programming 10544 language, and data definitions are specified in ISO C format. The C language is 10545 used here as a convenient notation. Using a C language description of these 10546 data objects does not preclude their use by other programming languages. 10547 10548 ------------------------------------------------------------------------------- 10549 10550 security/pam_appl.h 10551 10552 typedef struct pam_handle pam_handle_t; 10553 struct pam_message 10554 { 10555 int msg_style; 10556 const char *msg; 10557 } 10558 ; 10559 struct pam_response 10560 { 10561 char *resp; 10562 int resp_retcode; 10563 } 10564 ; 10565 10566 struct pam_conv 10567 { 10568 int (*conv) (int num_msg, const struct pam_message * *msg, 10569 struct pam_response * *resp, void *appdata_ptr); 10570 void *appdata_ptr; 10571 } 10572 ; 10573 #define PAM_PROMPT_ECHO_OFF 1 10574 #define PAM_PROMPT_ECHO_ON 2 10575 #define PAM_ERROR_MSG 3 10576 #define PAM_TEXT_INFO 4 10577 10578 #define PAM_SERVICE 1 10579 #define PAM_USER 2 10580 #define PAM_TTY 3 10581 #define PAM_RHOST 4 10582 #define PAM_CONV 5 10583 #define PAM_RUSER 8 10584 #define PAM_USER_PROMPT 9 10585 10586 #define PAM_SUCCESS 0 10587 #define PAM_OPEN_ERR 1 10588 #define PAM_USER_UNKNOWN 10 10589 #define PAM_MAXTRIES 11 10590 #define PAM_NEW_AUTHTOK_REQD 12 10591 #define PAM_ACCT_EXPIRED 13 10592 #define PAM_SESSION_ERR 14 10593 #define PAM_CRED_UNAVAIL 15 10594 #define PAM_CRED_EXPIRED 16 10595 #define PAM_CRED_ERR 17 10596 #define PAM_CONV_ERR 19 10597 #define PAM_SYMBOL_ERR 2 10598 #define PAM_AUTHTOK_ERR 20 10599 #define PAM_AUTHTOK_RECOVER_ERR 21 10600 #define PAM_AUTHTOK_LOCK_BUSY 22 10601 #define PAM_AUTHTOK_DISABLE_AGING 23 10602 #define PAM_TRY_AGAIN 24 10603 #define PAM_ABORT 26 10604 #define PAM_AUTHTOK_EXPIRED 27 10605 #define PAM_BAD_ITEM 29 10606 #define PAM_SERVICE_ERR 3 10607 #define PAM_SYSTEM_ERR 4 10608 #define PAM_BUF_ERR 5 10609 #define PAM_PERM_DENIED 6 10610 #define PAM_AUTH_ERR 7 10611 #define PAM_CRED_INSUFFICIENT 8 10612 #define PAM_AUTHINFO_UNAVAIL 9 10613 10614 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 10615 #define PAM_ESTABLISH_CRED 0x0002U 10616 #define PAM_DELETE_CRED 0x0004U 10617 #define PAM_REINITIALIZE_CRED 0x0008U 10618 #define PAM_REFRESH_CRED 0x0010U 10619 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 10620 #define PAM_SILENT 0x8000U 10621 10622 ------------------------------------------------------------------------------- 10623 10624 Interface Definitions for libpam 10625 10626 Table of Contents 10627 pam_acct_mgmt -- establish the status of a user's account 10628 pam_authenticate -- authenticate the user 10629 pam_chauthtok -- change the authentication token for a given user 10630 pam_close_session -- indicate that an authenticated session has ended 10631 pam_end -- terminate the use of the PAM library 10632 pam_fail_delay -- specify delay time to use on authentication error 10633 pam_get_item -- obtain the value of the indicated item. 10634 pam_getenvlist -- returns a pointer to the complete PAM environment. 10635 pam_open_session -- used to indicate that an authenticated session has been 10636 initiated 10637 pam_set_item -- (re)set the value of an item. 10638 pam_setcred -- set the module-specific credentials of the user 10639 pam_start -- initialize the PAM library 10640 pam_strerror -- returns a string describing the PAM error 10641 10642 The following interfaces are included in libpam and are defined by this 10643 specification. Unless otherwise noted, these interfaces shall be included in 10644 the source standard. 10645 10646 Other interfaces listed above for libpam shall behave as described in the 10647 referenced base document. 10648 10649 pam_acct_mgmt 10650 10651 Name 10652 10653 pam_acct_mgmt -- establish the status of a user's account 10654 10655 Synopsis 10656 10657 #include 10658 10659 int pam_acct_mgmt(pam_handle_t *pamh, int flags); 10660 10661 Description 10662 10663 pam_acct_mgmt establishes the account's usability and the user's accessibility 10664 to the system. It is typically called after the user has been authenticated. 10665 10666 flags may be specified as any valid flag (namely, one of those applicable to 10667 the flags argument of pam_authenticate). Additionally, the value of flags may 10668 be logically or'd with PAM_SILENT. 10669 10670 Return Value 10671 10672 PAM_SUCCESS 10673 10674 Success. 10675 10676 PAM_NEW_AUTHTOK_REQD 10677 10678 User is valid, but user's authentication token has expired. The correct 10679 response to this return-value is to require that the user satisfy the 10680 pam_chauthtok function before obtaining service. It may not be possible for 10681 an application to do this. In such a case, the user should be denied access 10682 until the account password is updated. 10683 10684 PAM_ACCT_EXPIRED 10685 10686 User is no longer permitted access to the system. 10687 10688 PAM_AUTH_ERR 10689 10690 Authentication error. 10691 10692 PAM_PERM_DENIED 10693 10694 User is not permitted to gain access at this time. 10695 10696 PAM_USER_UNKNOWN 10697 10698 User is not known to a module's account management component. 10699 10700 Errors 10701 10702 May be translated to text with pam_strerror. 10703 10704 pam_authenticate 10705 10706 Name 10707 10708 pam_authenticate -- authenticate the user 10709 10710 Synopsis 10711 10712 #include 10713 10714 int pam_authenticate(pam_handle_t *pamh, int flags); 10715 10716 Description 10717 10718 pam_authenticate serves as an interface to the authentication mechanisms of the 10719 loaded modules. 10720 10721 flags is an optional parameter that may be specified by the following value: 10722 10723 PAM_DISALLOW_NULL_AUTHTOK 10724 10725 Instruct the authentication modules to return PAM_AUTH_ERR if the user does 10726 not have a registered authorization token. 10727 10728 Additionally, the value of flags may be logically or'd with PAM_SILENT. 10729 10730 The process may need to be privileged in order to successfully call this 10731 function. 10732 10733 Return Value 10734 10735 PAM_SUCCESS 10736 10737 Success. 10738 10739 PAM_AUTH_ERR 10740 10741 User was not authenticated or process did not have sufficient privileges to 10742 perform authentication. 10743 10744 PAM_CRED_INSUFFICIENT 10745 10746 Application does not have sufficient credentials to authenticate the user. 10747 10748 PAM_AUTHINFO_UNAVAIL 10749 10750 Modules were not able to access the authentication information. This might 10751 be due to a network or hardware failure, etc. 10752 10753 PAM_USER_UNKNOWN 10754 10755 Supplied username is not known to the authentication service. 10756 10757 PAM_MAXTRIES 10758 10759 One or more authentication modules has reached its limit of tries 10760 authenticating the user. Do not try again. 10761 10762 PAM_ABORT 10763 10764 One or more authentication modules failed to load. 10765 10766 Errors 10767 10768 May be translated to text with pam_strerror. 10769 10770 pam_chauthtok 10771 10772 Name 10773 10774 pam_chauthtok -- change the authentication token for a given user 10775 10776 Synopsis 10777 10778 #include 10779 10780 int pam_chauthtok(pam_handle_t *pamh, const int flags); 10781 10782 Description 10783 10784 pam_chauthtok is used to change the authentication token for a given user as 10785 indicated by the state associated with the handle pamh. 10786 10787 flags is an optional parameter that may be specified by the following value: 10788 10789 PAM_CHANGE_EXPIRED_AUTHTOK 10790 10791 User's authentication token should only be changed if it has expired. 10792 10793 Additionally, the value of flags may be logically or'd with PAM_SILENT. 10794 10795 RETURN VALUE 10796 10797 PAM_SUCCESS 10798 10799 Success. 10800 10801 PAM_AUTHTOK_ERR 10802 10803 A module was unable to obtain the new authentication token. 10804 10805 PAM_AUTHTOK_RECOVER_ERR 10806 10807 A module was unable to obtain the old authentication token. 10808 10809 PAM_AUTHTOK_LOCK_BUSY 10810 10811 One or more modules were unable to change the authentication token since it 10812 is currently locked. 10813 10814 PAM_AUTHTOK_DISABLE_AGING 10815 10816 Authentication token aging has been disabled for at least one of the 10817 modules. 10818 10819 PAM_PERM_DENIED 10820 10821 Permission denied. 10822 10823 PAM_TRY_AGAIN 10824 10825 Not all modules were in a position to update the authentication token(s). 10826 In such a case, none of the user's authentication tokens are updated. 10827 10828 PAM_USER_UNKNOWN 10829 10830 User is not known to the authentication token changing service. 10831 10832 ERRORS 10833 10834 May be translated to text with pam_strerror. 10835 10836 pam_close_session 10837 10838 Name 10839 10840 pam_close_session -- indicate that an authenticated session has ended 10841 10842 Synopsis 10843 10844 #include 10845 10846 int pam_close_session(pam_handle_t *pamh, int flags); 10847 10848 Description 10849 10850 pam_close_session is used to indicate that an authenticated session has ended. 10851 It is used to inform the module that the user is exiting a session. It should 10852 be possible for the PAM library to open a session and close the same session 10853 from different applications. 10854 10855 flags may have the value PAM_SILENT to indicate that no output should be 10856 generated as a result of this function call. 10857 10858 Return Value 10859 10860 PAM_SUCCESS 10861 10862 Success. 10863 10864 PAM_SESSION_ERR 10865 10866 One of the required loaded modules was unable to close a session for the 10867 user. 10868 10869 Errors 10870 10871 May be translated to text with pam_strerror. 10872 10873 pam_end 10874 10875 Name 10876 10877 pam_end -- terminate the use of the PAM library 10878 10879 Synopsis 10880 10881 #include 10882 10883 int pam_end(pam_handle_t *pamh, int pam_status); 10884 10885 Description 10886 10887 pam_end terminates use of the PAM library. On success, the contents of *pamh 10888 are no longer valid, and all memory associated with it is invalid. 10889 10890 Normally, pam_status is passed the value PAM_SUCCESS, but in the event of an 10891 unsuccessful service application, the appropriate PAM error return value should 10892 be used. 10893 10894 Return Value 10895 10896 PAM_SUCCESS 10897 10898 Success. 10899 10900 Errors 10901 10902 May be translated to text with pam_strerror. 10903 10904 pam_fail_delay 10905 10906 Name 10907 10908 pam_fail_delay -- specify delay time to use on authentication error 10909 10910 Synopsis 10911 10912 #include 10913 10914 int pam_fail_delay(pam_handle_t *pamh, unsigned int micro_sec); 10915 10916 Description 10917 10918 pam_fail_delay specifies the minimum delay for the PAM library to use when an 10919 authentication error occurs. The actual delay can vary by as much at 25%. If 10920 this function is called multiple times, the longest time specified by any of 10921 the call will be used. 10922 10923 The delay is invoked if an authentication error occurs during the 10924 pam_authenticate or pam_chauthtok function calls. 10925 10926 Independent of the success of pam_authenticate or pam_chauthtok, the delay time 10927 is reset to its default value of 0 when the PAM library returns control to the 10928 application from these two functions. 10929 10930 Return Value 10931 10932 PAM_SUCCESS 10933 10934 Success. 10935 10936 Errors 10937 10938 May be translated to text with pam_strerror. 10939 10940 pam_get_item 10941 10942 Name 10943 10944 pam_get_item -- obtain the value of the indicated item. 10945 10946 Synopsis 10947 10948 #include 10949 10950 int pam_get_item(const pam_handle_t *pamh, int item_type, const void **item); 10951 10952 Description 10953 10954 pam_get_item obtains the value of the indicated item_type. The possible values 10955 of item_type are the same as listed for pam_set_item. 10956 10957 On success, item contains a pointer to the value of the corresponding item. 10958 Note that this is a pointer to the actual data and should not be free'd or 10959 over-written. 10960 10961 Return Value 10962 10963 PAM_SUCCESS 10964 10965 Success. 10966 10967 PAM_PERM_DENIED 10968 10969 Application passed a NULL pointer for item. 10970 10971 PAM_BAD_ITEM 10972 10973 Application attempted to get an undefined item. 10974 10975 Errors 10976 10977 May be translated to text with pam_strerror. 10978 10979 pam_getenvlist 10980 10981 Name 10982 10983 pam_getenvlist -- returns a pointer to the complete PAM environment. 10984 10985 Synopsis 10986 10987 #include 10988 10989 char * const *pam_getenvlist(pam_handle_t *pamh); 10990 10991 Description 10992 10993 pam_getenvlist returns a pointer to the complete PAM environment. This pointer 10994 points to an array of pointers to NUL-terminated strings and must be terminated 10995 by a NULL pointer. Each string has the form "name=value". 10996 10997 The PAM library module allocates memory for the returned value and the 10998 associated strings. The calling application is responsible for freeing this 10999 memory. 11000 11001 Return Value 11002 11003 pam_getenvlist returns an array of string pointers containing the PAM 11004 environment. On error, NULL is returned. 11005 11006 pam_open_session 11007 11008 Name 11009 11010 pam_open_session -- used to indicate that an authenticated session has been 11011 initiated 11012 11013 Synopsis 11014 11015 #include 11016 11017 int pam_open_session(pam_handle_t *pamh, int flags); 11018 11019 Description 11020 11021 pam_handle_t is used to indicate that an authenticated session has begun. It is 11022 used to inform the module that the user is currently in a session. It should be 11023 possible for the PAM library to open a session and close the same session from 11024 different applications. 11025 11026 flags may have the value PAM_SILENT to indicate that no output be generated as 11027 a rsult of this function call. 11028 11029 Return Value 11030 11031 PAM_SUCCESS 11032 11033 Success. 11034 11035 PAM_SESSION_ERR 11036 11037 One of the loaded modules was unable to open a session for the user. 11038 11039 ERRORS 11040 11041 May be translated to text with pam_strerror. 11042 11043 pam_set_item 11044 11045 Name 11046 11047 pam_set_item -- (re)set the value of an item. 11048 11049 Synopsis 11050 11051 #include 11052 11053 int pam_set_item(pam_handle_t *pamh, int item_type, const void *item); 11054 11055 Description 11056 11057 pam_set_item (re)sets the value of one of the following item_types: 11058 11059 PAM_SERVICE 11060 11061 service name 11062 11063 PAM_USER 11064 11065 user name 11066 11067 PAM_TTY 11068 11069 terminal name 11070 11071 The value for a device file should include the /dev/ prefix. The value for 11072 graphical, X-based, applications should be the $DISPLAY variable. 11073 11074 PAM_RHOST 11075 11076 remote host name 11077 11078 PAM_CONV 11079 11080 conversation structure 11081 11082 PAM_RUSER 11083 11084 remote user name 11085 11086 PAM_USER_PROMPT 11087 11088 string to be used when prompting for a user's name 11089 11090 The default value for this string is Please enter username: . 11091 11092 For all item_types other than PAM_CONV, item is a pointer to a NULL-terminated 11093 character string. In the case of PAM_CONV, item points to an initialized 11094 pam_conv structure. 11095 11096 Return Value 11097 11098 PAM_SUCCESS 11099 11100 Success. 11101 11102 PAM_PERM_DENIED 11103 11104 An attempt was made to replace the conversation structure with a NULL 11105 value. 11106 11107 PAM_BUF_ERR 11108 11109 Function ran out of memory making a copy of the item. 11110 11111 PAM_BAD_ITEM 11112 11113 Application attempted to set an undefined item. 11114 11115 Errors 11116 11117 May be translated to text with pam_strerror. 11118 11119 pam_setcred 11120 11121 Name 11122 11123 pam_setcred -- set the module-specific credentials of the user 11124 11125 Synopsis 11126 11127 #include 11128 11129 extern int pam_setcred(pam_handle_t *pamh, int flags); 11130 11131 Description 11132 11133 pam_setcred sets the module-specific credentials of the user. It is usually 11134 called after the user has been authenticated, after the account management 11135 function has been called and after a session has been opened for the user. 11136 11137 flags maybe specified from among the following values: 11138 11139 PAM_ESTABLISH_CRED 11140 11141 set credentials for the authentication service 11142 11143 PAM_DELETE_CRED 11144 11145 delete credentials associated with the authentication service 11146 11147 PAM_REINITIALIZE_CRED 11148 11149 reinitialize the user credentials 11150 11151 PAM_REFRESH_CRED 11152 11153 extend lifetime of the user credentials 11154 11155 Additionally, the value of flags may be logically or'd with PAM_SILENT. 11156 11157 Return Value 11158 11159 PAM_SUCCESS 11160 11161 Success. 11162 11163 PAM_CRED_UNAVAIL 11164 11165 Module cannot retrieve the user's credentials. 11166 11167 PAM_CRED_EXPIRED 11168 11169 User's credentials have expired. 11170 11171 PAM_USER_UNKNOWN 11172 11173 User is not known to an authentication module. 11174 11175 PAM_CRED_ERR 11176 11177 Module was unable to set the credentials of the user. 11178 11179 Errors 11180 11181 May be translated to text with pam_strerror. 11182 11183 pam_start 11184 11185 Name 11186 11187 pam_start -- initialize the PAM library 11188 11189 Synopsis 11190 11191 #include 11192 11193 int pam_start(const char *service_name, const char *user, const (struct 11194 pam_conv *pam_conversation), pam_handle_t **pamh); 11195 11196 Description 11197 11198 pam_start is used to initialize the PAM library. It must be called prior to any 11199 other usage of the PAM library. On success, *pamh becomes a handle that 11200 provides continuity for successive calls to the PAM library. pam_start expects 11201 arguments as follows: the service_name of the program, the username of the 11202 individual to be authenticated, a pointer to an application-supplied pam_conv 11203 structure, and a pointer to a pam_handle_t pointer. 11204 11205 An application must provide the conversation function used for direct 11206 communication between a loaded module and the application. The application also 11207 typically provides a means for the module to prompt the user for a password, 11208 etc. 11209 11210 The structure, pam_conv, is defined to be, 11211 11212 struct pam_conv { 11213 int (*conv) (int num_msg, 11214 const struct pam_message * *msg, 11215 struct pam_response * *resp, 11216 void *appdata_ptr); 11217 void *appdata_ptr; 11218 }; 11219 11220 It is initialized by the application before it is passed to the library. The 11221 contents of this structure are attached to the *pamh handle. The point of this 11222 argument is to provide a mechanism for any loaded module to interact directly 11223 with the application program; this is why it is called a conversation 11224 structure. 11225 11226 When a module calls the referenced conv function, appdata_ptr is set to the 11227 second element of this structure. 11228 11229 The other arguments of a call to conv concern the information exchanged by 11230 module and application. num_msg holds the length of the array of pointers 11231 passed via msg. On success, the pointer resp points to an array of num_msg 11232 pam_response structures, holding the application-supplied text. Note that resp 11233 is a struct pam_response array and not an array of pointers. 11234 11235 Return Value 11236 11237 PAM_SUCCESS 11238 11239 Success. 11240 11241 PAM_BUF_ERR 11242 11243 Memory allocation error. 11244 11245 PAM_ABORT 11246 11247 Internal failure. 11248 11249 ERRORS 11250 11251 May be translated to text with pam_strerror. 11252 11253 pam_strerror 11254 11255 Name 11256 11257 pam_strerror -- returns a string describing the PAM error 11258 11259 Synopsis 11260 11261 #include 11262 11263 const char * pam_strerror(pam_handle_t *pamh, int errnum); 11264 11265 Description 11266 11267 pam_strerror returns a string describing the PAM error associated with errnum. 11268 11269 Return Value 11270 11271 On success, this function returns a description of the indicated error. The 11272 application should not free or modify this string. This returned string will 11273 not be translated. 11274 11275 III. Utility Libraries 11276 11277 Table of Contents 11278 8. utility Libraries 11279 11280 ------------------------------------------------------------------------------- 11281 11282 Chapter 8. utility Libraries 11283 11284 An LSB-conforming implementation shall also support some utility libraries 11285 which are built on top of the interfaces provided by the base libraries. These 11286 libraries implement common functionality, and hide additional system dependent 11287 information such as file formats and device names. 11288 11289 ------------------------------------------------------------------------------- 11290 11291 Interfaces for libz 11292 11293 Table 8-1 defines the library name and shared object name for the libz library 11294 11295 Table 8-1. libz Definition 11296 11297 +-------------------+ 11298 |Library:|libz | 11299 |--------+----------| 11300 |SONAME: |libz.so.1 | 11301 +-------------------+ 11302 11303 The behavior of the interfaces in this library is specified by the following 11304 specifications: 11305 11306 zlib Manual 11307 11308 ------------------------------------------------------------------------------- 11309 11310 Compression Library 11311 11312 ------------------------------------------------------------------------------- 11313 11314 Interfaces for Compression Library 11315 11316 An LSB conforming implementation shall provide the generic functions for 11317 Compression Library specified in Table 8-2, with the full functionality as 11318 described in the referenced underlying specification. 11319 11320 Table 8-2. libz - Compression Library Function Interfaces 11321 11322 +-----------------------------------------------------------------------------+ 11323 |adler32 [1] |deflateInit_ [1] |gzerror |gzread [1] |inflateInit2_ [1] | 11324 | | |[1] | | | 11325 |-------------+--------------------+---------+-----------+--------------------| 11326 |compress [1] |deflateParams [1] |gzflush |gzrewind |inflateInit_ [1] | 11327 | | |[1] |[1] | | 11328 |-------------+--------------------+---------+-----------+--------------------| 11329 |compress2 [1]|deflateReset [1] |gzgetc |gzseek [1] |inflateReset [1] | 11330 | | |[1] | | | 11331 |-------------+--------------------+---------+-----------+--------------------| 11332 |crc32 [1] |deflateSetDictionary|gzgets |gzsetparams|inflateSetDictionary| 11333 | |[1] |[1] |[1] |[1] | 11334 |-------------+--------------------+---------+-----------+--------------------| 11335 |deflate [1] |get_crc_table [1] |gzopen |gztell [1] |inflateSync [1] | 11336 | | |[1] | | | 11337 |-------------+--------------------+---------+-----------+--------------------| 11338 |deflateCopy |gzclose [1] |gzprintf |gzwrite [1]|inflateSyncPoint [1]| 11339 |[1] | |[1] | | | 11340 |-------------+--------------------+---------+-----------+--------------------| 11341 |deflateEnd |gzdopen [1] |gzputc |inflate [1]|uncompress [1] | 11342 |[1] | |[1] | | | 11343 |-------------+--------------------+---------+-----------+--------------------| 11344 |deflateInit2_|gzeof [1] |gzputs |inflateEnd |zError [1] | 11345 |[1] | |[1] |[1] | | 11346 +-----------------------------------------------------------------------------+ 11347 11348 Referenced Specification(s) 11349 11350 [1]. zlib Manual 11351 11352 ------------------------------------------------------------------------------- 11353 11354 Data Definitions for libz 11355 11356 This section defines global identifiers and their values that are associated 11357 with interfaces contained in libz. These definitions are organized into groups 11358 that correspond to system headers. This convention is used as a convenience for 11359 the reader, and does not imply the existence of these headers, or their 11360 content. 11361 11362 These definitions are intended to supplement those provided in the referenced 11363 underlying specifications. 11364 11365 This specification uses ISO/IEC 9899 C Language as the reference programming 11366 language, and data definitions are specified in ISO C format. The C language is 11367 used here as a convenient notation. Using a C language description of these 11368 data objects does not preclude their use by other programming languages. 11369 11370 ------------------------------------------------------------------------------- 11371 11372 zlib.h 11373 11374 #define Z_NULL 0 11375 #define MAX_WBITS 15 11376 #define MAX_MEM_LEVEL 9 11377 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 11378 #define deflateInit(strm,level) deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 11379 #define inflateInit2(strm,windowBits) inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 11380 #define inflateInit(strm) inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 11381 11382 typedef int intf; 11383 11384 typedef void *voidpf; 11385 typedef unsigned int uInt; 11386 typedef unsigned long uLong; 11387 typedef uLong uLongf; 11388 typedef void *voidp; 11389 typedef unsigned char Byte; 11390 typedef off_t z_off_t; 11391 typedef void *const voidpc; 11392 11393 typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size); 11394 typedef void (*free_func) (voidpf opaque, voidpf address); 11395 struct internal_state 11396 { 11397 int dummy; 11398 } 11399 ; 11400 typedef Byte Bytef; 11401 typedef uInt uIntf; 11402 11403 typedef struct z_stream_s 11404 { 11405 Bytef *next_in; 11406 uInt avail_in; 11407 uLong total_in; 11408 Bytef *next_out; 11409 uInt avail_out; 11410 uLong total_out; 11411 char *msg; 11412 struct internal_state *state; 11413 alloc_func zalloc; 11414 free_func zfree; 11415 voidpf opaque; 11416 int data_type; 11417 uLong adler; 11418 uLong reserved; 11419 } 11420 z_stream; 11421 11422 typedef z_stream *z_streamp; 11423 typedef voidp gzFile; 11424 #define Z_NO_FLUSH 0 11425 #define Z_PARTIAL_FLUSH 1 11426 #define Z_SYNC_FLUSH 2 11427 #define Z_FULL_FLUSH 3 11428 #define Z_FINISH 4 11429 11430 #define Z_ERRNO (-1) 11431 #define Z_STREAM_ERROR (-2) 11432 #define Z_DATA_ERROR (-3) 11433 #define Z_MEM_ERROR (-4) 11434 #define Z_BUF_ERROR (-5) 11435 #define Z_OK 0 11436 #define Z_STREAM_END 1 11437 #define Z_NEED_DICT 2 11438 11439 #define Z_DEFAULT_COMPRESSION (-1) 11440 #define Z_NO_COMPRESSION 0 11441 #define Z_BEST_SPEED 1 11442 #define Z_BEST_COMPRESSION 9 11443 11444 #define Z_DEFAULT_STRATEGY 0 11445 #define Z_FILTERED 1 11446 #define Z_HUFFMAN_ONLY 2 11447 11448 #define Z_BINARY 0 11449 #define Z_ASCII 1 11450 #define Z_UNKNOWN 2 11451 11452 #define Z_DEFLATED 8 11453 11454 ------------------------------------------------------------------------------- 11455 11456 Interfaces for libncurses 11457 11458 Table 8-3 defines the library name and shared object name for the libncurses 11459 library 11460 11461 Table 8-3. libncurses Definition 11462 11463 +-------------------------+ 11464 |Library:|libncurses | 11465 |--------+----------------| 11466 |SONAME: |libncurses.so.5 | 11467 +-------------------------+ 11468 11469 The behavior of the interfaces in this library is specified by the following 11470 specifications: 11471 11472 X/Open Curses 11473 11474 ------------------------------------------------------------------------------- 11475 11476 Curses 11477 11478 ------------------------------------------------------------------------------- 11479 11480 Interfaces for Curses 11481 11482 An LSB conforming implementation shall provide the generic functions for Curses 11483 specified in Table 8-4, with the full functionality as described in the 11484 referenced underlying specification. 11485 11486 Table 8-4. libncurses - Curses Function Interfaces 11487 11488 +-----------------------------------------------------------------------------+ 11489 |addch [1] |has_ic [1] |mvwaddchnstr [1]|scr_init [1] |vwscanw [1] | 11490 |----------------+--------------+----------------+---------------+------------| 11491 |addchnstr [1] |has_il [1] |mvwaddchstr [1] |scr_restore [1]|waddch [1] | 11492 |----------------+--------------+----------------+---------------+------------| 11493 |addchstr [1] |hline [1] |mvwaddnstr [1] |scr_set [1] |waddchnstr | 11494 | | | | |[1] | 11495 |----------------+--------------+----------------+---------------+------------| 11496 |addnstr [1] |idcok [1] |mvwaddstr [1] |scrl [1] |waddchstr | 11497 | | | | |[1] | 11498 |----------------+--------------+----------------+---------------+------------| 11499 |addstr [1] |idlok [1] |mvwchgat [1] |scroll [1] |waddnstr [1]| 11500 |----------------+--------------+----------------+---------------+------------| 11501 |attr_get [1] |immedok [1] |mvwdelch [1] |scrollok [1] |waddstr [1] | 11502 |----------------+--------------+----------------+---------------+------------| 11503 |attr_off [1] |inch [1] |mvwgetch [1] |set_curterm [1]|wattr_get | 11504 | | | | |[1] | 11505 |----------------+--------------+----------------+---------------+------------| 11506 |attr_on [1] |inchnstr [1] |mvwgetnstr [1] |set_term [1] |wattr_off | 11507 | | | | |[1] | 11508 |----------------+--------------+----------------+---------------+------------| 11509 |attr_set [1] |inchstr [1] |mvwgetstr [1] |setscrreg [1] |wattr_on [1]| 11510 |----------------+--------------+----------------+---------------+------------| 11511 |attroff [1] |init_color [1]|mvwhline [1] |setupterm [1] |wattr_set | 11512 | | | | |[1] | 11513 |----------------+--------------+----------------+---------------+------------| 11514 |attron [1] |init_pair [1] |mvwin [1] |slk_attr_set |wattroff [1]| 11515 | | | |[1] | | 11516 |----------------+--------------+----------------+---------------+------------| 11517 |attrset [1] |initscr [1] |mvwinch [1] |slk_attroff [1]|wattron [1] | 11518 |----------------+--------------+----------------+---------------+------------| 11519 |baudrate [1] |innstr [1] |mvwinchnstr [1] |slk_attron [1] |wattrset [1]| 11520 |----------------+--------------+----------------+---------------+------------| 11521 |beep [1] |insch [1] |mvwinchstr [1] |slk_attrset [1]|wbkgd [1] | 11522 |----------------+--------------+----------------+---------------+------------| 11523 |bkgd [1] |insdelln [1] |mvwinnstr [1] |slk_clear [1] |wbkgdset [1]| 11524 |----------------+--------------+----------------+---------------+------------| 11525 |bkgdset [1] |insertln [1] |mvwinsch [1] |slk_color [1] |wborder [1] | 11526 |----------------+--------------+----------------+---------------+------------| 11527 |border [1] |insnstr [1] |mvwinsnstr [1] |slk_init [1] |wchgat [1] | 11528 |----------------+--------------+----------------+---------------+------------| 11529 |box [1] |insstr [1] |mvwinsstr [1] |slk_label [1] |wclear [1] | 11530 |----------------+--------------+----------------+---------------+------------| 11531 |can_change_color|instr [1] |mvwinstr [1] |slk_noutrefresh|wclrtobot | 11532 |[1] | | |[1] |[1] | 11533 |----------------+--------------+----------------+---------------+------------| 11534 |cbreak [1] |intrflush [1] |mvwprintw [1] |slk_refresh [1]|wclrtoeol | 11535 | | | | |[1] | 11536 |----------------+--------------+----------------+---------------+------------| 11537 |chgat [1] |is_linetouched|mvwscanw [1] |slk_restore [1]|wcolor_set | 11538 | |[1] | | |[1] | 11539 |----------------+--------------+----------------+---------------+------------| 11540 |clear [1] |is_wintouched |mvwvline [1] |slk_set [1] |wcursyncup | 11541 | |[1] | | |[1] | 11542 |----------------+--------------+----------------+---------------+------------| 11543 |clearok [1] |isendwin [1] |napms [1] |slk_touch [1] |wdelch [1] | 11544 |----------------+--------------+----------------+---------------+------------| 11545 |clrtobot [1] |keyname [1] |newpad [1] |standend [1] |wdeleteln | 11546 | | | | |[1] | 11547 |----------------+--------------+----------------+---------------+------------| 11548 |clrtoeol [1] |keypad [1] |newterm [1] |standout [1] |wechochar | 11549 | | | | |[1] | 11550 |----------------+--------------+----------------+---------------+------------| 11551 |color_content |killchar [1] |newwin [1] |start_color [1]|werase [1] | 11552 |[1] | | | | | 11553 |----------------+--------------+----------------+---------------+------------| 11554 |color_set [1] |leaveok [1] |nl [1] |subpad [1] |wgetch [1] | 11555 |----------------+--------------+----------------+---------------+------------| 11556 |copywin [1] |longname [1] |nocbreak [1] |subwin [1] |wgetnstr [1]| 11557 |----------------+--------------+----------------+---------------+------------| 11558 |curs_set [1] |meta [1] |nodelay [1] |syncok [1] |wgetstr [1] | 11559 |----------------+--------------+----------------+---------------+------------| 11560 |def_prog_mode |move [1] |noecho [1] |termattrs [1] |whline [1] | 11561 |[1] | | | | | 11562 |----------------+--------------+----------------+---------------+------------| 11563 |def_shell_mode |mvaddch [1] |nonl [1] |termname [1] |winch [1] | 11564 |[1] | | | | | 11565 |----------------+--------------+----------------+---------------+------------| 11566 |del_curterm [1] |mvaddchnstr |noqiflush [1] |tgetent [1] |winchnstr | 11567 | |[1] | | |[1] | 11568 |----------------+--------------+----------------+---------------+------------| 11569 |delay_output [1]|mvaddchstr [1]|noraw [1] |tgetflag [1] |winchstr [1]| 11570 |----------------+--------------+----------------+---------------+------------| 11571 |delch [1] |mvaddnstr [1] |notimeout [1] |tgetnum [1] |winnstr [1] | 11572 |----------------+--------------+----------------+---------------+------------| 11573 |deleteln [1] |mvaddstr [1] |overlay [1] |tgetstr [1] |winsch [1] | 11574 |----------------+--------------+----------------+---------------+------------| 11575 |delscreen [1] |mvchgat [1] |overwrite [1] |tgoto [1] |winsdelln | 11576 | | | | |[1] | 11577 |----------------+--------------+----------------+---------------+------------| 11578 |delwin [1] |mvcur [1] |pair_content [1]|tigetflag [1] |winsertln | 11579 | | | | |[1] | 11580 |----------------+--------------+----------------+---------------+------------| 11581 |derwin [1] |mvdelch [1] |pechochar [1] |tigetnum [1] |winsnstr [1]| 11582 |----------------+--------------+----------------+---------------+------------| 11583 |doupdate [1] |mvderwin [1] |pnoutrefresh [1]|tigetstr [1] |winsstr [1] | 11584 |----------------+--------------+----------------+---------------+------------| 11585 |dupwin [1] |mvgetch [1] |prefresh [1] |timeout [1] |winstr [1] | 11586 |----------------+--------------+----------------+---------------+------------| 11587 |echo [1] |mvgetnstr [1] |printw [1] |touchline [1] |wmove [1] | 11588 |----------------+--------------+----------------+---------------+------------| 11589 |echochar [1] |mvgetstr [1] |putp [1] |touchwin [1] |wnoutrefresh| 11590 | | | | |[1] | 11591 |----------------+--------------+----------------+---------------+------------| 11592 |endwin [1] |mvhline [1] |putwin [1] |tparm [1] |wprintw [1] | 11593 |----------------+--------------+----------------+---------------+------------| 11594 |erase [1] |mvinch [1] |qiflush [1] |tputs [1] |wredrawln | 11595 | | | | |[1] | 11596 |----------------+--------------+----------------+---------------+------------| 11597 |erasechar [1] |mvinchnstr [1]|raw [1] |typeahead [1] |wrefresh [1]| 11598 |----------------+--------------+----------------+---------------+------------| 11599 |filter [1] |mvinchstr [1] |redrawwin [1] |unctrl [1] |wscanw [1] | 11600 |----------------+--------------+----------------+---------------+------------| 11601 |flash [1] |mvinnstr [1] |refresh [1] |ungetch [1] |wscrl [1] | 11602 |----------------+--------------+----------------+---------------+------------| 11603 |flushinp [1] |mvinsch [1] |reset_prog_mode |untouchwin [1] |wsetscrreg | 11604 | | |[1] | |[1] | 11605 |----------------+--------------+----------------+---------------+------------| 11606 |getbkgd [1] |mvinsnstr [1] |reset_shell_mode|use_env [1] |wstandend | 11607 | | |[1] | |[1] | 11608 |----------------+--------------+----------------+---------------+------------| 11609 |getch [1] |mvinsstr [1] |resetty [1] |vidattr [1] |wstandout | 11610 | | | | |[1] | 11611 |----------------+--------------+----------------+---------------+------------| 11612 |getnstr [1] |mvinstr [1] |restartterm [1] |vidputs [1] |wsyncdown | 11613 | | | | |[1] | 11614 |----------------+--------------+----------------+---------------+------------| 11615 |getstr [1] |mvprintw [1] |ripoffline [1] |vline [1] |wsyncup [1] | 11616 |----------------+--------------+----------------+---------------+------------| 11617 |getwin [1] |mvscanw [1] |savetty [1] |vw_printw [1] |wtimeout [1]| 11618 |----------------+--------------+----------------+---------------+------------| 11619 |halfdelay [1] |mvvline [1] |scanw [1] |vw_scanw [1] |wtouchln [1]| 11620 |----------------+--------------+----------------+---------------+------------| 11621 |has_colors [1] |mvwaddch [1] |scr_dump [1] |vwprintw [1] |wvline [1] | 11622 +-----------------------------------------------------------------------------+ 11623 11624 Referenced Specification(s) 11625 11626 [1]. X/Open Curses 11627 11628 An LSB conforming implementation shall provide the generic data interfaces for 11629 Curses specified in Table 8-5, with the full functionality as described in the 11630 referenced underlying specification. 11631 11632 Table 8-5. libncurses - Curses Data Interfaces 11633 11634 +---------------------------------------------------+ 11635 |COLORS [1] |COLS [1] |acs_map [1] |curscr [1]| | 11636 |---------------+---------+------------+----------+-| 11637 |COLOR_PAIRS [1]|LINES [1]|cur_term [1]|stdscr [1]| | 11638 +---------------------------------------------------+ 11639 11640 Referenced Specification(s) 11641 11642 [1]. X/Open Curses 11643 11644 ------------------------------------------------------------------------------- 11645 11646 Data Definitions for libncurses 11647 11648 This section defines global identifiers and their values that are associated 11649 with interfaces contained in libncurses. These definitions are organized into 11650 groups that correspond to system headers. This convention is used as a 11651 convenience for the reader, and does not imply the existence of these headers, 11652 or their content. 11653 11654 These definitions are intended to supplement those provided in the referenced 11655 underlying specifications. 11656 11657 This specification uses ISO/IEC 9899 C Language as the reference programming 11658 language, and data definitions are specified in ISO C format. The C language is 11659 used here as a convenient notation. Using a C language description of these 11660 data objects does not preclude their use by other programming languages. 11661 11662 ------------------------------------------------------------------------------- 11663 11664 curses.h 11665 11666 #define ERR (-1) 11667 #define OK (0) 11668 #define ACS_RARROW (acs_map['+']) 11669 #define ACS_LARROW (acs_map[',']) 11670 #define ACS_UARROW (acs_map['-']) 11671 #define ACS_DARROW (acs_map['.']) 11672 #define ACS_BLOCK (acs_map['0']) 11673 #define ACS_CKBOARD (acs_map['a']) 11674 #define ACS_DEGREE (acs_map['f']) 11675 #define ACS_PLMINUS (acs_map['g']) 11676 #define ACS_BOARD (acs_map['h']) 11677 #define ACS_LANTERN (acs_map['i']) 11678 #define ACS_LRCORNER (acs_map['j']) 11679 #define ACS_URCORNER (acs_map['k']) 11680 #define ACS_ULCORNER (acs_map['l']) 11681 #define ACS_LLCORNER (acs_map['m']) 11682 #define ACS_PLUS (acs_map['n']) 11683 #define ACS_S1 (acs_map['o']) 11684 #define ACS_HLINE (acs_map['q']) 11685 #define ACS_S9 (acs_map['s']) 11686 #define ACS_LTEE (acs_map['t']) 11687 #define ACS_RTEE (acs_map['u']) 11688 #define ACS_BTEE (acs_map['v']) 11689 #define ACS_TTEE (acs_map['w']) 11690 #define ACS_VLINE (acs_map['x']) 11691 #define ACS_DIAMOND (acs_map['`']) 11692 #define ACS_BULLET (acs_map['~']) 11693 #define getmaxyx(win,y,x) (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 11694 #define getbegyx(win,y,x) (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 11695 #define getyx(win,y,x) (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 11696 #define getparyx(win,y,x) (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 11697 11698 #define WA_ALTCHARSET A_ALTCHARSET 11699 #define WA_ATTRIBUTES A_ATTRIBUTES 11700 #define WA_BLINK A_BLINK 11701 #define WA_BOLD A_BOLD 11702 #define WA_DIM A_DIM 11703 #define WA_HORIZONTAL A_HORIZONTAL 11704 #define WA_INVIS A_INVIS 11705 #define WA_LEFT A_LEFT 11706 #define WA_LOW A_LOW 11707 #define WA_NORMAL A_NORMAL 11708 #define WA_PROTECT A_PROTECT 11709 #define WA_REVERSE A_REVERSE 11710 #define WA_RIGHT A_RIGHT 11711 #define WA_STANDOUT A_STANDOUT 11712 #define WA_TOP A_TOP 11713 #define WA_UNDERLINE A_UNDERLINE 11714 #define WA_VERTICAL A_VERTICAL 11715 #define A_REVERSE NCURSES_BITS(1UL,10) 11716 11717 #define COLOR_BLACK 0 11718 #define COLOR_RED 1 11719 #define COLOR_GREEN 2 11720 #define COLOR_YELLOW 3 11721 #define COLOR_BLUE 4 11722 #define COLOR_MAGENTA 5 11723 #define COLOR_CYAN 6 11724 #define COLOR_WHITE 7 11725 11726 #define _SUBWIN 0x01 11727 #define _ENDLINE 0x02 11728 #define _FULLWIN 0x04 11729 #define _ISPAD 0x10 11730 #define _HASMOVED 0x20 11731 11732 typedef unsigned char bool; 11733 11734 typedef unsigned long chtype; 11735 typedef struct screen SCREEN; 11736 typedef struct _win_st WINDOW; 11737 typedef chtype attr_t; 11738 typedef struct 11739 { 11740 attr_t attr; 11741 wchar_t chars[5]; 11742 } 11743 cchar_t; 11744 struct pdat 11745 { 11746 short _pad_y; 11747 short _pad_x; 11748 short _pad_top; 11749 short _pad_left; 11750 short _pad_bottom; 11751 short _pad_right; 11752 } 11753 ; 11754 11755 struct _win_st 11756 { 11757 short _cury; 11758 short _curx; 11759 short _maxy; 11760 short _maxx; 11761 short _begy; 11762 short _begx; 11763 short _flags; 11764 attr_t _attrs; 11765 chtype _bkgd; 11766 bool _notimeout; 11767 bool _clear; 11768 bool _leaveok; 11769 bool _scroll; 11770 bool _idlok; 11771 bool _idcok; 11772 bool _immed; 11773 bool _sync; 11774 bool _use_keypad; 11775 int _delay; 11776 struct ldat *_line; 11777 short _regtop; 11778 short _regbottom; 11779 int _parx; 11780 int _pary; 11781 WINDOW *_parent; 11782 struct pdat _pad; 11783 short _yoffset; 11784 cchar_t _bkgrnd; 11785 } 11786 ; 11787 #define KEY_CODE_YES 0400 11788 #define KEY_BREAK 0401 11789 #define KEY_MIN 0401 11790 #define KEY_DOWN 0402 11791 #define KEY_UP 0403 11792 #define KEY_LEFT 0404 11793 #define KEY_RIGHT 0405 11794 #define KEY_HOME 0406 11795 #define KEY_BACKSPACE 0407 11796 #define KEY_F0 0410 11797 #define KEY_DL 0510 11798 #define KEY_IL 0511 11799 #define KEY_DC 0512 11800 #define KEY_IC 0513 11801 #define KEY_EIC 0514 11802 #define KEY_CLEAR 0515 11803 #define KEY_EOS 0516 11804 #define KEY_EOL 0517 11805 #define KEY_SF 0520 11806 #define KEY_SR 0521 11807 #define KEY_NPAGE 0522 11808 #define KEY_PPAGE 0523 11809 #define KEY_STAB 0524 11810 #define KEY_CTAB 0525 11811 #define KEY_CATAB 0526 11812 #define KEY_ENTER 0527 11813 #define KEY_SRESET 0530 11814 #define KEY_RESET 0531 11815 #define KEY_PRINT 0532 11816 #define KEY_LL 0533 11817 #define KEY_A1 0534 11818 #define KEY_A3 0535 11819 #define KEY_B2 0536 11820 #define KEY_C1 0537 11821 #define KEY_C3 0540 11822 #define KEY_BTAB 0541 11823 #define KEY_BEG 0542 11824 #define KEY_CANCEL 0543 11825 #define KEY_CLOSE 0544 11826 #define KEY_COMMAND 0545 11827 #define KEY_COPY 0546 11828 #define KEY_CREATE 0547 11829 #define KEY_END 0550 11830 #define KEY_EXIT 0551 11831 #define KEY_FIND 0552 11832 #define KEY_HELP 0553 11833 #define KEY_MARK 0554 11834 #define KEY_MESSAGE 0555 11835 #define KEY_MOVE 0556 11836 #define KEY_NEXT 0557 11837 #define KEY_OPEN 0560 11838 #define KEY_OPTIONS 0561 11839 #define KEY_PREVIOUS 0562 11840 #define KEY_REDO 0563 11841 #define KEY_REFERENCE 0564 11842 #define KEY_REFRESH 0565 11843 #define KEY_REPLACE 0566 11844 #define KEY_RESTART 0567 11845 #define KEY_RESUME 0570 11846 #define KEY_SAVE 0571 11847 #define KEY_SBEG 0572 11848 #define KEY_SCANCEL 0573 11849 #define KEY_SCOMMAND 0574 11850 #define KEY_SCOPY 0575 11851 #define KEY_SCREATE 0576 11852 #define KEY_SDC 0577 11853 #define KEY_SDL 0600 11854 #define KEY_SELECT 0601 11855 #define KEY_SEND 0602 11856 #define KEY_SEOL 0603 11857 #define KEY_SEXIT 0604 11858 #define KEY_SFIND 0605 11859 #define KEY_SHELP 0606 11860 #define KEY_SHOME 0607 11861 #define KEY_SIC 0610 11862 #define KEY_SLEFT 0611 11863 #define KEY_SMESSAGE 0612 11864 #define KEY_SMOVE 0613 11865 #define KEY_SNEXT 0614 11866 #define KEY_SOPTIONS 0615 11867 #define KEY_SPREVIOUS 0616 11868 #define KEY_SPRINT 0617 11869 #define KEY_SREDO 0620 11870 #define KEY_SREPLACE 0621 11871 #define KEY_SRIGHT 0622 11872 #define KEY_SRSUME 0623 11873 #define KEY_SSAVE 0624 11874 #define KEY_SSUSPEND 0625 11875 #define KEY_SUNDO 0626 11876 #define KEY_SUSPEND 0627 11877 #define KEY_UNDO 0630 11878 #define KEY_MOUSE 0631 11879 #define KEY_RESIZE 0632 11880 #define KEY_MAX 0777 11881 11882 #define PAIR_NUMBER(a) (((a)& A_COLOR)>>8) 11883 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 11884 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 11885 #define A_NORMAL 0L 11886 #define NCURSES_ATTR_SHIFT 8 11887 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 11888 #define A_BLINK NCURSES_BITS(1UL,11) 11889 #define A_DIM NCURSES_BITS(1UL,12) 11890 #define A_BOLD NCURSES_BITS(1UL,13) 11891 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 11892 #define A_INVIS NCURSES_BITS(1UL,15) 11893 #define A_PROTECT NCURSES_BITS(1UL,16) 11894 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 11895 #define A_LEFT NCURSES_BITS(1UL,18) 11896 #define A_LOW NCURSES_BITS(1UL,19) 11897 #define A_RIGHT NCURSES_BITS(1UL,20) 11898 #define A_TOP NCURSES_BITS(1UL,21) 11899 #define A_VERTICAL NCURSES_BITS(1UL,22) 11900 #define A_STANDOUT NCURSES_BITS(1UL,8) 11901 #define A_UNDERLINE NCURSES_BITS(1UL,9) 11902 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 11903 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 11904 11905 ------------------------------------------------------------------------------- 11906 11907 Interfaces for libutil 11908 11909 Table 8-6 defines the library name and shared object name for the libutil 11910 library 11911 11912 Table 8-6. libutil Definition 11913 11914 +----------------------+ 11915 |Library:|libutil | 11916 |--------+-------------| 11917 |SONAME: |libutil.so.1 | 11918 +----------------------+ 11919 11920 The behavior of the interfaces in this library is specified by the following 11921 specifications: 11922 11923 this specification 11924 11925 ------------------------------------------------------------------------------- 11926 11927 Utility Functions 11928 11929 ------------------------------------------------------------------------------- 11930 11931 Interfaces for Utility Functions 11932 11933 An LSB conforming implementation shall provide the generic functions for 11934 Utility Functions specified in Table 8-7, with the full functionality as 11935 described in the referenced underlying specification. 11936 11937 Table 8-7. libutil - Utility Functions Function Interfaces 11938 11939 +-----------------------------------------+ 11940 |forkpty [1]|login_tty [1]|logwtmp [1]| | | 11941 |-----------+-------------+-----------+-+-| 11942 |login [1] |logout [1] |openpty [1]| | | 11943 +-----------------------------------------+ 11944 11945 Referenced Specification(s) 11946 11947 [1]. this specification 11948 11949 ------------------------------------------------------------------------------- 11950 11951 Interface Definitions for libutil 11952 11953 Table of Contents 11954 forkpty -- Create a new process attached to an available pseudo-terminal 11955 login -- login utility function 11956 login_tty -- Prepare a terminal for login 11957 logout -- logout utility function 11958 logwtmp -- append an entry to the wtmp file 11959 openpty -- find and open an available pseudo-terminal 11960 11961 The following interfaces are included in libutil and are defined by this 11962 specification. Unless otherwise noted, these interfaces shall be included in 11963 the source standard. 11964 11965 Other interfaces listed above for libutil shall behave as described in the 11966 referenced base document. 11967 11968 forkpty 11969 11970 Name 11971 11972 forkpty -- Create a new process attached to an available pseudo-terminal 11973 11974 Synopsis 11975 11976 #include 11977 11978 int forkpty(int * amaster, char * name, struct termios * termp, struct winsize 11979 * winp); 11980 11981 Description 11982 11983 The forkpty() function shall find and open a pseudo-terminal device pair in the 11984 same manner as the openpty() function. If a pseudo-terminal is available, 11985 forkpty shall create a new process in the same manner as the fork() function, 11986 and prepares the new process for login in the same manner as login_tty(). 11987 11988 If termp is not null, it shall refer to a termios structure that shall be used 11989 to initialize the characteristics of the slave device. If winp is not null, it 11990 shall refer to a winsize structure used to initialize the window size of the 11991 slave device. 11992 11993 Return Value 11994 11995 On success, the parent process shall return the process id of the child, and 11996 the child shall return 0. On error, no new process shall be created, -1 shall 11997 be returned, and errno shall be set appropriately. On success, the parent 11998 process shall receive the file descriptor of the master side of the 11999 pseudo-terminal in the location referenced by amaster, and, if name is not 12000 NULL, the filename of the slave device in name. 12001 12002 Errors 12003 12004 EAGAIN 12005 12006 Unable to create a new process. 12007 12008 ENOENT 12009 12010 There are no available pseudo-terminals. 12011 12012 ENOMEM 12013 12014 Insufficient memory was available. 12015 12016 login 12017 12018 Name 12019 12020 login -- login utility function 12021 12022 Synopsis 12023 12024 #include 12025 12026 void login (struct utmp * ut ); 12027 12028 Description 12029 12030 The login function shall update the user accounting databases. The ut parameter 12031 shall reference a utmp structure for all fields except the following: 12032 12033 1. The ut_type field shall be set to USER_PROCESS. 12034 12035 2. The ut_pid field shall be set to the process identifier for the current 12036 process. 12037 12038 3. The ut_line field shall be set to the name of the controlling terminal 12039 device. The name shall be found by examaning the device associated with the 12040 standard input, output and error streams in sequence, until one associated 12041 with a terminal device is found. If none of these streams refers to a 12042 terminal device, the ut_line field shall be set to "???". If the terminal 12043 device is in the /dev directory hierarchy, the ut_line field shall not 12044 contain the leading "/dev/", otherwise it shall be set to the final 12045 component of the pathname of the device. If the user accounting database 12046 imposes a limit on the size of the ut_line field, it shall truncate the 12047 name, but any such limit shall not be smaller than UT_LINESIZE (including a 12048 terminating null character). 12049 12050 Return Value 12051 12052 None 12053 12054 Errors 12055 12056 None 12057 12058 login_tty 12059 12060 Name 12061 12062 login_tty -- Prepare a terminal for login 12063 12064 Synopsis 12065 12066 #include 12067 12068 int login_tty (int fdr); 12069 12070 Description 12071 12072 The login_tty() function shall prepare the terminal device referenced by the 12073 file descriptor fdr. This function shall create a new session, make the 12074 terminal the controlling terminal for the current process, and set the standard 12075 input, output, and error streams of the current process to the terminal. If fdr 12076 is not the standard input, output or error stream, then login_tty() shall close 12077 fdr. 12078 12079 Return Value 12080 12081 On success, login_tty() shall return zero; otherwise -1 is returned, and errno 12082 shall be set appropriately. 12083 12084 Errors 12085 12086 ENOTTY 12087 12088 fdr does not refer to a terminal device. 12089 12090 logout 12091 12092 Name 12093 12094 logout -- logout utility function 12095 12096 Synopsis 12097 12098 #include 12099 12100 int logout (const char * line ); 12101 12102 Description 12103 12104 Given the device line, the logout function shall search the user accounting 12105 database which is read by getutent for an entry with the corresponding line, 12106 and with the type of USER_PROCESS. If a corresponding entry is located, it 12107 shall be updated as follows: 12108 12109 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL bytes). 12110 12111 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL bytes). 12112 12113 3. The ut_tv shall be set to the current time of day. 12114 12115 4. The ut_type field shall be set to DEAD_PROCESS. 12116 12117 Return Value 12118 12119 On success, the logout() function shall return non-zero. Zero is returned if 12120 there was no entry to remove, or if the utmp file could not be opened or 12121 updated. 12122 12123 logwtmp 12124 12125 Name 12126 12127 logwtmp -- append an entry to the wtmp file 12128 12129 Synopsis 12130 12131 #include 12132 12133 void logwtmp (const char * line , const char * name , const char * host ); 12134 12135 Description 12136 12137 If the process has permission to update the user accounting databases, the 12138 logwtmp function shall append a record to the user accounting database that 12139 records all logins and logouts. The record to be appended shall be constructed 12140 as follows: 12141 12142 1. The ut_line field shall be intitialized from line. If the user accounting 12143 database imposes a limit on the size of the ut_line field, it shall 12144 truncate the value, but any such limit shall not be smaller than 12145 UT_LINESIZE (including a terminating null character). 12146 12147 2. The ut_name field shall be intitialized from name. If the user accounting 12148 database imposes a limit on the size of the ut_name field, it shall 12149 truncate the value, but any such limit shall not be smaller than 12150 UT_NAMESIZE (including a terminating null character). 12151 12152 3. The ut_host field shall be intitialized from host. If the user accounting 12153 database imposes a limit on the size of the ut_host field, it shall 12154 truncate the value, but any such limit shall not be smaller than 12155 UT_HOSTSIZE (including a terminating null character). 12156 12157 4. If the name parameter does not refer to an empty string (i.e. ""), the 12158 ut_type field shall be set to USER_PROCESS; otherwise the ut_type 12159 fieldshall be set to DEAD_PROCESS. 12160 12161 5. The ut_id field shall be set to the process identifier for the current 12162 process. 12163 12164 6. The ut_tv field shall be set to the current time of day. 12165 12166 Note: If a process does not have write access to the the user accounting 12167 database, the logwtmp function will not update it. Since the function does 12168 not return any value, an application has no way of knowing whether it 12169 succeeded or failed. 12170 12171 Return Value 12172 12173 None. 12174 12175 openpty 12176 12177 Name 12178 12179 openpty -- find and open an available pseudo-terminal 12180 12181 Synopsis 12182 12183 #include 12184 12185 int openpty(int *amaster, int *aslave, char *name, struct termios *termp, 12186 struct winsize *winp); 12187 12188 Description 12189 12190 The openpty() function shall find an available pseudo-terminal and return file 12191 descriptors for the master and slave devices in the locations referenced by 12192 amaster and aslave respectively. If name is not NULL, the filename of the slave 12193 shall be placed in the user supplied buffer referenced by name. If termp is not 12194 NULL, it shall point to a termios structure used to initialize the terminal 12195 parameters of the slave pseudo-terminal device. If winp is not NULL, it shall 12196 point to a winsize structure used to initialize the window size parameters of 12197 the slave pseudo-terminal device. 12198 12199 Return Value 12200 12201 On success, zero is returned. On error, -1 is returned, and errno is set 12202 appropriately. 12203 12204 Errors 12205 12206 ENOENT 12207 12208 There are no available pseudo-terminals. 12209 12210 IV. Commands and Utilities 12211 12212 Table of Contents 12213 9. Commands and Utilities 12214 12215 ------------------------------------------------------------------------------- 12216 12217 Chapter 9. Commands and Utilities 12218 12219 Commands and Utilities 12220 12221 Table 9-1 lists the Commands and Utilities required to be present on a 12222 conforming system. These commands and utilities shall behave as described in 12223 the relevant underlying specification, with the following exceptions: 12224 12225 1. If any operand (except one which follows --) starts with a hyphen, the 12226 behavior is unspecified. 12227 12228 12229 Rationale (Informative): Applications should place options before 12230 operands, or use --, as needed. This text is needed because GNU option 12231 parsing differs from POSIX. For example, ls . -a in GNU ls means to 12232 list the current directory, showing all files (that is, "." is an 12233 operand and -a is an option). In POSIX, "." and -a are both operands, 12234 and the command means to list the current directory, and also the file 12235 named -a. Suggesting that applications rely on the setting of the 12236 POSIXLY_CORRECT environment variable, or try to set it, seems worse 12237 than just asking the applictions to invoke commands in ways which work 12238 with either the POSIX or GNU behaviors. 12239 12240 The behavior of the interfaces described in this section is specified by the 12241 following standards. 12242 12243 this specification 12244 ISO POSIX (2003) 12245 12246 Table 9-1. Commands and Utilities 12247 12248 +-----------------------------------------------------------------------------+ 12249 |[ [1] |ar [2] |at [2] |awk [2] |basename [1] | 12250 |-----------------+------------+---------------+-------------+----------------| 12251 |batch [2] |bc [2] |cat [1] |chfn [2] |chgrp [2] | 12252 |-----------------+------------+---------------+-------------+----------------| 12253 |chmod [1] |chown [2] |chsh [2] |cksum [1] |cmp [1] | 12254 |-----------------+------------+---------------+-------------+----------------| 12255 |col [2] |comm [1] |cp [1] |cpio [2] |crontab [2] | 12256 |-----------------+------------+---------------+-------------+----------------| 12257 |csplit [1] |cut [2] |date [1] |dd [1] |df [2] | 12258 |-----------------+------------+---------------+-------------+----------------| 12259 |diff [1] |dirname [1] |dmesg [2] |du [2] |echo [2] | 12260 |-----------------+------------+---------------+-------------+----------------| 12261 |egrep [2] |env [1] |expand [1] |expr [1] |false [1] | 12262 |-----------------+------------+---------------+-------------+----------------| 12263 |fgrep [2] |file [2] |find [2] |fold [1] |fuser [2] | 12264 |-----------------+------------+---------------+-------------+----------------| 12265 |gencat [1] |getconf [1] |gettext [2] |grep [2] |groupadd [2] | 12266 |-----------------+------------+---------------+-------------+----------------| 12267 |groupdel [2] |groupmod [2]|groups [2] |gunzip [2] |gzip [2] | 12268 |-----------------+------------+---------------+-------------+----------------| 12269 |head [1] |hostname [2]|iconv [1] |id [1] |install [2] | 12270 |-----------------+------------+---------------+-------------+----------------| 12271 |install_initd [2]|ipcrm [2] |ipcs [2] |join [1] |kill [1] | 12272 |-----------------+------------+---------------+-------------+----------------| 12273 |killall [2] |ln [1] |locale [1] |localedef [1]|logname [1] | 12274 |-----------------+------------+---------------+-------------+----------------| 12275 |lpr [2] |ls [2] |lsb_release [2]|m4 [2] |make [1] | 12276 |-----------------+------------+---------------+-------------+----------------| 12277 |man [1] |md5sum [2] |mkdir [1] |mkfifo [1] |mknod [2] | 12278 |-----------------+------------+---------------+-------------+----------------| 12279 |mktemp [2] |more [2] |mount [2] |msgfmt [2] |mv [1] | 12280 |-----------------+------------+---------------+-------------+----------------| 12281 |newgrp [2] |nice [1] |nl [1] |nohup [1] |od [2] | 12282 |-----------------+------------+---------------+-------------+----------------| 12283 |passwd [2] |paste [1] |patch [2] |pathchk [1] |pidof [2] | 12284 |-----------------+------------+---------------+-------------+----------------| 12285 |pr [1] |printf [1] |ps [1] |pwd [1] |remove_initd [2]| 12286 |-----------------+------------+---------------+-------------+----------------| 12287 |renice [2] |rm [1] |rmdir [1] |sed [2] |sendmail [2] | 12288 |-----------------+------------+---------------+-------------+----------------| 12289 |sh [1] |shutdown [2]|sleep [1] |sort [1] |split [1] | 12290 |-----------------+------------+---------------+-------------+----------------| 12291 |strip [1] |stty [1] |su [2] |sync [2] |tail [1] | 12292 |-----------------+------------+---------------+-------------+----------------| 12293 |tar [2] |tee [1] |test [1] |time [1] |touch [1] | 12294 |-----------------+------------+---------------+-------------+----------------| 12295 |tr [1] |true [1] |tsort [1] |tty [1] |umount [2] | 12296 |-----------------+------------+---------------+-------------+----------------| 12297 |uname [1] |unexpand [1]|uniq [1] |useradd [2] |userdel [2] | 12298 |-----------------+------------+---------------+-------------+----------------| 12299 |usermod [2] |wc [1] |xargs [2] | | | 12300 +-----------------------------------------------------------------------------+ 12301 12302 Referenced Specification(s) 12303 12304 [1]. ISO POSIX (2003) 12305 12306 [2]. this specification 12307 12308 ------------------------------------------------------------------------------- 12309 12310 Command Behavior 12311 12312 Table of Contents 12313 ar -- create and maintain library archives (LSB DEPRECATED) 12314 at -- examine or delete jobs for later execution 12315 awk -- pattern scanning and processing language 12316 batch -- schedule commands to be executed in a batch queue 12317 bc -- An arbitrary precision calculator language 12318 chfn -- change user name and information 12319 chgrp -- change file group 12320 chown -- change file owner and group 12321 chsh -- change login shell 12322 col -- filter reverse line feeds from input 12323 cpio -- copy file archives in and out 12324 crontab -- maintain crontab files for individual users 12325 cut -- split a file into sections determined by context lines 12326 df -- report filesystem disk space usage 12327 dmesg -- print or control the system message buffer 12328 du -- estimate file space usage 12329 echo -- display a line of text 12330 egrep -- search a file with an ERE pattern 12331 fgrep -- search a file with a fixed pattern 12332 file -- determine file type 12333 find -- search for files in a directory hierarchy 12334 fuser -- identify processes using files or sockets 12335 gettext -- retrieve text string from message catalog 12336 grep -- print lines matching a pattern 12337 groupadd -- create a new group 12338 groupdel -- delete a group 12339 groupmod -- modify a group 12340 groups -- display a group 12341 gunzip -- uncompress files 12342 gzip -- compress or expand files 12343 hostname -- show or set the system's host name 12344 install -- copy files and set attributes 12345 install_initd -- install an init.d file 12346 ipcrm -- Remove IPC Resources 12347 ipcs -- provide information on ipc facilities 12348 killall -- kill processes by name 12349 lpr -- off line print 12350 ls -- list directory contents 12351 lsb_release -- print distribution specific information 12352 m4 -- macro processor 12353 md5sum -- generate or check MD5 message digests 12354 mknod -- make special files 12355 mktemp -- make temporary file name (unique) 12356 more -- display files on a page-by-page basis 12357 mount -- mount a file system 12358 msgfmt -- create a message object from a message file 12359 newgrp -- change group ID 12360 od -- dump files in octal and other formats 12361 passwd -- change user password 12362 patch -- apply a diff file to an original 12363 pidof -- find the process ID of a running program 12364 remove_initd -- clean up boot script system modifications introduced by 12365 install_initd 12366 renice -- alter priority of running processes 12367 sed -- stream editor 12368 sendmail -- an electronic mail transport agent 12369 shutdown -- bring the system down 12370 su -- change user ID or become super-user 12371 sync -- flush filesystem buffers 12372 tar -- file archiver 12373 umount -- unmount file systems 12374 useradd -- create a new user or update default new user information 12375 userdel -- delete a user account and related files 12376 usermod -- modify a user account 12377 xargs -- build and execute command lines from standard input 12378 12379 This section contains descriptions for commands and utilities whose specified 12380 behavior in the LSB contradicts or extends the standards referenced. It also 12381 contains commands and utilities only required by the LSB and not specified by 12382 other standards. 12383 12384 ar 12385 12386 Name 12387 12388 ar -- create and maintain library archives (LSB DEPRECATED) 12389 12390 Description 12391 12392 ar is deprecated from the LSB and is expected to disappear from a future 12393 version of the LSB. 12394 12395 12396 Rationale: The LSB generally does not include software development 12397 utilities nor does it specify .o and .a file formats. 12398 12399 ar is as specified in ISO POSIX (2003) but with differences as listed below. 12400 12401 Differences 12402 12403 -T, -C 12404 12405 need not be accepted. 12406 12407 -l 12408 12409 has unspecified behavior. 12410 12411 -q 12412 12413 has unspecified behavior; using -r is suggested. 12414 12415 at 12416 12417 Name 12418 12419 at -- examine or delete jobs for later execution 12420 12421 Description 12422 12423 at is as specified in ISO POSIX (2003) but with differences as listed below. 12424 12425 Differences 12426 12427 -d 12428 12429 is functionally equivalent to the -r option specified in ISO POSIX (2003). 12430 12431 -r 12432 12433 need not be supported, but the '-d' option is equivalent. 12434 12435 -t time 12436 12437 need not be supported. 12438 12439 Files 12440 12441 The files at.allow and at.deny reside in /etc rather than /usr/lib/cron. 12442 12443 awk 12444 12445 Name 12446 12447 awk -- pattern scanning and processing language 12448 12449 Description 12450 12451 awk is as specified in ISO POSIX (2003) but with differences as listed below. 12452 12453 Differences 12454 12455 Certain aspects of internationalized regular expressions are optional; see 12456 Internationalization and Regular Expressions>. 12457 12458 batch 12459 12460 Name 12461 12462 batch -- schedule commands to be executed in a batch queue 12463 12464 Description 12465 12466 The specification for batch is as specified in ISO POSIX (2003), but with the 12467 following differences as listed below. 12468 12469 Files 12470 12471 The files at.allow and at.deny reside in /etc rather than /usr/lib/cron. 12472 12473 bc 12474 12475 Name 12476 12477 bc -- An arbitrary precision calculator language 12478 12479 Description 12480 12481 bc is as specified in ISO POSIX (2003) but with differences as listed below. 12482 12483 Differences 12484 12485 The bc language may be extended in an implementation defined manner. If an 12486 implementation supports extensions, it shall also support the additional 12487 options: 12488 12489 -s|--standard 12490 12491 processes exactly the POSIX bc language. 12492 12493 -w|--warn 12494 12495 gives warnings for extensions to POSIX bc. 12496 12497 chfn 12498 12499 Name 12500 12501 chfn -- change user name and information 12502 12503 Synopsis 12504 12505 chfn [-f full_name] [-h home_phone] [user] 12506 12507 Description 12508 12509 chfn shall update the user database. An unprivileged user may only change the 12510 fields for their own account, a user with appropriate privileges may change the 12511 fields for any account. 12512 12513 The fields full_name and home_phone may contain any character except: 12514 12515 any control character 12516 comma 12517 colon 12518 equal sign 12519 12520 If none of the options are selected, chfn operates in an interactive fashion. 12521 The prompts and expected input in interactive mode are unspecified and should 12522 not be relied upon. 12523 12524 As it is possible for the system to be configured to restrict which fields a 12525 non-privileged user is permitted to change, applications should be written to 12526 gracefully handle these situations. 12527 12528 Standard Options 12529 12530 -f full_name 12531 12532 sets the user's full name. 12533 12534 -h home_phone 12535 12536 sets the user's home phone number. 12537 12538 Future Directions 12539 12540 The following two options are expected to be added in a future version of the 12541 LSB: 12542 12543 -o office 12544 12545 sets the user's office room number. 12546 12547 -p office_phone 12548 12549 sets the user's office phone number. 12550 12551 Note that some implementations contain a "-o other" option which specifies an 12552 additional field called "other". Traditionally, this field is not subject to 12553 the constraints about legitimate characters in fields. Also, one traditionally 12554 shall have appropriate privileges to change the other field. At this point 12555 there is no consensus about whether it is desirable to specify the other field; 12556 applications may wish to avoid using it. 12557 12558 The "-w work_phone" field found in some implementations should be replaced by 12559 the "-p office_phone" field. The "-r room_number" field found in some 12560 implementations is the equivalent of the "-o office" option mentioned above; 12561 which one of these two options to specify will depend on implementation 12562 experience and the decision regarding the other field. 12563 12564 chgrp 12565 12566 Name 12567 12568 chgrp -- change file group 12569 12570 Description 12571 12572 chgrp is as specified in ISO POSIX (2003) but with differences as listed below. 12573 12574 Differences 12575 12576 The -L, -H, and -P options need not be supported. 12577 12578 chown 12579 12580 Name 12581 12582 chown -- change file owner and group 12583 12584 Description 12585 12586 chown is as specified in ISO POSIX (2003) but with differences as listed below. 12587 12588 Differences 12589 12590 The -L, -H, and -P options need not be supported. 12591 12592 chsh 12593 12594 Name 12595 12596 chsh -- change login shell 12597 12598 Synopsis 12599 12600 chsh [-s login_shell] [user] 12601 12602 Description 12603 12604 chsh changes the user login shell. This determines the name of the user's 12605 initial login command. An unprivileged user may only change the login shell for 12606 their own account, a user with appropriate privilege may change the login shell 12607 for any account specified by user. 12608 12609 Unless the user has appropriate privilege, the initial login command name shall 12610 be one of those listed in /etc/shells. The login_shell shall be the absolute 12611 path (i.e. it must start with '/') to an executable file. Accounts which are 12612 restricted (in an implementation-defined manner) may not change their login 12613 shell. 12614 12615 If the -s option is not selected, chsh operates in an interactive mode. The 12616 prompts and expected input in this mode are unspecified. 12617 12618 Standard Options 12619 12620 -s login_shell 12621 12622 sets the login shell. 12623 12624 col 12625 12626 Name 12627 12628 col -- filter reverse line feeds from input 12629 12630 Description 12631 12632 col is as specified in the SUSv2 with the difference that the -p option has 12633 unspecified behavior. 12634 12635 Although col is shown as legacy in SUSv2, Version 2, it is not (yet) deprecated 12636 in the LSB. 12637 12638 cpio 12639 12640 Name 12641 12642 cpio -- copy file archives in and out 12643 12644 Description 12645 12646 cpio is as specified in ISO POSIX (2003), but with differences as listed below. 12647 12648 Differences 12649 12650 Some elements of the Pattern Matching Notation are optional; see 12651 Internationalization and Pattern Matching Notation. 12652 12653 crontab 12654 12655 Name 12656 12657 crontab -- maintain crontab files for individual users 12658 12659 Synopsis 12660 12661 crontab [-u user] file 12662 12663 crontab [-u user] {-l | -r | -e} 12664 12665 Description 12666 12667 crontab is as specified in ISO POSIX (2003), but with differences as listed 12668 below. 12669 12670 Files 12671 12672 The files cron.allow and cron.deny reside in /etc rather than /usr/lib/cron. 12673 12674 cut 12675 12676 Name 12677 12678 cut -- split a file into sections determined by context lines 12679 12680 Description 12681 12682 cut is as specified in ISO POSIX (2003), but with differences as listed below. 12683 12684 Differences 12685 12686 -n 12687 12688 has unspecified behavior. 12689 12690 df 12691 12692 Name 12693 12694 df -- report filesystem disk space usage 12695 12696 Description 12697 12698 df is as specified in ISO POSIX (2003), but with the following differences. 12699 12700 If the -k option is not specified, disk space is shown in unspecified units. 12701 Applications should specify -k. 12702 12703 If an argument is the absolute file name of a disk device node containing a 12704 mounted filesystem, df shows the space available on that filesystem rather than 12705 on the filesystem containing the device node (which is always the root 12706 filesystem). 12707 12708 dmesg 12709 12710 Name 12711 12712 dmesg -- print or control the system message buffer 12713 12714 Synopsis 12715 12716 dmesg [-c | -n level | -s bufsize] 12717 12718 Description 12719 12720 dmesg examines or controls the system message buffer. Only a user with 12721 appropriate privileges may modify the system message buffer parameters or 12722 contents. 12723 12724 Standard Options 12725 12726 -c 12727 12728 If the user has appropriate privilege, clears the system message buffer 12729 contents after printing. 12730 12731 -n level 12732 12733 If the user has appropriate privilege, sets the level at which logging of 12734 messages is done to the console. 12735 12736 -s bufsize 12737 12738 uses a buffer of bufsize to query the system message buffer. This is 16392 12739 by default (this matches the default kernel syslog buffer size since 12740 2.1.113). If you have set the kernel buffer to larger than the default then 12741 this option can be used to view the entire buffer. 12742 12743 du 12744 12745 Name 12746 12747 du -- estimate file space usage 12748 12749 Description 12750 12751 du is as specified in ISO POSIX (2003), but with differences as listed below. 12752 12753 Differences 12754 12755 If the -k option is not specified, disk space is shown in unspecified units. 12756 Applications should specify -k. 12757 12758 echo 12759 12760 Name 12761 12762 echo -- display a line of text 12763 12764 Synopsis 12765 12766 echo [STRING...] 12767 12768 Description 12769 12770 The echo command is as specified in ISO POSIX (2003), but with the following 12771 differences. 12772 12773 Unlike the behavior specified in ISO POSIX (2003), whether echo supports 12774 options is implementation defined. The behavior of echo if any arguments 12775 contain backslashes is also implementation defined. Conforming applications 12776 shall not run echo with a first argument starting with a hyphen, or with any 12777 arguments containing backslashes; they shall use printf in those cases. 12778 12779 12780 Note: The behavior specified here is similar to that specified by ISO POSIX 12781 (2003) without the XSI option. However, the LSB forbids all options and the 12782 latter forbids only -n. 12783 12784 egrep 12785 12786 Name 12787 12788 egrep -- search a file with an ERE pattern 12789 12790 Description 12791 12792 egrep is equivalent to grep -E. For further details, see the specification for 12793 grep. 12794 12795 fgrep 12796 12797 Name 12798 12799 fgrep -- search a file with a fixed pattern 12800 12801 Description 12802 12803 fgrep is equivalent to grep -F. For further details, see the specification for 12804 grep. 12805 12806 file 12807 12808 Name 12809 12810 file -- determine file type 12811 12812 Description 12813 12814 file is as specified in ISO POSIX (2003), but with differences as listed below. 12815 12816 Differences 12817 12818 The -M, -h, -d, and -i options need not be supported. 12819 12820 find 12821 12822 Name 12823 12824 find -- search for files in a directory hierarchy 12825 12826 Description 12827 12828 find is as specified in ISO POSIX (2003), but with additional options as 12829 specified below. 12830 12831 Differences 12832 12833 Some elements of the Pattern Matching Notation are optional; see 12834 Internationalization and Pattern Matching Notation. 12835 12836 fuser 12837 12838 Name 12839 12840 fuser -- identify processes using files or sockets 12841 12842 Description 12843 12844 fuser is as specified in ISO POSIX (2003), but with differences as listed 12845 below. 12846 12847 Differences 12848 12849 -c 12850 12851 has unspecified behavior. 12852 12853 -f 12854 12855 has unspecified behavior. 12856 12857 gettext 12858 12859 Name 12860 12861 gettext -- retrieve text string from message catalog 12862 12863 Synopsis 12864 12865 gettext [options] [textdomain] msgid 12866 12867 gettext -s [options] msgid... 12868 12869 Description 12870 12871 The gettext utility retrieves a translated text string corresponding to string 12872 msgid from a message object generated with msgfmt utility. 12873 12874 The message object name is derived from the optional argument textdomain if 12875 present, otherwise from the TEXTDOMAIN environment variable. If no domain is 12876 specified, or if a corresponding string cannot be found, gettext prints msgid. 12877 12878 Ordinarily gettext looks for its message object in dirname/lang/LC_MESSAGES 12879 where dirname is the implementation-defined default directory and lang is the 12880 locale name. If present, the TEXTDOMAINDIR environment variable replaces the 12881 dirname. 12882 12883 This utility interprets C escape sequences such as \t for tab. Use \\ to print 12884 a backslash. To produce a message on a line of its own, either put a \n at the 12885 end of msgid, or use this command in conjunction with the printf utility. 12886 12887 When used with the -s option the gettext utility behaves like the echo utility, 12888 except that the message corresponding to msgid in the selected catalog provides 12889 the arguments. 12890 12891 Options 12892 12893 -d domainname, --domain=domainname 12894 12895 PARAMETER translated messages from domainname. 12896 12897 -e 12898 12899 Enable expansion of some escape sequences. 12900 12901 -n 12902 12903 Suppress trailing newline. 12904 12905 Operands 12906 12907 The following operands are supported: 12908 12909 textdomain 12910 12911 A domain name used to retrieve the messages. 12912 12913 msgid 12914 12915 A key to retrieve the localized message. 12916 12917 Environment Variables 12918 12919 LANGUAGE 12920 12921 Specifies one or more locale names. 12922 12923 LANG 12924 12925 Specifies locale name. 12926 12927 LC_MESSAGES 12928 12929 Specifies messaging locale, and if present overrides LANG for messages. 12930 12931 TEXTDOMAIN 12932 12933 Specifies the text domain name, which is identical to the message object 12934 filename without .mo suffix. 12935 12936 TEXTDOMAINDIR 12937 12938 Specifies the pathname to the message catalog, and if present replaces the 12939 implementation-defined default directory. 12940 12941 Exit Status 12942 12943 The following exit values are returned: 12944 12945 0 12946 12947 Successful completion. 12948 12949 >0 12950 12951 An error occurred. 12952 12953 grep 12954 12955 Name 12956 12957 grep -- print lines matching a pattern 12958 12959 Description 12960 12961 grep is as specified in ISO POSIX (2003), but with differences as listed below. 12962 12963 LSB Differences 12964 12965 Some elements of the Pattern Matching Notation are optional; see 12966 Internationalization and Pattern Matching Notation. 12967 12968 groupadd 12969 12970 Name 12971 12972 groupadd -- create a new group 12973 12974 Synopsis 12975 12976 groupadd [-g gid [-o]] group 12977 12978 Description 12979 12980 If the caller has appropriate privilege, the groupadd command shall create a 12981 new group named group. The group name shall be unique in the group database. If 12982 no gid is specified, groupadd shall create the new group with a unique group 12983 ID. 12984 12985 Options 12986 12987 -g gid [-o] 12988 12989 The new group shall have group ID gid. If the -o option is not used, no 12990 other group shall have this group ID. The value of gidshall be 12991 non-negative. 12992 12993 groupdel 12994 12995 Name 12996 12997 groupdel -- delete a group 12998 12999 Synopsis 13000 13001 groupdel group 13002 13003 Description 13004 13005 If the caller has sufficient privilege, the groupdel command shall modify the 13006 system group database, deleting the group named group. If the group named group 13007 does not exist, groupdel shall issue a diagnostic message and exit with a 13008 non-zero exit status. 13009 13010 groupmod 13011 13012 Name 13013 13014 groupmod -- modify a group 13015 13016 Synopsis 13017 13018 groupmod [-g gid [-o]] [-n group_name] group 13019 13020 Description 13021 13022 If the caller has appropriate privilege, the groupmod command shall modify the 13023 entry in the system group database corresponding to a group named group. 13024 13025 Options 13026 13027 -g gid [-o] 13028 13029 Modify the group's group ID, setting it to gid. If the -o option is not 13030 used, no other group shall have this group ID. The value of gidshall be 13031 non-negative. 13032 13033 13034 Note: Only the group ID in the database is altered; any files with 13035 group ownership set to the original group ID are unchanged by this 13036 modification. 13037 13038 -n group_name 13039 13040 changes the name of the group from group to group_name. 13041 13042 groups 13043 13044 Name 13045 13046 groups -- display a group 13047 13048 Synopsis 13049 13050 groups [user] 13051 13052 Description 13053 13054 The groups command shall behave as id -Gn [user], as specified in ISO POSIX 13055 (2003). The optional user parameter will display the groups for the named user. 13056 13057 gunzip 13058 13059 Name 13060 13061 gunzip -- uncompress files 13062 13063 Description 13064 13065 gunzip is equivalent to gzip -d. See the specification for gzip for further 13066 details. 13067 13068 gzip 13069 13070 Name 13071 13072 gzip -- compress or expand files 13073 13074 Synopsis 13075 13076 gzip [-acdfhlLnNrtvV19] [-S suffix] [name...] 13077 13078 Description 13079 13080 The gzip command shall attempt to reduce the size of the named files. Whenever 13081 possible, each file is replaced by one with the extension .gz, while keeping 13082 the same ownership modes, access and modification times. If no files are 13083 specified, or if a file name is -, the standard input is compressed to the 13084 standard output. gzip shall only attempt to compress regular files. In 13085 particular, it will ignore symbolic links. 13086 13087 When compressing, gzip uses the deflate algorithm specified in RFC 1951: 13088 DEFLATE Compressed Data Format Specification and stores the result in a file 13089 using the gzip file format specified in RFC 1952: GZIP File Format 13090 Specification. 13091 13092 Options 13093 13094 -a, --ascii 13095 13096 does nothing on LSB conforming systems. 13097 13098 13099 Note: This option may be deprecated in a future verion of this 13100 specification. 13101 13102 -c, --stdout, --to-stdout 13103 13104 writes output on standard output, leaving the original files unchanged. If 13105 there are several input files, the output consists of a sequence of 13106 independently compressed members. To obtain better compression, concatenate 13107 all input files before compressing them. 13108 13109 -d, --decompress, --uncompress 13110 13111 the name operands are compressed files, and gzip shall decompress them. 13112 13113 -f, --force 13114 13115 forces compression or decompression even if the file has multiple links or 13116 the corresponding file already exists, or if the compressed data is read 13117 from or written to a terminal. If the input data is not in a format 13118 recognized by gzip, and if the option --stdout is also given, copy the 13119 input data without change to the standard ouput: let gzip behave as cat. If 13120 -f is not given, and when not running in the background, gzip prompts to 13121 verify whether an existing file should be overwritten. 13122 13123 -l, --list 13124 13125 lists the compressed size, uncompressed size, ration and uncompressed name 13126 for each compressed file. Gives the uncompressed size as -1 for files not 13127 in gzip format. Additionally displays method, crc and timestamp for the 13128 uncompress file when used in combination with --verbose. 13129 13130 For decompression, gzip shall support at least the following compression 13131 methods: 13132 13133 + deflate (RFC 1951: DEFLATE Compressed Data Format Specification) 13134 13135 + compress (ISO POSIX (2003)) 13136 13137 + lzh (SCO compress -H) 13138 13139 + pack (Huffman encoding) 13140 13141 The crc shall be given as ffffffff for a file not in gzip format. 13142 13143 With --name, the uncompressed name, date and time are those stored within 13144 the compress file, if present. 13145 13146 With --verbose, the size totals and compression ratio for all files is also 13147 displayed, unless some sizes are unknown. With --quiet, the title and 13148 totals lines are not displayed. 13149 13150 -L, --license 13151 13152 displays the gzip license and quit. 13153 13154 -n, --no-name 13155 13156 does not save the original file name and time stamp by default when 13157 compressing. (The original name is always saved if the name had to be 13158 truncated.) When decompressing, do not restore the original file name if 13159 present (remove only the gzip suffix from the compressed file name) and do 13160 not restore the original time stamp if present (copy it from the compressed 13161 file). This option is the default when decompressing. 13162 13163 -N, --name 13164 13165 always saves the original file name and time stamp when compressing; this 13166 is the default. When decompressing, restore the original file name and time 13167 stamp if present. This option is useful on systems which have a limit on 13168 file name length or when the time stamp has been lost after a file 13169 transfer. 13170 13171 -q, --quiet 13172 13173 suppresses all warnings. 13174 13175 -r, --recursive 13176 13177 travels the directory structure recursively. If any of the file names 13178 specified on the command line are directories, gzip will descend into the 13179 directory and compress all the files it finds there (or decompress them in 13180 the case of gunzip). 13181 13182 -S .suf, --sufix .suf 13183 13184 uses suffix .suf instead of .gz. 13185 13186 -t, --test 13187 13188 checks the compressed file integrity. 13189 13190 -v, --verbose 13191 13192 displays the name and percentage reduction for each file compressed or 13193 decompressed. 13194 13195 -#, --fast, --best 13196 13197 regulates the speed of compression using the specified digit #, where -1 or 13198 --fast indicates the fastest compression method (less compression) and -9 13199 or --best indicates the slowest compression method (best compression). The 13200 default compression level is -6 (that is, biased towards high compression 13201 at expense of speed). 13202 13203 LSB Deprecated Options 13204 13205 The behaviors specified in this section are expected to disappear from a future 13206 version of the LSB; applications should only use the non-LSB-deprecated 13207 behaviors. 13208 13209 -V, --version 13210 13211 displays the version number and compilation options, then quits. 13212 13213 hostname 13214 13215 Name 13216 13217 hostname -- show or set the system's host name 13218 13219 Synopsis 13220 13221 hostname [name] 13222 13223 Description 13224 13225 hostname is used to either display or, with appropriate privileges, set the 13226 current host name of the system. The host name is used by many applications to 13227 identify the machine. 13228 13229 When called without any arguments, the program displays the name of the system 13230 as returned by the gethostname function. 13231 13232 When called with a name argument, and the user has appropriate privilege, the 13233 command sets the host name. 13234 13235 Note: It is not specified if the hostname displayed will be a fully 13236 qualified domain name. Applications requiring a particular format of 13237 hostname should check the output and take appropriate action. 13238 13239 install 13240 13241 Name 13242 13243 install -- copy files and set attributes 13244 13245 Synopsis 13246 13247 install [option...] SOURCE DEST 13248 13249 install [option...] SOURCE... DEST 13250 13251 install [-d | --directory] [option...] DIRECTORY... 13252 13253 Description 13254 13255 In the first two formats, copy SOURCE to DEST or multiple SOURCE(s) to the 13256 existing DIRECTORY, optionally setting permission modes and file ownership. In 13257 the third format, each DIRECTORY and any missing parent directories shall be 13258 created. 13259 13260 Standard Options 13261 13262 --backup[=METHOD] 13263 13264 makes a backup of each existing destination file. METHOD may be one of the 13265 following: 13266 13267 + none or off never make backups. 13268 13269 + numbered or t make numbered backups. A numbered backup has the form 13270 "%s.~%d~", target_name, version_number. Each backup shall increment the 13271 version number by 1. 13272 13273 + existing or nil numbered if numbered backups exist, or simple 13274 otherwise. 13275 13276 + simple or never append a suffix to the name. The default suffix is '~', 13277 but can be overriden by setting SIMPLE_BACKUP_SUFFIX in the 13278 environment, or via the -S or --suffix option. 13279 13280 If no METHOD is specified, the environment variable VERSION_CONTROL shall 13281 be examined for one of the above. Unambiguous abbreviations of METHOD shall 13282 be accepted. If no METHOD is specified, or if METHOD is empty, the backup 13283 method shall default to existing. 13284 13285 If METHOD is invalid or ambiguous, install shall fail and issue a 13286 diagnostic message. 13287 13288 -b 13289 13290 is equivalent to --backup=existing. 13291 13292 -d, --directory 13293 13294 treats all arguments as directory names; creates all components of the 13295 specified directories. 13296 13297 -D 13298 13299 creates all leading components of DEST except the last, then copies SOURCE 13300 to DEST; useful in the 1st format. 13301 13302 -g GROUP, --group=GROUP 13303 13304 if the user has appropriate privilege, sets group ownership, instead of 13305 process' current group. GROUP is either a name in the user group database, 13306 or a positive integer, which shall be used as a group-id. 13307 13308 -m MODE, --mode=MODE 13309 13310 sets permission mode (specified as in chmod), instead of the default 13311 rwxr-xr-x. 13312 13313 -o OWNER, --owner=OWNER 13314 13315 if the user has appropriate privilege, sets ownership. OWNER is either a 13316 name in the user login database, or a positive integer, which shall be used 13317 as a user-id. 13318 13319 -p, --preserve-timestamps 13320 13321 copies the access and modification times of SOURCE files to corresponding 13322 destination files. 13323 13324 -s, --strip 13325 13326 strips symbol tables, only for 1st and 2nd formats. 13327 13328 -S SUFFIX, --suffix=SUFFIX 13329 13330 equivalent to --backup=existing, except if a simple suffix is required, use 13331 SUFFIX. 13332 13333 --verbose 13334 13335 prints the name of each directory as it is created. 13336 13337 -v, --verbose 13338 13339 print the name of each file before copying it to stdout. 13340 13341 install_initd 13342 13343 Name 13344 13345 install_initd -- install an init.d file 13346 13347 Synopsis 13348 13349 /usr/lib/lsb/install_initd initd_file 13350 13351 Description 13352 13353 install_initd shall install a system initialization file that has been copied 13354 to the /etc/init.d location such that this file shall be run at the appropriate 13355 point during system initialization. The install_initrd command is typically 13356 called in the postinstall script of a package. See also the Section called 13357 Installation and Removal of init.d Files in Chapter 14. 13358 13359 ipcrm 13360 13361 Name 13362 13363 ipcrm -- Remove IPC Resources 13364 13365 Synopsis 13366 13367 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | -M shmkey]... 13368 13369 ipcrm [shm | msg | msg] id... 13370 13371 Description 13372 13373 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, the ipcrm shall 13374 behave as described in ISO POSIX (2003). 13375 13376 Otherwise, ipcrm shall remove the resource of the specified type identified by 13377 id. 13378 13379 Future Directions 13380 13381 A future revision of this specification may deprecate the second synopsis form. 13382 13383 13384 Rationale: In its first Linux implementation, ipcrm used the second syntax 13385 shown in the SYNOPSIS. Functionality present in other implementations of 13386 ipcrm has since been added, namely the ability to delete resources by key 13387 (not just identifier), and to respect the same command line syntax. The 13388 previous syntax is still supported for backwards compatibility only. 13389 13390 ipcs 13391 13392 Name 13393 13394 ipcs -- provide information on ipc facilities 13395 13396 Synopsis 13397 13398 ipcs [-smq] [-tcp] 13399 13400 Description 13401 13402 ipcs provides information on the ipc facilities for which the calling process 13403 has read access. 13404 13405 Resource display options 13406 13407 -m 13408 13409 shared memory segments. 13410 13411 -q 13412 13413 message queues. 13414 13415 -s 13416 13417 semaphore arrays. 13418 13419 Output format options 13420 13421 -t 13422 13423 time. 13424 13425 -p 13426 13427 pid. 13428 13429 -c 13430 13431 creator. 13432 13433 Application Usage 13434 13435 In some implementations of ipcs the -a option will print all information 13436 available. In other implementations the -a option will print all resource 13437 types. Therefore, applications shall not use the -a option. 13438 13439 Some implements of ipcs implement more output formats than are specified here. 13440 These options are not consistent between differing implementations of ipcs. 13441 Therefore, only the -t -c and -p option flags may be used. At least one of the 13442 -t -c and -p options shall be specified. 13443 13444 killall 13445 13446 Name 13447 13448 killall -- kill processes by name 13449 13450 Synopsis 13451 13452 killall [-egiqvw] [-signal] name... 13453 13454 killall -l 13455 13456 killall -V 13457 13458 Description 13459 13460 killall sends a signal to all processes running any of the specified commands. 13461 If no signal name is specified, SIGTERM is sent. 13462 13463 Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1). 13464 Signal 0 (check if a process exists) can only be specified by number. 13465 13466 If the command name contains a slash (/), processes executing that particular 13467 file will be selected for killing, independent of their name. 13468 13469 killall returns a non-zero return code if no process has been killed for any of 13470 the listed commands. If at least one process has been killed for each command, 13471 killall returns zero. 13472 13473 A killall process never kills itself (but may kill other killall processes). 13474 13475 Standard Options 13476 13477 -e 13478 13479 requires an exact match for very long names. If a command name is longer 13480 than 15 characters, the full name may be unavailable (i.e. it is swapped 13481 out). In this case, killall will kill everything that matches within the 13482 first 15 characters. With -e, such entries are skipped. killall prints a 13483 message for each skipped entry if -v is specified in addition to -e. 13484 13485 -g 13486 13487 kills the process group to which the process belongs. The kill signal is 13488 only sent once per group, even if multiple processes belonging to the same 13489 process group were found. 13490 13491 -i 13492 13493 asks interactively for confirmation before killing. 13494 13495 -l 13496 13497 lists all known signal names. 13498 13499 -q 13500 13501 does not complain if no processes were killed. 13502 13503 -v 13504 13505 reports if the signal was successfully sent. 13506 13507 LSB Deprecated Options 13508 13509 The behaviors specified in this section are expected to disappear from a future 13510 version of the LSB; applications should only use the non-LSB-deprecated 13511 behaviors. 13512 13513 -V 13514 13515 displays version information. 13516 13517 lpr 13518 13519 Name 13520 13521 lpr -- off line print 13522 13523 Synopsis 13524 13525 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T title] [name 13526 ......] 13527 13528 Description 13529 13530 lpr uses a spooling daemon to print the named files when facilities become 13531 available. If no names appear, the standard input is assumed. 13532 13533 Standard Options 13534 13535 -l 13536 13537 identifies binary data that is not to be filtered but sent as raw input to 13538 printer. 13539 13540 -p 13541 13542 formats with "pr" before sending to printer. 13543 13544 -Pprinter 13545 13546 sends output to the printer named printer instead of the default printer. 13547 13548 -h 13549 13550 suppresses header page. 13551 13552 -s 13553 13554 uses symbolic links. 13555 13556 -#copies 13557 13558 specifies copies as the number of copies to print. 13559 13560 -J name 13561 13562 specifies name as the job name for the header page. 13563 13564 -T title 13565 13566 specifies title as the title used for "pr". 13567 13568 ls 13569 13570 Name 13571 13572 ls -- list directory contents 13573 13574 Description 13575 13576 ls is as specified in ISO POSIX (2003), but with differences listed below. 13577 13578 Differences 13579 13580 -l 13581 13582 If the file is a character special or block special file, the size of the 13583 file shall be replaced with two unsigned numbers in the format "%u, %u", 13584 representing the major and minor device numbers associated with the special 13585 file. 13586 13587 13588 Note: The LSB does not specify the meaning of the major and minor 13589 devices numbers. 13590 13591 -p 13592 13593 in addition to ISO POSIX (2003) behavior of printing a slash for a 13594 directory, ls -p may display other characters for other file types. 13595 13596 Certain aspects of the pattern matching notation are optional; see 13597 Internationalization and Pattern Matching Notation. 13598 13599 lsb_release 13600 13601 Name 13602 13603 lsb_release -- print distribution specific information 13604 13605 Synopsis 13606 13607 lsb_release [OPTION...] 13608 13609 Description 13610 13611 The lsb_release command prints certain LSB (Linux Standard Base) and 13612 Distribution information. 13613 13614 If no options are given, the -v option is assumed. 13615 13616 Options 13617 13618 -v, --version 13619 13620 displays version of LSB against which distribution is compliant. The 13621 version is expressed as a colon seperated list of LSB module descriptions. 13622 LSB module descriptions are dash seperated tuples containing the module 13623 name, version, and architecture name. The output is a single line of text 13624 of the following format: 13625 13626 LSB Version:\t 13627 13628 -i, --id 13629 13630 displays string id of distributor. The output is a single line of text of 13631 the following format: 13632 13633 Distributor ID:\t 13634 13635 -d, --description 13636 13637 displays single line text description of distribution. The output is of the 13638 following format: 13639 13640 Description:\t 13641 13642 -r, --release 13643 13644 displays release number of distribution. The output is a single line of 13645 text of the following format: 13646 13647 Release:\t 13648 13649 -c, --codename 13650 13651 displays codename according to distribution release. The output is a single 13652 line of text of the following format. 13653 13654 Codename:\t 13655 13656 -a, --all 13657 13658 displays all of the above information. 13659 13660 -s, --short 13661 13662 displays all of the above information in short output format. 13663 13664 -h, --help 13665 13666 displays a human-readable help message. 13667 13668 Examples 13669 13670 The following command will list the LSB Profiles which are currently supported 13671 on this platform. 13672 13673 example% lsb_release -v 13674 LSB Version: core-2.0-ia32:core-2.0-noarch:graphics-2.0-ia32:graphics-2.0-noarch 13675 13676 m4 13677 13678 Name 13679 13680 m4 -- macro processor 13681 13682 Description 13683 13684 m4 is as specified in ISO POSIX (2003), but with extensions as listed below. 13685 13686 Extensions 13687 13688 -P 13689 13690 forces all builtins to be prefixed with m4_. For example, define becomes 13691 m4_define. 13692 13693 -I directory 13694 13695 Add directory to the end of the search path for includes. 13696 13697 md5sum 13698 13699 Name 13700 13701 md5sum -- generate or check MD5 message digests 13702 13703 Synopsis 13704 13705 md5sum [-c [file] | file] 13706 13707 Description 13708 13709 For each file, write to standard output a line containing the MD5 message 13710 digest of that file, followed by one or more blank characters, followed by the 13711 name of the file. The MD5 message digest shall be calculated according to RFC 13712 1321: The MD5 Message-Digest Algorithm and output as 32 hexadecimal digits. 13713 13714 If no file names are specified as operands, read from standard input and use 13715 "-" as the file name in the output. 13716 13717 Options 13718 13719 -c [file] 13720 13721 checks the MD5 message digest of all files named in file against the 13722 message digest listed in the same file. The actual format of file is the 13723 same as the output of md5sum. That is, each line in the file describes a 13724 file. If file is not specified, read message digests from stdin. 13725 13726 Exit Status 13727 13728 md5sum shall exit with status 0 if the sum was generated successfully, or, in 13729 check mode, if the check matched. Otherwise, md5sum shall exit with a non-zero 13730 status. 13731 13732 mknod 13733 13734 Name 13735 13736 mknod -- make special files 13737 13738 Synopsis 13739 13740 mknod [-m mode | --mode=mode] name type [major minor] 13741 13742 mknod [--version] 13743 13744 Description 13745 13746 The mknod command shall create a special file named name of the given type. 13747 13748 The type shall be one of the following: 13749 13750 b 13751 13752 creates a block (buffered) special file with the specified major and minor 13753 device numbers. 13754 13755 c, u 13756 13757 creates a character (unbuffered) special file with the specified major and 13758 minor device numbers. 13759 13760 p 13761 13762 creates a FIFO. 13763 13764 Options 13765 13766 -m mode, --mode=mode 13767 13768 create the special file with file access permissions set as described in 13769 mode. The permissions may be any absolute value (i.e. one not containing 13770 '+' or '-') acceptable to the chmod command. 13771 13772 --version 13773 13774 output version information and exit. 13775 13776 13777 Note: This option may be deprecated in a future release of this 13778 specification. 13779 13780 If type is pparameter, major and minor shall not be specified. Otherwise, these 13781 parameters are mandatory. 13782 13783 Future Directions 13784 13785 This command may be deprecated in a future version of this specification. The 13786 major and minor operands are insufficently portable to be specified usefully 13787 here. Only a FIFO can be portably created by this command, and the mkfifo 13788 command is a simpler interface for that purpose. 13789 13790 mktemp 13791 13792 Name 13793 13794 mktemp -- make temporary file name (unique) 13795 13796 Synopsis 13797 13798 mktemp [-q] [-u] template 13799 13800 Description 13801 13802 The mktemp command takes the given file name template and overwrites a portion 13803 of it to create a file name. This file name shall be unique and suitable for 13804 use by the application. 13805 13806 The template should have at least six trailing 'X' characters. These characters 13807 are replaced with characters from the portable filename character set in order 13808 to generate a unique name. 13809 13810 If mktemp can successfully generate a unique file name, and the -u option is 13811 not present, the file shall be created with read and write permission only for 13812 the current user. The mktemp command shall write the filename generated to the 13813 standard output. 13814 13815 Options 13816 13817 -q 13818 13819 fail silently if an error occurs. Diagnostic messages to stderr are 13820 suppressed, but the command shall still exit with a non-zero exit status if 13821 an error occurs. 13822 13823 -u 13824 13825 operates in `unsafe' mode. A unique name is generated, but the temporary 13826 file shall be unlinked before mktemp exits. Use of this option is not 13827 encouraged. 13828 13829 more 13830 13831 Name 13832 13833 more -- display files on a page-by-page basis 13834 13835 Description 13836 13837 more is as specified in ISO POSIX (2003), but with differences as listed below. 13838 13839 Differences 13840 13841 The more command need not respect the LINES and COLUMNS environment variables. 13842 13843 The following additional options may be supported: 13844 13845 -num 13846 13847 specifies an integer which is the screen size (in lines). 13848 13849 +num 13850 13851 starts at line number num. 13852 13853 +/pattern 13854 13855 Start at the first line matching the pattern, equivalent to executing the 13856 search forward (/) command with the given pattern immediately after opening 13857 each file. 13858 13859 The following options from ISO POSIX (2003) may behave differently: 13860 13861 -e 13862 13863 has unspecified behavior. 13864 13865 -i 13866 13867 has unspecified behavior. 13868 13869 -n 13870 13871 has unspecified behavior. 13872 13873 -p 13874 13875 Either clear the whole screen before displaying any text (instead of the 13876 usual scrolling behavior), or provide the behavior specified by ISO POSIX 13877 (2003). In the latter case, the syntax is "-p command". 13878 13879 -t 13880 13881 has unspecified behavior. 13882 13883 The more command need not support the following interactive commands: 13884 13885 g 13886 G 13887 u 13888 control u 13889 control f 13890 newline 13891 j 13892 k 13893 r 13894 R 13895 m 13896 ' (return to mark) 13897 /! 13898 ? 13899 N 13900 :e 13901 :t 13902 control g 13903 ZZ 13904 13905 Rationale 13906 13907 The +num and +/string options are deprecated in SUSv2, and have been removed in 13908 ISO POSIX (2003); however this specification continues to specify them because 13909 the publicly available util-linux package does not support the replacement (-p 13910 command). The +command option as found in SUSv2 is more general than is 13911 specified here, but the util-linux package appears to only support the more 13912 specific +num and +/string forms. 13913 13914 mount 13915 13916 Name 13917 13918 mount -- mount a file system 13919 13920 Synopsis 13921 13922 mount [-hV] 13923 13924 mount [-a] [-fFnrsvw] [-t vfstype] 13925 13926 mount [-fnrsvw] [-o options [,...]] [device | dir] 13927 13928 mount [-fnrsvw] [-t vfstype] [-o options] device dir 13929 13930 Description 13931 13932 As described in ISO POSIX (2003), all files in the system are organized in a 13933 directed graph, known as the file hierarchy, rooted at /. These files can be 13934 spread out over several underlying devices. The mount command shall attach the 13935 file system found on some underlying device to the file hierarchy. 13936 13937 Options 13938 13939 -v 13940 13941 invoke verbose mode. The mount command shall provide diagnostic messages on 13942 stdout. 13943 13944 -a 13945 13946 mount all filesystems (of the given types) mentioned in /etc/fstab. 13947 13948 -F 13949 13950 If the -a option is also present, fork a new incarnation of mount for each 13951 device to be mounted. This will do the mounts on different devices or 13952 different NFS servers in parallel. 13953 13954 -f 13955 13956 cause everything to be done except for the actual system call; if it's not 13957 obvious, this `fakes' mounting the file system. 13958 13959 -n 13960 13961 mount without writing in /etc/mtab. This is necessary for example when /etc 13962 is on a read-only file system. 13963 13964 -s 13965 13966 ignore mount options not supported by a filesystem type. Not all 13967 filesystems support this option. 13968 13969 -r 13970 13971 mount the file system read-only. A synonym is -o ro. 13972 13973 -w 13974 13975 mount the file system read/write. (default) A synonym is -o rw. 13976 13977 -L label 13978 13979 If the file /proc/partitions is supported, mount the partition that has the 13980 specified label. 13981 13982 -U uuid 13983 13984 If the file /proc/partitions is supported, mount the partition that has the 13985 specified uuid. 13986 13987 -t vfstype 13988 13989 indicate a file system type of vfstype. 13990 13991 More than one type may be specified in a comma separated list. The list of 13992 file system types can be prefixed with no to specify the file system types 13993 on which no action should be taken. 13994 13995 -o 13996 13997 options are specified with a -o flag followed by a comma-separated string 13998 of options. Some of these options are only useful when they appear in the / 13999 etc/fstab file. The following options apply to any file system that is 14000 being mounted: 14001 14002 async 14003 14004 perform all I/O to the file system asynchronously. 14005 14006 atime 14007 14008 update inode access time for each access. (default) 14009 14010 auto 14011 14012 in /etc/fstab, indicate the device is mountable with -a. 14013 14014 defaults 14015 14016 use default options: rw, suid, dev, exec, auto, nouser, async. 14017 14018 dev 14019 14020 interpret character or block special devices on the file system. 14021 14022 exec 14023 14024 permit execution of binaries. 14025 14026 noatime 14027 14028 do not update file access times on this file system. 14029 14030 noauto 14031 14032 in /etc/fstab, indicates the device is only explicitly mountable. 14033 14034 nodev 14035 14036 do not interpret character or block special devices on the file system. 14037 14038 noexec 14039 14040 do not allow execution of any binaries on the mounted file system. 14041 14042 nosuid 14043 14044 do not allow set-user-identifier or set-group-identifier bits to take 14045 effect. 14046 14047 nouser 14048 14049 forbid an unprivileged user to mount the file system. (default) 14050 14051 remount 14052 14053 remount an already-mounted file system. This is commonly used to change 14054 the mount options for a file system, especially to make a read-only 14055 file system writable. 14056 14057 ro 14058 14059 mount the file system read-only. 14060 14061 rw 14062 14063 mount the file system read-write. 14064 14065 suid 14066 14067 allow set-user-identifier or set-group-identifier bits to take effect. 14068 14069 sync 14070 14071 do all I/O to the file system synchronously. 14072 14073 user 14074 14075 allow an unprivilieged user to mount the file system. This option 14076 implies the options noexec, nosuid, nodev unless overridden by 14077 subsequent options. 14078 14079 LSB Deprecated Options 14080 14081 The behaviors specified in this section are expected to disappear from a future 14082 version of the LSB; applications should only use the non-LSB-deprecated 14083 behaviors. 14084 14085 -V 14086 14087 output version and exit. 14088 14089 msgfmt 14090 14091 Name 14092 14093 msgfmt -- create a message object from a message file 14094 14095 Synopsis 14096 14097 msgfmt [options...] filename... 14098 14099 Description 14100 14101 The msgfmt command generates a binary message catalog from a textual 14102 translation description. Message catalogs, or message object files, are stored 14103 in files with a .mo extension. 14104 14105 14106 Note: The format of message object files is not guaranteed to be portable. 14107 Message catalogs should always be generated on the target architecture 14108 using the msgfmt command. 14109 14110 The source message files, otherwise known as portable object files, have a .po 14111 extension. 14112 14113 The filename operands shall be portable object files. The .po file contains 14114 messages to be displayed to users by system utilities or by application 14115 programs. The portable object files are text files, and the messages in them 14116 can be rewritten in any language supported by the system. 14117 14118 If any filename is -, a portable object file shall be read from the standard 14119 input. 14120 14121 The msgfmt command interprets data as characters according to the current 14122 setting of the LC_CTYPE locale category. 14123 14124 Options 14125 14126 -c, --check 14127 14128 Detect and diagnose input file anomalies which might represent translation 14129 errors. The msgid and msgstr strings are studied and compared. It is 14130 considered abnormal that one string starts or ends with a newline while the 14131 other does not. 14132 14133 If the message is flagged as c-format (see Comment Handling), check that 14134 the msgid string and the msgstr translation have the same number of % 14135 format specifiers, with matching types. 14136 14137 -D directory, --directory=directory 14138 14139 Add directory to list for input files search. If filename is not an 14140 absolute pathname and filename cannot be opened, search for it in 14141 directory. This option may be repeated. Directories shall be searched in 14142 order, with the leftmost directory searched first. 14143 14144 -f, --use-fuzzy 14145 14146 Use entries marked as fuzzy in output. If this option is not specified, 14147 such entries are not included into the output. See Comment Handling below. 14148 14149 -o output-file, --output-file=output-file 14150 14151 Specify the output file name as output-file. If multiple domains or 14152 duplicate msgids in the .po file are present, the behavior is unspecified. 14153 If output-file is -, output is written to standard output. 14154 14155 -S, --strict 14156 14157 Ensure that all output files have a .mo extension. Output files are named 14158 either by the -o (or --output-file) option, or by domains found in the 14159 input files. 14160 14161 -v, --verbose 14162 14163 Print additional information to the standard error, including the number of 14164 translated strings processed. 14165 14166 Operands 14167 14168 The filename operands are treated as portable object files. The format of 14169 portable object files is defined in EXTENDED DESCRIPTION. 14170 14171 Standard Input 14172 14173 The standard input is not used unless a filename operand is specified as "-". 14174 14175 Environment Variables 14176 14177 LANGUAGE 14178 14179 Specifies one or more locale names. 14180 14181 LANG 14182 14183 Specifies locale name. 14184 14185 LC_ALL 14186 14187 Specifies locale name for all categories. If defined, overrides LANG, 14188 LC_CTYPE and LC_MESSAGES. 14189 14190 LC_CTYPE 14191 14192 Determine the locale for the interpretation of sequences of bytes of text 14193 data as characters (for example, single-byte as opposed to multi-byte 14194 characters in arguments and input files). 14195 14196 LC_MESSAGES 14197 14198 Specifies messaging locale, and if present overrides LANG for messages. 14199 14200 Standard Output 14201 14202 The standard output is not used unless the option-argument of the -o option is 14203 specified as -. 14204 14205 Extended Description 14206 14207 The format of portable object files (.po files) is defined as follows. Each .po 14208 file contains one or more lines, with each line containing either a comment or 14209 a statement. Comments start the line with a hash mark (#) and end with the 14210 newline character. Empty lines, or lines containing only white-space, shall be 14211 ignored. Comments can in certain circumstances alter the behavior of msgfmt. 14212 See Comment Handling below for details on comment processing. The format of a 14213 statement is: 14214 14215 directive value 14216 14217 Each directive starts at the beginning of the line and is separated from value 14218 by white space (such as one or more space or tab characters). The value 14219 consists of one or more quoted strings separated by white space. If two or more 14220 strings are specified as value, they are normalized into single string using 14221 the string normalization syntax specified in ISO C (1999). The following 14222 directives are supported: 14223 14224 domain domainname 14225 14226 msgid message_identifier 14227 14228 msgid_plural untranslated_string_plural 14229 14230 msgstr message_string 14231 14232 msgstr[n] message_string 14233 14234 The behavior of the domain directive is affected by the options used. See 14235 OPTIONS for the behavior when the -o option is specified. If the -o option is 14236 not specified, the behavior of the domain directive is as follows: 14237 14238 1. All msgids from the beginning of each .po file to the first domain 14239 directive are put into a default message object file, messages (or 14240 messages.mo if the --strict option is specified). 14241 14242 2. When msgfmt encounters a domain domainname directive in the .po file, all 14243 following msgids until the next domain directive are put into the message 14244 object file domainname (or domainname.mo if --strict option is specified). 14245 14246 3. Duplicate msgids are defined in the scope of each domain. That is, a msgid 14247 is considered a duplicate only if the identical msgid exists in the same 14248 domain. 14249 14250 4. All duplicate msgids are ignored. 14251 14252 14253 14254 The msgid directive specifies the value of a message identifier associated with 14255 the directive that follows it. The msgid_plural directive specifies the plural 14256 form message specified to the plural message handling functions ngettext, 14257 dngettext or dcngettext. The message_identifier string identifies a target 14258 string to be used at retrieval time. Each statement containing a msgid 14259 directive shall be followed by a statement containing a msgstr directive or 14260 msgstr[n] directives. 14261 14262 The msgstr directive specifies the target string associated with the 14263 message_identifier string declared in the immediately preceding msgid 14264 directive. 14265 14266 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the target string to 14267 be used with plural form handling functions ngettext, dngettext and dcngettext. 14268 14269 Message strings can contain the following escape sequences: 14270 14271 Table 9-1. Escape Sequences 14272 14273 +-----------------------------+ 14274 |\n |newline | 14275 |----+------------------------| 14276 |\t |tab | 14277 |----+------------------------| 14278 |\v |vertical tab | 14279 |----+------------------------| 14280 |\b |backspace | 14281 |----+------------------------| 14282 |\r |carriage return | 14283 |----+------------------------| 14284 |\f |formfeed | 14285 |----+------------------------| 14286 |\\ |backslash | 14287 |----+------------------------| 14288 |\" |double quote | 14289 |----+------------------------| 14290 |\ddd|octal bit pattern | 14291 |----+------------------------| 14292 |\xHH|hexadecimal bit pattern | 14293 +-----------------------------+ 14294 14295 Comment Handling 14296 14297 Comments are introduced by a #, and continue to the end of the line. The second 14298 character (i.e. the character following the #) has special meaning. Regular 14299 comments should follow a space character. Other comment types include: 14300 14301 # normal-comments 14302 14303 #. automatic-comments 14304 14305 #: reference... 14306 14307 #, flag 14308 14309 Automatic and reference comments are typically generated by external utilities, 14310 and are not specified by the LSB. The msgfmt command shall ignore such 14311 comments. 14312 14313 14314 Note: Portable object files may be produced by unspecified tools. Some of 14315 the comment types described here may arise from the use of such tools. It 14316 is beyond the scope of this specification to describe these tools. 14317 14318 The #, comments require one or more flags separated by the comma (,) character. 14319 The following flags can be specified: 14320 14321 fuzzy 14322 14323 This flag shows that the following msgstr string might not be a correct 14324 translation. Only the translator (i.e. the individual undertaking the 14325 translation) can judge if the translation requires further modification, or 14326 is acceptable as is. Once satisfied with the translation, the translator 14327 then removes this fuzzy flag. 14328 14329 If this flag is specified, the msgfmt utility will not generate the entry 14330 for the immediately following msgid in the output message catalog, unless 14331 the --use-fuzzy is specified. 14332 14333 c-format, no-c-format 14334 14335 The c-format flag indicates that the msgid string is used as format string 14336 by printf-like functions. If the c-format flag is given for a string the 14337 msgfmt utility may perform additional tests to check to validity of the 14338 translation. 14339 14340 Plurals 14341 14342 The msgid entry with empty string ("") is called the header entry and is 14343 treated specially. If the message string for the header entry contains nplurals 14344 =value, the value indicates the number of plural forms. For example, if 14345 nplurals=4, there are 4 plural forms. If nplurals is defined, there should be a 14346 plural=expression on the same line, separated by a semicolon (;) character. The 14347 expression is a C language expression to determine which version of msgstr[n] 14348 to be used based on the value of n, the last argument of ngettext, dngettext or 14349 dcngettext. For example: 14350 14351 nplurals=2; plural=n == 1 ? 0 : 1 14352 14353 indicates that there are 2 plural forms in the language; msgstr[0] is used if n 14354 == 1, otherwise msgstr[1] is used. Another example: 14355 14356 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 14357 14358 indicates that there are 3 plural forms in the language; msgstr[0] is used if n 14359 == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is used. 14360 14361 If the header entry contains charset=codeset string, the codeset is used to 14362 indicate the codeset to be used to encode the message strings. If the output 14363 string's codeset is different from the message string's codeset, codeset 14364 conversion from the message strings's codeset to the output string's codeset 14365 will be performed upon the call of gettext, dgettext, dcgettext, ngettext, 14366 dngettext, and dcngettext. The output string's codeset is determined by the 14367 current locale's codeset (the return value of nl_langinfo(CODESET)) by default, 14368 and can be changed by the call of bind_textdomain_codeset. 14369 14370 Exit Status 14371 14372 The following exit values are returned: 14373 14374 0 14375 14376 Successful completion. 14377 14378 >0 14379 14380 An error occurred. 14381 14382 Application Usage 14383 14384 Neither msgfmt nor any gettext function imposes a limit on the total length of 14385 a message. Installing message catalogs under the C locale is pointless, since 14386 they are ignored for the sake of efficiency. 14387 14388 Examples 14389 14390 Example 1: Examples of creating message objects from message files. 14391 14392 In this example module1.po, module2.po and module3.po are portable message 14393 object files. 14394 14395 example% cat module1.po 14396 14397 # default domain "messages" 14398 14399 msgid "message one" 14400 14401 msgstr "mensaje n?mero uno" 14402 14403 # 14404 14405 domain "help_domain" 14406 14407 msgid "help two" 14408 14409 msgstr "ayuda n?mero dos" 14410 14411 # 14412 14413 domain "error_domain" 14414 14415 msgid "error three" 14416 14417 msgstr "error n?mero tres" 14418 14419 example% cat module2.po 14420 14421 # default domain "messages" 14422 14423 msgid "message four" 14424 14425 msgstr "mensaje n?mero cuatro" 14426 14427 # 14428 14429 domain "error_domain" 14430 14431 msgid "error five" 14432 14433 msgstr "error n?mero cinco" 14434 14435 # 14436 14437 domain "window_domain" 14438 14439 msgid "window six" 14440 14441 msgstr "ventana n?mero seises" 14442 14443 example% cat module3.po 14444 14445 # default domain "messages" 14446 14447 msgid "message seven" 14448 14449 msgstr "mensaje n?mero siete" 14450 14451 The following command will produce the output files messages, help_domain, and 14452 error_domain. 14453 14454 example% msgfmt module1.po 14455 14456 The following command will produce the output files messages, help_domain, 14457 error_domain, and window_domain. 14458 14459 example% msgfmt module1.po module2.po 14460 14461 The following example will produce the output file hello.mo. 14462 14463 example% msgfmt -o hello.mo module3.po 14464 14465 newgrp 14466 14467 Name 14468 14469 newgrp -- change group ID 14470 14471 Synopsis 14472 14473 newgrp [group] 14474 14475 Description 14476 14477 The newgrp command is as specified in ISO POSIX (2003), but with differences as 14478 listed below. 14479 14480 Differences 14481 14482 The -l option specified in ISO POSIX (2003) need not be supported. 14483 14484 od 14485 14486 Name 14487 14488 od -- dump files in octal and other formats 14489 14490 Synopsis 14491 14492 od [-abcdfilox] [-w width | --width-width] [-v] [-A address_base] [-j skip] [-n 14493 count] [-t type_string] [file...] 14494 14495 od --traditional [options] [file] [[+]offset [.] [b]] [[+]label [.] [b]] 14496 14497 Description 14498 14499 od is as specified in ISO POSIX (2003), but with differences as listed below. 14500 14501 Differences 14502 14503 -wwidth, --width[=width] 14504 14505 each output line is limited to width bytes from the input. 14506 14507 --traditional 14508 14509 accepts arguments in traditional form. 14510 14511 14512 Note: The XSI optional behavior described in ISO POSIX (2003) is not 14513 supported unless the --traditional option is also specified. 14514 14515 Pre-POSIX and XSI Specifications 14516 14517 The LSB supports option intermixtures with the following pre-POSIX and XSI 14518 options: 14519 14520 -a 14521 14522 is equivalent to -t a, selects named characters. 14523 14524 -b 14525 14526 is equivalent to -t o1, selects octal bytes. 14527 14528 -c 14529 14530 is equivalent to -t c, selects characters. 14531 14532 -d 14533 14534 is equivalent to -t u2, selects unsigned decimal two byte units. 14535 14536 -f 14537 14538 is equivalent to -t fF, selects floats. 14539 14540 -i 14541 14542 is equivalent to -t d2, selects decimal two byte units. 14543 14544 14545 Note: This usage may change in future releases; portable applications 14546 should use -t d2. 14547 14548 -l 14549 14550 is equivalent to -t d4, selects decimal longs. 14551 14552 -o 14553 14554 is equivalent to -t o2, selects octal two byte units. 14555 14556 -x 14557 14558 is equivalent to -t x2, selects hexadecimal two byte units. 14559 14560 Note that the XSI option -s need not be supported. 14561 14562 Traditional Usage 14563 14564 If the --traditional is specified, there may be between zero and three operands 14565 specified. 14566 14567 If no operands are specified, then od shall read the standard input. 14568 14569 If there is exactly one operand, and it is an offset of the form [+]offset[.] 14570 [b], then it shall be interpreted as specified in ISO POSIX (2003). The file to 14571 be dumped shall be the standard input. 14572 14573 If there are exactly two operands, and they are both of the form [+]offset[.] 14574 [b], then the first shall be an treated as an offset (as above), and the second 14575 shall be a label, in the same format as the offset. If a label is specified, 14576 then the first output line produced for each input block shall be preceded by 14577 the input offset, cumulative across input files, of the next byte to be 14578 written, followed by the label, in parentheses. The label shall increment in 14579 the same manner as the offset. 14580 14581 If there are three operands, then the first shall be the file to dump, the 14582 second the offset, and the third the label. 14583 14584 passwd 14585 14586 Name 14587 14588 passwd -- change user password 14589 14590 Synopsis 14591 14592 passwd [-x max] [-n min] [-w warn] [-i inact] name 14593 14594 passwd {-l | -u} name 14595 14596 Description 14597 14598 passwd changes passwords for user and group accounts. A normal user may only 14599 change the password for their own account, the super user may change the 14600 password for any account. passwd also changes password expiry dates and 14601 intervals. Applications may not assume the format of prompts and anticipated 14602 input for user interaction, because they are unspecified. 14603 14604 Options 14605 14606 -x max 14607 14608 sets the maximum number of days a password remains valid. 14609 14610 -n min 14611 14612 sets the minimum number of days before a password may be changed. 14613 14614 -w warn 14615 14616 sets the number of days warning the user will receive before their password 14617 will expire. 14618 14619 -i inactive 14620 14621 disables an account after the password has been expired for the given 14622 number of days. 14623 14624 -l 14625 14626 disables an account by changing the password to a value which matches no 14627 possible encrypted value. 14628 14629 -u 14630 14631 re-enables an account by changing the password back to its previous value. 14632 14633 patch 14634 14635 Name 14636 14637 patch -- apply a diff file to an original 14638 14639 Description 14640 14641 patch is as specified in ISO POSIX (2003), but with extensions as listed below. 14642 14643 Extensions 14644 14645 --binary 14646 14647 reads and write all files in binary mode, except for standard output and / 14648 dev/tty. This option has no effect on POSIX-compliant systems. 14649 14650 -u, --unified 14651 14652 interprets the patch file as a unified context diff. 14653 14654 pidof 14655 14656 Name 14657 14658 pidof -- find the process ID of a running program 14659 14660 Synopsis 14661 14662 pidof [-s] [-x] [-o omitpid...] program... 14663 14664 Description 14665 14666 Return the process ID of a process which is running the program named on the 14667 command line. 14668 14669 Options 14670 14671 -s 14672 14673 instructs the program to only return one pid. 14674 14675 -x 14676 14677 causes the program to also return process id's of shells running the named 14678 scripts. 14679 14680 -o 14681 14682 omits processes with specified process id. 14683 14684 remove_initd 14685 14686 Name 14687 14688 remove_initd -- clean up boot script system modifications introduced by 14689 install_initd 14690 14691 Synopsis 14692 14693 /usr/lib/lsb/remove_initd initd_file 14694 14695 Description 14696 14697 remove_initd processes the removal of the modifications made to a 14698 distribution's boot script system by the install_initd program. This cleanup is 14699 performed in the preuninstall script of a package; however, the package manager 14700 is still responsible for removing the /etc/init.d file. See also the Section 14701 called Installation and Removal of init.d Files in Chapter 14. 14702 14703 renice 14704 14705 Name 14706 14707 renice -- alter priority of running processes 14708 14709 Description 14710 14711 renice is as specified in ISO POSIX (2003), but with differences as listed 14712 below. 14713 14714 Differences 14715 14716 -n increment 14717 14718 has unspecified behavior. 14719 14720 sed 14721 14722 Name 14723 14724 sed -- stream editor 14725 14726 Description 14727 14728 sed is as specified in ISO POSIX (2003), but with differences as listed below. 14729 14730 LSB Differences 14731 14732 Certain aspects of internationalized regular expressions are optional; see 14733 Internationalization and Regular Expressions>. 14734 14735 sendmail 14736 14737 Name 14738 14739 sendmail -- an electronic mail transport agent 14740 14741 Synopsis 14742 14743 sendmail [options] [address...] 14744 14745 Description 14746 14747 To deliver electronic mail (email), applications shall support the interface 14748 provided by /usr/sbin/sendmail (described here). This interface shall be the 14749 default delivery method for applications. 14750 14751 This program sends an email message to one or more recipients, routing the 14752 message as necessary. This program is not intended as a user interface routine. 14753 14754 With no options, sendmail reads its standard input up to an end-of-file or a 14755 line consisting only of a single dot and sends a copy of the message found 14756 there to all of the addresses listed. It determines the network(s) to use based 14757 on the syntax and contents of the addresses. 14758 14759 It is recommended that applications use as few options as necessary, none if 14760 possible. 14761 14762 Some agents allow aliasing on the local system to be prevented by preceding the 14763 address with a backslash. 14764 14765 The format of messages shall be as defined in RFC 2822. 14766 14767 Options 14768 14769 -bm 14770 14771 reads mail from standard input and delivers to the recipient addresses. 14772 This is the default mode of operation. 14773 14774 -bp 14775 14776 lists information about messages currently in the input mail queue. 14777 14778 -bs 14779 14780 uses the SMTP protocol as described in RFC 2821; reads SMTP commands on 14781 standard input and writes SMTP responses on standard output. 14782 14783 Note that RFC 2821 specifies \r\n (CR-LF) be used at the end of each line, 14784 but pipes almost always use \n (LF) instead. To deal with this, agents will 14785 accept both \r\n and \n at the end of each line. When accepting \r\n, the \ 14786 r before the \n is silently discarded. 14787 14788 -F fullname 14789 14790 explicitly sets the full name of the sender for incoming mail unless the 14791 message already contains a From: message header. 14792 14793 If the user running sendmail is not sufficiently trusted, then the actual 14794 sender may be indicated in the message, depending on the behavior of the 14795 agent. 14796 14797 -f name 14798 14799 explicitly sets the envelope sender address for incoming mail. If there is 14800 no From: header, the address specified in the From: header will also be 14801 set. 14802 14803 If the user running sendmail is not sufficiently trusted, then the actual 14804 sender will be indicated in the message. 14805 14806 -i 14807 14808 ignores dots alone on lines by themselves in incoming messages. If -bs is 14809 also used, the behavior is unspecified. 14810 14811 -odb 14812 14813 delivers any mail in background, if supported; otherwise ignored. 14814 14815 -odf 14816 14817 delivers any mail in foreground, if supported; otherwise ignored. 14818 14819 -oem or -em 14820 14821 mails errors back to the sender. (default) 14822 14823 -oep or -ep 14824 14825 writes errors to the standard error output. 14826 14827 -oeq or -eq 14828 14829 does not send notification of errors to the sender. This only works for 14830 mail delivered locally. 14831 14832 -oi 14833 14834 is equivalent to -i. 14835 14836 -om 14837 14838 indicates that the sender of a message should receive a copy of the message 14839 if the sender appears in an alias expansion. Ignored if aliases are not 14840 supported. 14841 14842 -t 14843 14844 reads the message to obtain recipients from the To:, Cc:, and Bcc: headers 14845 in the message instead of from the command arguments. If a Bcc: header is 14846 present, it is removed from the message unless there is no To: or Cc: 14847 header, in which case a Bcc: header with no data is created, in accordance 14848 with RFC 2822. 14849 14850 If there are any arguments, they specify addresses to which the message is 14851 not to be delivered. That is, the argument addresses are removed from the 14852 recipients list obtained from the headers. Note: some agents implement this 14853 behavior in reverse, adding addresses instead of removing them. Others may 14854 disallow addresses in argument list. Therefore, applications should not put 14855 addresses in the argument list if -t is used. 14856 14857 This option is sometimes ignored when not in -bm mode (the default). 14858 14859 Exit status 14860 14861 0 14862 14863 successful completion on all addresses. This does not indicate successful 14864 delivery. 14865 14866 >0 14867 14868 there was an error. 14869 14870 Notes/Rationale 14871 14872 This page is believed to reflect functionality provided by smail, exim and 14873 other implementations, not just the sendmail implementation. 14874 14875 shutdown 14876 14877 Name 14878 14879 shutdown -- bring the system down 14880 14881 Synopsis 14882 14883 /sbin/shutdown [-t sec] [-arkhcfF] time [warning-message] 14884 14885 Description 14886 14887 shutdown brings the system down in a secure way. All logged-in users are 14888 notified that the system is going down, and login(1) is blocked. It is possible 14889 to shut the system down immediately or after a specified delay. All processes 14890 are first notified that the system is going down by the signal SIGTERM. If 14891 neither the -h or the -r argument is used, then the default behavior is to take 14892 the system to runlevel one where administrative tasks can be run. 14893 14894 Standard Options 14895 14896 -a 14897 14898 uses /etc/shutdown.allow. 14899 14900 -t sec 14901 14902 tells init(8) to wait sec seconds between sending processes the warning and 14903 the kill signal, before changing to another runlevel. 14904 14905 -k 14906 14907 doesn't really shutdown; only sends the warning messages to everybody. 14908 14909 -r 14910 14911 reboots after shutdown. 14912 14913 -h 14914 14915 halts after shutdown. Powering off after halting is unspecified. 14916 14917 -f 14918 14919 skips fsck on reboot. 14920 14921 -F 14922 14923 forces fsck on reboot. 14924 14925 -c 14926 14927 cancels an already running shutdown. With this option, it is of course not 14928 possible to give the time argument, but you can enter a explanatory message 14929 on the command line that will be sent to all users. 14930 14931 time 14932 14933 specifies when to shut down. 14934 14935 The time argument can have different formats. First, it can be an absolute 14936 time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm is 14937 the minute of the hour (in two digits). Second, it can be in the format +m, 14938 in which m is the number of minutes to wait. The word now is an alias for 14939 +0. 14940 14941 If shutdown is called with a delay, it creates the advisory file /etc/ 14942 nologin which causes programs such as login(1) to not allow new user 14943 logins. shutdown only removes this file if it is stopped before it can 14944 signal init (i.e. it is cancelled or something goes wrong). Otherwise it is 14945 the responsibility of the system shutdown or startup scripts to remove this 14946 file so that users can login. 14947 14948 warning-message 14949 14950 specifies message to send all users. 14951 14952 su 14953 14954 Name 14955 14956 su -- change user ID or become super-user 14957 14958 Synopsis 14959 14960 su [options] [-] [username [ARGS]] 14961 14962 Description 14963 14964 su is used to become another user during a login session. Invoked without a 14965 username, su defaults to becoming the super user. The optional argument - may 14966 be used to provide an environment similar to what the user would expect had the 14967 user logged in directly. 14968 14969 The user will be prompted for a password, if appropriate. Invalid passwords 14970 will produce an error message. All attempts, both valid and invalid, are logged 14971 to detect abuses of the system. Applications may not assume the format of 14972 prompts and anticipated input for user interaction, because they are 14973 unspecified. 14974 14975 An optional command can be executed. This is done by the shell specified in / 14976 etc/passwd for the target user unless the -s or -m options are used. Any 14977 arguments supplied after the username will be passed to the invoked shell 14978 (shell shall support the -c command line option in order for a command to be 14979 passed to it). 14980 14981 The current environment is passed to the new shell. The value of $PATH is reset 14982 to /bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the 14983 super user. This may be changed with the ENV_PATH and ENV_SUPATH definitions in 14984 /etc/login.defs. When using the -m or -p options, the user's environment is not 14985 changed. 14986 14987 A subsystem login is indicated by the presense of a "*" as the first character 14988 of the login shell. The given home directory will be used as the root of a new 14989 filesystem which the user is actually logged into. 14990 14991 Standard Options 14992 14993 - 14994 14995 makes this a login shell. 14996 14997 -c, --comand=command 14998 14999 passes command to the invoked shell. It is passed directly to the invoked 15000 shell (using the shell's -c option), so its syntax is whatever that shell 15001 can accept. 15002 15003 -m, -p, --preserve-environment 15004 15005 does not reset environment variables, and keeps the same shell if it is 15006 present in /etc/shells. 15007 15008 -s, --shell=shell 15009 15010 uses shell instead of the default in /etc/passwd. The shell specified shall 15011 be present in /etc/shells. 15012 15013 sync 15014 15015 Name 15016 15017 sync -- flush filesystem buffers 15018 15019 Synopsis 15020 15021 sync 15022 15023 Description 15024 15025 Force changed blocks to disk, update the super block. 15026 15027 tar 15028 15029 Name 15030 15031 tar -- file archiver 15032 15033 Description 15034 15035 tar is as specified in SUSv2, but with differences as listed below. 15036 15037 Differences 15038 15039 Certain aspects of internationalized filename globbing are optional; see 15040 Internationalization and Pattern Matching Notation>. 15041 15042 -h 15043 15044 doesn't dump symlinks; dumps the files they point to. 15045 15046 -z 15047 15048 filters the archive through gzip. 15049 15050 umount 15051 15052 Name 15053 15054 umount -- unmount file systems 15055 15056 Synopsis 15057 15058 umount [-hV] 15059 15060 umount -a [-nrv] [-t vfstype] 15061 15062 umount [-nrv] device | dir 15063 15064 Description 15065 15066 umount detaches the file system(s) mentioned from the file hierarchy. A file 15067 system is specified by giving the directory where it has been mounted. 15068 15069 Standard Options 15070 15071 -v 15072 15073 invokes verbose mode. 15074 15075 -n 15076 15077 unmounts without writing in /etc/mtab. 15078 15079 -r 15080 15081 tries to remount read-only if unmounting fails. 15082 15083 -a 15084 15085 unmounts all of the file systems described in /etc/mtab except for the proc 15086 filesystem. 15087 15088 -t vfstype 15089 15090 indicates that the actions should only be taken on file systems of the 15091 specified type. More than one type may be specified in a comma separated 15092 list. The list of file system types can be prefixed with no to specify the 15093 file system types on which no action should be taken. 15094 15095 -f 15096 15097 forces unmount (in case of an unreachable NFS system). 15098 15099 LSB Deprecated Options 15100 15101 The behaviors specified in this section are expected to disappear from a future 15102 version of the LSB; applications should only use the non-LSB-deprecated 15103 behaviors. 15104 15105 -V 15106 15107 print version and exits. 15108 15109 useradd 15110 15111 Name 15112 15113 useradd -- create a new user or update default new user information 15114 15115 Synopsis 15116 15117 useradd [-c comment] [-d home_dir] 15118 [-g initial_group] [-G group[,...]] 15119 [-m [-k skeleton_dir]] [-p passwd] [-r] 15120 [-s shell] [-u uid [ -o]] login 15121 15122 useradd -D [-g default_group] [-b default_home] 15123 [-s default_shell] 15124 15125 Description 15126 15127 When invoked without the -D option, useradd creates a new user account using 15128 the values specified on the command line and the default values from the 15129 system. The new user account will be entered into the system files as needed, 15130 the home directory will be created, and initial files copied, depending on the 15131 command line options. 15132 15133 When invoked with the -D option, useradd will either display the current 15134 default values, or update the default values from the command line. If no 15135 options are specified, useradd displays the current default values. 15136 15137 Standard Options 15138 15139 -c comment 15140 15141 specifies the new user's password file comment field value. 15142 15143 -d home_dir 15144 15145 creates the new user using home_dir as the value for the user's login 15146 directory. The default is to append the login name to default_home and use 15147 that as the login directory name. 15148 15149 -g initial_group 15150 15151 specifies the group name or number of the user's initial login group. The 15152 group name shall exist. A group number shall refer to an already existing 15153 group. If -g is not specified, the implementation will follow the normal 15154 user default for that system. This may create a new group or choose a 15155 default group that normal users are placed in. Applications which require 15156 control of the groups into which a user is placed should specify -g. 15157 15158 -G group,[...] 15159 15160 specifies a list of supplementary groups which the user is also a member 15161 of. Each group is separated from the next by a comma, with no intervening 15162 whitespace. The groups are subject to the same restrictions as the group 15163 given with the -g option. The default is for the user to belong only to the 15164 initial group. 15165 15166 -m [-k skeleton_dir] 15167 15168 specifies the user's home directory will be created if it does not exist. 15169 The files contained in skeleton_dir will be copied to the home directory if 15170 the -k option is used, otherwise the files contained in /etc/skel will be 15171 used instead. Any directories contained in skeleton_dir or /etc/skel will 15172 be created in the user's home directory as well. The -k option is only 15173 valid in conjunction with the -m option. The default is to not create the 15174 directory and to not copy any files. 15175 15176 -p passwd 15177 15178 is the encrypted password, as returned by crypt(3). The default is to 15179 disable the account. 15180 15181 -r 15182 15183 creates a system account, that is, a user with a UID in the range reserved 15184 for system account users. If there is not a UID free in the reserved range 15185 the command will fail. 15186 15187 -s shell 15188 15189 specifies the name of the user's login shell. The default is to leave this 15190 field blank, which causes the system to select the default login shell. 15191 15192 -u uid [-o] 15193 15194 specifies the numerical value of the user's ID. This value shall be unique, 15195 unless the -o option is used. The value shall be non-negative. The default 15196 is the smallest ID value greater than 499 which is not yet used. 15197 15198 Change Default Options 15199 15200 -b default_home 15201 15202 specifies the initial path prefix for a new user's home directory. The 15203 user's name will be affixed to the end of default_home to create the new 15204 directory name if the -d option is not used when creating a new account. 15205 15206 -g default_group 15207 15208 specifies the group name or ID for a new user's initial group. The named 15209 group shall exist, and a numerical group ID shall have an existing entry. 15210 15211 -s default_shell 15212 15213 specifies the name of the new user's login shell. The named program will be 15214 used for all future new user accounts. 15215 15216 -c comment 15217 15218 specifies the new user's password file comment field value. 15219 15220 Application Usage 15221 15222 The -D option will typically be used by system administration packages. Most 15223 applications should not change defaults which will affect other applications 15224 and users. 15225 15226 userdel 15227 15228 Name 15229 15230 userdel -- delete a user account and related files 15231 15232 Synopsis 15233 15234 userdel [-r] login 15235 15236 Description 15237 15238 Delete the user account named login. If there is also a group named login, this 15239 command may delete the group as well, or may leave it alone. 15240 15241 Options 15242 15243 -r 15244 15245 removes files in the user's home directory along with the home directory 15246 itself. Files located in other file system will have to be searched for and 15247 deleted manually. 15248 15249 usermod 15250 15251 Name 15252 15253 usermod -- modify a user account 15254 15255 Synopsis 15256 15257 usermod [-c comment] [-d home_dir [ -m]] 15258 [-g initial_group] [-G group[,...]] 15259 [-l login_name] [-p passwd] 15260 [-s shell] [-u uid [ -o]] login 15261 15262 Options 15263 15264 -c comment 15265 15266 specifies the new value of the user's password file comment field. 15267 15268 -d home_dir 15269 15270 specifies the user's new login directory. If the -m option is given the 15271 contents of the current home directory will be moved to the new home 15272 directory, which is created if it does not already exist. 15273 15274 -g initial_group 15275 15276 specifies the group name or number of the user's new initial login group. 15277 The group name shall exist. A group number shall refer to an already 15278 existing group. 15279 15280 -G group,[...] 15281 15282 specifies a list of supplementary groups which the user is also a member 15283 of. Each group is separated from the next by a comma, with no intervening 15284 whitespace. The groups are subject to the same restrictions as the group 15285 given with the -g option. If the user is currently a member of a group 15286 which is not listed, the user will be removed from the group. 15287 15288 -l login_name 15289 15290 changes the name of the user from login to login_name. Nothing else is 15291 changed. In particular, the user's home directory name should probably be 15292 changed to reflect the new login name. 15293 15294 -p passwd 15295 15296 is the encrypted password, as returned by crypt(3). 15297 15298 -s shell 15299 15300 specifies the name of the user's new login shell. Setting this field to 15301 blank causes the system to select the default login shell. 15302 15303 -u uid [-o] 15304 15305 specifies the numerical value of the user's ID. This value shall be unique, 15306 unless the -o option is used. The value shall be non-negative. Any files 15307 which the user owns and which are located in the directory tree rooted at 15308 the user's home directory will have the file user ID changed automatically. 15309 Files outside of the user's home directory shall be altered manually. 15310 15311 xargs 15312 15313 Name 15314 15315 xargs -- build and execute command lines from standard input 15316 15317 Description 15318 15319 xargs is as specified in ISO POSIX (2003), but with differences as listed 15320 below. 15321 15322 Differences 15323 15324 -E 15325 15326 has unspecified behavior. 15327 15328 -I 15329 15330 has unspecified behavior. 15331 15332 -L 15333 15334 has unspecified behavior. 15335 15336 V. Execution Environment 15337 15338 Table of Contents 15339 10. File System Hierarchy 15340 11. Additional Recommendations 15341 12. Additional Behaviors 15342 13. Localization 15343 15344 ------------------------------------------------------------------------------- 15345 15346 Chapter 10. File System Hierarchy 15347 15348 An LSB conforming implementation shall provide the mandatory portions of the 15349 filesystem hierarchy specified in the Filesystem Hierarchy Standard (FHS), 15350 together with any additional requirements made in this specification. 15351 15352 An LSB conforming application shall conform to the Filesystem Hierarchy 15353 Standard. 15354 15355 The FHS allows many components or subsystems to be optional. An application 15356 shall check for the existence of an optional component before using it, and 15357 should behave in a reasonable manner if the optional component is not present. 15358 15359 The FHS requirement to locate the operating system kernel in either / or /boot 15360 does not apply if the operating system kernel does not exist as a file in the 15361 filesystem. 15362 15363 The FHS specifies certain behaviors for a variety of commands if they are 15364 present (for example, ping or python). However, LSB applications shall not rely 15365 on any commands beyond those specified by the LSB. The mere existence of a 15366 command may not be used as an indication that the command behaves in any 15367 particular way. 15368 15369 The following directories or links need not be present: /etc/X11 /usr/bin/X11 / 15370 usr/lib/X11 /proc 15371 15372 ------------------------------------------------------------------------------- 15373 15374 /dev 15375 15376 The following shall exist under /dev. Other devices may also exist in /dev. 15377 Device names may exist as symbolic links to other device nodes located in /dev 15378 or subdirectories of /dev. There is no requirement concerning major/minor 15379 number values. 15380 15381 /dev/null 15382 15383 An infinite data source and data sink. Data written to this device shall be 15384 discarded. Reads from this device shall always return end-of-file (EOF). 15385 15386 /dev/zero 15387 15388 This device is a source of zeroed out data. All data written to this device 15389 shall be discarded. A read from this device shall always return the 15390 requested number of bytes, each initialized to the value '\0'. 15391 15392 /dev/tty 15393 15394 In each process, a synonym for the controlling terminal associated with the 15395 process group of that process, if any. All reads and writes to this device 15396 shall behave as if the actual controlling terminal device had been opened. 15397 15398 ------------------------------------------------------------------------------- 15399 15400 Chapter 11. Additional Recommendations 15401 15402 Minimal granted Directory and File permissions 15403 15404 In this Chapter "System" means an "LSB conforming implementation" and 15405 "application" means an "LSB conforming (third party vendor) application". 15406 15407 The system shall grant to the application read and execute permissions on files 15408 needed to use all system interfaces (ABIs) required by the LSB specification. 15409 15410 ------------------------------------------------------------------------------- 15411 15412 Recommendations for applications on ownership and permissions 15413 15414 Directory Write Permissions 15415 15416 The application should not depend on having directory write permission outside 15417 /tmp, /var/tmp, invoking user's home directory and /var/opt/package, (where 15418 package is the name of the application package). 15419 15420 The application should not depend on owning these directories. 15421 15422 For these directories the application should be able to work with directory 15423 write permissions restricted by the S_ISVTXT bit (otherwise known as the 15424 "sticky bit"). 15425 15426 ------------------------------------------------------------------------------- 15427 15428 File Write Permissions 15429 15430 The application should not depend on file write permission on files not owned 15431 by the user it runs under with the exception of its personal inbox /var/mail/ 15432 username. 15433 15434 ------------------------------------------------------------------------------- 15435 15436 File Read and execute Permissions 15437 15438 The application should not depend on having read permission to every file and 15439 directory. 15440 15441 ------------------------------------------------------------------------------- 15442 15443 Suid and Sgid Permissions 15444 15445 The application should not depend on the set user ID or set group ID (the 15446 S_ISUID or S_ISGID permissions of a file not packaged with the application. 15447 Instead, the distribution is responsible for assuming that all system commands 15448 have the required permissions and work correctly. 15449 15450 Rationale: In order to implement common security policies it is strongly 15451 advisable for applications to use the minimum set of security attributes 15452 necessary for correct operation. Applications that require substantial 15453 appropriate privilege are likely to cause problems with such security 15454 policies. 15455 15456 ------------------------------------------------------------------------------- 15457 15458 Privileged users 15459 15460 In general, applications should not depend on running as a privileged user. 15461 This specification uses the term "appropriate privilege" throughout to identify 15462 operations that cannot be achieved without some special granting of additional 15463 privilege. 15464 15465 Applications that have a reason to run with appropriate privilege should 15466 outline this reason clearly in their documentation. Users of the application 15467 should be informed, that "this application demands security privileges, which 15468 could interfere with system security". 15469 15470 The application should not contain binary-only software that requires being run 15471 with appropriate privilege, as this makes security auditing harder or even 15472 impossible. 15473 15474 ------------------------------------------------------------------------------- 15475 15476 Changing permissions 15477 15478 The application shall not change permissions of files and directories that do 15479 not belong to its own package. Should an application require that certain files 15480 and directories not directly belonging to the package have a particular 15481 ownership, the application shall document this requirement, and may fail during 15482 installation if the permissions on these files is inappropriate. 15483 15484 ------------------------------------------------------------------------------- 15485 15486 Removable Media (Cdrom, Floppy, etc.) 15487 15488 Applications that expect to be runnable from removable media should not depend 15489 on logging in as a privileged user, and should be prepared to deal with a 15490 restrictive environment. Examples of such restrictions could be default mount 15491 options that disable set-user/group-ID attributes, disabling block or 15492 character-special files on the medium, or remapping the user and group IDs of 15493 files away from any privileged value. 15494 15495 15496 Rationale: System vendors and local system administrators want to run 15497 applications from removable media, but want the possibility to control what 15498 the application can do. 15499 15500 ------------------------------------------------------------------------------- 15501 15502 Installable applications 15503 15504 Where the installation of an application needs additional privileges, it must 15505 clearly document all files and system databases that are modified outside of 15506 those in /opt/pkg-name and /var/opt/pkg-name, other than those that may be 15507 updated by system logging or auditing activities. 15508 15509 Without this, the local system administrator would have to blindly trust a 15510 piece of software, particularly with respect to its security. 15511 15512 ------------------------------------------------------------------------------- 15513 15514 Chapter 12. Additional Behaviors 15515 15516 Mandatory Optional Behaviors 15517 15518 This section specifies behaviors in which there is optional behavior in one of 15519 the standards on which the LSB relies, and where the LSB requires a specific 15520 behavior. 15521 15522 15523 Note: The LSB does not require the kernel to be Linux; the set of mandated 15524 options reflects current existing practice, but may be modified in future 15525 releases. 15526 15527 LSB conforming implementations shall support the following options defined 15528 within the ISO POSIX (2003): 15529 15530 _POSIX_FSYNC 15531 _POSIX_MAPPED_FILES 15532 _POSIX_MEMLOCK 15533 _POSIX_MEMLOCK_RANGE 15534 _POSIX_MEMORY_PROTECTION 15535 _POSIX_PRIORITY_SCHEDULING 15536 _POSIX_REALTIME_SIGNALS 15537 _POSIX_THREAD_ATTR_STACKADDR 15538 _POSIX_THREAD_ATTR_STACKSIZE 15539 _POSIX_THREAD_PROCESS_SHARED 15540 _POSIX_THREAD_SAFE_FUNCTIONS 15541 _POSIX_THREADS 15542 _XOPEN_UNIX 15543 15544 The opendir() function shall consume a file descriptor in the same fashion as 15545 open, and therefore may fail with EMFILE or ENFILE. 15546 15547 The START and STOP termios characters shall be changeable, as described as 15548 optional behavior in the "General Terminal Interface" section of the ISO POSIX 15549 (2003). 15550 15551 The access() function function shall fail with errno set to EINVAL if the amode 15552 argument contains bits other than those set by the bitwise inclusive OR of 15553 R_OK, W_OK, X_OK and F_OK. 15554 15555 The link() function shall require access to the existing file in order to 15556 succeed, as described as optional behavior in the ISO POSIX (2003). 15557 15558 Calling unlink() on a directory shall fail. Calling link() specifying a 15559 directory as the first argument shall fail. See also unlink. 15560 15561 15562 Note: Linux allows rename() on a directory without having write access, but 15563 the LSB does not require this. 15564 15565 ------------------------------------------------------------------------------- 15566 15567 Special Requirements 15568 15569 LSB conforming systems shall enforce certain special additional restrictions 15570 above and beyond those required by ISO POSIX (2003). 15571 15572 15573 Note: These additional restrictions are required in order to support the 15574 testing and certification programs associated with the LSB. In each case, 15575 these are values that defined macros must not have; conforming applications 15576 that use these values shall trigger a failure in the interface that is 15577 otherwise described as a "may fail". 15578 15579 The fcntl() function shall treat the "cmd" value -1 as invalid. 15580 15581 The whence value -1 shall be an invalid value for the lseek(), fseek() and 15582 fcntl() functions. 15583 15584 The value -5 shall be an invalid signal number. 15585 15586 If the sigaddset() or sigdelset() functions are passed an invalid signal 15587 number, they shall return with EINVAL. Implementations are only required to 15588 enforce this requirement for signal numbers which are specified to be invalid 15589 by this specification (such as the -5 mentioned above). 15590 15591 The mode value -1 to the access() function shall be treated as invalid. 15592 15593 A value of -1 shall be an invalid "_PC_..." value for pathconf(). 15594 15595 A value of -1 shall be an invalid "_SC..." value for sysconf(). 15596 15597 The nl_item value -1 shall be invalid for nl_langinfo. 15598 15599 The value -1 shall be an invalid "_CS_..." value for confstr(). 15600 15601 The value "z" shall be an invalid mode argument to popen(). 15602 15603 ------------------------------------------------------------------------------- 15604 15605 Chapter 13. Localization 15606 15607 In order to install a message catalog, the installation procedure shall supply 15608 the message catalog in a format readable by the msgfmt utility, which shall be 15609 invoked to compile the message catalog into an appropriate binary format on the 15610 target system. 15611 15612 15613 Rationale: The original intent was to allow an application to contain the 15614 binary GNU MO format files. However, the format of these files is not 15615 officially stable, hence it is necessary to compile these catalogs on the 15616 target system. These binary catalogs may differ from architecture to 15617 architecture as well. 15618 15619 The resulting binary message catalog shall be located in the package's private 15620 area under /opt, and the application may use bindtextdomain() to specify this 15621 location. 15622 15623 Implementations shall support the POSIX and C locales as specified in the ISO 15624 POSIX (2003). 15625 15626 ------------------------------------------------------------------------------- 15627 15628 Regular Expressions 15629 15630 Utilities that process regular expressions shall support Basic Regular 15631 Expressions and Extended Regular Expressions as specified in ISO POSIX (2003), 15632 with the following exceptions: 15633 15634 Range expression (such as [a-z]) can be based on code point order instead of 15635 collating element order. 15636 15637 Equivalence class expression (such as [=a=]) and multi-character collating 15638 element expression (such as [.ch.]) are optional. 15639 15640 Handling of a multi-character collating element is optional. 15641 15642 This affects at least the following utilities: grep (grep) (including egrep), 15643 sed (sed), and awk (awk). 15644 15645 ------------------------------------------------------------------------------- 15646 15647 Pattern Matching Notation 15648 15649 Utilities that perform filename pattern matching (also known as Filename 15650 Globbing) shall do it as specified in ISO POSIX (2003), Pattern Matching 15651 Notation, with the following exceptions: 15652 15653 Pattern bracket expressions (such as [a-z]) can be based on code point order 15654 instead of collating element order. 15655 15656 Equivalence class expression (such as [=a=]) and multi-character collating 15657 element expression (such as [.ch.]) are optional. 15658 15659 Handling of a multi-character collating element is optional. 15660 15661 This affects at least the following utilities: cpio (cpio), find (find), ls (ls 15662 ) and tar (tar). 15663 15664 VI. System Initialization 15665 15666 Table of Contents 15667 14. System Initialization 15668 15669 ------------------------------------------------------------------------------- 15670 15671 Chapter 14. System Initialization 15672 15673 Cron Jobs 15674 15675 In addition to the individual user crontab files specified by ISO POSIX (2003) 15676 stored under /var/spool/cron, the process that executes scheduled commands 15677 shall also process the following additional crontab files: /etc/crontab, /etc/ 15678 cron.d/* The installation of a package shall not modify the configuration file 15679 /etc/crontab. 15680 15681 If a package wishes to install a job that has to be executed periodically, it 15682 shall place a file in one of the following directories: 15683 15684 /etc/cron.daily 15685 /etc/cron.weekly 15686 /etc/cron.monthly 15687 15688 As these directory names suggest, the files within them are executed on a 15689 daily, weekly, or monthly basis, respectively, under the control of an entry in 15690 one of the system crontab files. See below for the rules concerning the names 15691 of files in these directories. 15692 15693 It is recommended that files installed in any of these directories be scripts 15694 (e.g. shell scripts, Perl scripts, etc.) so that they may be modified by the 15695 local system administrator. 15696 15697 The scripts in these directories should check if all necessary programs are 15698 installed before they try to execute them. Otherwise, problems will arise if a 15699 package is removed (but not purged), since the configuration files are kept on 15700 the system in this situation. 15701 15702 If a certain job has to be executed at a different frequency (e.g. more 15703 frequently than daily), the package shall install a file /etc/cron.d/cron-name 15704 tagged as a configuration file. This file uses the same syntax as /etc/crontab 15705 and is processed by the system automatically. 15706 15707 To avoid namespace conflicts in the /etc/cron.* directories, the filenames used 15708 by LSB-compliant packages in /etc/cron.daily, /etc/cron.weekly, /etc/ 15709 cron.monthly, or /etc/cron.d shall come from a managed namespace. These 15710 filenames may be assigned using one of the following methods: 15711 15712 * Assigned namespace. This namespace consists of names which only use the 15713 character set [a-z0-9]. In order to avoid conflicts these cron script names 15714 shall be reserved through the Linux Assigned Names and Numbers Authority 15715 (LANANA). Information about the LANANA may be found at www.lanana.org. 15716 15717 Commonly used names shall be reserved in advance; developers for projects 15718 should be encouraged reserve names from LANANA, so that each distribution 15719 can use the same name, and to avoid conflicts with other projects. 15720 15721 * Hierarchical namespace. This namespace consists of script names of the 15722 form: [hier1]-[hier2]-...-[name], where name is again taken from the 15723 character set [a-z0-9], and where there may be one or more [hier-n] 15724 components. [hier1] may either be an LSB provider name assigned by the 15725 LANANA, or it may be owners' DNS name in lower case, with at least one '.'. 15726 e.g. "debian.org", "staroffice.sun.com", etc. The LSB provider name 15727 assigned by LANANA shall only consist of the ASCII characters [a-z0-9]. 15728 15729 * Reserved namespace. This namespace consists of script names which begin 15730 with the character '_', and is reserved for distribution use only. This 15731 namespace should be used for core packages only. 15732 15733 ------------------------------------------------------------------------------- 15734 15735 Init Script Actions 15736 15737 Init files provided by LSB applications shall accept one argument, saying what 15738 to do: 15739 15740 start start the service 15741 stop stop the service 15742 restart stop and restart the service if the service is already running, 15743 otherwise start the service 15744 try-restart restart the service if the service is already running 15745 reload cause the configuration of the service to be reloaded without 15746 actually stopping and restarting the service 15747 force-reload cause the configuration to be reloaded if the service supports 15748 this, otherwise restart the service if it is running 15749 status print the current status of the service 15750 15751 The start, stop, restart, force-reload, and status commands shall be supported 15752 by all init files; the reload and the try-restart options are optional. Other 15753 init script actions may be defined by the init script. 15754 15755 Init files shall ensure that they will behave sensibly if invoked with start 15756 when the service is already running, or with stop when it isn't, and that they 15757 don't kill unfortunately-named user processes. The best way to achieve this is 15758 to use the init-script functions provided by /lib/lsb/init-functions. 15759 15760 If a service reloads its configuration automatically (as in the case of cron, 15761 for example), the reload option of the init file shall behave as if the 15762 configuration has been reloaded successfully. The restart, try-restart, reload 15763 and force-reload action may be atomic; i.e. if a service is known not be 15764 operational after a restart or reload, the script may return an error without 15765 any further action. 15766 15767 These executable files shall not fail obscurely when the configuration files 15768 remain but the package has been removed, as the default in [the packaging 15769 system] is to leave configuration files on the system after the package has 15770 been removed. Only when it is executed with the [purge] option will [the 15771 packaging system] remove configuration files. Therefore, you should include a 15772 test statement at the top of the file, like this: 15773 15774 test -f program-executed-later-in-file || exit 5 15775 15776 or take the equivalent action if the init file is not a shell script. 15777 15778 If the status command is given, the init script will return the following exit 15779 status codes. 15780 15781 0 program is running or service is OK 15782 1 program is dead and /var/run pid file exists 15783 2 program is dead and /var/lock lock file exists 15784 3 program is not running 15785 4 program or service status is unknown 15786 5-99 reserved for future LSB use 15787 100-149 reserved for distribution use 15788 150-199 reserved for application use 15789 200-254 reserved 15790 15791 In the case of init script commands other than "status" (i.e., "start", "stop", 15792 "restart", "try-restart", "reload", and "force-reload"), the init script shall 15793 return an exit status of zero if the action described by the argument has been 15794 successful. Otherwise, the exit status shall be non-zero, as defined below. In 15795 addition to straightforward success, the following situations are also to be 15796 considered successful: 15797 15798 * restarting a service (instead of reloading it) with the "force-reload" 15799 argument 15800 15801 * running "start" on a service already running 15802 15803 * running "stop" on a service already stopped or not running 15804 15805 * running "restart" on a service already stopped or not running 15806 15807 * running "try-restart" on a service already stopped or not running 15808 15809 15810 15811 In case of an error, while processing any init script action except for 15812 "status", the init script shall print an error message and return one of the 15813 following non-zero exit status codes. 15814 15815 1 generic or unspecified error (current practice) 15816 2 invalid or excess argument(s) 15817 3 unimplemented feature (for example, "reload") 15818 4 user had insufficient privilege 15819 5 program is not installed 15820 6 program is not configured 15821 7 program is not running 15822 8-99 reserved for future LSB use 15823 100-149 reserved for distribution use 15824 150-199 reserved for application use 15825 200-254 reserved 15826 15827 Error and status messages should be printed with the logging functions such as 15828 log_failure_msg and so on. Scripts may write to standard error or standard 15829 output, but implementations need not present text written to standard error/ 15830 output to the user or do anything else with it. 15831 15832 Since init files may be run manually by a system administrator with 15833 non-standard environment variable values for PATH, USER, LOGNAME, etc. init 15834 files shall not depend on the values of these environment variables. They 15835 should set them to some known/default values if they are needed. 15836 15837 ------------------------------------------------------------------------------- 15838 15839 Comment Conventions for Init Scripts 15840 15841 LSB applications which need to execute script(s) at bootup and/or shutdown may 15842 provide one or more init.d files. These files are installed by the 15843 install_initd program described below, which copies it into a standard 15844 directory and makes whatever other adjustments (creation of symlinks, creation 15845 of entries in a database, etc.) are necessary so that the script can be run at 15846 boot-time. [2] 15847 15848 In the init.d file, information about the shell script shall be delimited by 15849 the lines "### BEGIN INIT INFO" and "### END INIT INFO". These delimiter lines 15850 may containg trailing whitespace, which shall be ignored. Inside this block 15851 there shall be lines of the form "# {keyword}: [arg1] [arg2] ...". (All lines 15852 inside this block start with a hash ('#') character in the first column, so 15853 that shell treats them as comments.) There shall be exactly one space character 15854 between "#" and the keyword.[3] The following keywords, with their arguments 15855 are defined in this specification: 15856 15857 # Provides: boot_facility_1 [ boot_facility_2 ...] 15858 # Required-Start: boot_facility_1 [ boot_facility_2 ...] 15859 # Required-Stop: boot_facility_1 [ boot_facility_2 ...] 15860 # Should-Start: boot_facility_1 [ boot_facility_2 ...] 15861 # Should-Stop: boot_facility_1 [ boot_facility_2 ...] 15862 # Default-Start: run_level_1 [ run_level_2 ...] 15863 # Default-Stop: run_level_1 [ run_level_2 ...] 15864 # Short-Description: short_description 15865 # Description: multiline_description 15866 15867 Additional keywords may be defined in future LSB specifications. Distributions 15868 may define local extensions by using the prefix "X-[distribution name]" --- for 15869 example, "X-RedHat-foobardecl", or "X-Debian-xyzzydecl". 15870 15871 An init.d shell script may declare using the "Required-Start: " header that it 15872 shall not be run until certain boot facilities are provided. This information 15873 is used by the installation tool or the boot-time boot-script execution 15874 facility to assure that init scripts are run in the correct order. When an init 15875 script is run with a "start" argument, the boot facility or facilities 15876 specified in the "Provides" header shall be considered present, and hence init 15877 scripts which require those boot facilities would then be eligble to be run. 15878 When an init script is run with a "stop" argument, the boot facilities 15879 specified in the "Provides" header are considered no longer present. There are 15880 naming conventions for boot facilities and system facilities, as described in a 15881 following section. 15882 15883 Similarly, the "Required-Stop:" header defines which facilities shall still be 15884 available during the shutdown of that service. Hence, the init script system 15885 should avoid stopping shell scripts which provide those facilities until this 15886 shell script is stopped. 15887 15888 The "Should-Start:" header defines which facilities if present should be 15889 started before this service. This allows for weak dependencies which do not 15890 cause the service to fail if a facility is not available. But may cause reduced 15891 functionality of the service. Compliant applications should not rely on the 15892 existence of this feature. 15893 15894 The "Should-Stop:" header defines which facilities should be still available 15895 during the shutdown of that service. 15896 15897 The "Default-Start" and "Default-Stop" headers define which run levels should 15898 by default run the script with a start or stop argument, respectively, to start 15899 or stop the services controlled by the init script. [4] 15900 15901 The "Short-Description" and "Description" header fields are used to provide 15902 text which describes the actions of the init script. The "short_description" 15903 shall be a relatively short, pithy description of the init script, where as the 15904 "multiline_description" can be a much longer piece of text that may span 15905 mulitple lines. In a multiline description, each continuation line shall begin 15906 with a '#' followed by tab character or a '#' followed by at least two space 15907 characters. The multiline description is terminated by the first line that does 15908 not match this criteria. 15909 15910 The comment conventions described in this session are only required for use by 15911 LSB-compliant applications; system init scripts as provided by LSB-compliant 15912 run-time environments are not required to use the scheme outlined here. 15913 15914 ------------------------------------------------------------------------------- 15915 15916 Installation and Removal of init.d Files 15917 15918 An init.d file is installed in /etc/init.d (which may be a symlink to another 15919 location). This can be done by the package installer. See Script Names>. During 15920 the package's postinstall script, the program "/usr/lib/lsb/install_initd" 15921 configures the distribution's boot script system to call the package's init.d 15922 file at the appropriate time. [5] 15923 15924 The install_initd program takes a single argument, the pathname to the /etc/ 15925 init.d file. For example: 15926 15927 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 15928 15929 The install_initd program shall return an exit status of zero if the init.d 15930 file has been successfully installed or if the the init.d file was already 15931 installed. If the required boot facilities cannot be fulfilled an exit status 15932 of one shall be returned and the init.d file shall not be installed. 15933 15934 When a software package is removed, the package's preuninstall script shall 15935 call /usr/lib/lsb/remove_initd and pass the pathname to the /etc/init.d file. 15936 The package manager is still responsible for removing the /etc/init.d file; the 15937 remove_initd program is provided in case the distribution needs to clean up any 15938 other modifications in the distribution's boot script system that might have 15939 been made by the install_initd program. For example: 15940 15941 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 15942 15943 The remove_initd program shall return an exit status of zero if the init.d file 15944 has been successfully removed or if the the init.d file is not installed. If 15945 another init.d file which depends on a boot facility provided by this init.d 15946 file is installed, an exit status of one shall be returned and the init.d file 15947 shall remained installed. 15948 15949 There should be a tool available to the user (e.g., RedHat's chkconfig) which 15950 can be used by the system administrator to easily manipulate at which init 15951 levels a particular init.d script is started or stopped. This specification 15952 currently does not specify such an interface, however. 15953 15954 ------------------------------------------------------------------------------- 15955 15956 Run Levels 15957 15958 The following run levels are specified for use by the "Default-Start:" and 15959 "Default-Stop:" specifiers as defined by the section Comment Conventions for 15960 Init Scripts>. Many LSB run-time environments commonly use these run level 15961 definitions, and in the absence of other considerations, providers of run-time 15962 environments are strongly encouraged to follow this convention to provide 15963 consistency for system administrators who need to work with multiple 15964 distributions. However, it is not required that LSB-compliant run-time 15965 environments use these run levels; the distribution-provided install_initd 15966 script may map the run levels specified below to whatever 15967 distribution-specified run levels are most appropriate. 15968 15969 0 halt 15970 1 single user mode 15971 2 multiuser with no network services exported 15972 3 normal/full multiuser 15973 4 reserved for local use, default is normal/full multiuser 15974 5 multiuser with xdm or equivalent 15975 6 reboot 15976 15977 ------------------------------------------------------------------------------- 15978 15979 Facility Names 15980 15981 Boot facilities are used to indicate dependencies in init scripts, as defined 15982 in a previous section. Facility names that begin with a dollar sign ('$') are 15983 system facility names, defined by the LSB, and SHALL be provided by 15984 distributions. [6] LSB applications shall not provide facilities that begin 15985 with a dollar sign. This document defines the following facility names: 15986 15987 $local_fs all local filesystems are mounted 15988 $network low level networking (ethernet card; may imply PCMCIA running) 15989 $named daemons which may provide hostname resolution (if present) are 15990 running[7] 15991 $portmap daemons providing SunRPC/ONCRPC portmapping service[8] (if present) 15992 are running 15993 $remote_fs all remote filesystems are mounted[9]. 15994 $syslog system logger is operational 15995 $time the system time has been set [10] 15996 15997 Other (non-system) facilities may be defined by other LSB applications. These 15998 facilities shall be named using the same conventions defined for naming init.d 15999 script names. Commonly, the facility provided by an LSB application init.d 16000 script will have the same name as the name assigned to the init.d script. 16001 16002 ------------------------------------------------------------------------------- 16003 16004 Script Names 16005 16006 Since the init.d scripts shall live in a single directory, they shall come from 16007 a single namespace. Three means of assigning names from this namespace are 16008 available: 16009 16010 * Assigned namespace. This namespace consists of names which only use the 16011 character set [a-z0-9]. This space is desirable for scripts which system 16012 administrators may often wish to run manually: e.g., "/etc/init.d/named 16013 restart" In order to avoid conflicts these init.d names shall be reserved 16014 through the Linux Assigned Names and Numbers Authority (LANANA). 16015 Information about the LANANA may be found at www.lanana.org. 16016 16017 Commonly used names shall be reserved in advance; developers for projects 16018 should be encouraged to reserve names from LANANA, so that each 16019 distribution can use the same name, and to avoid conflicts with other 16020 projects. 16021 16022 * Hierarchical namespace. This namespace consists of scripts names which look 16023 like this: [hier1]-[hier2]-...-[name], where name is again taken the 16024 character set [a-z0-9], and where there may be one or more [hier-n] 16025 components. [hier1] may either be an LSB provider name assigned by the 16026 LANANA, or it may be owners' DNS name in lower case, with at least one '.' 16027 (e.g., "debian.org", "staroffice.sun.com"). The LSB provider name assigned 16028 by LANANA shall only consist of the ASCII characters [a-z0-9]. 16029 16030 * Reserved namespace. This namespace consists of script names which begin 16031 with the character '_', and is reserved for distribution use only. This 16032 namespace should be used for core packages only, and in general use of this 16033 namespace is highly discouraged. 16034 16035 In general, if a package or some system function is likely to be used on 16036 multiple systems, the package developers or the distribution SHOULD get a 16037 registered name through LANANA, and distributions should strive to use the same 16038 name whenever possible. For applications which may not be "core" or may not be 16039 commonly installed, the hierarchical namespace may be more appropriate. An 16040 advantage to the hierarchical namespace is that there is no need to consult 16041 with the LANANA before obtaining an assigned name. 16042 16043 Short names are highly desirable, since many system administrators like to use 16044 them to manually start and stop services. Given this, they should be 16045 standardized on a per-package basis. This is the rationale behind having a 16046 LANANA organization to assign these names. The LANANA may be called upon to 16047 handle other namespace issues, such as package/prerequisites naming (which is 16048 essential to making prerequisites to work correctly). 16049 16050 ------------------------------------------------------------------------------- 16051 16052 Init Script Functions 16053 16054 Each LSB-compliant init.d script shall source the file /lib/lsb/init-functions. 16055 This file shall cause the following shell script commands to be defined. This 16056 can be done either by adding a directory to the PATH variable which defines 16057 these commands, or by defining sh aliases. While the distribution-provided 16058 aliases may choose to use shell extensions (at the distribution's option), the 16059 LSB init.d files themselves should only depend in shell features as defined by 16060 the LSB. 16061 16062 The start_daemon, killproc and pidofproc functions shall use this algorithm for 16063 determining the status and the pid(s) of the specified program. They shall read 16064 the pidfile specified or otherwise /var/run/basename.pid and use the pid(s) 16065 herein when determining whether a program is running. The method used to 16066 determine the status is implementation defined, but should allow for non-binary 16067 programs. [11] Compliant implementations may use other mechanisms besides those 16068 based on pidfiles, unless the -p pidfile option has been used. Compliant 16069 applications should not rely on such mechanisms and should always use a 16070 pidfile. When a program is stopped, it should delete its pidfile. Multiple pid 16071 (s) shall be separated by a single space in the pidfile and in the output of 16072 pidofproc. 16073 16074 This runs the specified program as a daemon. start_daemon shall 16075 start_daemon check if the program is already running using the algorithm 16076 [-f] [-n given above. If so, it shall not start another copy of the 16077 nicelevel] [-p daemon unless the -f option is given. The -n option specifies a 16078 pidfile] nice level. See nice(1). start_daemon should return the LSB 16079 pathname [args] defined exit status codes. It shall return 0 if the program has 16080 been successfully started or is running and not 0 otherwise. 16081 This stops the specified program. The program is found using 16082 the algorithm given above. If a signal is specified, using the 16083 -signal_name or -signal_number syntaxes as specified by the 16084 kill command, the program is sent that signal. Otherwise, a 16085 killproc [-p SIGTERM followed by a SIGKILL after some number of seconds 16086 pidfile] shall be sent. If a program has been terminated, the pidfile 16087 pathname should be removed if the terminated process has not already 16088 [signal] done so. Compliant applications may use the basename instead of 16089 the pathname. killproc should return the LSB defined exit 16090 status codes. If called without a signal, it shall return 0 if 16091 the program has been stopped or is not running and not 0 16092 otherwise. If a signal is given, it shall return 0 only if the 16093 program is running. 16094 This function returns one or more pid(s) for a particular 16095 pidofproc [-p daemon using the algorithm given above. Only pids of running 16096 pidfile] processes should be returned. Compliant applications may use 16097 pathname the basename instead of the pathname. pidofproc should return 16098 the LSB defined exit status codes for "status". It shall return 16099 0 if the program is running and not 0 otherwise. 16100 log_success_msg This requests the distribution to print a success message. The 16101 "message" message should be relatively short; no more than 60 characters 16102 is highly desirable. 16103 log_failure_msg This requests the distribution to print a failure message. The 16104 "message" message should be relatively short; no more than 60 characters 16105 is highly desirable. 16106 log_warning_msg This requests the distribution to print a warning message. The 16107 "message" message should be relatively short; no more than 60 characters 16108 is highly desirable. 16109 16110 VII. Users & Groups 16111 16112 Table of Contents 16113 15. Users & Groups 16114 16115 ------------------------------------------------------------------------------- 16116 16117 Chapter 15. Users & Groups 16118 16119 User and Group Database 16120 16121 The format of the User and Group databases is not specified. Programs may only 16122 read these databases using the provided API. Changes to these databases should 16123 be made using the provided commands. 16124 16125 ------------------------------------------------------------------------------- 16126 16127 User & Group Names 16128 16129 Below is a table of required mnemonic user and group names. This specification 16130 makes no attempt to numerically assign uid or gid numbers. The exception is the 16131 uid and gid for "root" which are equal to 0. 16132 16133 Table 15-1. Required User & Group Names 16134 16135 +-----------------------------------------------------------------------------+ 16136 |User |Group |Comments | 16137 |---------+---------+---------------------------------------------------------| 16138 |root |root |Administrative user with all appropriate privileges | 16139 |---------+---------+---------------------------------------------------------| 16140 |bin |bin |Legacy UID/GID[a] | 16141 |---------+---------+---------------------------------------------------------| 16142 |daemon |daemon |Legacy UID/GID[b] | 16143 |-----------------------------------------------------------------------------| 16144 |Notes: | 16145 |a. The 'bin' UID/GID is included for compatibility with legacy applications. | 16146 |New applications should no longer use the 'bin' UID/GID. | 16147 |b. The 'daemon' UID/GID was used as an unprivileged UID/GID for daemons to | 16148 |execute under in order to limit their access to the system. Generally daemons| 16149 |should now run under individual UID/GIDs in order to further partition | 16150 |daemons from one another. | 16151 +-----------------------------------------------------------------------------+ 16152 16153 Below is a table of optional mnemonic user and group names. This specification 16154 makes no attempt to numerically assign uid or gid numbers. If the username 16155 exists on a system, then they should be in the suggested corresponding group. 16156 These user and group names are for use by distributions, not by applications. 16157 16158 Table 15-2. Optional User & Group Names 16159 16160 +---------------------------------------------------+ 16161 |User |Group |Comments | 16162 |--------+--------+---------------------------------| 16163 |adm |adm |Administrative special privileges| 16164 |--------+--------+---------------------------------| 16165 |lp |lp |Printer special privileges | 16166 |--------+--------+---------------------------------| 16167 |sync |sync |Login to sync the system | 16168 |--------+--------+---------------------------------| 16169 |shutdown|shutdown|Login to shutdown the system | 16170 |--------+--------+---------------------------------| 16171 |halt |halt |Login to halt the system | 16172 |--------+--------+---------------------------------| 16173 |mail |mail |Mail special privileges | 16174 |--------+--------+---------------------------------| 16175 |news |news |News special privileges | 16176 |--------+--------+---------------------------------| 16177 |uucp |uucp |UUCP special privileges | 16178 |--------+--------+---------------------------------| 16179 |operator|root |Operator special privileges | 16180 |--------+--------+---------------------------------| 16181 |man |man |Man special privileges | 16182 |--------+--------+---------------------------------| 16183 |nobody |nobody |Used by NFS | 16184 +---------------------------------------------------+ 16185 16186 The differences in numeric values of the uids and gids between systems on a 16187 network can be reconciled via NIS, rdist(1), rsync(1), or ugidd(8). Only a 16188 minimum working set of "user names" and their corresponding "user groups" are 16189 required. Applications cannot assume non system user or group names will be 16190 defined. 16191 16192 Applications cannot assume any policy for the default umask or the default 16193 directory permissions a user may have. Applications should enforce user only 16194 file permissions on private files such as mailboxes. The location of the users 16195 home directory is also not defined by policy other than the recommendations of 16196 the FHS and shall be obtained by the *pwnam(3) calls. 16197 16198 ------------------------------------------------------------------------------- 16199 16200 UID Ranges 16201 16202 The system UIDs from 0 to 99 should be statically allocated by the system, and 16203 shall not be created by applications. 16204 16205 The system UIDs from 100 to 499 should be reserved for dynamic allocation by 16206 system administrators and post install scripts using useradd(1). 16207 16208 ------------------------------------------------------------------------------- 16209 16210 Rationale 16211 16212 The purpose of specifying optional users and groups is to reduce the potential 16213 for name conflicts between applications and distributions. 16214 16215 ------------------------------------------------------------------------------- 16216 16217 Appendix A. GNU Free Documentation License 16218 16219 Version 1.1, March 2000 16220 16221 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 16222 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute 16223 verbatim copies of this license document, but changing it is not allowed. 16224 16225 ------------------------------------------------------------------------------- 16226 16227 PREAMBLE 16228 16229 The purpose of this License is to make a manual, textbook, or other written 16230 document "free" in the sense of freedom: to assure everyone the effective 16231 freedom to copy and redistribute it, with or without modifying it, either 16232 commercially or noncommercially. Secondarily, this License preserves for the 16233 author and publisher a way to get credit for their work, while not being 16234 considered responsible for modifications made by others. 16235 16236 This License is a kind of "copyleft", which means that derivative works of the 16237 document must themselves be free in the same sense. It complements the GNU 16238 General Public License, which is a copyleft license designed for free software. 16239 16240 We have designed this License in order to use it for manuals for free software, 16241 because free software needs free documentation: a free program should come with 16242 manuals providing the same freedoms that the software does. But this License is 16243 not limited to software manuals; it can be used for any textual work, 16244 regardless of subject matter or whether it is published as a printed book. We 16245 recommend this License principally for works whose purpose is instruction or 16246 reference. 16247 16248 ------------------------------------------------------------------------------- 16249 16250 APPLICABILITY AND DEFINITIONS 16251 16252 This License applies to any manual or other work that contains a notice placed 16253 by the copyright holder saying it can be distributed under the terms of this 16254 License. The "Document", below, refers to any such manual or work. Any member 16255 of the public is a licensee, and is addressed as "you". 16256 16257 A "Modified Version" of the Document means any work containing the Document or 16258 a portion of it, either copied verbatim, or with modifications and/or 16259 translated into another language. 16260 16261 A "Secondary Section" is a named appendix or a front-matter section of the 16262 Document that deals exclusively with the relationship of the publishers or 16263 authors of the Document to the Document's overall subject (or to related 16264 matters) and contains nothing that could fall directly within that overall 16265 subject. (For example, if the Document is in part a textbook of mathematics, a 16266 Secondary Section may not explain any mathematics.) The relationship could be a 16267 matter of historical connection with the subject or with related matters, or of 16268 legal, commercial, philosophical, ethical or political position regarding them. 16269 16270 The "Invariant Sections" are certain Secondary Sections whose titles are 16271 designated, as being those of Invariant Sections, in the notice that says that 16272 the Document is released under this License. 16273 16274 The "Cover Texts" are certain short passages of text that are listed, as 16275 Front-Cover Texts or Back-Cover Texts, in the notice that says that the 16276 Document is released under this License. 16277 16278 A "Transparent" copy of the Document means a machine-readable copy, represented 16279 in a format whose specification is available to the general public, whose 16280 contents can be viewed and edited directly and straightforwardly with generic 16281 text editors or (for images composed of pixels) generic paint programs or (for 16282 drawings) some widely available drawing editor, and that is suitable for input 16283 to text formatters or for automatic translation to a variety of formats 16284 suitable for input to text formatters. A copy made in an otherwise Transparent 16285 file format whose markup has been designed to thwart or discourage subsequent 16286 modification by readers is not Transparent. A copy that is not "Transparent" is 16287 called "Opaque". 16288 16289 Examples of suitable formats for Transparent copies include plain ASCII without 16290 markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly 16291 available DTD, and standard-conforming simple HTML designed for human 16292 modification. Opaque formats include PostScript, PDF, proprietary formats that 16293 can be read and edited only by proprietary word processors, SGML or XML for 16294 which the DTD and/or processing tools are not generally available, and the 16295 machine-generated HTML produced by some word processors for output purposes 16296 only. 16297 16298 The "Title Page" means, for a printed book, the title page itself, plus such 16299 following pages as are needed to hold, legibly, the material this License 16300 requires to appear in the title page. For works in formats which do not have 16301 any title page as such, "Title Page" means the text near the most prominent 16302 appearance of the work's title, preceding the beginning of the body of the 16303 text. 16304 16305 ------------------------------------------------------------------------------- 16306 16307 VERBATIM COPYING 16308 16309 You may copy and distribute the Document in any medium, either commercially or 16310 noncommercially, provided that this License, the copyright notices, and the 16311 license notice saying this License applies to the Document are reproduced in 16312 all copies, and that you add no other conditions whatsoever to those of this 16313 License. You may not use technical measures to obstruct or control the reading 16314 or further copying of the copies you make or distribute. However, you may 16315 accept compensation in exchange for copies. If you distribute a large enough 16316 number of copies you must also follow the conditions in section 3. 16317 16318 You may also lend copies, under the same conditions stated above, and you may 16319 publicly display copies. 16320 16321 ------------------------------------------------------------------------------- 16322 16323 COPYING IN QUANTITY 16324 16325 If you publish printed copies of the Document numbering more than 100, and the 16326 Document's license notice requires Cover Texts, you must enclose the copies in 16327 covers that carry, clearly and legibly, all these Cover Texts: Front-Cover 16328 Texts on the front cover, and Back-Cover Texts on the back cover. Both covers 16329 must also clearly and legibly identify you as the publisher of these copies. 16330 The front cover must present the full title with all words of the title equally 16331 prominent and visible. You may add other material on the covers in addition. 16332 Copying with changes limited to the covers, as long as they preserve the title 16333 of the Document and satisfy these conditions, can be treated as verbatim 16334 copying in other respects. 16335 16336 If the required texts for either cover are too voluminous to fit legibly, you 16337 should put the first ones listed (as many as fit reasonably) on the actual 16338 cover, and continue the rest onto adjacent pages. 16339 16340 If you publish or distribute Opaque copies of the Document numbering more than 16341 100, you must either include a machine-readable Transparent copy along with 16342 each Opaque copy, or state in or with each Opaque copy a publicly-accessible 16343 computer-network location containing a complete Transparent copy of the 16344 Document, free of added material, which the general network-using public has 16345 access to download anonymously at no charge using public-standard network 16346 protocols. If you use the latter option, you must take reasonably prudent 16347 steps, when you begin distribution of Opaque copies in quantity, to ensure that 16348 this Transparent copy will remain thus accessible at the stated location until 16349 at least one year after the last time you distribute an Opaque copy (directly 16350 or through your agents or retailers) of that edition to the public. 16351 16352 It is requested, but not required, that you contact the authors of the Document 16353 well before redistributing any large number of copies, to give them a chance to 16354 provide you with an updated version of the Document. 16355 16356 ------------------------------------------------------------------------------- 16357 16358 MODIFICATIONS 16359 16360 You may copy and distribute a Modified Version of the Document under the 16361 conditions of sections 2 and 3 above, provided that you release the Modified 16362 Version under precisely this License, with the Modified Version filling the 16363 role of the Document, thus licensing distribution and modification of the 16364 Modified Version to whoever possesses a copy of it. In addition, you must do 16365 these things in the Modified Version: 16366 16367 A. Use in the Title Page (and on the covers, if any) a title distinct from 16368 that of the Document, and from those of previous versions (which should, if 16369 there were any, be listed in the History section of the Document). You may 16370 use the same title as a previous version if the original publisher of that 16371 version gives permission. 16372 16373 B. List on the Title Page, as authors, one or more persons or entities 16374 responsible for authorship of the modifications in the Modified Version, 16375 together with at least five of the principal authors of the Document (all 16376 of its principal authors, if it has less than five). 16377 16378 C. State on the Title page the name of the publisher of the Modified Version, 16379 as the publisher. 16380 16381 D. Preserve all the copyright notices of the Document. 16382 16383 E. Add an appropriate copyright notice for your modifications adjacent to the 16384 other copyright notices. 16385 16386 F. Include, immediately after the copyright notices, a license notice giving 16387 the public permission to use the Modified Version under the terms of this 16388 License, in the form shown in the Addendum below. 16389 16390 G. Preserve in that license notice the full lists of Invariant Sections and 16391 required Cover Texts given in the Document's license notice. 16392 16393 H. Include an unaltered copy of this License. 16394 16395 I. Preserve the section entitled "History", and its title, and add to it an 16396 item stating at least the title, year, new authors, and publisher of the 16397 Modified Version as given on the Title Page. If there is no section 16398 entitled "History" in the Document, create one stating the title, year, 16399 authors, and publisher of the Document as given on its Title Page, then add 16400 an item describing the Modified Version as stated in the previous sentence. 16401 16402 J. Preserve the network location, if any, given in the Document for public 16403 access to a Transparent copy of the Document, and likewise the network 16404 locations given in the Document for previous versions it was based on. 16405 These may be placed in the "History" section. You may omit a network 16406 location for a work that was published at least four years before the 16407 Document itself, or if the original publisher of the version it refers to 16408 gives permission. 16409 16410 K. In any section entitled "Acknowledgements" or "Dedications", preserve the 16411 section's title, and preserve in the section all the substance and tone of 16412 each of the contributor acknowledgements and/or dedications given therein. 16413 16414 L. Preserve all the Invariant Sections of the Document, unaltered in their 16415 text and in their titles. Section numbers or the equivalent are not 16416 considered part of the section titles. 16417 16418 M. Delete any section entitled "Endorsements". Such a section may not be 16419 included in the Modified Version. 16420 16421 N. Do not retitle any existing section as "Endorsements" or to conflict in 16422 title with any Invariant Section. 16423 16424 If the Modified Version includes new front-matter sections or appendices that 16425 qualify as Secondary Sections and contain no material copied from the Document, 16426 you may at your option designate some or all of these sections as invariant. To 16427 do this, add their titles to the list of Invariant Sections in the Modified 16428 Version's license notice. These titles must be distinct from any other section 16429 titles. 16430 16431 You may add a section entitled "Endorsements", provided it contains nothing but 16432 endorsements of your Modified Version by various parties--for example, 16433 statements of peer review or that the text has been approved by an organization 16434 as the authoritative definition of a standard. 16435 16436 You may add a passage of up to five words as a Front-Cover Text, and a passage 16437 of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts 16438 in the Modified Version. Only one passage of Front-Cover Text and one of 16439 Back-Cover Text may be added by (or through arrangements made by) any one 16440 entity. If the Document already includes a cover text for the same cover, 16441 previously added by you or by arrangement made by the same entity you are 16442 acting on behalf of, you may not add another; but you may replace the old one, 16443 on explicit permission from the previous publisher that added the old one. 16444 16445 The author(s) and publisher(s) of the Document do not by this License give 16446 permission to use their names for publicity for or to assert or imply 16447 endorsement of any Modified Version. 16448 16449 ------------------------------------------------------------------------------- 16450 16451 COMBINING DOCUMENTS 16452 16453 You may combine the Document with other documents released under this License, 16454 under the terms defined in section 4 above for modified versions, provided that 16455 you include in the combination all of the Invariant Sections of all of the 16456 original documents, unmodified, and list them all as Invariant Sections of your 16457 combined work in its license notice. 16458 16459 The combined work need only contain one copy of this License, and multiple 16460 identical Invariant Sections may be replaced with a single copy. If there are 16461 multiple Invariant Sections with the same name but different contents, make the 16462 title of each such section unique by adding at the end of it, in parentheses, 16463 the name of the original author or publisher of that section if known, or else 16464 a unique number. Make the same adjustment to the section titles in the list of 16465 Invariant Sections in the license notice of the combined work. 16466 16467 In the combination, you must combine any sections entitled "History" in the 16468 various original documents, forming one section entitled "History"; likewise 16469 combine any sections entitled "Acknowledgements", and any sections entitled 16470 "Dedications". You must delete all sections entitled "Endorsements." 16471 16472 ------------------------------------------------------------------------------- 16473 16474 COLLECTIONS OF DOCUMENTS 16475 16476 You may make a collection consisting of the Document and other documents 16477 released under this License, and replace the individual copies of this License 16478 in the various documents with a single copy that is included in the collection, 16479 provided that you follow the rules of this License for verbatim copying of each 16480 of the documents in all other respects. 16481 16482 You may extract a single document from such a collection, and distribute it 16483 individually under this License, provided you insert a copy of this License 16484 into the extracted document, and follow this License in all other respects 16485 regarding verbatim copying of that document. 16486 16487 ------------------------------------------------------------------------------- 16488 16489 AGGREGATION WITH INDEPENDENT WORKS 16490 16491 A compilation of the Document or its derivatives with other separate and 16492 independent documents or works, in or on a volume of a storage or distribution 16493 medium, does not as a whole count as a Modified Version of the Document, 16494 provided no compilation copyright is claimed for the compilation. Such a 16495 compilation is called an "aggregate", and this License does not apply to the 16496 other self-contained works thus compiled with the Document, on account of their 16497 being thus compiled, if they are not themselves derivative works of the 16498 Document. 16499 16500 If the Cover Text requirement of section 3 is applicable to these copies of the 16501 Document, then if the Document is less than one quarter of the entire 16502 aggregate, the Document's Cover Texts may be placed on covers that surround 16503 only the Document within the aggregate. Otherwise they must appear on covers 16504 around the whole aggregate. 16505 16506 ------------------------------------------------------------------------------- 16507 16508 TRANSLATION 16509 16510 Translation is considered a kind of modification, so you may distribute 16511 translations of the Document under the terms of section 4. Replacing Invariant 16512 Sections with translations requires special permission from their copyright 16513 holders, but you may include translations of some or all Invariant Sections in 16514 addition to the original versions of these Invariant Sections. You may include 16515 a translation of this License provided that you also include the original 16516 English version of this License. In case of a disagreement between the 16517 translation and the original English version of this License, the original 16518 English version will prevail. 16519 16520 ------------------------------------------------------------------------------- 16521 16522 TERMINATION 16523 16524 You may not copy, modify, sublicense, or distribute the Document except as 16525 expressly provided for under this License. Any other attempt to copy, modify, 16526 sublicense or distribute the Document is void, and will automatically terminate 16527 your rights under this License. However, parties who have received copies, or 16528 rights, from you under this License will not have their licenses terminated so 16529 long as such parties remain in full compliance. 16530 16531 ------------------------------------------------------------------------------- 16532 16533 FUTURE REVISIONS OF THIS LICENSE 16534 16535 The Free Software Foundation may publish new, revised versions of the GNU Free 16536 Documentation License from time to time. Such new versions will be similar in 16537 spirit to the present version, but may differ in detail to address new problems 16538 or concerns. See http://www.gnu.org/copyleft/. 16539 16540 Each version of the License is given a distinguishing version number. If the 16541 Document specifies that a particular numbered version of this License "or any 16542 later version" applies to it, you have the option of following the terms and 16543 conditions either of that specified version or of any later version that has 16544 been published (not as a draft) by the Free Software Foundation. If the 16545 Document does not specify a version number of this License, you may choose any 16546 version ever published (not as a draft) by the Free Software Foundation. 16547 16548 ------------------------------------------------------------------------------- 16549 16550 How to use this License for your documents 16551 16552 To use this License in a document you have written, include a copy of the 16553 License in the document and put the following copyright and license notices 16554 just after the title page: 16555 16556 Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and 16557 /or modify this document under the terms of the GNU Free Documentation 16558 License, Version 1.1 or any later version published by the Free Software 16559 Foundation; with the Invariant Sections being LIST THEIR TITLES, with the 16560 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A 16561 copy of the license is included in the section entitled "GNU Free 16562 Documentation License". 16563 16564 If you have no Invariant Sections, write "with no Invariant Sections" instead 16565 of saying which ones are invariant. If you have no Front-Cover Texts, write "no 16566 Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for 16567 Back-Cover Texts. 16568 16569 If your document contains nontrivial examples of program code, we recommend 16570 releasing these examples in parallel under your choice of free software 16571 license, such as the GNU General Public License, to permit their use in free 16572 software. 16573 16574 Notes 16575 16576 [1] Future versions of this specification might define additional service 16577 names. 16578 16579 [2] This specification does not require, but is designed to allow, the 16580 development of a system which runs boot scripts in parallel. Hence, 16581 enforced-serialization of scripts is avoided unless it is explicitly 16582 necessary. 16583 16584 [3] More than one space, or a tab character, indicates the continuation line. 16585 16586 [4] For example, if you want a service to run in runlevels 3, 4, and 5 (only), 16587 specify "Default-Start: 3 4 5" and "Default-Stop: 0 1 2 6". 16588 16589 [5] For example, install_initd might create symbolic links in /etc/rc2.d and 16590 other such directories which point to the files in /etc/init.d (or it 16591 might update a database, or some other mechanism). The init.d files 16592 themselves should already be in /etc/init.d before running install_initd. 16593 16594 [6] The dollar sign does not indicate variable expansion as in many Linux 16595 utilities. Starting a facility name with a dollar sign is merely a way of 16596 dividing the namespace between the system and applications. 16597 16598 [7] For example, daemons to query DNS, NIS+, or LDAP 16599 16600 [8] as defined in RFC 1833 16601 16602 [9] In some LSB run-time environments, filesystems such as /usr may be remote. 16603 Many applications that require $local_fs will probably require also 16604 require $remote_fs 16605 16606 [10] i.e., using a network-based time program such as ntp or rdate, or via the 16607 hardware Real Time Clock 16608 16609 [11] This note is only informative. Commonly used methods check either for the 16610 existence of the /proc/pid directory or use /proc/pid/exe and /proc/pid/ 16611 cmdline. Relying only on /proc/pid/exe is discouraged since this results 16612 in a not-running status for daemons that are written in a script language. 16613